2009-10-21 Gonzalo Paniagua Javier <gonzalo@novell.com>
[mono.git] / mono / metadata / ChangeLog
1 2009-10-21  Mark Probst  <mark.probst@gmail.com>
2
3         * sgen-gc.c: Make managed write barriers atomic via
4         thread-restarts.
5
6 2009-10-21  Rodrigo Kumpera  <rkumpera@novell.com>
7
8         * verify.c (verify_delegate_compatibility): Properly verify delegate creation of static
9         methods. Fixes #543021.
10
11 2009-10-21 Gonzalo Paniagua Javier <gonzalo@novell.com>
12
13         * socket-io.[ch]: fix VS build.
14
15 2009-10-21 Gonzalo Paniagua Javier <gonzalo@novell.com>
16
17         * icall-def.h:
18         * socket-io.[ch]: implemented SendFile.
19
20 2009-10-20  Zoltan Varga  <vargaz@gmail.com>
21
22         * class.c (mono_class_create_from_typedef): Initialize class->element_class
23         before the interfaces to avoid crashes later if class initialization fails.
24         Fixes #548417.
25
26         * marshal.c (emit_marshal_vtype): Implement byref marshalling of DateTime.
27         Fixes #548276.
28
29 2009-10-20  Marek Safar  <marek.safar@gmail.com>
30
31         * domain.c: Bump 4.0 version.
32
33 2009-10-19  Sebastien Pouliot  <sebastien@ximian.com>
34
35         * assembly.c (mono_assembly_load_reference): Fix leak when 'status'
36         code is known. (parse_public_key) Remove duplicate (unneeded) NULL
37         check since 'pubkey' can't be NULL at this stage
38         * icall.c (ves_icall_System_Array_FastCopy): Add comment about
39         the check. (ves_icall_Type_GetInterfaceMapData) Remove duplicate
40         initialization of 'iter'
41
42 2009-10-16  Bill Holmes  <billholmes54@gmail.com>
43
44         * cominterop.c : Search the interface parts of vtable to find 
45           method matches.  Fixes 547030.
46
47         Code is contributed under MIT/X11 license.
48
49 2009-10-15 Gonzalo Paniagua Javier <gonzalo@novell.com>
50
51         * marshal.c: BeginInvoke cannot be called on multicast delegates with
52         multiple targets. Fixes bug #574426.
53
54 2009-10-14  Massimiliano Mantione  <massi@ximian.com>
55
56         * profiler.h: Put here the definition of
57         MONO_PROFILER_MAX_STAT_CALL_CHAIN_DEPTH
58         (and fix the build...).
59
60 2009-10-14  Massimiliano Mantione  <massi@ximian.com>
61
62         * profiler.c, profiler.h, profiler-private.h:
63         Added support for different ways of getting call chains in stat mode.
64
65 2009-10-12  Mark Probst  <mark.probst@gmail.com>
66
67         * object.c, object-internals.h: New function for computing the
68         size of an array, factored out of mono_array_new_full().  Use
69         SGen's functions for allocating arrays and vectors.
70
71         * sgen-gc.c, gc-internal.h: Special functions for allocating
72         arrays and vectors without race conditions.  A managed array
73         allocator method.
74
75         * boehm-gc.c, null-gc.c: Don't provide a managed array allocator.
76
77 2009-10-12  Mark Probst  <mark.probst@gmail.com>
78
79         * object.c, object.h, icall.c: Write barriers do the copying now,
80         as well, so no need for an additional memcpy.
81
82         * sgen-gc.c: Lock when storing remsets.  Do the memory
83         copying/moving in the write barriers.
84
85         * null-gc.c, boehm-gc.c: Write barriers must copy here, too.
86
87         * reflection.c: Added an assert.
88
89 2009-10-12  Mark Probst  <mark.probst@gmail.com>
90
91         * threads.c, process.c: A few missing write barriers.
92
93 2009-10-12  Joel W. Reed <joelwreed@gmail.com>
94
95         * mono-perfcounters.c, mono-perfcounters-def.h: Add
96         network performance counters for bytes sent per second, bytes
97         received per second, and bytes total per second.
98
99         Code is contributed under MIT/X11 license.
100
101 2009-10-09  Mark Probst  <mark.probst@gmail.com>
102
103         * threads.c (ves_icall_System_Threading_Thread_GetAbortExceptionState):
104         Fix warning.
105
106 2009-10-09  Mark Probst  <mark.probst@gmail.com>
107
108         * threads.c, object-internals.h, object.c: Move code for
109         transferring an object to a different domain (via
110         serialization/remoting) to object.c.
111
112         * object.c (call_unhandled_exception_delegate): If the exception
113         is in a different domain than the delegate, transfer the exception
114         to that domain.
115
116 2009-10-07  Zoltan Varga  <vargaz@gmail.com>
117
118         * marshal.c (emit_marshal_vtype): Emit marshalling of DateTime to OLE DATE.
119         Fixes #322934.
120
121 2009-10-06  Zoltan Varga  <vargaz@gmail.com>
122
123         * domain.c (DEFAULT_RUNTIME_VERSION): Change this to v2.0.
124
125 2009-10-06  Mark Probst  <mark.probst@gmail.com>
126
127         * object.c (mono_method_return_message_restore): Handle the case
128         where the argument is an instance of a generic type.  Fixes
129         #544446.
130
131 2009-10-06  Mark Probst  <mark.probst@gmail.com>
132
133         * object.c (set_value): Write barrier fix - we must pass the
134         count, not the size.
135
136 2009-10-05  Zoltan Varga  <vargaz@gmail.com>
137
138         * domain.c (mono_init_internal): Print a useful error message when encountering
139         an old mscorlib, instead of crashing. Fixes #544307.
140
141 2009-10-04  Zoltan Varga  <vargaz@gmail.com>
142
143         * appdomain.c (copy_app_domain_setup): Fix a warning.
144
145         * debug-helpers.c (dis_one): Ditto.
146
147 2009-10-04  Mark Probst  <mark.probst@gmail.com>
148
149         * domain-internals.h, appdomain.c: The AppDomainSetup is copied
150         into the new domain, instead of referencing the original one.
151
152         * marshal.c, marshal.h: Make mono_marshal_xdomain_copy_value()
153         non-static.
154
155         * appdomain.c: Corlib version bump.
156
157 2009-10-02 Gonzalo Paniagua Javier <gonzalo@novell.com>
158
159         * threadpool.c: one more...
160
161 2009-10-02 Gonzalo Paniagua Javier <gonzalo@novell.com>
162
163         * threadpool.c: forgot a LeaveCriticalSection when telling the idle
164         threads to die because we're shutting down. delgate5.exe works again.
165
166 2009-10-01  Bill Holmes  <billholmes54@gmail.com>
167
168         * cominterop.c (mono_marshal_free_ccw_entry): Updating the
169           ccw_interface_hash table when a ccw is finalized.
170
171         Code is contributed under MIT/X11 license.
172
173 2009-09-30  Mark Probst  <mark.probst@gmail.com>
174
175         * assembly.c, domain.c, image.c, metadata-internals.h: Split
176         domain and image unloading into two steps.  We must do this
177         because clearing the domain in SGen requires the class metadata to
178         be intact, but we need to free the mono_g_hash_tables in case a
179         collection occurs during domain unloading and the roots would trip
180         up the GC.
181
182 2009-09-30  Mark Probst  <mark.probst@gmail.com>
183
184         * object-internals.h: Remove serialized culture fields from
185         MonoInternalThread.
186
187         * icall-def.h, thread-types.h, threads.c: Remove serialized
188         culture icalls.
189
190         * appdomain.c: Corlib version bump.
191
192 2009-09-30  Zoltan Varga  <vargaz@gmail.com>
193
194         * marshal.c (emit_marshal_object): Emit out marshalling of stringbuilders.
195         Fixes #543133.
196
197 2009-09-30  Mark Probst  <mark.probst@gmail.com>
198
199         * sgen-gc.c: Try to shorten the new section after a major
200         allocation to avoid ever-growing sections.
201
202 2009-10-13  Martin Baulig  <martin@ximian.com>
203
204         * mono-debug-debugger.h (MonoDebuggerEvent): Renamed
205         `MONO_DEBUGGER_EVENT_TRAMPOLINE' into
206         `MONO_DEBUGGER_EVENT_OLD_TRAMPOLINE' and added a new
207         `MONO_DEBUGGER_EVENT_TRAMPOLINE'.
208
209         * mono-debug.h (MONO_DEBUGGER_MINOR_VERSION): Bump to 4.
210
211 2009-09-29 Gonzalo Paniagua Javier <gonzalo@novell.com>
212
213         * threadpool.c: fixed the order in which 'completed' and the wait
214         handle, if any, are set.  Fixes bug #542933 and delegate2.exe
215         No need to use the wait_handle field of ASyncCall. Make sure the
216         threadpool is active when adding a job or queueing an idle thread.
217
218 2009-09-29  Zoltan Varga  <vargaz@gmail.com>
219
220         * object.c (mono_unhandled_exception): Fix a crash if there is no main thread.
221
222         * threads.c (build_wait_tids): Fix a crash if there is no main thread, like
223         when using --compile-all.
224
225 2009-09-27  Mark Probst  <mark.probst@gmail.com>
226
227         * metadata.c (free_generic_class): Unregister the field_objects
228         roots if we're using SGen.
229
230 2009-09-27  Mark Probst  <mark.probst@gmail.com>
231
232         * reflection.c (mono_dynamic_image_free): Deregister the GC root
233         for GenericParamTableEntry.gparam.
234
235 2009-09-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
236
237         * marshal.c: don't create the handle when calling. It is created later
238         if needed.
239
240 2009-09-26  Mark Probst  <mark.probst@gmail.com>
241
242         * sgen-gc.c: Warning fixes.
243
244 2009-09-26  Mark Probst  <mark.probst@gmail.com>
245
246         * sgen-gc.c: New debug option "xdomain-checks", which scans the
247         whole heap for cross-domain references before each collection.
248
249         * sgen-scan-object.h: The scan action can now use SCAN to scan the
250         object.
251
252         * threadpool-internals.h, threadpool.c: New function
253         mono_thread_pool_is_queue_array() for checking whether a given
254         array is used as a (cross-domain) queue by the thread pool code.
255
256 2009-09-26  Mark Probst  <mark.probst@gmail.com>
257
258         * sgen-gc.c: New function mono_gc_scan_for_specific_ref() which
259         searches the whole heap for objects containing a specific
260         reference.  Only for debugging.
261
262 2009-09-26  Mark Probst  <mark.probst@gmail.com>
263
264         * appdomain.c (MONO_CORLIB_VERSION): Bumped.
265
266         * icall-def.h, threads.c, threads-types.h: New icalls for copying
267         byte arrays between domains.
268
269 2009-09-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
270
271         * threadpool.c:
272         * class-internals.h:
273         * mono-perfcounters-def.h:
274         * mono-perfcounters.c:
275         -There is a list of idle threads
276         -Each of those idle threads wait on their own WaitHandle instead
277         of all of them using the same semaphore. When a new work item is
278         added, the job is assigned directly to an idle thread or a newly
279         created one if possible and then the handle for that thread is
280         signaled. Compare that to the current approach where all the
281         threads in the pool compete to dequeue a job from the same
282         queue.
283         -New struct ThreadPool that brings together the bunch of static
284         variable for each threadpool (IO and regular).
285         -New performance counters: # of items added and its rate per
286         threadpool. The rate will be used later, perhaps together with
287         other perf. counters, to decide when idle threads should exit.
288
289 2009-09-25  Jonathan Chambers  <joncham@gmail.com>
290
291         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Receive_internal): 
292         Fix typo on Windows build.      
293         (ves_icall_System_Net_Sockets_Socket_Accept_internal): Fix typo on Windows build.
294         
295         Code is contributed under MIT/X11 license.
296
297 2009-09-25  Mark Probst  <mark.probst@gmail.com>
298
299         * object-internals.h: The Thread class is split up into Thread and
300         InternalThread now.  We have exactly one InternalThread per
301         thread, and at most one Thread per appdomain per thread.  Most
302         data is stored in InternalThread.  All InternalThread objects live
303         in the root domain.
304
305         * class-internals.h: Add internal_thread_class to MonoDefaults.
306
307         * appdomain.c (mono_domain_unload), attach.c (receiver_thread),
308         domain.c, gc.c, icall-def.h, monitor.c, object.c, sgen-gc.c,
309         socket-io.c, threadpool.c, thread-types.h, threads.c: Changes
310         resulting from the split of the Thread class.
311
312         * gc-internal.h: Prototype for new function for checking whether a
313         thread is the finalizer thread.
314
315         * appdomain.c: Corlib version bump.
316
317 2009-09-25  Rolf Bjarne Kvinge  <RKvinge@novell.com>
318
319         * appdomain.c|h: Add a mono_domain_try_unload method which is
320         equivalent to mono_domain_unload, except that it returns an exception
321         instead of throwing it. Make mono_domain_unload use the
322         mono_domain_try_unload method to avoid code-duplication.
323
324 2009-09-25  Zoltan Varga  <vargaz@gmail.com>
325
326         * debug-helpers.c (dis_one): Avoid unaligned accesses on platforms where that is
327         a problem.
328
329 2009-09-24  Zoltan Varga  <vargaz@gmail.com>
330
331         * marshal.c (emit_ptr_to_object_conv): Generate an exception instead of
332         aborting when a conversion is not implemented.
333
334 2009-09-23  Miguel de Icaza  <miguel@novell.com>
335
336         * verify.c: when comparing culture strings, use g_ascii_strcmp
337
338         * assembly.c (mono_public_tokens_are_equal): Change g_strcasecmp
339         when comparing public key tokens to use memcmp on 16 bytes.   I do
340         not believe this ever worked as advertised in the past.
341
342         The standard Public Key is 00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00
343         which would have always failed earlier.
344
345 2009-06-25  Miguel de Icaza  <miguel@novell.com>
346
347         * gc.c: Raise a NullArgumentException if the object passed is
348         null.
349
350 2009-09-22  Zoltan Varga  <vargaz@gmail.com>
351
352         * image.c (mono_image_close): Atomically decrement the reference count and
353         remove the image from the hash tables, to prevent another thread from seeing a
354         dying MonoImage. Fixes #541194.
355
356 2009-09-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
357
358         * threadpool.c: actually use the minimum number of 'completion ports'
359         (for us is just a potential worker thread).
360
361 2009-09-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
362
363         * threadpool.c: remove ares_htable. It does not make sense any more
364         since the same objects are now stored in GC-tracked arrays while they are
365         in the queue.
366
367 2009-09-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
368
369         * threadpool.c: increase the minimum length of the queues to 128.
370         Remove warning.
371
372 2009-09-21  Zoltan Varga  <vargaz@gmail.com>
373
374         * marshal.c (mono_marshal_get_string_ctor_signature): New internal function to
375         return the modified signature used by string ctors.
376
377 2009-09-20  Zoltan Varga  <vargaz@gmail.com>
378
379         * marshal.c (mono_marshal_get_runtime_invoke_dynamic): New internal function
380         to return a runtime-invoke wrapper which uses DYN_CALL to call the wrapped
381         method, to be used by full-aot.
382
383 2009-09-18  Rodrigo Kumpera  <rkumpera@novell.com>
384
385         Since the runtime supports lazy initialization of a type's vtable and this can cause a type
386         to fail, we need to ensure that the vtable is properly initialized at spots were the type must
387         be known to be good.
388
389         * class.c (mono_class_init): Fail array types if their element type fails initialization
390         as well.
391
392         * object.c (mono_class_create_runtime_vtable): Fail array types if their element type fails
393         initialization, additionally we request the element_type vtable to be initialized as well.
394
395         This is fine and should not increase the working set in any meaningful way since it's reasonable
396         to assume       that most code will create an array and eventually populate it, which will require the
397         type's vtable to be initialized.
398
399         * loader.c (field_from_memberref): Add a comment for a possibly useless mono_class_init call.
400
401 2009-09-17  Atsushi Enomoto  <atsushi@ximian.com>
402
403         * normalization-tables.h : regenerated.
404
405 2009-09-16  Zoltan Varga  <vargaz@gmail.com>
406
407         * mono-debug.c (mono_debug_add_method): Increase the size of the buffer,
408         a leb128 encoding can take up to 5 bytes.
409
410 2009-09-15  Rodrigo Kumpera  <rkumpera@novell.com>
411
412         * class.c (verify_class_overrides): Remove useless argument.
413
414         * class.c (mono_class_setup_vtable_general): Move the overrides check to happen
415         before interface enumeration as this is no longer required.
416
417 2009-09-15  Rodrigo Kumpera  <rkumpera@novell.com>
418
419         * class.c: New function mono_class_is_assignable_from_slow that is safe to be
420         used under mono_class_init context. This functions avoid any code path that
421         calls mono_class_init, which leads it to be slow as some things like the interface
422         bitmap are not available.
423
424         * class.c (verify_class_overrides): Use mono_class_is_assignable_from_slow instead
425         of it's own broken version. Fixes the verifier part of #538588.
426
427         * class-internals.h: Export mono_class_is_assignable_from_slow as part of the internal
428         API.
429
430 2009-09-15  Mark Probst  <mark.probst@gmail.com>
431
432         * class.c (mono_class_init): Always set an exception in a class if
433         vtable setup fails.  Fixes #538577.
434
435         * generic-sharing.c: Raise an exception if mono_class_vtable()
436         returns NULL.
437
438 2009-09-13  Zoltan Varga  <vargaz@gmail.com>
439
440         * marshal.c (mono_marshal_get_runtime_invoke): Don't share instance 
441         methods of vtypes, as they could be incorrectly shared with static methods
442         taking an IntPtr argument.
443
444 2009-09-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
445
446         * domain.c:
447         * object.c:
448         * class-internals.h: renamed waithandle_class to
449         manualresetevent_class.
450         * marshal.c: propagate the exception if a remoting BeginInvoke call
451         fails.
452
453 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
454
455         * object.c: Properly handle vtable failures.
456
457 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
458
459         * socket-io.c: Assert on vtable failure.
460
461         * mono-mlist.c: Assert on vtable failure.
462
463 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
464
465         * marshal.c: Assert on vtable failure.
466
467 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
468
469         * icall.c: Properly handle vtable failures.
470
471 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
472
473         * debug-helpers.c (mono_class_describe_statics): Properly handle vtable failures.
474
475 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
476
477         * cominterop.c (ves_icall_System_ComObject_CreateRCW): Property handle vtable failures.
478
479         * console-unix.c (do_console_cancel_event): Same.
480
481 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
482
483         * class-internals.h: Add mono_class_vtable_full function that allows control
484         if an exception should be raised or not.
485
486         * object.c (mono_class_vtable): Call into mono_class_vtable_full. Fix this function
487         to do what its documentation say, that is to return NULL and set exception_type on
488         failure.
489
490         * object.c (mono_class_create_runtime_vtable): Add new raise_on_error parameter
491         and change the code to honor it.
492
493 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
494
495         * verify.c: Fix typo in error message.
496
497 2009-09-10  Sebastien Pouliot  <sebastien@ximian.com>
498
499         * security-core-clr.c: Fix default_platform_check so it can run
500         the runtime coreclr tests (without an infinite recursion when
501         throwing an exception).
502
503 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
504
505         object.c (mono_delegate_ctor_with_method): Guard against null method.
506
507 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
508
509         * marshal.c (mono_marshal_get_xappdomain_dispatch): Add an assert
510         that should be replaced with error handling later.
511
512 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
513
514         * marshal.c (mono_delegate_end_invoke): Fix warning.
515
516 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
517
518         * loader.c (mono_field_from_token): Properly handle invalid
519         dynamic tokens.
520
521 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
522
523         * pedump.c (verify_image_file): Skip types that can't be
524         decoded.
525
526 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
527
528         * verify.c: Look for recursive valuetypes only against the
529         type been initialized as this is a lot simpler and works.
530
531 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
532
533         * verify.c: Ensure that fields are properly loaded before
534         checking them.
535
536 2009-09-10  Bill Holmes  <billholmes54@gmail.com>
537
538         * object.c (mono_object_get_virtual_method) : Call 
539           mono_cominterop_get_invoke if the object is a COM object.
540
541         Code is contributed under MIT/X11 license.
542
543 2009-09-09  Rodrigo Kumpera  <rkumpera@novell.com>
544
545         * verify.c: Check for recursive valuetype definitions.
546
547 2009-09-08  Rodrigo Kumpera  <rkumpera@novell.com>
548
549         Use inheritance-aware interface offsets. Inherited types use the same offsets
550         of their parents. This reduce offset duplication in case more than one type in
551         the inheritance tree explicitly implements the same interface.
552
553         This also removes a source of vtable bubbles found in #532409. An abstract type
554         isn't required to provide abstract methods to all interfaces it implements, which
555         resulted in a bubble with the previous scheme as the child would get a non-full
556         vtable from its parent. We fail all concrete types with vtable bubbles, so this
557         should be fixed.
558
559         This change causes an increase of 1.7% in vtable memory usage for IronPython pystone but
560         it's expected to not cause any significant increase beyond that.
561
562         * class.c (setup_interface_offsets): Compute super class iface offsets
563         first to force sharing.
564
565         * class.c: Add VTABLE_SELECTOR macro to the vtable debug macros to help
566         dumping only the relevant ones.
567
568         * class.c (mono_class_setup_vtable_general): Give newslot, non final, virtual
569         methods a new slot regardless if they belong to an interface or not. This allows
570         an inherited type to override the iface method separately from the class one.
571
572 2009-09-04 Gonzalo Paniagua Javier <gonzalo@novell.com>
573
574         * threadpool.c: make the Sleep() alertable to prevent delays exiting
575         applications that take less than 2s to execute.
576         Bug #524984 fixed.
577
578 2009-09-04  Zoltan Varga  <vargaz@gmail.com>
579
580         * object-internals.h (MonoRuntimeCallbacks): Add a 'get_runtime_build_info' callback.
581
582         * object.c (mono_get_runtime_callbacks): New helper function to return
583         the runtime callbacks.
584
585         * icall.c (ves_icall_Mono_Runtime_GetDisplayName): Use the result of
586         mono_get_runtime_build_info () as the display name.
587         
588 2009-09-03  Zoltan Varga  <vargaz@gmail.com>
589
590         * marshal.c (emit_marshal_array): Call conv.ovf.i on the array parameter
591         argument, since NEWARR expects a native int. Fixes #481559.
592
593 2009-09-03  Rodrigo Kumpera  <rkumpera@novell.com>
594
595         * icall.c (ves_icall_MonoMethod_GetDllImportAttribute): Guard
596         against broken SRE methods.
597
598 2009-09-03  Rodrigo Kumpera  <rkumpera@novell.com>
599
600         * class.c (mono_type_get_full): Don't call mono_metadata_free_type on
601         a NULL variable. Abort early on failure.
602
603 2009-09-03  Rodrigo Kumpera  <rkumpera@novell.com>
604
605         * class.c (can_access_type): Fail visibility test for non nested
606         types with nested visibility.
607
608 2009-09-02  Sebastien Pouliot  <sebastien@ximian.com>
609
610         * assembly.c (parse_public_key): Avoid allocating (and not 
611         freeing) the public key array when it's not requested by the 
612         caller.
613         * threads.c (mono_thread_manage, mono_thread_create_internal, 
614         ves_icall_System_Threading_Thread_Thread_internal): Free 
615         allocated memory on error.
616
617 2009-09-02  Rodrigo Kumpera  <rkumpera@novell.com>
618
619         * icall.c, icall-def.h: Remove some dead code from early SRE changes.
620
621 2009-09-02  Rodrigo Kumpera  <rkumpera@novell.com>
622
623         * class.c (mono_class_setup_fields): Remove duplicated local variable
624         named gklass.
625         Rename gklass to gtd to reflect the fact that it points to the generic
626         type definition.
627         Remove the duplicated call to mono_class_setup_fields on gtd and move
628         the error check to the beginning.
629
630 2009-09-02  Rodrigo Kumpera  <rkumpera@novell.com>
631
632         * marshal.c (mono_array_to_lparray): Do DISABLE_COM properly.
633         Remove cruft of the previous patch.
634
635 2009-09-01  Rodrigo Kumpera  <rkumpera@novell.com>
636
637         * metadata-verify.c (verify_method_table): Check for abstract + final.
638         Fixes #534175.
639
640 2009-09-01  Rodrigo Kumpera  <rkumpera@novell.com>
641
642         * verify.c (verify_class_fields): Check for duplicate fields.
643
644 2009-09-01  Rodrigo Kumpera  <rkumpera@novell.com>
645
646         * metadata-verify.c: Verify the typeref table for duplicates.
647
648 2009-09-01  Rodrigo Kumpera  <rkumpera@novell.com>
649
650         This reverts r140936 and properly handles interfaces with static methods. The
651         right fix is to ensure vtables without bubles which is an easier to verify
652         constraint. We should avoid such special cases as of the reverted patch as those
653         only make the runtime more brittle.
654
655         * class.c (mono_class_setup_vtable_general): Revert previous change that handle
656         static methods on interfaces.
657
658         * class.c (setup_interface_offsets): Use the number of virtual methods when
659         calculating interface offsets instead of the number of methods. This way we
660         avoid bubles on the layout.
661
662 2009-08-31  Rodrigo Kumpera  <rkumpera@novell.com>
663
664         * metadata-verify.c (verify_metadata_header): Some very smart
665         obfuscators like to add extra stream headers. Ignore them.
666
667 2009-08-30  Zoltan Varga  <vargaz@gmail.com>
668
669         * class.c (mono_class_setup_vtable_general): Verify interfaces with static
670         methods correctly.
671
672 2009-08-29  Rodrigo Kumpera  <rkumpera@novell.com>
673
674         * metadata-verify.c: Verify for duplicated types.
675
676 2009-08-28  Rodrigo Kumpera  <rkumpera@novell.com>
677
678         * metadata-verify.c (verify_typedef_table): Verify for nested types
679         without an entry on the nested class table.
680
681 2009-08-28  Zoltan Varga  <vargaz@gmail.com>
682
683         * cominterop.c (cominterop_get_ccw): Applied patch from tom hindle
684         <tom_hindle@sil.org>. Add locking around hash table accesses.
685
686 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
687
688         * verify.c (mono_verifier_verify_class): Verify all interface if
689         really are interfaces. Fixes #534184.
690
691 2009-08-27  Rodrigo Kumpera  <rkumpera@novell.com>
692
693         * pedump.c: Initialize all types during metadata validation so we report
694         errors only detected as part of class initialization.
695
696 2009-08-26  Rodrigo Kumpera  <rkumpera@novell.com>
697
698         * metadata-verify.c (verify_method_table): PInvoke requires method to
699         be static. Fixes #534189
700
701 2009-08-26  Zoltan Varga  <vargaz@gmail.com>
702
703         * threads.c (mono_thread_suspend_all_other_threads): Handle 'threads_starting_ip'
704         being NULL.
705
706 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
707
708         * class.c (mono_class_setup_vtable_general): Verify the resulting vtable
709         for holes or bad methods. Fixes #525314.
710
711 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
712
713         * class.c (setup_interface_offsets): Don't allocate slot
714         for the same interface multiple times. This creates bubbles
715         that waster space and make vtable verification harder.
716
717         The same interface get a slot multiple times since we need
718         to get the closure of all implemented interfaces, which means
719         the same interface is reported multiple times.
720
721 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
722
723         * verify.c (mono_verifier_verify_class): Don't check the fields
724         of generic instances since the context on which they got expanded
725         might lead to false positives.
726
727         Such thing happens when a generic type is inflated in the context
728         of a generic method and the inflated type of a field turns into a
729         generic method argument, which causes the checking code to think
730         it's an invalid class when it's not.
731
732 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
733
734         * verify.c (mono_type_is_valid_in_context): Verify if type
735         is NULL and remove duplicate test.
736
737 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
738
739         * verify.c (mono_verifier_verify_class): Check fields for
740         invalid generic arguments.
741
742 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
743
744         * class.c (verify_class_overrides): Verify if for static
745         and non virtual methods.
746
747 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
748
749         * icaa.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor):
750         Check for errors after retrieving the vtable.
751
752 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
753
754         * class.c (mono_class_setup_vtable_general): Verify
755         if method overrides are valid before processing them.
756
757 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
758
759         * marshal.c (mono_array_to_lparray): Fix minimal build with
760         cominterop disabled.
761
762         * marshal.c (mono_free_lparray): Same.
763
764 2009-08-21  Mark Probst  <mark.probst@gmail.com>
765
766         * threadpool.c (mono_thread_pool_init): Use mono_object_hash() as
767         the hash function for the ares_htable.
768
769 2009-08-20  Rodrigo Kumpera  <rkumpera@novell.com>
770
771         * metadata-verify.c (verify_assembly_table): Accept 0x10 as a valid
772         bit for assembly flags. MS is ok with it but there is no spec anywhere
773         on its mean
774
775 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
776
777         * class.c (mono_class_create_from_typedef): Emit profiler events
778         in all cases.
779
780 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
781
782         * icall.c (ves_icall_Type_GetMethodsByName): Don't leak loader errors.
783         Release memory on failure.
784
785 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
786
787         * class-internals.h: Add mono_metadata_load_generic_param_constraints_full
788         to the internal API.
789
790         * metadata.c (get_constraints): Use a single-linked table as we don't
791         traverse it backward. Fail and return FALSE if only of the contraint types
792         is not found.
793
794         * metadata.c (mono_metadata_load_generic_param_constraints_full): Identical
795         to mono_metadata_load_generic_param_constraints except for having a return value.
796         This has to be done since the later is part of the public API.
797
798         * class.c (mono_class_create_from_typedef): Properly check the loading of constrains
799         and fail the type.
800
801         * loader.c (mono_get_method_from_token): Properly check the loading of constraints
802         and fail the method.
803
804 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
805
806         * metadata-verify.c (is_valid_method_header): Add work-around to deal
807         with MS broken behavior of emmitting EH section sizes without the
808         header size added.
809
810 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
811
812         * metadata.c (mono_type_create_from_typespec): Don't allocate image
813         memory until we're sure that we'll need it. This avoids leaking for
814         broken types or duplicated instantiation.
815
816 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
817
818         * metadata-verify.c (is_valid_method_header): Fix stupid formating
819         mistake.
820
821 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
822
823         * metadata-verify.c (is_valid_method_header): Fix number of clauses
824         and expected size calculation.
825
826 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
827
828         * class.c (mono_class_get_field_idx): Add fixme for broken
829         behavior for types with multiple fields with the same name.
830         I would rather fix it, but have no idea on how to generate
831         such artifact for testing.
832
833 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
834
835         * verify.c (verifier_load_field): We should allow references to
836         fields to be made using the generic type definition. It's up to
837         the loader system to fail invalid ops.
838
839         * verify.c (get_boxable_mono_type): Only uninstantiated GTDs
840         are invalid.
841
842 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
843
844         * class.c: Fix usage of mono_metadata_interfaces_from_typedef_full.
845
846         * metadata-internals.h: Fix declaration of 
847         mono_metadata_interfaces_from_typedef_full.
848
849         * metadata.c (mono_metadata_interfaces_from_typedef_full): Add extra
850         heap_alloc_result parameter that controls if the result should be
851         g_malloc'd.
852
853         * metadata.c (mono_metadata_interfaces_from_typedef): Let the resulting
854         array be g_malloc'd and properly document this public API function.
855
856 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
857
858         * cil-coff.h: Fix METHOD_HEADER_FORMAT_MASK to be 2 bits and
859         remove METHOD_HEADER_TINY_FORMAT1.
860
861         * reflection.c: Remove reference to METHOD_HEADER_TINY_FORMAT1.
862
863         * metadata.c (mono_metadata_parse_mh_full): Kill tiny format1.
864
865         Both spec and MS uses only 2 bits to enumerate the kind of header.
866         So given that 0x6 and 0x2 are equal under a 2 bits mask, tiny format1
867         is superfluous, only used for tiny headers with odd code lengths.
868
869         This change also make sure that mono doesn't wronly interpret bit 2
870         of fat header flags, which is currently reserved.
871
872 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
873
874         * metadata.c (do_mono_metadata_parse_type): Do error
875         checking for element types. Don't abort if presented
876         with a broken type kind.
877
878 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
879
880         * metadata.c (mono_metadata_parse_method_signature_full):
881         Gracefully fail bad vararg signatures.
882
883 2009-08-18  Christian Hergert  <chris@dronelabs.com>
884
885         * profiler.c:
886         * class.c: Fix warnings for uninitialized variables.
887
888 2009-08-18  Christian Hergert  <chris@dronelabs.com>
889
890         * icall.c: Fix _NSGetEnviron method declaration warning.
891
892 2009-08-18  Christian Hergert  <chris@dronelabs.com>
893
894         * icall.c:
895         * reflection.c: Make bitwise checks explicit.
896
897 2009-08-18  Christian Hergert  <chris@dronelabs.com>
898
899         * debug-helpers.c:
900         * marshal.c: Fix printf warnings.
901
902 2009-08-18  Zoltan Varga  <vargaz@gmail.com>
903
904         * reflection.c (encode_cattr_value): Fix a warning.
905
906 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
907
908         * metadata.c (mono_metadata_parse_array_full): Fix memory leak
909         of array bounds.
910
911 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
912
913         * loader.c (mono_method_signature): Don't assert on broken
914         signature. Print a more useful error message.
915
916 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
917
918         * loader.c (mono_method_get_marshal_info): Assert if
919         signature is invalid. Bounds check stores to the
920         mspecs array;
921
922 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
923
924         * loader.c (field_from_memberref): Fix warning.
925
926 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
927
928         * loader.c (mono_method_get_param_names): Check if signature
929         is null. Don't store beyond the size of the name array.
930
931 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
932
933         * loader.c (mono_get_method_constrained): Check if signature
934         is null.
935
936 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
937
938         * loader.c (mono_loader_set_error_bad_image): Improve
939         error messages.
940
941 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
942
943         * loader.c (mono_get_method_full): Convert an assertion
944         into a loader error.
945
946 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
947
948         * class-internals.h, class.c: Better naming and documentation.
949
950 2009-08-17  Zoltan Varga  <vargaz@gmail.com>
951
952         * boehm-gc.c (mono_gc_add_weak_track_handle): Don't do any work if
953         obj is NULL.
954
955 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
956
957         * loader.c (mono_method_get_signature_full): Fail gracefully if signature
958         parsing fails.
959
960 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
961
962         * loader.c (mono_loader_error_prepare_exception): Handle missing field
963         errors with no class set.
964
965         * loader.c (field_from_memberref): If the field signature is of the wrong
966         type fail with a MissingFieldException instead of a BadImageException as
967         this is the behavior observed on MS. 
968
969 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
970
971         * loader.c (field_from_memberref): Don't crash if either the field
972         signature or the typespec class are invalid.
973
974 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
975
976         * verify.c (verifier_load_field): Don't allow field related
977         ops to reference fields on generic type definition.
978
979 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
980
981         * metadata-verify.c: Add new warning level for errors specified
982         by ECMA 335 but that MS ignores.
983
984         * metadata-verify.c (verify_method_table): Make compiler controled
985         visibility + (rt)specialname error a warning as MS ignores this. Ignoring
986         this check is safe because the end result will only be some visibility
987         exceptions been thrown.
988
989 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
990
991         * verify.c (get_boxable_mono_type): Don't allow the
992         use of the generic type definition on boxed type positions.
993
994         Fixes #531237.
995
996 2009-08-14  Mark Probst  <mark.probst@gmail.com>
997
998         * threadpool.c: Make sure no cross-domain references remain in
999         ares_htable or the arrays that are thrown away when resizing.
1000
1001 2009-08-14  Mark Probst  <mark.probst@gmail.com>
1002
1003         * appdomain.c, metadata-internals.h, image.c: In MonoImage add a
1004         list of classes for which we have to unregister reflection_info
1005         with the GC and which are not in the namespace cache.
1006
1007         * reflection.c (mono_reflection_initialize_generic_parameter): Add
1008         the class to the list.
1009
1010 2009-08-14  Mark Probst  <mark.probst@gmail.com>
1011
1012         * domain.c (mono_domain_free): Unregister the GC roots in
1013         MonoDomain.
1014
1015 2009-08-12  Rodrigo Kumpera  <rkumpera@novell.com>
1016
1017         * reflection.c (mono_reflection_type_get_handle): Fix typo.
1018
1019 2009-08-12  Rodrigo Kumpera  <rkumpera@novell.com>
1020
1021         * class.c: Add mono_class_get_field_from_name_full which does
1022         the same as mono_class_get_field_from_name but does check field
1023         signature as well.
1024
1025         * class-internals.h: Export mono_class_get_field_from_name_full as
1026         part of the internal API.
1027
1028         * loader.c (field_from_memberref): Search fields by name and signature
1029         as it's valid to have two fields with same name but different types.
1030
1031         Fixes #528055.
1032
1033 2009-08-10  Rodrigo Kumpera  <rkumpera@novell.com>
1034
1035         * icall-def.h: Add a bunch of temporary icalls to MonoGenericClass.
1036
1037         * reflection.c (mono_reflection_type_get_handle): Handle MonoGenericClass.
1038
1039         * reflection.c (encode_cattr_value): Use mono_reflection_type_get_handle to encode
1040         System.Type.
1041
1042 2009-08-13  Zoltan Varga  <vargaz@gmail.com>
1043
1044         * gc.c (GCHandle_CheckCurrentDomain): Moved this here from icall.c.
1045
1046         * boehm-gc.c (mono_gc_add_weak_track_handle): Handle nulls.
1047
1048 2009-08-12  Mark Probst  <mark.probst@gmail.com>
1049
1050         * sgen-gc.c, sgen-scan-object.h: Object scanning code factored out
1051         to sgen-scan-object.h, which can be included and parameterized via
1052         macros.
1053
1054         * Makefile.am: sgen-scan-object.h added.
1055
1056 2009-08-12  Mark Probst  <mark.probst@gmail.com>
1057
1058         * gc.c: #define GC_dont_gc if we're compiling with SGen.
1059
1060 2009-08-12  Mark Probst  <mark.probst@gmail.com>
1061
1062         * domain.c (mono_domain_free): Free a domain's mono_g_hash_tables
1063         before clearing a domain in the GC.
1064
1065 2009-08-12  Mark Probst  <mark.probst@gmail.com>
1066
1067         * exception.c (mono_exception_from_name_domain): Actually create
1068         the exception in the specified domain.
1069
1070         * appdomain.c (mono_domain_create_appdomain_internal): Create the
1071         OutOfMemoryException a bit later so that the domain is inialized
1072         "enough" that it works.
1073
1074 2009-08-12  Mark Probst  <mark.probst@gmail.com>
1075
1076         * threads.c (thread_cleanup): Clean up the cached_culture_info
1077         array to prevent cross-domain references.
1078
1079 Tue Aug 11 14:38:57 CEST 2009 Paolo Molaro <lupus@ximian.com>
1080
1081         * metadata.c: more documentation for MonoType accessors.
1082
1083 2009-08-11  Raja R Harinath  <harinath@hurrynot.org>
1084
1085         Fix incorrect size definitions where the tail array isn't a list
1086         of pointers
1087         * class-internals.h (MONO_SIZEOF_MARSHAL_TYPE): Use offsetof to
1088         define size.
1089         * domain-internals.h (MONO_SIZEOF_JIT_INFO): Likewise.
1090         * metadata.h (MONO_SIZEOF_TYPE): Likewise.
1091         * reflection.h (MONO_SIZEOF_CUSTOM_ATTR_INFO): Likewise.
1092
1093 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
1094
1095         * reflection.h:
1096         * reflection.c: MONO_SIZEOF_CUSTOM_ATTR_INFO.
1097
1098 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
1099
1100         * metadata.c:
1101         * loader.c:
1102         * metadata-internals.h:
1103         * method-builder.c:
1104         * reflection.c: use MONO_SIZEOF_METHOD_HEADER.
1105
1106 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
1107
1108         * cominterop.c:
1109         * metadata.c:
1110         * metadata.h:
1111         * loader.c:
1112         * marshal.c:
1113         * reflection.c: #define for sizeof in MonoType and
1114         MonoMethodSignature.
1115
1116 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
1117
1118         * domain.c:
1119         * domain-internals.h: add and use #define's instead of sizeof()
1120         for MonoJitInfo and MonoJitInfoTable.
1121
1122 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
1123
1124         * object.c:
1125         * class.h: use #define instead of sizeof() for MonoRemoteClass.
1126
1127 2009-08-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
1128
1129         * metadata.c:
1130         * metadata.h:
1131         * object.c:
1132         * class-internals.h:
1133         * generic-sharing.c:
1134         * marshal.c: use a #define instead of sizeof() for a few
1135         structures that use a zero-length array.
1136
1137 2009-08-06  Rodrigo Kumpera  <rkumpera@novell.com>
1138
1139         * object-internals.h (MonoReflectionMethodOnTypeBuilderInst): Add new fields
1140         to handle inflated generic methods.
1141
1142         * appdomain.c: Bump corlib version.
1143
1144         * reflection.c (mono_image_get_method_on_inst_token): Handle generic method
1145         instances.
1146
1147         * reflection.c (fixup_method): Same
1148
1149         * reflection.c (resolve_object): Same.
1150
1151         * reflection.c (inflate_method): Replace a g_assert_not_reached with a
1152         g_error and a decent message.
1153
1154 2009-08-06  Massimiliano Mantione  <massi@ximian.com>
1155
1156         * bohem-gc.c (mono_gc_add_weak_track_handle): Get the domain
1157         from the object because it could not yet be available globally
1158         (it happens if the profiler tries to create a gchandle on the
1159         MonoThread object of a thread that is still registering itself
1160         with the runtime).
1161
1162 2009-08-04  Rodrigo Kumpera  <rkumpera@novell.com>
1163
1164         * reflection.c (mono_generic_class_get_object): Initialized the
1165         managed type arguments array.
1166
1167         * object-internals.h (MonoReflectionGenericClass): Add type_arguments field.
1168
1169         * appdomain.c: Bump corlib version.
1170
1171 2009-08-04  Zoltan Varga  <vargaz@gmail.com>
1172
1173         * threads.c (thread_cleanup): Free serialized_ui_culture_info. Fixes
1174         #527902.
1175
1176 2009-08-03  Zoltan Varga  <vargaz@gmail.com>
1177
1178         * threads.c (ves_icall_System_Threading_Thread_Thread_free_internal): 
1179         Avoid a crash if synch_cs is not set.
1180         
1181         * threads.c (ves_icall_System_Threading_Thread_Thread_free_internal): 
1182         Handle the case when the handle is 0.
1183
1184         * appdomain.c: Bump corlib version.
1185
1186 2009-08-02  Zoltan Varga  <vargaz@gmail.com>
1187
1188         * reflection.c (mono_type_get_object): Fix a warning.
1189
1190 2009-08-01  Mark Probst  <mark.probst@gmail.com>
1191
1192         * sgen-gc.c (mono_gc_wbarrier_value_copy): Don't compute the GC
1193         descriptor here.  We assume it's already been computed.
1194
1195         * generic-sharing.c (instantiate_other_info): Compute the GC
1196         descriptor for info type MONO_RGCTX_INFO_KLASS.
1197
1198 2009-08-01  Mark Probst  <mark.probst@gmail.com>
1199
1200         * reflection.c (mono_type_get_object): MonoDomain is an unmanaged
1201         type, so don't use MONO_OBJECT_SETREF to set a field.
1202
1203 2009-08-01  Mark Probst  <mark.probst@gmail.com>
1204
1205         * gc.c: We were missing one case where invoking a finalizer would
1206         not reset the domain.  Also, in the finalizer thread loop, assert
1207         that we're in the root domain.
1208
1209 2009-07-31  Rodrigo Kumpera  <rkumpera@novell.com>
1210
1211         * icall.c (ves_icall_MonoType_GetArrayRank): Throw ArgumentException
1212         if the type is not an array.
1213
1214 2009-07-31  Rodrigo Kumpera  <rkumpera@novell.com>
1215
1216         * icall.c (ves_icall_MonoType_get_DeclaringMethod): Return the
1217         method bound to the declaring type of the method. Raise an exception
1218         if the type is not a generic param.
1219
1220 2009-07-31  Rodrigo Kumpera  <rkumpera@novell.com>
1221
1222         * class.c (print_unimplemented_interface_method_info): Print the
1223         full type name.
1224
1225         * class.c (mono_class_setup_vtable_general): When dealing with a
1226         generic instance first check if the generic type definition is
1227         not broken.
1228
1229 2009-02-11 Tom Hindke <tom_hindle@sil.org>
1230
1231         * marshal.c (mono_array_to_lparray): Implemented so managed object types are converted to native types.
1232
1233         * marshal.c: Added new method mono_free_lparray to free memory allocated by mono_array_to_lparray
1234
1235         * marshal.c (emit_marshal_array): call emit mono_free_lparray where approprate.
1236
1237         * marshal.c (conv_to_icall): added MONO_MARSHAL_FREE_LPARRAY case
1238
1239         * metadata.h (MonoMarshalConv enum): added MONO_MARSHAL_FREE_LPARRAY
1240
1241         Code is contributed under MIT/X11 license
1242
1243 2009-08-30  Rodrigo Kumpera  <rkumpera@novell.com>
1244
1245         * verify.c: Fix naming of stelem and ldelem.
1246
1247 2009-07-30  Mark Probst  <mark.probst@gmail.com>
1248
1249         * generic-sharing.c: Replace the templates lock with the loader
1250         lock because of very hard to resolve deadlock issues.
1251
1252 2009-07-30  Zoltan Varga  <vargaz@gmail.com>
1253
1254         * icall.c (ves_icall_Type_GetMethodsByName): Use 
1255         mono_class_get_vtable_size () instead of accessing klass->vtable_size
1256         directly. Fixes #525338.
1257
1258         * class.c (mono_class_get_vtable_size): New helper function.
1259
1260         * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle_type): Fix the second argument, its a MonoType* not a MonoClass*. Check whenever
1261         the field belongs to the type. Fixes #525733.
1262
1263 2009-07-30  Mark Probst  <mark.probst@gmail.com>
1264
1265         * sgen-gc.c: When we stop a thread and its stack top is not within
1266         its allocated stack (because it's in an altstack signal handler),
1267         restart it and stop it again, until it is.
1268
1269 2009-07-30  Mark Probst  <mark.probst@gmail.com>
1270
1271         * sgen-gc.c: Take a thread's stack top and registers from the
1272         sigcontext in the suspend signal handler.
1273
1274         * sgen-gc.h, sgen-archdep.h, Makefile.am: Move arch-dependent
1275         stuff to sgen-archdep.h.
1276
1277         * gc.c, gc-internal.h: Remove the get_ip_from_sigctx installer and
1278         caller, because have code in sgen-archdep.h to acquire that data.
1279
1280 2009-07-29  Massimiliano Mantione  <massi@ximian.com>
1281
1282         * profiler.c, profiler.h, profiler-private.h:
1283         Added support for keeping track of code chunks and buffers.
1284
1285 2009-07-29 Rodrigo Kumpera  <rkumpera@novell.com>
1286
1287         * metadata-verify.c: Fix endianness problems on decoding functions.
1288         Based on a patch by Ulrich Weigand <uweigand@de.ibm.com>
1289
1290 2009-07-28 Rodrigo Kumpera  <rkumpera@novell.com>
1291
1292         * icall.c (ves_icall_Type_make_array_type): Handle the new encoding
1293         schema for vectors and one dimension SZARRAY.
1294
1295 2009-07-28 Rodrigo Kumpera  <rkumpera@novell.com>
1296
1297         * reflection.c (mono_reflection_type_get_handle): Handle the new encoding
1298         schema for vectors and one dimension SZARRAY.
1299
1300 2009-07-27  Mark Probst  <mark.probst@gmail.com>
1301
1302         * icall-def.h, thread-types.h, threads.c: New separate icalls for
1303         Interlocked.(Compare)Exchange with object arguments, which invoke
1304         write barriers.
1305
1306 2009-07-26  Miguel de Icaza  <miguel@novell.com>
1307
1308         * icall.c (ves_icall_Type_GetNestedType): Throw an exception when
1309         passed invalid arguments.   Fixes another crasher in the
1310         Silverlight test suite.
1311
1312         * class.c (mono_class_array_element_size): Return 0 for the size
1313         of the class;  This fixes the crasher exposed by :
1314
1315         typeof (void).MakeArrayType ();
1316
1317         * icall.c (ves_icall_MonoType_GetEvent): Do not dereference method
1318         if there is no method to dereference.    Put all the code that
1319         depends on this inside the if (method) block.
1320
1321         This fixes the crasher exposed by Microsoft's Silvelright CLR test
1322         suite  ./Reflection/Emit/TypeBuilder/TypeBuilderGetEvent.exe
1323
1324         With this change, we pass the test.
1325         
1326         * reflection.c (mono_reflection_sighelper_get_signature_local):
1327         Only dereference the assembly if it has been set.    Fixes a
1328         crasher exposed by #525328
1329
1330 2009-07-25  Mark Probst  <mark.probst@gmail.com>
1331
1332         * sgen-gc.c, object.h, null-gc.c, boehm-gc.c, marshal.c: Really
1333         don't perform the store in mono_gc_wbarrier_generic_nostore().
1334         Remove the second argument (value), which is not needed.
1335
1336 2009-07-24  Zoltan Varga  <vargaz@gmail.com>
1337
1338         * null-gc.c (mono_gc_wbarrier_generic_nostore): Define this to fix
1339         the build.
1340
1341         * boehm-gc.c: Ditto.
1342         
1343 2009-07-24  Mark Probst  <mark.probst@gmail.com>
1344
1345         * sgen-gc.c, marshal.c, object.h: Make the managed write barrier
1346         not perform the store itself.  Introduce
1347         mono_gc_wbarrier_generic_nostore(), which is the same as
1348         mono_gc_wbarrier_generic_store(), except it doesn't perform the
1349         store.
1350
1351 2009-07-24  Mark Probst  <mark.probst@gmail.com>
1352
1353         * icall.c (ves_icall_System_Array_SetGenericValueImpl):
1354         mono_gc_wbarrier_value_copy() doesn't perform the copy itself, so
1355         we still need the memcpy().
1356
1357 2009-07-22  Mark Probst  <mark.probst@gmail.com>
1358
1359         * sgen-gc.c: Align array bounds calculation to mono_array_size_t
1360         so that big arrays are handled correctly.  Always use
1361         safe_object_get_size() to calculate array object sizes, which
1362         takes bounds into account.
1363
1364 2009-07-22  Mark Probst  <mark.probst@gmail.com>
1365
1366         * sgen-gc.c (mono_gc_wbarrier_value_copy): Make sure the class's
1367         GC descriptor is computed before we use it.
1368
1369 2009-07-22  Mark Probst  <mark.probst@gmail.com>
1370
1371         * icall.c (ves_icall_System_Array_SetGenericValueImpl): Use a
1372         write barrier if necessary.
1373
1374 2009-07-22  Mark Probst  <mark.probst@gmail.com>
1375
1376         * icall-def.h, icall.c, thread-types.h: New separate icall for
1377         VolatileWrite(object&,object) that uses a write barrier.
1378
1379         * console-unix.c, file-io.c, icall.c, threads.c: Use write
1380         barriers in icalls which write to "ref" or "out" arguments.
1381
1382 2009-07-21  Zoltan Varga  <vargaz@gmail.com>
1383
1384         * marshal.c (mono_marshal_get_runtime_invoke): Do the work done in the exception
1385         handler in a separate icall, to reduce the size of the wrappers.
1386
1387 2009-07-20 Rodrigo Kumpera  <rkumpera@novell.com>
1388
1389         * metadata-verify.c (is_valid_typespec_blob): Fix error message.
1390
1391 2009-07-20 Rodrigo Kumpera  <rkumpera@novell.com>
1392
1393         * metadata-verify.c (parse_field): Allow byref field.
1394
1395         * metadata-verify.c (parse_locals_signature): Allow byref locals.
1396
1397         * metadata-verify.c (is_valid_typespec_blob): Allow byref typespec.
1398
1399 2009-07-20 Rodrigo Kumpera  <rkumpera@novell.com>
1400
1401         * verify.c (do_cast): Fail for any non reference type that isn't boxed.
1402         Fixes #522784.
1403
1404 2009-07-20  Robert Jordan  <robertj@gmx.net>
1405
1406         * cominterop.c (cominterop_get_managed_wrapper_adjusted):
1407         Fix invalid IL in valuetype handling (STOBJ must push the
1408         corresponding class). Fixes bug #523149.
1409
1410         Code is contributed under MIT/X11 license.
1411
1412 2009-07-20  Geoff Norton  <gnorton@novell.com>
1413
1414         * gc.c: Use proper semaphores where available on posix and darwin.
1415
1416 2009-07-19  Geoff Norton  <gnorton@novell.com>
1417
1418         * gc.c: Unnamed posix semaphores are broken on darwin-arm too.
1419
1420 2009-07-19 Rodrigo Kumpera  <rkumpera@novell.com>
1421
1422         * refletion.c (is_sre_usertype): Change name to is_usertype and
1423         invert it's result so it returns true if the type is an user type
1424         and not the opposite.
1425
1426         * reflection.c (is_*_type): Change all of those to use new macro
1427         check_corlib_type_cached that cached the type lookup so we don't
1428         need to do string comparisons all the type. Changed the signature
1429         to take a MonoClass instead.
1430
1431         * reflection.c: Change mono_image_create_token and resolve_object
1432         to use is_sre_* functions.
1433
1434 2009-07-18  Mark Probst  <mark.probst@gmail.com>
1435
1436         * sgen-gc.c: Check for writes to the stack in the managed
1437         wbarrier as well.
1438
1439 2009-07-18  Mark Probst  <mark.probst@gmail.com>
1440
1441         * sgen-gc.c: When a thread is unregistered, don't free its remsets
1442         but put them on a list which is processed with the other thread's
1443         remsets.
1444
1445 2009-07-18  Mark Probst  <mark.probst@gmail.com>
1446
1447         * sgen-gc.c: Fix and enable the internal allocator instead of
1448         using malloc/free (which causes deadlocks).
1449
1450 2009-07-16 Rodrigo Kumpera  <rkumpera@novell.com>
1451
1452         * refletion.c: Fix builds with SRE disabled by adding a minimal
1453         implementation of mono_reflection_type_get_handle.
1454
1455 2009-07-15 Rodrigo Kumpera  <rkumpera@novell.com>
1456
1457         * refletion.c: Make mono_reflection_type_get_handle non static.
1458
1459         * object-internals.h: Export mono_reflection_type_get_handle.
1460
1461         * icall.c (ves_icall_MonoGenericClass_InflateType): Resolve the
1462         unmanaged handle using mono_reflection_type_get_handle.
1463
1464 2009-07-15 Rodrigo Kumpera  <rkumpera@novell.com>
1465
1466         * refletion.c: Replace all reads of MonoReflectionType::type with
1467         calls to mono_reflection_type_get_handle. Only the functions that
1468         deal with constructing TypeBuilder::type have not been changed
1469         because they have to deal with NULL values.
1470
1471         This is a first step into supporting reflection types that don't
1472         map directly into their unmanaged counterpart.
1473
1474 2009-07-14 Rodrigo Kumpera  <rkumpera@novell.com>
1475
1476         * metadata-verify.c (parse_locals_signature): Don't complain
1477         on signature with zero locals since MS generates it and doesn't
1478         bother with.
1479
1480 2009-07-14 Rodrigo Kumpera  <rkumpera@novell.com>
1481
1482         * reflection.c (mono_image_get_array_token): Resolve return
1483         type using mono_reflection_type_get_handle.
1484
1485         * reflection.c (mono_image_get_array_token): Resolve array method
1486         parent type using mono_reflection_type_get_handle.
1487
1488 2009-07-14  Zoltan Varga  <vargaz@gmail.com>
1489
1490         * reflection.c (mono_image_basic_init): Applied patch from
1491         <Dax@daxxfiles.net>. Set the public key token from the assembly
1492         builder. Fixes #518909.
1493
1494         * appdomain.c: Bump corlib version.
1495
1496 2009-07-13  Zoltan Varga  <vargaz@gmail.com>
1497
1498         * class.c (mono_class_needs_cctor_run): Make this return false if
1499         the class has no cctor.
1500
1501 2009-07-13  Mark Probst  <mark.probst@gmail.com>
1502
1503         * sgen-gc.c: When the minor GC needs to allocate a new section,
1504         invoke the major GC afterwards.
1505
1506 2009-07-14  Bill Holmes  <billholmes54@gmail.com>
1507
1508         * process.c  (ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal) :
1509           Applying the window_style field to the SHELLEXECUTEINFO struct.
1510
1511         Code is contributed under MIT/X11 license.
1512
1513 2009-07-13  Mark Probst  <mark.probst@gmail.com>
1514
1515         * sgen-gc.c: Fix the race condition in the unmanaged allocator by
1516         locking earlier.  Fix it in the managed allocator by making sure
1517         that no thread is stopped there before the GC runs.  If we do stop
1518         a thread there, we restart it and let it run a but, until it stops
1519         somewhere else.
1520
1521         * gc-internal.h, gc.c: Function for getting the IP from a signal
1522         context via a function registered by mini.
1523
1524 2009-07-11  Zoltan Varga  <vargaz@gmail.com>
1525
1526         * object-internals.h (MonoIntPtr): New structure describing a boxed
1527         IntPtr.
1528
1529         * object.c (mono_runtime_invoke_array): Handle ptr arguments and
1530         returns. Fixes #519953.
1531
1532         * marshal.c (mono_marshal_get_runtime_invoke): Handle pointer returns.
1533
1534 2009-07-09  Mark Probst  <mark.probst@gmail.com>
1535
1536         * class-internals.h, generic-sharing.c: New RGCTX info type for
1537         getting a remoting invoke with check wrapper.
1538
1539 2009-07-07  Geoff Norton  <gnorton@novell.com>
1540
1541         * icall-def.h: Fix the enable-minimal build.
1542
1543 2009-07-07 Rodrigo Kumpera  <rkumpera@novell.com>
1544
1545         * object-internals.h: Add MonoReflectionDerivedType.
1546
1547         * reflection.c: Implement support for PointerType.
1548         Fixed tons of warnings.
1549
1550 2009-07-07 Rodrigo Kumpera  <rkumpera@novell.com>
1551
1552         * object-internals.h: Add MonoReflectionByRefType.
1553
1554         * reflection.c: Implement support for ByRefType.
1555
1556 2009-07-07 Rodrigo Kumpera  <rkumpera@novell.com>
1557
1558         * icall-def.h: Add System.Reflection.Emit.DerivedType::create_unmanaged_type.
1559
1560         * object-internals.h: Add MonoReflectionArrayType and
1561         mono_reflection_create_unmanaged_type.
1562
1563         * reflection.c: Implement support for ArrayType.
1564
1565 2009-07-07 Rodrigo Kumpera  <rkumpera@novell.com>
1566
1567         * metadata-verify.c (is_valid_method_header): Parse EH block
1568         flags correctly.
1569
1570 2009-07-03  Mark Probst  <mark.probst@gmail.com>
1571
1572         * sgen-gc.c (finish_gray_stack): Set the to_space pointer after
1573         processing the disappearing links, and process disappearing links
1574         in a loop until no new objects are copied.
1575
1576 2009-07-03  Mark Probst  <mark.probst@gmail.com>
1577
1578         * object.c (handle_enum): Invoke the write barrier when copying
1579         value type instances.
1580
1581         * sgen-gc.c: Register remsets for unmanaged write barriers only
1582         when the address written to is actually on the heap.  This makes
1583         set_value() in object.c work without requiring that the result be
1584         on the heap.
1585
1586 2009-07-02 Rodrigo Kumpera  <rkumpera@novell.com>
1587
1588         The runtime wrappers are all bound to a given type that must
1589         exist in the same image. For regular images we use the <Module>
1590         type, which is required to exist for all images.
1591
1592         The <Module> type can't be used for dynamic images because it
1593         might not exist at the time the wrapper is required, so we create
1594         a synthetic type to use instead.
1595
1596         The current code works because of the 2 stage setup of MonoClass,
1597         but once this is gone it will no longer work.
1598
1599         * icall-def.h: Add ModuleBuilder::set_wrappers_type.
1600
1601         * metadata-internals.h (MonoDynamicImage): Add wrappers_type.
1602
1603         * object-internals.h: Export mono_image_set_wrappers_type icall
1604         as part of the internal API.
1605
1606         * marshal.c (get_wrapper_target_class): If the image is dynamic,
1607         use MonoDynamicImage::wrappers_type instead of the <Module> type.
1608
1609         reflection.c: Add mono_image_set_wrappers_type qhixh sets the dynamic
1610         image wrappers_type to the provided value.
1611
1612 2009-07-01 Rodrigo Kumpera  <rkumpera@novell.com>
1613
1614         * appdomain.c (deregister_reflection_info_roots): No need
1615         to use the image lock here.
1616
1617 2009-07-02  Mark Probst  <mark.probst@gmail.com>
1618
1619         * sgen-gc.c (collect_nursery): Also scan from write-barrier roots.
1620
1621 2009-06-29  Zoltan Varga  <vargaz@gmail.com>
1622
1623         * threads.c: Store the thread start argument in a hash table instead of
1624         registering it as a root, as libgc doesn't support unregistering roots
1625         under windows, leading to 'too many root sets' errors when many threads
1626         are created.
1627
1628         * gc.c (mono_gc_run_finalize): Avoid finalizing dynamic methods during
1629         shutdown, they can still be referenced by the other dying objects.
1630         Fixes #514506.
1631
1632 2009-06-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
1633
1634         * socket-io.c: DontLinger does not allow LingerOptions.
1635
1636 2009-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
1637
1638         * metadata-verify.c: The spec doesn't mention that it's possible to add
1639         custom attribute to a generic parameter. Fixed.
1640
1641 2009-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
1642
1643         * class.c (inflate_generic_type): Don't crash while trying to output a message
1644         on why we're aborting.
1645
1646 2009-06-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
1647
1648         * socket-io.c: DontLinger can take an int or a boolean too.
1649
1650 Fri Jun 26 17:00:04 CEST 2009 Paolo Molaro <lupus@ximian.com>
1651
1652         * gc.c: check for a null argument to SuppressFinalize () and
1653         ReRegisterForFinalize ().
1654
1655 2009-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
1656
1657         * loader.c (method_from_methodspec): Call into the verifier to check
1658         the signature.
1659
1660         * metadata-verify.c: Addmono_verifier_verify_methodspec_signature.
1661
1662         * verify-internals.h: Export mono_verifier_verify_methodspec_signature as
1663         part of the internal API.
1664
1665 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
1666
1667         * metadata.c (mono_type_create_from_typespec): Call into the verifier to check
1668         the signature.
1669
1670         * metadata-verify.c: Add mono_verifier_verify_typespec_signature.
1671
1672         * verify-internals.h: Export mono_verifier_verify_typespec_signature as
1673         part of the internal API.
1674
1675 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
1676
1677         * metadata.c (mono_metadata_parse_mh_full): Call into the verifier to check
1678         the signature.
1679
1680         * metadata-verify.c: Add mono_verifier_verify_standalone_signature. Fix
1681         blob verification.
1682
1683         * verify-internals.h: Export mono_verifier_verify_memberref_signature as
1684         part of the internal API.
1685
1686 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
1687
1688         * metadata-verify.c: Use is_valid_blob_object to verify blob validity
1689         when doing basic verification. 
1690
1691         This check must be done since the runtime peeks into signatures in much
1692         more places than it does decoding so it makes sense to ensure that all
1693         pointers to blob objects are well formed.
1694
1695 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
1696
1697         * metadata-verify.c (is_valid_blob_object): Add extra minsize argument.
1698         Use proper overflow dectection. Fix usage of it.
1699
1700 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
1701
1702         * loader.c (field_from_memberref): Call into the verifier to check
1703         the signature.
1704
1705         * loader.c (mono_method_get_signature_full): Same.
1706
1707         * loader.c (method_from_memberref): Same.
1708
1709         * metadata-verify.c: Add mono_verifier_verify_memberref_signature.
1710
1711         * verify-internals.h: Export mono_verifier_verify_memberref_signature as
1712         part of the internal API.
1713
1714 2009-06-25  Mark Probst  <mark.probst@gmail.com>
1715
1716         * threadpool.c (mono_thread_pool_add): If the domain is unloading
1717         or unloaded, still return an AsyncResult, but don't add it to the
1718         threadpool.
1719
1720 2009-06-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
1721
1722         * threads.c: fix missing colon when DEBUG is defined.
1723
1724 2009-06-25  Mark Probst  <mark.probst@gmail.com>
1725
1726         * threadpool.c: Don't add new calls to a threadpool if the domain
1727         of the call is unloading or unloaded.  When dequeuing a job, null
1728         the reference in the queue.
1729
1730 2009-06-25  Mark Probst  <mark.probst@gmail.com>
1731
1732         * sgen-gc.c (null_link_in_range): Add the dislink for the old
1733         generation if an object was moved.
1734
1735 2009-06-25  Sylvain Dupont <duposyl@gmail.com>
1736
1737         * cominterop.h cominterop.c marshal.c: Added support for marshalling out 
1738           parameters of type SAFEARRAY[VARIANT].
1739
1740         * reflection.c (encode_marshal_blob): Properly generate element type
1741           (SafeArraySubType marshal attribute option).
1742
1743         Code is contributed under MIT/X11 license.
1744
1745 Thu Jun 25 15:48:09 CEST 2009 Paolo Molaro <lupus@ximian.com>
1746
1747         * reflection.c: in mono_method_clear_object () really ensure all the
1748         objects are removed.
1749
1750 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
1751
1752         * loader.c (mono_method_signature): Call into the verifier to check
1753         the method signature.
1754
1755         * metadata-verify.c (verify_method_table): Move signature verification
1756         to verify_method_table_full.
1757
1758         * metadata-verify.c: Add mono_verifier_verify_method_signature.
1759
1760         * verify-internals.h: Export mono_verifier_verify_method_signature as
1761         part of the internal API.
1762
1763 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
1764
1765         * loader.c (mono_method_get_header): Call into the verifier to
1766         check the method header.
1767
1768         * metadata-verify.c: Add mono_verifier_verify_method_header.
1769
1770         * verify-internals.h: Export mono_verifier_verify_method_header as
1771         part of the internal API.
1772
1773 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
1774
1775         * class.c (mono_class_find_enum_basetype): Call into the verifier to
1776         check the field signature. Replace an assert with an explicit check.
1777
1778         * class.c (mono_class_setup_fields): Call into the verifier to check
1779         the field signature.
1780
1781         * metadata-verify.c: Add mono_verifier_verify_field_signature.
1782
1783         * verify-internals.h: Export mono_verifier_verify_field_signature as
1784         part of the internal API.
1785
1786 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
1787
1788         * class.c (mono_class_find_enum_basetype): Simplify this function
1789         by moving code outside of the loop and not decoding static fields.
1790
1791 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
1792
1793         * metadata-verify.c (verify_typedef_table): Check the extends
1794         token here. Move to here a flags check from verify_typedef_table_full.
1795
1796 2009-06-24  Zoltan Varga  <vargaz@gmail.com>
1797
1798         * metadata-verify.c (is_valid_method_header): Fix a warning.
1799
1800         * metadata-internals.h (MonoImage): Remove the unused 
1801         static_rgctx_invoke_wrapper_cache.
1802
1803         * image.c marshal.c: Ditto.
1804
1805 2009-06-23 Rodrigo Kumpera  <rkumpera@novell.com>
1806
1807         * image.c (do_mono_image_load): Enable table data verification.
1808
1809 2009-06-23 Rodrigo Kumpera  <rkumpera@novell.com>
1810
1811         * metadata-verify.c (is_valid_constant): Fix nullref check.
1812
1813 2009-06-23 Rodrigo Kumpera  <rkumpera@novell.com>
1814
1815         * metadata-verify.c (is_valid_constant): Fix string bounds check.
1816
1817 2009-06-22  Mark Probst  <mark.probst@gmail.com>
1818
1819         * sgen-gc.c: Managed allocation with pthreads TLS.
1820
1821         * threads.c, threads-types.h: Functions for the JIT to tell the
1822         runtime whether it supports the MONO_TLS opcode.
1823
1824 2009-06-22 Rodrigo Kumpera  <rkumpera@novell.com>
1825
1826         * metadata-verify.c (verify_param_table): Fix a crash for assemblies
1827         without methods.
1828
1829 2009-06-22 Rodrigo Kumpera  <rkumpera@novell.com>
1830
1831         * metadata-verify.c (is_valid_constant): Fix the string length check.
1832         Use safe overflow checking. Add decent error messages.
1833
1834 2009-06-22 Rodrigo Kumpera  <rkumpera@novell.com>
1835
1836         * metadata-verify.c: Move remaininh blob checks to the offline
1837         verification path.
1838
1839 2009-06-22 Rodrigo Kumpera  <rkumpera@novell.com>
1840
1841         * metadata-verify.c: Move more blob checks to the offline verification
1842         path.
1843
1844 2009-06-22  Bill Holmes  <billholmes54@gmail.com>
1845
1846         * object-internals.h : Adding interrupt_on_stop field.
1847
1848         * threads.c (mono_thread_request_interruption) : On Windows exit the
1849           thread if interrupt_on_stop is set.
1850
1851         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Accept_internal) :
1852          Removing old interrupt logic and setting the interrupt_on_stop for the
1853          thread when calling accept.
1854
1855         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Receive_internal) :
1856          setting the interrupt_on_stop for the thread when calling accept.
1857
1858         Contributed under MIT/X11 license.
1859
1860 2009-06-20  Martin Baulig  <martin@ximian.com>
1861
1862         * mono-debug.h (MONO_DEBUGGER_MINOR_VERSION): Bump to 3.
1863
1864 2009-06-21  Zoltan Varga  <vargaz@gmail.com>
1865
1866         * appdomain.c (mono_try_assembly_resolve): Don't call managed code when
1867         running in no-exec mode.
1868
1869 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
1870
1871         * metadata-verify.c (verify_method_table): Move header
1872         checking to verify_method_table_full.
1873
1874         * metata-verify.c (mono_verifier_verify_full_table_data):
1875         Call verify_method_table_full.
1876
1877 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
1878
1879         * metadata-verify.c (verify_field_table): Move signature
1880         checking to verify_field_table_full.
1881
1882         * metata-verify.c (mono_verifier_verify_full_table_data):
1883         Call verify_field_table_full.
1884
1885 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
1886
1887         * metadata-verify.c (verify_typedef_table): Move remaining
1888         stuff to verify_typedef_table_full.
1889
1890 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
1891
1892         * metadata-verify.c: Kill is_corlib from VerifyContext.
1893         It is only used by the offline mode.
1894         So we better remove it from the runtime path.
1895
1896 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
1897
1898         * metadata-verify.c: Add new mono_verifier_verify_full_table_data
1899         function that perform the offline metadata verification steps.
1900
1901         * metadata-verify.c (verify_typedef_table): Move some checks to
1902         verify_typedef_table_full and make it been called by new function
1903         mono_verifier_verify_full_table_data.
1904
1905         * pedump.c: Call mono_verifier_verify_full_table_data.
1906
1907         * verify-internals.h: Export mono_verifier_verify_full_table_data as
1908         part of the internal API.
1909
1910 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
1911
1912         * metadata-verify.c (typedef_is_system_object): Fix System.Object
1913         check.
1914
1915         * metadata-verify.c (verify_implmap_table): Fix implmap invalid
1916         flags bits. SupportLastError was confused as bit 7 instead of 6.
1917
1918         * metadata-verify.c (verify_implmap_table): Fix import scope verification
1919         to check against the module ref table instead of module.
1920
1921         * metadata-verify.c (verify_implmap_table): Fix corlib check.
1922
1923         * pedump.c: Call mono_image_load_names.
1924
1925 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
1926
1927         * image.c: Extract mono_image_load_names from do_mono_image_load.
1928
1929         * metadata-internals.h: Export mono_image_load_names as part of
1930         the internal API.
1931         
1932 2009-06-19  Zoltan Varga  <vargaz@gmail.com>
1933
1934         * metadata.c (mono_metadata_cleanup): Free the generic method cache
1935         first, as it could reference data in the other caches.
1936
1937 2009-06-18 Rodrigo Kumpera  <rkumpera@novell.com>
1938
1939         * metadata-verify.c: Finished with method header verification.
1940
1941 2009-06-18 Rodrigo Kumpera  <rkumpera@novell.com>
1942
1943         * metadata-verify.c: Added more header verification code.
1944         Now only EH clauses are missing.
1945
1946 2009-06-17  Zoltan Varga  <vargaz@gmail.com>
1947
1948         * marshal.c (get_runtime_invoke_type): Don't share primitive types
1949         for return values.
1950
1951 2009-06-16 Rodrigo Kumpera  <rkumpera@novell.com>
1952
1953         * metadata-verify.c: Initial method header verification.
1954
1955 2009-06-16 Rodrigo Kumpera  <rkumpera@novell.com>
1956
1957         * metadata-verify.c (verify_import_table): The IAT contents
1958         might end been patched by the windows DL when running with
1959         coree enabled.
1960
1961 2009-06-15 Rodrigo Kumpera  <rkumpera@novell.com>
1962
1963         * class.c (mono_class_from_typeref): If the enclosing type is not
1964         found return null instead of crashing. Fixes #508487.
1965
1966 2009-06-15  Atsushi Enomoto  <atsushi@ximian.com>
1967
1968         * normalization-tables.h : updated to the latest unicode charcter
1969           data.
1970         * appdomain.c : bump corlib version.
1971
1972 2009-06-14  Zoltan Varga  <vargaz@gmail.com>
1973
1974         * class.c (mono_class_from_name): Fix support for assembly references
1975         in the EXPORTEDTYPE table. Fixes #511704.
1976
1977 2009-06-13  Geoff Norton  <gnorton@novell.com>
1978
1979         * domain.c: Ensure that mono_domain_assembly_open actually opens the
1980         assembly in the target domain.
1981
1982 2009-06-12  Robert Jordan  <robertj@gmx.net>
1983
1984         * cominterop.c (cominterop_get_ccw): Increment mspec's SizeParamIndex
1985         because "this" of the managed signature has become an
1986         ordinary parameter in the unmanaged signature.
1987
1988 2009-06-12  Zoltan Varga  <vargaz@gmail.com>
1989
1990         * class-internals.h (struct _MonoGenericContainer): Add an 'image'
1991         field for owner-less generic containers.
1992
1993         * reflection.c (mono_reflection_initialize_generic_parameter): Set the
1994         image field of the owner-less generic containers created here.
1995
1996         * metadata.c (mono_metadata_load_generic_params): Ditto, the
1997         contain is ownerless until the caller sets its owner.
1998
1999         * metadata.c (type_in_image): Handle owner-less generic containers
2000         correctly.
2001         
2002 2009-06-11  Zoltan Varga  <vargaz@gmail.com>
2003
2004         * image.c (mono_image_close): Support debug_assembly_unload for
2005         dynamic images too.
2006
2007 2009-06-11 Andrés G. Aragoneses  <aaragoneses@novell.com>
2008
2009         * class.c: Fix some typos in comments.
2010
2011 2009-06-11  Zoltan Varga  <vargaz@gmail.com>
2012
2013         * reflection.c (add_custom_modifiers): Avoid reading invalid memory.
2014
2015         * threads.c (mono_thread_execute_interruption): Avoid creating the
2016         abort exception object while holding the synch_cs lock.
2017
2018 2009-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
2019
2020         * metadata-verify.c: Verify basic cattr content.
2021
2022 2009-06-10  Zoltan Varga  <vargaz@gmail.com>
2023
2024         * reflection.c (add_exported_type): Don't set the FORWARDER flag on
2025         nested types.
2026         
2027         * reflection.c (mono_image_fill_export_table_from_type_forwarders): Add
2028         support for nested types. Fixes #511704.
2029
2030 2009-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
2031
2032         * metadata-verify.c: Verify methodspec signatures.
2033
2034 2009-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
2035
2036         * metadata-verify.c: Verify typespec signatures.
2037
2038 2009-06-09  Zoltan Varga  <vargaz@gmail.com>
2039
2040         * metadata.c (free_inflated_method): Call 
2041         mono_marshal_free_inflated_wrappers (), which was missed earlier.
2042
2043 2009-06-08  Miguel de Icaza  <miguel@novell.com>
2044
2045         * mono-config.c: Small change to report the PPC64/ILP32 model.
2046
2047 2009-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
2048
2049         * metadata-verify.c (parse_type): Check szarray.
2050
2051 2009-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
2052
2053         * metadata-verify.c (parse_type): Check fnptr.
2054
2055 2009-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
2056
2057         * metadata-verify.c (parse_type): Check generic instances.
2058
2059 2009-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
2060
2061         * metadata-verify.c (parse_type): Check array shape.
2062
2063 2009-06-05  Robert Jordan  <robertj@gmx.net>
2064
2065         * class.c (mono_class_create_from_typedef): Check only for
2066         mscorlib's System.Array.
2067
2068 2009-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
2069
2070         * metadata-verify.c (parse_type): Check pointer, class/valuetype
2071         and generic params. 
2072
2073         * metadata-verify.c (parse_field): Check the signature.
2074
2075 2009-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
2076
2077         * metadata-verify.c: Implement locals signature check.
2078
2079 2009-06-04  Marek Safar  <marek.safar@gmail.com>
2080
2081         * domain.c: Add .NET 4.0 Beta 1 version.
2082
2083 2009-06-04  Bill Holmes  <billholmes54@gmail.com>
2084
2085         * cominterop.c (cominterop_ccw_queryinterface): Fix for bug 499566.
2086           For QueryInterface on CCWs consider the base class
2087           interfaces as well.
2088
2089         Code is contributed under MIT/X11 license.
2090
2091 2009-06-04  Zoltan Varga  <vargaz@gmail.com>
2092
2093         * wrapper-types.h: Delete STATIC_RGCTX_INVOKE.
2094
2095         * marshal.c (mono_marshal_ret_static_rgctx_invoke): Remove, no longer
2096         used.
2097
2098         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Avoid
2099         adding a static-rgctx invoke wrapper, it is done by the runtime trampolines.
2100
2101         * generic-sharing.c (inflate_other_data): Ditto.
2102         
2103 2009-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
2104
2105         * metadata-verify.c: Implement property signature check.
2106
2107 2009-06-04  Mark Probst  <mark.probst@gmail.com>
2108
2109         * sgen-gc.h: Register saving support for PPC.
2110
2111 2009-06-04  Mark Probst  <mark.probst@gmail.com>
2112
2113         * sgen-gc.c: Fixed a pthread TLS screwup.
2114
2115 2009-06-04  Mark Probst  <mark.probst@gmail.com>
2116
2117         * sgen-gc.c: Do TLS using pthread API if __thread keyword is not
2118         supported.
2119
2120 2009-06-04  Mark Probst  <mark.probst@gmail.com>
2121
2122         * sgen-gc.c: Disable TLA and managed allocation if the __thread
2123         keyword is not supported.
2124
2125 2009-06-04  Zoltan Varga  <vargaz@gmail.com>
2126
2127         * marshal.c metadata.c: Applied patch from Ulrich Weigand 
2128         <uweigand@de.ibm.com>: Free the wrappers of inflated generic methods when
2129         the inflated method is freed. Fixes #508389.
2130
2131         The code is contributed under the MIT/X11 license.
2132         
2133 2009-06-03  Zoltan Varga  <vargaz@gmail.com>
2134
2135         * marshal.c (get_wrapper_target_class): New helper function.
2136         (mono_marshal_get_runtime_invoke): Place runtime-invoke wrappers into
2137         the <Module> class of the image. Fixes #509049.
2138
2139 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
2140
2141         * threads.c (ves_icall_System_Threading_Thread_Sleep_internal):
2142         Check if the thread was interrupted and proccess it straight away.
2143         Makes abortion much more responsive.
2144
2145 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
2146
2147         * threads.c (mono_thread_execute_interruption): Use atomic cas with
2148         MonoThread::interruption_requested to match it's counterpart.
2149
2150         Fixes a hang in abort-stress-1 on a 2 core x86.
2151
2152         * threads.c (ves_icall_System_Threading_Thread_GetAbortExceptionState):
2153         Fix warning.
2154
2155 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
2156
2157         Change MonoImage::name_cache to be protected by the image lock
2158         instead of the loader lock.
2159
2160         * appdomain.c (deregister_reflection_info_roots): Protect access
2161         to name_cache.
2162
2163         * class.c (mono_image_init_name_cache): Change from the loader lock
2164         to the image lock. Check if the cache wasn't already created.
2165
2166         * class.c: Change from the loader to the image lock.
2167
2168         * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces): Fix
2169         the code to hold the image lock while iterating over name_cache and
2170         not go into mono_array_new holding it.
2171
2172         * metadata-internals.h: Add a comment about this change.
2173
2174 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
2175
2176         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType):
2177         Under the 2.0 profile raise the loader error.
2178
2179         Fixes #508532.
2180
2181 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
2182
2183         * marshal.c (mono_marshal_get_runtime_invoke): Emit the right kind
2184         of ldind opcode for generic instances so we don't fail for direct wrappers.
2185         This only affect direct calls.
2186
2187 2009-05-31  Zoltan Varga  <vargaz@gmail.com>
2188
2189         * reflection.c (create_dynamic_mono_image): Fix warnings.
2190
2191         * generic-sharing.c (other_info_equal): Ditto.
2192         
2193 2009-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
2194
2195         * metadata-verify.c: Implement field signature check.
2196
2197 2009-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
2198
2199         * metadata-verify.c: Implement standalone signature check.
2200
2201 2009-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
2202
2203         * metadata-verify.c: Implement methodref signature check.
2204
2205 2009-05-28  Zoltan Varga  <vargaz@gmail.com>
2206
2207         * object-internals.h (MonoRuntimeCallbacks): New structure containing
2208         callbacks supplied by the runtime.
2209
2210         * object.c (mono_install_callbacks): New internal function to install
2211         the callbacks.
2212
2213         * object.c (mono_create_ftnptr): Move the implementation of this to
2214         mini/.
2215
2216         * object.c (mono_get_addr_from_ftnptr): Ditto.  
2217
2218 2009-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
2219
2220         * metadata-verify.c (parse_return_type): Proper byref check.
2221         * metadata-verify.c (is_valid_method_signature): Check for zero arity
2222         generic signatures and method params.
2223
2224 2009-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
2225
2226         * metadata-verify.c (decode_signature_header): Fix bounds check.
2227
2228         * metadata-verify.c (parse_custom_mods): Check custom mods.
2229
2230         * metadata-verify.c (parse_type): Do initial basic verification
2231         of valid values.
2232         
2233         * metadata-verify.c (is_valid_method_signature): Parse the generic
2234         param count.
2235
2236 2009-05-26 Rodrigo Kumpera  <rkumpera@novell.com>
2237
2238         * icall.c (ves_icall_Type_GetMethodsByName): Virtual methods should be
2239         discarded based on their most specific definition so we set the method_slots
2240         array before checking if the method is acceptable or not.
2241
2242         Fixes #506757.
2243
2244 2009-05-26  Mark Probst  <mark.probst@gmail.com>
2245
2246         * icall.c: Free the old array when resizing a mono_ptr_array.
2247
2248 2009-05-26  Mark Probst  <mark.probst@gmail.com>
2249
2250         * reflection.c (create_dynamic_mono_image): Use mono_object_hash()
2251         for the hashes whose keys are managed objects.
2252
2253 2009-05-26  Mark Probst  <mark.probst@gmail.com>
2254
2255         * object-internals.h, threads.c: Set the execution context on
2256         thread start here, not in corlib.
2257
2258         * appdomain.c: Bump corlib version.
2259
2260 2009-05-27  Martin Baulig  <martin@ximian.com>
2261
2262         * mono-debug.c (mono_debug_init): Use `MONO_DEBUG_FORMAT_DEBUGGER'
2263         if `_mono_debug_using_mono_debugger' is set to make things work
2264         properly when embedding Mono.
2265
2266 2009-05-25 Rodrigo Kumpera  <rkumpera@novell.com>
2267
2268         * class.c (mono_class_setup_fields): Don't mark simd types as having
2269         16 bytes alignment as the whole runtime doesn't support.
2270
2271 2009-05-25 Rodrigo Kumpera  <rkumpera@novell.com>
2272
2273         * metadata-verify.c (safe_read): Use endian safe read macros.
2274
2275 2009-05-25  Zoltan Varga  <vargaz@gmail.com>
2276
2277         * object.c (mono_create_ftnptr): Don't allocate from the code mempool since
2278         it is read-only when using full aot.
2279
2280 2009-05-22 Rodrigo Kumpera  <rkumpera@novell.com>
2281
2282         * metadata-verify.c (is_valid_method_signature): Verify parts
2283         of the return type. Provide an error message in case of failure.
2284
2285 2009-05-22 Rodrigo Kumpera  <rkumpera@novell.com>
2286
2287         * metadata-verify.c (is_valid_method_signature): Verify the call conv.
2288
2289 2009-05-22 Rodrigo Kumpera  <rkumpera@novell.com>
2290
2291         * metadata-verify.c: Include the size prefix in the bounds check.
2292
2293 2009-05-22  Miguel de Icaza  <miguel@novell.com>
2294
2295         * icall.c: Remove warnings.
2296
2297         * mono-config.c: Allow for CONFIG_CPU to be set in config.h and
2298         prevent auto-detection based on GCC defines.
2299
2300         Add PS3
2301
2302         * metadata-verify.c: Do not include signal.h
2303
2304         * generic-sharing.c, marshal.c: Add returns to avoid some warning
2305         messages.  Not sure why the g_assert_not_reached is not enough to
2306         quiet the compiler.
2307         
2308
2309         * appdomain.c: Remove code that is not used when
2310         DISABLE_SHADOW_COPY is set.
2311
2312         * image.c: use g_getenv
2313
2314 2009-05-21  Miguel de Icaza  <miguel@novell.com>
2315
2316         * reflection.c: Remove code that it not used with
2317         DISABLE_REFLECTION_EMIT is defined.
2318
2319 2009-05-21  Zoltan Varga  <vargaz@gmail.com>
2320
2321         * marshal.c (mono_marshal_get_runtime_invoke): Share more runtime
2322         invoke wrappers.
2323
2324 2009-05-20  Miguel de Icaza  <miguel@novell.com>
2325
2326         * socket-io.c
2327         (ves_icall_System_Net_Sockets_Socket_Available_internal): Remove
2328         the ifdef here and instead put that on io-layer
2329
2330 2009-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
2331
2332         * metadata-verify.c: Verify the generic param constraint table.
2333
2334 2009-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
2335
2336         * metadata-verify.c (verify_generic_param_table): Fix
2337         thinko on the valid flags bits for generic params.
2338
2339 2009-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
2340
2341         * metadata-verify.c: Verify the methodspec table.
2342
2343 2009-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
2344
2345         * metadata-verify.c: Verify the generic param table.
2346
2347 2009-05-19  Mark Probst  <mark.probst@gmail.com>
2348
2349         * sgen-gc.c: Store and use the count with REMSET_VTYPE.
2350
2351 2009-05-19  Mark Probst  <mark.probst@gmail.com>
2352
2353         * sgen-gc.c: Use generation enum more consistently and use the
2354         correct generation in mono_gc_register_for_finalization().
2355
2356 2009-05-18 Rodrigo Kumpera  <rkumpera@novell.com>
2357
2358         * metadata-verify.c: Verify the nested class table.
2359
2360 2009-05-18 Rodrigo Kumpera  <rkumpera@novell.com>
2361
2362         * metadata-verify.c: Verify the manifest resource table.
2363
2364 2009-05-17  Zoltan Varga  <vargaz@gmail.com>
2365
2366         * debug-helpers.c (dis_one): Add little-endian support for ldstr.
2367
2368 2009-05-16  Zoltan Varga  <vargaz@gmail.com>
2369
2370         * class.c (mono_class_get_vtable_entry): Avoid adding static-rgctx
2371         wrappers, this is now done in the JIT.
2372         
2373         * class.c (mono_set_generic_sharing_supported): New internal function.
2374         (mono_class_generic_sharing_enabled): Move the #ifdef stuff to the JIT.
2375
2376 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
2377
2378         * metadata-verify.c: Verify the exported type table.
2379
2380 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
2381
2382         * pedump.c (main): Fake an assembly for netmodules to make the verifier happy.
2383
2384 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
2385
2386         * metadata-verify.c: Verify the file table.
2387
2388 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
2389
2390         * metadata-verify.c (verify_assembly_table): Fix an error message.
2391
2392         * metadata-verify.c: Verify the assemblyref table.
2393
2394 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
2395
2396         * metadata-verify.c (verify_assembly_table): Fix the valid
2397         bits mask for flags.
2398
2399 2009-05-15  Zoltan Varga  <vargaz@gmail.com>
2400
2401         * debug-helpers.c (mono_method_full_name): Print generic parameters of
2402         generic methods as well.
2403
2404 2009-05-15  Geoff Norton  <gnorton@novell.com>
2405
2406         * gc.c: MachO/Darwin supports and uses semaphores fine for this 
2407         use-case and is significantly more performant than the wapi layer.
2408
2409 2009-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
2410
2411         * metadata-verify.c: Verify the assembly table.
2412
2413 2009-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
2414
2415         * metadata-verify.c: Fix rows limit check.
2416
2417 2009-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
2418
2419         * metadata-verify.c: Verify the fieldrva table.
2420
2421 2009-05-13  Mark Probst  <mark.probst@gmail.com>
2422
2423         * sgen.c: Speed up weak links and finalizers by grouping them by
2424         generation.
2425
2426 2009-05-13  Mark Probst  <mark.probst@gmail.com>
2427
2428         * marshal.c (delegate_hash_table_add): When overwriting an entry,
2429         free the old GCHandle (only applies to SGen).
2430
2431 2009-05-13  Zoltan Varga  <vargaz@gmail.com>
2432
2433         * loader.c (mono_get_method_from_token): Avoid the expensive call to
2434         mono_metadata_load_generic_params () for non-generic methods.
2435
2436 2009-05-12  Mark Probst  <mark.probst@gmail.com>
2437
2438         * monitor.c, monitor.h (mono_monitor_get_object_monitor_weak_link):
2439         New function for returning a monitor's weak link if it has one.
2440
2441         * sgen-gc.c: Remove an object's monitor's weak link (if it has
2442         one) when clearing a domain.  These can still be around because
2443         the object might not have been collected.
2444
2445 2009-05-12  Zoltan Varga  <vargaz@gmail.com>
2446
2447         * gc.c: Fix a warning.
2448
2449 2009-05-12  Kornél Pál  <kornelpal@gmail.com>
2450
2451         * gc.c (mono_gc_init): Set gc_thread on creation. This avoids the
2452         prevous wait that resulted in a deadlock on Windows when initializing
2453         the runtime form DllMain. Also results in improved startup time.
2454         (finalizer_thread): Get rid of thread_started_event.
2455         * threads.c, threads-types.h (mono_thread_create_internal): Return the
2456         resulting MonoThread.
2457
2458         Contributed under MIT/X11 license.
2459
2460 2009-05-11 Rodrigo Kumpera  <rkumpera@novell.com>
2461
2462         * metadata-verify.c: Verify the implmap table.
2463         Don't require that #US and #Strings be present.
2464
2465 2009-05-11  Sebastien Pouliot  <sebastien@ximian.com>
2466
2467         * security-core-clr.c: Delegate checks are done at creation time,
2468         not a invocation time. Fix exception for Telerik Silverlight demo
2469
2470 2009-05-11  Mark Probst  <mark.probst@gmail.com>
2471
2472         * sgen-gc.c (need_remove_object_for_domain): Remove the special
2473         case for the Thread class.
2474
2475         * threads.c: Do clean-up of abort exception/state in
2476         thread_cleanup() instead of Thread.free_internal().  Also clean up
2477         current_appcontext.  The reason we have to do that is because
2478         those references might point into another domain and if that
2479         domain is unloaded before the thread is finalized, they point to
2480         invalid data.
2481
2482 2009-05-10  Andreas Faerber  <andreas.faerber@web.de>
2483
2484         * null-gc.c (mono_gc_weak_link_add, mono_gc_clear_domain): Fix
2485         stub signatures.
2486         
2487         Contributed unter MIT/X11 license.
2488
2489 2009-05-09  Miguel de Icaza  <miguel@novell.com>
2490
2491         * verify.c, metadata-verifier.c: Add support for disabling the
2492         verifier in some builds.
2493
2494         [ Sorry, my previous commit accidentally commited some work in
2495         progress ]
2496
2497 2009-05-08  Zoltan Varga  <vargaz@gmail.com>
2498
2499         * class.c (mono_class_setup_fields): Set class->field.first for
2500         generic instances.
2501
2502 2009-05-07 Rodrigo Kumpera  <rkumpera@novell.com>
2503
2504         * metadata-verify.c: Verify the typespec table.
2505
2506 2009-05-07 Rodrigo Kumpera  <rkumpera@novell.com>
2507
2508         * metadata-verify.c: Verify the module table.
2509
2510 2009-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
2511
2512         * metadata-verify.c: Verify the methodimpl table.
2513
2514 2009-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
2515
2516         * metadata-verify.c: Verify the property table.
2517
2518 2009-05-06  Zoltan Varga  <vargaz@gmail.com>
2519
2520         * debug-helpers.c (mono_method_desc_match): Add support for generic
2521         glob patterns.
2522
2523 2009-05-05 Rodrigo Kumpera  <rkumpera@novell.com>
2524
2525         * metadata-verify.c: Verify the propertymap table.
2526
2527 2009-05-04 Rodrigo Kumpera  <rkumpera@novell.com>
2528
2529         * metadata-verify.c: Verify the event table.
2530
2531         * metadata-verify.c (search_sorted_table): Fix offset
2532         calculation.
2533
2534 2009-05-02  Zoltan Varga  <vargaz@gmail.com>
2535
2536         * domain-internals.h (struct _MonoJitInfo): Add a 'from_llvm' flag.
2537
2538 2009-05-01  Mark Probst  <mark.probst@gmail.com>
2539
2540         * gc.c (mono_gc_run_finalize): Don't set the domain too late,
2541         because mono_delegate_free_ftnptr() needs it.
2542
2543 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
2544
2545         * metadata-verify.c: Verify the eventmap table.
2546
2547 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
2548
2549         * metadata-verify.c: Verify the standalonesig table.
2550
2551 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
2552
2553         * metadata-verify.c: Verify the field layout table.
2554
2555 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
2556
2557         * class.c (mono_type_get_name_recurse): Don't crash
2558         for ownerless generic params.
2559
2560         * debug-helpers.c (mono_type_get_desc): Correct the format
2561         for ownerless generic params.
2562
2563 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
2564
2565         * metadata-verify.c: Verify the class layout table.
2566
2567 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
2568
2569         * metadata-verify.c: Verify the decl security table.
2570
2571 2009-04-30  Mark Probst  <mark.probst@gmail.com>
2572
2573         * domain.c (mono_domain_set_internal_with_options): Don't do
2574         anything if the old domain is the same as the old one.  Fixes
2575         #499326.
2576
2577 2009-04-30  Mark Probst  <mark.probst@gmail.com>
2578
2579         * appdomain.c: Deregister the reflection_info roots when unloading
2580         a domain.
2581
2582         * sgen-gc.c, domain.c, gc-internal.h: mono_gc_clear_domain() nulls
2583         memory allocated by a domain and frees its disappearing links.
2584
2585         * boehm-gc.c, null-gc.c: Empty implementation of
2586         mono_gc_clear_domain().
2587
2588 2009-04-30  Mark Probst  <mark.probst@gmail.com>
2589
2590         * appdomain.c (clear_cached_vtable): Free the static fields memory
2591         block.
2592
2593 2009-04-30  Mark Probst  <mark.probst@gmail.com>
2594
2595         * gc.c: Set the correct domain when invoking finalizers.
2596
2597         * appdomain.c: Set the correct domain when creating threads.
2598
2599 2009-04-30  Mark Probst  <mark.probst@gmail.com>
2600
2601         * sgen-gc.c: Fix skip size for vectors.
2602
2603 2009-05-03  Martin Baulig  <martin@ximian.com>
2604
2605         * mono-debug-debugger.c
2606         (mono_debugger_check_breakpoints): Check class init handlers even
2607         if we don't have any method load handers.
2608
2609 2009-04-30  Zoltan Varga  <vargaz@gmail.com>
2610
2611         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Avoid 
2612         returning refonly assemblies if refonly is FALSE. Fixes #499013.
2613
2614 2009-04-29 Rodrigo Kumpera  <rkumpera@novell.com>
2615
2616         * metadata-verify.c: Verify the field marshal table.
2617
2618 2009-04-29 Rodrigo Kumpera  <rkumpera@novell.com>
2619
2620         * metadata-verify.c: Verify the custom attribute table.
2621
2622 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
2623
2624         * metadata-verify.c: Verify the constant table.
2625
2626 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
2627
2628         * metadata-verify.c: Verify the memberef table.
2629
2630 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
2631
2632         * metadata-verify.c (get_coded_index_token): Remove
2633         dead argument.
2634
2635 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
2636
2637         * metadata-verify.c: Verify the interfaceimpl table.
2638
2639 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
2640
2641         * verify.c: Improve error message.
2642
2643         * debug-helpers.c (mono_type_get_desc): Harden the code that
2644         deals with VAR and MVAR.
2645
2646 2009-04-28  Zoltan Varga  <vargaz@gmail.com>
2647
2648         * image.c (mono_image_fixup_vtable): Avoid casting an lvalue. Fixes 
2649         part of #498692.
2650
2651 2009-04-23 Tom Hindle <tom_hindle@sil.org>
2652
2653         * cominterop.c (ves_icall_System_Runtime_InteropServices_Marshal_ReleaseComObjectInternal):
2654         changed to match .Net behaviour of not aborting on additional calls to ReleaseComObject.
2655
2656 2009-04-28  Sebastien Pouliot  <sebastien@ximian.com>
2657
2658         * security-core-clr.c: Avoid redundant checks for platform code, 
2659         e.g. check for method and for class (very common) and check
2660         for class and outer class (less common)...
2661
2662 2009-04-27  Zoltan Varga  <vargaz@gmail.com>
2663
2664         * reflection.c: Avoid returning random cattrs for synthetic methods.
2665         Fixes #498545.
2666
2667 2009-04-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
2668
2669         * assembly.c: assemblies in the GAC should never be shadow-copied.
2670
2671 2009-04-26  Mark Probst  <mark.probst@gmail.com>
2672
2673         * domain.c, domain-internals.h: Disable
2674         track_resurrection_{objects,handles}_hash in MonoDomain if using
2675         SGen.
2676
2677 2009-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
2678
2679         * metadata-verify.c: Verify the param table.
2680
2681 2009-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
2682
2683         * metadata-verify.c (verify_typedef_table): Range check FieldList and
2684         MethodList.
2685
2686         * metadata-verify.c (verify_method_table): Proper check the ParamList
2687         field.
2688
2689 2009-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
2690
2691         * metadata-verify.c (verify_method_table): Check for runtime
2692         implemented functions such as delegate .ctors. Remove spurious
2693         printf.
2694         
2695 2009-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
2696
2697         * pedump.c: Proper initialize the runtime forcing the 2.0 profile.
2698
2699 2009-04-24  Raja R Harinath  <harinath@hurrynot.org>
2700
2701         Don't allocate MonoGenericInfo for ownerless generic params.
2702         * class-internals.h (MonoGenericParam::info): Move field to ...
2703         (MonoGenericParamFull): ... this.  New struct.
2704         (MonoGenericContainer::type_params): Change type to
2705         MonoGenericParamFull.
2706         (MonoGenericParam, MonoGenericContainer): Update accessors.
2707         * metadata.c (mono_metadata_parse_generic_param): Don't initialize
2708         'info' field for ownerless generic param.
2709         (mono_metadata_load_generic_params): Update to changes.
2710         * reflection.c (mono_reflection_create_generic_class): Likewise.
2711         (reflection_methodbuilder_to_mono_method): Likewise.
2712         (mono_reflection_initialize_generic_parameter): Likewise.
2713
2714 2009-04-24  Raja R Harinath  <harinath@hurrynot.org>
2715
2716         Don't use MonoGenericParamInfo for ownerless generic params.
2717         * class.c (get_anon_gparam_class, set_anon_gparam_class): New.  Don't
2718         use ParamInfo class at all.
2719         (mono_class_from_generic_parameter): Use them.
2720         (make_generic_param_class): Fix a couple of instances where 'pinfo
2721         == NULL' wasn't handle.
2722
2723 2009-04-24  Raja R Harinath  <harinath@hurrynot.org>
2724
2725         * class.c (make_generic_param_class): Carve out of ...
2726         (mono_class_from_generic_parameter): ... here.
2727
2728 2009-04-24  Raja R Harinath  <harinath@hurrynot.org>
2729
2730         Simplify mono_class_from_generic_parameter
2731         * class-internals.h (MonoGenericParamInfo::token): New field.
2732         * metadata.c (mono_metadata_load_generic_params): Initialize it
2733         from metadata.
2734         * class.c (mono_class_from_generic_parameter): Use it instead of
2735         searching through metadata.
2736
2737 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
2738
2739         * metadata-verify.c: Add verification of the method table.
2740
2741 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
2742
2743         * icall.c (ves_icall_Type_GetMethodsByName): Fix memleak for the
2744         Delegate::Invoke optimization.
2745
2746 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
2747
2748         * appdomain.c (mono_domain_create_appdomain_internal): Free the
2749         string returned by get_shadow_assembly_location_base.
2750
2751         * appdomain.c (get_shadow_assembly_location_base): Add a comment
2752         about caller's ownership.
2753
2754 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
2755
2756         * reflection.c: Add mono_reflection_cleanup_domain to cleanup
2757         reflection memory on domain unload.
2758
2759         * domain.c (mono_domain_free): Don't free refobject_hash, let the
2760         reflection cleanup code do it.
2761
2762         * domain-internals.h: Add mono_reflection_cleanup_domain.
2763
2764         This fixes a memory leak for managed mirrors of reflection objects
2765         on domain unload. 
2766
2767 2009-04-22 Rodrigo Kumpera  <rkumpera@novell.com>
2768
2769         * metadata-verify.c: Implement more verification of the field table.
2770
2771 2009-04-22 Rodrigo Kumpera  <rkumpera@novell.com>
2772
2773         * pedump.c (main): Init mono with mscorlib so it defaults to 2.0 and
2774         doesn't try to parse the input assembly, which can be broken.
2775
2776 2009-04-23  Mark Probst  <mark.probst@gmail.com>
2777
2778         * boehm-gc.c, gc-internal.h, gc.c, monitor.c, null-gc.c,
2779         sgen-gc.c: Implement track resurrection in weak GC handles in SGen
2780         by using the lowest bit in the link to store whether the link is
2781         tracked.  Move the track_resurrection hashes into boehm-gc.c.
2782
2783 2009-04-22  Miguel de Icaza  <miguel@novell.com>
2784
2785         * Makefile.am: Split the console support in platform specific code
2786         and put together a framework for making this easy in the future so
2787         that we can start splitting code instead of having a mess of PLATFORM_WIN32
2788
2789 2009-04-21 Rodrigo Kumpera  <rkumpera@novell.com>
2790
2791         * pedump.c: Fix a warning.
2792
2793 2009-04-21 Rodrigo Kumpera  <rkumpera@novell.com>
2794
2795         * verify.c (mono_delegate_type_equal): Compare valuetypes using
2796         mono_class_from_mono_type to avoid bad interactions with the dual representation
2797         of the generic type definition.
2798
2799 2009-04-21 Rodrigo Kumpera  <rkumpera@novell.com>
2800
2801         * verify.c (do_invoke_method): Use mono_class_from_mono_type to
2802         get the MonoClass for the call context type as it might be a generic
2803         instance.
2804
2805         Fixes #491483.
2806
2807 2009-04-21  Mark Probst  <mark.probst@gmail.com>
2808
2809         * object-internals.h: The Thread object has no execution_context
2810         member anymore.
2811
2812         * threads.c, threadpool.c, threads-types.h: Accessor functions for
2813         the execution context.
2814
2815         * appdomain.c: Bump corlib version.
2816
2817 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
2818
2819         * verify.c (do_newobj): Improve error message.
2820
2821 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
2822
2823         * verify.c (verify_clause_relationship): Only mask as an error if the exception clause
2824         is nested in the filter block.
2825
2826         * verify.c (verify_clause_relationship): The disjoint check must verify if the exception
2827         block is not fully nested.
2828
2829         Fixes #495656.
2830
2831 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
2832
2833         * verify.c (verify_type_compatibility_full): Compare MonoClass and
2834         not MonoType to check for equality of valuetypes as the generic type
2835         definition allows for two different encodings: the generic type definition
2836         class or a generic instance over the GTD arguments.
2837
2838         Fixes #496175.
2839
2840 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
2841
2842         * verify.c (dump_stack_value): Fix compilation with extra debug turned on.
2843
2844         * verify.c (do_initobj): Improve error message.
2845
2846 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
2847
2848         * metadata-verify.c: Enable pe verification as the issue with #496453
2849         is that the authenticode data directory have a different unspecified
2850         format. Ignore it for now.
2851
2852         * pedump.c: Run the metadata verifier together with the IL verifier.
2853
2854         Fixes ##496453.
2855
2856 2009-04-20  Rolf Bjarne Kvinge  <RKvinge@novell.com>
2857
2858         * metadata-verify.c: Temporarily disable pe verification due to #496453.
2859
2860 2009-04-17 Rodrigo Kumpera  <rkumpera@novell.com>
2861
2862         * class.c (can_access_type): Check visibility against
2863         the element type for pointers and arrays.
2864
2865         Fixes #496150.
2866
2867 2009-04-17 Rodrigo Kumpera  <rkumpera@novell.com>
2868
2869         * metadata-verify.c: Fix cli and table verification to use information
2870         from the MonoImage. A lot of duplicated code got killed.
2871
2872 2009-04-17 Rodrigo Kumpera  <rkumpera@novell.com>
2873
2874
2875         This patch starts to integrate the metadata verifier with the runtime code.
2876
2877         This patch causes major regression in functionality for the metadata verifier
2878         as cli and table verification are disabled since they require to be ported to
2879         use MonoImage information.
2880
2881         * image.c (do_mono_image_load): Split the code in this function
2882         into mono_image_load_pe_data and mono_image_load_cli_data.
2883         Add     care_about_pecoff parameter to not load pecoff data.
2884         Call into the metadata verifier for pecoff and cli verification.
2885
2886         * image.c (mono_image_open_raw): New function that doesn't perform
2887         any parsing of the image contents.
2888         
2889         The reason for the 3 new functions is to give pedump better control
2890         into the interaction with the verifier.
2891
2892         * metadata-internals.h: Add new functions from image.c as part of the
2893         internal mono API.
2894
2895         * metadata-verify.c: Split mono_image_verify into mono_verifier_verify_pe_data,
2896         mono_verifier_verify_cli_data and mono_verifier_verify_table_data. Prepare
2897         to make those functions work together with the runtime.
2898
2899         * verify.c: Add mono_verifier_is_enabled_for_image function that returns
2900         true if the image needs to be verified.
2901
2902         * verify-internals.h: Export new functions from metadata-verify.c and verify.c.
2903
2904         * pedump.c: Use new metadata verifier API.
2905
2906 2009-04-19  Zoltan Varga  <vargaz@gmail.com>
2907
2908         * object.c (mono_install_vtable_trampoline): Make this receive a
2909         trampoline creation function instead of trampoline, allowing the JIT
2910         to use a different trampoline for each vtable.
2911
2912 2009-04-18  Mark Probst  <mark.probst@gmail.com>
2913
2914         * object.c (mono_raise_exception): Don't reset the thread abort
2915         exception state here.
2916
2917 2009-04-18  Mark Probst  <mark.probst@gmail.com>
2918
2919         * icall-def.h: New icall for getting the thread abort exception
2920         state for a thread.
2921
2922         * object.c, thread.c, object-internals.h: A thread's abort
2923         exception state is now a GC handle.  To get the object it stands
2924         for, we must move it into the current app domain, if it's
2925         different than the one where it originated from.
2926
2927         * appdomain.c: Bump corlib version.
2928
2929         * domain.c, domain-internals.h: New function for setting the
2930         domain and migrate the thread abort exception or not.
2931
2932 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
2933
2934         * metadata-verify.c: Add initial verification of the
2935         field table.
2936
2937 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
2938
2939         * metadata-verify.c: Add a macro to conditionally enable
2940         dumping of verification information. Add  make_coded_token
2941         and search_sorted_table to enable search sorted tables
2942         by a given coded token.
2943
2944 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
2945
2946         * metadata-verify.c: Add array mapping from table index
2947         to description offset. Add get_col_offset and get_col_size
2948         functions.
2949
2950 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
2951
2952         * metadata-verify.c: Add remaining table descriptions offsets.
2953         Add remaining coded index descriptions.
2954
2955 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
2956
2957         * metadata-verify.c: Fixed constant table description.
2958         Fixed calculation of HasCustomAttribute coded index size.
2959         Fixed calculation of size for many table indexes. 
2960
2961 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
2962
2963         * pedump.c (dump_metadata): Dump table offset instead
2964         of useless pointer in memory.
2965
2966 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
2967
2968         * metadata-verify.c (verify_typedef_table): Add tests for MethodList.
2969
2970 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
2971
2972         * metadata-verify.c (verify_typedef_table): Add tests for FieldList and
2973         a missing of for interface types.
2974
2975 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
2976
2977         * metadata-verify.c (verify_pe_optional_header): Add comment of why
2978         the code is commented.
2979
2980         * metadata-verify.c (verify_resources_table): Remove spurious printf
2981         and don't fail if there are unmanaged resources. Gmcs generates a useless
2982         one     for all assemblies - I bet it's some MS compatibility junk.
2983
2984 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
2985
2986         * metadata-verify.c (verify_typedef_table): Verify the extends field.
2987
2988         * metadata-verify.c (mono_image_verify): Add a is_corlib.
2989
2990         * verify-internals.h: Same.
2991
2992         * pedump.c: Fix for mono_image_verify new signature.
2993
2994 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
2995
2996         * metadata-verify.c (verify_typedef_table): Verify for some invalid
2997         flags combinations.
2998
2999 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
3000
3001         * metadata-verify.c (verify_module_table): Ignore the generation field.
3002
3003 2009-04-15  Martin Baulig  <martin@ximian.com>
3004
3005         * debug-mono-symfile.c
3006         (mono_debug_symfile_lookup_location): Don't print a warning for
3007         unknown extended opcodes if they're within 0x40 and 0x7f.
3008
3009 2009-04-15  Zoltan Varga  <vargaz@gmail.com>
3010
3011         * marshal.c (mono_marshal_get_runtime_invoke_sig): Don't share runtime
3012         invoke signatures returning an enum. Fixes #494847.
3013
3014 2009-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
3015
3016         * metadata-verify.c: Initial code to verify the typedef table.
3017
3018 2009-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
3019
3020         * verify.c (mono_method_verify): Don't fail if an unconditional branch
3021         with non empty stack happens before the beginning of a try block.
3022
3023         Fixes #494812.
3024
3025 2009-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
3026
3027         * metadata-verify.c: Verify typename and typenamespace fields of
3028         the typeref table.
3029
3030 2009-04-13 Rodrigo Kumpera  <rkumpera@novell.com>
3031
3032         * metadata-verify.c: Initial code to verify the typeref table.
3033
3034 2009-04-13 Rodrigo Kumpera  <rkumpera@novell.com>
3035
3036         * verify.c (verify_delegate_compatibility): Fix error message.
3037
3038 2009-04-14  Sebastien Pouliot  <sebastien@ximian.com>
3039
3040         * security-core-clr.c: Fix typo
3041
3042 2009-04-14  Zoltan Varga  <vargaz@gmail.com>
3043
3044         * marshal.c (delegate_hash_table_add): Make delegate_target_locations 
3045         a MonoGHashTable to keep its values alive.
3046         (emit_marshal_boolean): Fix a warning.
3047
3048 2009-04-13 Gonzalo Paniagua Javier <gonzalo@novell.com>
3049
3050         * socket-io.c: don't return IPv4/IPv6 addresses if the machine does
3051         not have any interface configured for IPv4/IPv6.
3052
3053 2009-04-13 Gonzalo Paniagua Javier <gonzalo@novell.com>
3054
3055         * assembly.c: fix typo in error message.
3056
3057 2009-04-14  Zoltan Varga  <vargaz@gmail.com>
3058
3059         * marshal.c (mono_delegate_to_ftnptr): Use mono_gc_alloc_fixed () for
3060         allocating the location holding the this argument to prevent
3061         'too many root sets' errors.
3062
3063         * object.c (mono_class_create_runtime_vtable): Set field->offset to -1
3064         to mark fields as special static.
3065         (mono_field_static_get_value): Handle special static fields.
3066         (mono_field_static_set_value): Ditto.
3067
3068         * class-internals.h (struct _MonoClassField): Document this.
3069
3070 2009-04-13  Bill Holmes  <billholmes54@gmail.com>
3071
3072         * cominterop.c (mono_cominterop_emit_marshal_com_interface): Assigning
3073           the argument a value of null for the MARSHAL_ACTION_MANAGED_CONV_OUT
3074           case.  This will handle when managed code returns null to native code.
3075
3076         Code is contributed under MIT/X11 license.
3077
3078 2009-04-13  Bill Holmes  <billholmes54@gmail.com>
3079
3080         * object.c (build_imt_slots): Changing a free to a g_free to match
3081           the g_malloc0 in add_imt_builder_entry that allocated this memory.
3082
3083         Code is contributed under MIT/X11 license.
3084
3085 2009-04-13  Bill Holmes  <billholmes54@gmail.com>
3086
3087         * marshal.c (emit_marshal_boolean): Adding code to ensure that
3088           the correct TRUE value is passed through the marshaling layer.
3089
3090         Code is contributed under MIT/X11 license.
3091
3092 2009-04-13  Zoltan Varga  <vargaz@gmail.com>
3093
3094         * marshal.c (mono_marshal_emit_managed_wrapper): Handle closed delegates
3095         correctly. Fixes #492330.
3096         
3097         * marshal.c: Fix the embedding of object pointers into JITted code in
3098         the native-to-managed wrappers by allocating some GC tracked memory, and
3099         embedding the address of that.
3100
3101 2009-04-11  Zoltan Varga  <vargaz@gmail.com>
3102
3103         * object.c (mono_class_create_runtime_vtable): Avoid putting MonoMethod
3104         pointers into the vtable.
3105
3106 2009-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
3107
3108         * verify.c (mono_delegate_type_equal): Proper check MONO_TYPE_CLASS.
3109
3110         * verify.c (verify_ldftn_delegate): Improve error message.
3111
3112 2009-04-09  Raja R Harinath  <harinath@hurrynot.org>
3113
3114         * reflection.c (my_mono_class_from_mono_type): Remove.
3115
3116 2009-04-09  Raja R Harinath  <harinath@hurrynot.org>
3117
3118         Prepare to reduce memory usage of owner-less generic parameters (1/n)
3119         * class-internals.h (MonoGenericParam): Carve out pklass, name, flags
3120         and constraints fields into ...
3121         (MonoGenericParamInfo): ... this.
3122         (mono_generic_param_info, mono_generic_container_get_param_info):
3123         New accessors.
3124         * class.c, debug-helpers.c, icall.c: Update to changes.
3125         * metadata.c, reflection.c, verify.c: Likewise.
3126
3127 2009-04-09  Zoltan Varga  <vargaz@gmail.com>
3128
3129         * debug-helpers.c (dis_one): Fix decoding of strings in dynamic images.
3130
3131         * marshal.c (get_runtime_invoke_type): Share enums with their base types.
3132         
3133         * marshal.c (get_runtime_invoke_type): Share pointers with ints and
3134         booleans with sbytes.
3135
3136 2009-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
3137
3138         * class.c (can_access_instantiation): Verify accesibility of element types
3139         for arrays and pointers.
3140
3141         * class.c (can_access_type): Return true if the target class is VAR or MVAR.
3142
3143         * class.c (mono_method_can_access_method_full): Fix typos in the documentation.
3144
3145         Fixes #493068.
3146
3147 2009-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
3148
3149         * verify.c (do_invoke_method): Improve error messages.
3150
3151 2009-04-08  Bill Holmes  <billholmes54@gmail.com>
3152
3153         * verify.c:  Fixing the MSVC build.
3154
3155         Code is contributed under MIT/X11 license.
3156
3157 2009-04-08  Sebastien Pouliot  <sebastien@ximian.com>
3158
3159         * security-core-clr.c: Simplify get_reflection_caller not to call
3160         mono_method_get_last_managed (another stack walk) and adjust the
3161         callers to handle a (should not happen) NULL return value.
3162
3163 2009-04-08  Raja R Harinath  <harinath@hurrynot.org>
3164
3165         Add accessors to some MonoGenericParam fields
3166         * class-internals.h (mono_generic_param_owner): New accessor.
3167         (mono_generic_param_num): Likewise.
3168         (mono_type_get_generic_param_owner): New helper.
3169         (mono_type_get_generic_param_num): New helper.
3170         * class.c, icall.c, metadata.c, reflection.c, verify.c: Use them.
3171
3172 2009-04-08  Raja R Harinath  <harinath@hurrynot.org>
3173
3174         * class-internals.h (mono_generic_container_get_param): New wrapper.
3175         * class.c, icall.c, metadata.c, verify.c: Use it.
3176
3177 2009-04-08  Raja R Harinath  <harinath@hurrynot.org>
3178
3179         Fix gtest-252.cs
3180         * verify.c (mono_type_is_valid_type_in_context): Rewrite to use
3181         the standard case/loop.  In particular, don't complain about
3182         references to generic type definitions.
3183
3184 2009-04-07  Zoltan Varga  <vargaz@gmail.com>
3185
3186         * debug-helpers.c (dis_one): Decode string arguments.
3187
3188 2009-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
3189
3190         * pedump.c (dump_verify_info): Dump type name correctly.
3191
3192 2009-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
3193
3194         * verify.c (mono_method_verify): Don't init code slots for exception boundaries if they
3195         are larger than code size.
3196
3197         This can happen in valid code if the try/catch block is not followed by any instruction
3198         and do a backward branch on the leave instruction.
3199
3200         Fixes #492494.
3201
3202 2009-04-06  Sebastien Pouliot  <sebastien@ximian.com>
3203
3204         * security-core-clr.c: Fix typo while comparing second method names
3205         in can_avoid_corlib_reflection_delegate_optimization
3206
3207 2009-04-06 Rodrigo Kumpera  <rkumpera@novell.com>
3208
3209         * verify.c (do_throw): Don't allow an unboxed generic param ar argument.
3210
3211         Fixes #487738.
3212
3213 2009-04-06 Rodrigo Kumpera  <rkumpera@novell.com>
3214
3215         * metadata.c (do_mono_metadata_parse_type): Fail if we are decoding
3216         a MVAR using a class context.
3217
3218         Fixes #490335.
3219
3220 2009-04-06  Zoltan Varga  <vargaz@gmail.com>
3221
3222         * object.c (mono_class_compute_gc_descriptor): Make this non-static.
3223
3224         * domain-internals.h (struct _MonoJitInfo): Add a 'gc_info' field.
3225
3226         * gc-internal.h (MonoGCCallbacks): New stucture containing the callback
3227         functions supplied by the JIT for the SGEN GC.
3228
3229         * sgen-gc.c: Call the callbacks supplied by the JIT to do stack marking.
3230         
3231 2009-04-06  Massimiliano Mantione  <massi@ximian.com>
3232
3233         monitor.c (mono_monitor_try_enter_internal):
3234         Added calls to profile monitor contentions.
3235         Also duplicated a small piece of code (the "get the monitor" logic)
3236         from the fast path to the slow path, and changed the relevant goto
3237         statements, so that monitor acquisition events can be emitted from the
3238         slow path (this is by Paolo Molaro).
3239
3240 2009-04-06  Massimiliano Mantione  <massi@ximian.com>
3241
3242         * profiler.c, profiler.h, profiler-private.h:
3243         Added support for profiling monitor contentions.
3244
3245 2009-04-03 Rodrigo Kumpera  <rkumpera@novell.com>
3246
3247         * metadata-verify.c: Verify the modules table.
3248
3249 2009-04-02 Rodrigo Kumpera  <rkumpera@novell.com>
3250
3251         * verify.c (mono_generic_param_is_constraint_compatible): Inflate the candidate
3252         using the context of the method been verifier and not of the method been called.
3253
3254         * verify.c: Add verifier_inflate_type and mono_type_is_valid_type_in_context to
3255         safely inflate generic types. 
3256
3257 2009-04-02  Sebastien Pouliot  <sebastien@ximian.com>
3258
3259         * security-core-clr.c: Change the strategy for checking the 
3260         "reflection using delegates optimization" to avoid unneeded 
3261         attributes in multiple class libraries.
3262
3263 2009-04-02  Mark Probst  <mark.probst@gmail.com>
3264
3265         * sgen-gc.c: Remove object element in the disappearing link struct
3266         by storing the object pointer in the link.
3267
3268 2009-03-31 Rodrigo Kumpera  <rkumpera@novell.com>
3269
3270         * pedump.c (dump_verify_info): Don't crash if signature decoding fails.
3271
3272 2009-03-31 Rodrigo Kumpera  <rkumpera@novell.com>
3273
3274         * verify.c (verifier_load_field): Fail if the field parent could not be loaded.
3275
3276         * verify.c (mono_method_verify): Do proper bounds checking of exception
3277         clause ranges.
3278
3279 2009-03-31 Rodrigo Kumpera  <rkumpera@novell.com>
3280
3281         * loader.c (mono_field_from_token): Don't crash if the field parent could
3282         not be decoded.
3283
3284 2009-03-31  Mark Probst  <mark.probst@gmail.com>
3285
3286         * sgen-gc.c: Execute critical finalizers after ordinary
3287         finalizers.
3288
3289         * class-internals.h, domain.c: Add CriticalFinalizerObject to
3290         mono_defaults.
3291
3292 2009-03-31 Jb Evain <jbevain@novell.com>
3293
3294         * verify.c (do_ldstr): don't check if a string is in the user strings
3295         heap if the current image is dynamic.
3296
3297 2009-03-31  Mark Probst  <mark.probst@gmail.com>
3298
3299         * sgen-gc.c: Wait until the last finalizer has executed when
3300         returning from WaitForPendingFinalizers.
3301
3302 2009-03-31  Martin Baulig  <martin@ximian.com>
3303
3304         * mono-debug-debugger.h (MonoDebuggerEvent): Add
3305         `MONO_DEBUGGER_EVENT_CREATE_APPDOMAIN' and
3306         `MONO_DEBUGGER_EVENT_UNLOAD_APPDOMAIN'.
3307         (mono_debugger_event_create_appdomain): New function.
3308         (mono_debugger_event_unload_appdomain): New function.
3309
3310         * appdomain.c (mono_domain_create_appdomain_internal): Call
3311         mono_debugger_event_create_appdomain().
3312
3313 2009-03-31  Martin Baulig  <martin@ximian.com>
3314
3315         * mono-debug-debugger.c
3316         (mono_debugger_register_class_init_callback): Also register the
3317         class init callback if the class is already initialized to make
3318         things work with shadow copied assemblies.
3319
3320 2009-03-31  Sebastien Pouliot  <sebastien@ximian.com>
3321
3322         * security-core-clr.c
3323         (mono_security_core_clr_ensure_reflection_access_field): Let 
3324         critical code access the field (just like we do for methods). Use
3325         check_field_access helper.
3326         (mono_security_core_clr_ensure_reflection_access_method): Use 
3327         check_field_access helper.
3328
3329 2009-03-31  Mark Probst  <mark.probst@gmail.com>
3330
3331         * sgen-gc.c: Remove data (callback) element from FinalizeEntry and
3332         call the run-finalize function directly.
3333
3334         * gc.c, gc-internal.h: Make run_finalize() non-static.
3335
3336 2009-03-31  Mark Probst  <mark.probst@gmail.com>
3337
3338         * sgen-gc.c: Use a separate struct for disappearing links.
3339
3340 2009-03-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
3341
3342         * socket-io.c: don't fail if the SocketOptionsFlag has Partial or
3343         * MaxIOVectorLength enabled, just ignore them.
3344         Fixes bug #349688.
3345
3346 2009-03-30 Rodrigo Kumpera  <rkumpera@novell.com>
3347
3348         * metadata-verify.c: Fix eglib build.
3349
3350 2009-03-30  Zoltan Varga  <vargaz@gmail.com>
3351
3352         * threads-types.h: Fix the win32 build.
3353
3354 2009-03-28  Sebastien Pouliot  <sebastien@ximian.com>
3355
3356         * class.c: move coreclr inheritance/override checks to 
3357         security-core.clr.c
3358         * security-core.clr.c|h: add code from class.c with additional
3359         documentation. Fix override check when the method is not critical.
3360
3361 2009-03-28  Zoltan Varga  <vargaz@gmail.com>
3362
3363         * debug-helpers.c (mono_method_desc_match): Make '*' match anything.
3364         (match_class): Ditto.
3365
3366 2009-03-27 Rodrigo Kumpera  <rkumpera@novell.com>
3367
3368         * metadata-verify.c: Rename bounds_check_offset to bounds_check_datadir.
3369
3370         * metadata-verify.c: Implement table layout row size calculation. Verify
3371         the total size of the tables.
3372
3373 2009-03-27 Rodrigo Kumpera  <rkumpera@novell.com>
3374
3375         * metadata-verify.c: Verify heap sizes and size to decode row counts. 
3376
3377 2009-03-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
3378
3379         * appdomain.c:
3380         * console-io.[ch]: added new mono_console_init() to make sure that
3381         file descriptors 0, 1 and 2 are opened.
3382         Bug #489019 fixed.
3383
3384 2009-03-27  Sebastien Pouliot  <sebastien@ximian.com> 
3385
3386         * appdomain.h: Export a new callback type and a new function to
3387         set this callback. This allow a mono host to provide it's own
3388         definition for "platform code".
3389         * metadata-internals.h: Add a core_clr_platform_code flag on 
3390         _MonoImage to (cache and) know if it is representing platform 
3391         code.
3392         * image.c (do_mono_image_open): Set core_clr_platform_code flag 
3393         on platform code images.
3394         * security-core-clr.c|h 
3395         (mono_security_set_core_clr_platform_callback): Allow the host
3396         to provide it's own platform check definition.
3397         (mono_security_core_clr_determine_platform_image): Detect if an 
3398         image is platform code (using the specified callback).
3399         (mono_security_core_clr_is_platform_image): Return cached value 
3400         for platform code.
3401
3402 2009-03-27  Zoltan Varga  <vargaz@gmail.com>
3403
3404         * threads.c (mono_create_thread): New helper function to wrap CreateThread
3405         which has different parameter types for the 'tid' argument in windows and
3406         the io-layer.
3407
3408         * appdomain.c attach.c threads.c: Use the new helper.
3409
3410 2009-03-26 Rodrigo Kumpera  <rkumpera@novell.com>
3411
3412         * metadata-verify.c: Verify valid table bits.
3413
3414 2009-03-26 Rodrigo Kumpera  <rkumpera@novell.com>
3415
3416         * metadata-verify.c (verify_metadata_header): Store size in the size field.
3417
3418         * metadata-verify.c: Add initial table schema verification.
3419
3420 2009-03-26  Zoltan Varga  <vargaz@gmail.com>
3421
3422         * icall.c (ves_icall_get_parameter_info): Add a 'member' argument, used to
3423         obtain the refclass argument needed by mono_param_get_objects (). Fixes
3424         #488383.
3425
3426         * reflection.c (mono_param_get_objects_internal): Add a 'refclass' argument.
3427
3428         * appdomain.c (MONO_CORLIB_VERSION): Bump this.
3429
3430 2009-03-26  Sebastien Pouliot  <sebastien@ximian.com>
3431
3432         * security-core-clr.c: Add/update documentation
3433
3434 2009-03-26  Zoltan Varga  <vargaz@gmail.com>
3435
3436         * marshal.c (emit_marshal_object): Generate code to throw an exception
3437         instead of throwing it. Fixes #488670.
3438
3439 2009-03-25  Sebastien Pouliot  <sebastien@ximian.com>
3440
3441         * appdomain.c: Bump MONO_CORLIB_VERSION to 73.
3442         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Add
3443         an extra 'throwOnBindFailure' parameter to the icall. Remove FIXME
3444         and add a call to mono_security_core_clr_ensure_delegate_creation
3445         to do the extra checks required by CoreCLR.
3446         * security-core-clr.c|h: Add function to check delegate creation,
3447         both in the binding and accessibility, under CoreCLR.
3448
3449 2009-03-25  Sebastien Pouliot  <sebastien@ximian.com> 
3450
3451         * reflection.c (mono_reflection_create_dynamic_method): when 
3452         coreclr is enabled make sure that every resolved object are
3453         checked (e.g. field and method access).
3454         * security-core-clr.c|h: Add function to check objects resolved
3455         when a dynamic method is created.
3456
3457 2009-03-24 Rodrigo Kumpera  <rkumpera@novell.com>
3458
3459         * metadata-verify.c: Cache directory rva translations.
3460
3461         * metadata-verify.c: Add cli-header and streams verification.
3462
3463 2009-03-24 Rodrigo Kumpera  <rkumpera@novell.com>
3464
3465         * image.c (load_metadata_ptrs): We decode MonoImage::md_version_minor at
3466         the wrong offset (8 instead of 6).
3467
3468 2009-03-23  Zoltan Varga  <vargaz@gmail.com>
3469
3470         * marshal.c (mono_delegate_to_ftnptr): For delegates wrapping pinvoke
3471         methods, return the native function address itself. Fixes
3472         #487758.
3473
3474 2009-03-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
3475
3476         * console-io.c: some of the values for control characters might not be
3477         present.
3478
3479 2009-03-21  Sebastien Pouliot  <sebastien@ximian.com>
3480
3481         * exception.c|h: Add helpers to create [Field|Method]AccessException
3482         * icall.c: Add required coreclr check calls for field reflection.
3483         Move the existing (method) check logic into security-core-clr.c
3484         * security-core-clr.c: Add functions to check if the access of a
3485         field or method is allowed when reflecting under coreclr. This is
3486         mostly done using a stack walk to find the "real" caller: i.e. the
3487         code that is calling the reflection
3488
3489 2009-03-20  Zoltan Varga  <vargaz@gmail.com>
3490
3491         * gc-internal.h: Change location of gc_wrapper.h
3492
3493 2009-03-20  Sebastien Pouliot  <sebastien@ximian.com> 
3494
3495         * class.c: Simplification to coreclr checks for overrides that
3496         makes it easier to set breakpoints.
3497
3498 2009-03-20  Sebastien Pouliot  <sebastien@ximian.com>
3499
3500         * security-core-clr.c|h: (mono_security_core_clr_class_level, 
3501         mono_security_core_clr_method_level): Avoid potential 
3502         MonoCustomAttrInfo allocation for transparent assemblies (e.g. 
3503         user/application code) and make it easier to set breakpoints
3504
3505 2009-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
3506
3507         * metadata-verify.c: Reject cli header tables that mono don't handle.
3508
3509 2009-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
3510
3511         * pedump.c: Fix CLI header dumping.
3512
3513 2009-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
3514
3515         * metadata-verify.c: More CLI header verification.
3516
3517 2009-03-19  Zoltan Varga  <vargaz@gmail.com>
3518
3519         * locales.c (get_current_locale_name): Use g_malloc instead of malloc.
3520
3521 2009-03-18 Rodrigo Kumpera  <rkumpera@novell.com>
3522
3523         * metadata-verify.c: Initial verification of the CLI header.
3524
3525 2009-03-18 Rodrigo Kumpera  <rkumpera@novell.com>
3526
3527         * metadata-verify.c (verify_resources_table): Fix verification of zero
3528         sized resource section and id entries count.
3529
3530 2009-03-18  Zoltan Varga  <vargaz@gmail.com>
3531
3532         * icall.c: Handle user types in many Type icalls. Fixes #486303.
3533
3534 2009-03-17  Jb Evain  <jbevain@novell.com>
3535
3536         * profiler.c: call mono_gc_base_init from mono_profiler_load.
3537
3538 2009-03-17  Zoltan Varga  <vargaz@gmail.com>
3539
3540         * sgen-gc.c (mono_gc_make_descr_for_object): Fix 64 bit support.
3541         (mono_gc_make_descr_for_array): Ditto.
3542
3543 2009-03-17  Sebastien Pouliot  <sebastien@ximian.com>
3544
3545         * verify.c (mono_verifier_is_class_full_trust): Add support for
3546         CoreCLR security mode where trusted assemblies are defined as
3547         "platform code".
3548
3549 2009-03-16 Rodrigo Kumpera  <rkumpera@novell.com>
3550
3551         * metadata-verify.c: Add minimal PECOFF resource verification.
3552
3553 2009-03-16 Rodrigo Kumpera  <rkumpera@novell.com>
3554
3555         * metadata-verify.c: Be less restrictive with some coff fields.
3556
3557 2009-03-16 Rodrigo Kumpera  <rkumpera@novell.com>
3558
3559         * verify.c (init_stack_with_value_at_exception_boundary): Init generic
3560         params as boxed values on stack. Fixes #485706.
3561
3562 2009-03-16 Gonzalo Paniagua Javier <gonzalo@novell.com>
3563
3564         * console-io.c: the termios values may vary in different flavors of unix.
3565
3566 2009-03-16 Gonzalo Paniagua Javier <gonzalo@novell.com>
3567
3568         * console-io.[ch]: return the entire set of control characters when
3569         initializing the terminal.
3570         * appdomain.c: bump corlib version.
3571
3572 Mon Mar 16 11:11:26 CET 2009 Paolo Molaro <lupus@ximian.com>
3573
3574         * mono-perfcounters.c: added support for in-process custom
3575         performance counters.
3576
3577 2009-03-13 Rodrigo Kumpera  <rkumpera@novell.com>
3578
3579         * metadata-verify.c: Small cleanup and add comment for IAT directory entry. 
3580
3581 2009-03-13 Rodrigo Kumpera  <rkumpera@novell.com>
3582
3583         * metadata-verify.c: Verify the data pointed by the import table. 
3584
3585 2009-03-13 Rodrigo Kumpera  <rkumpera@novell.com>
3586
3587         * metadata-verify.c (load_data_directories): Store data
3588         directory contents.
3589
3590         * metadata-verify.c: Verify the import table. 
3591
3592 2009-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
3593
3594         * metadata-verify.c: Verify data directories.
3595
3596 2009-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
3597
3598         * metadata-verify.c: Check section header flags.
3599
3600 2009-03-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
3601
3602         * appdomain.c: if the assembly name is a shadow-copied file, return
3603         TRUE from mono_is_shadow_copy_enabled but don't actually do anything
3604         in mono_make_shadow_copy.
3605         * icall.c: if the assembly name is a shadow-copied file, replace it
3606         with the original assembly path.
3607
3608         Bug #484244 fixed. NUnit tests for corlib can be run without
3609         --noshadow now.
3610
3611 2009-03-12  Zoltan Varga  <vargaz@gmail.com>
3612
3613         * sgen-gc.c (add_to_global_remset): Fix the handling of root global remset
3614         entries when the table is reallocated.
3615
3616         * icall.c: Allocate the memory used by the mono_ptr_array macros using
3617         mono_gc_alloc_fixed () since it contains GC refs.
3618
3619 2009-03-10  Zoltan Varga  <vargaz@gmail.com>
3620
3621         * reflection.c (ensure_complete_type): New helper function to call
3622         type resolve handlers for unfinished dynamic types.
3623         (resolve_object): Call it for MonoClassFields. Fixes #483852.
3624
3625 2009-03-09  Zoltan Varga  <vargaz@gmail.com>
3626
3627         * reflection.c (mono_custom_attrs_has_attr): Handle interfaces. Fixes
3628         #483247.
3629
3630 2009-03-08 Rodrigo Kumpera  <rkumpera@novell.com>
3631
3632         * appdomain.c (get_shadow_assembly_location): Fix memleak.
3633
3634 2009-03-08  Zoltan Varga  <vargaz@gmail.com>
3635
3636         * domain-internals.h (struct _MonoDomain): Add new hash tables mapping
3637         between GCHandles of type WeakTrackResurrection and the objects they
3638         point to.
3639
3640         * gc.c: Partly implement the sematics of GCHandles of type 
3641         WeakTrackResurrection: these handles should only be cleared after the
3642         finalizer of the object they are pointing to has ran.
3643
3644 2009-03-06  Mark Probst  <mark.probst@gmail.com>
3645
3646         * icall.c: Partially revert r126631 because using the jump
3647         trampolines for generic shared methods makes it superfluous.
3648
3649 2009-03-06  Zoltan Varga  <vargaz@gmail.com>
3650
3651         * threads.c (handle_store): Create the 'threads' hash table with the proper
3652         MONO_HASH_VALUE_GC type.
3653
3654 2009-03-05  Zoltan Varga  <vargaz@gmail.com>
3655
3656         * domain-internals.h (struct _MonoDomain): Move 'typeof_void' before
3657         FIRST_GC_TRACKED.
3658
3659         * domain.c (mono_domain_create): Register the fields between FIRST_GC_TRACKED
3660         and LAST_GC_TRACKED as a GC root.
3661
3662         * gc-internal.h: Fix the comment of mono_gc_alloc_fixed.
3663
3664         * object.c (mono_class_create_runtime_vtable): Create a GC descriptor for
3665         the static data even if it consists of 1 reference.
3666
3667         * boehm-gc.c (mono_gc_alloc_fixed): Allocate using GC_MALLOC_EXPLICITLY_TYPED
3668         if there is a GC descriptor.
3669
3670         * reflection.c (ALLOC_REFENTRY): Allocate ReflectedEntry-es using malloc
3671         instead of through the GC since they contain no object references.
3672
3673 2009-03-05  Mark Probst  <mark.probst@gmail.com>
3674
3675         * generic-sharing.c (instantiate_other_info): Always return a jump
3676         trampoline for method code.
3677
3678 2009-03-05  Marek Habersack  <mhabersack@novell.com>
3679
3680         * culture-info-tables.h: generated to include the en-tt culture.
3681
3682 2009-03-04 Rodrigo Kumpera  <rkumpera@novell.com>
3683
3684         * domain-internals.h (MonoDomain): Add two fields to cache invoke wrappers to
3685         capture the thread context.
3686
3687         * object.c (mono_async_result_new): Cache the invoke wrappers to
3688         ExecutionContext::Capture.
3689
3690 2009-03-04 Rodrigo Kumpera  <rkumpera@novell.com>
3691
3692         * marshal.h: Add a prototype for what mono_compile_method returns
3693         for invoke wrappers.
3694
3695         * gc.c: Use the new prototype declaration.
3696
3697 2009-03-04  Geoff Norton  <gnorton@novell.com>
3698
3699         * boehm-gc.c: Add some MONO_LOG tracing for the GC
3700         * gc-internal.h:
3701         * mono-gc.h: Expose mono_gc_invoke_finalizers in the embedding api.
3702
3703 2009-03-04  Martin Baulig  <martin@ximian.com>
3704
3705         * mono-debug.h
3706         (mono_debugger_runtime_invoke): Removed.
3707
3708         * mono-debug-debugger.c
3709         (mono_runtime_invoke): Moved into ../mini/debug-mini.c.
3710
3711 2009-03-02  Martin Baulig  <martin@ximian.com>
3712
3713         * mono-debug.h
3714         (mono_debugger_unhandled_exception): Removed.
3715         (mono_debugger_handle_exception): Removed.
3716         (mono_debugger_throw_exception): Removed.
3717
3718         * mono-debug.c
3719         (mono_debug_debugger_version): Bump to 5.
3720
3721         * mono-debug-debugger.c: Moved the exception handling code to
3722         ../mini/debug-mini.c
3723
3724 2009-03-03  Zoltan Varga  <vargaz@gmail.com>
3725
3726         * domain-internals.h (struct _MonoDomain): Add a separate lock for the
3727         finalize_objects_hash.
3728
3729         * gc.c: Use the separate lock to access the finalize_objects_hash field.
3730         
3731         * domain-internals.h (struct _MonoDomain): Add finalize_runtime_invoke
3732         field.
3733
3734         * metadata-internals.h (struct _MonoImage): Add runtime_invoke_vcall_cache
3735         cache.
3736
3737         * image.c (mono_image_close): Free it.
3738         
3739         * marshal.c (mono_marshal_get_runtime_invoke): Add a 'virtual' argument
3740         allowing a creation of a wrapper which invokes its method using a CALLVIRT
3741         on the this argument.
3742
3743         * gc.c (run_finalize): Optimize the calling of the finalizers.
3744
3745 2009-03-03  Martin Baulig  <martin@ximian.com>
3746
3747         * mono-debug.h (MONO_DEBUGGER_MAJOR_VERSION): Bump to 81 because
3748         of the `MonoGenericInst' changes.
3749
3750 2009-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
3751
3752         * icall.c (ves_icall_MonoType_GetGenericArguments): Use
3753         mono_array_class_get_cached to reduce locking contention. Extract
3754         a domain var.
3755
3756         * icall.c (ves_icall_Type_GetFields_internal): Avoid allocating
3757         intermediary managed arrays. Use caching version of mono_array_new
3758         to allocate the result array.
3759
3760         * icall.c (ves_icall_Type_GetEvents_internal): Same.    
3761
3762         * icall.c (ves_icall_Type_GetNestedTypes): Same.        
3763
3764         * locales.c (create_names_array_idx):  Use mono_array_new_cached
3765         to reduce locking contention.
3766
3767 2009-03-03  Zoltan Varga  <vargaz@gmail.com>
3768                 
3769         * object.c (mono_method_add_generic_virtual_invocation): Put back the
3770         thunk builder code for the non-interface case.
3771
3772 2009-03-02  Zoltan Varga  <vargaz@gmail.com>
3773
3774         * object.c (get_generic_virtual_entries): New helper function to collect
3775         the virtual generic method instances which need to be added to an IMT
3776         thunk.
3777         (mono_method_add_generic_virtual_invocation): Add a 'vtable' argument.
3778         Instead of creating a new IMT thunk, reset the vtable slot to the
3779         trampoline, the thunk will be created the next time the trampoline is called.
3780         (build_imt_slots): Add support for virtual generic methods in interfaces by
3781         adding to the IMT thunk all the methods registered using 
3782         mono_method_add_generic_virtual_invocation ().
3783
3784         * object-internals.h (_MonoImtBuilderEntry): Add a 'has_target_code' field.
3785         (struct _MonoIMTCheckItem): Ditto.
3786
3787         * object.c (mono_method_add_generic_virtual_invocation): Take a
3788         MonoMethod argument instead of a MonoGenericInst. Fix the construction of
3789         the IMT thunk to include all items.
3790         
3791         * object.c (mono_class_create_runtime_vtable): Add a missing
3792         mono_loader_unlock ().
3793
3794 2009-03-02 Rodrigo Kumpera  <rkumpera@novell.com>
3795
3796         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
3797
3798         * object-internals.h (MonoReflectionEvent): Add cached_add_event.
3799
3800 2009-03-02 Rodrigo Kumpera  <rkumpera@novell.com>
3801
3802         * object-internals.h: Rename _MonoReflectionEvent to
3803         MonoReflectionMonoEvent so it reflects the right managed type.
3804         Add a MonoReflectionEvent that correctly represents System.EventInfo.
3805
3806         * icall.c:
3807         * reflection.c: Adjust code to use the new MonoReflectionMonoEvent
3808         type.
3809
3810 2009-03-02 Rodrigo Kumpera  <rkumpera@novell.com>
3811
3812         * icall.c (ves_icall_Type_GetMethodsByName): Avoid allocating
3813         intermediary managed arrays. Use caching version of mono_array_new
3814         to allocate the result array.
3815
3816 2009-03-01 Rodrigo Kumpera  <rkumpera@novell.com>
3817
3818         * reflection.c: Use cached version of mono_array_new alongside
3819         the mono_reflection_get_custom_attrs_by_type call path.
3820
3821 2009-03-01 Rodrigo Kumpera  <rkumpera@novell.com>
3822
3823         * icall.c (ves_icall_Type_GetInterfaces): Avoid allocating
3824         intermediary managed arrays. Use caching version of mono_array_new
3825         to allocate the result array.
3826
3827         * icall.c (ves_icall_Type_GetConstructors_internal): Same.
3828
3829 2009-03-01 Rodrigo Kumpera  <rkumpera@novell.com>
3830
3831         * icall.c: Add small implementation of a growable stack bound array.
3832
3833         * icall.c (ves_icall_System_Enum_get_hashcode): Fix warning.
3834
3835         * icall.c (ves_icall_Type_GetPropertiesByName): Avoid allocating
3836         intermediary managed arrays. Use caching version of mono_array_new
3837         to allocate the result array.
3838
3839 2009-02-27 Rodrigo Kumpera  <rkumpera@novell.com>
3840
3841         * icall.c: New icall ves_icall_System_Enum_compare_value_to that
3842         helps Enum::CompareTo to be implemented without reboxing all enums
3843         to their underlying type.
3844 2009-02-27  Zoltan Varga  <vargaz@gmail.com>
3845
3846         * domain.c (SET_APPDOMAIN): Avoid calling TlsSetValue () on some platforms,
3847         since it acquires a global lock leading to scalability problems.
3848
3849         * profiler.c: Make the stat profiler work with multiple appdomains, this
3850         currently only works when no appdomains are unloaded.
3851
3852 2009-02-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
3853
3854         * appdomain.c: make the check to avoid copying when the assembly is
3855         already shadow copied actually work.
3856
3857 2009-02-26  Zoltan Varga  <vargaz@gmail.com>
3858
3859         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
3860
3861         * object-internals.h (struct _MonoReflectionGenericClass): Sync with
3862         changes to the managed side.
3863
3864 2009-02-25  Zoltan Varga  <vargaz@gmail.com>
3865
3866         * metadata-internals.h (struct _MonoImage): Add a new cache for szarray
3867         classes + a separate lock for it, as it is used frequently at runtime, not
3868         just during metadata loading/JIT compilation.
3869
3870         * class.c (mono_bounded_array_class_get): Use the separate cache + lock
3871         for szarrays.
3872         
3873         * object-internals.h (mono_class_from_name_cached): New macro to cache
3874         the results of the lookup locally without having to declare a static
3875         variable to hold it.
3876         (mono_class_get_field_from_name_cached): Ditto.
3877         (mono_array_class_get_cached): Ditto.
3878
3879         * threadpool.c threads.c locales.c icall.c reflection.c socket-io.c: Use
3880         the new macros.
3881         
3882         * object.c (mono_get_delegate_invoke): Call setup_methods () to avoid the
3883         slower search in metadata.
3884
3885         * pedump.c: Fix a warning.
3886
3887 2009-02-23  Zoltan Varga  <vargaz@gmail.com>
3888
3889         * reflection.c (encode_locals): Add checks for user types.
3890         (method_encode_clauses): Ditto.
3891         (method_encode_code): Ditto.
3892         (mono_image_create_token): Ditto.
3893
3894         * object-internals.h: Change the type of more fields from MonoReflectionType*
3895         to MonoObject*.
3896
3897 2009-02-22  Zoltan Varga  <vargaz@gmail.com>
3898
3899         * threads.c (mono_thread_suspend_all_other_threads): Handle the case when
3900         the a thread does not suspend within 100ms.
3901
3902         * monitor.c (mono_monitor_try_enter_internal): Handle SuspendRequested
3903         in addition to StopRequested as well.
3904
3905         * mono-debug.c: Call _mono_debug_get_image () while holding the debug lock.
3906
3907         * debug-mono-symfile.c (mono_debug_symfile_lookup_method): Actually
3908         search the method_hash before inserting a new entry, to avoid crashes when
3909         the same method is inserted multiple times, causing the old 
3910         MonoDebugMethodInfo structure to be freed by the value dtor function.
3911
3912 2009-02-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
3913
3914         * socket-io.c: support SO_MAXCONN, SO_USELOOPBACK and
3915         SO_EXLUSIVEADDRUSE where available.
3916
3917 2009-02-21  Zoltan Varga  <vargaz@gmail.com>
3918
3919         * marshal.c (mono_marshal_get_runtime_invoke): Fix _another_ bug sharing
3920         runtime invoke wrappers, this time it is string ctor wrappers, which
3921         pass a dummy string as 'this' instead of their obj argument. Fixes
3922         #478473.
3923
3924 2009-02-21  Jb Evain  <jbevain@novell.com>
3925
3926         * icall.c (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
3927         only get create_culture once.
3928
3929 2009-02-20  Zoltan Varga  <vargaz@gmail.com>
3930
3931         * reflection.c (mono_reflection_setup_internal_class): Move the user type
3932         check before the locking.
3933         
3934         * reflection.c (mono_reflection_setup_internal_class): Check for user types.
3935         (mono_reflection_create_runtime_class): Ditto.
3936         (mono_reflection_sighelper_get_signature_local): Ditto.
3937         (mono_reflection_sighelper_get_signature_field): Ditto.
3938
3939         * object-internals.h (CHECK_MONOTYPE): New macro to check that a Type object
3940         is a System.MonoType object or similar.
3941         (monotype_cast): New helper function to cast a MonoObject to a 
3942         MonoReflectionType object.
3943
3944         * object-internals.h: Change MonoReflectionType* members in structures to
3945         MonoObject* members to force the usage of the monotype_cast () function.
3946
3947         * reflection.c icall.c: Use monotype_cast () for accessing Type members of
3948         structures/arrays. This causes us to assert instead of crashing when 
3949         instances of user defined subclasses of System.Type are encountered.
3950
3951 2009-02-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
3952
3953         * cil-coff.h:
3954         * icall-def.h:
3955         * icall.c: add new GetUnmanagedResourcePtr that returns a pointer to a
3956         win32 resource loaded from a PE file.
3957
3958         * image.c: fix mono_image_lookup_resource.
3959
3960 2009-02-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
3961
3962         * icall-def.h:
3963         * threads-types.h:
3964         * threads.c: added internal call for WaitHandle.SignalAndWait.
3965
3966 2009-02-19  Bill Holmes  <billholmes54@gmail.com>
3967
3968         * cominterop.c : Adding cominterop_type_from_handle and 
3969           registering it as an icall.  Replacing all references
3970           to type_from_handle.
3971
3972         Code is contributed under MIT/X11 license.
3973
3974 2009-02-19 Rodrigo Kumpera  <rkumpera@novell.com>
3975
3976         * Makefile.am: Add lock-tracer.h and lock-trace.c.
3977
3978         * appdomain.c: Call the tracer init function.
3979
3980         * domain-internals.h: Enable the tracer for the domain locks.
3981
3982         * image.c: Enable the tracer for image locks.
3983
3984         * loader.c: Enable the trace for the loader lock.
3985
3986         * lock-tracer.h:
3987         * lock-tracer.c: Initial implementation of the lock trace utility.
3988         The tracer requires a compile time define to be enabled and a env var
3989         to be enabled at runtime.
3990
3991 2009-02-19 Rodrigo Kumpera  <rkumpera@novell.com>
3992
3993         * domain.c (mono_domain_code_foreach): Improve documentation.
3994
3995 2009-02-19 Rodrigo Kumpera  <rkumpera@novell.com>
3996
3997         * appdomain.c:
3998         * generic-sharing.c:
3999         * object.c:
4000         * reflection.c:  Adjust locking order to the new semantics where the loader lock
4001         comes first.
4002
4003 2009-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
4004
4005         * domain.c: Add mono_domain_code_* functions that perform locking
4006         around the domain codeman.
4007
4008         * domain-internals.h: Export those functions.
4009
4010         * object.c: Use new functions instead of acquiring the domain lock.
4011
4012 2009-02-19  Zoltan Varga  <vargaz@gmail.com>
4013
4014         * marshal.c (mono_ftnptr_to_delegate): Convert a NULL ftnptr to a null
4015         delegate. Fixes #477396.
4016
4017 2009-02-18  Zoltan Varga  <vargaz@gmail.com>
4018
4019         * reflection.c (create_custom_attr): Get rid of alloca.
4020
4021 2009-02-18  Bill Holmes  <billholmes54@gmail.com>
4022
4023         * cominterop.c (cominterop_get_managed_wrapper_adjusted) :
4024           Adding exception handling for all CCW calls.
4025
4026         Code is contributed under MIT/X11 license.
4027
4028 2009-02-18  Zoltan Varga  <vargaz@gmail.com>
4029
4030         * reflection.c (mono_reflection_init): Remove the unused reflection mutex.
4031
4032         * marshal.c (emit_marshal_boolean): Add null checks to the new 
4033         native->managed marshalling code. Fixes #476247.
4034
4035 2009-02-17  Zoltan Varga  <vargaz@gmail.com>
4036
4037         * class.c (mono_class_get_vtable_entry): Move the addition of
4038         static rgctx invoke wrappers for vtable methods here, this simplifies
4039         a lot of code and causes fewer rgctx wrappers to be created.
4040
4041         * marshal.c (mono_marshal_get_static_rgctx_invoke): Change the
4042         name of the statistics to begin with an uppercase.
4043
4044 2009-02-17 Rodrigo Kumpera  <rkumpera@novell.com>
4045
4046         * reflection.c: Revert previous change as it breaks the build.
4047         
4048 2009-02-17 Rodrigo Kumpera  <rkumpera@novell.com>
4049
4050         * verify.c: Properly handle SZARRAY element type.
4051
4052         Fixes #474271.
4053
4054 2009-02-17 Rodrigo Kumpera  <rkumpera@novell.com>
4055
4056         * reflection.c (mono_image_create_method_token): Correctly encode
4057         MethodDef MemberRefParent token.
4058
4059         Fixes #472845.
4060
4061 2009-02-17  Zoltan Varga  <vargaz@gmail.com>
4062
4063         * image.c (mono_image_close): Delete the critical section before
4064         freeing the memory holding it.
4065
4066 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
4067
4068         * verify.c (mono_method_verify): rethrow opcode doesn not fall through.
4069         Fixes #476257.
4070
4071 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
4072
4073         * pedump.c (main): Call mono_marshal_init so pedump
4074         doesn't crash.
4075
4076 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
4077
4078         * loader.c (method_from_memberref): Properly fix #474271 and
4079         don't break the runtime bad.
4080
4081 2009-02-16  Zoltan Varga  <vargaz@gmail.com>
4082
4083         * domain.c (mono_domain_alloc): Add locking so the caller doesn't have to.
4084         (mono_domain_alloc0): Ditto.
4085
4086 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
4087
4088         * loader.c (method_from_memberref): Don't abort if the array
4089         method is not found. A regular loader failure is more informative
4090         and correct.
4091
4092         Fixes #474271.
4093
4094 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
4095
4096         *loader.c: Guard MonoImage::method_cache/methodref_cache
4097         using the image lock instead of the loader lock.
4098
4099         * metadata.h: Add comments about which fields are protected by
4100         the image lock.
4101
4102 2009-02-16  Zoltan Varga  <vargaz@gmail.com>
4103
4104         * appdomain.c (mono_set_private_bin_path_from_config): Fix a warning.
4105
4106         * generic-sharing.c (mono_method_construct_object_context): Remove the
4107         wrapper_type == NONE assert, it is not needed.
4108
4109 2009-02-15  Zoltan Varga  <vargaz@gmail.com>
4110
4111         * reflection.c (clear_cached_object): New helper function.
4112         (mono_method_clear_object): New function to clear the cached reflection
4113         objects for a dynamic method.
4114
4115         * object.c (mono_runtime_free_method): Call mono_method_clear_object ().
4116         Partly fixes # 463323.
4117         
4118 2009-02-14 Rodrigo Kumpera  <rkumpera@novell.com>
4119
4120         * class.c:
4121         * loader.c:
4122         * reflection.c: Remove all explicit uses of MonoImage::property_hash.
4123
4124 2009-02-14 Rodrigo Kumpera  <rkumpera@novell.com>
4125
4126         * image.c: Add mono_image_property_(lookup,insert,remove) functions that
4127         take the image lock instead of the loader lock.
4128
4129         * metadata-internals.h: Export new functions.
4130
4131 2009-02-12  Miguel de Icaza  <miguel@novell.com>
4132
4133         * domain.c (app_config_parse): Remove another use of stat that is
4134         not necessary as g_file_get_contents already does the presence
4135         check. 
4136
4137 2009-02-13  Zoltan Varga  <vargaz@gmail.com>
4138
4139         * cominterop.c icall-def.h: Fix the DISABLE_COM build.
4140
4141         * marshal.c: Move the bstr handling code to cominterop.c.
4142
4143         * marshal.c: Remove some COM interop code missed previously.
4144
4145 2009-02-12  Miguel de Icaza  <miguel@novell.com>
4146
4147         More Paolo patches from the Wii port:
4148         
4149         * security.c: Remove ves_icall_System_Environment_get_UserName
4150         from here.
4151
4152         * icall.c: And put ves_icall_System_Environment_get_UserName
4153         here. 
4154
4155         * appdomain.c (mono_set_private_bin_path_from_config): Remove
4156         redundant call to stat that was only used to test for the file
4157         existence.   Patch from Paolo.
4158
4159         * gc.c (run_finalize): If COM is disabled, do not link in
4160         mono_marshal_free_ccw.
4161
4162         * generic-sharing.c: Use alloca.h here as well.
4163
4164 2009-02-13 Rodrigo Kumpera  <rkumpera@novell.com>
4165
4166         * reflection.c (mono_reflection_lookup_dynamic_token): Do the locking properly.
4167
4168 2009-02-13  Zoltan Varga  <vargaz@gmail.com>
4169
4170         * cominterop.c cominterop.h: New files.
4171
4172         * marshal.c: Move the COM interop related code to cominterop.c. Make a few
4173         function/typedefs which are needed by cominterop.c global.
4174
4175 2009-02-12  Mark Probst  <mark.probst@gmail.com>
4176
4177         * generic-sharing.c: Don't take the loader lock to guard image
4178         mempool allocs.
4179
4180 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
4181
4182         * reflection.c (mono_reflection_lookup_dynamic_token): This function might be
4183         called without the loader lock which is required to guard MonoImage:tokens.
4184
4185 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
4186
4187         * class.c:
4188         * metadata.c:
4189         * method-builder.c:
4190         * marshal.c:
4191         * reflection.c: Don't take the loader lock to alloc memory from the image mempool.
4192
4193 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
4194
4195         * metadata.c: Remove mono_image_alloc_lock and mono_image_alloc0_lock.
4196         Rework the code to use regular mono_image_alloc/0.
4197
4198         * loader.c: Rework the code to use regular mono_image_alloc/0.
4199
4200         * metadata-internals.h: Remove mono_image_alloc_lock and mono_image_alloc0_lock.
4201
4202 2009-02-12  Bill Holmes  <billholmes54@gmail.com>
4203
4204         * object-internals.h : Fixing a typo in the 
4205           MonoReflectionComVisibleAttribute struct.
4206
4207         * marshal.c (cominterop_com_visible): Check the implemented 
4208           interfaces for ComImport.
4209
4210         * marshal.c (cominterop_get_native_wrapper_adjusted): For COM calls 
4211           assume that bools should be treated as VARIANTBOOLs.
4212
4213         * marshal.c (emit_marshal_boolean): Adding cases for 
4214           MARSHAL_ACTION_MANAGED_CONV_IN and MARSHAL_ACTION_MANAGED_CONV_OUT.
4215
4216         * marshal.c (mono_marshal_emit_managed_wrapper): Adding calls to 
4217           emit_marshal MARSHAL_ACTION_MANAGED_CONV_IN and OUT for bools.
4218
4219         * marshal.c (cominterop_get_ccw): For COM calls assume that bools
4220           should be treated as VARIANTBOOLs.    
4221
4222         Code is contributed under MIT/X11 license.
4223
4224 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
4225
4226         * image.c (mono_image_alloc, mono_image_alloc0, mono_image_strdup): Guard mempool
4227         allocation with the image lock.
4228
4229 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
4230
4231         This patch is the last of a series to remove explicit reference of MonoImage::mempool
4232         and use mono_image_alloc set of functions instead. This time we finish with reflection.c
4233
4234         * object.c: Add mono_string_to_utf8_image.
4235
4236         * object-internals.h: Export mono_string_to_utf8_image.
4237
4238         * reflection.c: Rework all explicit references to the the image mempool to go thought
4239         the mono_image_alloc set of functions.
4240
4241 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
4242
4243         This patch is the third of a series to remove explicit reference of MonoImage::mempool
4244         and use mono_image_alloc set of functions instead. This time we finish with marshal.c
4245         and generics-sharing.c.
4246
4247         * generics-sharing.c (set_other_info_templates): Take a MonoImage instead of a MonoMemPool
4248         as first argument. Note that this function remains broken as it doesn't perform locking around the
4249         mempool allocation.
4250
4251         * generics-sharing.c (rgctx_template_set_other_slot): Pass the image and not the mempool.
4252
4253         * image.c: Add g_slist_append_image.
4254
4255         * metadata.c (mono_metadata_field_info_with_mempool): Remove the mempool argument and use
4256         the supplied image for allocation. Move code into mono_metadata_field_info_full.
4257
4258         * metadata.c (mono_metadata_parse_marshal_spec_full): Take a MonoImage instead of a MonoMemPool.
4259         Fix all related code to do the same.
4260
4261         * marshal.c (mono_marshal_load_type_info): Pass the image instead of the mempool.
4262
4263         * metadata-internals.h: Fix the signatures.
4264
4265 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
4266
4267         This patch is the second of a series to remove explicit reference of MonoImage::mempool
4268         and use mono_image_alloc set of functions instead. This time we rework mono_metadata_type_dup
4269         and similar to work using MonoImage.
4270
4271         * class.c (mono_mempool_dup): Rename to mono_image_memdup and take a MonoImage instead of a
4272         MonoMemPool.
4273
4274         * class.c (mono_dup_array_type): Take a MonoImage instead of a MonoMemPool as first argument.
4275
4276         * class.c (mono_metadata_signature_deep_dup): Same.
4277
4278         * class.c (inflate_generic_type): Same.
4279
4280         * class.c (mono_class_inflate_generic_type_with_mempool): Same.
4281
4282         * metadata.c (mono_metadata_signature_dup_full): Same.
4283
4284         * metadata.c: Add mono_metadata_signature_dup_mempool and extract common functionality from 
4285         mono_metadata_signature_dup_full.
4286
4287         * metadata.c (mono_metadata_type_dup): Same.
4288
4289         * marshal.c: Pass the image to calls to mono_metadata_type_dup.
4290
4291         * reflection.c: Same.
4292
4293         * generic-sharing.c: Pass the image to calls to mono_class_inflate_generic_type_with_mempool.
4294
4295         * metadata-internals.h: Fix the signatures.
4296
4297         * class-internals.h: Same.
4298
4299 2009-02-11 Rodrigo Kumpera  <rkumpera@novell.com>
4300
4301         This patch is the first of a series to remove explicit reference of MonoImage::mempool
4302         and use mono_image_alloc set of functions instead. 
4303
4304         * class.c (mono_class_inflate_generic_type_with_mempool_no_copy):
4305         Rename to mono_class_inflate_generic_type_no_copy and take a MonoImage instead
4306         of a MonoMemPool.
4307
4308         * class.c (mono_class_setup_fields): Adapt to mono_class_inflate_generic_type_no_copy.
4309
4310         * class.c (g_list_prepend_mempool): Removed.
4311
4312         * class.c (mono_class_get_nested_types): Use g_list_prepend_image instead of g_list_prepend_mempool.
4313
4314         * image.c: Add g_list_prepend_image.
4315
4316         * metadata-internals.h (struct MonoImage): Fix comment. Export g_list_prepend_image as internal.
4317
4318         * reflection.c (mono_reflection_create_runtime_class): Use g_list_prepend_image instead of g_list_prepend_mempool.
4319
4320
4321 2009-02-11 Rodrigo Kumpera  <rkumpera@novell.com>
4322
4323         * metadata-internals.h (struct MonoImage): Add lock field. Export mono_image_lock and
4324         mono_image_unlock.
4325
4326         * image.c (mono_image_init): Init the lock field.
4327  
4328         * image.c (mono_image_init): Cleanup the lock field.
4329
4330         * image.c: Add mono_image_(un)lock functions.
4331
4332 2009-02-11  Mark Probst  <mark.probst@gmail.com>
4333
4334         * class.c, class-internals.h: mono_method_get_context_general()
4335         combines the functionality of mono_method_get_context() and
4336         mini_method_get_context().
4337
4338         * generic-sharing.c, domain-internals.h:
4339         mono_method_construct_object_context() and
4340         mono_domain_lookup_shared_generic() moved from mini.
4341
4342         * icall.c (ves_icall_InternalInvoke): Handle the case where the
4343         method doesn't have the correct instantiation because it's shared
4344         generic code.  Fixes #473999.
4345
4346 2009-02-11  Zoltan Varga  <vargaz@gmail.com>
4347
4348         * loader.c (mono_method_get_wrapper_data): Handle inflated methods as well.
4349
4350         * loader.c (mono_loader_lock): Add a comment pointing to the locking document.
4351         
4352 2009-02-11 Rodrigo Kumpera  <rkumpera@novell.com>
4353
4354         * metadata.c: Make mono_image_alloc_lock and mono_image_alloc0_lock non static.
4355
4356         * metadata-internals.h: Export mono_image_alloc_lock and mono_image_alloc0_lock.
4357
4358         * loader.c (mono_get_method_full): Drop the loader lock while constructing the method
4359         and recheck the cache for dups after it.
4360
4361         * loader.c (mono_get_method_from_token): Use _lock version of mono_image_alloc0.
4362
4363         Fixes one of the deadlocks found in #473150.
4364
4365 2009-02-11  Bill Holmes  <billholmes54@gmail.com>
4366
4367         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Accept_internal):
4368           For Win32, add additional break conditions for accept.
4369
4370         Code is contributed under MIT/X11 license.
4371
4372 2009-02-10  Zoltan Varga  <vargaz@gmail.com>
4373
4374         * marshal.c (mono_marshal_get_native_func_wrapper): Use get_cache to
4375         lazily initialize the native wrapper cache.
4376         (mono_marshal_get_native_wrapper): Put aot-ed native wrappers into a separate
4377         cache, since they are different from the normal wrappers.
4378
4379         * image.c (mono_image_init): Initialize native_wrapper_cache lazily as well.
4380
4381         * metadata-internals.h (struct _MonoImage): Add a new wrapper for
4382         AOT compiled native wrappers.
4383
4384 2009-02-09  Geoff Norton  <gnorton@novell.com>
4385
4386         * appdomain.h:
4387         * security-core-clr.c: Allow enabling core-clr from the embedding
4388         API.
4389
4390 2009-02-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
4391
4392         * socket-io.c: when requesting all the local ips, if there are no
4393         interfaces up and running, MS returns 127.0.0.1.
4394
4395 2009-02-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
4396
4397         * mono-perfcounters-def.h: processor time is an inverse time.
4398         Fixes bug #468625.
4399
4400 2009-02-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
4401
4402         * socket-io.c: an empty host name returns the list of local IPs.
4403         Fixes bug #386637 part 1/2.
4404
4405 2009-02-07  Zoltan Varga  <vargaz@gmail.com>
4406
4407         * verify.c (mono_class_interface_implements_interface): Call
4408         mono_class_setup_interfaces ().
4409         (merge_stacks): Ditto.
4410
4411 2009-02-06  Zoltan Varga  <vargaz@gmail.com>
4412
4413         * class.c (mono_class_setup_interfaces): New function to lazily initalize
4414         klass->interfaces.
4415         (mono_generic_class_get_class): Don't initalize klass->interfaces.
4416         (mono_generic_class_get_class): Ditto.
4417
4418 2009-02-06  U-QUACK\miguel  <miguel@quack>
4419
4420         * icall-defs.h: Include also the Encrypt/Decrypt string methods as
4421         they live in security.c
4422
4423         * debug-mono-symfile.c (mono_debug_open_mono_symbols): Integrated
4424         another bit from Paolo's code.
4425
4426 2009-02-06  Zoltan Varga  <vargaz@gmail.com>
4427
4428         * object.c (build_imt_slots): Add a small optimization to avoid inflating
4429         methods which will be discarded by add_imt_builder_entry ().
4430
4431         * marshal.c (get_runtime_invoke_type): Avoid sharing enum types since they
4432         need to be boxed.
4433
4434         * loader.c: Add a statistics for the size of the memberref signature cache.
4435         
4436         * loader.c (find_cached_memberref_sig): New helper function.
4437         (cache_memberref_sig): Ditto.
4438
4439         * loader.c: Cache the result of parsing memberref signatures, since otherwise
4440         they will be parsed again for every generic instantiation, leading to unbounded
4441         memory growth.
4442
4443 2009-02-05  Zoltan Varga  <vargaz@gmail.com>
4444
4445         * loader.c (mono_get_method_from_token): Avoid creating class for the generic
4446         parameters of generic methods.
4447
4448         * class.c (mono_class_inflate_generic_method_full): Set is_mb_open again
4449         after the original method is copied to the inflated method.
4450         (mono_class_get_vtable_entry): Handle rgctx invoke wrappers more efficiently.
4451
4452         * class-internals.h (struct _MonoMethodInflated): Move the is_mb_open
4453         field to MonoMethod since it only consumes 1 bit there, and 4/8 bytes here.
4454
4455         * class.c metadata.c: Update after the changes above.
4456
4457 2009-02-05 Rodrigo Kumpera  <rkumpera@novell.com>
4458
4459         * metadata-verify.c: Simplified error handling and added
4460         section table validation.
4461
4462 2009-02-05  Zoltan Varga  <vargaz@gmail.com>
4463
4464         * class-internals.h (MonoClassExt): New structure containing rarely used
4465         fields of MonoClass.
4466         (struct _MonoClass): Move rarely used fields to MonoClassExt, accessed
4467         through a new 'ext' field.
4468
4469         * class.c (mono_class_alloc_ext): New helper function to allocate 
4470         class->ext.
4471
4472         * class.c metadata.c reflection.c: Update after MonoClass structure changes.
4473
4474 2009-02-05  Mark Probst  <mark.probst@gmail.com>
4475
4476         * object.c (mono_object_get_virtual_method): Properly inflate
4477         generic methods.  Fixes #472692.
4478
4479 2009-02-05 Rodrigo Kumpera  <rkumpera@novell.com>
4480
4481         * class.c (mono_class_create_from_typedef): The CLR supports SystemF
4482         recursive types such as List<T>:Cons<T,List<T>> so when doing the lookup
4483         for the parent type, the created type must be ready to be used on a generic
4484         instantiation.
4485         We fill this_arg/byval_arg if the parent is a generic instance to make sure
4486         we won't have duplicated entries in generic_inst_cache.
4487
4488         Fixes #469553.
4489
4490 2009-02-05  Miguel De Icaza  <miguel@novell.com>
4491
4492         * threadpool.c (socket_io_add_poll): Remove the BSD6 define and
4493         replace with plain BSD per the comments on the bug MONO77637.
4494
4495 2009-02-05  Zoltan Varga  <vargaz@gmail.com>
4496
4497         * class.c (mono_class_get_generic_class): New accessor function.
4498         (mono_class_get_generic_container): Ditto.
4499
4500         * class-internals.h (struct _MonoClass): Add 'is_generic' and 'is_inflated'
4501         fields, similar to the ones in MonoMethod.
4502
4503         * class.c (mono_generic_class_get_class): Set klass->is_inflated.
4504         (mono_class_create_from_typedef): Set klass->is_generic if needed.
4505
4506         * reflection.c (mono_reflection_create_generic_class): Set klass->is_generic.
4507         
4508         * class-internals.h (struct _MonoClass): Remove enum_basetype, it contains
4509         the same information as element_class->byval_arg.
4510
4511         * class.c reflection.c: Remove references to class->byval_arg.
4512
4513         * class.c marshal.c: Use mono_class_enum_basetype () instead of accessing 
4514         klass->enum_basetype directly.
4515
4516         * verify.c metadata.c object.c icall.c reflection.c: Use 
4517         mono_class_enum_basetype () instead of accessing klass->enum_basetype 
4518         directly.
4519
4520 2009-02-04  Miguel de Icaza  <miguel@novell.com>
4521
4522         * icall-def.h: Remove internal calls for sockets when
4523         DISABLE_SOCKET is defined, file system writing features when the
4524         OS only support reading and not writing data and Policy support if
4525         the Policy is disabled.
4526         
4527         * image.c (do_mono_image_open): Apply Paolo's patches for using
4528         mono_file_map_ APIs here.
4529
4530         * assembly.c: Add support for platforms to avoid prefix
4531         auto-detection. 
4532
4533 2009-02-04  Zoltan Varga  <vargaz@gmail.com>
4534
4535         * generic-sharing.c (mono_method_fill_runtime_generic_context): Fix a
4536         warning.
4537
4538         * class.c (mono_class_inflate_generic_class): New helper function.
4539
4540         * class.c: Use mono_class_inflate_generic_class in a few places. Add
4541         statistics for inflated methods/classes.
4542
4543         * loader.c (inflate_generic_header): Use mono_class_inflate_generic_class.
4544
4545         * icall.c (ves_icall_Type_GetMethodsByName): Optimize the case when
4546         the call is made from Delegate.CreateDelegate () for the invoke method of
4547         a delegate.
4548
4549         * loader.c: Add a statistics for the memory occupied by inflated signatures.
4550
4551         * metadata.c (mono_metadata_signature_size): New helper function.
4552
4553         * class.c (mono_class_get_method_from_name_flags): Add an optimization for
4554         generic instances.
4555
4556         * metadata.c (inflated_method_in_image): Avoid calling 
4557         mono_method_signature () if the method does not already have a signature.
4558
4559 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
4560
4561         * verify.c (is_compatible_boxed_valuetype): When checking if the boxed 
4562         valuetype is compatible with target type, check by inheritance as a
4563         VT is not really compatible with System.ValueType, for example.
4564
4565         * verify.c (do_invoke_method): Improve error message.
4566
4567         * verify.c (do_box_value): If boxing a nullable, use the type argument
4568         on stack instead.
4569
4570         * verify.c (do_newobj): Improve error message.  
4571
4572         Fixes #469549.
4573
4574 2009-02-03  Miguel de Icaza  <miguel@novell.com>
4575
4576         * appdomain.c: Add support for DISABLE_SOCKETS and DISABLE_SHADOW_COPY
4577
4578 2009-02-03  Mark Probst  <mark.probst@gmail.com>
4579
4580         * generic-sharing.c: Don't hold domain lock when calling
4581         instantiate_other_info().  Fixes #471958.
4582
4583         * domain-internals.h, loader.c: Describe locking policy of domain
4584         lock vs loader lock.
4585
4586 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
4587
4588         * verify.c (mono_delegate_signature_equal): Make it possible to check
4589         first-arg-bound delegates to static method.
4590
4591         * verify.c (verify_delegate_compatibility): Correctly verify delegates to
4592         static methods with the first arg bound.
4593
4594         Fixes #469529.
4595
4596 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
4597
4598         * verify.c: Added stack_slot_full_name to provide decent and more meanfull
4599         errors.
4600
4601         * verify.c (is_compatible_boxed_valuetype): Be less restrictive when not
4602         under strict mode. Any type, when boxed can be seen as a reference type.
4603
4604         Fixes #469528.
4605
4606 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
4607
4608         * object.h: The lower bound of an array is a signed integer value.
4609         Introduce mono_array_lower_bound_t typedef. It should be used instead of
4610         gint32 as under MONO_BIG_ARRAYS it will be a gint64.
4611
4612         * icall.c: Cast MonoArrayBounds::length to a signed value so correctly
4613         calculate the upper bound.
4614         
4615         Fixes #471252.
4616
4617 2009-02-02  Miguel de Icaza  <miguel@novell.com>
4618
4619         From Paolo's work, refactored, cleared up:
4620         
4621         * threadpool.c, icall.c: ifdef code that requires a working socket
4622         stack.
4623
4624         * metadata.c (mono_metadata_field_info): Do not attempt to return
4625         a value from a function declared as void.
4626
4627         * console-io.c: Use MONO_NULL_TTYDRIVER to remove the tty driver
4628         from the console stack.
4629
4630         * assembly.c: use strrchr instead of rindex.
4631
4632         * class.c, object.c, marshal.c, icall.c, reflection.c: include
4633         alloca.h on systems that have it.
4634
4635         * environment.c: Avoid code that uses stuff from
4636         HAVE_SYS_UTSNAME_H
4637         
4638         * appdomain.c: Include sys/time.h.
4639
4640         * console-io.c: include sys/ioctl.h if it is available.
4641
4642 2009-02-03  Zoltan Varga  <vargaz@gmail.com>
4643
4644         * method-builder.h (_MonoMethodBuilder): Add a 'skip_visibility' flag.
4645
4646         * method-builder.c (mono_mb_create_method): Set method->skip_visibility from
4647         the method builder.
4648
4649         * marshal.c: Set mb->skip_visibility instead of setting it on the method
4650         after it was created and cached, as the later is not thread safe.
4651         
4652 2009-02-02  Zoltan Varga  <vargaz@gmail.com>
4653
4654         * mono-debug.c (mono_debug_print_stack_frame): Avoid crashes when this is
4655         called while the debugging module is not initialized. Fixes #471669.
4656
4657 2009-02-02 Rodrigo Kumpera  <rkumpera@novell.com>
4658
4659         * icall.c (type_from_name): Ignore reflection frames to find out the real caller.
4660
4661         Fixes #471255.
4662
4663 2009-02-02  Mark Probst  <mark.probst@gmail.com>
4664
4665         * generic-sharing.c (lookup_or_register_other_info): Make sure the
4666         loader lock is not taken while the templates lock is held.  Fixes
4667         #471089.
4668
4669 2009-02-02  Mark Probst  <mark.probst@gmail.com>
4670
4671         * metadata.c (type_in_image): Added a check to fix a monodis
4672         crash.
4673
4674 2009-02-02  Zoltan Varga  <vargaz@gmail.com>
4675
4676         * marshal.c (mono_marshal_get_runtime_invoke): Add support for byref
4677         nullable arguments.
4678
4679         * object.c (mono_runtime_invoke_array): Ditto.
4680         
4681         * marshal.c (mono_marshal_free_dynamic_wrappers): New function for
4682         freeing wrappers of dynamic methods.
4683
4684         * loader.c (mono_free_method): Call it. Fixes #463323.
4685         
4686         * marshal.c (mono_marshal_get_runtime_invoke): Disable sharing for
4687         methods taking vtype/byref arguments, to fix yet another bug caused by
4688         the sharing of runtime invoke wrappers. Partly fixes #471259.
4689
4690 2009-02-01  Zoltan Varga  <vargaz@gmail.com>
4691
4692         * debug-mono-symfile.c (check_line): Return NULL instead of returning
4693         <first file in file table>:1 when the IL offset does not have an associated
4694         line number.
4695
4696 2009-01-31  Zoltan Varga  <vargaz@gmail.com>
4697
4698         * mono-debug.c (mono_debug_lookup_locals): New function to return local
4699         variable info for a method.
4700
4701         * debug-mono-symfile.c (mono_debug_symfile_lookup_locals): Ditto.
4702         
4703 2009-01-30  Jb Evain  <jbevain@novell.com>
4704
4705         * pedump.c: reuse code from monodis to make sure pedump honors
4706         MONO_PATH, which is needed to verify net_2_1 assemblies.
4707
4708 2009-01-29  Zoltan Varga  <vargaz@gmail.com>
4709
4710         * mono-debug.c (mono_debug_print_stack_frame): Print the IL offset even when
4711         there is no line number info.
4712
4713 2009-01-29  Raja R Harinath  <harinath@hurrynot.org>
4714
4715         Avoid some MonoType allocations
4716         * reflection.c (mono_reflection_initialize_generic_parameter):
4717         Reuse MonoType from param->pklass rather than allocating one.
4718         (mono_dynamic_image_free): Update to changes.
4719
4720 2009-01-28  Raja R Harinath  <harinath@hurrynot.org>
4721
4722         Rearrange some code to improve consistency
4723         * reflection.c (mono_reflection_setup_generic_class): Move body ...
4724         (mono_reflection_initialize_generic_parameter): ... here.
4725
4726 2009-01-28  Zoltan Varga  <vargaz@gmail.com>
4727
4728         * generic-sharing.c (has_constraints): Enable gshared for methods/classes
4729         with type constraints as an experiment.
4730
4731         * boehm-gc.c (on_gc_notification): Update mono_stats.
4732
4733 2009-01-28  Raja R Harinath  <harinath@hurrynot.org>
4734
4735         Avoid some allocations
4736         * class-internals.h (_MonoGenericInst::type_argv): Convert from
4737         pointer to tail array to avoid extra allocation.
4738         * metadata.c (free_generic_inst): Update to changes.
4739         (mono_metadata_get_generic_inst): Likewise.  Use alloca instead of
4740         on-stack struct.
4741
4742 2009-01-27  Zoltan Varga  <vargaz@gmail.com>
4743
4744         * icall.c (ves_icall_System_Type_EqualsInternal): For user-defined types,
4745         return TRUE if the two type objects are the same.
4746
4747 2009-01-26  Zoltan Varga  <vargaz@gmail.com>
4748
4749         * marshal.c (mono_marshal_load_type_info): Fill out info->min_align.
4750         (mono_class_native_size): Use klass->marshal_info->min_align instead of
4751         klass->min_align, since klass->min_align contains the managed alignment,
4752         while the native alignment can be different, like for longs on x86.
4753         Fixes #469135.
4754
4755         * class-internals.h (MonoMarshalType): Add a min_align field.
4756
4757 2009-01-26 Rodrigo Kumpera  <rkumpera@novell.com>
4758
4759         * assembly.c (mono_assembly_try_decode_skip_verification): Add a hack to check
4760         the 1.0 format.
4761
4762 2009-01-26  Zoltan Varga  <vargaz@gmail.com>
4763
4764         * domain-internals.h (struct _MonoJitInfo): Add a 'from_aot' field plus
4765         some comments about the usage of the used_regs field.
4766
4767         * marshal.c (emit_marshal_ptr): Allow pointers to blittable structures.
4768         Fixes #469217.
4769
4770 2009-01-24 Gonzalo Paniagua Javier <gonzalo@novell.com>
4771
4772         * appdomain.c: return NULL instead of throwing FileNotFoundException
4773         when LoadAssembly() fails.
4774
4775 2009-01-23  Mark Probst  <mark.probst@gmail.com>
4776
4777         * metadata.c (mono_metadata_generic_param_equal): Only compare the
4778         image if the owner is NULL.  Fixes the AOT failures.
4779
4780 2009-01-23  Zoltan Varga  <vargaz@gmail.com>
4781
4782         * metadata.c (mono_metadata_load_generic_params): Initialize the 
4783         MonoGenericParam structure using memset so the image field is initialized
4784         as well.
4785
4786 2009-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
4787
4788         * appdomain.c (mono_domain_unload): Change the InterlockedIncrement to
4789         a plain store.
4790
4791 2009-01-21  Zoltan Varga  <vargaz@gmail.com>
4792
4793         * class.c (mono_class_setup_vtable_general): In the generic instance
4794         optimization, set method->slot for abstract virtual methods. Fixes part of
4795         #467834.
4796
4797 2009-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
4798
4799         * domain-internals.h: Add new appdomain state MONO_APPDOMAIN_UNLOADING_START
4800         which signals that the unloading has started but all appdomain services must
4801         remain operational.
4802
4803         * appdomain.c (mono_domain_unload): The initial state for unloading now
4804         is unloading_start and we switch to unloading after the managed call to
4805         AppDomain::DomainUnload has finished.
4806
4807         The new unloading state has to be created because managed code in the
4808         DomainUnload event can depend on things like the threadpool still working.
4809         The domain must remain fully functional while the event executes.
4810
4811         This shown as an issue due to Process::WaitForExit, which waits for
4812         async reads of stdout and stderr to complete. Since those are processed
4813         in the threadpool the code deadlocks because the DomainUnload callback 
4814         waits for the async read finished event, which should have been set by a
4815         threadpool job but has been discarded due to the domain been in unload
4816         state.
4817
4818 2009-01-21  Mark Probst  <mark.probst@gmail.com>
4819
4820         * metadata.c (mono_metadata_generic_param_equal): Owner as well as
4821         image must match.
4822
4823 2009-01-21  Mark Probst  <mark.probst@gmail.com>
4824
4825         * reflection.c (resolve_object): For fields, inflate the class and
4826         then get the field in the inflated class.
4827
4828 2009-01-20  Mark Probst  <mark.probst@gmail.com>
4829
4830         * object-internals.h (struct _MonoException): Added a comment
4831         explaining the new use of trace_ips.
4832
4833 2009-01-20  Mark Probst  <mark.probst@gmail.com>
4834
4835         * generic-sharing.c (inflate_other_data): Inflate array methods
4836         correctly.
4837
4838         * loader.c, class-internals.h: Rename search_in_array_class() to
4839         mono_method_search_in_array_class() and make it non-static.
4840
4841 2009-01-19  Zoltan Varga  <vargaz@gmail.com>
4842
4843         * metadata.c (inflated_signature_in_image): Call signature_in_image as well.
4844         Hopefully fixes #458168.
4845
4846 2009-01-19  Christian Hergert  <christian.hergert@gmail.com>
4847
4848         * object.c (mono_raise_exception): Remove call to InterlockedIncrement
4849         as it is performed elsewhere.
4850
4851         Code is contributed under MIT/X11 license
4852
4853 2009-01-19  Christian Hergert  <christian.hergert@gmail.com>
4854
4855         * mono-perfcounters-def.h: Add counters for asp.net requests total and
4856         requests queued.
4857         * object.c (mono_raise_exception): Increment the exceptions total
4858         counter when an exception is thrown.
4859         * class-internals.h: Add a location for storing the total number of
4860         asp.net requests served.
4861         * mono-perfcounters.c: Implement update support for asp.net counters
4862         from the class libraries. Implement read support for asp.net counters
4863         and exceptions total counter.
4864
4865 2009-01-19  Zoltan Varga  <vargaz@gmail.com>
4866
4867         * loader.c (search_in_array_class): Call mono_class_setup_methods () before
4868         accessing klass->methods. Fixes #467385.
4869
4870 2009-01-18  Zoltan Varga  <vargaz@gmail.com>
4871
4872         * marshal.c (emit_marshal_custom): Avoid calling MarshalNativeToManaged
4873         for byval arguments without an [Out] attribute. Fixes #467212.
4874
4875         * attach.c: Applied patch from Koushik Dutta (koush@koushikdutta.com). 
4876         Fix compilation under android.
4877         
4878         * sgen-gc.c: Instead of scanning gray objects after all roots have been 
4879         processed, scan them directly after they are copied, to achieve better locality
4880         and cache usage.
4881
4882         * socket-io.c: Applied patch from Koushik Dutta
4883         (koush@koushikdutta.com). Disable IPV6 when running under android.
4884
4885 2009-01-18  Zoltan Varga  <vargaz@gmail.com>
4886
4887         * icall.c (ves_icall_InternalExecute): Add write barriers.
4888
4889         * marshal.c (mono_marshal_get_write_barrier): Remove, this is now done in
4890         the GC code.
4891
4892         * sgen-gc.c: Implement write barriers in IL code.
4893
4894 2009-01-17  Geoff Norton  <gnorton@novell.com>
4895
4896         * image.c: Avoid trying to walk the reference table of dynamic assemblies.
4897
4898 2009-01-17  Geoff Norton  <gnorton@novell.com>
4899
4900         * image.c: When unloading the image->references table, there can be gaps
4901         in it.  Ensure that we iterate every entry to avoid leaking assembly references
4902         when unloading an appdomain.
4903
4904 2009-01-16  Zoltan Varga  <vargaz@gmail.com>
4905
4906         * sgen-gc.c: Add support for allocating a nursery at an aligned address, to
4907         speed up ptr-in-nursery checks.
4908
4909         * threads.c (mono_threads_abort_appdomain_threads): Abort threads outside the
4910         threads_lock () to prevent deadlocks.
4911
4912         * sgen-gc.c gc-internal.h: Add a new root type root-with-wbarrier, which
4913         does not need to be scanned during minor collections, since writes to it
4914         must use write barriers.
4915
4916 2009-01-15 Rodrigo Kumpera  <rkumpera@novell.com>
4917
4918         * metadata-verify.c: Add pe nt header verification.
4919         
4920 2009-01-15  Zoltan Varga  <vargaz@gmail.com>
4921
4922         * gc.c: Fix a few warnings when using SGEN.
4923
4924 2009-01-14 Rodrigo Kumpera  <rkumpera@novell.com>
4925
4926         * metadata-verify.c: Add pe optional header verification.
4927
4928 2009-01-15  Zoltan Varga  <vargaz@gmail.com>
4929
4930         * sgen-gc.c: Add support for user defined marker functions, used by
4931         MonoGHashTable to avoid registering a GC root for every hash node.
4932
4933 2009-01-14  Zoltan Varga  <vargaz@gmail.com>
4934
4935         * sgen-gc.c: Fix warnings. Optimize copy_object () a bit. Split pinned/
4936         non-pinned roots into separate hashes to avoid having to traverse them
4937         in functions which are only interested in one kind.
4938
4939 2009-01-13 Rodrigo Kumpera  <rkumpera@novell.com>
4940
4941         * metadata-verify.c: Add pe header machine field verification.
4942         
4943 2009-01-13 Rodrigo Kumpera  <rkumpera@novell.com>
4944
4945         * metadata-verify.c: Add pe header size verification.
4946
4947 2009-01-14  Zoltan Varga  <vargaz@gmail.com>
4948
4949         * reflection.c (ALLOC_REFENTRY): Don't allocate the ReflectionEntry structures
4950         using the GC, they don't contain references.
4951
4952         * domain.c (mono_domain_create): Create ldstr_table using MONO_HASH_KEY_VALUE_GC.
4953
4954 2009-01-13  Geoff Norton  <gnorton@novell.com>
4955
4956         * appdomain.c|h: Expose mono_domain_unload to the embedding api so that 
4957         AppDomains created on the native side can be cleaned up on the native side.
4958
4959 2009-01-13  Geoff Norton  <gnorton@novell.com>
4960
4961         * appdomain.c: Ensure that we call mono_context_init for the embedding api
4962         as well as the managed api.
4963
4964 2009-01-13  Geoff Norton  <gnorton@novell.com>
4965
4966         * appdomain.h|c: New API for creating a MonoDomain in the embedding api
4967         with a MonoAppDomain initialized against it.
4968
4969 2009-01-13  Zoltan Varga  <vargaz@gmail.com>
4970
4971         * reflection.c (MOVING_GC_REGISTER): Fix a warning.
4972         
4973         * reflection.c (mono_image_get_generic_param_info): Use MOVING_GC_REGISTER.
4974
4975         * marshal.c: Avoid setting the exception clauses after a method has been entered 
4976         into the wrapper caches. Fixes #465700.
4977
4978         * method-builder.c (mono_mb_set_clauses): New function to set the clauses of the
4979         method builder.
4980         (mono_mb_create_method): Set the clauses from the method builder.
4981
4982 2009-01-13 Gonzalo Paniagua Javier <gonzalo@novell.com>
4983
4984         * threadpool.c: include sys/socket.h. Fixes compilation on FreeBSD.
4985         Patch from Makoto Kishimoto.
4986
4987 2009-01-13  Zoltan Varga  <vargaz@gmail.com>
4988
4989         * sgen-gc.c (mono_gc_make_descr_from_bitmap): Handle large bitmaps by 
4990         encoding them as ROOT_DESC_COMPLEX.
4991         (precisely_scan_objects_from): Implement support for ROOT_DESC_COMPLEX.
4992
4993 2009-01-12  Zoltan Varga  <vargaz@gmail.com>
4994
4995         * sgen-gc.c (scan_from_remsets): Clear the global remset of pointers which
4996         no longer point to the nursery.
4997
4998         * sgen-gc.c: Add a few comments/FIXMEs.
4999         
5000         * sgen-gc.c: Implement scanning of the alloc_pinned objects.
5001
5002         * marshal.c (mono_marshal_get_synchronized_wrapper): Make the 
5003         initialization of the various _method variables thread safe. Fixes
5004         #465377.
5005
5006 2009-01-12  Mark Probst  <mark.probst@gmail.com>
5007
5008         * domain.c, domain-internals.h: Remove the shared_generics_hash
5009         and its lookup functions.
5010
5011 2009-01-12  Bill Holmes  <billholmes54@gmail.com>
5012
5013         * socket-io.c:  Fixing the MSVC build. 
5014
5015         Code is contributed under MIT/X11 license.
5016
5017 2009-01-12 Rodrigo Kumpera  <rkumpera@novell.com>
5018
5019         * metadata-verify.c: Add pe header watermark verification.
5020
5021 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
5022
5023         * metadata-verify.c: Add lfanew verification.
5024
5025 2009-01-12  Jb Evain  <jbevain@novell.com>
5026
5027         * tabldefs.h: rename METHOD_ATTRIBUTE_CHECK_ACCESS_ON_OVERRIDE to
5028         METHOD_ATTRIBUTE_STRICT to match the ECMA terminology.
5029
5030 2009-01-10  Zoltan Varga  <vargaz@gmail.com>
5031
5032         * socket-io.c: Fix the build.
5033
5034         * environment.c: Fix an #ifdef.
5035
5036 2009-01-09  Zoltan Varga  <vargaz@gmail.com>
5037
5038         * threadpool.c (async_invoke_thread): Handle the wait function returning
5039         WAIT_IO_COMPLETION as well.
5040         (async_invoke_io_thread): Ditto.
5041
5042 2009-01-09  Bill Holmes  <billholmes54@gmail.com>
5043
5044         * threads.c: Fixing the Windows build.
5045
5046         Code is contributed under MIT/X11 license.
5047
5048 2009-01-09  Zoltan Varga  <vargaz@gmail.com>
5049  
5050         * threads.c (signal_thread_state_change): Call wapi_interrupt_thread () to
5051         interrupt a wait.
5052         (mono_thread_execute_interruption): Call wapi_clear_interruption () to enable
5053         the thread to wait again.
5054
5055 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
5056
5057         * metadata-verify.c: Initial skeleton of the metadata verifier.
5058
5059         * pedump.c: Add support for the metadata verifier.
5060
5061         * verify-internal.h: Export the whole assembly metadata verifier function.
5062
5063 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
5064
5065         * gc.c (mono_gc_init): Fix the comments about deadlock on windows.
5066
5067 2009-01-09  Zoltan Varga  <vargaz@gmail.com>
5068
5069         * Makefile.am: Upgrade dtrace-prelink.sh location.
5070
5071 2009-01-08 Rodrigo Kumpera  <rkumpera@novell.com>
5072
5073         * gc.c (mono_gc_init): Wait for finalizer thread to init on windows as
5074         well. Otherwise the shutdown deadlock that happens on unix will can happen
5075         as well.
5076         If the main thread code finishes too fast it's possible that the finalizer
5077         thread won't have executed yet, won't record itself as the finalizer thread
5078         and the shutdown sequence will wait on it forever.
5079
5080 2009-01-08 Rodrigo Kumpera  <rkumpera@novell.com>
5081
5082         * threads.c (mono_thread_current): Make THREAD_DEBUG work on windows
5083         with MSVC.
5084
5085 2009-01-08  Miguel de Icaza  <miguel@novell.com>
5086
5087         * appdomain.c: Initialize the mono_strtod_mutex here, thanks to
5088         Robert Jordan for pointing this out.
5089
5090 2009-01-08  Christian Prochnow  <cproch@seculogix.de>
5091
5092         * icall.c
5093         * icall-def.h: added internal calls ves_icall_System_IO_DriveInfo_GetDiskFreeSpace,
5094         ves_icall_System_IO_DriveInfo_GetDriveType.
5095
5096 2009-01-07  Miguel de Icaza  <miguel@novell.com>
5097
5098         * icall.c: Wrap calls to mono_strtod in CriticalSection
5099         invocations when using eglib, to work around #464316.
5100
5101 2009-01-07 Rodrigo Kumpera  <rkumpera@novell.com>
5102
5103         * file-io.c (ves_icall_System_IO_MonoIO_GetCurrentDirectory): Double check the
5104         return value of GetCurrentDirectory to never access unitialized memory.
5105
5106 2009-01-07 Rodrigo Kumpera  <rkumpera@novell.com>
5107
5108         * file-io.c (ves_icall_System_IO_MonoIO_GetCurrentDirectory): Properly check the
5109         return value of GetCurrentDirectory and expand the buffer if needed.
5110
5111         Fixes #459094.
5112
5113 2009-10-07 Tom Hindle  <tom_hindle@sil.org>
5114
5115         * marshal.c (GetIUnknownForObjectInternal, GetIUnknownForObjectInternal) : 
5116           Adding a call to mono_init_com_types.
5117
5118         Code is contributed under MIT/X11 license.
5119
5120 2009-01-07  Geoff Norton  <gnorton@novell.com>
5121
5122         * socket-io.c: ioctlsocket(FIONREAD) returns the size of the UDP header as well on 
5123         darwin.  Use getsockopt SO_NREAD instead to get the right values for TCP and UDP.
5124         ai_canonname can be null in some cases on darwin, where the runtime assumes it will 
5125         be the value of the ip buffer.
5126
5127 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
5128
5129         * verify.c (mono_class_interface_implements_interface): Verify parents as we can't rely on
5130         interfaces_packed here.
5131
5132         Fixes part of #463294.
5133
5134 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
5135
5136         * verify.c (is_array_type_compatible): Ignore bounds and sizes when checking array compatibility.
5137
5138         Fixes part of #463294.
5139
5140 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
5141
5142         * verify.c (stack_slot_is_complex_type_not_reference_type): Check if the type
5143         is a boxed complex as well.
5144
5145         Fixes part of #463294.
5146
5147 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
5148
5149         * reflection.c (mono_image_get_methodref_token): Add an extra create_typespec parameter to
5150         control if a methodspec should be created for the generic method definition from external assemblies.
5151         Caching of methodspec is done using the handleref hash table.
5152
5153         Fixes #462592.
5154
5155 2009-01-05 Rodrigo Kumpera  <rkumpera@novell.com>
5156
5157         * loader.c (find_method): When searching the interfaces of a class
5158         check the transitive closure of implemented interfaces.
5159
5160         Fixes #463303.
5161
5162 2009-01-03 Rodrigo Kumpera  <rkumpera@novell.com>
5163
5164         * class.c (get_implicit_generic_array_interfaces): Improve debugging code.
5165         
5166 2009-01-03 Rodrigo Kumpera  <rkumpera@novell.com>
5167
5168         * class.c (get_implicit_generic_array_interfaces): Extract valuetype
5169         interfaces calculation to fill_valuetype_array_derived_types.
5170
5171         * class.c (get_implicit_generic_array_interfaces): Valuetypes need IList /
5172         ICollection / IEnumerator interfaces for their extra twin type - sbyte for byte
5173         for example.
5174
5175         * class.c (get_implicit_generic_array_interfaces): InternalEnumerator gets
5176         interfaces for valuetypes if needed.    
5177
5178         * class.c (fill_valuetype_array_derived_types): Enums should have interfaces
5179         for their basetype as well. Types are array expanded if rank is > 0.
5180
5181         Fixes #400716.
5182
5183 2008-12-30  Bill Holmes  <billholmes54@gmail.com>
5184
5185         * socket-io.h : Changing the signature of
5186           ves_icall_System_Net_Sockets_Socket_Accept_internal to pass
5187           the blocking state.
5188
5189         * icall-def.h :  Changing the signature of
5190           System.Net.Sockets.Socket.Accept_internal to pass the blocking state.
5191
5192         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Accept_internal) :
5193           For Windows only.  Avoid blocking when calling accept by
5194           querying for a connection via select.  The loop also queries
5195           the thread state every 1000 micro seconds for the thread
5196           stop state.  This will avoid the process hanging on shutdown
5197           when using a TcpChannel that is never connected to.
5198
5199         Code is contributed under MIT/X11 license.
5200
5201 2008-12-30  Marek Safar  <marek.safar@gmail.com>
5202
5203         * tabledefs.h: Add METHOD_ATTRIBUTE_CHECK_ACCESS_ON_OVERRIDE.
5204
5205 2008-12-26 Rodrigo Kumpera  <rkumpera@novell.com>
5206
5207         * class.c (get_implicit_generic_array_interfaces): Extract common
5208         code to a helper function making it a lot easier on the eyes.
5209
5210 2008-12-26 Rodrigo Kumpera  <rkumpera@novell.com>
5211
5212         * class.c (get_implicit_generic_array_interfaces): If the internal
5213         enumerator is an interface inflate System.Object instead of itself.
5214
5215         Fixes #461261.
5216
5217 2008-12-24 Rodrigo Kumpera  <rkumpera@novell.com>
5218
5219         * object.c (mono_runtime_invoke_array): Don't assert with
5220         byref nullable types.
5221
5222         * marshal.c (mono_marshal_get_runtime_invoke): To handle
5223         byref nullables we unbox the object and store it on the
5224         stack. 
5225         We can't use the boxed object since it is the T of Nullable<T>
5226         and the boxed representation of a nullable it's underlying type
5227         or null.
5228         We could cheat and create a boxed nullable and use the same
5229         machinery of other byref VTs but this feels like a hack and
5230         using the stack has the bonus of reducing heap pressure.
5231
5232         Fixes #461941.
5233
5234 2008-12-23 Rodrigo Kumpera  <rkumpera@novell.com>
5235
5236         * marshal.c (mono_marshal_emit_managed_wrapper): Handle char
5237         return value.
5238
5239         Fixes #461867.
5240
5241 2008-12-19  Bill Holmes  <billholmes54@gmail.com>
5242
5243         * icall-def.h : Adding an internal call definition for 
5244           System.Environment.internalBroadcastSettingChange.
5245
5246         * icall.c : Adding a Windows only implementation to broadcast a 
5247           WM_SETTINGCHANGE when an environment variable has changed.
5248
5249         Code is contributed under MIT/X11 license.
5250
5251 2008-12-19  Mark Probst  <mark.probst@gmail.com>
5252
5253         * class.c, class-internals.h: Made
5254         mono_class_has_parent_and_ignore_generics() non-static.
5255
5256 Thu Dec 18 16:35:22 CET 2008 Paolo Molaro <lupus@ximian.com>
5257
5258         * image.c: deal with the mmap failing when loading an image.
5259
5260 2008-12-17  Geoff Norton  <gnorton@novell.com>
5261
5262         * threadpool.c: Ensure that the io_queue_lock is initialized
5263         in all circumstances, as we always attempt to cleanup against it.
5264
5265 2008-12-17  Miguel de Icaza  <miguel@novell.com>
5266
5267         * icall.c (ves_icall_System_Environment_get_Platform): For
5268         compatibility reasons for existing client code we will keep
5269         returning 4 for a while.   
5270
5271         For how long will depend on the documentation being updated, and
5272         for us to give client code a chance to be updated.
5273
5274         This reverts the original decison on #433108 since we did not
5275         catch roughly 33 instances of the broken code in our own source
5276         code base, we did not catch failures on the buildbots, and QA did
5277         not bring this as a problem.
5278
5279         Only today I found some customer's code breaking due to our own
5280         class libraries not being fully updated and tracked it down to
5281         this change.  I am reverting it because if we could not even get
5282         our story straight in our own code base, how can we hope that our
5283         end user code be fixed?
5284
5285         As of this morning, our Wiki page that documents how to detect
5286         Unix had not been fixed.    
5287
5288 2008-12-16  Zoltan Varga  <vargaz@gmail.com>
5289
5290         * metadata.c (inflated_method_in_image): Add a workaround for #458168.
5291
5292         * class.c (mono_class_get_fields): Handle loading errors.
5293
5294 2008-12-12 Mark Mason <mmason@upwardaccess.com>
5295
5296         * 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.
5297         
5298 2008-12-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
5299
5300         * mono-perfcounters.c: avoid warning.
5301
5302 2008-12-12 Rodrigo Kumpera  <rkumpera@novell.com>
5303
5304         * reflection.c (ensure_runtime_vtable): Work on generic instances and
5305         make sure all interfaces have MonoClass::interface_id set.
5306
5307         * reflection.c (ensure_generic_class_runtime_vtable): Ensure the
5308         method table is property set.
5309
5310 2008-12-12 Rodrigo Kumpera  <rkumpera@novell.com>
5311
5312         * class.c: New function mono_class_setup_interface_id that setup
5313         MonoClass::interface_id if needed.
5314
5315         * class-internals.h: Export new function.
5316
5317 2008-12-12 Rodrigo Kumpera  <rkumpera@novell.com>
5318
5319         * class.c: Add code to sanity check the vtable after setup_vtable_general
5320         has done it's work.
5321
5322 2008-12-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
5323
5324         * icall.c: make Assembly.GetExecutingAssembly work properly when
5325         reflection is used to invoke the method.
5326         Bug #321781 fixed.
5327
5328 2008-12-11  Mark Probst  <mark.probst@gmail.com>
5329
5330         * metadata/generic-sharing.c: Look for constraints in all type
5331         arguments, not just the first one.
5332
5333 2008-12-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
5334
5335         * appdomain.c: return the correct CodeBase for an Assembly instance
5336         that was loaded from the shadow-copy directories.
5337         Bug #458190 fixed.
5338
5339 2008-12-10  Zoltan Varga  <vargaz@gmail.com>
5340
5341         * sgen-gc.c (build_nursery_fragments): Clear nursery_next/nursery_frag_real_end.
5342
5343         * sgen-gc.c (check_object): New debugging helper function.
5344
5345         * object.c: Fix calls to mono_value_copy_array ().
5346
5347 2008-12-10 Rodrigo Kumpera  <rkumpera@novell.com>
5348
5349         * class.c (mono_class_setup_fields): If working on an inflated class
5350         first check if the generic definition did init with success.
5351
5352         Fixes #445361.
5353
5354 2008-12-10 Rodrigo Kumpera  <rkumpera@novell.com>
5355
5356         pedump.c (main): Fix a warning.
5357
5358 2008-12-10  Bill Holmes  <billholmes54@gmail.com>
5359
5360         * object-internals.h : Adding a definition for 
5361           MonoReflectionComVisibleAttribute.
5362
5363         * marshal.c (cominterop_com_visible) :  Method added to check the 
5364           ComVisible attribute of a class.
5365
5366         * marshal.c (cominterop_raise_hr_exception, cominterop_get_interface) :  
5367           cominterop_raise_hr_exception added to consolidate common code 
5368           to raise hr exceptions.
5369
5370         * marshal.c (cominterop_can_support_dispatch) :  Method added to determine 
5371           if a managed class should support IDispatch.
5372
5373         * marshal.c 
5374           (cominterop_get_idispatch_for_objec, cominterop_ccw_queryinterfacet) :  
5375           Added additional checks for managed object when getting 
5376           an IDispatch interface.
5377
5378         Code is contributed under MIT/X11 license.
5379
5380 2008-12-10 Rodrigo Kumpera  <rkumpera@novell.com>
5381
5382         pedump.c (main): Handle mono_get_method () returning NULL. 
5383
5384 2008-12-09  Zoltan Varga  <vargaz@gmail.com>
5385
5386         * marshal.h: Fix a warning.
5387
5388 2008-12-09  Bill Holmes  <billholmes54@gmail.com>
5389
5390         * marshal.c : Adding cominterop_release_all_rcws to release all
5391           runtime callable wrappers held by the runtime.
5392
5393         * marshal.h : Adding declaration for cominterop_release_all_rcws.
5394           
5395         Code is contributed under MIT/X11 license.
5396
5397 2008-12-09  Zoltan Varga  <vargaz@gmail.com>
5398
5399         * metadata.c (mono_image_alloc_lock): New helper function.
5400         (mono_image_alloc0_lock): Ditto.
5401
5402         * metadata.c: Use the alloc_lock () helper functions for allocating
5403         memory from the image mempool.
5404
5405 2008-12-08 Rodrigo Kumpera  <rkumpera@novell.com>
5406
5407         * class.c (mono_class_from_generic_parameter): Document it's
5408         locking behavior. Fix double checked locking here, we stored in
5409         param->pklass a partially initialized MonoClass and no membar was used.
5410
5411 2008-12-05  Marek Habersack  <mhabersack@novell.com>
5412
5413         * sysmath.c (ves_icall_System_Math_Round2): if round (3) and rint
5414         (3) functions are present in the C library use them to do the
5415         job. If they are absent, make sure that the sum of int_part and
5416         dec_part is rounded before returning. This is necessary due to the
5417         division of dec_part by the power of 10 before the final addition
5418         is performed - if the result is not rounded in some cases it will
5419         yield invalid results.
5420
5421 2008-12-04  Zoltan Varga  <vargaz@gmail.com>
5422
5423         * marshal.c (mono_marshal_emit_native_wrapper): Add AOT support for pinvoke
5424         wrappers by emitting the function address using a CEE_MONO_ICALL_ADDR 
5425         instruction instead of a pointer constant.
5426
5427 2008-12-03  Zoltan Varga  <vargaz@gmail.com>
5428
5429         * loader.c (mono_method_get_header): Do most of the work outside the
5430         loader lock, to avoid assembly load hook deadlocks.
5431
5432         * metadata.c (mono_metadata_parse_mh_full): Use finer-grained locking.
5433         (mono_metadata_parse_type_full): Ditto.
5434
5435 2008-12-02 Rodrigo Kumpera  <rkumpera@novell.com>
5436
5437         * mempool.c (mono_backtrace): Take the number of allocated bytes as argument.
5438         Make the stack depth fixed. Ensure proper argument passing to the backtrace
5439         funtions. Finally, use a lock to produce well ordered output.
5440
5441         The lock looks silly, as all calls to the corlib mempool should be guarded
5442         with the loader lock, but for some reason this fact doesn't help. 
5443
5444         * mempool.c (mono_mempool_alloc0): Add support for TRACE_ALLOCATIONS.
5445
5446 2008-12-02  Mark Probst  <mark.probst@gmail.com>
5447
5448         * socket-io.c: 64 bit big-endian fixes.
5449
5450 2008-12-01 Rodrigo Kumpera  <rkumpera@novell.com>
5451
5452         * verify.c (is_compatible_boxed_valuetype): Rewrite function to work properly with
5453         targets that require strict compatibility between the types.
5454
5455         * verify.c (verify_stack_type_compatibility_full): Boxed values are not compatible
5456         to unboxed types. All cases that this is true are checked by is_compatible_boxed_valuetype.
5457         Kill the strict argument and create a new one valuetype_must_be_boxed.
5458
5459         * verify.c (verify_delegate_compatibility): Use verify_stack_type_compatibility_full to
5460         state that all valuetypes must be boxed.
5461
5462         Fixes #448560.
5463
5464 2008-11-29  Kornél Pál  <kornelpal@gmail.com>
5465
5466         * coree.c (MonoFixupExe): Use sizeof(IMAGE_BASE_RELOCATION) instead of
5467         IMAGE_SIZEOF_BASE_RELOCATION as newer Vista SDKs no longer define the latter.
5468
5469         Contributed under MIT/X11 license.
5470
5471 2008-11-28 Rodrigo Kumpera  <rkumpera@novell.com>
5472
5473         * class.c (mono_class_setup_fields): Don't copy MonoType::attrs as
5474         the inflate_generic_type machinery should handle it.
5475
5476         This avoids a crash when the field's flags is zero and it's type is
5477         a primitive.
5478         What happens is that mono_metadata_parse_type_full will see that opt_attrs
5479         is zero and will return one of the cached built-in primitive types. Since
5480         those types live in read-only memory, the code that copies it crashes.  
5481
5482 2008-11-28  Mark Probst  <mark.probst@gmail.com>
5483
5484         * object.c: Don't put function descriptors into generalized IMT
5485         thunks.
5486
5487 2008-11-28  Mark Probst  <mark.probst@gmail.com>
5488
5489         * class.c: Enable generic code sharing on PPC64.
5490
5491 2008-11-27  Mark Probst  <mark.probst@gmail.com>
5492
5493         * mempool.c, mempool-internals.h: Added g_slist_append_mempool()
5494         from mini/mini.c.
5495
5496         * generic-sharing.c: Allocate the method template slists from the
5497         image mempool so it doesn't leak.
5498
5499 2008-11-27 Rodrigo Kumpera  <rkumpera@novell.com>
5500
5501         * class.c (generic_array_methods): Release the linked list.
5502
5503 2008-11-27  Mark Probst  <mark.probst@gmail.com>
5504
5505         * marshal.c (mono_string_builder_to_utf8): Fixed a wrong
5506         invocation to g_utf16_to_utf8().
5507
5508 2008-11-26  Mark Probst  <mark.probst@gmail.com>
5509
5510         * icall.c (mono_ArgIterator_IntGetNextArg): Handle sub-word sized
5511         arguments on big endian archs.
5512
5513 2008-11-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
5514
5515         * reflection.c: (_mono_reflection_parse_type) skip leading spaces in
5516         the type name (test added in corlib).
5517
5518 2008-11-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
5519
5520         * pedump.c: initialize perf. counters. Fixes a segv.
5521
5522 2008-11-25  Martin Baulig  <martin@ximian.com>
5523
5524         * mono-debug-debugger.c
5525         (mono_debugger_runtime_invoke): Return the exception object if an
5526         exception was thrown.  Visual Studio displays the exception object
5527         in the locals window.
5528
5529 2008-11-24  Mark Probst  <mark.probst@gmail.com>
5530
5531         * mini-trampolines.c (mono_delegate_trampoline): Don't return a
5532         ftnptr.
5533
5534 2008-11-24  Mark Probst  <mark.probst@gmail.com>
5535
5536         * marshal.c (mono_type_native_stack_size): MONO_TYPE_I and
5537         MONO_TYPE_U are sizeof (gpointer), too.
5538
5539 2008-11-24  Mark Probst  <mark.probst@gmail.com>
5540
5541         * marshal.c (mono_type_native_stack_size): Fixed size and
5542         alignment for reference types.
5543
5544 2008-11-23  Mark Probst  <mark.probst@gmail.com>
5545
5546         * class.c (mono_class_generic_sharing_enabled): Disable generic
5547         code sharing for PPC64.
5548
5549 2008-11-21 Rodrigo Kumpera  <rkumpera@novell.com>
5550
5551         * icall.c (mono_method_get_equivalent_method): Make sure
5552         method->klass->methods is inited before looping over it.
5553
5554 2008-11-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
5555
5556         * object.c: when calling ExecuteAssembly in a newly created domain,
5557         the configuration file and application base are already set up.
5558         Bug #446353 take 2 fixed.
5559
5560 2008-11-20  Zoltan Varga  <vargaz@gmail.com>
5561
5562         * marshal.c: Add support for MONO_TYPE_GENERICINST to some functions.
5563         Fixes #444715. Fix a warning.
5564
5565 2008-11-18 Gonzalo Paniagua Javier <gonzalo@novell.com>
5566
5567         * appdomain.c: write the full path of the assembly to the .ini file
5568         created when "shadow-copying"
5569         Bug #446353 fixed.
5570
5571 2008-11-18  Zoltan Varga  <vargaz@gmail.com>
5572
5573         * debug-helpers.c (mono_method_full_name): Stringify wrapper types even
5574         if signature==FALSE.
5575
5576 2008-11-17  Bill Holmes  <billholmes54@gmail.com>
5577
5578         * marshal.h : Fix the cygwin build.
5579            marshal.c:12442: undefined reference to `_IID_IMarshal'
5580           
5581         Code is contributed under MIT/X11 license.
5582
5583 2008-11-17  Bill Holmes  <billholmes54@gmail.com>
5584
5585         * marshal.h : cominterop_ccw_getfreethreadedmarshaler added to return the
5586           free threaded marshaler when QueryInterface is called on a COM callable
5587           wrapper requesting the IMarshal interface.
5588           
5589         Code is contributed under MIT/X11 license.
5590
5591 2008-11-14  Zoltan Varga  <vargaz@gmail.com>
5592
5593         * domain-internals.h (MonoDomain): Update MONO_DOMAIN_LAST_GC_TRACKED.
5594
5595         * reflection.c (mono_type_get_object): Special case the very common
5596         void type.
5597
5598         * domain-internals.h (struct _MonoDomain): Add 'typeof_void' field to
5599         hold typeof(void).
5600
5601 2008-11-13  Bill Holmes  <billholmes54@gmail.com>
5602
5603         * process.h : Adding method declaration for
5604           ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
5605           
5606         * process.c : Adding implementation for
5607           ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
5608           
5609         * icall-def.h : Registering ICALL Processs.WaitForInputIdle_internal
5610           to ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
5611
5612         Code is contributed under MIT/X11 license.
5613
5614 2008-11-10  Rodrigo Kumpera  <rkumpera@novell.com>
5615
5616         * appdomain.c (unload_thread_main): Clean up threadpool by
5617         calling mono_thread_pool_remove_domain_jobs.
5618
5619         * domain-internals.h (struct _MonoDomain): Add new fields to
5620         help coordinate the cleanup of the threadpool.
5621
5622         * threadpool.c (mono_thread_pool_remove_domain_jobs): New fuction
5623         that cleans up the threadpool of all jobs associated with an appdomain.
5624         It does that by cleaning up the queues and making sure all active
5625         threads are accounted.
5626
5627         * threadpool.c (async_invoke_io_thread): Ignore job if its domain is
5628         unloaded or in the process of. Take this is such way that there is
5629         no race condition between another thread starting the unload and the
5630         current thread acknowledging it.
5631
5632         * threadpool.c (async_invoke_thread): Same.
5633
5634         * threadpool.c (start_io_thread_or_queue): Increment threadpool_jobs before
5635         firing the new thread.
5636
5637         * threadpool.c (start_tpthread): Same.
5638
5639         * theadpool.c (append_job): Increment threadpool_jobs before queueing.
5640
5641         * threadpool.h: Add mono_thread_pool_remove_domain_jobs.
5642
5643 2008-11-06  Jonathan Chambers  <joncham@gmail.com>
5644
5645         * file-io.c (ves_icall_System_IO_MonoIO_DuplicateHandle): 
5646         Add support for DuplicateHandle.
5647         
5648         * file-io.h (ves_icall_System_IO_MonoIO_DuplicateHandle): 
5649         Add support for DuplicateHandle.
5650         
5651         * icall-def.h (ves_icall_System_IO_MonoIO_DuplicateHandle): 
5652         Add support for DuplicateHandle.
5653
5654         Code is contributed under MIT/X11 license.
5655
5656 2008-11-06  Mark Probst  <mark.probst@gmail.com>
5657
5658         * class-internals.h: Make min_align into a whole byte.
5659
5660         * class.c: Set min_align for SIMD types to 16.
5661
5662 2008-11-05  Geoff Norton  <gnorton@novell.com>
5663
5664         * attach.c: Default the attacher to enabled for all cases including
5665         embedded.
5666
5667 Wed Nov 5 16:33:41 CET 2008 Paolo Molaro <lupus@ximian.com>
5668
5669         * monitor.c, class-internals.h, wrapper-types.h: revert incorrect
5670         change r117650.
5671
5672 2008-11-04  Mark Probst  <mark.probst@gmail.com>
5673
5674         * monitor.c, monitor.h: New function for querying offsets of
5675         members of MonoThreadsSync.
5676
5677 2008-11-04  Zoltan Varga  <vargaz@gmail.com>
5678
5679         * marshal.c (mono_marshal_get_runtime_invoke): Use runtime_invoke_direct_cache
5680         to speed up this function and to avoid the boundless memory growth caused by
5681         the signature_dup () calls.
5682
5683 2008-11-02  Zoltan Varga  <vargaz@gmail.com>
5684
5685         * monitor.c (mono_monitor_get_fast_enter_method): Add a proper type for the
5686         wrapper.
5687
5688         * class-internals.h (struct _MonoMethod): Increase the size of 'wrapper_type'
5689         by 1 bit.
5690
5691         * wrapper-types.h: Add MONO_WRAPPER_MONITOR_FAST_ENTER/EXIT.
5692
5693 2008-10-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
5694
5695         * appdomain.c:
5696         * domain-internals.h: made mono_set_private_bin_path_from_config()
5697         "internal".
5698         * object.c: call the above function after setting the configuration
5699         file path for the root domain.
5700         Fixes bug #314478.
5701
5702 2008-10-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
5703
5704         * assembly.c: when the assembly is loaded from an absolute path, end
5705         basedir with a directory separator.
5706         Bug #440781 fixed.
5707
5708 2008-10-30  Mark Probst  <mark.probst@gmail.com>
5709
5710         * monitor.c (mono_monitor_get_fast_enter_method): If
5711         CompareExchange is not available, don't create the fastpath
5712         instead of asserting.  (The method is missing in the 1.1 profile.)
5713
5714 2008-10-30  Mark Probst  <mark.probst@gmail.com>
5715
5716         * marshal.c, marshal.h: Rename signature_no_pinvoke() and make it non-static.
5717
5718         * monitor.c, monitor.h: Code for generating Monitor.Enter and
5719         Monitor.Exit IL fastpaths.
5720
5721 2008-10-28  Rodrigo Kumpera  <rkumpera@novell.com>
5722
5723         * class.c (mono_class_create_from_typedef): Added Vector2ul.
5724
5725 2008-10-28  Rodrigo Kumpera  <rkumpera@novell.com>
5726
5727         * class.c (mono_class_create_from_typedef): Added Vector2l.
5728
5729 2008-10-27  Rodrigo Kumpera  <rkumpera@novell.com>
5730
5731         * class.c (mono_class_create_from_typedef): Added Vector2d.
5732
5733 2008-10-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
5734
5735         * appdomain.c: translate \ into / for cache_path.
5736         * domain-internals.h: new mono_is_shadow_copy_enabled().
5737         * icall.c: (fill_reflection_assembly_name) do the same path
5738         manipulations that get_code_base does.
5739         (get_code_base) use mono_is_shadow_copy_enabled.
5740
5741 2008-10-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
5742
5743         * appdomain.c: shadow-copied assemblies go to CachePath +
5744         ApplicationName when both are set. DynamicBase has nothing to do with
5745         shadow copies.
5746         Bug #406877 fixed.
5747
5748 2008-10-26  Zoltan Varga  <vargaz@gmail.com>
5749
5750         * reflection.c (encode_locals): Use a cache to avoid duplicate entries in the
5751         STANDALONESIG table.
5752
5753         * metadata-internals.h (struct _MonoDynamicImage): Add cache for
5754         standalone signatures.
5755
5756         * marshal.c (mono_marshal_get_runtime_invoke): Rewrite the signature 
5757         comparison code: instead of comparing the signatures using a custom
5758         equals function, transform them to a common signature and compare that. This
5759         works better with AOT.
5760
5761 2008-10-25  Zoltan Varga  <vargaz@gmail.com>
5762
5763         * Reapply r116521 with (!mono_debug_using_mono_debugger ()) checks.
5764
5765         * class.c (mono_class_init): Remove unneccesary mono_class_setup_properties ()
5766         call for generic instances.
5767         (mono_class_setup_properties): Call setup_properties () before accessing
5768         gklass->properties.
5769
5770         * class.c (mono_class_get_virtual_methods): New helper function to iterate
5771         over the virtual methods of a class using metadata if possible, avoiding the
5772         creation of MonoMethod's for non-virtual methods.
5773         
5774         * class.c (mono_class_setup_vtable_general): Rewrite this to use 
5775         get_virtual_methods () to iterate over the virtual methods of classes.
5776
5777 2008-10-25  Martin Baulig  <martin@ximian.com>
5778
5779         * mono-debug.h (MONO_DEBUG_VAR_ADDRESS_MODE_DEAD): New #define.
5780
5781 2008-10-24  Rodrigo Kumpera  <rkumpera@novell.com>
5782
5783         * class.c (mono_class_create_from_typedef): Added Vector4i.
5784
5785 2008-10-24  Mark Probst  <mark.probst@gmail.com>
5786
5787         * marshal.c (mono_marshal_get_synchronized_wrapper): Emit
5788         ldtoken+GetTypeFromHandle instead of i4+icall so that the JIT
5789         special-casing applies to eliminate the call completely.
5790
5791 2008-10-24  Rodrigo Kumpera  <rkumpera@novell.com>
5792
5793         * class.c (mono_class_create_from_typedef): Added Vector8s.
5794
5795 2008-10-23  Rodrigo Kumpera  <rkumpera@novell.com>
5796
5797         * class.c (mono_class_create_from_typedef): Added Vector16sb.
5798
5799 2008-10-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
5800
5801         * icall.c: get rid of annoying warning.
5802
5803 2008-10-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
5804
5805         * threadpool.c: in 1.x, if you change the background status of the
5806         threadpool thread, it's not reset.
5807         Remove unnecessary calls to SetState.
5808
5809 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
5810
5811         * threadpool.c: asynchronously create a set of idle threads upon first
5812         use of the threadpool. SetMinThreads will now start the appropriate
5813         number of idle threads if they are not already running. The default is
5814         1 threadpool thread per CPU. Increased the maximum number of threads
5815         per CPU to 10.
5816
5817 2008-10-22  Martin Baulig  <martin@ximian.com>
5818
5819         Revert r116521 from Zoltan, it breaks the debugger:
5820
5821         * class.c (mono_class_get_virtual_methods): New helper function to iterate
5822         over the virtual methods of a class using metadata if possible, avoiding the
5823         creation of MonoMethod's for non-virtual methods.
5824         
5825         * class.c (mono_class_setup_vtable_general): Rewrite this to use 
5826         get_virtual_methods () to iterate over the virtual methods of classes.
5827
5828 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
5829
5830         * threads.c: when creating a threadpool thread, set its state to
5831         'background'.
5832         * threadpool.c: reset the background state of a threadpool thread
5833         after finishing each work item
5834         Bug #437888 fixed.
5835
5836 2008-10-22  Zoltan Varga  <vargaz@gmail.com>
5837
5838         * class.c (mono_class_get_vtable_entry): Add an optimization for szarrays.
5839         
5840         * class.c (mono_class_setup_vtable_general): Add an optimized version for
5841         generic instances which works by inflating the methods in the container
5842         class's vtable.
5843
5844         * class.c (mono_class_inflate_generic_type_with_mempool_no_copy): New
5845         variant which doesn't make a copy if no inflation was done.
5846         (mono_class_setup_fields): Use it.
5847
5848         * metadata.c (mono_metadata_get_shared_type): New helper function to
5849         return a shared instance of a given MonoType.
5850
5851         * class.c (mono_class_inflate_generic_type_with_mempool): Avoid making
5852         a copy of most non-generic types.
5853
5854 Wed Oct 22 18:00:46 CEST 2008 Paolo Molaro <lupus@ximian.com>
5855
5856         * threadpool.c: remove one more GetSystemInfo () call.
5857
5858 Wed Oct 22 17:45:48 CEST 2008 Paolo Molaro <lupus@ximian.com>
5859
5860         * mono-perfcounters.c, icall-def.h, environment.c, environment.h:
5861         use the code in mono-proclib.h to get processor information.
5862
5863 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
5864
5865         * appdomain.c: fixed the logic that determines whether assemblies in a
5866         directory are "shadow-copied" or not. Bug #433483 fixed.
5867
5868 2008-10-22  Zoltan Varga  <vargaz@gmail.com>
5869
5870         * process.c (ves_icall_System_Diagnostics_Process_GetProcessData): Fix a
5871         warning.
5872
5873 2008-10-21  Zoltan Varga  <vargaz@gmail.com>
5874
5875         * marshal.c (runtime_invoke_signature_equal): Don't shared wrappers
5876         returning a vtype.
5877
5878         * class.c debug-helpers.c object.c class-internals.h marshal.c icall.c
5879         reflection.c: Use mono_field_get_name () for accessing a field's name.
5880
5881         * class-internals.h (MONO_CLASS_HAS_STATIC_METADATA): Move this here from
5882         class.c
5883
5884         * class.c (mono_field_get_rva): Fix crash if this is called on a dynamic
5885         field.
5886
5887         * loader.c (find_method_in_class): Reenable the metadata optimization by
5888         not using it for generic instances.
5889
5890         * class-internals.h (MonoFieldDefaultValue): Extract the rarely used 
5891         data/def_type fields from MonoClassField into a separate structure.
5892         (struct MonoClassField): Remove data/def_type fields.
5893         (struct _MonoClass): Add a 'field_def_values' array to store the default
5894         values/RVA for fields.
5895
5896         * class.c reflection.c: Update after the changes.
5897         
5898         * object.c (mono_class_create_runtime_vtable): Use mono_field_get_data ()
5899         for accessing field->data.
5900
5901         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_InitializeArray): Ditto.
5902
5903         * loader.c (find_method_in_class): Revert the last change for now as
5904         it breaks Mono.C5 unit tests.
5905
5906         * class-internals.h (struct _MonoDynamicGenericClass): Add fields
5907         'field_generic_types' and 'field_objects' which contain the information
5908         previously stored in MonoInflatedField.
5909         (MonoInflatedField): Delete.
5910         (struct _MonoClassField): Delete 'generic_info' field.
5911
5912         * reflection.c: Store the information which was previously in 
5913         field->generic_info in MonoDynamicGenericClass instead.
5914
5915         * metadata.c (free_generic_class): Update after MonoDynamicGenericClass/
5916         MonoClassField changes.
5917
5918 Tue Oct 21 17:07:55 CEST 2008 Paolo Molaro <lupus@ximian.com>
5919
5920         * marshal.c, method-builder.c: get rid of wrapper_hash and instead
5921         store the value inside the data array of the MonoMethodWrapper.
5922         This saves memory, is faster and fixes the lifetime issues (methods
5923         were never removed from the hash previously). May also fix bug#436996.
5924
5925 2008-10-21  Zoltan Varga  <vargaz@gmail.com>
5926
5927         * reflection.c (mono_image_get_fieldref_token): For fields of non-dynamic 
5928         generic instances, compute the type from the generic definition instead of
5929         looking in field->generic_info.
5930
5931         * class.c (mono_class_setup_fields): Don't create a MonoInflatedField
5932         for inflated fields, the only user was get_fieldref_token () which no
5933         longer needs it.
5934
5935         * class.c (mono_class_init): Revert the last change as it seems to cause
5936         crashes.
5937
5938         * class-internals.h (struct _MonoClassField): Reorder fields to save 4
5939         bytes on 64 bit platforms.
5940
5941         * object.c (mono_class_create_runtime_vtable): Fix a warning.
5942         
5943         * object.c (mono_class_create_runtime_vtable): Don't initalize
5944         field->data/field->def_type here, it is done lazily by 
5945         mono_class_get_field_default_value ().
5946
5947         * icall.c (ves_icall_get_enum_info): Call 
5948         mono_class_get_field_default_value () instead of directly accessing
5949         field->data and field->def_type.
5950
5951         * object.c (get_default_field_value): Ditto.
5952
5953         * class.c (mono_field_get_data): Ditto.
5954         
5955         * class.c (mono_class_init): Remove unneccesary mono_class_setup_methods ()
5956         call for generic instances.
5957
5958         * loader.c (find_method_in_class): If klass != from_class, then inflate
5959         the method with the context of from_class, since the caller assumes this.
5960
5961 2008-10-20  Zoltan Varga  <vargaz@gmail.com>
5962
5963         * class.c (mono_method_get_vtable_index): Use mono_method_get_vtable_slot ()
5964         for accessing method->slot.
5965
5966 2008-10-20  Cedric Vivier  <cedricv@neonux.com>
5967
5968         * icall-def.h, icall.c: Add icall for Debugger.IsAttached.
5969
5970 2008-10-19  Zoltan Varga  <vargaz@gmail.com>
5971
5972         * class.c (mono_method_get_vtable_index): Use
5973         mono_method_get_vtable_slot () for accessing method->slot.
5974
5975         * object.c (build_imt_slots): Use mono_class_get_method_by_index () for
5976         accessing klass->methods.
5977
5978         * class.c (mono_method_get_vtable_slot): New helper function.
5979         (mono_class_get_vtable_entry): Ditto.
5980         (mono_class_setup_vtable_general): Use mono_method_get_vtable_slot () for
5981         accessing method->slot.
5982
5983         * generic-sharing.c (mono_class_get_method_generic): Pass the declaring
5984         method to get_inflated_method ().
5985
5986         * class.c (mono_class_get_inflated_method): New helper method to obtain
5987         a method of an inflated class without calling setup_methods ().
5988         (mono_class_get_cctor): Use get_inflated_method.
5989
5990         * generic-sharing.c (mono_class_get_method_generic): Ditto.
5991         
5992         * marshal.c image.c: Lazily create all the marshal caches.
5993
5994         * image.c (mono_image_init): Move initialization of runtime_invoke
5995         caches to marshal.c.
5996
5997         * marshal.c (get_cache): New helper function to lazily initialize a 
5998         wrapper cache.
5999         (mono_marshal_get_runtime_invoke): Share more runtime invoke wrappers.
6000
6001         * debug-helpers.c (mono_method_full_name): Include generic arguments.
6002
6003 Fri Oct 17 10:51:32 CEST 2008 Paolo Molaro <lupus@ximian.com>
6004
6005         * loader.c: fixed check for interface type.
6006
6007 Thu Oct 16 20:59:11 CEST 2008 Paolo Molaro <lupus@ximian.com>
6008
6009         * appdomain.c: check for NULL setup before it's referenced.
6010
6011 p
6012 Thu Oct 16 16:12:23 CEST 2008 Paolo Molaro <lupus@ximian.com>
6013
6014         * class.c: remove the unused old vtable setup code.
6015
6016 Thu Oct 16 12:53:29 CEST 2008 Paolo Molaro <lupus@ximian.com>
6017
6018         * class.c: don't depend on interface order in
6019         setup_interface_offsets (bug #435777).
6020         * reflection.c: sort the InterfaceImpl table (patch from
6021         Jb Evain  <jbevain@novell.com>).
6022
6023 2008-10-13  Zoltan Varga  <vargaz@gmail.com>
6024
6025         * assembly.c (mono_assembly_open_full): Avoid loading images while holding
6026         the low level assemblies lock.
6027
6028 Mon Oct 13 16:35:26 CEST 2008 Paolo Molaro <lupus@ximian.com>
6029
6030         * domain-internals.h, domain.c, icall.c, image.c, marshal.c,
6031         object.c, reflection.c, socket-io.c, threads.c: introduced
6032         mono_framework_version () to return the major framewrok version,
6033         changed the code that was using more complex patterns to use it.
6034         Return the correct value for PlatformID for OSX.
6035
6036 Mon Oct 13 14:38:01 CEST 2008 Paolo Molaro <lupus@ximian.com>
6037
6038         * icall-def.h, process.h, process.c: added an icall to get info about
6039         processes using mono-proclib.
6040
6041 Mon Oct 13 11:14:44 CEST 2008 Paolo Molaro <lupus@ximian.com>
6042
6043         * mono-perfcounters.c: use the mono-proclib functions to
6044         access process information.
6045
6046 Mon Oct 13 11:00:49 CEST 2008 Paolo Molaro <lupus@ximian.com>
6047
6048         * domain.c, assembly.c, debug-mono-symfile.c, debug-mono-symfile.h,
6049         monosn.c, Makefile.am, pedump.c, image.c, metadata-internals.h,
6050         reflection.c: remove rawbuffer usage: mmap support is more sanely
6051         provided by utils/mono-mmap.
6052
6053 Sat Oct 11 19:46:19 CEST 2008 Paolo Molaro <lupus@ximian.com>
6054
6055         * gc.c: use posix semaphores when possible so that
6056         mono_gc_finalize_notify() is signal safe.
6057
6058 2008-10-11  Zoltan Varga  <vargaz@gmail.com>
6059
6060         * reflection.c: Implement DISABLE_REFLECTION_EMIT, remove some
6061         #ifdef DISABLE_REFLECTION_SAVE stuff, only the exported functions need to
6062         be #ifdef-ed out, the linker will remove the rest.
6063
6064         * marshal.c: Implement DISABLE_COM.
6065
6066         * reflection.c: Implement DISABLE_REFLECTION_EMIT_SAVE.
6067
6068 2008-10-11  Miguel de Icaza  <miguel@novell.com>
6069
6070         * locales.c (string_invariant_compare_char): Optimization: do not
6071         call g_unichar_type unless we actually need the information.
6072
6073 2008-10-10  Mark Probst  <mark.probst@gmail.com>
6074
6075         * object.c, class-internals.h: Also create remoting trampolines
6076         for generic methods.  Pass the domain to the remoting trampoline
6077         creation function, too.
6078
6079 2008-10-10  Zoltan Varga  <vargaz@gmail.com>
6080
6081         * class.c (mono_class_init): Fix+re-enable the finalize optimization.
6082
6083 2008-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
6084
6085         * class.c (mono_class_create_from_typedef): Vector4u was renamed to
6086         Vector4ui.
6087
6088 2008-10-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
6089
6090         * assembly.c:
6091         * locales.c: remove the use of g_strdown. Fixes bug #322313.
6092
6093 Fri Oct 10 17:01:42 CEST 2008 Paolo Molaro <lupus@ximian.com>
6094
6095         * assembly.c: in mono_assembly_load_friends() take the assemblies lock
6096         for the least possible amount of time (extending the fix in r113458).
6097
6098 2008-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
6099
6100         * class.c (mono_class_create_from_typedef): Retrofit to new type names.
6101
6102 2008-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
6103
6104         * class.c (mono_class_create_from_typedef): Added Vector8u and Vector16u
6105         as possible simd intrinsic types.
6106         Optimized the test to check for the common prefix first.
6107
6108 Thu Oct 9 17:38:24 CEST 2008 Paolo Molaro <lupus@ximian.com>
6109
6110         * class.c: back out part of a broken optimization committed on
6111         May 23th (bug #433908).
6112
6113 2008-10-09  Mark Probst  <mark.probst@gmail.com>
6114
6115         * profiler.c (simple_shutdown): Don't call mono_thread_attach() on
6116         Win32.  Should fix #432388 for most cases until we have the new
6117         profiler on Win32.
6118
6119 2008-10-08  Zoltan Varga  <vargaz@gmail.com>
6120
6121         * metadata.c (mono_metadata_generic_context_hash): Call generic_inst_hash
6122         instead of using inst->id so the hash is stable for AOT.
6123
6124 2008-10-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
6125
6126         * appdomain.c:
6127         * icall.c: create a .ini file for shadow-copied assemblies that
6128         contains the location of the original assembly. Use this to return the
6129         proper CodeBase for shadow-copied assemblies. Fixes bug #323606.
6130         Also fix the number of '/' for windows when returning the CodeBase.
6131         Fixes bug #430920.
6132
6133 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
6134
6135         * marshal.c (cominterop_get_ccw) : Fixing a copy paste error from r115126.
6136
6137         Code is contributed under MIT/X11 license.
6138
6139 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
6140
6141         * marshal.c (cominterop_get_native_wrapper) : Adding a call to mono_class_setup_vtable
6142           if if the class vtable needs initialized.
6143
6144         Code is contributed under MIT/X11 license.
6145
6146 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
6147
6148         * marshal.c (cominterop_get_native_wrapper_adjusted, cominterop_get_ccw) : 
6149           Adding default MonoMarshalSpecs for COM methods.  OBJECT->STRUCT,
6150           STRING->BSTR, and CLASS->INTERFACE.
6151
6152         Code is contributed under MIT/X11 license.
6153
6154 2008-10-07  Marek Habersack  <mhabersack@novell.com>
6155
6156         * sysmath.h: changed the declaration of the
6157         ves_icall_System_Math_Round2 icall by adding an extra
6158         away_from_zero parameter.
6159
6160         * sysmath.c (ves_icall_System_Math_Round2): added support for
6161         away from zero rounding. The icall now takes an extra boolean
6162         parameter to signal that away from zero operation is requested.
6163
6164 2008-10-06  Zoltan Varga  <vargaz@gmail.com>
6165
6166         * marshal.c (mono_marshal_get_delegate_begin_invoke): Put the wrapper in
6167         the delegate klass so it can work with full-aot.
6168         (mono_marshal_get_delegate_end_invoke): Ditto.
6169         (mono_marshal_get_delegate_invoke): Ditto.
6170
6171 Mon Oct 6 16:10:02 CEST 2008 Paolo Molaro <lupus@ximian.com>
6172
6173         * gc.c, attach.h, attach.c: remove a bad pattern:
6174         add_finalizer_callback () is not implemented correctly, it can't
6175         without adding more overhead to the finalizer loop and it's not
6176         even needed, since we know exactly what we need to call, so there is
6177         no need to do so through an expensive function pointer.
6178
6179 2008-10-04  Zoltan Varga  <vargaz@gmail.com>
6180
6181         * gc.c: Define a dummy version of mono_gc_add_finalizer_thread_callback ()
6182         for the no-gc case.
6183         * attach.c (mono_attach_init): Remove the #ifdef.
6184
6185 2008-10-04  Andreas Färber  <andreas.faerber@web.de>
6186
6187         * attach.c (mono_attach_init): Don't use
6188         mono_gc_add_finalizer_thread_callback when compiling without GC.
6189         Fixes #432306.
6190         
6191         Code is contributed under MIT/X11 license.
6192
6193 2008-10-03  Zoltan Varga  <vargaz@gmail.com>
6194
6195         * class.c (mono_class_create_from_typedef): Remove the 
6196         #ifndef DISABLE_SIMD stuff.
6197
6198 2008-10-03  Rodrigo Kumpera  <rkumpera@novell.com>
6199
6200         * class-internals.h (MonoClass): Added simd_type bit field.
6201
6202         * class.c (mono_class_create_from_typedef): Check if type is a simd
6203         intrinsic.
6204
6205 2008-10-03  Mark Probst  <mark.probst@gmail.com>
6206
6207         * object.c (mono_method_add_generic_virtual_invocation): Only add
6208         instantiations to the thunk whose count is at least as large as
6209         the threshold.
6210
6211 2008-10-02 Gonzalo Paniagua Javier <gonzalo@novell.com>
6212
6213         * icall.c: changed the Type of the exception thrown when trying to
6214         invoke a constructor on an abstract class. Part of the fix for bug
6215         #324185.
6216
6217 2008-10-02  Mark Probst  <mark.probst@gmail.com>
6218
6219         * class.c, class-internals.h (mono_method_get_vtable_index): New
6220         function which returns the index into the vtable and properly
6221         handles inflated virtual generic methods.
6222
6223 2008-10-01  Mark Probst  <mark.probst@gmail.com>
6224
6225         * object.c, domain.c, object-internals.h, domain-internals.h:
6226         Generalize IMT thunk machinery to also handle thunks for virtual
6227         generic method invokes.  When a virtual generic method is invoked
6228         more than a number of times we insert it into the thunk so that it
6229         can be called without lookup in unmanaged code.
6230
6231         * generic-sharing.c, class-internals.h: Fetching a
6232         MonoGenericInst* for a method from an (M)RGCTX.
6233
6234 2008-10-01  Zoltan Varga  <vargaz@gmail.com>
6235
6236         * marshal.c (emit_marshal_string): Applied a variant of a patch by
6237         tom hindle <tom_hindle@sil.org>. Fix byref native-to-managed string
6238         marshalling. Fixes #431304.
6239
6240 2008-10-01  Bill Holmes  <billholmes54@gmail.com>
6241
6242         * marshal.c (emit_marshal_variant) : Change the attribute checks to 
6243           handle when ref is specified without In or Out.
6244
6245         Code is contributed under MIT/X11 license.
6246
6247 2008-09-30  Mark Probst  <mark.probst@gmail.com>
6248
6249         * loader.c (mono_get_method_constrained): Don't expand method with
6250         the class's context, because it's already a method of that class.
6251
6252 2008-09-30  Atsushi Enomoto  <atsushi@ximian.com>
6253
6254         * attach.c : should be correct build fix.
6255
6256 2008-09-29  Zoltan Varga  <vargaz@gmail.com>
6257
6258         * attach.c: Fix the previous change.
6259
6260 2008-09-29  Atsushi Enomoto  <atsushi@ximian.com>
6261
6262         * attach.c : quick w32 build fix.
6263
6264 2008-09-27  Miguel de Icaza  <miguel@novell.com>
6265
6266         * Turn off MONO_GENERIC_SHARING=all and go back to corlib as it
6267         crashes MonoDevelop: #430455.
6268
6269 2008-09-27  Zoltan Varga  <vargaz@gmail.com>
6270
6271         * domain-internals.h (struct _MonoDomain): Move most fields used only by
6272         the JIT do MonoJitDomainInfo in ../mini/mini.h.
6273
6274         * domain.c: Remove initialization/cleanup of the removed fields.
6275
6276 2008-09-27  Mark Probst  <mark.probst@gmail.com>
6277
6278         * class.c (mono_class_generic_sharing_enabled): Enable generic
6279         code sharing for PPC.
6280
6281 2008-09-26  Bill Holmes  <billholmes54@gmail.com>
6282
6283         * attach.c : Fixing the Windows builds.
6284
6285         Code is contributed under MIT/X11 license.
6286
6287 2008-09-25  Zoltan Varga  <vargaz@gmail.com>
6288
6289         * class.c (mono_class_generic_sharing_enabled): Experimentally change 
6290         the default generic sharing mode to 'all'.
6291
6292 2008-09-25  Mark Probst  <mark.probst@gmail.com>
6293
6294         * generic-sharing.c, class-internals.h: New function for checking
6295         whether a method needs a static RGCTX invoke wrapper.  A few
6296         funtions moved from mini/generic-sharing.c.
6297
6298         * icall.c: New function used.
6299
6300 2008-09-25  Mark Probst  <mark.probst@gmail.com>
6301
6302         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal):
6303         Static RGCTX invoke wrapping applies to value type methods, too.
6304
6305         * class.c (mono_class_setup_vtable_general): In generic-shared
6306         value types, wrap methods with a static RGCTX invoke wrapper.
6307
6308 2008-09-25  Zoltan Varga  <vargaz@gmail.com>
6309
6310         * attach.c (ipc_connect): Use AF_UNIX instead of AF_FILE to fix the
6311         osx build.
6312
6313 2008-09-24  Zoltan Varga  <vargaz@gmail.com>
6314
6315         * gc.c (mono_gc_add_finalizer_thread_callback): New function to
6316         register a callback which is called when the finalizer thread is woken
6317         up.
6318         (finalizer_thread): Call the callback if it exists.
6319
6320         * attach.h attach.c: New files, implementing the attach mechanism.
6321
6322         * appdomain.c: Init/cleanup the attach mechanism on startup/shutdown.
6323         
6324         * object.c (mono_object_get_virtual_method): Fix an assertion introduced
6325         by the previous change.
6326
6327 Tue Sep 23 15:24:03 CEST 2008 Paolo Molaro <lupus@ximian.com>
6328
6329         * class.c, domain-internals.h, domain.c, generic-sharing.c, image.c,
6330         loader.c, marshal.c, metadata-internals.h, metadata.c,
6331         method-builder.c, object.c, reflection.c: introduced specific functions
6332         to allocate from the domain and image mempools and cleaned up most of
6333         the code to use them (still missing a few in reflection.c).
6334         Keep the loader bytes counter updated.
6335
6336 Mon Sep 22 17:33:12 CEST 2008 Paolo Molaro <lupus@ximian.com>
6337
6338         * domain.c, monitor.c, boehm-gc.c, gc.c: update some of the GC and
6339         loader-related counters.
6340
6341 Mon Sep 22 17:29:54 CEST 2008 Paolo Molaro <lupus@ximian.com>
6342
6343         * mono-perfcounters-def.h, mono-perfcounters.c, class-internals.h:
6344         added more MS-compatible counters.
6345
6346 2008-09-22  Zoltan Varga  <vargaz@gmail.com>
6347
6348         * class.c (mono_class_setup_fields): Call setup_fields before accessing
6349         class->blittable. Fixes #428217.
6350
6351 2008-09-21  Zoltan Varga  <vargaz@gmail.com>
6352
6353         * reflection.c (mono_image_get_field_on_inst_token): Call 
6354         field_encode_signature () since that handles custom modifiers too.
6355         Fixes #424663.
6356
6357 2008-09-20  Zoltan Varga  <vargaz@gmail.com>
6358
6359         * reflection.c (add_custom_modifiers): New helper function to merge custom
6360         modifiers stored in objects to a MonoType.
6361         (fieldref_encode_signature): Encode custom modifiers.
6362         (mono_image_get_generic_field_token): Call add_custom_modifiers ().
6363         (fieldbuilder_to_mono_class_field): Ditto. Fixes #424663.
6364
6365 2008-09-19  Kornél Pál  <kornelpal@gmail.com>
6366
6367         * coree.c (_CorValidateImage): Some 64-bit IL only images have entry point
6368         calling _CorDllMain imported from mscoree.dll. Set entry point RVA to 0 for
6369         64-bit IL only images because imports are not resolved for IL only images.
6370         Special thanks to Bill Holmes for finding this bug and testing the patch.
6371         Also fail for 64-bit images marked as CLI_FLAGS_32BITREQUIRED.
6372
6373         Contributed under MIT/X11 license.
6374
6375 2008-09-19  Miguel de Icaza  <miguel@novell.com>
6376
6377         * mono-config.c (dllmap_start): Add support for the bits keyword
6378         on dllentry and dllmap to easily detect 32 vs 64 bit systems.
6379
6380 2008-09-19  Mark Probst  <mark.probst@gmail.com>
6381
6382         * reflection.c (inflate_mono_method): When the class the method is
6383         to be inflated for is itself not inflated, just return the method.
6384
6385 Fri Sep 19 11:51:36 CEST 2008 Paolo Molaro <lupus@ximian.com>
6386
6387         * mono-perfcounters.c: use more user friendly process instance names.
6388
6389 2008-09-18  Bill Holmes  <billholmes54@gmail.com>
6390
6391         * marshal.c (emit_marshal_variant) : Change the attribute checks to 
6392           handle "[in] ref" and "[in][out] ref" cases.
6393
6394         * marshal.c (cominterop_get_ccw) : The wrong signature was being passed
6395           to mono_mb_create_method.  This was causing problems calling native to
6396           managed passing Variants by value.
6397
6398         Code is contributed under MIT/X11 license.
6399
6400 2008-09-18  Zoltan Varga  <vargaz@gmail.com>
6401
6402         * class.c (can_access_internals): Call mono_assembly_load_friends ()
6403         before accessing the friend_assembly_names field.
6404
6405         * assembly.c (mono_assembly_load_friends): Make this callable multiple
6406         times.
6407         (mono_assembly_load_from_full): Avoid calling load_friends (), it is
6408         called lazily when it is needed.
6409
6410         * metadata-internals.h (struct _MonoAssembly): Add 
6411         'friend_assembly_names_inited' flag.
6412
6413 Thu Sep 18 18:18:47 CEST 2008 Paolo Molaro <lupus@ximian.com>
6414
6415         * mono-perfcounters-def.h: fix the types of a few counters.
6416         * mono-perfcounters.c: implemented the instance names getter
6417         and a few bugfixes.
6418
6419 2008-09-18  Atsushi Enomoot  <atsushi@ximian.com>
6420
6421         * culture-info-table.h : regenerated.
6422
6423 2008-09-17  Robert Jordan  <robertj@gmx.net>
6424
6425         * marshal.c (mono_marshal_get_ldflda_wrapper): Add support for
6426         context bound objects. Fixes #415577.
6427
6428         Code is contributed under MIT/X11 license.
6429
6430 Tue Sep 16 21:03:58 CEST 2008 Paolo Molaro <lupus@ximian.com>
6431
6432         * icall-def.h, threads-types.h, threads.c: fixed SpinWait()
6433         implementation (bug #423582).
6434
6435 2008-09-16  Zoltan Varga  <vargaz@gmail.com>
6436
6437         * object.c (mono_object_get_virtual_method): Handle the case method->slot
6438         is not set. Fixes #426309.
6439
6440 2008-09-16  Jb Evain  <jbevain@novell.com>
6441
6442         * class.c (mono_class_from_name): fix the exported type look up
6443         when the type is defined in a referenced assembly.
6444
6445 2008-09-16  Jb Evain  <jbevain@novell.com>
6446
6447         * reflection.c (mono_image_fill_export_table_from_type_forwarders):
6448         increment the next index counter on each iteration to make that work
6449         for more than one type forwarder. Unmanaged part to fix #422929.
6450
6451 2008-09-15  Mark Probst  <mark.probst@gmail.com>
6452
6453         * object-internals.h: enum ComInterfaceType in
6454         MonoInterfaceTypeAttribute is guint32, not guint16.
6455
6456 2008-09-12  Mark Probst  <mark.probst@gmail.com>
6457
6458         * cil-coff.h, image.c, reflection.c: Endianness fixes in image
6459         writing code.
6460
6461 2008-09-11  Mark Probst  <mark.probst@gmail.com>
6462
6463         * icall.c: Boolean arguments to a runtime invoke are MonoBoolean,
6464         not gboolean.
6465
6466 2008-09-11  Mark Probst  <mark.probst@gmail.com>
6467
6468         * debug-mono-symfile.c (mono_debug_symfile_lookup_location):
6469         Endianness fixes for MonoSymbolFileOffsetTable.
6470
6471 2008-09-10  Bill Holmes  <billholmes54@gmail.com>
6472
6473         * process.c (complete_path) : Removing quotes from the 
6474           input path.  The glib file routines do not handle file paths
6475           that have quotes around them.
6476
6477         Code is contributed under MIT/X11 license.
6478
6479 2008-09-10  Bill Holmes  <billholmes54@gmail.com>
6480
6481         * socket-io.h : Adding a comment to provide locations where 
6482           changes to MonoSocketAsyncResult need to be synced.
6483
6484         Code is contributed under MIT/X11 license.
6485
6486 2008-09-10  Zoltan Varga  <vargaz@gmail.com>
6487
6488         * marshal.c (emit_marshal_custom): Call NativeToManaged for non-out 
6489         parameters as well. Fixes #425001.
6490
6491 2008-09-08  Miguel de Icaza  <miguel@novell.com>
6492
6493         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup): Fix
6494         windows build.
6495
6496 2008-09-07  Miguel de Icaza  <miguel@novell.com>
6497
6498         * console-io.c: Add support for tracking the window size if it
6499         changes.
6500
6501         The setup is very simple: the TtySetup function will now return a
6502         pointer to a location in memory that tracks the current console
6503         size.  The managed code checks its current value every time its
6504         queried against the last value set, and updates accordingly.
6505
6506         With this setup we can work with multiple consoles, and we do not
6507         require to poke into managed code from a signal handler.
6508
6509         Additionally, the environment for COLUMNS and LINES is now handled
6510         in unmanaged code.
6511
6512         (ves_icall_System_ConsoleDriver_GetTtySize): This is now gone.
6513
6514 2008-09-07  Mark Probst  <mark.probst@gmail.com>
6515
6516         * marshal.c (mono_type_native_stack_size): Treat
6517         MONO_TYPE_TYPEDBYREF like MONO_TYPE_VALUETYPE.
6518
6519 2008-09-04  Jb Evain  <jbevain@novell.com>
6520
6521         * class.c (mono_class_is_assignable_from): fix assignability of nullables
6522         to nullables.
6523
6524 2008-09-03 Rodrigo Kumpera  <rkumpera@novell.com>
6525
6526         * verify.c (verify_type_compatibility_full): Revert change
6527         to allow converting a native int to unmanaged pointer be verifiable
6528         under non-strict mode.
6529         It turns out that "(IntPtr)null" is indeed unverifiable, go figure.
6530
6531         * verify.c: Added some TODOs.
6532
6533 2008-09-02  Bill Holmes  <billholmes54@gmail.com>
6534
6535         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi,
6536           ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni) :
6537           Changed to use GlobalAlloc for the memory returned on Windows platforms.
6538
6539         Code is contributed under MIT/X11 license.
6540
6541 2008-09-02  Jb Evain  <jbevain@novell.com>
6542
6543         * object.c (mono_ldstr_metdata_sig): renamed to mono_ldstr_metadata_sig.
6544
6545 2008-09-02 Rodrigo Kumpera  <rkumpera@novell.com>
6546
6547         reflection.c (typebuilder_setup_fields): Handle classes with
6548         explicit size.
6549
6550 2008-09-01 Rodrigo Kumpera  <rkumpera@novell.com>
6551
6552         class.c (mono_class_setup_events): Add memory barrier due to
6553         double checked locking.
6554         
6555         class.c (mono_class_setup_properties): Same.
6556
6557 2008-08-31  Zoltan Varga  <vargaz@gmail.com>
6558
6559         * class.c (mono_class_is_assignable_from): Fix the build.
6560         
6561         * class.c (mono_class_is_assignable_from): Call mono_class_setup_vtable ()
6562         before accessing klass->interface_bitmap. Fixes #421744.
6563
6564 2008-08-28  Zoltan Varga  <vargaz@gmail.com>
6565
6566         * appdomain.c (mono_runtime_set_no_exec): New internal function setting
6567         the runtime into no-exec mode, useful when running the AOT compiler.
6568
6569         * appdomain.c gc.c object.c: Avoid executing managed code when running
6570         in no-exec mode.
6571         
6572         * rawbuffer.c (mono_raw_buffer_load_mmap): Disable this on the iphone.
6573
6574         * reflection.c (_mono_reflection_get_type_from_info): Handle the 
6575         special case when the mono_assembly_loaded () returns NULL because the 
6576         search hook is not installed.
6577
6578 2008-08-25  Zoltan Varga  <vargaz@gmail.com>
6579
6580         * marshal.c: Applied patch from tom hindle (tom_hindle@sil.org) to fix
6581         crashes in bstr marshalling on linux.
6582
6583 2008-08-24  Zoltan Varga  <vargaz@gmail.com>
6584
6585         * debug-helpers.c (mono_type_get_desc): Fix printing of generic instances
6586         with more than one parameter.
6587
6588 2008-08-24  Miguel de Icaza  <miguel@novell.com>
6589
6590         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup): Disable
6591         start/stop flow control as well when turning off ICANON (allows
6592         C-s and C-q to be read by Console.ReadKey).
6593
6594 2008-08-24  Zoltan Varga  <vargaz@gmail.com>
6595
6596         * class.c (mono_class_init): Move the initialization of nested classes
6597         into mono_class_get_nested_types (). Fixes #418433.
6598
6599         * class-internals.h (struct _MonoClass): Add a new 'nested_classes_inited'
6600         flag.
6601
6602         * class.c reflection.c icall.c: Use mono_class_get_nested_types () for 
6603         iterating tough the nested classes of a class.
6604
6605 2008-08-23  Zoltan Varga  <vargaz@gmail.com>
6606
6607         * class.c (mono_class_generic_sharing_enabled): Enable generic sharing
6608         on arm.
6609
6610 2008-08-22  Miguel de Icaza  <miguel@novell.com>
6611
6612         * console-io.c (sigcont_handler): Support signal chaining for
6613         SIGCONT.
6614
6615         (console_set_signal_handlers): Use best practices with sigaction,
6616         clear the structure before using it. 
6617
6618 2008-08-22  Robert Jordan  <robertj@gmx.net>
6619
6620         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup):
6621         Fix the Windows build.
6622
6623 2008-08-22  Zoltan Varga  <vargaz@gmail.com>
6624
6625         * class.c (mono_class_generic_sharing_enabled): Make the default
6626         sharing mode 'corlib'.
6627
6628 2008-08-21  Zoltan Varga  <vargaz@gmail.com>
6629
6630         * console-io.c (console_set_signal_handlers): Fix a warning.
6631
6632         * marshal.c (mono_marshal_get_synchronized_wrapper): Call the wrapper
6633         method normally, the JIT will take care of avoiding recursion.
6634
6635 2008-08-20  Bill Holmes  <billholmes54@gmail.com>
6636
6637         * console-io.c : Fixing builds for platforms that do not have <termios.h>.
6638
6639         Code is contributed under MIT/X11 license.
6640
6641 2008-08-20  Miguel de Icaza  <miguel@novell.com>
6642
6643         * console-io.c (sigcont_handler): We need to restore the entire
6644         termios state, not only the original settings, as things like echo
6645         can be controlled after this (Booish exposes this issue with its
6646         own ReadLine implementation).
6647
6648         Additionally, we need to set the terminal back into keypad_xmit
6649         mode.
6650         
6651         (ves_icall_System_ConsoleDriver_TtySetup): Take the keypad xmit
6652         string as a paramter as well.   Otherwise we get different
6653         keyboard sequences.
6654
6655 2008-08-20  Zoltan Varga  <vargaz@gmail.com>
6656
6657         * marshal.c (emit_marshal_object): Avoid managed-to-native marshalling of
6658         delegates with byref out parameter passing. Fixes #351520.
6659
6660         * debug-helpers.c (mono_context_get_desc): New helper function to stringify
6661         a generic context.
6662         (mono_type_get_desc): Add the type arguments for GENERICINST.
6663         (mono_method_full_name): Stringify the class name using mono_type_full_name
6664         so it picks up generic arguments.
6665
6666 2008-08-19  Gert Driesen  <drieseng@users.sourceforge.net>
6667
6668         * console-io.c: Removed debug output.
6669
6670 2008-08-19 Rodrigo Kumpera  <rkumpera@novell.com>
6671
6672         reflection.c (mono_reflection_create_runtime_class): Alloc
6673         the nested classes linked list using the dynamic image mempool.
6674         Fixes leak in corlib compilation.
6675
6676 2008-08-19  Miguel de Icaza  <miguel@novell.com>
6677
6678         * console-io.c: Fix incredibly annoying behavior on the console
6679         after resuming execution after control-z.   This affected every
6680         console application.
6681
6682 2008-08-18 Rodrigo Kumpera  <rkumpera@novell.com>
6683
6684         * mempool-internals.h: Header for mono private mempool functions. The first
6685         two function are for allocating glib linked lists using pools.
6686
6687         * mempool.c: Added g_list_prepend_mempool and g_slist_prepend_mempool.
6688
6689         * Makefile.am: Added mempool-internals.h.
6690
6691 2008-08-16  Zoltan Varga  <vargaz@gmail.com>
6692
6693         * domain.c (mono_domain_create): Call the JIT domain hook if installed.
6694         (mono_domain_free): Ditto.
6695
6696         * domain-internals.h (struct _MonoDomain): Add 'runtime_info' field, this could
6697         be used by the JIT to store its domain-specific information, instead of putting
6698         it directly into MonoDomain.
6699
6700         * domain.c (mono_install_create_domain_hook): New helper function to install
6701         a hook which initializes domain->runtime_info.
6702
6703         * domain.c (mono_install_free_domain_hook): Ditto.
6704         
6705 2008-08-15  Zoltan Varga  <vargaz@gmail.com>
6706
6707         * marshal.c (mono_delegate_end_invoke): Raise an exception instead of
6708         asserting if the ares parameter is null.
6709
6710         * mono-perfcounters.c: Fix warnings.
6711
6712         * marshal.c (mono_marshal_get_delegate_begin_invoke): Don't set save_lmf, it
6713         is not needed, don't check for interruptions either.
6714         (mono_marshal_get_delegate_end_invoke): Ditto.
6715
6716 2008-08-15  Marek Habersack  <mhabersack@novell.com>
6717
6718         * mono-perfcounters.c (predef_readonly_counter): added support for
6719         reading the ASP.NET Requests Queued counter from another process.
6720
6721 2008-08-12  Zoltan Varga  <vargaz@gmail.com>
6722
6723         * metadata-internals.h: Move the 'aot_module' field from MonoAssembly to
6724         MonoImage to simplify the AOT code.
6725
6726 2008-08-10  Zoltan Varga  <vargaz@gmail.com>
6727
6728         * marshal.c (emit_marshal_object): Implement native-to-managed StringBuilder
6729         marshalling. Fixes #416078.
6730
6731 2008-08-08  Zoltan Varga  <vargaz@gmail.com>
6732         
6733         * marshal.c (mono_marshal_get_native_wrapper): Add an 'aot' argument, when
6734         it is set, looking up the icall address is deferred to the JIT, since 
6735         in embedded scenarios, the icall might not be registered in the runtime
6736         doing the AOT compilation. Backported from the 2.0 branch.
6737
6738 2008-08-08  Zoltan Varga  <vargaz@gmail.com>
6739
6740         * marshal.c (mono_remoting_wrapper): Handle nullable types correctly.
6741         Fixes #415621.
6742
6743 2008-08-05  Marek Habersack  <mhabersack@novell.com>
6744
6745         * Makefile.am: added support for cross-compilation.
6746
6747 2008-08-04  Zoltan Varga  <vargaz@gmail.com>
6748
6749         * socket-io.c (get_socket_assembly): Make 'moonlight' variable static.
6750
6751 Fri Aug 1 18:47:48 CEST 2008 Paolo Molaro <lupus@ximian.com>
6752
6753         * mono-perfcounters.c: jitted methods and jitted bytes counters.
6754
6755 Fri Aug 1 16:07:09 CEST 2008 Paolo Molaro <lupus@ximian.com>
6756
6757         * class-internals.h, icall-def.h, mono-perfcounters-def.h,
6758         mono-perfcounters.c: performance counters implementation.
6759
6760 2008-07-31  Zoltan Varga  <vargaz@gmail.com>
6761
6762         * metadata-internals.h (struct _MonoAssembly): Change the type of 'aot_module'
6763         to gpointer, letting the AOT code decide what to store in it.
6764
6765 2008-07-31  Bill Holmes  <billholmes54@gmail.com>
6766
6767         * marshal.c (cominterop_get_native_wrapper) : Adding a call to 
6768           mono_class_setup_methods if the methods are not initialized.
6769
6770         Code is contributed under MIT/X11 license.
6771
6772 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
6773
6774         * verify.c: Remove some debug code I commited by accident.
6775
6776         * verify.c (mono_method_is_valid_in_context): Change the return value
6777         to make possible to distinguish between invalid and unverifiable.
6778
6779         * verify.c (verifier_load_method): Don't return NULL for unverifiable
6780         methods.
6781
6782 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
6783
6784         * verify.c (mono_generic_param_is_constraint_compatible): Inflate type
6785         constraints. Fixes regression in gtest-253.
6786
6787 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
6788
6789         * verify.c (mono_verifier_verify_class): Don't allow generic types
6790         with explicit layout.
6791
6792         * verify.c (mono_method_verify): Check locals and argument types.
6793
6794 2008-07-29  Zoltan Varga  <vargaz@gmail.com>
6795
6796         * monitor.c (mono_monitor_try_enter_internal): Allow nterruption of the
6797         wait if the thread is in StopRequested state.
6798
6799         * class.c (mono_class_from_name): Refactor the module searching code into
6800         a separate function so it can be reused in the AOT case too.
6801
6802 2008-07-28 Rodrigo Kumpera  <rkumpera@novell.com>
6803
6804         * verify.c (mono_type_is_valid_in_context): Improve the error message.
6805         Check both the type and it's generic type definition for loader errors.
6806         
6807         * verify.c (mono_method_is_valid_in_context): Don't generate another
6808         error when a type errors occur, this leads to the wrong exception been
6809         thrown.
6810
6811 2008-07-28  Dick Porter  <dick@ximian.com>
6812
6813         * icall-def.h
6814         * process.c
6815         (ves_icall_System_Diagnostics_Process_ProcessHandle_duplicate):
6816         New internal calls to duplicate and close a process handle.
6817
6818 2008-07-27  Andreas Färber  <andreas.faerber@web.de>
6819
6820         * object.c (CHECK_ADD_OVERFLOW_UN): Add missing bracket. Fixes #412499.
6821
6822 2008-07-27  Zoltan Varga  <vargaz@gmail.com>
6823
6824         * appdomain.c (unload_thread_main): Attach the unload thread to the runtime.
6825
6826 2008-07-27  Robert Jordan  <robertj@gmx.net>
6827
6828         * class.c (mono_class_init): Don't compute class.has_finalize for
6829         valuetypes. Fixes #412477.
6830
6831 2008-07-25 Rodrigo Kumpera  <rkumpera@novell.com>
6832
6833         * verify.c: Implement constraint equivalence checking.
6834         This is required when a generic parameter is used as
6835         argument to a constrained one.
6836
6837         Fixes #410637.
6838
6839 2008-07-24  Zoltan Varga  <vargaz@gmail.com>
6840
6841         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
6842
6843         * domain-internals.h (struct _MonoDomain): Add 'method_code_hash' field.
6844
6845         * object-internals.h (struct _MonoDelegate): Add 'method_code' field,
6846         synch with managed object layout.
6847
6848 2008-07-24 Rodrigo Kumpera  <rkumpera@novell.com>
6849
6850         * verify.c (do_branch_op): Handle valuetypes and generic
6851         arguments properly.
6852
6853         * verify.c (do_cmp_op): Same.
6854
6855         Fixes #410383.
6856
6857 2008-07-24  Mark Probst  <mark.probst@gmail.com>
6858
6859         * generic-sharing.c: Fix memory leaks.
6860
6861         * class.c, class-internals.h: Make
6862         mono_class_inflate_generic_type_with_mempool() non-static.
6863
6864 2008-07-24 Rodrigo Kumpera  <rkumpera@novell.com>
6865
6866         * pedump.c (dump_verify_info): Dump full class name.
6867
6868 2008-07-24  Mark Probst  <mark.probst@gmail.com>
6869
6870         * generic-sharing.c: Removed some old code that didn't do anything.
6871
6872 2008-07-24  Massimiliano Mantione  <massi@ximian.com>
6873         * profiler.c: Added runtime_initialized_event,
6874         mono_profiler_install_runtime_initialized and
6875         mono_profiler_runtime_initialized. This new hook tells the profiler
6876         when the runtime is sufficiently initialized to be able to call
6877         mono_thread_attach on the root appdomain.
6878         * profiler.h, profiler-private.h: Likewise.
6879
6880 2008-07-23 Rodrigo Kumpera  <rkumpera@novell.com>
6881
6882         * verify.c (do_cast): Do boxing for generic arguments as well.
6883
6884         * class.c (is_nesting_type): Drop generic instantiations before
6885         checking for nesting.
6886
6887         * class.c (can_access_instantiation): Allow access to generic
6888         arguments.
6889
6890 2008-07-23 Rodrigo Kumpera  <rkumpera@novell.com>
6891
6892         * verify.c (verify_class_for_overlapping_reference_fields):
6893         On some cases, the field size might be zero, guard against that.
6894         Fix the explicit layout check to work as expected.
6895
6896 2008-07-23  Zoltan Varga  <vargaz@gmail.com>
6897
6898         * threads.c (ves_icall_System_Threading_Thread_Abort): Avoid calling 
6899         mono_thread_resume () during shutdown, since the thread we want to abort
6900         might be suspended.
6901
6902 2008-07-22  Zoltan Varga  <vargaz@gmail.com>
6903
6904         * mono-debug-debugger.c (mono_debugger_check_breakpoints): Fix a 
6905         warning.
6906
6907         * debug-mono-symfile.c: Fix a warning.
6908
6909         * mono-perfcounters.c (get_cpu_times): Fix a warning.
6910
6911         * object.c (mono_class_vtable): Check if exception_type is set, and return
6912         NULL as defined by the function comments.
6913
6914 2008-07-22  Mark Probst  <mark.probst@gmail.com>
6915
6916         * mempool.c: Use malloc for every single mempool allocation if the
6917         configure option is set.  This makes it easier to track mempool
6918         allocations with tools like Valgrind.
6919
6920 2008-07-22  Jb Evain  <jbevain@novell.com>
6921
6922         * reflection.c (create_dynamic_mono_image): emit the same
6923         metadata version that SL2 does when creating a SL2 image.
6924
6925 2008-07-21 Rodrigo Kumpera  <rkumpera@novell.com>
6926
6927         * icall-def.h:
6928         * icall.c: New icall System.Enum:get_hashcode. This function
6929         avoids the overhead of boxing the enum to the underlying type.
6930
6931 2008-07-21  Mark Probst  <mark.probst@gmail.com>
6932
6933         * reflection.c (mono_method_get_object): Don't let static RGCTX
6934         invoke wrappers get into MonoReflectionMethods.
6935
6936 2008-07-17 Rodrigo Kumpera  <rkumpera@novell.com>
6937
6938         * object-internals.h:
6939         * object.c: New mono_runtime_class_init_full function
6940         that makes throwing the exception optinal.
6941
6942         * class-internals.h: New exception type MONO_EXCEPTION_OBJECT_SUPPLIED
6943         for the case where the exception object is supplied.
6944
6945 2008-07-16  Kornél Pál  <kornelpal@gmail.com>
6946
6947         * coree.h: Define __ImageBase as _image_base__ on cygwin that fixes build with
6948         old ld versions.
6949
6950         Contributed under MIT/X11 license.
6951
6952 2008-07-16 Rodrigo Kumpera  <rkumpera@novell.com>
6953
6954         * string-icalls.c (ves_icall_System_String_InternalSplit):
6955         Optimize array allocation by caching the MonoClass of the
6956         array type.
6957
6958         * icall.c (ves_icall_Type_GetMethodsByName): Same.
6959
6960         * reflection.c (mono_param_get_objects): Same.
6961
6962 2008-07-16 Rodrigo Kumpera  <rkumpera@novell.com>
6963
6964         * icall-def.h:
6965         * icall.c: New ves_icall_MonoGenericClass_InflateType icall.
6966         It inflates the given type using the class context.
6967
6968 2008-07-15 Rodrigo Kumpera  <rkumpera@novell.com>
6969
6970         * object.c (mono_class_try_get_vtable): New function. Tries to fetch
6971         the vtable if it already exists.
6972
6973         * object-internals.h: Add mono_class_try_get_vtable as part of the
6974         internal API.
6975
6976         * reflection.c (mono_type_get_object): Use the MonoObject from the
6977         vtable when possible. Reduces locking contention on reflection heavy
6978         code.
6979
6980 2008-07-15  Zoltan Varga  <vargaz@gmail.com>
6981
6982         * decimal.c (my_g_bit_nth_msf): Implement this directly without calling
6983         g_bit_nth_msf () since that macro is not implemented in eglib.
6984
6985 2008-07-13  Zoltan Varga  <vargaz@gmail.com>
6986
6987         * class.c (mono_class_generic_sharing_enabled): Always disable generic sharing
6988         on platforms which do not support it.
6989
6990 2008-07-12  Zoltan Varga  <vargaz@gmail.com>
6991
6992         * marshal.c (mono_signature_to_name): Encode sig->hasthis as well.
6993
6994 2008-07-11  Martin Baulig  <martin@ximian.com>
6995
6996         * mono-debug-debugger.h
6997         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_INTERRUPTION_REQUEST'.
6998
6999         * mono-debug-debugger.c
7000         (_mono_debugger_interruption_request): New global volatile variable.
7001         (mono_debugger_check_interruption): New public function.
7002
7003         * threads.c
7004         (mono_thread_current_check_pending_interrupt): Call
7005         mono_debugger_check_interruption().
7006         (mono_thread_interruption_checkpoint_request): Likewise.
7007
7008 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
7009
7010         * verify.c: Add more type checks for loaded types. Verify the result
7011         handle from ldtoken.
7012
7013 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
7014
7015         * loader.c (field_from_memberref): Don't crash if the field
7016         wasn't found.
7017
7018 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
7019
7020         * verify.c: Verify if type and method instantiations
7021         don't have invalid VAR or MVAR arguments.
7022
7023 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
7024
7025         * verify.c: Fix double free of function pointer list.
7026
7027 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
7028
7029         * object.c (mono_string_to_utf8): Comment the new code as it
7030         breaks under eglib.
7031
7032 2008-07-08 Rodrigo Kumpera  <rkumpera@novell.com>
7033
7034         * object.c (mono_string_to_utf8): Avoid allocating a temp array.
7035
7036 2008-07-07  Bill Holmes  <billholmes54@gmail.com>
7037
7038         * threads.c : Thread.Interrupt changes to ensure that ThreadInterruptedException
7039           is not throw too many times.
7040
7041         Code is contributed under MIT/X11 license.
7042
7043 2008-07-07  Zoltan Varga  <vargaz@gmail.com>
7044
7045         * mono-debug.c (mono_debug_find_method): Allow this to be called even when
7046         debugging is turned off.
7047
7048 2008-07-06  Zoltan Varga  <vargaz@gmail.com>
7049
7050         * generic-sharing.c (mono_method_lookup_rgctx): Fix a warning.
7051
7052 2008-07-04  Mark Probst  <mark.probst@gmail.com>
7053
7054         * class-internals.h, class.c: Added new generic sharing option:
7055         Share only stuff in System.Collections.Generic, which is now the
7056         default.
7057
7058 2008-07-04  Mark Probst  <mark.probst@gmail.com>
7059
7060         * generic-sharing.c, class-internals.h: New function for getting a
7061         generic method in a generic class given the corresponding method
7062         for a different instantiation of the class.  Partly refactored
7063         from mini-trampolines.c.
7064
7065         * class.c: Make sure generic methods have a class_inst if they are
7066         part of a generic class.
7067
7068         * metadata.c (mono_type_stack_size_internal): Handle type
7069         variables.
7070
7071 2008-07-04  Mark Probst  <mark.probst@gmail.com>
7072
7073         * domain-internals.h: New field (has_this) in MonoGenericJitInfo.
7074         Signifies whether information on the this/vtable/mrgctx variable
7075         is available.
7076
7077 2008-07-04  Mark Probst  <mark.probst@gmail.com>
7078
7079         * object.c, object-internals.h, icall.c: New function
7080         mono_delegate_ctor_with_method(), which does the same as
7081         mono_delegate_ctor(), but takes an explicit method argument
7082         instead of taking the method from the jit info.
7083
7084         * marshal.c: When creating a delegate with an inflated method take
7085         the "this" argument as the target class for the castclass.
7086
7087 2008-07-03  Mark Probst  <mark.probst@gmail.com>
7088
7089         * domain.c (mono_jit_info_table_find): Fixed a bug that caused
7090         mono_jit_info_table_find() to perform very badly in some cases.
7091
7092 2008-07-02  Zoltan Varga  <vargaz@gmail.com>
7093
7094         * icall.c (type_from_typename): Handle 'string'.
7095
7096         * marshal.c (mono_marshal_get_runtime_invoke): Don't insert runtime invoke
7097         wrappers into the wrapper_hash, since the key is not a MonoMethod.
7098
7099 2008-07-01  Zoltan Varga  <vargaz@gmail.com>
7100
7101         * icall.c (mono_get_jit_icall_info): New function to return the jit icall hash table.
7102
7103         * *-gc.c (mono_gc_get_managed_allocator_types): New function to return the
7104         number of available managed allocator types.
7105
7106         * marshal.c (mono_marshal_init): Register Thread:ResetAbort as an icall ().
7107         (mono_marshal_get_runtime_invoke): Call ResetAbort as an icall.
7108
7109 2008-06-30  Zoltan Varga  <vargaz@gmail.com>
7110
7111         * domain-internals.h (struct _MonoDomain): Add 'jit_code_hash_lock' field,
7112         which is a low level lock protecting just the 'jit_code_hash' hash table.
7113
7114         * domain.c: Initialize+cleanup jit_code_hash_lock.
7115         
7116 2008-06-30  Kornél Pál  <kornelpal@gmail.com>
7117
7118         * coree.c (mono_load_coree): Set coree_module_handle global variable only
7119         after initialization.
7120
7121         * coree.h: Make MonoFixupExe internal.
7122
7123         Contributed under MIT/X11 license.
7124
7125 2008-06-30  Kornél Pál  <kornelpal@gmail.com>
7126
7127         * coree.c (_CorValidateImage): Retain IMAGE_DIRECTORY_ENTRY_SECURITY
7128         because that is platform independent. Check NumberOfRvaAndSizes in PE32
7129         as well.
7130         (MonoLoadImage): New wrapper function around LoadLibrary to ensure that the
7131         image being loaded is a CLI image and _CorValidateImage gets called.
7132
7133         * coree.h: Add MonoLoadImage.
7134
7135         * image.c (mono_image_open_full): Load CLI images using MonoLoadImage
7136         instead of LoadLibrary.
7137
7138         Contributed under MIT/X11 license.
7139
7140 2008-06-29 Rodrigo Kumpera  <rkumpera@novell.com>
7141
7142         * icall.c (ves_icall_System_ValueType_Equals): Avoid allocating objects
7143         for any primitive type.
7144
7145 2008-06-29  Zoltan Varga  <vargaz@gmail.com>
7146
7147         * object.c (mono_array_new_specific): Optimize this and the other allocation
7148         functions a bit.
7149         
7150         * object.c (mono_class_create_runtime_vtable): Use typed allocation in other
7151         domains too if mono_dont_free_domains is set.
7152
7153         * domain-internals.h (mono_dont_free_domains): New internal option controlling
7154         whenever to free appdomain data after it has been unloaded.
7155
7156         * domain.c (mono_domain_free): Don't free appdomain data if the option is set.
7157         
7158 2008-06-28  Zoltan Varga  <vargaz@gmail.com>
7159
7160         * icall.c (ves_icall_System_Enum_get_underlying_type): New icall.
7161         (mono_method_get_equivalent_method): Fix a warning.
7162
7163         * object.c (mono_message_init): Avoid looking up array types for each call.
7164
7165 2008-06-27  Zoltan Varga  <vargaz@gmail.com>
7166
7167         * object.c (mono_message_invoke): Avoid looking up the object[] type for each
7168         call.
7169
7170         * icall.c (ves_icall_System_ValueType_Equals): Optimize the comparison of enums
7171         even more.
7172
7173         * class.c (mono_class_get_fields): Avoid calling setup_fields_locking () for
7174         each iteration.
7175
7176         * icall.c (ves_icall_System_ValueType_Equals): Avoid traversing all the static
7177         fields of an enum.
7178
7179 2008-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
7180
7181         * object.c (mono_value_box): Fix boxing of nullables.
7182
7183 2008-06-26  Kornél Pál  <kornelpal@gmail.com>
7184
7185         * assembly.c (mono_set_rootdir): Use __ImageBase instead of
7186         mono_module_handle that is defined by the linker; no initialization required.
7187         * coree.h: Remove mono_module_handle, add __ImageBase, update
7188         mono_image_open_from_module_handle.
7189         * coree.c (_CorValidateImage): Convert platform independent PE32 images to
7190         PE32+ on 64-bit Windows that makes the OS able to load CIL images as modules.
7191         (MonoFixupCorEE): Export Address Table RVAs are 32-bit unsigned integers so
7192         memory has to be allocated for trampolines (x64) or procedure labels (IA64) up
7193         to 4 GB away from image base address. IA64 version is not tested but was very
7194         easy to implement and should work if we ever need it.
7195         * domain.c (mono_init_internal): Avoid system error message boxes.
7196         * image.c (mono_image_open_from_module_handle): Replace ref_count argument
7197         with has_entry_point. Handle do_mono_image_load fauilre correctly.
7198         (mono_image_open_full, mono_image_close): Use has_entry_point instead of
7199         coff_attributes that is a more reliable way to detect if _CorDllMain was called.
7200         * metadata-internals.h: Add has_entry_point to _MonoImage on Windows.
7201
7202         Contributed under MIT/X11 license.
7203
7204 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
7205
7206         * class.c, class-internals.h: Export mono_class_get_generic_type_definition
7207         as part of the private mono API.
7208         
7209         * loader.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandleInternalType):
7210         Do proper argument checking for methods that belong to generic classes.
7211         Do proper type resolution for GMFH/2.
7212         Fixes #377324.
7213         
7214 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
7215
7216         * verify.c (do_switch): Fix a memory corruption bug with
7217         the jump index is out of bound.
7218
7219 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
7220
7221         * verify.c: Disable debug code.
7222
7223 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
7224
7225         * reflection.c (mono_image_get_methodbuilder_token): Use
7226         mono_image_get_methodspec_token_for_generic_method_definition
7227         instead of mono_image_get_memberref_token. We cache more memberef
7228         entries now.
7229
7230 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
7231
7232         * verify.c: Inflate exception clause types.
7233         Fixes #402606.
7234         
7235 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
7236
7237         * reflection.c (mono_image_get_methodbuilder_token): Don't leak
7238         name.
7239
7240         * reflection.c (mono_image_get_ctorbuilder_token): Same.
7241
7242         * reflection.c (mono_image_create_method_token): Same.
7243
7244 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
7245
7246         * reflection.c: Added mono_image_get_methodref_token_for_methodbuilder.
7247         It does the same as mono_image_get_methodref_token but works on
7248         MethodBuilder.
7249
7250         * reflection.c: Use mono_image_get_methodspec_token_for_generic_method_definition
7251         and always generate a methodspec. This follows the old behavior and fixes
7252         the regressions in System.Core. 
7253
7254 2008-06-24  Zoltan Varga  <vargaz@gmail.com>
7255
7256         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Collect exceptions for classes where 
7257         don't event mono_class_get () succeeds. Fixes #402182.
7258
7259 2008-06-20 Rodrigo Kumpera  <rkumpera@novell.com>
7260
7261         * metadata-internals.h: Added MonoDynamicImage::methodspec
7262         hashtable to store methodspec tokens created for MethodBuilders.
7263
7264         * reflection.c (mono_image_get_methodbuilder_token): Encode generic
7265         MethodBuilders as open instantiations if a methodspec was requested.
7266
7267         * reflection.c (fixup_method): Skip MethodBuilder with methodspec tokens.
7268
7269         * reflection.c (create_dynamic_mono_image): Create the methodspec hashtable.
7270
7271         * reflection.c (mono_dynamic_image_free): Release the methodspec hashtable.
7272
7273         Fixes bug #349190.
7274
7275 2008-06-20 Rodrigo Kumpera  <rkumpera@novell.com>
7276
7277         * loader.c (method_from_methodspec): Avoid crashing if the
7278         method lookup fails.
7279
7280 2008-06-20  Dick Porter  <dick@ximian.com>
7281
7282         * socket-io.c (get_socket_assembly): Cope with Moonlight network
7283         classes being in a different assembly.  Fixes bug 399184.
7284
7285 2008-06-20  Zoltan Varga  <vargaz@gmail.com>
7286
7287         * loader.c (mono_loader_init): Make this callable multiple times.
7288         (mono_dllmap_insert): Call mono_loader_init () so this works even before
7289         the runtime is initialized. Fixes #401755.
7290
7291 2008-06-19  Dick Porter  <dick@ximian.com>
7292
7293         * socket-io.c (convert_socketflags): Ignore SocketFlags.Partial.
7294         Fixes bug 349688.
7295
7296 2008-06-19  Dick Porter  <dick@ximian.com>
7297
7298         * socket-io.c:
7299         * icall-def.h: Implement Socket generic Send() and Receive()
7300         methods.  Fixes bug 395168.
7301
7302 2008-06-19  Kornél Pál  <kornelpal@gmail.com>
7303
7304         * icall-def.h, icall.c: Add ves_icall_System_Reflection_Module_GetHINSTANCE.
7305
7306         Contributed under MIT/X11 license.
7307
7308 2008-06-18  Martin Baulig  <martin@ximian.com>
7309
7310         * mono-debug.h (MONO_DEBUGGER_VERSION): Split into
7311         `MONO_DEBUGGER_MAJOR_VERSION' and `MONO_DEBUGGER_MINOR_VERSION';
7312         set to 80.0.  The debugger <-> runtime interface is now frozen as
7313         well.   
7314
7315         * mono-debug.c
7316         (mono_debug_debugger_version): Bump to 4.
7317
7318 2008-06-18  Martin Baulig  <martin@ximian.com>
7319
7320         * debug-mono-symfile.c
7321         (load_symfile): Don't check the minor version.
7322
7323         * debug-mono-symfile.h: Bump the version number to 50.0.
7324
7325 2008-06-18  Martin Baulig  <martin@ximian.com>
7326
7327         * debug-mono-symfile.c
7328         (load_symfile): Treat `MONO_SYMBOL_FILE_MINOR_VERSION' as a
7329         minimum required version.
7330
7331 2008-06-17 Rodrigo Kumpera  <rkumpera@novell.com>
7332
7333         * reflection.c (mono_custom_attrs_from_property): Fix support for
7334         retriveving cattrs of dynamic inflated generic types.
7335
7336         * reflection.c (mono_custom_attrs_from_event): Same.
7337
7338         * reflection.c (mono_custom_attrs_from_field): Same;
7339
7340         * reflection.c (typebuilder_setup_events): Same cattrs of events.
7341
7342         * loader.c (-mono_metadata_get_corresponding_field_from_generic_type_definition):
7343         Moved to metadata.c.
7344
7345         * metadata.c: New functions to retrive the equivalent field, event
7346         of property from the generic type definition.
7347
7348         * metadata-internals.h: Added new functions from metadata.c.
7349
7350 2008-06-17 Rodrigo Kumpera  <rkumpera@novell.com>
7351
7352         * reflection.c (mono_custom_attrs_from_builders): Mark MonoCustomAttrInfo
7353         to cached in a mempool is used.
7354
7355         * metadata.c (free_generic_class): In some situations field generic_info type
7356         is not properly dup'ed and leads to double free'ing.
7357
7358         Fixes #400643.
7359
7360 2008-06-17  Mark Probst  <mark.probst@gmail.com>
7361
7362         * marshal.c (mono_marshal_get_static_rgctx_invoke): Also handle
7363         this arguments (will be needed later for generic methods).
7364         Collect stats.
7365
7366 2008-06-17  Mark Probst  <mark.probst@gmail.com>
7367
7368         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal):
7369         Create a static RGCTX invoke wrapper for methods which require it.
7370
7371 2008-06-17  Mark Probst  <mark.probst@gmail.com>
7372
7373         * object.c, class-internals.h: New function for checking whether
7374         an individual field is special static.
7375
7376 2008-06-15  Zoltan Varga  <vargaz@gmail.com>
7377
7378         * metadata.c (mono_metadata_get_generic_param_row): Use bsearch instead of
7379         linear search since the table is sorted.
7380
7381         * gc.c (mono_gc_cleanup): Abort the finalizer thread more gracefully.
7382         Fixes #324180.
7383
7384 2008-06-14  Zoltan Varga  <vargaz@gmail.com>
7385
7386         * appdomain.c (unload_thread_main): Applied patch from Tim Howard 
7387         (timh@ict.om.org). Remove the timeouts when waiting for appdomains to unload.
7388
7389         * gc.c (mono_domain_finalize): Allow an infinite timeout.
7390
7391         * threads.c (mono_threads_abort_appdomain_threads): Ditto.
7392         
7393         * threads.c (mono_thread_request_interruption): Get rid of locking, use
7394         InterlockedCompareExchange to query and modify 
7395         thread->interruption_requested.
7396
7397         * object-internals.h (struct _MonoThread): Change interruption_requested
7398         to a gint32 so it can be modified by atomic operations. Add 
7399         'critical_region_level' from the managed side, change small_id to a guint32,
7400         add new set of 'unused' fields.
7401
7402         * appdomain.c: Bump corlib version.
7403
7404 2008-06-13  Zoltan Varga  <vargaz@gmail.com>
7405
7406         * class.c (mono_class_from_name): Search modules as well. Fixes
7407         #322332.
7408
7409 2008-06-13  Mark Probst  <mark.probst@gmail.com>
7410
7411         * generic-sharing.c: Code for maintaining the MRGCTX and MRGCTX
7412         templates.  Templates are generalized with an additional type_argc
7413         argument.  RGCTX templates have type_argc==0, MRGCTX templates
7414         have type_argc>0.
7415
7416         * domain-internals.h, domain.c: New hash table for looking up
7417         MRGCTXs.
7418
7419         * metadata.c, metadata-internals.h: Rename hash and equal
7420         functions for MonoGenericInst's and make them public.
7421
7422         * class-internals.h: New data structures for the MRGCTX.  Macros
7423         for distinguishing slots in the RGCTX and the MRGCTX.
7424
7425 2008-06-13  Mark Probst  <mark.probst@gmail.com>
7426
7427         * object.c (mono_method_get_imt_slot): Put the same methods of
7428         different instantiations of the same generic interface in the same
7429         IMT slots, to make generic sharing simpler.
7430
7431 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
7432
7433         * metadata-internals.h: Added mono_metadata_field_info_with_mempool.
7434
7435         * metadata.c (mono_metadata_field_info_with_mempool): Added.
7436         This function works just like mono_metadata_field_info, but
7437         accept a mempool as argument to be used allocating memory.
7438
7439         * marshal.c (mono_marshal_load_type_info): Use new function
7440         to load marshal data into image mempool.
7441
7442 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
7443
7444         * class.c (mono_class_inflate_generic_type_with_mempool):
7445         This function allows to inflate a generic type using
7446         a mempool.
7447
7448         * class.c (inflate_generic_type): Take a mempool as argument
7449         and use it to do type dup'ing.
7450
7451         * class.c (mono_class_setup_fields): Field type for generic
7452         generic classes are allocated from the image mempool.
7453
7454         * metadata.c (free_generic_class): Inflated field type is
7455         now allocated in the image mempool.
7456
7457 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
7458
7459         * threads.c (thread_cleanup): Free MonoThread::name.
7460
7461 2008-06-12  Marek Habersack  <mhabersack@novell.com>
7462
7463         * appdomain.c (ensure_directory_exists): avoid unnecessary
7464         mkdir(2) calls when the shadow directory already exists.
7465         (mono_make_shadow_copy): copy also satellite assemblies from the
7466         private bin directories.
7467
7468 2008-06-11  Zoltan Varga  <vargaz@gmail.com>
7469
7470         * threads.c (mono_thread_get_stack_bounds): Align the stack in all cases.
7471         
7472         * threads.c (mono_thread_get_stack_bounds): Align the stack address to
7473         a page boundary. Fixes #396219.
7474
7475 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
7476
7477         * marshal.c (mono_marshal_load_type_info): Add a memory barrier
7478         due to double-checked locking.
7479
7480 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
7481
7482         * assembly.c (build_assembly_name): Release memory on failure.
7483
7484         * assembly.c (mono_assembly_name_parse_full): Release memory on failure.
7485
7486 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
7487
7488         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Release
7489         memory on failure.
7490
7491 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
7492
7493         * icall.c (ves_icall_System_Reflection_AssemblyName_ParseName): Release
7494         memory on failure.
7495
7496 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
7497
7498         * loader.c (field_from_memberref): Check if field signature type is equal
7499         to the non-inflated type of the field. Fixes #398980.
7500
7501 2008-06-11  Zoltan Varga  <vargaz@gmail.com>
7502
7503         * assembly.c (mono_assembly_load_from_full): Call 
7504         mono_assembly_load_friends () outside the assemblies lock, since it can
7505         acquire the loader lock. Fixes #323696.
7506
7507         * reflection.c (resolve_object): Inflate the inst with the context for
7508         FieldOnTypeBuilderInst. Fixes #399010.
7509
7510 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
7511
7512         * reflection.c (mono_image_get_field_on_inst_token): Don't
7513         inflate the field to encode it's signature. If it's a
7514         VAR or MVAR it should stay that way in the signature.
7515         Fixes #399047.
7516
7517 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
7518
7519         * reflection.c (resolve_object): Release memory of inflated types.
7520
7521 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
7522
7523         * loader.c (mono_method_get_signature_full): Remove assert about
7524         loading a methodspec to a generic method. We have such methods, such as
7525         System.Threading.Interlocked::CompareExchange<T>.
7526         This assert was removed since it crashes the verifier when it checks
7527         methods calling CompareExchange<T>.
7528
7529 2008-06-10  Marek Safar  <marek.safar@gmail.com>
7530
7531         * icall.c (ves_icall_MonoMethod_GetGenericArguments): Creates an instance
7532         of Type array and not MonoType.
7533
7534 2008-06-10  Marek Habersack  <mhabersack@novell.com>
7535
7536         * profiler.c: fix a segfault on shutdown. Patch from Paolo Molaro
7537         <lupus@ximian.com>
7538
7539 2008-06-10  Martin Baulig  <martin@ximian.com>
7540
7541         * debug-mono-symfile.h
7542         (MONO_SYMBOL_FILE_MINOR_VERSION): Bump to 6.  There were no
7543         changes to the file format, but we were generating incorrect
7544         source file indices in the line number table due to a bug, which
7545         made backtraces report an incorrect source file.
7546
7547 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
7548
7549         * mono-debug.c: Moved mono_debug_free_method_jit_info from
7550         mini/debug-mini.c to here.
7551
7552         * mono-debug.c (il_offset_from_address): Free memory from find_method.
7553
7554         * mono-debug.h: Export mono_debug_free_method_jit_info, users should
7555         use it to release structs returned by mono_debug_find_method.
7556
7557 2008-06-10  Zoltan Varga  <vargaz@gmail.com>
7558
7559         * class.c (mono_class_setup_vtable): Call setup_methods even for interfaces
7560         since it needs to set method->slot for all interface methods.
7561
7562 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
7563
7564         * class-internals.h: Forgot to add.
7565
7566 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
7567
7568         * class-internals.h: Added MONO_PROP_DYNAMIC_CATTR.
7569
7570         * reflection.c (lookup_custom_attr): Added a MonoImage argument.
7571         Lookup the custom attributes from property_hash.
7572
7573         * reflection.c (mono_save_custom_attrs): Save the custom attributes
7574         in property_hash. Allocate all data using the image mempool.
7575
7576         * reflection.c: Removed dynamic_custom_attrs. Changed all checks
7577         for dynamic_custom_attrs to checks if the image is dynamic.
7578
7579 2008-06-09  Zoltan Varga  <vargaz@gmail.com>
7580
7581         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Free the
7582         assemblies array.
7583         
7584         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Avoid calling
7585         runtime functions while holding the domain assemblies lock.
7586
7587 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
7588
7589         * verify.c: Reapplied the last bit of the reverted changes.
7590
7591 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
7592
7593         * verify.c: Reapplied more of the reverted changes.
7594
7595 2008-06-09  Martin Baulig  <martin@ximian.com>
7596
7597         * debug-mono-symfile.c (load_symfile): Check the major version
7598         first; if it's wrong, don't print the minor version in the error message.
7599
7600 2008-06-09  Zoltan Varga  <vargaz@gmail.com>
7601
7602         * appdomain.c (set_domain_search_path): Make this use the domain assemblies
7603         lock instead of the domain lock to avoid deadlocks, since the thread might
7604         already hold the loader lock.
7605
7606         * threads.c (start_wrapper): Call mono_monitor_init_tls ().
7607         (mono_thread_attach): Ditto.
7608
7609         * monitor.c: Use a TLS variable for holding the current thread id instead
7610         of calling pthread_self ().
7611         (mono_monitor_init_tls): New internal function to initialize the TLS
7612         variable.
7613         (mono_monitor_try_enter_internal): Put the owner == id check after the
7614         owner == 0 check.
7615
7616         * object-internals.h (_G_BOOLEAN_EXPR): Redefine this glib macro to avoid
7617         missed optimizations when using gcc-4.3.
7618
7619 2008-06-08 Rodrigo Kumpera  <rkumpera@novell.com>
7620
7621         * reflection.c (mono_dynamic_image_free): Free the memory
7622         used by MonoGenericParam in MonoDynamicImage::gen_param.
7623
7624         * reflection.c (mono_reflection_setup_generic_class): Allocate
7625         container from mempool.
7626
7627         * reflection.c (mono_reflection_initialize_generic_parameter): Allocate
7628         container from mempool.
7629
7630 2008-06-07  Zoltan Varga  <vargaz@gmail.com>
7631
7632         * threads.c (mono_set_pending_exception): New internal function to set the
7633         pending exception of the current thread.
7634         (mono_thread_get_and_clear_pending_exception): Check for 
7635         thread->pending_exception as well.
7636
7637         * object-internals.h (struct _MonoThread): Add 'pending_exception' field.
7638
7639         * boehm-gc.c (mono_gc_base_init): Set GC_no_dls before calling GC_init () since
7640         it can trigger a collection.
7641
7642 2008-06-06  Martin Baulig  <martin@ximian.com>
7643
7644         Merged the `debugger-kahalo' branch.
7645
7646         * mono-debug.h
7647         (MONO_DEBUGGER_VERSION): Bumped to 72.
7648
7649         * debug-mono-symfile.h
7650         (MonoSymbolFileMethodIndexEntry): Removed.
7651         (MonoSymbolFileMethodEntry): New public typedef.
7652         (MonoSymbolFileOffsetTable): Added `_is_aspx_source'.
7653         (MonoSymbolFileSourceEntry): Remove everything except `index' and
7654         `data_offset'.
7655         (MonoSymbolFileMethodEntry): Removed.
7656         (MonoSymbolFileLexicalBlockEntry): Removed.
7657         (MonoSymbolFileLineNumberEntry): Removed.
7658         (MonoDebugLexicalBlockEntry): Removed.
7659         (MonoDebugMethodInfo): Replaced `entry' by `guint32 entry_offset';
7660         removed `num_il_offsets' and `il_offsets'.
7661         (MonoSymbolFile): Replace `version' with `major_version' and
7662         `minor_version'.
7663         (MONO_SYMBOL_FILE_VERSION): Replace with
7664         `MONO_SYMBOL_FILE_MAJOR_VERSION' and
7665         `MONO_SYMBOL_FILE_MINOR_VERSION'.
7666
7667         * debug-mono-symfile.c
7668         (mono_debug_symfile_lookup_location): Add support for the new line
7669         number table format.
7670
7671 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
7672
7673         * metadata.c (free_generic_class): Release the inflated
7674         MonoClass of dynamic generic classes if it's not a generic
7675         type definition.
7676
7677 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
7678
7679         * verify.c: Reapplied more of the reverted changes.
7680
7681 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
7682
7683         * reflection.c (lookup_custom_attr): Clean the cached flag or
7684         nobody will free it. Fixes a memleak in MonoCustomAttrs::IsDefinedInternal
7685         for SRE types.
7686
7687 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
7688
7689         * verify.c: Reapplied a small part of the reverted changes.
7690
7691 2008-06-07  Zoltan Varga  <vargaz@gmail.com>
7692
7693         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
7694
7695         * monitor.c (mono_monitor_try_enter_internal): Add NULL check which was 
7696         previously in managed code.
7697         (mono_monitor_exit): Ditto.
7698         (ves_icall_System_Threading_Monitor_Monitor_exit): Removed, not needed anymore.
7699
7700         * icall-def.h: Rename the Enter/Exit icalls to simply Enter/Exit to match
7701         the managed definition.
7702
7703 2008-06-06 Rodrigo Kumpera  <rkumpera@novell.com>
7704
7705         * verify.c: Revert changes to see if it helps with weird buildbot crashes.
7706
7707 2008-06-06  Zoltan Varga  <vargaz@gmail.com>
7708
7709         * monitor.c: Redefine GetCurrentThreadId () with a macro on !win32.
7710         
7711         * monitor.c: Add some micro optimizations.
7712
7713         * icall.c (type_from_typename): Handle 'bool'.
7714
7715 2008-06-06 Rodrigo Kumpera  <rkumpera@novell.com>
7716
7717         * verify.c: Implement constructor verification per P III 1.8.1.4.
7718         Fixes #396716.
7719
7720 2008-06-06  Zoltan Varga  <vargaz@gmail.com>
7721
7722         * assembly.c (mono_assembly_loaded_full): Avoid calling the search hooks while
7723         holding the assemblies lock here too.
7724
7725 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
7726
7727         * verify.c: Kill stack_top function.
7728
7729 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
7730
7731         * verify.c: Kill stack_get function.
7732
7733 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
7734
7735         * verify.c (mono_method_verify): Last change broke the build. Fixed.
7736
7737 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
7738
7739         * verify.c (verify_type_compatibility_full): Make SZARRAY checks
7740         more reliable.
7741
7742         * verify.c (mono_method_verify): Inflate params and locals to avoid
7743         mismatch when checking for compatibility.
7744
7745 2008-06-05  Jonathan Chambers  <joncham@gmail.com>
7746
7747         * metadata.c (mono_string_from_bstr): Fix BSTR marshalling.
7748         Length prefix should be size in bytes. Fix bug #339530.
7749         
7750         * metadata.c (mono_string_to_bstr): Fix BSTR marshalling.
7751         Length prefix should be size in bytes. Fix bug #339530.
7752
7753         Code is contributed under MIT/X11 license.
7754
7755 2008-06-05  Bill Holmes <billholmes54@gmail.com>
7756
7757         * decimal.c:  Adding MSVC implementation to my_g_bit_nth_msf.
7758
7759         Contributed under MIT/X11 license.
7760
7761 2008-06-05  Martin Baulig  <martin@ximian.com>
7762
7763         * mono-debug-debugger.c
7764         (mono_debugger_check_breakpoints): Reflect latest runtime changes.
7765
7766 2008-06-05  Zoltan Varga  <vargaz@gmail.com>
7767
7768         * assembly.c (mono_assembly_load_from_full): Avoid calling the search hooks
7769         while holding the assemblies lock to prevent deadlocks. Handle the case
7770         where the search hook returns NULL but the assembly was still loaded.
7771         Fixes #323696.
7772
7773         * appdomain.c (set_domain_search_path): Acquire the domain lock since we
7774         modify domain state.
7775
7776 2008-06-05  Andreas Färber  <andreas.faerber@web.de>
7777
7778         * boehm-gc.c: Add DTrace probes gc-{begin,end}.
7779         * Makefile.am (pedump_LDADD): Post-process object files and
7780         add dtrace-generated object file, if necessary.
7781
7782         Code is contributed under MIT/X11 license.
7783
7784 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
7785
7786         * reflection.c (mono_dynamic_image_free): Free MonoDynamicImage::public_key.
7787
7788 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
7789
7790         * class.c (mono_type_get_full): Add a work-around for generic type definitions.
7791
7792 2008-06-04  Mark Probst  <mark.probst@gmail.com>
7793
7794         * threads.c: Try to free everything from the delayed free table
7795         when shutting down threads, and set the variable to NULL after the
7796         table is freed so that calling
7797         mono_thread_hazardous_try_free_all() when shutting down the root
7798         domain doesn't crash.
7799
7800 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
7801
7802         * class.c (mono_type_retrieve_from_typespec): Add an argument to inform
7803         the caller if resulting type was inflated.
7804
7805         * class.c (mono_class_create_from_typespec): Free the MonoType if it
7806         was inflated.
7807
7808         * class.c (mono_type_get_full): Free the MonoType if it was inflated.
7809
7810
7811 2008-06-04  Zoltan Varga  <vargaz@gmail.com>
7812
7813         * decimal.c (rescale128): Rework the code a bit so it no longer crashes the
7814         class library tests.
7815
7816         * icall.c (ves_icall_InternalInvoke): Applied patch from Andy Hume 
7817         (andyhume32@yahoo.co.uk). Add more useful exception messages. Fixes
7818         #396989.
7819
7820 2008-06-04  Mark Probst  <mark.probst@gmail.com>
7821
7822         * domain.c, domain-internals.h: The JIT infos are now freed by the
7823         JIT info table code.  They are freed immediately if there only a
7824         single JIT info table in circulation.  If there is more, the free
7825         is delayed via a queue.
7826
7827         * threads.c, threads-types.h: New hazard pointer function for
7828         freeing all freeable delayed items in one sitting.
7829
7830 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
7831
7832         * reflection.c (typebuilder_setup_fields): Use mempool for allocations.
7833
7834         * reflection.c (typebuilder_setup_properties): Same.
7835
7836         * reflection.c (typebuilder_setup_events): Same.
7837
7838 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
7839
7840         * reflection.c (mono_custom_attrs_from_builders): Receive a MonoMemPool
7841         and use it for allocating memory.
7842
7843         * reflection.c (mono_marshal_spec_from_builder): Same.
7844
7845         * reflection.c: Change code to use new signatures.
7846
7847         * metadata.c (mono_metadata_type_dup): Add a FIXME note.
7848
7849 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
7850
7851         * decimal.c (rescale128): Put back one line which was accidently commented
7852         out.
7853         
7854         * decimal.c (rescale128): Disable the code added by the last patch, as it seems
7855         to cause crashes.
7856
7857 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
7858
7859         * reflection.c (mono_reflection_generic_class_initialize): Name must
7860         be always malloc'ed so we can free it later on. Do this for field, property
7861         and event.
7862
7863         * metadata.c (free_generic_class): Free field, property and event names.
7864
7865 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
7866
7867         * reflection.c (fieldbuilder_to_mono_class_field): Use mono_metadata_type_dup
7868         instead of g_memdup.
7869
7870         * reflection.c (typebuilder_setup_fields): Same.
7871
7872 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
7873
7874         * decimal.c (rescale128): Optimize this function a bit more.
7875
7876 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
7877
7878         * metadata.c (free_generic_class): Release some memory from
7879         SRE generic classes.
7880
7881 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
7882
7883         * reflection.c (mono_image_get_generic_field_token): No reference
7884         to name is kept, free it.
7885
7886         * reflection.c (mono_reflection_generic_class_initialize): Free
7887         more memory of the inflated field.
7888
7889 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
7890
7891         * decimal.c (mono_decimalDiv): Moved equality checks here from managed
7892         code.
7893
7894 2008-06-02 Rodrigo Kumpera  <rkumpera@novell.com>
7895
7896         * reflection.c (mono_dynamic_image_free): Release memory used by
7897         MonoDynamicImage::array_methods elements.
7898
7899         * reflection.c (assembly_add_win32_resources): Release memory after
7900         encoding.
7901
7902 2008-06-02  Zoltan Varga  <vargaz@gmail.com>
7903
7904         * decimal.c (log2_32): Use an optimized version for this function too.
7905         
7906         * decimal.c (log2_64): Fix this on 32 bit machines.
7907
7908 2008-06-02 Rodrigo Kumpera  <rkumpera@novell.com>
7909
7910         * class.c (mono_dup_array_type): Implement allocation using a mempool.
7911
7912         * class.c (mono_metadata_signature_deep_dup): Same.
7913
7914         * metadata.c (mono_metadata_signature_dup_full): Added, allow dup'ng with
7915         a mempool.
7916
7917         * metadata.c (mono_metadata_signature_dup): Delegate to the _full version.
7918
7919         * metadata.c (mono_metadata_type_dup): Remove asserts and FIXME.
7920
7921         * metadata-internals.h: Added mono_metadata_signature_dup_full.
7922
7923         * class-internals.h: Update signatures to take a MonoMemPool.
7924
7925 2008-06-02  Dick Porter  <dick@ximian.com>
7926
7927         * icall.c (ves_icall_System_ComponentModel_Win32Exception_W32ErrorMessage): 
7928         * icall-def.h: Add
7929         System.ComponentModel.Win32Exception.W32ErrorMessage, using the
7930         FormatMessage API to get the error text.  Fixes bug 321827.
7931
7932 2008-06-02  Zoltan Varga  <vargaz@gmail.com>
7933
7934         * decimal.c: Add some micro optimizations to make decimal operations faster.
7935
7936 2008-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
7937
7938         * reflection.c (method_encode_clauses): Take a mempool
7939         as parameter and use it to allocate the clause array.
7940
7941         * reflection.c (mono_image_get_field_on_inst_token): Free
7942         the inflated type after encoding it.
7943
7944         * reflection.c (mono_dynamic_image_free): Free each element
7945         of MonoDynamicImage::gen_params.
7946
7947         * reflection.c (reflection_methodbuilder_to_mono_method):
7948         Allocate the generic param array from the mempool.
7949         Allocate signature params from the mempool.
7950
7951         * reflection.c (mono_reflection_generic_class_initialize):
7952         Free inflated fields after been used.
7953
7954 2008-05-30 Rodrigo Kumpera  <rkumpera@novell.com>
7955
7956         * icall.c: Reapply the memory leak fixes as they no
7957         longer make mono crash.
7958
7959 2008-05-30 Rodrigo Kumpera  <rkumpera@novell.com>
7960
7961         * reflection.c (mono_type_get_object): Don't store the suplied
7962         MonoType with type_hash. A caller which pass a type that
7963         was mono_metadata_type_dup'ed cannot free it reliably, as type_hash
7964         might end with a pointer to freed memory.
7965         The solution is to use byval_arg or this_arg from the associated
7966         MonoClass of the supplied type.
7967
7968 2008-05-29  Zoltan Varga  <vargaz@gmail.com>
7969
7970         * icall.c: Revert the rest of the last change as it breaks the build too.
7971
7972 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
7973
7974         * icall.c: Revert a leak fix as it's breaking the build.
7975
7976 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
7977
7978         * appdomain.c (mono_make_shadow_copy): Fix another leak of dir_name.
7979
7980 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
7981
7982         * appdomain.c (mono_make_shadow_copy): We leaked dir_name.
7983
7984 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
7985
7986         * icall.c: Fix some memory leaks.
7987
7988 2008-05-29  Dick Porter  <dick@ximian.com>
7989
7990         * threadpool.c (mono_thread_pool_remove_socket): Always remove the
7991         async socket operations from the pending list when a socket
7992         closes.  Leaving it until the threadpool services the event
7993         exposes a race condition when a socket descriptor is reused.
7994         Fixes bug 377589.
7995
7996 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
7997
7998         * object.c: Fix negative index check for array alocation.
7999
8000 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
8001
8002         * icall.c, marshal.c: Delegate wrappers should skip visibility.
8003         This check is performed by the verifier for IL created delegates
8004         and by Delegate::CreateDelegate for programatically created ones.
8005         Fixes #372406.
8006
8007 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
8008
8009         * sockey-io.c (ves_icall_System_Net_Sockets_Socket_Select_internal):
8010         Fix code to use mono_array_size_t instead of int.
8011
8012         Based on patch by Luis F. Ortiz.
8013         Contributed under X11 license.
8014         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
8015
8016 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
8017
8018         * icall.c: Added ves_icall_System_Array_GetLongLength and
8019         ves_icall_System_Array_CreateInstanceImpl64. Both allow handling big
8020         arrays.
8021
8022         * icall.h: Export both new functions.
8023
8024         Based on patch by Luis F. Ortiz.
8025         Contributed under X11 license.
8026         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
8027
8028 2008-05-28  Martin Baulig  <martin@ximian.com>
8029
8030         The debugger now requires exactly r103463.
8031
8032         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 71.
8033         This version is not supported by the debugger, wait for 72.
8034
8035 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
8036
8037         * object.h: Changed array related functions to use
8038         mono_array_size_t instead of guint32. Forgot to commit this file.
8039
8040         Patch by Luis F. Ortiz.
8041         Contributed under X11 license.
8042         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
8043
8044
8045 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
8046
8047         * object.h: Don't use G_MAXINT32 or G_MAXUINT32 as old glibs
8048         don't define it. Use the number literal instead.
8049
8050 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
8051
8052         * icall.c: Changed array related functions to use
8053         mono_array_size_t instead of guint32.
8054
8055         * icall.c (ves_icall_System_Array_GetLength): Check for length
8056         overflow under MONO_BIG_ARRAYS.
8057
8058         Based on patch by Luis F. Ortiz.
8059         Contributed under X11 license.
8060         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
8061
8062 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
8063
8064         * object.c: Add 64bits bounds check for arrays under MONO_BIG_ARRAYS.
8065
8066         Based on patch by Luis F. Ortiz.
8067         Contributed under X11 license.
8068         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
8069
8070 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
8071
8072         * object.c, object.h: Changed array related functions to use
8073         mono_array_size_t instead of guint32.
8074
8075         Patch by Luis F. Ortiz.
8076         Contributed under X11 license.
8077         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
8078
8079 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
8080
8081         * object.h: Introduced mono_array_size_t typedef. This must be used
8082         in all places an array length is expected. This is 64bits wide if
8083         MONO_BIG_ARRAYS is enabled.
8084
8085         Patch by Luis F. Ortiz.
8086         Contributed under X11 license.
8087         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
8088
8089 2008-05-27  Zoltan Varga  <vargaz@gmail.com>
8090
8091         * security-manager.c class.c: Set the class exception info by calling
8092         mono_class_set_failure ().
8093
8094         * class.c (mono_class_get_exception_data): New accessor function.
8095         (mono_class_set_failure): Store exception_data in the property hash.
8096
8097         * class-internals.h (struct _MonoClass): Store 'exception_data' outside
8098         the struct as a property.
8099
8100         * loader.c (mono_get_method_full): Store the lookup result for method
8101         tokens in method_cache, the others in methodref_cache to decrease the memory
8102         usage of hash tables.
8103
8104         * image.c (mono_image_close): Destroy method_cache and methodref_cache.
8105         (mono_image_init): method_cache is lazy inited now.
8106
8107         * metadata-internals.h (struct _MonoImage): Change method_cache to
8108         a MonoValueHashTable, add a separate methodref_cache.
8109
8110 2008-05-27  Eyal Alaluf <eyala@mainsoft.com>
8111
8112         * number-formatter.h: Fix tables to avoid arithemtic overflow in
8113           Double.ToString as exposed by Bug #383531.
8114
8115 2008-05-26  Zoltan Varga  <vargaz@gmail.com>
8116
8117         * number-formatter.h: Make some tables static.
8118
8119         * class.c (mono_method_set_generic_container): New accessor function.
8120         (mono_method_get_generic_container): Ditto.
8121
8122         * class-internals.h (struct _MonoMethod): Remove rarely used 
8123         'generic_container' field, store it in the property hash instead. Add 
8124         'is_generic' boolean field instead.
8125
8126         * image.c (mono_image_init): Initialize property_hash.
8127         (mono_image_close): Destroy property_hash.
8128
8129         * metadata-internals.h (struct _MonoImage): Add 'property_hash' hash table to
8130         hold rarely used fields of runtime structures belonging to this image.
8131
8132         * class.c loader.c verify.c icall.c reflection.c: Use the new accessor functions
8133         to get/set method->generic_container.
8134
8135         * loader.c (mono_get_method_from_token): Avoid loading the method header for
8136         generic methods.
8137
8138 2008-05-25  Zoltan Varga  <vargaz@gmail.com>
8139
8140         * class.c (mono_class_inflate_generic_method_full): Don't increase
8141         mono_stats.inflated_method_count for methods found in the cache.
8142
8143         * threads.c (mono_thread_request_interruption): Add a comment about 
8144         QueueUserAPC ().
8145
8146 2008-05-24  Zoltan Varga  <vargaz@gmail.com>
8147
8148         * class.c (setup_interface_offsets): Use sizeof (guint16) when allocating the
8149         interface_offsets_packed table.
8150         
8151         * class.c (mono_class_init): Remove some dead code.
8152
8153         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Call
8154         mono_class_setup_vtable () when CAS is active to detect security problems.
8155
8156 2008-05-23 Rodrigo Kumpera  <rkumpera@novell.com>
8157
8158         * verify.c (mono_delegate_type_equal): Handle VAR, MVAR and GENERICINST.
8159
8160         * verify.c (mono_delegate_signature_equal): Don't compar number of generic
8161         parameters as it's irrelevant for delegate checking.
8162
8163 2008-05-23  Zoltan Varga  <vargaz@gmail.com>
8164
8165         * class-internals.h class.c: Correct the name of the 'mono_no_setup_vtable_in_class_init' variable.
8166
8167         * class.c (mono_class_init): Control the creation of a generic vtable using
8168         a global which is true by default, but set to false by the runtime startup code.
8169         
8170         * class.c (mono_class_init): Avoid constructing a generic vtable in most cases.
8171         Disabled for now since it breaks the embedding API.
8172         Move the setup of class->methods for arrays to mono_class_setup_methods ().
8173         (mono_class_setup_methods): Add a memory barrier.
8174
8175         * object.c (mono_class_create_runtime_vtable): Add code to handle the case
8176         when mono_class_init () doesn't compute the generic vtable.
8177         
8178 2008-05-23  Massimiliano Mantione  <massi@ximian.com>
8179         * profiler.c: Added mono_profiler_install_statistical_call_chain,
8180         mono_profiler_stat_get_call_chain_depth and mono_profiler_stat_call_chain
8181         to support call chains (backtrace) in the stat profiler.
8182         * profiler.c, profiler-private.h: Likewise.
8183
8184 2008-05-22  Mark Probst  <mark.probst@gmail.com>
8185
8186         * generic-sharing.c: Init generic class when a method of it is
8187         requested via a runtime generic context.
8188
8189 2008-05-22  Zoltan Varga  <vargaz@gmail.com>
8190
8191         * class.c (mono_class_init): Add a comment about trying to avoid calling this.
8192
8193         * reflection.c (mono_type_get_object): Add a FIXME.
8194
8195         * loader.c (find_method_in_class): Use mono_class_get_method_by_index ().
8196
8197         * class.c (mono_class_get_method_by_index): New helper function, returning an
8198         entry in the class->methods array.
8199
8200 2008-05-21  Zoltan Varga  <vargaz@gmail.com>
8201
8202         * class.c (mono_class_init): Only do the array optimization for szarrays. 
8203         Avoid creating a generic vtable for generic instances as well.
8204         (mono_class_get_method_from_name_flags): Don't search in the metadata for
8205         generic instances.
8206
8207 2008-05-21 Rodrigo Kumpera  <rkumpera@novell.com>
8208
8209         * loader.c (mono_get_method_constrained): Inflate the signature
8210         with class context. Fix #325283.
8211
8212 2008-05-21  Zoltan Varga  <vargaz@gmail.com>
8213
8214         * object.c (mono_class_create_runtime_vtable): Add a comment.
8215
8216         * class.c (get_implicit_generic_array_interfaces): Call mono_class_init ()
8217         where needed.
8218         (setup_interface_offsets): Handle the case when this is called twice for arrays.
8219         (mono_class_setup_vtable_general): Add an assert.
8220         (mono_class_init): Avoid creating a generic vtable for arrays.
8221
8222         * class.c (mono_generic_class_get_class): Don't call setup_interface_offsets ()
8223         here, let mono_class_init () do that.
8224
8225         * class.c (mono_class_init): Avoid calling mono_class_setup_methods () for
8226         interfaces in mscorlib.
8227
8228         * class.c (mono_class_setup_vtable): Avoid calling setup_methods () for
8229         interfaces. Add some comments.
8230         (mono_class_init): Call mono_class_setup_methods () here since it is no
8231         longer called by mono_class_setup_vtable ().
8232
8233         * object.c (mono_class_proxy_vtable): Null out entries in pvt->vtable which are
8234         not set in class->vtable.
8235         (mono_class_create_runtime_vtable): Reenable the disabled code.
8236
8237         * object.c (mono_class_create_runtime_vtable): Disable the last change for
8238         now as it causes some test failures.
8239
8240         * object.c (mono_class_create_runtime_vtable): Avoid creating a generic vtable
8241         if using the vtable trampoline. Also remove some strange code which put the
8242         generic methods themselves into the vtable slots. Remove the AOT init_vtable
8243         stuff as it is no longer needed.
8244
8245 2008-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
8246
8247         * pedump.c: Give make --verify all option check code as well.
8248         Using --verify code won't check for metadata now.
8249
8250 2008-05-19  Martin Baulig  <martin@ximian.com>
8251
8252         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 70.
8253
8254         * mono-debug.c
8255         (_mono_debug_using_mono_debugger): New global variable; it's set
8256         directly by the debugger, so mono_debug_using_mono_debugger() also
8257         works after attaching.
8258
8259 2008-05-18 Rodrigo Kumpera  <rkumpera@novell.com>
8260
8261         * object.c (mono_class_create_runtime_vtable): Use memory barriers
8262         as we do double checked locking on MonoClass::runtime_info and
8263         MonoClassRuntimeInfo::domain_vtables.
8264
8265 2008-05-18  Zoltan Varga  <vargaz@gmail.com>
8266
8267         * debug-helpers.c (print_field_value): Fix a warning.
8268
8269 2008-05-16  Zoltan Varga  <vargaz@gmail.com>
8270
8271         * object.c (mono_object_get_virtual_method): Fix a crash if method->slot is not
8272         set in the AOT case.
8273
8274 2008-05-16 Rodrigo Kumpera  <rkumpera@novell.com>
8275
8276         * class.c (mono_class_setup_vtable_general): Use memory barriers
8277         as we do double checked locking on MonoClass::vtable.
8278
8279 2008-05-16 Rodrigo Kumpera  <rkumpera@novell.com>
8280
8281         * reflection.c (resolve_object): Inflate only if the generic context
8282         is not null. Fixes #389886.
8283
8284 2008-05-15  Jonathan Chambers  <joncham@gmail.com>
8285
8286         * metadata.c (emit_marshal_string): Free return strings using mono_marshal_free
8287         instead of g_free.
8288
8289         Code is contributed under MIT/X11 license.
8290
8291 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
8292
8293         * class.c: Revert unrelated change.
8294
8295 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
8296
8297         * verify.c (check_is_valid_type_for_field_ops): Type on stack can be
8298         a generic instantiation, use mono_class_from_mono_type instead of playing
8299         with MonoType directly.
8300
8301 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
8302
8303         * class.c: Added mono_class_has_parent_and_ignore_generics. Visibility
8304         checks must ignore generic instantiations, so mono_class_has_parent is not
8305         suitable. Fixes #390128.
8306
8307 2008-05-14  Zoltan Varga  <vargaz@gmail.com>
8308
8309         * reflection.c (mono_image_create_token): Add a 'register_token' argument, and use
8310         it to avoid registering tokens during metadata generation. Fixes #390023.
8311
8312 2008-05-14  Kornél Pál  <kornelpal@gmail.com>
8313
8314         * coree.c: Rename dwOldProtect to OldProtect that makes naming convention
8315         consistent.
8316
8317         Contributed under MIT/X11 license.
8318
8319 2008-05-14  Kornél Pál  <kornelpal@gmail.com>
8320
8321         * domain.c (mono_init_internal): Enable LoadLibrary support. Load EXE image
8322         even when get_runtimes_from_exe didn't load it that allows mono_fixup_exe_image
8323         to fixup the EXE image.
8324         (mono_cleanup): Use mono_close_exe_image.
8325         (mono_close_exe_image): New function.
8326         * image.c: Include "marshal.h".
8327         (mono_image_open_from_module_handle): Add ref_count argument. Return the image.
8328         (mono_image_open_full, mono_image_close): Fix LoadLibrary/FreeLibrary reference
8329         counting when the image is loaded outside of mono_image_open_full. Set status
8330         based on GetLastError.
8331         * coree.c: Include required headers. Add init_from_coree.
8332         (_CorDllMain): Support fix in mono_image_open_full, mono_image_close. Call
8333         mono_assembly_open only when the image has vtfixups. Set init_from_coree.
8334         (_CorExeMain): Set init_from_coree.
8335         (CorExitProcess): Only call ExitProcess for now.
8336         (CorBindToRuntimeEx): New stub implementation.
8337         (CorBindToRuntime): New function.
8338         (MonoFixupCorEE): Fixup CorBindToRuntime and CorBindToRuntimeEx.
8339         (MonoFixupExe): ILONLY executables require no fixups.
8340         (mono_set_act_ctx): New function to set activation context.
8341         (mono_load_coree): Use init_from_coree. Call mono_set_act_ctx.  
8342         * coree.h: Move STATUS_SUCCESS and STATUS_INVALID_IMAGE_FORMAT to header.
8343         Declare mono_module_handle, coree_module_handle, mono_get_module_file_name,
8344         mono_load_coree, mono_fixup_exe_image and mono_image_open_from_module_handle
8345         as MONO_INTERNAL.
8346         * domain-internals.h: Add mono_close_exe_image.
8347
8348         Contributed under MIT/X11 license.
8349
8350 2008-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
8351
8352         * metadata.c (mono_metadata_compute_size): Correctly calculate field
8353         size for generic param and event tables. Fixes #388977.
8354
8355 2008-05-13  Zoltan Varga  <vargaz@gmail.com>
8356
8357         * loader.c (mono_method_signature): Use memory barriers because of the double
8358         checked locking pattern.
8359
8360         * threads.c (remove_and_abort_threads): Stop and wait for threads which are
8361         aborting or aborted as well. Fixes #376391.
8362         
8363         * threads.c (mono_thread_execute_interruption): Avoid depending on no longer
8364         existing runtime state in the Suspend handler during shutdown.
8365
8366 2008-05-12  Zoltan Varga  <vargaz@gmail.com>
8367
8368         * threads.c (mono_thread_request_interruption): Add some FIXMEs.
8369
8370         * threads.c (mono_thread_suspend_all_other_threads): Add support for threads 
8371         which are starting up or shutting down.
8372
8373         * threads.c (mono_threads_set_shutting_down): Don't return a value since
8374         this function never returns if the runtime is already shutting down.
8375
8376         * icall.c (ves_icall_System_Environment_Exit): Update after 
8377         mono_threads_set_shutting_down () signature change.
8378         
8379 2008-05-09 Rodrigo Kumpera  <rkumpera@novell.com>
8380
8381         * class.c: Added can_access_instantiation to verify if the instantiation
8382         is visible. Fix access check for nested types as they returned TRUE
8383         before doing type and generic instantiation visibility checks.
8384
8385 2008-05-08 Rodrigo Kumpera  <rkumpera@novell.com>
8386
8387         * reflection.c (mono_reflection_create_generic_class): The created type
8388         must have a different container from its TypeBuilder. Otherwise they
8389         will end sharing generic arguments, which is wrong.
8390
8391         Due to the sharing, making a generic instance of the created type using
8392         the TypeBuider generic arguments resulted in the generic type definition
8393         been returned, which is wrong as well.
8394
8395         As a bonus the code was leaking the type_params array. This memory should
8396         be allocated from the image mempool.
8397
8398         This fixes bug #354047.
8399
8400 2008-05-08 Rodrigo Kumpera  <rkumpera@novell.com>
8401
8402         * metadata-internals.h: Move MONO_SECMAN_FLAG macros from mini/declsec.h
8403         to here         as they are now used in assembly.c new code.
8404         Added a skipverification flag to MonoAssembly.
8405         New internal function mono_assembly_has_skip_verification.
8406
8407         * assembly.c: New function mono_assembly_has_skip_verification. It checks
8408         if an assembly has a version 2.0 SkipVerification security attribute. Fixes
8409         part of #387274.
8410
8411 2008-05-07  Zoltan Varga  <vargaz@gmail.com>
8412
8413         * object.c (mono_object_get_virtual_method): Inflate the resulting method if
8414         needed. Fixes #387034.
8415
8416         * class.c (mono_class_inflate_generic_type): Avoid a crash if context is NULL.
8417
8418 2008-05-06  Miguel de Icaza  <miguel@novell.com>
8419
8420         * assembly.c (mono_assembly_load_reference): Prevent crash while
8421         disassembling Silverlight 2.0 executables while we still do not
8422         have GACed libraries.
8423
8424 2008-05-07  Zoltan Varga  <vargaz@gmail.com>
8425
8426         * reflection.c: Special case generic type definitions as well. Fixes #383444.
8427
8428 2008-05-06  Zoltan Varga  <vargaz@gmail.com>
8429
8430         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Fix handling
8431         of the dynamic case. Fixes #387404.
8432
8433 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
8434
8435         *verify.c (mono_verifier_is_class_full_trust): If under
8436         verify_all and the verifier mode was not set, only
8437         gac and corlib types are fulltrust. This makes --verify-all
8438         usable to detect unverifiable code, which is the expected
8439         use case.
8440
8441 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
8442
8443         * verify.h: Ops, commited the header with debug
8444         enabled.
8445
8446 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
8447
8448         * verify.c (merge_stack): Use the new value on unverifiable
8449         stack merges.
8450
8451         * verify.c (verify_type_compatibility_full): Comparison
8452         of nullable types can't use mono_class_is_assignable_from.
8453
8454         * verify.c, verify.h: Added MONO_VERIFY_REPORT_ALL_ERRORS
8455         that makes all verification errors be reported.
8456
8457         * pedump.c: Pass MONO_VERIFY_REPORT_ALL_ERRORS to
8458         mono_method_verify.
8459
8460 2008-05-05  Robert Jordan  <robertj@gmx.net>
8461
8462         * marshal.c (mono_marshal_get_thunk_invoke_wrapper):
8463         support for value types. See #386415.
8464
8465         * object.c: comments.
8466
8467         Code is contributed under MIT/X11 license.
8468
8469 2008-05-05  Martin Baulig  <martin@ximian.com>
8470
8471         * debug-mono-symfile.h
8472         (MONO_SYMBOL_FILE_COMPATIBILITY_VERSION): Removed; dropped support
8473         for old pre-terrania symbol files.
8474
8475 2008-05-05  Andreas Färber  <andreas.faerber@web.de>
8476
8477         * mono-config.c: Add ppc64 architecture.
8478
8479         Code is contributed under MIT/X11 license.
8480
8481 2008-05-05  Andreas Färber  <andreas.faerber@web.de>
8482
8483         * object.c (mono_create_ftnptr, mono_get_addr_from_ftnptr):
8484           PPC64 uses function descriptors as well.
8485
8486         Code is contributed under MIT/X11 license.
8487
8488 2008-05-04  Zoltan Varga  <vargaz@gmail.com>
8489
8490         * object.c (compute_class_bitmap): Ignore literal static fields.
8491
8492         * sgen-gc.c (mono_gc_base_init): Print some help when the MONO_GC_DEBUG env
8493         var has an invalid format.
8494         (describe_ptr): Add some sanity checks for the vtable.
8495         (add_nursery_frag): Clear unused nursery fragments.
8496         (major_collection): Clear all remaining nursery fragments.
8497
8498 2008-05-03  Robert Jordan  <robertj@gmx.net>
8499
8500         * image.c, metadata-internals.h: add thunk_invoke_cache.
8501
8502         * marshal.c, marshal.h: implement
8503         mono_marshal_get_thunk_invoke_wrapper ().
8504
8505         * object.c, object.h: implement mono_method_get_unmanaged_thunk ().
8506
8507         Code is contributed under MIT/X11 license.
8508
8509 2008-05-02 Rodrigo Kumpera  <rkumpera@novell.com>
8510
8511         * verify.c (do_leave): Empty the stack.
8512
8513 2008-05-02 Rodrigo Kumpera  <rkumpera@novell.com>
8514
8515         * class.c (mono_class_is_assignable_from): Variance
8516         doesn't work between reference and value types. For example,
8517         given type C<T+>, C<int32> is not assignable to C<object>.
8518         Break the argument checking loop on first error. 
8519
8520 2008-05-02  Atsushi Enomoto  <atsushi@ximian.com>
8521
8522         * icall.c : base64_to_byte_array() needs some more strict
8523           check for sequence of '=' characters. Patch by Santa
8524           Marta (http://deee.g.hatena.ne.jp/santamarta).
8525
8526           Contributed under MIT/X11 license.
8527           (see http://www.lingr.com/room/mono-jp/archives/2008/04/20)
8528
8529 2008-05-02  Jonathan Chambers  <joncham@gmail.com>
8530
8531         * domain.c: Disable LoadLibrary support to fix Win32 build.
8532
8533         Code is contributed under MIT/X11 license.
8534
8535 2008-05-02  Zoltan Varga  <vargaz@gmail.com>
8536
8537         * sgen-gc.c: Add support for clearing nursery memory when a tlab is allocated,
8538         to help with cache behaviour.
8539
8540 2008-05-01  Miguel de Icaza  <miguel@novell.com>
8541
8542         * appdomain.c (mono_domain_from_appdomain): Add new accessor
8543         method. 
8544
8545 2008-05-01  Zoltan Varga  <vargaz@gmail.com>
8546
8547         * sgen-gc.c: Implement thread-local allocation and a managed allocation routine.
8548
8549 2008-05-01  Dick Porter  <dick@ximian.com>
8550
8551         * process.c (process_get_fileversion): Only pass 16 bits of
8552         language ID to VerLanguageName.  Fixes bug 381204.
8553
8554 2008-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
8555
8556         * verify.c (mono_method_verify): Fix the comparison
8557         operator for code bounds check.
8558
8559 2008-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
8560
8561         * verify.c (mono_method_verify): Check the bounds of
8562         all access of the code array.
8563
8564 2008-04-29  Kornél Pál  <kornelpal@gmail.com>
8565
8566         * appdomain.c: Use HAVE_SYS_UTIME_H that fixes MSVC build.
8567
8568 2008-04-28  Zoltan Varga  <vargaz@gmail.com>
8569
8570         * image.c (mono_image_strong_name_position): Fix return value when the rva is
8571         not valid.
8572
8573 2008-04-28  Kornél Pál  <kornelpal@gmail.com>
8574
8575         * loader.c (mono_get_method_from_token, mono_method_signature): Add
8576         support for METHOD_IMPL_ATTRIBUTE_NATIVE.
8577         * domain.c (mono_init_internal): Load and fixup mscoree.dll on startup and
8578         fixup main EXE images when using mono.exe for mixed-mode assembly support.
8579         * domain-internals.h: Add MonoLoadFunc, mono_install_runtime_load and
8580         mono_runtime_load.
8581         * appdomain.c: Add mono_install_runtime_load, mono_runtime_load to support
8582         runtime initialization from metadata.
8583         * assembly.c: Remove obsolete ceGetModuleFileNameA.
8584         (mono_set_rootdir): Use mono_get_module_file_name.
8585         (mono_assembly_load_from_full): Call mono_image_fixup_vtable for module
8586         handles.
8587         * cil-coff.h: Add MonoVTableFixup. Update mono_cli_rva_image_map signature.
8588         * metadata-internals.h: Add is_module_handle to _MonoImage on Windows.
8589         * image.c (mono_cli_rva_image_map): Use MonoImage instead of
8590         MonoCLIImageInfo. Add support for module handles.
8591         (load_cli_header): Update mono_cli_rva_image_map signature.
8592         (load_metadata_ptrs): Update mono_cli_rva_image_map signature.
8593         (mono_image_strong_name_position): Use mono_cli_rva_image_map.
8594         (mono_image_rva_map): Add support for module handles.
8595         (mono_image_ensure_section_idx): Add support for module handles.
8596         (mono_image_close): Add support for module handles.
8597         (do_load_header): Add support for module handles.
8598         (mono_image_open_from_module_handle): New function for internal use.
8599         (mono_image_open_full): Load normal images using LoadLibrary on Windows.
8600         (mono_image_load_module): Call mono_image_fixup_vtable for module handles.
8601         (mono_image_load_file_for_image): Call mono_image_fixup_vtable for module
8602         handles.
8603         (mono_image_fixup_vtable): New function for mixed-mode assembly support.
8604         * image.h: Add mono_image_fixup_vtable.
8605         * coree.c: New file for mscoree.dll functions and mixed-mode assembly
8606         support.
8607         * coree.h: New file.
8608         * marshal.c (mono_marshal_get_native_wrapper): Throw exception for
8609         unsupported native code.
8610         (mono_marshal_set_callconv_from_modopt): New function splitted from
8611         mono_marshal_get_managed_wrapper.
8612         (mono_marshal_get_managed_wrapper): Use
8613         mono_marshal_set_callconv_from_modopt.
8614         (mono_marshal_get_vtfixup_ftnptr): New function for mixed-mode assembly support.
8615         * marshal.h: Add mono_marshal_get_vtfixup_ftnptr.
8616         * gc.c (mono_gc_init): Don't wait for the finalizer thread on Windows because
8617         that results in a deadlock when the runtime is loaded in _CorDllMain.
8618         * Makefile.am: Add coree.c and coree.h.
8619
8620         Contributed under MIT/X11 license.
8621
8622 2008-04-28  Mark Probst  <mark.probst@gmail.com>
8623
8624         * generic-sharing.c: Search for type arguments in array element
8625         types as well.
8626
8627 2008-04-28  Mark Probst  <mark.probst@gmail.com>
8628
8629         * class-internals.h, generic-sharing.c: New, small runtime generic context.
8630
8631         * metadata-internals.h, domain.c, image.c: Less bookkeeping is required for the new RGCTX.
8632
8633         * object.c: Don't setup the RGCTX when the vtable is created,
8634         because we're setting it up lazily now.
8635
8636 2008-04-26  Zoltan Varga  <vargaz@gmail.com>
8637
8638         * sgen-gc.c: Make the 'desc' variables an mword instead of a guint32 to fix 
8639         64 bit support.
8640
8641 2008-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
8642
8643         * verify.c (verify_class_for_overlapping_reference_fields): 
8644         If class is under fulltrust allow reference types to overllap
8645         if they have the same RVA.
8646
8647 2008-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
8648
8649         * pedump.c: Added new flag valid-only, that makes the verifier
8650         behaves just like --security=validil. It won't fail type load
8651         due to unverifiable restrictions.
8652
8653 2008-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
8654
8655         * class-internals.h (struct MonoMethod): Added a verification_success
8656         field to cache verifier executions. Reduced MonoMethod:slot size by
8657         one bit.
8658
8659 2008-04-23  Zoltan Varga  <vargaz@gmail.com>
8660
8661         * sgen-gc.c (OBJ_RUN_LEN_SIZE): Make this and other macros take a 'desc' argument
8662         instead of a 'vt' argument to save an indirection and to allow these to be used
8663         for valuetypes.
8664         (scan_vtype): New helper function to scan an area using a gc descriptor.
8665         (mono_gc_wbarrier_value_copy): Implement this.
8666         (handle_remset): Add support for REMSET_VTYPE.
8667         (find_in_remset_loc): Ditto.
8668         (mono_gc_base_init): Allow some debugging options to be controlled through the
8669         use of the MONO_GC_DEBUG env variable.
8670         (mono_gc_alloc_obj): Add support the 'collect-before-allocs' debug option.
8671         (collect_nursery): Add support for the 'check-at-minor-collection' debug option.
8672
8673 2008-04-23  Martin Baulig  <martin@ximian.com>
8674
8675         * domain.c (mono_domain_create): Move the call to
8676         mono_debug_domain_create() down, after allocating the domain id.
8677
8678 2008-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
8679
8680         verify.c (verify_class_for_overlapping_reference_fields): Skip
8681         static fields while verifying for overlapping fields as they
8682         don't matter at all.
8683
8684 2008-04-23  Marek Habersack  <mhabersack@novell.com>
8685
8686         * domain-internals.h: added a declaration of
8687         mono_make_shadow_copy.
8688
8689         * assembly.c (mono_assembly_open_full): shadow copying of
8690         assemblies moved to here, so that all the assemblies within the
8691         application domain's private binary directories can be
8692         processed. Fixes bug #380546
8693
8694         * appdomain.c (mono_make_shadow_copy): make_shadow_copy renamed to
8695         mono_make_shadow_copy and made non-static. The decision whether
8696         to shadow-copy an assembly is made based on its location - it's
8697         copied if it's in one of the private application domain binary
8698         directories and its different to the target file in the shadow
8699         directory. Fixes bug #380546
8700
8701 2008-04-22  Zoltan Varga  <vargaz@gmail.com>
8702
8703         * reflection.c (fixup_method): Handle {Method|Constructor}OnTypeBuilderInst.
8704
8705         * object-internals.h: Add MonoReflection{Method|Constructor}OnTypeBuilderInst
8706         types.
8707
8708         * reflection.c (mono_image_create_token): Handle 
8709         Method/ConstructorOnTypeBuilderInst.
8710         (resolve_object): Ditto.
8711         (inflate_mono_method): Receive the inflated class instead of a MonoGenericClass
8712         so it can be called from resolve_object. Also handle the case when the inflated
8713         class already has its methods setup.
8714
8715 2008-04-21  Martin Baulig  <martin@ximian.com>
8716
8717         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 69.
8718
8719 2008-04-20  Geoff Norton  <gnorton@novell.com>
8720
8721         * icall.c: Fix the _NSGetEnviron define to prevent an impropoer
8722         pointer dereference.
8723
8724 2008-04-15  Marek Habersack  <mhabersack@novell.com>
8725
8726         * appdomain.c (try_load_from): if IOMAP is in effect, call the
8727         portability API to look up the assembly file. Fixes behavior in
8728         situations when the application has a bin/ directory, but the
8729         assembly search patch refers to Bin/ (and thus the requested file
8730         name is Bin/SomeLibrary.dll). Fixes bug #379888
8731
8732 2008-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
8733
8734         verify.c (mono_type_is_generic_argument): Extracted this check
8735         from a dozen places to here.
8736
8737         verify.c: Fixed all issues related to boxing generic arguments
8738         and their constraints.
8739
8740 2008-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
8741
8742         verify.c (mono_class_interface_implements_interface): Fix win32 build.
8743
8744 2008-04-14  Zoltan Varga  <vargaz@gmail.com>
8745
8746         * reflection.c (mono_custom_attrs_construct): Fix crash when the cattr type
8747         isn't finished yet. Fixes #363447.
8748
8749 2008-04-13  Zoltan Varga  <vargaz@gmail.com>
8750
8751         * class.c (mono_bounded_array_class_get): Fix the name of bounded array types.
8752         Fixes #346419.
8753
8754 2008-04-13  Jb Evain  <jbevain@novell.com>
8755
8756         * domain.c: update the 2.1 profile versions.
8757         Merged from the Moonlight 2 branch.
8758
8759 2008-04-12  Zoltan Varga  <vargaz@gmail.com>
8760
8761         * assembly.c (mono_assembly_load_from_full): Do the check for loading other
8762         mscorlibs for the non-refonly case as well.
8763
8764         * image.c (do_mono_image_load): Remove the mscorlib check, it is already done
8765         in mono_assembly_load_from_full (). Fixes #378924.
8766
8767 2008-04-11  Geoff Norton  <gnorton@novell.com>
8768
8769         * icall.c: The global extern environ doesn't exist on Mac.  We
8770         need to call NSGetEnviron instead.
8771
8772 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
8773
8774         verify.c: Add generic method constraint verification.
8775
8776 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
8777
8778         class.c (mono_class_inflate_generic_method_full): Add a long
8779         explanation to the is_mb_open hack. Remove the FIXME.
8780
8781 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
8782
8783         * verify.c (mono_method_verify): Mark all unknown opcodes
8784         as invalid. Mark jmp as unverifiable.
8785
8786 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
8787
8788         * verify.c: Add code to do type constraint verification on class instances.
8789
8790         * verify.c (mono_verifier_verify_class): Use the type constraint 
8791         verification code.
8792
8793 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
8794
8795         * class.c (mono_class_get_field_default_value): Don't pass cindex
8796         as hint to mono_metadata_get_constant_index. The local is not initialized
8797         and should contain garbage most of the time. This could only work
8798         with a lot of luck.
8799
8800 2008-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
8801
8802         * tokentype.h: Add MONO_TOKEN_GENERIC_PARAM.
8803
8804 2008-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
8805
8806         * class-internals.h: Add generic_param_token to MonoClass::sizes union.
8807
8808         * class.c (mono_class_from_generic_parameter): Save the token of the
8809         generic param in MonoClass::sizes.generic_param_token.
8810
8811         * reflection.c (mono_custom_attrs_from_class): If the class type is
8812         VAR or MVAR retrieve the attributes of the generic param.
8813
8814 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
8815
8816         * class.c (mono_class_init): Do class verification if the verifier
8817         is enabled.
8818
8819 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
8820
8821         * verify-internal.h: Added mono_verifier_verify_class.
8822
8823         * verify.c: Added mono_verifier_verify_class. It checks for
8824         classes with explicit layout that have overlapping reference fields.
8825
8826         * pedump.c: Init the verifier state prior to verification. Fixed
8827         command line arguments.
8828
8829 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
8830
8831         * Makefile.am: Added verify-internals.h, hopefully fix the build.
8832
8833 2008-04-08  Zoltan Varga  <vargaz@gmail.com>
8834
8835         * verify-internals.h: Fix a warning.
8836
8837 2008-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
8838
8839         * verify-internals.h: New header with the verifier configuration
8840         extracted from mini.c.
8841
8842         * verify.c: Implemented the new functions exported by verify-internals.h.
8843
8844 2008-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
8845
8846         * verify.c: Add proper verification of ckfinite.
8847
8848 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
8849
8850         * verify.c (do_conversion): Improved error message to something
8851         more meanfull.
8852
8853         * verify.c (check_is_valid_type_for_field_ops): Fix to work
8854         with primitive types.
8855
8856 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
8857
8858         * verify.c: Added tail prefix checking. Marked icall
8859         as unverifible.
8860
8861 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
8862
8863         * verify.c: Fix the detection of branches to the middle
8864         of an instruction.
8865
8866 2008-04-03 Rodrigo Kumpera  <rkumpera@novell.com>
8867
8868         * verify.c: Implemented verification of volatile. and
8869         unaligned. prefix. Check if a type is valid after retrieving it.
8870
8871 2008-04-01  Dick Porter  <dick@ximian.com>
8872
8873         * process.c (process_get_fileversion): If there's no string block,
8874         set the file language to en_US.  Fixes the other new part of bug
8875         374600.
8876
8877 2008-03-29 Rodrigo Kumpera  <rkumpera@novell.com>
8878
8879         * class.c: New functions mono_method_can_access_field_full and
8880         mono_method_can_access_method_full. They perform type visibility
8881         and type site check.
8882
8883         * class-internal.h: Added exported functions.
8884
8885         * verify.c: Use new functions to implement proper visibility checks.
8886
8887 2008-03-29  Zoltan Varga  <vargaz@gmail.com>
8888
8889         * mono-config.h: Add missing G_BEGIN_DECLS/G_END_DECLS. Fixes #375188.
8890
8891 2008-03-28  Dick Porter  <dick@ximian.com>
8892
8893         * process.c (process_get_fileversion): Use the first language ID
8894         we see, rather than insisting on an invariant language.  Fixes bug
8895         374600.
8896
8897 2008-03-28  Zoltan Varga  <vargaz@gmail.com>
8898
8899         * reflection.c (calc_section_size): Use add_stream_zero to align the size of
8900         the streams to fix reading of invalid memory later.
8901
8902         * metadata.h (MonoType): Use 'MonoTypeEnum' instead of int for the 'type' field
8903         to ease debugging.
8904
8905 2008-03-26  Zoltan Varga  <vargaz@gmail.com>
8906
8907         * marshal.c (signature_dup): Use mono_metadata_signature_alloc ().
8908         (cominterop_method_signature): Ditto. Fix the size passed to memcpy.
8909
8910 2008-03-26  Massimiliano Mantione  <massi@ximian.com>
8911         * threads.h: Added MonoThreadManageCallback type and
8912         mono_thread_set_manage_callback prototype
8913         * object-internals.h: In _MonoThread, renamed unused6 to manage_callback
8914         (used to store the mono_thread_manage callback).
8915         * threads.c: Added mono_thread_set_manage_callback, and handle
8916         "MonoThread->manage_callback" in build_wait_tids.
8917
8918 2008-03-26  Dick Porter  <dick@ximian.com>
8919
8920         * process.c (process_get_fileversion): Set FileVersionInfo strings
8921         to Empty when the resource doesn't have the particular info.
8922         Fixes bug 355717.
8923
8924 2008-03-25 Rodrigo Kumpera  <rkumpera@novell.com>
8925
8926         * verify.c (mono_method_verify): Proper prefix validation.
8927
8928 2008-03-25  Zoltan Varga  <vargaz@gmail.com>
8929
8930         * icall.c (ves_icall_InternalInvoke): Return exceptions thrown by the icall
8931         itself in a separate argument instead of throwing them. Fixes #373448.
8932
8933         * appdomain.c: Bump corlib version.
8934
8935 2008-03-24 Rodrigo Kumpera  <rkumpera@novell.com>
8936
8937         * verify.c: Implemented readonly prefix and verify controled mutability pointers.
8938
8939 2008-03-20  Kornél Pál  <kornelpal@gmail.com>
8940
8941         * file-io.c, filewatcher.c, threadpool.c, threads.c: Removed Windows
8942         version macros.
8943
8944 2008-03-20  Mark Probst  <mark.probst@gmail.com>
8945
8946         * generic-sharing.c, class-internals.h: Code for putting
8947         reflection types into the runtime generic context.
8948
8949 2008-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
8950
8951         * icall.c (ves_icall_get_method_info): Return correct values for the call convention.
8952         Fixes #340662. 
8953
8954
8955 2008-03-17 Rodrigo Kumpera  <rkumpera@novell.com>
8956
8957         * verify.c (VerifyContext): Added instruction prefix data to the struct.
8958
8959         * verify.c (is_compatible_boxed_valuetype): Don't check if the type is a valuetype, been boxed is enough.
8960
8961         * verify.c (do_invoke): Support constrained callvirt form. Grouped similar checks together.
8962
8963         * verify.c (do_cast): Let the result value keep the boxed status.
8964
8965         * verify.c (mono_method_verify): Add proper support for prefixed and implement contrained.
8966
8967 2008-03-17  Jb Evain  <jbevain@novell.com>
8968
8969         * reflection.c: when running on a 2.0 runtime, emit
8970         unconditionally the #~ header version as 2.0, and the
8971         CLI header version as 2.5, for symmetry's sake with csc.
8972
8973 2008-03-16  Zoltan Varga  <vargaz@gmail.com>
8974
8975         * class.c: Remove the unused cache_interface_offsets stuff.
8976
8977         * class.c loader.c domain.c verify.c metadata.c debug-helpers.c threadpool.c
8978         profiler.c: Fix warnings.
8979
8980 2008-03-16  Mark Probst  <mark.probst@gmail.com>
8981
8982         * generic-sharing.c, class-internals.h: Support for putting
8983         methods into the runtime generic context.
8984
8985 2008-03-16  Zoltan Varga  <vargaz@gmail.com>
8986
8987         * class.c (mono_class_setup_fields): Ignore calls made to this function for
8988         classes which are generic instances of not-yet finished typebuilders. Fixes
8989         #351172.
8990
8991         * reflection.c (fixup_method): Add support for FieldOnTypeBuilderInst.
8992
8993 2008-03-15  Zoltan Varga  <vargaz@gmail.com>
8994
8995         * metadata-internals.h (MonoDynamicImage): Add 'generic_def_objects' hash table.
8996
8997         * class-internals.h (MonoMethodInflated): Remove the rarely used reflection_info
8998         field, replace it with a hash table in MonoDynamicImage.
8999
9000         * reflection.c (inflate_mono_method): Access the generic definition object from
9001         image->generic_def_objects instead of imethod->reflection_info.
9002
9003         * reflection.c (mono_reflection_bind_generic_method_parameters): Ditto. 
9004
9005         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition): Ditto.
9006         
9007         * image.c (mono_image_close): Move the dynamic image freeing code to a separate
9008         function in reflection.c so it is easier to keep in sync with the dynamic image
9009         creation code.
9010
9011         * reflection.c (mono_dynamic_image_free): New internal function, extracted from
9012         mono_image_close ().
9013
9014 2008-03-15  Mark Probst  <mark.probst@gmail.com>
9015
9016         * class.c (mono_class_generic_sharing_enabled): Disable generic
9017         sharing for all architectures except AMD64 and x86 to fix build.
9018
9019 2008-03-14 Rodrigo Kumpera  <rkumpera@novell.com>
9020
9021         * verify.c: Use the generic definition MonoGenericContext when available.
9022         Remove code for checking generics instance compatibility in favor of
9023         mono_class_is_assignable_from.
9024
9025 2008-03-14  Mark Probst  <mark.probst@gmail.com>
9026
9027         * marshal.c, marshal.h, metadata-internals.h, image.c,
9028         wrapper-types.h: New wrapper for invoking a shared static method
9029         without having to pass the runtime generic context argument.
9030
9031 2008-03-14 Rodrigo Kumpera  <rkumpera@novell.com>
9032
9033         * icall-def.h: Add missing function PerformanceCounterCategory::GetInstanceNames.
9034
9035 2008-03-14  Zoltan Varga  <vargaz@gmail.com>
9036
9037         * reflection.c (mono_image_get_field_on_inst_token): Add caching.
9038         
9039         * reflection.c (mono_image_get_field_on_inst_token): New helper function to
9040         create a token from a FieldOnTypeBuilderInst.
9041         (mono_image_create_token): Handle FieldOnTypeBuilderInst.
9042         (resolve_object): Ditto.
9043
9044         * object-internals.h (MonoReflectionFieldOnTypeBuilderInst): New structure
9045         mirroring System.Reflection.Emit.FieldOnTypeBuilderInst.
9046
9047 2008-03-14  Martin Baulig  <martin@ximian.com>
9048
9049         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 68.
9050
9051         * debug-mono-symfile.h
9052         (MONO_SYMBOL_FILE_VERSION): Bump to 41.
9053         (MONO_SYMBOL_FILE_COMPATIBILITY_VERSION): New #define.
9054
9055 2008-03-10  Martin Baulig  <martin@ximian.com>
9056
9057         * debug-mono-symfile.h
9058         (MonoSymbolFileMethodAddress): Removed `num_lexical_blocks' and
9059         `lexical_block_table_offset'.
9060         (MonoDebugMethodInfo): Removed `num_lexical_blocks' and
9061         `lexical_blocks'.
9062         (MonoSymbolFile): Added `version'.
9063
9064         * mono-debug.h
9065         (MonoDebugLexicalBlockEntry): Removed.
9066         (MonoDebugMethodJitInfo): Removed `num_lexical_blocks' and
9067         `lexical_blocks'.
9068
9069         * mono-debug.c (mono_debug_add_method): Don't compute lexical
9070         blocks here; the debugger now does this internally.
9071
9072 2008-02-27  Martin Baulig  <martin@ximian.com>
9073
9074         * object.c (mono_runtime_exec_main): Call
9075         `mono_debugger_event (MONO_DEBUGGER_EVENT_REACHED_MAIN)' and
9076         `mono_debugger_event (MONO_DEBUGGER_EVENT_MAIN_EXITED)' here.
9077
9078 2008-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
9079
9080         * verify.c (verify_type_compatibility_full): Allow native int to be converted
9081         to native pointer in non-strict mode. Required to "(IntPtr)null" work.
9082
9083 2008-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
9084
9085         * verify.c (verify_ldftn_delegate): Accept a sealed type when using
9086         ldftn with a virtual method.
9087
9088 2008-03-13  Geoff Norton  <gnorton@novell.com>
9089
9090         * decimal.c:  Only include memory.h if the platform has it.
9091
9092 Wed Mar 12 12:11:06 CET 2008 Paolo Molaro <lupus@ximian.com>
9093
9094         * assembly.c, class.c, metadata-internals.h: make sure public key
9095         tokesns are compared in a case-insensitive way. Also, all
9096         the lookups in the GAC use a lowercase public key token
9097         (gaacutil already does the lowercasing on install). Fixes
9098         bug #369541.
9099
9100 2008-03-11 Rodrigo Kumpera  <rkumpera@novell.com>
9101
9102         * verify.c (mono_delegate_signature_equal): Do proper variance check on arguments
9103         and return value.
9104
9105 Tue Mar 11 17:41:38 CET 2008 Paolo Molaro <lupus@ximian.com>
9106
9107         * image.c: when someone loads a mscorlib from a file, return the
9108         currently loaded mscorlib (fixes bug #369253).
9109
9110 Tue Mar 11 16:47:32 CET 2008 Paolo Molaro <lupus@ximian.com>
9111
9112         * class.c: handle types with no parents by forcing them to have
9113         System.Object as a parent and marking them as broken (this currently
9114         allows the first part of bug #369173 to work as well, likely because
9115         we don't check for typeload exceptions everywhere yet).
9116
9117 Tue Mar 11 15:23:54 CET 2008 Paolo Molaro <lupus@ximian.com>
9118
9119         * class.c: more complete check that types belong to corlib
9120         (fixes second part of bug #369173).
9121
9122 2007-03-10  Bill Holmes  <billholmes54@gmail.com>
9123
9124         * generic-sharing.c:  Including glib.h for the MSVC builds to define
9125           "inline" to "__inline" before including mono-membar.h.
9126           
9127         * mono-perfcounters.c:  Adding HAVE_SYS_TIME_H check for MSVC builds.
9128           Rename "Unknown" to "CatTypeUnknown" to avoid name collisions for 
9129           MSVC builds.
9130
9131         Contributed under MIT/X11 license.
9132
9133 2008-03-10 Rodrigo Kumpera  <rkumpera@novell.com>
9134
9135         * verify.c (do_invoke_method): Remove return type validation.
9136
9137         * verify.c (do_ret): Do return type validation at return site instead of
9138         call site.
9139
9140 2008-03-10 Rodrigo Kumpera  <rkumpera@novell.com>
9141
9142         * verify.c (do_invoke_method): Mark callvirt to static methods unverifiable.
9143
9144         * verify.c: Some todos cleaned and improved a few error messages.
9145
9146 2008-03-08  Zoltan Varga  <vargaz@gmail.com>
9147
9148         * class.c (mono_class_setup_mono_type): Improve the test for corlib.
9149
9150 2008-03-07  Zoltan Varga  <vargaz@gmail.com>
9151
9152         * class.c (mono_class_setup_mono_type): Handle types whose name clashes with
9153         system types correctly.
9154
9155         * exception.h exception.c (mono_exception_from_token_two_strings): New helper
9156         function.
9157
9158 2008-03-06  Zoltan Varga  <vargaz@gmail.com>
9159
9160         * assembly.c (build_assembly_name): Fix a warning.
9161
9162 Thu Mar 6 19:43:41 CET 2008 Paolo Molaro <lupus@ximian.com>
9163
9164         * marshal.c: ldfld_remote and stfld_remote needs just one wrapper as
9165         the called function takes an object type argument. Fixes storing or
9166         valuetypes across remoting as well as reducing memory usage.
9167         * image.c, metadata-internals.h: remove now unused ldfld_remote and
9168         stfld_remote wrapper caches.
9169
9170 2008-03-06  Zoltan Varga  <vargaz@gmail.com>
9171
9172         * icall.c (mono_lookup_internal_call): Update the exception message when an icall
9173         is not found.
9174
9175         * reflection.c (mono_image_register_token): New helper function to save
9176         a token->object mapping.        
9177
9178         * icall.c (ves_icall_ModuleBuilder_RegisterToken): New icall to access it from
9179         managed code.
9180
9181         * reflection.c (_mono_reflection_parse_type): Distinguish between vectors and
9182         one dimension arrays. Fixes #367670.
9183         (mono_reflection_get_type_internal): Ditto.
9184
9185 Tue Mar 4 19:04:02 CET 2008 Paolo Molaro <lupus@ximian.com>
9186
9187         * marshal.c: mono_load_remote_field_new() always returns object.
9188         so use the proper signature (fixes bug #366445).
9189
9190 2008-03-04  Zoltan Varga  <vargaz@gmail.com>
9191         
9192         * class-internals.h (MonoMethod): Remove unused uses_this flag, 
9193         add an 'inline_failure' flag instead.
9194
9195 2008-03-04  Mark Probst  <mark.probst@gmail.com>
9196
9197         * domain-internals.h, domain.c: Replaced MonoGenericSharingContext
9198         with a new structure, MonoGenericJitInfo, in the MonoJitInfo.  It
9199         contains the location of "this", used for exception handling.
9200
9201 2008-03-04  Zoltan Varga  <vargaz@gmail.com>
9202
9203         * class.c (mono_class_layout_fields): Set the min alignment of small structs to
9204         their size on all platforms for perf reasons.
9205
9206 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
9207
9208         * reflection.h: Move mono_reflection_is_valid_dynamic_token to
9209         object-internal.h
9210
9211         * object-internal.h: Same.
9212
9213 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
9214
9215         * reflection.h: Fix the build I just broke.
9216
9217 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
9218
9219         * reflection.c (mono_reflection_is_valid_dynamic_token): New function,
9220         Test if a token is valid, this remove explicit usage of 
9221         MonoDynamicImage::tokens from the verifier code.
9222
9223         * reflection.h: Added mono_reflection_is_valid_dynamic_token.
9224
9225         * verify.c (token_bounds_check): Use mono_reflection_is_valid_dynamic_token
9226         instead of direct access to MonoDynamicImage::tokens.
9227
9228 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
9229
9230         * verify.c (token_bounds_check): Fix the build I just broke.
9231
9232 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
9233
9234         * verify.c (token_bounds_check): Fix bounds check for dynamic images.
9235
9236         * verify.c (verifier_load_method): Fixed the errors message.
9237
9238         * verify.c (mono_method_verify): Fixed a debug message.
9239
9240 Thu Feb 28 19:49:45 CET 2008 Paolo Molaro <lupus@ximian.com>
9241
9242         * icall-def.h, domain.c, mono-perfcounters-def.h, mono-perfcounters.c,
9243         mono-perfcounters.h, class-internals.h: support for predefined
9244         writable counters, query of categories and counters, bugfixes.
9245
9246 2008-02-28 Rodrigo Kumpera  <rkumpera@novell.com>
9247
9248         * verify.c (do_refanytype): Verify the refanytype opcode.
9249
9250         * verify.c (mono_method_verify): Use do_refanytype.
9251
9252 2008-02-28 Rodrigo Kumpera  <rkumpera@novell.com>
9253
9254         * verify.c (do_mkrefany): Verify the mkrefany opcode.
9255
9256         * verify.c (mono_method_verify): Use do_mkrefany.
9257
9258 Wed Feb 27 19:49:16 CET 2008 Paolo Molaro <lupus@ximian.com>
9259
9260         * Makefile.am, icall-def.h, icall.c, mono-perfcounters-def.h,
9261         mono-perfcounters.c, mono-perfcounters.h: basic performance counter
9262         implementation.
9263
9264 2008-02-27  Zoltan Varga  <vargaz@gmail.com>
9265
9266         * marshal.c (mono_marshal_get_synchronized_wrapper): Fix the code which throws
9267         the type load exception.
9268
9269 2008-02-27 Rodrigo Kumpera  <rkumpera@novell.com>
9270
9271         * verify.c: Added a few FIXME for method signatures
9272
9273         * verify.c (do_invoke_method): Use mono_method_get_signature_full instead
9274         of mono_method_get_signature and get vararg call working. Removed unused
9275         checks for return value.
9276
9277         * verify.c (do_refanyval): Verify the refanyval opcode.
9278
9279         * verify.c (mono_method_verify): Implemented verification of arglist and
9280         use do_refanyval.
9281
9282 2008-02-27  Zoltan Varga  <vargaz@gmail.com>
9283
9284         * class.c (mono_class_setup_methods): Move the check for synchronized methods on
9285         vtypes to marshal.c.
9286
9287         * marshal.c (mono_marshal_get_synchronized_wrapper): Do the vtype check here so
9288         it works for AOT as well.
9289
9290 Tue Feb 26 17:46:32 CET 2008 Paolo Molaro <lupus@ximian.com>
9291
9292         * monitor.c, threads.c, threadpool.c: replace the use of GetTickCount ()
9293         with mono_msec_ticks () which is monotonic and doesn't cause bugs when
9294         the system time is adjusted.
9295
9296 Tue Feb 26 17:40:10 CET 2008 Paolo Molaro <lupus@ximian.com>
9297
9298         * icall.c, icall-def.h: use the new time functions (fixes the
9299         non-monotonic behaviour of TickCount).
9300
9301 2008-02-26  Zoltan Varga  <vargaz@gmail.com>
9302
9303         * reflection.c (mono_custom_attrs_from_builders): Revert the last change as
9304         it breaks the build.
9305         
9306         * reflection.c (mono_custom_attrs_from_builders): Assert instead of a crash if the
9307         cattr is not finished yet.
9308
9309 2008-02-25 Rodrigo Kumpera  <rkumpera@novell.com>
9310
9311         * verify.c: Proper token validation for field, method and type.
9312
9313 2008-02-25 Rodrigo Kumpera  <rkumpera@novell.com>
9314
9315         * loader.c (field_from_memberref): Generate a loader error if the type is not found.
9316
9317         * loader.c (method_from_memberref): Generate type load error instead of method missing
9318         if the type is not found.
9319
9320 2008-02-23  Zoltan Varga  <vargaz@gmail.com>
9321
9322         * marshal.c (mono_marshal_emit_managed_wrapper): Avoid generating invalid IL if
9323         some of the conversions caused the generation of a marshal directive exception.
9324
9325 2008-02-21 Rodrigo Kumpera  <rkumpera@novell.com>
9326
9327         verify.c: Report which exception should be thrown by the JIT.
9328         Added a lot of FIXME notes.
9329
9330 2008-02-22  Mark Probst  <mark.probst@gmail.com>
9331
9332         * generic-sharing.c: Runtime generic context slots are not
9333         instantiated on init anymore.  Instead, provide function to do the
9334         instantiating on demand.
9335
9336         * class-internals.h: Added vtable to runtime generic context.
9337         Macros for encoding direct and indirect slot offsets in one
9338         guint32.
9339
9340 2008-02-21  Mark Probst  <mark.probst@gmail.com>
9341
9342         * object.c, generic-sharing.c: Moved some generic sharing code
9343         from object.c to generic-sharing.c.
9344
9345         * generic-sharing.c: Added support for extensible runtime generic
9346         context.
9347
9348         * metadata-internals.h: Two new hash tables in MonoImage for
9349         extensible runtime generic context support.
9350
9351         * domain.c: Unregister generic vtables upon domain unloading.
9352
9353         * image.c: Destroy new hash tables upon image unloading.
9354
9355         * metadata.c: Unregister generic subclasses upon image unloading.
9356
9357         * class-internals.h: New data structure for runtime generic
9358         context template.  New fields in the runtime generic context for
9359         extensible part.
9360
9361         * Makefile.am: Added generic-sharing.c.
9362
9363 2008-02-21 Rodrigo Kumpera  <rkumpera@novell.com>
9364
9365         icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): If
9366         there is a pending loader exception, raise it.
9367
9368         icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): 
9369         same.
9370
9371         icall.c (ves_icall_System_Reflection_Module_ResolveFieldToken): 
9372         same.
9373
9374         Fixes #363450.
9375
9376 2008-02-20  Zoltan Varga  <vargaz@gmail.com>
9377
9378         * icall.c (ves_icall_Type_GetPacking): Handle dynamic types.
9379
9380         * assembly.c (mono_assembly_load_from_full): Fix a leak in the previous patch.
9381         
9382         * assembly.c (mono_assembly_load_from_full): Return the non-refonly corlib for
9383         ref-only requests for compatibility with MS.
9384
9385 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
9386
9387         * reflection.c (mono_custom_attrs_from_method): Don't silently
9388         return an empty list for generic method instances.
9389         (mono_custom_attrs_from_param): Likewise.
9390
9391 2008-02-20  Rodrigo Kumpera  <rkumpera@novell.com>
9392             Raja R Harinath  <harinath@hurrynot.org>
9393
9394         Fix #354757
9395         * class-internals.h (struct _MonoMethodInflated.is_mb_open): Add.
9396         * class.c (mono_class_inflate_generic_method_full): Initialize it
9397         when a fully-open method is instantiated.
9398         * metadata.c (inflated_method_equal, inflated_method_hash): Update
9399         to new field.
9400         * reflection.c (inflate_mono_method): Don't create a temporary context.
9401
9402 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
9403
9404         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition):
9405         Compute correct value, to prepare for imethod->reflection_info going away.
9406
9407 2008-02-19  Zoltan Varga  <vargaz@gmail.com>
9408
9409         * class.c (mono_class_setup_vtable_general): Ignore static methods in interfaces.
9410
9411 2008-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
9412
9413         * verify.c: Implement skip visibility flag.
9414
9415 2008-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
9416
9417         * verify.h: Added MONO_VERIFY_SKIP_VISIBILITY and struct MonoVerifyInfoExtended
9418         which contains an extra field to tell the kind of exception that should be thrown.
9419
9420         * verify.c: Use MonoVerifyInfoExtended instead of MonoVerifyInfo.
9421
9422 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
9423
9424         * loader.c (mono_method_get_param_names): Initialize 'klass' after
9425         'method' is updated.
9426
9427 2008-02-11  Zoltan Varga  <vargaz@gmail.com>
9428
9429         * class.c (mono_class_layout_fields): Set class->min_align for classes using
9430         explicit layout as well. Fixes #360375.
9431
9432 2008-02-11  Geoff Norton  <gnorton@novell.com>
9433
9434         * loader.c: Guard and dereference against inflated generic methods
9435
9436 2008-02-10  Gert Driesen  <drieseng@users.sourceforge.net>
9437
9438         * class.c: Include Retargetable spec in assembly name.
9439         * assembly.c: Always include PublicKeyToken spec in assembly name
9440         (with value "null" if assembly is not signed), and include
9441         Retargetable spec.
9442         * icall-def.h: Added icall for Assembly.get_fullname.
9443         * icall.c: Added icall returning the fullname of an assembly.
9444
9445 2008-02-09  Zoltan Varga  <vargaz@gmail.com>
9446
9447         * class.c (mono_class_setup_vtable_general): Add a missing call to
9448         mono_class_setup_methods () which is needed in the AOT case.
9449
9450 2008-02-08 Rodrigo Kumpera  <rkumpera@novell.com>
9451
9452         * verify.c (mono_type_get_stack_name): Added. Return the name for the
9453         stack type of the given MonoType.
9454
9455         * verify.c (verify_type_compatibility_full): Handle the void type.
9456
9457         * verify.c (is_compatible_boxed_valuetype): Changed to fit the
9458         way stack merging works.
9459
9460         * verify.c (store_local): Improved verification message.
9461
9462         * verify.c (do_branch_op): If the merging is invalid, the method
9463         is unverifiable and not invalid. Improved error message.
9464
9465         * verify.c (merge_stacks): Properly merge a boxed valuetype and
9466         a reference type diferent than System.Object. Improved error
9467         message.
9468
9469 2008-02-07 Rodrigo Kumpera  <rkumpera@novell.com>
9470
9471         * verify.c (mono_type_is_enum_type): Added. Test if a type is an enum.
9472
9473         * verify.c (mono_type_get_underlying_type_any): Added. Return the underlying
9474         type of an enum even if the argument is byref.
9475
9476         * verify.c: Replace all explicit uses of enumtype and enum_basetype
9477         to calls to mono_type_is_enum_type and mono_type_get_underlying_type_any.
9478
9479         * verify.c: Check for an enum in all cases of MONO_TYPE_GENERICINST.
9480
9481         *verify.c (verify_type_compatibility_full): Make enum types
9482         compatible with their base types.
9483
9484         * verify.c (is_compatible_boxed_valuetype): Added. Check if both
9485         types are compatible for the special case of a boxed valuetype and
9486         System.Object.
9487
9488         * verify.c (verify_stack_type_compatibility): The function
9489         is_compatible_boxed_valuetype was extracted from here.
9490
9491         * verify.c (push_arg): Only set ctx->has_this_store if the method
9492         is not static.
9493
9494         * verify.c (do_ldelem): Fixed a typo in an error message and added
9495         strict check for mixing int32 and native int as the array type
9496         and ldelem type.
9497
9498         * verify.c (merge_stacks): Consider boxed valuetypes in the
9499         compatibility checks.
9500
9501 2008-02-07  Massimiliano Mantione  <massi@ximian.com>
9502         * profiler.h: (MonoGCEvent): Added start-stop the world events.
9503
9504 2008-02-06  Massimiliano Mantione  <massi@ximian.com>
9505         *class.c: use_new_interface_vtable_code: renamed the env var to have
9506         a "MONO_" prefix, and fix the logic to enable it by default.
9507
9508 2008-02-06  Massimiliano Mantione  <massi@ximian.com>
9509         *class.c:
9510         mono_class_setup_vtable_general: rewrote the way in which interface
9511         methods are added to vtables. Makes bug-77127.exe pass, and hopefully
9512         makes the code more maintainable.
9513         For now the old code is still there, and can be activated setting
9514         the env var "USE_NEW_INTERFACE_VTABLE_CODE".
9515
9516 2008-02-06 Rodrigo Kumpera  <rkumpera@novell.com>
9517
9518         * verify.c: guarded some debug functions around and #ifdef.
9519
9520         * verify.c (merge_stacks): implement proper PIII 1.8.1.3 stack state merging.
9521
9522 2008-02-06  Zoltan Varga  <vargaz@gmail.com>
9523
9524         * marshal.c (mono_marshal_get_runtime_invoke): Revert the direct_wrapper
9525         changes for now since they seem to break too many things.
9526
9527 2008-02-05  Mark Probst  <mark.probst@gmail.com>
9528
9529         * marshal.c, marshal.h (mono_marshal_find_bitfield_offset,
9530         mono_marshal_find_nonzero_bit_offset): Added macro and function
9531         for finding the byte- and bit-offset of a bitfield within a
9532         struct.
9533
9534 2008-02-05  Zoltan Varga  <vargaz@gmail.com>
9535
9536         * marshal.c (mono_marshal_get_ptr_to_struct): Make the signature non-pinvoke.
9537         (mono_marshal_get_struct_to_ptr): Ditto.
9538
9539         * marshal.c (mono_marshal_get_runtime_invoke): Fix the signature of 
9540         cctor_signature.
9541
9542 2008-02-03  Zoltan Varga  <vargaz@gmail.com>
9543
9544         * marshal.c (mono_marshal_get_runtime_invoke): Fix sharing of runtime wrappers
9545         between methods for non-corlib types.
9546
9547 2008-02-02  Geoff Norton  <gnorton@novell.com>
9548
9549         * loader.c (mono_method_get_param_names): Populate the parameter name for 
9550         generic parameters as well. (Fixes #342536)
9551
9552 2008-01-31 Rodrigo Kumpera  <rkumpera@novell.com>
9553
9554         * verify.c (is_valid_bool_arg): Allow boxed values and null literals as well.
9555
9556         * verify.c (do_invoke_method): Fix for calling with byref structs.
9557
9558         * verify.c (do_cast): push a boxed value type based on the type token and not
9559         the type of stack.
9560
9561 2008-01-31  William Holmes  <billholmes54@gmail.com>
9562
9563         * process.c (process_module_string_read): Check the size returned form 
9564           VerQueryValue to avoid out of memory exception. 
9565
9566 2008-01-30  Zoltan Varga  <vargaz@gmail.com>
9567
9568         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
9569         Handle properly modules which are not in the moduleref table. Fixes
9570         #356938.
9571
9572 2008-01-29  Zoltan Varga  <vargaz@gmail.com>
9573
9574         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): Remove
9575         the dynamic case which is now in managed code.
9576         (ves_icall_System_Reflection_Assembly_GetTypes): Ditto.
9577
9578         * marshal.c (mono_string_to_bstr): Fix a warning.
9579         (init_com_provider_ms): Ditto.
9580
9581         * appdomain.c (ves_icall_System_AppDomain_createDomain): Add some FIXMEs.
9582
9583         * exception.c (mono_get_exception_out_of_memory): New helper function.
9584
9585 2008-01-28  Jonathan Chambers  <joncham@gmail.com>
9586
9587         * marshal.c: Add support for BSTR marshalling
9588         using other COM systems.
9589
9590         Code is contributed under MIT/X11 license.
9591
9592 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
9593
9594         * object.c (mono_runtime_invoke_array): reverted previous
9595         commit as it breaks the build.
9596
9597 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
9598
9599         * object.c (mono_runtime_invoke_array): Verify arguments for
9600         invalid types. Fixes #348522.
9601
9602 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
9603
9604         * verify.c: added IL_CODE_CALL_NONFINAL_VIRTUAL to track calls to
9605         non-final virtual calls using call. 
9606
9607         * verify.c (do_invoke): fixed some TODOs.
9608
9609         * verify.c (push_arg): set has_this_store for "ldarga 0".
9610
9611 2008-01-27  Zoltan Varga  <vargaz@gmail.com>
9612
9613         * reflection.c (reflection_methodbuilder_to_mono_method): Allow DynamicMethods
9614         which belong to an inflated class. Fixes #356531.
9615
9616 2008-01-26  Robert Jordan  <robertj@gmx.net>
9617
9618         * file-io.c: Implement and use wrappers for GetFileAttribute|Ex ()
9619         which resort to FindFirstFile when a certain error condition
9620         (ERROR_SHARING_VIOLATION) occured. Fixes bug #325212.
9621         Code is contributed under MIT/X11 license.
9622
9623 2008-01-24  Jonathan Chambers  <joncham@gmail.com>
9624
9625         * marshal.c (emit_marshal_string): Fix out string marshalling
9626         to use specified encoding. Fixes #323900.
9627
9628         Code is contributed under MIT/X11 license.
9629
9630 2008-01-24  Raja R Harinath  <harinath@hurrynot.org>
9631
9632         * class.c (mono_class_inflate_generic_method_full): Don't modify
9633         iresult->context after cache check.
9634
9635 2008-01-23  Zoltan Varga  <vargaz@gmail.com>
9636
9637         * class.c (mono_class_inflate_generic_method_full): Change the
9638         struct assignments to memcpy for better visibility and add some comments.
9639
9640 2008-01-23  Dick Porter  <dick@ximian.com>
9641
9642         * threads.c (mono_threads_set_shutting_down): Simplify shutdown
9643         procedure, and make it work on windows.
9644
9645 2008-01-22  Zoltan Varga  <vargaz@gmail.com>
9646
9647         * object-internals.h (MonoReflectionGenericClass): Make the 'generic_type' field
9648         a MonoReflectionTypeBuilder since it is always of that type.
9649
9650         * reflection.c (mono_type_get_object): Remove an unneccesary check.     
9651
9652         * reflection.c (mono_generic_class_get_object): Simplify this a bit.
9653
9654         * reflection.c (mono_reflection_bind_generic_parameters): Ditto.
9655         
9656         * icall.c (ves_icall_MonoGenericClass_GetParentType): Ditto.
9657
9658         * icall.c (ves_icall_MonoGenericClass_GetInterfaces): Ditto.
9659
9660         * reflection.c (mono_reflection_create_runtime_class): Remove already created
9661         instantiations from the type cache.
9662
9663 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
9664
9665         * verify.c (do_ldstr): fixed token verification. previous code was 100% broken.
9666
9667         * verify.c (do_unbox_value): push a controled mutability managed pointer.
9668
9669 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
9670
9671         * verify.c (do_ldstr): added, verifies if the #US token is valid.
9672
9673         * verify.c (mono_method_verify): removed old TODO
9674
9675 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
9676
9677         * verify.c (do_newobj): add visibility check.
9678
9679 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
9680
9681         * verify.c (do_load_function_ptr): add visibility check.
9682
9683 2008-01-21  Massimiliano Mantione  <massi@ximian.com>
9684         *class.c:
9685         mono_generic_class_get_class: hook profiler events.
9686         mono_field_get_offset: added to support heap-shot in the new profiler.
9687         *class.h: exported mono_field_get_offset.
9688         * reflection.c:
9689         mono_reflection_setup_internal_class: hook profiler events.
9690
9691 2008-01-20  Zoltan Varga  <vargaz@gmail.com>
9692
9693         * marshal.c (mono_marshal_emit_native_wrapper): Add a 'check_exceptions' 
9694         argument here too and use it to avoid checking for pending exceptions if 
9695         possible.
9696
9697 2008-01-20  Gert Driesen  <drieseng@users.sourceforge.net>
9698
9699         * assembly.c (build_assembly_name): add arg for passing the assembly
9700         flags. Do not consider a PublicKey with value "null" valid.
9701         (mono_assembly_name_parse_full): added boolean argument that will be
9702         set if the assembly name contains a PublicKeyToken spec. Added support
9703         for the Retargetable spec for which only Yes or No are allowed as valid
9704         value. Consider assembly name invalid if Retargetable spec is set, but
9705         either version, culture or public key (token) are not specified.
9706         * metadata-internals.h: sync signature of mono_assembly_name_parse_full
9707         with implementation in assembly.c.
9708         * icall.c (fill_reflection_assembly_name): also copy assembly flags
9709         from MonoAssemblyName.
9710         (ves_icall_System_Reflection_AssemblyName_ParseName): use newly
9711         introduced argument for mono_assembly_name_parse_full to know if the
9712         assembly name has a PublicKeyToken spec, and if it has instruct
9713         fill_reflection_assembly_name to use default value for keyToken (if
9714         PublicKeyToken is null).
9715
9716 2008-01-18  Rodrigo Kumpera  <rkumpera@novell.com>
9717
9718         * verify.c (mono_method_verify): fixed ovf ops with
9719         float values. They are unverifiable now.
9720
9721 2008-01-18  Rodrigo Kumpera  <rkumpera@novell.com>
9722
9723         * class.c (set_failure_from_loader_error): add BadImageException to the
9724         list of exceptions that can cause a type to fail to load.
9725
9726         * class.c (mono_class_get_exception_for_failure): same.
9727
9728 2008-01-17  Rodrigo Kumpera  <rkumpera@novell.com>
9729
9730         * verify.c (in_any_exception_block): added, check if offset
9731         is part of any exception handling clause.
9732
9733         * verify.c (get_stack_type): added VAR and MVAR types.
9734
9735         * verify.c (do_stobj): better error messages.
9736
9737         * verify.c (do_cpobj): added, check cpobj.
9738
9739         * verify.c (do_initobj): added, check initobj.
9740
9741         * verify.c (do_sizeof): added, check sizeof.
9742
9743         * verify.c (do_localloc): added, check localloc.
9744
9745         * verify.c: adde proper verification for cpobj, initobj, sizeof and localloc.
9746
9747 2008-01-17  Zoltan Varga  <vargaz@gmail.com>
9748
9749         * method-builder.c (mono_mb_emit_native_call): Get rid of the unused
9750         save_lmf/restore_lmf opcodes.
9751
9752         * threads.c (mono_threads_install_notify_pending_exc): New function to
9753         install a callback notifying the JIT there is a pending exception on a thread.
9754         (mono_thread_request_interruption): Call the new callback.
9755         (mono_thread_get_and_clear_pending_exception): New function to return the
9756         exception pending on a thread.
9757
9758         * marshal.c (mono_marshal_get_icall_wrapper): Add a check_exceptions argument
9759         to turn off checking for pending exceptions.
9760         (mono_marshal_get_native_wrapper): Ditto.
9761
9762 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
9763
9764         * threads-types.h: Get rid of the unnecessary extern declarations.
9765
9766 2008-01-16  Gert Driesen  <drieseng@users.sourceforge.net>
9767
9768         * icall.c (ves_icall_Type_GetField): if NonPublic flag is set, only
9769         return field from parent class if not private.
9770         (ves_icall_Type_GetFields_internal): if NonPublic flag is set, only
9771         returns fields from parent class if they are not private.
9772         (method_nonpublic): added function to determine if a given method
9773         should be considered non-public. Returns false for private methods
9774         on parent class, and internal methods from parent on the 1.0 profile.
9775         (ves_icall_Type_GetMethodsByName): if NonPublic flag is set, then
9776         use method_nonpublic function to determine whether method should be
9777         returned.
9778         (property_accessor_public): use newly introduced method_nonpublic
9779         function to determine whether accessor is non-public. 
9780         (ves_icall_MonoType_GetEvent): If NonPublic flag is set, only return
9781         event from parent class if not private. Only return static event if
9782         Static flag is set, and only return static event from parent class if
9783         FlattenHierarchy flag is set.
9784         (ves_icall_Type_GetEvents_internal): If NonPublic flag is set, only
9785         include non-private events from parent class.
9786
9787 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
9788
9789         * icall.c (ves_icall_System_NumberFormatter_GetFormatterTables): Fix a
9790         warning.
9791
9792 2008-01-16  Wade Berrier <wberrier@novell.com>
9793
9794         * security.c: Add assembly.h header to appease some warnings
9795
9796 2008-01-16  Dick Porter  <dick@ximian.com>
9797
9798         * process.c (process_module_string_read): Remove trailing null
9799         when saving string.
9800
9801 2008-01-16  Mark Probst  <mark.probst@gmail.com>
9802
9803         * class-internals.h: A new data structure describing the layout of
9804         a runtime generic context (MonoRuntimeGenericContextTemplate).
9805
9806         * metadata-internals.h: Added a hash table to MonoDomain that maps
9807         from open generic classes to their runtime generic context
9808         templates.
9809
9810         * object.c: Building of the runtime generic context, including
9811         proper handling of generic type arguments of superclasses.
9812         Building of the runtime generic context according to the template.
9813
9814 2008-01-15  Zoltan Varga  <vargaz@gmail.com>
9815
9816         * class.c (mono_class_setup_fields): Set field.count for generic instances.
9817         Fixes #350856.
9818
9819         * image.c (do_mono_image_open): Pass TRUE as last_exists to 
9820         mono_portability_find_file (). Fixes #325466.
9821         (mono_image_get_public_key): Fix a warning.
9822
9823 2008-01-14  Zoltan Varga  <vargaz@gmail.com>
9824
9825         * class.c (mono_class_from_name): Fix comments for NULL-ness of image parameter.
9826         Fixes #353550.
9827         (mono_class_from_name_case): Ditto.
9828
9829 2008-01-13  Eyal Alaluf <eyala@mainsoft.com>
9830
9831         * icall-def.h number-formatter.h icall.c: Implemented a cross app-domain
9832           common storage for the tables used in the System/NumberFormatter class.
9833
9834 2008-01-13  Zoltan Varga  <vargaz@gmail.com>
9835
9836         * marshal.c (mono_marshal_get_runtime_invoke): Fix a typo.
9837
9838 2008-01-11  Rodrigo Kumpera  <rkumpera@novell.com>
9839
9840         * verify.c (get_boxable_mono_type): check if the token is valid.
9841
9842         * verify.c (set_stack_value): changed to add an error if an
9843         invalid type is set on stack. Changed all callers due to signature change.
9844
9845         * verify.c (do_stobj): implement stobj validation.
9846
9847 2008-01-11  Zoltan Varga  <vargaz@gmail.com>
9848
9849         * reflection.c (reflection_methodbuilder_to_mono_method): No need to
9850         set container->is_method, it was set earlier.
9851
9852         * metadata.c (type_in_image): Handle MVARs which belong to not finished
9853         generic methods.
9854
9855         * reflection.c (mono_reflection_initialize_generic_parameter): Set
9856         is_method of the generic container to TRUE for methods.
9857
9858 2008-01-10  Zoltan Varga  <vargaz@gmail.com>
9859
9860         * metadata.c (type_in_image): Handle type parameters properly.
9861
9862         * class-internals.h (MonoGenericParam): Add an 'image' argument to track
9863         memory ownership of this structure.
9864
9865 2008-01-10  Rodrigo Kumpera  <rkumpera@novell.com>
9866
9867         * verify.c (get_boxable_mono_type): make typedref types been just
9868         unverifiable. check for void type.
9869
9870         * verify.c (do_unbox_any): added, verify opcode unbox.any.
9871
9872         * verify.c (do_load_function_ptr): accept method spec tokens.
9873
9874 2008-01-10  Zoltan Varga  <vargaz@gmail.com>
9875
9876         * marshal.c (mono_class_native_size): Always set *align even if this is called
9877         recursively.
9878
9879 2008-01-09  Zoltan Varga  <vargaz@gmail.com>
9880
9881         * verify.c (mono_verify_corlib): Remove this as it was not used and was 
9882         out-of-date.
9883
9884 2008-01-09  Rodrigo Kumpera  <rkumpera@novell.com>
9885
9886         * verify.c: removed some old unused tables. A huge bunch of small fixes
9887         to things found while testing the verifier with mono basic.
9888
9889         * verify.c (dump_stack_value): dump null literal flag to.
9890
9891         * verify.c (verify_type_compatibility_full): fix comparison
9892         for types that have a generic super type.
9893
9894         * verify.c (verify_stack_type_compatibility): fix compatibility
9895         between null literals and reference types. fix compatibility between
9896         boxed valuetypes and object. fix corner case test for enums.
9897
9898         * verify.c (do_cmp_op): proper verification of cgt.un in case
9899         of reference types.
9900
9901         * verify.c (do_invoke_method): fix error message.
9902
9903         * verify.c (do_store_indirect
9904
9905         * verify.c (check_is_valid_type_for_field_ops): proper verification
9906         of managed pointers to valuetypes and boxed valuetypes. proper verification
9907         of null literals.
9908
9909         * verify.c (do_unbox_value): expect valuetypes to be always boxed. don't
9910         allow token to be a reference type.
9911
9912         * verify.c (do_cast): proper handling of boxes valuetypes.
9913
9914         * verify.c (do_stelem): proper handling of storing a boxed valuetype
9915         in object[].
9916
9917         * verify.c (mono_method_verify): pass the opcode to do_cmp_op
9918         to handle cgt.un properly. Implement add/mul/sub ovf opcodes.
9919         fixed the decoding of unbox_any
9920
9921 2008-01-08  Zoltan Varga  <vargaz@gmail.com>
9922
9923         * boehm-gc.c (mono_gc_deregister_root): Fix the size passed to libgc.
9924
9925 2008-01-08  Rodrigo Kumpera  <rkumpera@novell.com>
9926
9927         * verify.c (do_newobj): do delegate verification.
9928
9929         * verify.c (verify_delegate_compatibility): perform delegate
9930         verification.
9931
9932         * verify.c (verify_ldftn_delegate): perform tests related to
9933         ldftn delegates.
9934
9935         * verify.c (mono_delegate_signature_equal): perform the
9936         slightly diferent signature comparison required by delegates.
9937
9938         * metadata.c (mono_metadata_type_equal_full): added and exported
9939         as MONO_INTERNAL. This is a version of mono_metadata_type_equal that
9940         allows signature only comparison.
9941
9942         * metadata-internal.h (mono_metadata_type_equal_full): added and exported
9943         as MONO_INTERNAL.
9944
9945 2008-01-07  Rodrigo Kumpera  <rkumpera@novell.com>
9946
9947         * verify.c: added a bunch of stack_slot_* functions to
9948         make access to stack slot type easier. This is required to
9949         allow optional flags, like null literal, boxed value and
9950         this pointer.
9951         All access paths to IlStackDesc::stype have been changed 
9952         to use these new funcions.
9953         Removed a bunch of unused functions and cleared all warnings.
9954         This patch introduces the usage of the this pointer and 
9955         boxed value flags.
9956
9957 2008-01-07  Zoltan Varga  <vargaz@gmail.com>
9958
9959         * boehm-gc.c (mono_gc_deregister_root): Fix win32 build.
9960
9961 2008-01-06  Zoltan Varga  <vargaz@gmail.com>
9962
9963         * appdomain.c (ves_icall_System_AppDomain_ExecuteAssembly): Change signature to
9964         match managed version.
9965
9966         * appdomain.c: Bump corlib version.
9967         
9968         * appdomain.c (ves_icall_System_AppDomain_ExecuteAssembly): Check for a null
9969         argument.
9970
9971 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
9972
9973         * icall.c (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies)
9974         Set public key token to zero-length byte array if assembly is not
9975         strongnamed.
9976
9977 2008-01-05  Zoltan Varga  <vargaz@gmail.com>
9978
9979         * icall.c (ves_icall_System_Array_SetValueImpl): Use a write barrier when
9980         writing a vtype array elem.
9981
9982 2007-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
9983
9984         * assembly.c (build_assembly_name): return FALSE if length of token is
9985         not 16 (if not "null").
9986         (mono_assembly_name_parse_full): return FALSE if value of version,
9987         culture, token or key is 0.
9988         * icall.c (fill_reflection_assembly_name): add boolean arguments to
9989         specify whether public key and public key token must be set to default
9990         value (zero-length byte array) if not available. Set versioncompat to
9991         SameMachine. If public key is available or the default is set, then
9992         set PublicKey flag.
9993         (ves_icall_System_Reflection_Assembly_FillName): if no public key
9994         is available, use empty byte array as default value. On the 2.0
9995         profile, use default value for public key token if not set.
9996         (ves_icall_System_Reflection_InternalGetAssemblyName): on the 1.0
9997         profile, use default value for public key if not set. On the 2.0
9998         profile, use default value for public key token if not set.
9999         (ves_icall_System_Reflection_AssemblyName_ParseName): do not set
10000         default values for public key and public key token.
10001
10002 2008-01-05  Zoltan Varga  <vargaz@gmail.com>
10003
10004         * object-internals.h (MonoReflectionAssemblyName): Add 'processor_architecture'
10005         field to keep it in synch with the managed object.
10006
10007         * marshal.c (emit_marshal_object): Add support for byref marshalling of
10008         delegates. Fixes #351520.
10009
10010         * sgen-gc.c (conservatively_pin_objects_from): Tell valgrind that the pin queue
10011         contains defined memory.
10012         
10013         * sgen-gc.c: Fix 64 bit warnings. Fix some typos. Update GC stats in mono_stats.
10014
10015         * sgen-gc.c (build_nursery_fragments): Handle half-constructed objects correctly.
10016         
10017         * sgen-gc.c (check_consistency): New helper function to do a consistency check
10018         of the GC data structures.
10019
10020         * gc-internal.h: Moved the REGISTER/UNREGISTER macros here from os/gc_wrapper.h.
10021
10022         * *.c: Include metadata/gc-internal.h instead of os/gc_wrapper.h.
10023         
10024         * object.c (mono_array_full_copy): Fix detection of whenever to use a write
10025         barrier.
10026         (mono_array_clone_in_domain): Ditto.
10027         (mono_array_clone_in_domain): Ditto.
10028
10029         * threads.c (start_wrapper): Register the thread start argument as a GC root.
10030         (cache_culture): Use a write barrier.
10031
10032         * icall.c (ves_icall_System_Array_SetValueImpl): Call a write barrier.
10033         (ves_icall_get_property_info): Ditto.
10034
10035         * object.h (MONO_STRUCT_SETREF): New macro.
10036
10037         * class-internals.h (MonoStats): Add some GC statistics.
10038
10039         * boehm-gc.c null-gc.c: Define mono_gc_deregister_root ().
10040
10041 2008-01-04  Andreas Faerber  <andreas.faerber@web.de>
10042
10043         * exception.c (mono_exception_from_name_two_strings):
10044         Break from loop after method is found.
10045
10046 2008-01-04  Dick Porter  <dick@ximian.com>
10047
10048         * process.c (process_module_string_read): Rename variable to
10049         reflect correct usage, after fixing bug 345972.
10050
10051 2008-01-03  Rodrigo Kumpera  <rkumpera@novell.com>
10052
10053         * verify.c (mono_type_create_fnptr_from_mono_method): 
10054         created a MonoType function pointer instance to be used during
10055         verification. The verifier releases this memory at end.
10056
10057         * verify.c (mono_method_is_constructor): extracted repeated
10058         checks for constructor into a single class.
10059
10060         * verify.c (do_push_field): use new extracted method
10061         for constructor check.
10062
10063         * verify.c (do_newobj): same.
10064
10065         * verify.c (do_ldftn): renamed to do_load_function_ptr
10066         and make it verify ldvirtftn too.
10067
10068         * verify.c (mono_method_verify: proper verification
10069         of ldvirtftn. release created MonoMethod instances.
10070
10071 2007-12-31  Rodrigo Kumpera  <rkumpera@novell.com>
10072
10073         * verify.c (token_bounds_check): added.
10074
10075         * verify.c (do_ldftn): added.
10076
10077         * verify.c (mono_method_verify): proper verificartion of ldftn.
10078
10079 2007-12-31  Rodrigo Kumpera  <rkumpera@novell.com>
10080
10081         * metadata.c (mono_metadata_decode_row): Assert if index is bigger
10082         than the table row count. It's the resposibility of the caller to
10083         make the bounds check and raise the correct error.
10084
10085         * metadata.c (mono_metadata_decode_row_col): Same.
10086
10087         * loader.c (mono_get_method_from_token): perform bounds check
10088         on token for methoddef table.
10089
10090 2007-12-29  Miguel de Icaza  <miguel@novell.com>
10091
10092         * icall.c
10093         (ves_icall_System_CurrentSystemTimeZone_GetTimeZoneData): Turn the
10094         assert into a negative result, the managed code already coped with
10095         that.
10096
10097         Some folks on Windows reported this error. 
10098
10099 2007-12-28  Gert Driesen  <drieseng@users.sourceforge.net>
10100
10101         * appdomain.c: Bump corlib version.
10102         * icall.c:
10103         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies): Use
10104         CultureInfo.CreateCulture to create CultureInfo for name.
10105         (fill_reflection_assembly_name): Use CultureInfo.CreateCulture to
10106         create CultureInfo for name. Fixes bug #347174.
10107
10108 2007-12-27  Rodrigo Kumpera  <rkumpera@novell.com>
10109
10110         * verify.c: added IL_CODE_FLAG_STACK_INITED and IL_CODE_STACK_MERGED
10111         flags.
10112
10113         * verify.c (is_valid_branch_instruction): allow branching to the
10114         first instruction of the protected block.
10115
10116         * verify.c (is_valid_cmp_branch_instruction): same.
10117
10118         * verify.c (stack_init): use IL_CODE_FLAG_STACK_INITED flag to
10119         avoid double initialization.
10120
10121         * verify.c (merge_stacks): use IL_CODE_STACK_MERGED to
10122         detect which cases the eval stack should just be copied.
10123
10124         * verify.c (mono_method_verify): check if the eval stack
10125         is empty when entering a protected block.
10126
10127 2007-12-27  Rodrigo Kumpera  <rkumpera@novell.com>
10128
10129         * verify.c: added is_clause_in_range, is_clause_inside_range,
10130         is_clause_nested and verify_clause_relationship. They perform
10131         the verifications stated in P1 12.4.2.7.
10132
10133         * verify.c (mono_method_verify): remove some unused variables,
10134         add the new exception clause checks, add instruction border
10135         checks for protected block start/end, improved some error 
10136         messages and fixed a bug in the way invalid instruction access
10137         is detected.
10138
10139 2007-12-26  Zoltan Varga  <vargaz@gmail.com>
10140
10141         * boehm-gc.c (mono_gc_register_thread): Use the new GC_register_my_thread () routine
10142         from GC 7.0 if available.
10143
10144         * object.c: Remove an unused define.
10145         
10146         * object.c (mono_class_compute_gc_descriptor): Fix a warning.
10147
10148         * boehm-gc.c (mono_gc_make_descr_for_array): Implement.
10149
10150         * null-gc.c (mono_gc_make_descr_for_array): Implement.
10151
10152         * object.c (mono_class_compute_gc_descriptor): Remove an #ifdef SGEN_GC.
10153
10154         * gc-internal.h: Change the signature of mono_gc_make_descr_for_string ()
10155         to take the same arguments as the other make_descr functions.
10156
10157         * boehm-gc.c null-gc.c: Add implementation for make_descr functions.
10158
10159         * objects.c: Get rid of the MAKE_DESCRIPTOR macros, call make_descr functions
10160         directly.
10161
10162         * boehm-gc.c (mono_gc_base_init): Moved the setting of GC_stackbottom here from
10163         mini.c.
10164
10165         * object.c (mono_class_compute_gc_descriptor): Move the GC_init_gcj_malloc () 
10166         call to boehm-gc.c.
10167
10168         * boehm-gc.c (mono_gc_register_root): Fix a warning.
10169
10170         * null-gc.c (mono_gc_register_root): Fix a warning.
10171
10172         * reflection.c (ALLOC_REFENTRY): Use mono_gc_alloc_fixed for boehm as well.
10173
10174         * boehm-gc.c (mono_gc_register_root): Moved definition here from gc_wrapper.h.
10175         (mono_gc_base_init): Call GC_init ().
10176
10177         * null-gc.c: Define mono_gc_register_root () as a no-op.
10178
10179         * domain.c appdomain.c: Call mono_gc_base_init () instead of MONO_GC_PRE_INIT ().
10180
10181 2007-12-24  Rodrigo Kumpera  <rkumpera@novell.com>
10182
10183         * verify.c: add prototype for merge_stacks at top
10184
10185         * verify.c (do_switch): added.
10186
10187         * verify.c (merge_stacks): on some cases the stack merging
10188         was not happening properly. Unequal stack sizes at merge
10189         points should be invalid.
10190
10191         * verify.c (mono_method_verify): added more debug info on stack state.
10192         verify switch properly.
10193
10194 2007-12-24  Zoltan Varga  <vargaz@gmail.com>
10195
10196         * method-builder.h: New file, moved the mono_mb_ declarations here from 
10197         marshal.h.
10198
10199         * boehm-gc.c marshal.c: Include method-builder.h.
10200
10201         * marshal.c: Use mono_mb_emit_branch_label () in a few places.
10202
10203         * marshal.c: Remove some code which is now in method-builder.c.
10204
10205 2007-12-23  Zoltan Varga  <vargaz@gmail.com>
10206
10207         * method-builder.c: New file, extraction of the method builder functionality 
10208         from marshal.c.
10209
10210         * marshal.c: Move the mb functions into method-builder.c.
10211
10212         * marshal.h marshal.c: Export some mono_mb_... functions.
10213
10214         * marshal.c: Use mono_mb_get_label () and mono_mb_patch_branch () in all places.
10215
10216         * loader.c (field_from_memberref): Remove the dynamic case, it is handled in
10217         the caller.
10218
10219         * class.c (mono_class_get_full): Check the token type in the dynamic case.
10220
10221         * loader.c (mono_field_from_token): Ditto.      
10222
10223         * loader.c (mono_get_method_from_token): Change the check so it checks memberref
10224         type as well.
10225         
10226         * loader.c (mono_get_method_from_token): Check the token type in the dynamic case.
10227         Fixes #342565.
10228
10229         * class-internals.h: Add new loader error type MONO_EXCEPTION_BAD_IMAGE plus
10230         a helper function for setting it.
10231
10232         * loader.c (mono_loader_error_prepare_exception): Handle MONO_EXCEPTION_BAD_IMAGE.
10233
10234         
10235         * assembly.c: Significally simplify code now that referenced assemblies are 
10236         loaded lazily. Get rid of the 'loading' hashtables. Hopefully fixes #347629.
10237
10238         * threads.h: Don't include  the internal threads-types.h header file. Fixes
10239         #349952.
10240
10241 2007-12-21  Rodrigo Kumpera  <rkumpera@novell.com>
10242
10243         * verify.c: added enum value IL_CODE_FLAG_WAS_TARGET, to represent
10244         instructions that were target of branches or are at protected block boundaries.
10245
10246         * verify.c (in_same_block): handle filter clauses.
10247
10248         * verify.c (is_valid_branch_instruction): added. checks the target of
10249         instructions br or brtrue/false.
10250
10251         * verify.c (is_valid_cmp_branch_instruction): added. checks the target of
10252         binary branch instructions such as beq and bge.
10253
10254         * verify.c (init_stack_with_value): renamed to init_stack_with_value_at_exception_boundary
10255         and made it pin the instruction as been part of the exception block.
10256
10257         * verify.c (do_boolean_branch_op): use is_valid_branch_instruction instead
10258         of in_same_block.
10259
10260         * verify.c (do_branch_op): use is_valid_cmp_branch_instruction instead
10261         of in_same_block.
10262
10263         * verify.c (do_ret): ret from a protected block is unverifiable and
10264         not invalid.
10265
10266         * verify.c (do_static_branch): verify br and br.s instructions.
10267
10268         * verify.c (merge_stacks): add extra param to support detection
10269         of branches in the middle of instructions.
10270         
10271         * verify.c (mono_method_verify): verify branches and exception blocks
10272         that target the middle of instructions. Proper verification of br and br.s.
10273
10274 2007-12-21  Zoltan Varga  <vargaz@gmail.com>
10275
10276         * reflection.c (reflection_methodbuilder_from_ctor_builder): Initialize
10277         skip_visibility field.
10278         (reflection_methodbuilder_from_dynamic_method): Ditto.
10279
10280         * object.c (mono_class_compute_gc_descriptor): Remove more unused icall
10281         registrations. Fixes #348193.
10282
10283         * threads.h: Move the internal mono_thread_get_pending_exception () to
10284         threads-types.h and rename it to mono_thread_get_undeniable_exception ().
10285
10286 2007-12-20  Zoltan Varga  <vargaz@gmail.com>
10287
10288         * object.c (mono_class_compute_gc_descriptor): Remove unused GC_gcj_fast_malloc
10289         icall registration. Fixes #348193.
10290
10291         * marshal.c (mono_marshal_get_runtime_invoke): Put all runtime invoke wrappers
10292         for corlib classes into object. Fixes #349621.
10293
10294 2007-12-20  Gert Driesen  <drieseng@users.sourceforge.net>
10295
10296         * icall.c (property_accessor_nonpublic): new function to determine
10297         whether an accessor allows a property to be considered non-public.
10298         Returns false for private accessor(s) from parent class, and internal
10299         accessor(s) from parent on 2.0 profile (and higher).
10300         (ves_icall_Type_GetPropertiesByName): Use newly introduced function
10301         to determine whether property should be included if NonPublic flag
10302         is set. Fixes bug #349078.
10303
10304 2007-12-20  Rodrigo Kumpera  <rkumpera@novell.com>
10305
10306         * verify.c (init_stack_with_value): added.
10307
10308         * verify.c (mono_method_verify): extracted common
10309         code for exception initialization into init_stack_with_value.
10310
10311         * verify.c (mono_method_verify): initialize the exception
10312         for handler clauses as well.
10313
10314         * verify.c (mono_method_verify): fix the exception clause
10315         ordering rules, it should use handler end offset and not
10316         start offset.
10317
10318 Thu Dec 20 12:27:24 CET 2007 Paolo Molaro <lupus@ximian.com>
10319
10320         * rawbuffer.c: remove useless warning.
10321
10322 Thu Dec 20 12:10:38 CET 2007 Paolo Molaro <lupus@ximian.com>
10323
10324         * threads.h, threads-types.h: move functions to the correct header
10325         (fixes bug#349952).
10326
10327 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
10328
10329         * verify.c (mono_method_verify): proper verification
10330         of exception handling clauses ranges and fallthru in
10331         and out of protected blocks.
10332
10333 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
10334
10335         * verify.c (mono_method_verify): fixed compilation issue.
10336
10337 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
10338
10339         * verify.c (mono_method_verify): a printf slipped in, changed
10340         to use verifier debug macro.
10341
10342 2007-12-18  Rodrigo Kumpera  <rkumpera@novell.com>
10343
10344         * verify.c (is_correct_leave): check for filter clauses.
10345
10346         * verify.c (do_filter): added.
10347
10348         * verify.c (mono_method_verify): property verification of leave.
10349
10350
10351 2007-12-18  Mark Probst  <mark.probst@gmail.com>
10352
10353         * threads.c: Disable calls to _wapi_thread_signal_self() to fix
10354         Win32 build, until we figure out how to do the proper thing on
10355         Win32.
10356
10357 2007-12-17  Zoltan Varga  <vargaz@gmail.com>
10358
10359         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Fix a crash introduced
10360         by the previous patch.
10361         
10362         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Avoid calling
10363         the assembly resolve handler for refonly assemblies.
10364
10365 2007-12-17  Mark Probst  <mark.probst@gmail.com>
10366
10367         * threads.c, thread-types.h, icall.c: New shutdown safeguards.
10368         Make sure only one thread is allowed to commence shutdown, and
10369         don't allow new threads to be started once shutdown is in
10370         progress.
10371
10372 2007-12-14  Rodrigo Kumpera  <rkumpera@novell.com>
10373
10374         * verify.c (is_correct_endfilter): added.
10375
10376         * verify.c (is_unverifiable_endfilter): added.
10377
10378         * verify.c (do_endfilter): added.
10379
10380         * verify.c (mono_method_verify): property verification of endfilter
10381         and fixed a corner case or endfinally.
10382
10383 2007-12-13  Rodrigo Kumpera  <rkumpera@novell.com>
10384
10385         * verify.h: new flags to support fail fast of unverifiable code and
10386         do non-strict verification. Non-strict verification is required to
10387         have MS runtime compatibility. There are a huge amount of unverifiable
10388         code that it accepts as verifiable. The strict mode verifies the code
10389         as the specs says.
10390         Non-strict mode will be required in cases where code needs to be
10391         accepted as verifiable but fails under strict mode.
10392
10393         * pedump.c: added support to fail fast and non-strict verification.
10394
10395         * verify.c: added support for both fail fast and non-strict verification.
10396
10397 2007-12-12  Rodrigo Kumpera  <rkumpera@novell.com>
10398
10399         * verify.c (is_correct_endfinally): added.
10400
10401         * verify.c (mono_method_verify): property verification of endfinally.
10402
10403 2007-12-11  Rodrigo Kumpera  <rkumpera@novell.com>
10404
10405         * verify.c (in_any_block): check for filter clauses.
10406
10407         * verify.c (is_correct_rethrow): added.
10408
10409         * verify.c (mono_method_verify): property verification of rethrow.
10410
10411         * metadata.h: added MONO_OFFSET_IN_FILTER macro.
10412
10413 2007-12-11  Rodrigo Kumpera  <rkumpera@novell.com>
10414
10415         * verify.c (do_throw): added.
10416
10417         * verify.c (mono_method_verify): property verification of throw
10418
10419 2007-12-11  Zoltan Varga  <vargaz@gmail.com>
10420
10421         * assembly.c (mono_assembly_load_reference): Try an assembly resolve for ref-only
10422         assemblies. Fixes #346425.
10423
10424 2007-12-10  Zoltan Varga  <vargaz@gmail.com>
10425
10426         * reflection.c (mono_reflection_get_token): Call mono_image_create_token () for
10427         FieldBuilders.
10428
10429         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): Fix a warning.
10430
10431         * class.c (mono_lookup_dynamic_token_class): Add a 'valid token' argument to
10432         prevent asserts when this is called with a token which might not be valid.
10433
10434         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Call
10435         lookup_dynamic_token_class with valid_token == FALSE.
10436
10437         * icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): Ditto.       
10438
10439         * icall.c (ves_icall_System_Reflection_Module_ResolveStringToken): Ditto.
10440
10441         * icall.c (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
10442         
10443 2007-12-10  Mark Probst  <mark.probst@gmail.com>
10444
10445         * gc.c: Don't delay threadpool thread finalization unless Mono is
10446         shutting down.
10447
10448 Mon Dec 10 11:06:23 CET 2007 Paolo Molaro <lupus@ximian.com>
10449
10450         * threads.c: turn an assert into a non-fatal warning.
10451
10452 2007-12-09  Robert Jordan  <robertj@gmx.net>
10453
10454         * icall.c (GetVirtualMethod): Add missing argument validation.
10455
10456 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
10457
10458         * verify.c (do_cast): added.
10459
10460         * verify.c (mono_method_verify): property verification of castclass and isinst.
10461
10462
10463 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
10464
10465         * verify.c (mono_type_from_opcode): added opcodes for stelem.X.
10466
10467         * verify.c (do_stelem): added.
10468
10469         * verify.c (mono_method_verify): property verification of stelem.X.
10470
10471 2007-12-07  Mark Probst  <mark.probst@gmail.com>
10472
10473         * class.c, class-internals.h: Introduce an environment variable
10474         (MONO_GENERIC_SHARING) through which the extent of generic code
10475         sharing can be controlled (share all classes, share only corlib
10476         classes, or share nothing).
10477
10478         * object.c: Only create runtime generic context for classes for
10479         which sharing is enabled.
10480
10481 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
10482
10483         * verify.c (do_ldelem): refactor it to work with ldelem.any.
10484
10485         * verify.c (mono_method_verify): property verification of ldelem.any.
10486
10487 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
10488
10489         * verify.c (get_indirect_op_mono_type): renamed to mono_type_from_opcode,
10490         added ldelem.X opcodes.
10491
10492         * verify.c (do_ldelema): fixed possible invalid usage of MonoType.
10493
10494         * verify.c: proper verification of ldelem.X 
10495
10496 2007-12-06  Zoltan Varga  <vargaz@gmail.com>
10497
10498         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): Allow interface cctors to be called too.
10499
10500 2007-12-05  Rodrigo Kumpera  <rkumpera@novell.com>
10501
10502         * verify.c (mono_method_verify): null literal requires special handling,
10503         the value pushed on stack need to be flagged as so.
10504
10505         * verify.c (do_ldelema): Verify ldelema properly.
10506
10507 2007-12-05  Rodrigo Kumpera  <rkumpera@novell.com>
10508
10509         * verify.c: Verify ldlen properly.
10510
10511 2007-12-05  Zoltan Varga  <vargaz@gmail.com>
10512
10513         * icall.c (ves_icall_MonoField_GetValueInternal): Check that the field belongs
10514         to the target object's type. Fixes #346160.
10515
10516 2007-12-05  Dick Porter  <dick@ximian.com>
10517
10518         * threadpool.c (socket_io_add_poll): Asynchronous connect() on
10519         Solaris needs the same workaround as BSD-derived systems.  Fixes
10520         bug 323524, patch by Burkhard Linke
10521         <burkhard.linke@CeBiTec.Uni-Bielefeld.DE>
10522
10523 2007-12-04  Gert Driesen  <drieseng@users.sourceforge.net>
10524
10525         * process.c: When ProcessStartInfo.ErrorDialog is true, pass window
10526         handle to use when error dialog is shown; otherwise, update mask
10527         to show no error dialog when an error occurs.
10528
10529 2007-12-03  Zoltan Varga  <vargaz@gmail.com>
10530
10531         * icall.c (ves_icall_MonoField_GetRawConstantValue): New icall.
10532
10533         * class.c (mono_class_get_field_default_value): New helper function to initialize
10534         field->def_type and field->data.
10535
10536 2007-11-30  Zoltan Varga  <vargaz@gmail.com>
10537
10538         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Use the delegate trampoline instead of
10539         the general one.
10540
10541         * object.c (mono_runtime_create_delegate_trampoline): New helper function.
10542
10543         * marshal.c: Avoid depending on delegate->method_info being set.
10544
10545         * object.c (mono_delegate_ctor): Avoid initializing delegate->method_info.
10546         
10547         * object.c (mono_delegate_ctor): Set delegate->method.
10548
10549         * object-internals.h (struct _MonoDelegate): Add 'method' field.
10550
10551         * appdomain.c: Bump corlib version.
10552
10553 2007-11-27  Raja R Harinath  <harinath@gmail.com>
10554
10555         * metadata.c (mono_generic_inst_equal_full): Short-circuit
10556         equality check if we're comparing canonicalized MonoGenericInsts.
10557
10558 2007-11-23  Zoltan Varga  <vargaz@gmail.com>
10559
10560         * class.c (generic_array_methods): Call mono_class_setup_methods () before
10561         accessing class->methods.
10562
10563 2007-11-22  Dick Porter  <dick@ximian.com>
10564
10565         * threads.c: Ensure that the synch_cs is set before trying to use
10566         it.
10567
10568 Thu Nov 22 12:34:04 CET 2007 Paolo Molaro <lupus@ximian.com>
10569
10570         * profiler.c: r89126 broke the statistial profiler, unbreak.
10571
10572 2007-11-22  Martin Baulig  <martin@ximian.com>
10573
10574         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 66.
10575
10576         * mono-debug.c
10577         (mono_debug_debugger_version): Bump to 3.
10578         (mono_debug_init): Hook `mono_debugger_class_loaded_methods_func'
10579         -> mono_debugger_class_initialized().
10580
10581         * mono-debug-debugger.c
10582         (mono_debugger_add_type): Renamed into mono_debugger_class_initialized().
10583
10584         * class.c
10585         (mono_debugger_start_class_init_func): Removed.
10586         (mono_debugger_class_loaded_methods_func): Added.
10587         (mono_class_setup_methods): Call it here.
10588
10589 2007-11-22  Martin Baulig  <martin@ximian.com>
10590
10591         * mono-debug.c
10592         (mono_debug_add_delegate_trampoline): New public method.
10593         (MonoDebugDataItemType): Added `MONO_DEBUG_DATA_ITEM_DELEGATE_TRAMPOLINE'.
10594
10595         * mono-debug.h
10596         (MonoSymbolTable): Added `global_data_table'.
10597         (MonoDebuggerTypeKind): Removed.
10598
10599 2007-11-21  Zoltan Varga  <vargaz@gmail.com>
10600
10601         * marshal.c (mono_marshal_get_generic_array_helper): Skip visibility checks for
10602         these methods.
10603
10604         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
10605         
10606 Tue Nov 20 23:10:41 CET 2007 Paolo Molaro <lupus@ximian.com>
10607
10608         * object.c: some fields don't have a valid rva: ignore them (bug #343083).
10609
10610 2007-11-20  Martin Baulig  <martin@ximian.com>
10611
10612         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 65.
10613
10614         * mono-debug-debugger.c
10615         (mono_debugger_insert_method_breakpoint): Moved here from debug-mini.c
10616         (mono_debugger_remove_breakpoint): Likewise.
10617         (mono_debugger_check_breakpoints): Likewise.
10618         (mono_debugger_register_class_init_callback): New public method.
10619         (mono_debugger_remove_class_init_callback): Likewise.
10620         (mono_debugger_add_type): Likewise.
10621
10622         * mono-debug-debugger.h
10623         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_CLASS_INITIALIZED'.
10624
10625 Tue Nov 20 20:54:12 CET 2007 Paolo Molaro <lupus@ximian.com>
10626
10627         * class.c: more interface implementations needed for the
10628         array enumerator (fixes bug #341112).
10629
10630 2007-11-18  Gert Driesen  <drieseng@users.sourceforge.net>
10631
10632         * icall.c: Renamed arguments for ves_icall_System_Enum_ToObject to
10633         fix ParamName of ArgumentNullExceptions.
10634
10635 2007-11-17  Miguel de Icaza  <miguel@novell.com>
10636
10637         * reflection.c (mono_reflection_encode_sighelper): Generate the
10638         modopts and modreqs.   I have a useless test that crashes monodis,
10639         but that shows the code working.
10640
10641 2007-11-17  Zoltan Varga  <vargaz@gmail.com>
10642
10643         * boehm-gc.c (create_allocator): Fix size calculation for the string allocator.
10644         (mono_gc_get_managed_allocator): Enable the string allocator on amd64.
10645
10646 2007-11-15  Dick Porter  <dick@ximian.com>
10647
10648         * threads.c (ves_icall_System_Threading_Thread_Join_internal):
10649         When joining a thread, it's the thread that's calling Join that
10650         gets WaitSleepJoin state not the target.  Fixes the standalone
10651         test case in bug 334740, and hopefully the whole bug too.
10652
10653 2007-11-15  Dick Porter  <dick@ximian.com>
10654
10655         * process.c: Read file version info from the files pointed at by
10656         process modules, not the current process.  Fixes bug 315969.
10657
10658         Use windows typedef names in some places to fix warnings on the
10659         windows build.
10660
10661 2007-11-15  Mark Probst  <mark.probst@gmail.com>
10662
10663         * image.c, metadata-internals.h: Added a generic_class_cache hash
10664         to MonoImage for looking up generic classes when sharing generics.
10665
10666 Thu Nov 15 16:11:30 CET 2007 Paolo Molaro <lupus@ximian.com>
10667
10668         * sgen-gc.c: warning cleanups.
10669
10670 2007-11-15  Zoltan Varga  <vargaz@gmail.com>
10671
10672         * icall.c (ves_icall_Type_GetPropertiesByName): Implement proper hiding of
10673         inherited properties.
10674
10675 2007-11-14  Mark Probst  <mark.probst@gmail.com>
10676
10677         * object.c, class-internals.h: Added more information to the
10678         runtime generic context.
10679
10680 2007-11-13  Zoltan Varga  <vargaz@gmail.com>
10681
10682         * marshal.c (mono_marshal_get_delegate_invoke): Take a delegate as argument
10683         instead of just the target method. Generalize the abstract method handling to
10684         handle any non-static method.
10685
10686         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Update after
10687         mono_marshal_get_delegate_invoke () signature change.
10688
10689 2007-11-13  Mark Probst  <mark.probst@gmail.com>
10690
10691         * class.c, class-internals.h: Made
10692         mono_type_get_basic_type_from_generic () public.  Fixed member
10693         access check for shared generics.
10694
10695         * loader.c: Don't insert field into field cache if it's part of a
10696         non-inflated generic class.
10697
10698         * domain.c, domain-internals.h: The generic sharing context is now
10699         part of the jit info data structure.  Added two accessor
10700         functions.
10701
10702 2007-11-12  Zoltan Varga  <vargaz@gmail.com>
10703
10704         * marshal.c (mono_marshal_get_runtime_invoke): Create a non-shared wrapper for
10705         the array Get/Set/Address methods, since the JIT inlines them.
10706
10707         * metadata-internals.h (MonoImage): Add 'runtime_invoke_direct_cache'.
10708
10709         * image.c (mono_image_close): Free runtime_invoke_direct_cache.
10710         (mono_image_init): Initialize runtime_invoke_direct_cache.      
10711
10712         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Update after
10713         mono_marshal_get_delegate_invoke signature change.
10714
10715         * marshal.c (mono_marshal_get_delegate_invoke): Receive the target_method as
10716         an additional argument. Add support for invoking abstract methods.
10717
10718         * metadata-internals.h (MonoImage): Add 'delegate_abstract_invoke_cache'.
10719
10720         * image.c (mono_image_close): Free delegate_abstract_invoke_cache.      
10721
10722 2007-11-09  Mark Probst  <mark.probst@gmail.com>
10723
10724         * class.c: Do field layout for open generic classes as well.
10725
10726 2007-11-09  Mark Probst  <mark.probst@gmail.com>
10727
10728         * gc.c, gc-internal.h: Don't finalize threadpool threads with
10729         other objects, because the threadpool is still around.  Put them
10730         in a list instead and after finalizing all other objects in the
10731         root domain shut down the thread pool and then finalize the
10732         threads.  Fixes bug #337383.
10733
10734         * threads.c, thread-types.h: New mono_thread_create_internal()
10735         function for marking a thread with the threadpool flag before it
10736         started.  Set synch_cs to NULL after freeing it.
10737
10738         * threadpool.c: Mark threadpool threads before they start.
10739
10740 Thu Nov 8 15:31:21 CET 2007 Paolo Molaro <lupus@ximian.com>
10741
10742         * reflection.h, reflection.c: don't export random functions
10743         and lazy load dbnull and missing objects.
10744
10745 2007-11-07  Jonathan Chambers <joncham@gmail.com>
10746
10747         * class.c: Initialize COM types if COM interfaces
10748         are present (not just COM classes).
10749         
10750         Code is contributed under MIT/X11 license.
10751
10752 2007-11-07  Massimiliano Mantione  <massi@ximian.com>
10753         * reflection.c:
10754         create_dynamic_mono_image: hook module profiler events (dynamic case).
10755         mono_image_basic_init: hook assembly profiler events (dynamic case).
10756
10757 2007-11-07  Massimiliano Mantione  <massi@ximian.com>
10758         * profiler.c:
10759         simple_appdomain_unload: completely terminate the profiler
10760         instead of only processing the statistical samples.
10761         simple_shutdown: make sure this is really called exactly once,
10762         even in multithreaded applications, and always listen to
10763         appdomain events.
10764         * gc.c (mono_domain_finalize): don't call mono_profiler_appdomain_event
10765         here, the "[un]load" functions will do it.
10766         Fixes bugs #333791 and #325261.
10767
10768 2007-11-07  Geoff Norton  <gnorton@novell.com>
10769
10770         * socket-io.c:  Use the configure defines for HAVE_SOCKADDR_IN(6)_SIN_LEN
10771         rather than depend on __APPLE__.
10772
10773 2007-11-07  Mark Probst  <mark.probst@gmail.com>
10774
10775         * icall.c: Safety checks in InitializeArray.  Fixes bug #324535.
10776
10777 2007-11-06  Sebastien Pouliot  <sebastien@ximian.com> 
10778
10779         * object.c: Fix mono_string_to_utf8 to handle NULL values inside the
10780         UTF16 MonoString. Fix the crash from bug #335488
10781
10782 2007-11-06  Sebastien Pouliot  <sebastien@ximian.com>
10783
10784         * marshal.c: Correct (for non-Win32 OS) length != size in 
10785         mono_string_from_bstr. Fix #339530.
10786
10787 2007-11-06  Geoff Norton  <gnorton@novell.com>
10788
10789         * socket-io.c: Apple requires sin(6)_len to be set for getnameinfo
10790         to succeed
10791
10792 2007-11-05  Kornél Pál  <kornelpal@gmail.com>
10793
10794         * process.c: Added run-time GetProcessId API detection for Windows.
10795
10796 2007-11-04  Miguel de Icaza  <miguel@novell.com>
10797
10798         * reflection.c  (mono_param_get_objects): If a parameter has the
10799         attribute [System.Runtime.InteropServices.Optional] we should
10800         set the DefaultValue of the ParameterInfo to be
10801         System.Reflection.Missing instead of DBNull.
10802
10803         See bug #339013.
10804
10805         (mono_get_reflection_missing_object): New method,
10806         returns the System.Reflection.Missing.Value singleton instance.
10807
10808 2007-11-03  Atsushi Enomoto  <atsushi@ximian.com>
10809
10810         * culture-info-table.h : regenerated.
10811
10812 2007-11-02  Jonathan Chambers <joncham@gmail.com>
10813
10814         * icall.c: Use GetEnvironmentStrings on windows
10815         so we are using the same environment block as 
10816         GetEnvironmentVariable/SetEnvironmentVariable. Fixes
10817         #333740.
10818         
10819         Code is contributed under MIT/X11 license.
10820
10821 2007-10-31  Martin Baulig  <martin@ximian.com>
10822
10823         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 64.
10824
10825         * mono-debug-debugger.h
10826         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_TRAMPOLINE'.
10827
10828 2007-10-30  Zoltan Varga  <vargaz@gmail.com>
10829
10830         * reflection.c (mono_custom_attrs_from_class): Add support for dynamic inflated 
10831         classes.
10832
10833 2007-10-30  Atsushi Enomoto  <atsushi@ximian.com>
10834
10835         * culture-info-table.h : regenerated.
10836
10837 2007-10-30  Robert Jordan  <robertj@gmx.net>
10838
10839         * icall-def.h, icall.c:
10840         Add ves_icall_Remoting_RemotingServices_GetVirtualMethod ().
10841
10842         Code is contributed under MIT/X11 license.
10843
10844 2007-10-29  Zoltan Varga  <vargaz@gmail.com>
10845
10846         * class.c (mono_class_setup_vtable): Find the inflated methods in the
10847         inflated class instead of inflating them again.
10848         
10849         * class.c (mono_class_setup_vtable): Inflate the override methods in the 
10850         dynamic case.
10851
10852         * class.c (mono_generic_class_get_class): Set klass->property.count as well.
10853         Call setup_supertypes () after klass->parent is set.
10854         (mono_class_setup_properties): Enable this to work on dynamic generic classes.
10855
10856         * reflection.c (mono_type_get_object): Only return a MonoGenericClass object
10857         for inflated instances of not yet created dynamic generic classes.
10858         (ctorbuilder_to_mono_method): Handle the case when this is called multiple
10859         times from inflated_method.
10860         (methodbuilder_to_mono_method): Ditto.
10861
10862 Mon Oct 29 21:02:53 CET 2007 Paolo Molaro <lupus@ximian.com>
10863
10864         * gc.c: code cleanup and removed old untested option of not creating the
10865         finalizer thread.
10866
10867 2007-10-29  Zoltan Varga  <vargaz@gmail.com>
10868
10869         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Avoid
10870         creating a jump trampoline for dynamic methods.
10871
10872 2007-10-29 Rodrigo Kumpera <rkumpera@novell.com>
10873
10874         * reflection.c (mono_image_create_token): Correctly encode methods and constructors of
10875         generic TypeBuilders when called from another method of the same type (bug #335131).
10876
10877
10878 2007-10-27  Zoltan Varga  <vargaz@gmail.com>
10879
10880         * reflection.c (methodbuilder_to_mono_method): Revert the last change as it
10881         doesn't seem to work perfectly.
10882         
10883         * reflection.c (ctorbuilder_to_mono_method): Handle the case when this is
10884         called multiple times.
10885         (methodbuilder_to_mono_method): Ditto.
10886         (resolve_object): Inflate FieldBuilder's.
10887
10888 Fri Oct 26 19:38:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
10889
10890         * string-icalls.c, string-icalls.h, appdomain.c: patch from
10891         Tyler Larson <mono-devel@tlarson.com> to fix the handling of
10892         RemoveEmptyEntries in the string.Split implementation (bug #322375).
10893
10894 2007-10-26  Dick Porter  <dick@ximian.com>
10895
10896         * appdomain.c (MONO_CORLIB_VERSION): Bump version because of
10897         Thread initialisation changes
10898
10899 2007-10-26 Rodrigo Kumpera <rkumpera@novell.com>
10900
10901         * verify.c: fix compatibility check between arrays and System.Array
10902
10903 2007-10-26  Zoltan Varga  <vargaz@gmail.com>
10904
10905         * reflection.c (mono_reflection_get_custom_attrs_info): Handle MonoGenericClass
10906         too. Fixes #336999.
10907
10908 2007-10-25  Zoltan Varga  <vargaz@gmail.com>
10909
10910         * object.c (mono_value_box): Use typed allocation here.
10911
10912 2007-10-23  Zoltan Varga  <vargaz@gmail.com>
10913
10914         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Create a jump
10915         trampoline instead of compiling the method right away.
10916
10917         * class-internals.h object.c: Add a JIT callback to create a jump trampoline.
10918
10919 2007-10-21  Zoltan Varga  <vargaz@gmail.com>
10920
10921         * class.c (mono_generic_class_get_class): Avoid setting klass->size_inited and
10922         related fields for dynamic classes. Fixes #334493.
10923
10924 2007-10-20  Zoltan Varga  <vargaz@gmail.com>
10925
10926         * class.c (mono_generic_class_get_class): Set klass->field.count as well.
10927         
10928         * class.c (mono_class_layout_fields): Use 1 instead of TRUE for consistency.
10929
10930         * class.c (mono_class_layout_fields): Set size_inited for generic classes as well.
10931         (mono_class_setup_vtable): Obtain overrides for dynamic generic classes correctly.
10932
10933         * class.c (mono_class_setup_methods): Handle dynamic inflated classes correctly.
10934
10935         * reflection.c (create_generic_typespec): Initialize klass->generic_container
10936         if needed.
10937         (reflection_methodbuilder_to_mono_method): Set container->is_method to TRUE.
10938
10939 2007-10-18  Jonathan Chambers <joncham@gmail.com>
10940
10941         * marshal.c: Use correct key when removing item
10942         from ccw_hash.
10943         
10944         Code is contributed under MIT/X11 license.
10945
10946 2007-10-17  William Holmes  <billholmes54@gmail.com>
10947
10948         *marshal.c: Adding a case to marshal booleans to U1
10949
10950         Code is contributed under MIT/X11 license.
10951
10952 2007-10-18  Zoltan Varga  <vargaz@gmail.com>
10953
10954         * class.c (mono_class_from_name): Search the modules compromising dynamic
10955         assemblies. Fixes #331601.
10956
10957 2007-10-16  Zoltan Varga  <vargaz@gmail.com>
10958
10959         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Throw an
10960         exception if the type name contains an assembly component. Fixes #334203.
10961
10962         * reflection.c (mono_reflection_get_type_with_rootimage): Search all the
10963         modules inside dynamic assemblies. Fixes #334200.
10964         
10965         * reflection.c: Set image->public_key and image->public_key_length;
10966
10967         * metadata-internals.h (MonoDynamicImage): Add public_key and public_key_len
10968         fields.
10969
10970         * image.c (mono_image_get_public_key): Handle dynamic assemblies. Fixes #334173.        
10971         
10972 2007-10-16  Mark Probst  <mark.probst@gmail.com>
10973
10974         * metadata.c: Implemented correct comparing of generic classes.
10975         An inflated generic class can be equal to a non-inflated one if it
10976         is inflated with generic type variables as type arguments.  Fixes
10977         bug #333798.
10978
10979 2007-10-15  Dick Porter  <dick@ximian.com>
10980
10981         * monitor.c (mono_monitor_try_enter_internal): Set thread state to
10982         WaitSleepJoin while it is waiting to acquire a lock.  Fixes bug
10983         81646.
10984
10985         * threads.c: Turn the thread synch_lock into a CRITICAL_SECTION,
10986         instead of a monitor lock.  This means that monitor_try_enter and
10987         co can set the thread state safely.
10988         (ves_icall_System_Threading_Thread_Interrupt_internal): Always set
10989         thread_interrupt_requested, so interrupt actually works.
10990
10991         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal,
10992         ves_icall_System_Net_Sockets_Socket_Select_internal): Use thread
10993         state accessor function
10994
10995 2007-10-15  Martin Baulig  <martin@ximian.com>
10996
10997         * mono-debug.h
10998         (MONO_DEBUGGER_VERSION): Bump to 63 to make it impossible to use
10999         the debugger with the current runtime.
11000
11001 Mon Oct 15 10:20:56 CEST 2007 Paolo Molaro <lupus@ximian.com>
11002
11003         * object.c, object-internals.h: added the ability to set a single
11004         trampoline for all the slots in a vtable.
11005
11006 Fri Oct 12 17:50:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
11007
11008         * marshal.c: deal with a possible race condition during multicast
11009         delegate invocation.
11010
11011 Fri Oct 12 13:31:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
11012
11013         * class.c: ensure value type methods don't have the synchronized
11014         flag set.
11015
11016 Fri Oct 12 08:10:59 CEST 2007 Paolo Molaro <lupus@ximian.com>
11017
11018         * string-icalls.c, string-icalls.h: reverted unapproved patch that
11019         breaks the build.
11020
11021 2007-10-11  Joel Reed  <joelwreed@comcast.com>
11022
11023         * string-icalls.c, string-icalls.h: modify System_String_InternalSplit
11024         to take an options parameter so that empty entries can be removed during
11025         the split procedure. Patch from: Tyler Larson <mono-devel@tlarson.com>
11026
11027 Thu Oct 11 20:16:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
11028
11029         * marshal.c: make sure we don't store the signature from a dynamic
11030         method into the runtime invoke cache (bug #327189).
11031
11032 Thu Oct 11 18:22:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
11033
11034         * marshal.c: make sure the wrapper methods are properly initialized.
11035
11036 2007-10-11  Mark Probst  <mark.probst@gmail.com>
11037
11038         * metadata.c, metadata-internals.h: Generalized
11039         mono_type_stack_size() to mono_type_stack_size_internal() which
11040         takes an additional argument specifying whether it allows open
11041         types.
11042
11043 2007-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
11044
11045         * verify.c (do_invoke_method): handle typedbyref params
11046         correctly and check for unverifiable return values.
11047
11048         * verify.c (do_newobj): fix a warning.
11049
11050 2007-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
11051
11052         * verify.c: don't tread typedbyref as allways unverifable,
11053         so uses, like (ld/st)loc.0 are valid. verify for the cases
11054         that it matters, like boxing related operations.
11055
11056 2007-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
11057
11058         * verify.c: add verification of the newobj opcode. verification
11059         of delegate instantation still missing due ldftn and virldftn not
11060         pushing the function type on stack
11061
11062 2007-10-08  Mark Probst  <mark.probst@gmail.com>
11063
11064         * class-internals.h: Runtime generic context data structure
11065         definition.
11066
11067         * object.c: Initialization of runtime generic context at runtime
11068         vtable creation time.
11069
11070 2007-10-08  Massimiliano Mantione  <massi@ximian.com>
11071         * class.c (mono_class_create_from_typedef,
11072         mono_class_from_generic_parameter, mono_ptr_class_get,
11073         mono_fnptr_class_get, mono_bounded_array_class_get)
11074         * domain.c (mono_domain_create, mono_domain_free)
11075         * assembly.c (mono_assembly_load_from_full, mono_assembly_close)
11076         * image.c (do_mono_image_load, mono_image_close):
11077         Hooked up load-unload profiler events.
11078
11079 Mon Oct 8 11:38:04 CEST 2007 Paolo Molaro <lupus@ximian.com>
11080
11081         * domain.c: track statistics about the actual amount of native code
11082         allocated.
11083
11084 Sat Oct 6 10:01:42 CEST 2007 Paolo Molaro <lupus@ximian.com>
11085
11086         * class.c: the valuetype enumerators don't have the additional
11087         supertypes interfaces.
11088
11089 Fri Oct 5 20:33:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
11090
11091         * class.c: need more interfaces setup for the IEnumerator<T>
11092         object created for arrays (tests/ienumerator-interfaces.2.cs).
11093
11094 2007-10-05  Zoltan Varga  <vargaz@gmail.com>
11095
11096         * class.c (mono_ldtoken): Handle methodspec tokens as well. Fixes #331097.
11097
11098 2007-10-05  Alp Toker  <alp@atoker.com>
11099
11100         * icall.c (ves_icall_MonoType_GetElementType): For enums, return null
11101         rather than the underlying type. Based on a patch by Ben Maurer. Fixes
11102         #315863.
11103
11104 2007-10-04  Rodrigo Kumpera  <rkumpera@novell.com>
11105
11106         * verify.c (verify_type_compatibility_full): verification of
11107         compatibility improved, validates correctly non-strict checks between
11108         native int and I4 types different than (unsigned)int32.
11109
11110         * verify.c (do_store_indirect): added, do all verification of
11111         ldind.X opcodes. 
11112
11113         * verify.c (get_load_indirect_mono_type): renamed to
11114         get_indirect_op_mono_type, as it now returns the MonoType for 
11115         ldind.X and stind.X opcodes.
11116
11117 2007-10-04  Rodrigo Kumpera  <rkumpera@novell.com>
11118
11119         * reflection.c: Fix the encoding of generic type definition for
11120         TypeBuilders.
11121
11122         * reflection.c (mono_image_typedef_or_ref_full: do the same thing as
11123         mono_image_typedef_or_ref but allows to specify if typespec lookups should
11124         be made. Typespec check is done prior to typeref cache lookup.
11125
11126         * reflection.c (mono_image_typedef_or_ref): now just delegate to
11127         mono_image_typedef_or_ref_full.
11128
11129         * reflection.c (encode_generic_class): encode the generic class
11130         directly instead of calling encode_type.
11131
11132         * reflection.c (encode_type): encode the generic type definition
11133         MonoClass as a generic instantiation.
11134
11135         * reflection.c (create_typespec): cache typespec tokens in
11136         the assembly->typespec cache. Don't create typespec for a generic
11137         instance MonoClass. Create typespec for the generic type defintion.
11138
11139         * reflection.c (create_generic_typespec): encode the generic
11140         class directly instead of calling encode_type.
11141
11142         * reflection.c (mono_image_create_token): encode the generic
11143         type definition not using a typespec for MonoType instances.
11144
11145
11146 2007-10-04  Raja R Harinath  <rharinath@novell.com>
11147
11148         Fix #328812
11149         * class.c (mono_image_init_name_cache): Don't return nested
11150         'protected internal' classes.
11151         (mono_class_from_name_case): Likewise.
11152
11153 2007-10-04  Atsushi Enomoto  <atsushi@ximian.com>
11154
11155         * icall-def.h, icall.c : get_bundled_machine_config() is now the
11156           common function used by both DefaultConfig in System.dll and
11157           InternalConfigurationHost in System.Configuration.dll.
11158
11159 Wed Oct 3 17:26:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
11160
11161         * class.c: automatically add to vectors only a few essential explicit
11162         generic interfaces. The rest of the interfaces that arrays should
11163         provide are currently implicitly added (but still not lazily, see the
11164         design in the discussion of bug#325495 for the details of what is
11165         needed for that). Additionally, implicit interfaces are assigned the
11166         same vtable slot as the explicit interfaces (as they are compatible):
11167         this enables huge memory savings since we don't need to instantiate
11168         as many memthods and as large vtables anymore. Also, Since
11169         GetEnumerator<T> returns an instance of a type that is required to
11170         support a similarly large set of interfaces as arrays, we add
11171         implicit interfaces and interface offset sharing support to those
11172         types, too. This change adds all the required interfaces so that
11173         the anonarray.cs test case in the bug report works (we don't add
11174         all the interfaces to arrays of arrays 3-level deep and more because
11175         of the memory requirements explained in the bug and since they are much
11176         less common: the lazy-loading support will enabled them to work, too).
11177
11178 2007-10-02  Rodrigo Kumpera  <rkumpera@novell.com>
11179
11180         * verify.c (merge_stacks): major clean up, all type compatibility
11181         checks are done by verify_type_compatibility. This fix my earlier lack
11182         of understanding of the CLR type system and merge_stacks no longer looks
11183         scary.
11184
11185         * verify.c: fixed some bad spelling.
11186
11187 2007-10-02  Rodrigo Kumpera  <rkumpera@novell.com>
11188
11189         * verify.c (mono_type_from_stack_slot): added. returns the MonoType for
11190         a given stack slock.
11191         
11192         * verify.c: killed verify_type_compat in favor of verify_type_compatibility and
11193         verify_type_compatibility_full. This removed a near indentical function and fixed
11194         handling of Int32 and IntPtr across all opcodes.
11195
11196 Tue Oct 2 15:24:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
11197
11198         * class.c: only vectors have the additional generic interfaces.
11199
11200 2007-10-01  Jonathan Chambers <joncham@gmail.com>
11201
11202         * mono-config.c: Use g_strcasecmp instead of
11203         strcasecmp like everywhere else to fix
11204         compilation with MSVC.
11205         
11206         Code is contributed under MIT/X11 license.
11207
11208 Mon Oct 1 14:39:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
11209
11210         * object.c, object-internals.h: refactored the IMT code to enable
11211         building a single slot at a time and lazily creating the IMT trampolines
11212         and thunks.
11213
11214 2007-09-29  Zoltan Varga  <vargaz@gmail.com>
11215
11216         * loader.c (inflate_generic_signature): Allocate inflated signatures from the heap.
11217
11218         * metadata.c (mono_metadata_free_inflated_signature): Free the signature itself too.
11219         Fixes #328501.
11220         
11221 2007-09-29  Raja R Harinath  <harinath@gmail.com>
11222
11223         * loader.c (method_from_methodspec): Rearrange to avoid
11224         un-necessary exposition.  Don't assert out if the method's
11225         declaring type is a generic type definition.
11226
11227 2007-09-28  Martin Baulig  <martin@ximian.com>
11228
11229         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 61.
11230
11231 Fri Sep 28 20:15:47 CEST 2007 Paolo Molaro <lupus@ximian.com>
11232
11233         * class-internals.h: optimize field layout of MonoClass to
11234         requires less cachelines at runtime and save a few bytes on 64 bit
11235         systems.
11236
11237 2007-09-28  Jb Evain  <jbevain@novell.com>
11238
11239         * reflection.c: when encoding type names in custom attributes,
11240         if the type is a closed generic type, its generic arguments
11241         have to be serialized as AssemblyQualifiedName, so that when
11242         they are deserialized, it's possible to re-create them properly.
11243         Fixes #329450.
11244
11245
11246 Fri Sep 28 19:19:49 CEST 2007 Paolo Molaro <lupus@ximian.com>
11247
11248         * object.c, class-internals.h: added delegate-creation counter.
11249
11250 Fri Sep 28 18:07:53 CEST 2007 Paolo Molaro <lupus@ximian.com>
11251
11252         * class.c: cleanup of the code that synthetizes interfaces for
11253         arrays in 2.0: saves quit a bit of corlib mempool memory.
11254         Code to fix bug #325495 ifdeffed out for now until the issues
11255         with memory usage and O(n^2) behaviour are fixed.
11256
11257 Fri Sep 28 17:19:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
11258
11259         * marshal.c: when possible, do not duplicate the name of the methods
11260         in the method builder and in the generated MonoMethod.
11261
11262 2007-09-27  Rodrigo Kumpera  <rkumpera@novell.com>
11263         * verify.c: added support for type checking ldind_* opcodes.
11264
11265 2007-09-27  Rodrigo Kumpera  <rkumpera@novell.com>
11266
11267         * class-internals.h (struct _MonoGenericClass): new field is_tb_open
11268         which is used to distinguish the fully open instantiation of a TypeBuilder
11269         with the rest. This temporary hack is required to restore the property that
11270         the fully open instantiation is the same type of the generic type definition.
11271
11272         * class-internals.h (mono_generic_class_is_generic_type_definition):
11273         new function as part of the internal API.
11274
11275         * class.c (inflate_generic_type): return NULL when the generic inst is
11276         fully open. The fully open generic type is now the same as the generic type
11277         definition for non TypeBuilder types.
11278
11279         * class.c (mono_generic_class_get_class): removed assert since it is
11280         no longer valid, gklass->cached_class can point to the generic type definition.
11281
11282         * class.c (mono_generic_class_is_generic_type_definition): new.
11283
11284         * metadata.c (mono_generic_class_hash): added is_tb_open field
11285         to the hash calculation.
11286
11287         * metadata.c (free_generic_class): if the generic class is associated
11288         with the generic type definition, its field will come from the mempool and
11289         must not be freed.
11290
11291         * metadata.c (mono_metadata_is_type_builder_generic_type_definition):
11292         new, this function identifies the corner case of a TypeBuilder fully open
11293         instantiation.
11294
11295         * metadata.c (mono_metadata_lookup_generic_class): use is_tb_open
11296         for lookup. Set gclass->cached_class to be the container class in case of
11297         the fully open instantiation of non TypeBuilder types.
11298
11299         * metadata.c (_mono_metadata_generic_class_equal): use is_tb_open
11300         to compare generic classes.
11301
11302         * reflection.c (method_encode_methodspec): remove assert that
11303         no longer is valid.
11304
11305         * reflection.c (mono_reflection_generic_class_initialize): add
11306         an aditional assert to ensure the proper type is used.
11307
11308 2007-09-26  Rodrigo Kumpera  <rkumpera@novell.com>
11309
11310         * verify.c: disabled all debug spew by default, define MONO_VERIFIER_DEBUG
11311         to enjoy it.
11312
11313 2007-09-25  Rodrigo Kumpera  <rkumpera@novell.com>
11314
11315         * verify.c (push_arg): Fixed support for ldarga
11316         * verify.c (set_stack_value): Removed superfluous parameter, fixed the
11317         MonoType used as first arg in case of instance calls.
11318
11319 2007-09-25  Rodrigo Kumpera  <rkumpera@novell.com>
11320
11321         * verify.c: Support for verifying VAR and MVAR types, 
11322
11323 2007-09-25  Zoltan Varga  <vargaz@gmail.com>
11324
11325         * icall.c (ves_icall_get_property_info): Set the reflected type of the
11326         accessors correctly.
11327
11328 Tue Sep 25 14:56:03 CEST 2007 Paolo Molaro <lupus@ximian.com>
11329
11330         * threads.c: support OSX and other systems in
11331         mono_thread_get_stack_bounds (bug #328026).
11332
11333 2007-09-25  Martin Baulig  <martin@ximian.com>
11334
11335         * mono-debug.h
11336         (MonoDebugVarInfo): Replace `MonoClass *klass' with `MonoType *type'.
11337
11338 2007-09-24  Martin Baulig  <martin@ximian.com>
11339
11340         * mono-debug.h
11341         (MonoDebugClassEntry): Moved the definition of this struct into
11342         mono-debug.c to make it private.
11343
11344         * mono-debug.c
11345         (MonoDebugClassEntry): Removed `symfile_id'; since we now use one
11346         type table per symbol file, we don't need to store the symfile id
11347         any longer.
11348
11349 2007-09-24  Martin Baulig  <martin@ximian.com>
11350
11351         Create one type table per symbol file, since a `MonoClass *' gets
11352         invalid when its image is unloaded.
11353
11354         * mono-debug.h (MonoSymbolTable): Removed `type_table'.
11355         (MonoDebugHandle): Added `type_table'.
11356
11357 Mon Sep 24 17:25:43 CEST 2007 Paolo Molaro <lupus@ximian.com>
11358
11359         * mempool.c, mempool.h: added mono_mempool_new_size () API
11360         to be able to specify a smaller initial size for the pool.
11361         Adjusted the code to slowly increase pool size before using
11362         the previous default size.
11363         * image.c: use a small initial size for image mempools.
11364
11365 2007-09-23  Zoltan Varga  <vargaz@gmail.com>
11366
11367         * marshal.c (emit_marshal_array): Generate valid IL for byref array case.
11368         Fixes ##320990.
11369
11370         * icall.c (ves_icall_System_Reflection_Assembly_get_ManifestModuleInternal): 
11371         Rename this to ves_icall_System_Reflection_Assembly_GetManifestModuleInternal.
11372
11373 2007-09-22  Zoltan Varga  <vargaz@gmail.com>
11374
11375         * metadata.c (mono_type_create_from_typespec): Remove an invalid
11376         free. Fixes #327438.
11377
11378 2007-09-21  Raja R Harinath  <harinath@gmail.com>
11379
11380         * metadata.c (type_in_image) <MONO_TYPE_SZARRAY>: Handle arrays of
11381         generic instantiations, etc.
11382         <MONO_TYPE_ARRAY>: Likewise.
11383
11384 2007-09-21  Martin Baulig  <martin@ximian.com>
11385
11386         * mono-debug.h (MonoSymbolFilePriv, MonoDebugHandlePriv): Removed;
11387         these structs were never defined.
11388         (MonoDebugHandle): Removed the `_priv' field, it was never used.
11389
11390 2007-09-21  Martin Baulig  <martin@ximian.com>
11391
11392         * mono-debug.h (MonoDebugVarInfo): Add `MonoClass *klass'.
11393
11394 Fri Sep 21 14:39:45 CEST 2007 Paolo Molaro <lupus@ximian.com>
11395
11396         * image.c: removed the guid hash tables: we can get the same info
11397         without the additional memory usage hit (partially fixes also bug #327052).
11398
11399 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
11400
11401         * profiler.h, profiler-private.h, profiler.c: add a new profiler
11402         event to handle unloading methods. After the event is called, the
11403         corresponding MonoMethod* must be considered invalid.
11404         * loader.c (mono_free_method): call the new mono_profiler_method_free
11405         event.
11406
11407 2007-09-20  Mark Probst  <mark.probst@gmail.com>
11408
11409         * domain-internals.h: New flag in MonoJitInfo which marks shared
11410         generic methods.  New hash table (shared_generics_hash) in
11411         MonoDomain to keep track of shared generic methods.  Prototypes
11412         for functions to register and lookup shared generic methods.
11413
11414         * domain.c: Support for registering and looking up shared generic
11415         methods via a hash table (shared_generics_hash) in MonoDomain.
11416
11417         * class-internals.h: New exception to signal failure of shared
11418         compilation of a generic method.  New counters for generics
11419         sharing in MonoStats.
11420
11421 Thu Sep 20 16:59:36 CEST 2007 Paolo Molaro <lupus@ximian.com>
11422
11423         * image.c, metadata-internals.h: don't keep a file descriptor open
11424         for loaded assemblies (bug#325988).
11425
11426 2007-09-19  Raja R Harinath  <rharinath@novell.com>
11427
11428         * metadata.c (signature_in_image): New.  Carve out of type_in_image.
11429         (ginst_in_image, gclass_in_image): Simplify.  Change signature to
11430         use the corresponding datatypes.
11431         (type_in_image): Update to changes.
11432         (CleanForImageUserData): Simplify.
11433         (steal_gclass_in_image): Carved out of old 'gclass_in_image'.
11434         Avoid quadratic behaviour in handling the "stolen" list by
11435         separating the filter predicate out, and by prepending the stolen
11436         items rather than appending them.
11437         (steal_ginst_in_image): Likewise.
11438         (mono_metadata_clean_for_image): Update to changes.
11439
11440 2007-09-19  Martin Baulig  <martin@ximian.com>
11441
11442         * domain.c (mono_cleanup): Call mono_debug_cleanup() here.
11443
11444 2007-09-19  Martin Baulig  <martin@ximian.com>
11445
11446         * mono-debug.c (mono_debug_cleanup): Don't call
11447         mono_debugger_cleanup(); this is now called earlier from mini_cleanup().
11448
11449 2007-09-19  Raja R Harinath  <harinath@gmail.com>
11450
11451         Fix crash on 'make run-test' in mcs/errors
11452         * metadata.c (type_in_image): New.  Carve out of ginst_in_image.
11453         Avoid more potential allocations in mono_class_from_mono_type.
11454         (ginst_in_image): Update to changes.
11455         (gclass_in_image): Rearrange slightly.
11456
11457 2007-09-18  Zoltan Varga  <vargaz@gmail.com>
11458
11459         * class.c (mono_class_init): Move the code that sets up class->methods to 
11460         mono_class_setup_methods () for inflated generic classes too. Ditto for properties.
11461
11462         * metadata.c (mono_metadata_get_inflated_signature): New function to return a
11463         canonical instance of an inflated generic signature.
11464         (mono_type_create_from_typespec): Remove an invalid free.
11465
11466         * loader.c (mono_method_get_signature_full): Use mono_metadata_get_inflated_signature.  
11467
11468 2007-09-18  Marek Habersack  <mhabersack@novell.com>
11469
11470         * domain-internals.h: added a declaration of the
11471         mono_assembly_load_full_nosearch internal function.
11472
11473         * assembly.c (mono_assembly_load_with_partial_name): use
11474         mono_try_assembly_resolve return value properly.
11475         (mono_assembly_load_full_nosearch): copied the function body from
11476         mono_assembly_load_full, without the code to invoke assembly
11477         search hooks.
11478         (mono_assembly_load_full): calls the above new function and if the
11479         assembly is not resolved, invokes the search hooks.
11480
11481         * appdomain.c (mono_runtime_init): restore the global postload
11482         assembly search handlers.
11483
11484 2007-09-18  Zoltan Varga  <vargaz@gmail.com>
11485
11486         * class.c (mono_class_init): Make sure class->methods and class->properties
11487         are never NULL in the generics case.
11488
11489         * metadata.c (free_generic_class): Enable this again, skip the dynamic case.
11490
11491 2007-09-17  Zoltan Varga  <vargaz@gmail.com>
11492
11493         * metadata.c (free_generic_class): Disable some code to fix the build.
11494
11495         * domain.c (mono_cleanup): Fix a crash introduced by a previous patch.
11496
11497         * marshal.c (mono_marshal_get_xappdomain_dispatch): Allocate a piece of data
11498         from the image mempool.
11499
11500         * metadata.c (free_generic_class): Free more data from the inflated class.
11501
11502         * class.c (mono_class_from_generic_parameter): Allocate memory from the mempool.
11503
11504         * metadata.c (mono_metadata_parse_generic_param): Allocate memory from the image
11505         mempool.
11506         (mono_type_create_from_typespec): Ditto.
11507
11508         * domain.c (get_runtimes_from_exe): Add an out parameter to return the opened
11509         MonoImage to the caller.
11510         (mono_init_internal): Save the opened image in a global variable.
11511         (mono_cleanup): Close the image opened in get_runtimes_from_exe.
11512
11513         * reflection.c (resolve_object): Fix a leak.
11514
11515         * metadata.c: Fix the freeing of data in the generics caches.
11516         
11517         * metadata.c (free_generic_inst): Comment this out to fix the build.
11518         (free_generic_class): Ditto.
11519
11520         * metadata.c: Free cached generic methods, instantinations and classes when
11521         they are removed from the caches.
11522         (mono_metadata_free_type): Free the type itself.
11523
11524         * class.c: Free the result of mono_class_inflate_generic_type () in a few
11525         places.
11526
11527 Mon Sep 17 16:14:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
11528
11529         * boehm-gc.c: restrict managed allocs to __thread supporting
11530         architectures.
11531
11532 2007-09-16  Zoltan Varga  <vargaz@gmail.com>
11533
11534         * class.c (mono_class_inflate_generic_type): Add a comment describing memory ownership.
11535         (mono_generic_class_get_class): Fix a leak.
11536
11537         * metadata.c (do_mono_metadata_parse_type): Remove an unneccesary call to
11538         mono_metadata_free_type ().
11539         (mono_metadata_inflate_generic_inst): Fix a leak.
11540
11541 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
11542
11543         * mono-debug.c (free_header_data): Fix a leak missed earlier.
11544
11545         * metadata.c (mono_metadata_parse_array_full): Allocate memory from the image
11546         mempool.
11547
11548         * mono-debug.c (mono_debug_close_image): Fix call to 
11549         g_hash_table_remove ().
11550
11551 Fri Sep 14 19:36:37 CEST 2007 Paolo Molaro <lupus@ximian.com>
11552
11553         * icall-def.h: redirect all the string ctor to the managed
11554         CreateString () methods.
11555         * string-icalls.c, string-icalls.h: removed dead code for string
11556         ctors and icalls.
11557
11558 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
11559
11560         * mono-debug.c: Fix memory leaks.
11561
11562 2007-09-14  Jonathan Chambers <joncham@gmail.com>
11563
11564         * threads-types.h: Implement mono_hazard_pointer_set and 
11565         mono_hazard_pointer_clear macros using do/while(0) to fix
11566         compilation with MSVC.
11567         
11568         Code is contributed under MIT/X11 license.
11569
11570 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
11571
11572         * gc.c (ves_icall_System_GCHandle_GetAddrOfPinnedObject): Use a return value of
11573         -2 to communicate to managed code that the handle is not pinned. Fixes #82848.
11574
11575 Fri Sep 14 14:04:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
11576
11577         * icall-def.h, string-icalls.c: get rid of old, no longer used, string
11578         icalls.
11579
11580 Fri Sep 14 11:41:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
11581
11582         * boehm-gc.c, gc-internal.h, object.c: allow strings to be
11583         managed-code allocated as well.
11584
11585 2007-09-13  Zoltan Varga  <vargaz@gmail.com>
11586
11587         * class.c (mono_class_is_assignable_from): Add support for generic variance.
11588
11589 Thu Sep 13 11:55:55 CEST 2007 Paolo Molaro <lupus@ximian.com>
11590
11591         * boehm-gc.c: fixed the build after the AOT changes.
11592
11593 2007-09-13  Zoltan Varga  <vargaz@gmail.com>
11594
11595         * wrapper-types.h: Add an ALLOC wrapper type.
11596
11597         * gc-internals.h boehm-gc.c null-gc.c sgen-gc.c: Add functions needed by AOT to
11598         reference managed allocator methods.
11599
11600 2007-09-12  Marek Safar  <marek.safar@gmail.com>
11601
11602         * icall.c (ves_icall_MonoType_GetGenericArguments): Create an instance
11603         of Type array and not MonoType, a fix suggested by Hari.
11604         
11605 2007-09-12  Jonathan Chambers <joncham@gmail.com>
11606
11607         * domain-internals.h, domain.c : Remove delegate_invoke_impl_with_target_hash
11608         and delegate_invoke_impl_no_target_hash from _MonoDomain struct.
11609         
11610         Code is contributed under MIT/X11 license.
11611
11612 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
11613
11614         * domain.c, object.c, mono-config.c, object-internals.h: Fixed  #82416.
11615
11616 2007-09-12  Marek Habersack  <mhabersack@novell.com>
11617
11618         * image.c (do_mono_image_open): if assembly file fails to open and
11619         MONO_IOMAP is in effect, try to find the path in a
11620         case-insensitive way.
11621
11622         * appdomain.c (mono_runtime_init): do not install postload hooks -
11623         tests show that MS.NET doesn't use anything of that sort to
11624         trigger the AppDomain.AssemblyResolve event.
11625         (mono_try_assembly_resolve): renamed from try_assembly_resolve and
11626         made non-static.
11627         (mono_runtime_init): init portability helpers here.
11628
11629         * assembly.c (mono_assembly_load_with_partial_name): if other   
11630         attempts fail, trigger the AppDomain.AssemblyResolve event handler
11631         to resolve the assembly.
11632
11633         * domain-internals.h: added mono_try_assembly_resolve and marked
11634         it as internal.
11635
11636 2007-09-11  Jb Evain  <jbevain@novell.com>
11637
11638         * object-internals.h (MonoReflectionDynamicMethod): add
11639         a `MonoReflectionType *owner` field. The owner is used
11640         * reflection.c:
11641         (mono_reflection_create_dynamic_method): use the owner of the dynamic
11642         method as the class declaring the dynamic method.
11643         (reflection_methodbuilder_from_dynamic_method): copy the owner of the
11644         dynamic method to the declaring type of the methodbuilder.
11645
11646 2007-09-11  Mark Probst  <mark.probst@gmail.com>
11647
11648         * icall.c (ves_icall_InternalInvoke): Enforce CoreCLR security
11649         rules for calling methods via reflection.
11650
11651 2007-09-11  Zoltan Varga  <vargaz@gmail.com>
11652
11653         * reflection.c (resolve_object): Add support for MonoGenericClass. 
11654         Inflate MonoType's.
11655
11656 Tue Sep 11 16:08:08 CEST 2007 Paolo Molaro <lupus@ximian.com>
11657
11658         * gc-internal.h, boehm-gc.c, null-gc.c, sgen-gc.c: allow the GC to
11659         provide a managed method that does fast allocations without needing
11660         a managed->unmanaged transition. Boehm GC implementation currently
11661         enabled for ptrfree objects on sane architectures.
11662
11663 Tue Sep 11 16:00:35 CEST 2007 Paolo Molaro <lupus@ximian.com>
11664
11665         * marshal.c, marshal.h: exported a couple of useful functions and
11666         added mono_mb_get_label () to easily handle backward branches.
11667
11668 2007-09-10  Zoltan Varga  <vargaz@gmail.com>
11669
11670         * reflection.c (resolve_object): Inflate generic methods. Fixes #82782.
11671
11672 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
11673
11674         * loader.c (find_method): Fixed the regression introduced while
11675         fixing bug #81466.
11676
11677 2007-09-09  Zoltan Varga  <vargaz@gmail.com>
11678
11679         * class.c (mono_lookup_dynamic_token_class): Pass along the context here as
11680         well.
11681         
11682         * class.c loader.c metadata.c object.c class-internals.h object-internals.h
11683         icall.c reflection.c: Pass a MonoGenericContext argument to 
11684         mono_lookup_dynamic_token ().
11685
11686         * reflection.c (resolve_object): Handle GenericTypeParameterBuilder. Fixes
11687         #82744.
11688         
11689 2007-09-09  Robert Jordan  <robertj@gmx.net>
11690
11691         * object.c (mono_class_proxy_vtable): Don't create remoting trampolines
11692         for generic methods.
11693
11694         * object.c (mono_object_get_virtual_method): Handle generic methods.
11695         Fixes bug #78882.
11696
11697         Code is contributed under MIT/X11 license.
11698
11699 Sat Sep 8 18:16:01 CEST 2007 Paolo Molaro <lupus@ximian.com>
11700
11701         * image.c: fix locking in mono_image_load_file_for_image ().
11702
11703 Thu Sep 6 19:48:00 CEST 2007 Paolo Molaro <lupus@ximian.com>
11704
11705         * reflection.c, icall.c, icall-def.h: the methodinfos name field is
11706         used only as a cache: added an icall to fill it.
11707
11708 2007-09-16  Rodrigo Kumpera  <rkumpera@novell.com>
11709
11710         * reflection.h: exposed mono_reflection_free_type_info
11711         * reflection.c (mono_reflection_get_type_internal): type_args is always freed
11712         since mono_reflection_bind_generic_parameters makes a copy of it.
11713         * reflection.c (free_type_info): subinfos should be freed.
11714         * reflection.c (free_type_info): renamed to mono_reflection_free_type_info and 
11715         made non static.
11716         * icall.c (type_from_name and ves_icall_System_Reflection_Assembly_InternalGetType):
11717         replaced explicit cleanup of MonoTypeNameParse struct with a call to mono_reflection_free_type_info,
11718         this fixes #82695 and #81726.
11719    
11720
11721 2007-09-03  Atsushi Enomoto  <atsushi@ximian.com>
11722
11723         * process.h, process.c:  added support for user profile/info in
11724           ProcessStartInfo. For now only Windows works.
11725
11726 Fri Aug 31 17:30:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
11727
11728         * metadata.c: consider the generic arguments when comparing
11729         signatures (bug #82614).
11730
11731 Thu Aug 30 18:34:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
11732
11733         * cil-coff.h, image.c: updated assembly loader to cope with the
11734         PE32+ 64 bit file format.
11735
11736 Thu Aug 30 16:47:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
11737
11738         * assembly.c, class.c, domain.c, loader.c: remove useless
11739         inclusion of cil-coff.h.
11740
11741 2007-08-29  Jonathan Chambers  <joncham@gmail.com>
11742
11743         * marshal.c (cominterop_get_ccw): Walk up interface hierarchy
11744         if interface is marked with CoClassAttribute. 
11745    
11746         Code is contributed under MIT/X11 license.
11747
11748 Wed Aug 29 19:27:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
11749
11750         * sgen-gc.c: ensure no object from the to space is copied again or finalized
11751         if it's seen twice in major collections.
11752
11753 Wed Aug 29 18:46:49 CEST 2007 Paolo Molaro <lupus@ximian.com>
11754
11755         * sgen-gc.c: big objects are not copied to the gray area, but they
11756         need to be considered for scanning, too, if they are brought alive
11757         by an object ready for finalizations or a survived one.
11758
11759 Wed Aug 29 18:43:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
11760
11761         * sgen-gc.c: properly account the number of disappearing links when
11762         they are nullified.
11763
11764 Wed Aug 29 18:37:37 CEST 2007 Paolo Molaro <lupus@ximian.com>
11765
11766         * sgen-gc.c: share the code to scan the registered roots between the
11767         different types of collections.
11768
11769 2007-08-28  Zoltan Varga  <vargaz@gmail.com>
11770
11771         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunModuleConstructor): New icall.
11772
11773 2007-08-28  Zoltan Varga  <vargaz@gmail.com>
11774
11775         * object.c (mono_class_proxy_vtable): Use max_interface_id instead of
11776         class->max_interface_id in a one place. Fixes transparentproxy.exe test on ia64.
11777
11778 2007-08-28  Mark Probst  <mark.probst@gmail.com>
11779
11780         * security-manager.c (mono_security_manager_get_methods):
11781         LinkDemandSecurityException now has 2 arguments instead of 3.
11782
11783 2007-08-27  Zoltan Varga  <vargaz@gmail.com>
11784
11785         * class.c (mono_class_layout_fields): Only do the struct alignment hack on
11786         platforms which need it.
11787
11788 Mon Aug 27 18:29:12 CEST 2007 Paolo Molaro <lupus@ximian.com>
11789
11790         * sgen-gc.c: unregister thread data structures with a pthread_key_t
11791         dtor.
11792
11793 Mon Aug 27 18:27:35 CEST 2007 Paolo Molaro <lupus@ximian.com>
11794
11795         * threads.c: free the thread static data on thread exit.
11796
11797 Mon Aug 27 10:55:54 CEST 2007 Paolo Molaro <lupus@ximian.com>
11798
11799         * class.c: walk the hierarchy to find the generic definition for
11800         a class (fixes runtime part of bug #82498).
11801
11802 2007-08-24  Zoltan Varga  <vargaz@gmail.com>
11803
11804         * assembly.c (mono_assembly_close): Move the closing of the referenced assemblies to
11805         ...
11806
11807         * image.c (mono_image_close): Here. Hopefully fixes #82510.
11808
11809 2007-08-24  Mark Probst  <mark.probst@gmail.com>
11810
11811         * monodiet.c (handle_cattrs): Fixed a custom attr leak.
11812
11813 2007-08-24  Robert Jordan  <robertj@gmx.net>
11814
11815         * appdomain.c: don't perform the ':'->';' substitution on Win32.
11816
11817 2007-08-24  Jb Evain  <jbevain@novell.com>
11818
11819         * class.c (mono_type_get_name_recurse): fix AssemblyQualifiedName
11820         for byref types.
11821
11822 2007-08-24  Mark Probst  <mark.probst@gmail.com>
11823
11824         * threads.c: Make sure a thread gets cleaned up only once.  Fixes
11825         #82286.
11826
11827 2007-08-24  Zoltan Varga  <vargaz@gmail.com>
11828
11829         * assembly.c: Fix a warning.
11830         
11831 2007-08-23  Marek Habersack  <mhabersack@novell.com>
11832
11833         * appdomain.c: parse the <runtime> section looking for the probing
11834         element with the 'privatePath' attribute, which sets additional
11835         directories in which the runtime should look for assemblies.
11836
11837 2007-08-23  Robert Jordan  <robertj@gmx.net>
11838
11839         * marshal.c (Marshal_ReAllocHGlobal) : Fix GlobalReAlloc's flags.
11840         Fixes #82499.
11841
11842 2007-08-23  Martin Baulig  <martin@ximian.com>
11843
11844         * mono-debug.[ch]: Rename mono_debug_init_corlib() into
11845         _mono_debug_init_corlib() and remove it from the header file.
11846
11847 2007-08-23  Martin Baulig  <martin@ximian.com>
11848
11849         * mono-debug-debugger.c
11850         (mono_debugger_unhandled_exception): Ignore `ThreadAbortException';
11851         don't notify the debugger about it.
11852
11853         * mono-debug-debugger.h
11854         (MonoDebuggerEvent): Removed `THREAD_ABORT'.
11855
11856 2007-08-23  Robert Jordan  <robertj@gmx.net>
11857
11858         * icall-def.h, process.*: implemented Get|SetPriorityClass icalls.
11859         Code is contributed under MIT/X11 license.
11860
11861 Wed Aug 22 18:35:12 CEST 2007 Paolo Molaro <lupus@ximian.com>
11862
11863         * sgen-gc.h, sgen-gc.c: abstracted most of the OS-specific code.
11864
11865 2007-08-22  Martin Baulig  <martin@ximian.com>
11866
11867         * mono-debug.c: Store debugging info on a per-domain basis and
11868         free it on domain unload.  Add support for unloading symbol files.
11869
11870         * mono-debug.h
11871         (MonoDebugList): New typedef.
11872         (MonoSymbolTable):
11873         - add `data_tables and `type_table'.
11874         - replace 'symbol_files' and `num_symbol_files' with a
11875           `MonoDebugList *'.
11876         (mono_debug_data_table): Removed.
11877         (mono_debug_list_add): New public function.
11878         (mono_debug_list_remove): New public function.
11879         (mono_debug_init_1): Renamed into mono_debug_init_corlib().
11880         (mono_debug_init_2_memory): Renamed into
11881         mono_debug_open_image_from_memory().
11882         (mono_debug_close_image): New public function.
11883         (mono_debug_domain_create): Likewise.
11884         (mono_debug_domain_unload): Likewise.
11885         (MONO_DEBUGGER_VERSION): Bump to 60.
11886
11887         * mono-debug-debugger.h
11888         (MonoDebuggerEvent):
11889         - remove `RELOAD_SYMTABS' and `METHOD_COMPILED'.
11890         - rename `ADD_MODULE' into `LOAD_MODULE'; add `UNLOAD_MODULE'.
11891         - add `DOMAIN_CREATE' and `DOMAIN_UNLOAD'.
11892         - rename `THREAD_CREATED' and `THREAD_EXITED' into
11893           `GC_THREAD_CREATED' and `GC_THREAD_EXITED'.
11894         - re-add `THREAD_CREATED' and `THREAD_EXITED'; with different
11895           meaning.
11896         (mono_debugger_add_symbol_file): Removed.
11897         (mono_debugger_add_type): Removed.
11898         (mono_debugger_lookup_type): Removed.
11899         (mono_debugger_lookup_assembly): Removed.
11900
11901         * domain.c
11902         (mono_domain_create): Call mono_debug_domain_create().
11903         (mono_init_internal): Call mono_debug_init_corlib().
11904
11905         * assembly.c
11906         (mono_assembly_close): Call mono_debug_close_image().
11907
11908 Wed Aug 22 17:26:02 CEST 2007 Paolo Molaro <lupus@ximian.com>
11909
11910         * sgen-gc.c: use the mono-mmap facilitites instead of hard-coding the
11911         mmap call.
11912
11913 Wed Aug 22 17:17:09 CEST 2007 Paolo Molaro <lupus@ximian.com>
11914
11915         * sgen-gc.c: ensure section->pin_queue_end is initialized
11916         correctly when non pinning objects in the section have been found.
11917
11918 2007-08-22  Marek Habersack  <mhabersack@novell.com>
11919
11920         * appdomain.c (set_domain_search_path): cope with PrivateBinPath
11921         containing a list of directories separated by ':'. MSDN docs say
11922         the directories should be separated with ';'. Part of a bugfix for
11923         bug #81446
11924
11925 2007-08-21  Rodrigo Kumpera  <rkumpera@novell.com>
11926
11927         * class.c (mono_type_retrieve_from_typespec) : fixed the return type
11928         it should MonoType and not MonoClass.
11929
11930 2007-08-21  Atsushi Enomoto  <atsushi@ximian.com>
11931
11932         * culture-info-table.h : regenerated.
11933
11934 2007-08-20  William Holmes  <billholmes54@gmail.com>
11935
11936         *file-io.c: Added ves_icall_System_IO_MonoIO_ReplaceFile
11937          to call ReplaceFile Kernel32 on windows or in io-layer.
11938         *file-io.h: Added deceleration for ves_icall_System_IO_MonoIO_ReplaceFile
11939         *icall-def.h: Register ves_icall_System_IO_MonoIO_ReplaceFile
11940          as an internal call.
11941
11942         Code is contributed under MIT/X11 license.
11943
11944 2007-08-20  Jb Evain  <jbevain@novell.com>
11945
11946         * class-internals: add definitions for MONO_EXCEPTION_METHOD_ACCESS
11947         and MONO_EXCEPTION_FIELD_ACCESS.
11948
11949         * debug-helpers.[c|h]: new mono_field_full_name function.
11950
11951 2007-08-20  Mark Probst  <mark.probst@gmail.com>
11952
11953         * class.c: Removed class_security_level() and moved it to
11954         security-core-clr.c.
11955
11956         * security-core-clr.c, security-core-clr.h: class_security_level()
11957         is now public and renamed to mono_security_core_clr_class_level().
11958         It also looks for security attributes in the classes a class is
11959         nested in.
11960
11961 2007-08-20  Mark Probst  <mark.probst@gmail.com>
11962
11963         * security-core-clr.c, security-core-clr.h: CoreCLR security
11964         utility functions.
11965
11966         * Makefile.am: Added security-core-clr.[ch].
11967
11968         * security-manager.c, security-manager.h: Functions and enum for
11969         setting and getting the security mode.
11970
11971         * class.c: CoreCLR security checks.
11972
11973 Mon Aug 20 12:38:42 CEST 2007 Paolo Molaro <lupus@ximian.com>
11974
11975         * icall-def.h, process.c, process.h: implemented icall to get
11976         user/system processor times.
11977
11978 2007-08-17  Mark Probst  <mark.probst@gmail.com>
11979
11980         * domain.c, threads.c, class-internals.h, domain-internals.h: New
11981         reader-lock-free jit_info_table.
11982
11983 2007-08-17  Zoltan Varga  <vargaz@gmail.com>
11984
11985         * metadata.c (mono_type_to_unmanaged): Handle MONO_NATIVE_CUSTOM.
11986
11987         * marshal.c (mono_marshal_type_size): Ditto. Fixes #82465 and #82466.   
11988
11989         * object-internals.h (MonoException): Add missing _data member.
11990
11991 2007-08-08  Massimiliano Mantione  <massi@ximian.com>
11992
11993         * loader.c (find_method, find_method_in_class): Fixed bug #81466,
11994         checking that only methods with matching qname or fqname are picked
11995         from implemented interfaces.
11996
11997 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
11998
11999         * verify.c (do_newarr):added, do type verification of
12000         newarr ops, push the right value on the eval stack.
12001         * verify.c (mono_method_verify): use do_newarr
12002
12003
12004 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
12005
12006         * verify.c (do_ldobj_value, do_unbox_value and do_box_value):
12007         factored the common code into get_boxable_mono_type, which
12008         is now using mono_type_get_full, this fixed byref related tests.
12009
12010 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
12011
12012         * class.c: added mono_type_get_full, this function has the same
12013         behavior of mono_class_get_full but the returned MonoType has
12014         all metadata of the associated token in case of a typespec token.
12015         * class.c: added mono_type_retrieve_from_typespec, used by 
12016         mono_type_get_full to retrieve the token type.
12017         * class.c (mono_class_create_from_typespec): changed to use
12018         mono_type_retrieve_from_typespec.
12019         * class.c (mono_ldtoken): changed to use mono_type_get_full
12020         for MONO_TOKEN_TYPE_(DEF|REF|SPEC).
12021         * class-internals.h: exported mono_type_get_full for internal use.
12022
12023 2007-08-16  Jb Evain  <jbevain@novell.com>
12024
12025         * domain.c (supported_runtimes): add entry for
12026         the 'moonlight' runtime version.
12027
12028 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
12029
12030         * verify.c (mono_method_verify): small typo sliped in.  
12031
12032 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
12033
12034         * verify.c (do_unbox_value): added, do type verification of
12035         unboxing ops
12036         * verify.c (mono_method_verify): use do_unbox_value
12037
12038
12039 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
12040
12041         * verify.c (dump_stack_value): fixed typo, was printing string
12042         instead of object on stack.
12043         * verify.c (do_box_value): moved the byref check up as it leads
12044         to invalid code and should be done earlier.
12045         * verify.c: improved error messages for and ldobj
12046
12047 2007-08-15  William Holmes  <billholmes54@gmail.com>
12048
12049         * marshal.c (emit_marshal_custom): Omit the call to 
12050           marshal_native_to_managed when calling native to managed 
12051           and the argument is specified as an out argument.
12052
12053         Code is contributed under MIT/X11 license.
12054
12055 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
12056
12057         * verify.c: fixed the type checks for generics, function pointers and vectors.
12058         Added type verification for ldobj and ldtoken. The verifier
12059         would segfault if header or signature of a method contained references
12060         to non-existant types.
12061
12062 2007-08-15  Jonathan Chambers  <joncham@gmail.com>
12063
12064         * marshal.c (cominterop_get_ccw): Patch from
12065         Bill Holmes to no walk up interface hierarchy. 
12066         All parent methods should be present in the interface for COM.
12067    
12068         Code is contributed under MIT/X11 license.
12069
12070 2007-08-15  Jonathan Chambers  <joncham@gmail.com>
12071
12072         * marshal.c (emit_marshal_com_interface): Patch from
12073         Bill Holmes to handle COM Interfaces as return values
12074         for native->managed calls.
12075    
12076         Code is contributed under MIT/X11 license.
12077
12078 2007-08-14  Jonathan Chambers  <joncham@gmail.com>
12079
12080         * marshal.c (cominterop_get_idispatch_for_object): Implement
12081         for runtime callable wrappers.
12082    
12083         Code is contributed under MIT/X11 license.
12084
12085 2007-08-13  Rodrigo Kumpera  <rkumpera@novell.com>
12086
12087         * pedump.c (main): changed from mono_init to mono_init_from_assembly
12088         so 2.0 types are accessible
12089
12090
12091 2007-08-13  Miguel de Icaza  <miguel@novell.com>
12092
12093         * domain.c (mono_init_internal): Call mono_assembly_load_friends
12094         once we load mscorlib.   Due to the order in which we initialize,
12095         the mono_assembly_load_full routine that loads mscorlib did not
12096         load friends.   We now load it once we load the
12097         mono_defaults.internals_visible_class class. 
12098
12099         * assembly.c: Expose the mono_load_friend_assemblies method.
12100
12101 2007-08-11  Rodrigo Kumpera  <rkumpera@novell.com>
12102
12103         * verify.c: improved the handling of boxing, better
12104         type checking for unary ops and conversion. Fix bug
12105         regarding managed pointer compatibility checking
12106
12107 2007-08-11  Zoltan Varga  <vargaz@gmail.com>
12108
12109         * icall.c (ves_icall_System_Array_SetGenericValueImpl): New icall.
12110
12111         * threads.c threads-types.h: Export mono_thread_get_stack_bounds.
12112
12113 2007-08-09  Raja R Harinath  <rharinath@novell.com>
12114
12115         * reflection.c (dup_type): Remove.
12116         * class.c (dup_type): Remove.
12117         (mono_metadata_signature_deep_dup): Use 'mono_metadata_type_dup'
12118         instead of the dodgy 'dup_type'.
12119         (inflate_generic_type): Likewise.  Fix the VAR/MVAR cases to
12120         handle the case where 'dup_type' needed the second argument.
12121
12122 2007-08-08  Zoltan Varga  <vargaz@gmail.com>
12123
12124         * domain.c: Fix a warning.
12125
12126 2007-08-08  Massimiliano Mantione  <massi@ximian.com>
12127
12128         * class.c (mono_class_setup_vtable_general): Fixed bug #77127,
12129         checking that methods with the same fqname are not overridden
12130         with a method from an ancestor.
12131
12132 2007-08-07  Zoltan Varga  <vargaz@gmail.com>
12133
12134         * threads.c (free_thread_static_data_helper): Avoid a crash if
12135         thread->static_data is not yet set.
12136
12137 2007-08-07  Jonathan Chambers  <joncham@gmail.com>
12138
12139         * marshal.c: Use correct image when emitting
12140         native wrapper for COM calls.
12141    
12142         Code is contributed under MIT/X11 license.
12143
12144 2007-08-07  Atsushi Enomoto  <atsushi@ximian.com>
12145
12146         * icall-def.h, security.c, security.h :
12147           added icall wrapper to ProtectedMemory.[Unprotect|Protect]Data().
12148
12149 2007-08-07  Martin Baulig  <martin@ximian.com>
12150
12151         * mono-debug-debugger.h
12152         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_DOMAIN_UNLOAD'.
12153
12154         * domain.c (mono_domain_free): Call
12155         `mono_debugger_event (MONO_DEBUGGER_EVENT_DOMAIN_UNLOAD)'.
12156
12157 2007-08-06  Rodrigo Kumpera  <rkumpera@novell.com>
12158
12159         * verify.c (check_underflow, check_overflow): error message now returns IL offset
12160         * verify.c (in_same_block): code should test if either offset is inside the clauses
12161         * verify.c (mono_method_verify): push the exception into the eval stack of exception
12162         and filter blocks
12163
12164 2007-08-03  Zoltan Varga  <vargaz@gmail.com>
12165
12166         * image.c (mono_image_close): Fix a leak.
12167
12168         * object.c (mono_runtime_invoke_array): Avoid using alloca.
12169
12170         * icall.c (ves_icall_FieldInfo_SetValueInternal): Ditto.        
12171
12172 Fri Aug 3 19:54:23 CEST 2007 Paolo Molaro <lupus@ximian.com>
12173
12174         * domain.c, threads.c, threads-types.h: fix memory retention issue
12175         with thread static variables not being cleared on domain unload.
12176         Reuse thread static slots after domain unload.
12177
12178 2007-08-03  Zoltan Varga  <vargaz@gmail.com>
12179
12180         * object.c (mono_runtime_invoke_array): Handle the case when the receiver is a
12181         nullable type.
12182
12183         * marshal.c (mono_marshal_get_runtime_invoke): Revert the previous change, it is
12184         now done in mono_runtime_invoke_array.
12185
12186         * marshal.c (mono_marshal_get_runtime_invoke): Handle the case when the 
12187         receiver is a nullable type.
12188
12189         * class.c (mono_class_is_assignable_from): Handle the case when klass is a 
12190         generic parameter.
12191
12192 2007-08-03  Jonathan Chambers  <joncham@gmail.com>
12193
12194         * marshal.c: Implement COM Objects as return type for 
12195         managed->unmanaged calls. Added Release calls for COM Object
12196         out/return values in managed->unmanaged calls.
12197
12198         Code is contributed under MIT/X11 license.
12199
12200 Fri Aug 3 17:00:51 CEST 2007 Paolo Molaro <lupus@ximian.com>
12201
12202         * threads.h, threads-type.h: move the hazard pointer declarations
12203         to the private header.
12204
12205 Fri Aug 3 13:13:39 CEST 2007 Paolo Molaro <lupus@ximian.com>
12206
12207         * file-io.c, appdomain.c: memory leak fixes.
12208
12209 2007-08-02  Dick Porter  <dick@ximian.com>
12210
12211         * socket-io.c
12212         (ves_icall_System_Net_Sockets_Socket_Socket_internal): Move the
12213         SO_REUSEADDR setting into io-layer/sockets.c.
12214
12215 2007-08-01  Zoltan Varga  <vargaz@gmail.com>
12216
12217         * icall.c (ves_icall_Type_GetMethodsByName): Return the members inherited
12218         from Object when called on a generic parameter. Fixes #82211.
12219
12220 2007-08-01  Dick Porter  <dick@ximian.com>
12221
12222         * file-io.c (convert_share): Test FileShare values bit-by-bit.
12223         Fixes bug 79250 yet again.
12224
12225 2007-07-30  Martin Baulig  <martin@ximian.com>
12226
12227         Merged the `debugger-dublin' branch.
12228
12229         * mono-debug.h
12230         (MonoDebugDataTable): New typedef.
12231         (MonoDebugMethodAddressList): New typedef.
12232         (MonoDebugWrapperData): Removed.
12233         (MonoDebugSymbolTable): Removed `current_data_table',
12234         `current_data_table_size', `current_data_table_offset'.
12235         (MonoDebugDataItemType): Moved into mono-debug.c.
12236         (MonoDebugMethodJitInfo): Remove `address'.
12237         (mono_debug_data_table): New global variable.
12238         (mono_debug_lookup_method_addresses): New public function.
12239         (mono_debug_find_method): Take a `MonoMethod *', not a
12240         `MonoDebugMethodInfo *'.
12241
12242         * mono-debug.c: Drop support for the old symbol tables.
12243
12244 2007-06-28  Martin Baulig  <martin@ximian.com>
12245
12246         * mono-debug.c (mono_debug_debugger_version): New public variable.
12247
12248 2007-07-31  William Holmes  <billholmes54@gmail.com>
12249
12250         * metadata.c Changed mono_type_create_from_typespec to not insert
12251           the type into the hash map until after
12252           do_mono_metadata_parse_type has completed.
12253         Fixes Bug #82194
12254         Code is contributed under MIT/X11 license.
12255
12256 2007-07-31  Zoltan Varga  <vargaz@gmail.com>
12257
12258         * icall.c (ves_icall_Type_GetMethodsByName): Avoid a crash when called on a
12259         generic parameter. Fixes #82211.
12260
12261 2007-07-27  Jb Evain  <jbevain@novell.com>
12262
12263         * pedump.c (dump_metadata, dump_metadata_header): dump
12264         versions contained in the metadata header.
12265
12266 Fri Jul 27 17:07:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
12267
12268         * threads.c: register small_id_table with the GC.
12269
12270 2007-07-27  Mark Probst  <mark.probst@gmail.com>
12271
12272         * threads.c, threads.h, class-internals.h, object-internals.h:
12273         Hazard pointers, to be used by lock-free parallel algorithms.
12274
12275 2007-07-26  Dick Porter  <dick@ximian.com>
12276
12277         * appdomain.c (mono_runtime_cleanup): Invoke io-layer cleanup
12278         routine on non-windows platforms, as I've not managed to think of
12279         a non-kludgy way of doing this.  Finishes off bug 78739.
12280
12281 Wed Jul 25 18:06:33 CEST 2007 Paolo Molaro <lupus@ximian.com>
12282
12283         * object.c: properly setup interface_bitmap in proxy vtables.
12284
12285 2007-07-25  Marek Habersack  <mhabersack@novell.com>
12286
12287         * appdomain.c (get_shadow_assembly_location): do not use TickCount
12288         to create unique shadow copy target directories, use the domain's
12289         serial number instead. Each domain gets a unique target directory
12290         that way.
12291
12292         * domain.c (mono_domain_create): added code to increment domain
12293         shadow copy serial number and cache the value in the current
12294         domain structure.
12295
12296         * domain-internals.h (struct _MonoDomain): added a new field -
12297         shadow_serial to hold the serial number used in generation of
12298         shadow-copy directories. This is to make sure that the directory
12299         name is unique for each and every domain created. We avoid a race
12300         condition with overriding assemblies already in use by other app
12301         domains.
12302
12303 2007-07-24  Rodrigo Kumpera  <rkumpera@novell.com>
12304
12305         * class.c (mono_bounded_array_class_get): fixed memory leak when 
12306         binding generic parameters.
12307
12308 2007-07-24  Raja R Harinath  <rharinath@novell.com>
12309
12310         * metadata.c (do_mono_metadata_parse_generic_class): Use
12311         mono_metadata_lookup_generic_class.  Don't g_assert on a metadata
12312         error.
12313
12314 Tue Jul 24 15:15:19 CEST 2007 Paolo Molaro <lupus@ximian.com>
12315
12316         * loader.c, class-internals.h, reflection.c: removed the per-method
12317         generics hashtable: we use the global one through the call of
12318         mono_class_inflate_generic_method ().
12319
12320 Mon Jul 23 19:43:14 CEST 2007 Paolo Molaro <lupus@ximian.com>
12321
12322         * class.c, metadata.c, class-internals.h: introduce yet another
12323         generics global cache for inflated methods (fixes 98% of the perf
12324         issue in bug #81806).
12325
12326 2007-07-23  Raja R Harinath  <rharinath@novell.com>
12327
12328         Fix #81035 -- avoid allocating MonoGenericInsts willy-nilly
12329         * metadata.c (mono_metadata_lookup_generic_inst): Kill.
12330         (mono_metadata_get_generic_inst): New.  Given a list of MonoType*,
12331         return a MonoGenericInst containing (a copy) of those types.
12332         (mono_metadata_inflate_generic_inst): Update to changes.
12333         (mono_metadata_parse_generic_inst): Likewise.
12334         (mono_get_shared_generic_inst): Likewise.
12335         * reflection.c (mono_class_bind_generic_parameters): Likewise.
12336         (mono_reflection_bind_generic_method_parameters): Likewise.
12337         * metadata-internals.h: Likewise.
12338         * icall.c (free_generic_context): Kill.
12339         (init_generic_context_from_args): Use mono_metadata_get_generic_inst.
12340
12341         * reflection.c (reflection_methodbuilder_to_mono_method): Use
12342         mono_metadata_type_dup.
12343         * marshal.c (mono_mb_create_method): Likewise.
12344
12345         * metadata.c (mono_metadata_type_dup): Rename from
12346         mono_metadata_type_dup_mp.  Take an optional mempool instead of a
12347         MonoImage.  Handle a few more cases, esp. when no mempool is given.
12348         * marshal.c, metadata-internals.h: Update to changes.
12349
12350 Mon Jul 23 11:43:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
12351
12352         * class.c: fixed a small leak for array classes and removed warning.
12353
12354 2007-07-22  Zoltan Varga  <vargaz@gmail.com>
12355
12356         * loader.c (mono_method_get_param_token): Make this work on generic methods.
12357         Return 0x8000000 for return parameters. Fixes #82161.
12358
12359 2007-07-21  Marek Habersack  <grendello@gmail.com>
12360
12361         * appdomain.c (get_shadow_assembly_location): append the current
12362         ticks value to the path. Avoids overwriting the same assemblies by
12363         several threads at the same time.
12364
12365 2007-07-20  Atsushi Enomoto  <atsushi@ximian.com>
12366         and Raja R Harinath  <rharinath@novell.com>
12367
12368         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition):
12369         Simplify slightly.
12370         (ves_icall_MonoMethod_GetGenericMethodDefinition): Update
12371         property for testing if a method is a generic method definition.
12372
12373 2007-07-20  Atsushi Enomoto  <atsushi@ximian.com>
12374
12375         * domain-internals.h : added 2.0 member fields to MonoAppDomainSetup.
12376
12377 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
12378
12379         * verify.c: used function from private branch, reverted to the one in class.h 
12380
12381 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
12382
12383         * verify.c: a typo slipped in and the code wont compile
12384
12385 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
12386
12387         * verify.c: now all code use IS_MANAGED_POINTER and UNMASK_TYPE macros.
12388         disabled box instruction as it is doing the wrong thing
12389         improved stack dump messages, now it is easier to debug type related issues
12390
12391
12392 2007-07-19  Juraj Skripsky  <js@hotfeet.ch>
12393
12394         * icall.c (ves_icall_System_MonoType_getFullName): Fix a leak. 
12395
12396 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
12397
12398         * verify.c: changed MONO_TYPE_TYPEDBYREF stack type from 
12399         TYPE_COMPLEX to TYPE_PTR, it did not make any sense to be
12400         grouped with class and valuetype. This change will simply 
12401         the code as it should be handled just like unmanaged pointers.
12402
12403 2007-07-19  Mark Probst  <mark.probst@gmail.com>
12404
12405         * class.c (concat_two_strings_with_zero): Fixed a silly bug.
12406
12407 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
12408
12409         * verify.c: several stack merge issues fixed, reference comparisons now
12410         check the type size. strict type check now works correctly.
12411         added more uses of IS_MANAGED_POINTER macro.
12412         fixed issues pointed by running the test suite against .net.
12413         
12414
12415 2007-07-19  Mark Probst  <mark.probst@gmail.com>
12416
12417         * class.c, loader.c, class-internals.h: Removed the
12418         MonoLoaderErrorKind enum and replaced it with the MONO_EXCEPTION_
12419         defines.
12420
12421         * icall.c: Better error checking in some internal reflection
12422         methods.
12423
12424 2007-07-18  William Holmes  <billholmes54@gmail.com>
12425
12426         * filewatcher.c : removed unused variable 'filename' in 
12427           ves_icall_System_IO_FSW_SupportsFSW
12428
12429 Mon Jul 16 19:36:16 CEST 2007 Paolo Molaro <lupus@ximian.com>
12430
12431         * reflection.c, class.c, icall.c, loader.c: mono_get_inflated_method () is
12432         obsolete, removed.
12433
12434 2007-07-15  Zoltan Varga  <vargaz@gmail.com>
12435
12436         * icall.c (ves_icall_System_Reflection_FieldInfo_GetTypeModifiers): New icall.
12437         
12438         * icall.c (ves_icall_System_Reflection_Module_ResolveSignature): New icall.
12439
12440 2007-07-14  Zoltan Varga  <vargaz@gmail.com>
12441
12442         * icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): 
12443         Implement generics support.
12444         (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
12445
12446         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Add new
12447         type_args and method_args arguments.
12448         (ves_icall_System_Reflection_Module_ResolveMethodToken): Ditto.
12449         (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
12450         (ves_icall_System_Reflection_Module_ResolveMemberToken): Ditto.
12451
12452 2007-07-13  Rodrigo Kumpera  <rkumpera@novell.com>
12453
12454         * reflection.c: patch from Thong Nguyen to fix atribute resolution.
12455           It adds a rootimage parameter to mono_reflection_get_type_internal,
12456           adds new function mono_reflection_get_type_with_rootimage and use
12457           the rootimage to resolve the types instead of the current image
12458
12459 2007-07-13  Rolf Bjarne Kvinge  <RKvinge@novell.com>
12460
12461         * culture-info-table.h: Forgot to update after r78304.
12462
12463 2007-07-13  Raja R Harinath  <rharinath@novell.com>
12464
12465         * class.c (mono_class_is_open_constructed_type)
12466         <MONO_TYPE_GENERICINST>: Don't recompute a computed field.
12467
12468 2007-07-12  Rodrigo Kumpera  <rkumpera@novell.com>
12469
12470         * class.c (mono_bounded_array_class_get):  method fails if used with
12471         an incomplete TypeBuilder enum (no basetype field), fixed it by 
12472         avoiding calculating the size for such array as it cannot be instantiated.
12473         Fix bug #82015
12474
12475 2007-07-12  Raja R Harinath  <rharinath@novell.com>
12476
12477         * class-internals.h (_MonoGenericInst::is_reference): Remove bogus
12478         field.
12479         * metadata.c, reflection.c: Update to changes.
12480
12481 2007-07-11  Rodrigo Kumpera  <rkumpera@novell.com>
12482
12483         * class.c, class-internal.h: added mono_type_is_valid_enum_basetype and
12484         mono_class_is_valid_enum, they are used to valide a enum when loading.
12485         * reflection.c: used new functions to throw TypeLoadException when and
12486         invalid enum is build with TypeBuilder. Fixes #82018
12487   
12488 Wed Jul 11 14:47:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
12489
12490         * object.c: forgot commit of mono_class_setup_methods () to access
12491         iface->methods.
12492         * object-internals.h: added a few more handy fields to
12493         MonoIMTCheckItem.
12494
12495 2007-07-11  Zoltan Varga  <vargaz@gmail.com>
12496
12497         * object.c (build_imt): Call mono_class_setup_methods () before accessing 
12498         iface->methods.
12499
12500 Tue Jul 10 16:49:01 CEST 2007 Paolo Molaro <lupus@ximian.com>
12501
12502         * class-internals.h, object-internals.h, object.c: IMT-based
12503         interface invocation core from Massimiliano Mantione
12504         (massi@ximian.com) with a reworked arch-specific interface,
12505         bsearch implementation and a few bugfixes and memory savings by me.
12506
12507 2007-07-10  Rodrigo Kumpera  <rkumpera@novell.com>
12508
12509         * class.c (mono_class_create_from_typedef): mono would segfault if 
12510         an enum did not have a __value field. It now throws a TypeLoadException
12511         for such cases. Fix bug #82022
12512
12513 2007-07-10  Zoltan Varga  <vargaz@gmail.com>
12514
12515         * marshal.c (mono_marshal_string_to_utf16_copy): Fix allocation size.
12516
12517 2007-07-09  Mark Probst  <mark.probst@gmail.com>
12518
12519         * class.c (mono_class_init): If a class is already inited but has
12520         an exception_type set, return FALSE, not TRUE.  Fixes: 82050.
12521
12522 2007-07-09  Mark Probst  <mark.probst@gmail.com>
12523
12524         * class.c: Properly handle the case of an unimplemented interface
12525         method.  Fixes: 81673.
12526
12527 Mon Jul 9 16:21:43 CEST 2007 Paolo Molaro <lupus@ximian.com>
12528
12529         * class-internals.h, object.c: cleanup patch from massi: use
12530         MonoVTable->interface_bitmap since the vtable interfaces offset array
12531         is going away.
12532
12533 2007-07-10  Zoltan Varga  <vargaz@gmail.com>
12534
12535         * icall-def.h icall.c: Remove Module:get_MDStreamVersion icall and add a new
12536         GetMDStreamVersion icall instead.
12537
12538 Mon Jul 9 11:34:17 CEST 2007 Paolo Molaro <lupus@ximian.com>
12539
12540         * filewatcher.c: patch from Thong Nguyen <tum@veridicus.com> to
12541         not use mono_dl_build_path() with a full library name: makes
12542         fallbacks to libgaim and libfam work.
12543
12544 2007-07-06  William Holmes  <billholmes54@gmail.com>
12545
12546         * assembly.c: Added a continue statement in probe_for_partial_name when
12547          parse_assembly_directory_name fails.  Fixes : 82002
12548
12549 2007-07-06  Rodrigo Kumpera  <rkumpera@novell.com>
12550
12551         * verify.c (check_unmanaged_pointer_type): renamed to check_unverifiable_type
12552         and added a verification  for TYPEDBYREF.
12553         * verify.c (verify_stack_type_compatibility): fix handling of byref types,
12554         make native int interchangeable with int32 and some small cleanup and formating.
12555         * verify.c (push_arg): only ldarg on invalid argument is valid (but not verifiable) and
12556         handle byref of byref.
12557         * verify.c (push_local): handle byref of byref.
12558         * verify.c (do_binop): invalid mix of values is unverifiable
12559         * verify.c (do_invoke_method): fixed the handling of bad params on stack and
12560         added visibility checks
12561         * verify.c (field related method): added visibility checks
12562         * verify.c (do_push_field): cannot take the address of a temporary valuetype field
12563
12564 2007-07-06  Zoltan Varga  <vargaz@gmail.com>
12565
12566         * marshal.c (mono_marshal_string_to_utf16_copy): Null terminate the
12567         string.
12568
12569 2007-07-05  Zoltan Varga  <vargaz@gmail.com>
12570
12571         * profiler.c (mono_profiler_load): Fix an off-by-one error.
12572
12573         * marshal.c (emit_marshal_string): When returning a string from managed code,
12574         allways make a copy even for unicode strings. Fixes #81990.
12575
12576 Wed Jul 4 11:53:57 CEST 2007 Paolo Molaro <lupus@ximian.com>
12577
12578         * object.c: cleaned up mono_runtime_invoke_array () and fixed handling
12579         of byref generic inst types (bug #81997).
12580
12581 2007-07-03  Rodrigo Kumpera  <rkumpera@novell.com>
12582
12583         * class.c: moved methods mono_method_can_access_field and mono_method_can_access_method from mini/mini.c
12584         * class.h: added declarations of mono_method_can_access_field() and mono_method_can_access_method()
12585
12586 2007-07-02  Zoltan Varga  <vargaz@gmail.com>
12587
12588         * marshal.c (emit_marshal_string): Add support for unicode strings in
12589         MARSHAL_ACTION_MANAGED_CONV_RESULT. Fixes #81990.
12590
12591 2007-07-02 Rodrigo Kumpera  <rkumpera@novell.com>
12592
12593         * verify.c: field load/store are now verified, missing only access checks now
12594
12595 2007-06-28  Martin Baulig  <martin@ximian.com>
12596
12597         * mono-debug.c (mono_debug_debugger_version): New public variable.
12598
12599 2007-06-24  Gert Driesen  <drieseng@users.sourceforge.net>
12600
12601         * locales.c: When constructing DateTimeFormat or NumberFormat for
12602         MonoCultureInfo, inherit readonly bit from MonoCultureInfo. The
12603         MonoCultureInfo contructed from the current locale is always
12604         read-only and has UseUserOverride set to true. All MonoCultureInfo
12605         instances returned for GetCultures have both IsReadOnly and
12606         UseUserOverride set to true. Fixes part of bug #81930.
12607
12608 2007-06-22  Jonathan Chambers  <joncham@gmail.com>
12609
12610        * icall-def.h: Update System.__ComObject icalls
12611        * marshal.c: Avoid managed transition (and object creation)
12612        when looking up COM interface in RCW.
12613        * marshal.h: Ditto.
12614        
12615        Code is contributed under MIT/X11 license.
12616
12617 2007-06-22  Zoltan Varga  <vargaz@gmail.com>
12618
12619         * marshal.c (mono_marshal_get_runtime_invoke): Cache in the method image for now
12620         to avoid crashes during assembly unloading.
12621
12622 2007-06-22  Raja R Harinath  <rharinath@novell.com>
12623
12624         Fix MethodInfo.IsGenericMethodDefinition
12625         * reflection.c (mono_reflection_bind_generic_method_parameters):
12626         Rearrange code to ensure we always uses a generic method definition.
12627         * class.c (mono_class_inflate_generic_method_full): Set
12628         'generic_container' field only for generic method definitions.
12629         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition):
12630         Use presense of 'generic_container' field as indication of being a
12631         generic method definition.
12632
12633 2007-06-21  Zoltan Varga  <vargaz@gmail.com>
12634
12635         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
12636
12637         * object-internals.h: Reflect changes in the layout of the managed Delegate
12638         class.
12639         
12640         * object-internals.h reflection.c icall-def.h: Applied patch from Robert
12641         Jordan (robertj@gmx.net). Add a dtor to dynamic methods which frees up the
12642         runtime memory used by the dynamic method. Fixes #77146.
12643
12644 2007-06-21  Dick Porter  <dick@ximian.com>
12645
12646         * file-io.h: 
12647         * file-io.c (convert_share): Cope with FileShare.Delete.  Patch
12648         from Wojtek Krawczyk <krawczyk.wojciech@gazeta.pl>, fixes bug
12649         81767.
12650
12651 2007-06-21  Raja R Harinath  <rharinath@novell.com>
12652
12653         * reflection.c (method_encode_methodspec): Add a tripwire.
12654         * class.c (inflate_generic_type): The fully open generic type is
12655         not the same as the generic type definition.
12656
12657 2007-06-21  Martin Baulig  <martin@ximian.com>
12658
12659         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 59.
12660
12661         * mono-debug-debugger.h
12662         (MonoDebuggerBreakpointInfo): Removed.
12663         (mono_debugger_insert_breakpoint_full): Moved to ../mini/debug-mini.h.
12664         (mono_debugger_remove_breakpoint): Likewise.
12665         (mono_debugger_breakpoint_callback): Likewise.
12666         (mono_debugger_start_add_type): Renamed into mono_debugger_add_type().
12667
12668 2007-06-21  Raja R Harinath  <rharinath@novell.com>
12669
12670         * metadata.c (mono_metadata_lookup_generic_class): The fully open
12671         generic type is not the same as the generic type definition.
12672         * class.c (mono_generic_class_get_class): Likewise.
12673
12674 2007-06-20  Geoff Norton  <gnorton@customerdna.com>
12675
12676         * icall.c: The second argument to 
12677         System.Reflection.MethodBase.GetMethodFromHandleInternalType
12678         is a MonoType not a MonoClass.
12679
12680 2007-06-20  Rodrigo Kumpera  <kumpera@gmail.com>
12681
12682         * verify.c: support for function pointers in the verifier
12683
12684 2007-06-20  Rodrigo Kumpera  <kumpera@gmail.com>
12685
12686         * verify.c: unmanaged pointer verification checks (loading unmanaged pointers is unverifiable)
12687
12688 Wed Jun 20 10:22:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
12689
12690         * assembly.c: removed Mono.Data.SqliteClient from the list of
12691         forward-compatible assemblies as it breaks the ABI (bug #81899).
12692
12693 2007-06-19  Raja R Harinath  <rharinath@novell.com>
12694
12695         * metadata.c (mono_metadata_lookup_generic_class): Protect cache
12696         lookup/update with the loader lock.
12697         * reflection.c (mono_class_bind_generic_parameters): No need to
12698         protect mono_metadata_lookup_* with the loader lock.
12699         * class.c (inflate_generic_type): Likewise.
12700         
12701         * metadata.c (ginst_in_image): Avoid mono_class_from_mono_type
12702         on a generic instantiated type.
12703
12704 2007-06-18  Rodrigo Kumpera <kumpera@gmail.com>
12705
12706         *verify.c: produce meanfull error messages on verification error
12707         *verify.c: fixed some cases of verification errors reported as validation errors
12708         *pedump.c: fixed the error name array, now it shows validation errors properly
12709         *verify.h: fixed the contant that should be used for verification errors
12710
12711 Mon Jun 18 17:07:22 CEST 2007 Paolo Molaro <lupus@ximian.com>
12712
12713         * metadata.c, image.c, metadata-internals.h: part of the fixes needed
12714         for bug #77596, 81858 and 80743 (generics data structures on domain
12715         unload).
12716
12717 2007-06-15  Raja R Harinath  <rharinath@novell.com>
12718
12719         Avoid allocating 'MonoGenericContext' on the heap.
12720         * class-internals (_MonoMethodInflated::context): Make field
12721         inline, not a pointer.
12722         * loader.c (method_from_methodspec): Allocate 'new_context' on the
12723         stack.  Use the context embedded within the inflated method as the
12724         hash key, rather than 'new_context'.
12725         * class.c (inflate_generic_context): Simplify.  Return a struct
12726         rather than allocating on the heap.
12727         (mono_class_inflate_generic_method_full): Update to changes.  Now,
12728         doesn't salt away a copy of the context -- simplifying the
12729         lifetime rules of a 'MonoGenericContext *'.
12730         (mono_method_get_context): Return pointer to embedded context.
12731         (setup_generic_array_ifaces): Allocate temporary context on stack.
12732         * reflection.c (inflate_mono_method): Likewise.
12733         (mono_reflection_bind_generic_method_parameters): Likewise.
12734         Use the context embedded within the inflated method as the hash key.
12735
12736         Avoid a source of allocation of 'MonoGenericContext'.
12737         * class-internals.h (_MonoGenericClass::context): Combine 'inst'
12738         and 'cached_context' fields into embedded 'MonoGenericContext' field.
12739         * class.c: Update to changes.
12740         (mono_generic_class_get_context): Simplify drastically.  Now just
12741         returns a pointer to the field.
12742         * metadata-internals.h (mono_metadata_generic_context_hash): Mark
12743         argument as a const pointer.
12744         (mono_metadata_generic_context_equal): Likewise.
12745         * metadata.c, loader.c, icall.c, reflection.c, verify.c:
12746         Update to changes.
12747
12748 2007-06-14  Rodrigo Kumpera  <kumpera@gmail.com>
12749
12750         * verify.c improved the handling of brtrue/brfalse, factored out common code
12751
12752 2007-06-14  Raja R Harinath  <rharinath@novell.com>
12753
12754         Kill MonoGenericMethod.
12755         * class-internals.h (MonoGenericContext::method_inst): Rename from
12756         'gmethod' and convert to a MonoGenericInst.
12757         (MonoGenericMethod): Remove.
12758         * metadata.h (MonoGenericMethod): Note that the name is obsolete.
12759         * loader.c (method_from_methodspec): Update to changes.  Use a
12760         MonoGenericContext as the key to the hashtable.
12761         * metadata.c (mono_metadata_generic_context_equal): Rename from 
12762         'mono_metadata_generic_method_equal' and take MonoGenericContext.
12763         (mono_metadata_generic_context_hash): Likewise from
12764         'mono_metadata_generic_method_hash'.  Change hash function.
12765         (mono_metadata_load_generic_params): Update to changes.
12766         (mono_get_shared_generic_method): Remove.
12767         * metadata-internals.h (mono_get_shared_generic_method): Remove.
12768         * class.c (inflate_generic_type) [MONO_TYPE_MVAR]: Update to changes.
12769         (inflate_generic_context): Likewise.
12770         (mono_class_inflate_generic_method_full): Likewise.
12771         (setup_generic_array_ifaces): Likewise.
12772         (mono_class_create_from_typespec): Likewise.
12773         * reflection.c (encode_generic_method_sig): Take a MonoGenericContext.
12774         (method_encode_methodspec): Update callsite.
12775         (reflection_methodbuilder_to_mono_method): Update to changes.
12776         (mono_reflection_bind_generic_method_parameters): Likewise.  Use a
12777         MonoGenericContext as the key to the hashtable.
12778         (inflate_mono_method): Update to changes.
12779
12780         * class-internals.h (MonoGenericMethod::container): Remove.
12781         * class.c, loader.c, metadata.c, reflection.c: Update to changes.
12782
12783 Thu Jun 14 12:40:05 CEST 2007 Paolo Molaro <lupus@ximian.com>
12784
12785         * profiler-private.h, profiler.c, profiler.h: added API to profile
12786         exception events.
12787
12788 2007-06-13  Rodrigo Kumpera  <kumpera@gmail.com>
12789
12790         * verify.c: Fixed pointer type handling, some code and message formating and two invalid assigments 
12791
12792 2007-06-13  Rodrigo Kumpera  <kumpera@gmail.com>
12793
12794         * verify.c: method invocation is now validated, now we verify parameter types on stack.
12795         Fixed overflow and underflow not aborting the verification process.
12796
12797 2007-06-13  Mark Probst  <mark.probst@gmail.com>
12798
12799         * class-internals.h (MonoStats): Added stats entries for dynamic
12800         code allocations.
12801
12802 2007-06-12  Zoltan Varga  <vargaz@gmail.com>
12803
12804         * loader.c (mono_free_method): Free header->locals and header->clauses.
12805
12806         * marshal.c (mono_mb_create_method): Make a copy of the locals as well in the
12807         dynamic case.
12808
12809         * threads.c (mono_thread_get_stack_bounds): Fix memory leak.
12810
12811         * class.c (setup_interface_offsets): Allocate memory from the image mempool.
12812
12813 2007-06-12  Raja R Harinath  <rharinath@novell.com>
12814
12815         * verify.c (TYPE_MAX): Set it to 8 to match the dimensions of all
12816         the tables.
12817
12818 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
12819
12820         *pedump.c (main): return error code 4 if assembly cannot be loaded instead of segfaulting
12821
12822 2007-06-11  Raja R Harinath  <harinath@gmail.com>
12823
12824         MonoGenericMethod on a diet
12825         * class-internals.h (_MonoMethodInflated::reflection_info): Move
12826         here ...
12827         (_MonoGenericMethod::reflection_info): ... from here.
12828         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition):
12829         Update to changes.
12830         * reflection.c (inflate_mono_method): Likewise.
12831         (mono_reflection_bind_generic_method_parameters): Likewise.
12832
12833 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
12834
12835         *verify.c: all debu printf statements are now guarded by VERIFY_DEBUG
12836         *verify.c: factored long ldarg forms to share code with short forms
12837
12838 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
12839
12840         *verify.c: fixed code formating factored some duplicate code
12841         into a new function
12842
12843         *verify.h: fixed binary incompatibility introduced earlier
12844
12845         *pedump.c: fixed formating
12846
12847 2007-06-11  Raja R Harinath  <harinath@gmail.com>
12848
12849         Fix assertion when disassembling Mono.C5.dll
12850         * loader.c (method_from_methodspec): Avoid inflating a method
12851         twice with the same context.  If the methodref is inflated, use
12852         the declaring method instead.
12853
12854         * class.c (mono_class_from_generic_parameter): Fix case similar to
12855         bug #81830 handled below, but for method containers.
12856
12857 2007-06-10  Raja R Harinath  <harinath@gmail.com>
12858
12859         * class.c (inflate_generic_type) [MONO_TYPE_CLASS]: Don't call
12860         get_shared_generic_class.  Directly inflate the instance.
12861         [MONO_TYPE_GENERICINST]: Inline inflate_generic_class.
12862         (inflate_generic_class): Delete.
12863         (get_shared_generic_class): Delete.  Move setting of
12864         'cached_class' and 'cached_context' ...
12865         * metadata.c (mono_metadata_lookup_generic_class): ... here.
12866
12867         * metadata.c (mono_metadata_lookup_generic_class): Change
12868         signature to take the components of a MonoGenericClass rather than
12869         an allocated MonoGenericClass.  Change semantics to be intern-like.
12870         * reflection.c (mono_class_bind_generic_parameters): Update to
12871         changes.  Make locking region tighter.
12872         * class.c (inflate_generic_class): Update to changes.
12873         (get_shared_generic_class): Likewise.
12874         * metadata-internals.h: Likewise.
12875
12876         * reflection.c (mono_class_bind_generic_parameters): Take and
12877         return a MonoClass*, not a MonoType*.  Add 'is_dynamic' parameter.
12878         (mono_reflection_bind_generic_parameters): Use
12879         'mono_class_bind_generic_parameters' rather than duplicate the code.
12880         * class.c (mono_bounded_array_class_get): Update to changes.
12881         * object-internals.h: Likewise.
12882
12883         * reflection.c (mono_class_bind_generic_parameters): Only support
12884         parameterizing generic type definitions.  Remove support for other
12885         open types.
12886
12887 2007-06-08  Zoltan Varga  <vargaz@gmail.com>
12888
12889         * loader.c (mono_free_method): Free method->signature as well. Fixes #81832.
12890
12891         * marshal.c (mono_marshal_get_managed_wrapper): Allocate the signature using malloc
12892         in the dynamic case.
12893
12894 2007-06-08  Gert Driesen  <drieseng@users.sourceforge.net>
12895
12896         * threads.c: When cleaning up thread, reset the Background bit.
12897         Fixes bug #81720.
12898
12899 2007-06-08  Jonathan Chambers  <joncham@gmail.com>
12900
12901        * metadata.c: Move variable declarations to top of scope.
12902        * verify.c: Move variable declarations to top of scope.
12903
12904        Code is contributed under MIT/X11 license.
12905
12906 2007-06-08  Raja R Harinath  <rharinath@novell.com>
12907
12908         * reflection.c (mono_class_bind_generic_parameters): Replace
12909         open-coded loop with mono_metadata_inflate_generic_inst.
12910
12911         * class.c (get_shared_generic_class): Don't call
12912         mono_get_shared_generic_inst.  Use the container's own
12913         'class_inst'.
12914
12915         * metadata.c (mono_metadata_load_generic_params): Move
12916         initialization of 'context' field here from ...
12917         * class.c (mono_class_create_from_typedef): ... here, and ...
12918         * loader.c (mono_get_method_from_token): ... here.
12919
12920         * class.c (get_shared_generic_class): Rename from
12921         mono_get_shared_generic_class and make static.
12922         (mono_get_shared_generic_inst): Move to metadata.c.
12923         * loader.c (mono_get_shared_generic_method): Likewise.
12924         * class-internals.h, metadata-internals.h: Update to changes.
12925
12926         Fix #81830
12927         * class.c (mono_class_from_generic_parameter): Don't assume a
12928         generic container owner exists.  Generic containers from monodis
12929         don't have any.
12930
12931 2007-06-06  Rodrigo Kumpera  <kumpera@gmail.com>
12932
12933         * pedump.c: pedump exists with 2 if assembly is not verifiable and 3 if invalid
12934         * verify.h: new typedefs to returns the non-verifiable status
12935         * verify.c: initial implementation of generics, stack merging and object compatibility check
12936
12937 2007-06-06  Mark Probst  <mark.probst@gmail.com>
12938
12939         * class.c, image.c, class-internals.h (MonoImage): class_cache is
12940         a MonoInternalHashTable again (fixed bug in internal hash table
12941         code).
12942
12943 2007-06-06  Mark Probst  <mark.probst@gmail.com>
12944
12945         * domain.c, domain-internals.h (MonoDomain): jit_code_hash is a
12946         MonoInternalHashTable again (fixed bug in internal hash table
12947         code).
12948
12949 2007-06-06  Mark Probst  <mark.probst@gmail.com>
12950
12951         * class.c, image.c, class-internals.h, domain.c,
12952         domain-internals.h (MonoImage): Reverting MonoInternalHashTable
12953         changes.  Have to figure out what makes them break the SWF
12954         regression.
12955
12956 2007-06-04  Mark Probst  <mark.probst@gmail.com>
12957
12958         * class.c, image.c, class-internals.h (MonoImage): class_cache is
12959         a MonoInternalHashTable now.
12960
12961 2007-06-04  Mark Probst  <mark.probst@gmail.com>
12962
12963         * domain.c, domain-internals.h (MonoDomain): jit_code_hash is a
12964         MonoInternalHashTable now.
12965
12966 2007-05-31  Zoltan Varga  <vargaz@gmail.com>
12967
12968         * domain-internals.h (MonoDomain): Add two new hash tables to store delegate
12969         invoke_impl code.
12970
12971         * object-internals.h (_MonoDelegate): Reflect changes to managed object layout.
12972
12973         * object.c (mono_delegate_ctor): Initialize invoke_impl field with an arch
12974         dependent trampoline.
12975
12976         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
12977
12978         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): New icall.
12979
12980 2007-05-29  Robert Jordan  <robertj@gmx.net>
12981
12982         * marshal.[c|h]: add mono_win32_compat_* wrappers. Fixes #81754.
12983
12984 2007-05-28  Zoltan Varga  <vargaz@gmail.com>
12985
12986         * icall.c (ves_icall_get_method_info): Handle loader errors. Fixes #81724.
12987
12988 2007-05-25  Jonathan Chambers  <joncham@gmail.com>
12989
12990        * marshal.c: Fix interface lookup loops for
12991        cominterop_get_com_slot_for_method and 
12992        cominterop_get_method_interface. Only need to lookup
12993        if type is a class, else use interface type method is on.
12994
12995        Code is contributed under MIT/X11 license.
12996
12997 2007-05-25  Sebastien Pouliot  <sebastien@ximian.com>
12998
12999         * reflection.c: HasSecurity can be present even if no specially 
13000         encoded (CAS) attributes are available (e.g. SuppressUnmanagedCode
13001         SecurityAttribute). Fix CAS regression tests on buildbot.
13002
13003 2007-05-24  Jonathan Chambers  <joncham@gmail.com>
13004
13005        * appdomain.c: Add configure checks for header files.
13006        * image.c: Add configure checks for header files.
13007        * file-io.c: Add configure checks for header files.
13008        * debug-mono-symfile.c: Add configure checks for header files.
13009        * threadpool.c: Add configure checks for header files.
13010        * console-io.c: Add configure checks for header files.
13011        * profiler.c: Add configure checks for header files.
13012        * rawbuffer.c: Add configure checks for header files.
13013        * icall.c: Add configure checks for header files.
13014        * rand.c: Add configure checks for header files.
13015        * socket-io.c: Add configure checks for header files.
13016
13017        Code is contributed under MIT/X11 license.
13018
13019 2007-05-24  Zoltan Varga  <vargaz@gmail.com>
13020
13021         * reflection.c (mono_custom_attrs_from_builders): Remove the 
13022         assertion as it breaks the build.
13023         
13024         * reflection.c (mono_custom_attrs_from_builders): Add an assertion.
13025
13026         * reflection.c (lookup_custom_attr): Make a copy here too.
13027
13028         * image.c (mono_image_check_for_module_cctor): Avoid accessing metadata in
13029         dynamic images.
13030
13031         * class.c (mono_class_init): Avoid accessing the metadata in dynamic
13032         images.
13033
13034         * reflection.c (mono_custom_attrs_from_param): Make a copy of the dynamic attr
13035         info.
13036
13037 2007-05-22  Zoltan Varga  <vargaz@gmail.com>
13038
13039         * reflection.c (encode_cattr_value): Fix yet another object cattr encoding issue.
13040         (load_cattr_value): Ditto.
13041
13042 2007-05-20  Zoltan Varga  <vargaz@gmail.com>
13043
13044         * marshal.c (mono_marshal_get_delegate_invoke): Improve the generated IL a little.
13045
13046 2007-05-19  Gert Driesen  <drieseng@users.sourceforge.net>
13047
13048         * threads.c: In "start_wrapper", set apartment_state to MTA if
13049         apartment_state is Unknown and we're running on 2.0 profile or
13050         higher.
13051         * object.c: In "mono_runtime_exec_main", if STAThread is not applied
13052         to main method, then set apartment_state to Unknown on 1.0 profile,
13053         and MTA on 2.0 profile.
13054
13055 2007-05-16  Jb Evain  <jb@nurv.fr>
13056
13057         * class-internals.h (MonoDefaults): Add an attribute_class and
13058           customattribute_data_class.
13059         * domain.c (mono_init_internal): Populate them.
13060         * reflection.c: Use them to remove duplicates. Make a vew
13061         MonoClass variables `static'.
13062
13063 2007-05-15  Massimiliano Mantione  <massi@ximian.com>
13064
13065         * class-internals.h: Added "MonoVTable.interface_bitmap" as a next
13066         step in implementing IMT, so that all isinst checks now can go
13067         through the bitmap.
13068         This was needed because vtables for TransparentProxy need to look
13069         like the vtable of the "target" class, so they need to point to
13070         its interface bitmap directly.
13071
13072         * object.c: inside "mono_class_create_runtime_vtable" and
13073         "mono_class_proxy_vtable", initialize "MonoVTable.interface_bitmap".
13074
13075 2007-05-15  Atsushi Enomoto  <atsushi@ximian.com>
13076
13077         * object-internals.h
13078           culture-info.h : added territory field in MonoCulture and
13079           CultureInfoEntry foreach. Added lcid field in RegionInfoEntry.
13080         * locales.c : fill territory field above too.
13081         * culture-info-table.h : regenerated.
13082
13083 2007-05-12  Zoltan Varga  <vargaz@gmail.com>
13084
13085         * class-internals.h (_MonoGenericContainer): Widen type_argc filed to 31 bits.
13086         Fixes #81599.
13087
13088 2007-05-11  Jonathan Chambers  <joncham@gmail.com>
13089
13090         * object.c: Always initialize apartment, even if 
13091         there is no custom attributes on entry point.
13092         
13093         Code is contributed under MIT/X11 license.
13094
13095 2007-05-10  Jonathan Chambers  <joncham@gmail.com>
13096
13097         * marshal.c: LPTSTR == LPWSTR on Win32. Fixes #81370.
13098         * metadata.c: If no encoding is set, check for unicode
13099         on class.
13100         
13101         Code is contributed under MIT/X11 license.
13102
13103 2007-05-09  Jonathan Chambers  <joncham@gmail.com>
13104
13105         * threads.c: Handle if mono_thread_current returns NULL 
13106         
13107         Code is contributed under MIT/X11 license.
13108
13109 2007-05-09  Jonathan Chambers  <joncham@gmail.com>
13110
13111         * threads.c: Initialize Thread.AprtmentState and set on Thread.Start
13112         in start_wrapper. Added mono_thread_init_apartment_state and
13113         mono_thread_cleanup_apartment_state.
13114         * object.c: Initialize thread apartment state on main thread
13115         by checking for STAThreadAttribute on entry point.
13116         * object-internals.h: Add apartment_state field to MonoThread.
13117         * threads-types.h: Add unmanaged definition of 
13118         System.Threading.ApartmentState, MonoThreadApartmentState.
13119         
13120         Code is contributed under MIT/X11 license.
13121         
13122 2007-05-08  Jonathan Chambers  <joncham@gmail.com>
13123
13124         * class.c: Fix windows build.
13125         * class-internals.h: Fix windows build.
13126         
13127         Code is contributed under MIT/X11 license.
13128
13129 2007-05-08  Robert Jordan  <robertj@gmx.net>
13130
13131         * process.c (CreateProcess_internal):
13132         Pass CREATE_NO_WINDOW to CreateProcess when ProcessStartupInfo
13133         .CreateNoWindow was specified. Fixes #81496.
13134
13135 2007-05-08  Massimiliano Mantione  <massi@ximian.com>
13136
13137         * class-internals.h: Removed "MonoClass.interface_offsets" as a first
13138         step in implementing IMT, replaced it with two compact arrays
13139         (interfaces_packed and interface_offsets_packed) and a bitmap that
13140         is used for isinst checks (interface_bitmap).
13141
13142         * class.c: (compare_interface_ids): compare function to pass to
13143         bsearch when looking for an interface with a given id.
13144         (mono_class_interface_offset): reimplemented using bsearch on
13145         interfaces_packed, getting the offset from interface_offsets_packed.
13146         (print_implemented_interfaces): utility debugging function.
13147         (setup_interface_offsets): reworked to initialize interfaces_packed,
13148         interface_offsets_packed and interface_bitmap.
13149
13150         * object.c: replaced all accesses to "MonoClass.interface_offsets"
13151         with uses of interfaces_packed and interface_offsets_packed.
13152
13153 2007-05-08  Massimiliano Mantione  <massi@ximian.com>
13154
13155         * class-internals.h: Added MONO_CLASS_IMPLEMENTS_INTERFACE macro and
13156         mono_class_interface_offset prototype to wrap all accesses to
13157         "MonoClass.interface_offsets".
13158
13159         * class.c: Implemented mono_class_interface_offset, and wrapped all
13160         accesses to "MonoClass.interface_offsets".
13161
13162         * monodiet.c, object.c, marshal.c, icall.c: wrapped all accesses to
13163         "MonoClass.interface_offsets".
13164
13165 Tue May 8 13:02:09 CEST 2007 Paolo Molaro <lupus@ximian.com>
13166
13167         * icall.c, icall-def.h: implemented new GetFieldFromHandle and
13168         GetMethodFromHandle overloads (bug #78637).
13169
13170 Tue May 8 12:22:14 CEST 2007 Paolo Molaro <lupus@ximian.com>
13171
13172         * assembly.c: parse ProcessorArchitecture in assembly name and ignore
13173         it for now (see mono-devel, from Marek Sieradzki <marek.sieradzki@gmail.com>).
13174
13175 2007-05-01  Zoltan Varga  <vargaz@gmail.com>
13176
13177         * icall.c (custom_attrs_get_by_type): Handle loading errors gracefully. Fixes
13178         #81498.
13179
13180         * reflection.c (mono_reflection_get_custom_attrs_by_type): Handle loading errors
13181         gracefully.
13182         (mono_custom_attrs_from_index): Ditto.
13183
13184         * icall.c (ves_icall_InternalInvoke): Allow calling ctors of abstract classes. 
13185         Fixes #81501.
13186
13187 2007-04-30  Zoltan Varga  <vargaz@gmail.com>
13188
13189         * metadata.c (mono_metadata_parse_type_full): Avoid an invalid free since the type
13190         is now allocated from a mempool.
13191
13192 2007-04-28  Zoltan Varga  <vargaz@gmail.com>
13193
13194         * threads.c (build_wait_tids): Do not call mono_monitor_enter () here since the
13195         caller holds threads_lock, leading to deadlocks. Fixes #81476.
13196
13197 2007-04-26  Zoltan Varga  <vargaz@gmail.com>
13198
13199         * loader.c (mono_loader_error_prepare_exception): Fix crash caused by calling
13200         mono_loader_clear_error () too late. Fixes #81463.
13201
13202 2007-04-26  Atsushi Enomoto  <atsushi@ximian.com>
13203
13204         * culture-info-table.h : regenerated.
13205
13206 2007-04-25  Zoltan Varga  <vargaz@gmail.com>
13207
13208         * appdomain.c (add_assemblies_to_domain): Fix crash when an assembly reference
13209         is missing.
13210
13211 2007-04-25  Dick Porter  <dick@ximian.com>
13212
13213         * Makefile.am: Put the mingw enforced-optimisation back into the
13214         PLATFORM_WIN32 section.
13215
13216 2007-04-24  Zoltan Varga  <vargaz@gmail.com>
13217
13218         * reflection.c (mono_image_load_module_dynamic): Fix crash introduced by previous
13219         patch.
13220
13221         * image.c (mono_image_load_module): New API function to load a module reference.
13222
13223         * image.c (load_modules): Load modules lazily. Fixes #80812.
13224
13225         * class.c (mono_class_from_typeref): Use mono_image_load_module.
13226         
13227         * reflection.c (mono_image_load_module_dynamic): Copy image->modules_loaded too.
13228
13229         * object-internals.h reflection.c icall-def.h (mono_image_load_module): Rename this 
13230         to mono_image_load_module_dynamic.
13231
13232 2007-04-23  Jonathan Chambers  <joncham@gmail.com>
13233
13234         * marshal.c: Fix calling convention for CCW on non-windows
13235         platforms. STDCALL on windows, CDECL everywhere else to work 
13236         with XPCOM and MainWin COM.
13237         
13238         Code is contributed under MIT/X11 license.
13239
13240 2007-04-23  Martin Baulig  <martin@ximian.com>
13241
13242         Fix #80969.
13243
13244         * loader.c
13245         (method_from_memberref): Added `gboolean *used_context' argument.
13246         (mono_get_method_from_token): Likewise.
13247         (mono_get_method_full): Don't insert the method in the cache when
13248         `used_context' is true.
13249
13250 2007-04-23  Raja R Harinath  <rharinath@novell.com>
13251
13252         * monodiet.c (add_types_from_method): Fix "wrong type" warning.
13253
13254         * reflection.c (mono_reflection_bind_generic_parameters): Don't
13255         create new MonoTypes for returned types.
13256         * class.c (mono_generic_class_get_class): Export mono-internal.
13257         * class-internals.h: Update to changes.
13258
13259 Thu Apr 19 16:45:55 CEST 2007 Paolo Molaro <lupus@ximian.com>
13260
13261         * threadpool.c, threadpool.h, icall-def.h: patch from
13262         Robert Jordan to implemnt ThreadPool.SetMaxThreads.
13263
13264 2007-04-18  Zoltan Varga  <vargaz@gmail.com>
13265
13266         * threads.c (mono_thread_get_stack_bounds): Fix windows build.
13267         
13268         * threads.c (mono_thread_get_stack_bounds): Remove an assert which can be triggered.
13269
13270         * threads.c (mono_thread_get_stack_bounds): New helper function.
13271
13272         * threads.c (mono_thread_attach): Applied patch from horst.reiterer@fabasoft.com.
13273         Correctly compute stack bounds when attaching. Fixes #81394.
13274
13275 Wed Apr 18 18:28:41 BST 2007 Paolo Molaro <lupus@ximian.com>
13276
13277         * reflection.c: fix handling of doubles in custom attributes
13278         for the arm-fpa format (bug #81368).
13279
13280 2007-04-18  Raja R Harinath  <rharinath@novell.com>
13281
13282         * reflection.c (assembly_add_win32_resources): Mildly relax an
13283         bounds check to let the end pointer point just past the end of the
13284         allocated buffer.  (may fix #81384)
13285
13286 2007-04-17  Atsushi Enomoto  <atsushi@ximian.com>
13287
13288         * culture-info-table.h : regenerated.
13289
13290 2007-04-07  Zoltan Varga  <vargaz@gmail.com>
13291
13292         * threads.c (start_wrapper): Call push_appdomain_ref () earlier to fix races where
13293         the thread is aborted early.
13294
13295 2007-04-05  Dick Porter  <dick@ximian.com>
13296
13297         * file-io.c (ves_icall_System_IO_MonoIO_GetFileSystemEntries): use
13298         FindFirstFile()/FindNextFile() to find entries.  This lets the
13299         io-layer versions use MONO_IOMAP compatibility helpers.  Fixes bug
13300         81038.
13301
13302         * appdomain.c (MONO_CORLIB_VERSION): Increment, as the usage of
13303         the parameters of
13304         ves_icall_System_IO_MonoIO_GetFileSystemEntries() has changed.
13305
13306 2007-04-04  Martin Baulig  <martin@ximian.com>
13307
13308         * debug-helpers.c
13309         (mono_method_desc_full_match): Add support for nested classes.
13310
13311 2007-04-02  Zoltan Varga  <vargaz@gmail.com>
13312
13313         * marshal.c (cominterop_get_managed_wrapper_adjusted): Fix warnings.
13314
13315 2007-04-01  Zoltan Varga  <vargaz@gmail.com>
13316
13317         * threads.c (abort_appdomain_thread): Avoid handle leakage if we are
13318         waiting for too many threads.
13319
13320 2007-03-28  Sebastien Pouliot  <sebastien@ximian.com>
13321
13322         * environment.c: Fix return value check on uname so we can get the 
13323         executing version on Solaris operating systems.
13324
13325 2007-03-28  Jb Evain  <jbevain@gmail.com>
13326
13327         * class.c (mono_type_get_name_recurse): Complete the
13328         fix for the creation of assembly qualified names for
13329         pointer types. Fixes #81208.
13330
13331 2007-03-27  Dick Porter  <dick@ximian.com>
13332
13333         * appdomain.c (MONO_CORLIB_VERSION): Increment, as the signature
13334         of ves_icall_System_Threading_Mutex_ReleaseMutex_internal() has
13335         changed.
13336
13337         * threads.c
13338         (ves_icall_System_Threading_Mutex_ReleaseMutex_internal): Return
13339         the value of ReleaseMutex().
13340
13341 2007-03-27  Dick Porter  <dick@ximian.com>
13342
13343         * socket-io.c (ipaddress_to_struct_in_addr): IPAddress is stored
13344         in little-endian order, not network endian, so must be converted
13345         to host endian here.  Fixes bug 80593.
13346
13347 2007-03-22  Jb Evain  <jbevain@gmail.com>
13348
13349         * class.c (mono_type_get_name_recurse): Fix the creation of assembly
13350         qualified names for pointer types. Fixes #81208.
13351
13352 2007-03-21  Jonathan Chambers  <joncham@gmail.com>
13353
13354         * marshal.c: Add support for PreserveSigAttribute. 
13355         
13356         Code is contributed under MIT/X11 license.
13357
13358 2007-03-14  Zoltan Varga  <vargaz@gmail.com>
13359
13360         * process.c: Fix endianness issues. Fixes #81126.
13361
13362         * reflection.c (mono_reflection_create_dynamic_method): Fix the last change so
13363         multiple circular calls made from the same DynamicMethod work. Fixes #81141.
13364
13365         * image.c (mono_image_lookup_resource): Make this work on big-endian
13366         machines.Change API contract so the caller needs to free the return value.
13367         
13368         * process.c (process_get_fileversion): Adapt to mono_image_lookup_resource ()
13369         API change.
13370         
13371 2007-03-14  Martin Baulig  <martin@ximian.com>
13372
13373         * debug-helpers.c (mono_type_get_desc): In `MONO_TYPE_ARRAY', use
13374         mono_type_get_desc() as well.
13375
13376 2007-03-13  Jonathan Chambers  <joncham@gmail.com>
13377
13378         * icall.c:  Fix environ access in VS.  
13379         
13380 2007-03-13  Alp Toker  <alp@atoker.com>
13381
13382         * icall.c (ves_icall_MonoType_GetElementType): For enums, return null
13383         rather than the underlying type. Based on a patch by Ben Maurer. Fixes
13384         #63841.
13385
13386 2007-03-12  Zoltan Varga  <vargaz@gmail.com>
13387
13388         * reflection.c (mono_reflection_create_dynamic_method): Add support for 
13389         circular references among dynamic methods. Fixes #81091.
13390
13391         * object-internals.h (MonoReflectionDynamicMethod): Add 'referenced_by' field.
13392
13393 2007-03-09  Martin Baulig  <martin@ximian.com>
13394
13395         * reflection.c (encode_constant): Add support for MONO_TYPE_GENERICINST.
13396
13397 2007-03-09  Jonathan Chambers  <joncham@gmail.com>
13398
13399         * appdomain.c:  Fix shadow copy on Windows. Use g_snprintf instead
13400         of snprintf as it doesn't exist on Win32 (VS build); also for uniformity.  
13401         
13402         Code is contributed under MIT/X11 license.
13403         
13404 2007-03-09  Gert Driesen  <drieseng@users.souceforge.net>
13405
13406         * loader.c: Reapply patch for bug #79424.
13407
13408 2007-03-06  Zoltan Varga  <vargaz@gmail.com>
13409
13410         * metadata.c (mono_type_to_unmanaged): Only convert object to
13411         MARSHAL_CONV_SAFEHANDLE on the 2.0 profile.
13412
13413 Tue Mar 6 15:39:48 CET 2007 Paolo Molaro <lupus@ximian.com>
13414
13415         * class-internals.h, class.c, metadata.c, reflection.c: removed unused
13416         (and incorrectly set) is_reference field from MonoGenericInst.
13417
13418 2007-03-06  Zoltan Varga  <vargaz@gmail.com>
13419
13420         * assembly.c (mono_assembly_load_from_full): Call mono_assemblies_unlock ()
13421         a little earlier.
13422
13423         * icall.c (ves_icall_type_Equals): Rename this to ves_icall_System_Type_EqualsInternal.
13424
13425         * icall-def.h: Rename Type:Equals to Type:EqualsInternal.
13426
13427 2007-03-05  Miguel de Icaza  <miguel@novell.com>
13428
13429         * file-io.c (ves_icall_System_IO_MonoIO_Open): Use the new
13430         FileOptions.1 value to mean "temporary", map that to
13431         FILE_ATTRIBUTE_TEMPORARY and use that to signal 600 permissions.
13432
13433         Fixes 80688
13434
13435 2007-03-03  Marek Habersack  <mhabersack@novell.com>
13436
13437         * appdomain.c: implement MS .Net style shadow copying. Copies of
13438         the assemblies are made in a subdirectory of the dynamic base
13439         directory, the assembly names are preserved.
13440         Copy .mdb and .config files along with the assemblies being shadowed.
13441
13442 2007-02-28  Zoltan Varga  <vargaz@gmail.com>
13443
13444         * marshal.c (emit_object_to_ptr_conv): Emit valid IL for handling HandleRefs.
13445         (emit_marshal_handleref): Ditto.
13446
13447         * profiler.c: Applied patch from Tor Lillqvist (tml@novell.com) to fix output
13448         on Visual C++. Fixes #80671.
13449
13450 Wed Feb 28 16:53:40 CET 2007 Paolo Molaro <lupus@ximian.com>
13451
13452         * boehm-gc.c, null-gc.c, object.h, object.c: sgen gc fixes
13453         for clone operations.
13454
13455 2007-02-28  Zoltan Varga  <vargaz@gmail.com>
13456
13457         * marshal.c: Fix warnings.
13458
13459 Fri Feb 23 15:06:57 CET 2007 Paolo Molaro <lupus@ximian.com>
13460
13461         * loader.c: allow case-insensitive matching of the dll name
13462         in dllmap handling when prefixed with "i:".
13463
13464 2007-02-20  Jonathan Chambers  <joncham@gmail.com>
13465
13466         * threads.c: Fix #ifdef for dummy_apc function for VS.
13467
13468 Tue Feb 20 11:59:42 CET 2007 Paolo Molaro <lupus@ximian.com>
13469
13470         * threads.c: don't throw in MemoryBarrier (), use lock/unlock.
13471
13472 2007-02-19  Massimiliano Mantione  <massi@ximian.com>
13473         * class.c (mono_class_setup_vtable_general): Fix bug 75903,
13474         giving precedence to the methods with a fully qualified name
13475         (InterfaceName.MethodName) when building the interface sections
13476         of the vtable.
13477
13478 2007-02-16  Dick Porter  <dick@ximian.com>
13479
13480         * threadpool.c (append_job): Fix fast-path array handling, so it's
13481         less likely the array will grow exponentially when the load is
13482         heavy.
13483
13484 Fri Feb 16 19:17:30 CET 2007 Paolo Molaro <lupus@ximian.com>
13485
13486         * metadata-internals.h, loader.c: fix dllmap lookup order
13487         for non-function maps, too, and prepare for fallback code.
13488
13489 2007-02-12  Robert Jordan  <robertj@gmx.net>
13490
13491         * marshal.c, marshal.h, icall-def.h: rename mono_marshal_realloc
13492         to ves_icall_System_Runtime_InteropServices_Marshal_ReAllocHGlobal
13493         and use GlobalReAlloc on WIN32 to be in sync with GlobalAlloc,
13494         GlobalFree. Fixes a part of bug #77075.
13495
13496 Mon Feb 12 21:10:07 CET 2007 Paolo Molaro <lupus@ximian.com>
13497
13498         * loader.c: implemented typedef parent in field memberref.
13499
13500 2007-02-11  Jonathan Chambers  <joncham@gmail.com>
13501
13502         * marshal.c: Fix warnings and remember to call Release on
13503         IUnknown of RCW.
13504         
13505         Code is contributed under MIT/X11 license.
13506
13507 2007-02-10  Miguel de Icaza  <miguel@novell.com>
13508
13509         * class-internals.h: Add MonoHandleRef definition, and
13510         handleref_class to mono_defaults. 
13511
13512         * metadata.c (mono_type_to_unmanaged): If we find HandleRefs in a
13513         structure, use new conversion MONO_MARSHAL_CONV_HANDLEREF.
13514
13515         * marshal.c (emit_ptr_to_object_conv): Add support for HandleRefs
13516         (do nothing on this stage)
13517         (emit_object_to_ptr_conv): Extract the handle from the HandleRef.  
13518         (emit_marshal_handleref): New method, used for argument handling
13519         of HandleRefs. 
13520
13521 2007-02-08  Jonathan Chambers  <joncham@gmail.com>
13522
13523         * class.c (mono_class_setup_parent): Lazily init com types.
13524         * domain.c (mono_init_internal, mono_init_com_types): Lazily 
13525         init com types.
13526         * object.c (mono_remote_class_vtable): Lazily init com types.
13527         * class-internals.h: Add iunknown and idispatch to MonoDefaults.
13528         * object-internals.h: Add MonoComInteropProxy and MonoReflectionGuidAttribute.
13529         * domain-internals.h: Expose mono_init_com_types.
13530         * icall-def.h: Add icalls for ComInteropProxy, __ComObject, and Marshal.
13531         * marshal.c: Add mutex for cominterop use. Init locals for wrapper methods.
13532         Add support for COM Callable Wrapper marshalling.
13533         * marshal.h: Add icall definitions.
13534         * gc.c: Handle freeing of CCWs in finalizer code.
13535         
13536         Code is contributed under MIT/X11 license.
13537
13538 Thu Feb 8 12:46:18 CET 2007 Paolo Molaro <lupus@ximian.com>
13539
13540         * reflection.c: changed all the signature encoding code to use
13541         a variable-sized buffer.
13542
13543 Wed Feb 7 20:37:23 CET 2007 Paolo Molaro <lupus@ximian.com>
13544
13545         * marshal.c: locking fixes: never take the loader lock
13546         or other runtime locks when holding the marshal lock
13547         (fixes bug#80664).
13548
13549 Wed Feb 7 18:49:10 CET 2007 Paolo Molaro <lupus@ximian.com>
13550
13551         * marshal.c: make the delegate function pointer mapping
13552         work for the moving GC.
13553
13554 Mon Jan 29 11:30:46 CET 2007 Paolo Molaro <lupus@ximian.com>
13555
13556         * marshal.c: fix from Robert Jordan (robertj@gmx.net)
13557         for bug #80618.
13558
13559 Fri Jan 26 12:49:23 CET 2007 Paolo Molaro <lupus@ximian.com>
13560
13561         * image.h, loader.c, metadata-internals.h: use mono-dl instead of
13562         gmodule.
13563
13564 Fri Jan 26 12:00:45 CET 2007 Paolo Molaro <lupus@ximian.com>
13565
13566         * threadpool.c: made the code moving-GC safe.
13567
13568 Thu Jan 25 20:31:41 CET 2007 Paolo Molaro <lupus@ximian.com>
13569
13570         * assembly.c, boehm-gc.c, class-internals.h, class.c,
13571         debug-mono-symfile.c, domain.c, locales.c, marshal.c, metadata.c,
13572         monitor.c, mono-debug.c, mono-debug.h, object.c, profiler.c:
13573         warning cleanup.
13574         * reflection.c: warning cleanup, some threading and moving GC fixes.
13575
13576 Thu Jan 25 16:22:36 CET 2007 Paolo Molaro <lupus@ximian.com>
13577
13578         * class.c, loader.c: create the needed Set/Get/Address array methods
13579         as well as the .ctors in mono_class_init (), fixes bug #80567.
13580
13581 2007-01-24  Zoltan Varga  <vargaz@gmail.com>
13582
13583         * class.c (mono_class_layout_fields): When force-aligning a field, make sure
13584         we doesn't decrease its alignment. Should fix the sparc build.
13585
13586 2007-01-24  Dick Porter  <dick@ximian.com>
13587
13588         * socket-io.c
13589         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
13590         Create the returned object if we need to ignore an unsupported
13591         socket option.  Fixes a segfault reported by Atsushi.
13592
13593 Tue Jan 23 18:09:21 CET 2007 Paolo Molaro <lupus@ximian.com>
13594
13595         * class.c, object.c: restrict GC-tracked fields to
13596         UIntPtr fields used inside corlib, so we provide better
13597         type info to the GC and also allow broken packing as in
13598         bug #80580.
13599
13600 Mon Jan 22 11:24:27 CET 2007 Paolo Molaro <lupus@ximian.com>
13601
13602         * sgen-gc.c: removed duplicated function.
13603
13604 2007-01-19  Miguel de Icaza  <miguel@novell.com>
13605
13606         *  socket-io.c (convert_sockopt_level_and_name): return -2 as a
13607         value that means that the value is not supported, but that we
13608         should not return a failure, but instead report this as a
13609         successful operation.
13610
13611 2007-01-19  Raja R Harinath  <rharinath@novell.com>
13612
13613         Fix tests/bug79956.2.il
13614         * class.c (mono_type_get_underlying_type): Handle genericinst enums.
13615         (mono_generic_class_get_class): If the generic definition in an
13616         enum, copy over other fields related to it.
13617
13618 Thu Jan 18 18:37:28 CET 2007 Paolo Molaro <lupus@ximian.com>
13619
13620         * metadata.h: fix MONO_TYPE_ISSTRUCT() to not consider
13621         genericinst enums (bug #79215).
13622
13623 2007-01-17  Massimiliano Mantione  <massi@ximian.com>
13624         * class.c: Fix bug 80307.
13625
13626 Wed Jan 17 17:09:20 CET 2007 Paolo Molaro <lupus@ximian.com>
13627
13628         * image.c: if the file table is not present, try to load
13629         all the modules, since we don't have info about them
13630         having or not metadata (bug #80517).
13631         * assembly.c: allow mono_assembly_load_references () to
13632         work for netmodules.
13633
13634 Wed Jan 17 14:28:30 CET 2007 Paolo Molaro <lupus@ximian.com>
13635
13636         * image.c, metadata-internals.h, object.c: execute module
13637         cctors when running on the 2 runtime if present (bug #80487).
13638
13639 Tue Jan 16 15:32:53 CET 2007 Paolo Molaro <lupus@ximian.com>
13640
13641         * icall.c: optimized InitializeArray() on bigendian.
13642
13643 Tue Jan 16 13:18:51 CET 2007 Paolo Molaro <lupus@ximian.com>
13644
13645         * icall.c: fix for the broken ARM FPA double format.
13646
13647 Tue Jan 16 12:51:16 CET 2007 Paolo Molaro <lupus@ximian.com>
13648
13649         * icall.c: handle endian issues for r4 and r8 types, too, in
13650         the InitializeArray() icall.
13651
13652 2007-01-15  Miguel de Icaza  <miguel@novell.com>
13653
13654         * loader.c (mono_loader_error_prepare_exception): Clear the error
13655         once we have extracted the information from it, do this before we
13656         call into the JIT's class loading mechanisms.
13657
13658         * object.c (mono_class_create_runtime_vtable): Do not clear the
13659         loader error before calling mono_class_get_exception_for_failure
13660         as the loader error is needed inside
13661         mono_class_get_exception_for_failure to throw the error (thinko).
13662
13663         Fixes #80521
13664         
13665 Mon Jan 15 10:27:31 CET 2007 Paolo Molaro <lupus@ximian.com>
13666
13667         * reflection.c: align fields rva data so it's faster to load at
13668         runtime.
13669
13670 2007-01-12  Raja R Harinath  <rharinath@novell.com>
13671
13672         Prepare to simplify GenericMethod handling.
13673         * class-internals.h (mono_method_get_context): New accessor function.
13674         * class.c, icall.c, loader.c, reflection.c, verify.c: Use accessor
13675         rather than directly accessing '->context' field.
13676
13677         * class-internals.h (_MonoGenericParam.method): Move ...
13678         (_MonoGenericContainer): ... here.  Add into union with klass field.
13679         * class.c, icall.c, loader.c, metadata.c, reflection.c:
13680         Update to changes.
13681
13682 Fri Jan 12 11:58:52 CET 2007 Paolo Molaro <lupus@ximian.com>
13683
13684         * Makefile.am, class-internals.h, debug-helpers.c: consolidate
13685         the wrapper type enum and reduce relocations.
13686
13687 2007-01-12  Raja R Harinath  <rharinath@novell.com>
13688
13689         * reflection.c (inflate_mono_method): Reuse method instantiation
13690         from the generic method, if available.
13691
13692 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
13693
13694         * marshal.c (emit_marshal_variant): Fix conv_arg
13695         type in last commit, based on whether parameter is byref.
13696         
13697 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
13698
13699         * marshal.c (emit_marshal_variant): Handle unmanaged->managed
13700         marshalling.
13701         (mono_marshal_emit_managed_wrapper): Convert byref arguments of type
13702         MONO_TYPE_OBJECT back for VARIANT support.
13703
13704 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
13705
13706         * marshal.c, marshal.h, icall-def.h: Implement 
13707         Marshal.ReAllocCoTaskMem.
13708
13709 Thu Jan 11 19:00:03 CET 2007 Paolo Molaro <lupus@ximian.com>
13710
13711         * marshal.c: memory retention fixes: use the proper
13712         image cache for runtime_invoke method lookups.
13713
13714 Thu Jan 11 18:53:19 CET 2007 Paolo Molaro <lupus@ximian.com>
13715
13716         * mempool.c: added code to help debug mempool allocations.
13717
13718 2007-01-11  Dick Porter  <dick@ximian.com>
13719
13720         * socket-io.c (convert_sockopt_level_and_name): Add DontFragment
13721         support (experimenting with faking it with IP_MTU_DISCOVER for
13722         systems that don't have IP_DONTFRAGMENT.)
13723         (ves_icall_System_Net_Sockets_Socket_Disconnect_internal): New
13724         icall.
13725
13726         * icall-def.h: new System.Net.Sockets.Disconnect icall.
13727
13728         * socket-io.h: Add new fields to MonoSocketAsyncResult
13729         corresponding to the new ones in Socket.cs.
13730
13731 2007-01-11  Raja R Harinath  <rharinath@novell.com>
13732
13733         Fix IronPython regression mentioned in #80249
13734         * metadata.c (do_mono_metadata_parse_generic_class): Clear
13735         'cached_context' field, since it may have been initialized as a
13736         side-effect of metadata parsing.
13737
13738         * class-internals.h (_MonoGenericClass.is_inflated): Remove.
13739         (_MonoGenericClass.cached_class): Move here and rename from lone
13740         remaining field of ...
13741         (_MonoInflatedGenericClass): ... this.  Remove.
13742         * metadata.h, class.c, reflection.c, metadata.c, icall.c: Update
13743         to changes.
13744
13745         Fix mcs/tests/test-128.cs regression.
13746         * reflection.c (encode_cattr_value) [MONO_TYPE_SZARRAY]: Revert
13747         2007-01-10 change below.
13748         [MONO_TYPE_OBJECT]: Recurse into array case.
13749
13750 2007-01-11  Raja R Harinath  <harinath@gmail.com>
13751
13752         * class-internals.h (mono_get_inflated_generic_class): Remove.
13753         * class.c (mono_get_inflated_generic_class): Remove.
13754         (mono_generic_class_get_class): Rename from
13755         mono_class_create_generic.
13756         (mono_class_from_mono_type) [GENERICINST]: Use it.
13757         * reflection.c, metadata.c: Update to changes.  Use
13758         'mono_class_from_mono_type'.
13759
13760 Wed Jan 10 16:19:54 CET 2007 Paolo Molaro <lupus@ximian.com>
13761
13762         * reflection.c: use passed type when encoding an array element
13763         in custom attributes (patch from David Mitchell, dmitchell@logos.com).
13764
13765 2007-01-09  Robert Jordan  <robertj@gmx.net>
13766
13767         * marshal.c (mono_delegate_end_invoke): Add check for unpaired asyc
13768         result arguments (someDelegate.EndInvoke (unrelatedAres)).
13769         Fixes bug #80392.
13770
13771 2007-01-09  Raja R Harinath  <rharinath@novell.com>
13772
13773         * class-internals.h (_MonoInflatedGenericClass.is_initialized): Remove.
13774
13775         * object.c (set_value): Avoid aliasing between type->data.klass
13776         and type->data.generic_class.
13777
13778         * class.c (mono_class_create_generic): Don't use 'is_initialized' field.
13779
13780 2007-01-08  Raja R Harinath  <rharinath@novell.com>
13781
13782         * marshal.c (mono_marshal_get_runtime_invoke): Avoid aliasing
13783         between type->data.klass and type->data.generic_class.
13784
13785 2007-01-08  Lluis Sanchez  <lluis@ximian.com>
13786
13787         * marshal.c: In MS.NET, StringBuilder objects are not copied by
13788         value in out parameters.
13789
13790 2007-01-08  Raja R Harinath  <rharinath@novell.com>
13791
13792         Simplify invariant for MonoGenericClass::klass field.
13793         * class.c (mono_class_create_generic): Verify 'klass' is null.
13794         * metadata.c (do_mono_metadata_parse_generic_class): Don't
13795         initialize 'klass' field.
13796
13797 2007-01-05  Raja R Harinath  <rharinath@novell.com>
13798
13799         Ongoing work to avoid redundant data and simplify invariants.
13800         * class-internals.h (_MonoGenericMethod.class_inst): Rename from
13801         'generic_class', and change type to a GenericInst.
13802         (_MonoGenericContext.class_inst): Likewise, rename from 'gclass'.
13803         * class.c, loader.c, metadata.c, reflection.c: Update to changes.
13804
13805 2007-01-05  Atsushi Enomoto  <atsushi@ximian.com>
13806
13807         * class.c : skip io-layer under PLATFORM_WIN32.
13808
13809 2007-01-03  Tor Lillqvist  <tml@novell.com>
13810
13811         Fix #80305: In a bundled executable, look in the bundled exe
13812         assembly to determine the runtime version. Add the possibility to
13813         bundle also the machine.config file.
13814         
13815         * assembly.c (mono_assembly_open_from_bundle): Make
13816         non-static. Allow being called even if we have no bundled
13817         assemblies, and return NULL right away in that case.
13818
13819         * domain-internals.h: Declare mono_assembly_open_from_bundle()
13820         here.
13821
13822         * domain.c (app_config_parse): Take an assembly exe file name as
13823         parameter instead of a config file name. Check for a bundled
13824         config file for that assembly by calling
13825         mono_config_string_for_assembly_file() (see below) before looking
13826         for one in the file system.
13827         (get_runtimes_from_exe): Corrsponding change to call of
13828         app_config_parse().
13829         (get_runtimes_from_exe): Check for bundled assembly exe file first
13830         by calling mono_assembly_open_from_bundle(). If no bundled
13831         assembly exe file is found, call mono_image_open() as before to
13832         look it up in the file system.
13833
13834         * mono-config.c: Add variable bundled_machinec_onfig.
13835         (mono_config_string_for_assembly_file): New function.
13836         (mono_config_for_assembly): Move code snippet that looks for a
13837         bundled assembly .config file into the above new function. Call
13838         it.
13839         (mono_register_machine_config, mono_get_machine_config): New
13840         functions to set and retrieve
13841
13842         * assembly.h: Declare mono_register_machine_config().
13843
13844         * mono-config.h: Declare mono_get_machine_config() and
13845         mono_config_string_for_assembly_file().
13846
13847         * icall.c: No declaration of environ necessary on Win32. It is
13848         declared (as a macro expanding to a function call) in stdlib.h.
13849         (ves_icall_System_Configuration_DefaultConfig_get_bundled_machine_config):
13850         New internal mono function. Returns the value of
13851         mono_get_machine_config() as a Mono string.
13852
13853         * icall-def.h: Add get_bundled_machine_config().
13854
13855 2007-01-04  Raja R Harinath  <rharinath@novell.com>
13856
13857         Remove redundant field
13858         * class-internals.h (_MonoGenericContext.container): Remove field.
13859         * loader.c (mono_method_get_signature_full): Don't parse a
13860         "container" for a signature parse when the signature is inflated
13861         immediately.
13862         (method_from_methodspec): Likewise, for a generic_inst.
13863         * class.c, metadata.c, reflection.c: Update to changes.
13864
13865 2006-01-04  Raja R Harinath  <rharinath@novell.com>
13866
13867         * class-internals.h (_MonoGenericClass): Rename 'context' field to
13868         'cached_context', and change semantics -- it starts off NULL, and
13869         is initialized on demand.
13870         * class.c (mono_generic_class_get_context): New accessor to
13871         replace 'context' field accesses.
13872         (mono_class_get_context): New helper.
13873         (*): Update to changes.
13874         * icall.c, loader.c, metadata.c, reflection.c: Update to changes.
13875
13876 2007-01-03  Miguel de Icaza  <miguel@novell.com>
13877
13878         * marshal.c (mono_string_to_byvalstr): Fix thinko, shorten len
13879         before the memcpy.   Fixes Marshal2 regression.
13880
13881 2007-01-02  Jb Evain  <jbevain@gmail.com>
13882
13883         * blob.h: add a MONO_TYPE_ENUM definition
13884         * reflection.c (load_cattr_value, create_custom_attr, create_custom_attr_data):
13885         fix the encoding of arrays of enums in custom attributes.
13886
13887         Fixes #79666.
13888
13889 2007-01-01  Miguel de Icaza  <miguel@novell.com>
13890
13891         * marshal.c (mono_string_to_byvalwstr): Fix this routine.   The
13892         string is null terminated, but only cut the string short if it
13893         overflows the buffer.   
13894         
13895         (mono_string_to_byvalstr): Also fix this routine.   The code here
13896         was not properly terminating a string (it was only terminated
13897         because of the previous catch-all memset). 
13898
13899         I left the memset, because I do not know if applications expect
13900         the runtime to clear this region. 
13901
13902         Fixes #79944.
13903
13904         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType):
13905         Clear the error before returning to unmanaged code to prevent the
13906         runtime from being confused later on (fixes  80420).
13907         (ves_icall_type_from_name): Always call mono_loader_clear_error
13908         after parsing a type that could have failed.
13909         (ves_icall_System_Reflection_Assembly_GetTypes): ditto.
13910
13911         * loader.c (mono_loader_clear_error): Fix indentation.
13912
13913 2006-12-28  Martin Baulig  <martin@ximian.com>
13914
13915         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 58.
13916
13917 Fri Dec 22 20:04:57 CET 2006 Paolo Molaro <lupus@ximian.com>
13918
13919         * reflection.c: patch from Rolf Bjarne Kvinge to fix
13920         getting a token for an EnumBuilder.
13921
13922 Fri Dec 22 19:49:07 CET 2006 Paolo Molaro <lupus@ximian.com>
13923
13924         * reflection.c: be more careful in case resource generation
13925         fails to create the data array.
13926
13927 Fri Dec 22 18:17:40 CET 2006 Paolo Molaro <lupus@ximian.com>
13928
13929         * sgen-gc.c: write barrier for clone and fix unregister handles.
13930
13931 Fri Dec 22 18:15:33 CET 2006 Paolo Molaro <lupus@ximian.com>
13932
13933         * reflection.c: some fixes needed in the generics code for the moving GC.
13934
13935 2006-12-22  Robert Jordan  <robertj@gmx.net>
13936
13937         * icall.c (ves_icall_System_Array_SetValueImpl): Take enums into
13938         account. Fixes bug #80299.
13939
13940 2006-12-21  Raja R Harinath  <rharinath@novell.com>
13941
13942         Fix WaitHandle usage in delegates.
13943         * object-internals.h (mono_wait_handle_get_HANDLE): Declare.
13944         * object.c (mono_wait_handle_new): Use the property set method to
13945         initialize the handle.
13946         (mono_wait_handle_get_handle): New.
13947         * threadpool.c (mono_async_invoke): Use it.
13948         * threads.c (ves_icall_System_Threading_WaitHandle_WaitAll_internal):
13949         Likewise.
13950         (ves_icall_System_Threading_WaitHandle_WaitAny_internal): Likewise.
13951
13952 2006-12-21  Jonathan Chambers  <joncham@gmail.com>
13953
13954         * marshal.c (emit_marshal): Call emit_marshal_variant and
13955         emit_marshal_com_interface when applicable.
13956         (emit_marshal_variant, emit_marshal_com_interface): Add
13957         methods for this case and remove if's from emit_marshal_object.
13958         
13959 Wed Dec 20 11:03:56 CET 2006 Paolo Molaro <lupus@ximian.com>
13960
13961         * filewatcher.c: updated to use the mono-dl API instead of gmodule.
13962
13963 2006-12-19  Jonathan Chambers  <joncham@gmail.com>
13964
13965         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_AllocHGlobal,
13966         ves_icall_System_Runtime_InteropServices_Marshal_FreeHGlobal): Use GlobalAlloc
13967         and GlobalFree on Windows. Remove FIXME.
13968
13969 Tue Dec 19 16:18:16 CET 2006 Paolo Molaro <lupus@ximian.com>
13970
13971         * mono-mlist.h, mono-mlist.c, Makefile.am: linked list
13972         implementation for managed objects.
13973
13974 Tue Dec 19 14:28:03 CET 2006 Paolo Molaro <lupus@ximian.com>
13975
13976         * object.c: implemented code to be used for checking
13977         that no reference field overlaps with non-references.
13978
13979 Tue Dec 19 14:10:37 CET 2006 Paolo Molaro <lupus@ximian.com>
13980
13981         * threadpool.c: fix queue code to be compatible with the
13982         moving GC.
13983
13984 2006-12-18  Miguel de Icaza  <miguel@novell.com>
13985
13986         * marshal.c (emit_object_to_ptr_conv): Handle null safehandles
13987         in structures by throwing ArgumentNullException.
13988
13989         (emit_marshal_safehandle): Also when they are null parameters.
13990
13991         (emit_marshal_safehandle): Add support for ref
13992         SafeHandles parameters
13993
13994 Mon Dec 18 19:14:44 CET 2006 Paolo Molaro <lupus@ximian.com>
13995
13996         * profiler.c: updated to use the mono-dl API instead of
13997         gmodule.
13998
13999 Mon Dec 18 19:02:37 CET 2006 Paolo Molaro <lupus@ximian.com>
14000
14001         * profiler.c: updated to use the mono-dl dynamic loading
14002         API instead of gmodule.
14003
14004 Mon Dec 18 18:16:22 CET 2006 Paolo Molaro <lupus@ximian.com>
14005
14006         * profiler.c: use readlink, older versions of glib don't have
14007         g_file_read_link ().
14008
14009 Mon Dec 18 16:40:34 CET 2006 Paolo Molaro <lupus@ximian.com>
14010
14011         * profiler.c: try to detect the path to mono if libc fails to provide
14012         a useful name (bug #80286).
14013
14014 2006-12-16  Raja R Harinath  <rharinath@novell.com>
14015
14016         Fix #80242
14017         * icall.c (ves_icall_Type_GetNestedType): If the type is a generic
14018         instance, use the generic type definition instead.
14019         (ves_icall_Type_GetNestedTypes): Likewise.
14020         * class.c (mono_class_create_generic): Always set the
14021         nested_classes of a generic instance to NULL, even if the generic
14022         type definition has nested types.
14023
14024 2006-12-15  Jonathan Chambers  <joncham@gmail.com>
14025
14026         * marshal.c (mono_string_from_bstr): Revert previous Windows change
14027         and fix on Linux.
14028         
14029 2006-12-15  Miguel de Icaza  <miguel@novell.com>
14030
14031         * marshal.c (mono_string_from_bstr): Jon Chambers pointed out that
14032         my arguments were in the wrong order.   I also fixed the Windows
14033         version which seems to have had the same issue.
14034
14035         (mono_free_bstr): On Unix, this is g_free.
14036         (mono_string_from_bstr, mono_string_to_bstr): Implement bstr
14037         conversions (for the tests in corlib to pass).
14038
14039 2006-12-14  Miguel de Icaza  <miguel@novell.com>
14040
14041         * marshal.c (emit_ptr_to_object_conv): For now, ignore
14042         MONO_MARSHAL_CONV_SAFEHANDLE on return values (we need to throw an
14043         exception if a ref SafeHandle in a struct has changed).
14044         
14045         (emit_struct_conv): Do not perform layout checks for classes
14046         derived from SafeHandle, as those are specially handled. 
14047
14048         (emit_object_to_ptr_conv): Add support for
14049         MONO_MARSHAL_CONV_SAFEHANDLE conversion. 
14050
14051         (emit_marshal_safehandle): Implement conversion of return values
14052         of safehandles (MARSHAL_ACTION_CONV_RESULT).
14053         
14054         * threads.c: WaitHandle now is compiled with two different handles
14055         "IntPtr os_handle" for 1.x and "SafeWaitHandle safe_wait_handle"
14056         for 2.0.
14057         
14058         (ves_icall_System_Threading_WaitHandle_WaitAll_internal) 
14059         (ves_icall_System_Threading_WaitHandle_WaitAny_internal): Adjust
14060         these routines to cope with both kinds of fields.
14061
14062 2006-12-12  Miguel de Icaza  <miguel@novell.com>
14063
14064         * metadata.c (mono_type_to_unmanaged): Handle the case where
14065         type->data.klass is a SafeHandle, and in that case, return the
14066         size of a pointer (MONO_NATIVE_INT) and set the conversion to be
14067         MONO_MARSHAL_CONV_SAFEHANDLE. 
14068
14069 2006-12-11  Miguel de Icaza  <miguel@novell.com>
14070
14071         * marshal.c (emit_marshal): Hook up to the MONO_TYPE_CLASS and
14072         MONO_TYPE_OBJECT cases and check for a SafeHandle here before
14073         calling emit_marshal_object.
14074
14075         (emit_marshal_safehandle): Implement marshalling of
14076         SafeHandle parameters (no ref support yet).
14077
14078         (MarshalAction): Document the defines as I implement
14079         them for SafeHandle.
14080
14081         (emit_marshal_object): indentation police.
14082
14083         * class-internals.h: Define MonoSafeHandle.
14084         Add safehandle_class to MonoDefaults type.
14085
14086         * verify.c: Add System.Runtime.InteropServices.SafeHandle to the
14087         list of classes to check for fields. 
14088
14089         * domain.c (mono_init_internal): Add SafeHandle to the list of
14090         mono_defaults loaded.
14091
14092 2006-12-15  Raja R Harinath  <rharinath@novell.com>
14093
14094         Fix #80253
14095         * reflection.c (mono_reflection_bind_generic_parameters): If the
14096         generic type definition is a type builder, ensure that it is fully
14097         initialized before instantiating it.  Kill some dead code.
14098
14099 Thu Dec 14 17:02:59 CET 2006 Paolo Molaro <lupus@ximian.com>
14100
14101         * object.c: clear the loader_error () before loading
14102         more metadata stuff (bug #80258).
14103
14104 Thu Dec 14 12:49:47 CET 2006 Paolo Molaro <lupus@ximian.com>
14105
14106         * icall.c, icall-defs.h: type modifiers icalls for
14107         parameters and properties.
14108
14109 Wed Dec 13 19:29:50 CET 2006 Paolo Molaro <lupus@ximian.com>
14110
14111         * object.c, icall.c: fixed warnings.
14112
14113 Mon Dec 11 11:03:10 CET 2006 Paolo Molaro <lupus@ximian.com>
14114
14115         * marshal.c: fixed a couple of leaks and coding style in a few places.
14116
14117 2006-12-08  Dick Porter  <dick@ximian.com>
14118
14119         * process.c: Cope with NULL ProcessStartInfo arguments on windows
14120         too.  Patch from Jonathan Chambers <joncham@gmail.com>, fixes bug
14121         80173.
14122
14123 Thu Dec 7 15:20:31 CET 2006 Paolo Molaro <lupus@ximian.com>
14124
14125         * process.c: ProcessStartInfo may have only filename set and
14126         arguments can be NULL.
14127
14128 Tue Dec 5 19:19:34 CET 2006 Paolo Molaro <lupus@ximian.com>
14129
14130         * icall.c: fix leak found by Robert Jordan.
14131
14132 Tue Dec 5 17:53:10 CET 2006 Paolo Molaro <lupus@ximian.com>
14133
14134         * marshal.c, marshal.h: generate managed method to access an element
14135         of a multi-dimensional array.
14136
14137 2006-11-30  Paolo Molaro (lupus@ximian.com)
14138
14139         * metadata.c, marshal.c: locking fixes when writing to image->mempool.
14140
14141 Thu Nov 30 11:11:37 CET 2006 Paolo Molaro <lupus@ximian.com>
14142
14143         * icall.c: back out GetFields () fix until the serialization code is
14144         fixed to not depend on the incorrect behaviour.
14145
14146 Wed Nov 29 22:01:46 CET 2006 Paolo Molaro <lupus@ximian.com>
14147
14148         * profiler.c: provide defaults if none are set.
14149
14150 Tue Nov 28 12:54:51 CET 2006 Paolo Molaro <lupus@ximian.com>
14151
14152         * Makefile.am, attrdefs.h: new public header file with
14153         constants for attributes for use by embedders.
14154
14155 Tue Nov 28 11:44:52 CET 2006 Paolo Molaro <lupus@ximian.com>
14156
14157         * icall.c: GetFields () fix for bug #80064.
14158
14159 Tue Nov 28 10:56:01 CET 2006 Paolo Molaro <lupus@ximian.com>
14160
14161         * filewatcher.c, filewatcher.h, icall-def.h, icall.c, locales.c:
14162         removed long unused icalls.
14163
14164 2006-11-27  Jonathan Chambers  <joncham@gmail.com>
14165   
14166         * marshal.c: 
14167                 (mono_marshal_emit_managed_wrapper): Level of indirection for 
14168                 mono_marshal_get_managed_wrapper so that a wrapper for a managed method
14169                 can be generated without a delegate class.
14170                 (mono_marshal_get_managed_wrapper): Move wrapper logic to mono_marshal_emit_managed_wrapper.
14171         
14172         Signed-off-by: Jonathan Chambers <joncham@gmail.com>
14173
14174 2006-11-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14175
14176         * console-io.c: add the 'signal' call removed by mistake. Fixes bug
14177         #80069.
14178
14179 Mon Nov 27 19:29:13 CET 2006 Paolo Molaro <lupus@ximian.com>
14180
14181         * boehm-gc.c, null-gc.c, sgen-gc.c, mono-gc.h, icall.c,
14182         icall-def.h: added icalls needed by System.GC.
14183
14184 Thu Nov 23 20:01:12 CET 2006 Paolo Molaro <lupus@ximian.com>
14185
14186         * loader.c: ensure the class in catch clauses is handled
14187         correctly for generics methods (fixes bug#79980).
14188
14189 Thu Nov 23 17:31:58 CET 2006 Paolo Molaro <lupus@ximian.com>
14190
14191         * monitor.h, monitor.c: added mono_locks_dump () function
14192         to help debug deadlocks involving managed locks.
14193
14194 2006-11-13  Dick Porter  <dick@ximian.com>
14195
14196         * file-io.c (get_file_attributes): If the file is a symlink try
14197         and get the stat data for the target, but also add the
14198         FILE_ATTRIBUTE_REPARSE_POINT flag.  This is an attempt to follow
14199         the specs for the windows symlink support, but will probably have
14200         to be reworked when I have test data from a vista machine.  Fixes
14201         bug 79887.
14202
14203 2006-11-13  Dick Porter  <dick@ximian.com>
14204
14205         * gc.c (mono_domain_finalize): 
14206         * marshal.c (mono_delegate_begin_invoke): 
14207         * threadpool.c (socket_io_init, mono_thread_pool_init)
14208         (mono_thread_pool_finish): 
14209         * monitor.c (mono_monitor_try_enter_internal): 
14210         * threads.c (mono_thread_resume, mono_thread_init)
14211         (mono_thread_suspend_all_other_threads)
14212         (mono_thread_execute_interruption): 
14213         * appdomain.c (mono_domain_unload): Check for NULL error returns
14214         from CreateThread(), CreateEvent() and CreateSemaphore().  See bug
14215         75733.
14216
14217 2006-11-11  Miguel de Icaza  <miguel@novell.com>
14218
14219         * process.c
14220         (ves_icall_System_Diagnostics_Process_CreateProcess_internal):
14221         Only close the handle if the value of the handle is not
14222         INVALID_HANDLE_VALUE.  This just makes the process a bit more
14223         robust.
14224
14225         Improvement for #75733, so that we do not run into this problem. 
14226
14227         
14228         * assembly.c (check_path_env, check_extra_gac_path_env): Do not
14229         include empty directories from MONO_PATH or MONO_GAC_PREFIX in our
14230         internal variables.  Fixes #79462 
14231         
14232
14233 2006-11-09  Dick Porter  <dick@ximian.com>
14234
14235         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal):
14236         Use poll() not select().  Fixes bug 79397.
14237
14238 2006-11-09  Raja R Harinath  <rharinath@novell.com>
14239
14240         Fix #79872
14241         * assembly.c (mono_assembly_load_from_full): Check that the given
14242         image has an assembly manifest.
14243
14244 2006-11-09  Ankit Jain  <jankit@novell.com>
14245
14246         * tabledefs.h (ASSEMBLYREF_RETARGETABLE_FLAG):
14247         (ASSEMBLYREF_ENABLEJITCOMPILE_TRACKING_FLAG):
14248         (ASSEMBLYREF_DISABLEJITCOMPILE_OPTIMIZER_FLAG): Add AssemblyRef flags.
14249
14250 2006-11-07  Dick Porter  <dick@ximian.com>
14251
14252         * socket-io.c (ves_icall_System_Net_Dns_GetHostByAddr_internal):
14253         Put the old resolver behaviour back for pre-2.0 profiles.
14254
14255 Tue Nov 7 16:56:24 CET 2006 Paolo Molaro <lupus@ximian.com>
14256
14257         * threadpool.c: precise GC and locking fixes.
14258
14259 Tue Nov 7 11:02:42 CET 2006 Paolo Molaro <lupus@ximian.com>
14260
14261         * class.c: don't load types that have an explicit unaligned
14262         managed reference. Provide better info in the TypeLoad exception.
14263         Part of the fix for bug #79744.
14264         * object.c: use the correct check for class type load issues.
14265
14266 Mon Nov 6 17:07:43 CET 2006 Paolo Molaro <lupus@ximian.com>
14267
14268         * class.c: enforce alignment of fields with managed references
14269         even when Pack=1 is forced by the user (bug #77788).
14270
14271 2006-11-03  Dick Porter  <dick@ximian.com>
14272
14273         * socket-io.c (ves_icall_System_Net_Dns_GetHostByAddr_internal):
14274         If the address reverse lookup fails, return it as the hostname
14275         anyway.  Fixes bug 79721.
14276
14277 2006-11-03  Dick Porter  <dick@ximian.com>
14278
14279         * threads.c (ves_icall_System_Threading_Thread_SpinWait_internal):
14280         Fix build on Windows.
14281
14282 2006-11-02  Dick Porter  <dick@ximian.com>
14283
14284         * icall-def.h: 
14285         * object-internals.h: 
14286         * exception.c (mono_get_exception_thread_interrupted): 
14287         * threads.c: Implement Thread.Interrupt and Thread.SpinWait.
14288         Fixes bug 74525.
14289
14290         * monitor.c (ves_icall_System_Threading_Monitor_Monitor_wait):
14291         Check for pending Thread.Interrupt.
14292
14293 2006-10-27  Massimiliano Mantione  <massi@ximian.com>
14294         * loader.c: Fixed bug 79684.
14295
14296 2006-10-27  Dick Porter  <dick@ximian.com>
14297
14298         * file-io.c (get_file_attributes): Force symlinks to directories
14299         to be returned as a regular file.  Fixes bug 79733.
14300 2006-10-26  Dick Porter  <dick@ximian.com>
14301
14302         * file-io.c (ves_icall_System_IO_MonoIO_Open): If we're calling
14303         CreateFile to open a directory then we need to set the
14304         FILE_FLAG_BACKUP_SEMANTICS flag.  Fixes bug 75285.
14305
14306 2006-10-23  Zoltan Varga  <vargaz@gmail.com>
14307
14308         * reflection.c (mono_method_get_object): Cache the MonoMethod class and its
14309         friends.
14310
14311 Mon Oct 23 03:06:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
14312
14313         * sgengc.c: small cleanup of timer code.
14314
14315 Mon Oct 23 02:49:08 CEST 2006 Paolo Molaro <lupus@ximian.com>
14316
14317         * sgen-gc.c: fix some warnings and start adding support for
14318         complete object removal on domain unload.
14319
14320 2006-10-22  Gert Driesen  <drieseng@users.sourceforge.net>
14321
14322         * assembly.c: build_assembly_name should not consider a version
14323         number without build or revision number invalid. Fixes bug #79715.
14324
14325 2006-10-18  Jonathan Chambers  <joncham@gmail.com>
14326
14327         * icall.c: Have ves_icall_System_Diagnostics_DefaultTraceListener_WriteWindowsDebugString
14328         call kernel32 function OutputDebugString directly.
14329         
14330         Signed-off-by: Jonathan Chambers <joncham@gmail.com>
14331         
14332 Tue Oct 17 16:59:59 CEST 2006 Paolo Molaro <lupus@ximian.com>
14333
14334         * reflection.c: small cleanup, using a function to insert a MonoString
14335         in the string heap.
14336
14337 Tue Oct 17 16:45:27 CEST 2006 Paolo Molaro <lupus@ximian.com>
14338
14339         * reflection.c: moving GC fixes.
14340
14341 Mon Oct 16 16:53:12 CEST 2006 Paolo Molaro <lupus@ximian.com>
14342
14343         * sgen-gc.c, gc-internal.h, gc.c: added API to collect and remove
14344         all the objects with finalizers belonging to an unloading appdomain.
14345
14346 Mon Oct 16 15:08:41 CEST 2006 Paolo Molaro <lupus@ximian.com>
14347
14348         * sgen-gc.c: added ability to allocate even when the nursery is fully
14349         pinned and fixed a couple of bugs.
14350
14351 2006-10-15  Zoltan Varga  <vargaz@gmail.com>
14352
14353         * threads.h: Revert the last change for now.
14354
14355         * threads.h (mono_thread_get_pending_exception): Rename this to
14356         mono_thread_get_undeniable_exception ().
14357
14358 2006-10-15  Gert Driesen  <drieseng@users.sourceforge.net>
14359
14360         * appdomain.c: Use mono_get_exception_bad_image_format2 to construct
14361         BadImageFormatException in ves_icall_System_Reflection_Assembly_LoadFrom
14362         when fname does not refer to valid assembly. This result in a more
14363         meaningful error message.
14364         * exception.c: added mono_get_exception_bad_image_format2 which 
14365         constructs a BadImageFormatException using the ctor taking a custom
14366         message and the file name. Passing in a NULL msg results in a default
14367         message.
14368         * exception.h: define mono_get_exception_bad_image_format2 function.
14369         * icall.c: in InternalGetAssemblyName, throw BadImageFormatException 
14370         when file name pointed to an invalid IL image. Use 
14371         mono_get_exception_file_not_found2 to construct FileNotFoundException,
14372         as this results in a more meaningful error message.
14373
14374 2006-10-15  Zoltan Varga  <vargaz@gmail.com>
14375
14376         * reflection.c (encode_named_val): Implement proper encoding of arrays. Fixes
14377         #79465.
14378
14379 2006-10-12  Zoltan Varga  <vargaz@gmail.com>
14380
14381         * metadata.c (mono_type_size): Change the align parameter to guint32 for
14382         consistency with the other _size functions.
14383         (mono_type_stack_size): Ditto.
14384
14385         * class.c object.c icall.c: Fix warnings caused by the above change.
14386
14387         * class.c (mono_class_get_method_from_name_flags): Fix a typo.
14388
14389         * image.c (load_metadata_ptrs): Reenable loading of modules with uncompressed metadata.
14390
14391         * metadata.c class.c loader.c: Add proper support for uncompressed metadata.
14392
14393 Wed Oct 11 17:27:05 CEST 2006 Paolo Molaro <lupus@ximian.com>
14394
14395         * console-io.h, filewatcher.h, locales.h, marshal.h, monitor.h,
14396         process.h, rand.h, rawbuffer.h, security-manager.h, security.h,
14397         socket-io.h, string-icalls.h, sysmath.h, threadpool-internals.h,
14398         threadpool.h, threads-types.h: mark more internal functions.
14399
14400 2006-10-11  Dick Porter  <dick@ximian.com>
14401
14402         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal):
14403         Fix typo spotted by Robert Jordan in bug 79352 (though I can't
14404         reproduce the bug even before applying the fix.)
14405
14406 Tue Oct 10 15:39:39 CEST 2006 Paolo Molaro <lupus@ximian.com>
14407
14408         * reflection.c: allow retrieving attributes for arguments in generic
14409         methods (bug #79241).
14410
14411 Tue Oct 10 11:45:50 CEST 2006 Paolo Molaro <lupus@ximian.com>
14412
14413         * debug-mono-symfile.c: properly check fopen () result (found by
14414         coverity).
14415
14416 Tue Oct 10 11:30:52 CEST 2006 Paolo Molaro <lupus@ximian.com>
14417
14418         * reflection.c: make error message clearer and fixed two
14419         issuelets found by Coverity.
14420
14421 2006-10-10  Zoltan Varga  <vargaz@gmail.com>
14422
14423         * object-internals.h: Remove duplicate definition of mono_method_get_signature_full ().
14424
14425 Mon Oct 9 19:41:44 CEST 2006 Paolo Molaro <lupus@ximian.com>
14426
14427         * object-internals.h, gc-internal.h, profiler-private.h:
14428         mark internal functions.
14429
14430 Mon Oct 9 19:28:56 CEST 2006 Paolo Molaro <lupus@ximian.com>
14431
14432         * reflection.c: put data in the text section.
14433         * icall.c: recognize more types in type_from_typename ().
14434         * process.c, marshal.c: added some GC FIXMEs.
14435
14436 Mon Oct 9 19:27:26 CEST 2006 Paolo Molaro <lupus@ximian.com>
14437
14438         * loader.c: check for NULL before initializing.
14439
14440 2006-10-09  Zoltan Varga  <vargaz@gmail.com>
14441
14442         * gc.c (finalizer_thread): Use a non-alertable wait here.
14443
14444         * class.c loader.c metadata.c: Revert the mono_metadata_decode_table_... changes,
14445         until the correct solution is found.
14446
14447 2006-10-06  Zoltan Varga  <vargaz@gmail.com>
14448
14449         * reflection.c (mono_module_get_object): Avoid an assert when operating on
14450         modules with no metadata. Fixes #79596.
14451
14452         * image.c (load_metadata_ptrs): Put back the error message when
14453         the #- heap is encountered since the support is not complete yet.
14454
14455 Fri Oct 6 16:57:26 CEST 2006 Paolo Molaro <lupus@ximian.com>
14456
14457         * gc.c: do not allow the user to SuppressFinalize () a
14458         delegate because it would leak the trampoline if present.
14459
14460 2006-10-06  Zoltan Varga  <vargaz@gmail.com>
14461
14462         * class.c metadata.c row-indexes.h blob.h: Applied patch from Jb. Add support for the
14463         PropertyPtr table.
14464
14465 2006-10-05  Zoltan Varga  <vargaz@gmail.com>
14466
14467         * loader.c (mono_method_signature): Fix a use of MONO_TABLE_METHOD missed earlier.
14468
14469         * metadata.c (mono_metadata_get_param_attrs): Ditto.
14470
14471         * row-indexes.h: Add definitions for *Ptr tables.
14472
14473         * metadata-internals.h (MonoImage): Add an 'uncompressed_metadata' flag.
14474
14475         * metadata.c (mono_metadata_translate_token_index): New helper function to
14476         translate table indexes used in uncompressed metadata.
14477         (mono_metadata_decode_table_row): Ditto.
14478         (mono_metadata_decode_table_row_col): Ditto.
14479
14480         * metadata.c: Add table schema for *Ptr tables.
14481
14482         * class.c loader.c: Use the new helper function to access the affected metadata
14483         tables.
14484         
14485         * image.c (load_metadata_ptrs): Allow assemblies with uncompressed metadata. Fixes
14486         #38532.
14487         
14488 2006-10-04  Zoltan Varga  <vargaz@gmail.com>
14489
14490         * marshal.c (emit_object_to_ptr_conv): Avoid using short branches around IL
14491         sequences which can be unbounded in size. Fixes #79583.
14492
14493 2006-10-02  Zoltan Varga  <vargaz@gmail.com>
14494
14495         * object.c (mono_runtime_class_init): Handle a corner case in handling failure of
14496         static initialization.
14497
14498         * domain-internals.h (MonoDomain): Add a 'type_init_exception_hash' field.
14499
14500         * class-internals.h (MonoVTable): Add an 'init_failed' flag.
14501
14502         * domain.c (mono_domain_free): Free up type_init_exception_hash.
14503
14504         * object.c (mono_runtime_class_init): Implement correct semantics when a static
14505         ctor fails, i.e. throw the same exception on subsequent accesses.
14506         
14507 2006-09-0  Jonathan Chambers  <joncham@gmail.com>
14508
14509         * domain.c, class-internals.h: Added ComInteropProxy class to MonoDefaults.
14510         * marshal.c: Return correct unmanaged size for object when MarshalAs.Struct.
14511         Emit exception rather than crash in case of COM Callable Wrapper (not yet implemented).
14512         Handle marshalling of interfaces and VARIANTs contained in structs.
14513         
14514         Code is contributed under MIT/X11 license.
14515         
14516 2006-09-30  Zoltan Varga  <vargaz@gmail.com>
14517
14518         * marshal.c (emit_marshal_custom): Fix some corner cases. Fixes #79471.
14519         
14520         * marshal.c (mono_marshal_load_type_info): Allocate memory from the image
14521         mempool.
14522
14523 2006-09-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14524
14525         * console-io.c: ignore previous SIGINT handler.
14526
14527 2006-09-27  Zoltan Varga  <vargaz@gmail.com>
14528
14529         * metadata.c class.c: Applied patch from Ricardo Fernandez Pascual 
14530         (ricardo.fernandez@st.com). Add some new MonoClass and MonoType accessors. Fixes
14531         #79460, #79461, #79485.
14532
14533         * class.c (mono_class_from_name_case): Fix incorrect comments. Fixes #79504.
14534
14535         * marshal.c (mono_marshal_load_type_info): Fix a typo which caused an assert. Fixes
14536         #79217.
14537
14538 2006-09-26  Zoltan Varga  <vargaz@gmail.com>
14539
14540         * marshal.c (mono_marshal_get_delegate_invoke): Tweak the IL a little so better code
14541         could be generated from it.
14542
14543 Mon Sep 25 13:29:53 CEST 2006 Paolo Molaro <lupus@ximian.com>
14544
14545         * rand.c: fix read loop to correctly handle EINTR.
14546
14547 Mon Sep 25 11:33:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
14548
14549         * Makefile.am, icall-def.h, icall.c, verify.c: changed the way
14550         internal calls are defined to keep methods closer to the declaring
14551         type and allow a significant reduction in runtime relocations and
14552         memory usage.
14553
14554 2006-09-21 Gert Driesen  <drieseng@users.sourceforge.net>
14555
14556         * appdomain.c: Pass NULL to mono_get_exception_file_not_found2 as
14557         exception message to have FileNotFoundException use the default
14558         assembly load error message. Fixes bug #79426.
14559         * exception.c: Support NULL msg in mono_get_exception_file_not_found2.
14560
14561 2006-09-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14562
14563         * threadpool.c: (start_thread_or_queue) use the root domain when
14564         creating the thread instead of the async object one.
14565
14566 Thu Sep 21 19:30:04 CEST 2006 Paolo Molaro <lupus@ximian.com>
14567
14568         * class.c, object.c, class-internals.h, reflection.c:
14569         for arrays, store element_size inside MonoClass (speedup
14570         for array object creation).
14571
14572 Thu Sep 21 17:06:43 CEST 2006 Paolo Molaro <lupus@ximian.com>
14573
14574         * icall.c: fixed CodeBase to use the file name and not the module
14575         name (bug #79365).
14576
14577 Thu Sep 21 12:09:34 CEST 2006 Paolo Molaro <lupus@ximian.com>
14578
14579         * mono-debug.c, mono-debug.h: export find_method as
14580         mono_debug_find_method ().
14581
14582 Wed Sep 20 19:59:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
14583
14584         * debug-helpers.c, class-internals.h: added a few functions useful
14585         when debugging under gdb.
14586
14587 2006-09-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14588
14589         * console-io.[ch]: trigger the ConsoleCancelEvent and retrieve
14590         characters that need special handling.
14591
14592 Tue Sep 19 18:57:38 CEST 2006 Paolo Molaro <lupus@ximian.com>
14593
14594         * mono-config.c: make the os/cpu specification more flexible,
14595         allowing lists and negation.
14596
14597 2006-09-18  Jonathan Chambers  <joncham@gmail.com>
14598
14599         * marshal.c: COM Interop fixes. Handle case where method->klass.
14600         is interface. Handle BSTR/MonoString when null. Use CDECL as 
14601         calling convention on non-windows platforms. This is for
14602         compatibility with XPCOM and MainWin COM.
14603         
14604         Code is contributed under MIT/X11 license.
14605         
14606
14607 2006-09-18  Zoltan Varga  <vargaz@gmail.com>
14608
14609         * marshal.c (mono_marshal_load_type_info): Handle concurrent and recursive calls
14610         correctly. Fixes #79217.
14611
14612         * class-internals.h (MonoClass): Remove unused marshal_info_init_pending field.
14613
14614 Mon Sep 18 16:59:54 CEST 2006 Paolo Molaro <lupus@ximian.com>
14615
14616         * mono-config.c: allow both an os and cpu attribute for dllmap
14617         and dllentry elemnets to enable a single config file to be used
14618         for multiple architectures.
14619
14620 2006-09-18  Gert Driesen  <drieseng@users.sourceforge.net>
14621
14622         * loader.c: MonoLoaderError was cleared too soon on load failure.
14623         Fixes bug #79424.
14624
14625 Mon Sep 18 15:37:13 CEST 2006 Paolo Molaro <lupus@ximian.com>
14626
14627         * icall.c: use the defining class vtable when accessing a
14628         static field, not a pobblibly derived class.
14629
14630 2006-09-17  Zoltan Varga  <vargaz@gmail.com>
14631
14632         * icall.c string-icalls.c: Remove references to unicode.h.
14633
14634         * unicode.h unicode.c Makefile.am: Remove these unused source files.
14635
14636         * NOTES: Moved to ../../docs and renamed to thread-safety.txt.
14637
14638         * marshal.c (mono_marshal_emit_native_wrapper): Add an 'image' argument, 
14639         indicating the image where custom marshaller types should be looked up.
14640         (mono_ftnptr_to_delegate): Use the image of the delegate type to look up
14641         custom marshallers, instead of corlib. Fixes #79425.
14642
14643 2006-09-14  Zoltan Varga  <vargaz@gmail.com>
14644
14645         * marshal.c (emit_marshal_object): Fix marshalling of blittable classes and null.
14646
14647 2006-09-14  Jonathan Chambers  <joncham@gmail.com>
14648
14649         * environment.c (ves_icall_System_Environment_get_ProcessorCount): 
14650         Implement Environment.ProcessorCount.
14651         
14652         * environment.h (ves_icall_System_Environment_get_ProcessorCount): 
14653         Implement Environment.ProcessorCount.
14654         
14655         * icall.c: 
14656         Add Environment.ProcessorCount icall.
14657         
14658         Patch by Jason McFall.
14659
14660 2006-09-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14661
14662         * assembly.c: don't append .exe/.dll when the filename already contains
14663         one of those extensions.
14664
14665 2006-09-12  Martin Baulig  <martin@ximian.com>
14666
14667         * class.c (mono_bounded_array_class_get): Also add `IList<object>'
14668         to array interfaces.
14669
14670 2006-09-11  Martin Baulig  <martin@ximian.com>
14671
14672         * reflection.c (mono_image_build_metadata): Create the
14673         MethodImpl's after emitting all types and methods, so we don't
14674         need another fixup pass for them.
14675
14676 2006-09-11  Zoltan Varga  <vargaz@gmail.com>
14677
14678         * class.c (mono_class_from_name_case): Fix regression introduced by the last
14679         change.
14680
14681 Mon Sep 11 12:57:15 CEST 2006 Paolo Molaro <lupus@ximian.com>
14682
14683         * gc-internal.h, appdomain.c, gc.c: force-destroy GC handles on domain
14684         unload.
14685
14686 2006-09-10  Zoltan Varga  <vargaz@gmail.com>
14687
14688         * object.c (mono_method_return_message_restore): Avoid a crash if one of the out
14689         args is not set. Fixes #78926.
14690
14691 2006-09-08  Zoltan Varga  <vargaz@gmail.com>
14692
14693         * class.c (mono_class_init): Init class->no_special_static_fields from the cached info.
14694
14695         * image.c (load_class_names): Move this to class.c, and rename it to 
14696         'mono_image_init_name_cache'.
14697         (load_modules): Fix a warning.
14698
14699         * class.c icall.c image.c: Initialize image->name_cache lazily.
14700
14701         * class-internals.h (MonoGetClassFromName): New hook function to find a class based
14702         on its name using information in the AOT file.
14703
14704         * class.c (mono_class_from_name): Use the new hook function.
14705
14706 2006-09-06  Zoltan Varga  <vargaz@gmail.com>
14707
14708         * reflection.c (mono_param_get_objects): Handle enum default parameter values
14709         correctly.
14710
14711         * marshal.c (emit_marshal_object): Implement [In, Out] byval marshalling of classes.
14712         Fixes #79289.
14713         
14714 2006-09-06  Martin Baulig  <martin@ximian.com>
14715
14716         * icall.c (mono_lookup_internal_call): Small fix.
14717
14718 2006-09-05  Raja R Harinath  <rharinath@novell.com>
14719
14720         * debug-mono-symfile.c (mono_debug_open_mono_symbols): Remove
14721         double g_free.
14722
14723 2006-09-04  Sebastien Pouliot  <sebastien@ximian.com>
14724
14725         * debug-mono-symfile.c: Fix *some* memory leaks that happens only 
14726         when --debug is specified.
14727
14728 2006-09-04  Zoltan Varga  <vargaz@gmail.com>
14729
14730         * class.c (setup_generic_array_ifaces): Fix a warning.
14731
14732 2006-09-04  Miguel de Icaza  <miguel@novell.com>
14733
14734         * Temporarily remove the patch to assemly.c that checks the
14735         assembly versions as it breaks our gacutil.
14736
14737 2006-09-03  Zoltan Varga  <vargaz@gmail.com>
14738
14739         * metadata.c (mono_metadata_parse_mh_full): Fix an invalid free.
14740
14741         * assembly.c (mono_assembly_load_from_full): Avoid loading net 2.0 assemblies into
14742         a net 1.0 runtime.
14743
14744         * marshal.c (mono_string_builder_to_utf8): Fix marshalling of StringBuilders
14745         created using the default ctor. Fixes #79152.
14746         (mono_string_builder_to_utf16): Ditto.
14747
14748 2006-09-01  Martin Baulig  <martin@ximian.com>
14749
14750         Fix handling of the generic array interfaces.
14751
14752         * class-internals.h
14753         (MonoDefaults): Removed `generic_array_class' and added
14754         `generic_ilist' class.
14755
14756         * class.c
14757         (mono_bounded_array_class_get): Add the new generic array interfaces.
14758         (setup_generic_array_ifaces): New static method; create vtable
14759         entries for each method in the generic array interfaces.
14760
14761         * metadata.c
14762         (select_container): Allow "parent-less" generic methods.
14763
14764         * marshal.c
14765         (mono_marshal_get_generic_array_helper): New public method.
14766
14767         * icall.c
14768         (ves_icall_System_Array_InternalArray_GetGenericValueImpl):
14769         Renamed into ves_icall_System_Array_GetGenericValueImpl() and
14770         moved the interncall into System.Array.
14771
14772 2006-09-01  Raja R Harinath  <rharinath@novell.com>
14773
14774         A few more cases of avoiding work on types with ->byref set.
14775         Has the real fix for #79238
14776         * icall.c (is_generic_parameter): New helper.
14777         (ves_icall_Type_GetGenericParameterPosition): Use it.
14778         (ves_icall_Type_GetGenericParameterAttributes): Likewise.
14779         (ves_icall_MonoType_get_IsGenericParameter): Likewise.
14780         (ves_icall_TypeBuilder_get_IsGenericParameter): Likewise.
14781         (ves_icall_Type_GetGenericTypeDefinition_impl): Return NULL on
14782         reference types.
14783         (ves_icall_Type_get_IsGenericTypeDefinition): Return FALSE on
14784         reference types.
14785         (ves_icall_Type_get_IsGenericInstance): Likewise.
14786         (ves_icall_Type_get_IsGenericType): Likewise.
14787
14788 2006-09-01  Zoltan Varga  <vargaz@gmail.com>
14789
14790         * class.c (mono_class_setup_vtable_general): Share identical vtables with the parent
14791         class if possible.
14792
14793         * mempool.h (mono_mempool_get_allocated): New helper function.
14794
14795         * object.c (mono_class_create_runtime_vtable): Fix problem introduced by last
14796         change.
14797
14798         * mempool.c: Fix warnings and the calculation of stats.
14799
14800         * object.c (mono_class_create_runtime_vtable): Fix the AOT optimization.
14801
14802         * class.c (mono_class_setup_vtable): Update generic_vtable_count stat.
14803
14804         * loader.c (mono_get_method_from_token): Update method_count stat.
14805
14806         * class-internals.h (MonoStats): Add some stats.
14807
14808 2006-08-31 Robert Jordan  <robertj@gmx.net>
14809
14810         * icall.c: Replace the PtrToStringAuto, StringToHGlobalAuto icalls
14811         with managed variants.
14812         All code is contributed under the MIT/X11 license.
14813         
14814 2006-08-31  Zoltan Varga  <vargaz@gmail.com>
14815
14816         * reflection.c (reflection_methodbuilder_to_mono_method): Set 
14817         method->skip_visibility based up the skipVisibility parameter of DynamicMethods.
14818
14819         * class-internals.h (MonoMethod): Add a 'skip_visibility' field.
14820
14821         * marshal.c (mono_marshal_load_type_info): Revert the last change as it can't cope
14822         with cycles in classes.
14823
14824         * icall.c (ves_icall_MonoType_get_Name): Add a '&' for byref types. Fixes #79110.
14825
14826         * marshal.c (emit_marshal_array): Avoid crash when a parameter with type array is 
14827         missing a [MarshalAs] directive. Fixes #79203.
14828
14829         * marshal.c (mono_marshal_load_type_info): Fix a race in initializing 
14830         klass->marshal_info. Fixes #79217.
14831
14832 2006-08-30  Martin Baulig  <martin@ximian.com>
14833
14834         Committing a patch from Joachim Ante <joe@otee.dk>:
14835         Add support for binary data symbol stores.
14836
14837         * debug-mono-symfile.c
14838         (mono_debug_open_mono_symbol_file): Renamed into
14839         mono_debug_open_mono_symbols() and added `raw_contents' and `size'
14840         arguments.
14841
14842         * mono-debug.c
14843         (mono_debug_open_image): Added `raw_contents' and `size' args.
14844         (mono_debug_init_2_memory): New public function.
14845
14846 Fri Aug 25 18:25:23 CEST 2006 Paolo Molaro <lupus@ximian.com>
14847
14848         * icall.c: handle TypedReference in GetTypeCode (bug #79150).
14849
14850 2006-08-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14851
14852         * appdomain.c: implement support for ShadowCopyFiles.
14853
14854 2006-08-22  Sebastien Pouliot  <sebastien@ximian.com>
14855
14856         * string-icalls.c: Add shortcut in ves_icall_System_String_ctor_charp
14857         when value is NULL (and should remove CID #51).
14858
14859 2006-08-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14860
14861         * image.c: moved 2 functions to ../utils.
14862
14863 Tue Aug 22 15:53:29 CEST 2006 Paolo Molaro <lupus@ximian.com>
14864
14865         * gc.c: cope with the target object of a GC handle being NULL
14866         (bug #78877).
14867
14868 Tue Aug 22 11:10:33 CEST 2006 Paolo Molaro <lupus@ximian.com>
14869
14870         * class.c: recursively check parent's explicit implementations
14871         of interface methods (fixes bug #79125).
14872
14873 2006-08-19  Miguel de Icaza  <miguel@novell.com>
14874
14875         * filewatcher.c: Avoid warnings when building, do not redefine
14876         constants that are defined.
14877
14878         Remove warnings.
14879
14880 2006-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14881
14882         * image.c: don't fail when the link points to an absolute path.
14883
14884 2006-08-18  Sebastien Pouliot  <sebastien@ximian.com>
14885
14886         * decimal.c: Remove dead code (unrequired check) in mono_decimalIncr.
14887         Fix CID #3.
14888
14889 2006-08-17  Miguel de Icaza  <miguel@novell.com>
14890
14891         * image.c (full_path): A new method used to obtain the actual path
14892         of an assembly even in the presence of symbolic links.  
14893
14894         This is necessary for the case where we are running a binary that
14895         has been GACed, but we are using the "published" path name
14896         ($prefix/mono/1.0/blah.exe) which happens to point to the real
14897         file in the GAC.
14898
14899         This was the source of the failure for the `xsp' command with the
14900         recent AppDomain changes, as far as the runtime was concerned,
14901         there were two different assemblies: $prefix/mono/1.0/blah.exe and
14902         $prefix/mono/gac/blah/version/blah.exe.
14903
14904         (do_mono_image_open): use full path
14905
14906 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
14907
14908         * object.c (mono_class_create_runtime_vtable): Add a FIXME.
14909
14910 2006-08-17  Sebastien Pouliot  <sebastien@ximian.com>
14911
14912         * marshal.c: Fix mono_marshal_check_domain_image if an invalid 
14913         domain_id is supplied. Fix CID #241 and corlib's unit tests.
14914
14915 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
14916
14917         * class.c (mono_class_layout_fields): Set min_align to a bigger value for
14918         small structures. Fixes #78990.
14919
14920 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
14921
14922         * marshal.c (mono_marshal_get_xappdomain_invoke): Use the new helper functions here.
14923
14924         * appdomain.c (ves_icall_System_AppDomain_createDomain): Fix a warning.
14925
14926 2006-08-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14927
14928         * appdomain.c:
14929         * marshal.c: don't load all the assemblies from a domain into newly
14930         created ones. The new domains might have different rules and load
14931         assemblies from different locations. Fixes bug #76757.
14932
14933         Patch by Lluis. Conflicts resolved by Brian Crowell.
14934
14935 2006-08-16  Alp Toker  <alp@atoker.com>
14936
14937         * socket-io.c: First half of the fix for #79084.
14938         Set sa_size to the length of the content, not that of the struct.
14939         Don't add NULL suffix to the content, this should be done in
14940         managed code if needed.
14941
14942 2006-08-14  Raja R Harinath  <rharinath@novell.com>
14943
14944         Fix part of #79012
14945         * metadata.c (do_mono_metadata_parse_generic_class): Don't SEGV if
14946         mono_metadata_parse_type returns NULL.
14947
14948 2006-08-13  Atsushi Enomoto  <atsushi@ximian.com>
14949
14950         * normalization-tables.h : new file for string normalization data.
14951         * locales.c, locales.h, icall.c :
14952           added load_normalization_resource() for string normalization,
14953           and icall as well.
14954         * Makefile.am : added normalization-tables.h to the sources.
14955
14956 2006-08-13  Zoltan Varga  <vargaz@gmail.com>
14957
14958         * marshal.c: Add more helper functions to reduce code duplication and use them
14959         everywhere.
14960
14961 2006-08-12  Zoltan Varga  <vargaz@gmail.com>
14962
14963         * marshal.c: Fix non-x86 stdcall warnings.
14964         
14965         * marshal.c marshal.h: Add some helper functions to emit/patch branches, and use 
14966         them everywhere.
14967
14968 2006-08-11  Jonathan Chambers  <joncham@gmail.com>
14969
14970         * class.c (mono_bounded_array_class_get): Fix if statement that caused incorrect
14971         type check on multi-dimensional arrays. Fixes #79000.
14972
14973 2006-08-10  Jonathan Chambers  <joncham@gmail.com>
14974
14975         * class.c (mono_class_setup_parent): setup is_com_object during class initialization.
14976         * object.c (mono_remote_class_vtable/mono_object_new_specific): Changed checks
14977         to use is_com_object instead of MONO_CLASS_IS_IMPORT() macro.
14978         * class-internals.h: add is_com_object to class structure.
14979         * marshal.c: Fixed marshalling for IDispatch and IUnknown, added
14980         null checks to COM object marshalling. Fix .ctor call on RCW.
14981         * icall.c: Added icall implementation for MonoType.IsCOMObjectImpl.
14982         
14983         All code is contributed under the MIT/X11 license.
14984
14985 2006-08-09  Dick Porter  <dick@ximian.com>
14986
14987         * monitor.c (mono_monitor_cleanup): mono_monitor_cleanup() is
14988         racing mono_monitor_allocator_lock() somewhere, so don't delete
14989         the critical section for now.  Found by running and exiting
14990         monodevelop.
14991
14992 2006-08-10  Zoltan Varga  <vargaz@gmail.com>
14993
14994         * marshal.c (cominterop_get_native_wrapper): Fix a warning.
14995         (ves_icall_System_ComObject_FindInterface): Ditto.
14996         (ves_icall_System_ComObject_CacheInterface): Ditto.
14997
14998         * metadata.c (do_mono_metadata_type_equal): Applied patch from Roberto Costa
14999         (roberto.costa@st.com). Add support for MONO_TYPE_FNPTR.
15000
15001 2006-08-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15002
15003         * threadpool.c: treat pipes from process asynchronous reads as sockets
15004         when reading from them, so we get select/poll or epoll to wait for
15005         data.
15006
15007 2006-08-07  Sebastien Pouliot  <sebatien@ximian.com>
15008
15009         * loader.c: Fix a typo (CID #233) in the null check.
15010
15011 2006-08-07  Zoltan Varga  <vargaz@gmail.com>
15012
15013         * appdomain.c (mono_domain_unload): Close the thread handle of the unload thread.
15014         Hopefully fixes #78949.
15015         
15016         * metadata.c (mono_metadata_parse_method_signature_full): Applied patch from 
15017         Roberto Costa (roberto.costa@st.com). Handle vararg signatures without SENTINEL
15018         bytes. Fixes #78972.
15019
15020 2006-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15021
15022         * filewatcher.c: we need to set errno here.
15023
15024 2006-08-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15025
15026         * filewatcher.c: let Win32Exception get the error value.
15027
15028 2006-08-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15029
15030         * filewatcher.c: translate errno into win32 errors for Win32Exception
15031         to know what happened.
15032
15033 2006-08-01  Zoltan Varga  <vargaz@gmail.com>
15034
15035         * threadpool.c: Fix more warnings.
15036
15037         * assembly.c (search_loaded): Fix warnings.
15038
15039         * threadpool.c (mono_thread_pool_finish): Fix warnings.
15040         (mono_async_invoke): Ditto.
15041
15042 2006-07-28  Jonathan Chambers  <joncham@gmail.com>
15043
15044         * object.c (mono_remote_class_vtable): Need to create proxy vtable
15045         entries for __ComObject type in addition to ComImport types.
15046         * marshal.c: Added support for marshalling COM RCWs. Fixed warning
15047         about hash table.
15048         
15049         All code is contributed under the MIT/X11 license.
15050
15051 Fri Jul 28 19:04:34 CEST 2006 Paolo Molaro <lupus@ximian.com>
15052
15053         * image.c: avoid tentative loading of modulerefs that contain
15054         no metadata (P/Invoke library names).
15055
15056 2006-07-28  Dick Porter  <dick@ximian.com>
15057
15058         * loader.c (mono_loader_cleanup): mono_loader_cleanup() is racing
15059         mono_loader_lock() somewhere, so don't delete the critical section
15060         for now.  Found by running and exiting monodevelop.
15061
15062 2006-07-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15063
15064         * filewatcher.c: define the inotify syscalls when we're building on
15065         linux and have sys/syscall.h. The build system might not have support
15066         for inotify but the target system might have it.
15067
15068 2006-07-26  Miguel de Icaza  <miguel@novell.com>
15069
15070         * domain.c: Documentation updates.
15071
15072         * loader.c (mono_free_method): Do not release the method
15073         information if we are being profiled, as profilers will use this
15074         information at shut down to present some data to the user.
15075
15076         This is needed so that the profiler does not crash, as the
15077         profiler tends to keep MonoMethods around, and they might become
15078         invalid if we free these.
15079
15080         (mono_get_method_constrained): Return the original CIL stream
15081         method as well, so verification can be performed against it.
15082
15083 2006-07-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15084
15085         * filewatcher.[ch]: support for inotify file system watcher.
15086         * icall.c: add new internal calls for the inotify file system watcher.
15087
15088 2006-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15089
15090         * threadpool.c: Windows also misbehaves on async. connects. Fixes bug
15091         #78888.
15092
15093 2006-07-20  Dick Porter  <dick@ximian.com>
15094
15095         * file-io.c (ves_icall_System_IO_MonoIO_Seek): Fix signed/unsigned
15096         warning.
15097
15098 2006-07-20  Dick Porter  <dick@ximian.com>
15099
15100         * threads.c (start_wrapper): Do the thread cleanup while we still
15101         hold a reference to its object.  Fixes bug 78123.
15102
15103 2006-07-18  Kornél Pál  <kornelpal@gmail.com>
15104
15105         * class-internals.h: Added MONO_WRAPPER_MANAGED_TO_MANAGED wrapper type.
15106         * debug-helpers.c: Map MONO_WRAPPER_MANAGED_TO_MANAGED to
15107           "managed-to-managed".
15108         * icall.c: Redirect string constructors that take sbyte* to
15109           ves_icall_System_String_ctor_RedirectToCreateString.
15110         * marshal.c: Redirect ves_icall_System_String_ctor_RedirectToCreateString
15111           to CreateString () methods with matching signature.
15112         * reflection.c: Use original security informations for
15113           MONO_WRAPPER_MANAGED_TO_MANAGED.
15114         * security-manager.c: Use original security informations for
15115           MONO_WRAPPER_MANAGED_TO_MANAGED.
15116         * string-icalls.c: Added ves_icall_System_String_ctor_RedirectToCreateString
15117           that is a placeholder and only its address should be used.
15118         * string-icalls.h: Added ves_icall_System_String_ctor_RedirectToCreateString
15119           that is a placeholder and only its address should be used.
15120
15121 2006-07-15  Jonathan Chambers  <joncham@gmail.com>
15122
15123         Begin implementing COM Interop.
15124         * appdomain.c: Increment corlib version.
15125         * class.c: Set ComImport classes' parent to __ComObject.
15126         * loader.c: Mark cominterop methods as such.
15127         * domain.c: Add __ComObject class to MonoDefaults structure.
15128         * image.c: Add 2 hashtables to the image for COM Interop related methods
15129         * metadata.c: Added mono_metadata_type_dup_mp to duplicate a type
15130         using the mempool allocator
15131         
15132         * metadata-internals.h: Add 2 hashtables to the image for COM Interop related methods
15133         * metadata.h: Added cominterop field to _MonoMethodSignature struct and
15134         declaration for mono_metadata_type_dup_mp.
15135         
15136         * debug-helpers.c: Added strings for two additional wrapper types
15137         * object.c: Create proxy objects for ComImport classes
15138         * class-internals.h: Define 2 new method wrapper types, COM Interop remoting target,
15139         and added __ComObject class to MonoDefaults structure.
15140         
15141         * object-internals.h: Finish MonoRealProxy definition, and add definition of
15142         MonoComInteropProxy and MonoComObject.
15143         
15144         * marshal.c: Added support for COM Interop
15145         (signature_cominterop): Converts managed signature to corresponding
15146         unmanaged COM signature.
15147         (cominterop_get_function_pointer): gets unmanaged function pointer via
15148         COM object vtable
15149         (cominterop_get_com_slot_for_method): returns vtable slot in COM interface of method
15150         (cominterop_get_method_interface): returns interface type that method is defined on
15151         (mono_mb_emit_cominterop_call): emits native call to function pointer
15152         gotten from vtable
15153         (cominterop_get_native_wrapper_adjusted): actual wrapper around unmanaged COM call
15154         that matches signature of unmanaged function.
15155         (cominterop_get_native_wrapper): wrapper around adjusted method call.
15156         (cominterop_get_invoke): forwards call from proxy to __ComObject
15157         (ves_icall_System_Runtime_InteropServices_Marshal_AddRef): Implements Marshal.AddRef 
15158         (ves_icall_System_Runtime_InteropServices_Marshal_QueryInterface): Implements Marshal.QueryInterface 
15159         (ves_icall_System_Runtime_InteropServices_Marshal_Release): Implements Marshal.Release 
15160         
15161         * marshal.h: Added Marshal icall declarations.
15162         * icall.c: Added __ComObject icalls. Need to store interfaces in unmanaged code
15163         so we can access them in finalizer
15164         
15165 2006-07-14  Dick Porter  <dick@ximian.com>
15166
15167         * object.c (mono_type_initialization_cleanup): Fix a race
15168         condition by temporarily commenting out the critical section
15169         deletion.
15170
15171 2006-07-14  Zoltan Varga  <vargaz@gmail.com>
15172
15173         * reflection.c (create_custom_attr): Fix some warnings.
15174         (create_custom_attr_data): Ditto.
15175         (typebuilder_setup_properties): Save custom attrs for properties in dynamic
15176         types. Fixes #78855.
15177
15178 2006-07-11  Zoltan Varga  <vargaz@gmail.com>
15179
15180         * class.c (mono_type_get_name_recurse): Fix the name of 1 dimensional non-szarrays.
15181
15182         * reflection.c (mono_custom_attrs_free): Fix freeing of dynamic cattr info.
15183
15184 2006-07-08  Zoltan Varga  <vargaz@gmail.com>
15185
15186         * reflection.c (resolve_object): Add support for DynamicMethod.
15187
15188         * domain.c appdomain.c threads.c monitor.c object.c gc.c: Applied patch from
15189         Joachim Ante (joe@otee.dk). Fix some shutdown leaks.
15190
15191 2006-07-06  Sebastien Pouliot  <sebastien@ximian.com>
15192
15193         * process.c: In ves_icall_System_Diagnostics_Process_GetModules_internal 
15194         don't leak GPtrArray's pdata has we have no use (nor free) for it.
15195
15196 2006-07-01  Zoltan Varga  <vargaz@gmail.com>
15197
15198         * marshal.c (mono_marshal_get_runtime_invoke): Fix passing of generic valuetypes.
15199         Fixes #77888.
15200
15201 2006-06-30  Raja R Harinath  <rharinath@novell.com>
15202
15203         * icall.c (ves_icall_MonoMethod_get_base_definition): Simplify
15204         slightly: remove a shadow local variable.
15205
15206 2006-06-29  Raja R Harinath  <rharinath@novell.com>
15207
15208         * icall.c (ves_icall_MonoMethod_get_base_definition): Return the
15209         definition that introduces the virtual function slot.
15210         Also fix Coverity #105.
15211
15212 2006-06-29  Zoltan Varga  <vargaz@gmail.com>
15213
15214         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Fix support
15215         for dynamic assemblies. Fixes #78724.
15216
15217 2006-06-28  Zoltan Varga  <vargaz@gmail.com>
15218
15219         * marshal.c (mono_string_to_byvalwstr): Fix this completely broken function.
15220         Fixes #78722.
15221
15222 2006-06-21  Martin Baulig  <martin@ximian.com>
15223
15224         * reflection.c
15225         (method_encode_clauses): Don't assert on `ex_info->handlers' here;
15226         fixes #76484.
15227
15228 2006-06-21  Zoltan Varga  <vargaz@gmail.com>
15229
15230         * object.h (mono_array_setref): Cast value to (MonoObject*) to fix warnings.
15231
15232 2006-06-20  Raja R Harinath  <rharinath@novell.com>
15233
15234         Make 'mono_class_get_full' only inflate TYPESPECs, not TYPEDEFs
15235         nor TYPEREFs.
15236         * class.c (mono_class_create_from_typespec): Add 'context' argument.
15237         Inflate result if necessary.
15238         (mono_class_get_full): Remove old version.  Rename from
15239         'mono_class_get' and add 'context' argument.  Pass it to
15240         ..._create_from_typespec.
15241         (mono_class_get): New.  Simple wrapper to mono_class_get_full.
15242         (mono_ldtoken): Revert change below.
15243
15244 2006-06-20  Martin Baulig  <martin@ximian.com>
15245
15246         * class.c (mono_ldtoken): Don't pass the generic context to
15247         mono_class_get_full() for MONO_TOKEN_TYPE_DEF/REF.  Fixes #78053.
15248
15249 2006-06-15  Zoltan Varga  <vargaz@gmail.com>
15250
15251         * marshal.c (mono_ftnptr_to_delegate): Avoid allocating signature from mempool
15252         and later freeing it. Fixes #78638.
15253
15254 2006-06-15  Miguel de Icaza  <miguel@novell.com>
15255
15256         * icall.c (mono_class_get_throw): Revert over-zealous error
15257         throwing, the caller for mono_class_get_throw will cope with
15258         errors when classes are not properly initialized already.
15259
15260         The code still copes with loader exceptions though.
15261
15262         Fixes the regression in reftype1 and reftype3 from the CAS tests.
15263         
15264 2006-06-14  Miguel de Icaza  <miguel@novell.com>
15265
15266         Fixes the `make run1' version of RuntimeAbort (to be commited,
15267         source is in Bugzilla).
15268         
15269         * metadata.c (mono_metadata_interfaces_from_typedef_full): Return
15270         FALSE on class loading failure instead of returning true.
15271
15272         * class.c (mono_class_create_from_typedef): It is possible for
15273         mono_metadata_interfaces_from_typedef_full to fail if a class is
15274         not found, cope with this.
15275         
15276
15277 2006-06-14  Dick Porter  <dick@ximian.com>
15278
15279         * socket-io.c: 
15280         * process.c: Fix a bunch of signed/unsigned warnings from gcc
15281         4.1.1
15282
15283 2006-06-12  Atsushi Enomoto  <atsushi@ximian.com>
15284
15285         * culture-info-table.h : oops, forgot to make it nsync with r61548.
15286
15287 2006-06-09  Jonathan Chambers  <jonathan.chambers@ansys.com>
15288
15289         * icall.c: Another fix for building mono in Visual Studio.
15290
15291 2006-06-09  Jonathan Chambers  <jonathan.chambers@ansys.com>
15292
15293         * marshal.c icall.c: Minor fixes for building mono in Visual Studio.
15294         
15295 2006-06-09  Martin Baulig  <martin@ximian.com>
15296
15297         * debug-mono-symfile.c: Put this back and really fix it this
15298         time. Sorry for all the trouble.
15299
15300 2006-06-08  Zoltan Varga  <vargaz@gmail.com>
15301
15302         * icall.c (mono_class_get_throw): Fix a warning.
15303         (ves_icall_System_Reflection_Assembly_GetTypes): Allways throw 
15304         ReflectionTypeLoadException if needed. Fixes #78606.
15305
15306         * class.c (mono_class_setup_vtable_general): Handle loader errors a bit better.
15307         (mono_class_init): Ditto.
15308
15309         * loader.c (mono_loader_set_error_assembly_load): Display a separate warning for
15310         ref_only exceptions.
15311         (mono_loader_clear_error): Make this work even if there is no error.
15312
15313 2006-06-08  Jonathan Chambers  <jonathan.chambers@ansys.com>
15314
15315         * object-internals.h marshal.c marshal.h icall.c: Implement method 
15316         Marshal.GetComSlotForMethodInfo using internal call.
15317
15318 2006-06-07  Zoltan Varga  <vargaz@gmail.com>
15319
15320         * class-internals.h: Add a new kind of loader error LOADER_ERROR_ASSEMBLY plus
15321         a function for signalling it.
15322
15323         * class.c (mono_class_from_typeref): Use the new kind of loader error when
15324         a referenced assembly is not found.
15325
15326         * loader.c (mono_loader_error_prepare_exception): Add support for 
15327         LOADER_ERROR_ASSEMBLY. Fix formatting.
15328
15329 2006-06-05  Jonathan Chambers  <jonathan.chambers@ansys.com>
15330
15331         * domain.c appdomain.c class-internals.h marshal.c: Add support 
15332         for VARIANT marshalling on windows and increment corlib version
15333         since Variant struct was added.
15334
15335 2006-06-03  Miguel de Icaza  <miguel@novell.com>
15336
15337         * debug-mono-symfile.c: Revert Martin's previous patch which broke
15338         stack trace line information:
15339
15340         (Martin) (mono_debug_symfile_lookup_location): Fix the algorithm:
15341         (Martin) when looking up B which is between A and C, return A not C.
15342
15343         Bug is #78573.
15344
15345         Thanks to Alexander Olk for tracking this down.
15346
15347 2006-06-02  Zoltan Varga  <vargaz@gmail.com>
15348
15349         * marshal.c (mono_marshal_set_last_error_windows): Fix build.
15350         
15351         * marshal.c (mono_marshal_emit_native_wrapper): Call GetLastError () early and without a wrapper to
15352         avoid clobbering its value.
15353         (mono_string_to_lpstr): Fix a warning on windows.
15354
15355 2006-05-31  Zoltan Varga  <vargaz@gmail.com>
15356
15357         * class-internals.h (MonoClass): Removed obsolete 'dummy' flag.
15358
15359         * reflection.c loader.c: Removed references to 'dummy' flag.
15360
15361         * loader.c (mono_loader_error_prepare_exception): Fix a warning.
15362
15363         * threadpool.c: Make ASyncCall a copy of the managed MonoAsyncCall class so
15364         it gets GC tracking.
15365
15366         * object-internals.h (MonoAsyncResult): Add an 'object_data' field which has
15367         GC tracking.
15368         
15369         * object.c (mono_async_result_new): Add an additional parameter 'object_data'.
15370
15371         * marshal.c threadpool.c: Update callers of mono_async_result_new.
15372
15373         * appdomain.c: Bump corlib version.
15374
15375 2006-05-30  Zoltan Varga  <vargaz@gmail.com>
15376
15377         * marshal.c: Use mono_mb_emit_stloc in more places. Use CEE_LDIND_REF and
15378         CEE_STIND_REF when working with object references.
15379
15380 2006-05-31  Zoltan Varga  <vargaz@gmail.com>
15381
15382         * class.c (mono_class_setup_fields): Call mono_class_init () for class->parent.
15383         Fixes #78539.
15384
15385 2006-05-30  Miguel de Icaza  <miguel@novell.com>
15386
15387         * loader.c (method_from_memberref): Fix argument value for
15388         mono_loader_set_error_method_load (I was passing the MonoClass
15389         instead of the class name char *).
15390
15391 2006-05-30  Zoltan Varga  <vargaz@gmail.com>
15392
15393         * marshal.c: Use mono_mb_emit_stloc in more places. Use CEE_LDIND_REF and
15394         CEE_STIND_REF when working with object references.
15395
15396 2006-05-30  Martin Baulig  <martin@ximian.com>
15397
15398         * mono-debug.c (mono_debug_print_stack_frame): Reverted the
15399         mono_method_full_name() change and replace the ':' with a '.'
15400         here.
15401
15402 2006-05-30  Martin Baulig  <martin@ximian.com>
15403
15404         * debug-mono-symfile.c
15405         (mono_debug_symfile_lookup_location): Fix the algorithm:
15406         when looking up B which is between A and C, return A not C.
15407
15408 2006-05-29  Martin Baulig  <martin@ximian.com>
15409
15410         * mono-debug.h
15411         (MonoDebugMethodInfo): Make the typedef public.
15412         (MonoDebugSourceLocation): New public struct.
15413
15414         * mono-debug.c
15415         (mono_debug_source_location_from_address): Removed.
15416         (mono_debug_source_location_from_il_offset): Removed.
15417         (mono_debug_il_offset_from_address): Removed.
15418         (mono_debug_address_from_il_offset): Removed.
15419         (mono_debug_lookup_method): New public function.
15420         (mono_debug_lookup_source_location): New public function; replaces
15421         the old mono_debug_source_location_from_*() functions; see the
15422         inline documentation.
15423         (mono_debug_free_source_location): New public function.
15424         (mono_debug_print_stack_frame): New public function; see the
15425         inline documentation.
15426
15427         * debug-mono-symfile.c
15428         (mono_debug_find_source_location): Renamed into
15429         mono_debug_symfile_lookup_location(); only take a
15430         `MonoDebugMethodInfo *' and an `offset' argument; added inline
15431         documentation.
15432         (mono_debug_find_method): Renamed into
15433         mono_debug_symfile_lookup_method().
15434
15435 2006-05-27  Zoltan Varga  <vargaz@gmail.com>
15436
15437         * assembly.c (mono_assembly_open_full): Dont overwrite the status
15438         returned by mono_image_open_full ().
15439
15440         * appdomain.c (ves_icall_System_Reflection_Assembly_LoadFrom): Convert
15441         MONO_IMAGE_IMAGE_INVALID into a BadImageFormatException. Fixes
15442         #78517.
15443
15444         * object.c (compute_class_bitmap): Use class->class_size for static fields. Fixes
15445         #78518.
15446
15447 2006-05-27  Miguel de Icaza  <miguel@novell.com>
15448
15449         * class.c (mono_class_from_typeref): handle missing images
15450         earlier, deals with bug #78418.   Refactor code; 
15451
15452         Fix a warning introduced in my previous commit (some stale code
15453         from before I revisited my patch).
15454
15455         * class.c (mono_class_create_from_typedef): On failure, remove the
15456         class from the MonoImage->class_cache as the class is not
15457         initialized;   Fixes the leak pointed out by Paolo.
15458
15459 2006-05-25  Dick Porter  <dick@ximian.com>
15460
15461         * threads.c (mono_thread_cleanup): Build fix.  Comment out the
15462         DeleteCriticalSections until I figure out which one may still be
15463         sometimes locked when mono_thread_cleanup is called.
15464
15465 2006-05-24  Dick Porter  <dick@ximian.com>
15466
15467         * threads.c (mono_thread_cleanup): Move the threading cleanup out
15468         of mono_thread_manage and back into its own function, so it can be
15469         called after the finalizer thread has finished.
15470
15471         * appdomain.c (mono_runtime_cleanup): Call mono_thread_cleanup
15472
15473 2006-05-24  Zoltan Varga  <vargaz@gmail.com>
15474
15475         * assembly.c (mono_assembly_open_full): Fix typo introduced by a previous change.
15476         Fixes #78495.
15477
15478         * marshal.c (emit_ptr_to_object_conv): Implement marshalling of byval arrays
15479         with non-blittable elements.
15480         (emit_object_to_ptr_conv): Ditto. Fixes #78492.
15481
15482 2006-05-24  Martin Baulig  <martin@ximian.com>
15483
15484         * mono-debug-debugger.h (MonoDebuggerEvent): Added
15485         `MONO_DEBUGGER_EVENT_FINALIZE_MANAGED_CODE'.    
15486
15487         * mono-debug-debugger.c (mono_debugger_cleanup): Send a
15488         `MONO_DEBUGGER_EVENT_FINALIZE_MANAGED_CODE' and then set
15489         `mono_debugger_event_handler' to NULL.
15490
15491 2006-05-24  Martin Baulig  <martin@ximian.com>
15492
15493         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 57.
15494
15495 2006-05-24  Martin Baulig  <martin@ximian.com>
15496
15497         * mono-debug-debugger.h
15498         (mono_debugger_create_notification_function): Added
15499         `MonoCodeManager *' argument.
15500
15501 Tue May 23 16:05:47 CEST 2006 Paolo Molaro <lupus@ximian.com>
15502
15503         * boehm-gc.c, null-gc.c: fix compilation on 64 bit systems.
15504
15505 Tue May 23 13:44:11 CEST 2006 Paolo Molaro <lupus@ximian.com>
15506
15507         * Makefile.am, gc-internal.h, reflection.c: updates for the new GC.
15508         * sgen.-gc.c, sgen-gc.h: simple generational compacting GC
15509         implementation.
15510
15511 Tue May 23 13:40:30 CEST 2006 Paolo Molaro <lupus@ximian.com>
15512
15513         * icall.c: precise GC support: objects can't be stored in unmanaged
15514         memory anymore, even if they are kept alive by other references: since
15515         they can move the GC needs to be able to always find them.
15516
15517 Tue May 23 12:57:08 CEST 2006 Paolo Molaro <lupus@ximian.com>
15518
15519         * object.c: precise GC support for static fields. Support
15520         for moving GCs: write barriers and pinned allocation for interned
15521         strings.
15522
15523 Tue May 23 12:41:44 CEST 2006 Paolo Molaro <lupus@ximian.com>
15524
15525         * domain.c, domain-internals.h: precise GC support for the MonoDomain
15526         structure.
15527
15528 Tue May 23 12:38:56 CEST 2006 Paolo Molaro <lupus@ximian.com>
15529
15530         * class.c, gc.c: sgen and precise GC updates.
15531
15532 Tue May 23 12:33:24 CEST 2006 Paolo Molaro <lupus@ximian.com>
15533
15534         * marshal.h, marshal.c: added write barrier wrapper and precise type
15535         fixes.
15536
15537 Tue May 23 12:31:22 CEST 2006 Paolo Molaro <lupus@ximian.com>
15538
15539         * object.h, null-gc.c, boehm-gc.c: more write barrier functions and
15540         support.
15541
15542 Tue May 23 12:27:14 CEST 2006 Paolo Molaro <lupus@ximian.com>
15543
15544         * reflection.c: precise and sgen GC updates.
15545
15546 Tue May 23 12:21:46 CEST 2006 Paolo Molaro <lupus@ximian.com>
15547
15548         * debug-helpers.c, class-internals.h: added write barrier wrapper type.
15549
15550 2006-05-22  Zoltan Varga  <vargaz@gmail.com>
15551
15552         * threads.c (start_wrapper): Fix a missed guint32 tid declaration.
15553
15554 2006-05-20  Zoltan Varga  <vargaz@gmail.com>
15555
15556         * reflection.c (encode_cattr_value): Fix yet another bug in the encoding of
15557         MONO_TYPE_OBJECT. Fixes #78462.
15558
15559 2006-05-18  Zoltan Varga  <vargaz@gmail.com>
15560
15561         * marshal.c (emit_marshal_vtype): Add support for UnmanagedType.LPStruct 
15562         and blittable types.
15563
15564 2006-05-17  Miguel de Icaza  <miguel@novell.com>
15565
15566         * class.c (mono_class_get_exception_for_failure): Implement parts
15567         of a TODO: if the loader error is set (instead of the class
15568         error), we return a Loader exception that can be properly thrown
15569         elsewhere.
15570
15571         This was exposed by some Winforms 2.0 code that I tried to run
15572         (Atsushi pointed me to it).
15573
15574 2006-05-17  Zoltan Varga  <vargaz@gmail.com>
15575
15576         * marshal.c (mono_marshal_emit_native_wrapper): Make the marshalling code more
15577         uniform by moving stuff from this function to the proper emit_marshal_XXX functions.
15578         
15579         * marshal.c (emit_marshal_vtype): Add limited support for 
15580         UnmanagedType.LPStruct. Fixes #78427.
15581
15582         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure): 
15583         Applied a patch from kangaroo to fix #77523.
15584
15585 2006-05-17  Martin Baulig  <martin@ximian.com>
15586
15587         * threads.c
15588         (debugger_thread_vtable): Moved into ../mini/debug-debugger.c.
15589         (debugger_thread_created): Removed.
15590         (debugger_thread_exited): Removed.
15591
15592 2006-05-15  Zoltan Varga  <vargaz@gmail.com>
15593
15594         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
15595
15596         * object-internals.h (MonoReflectionResource): Sync with managed version.
15597
15598 2006-05-12  Wade Berrier <wberrier@novell.com>
15599
15600         * threads.c: Define G_GSIZE_FORMAT for systems with glib < 2.6
15601
15602 2006-05-12  Zoltan Varga  <vargaz@gmail.com>
15603
15604         * class.c (mono_fnptr_class_get): Set class->image to corlib for now, since other
15605         functions try to allocate from the image mempool.
15606
15607 2006-05-12  Dick Porter  <dick@ximian.com>
15608
15609         * threads.c (mono_thread_attach): Fix usage of GetCurrentThread().
15610
15611 2006-05-12  Lluis Sanchez  <lluis@ximian.com>
15612
15613         * object.c: The FieldGetter and FieldSetter methods require the full
15614         name of the class, not only the name. Fixes bug #78277.
15615
15616 2006-05-11  Miguel de Icaza  <miguel@novell.com>
15617
15618         * loader.c (method_from_memberref): Do not pass the NULL klass to
15619         mono_loader_set_error_() methods.  Pass the non-NULL value
15620         (class). 
15621
15622 2006-05-11  Zoltan Varga  <vargaz@gmail.com>
15623
15624         * assembly.c (mono_assembly_load_from_full): Fix a bunch of warnings.
15625         (mono_assembly_close): Null out assembly->image->references after freeing it.
15626
15627         * image.c (mono_image_close): Free image->references.
15628         
15629         * reflection.c (mono_image_basic_init): Fix a small memory leak.
15630
15631 2006-05-10  Sebastien Pouliot  <sebastien@ximian.com>
15632
15633         * marshal.c: In function mono_mb_add_local don't use the mb pointer 
15634         before checking if it's NULL (g_assert).
15635
15636 2006-05-10  Martin Baulig  <martin@ximian.com>
15637
15638         * metadata.c (mono_type_size): Kill the g_assert() in MONO_TYPE_GENERICINST;
15639         I thought I already killed that two months ago, but now it somehow reappeared.
15640
15641 2006-05-10  Martin Baulig  <martin@ximian.com>
15642
15643         * mono-debug.c (mono_debug_add_method): Allow instantiated generic methods.
15644
15645 2006-05-10  Zoltan Varga  <vargaz@gmail.com>
15646
15647         * reflection.c: Allocate memory for dynamically created methods in the image
15648         mempools.
15649
15650 2006-05-10  Sebastien Pouliot  <sebastien@ximian.com>
15651
15652         * appdomain.c: In ves_icall_System_AppDomain_[Get|Set]Data functions, 
15653         don't use the ad pointer before checking if it's NULL (g_assert).
15654
15655 2006-05-09  Zoltan Varga  <vargaz@gmail.com>
15656
15657         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): Remove
15658         a redundant (and incorrect) addref. Hopefully fixes sn.exe on windows.
15659
15660         * marshal.c: Allocate all signatures from mempools.
15661
15662         * marshal.c: Allocate some more signatures from mempools.
15663
15664 2006-05-09  Miguel de Icaza  <miguel@novell.com>
15665
15666         * object.c (mono_load_remote_field): The code used to provide a
15667         temporary variable for returning results if the user did not
15668         provide a result pointer.  But our temporary variable was allocted
15669         on the satck.
15670
15671         Fix calling code to always pass a result area.   Coverity ID 103.
15672
15673 2006-05-06  Zoltan Varga  <vargaz@gmail.com>
15674
15675         * threads.c (ves_icall_System_Threading_Interlocked_Add_Int): Return the new
15676         value, not the old. Fixes #78312.
15677         (ves_icall_System_Threading_Interlocked_Add_Long): Ditto.
15678
15679         * class.c (mono_bounded_array_class_get): Allocate data from the image mempool.
15680         (mono_ptr_class_get): Ditto. Also change the cache from a global one to a 
15681         per-image cache.
15682
15683         * assembly.c (mono_assembly_close): Free image->references.
15684
15685         * assembly.c (mono_assembly_names_equal): Fix a warning.
15686         (mono_assemblies_cleanup): Cleanup more global data.
15687
15688         * metadata-internals.h (MonoImage): Add 'ptr_cache'.
15689
15690         * image.c (mono_image_close): Free up the contents of 'array_cache', free up
15691         ptr_cache and image->modules.
15692
15693         * image.c (mono_image_init): Allocate array_cache lazily.
15694         
15695 2006-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15696
15697         * assembly.c: use GetCurrentThreadId for the hash, as GetCurrentThread
15698         behavior was changed recently and has bad side effects.
15699
15700 2006-05-05  Zoltan Varga  <vargaz@gmail.com>
15701
15702         * assembly.c (mono_assembly_open_full): Add a missing mono_image_close ().
15703         
15704         * assembly.c (mono_assembly_close): Remove a debug printf.
15705
15706         * profiler.c (create_profiler): Use mono_aligned_addr_hash.
15707
15708         * metadata-internals.h image.c assembly.c: Change the reference counting scheme
15709         to also allow for temporary references between mono_image_open ()/close ().
15710
15711         * domain.c (get_runtimes_from_exe): Add a FIXME.        
15712
15713 2006-05-04  Zoltan Varga  <vargaz@gmail.com>
15714
15715         * marshal.c: Fix support for dynamic methods.
15716
15717         * appdomain.c (mono_runtime_cleanup): Call mono_marshal_cleanup ().
15718
15719         * marshal.c (mono_marshal_cleanup): New cleanup function.
15720
15721         * marshal.c: Rewrite the wrapper code to allocate most of its memory from the 
15722         image mempools.
15723
15724         * class.c (mono_class_init): Fix leaking class->nested_classes.
15725
15726         * metadata-internals.h (MonoImage): Add a couple of new wrapper caches.
15727
15728         * image.c (mono_image_init): Initialize the new cashes.
15729
15730         * image.c (mono_image_close): Destroy the new cashes.
15731
15732         * marshal.c: Get rid of most of the static caches in favor of per-image caches.
15733
15734         * mempool.c (mono_mempool_strdup): New helper function.
15735
15736         * class-internals.h: Add prototype for mono_loader_unlock ().
15737
15738         * domain.c (mono_jit_info_table_find): Fix a warning.
15739         (mono_debugger_check_runtime_version): Ditto.
15740
15741         * rawbuffer.h rawbuffer.c metadata-internals.h metadata.c class-internals.h 
15742         class.c loader.c image.h image.c assembly.h assembly.c: Add init () and cleanup ()
15743         functions to these modules.
15744
15745         * domain-internals.h domain (mono_cleanup): New internal method to cleanup most
15746         metadata modules.
15747         
15748         * marshal.c (mono_free_bstr): Fix a warning.
15749
15750         * assembly.c (mono_assembly_open_full): Fix another small leak.
15751
15752         * object.c: Fix some unload leaks in the remoting code.
15753
15754         * object-internals.h object-internal.c (mono_string_to_utf8_mp): New helper
15755         function.
15756
15757         * assembly.c (mono_assembly_close): Fix a leak when unloading dynamic assemblies.
15758
15759         * reflection.c: Fix some unload leaks in dynamic assemblies.
15760
15761 2006-05-02  Jonathan Chambers  <jonathan.chambers@ansys.com>
15762
15763         * marshal.c: Add BSTR support on Win32 (all changes under MIT X11)
15764         * marshal.h: Add BSTR support on Win32
15765         * icall.c: Add BSTR icalls
15766         * metadata.h: Add BSTR enums
15767
15768 2006-04-28  Miguel de Icaza  <miguel@novell.com>
15769
15770         Work to catch the crash from #76795 and turn it into an
15771         exception.   As I stubbed out pieces of the VisualBasic support,
15772         I found a number of places where the code was failing and I added
15773         checks to those places. 
15774         
15775         * metadata.c (do_mono_metadata_parse_generic_class): Make this
15776         function return a status code.  If we fail to parse the signature
15777         from mono_metadata_parse_generic_inst, return FALSE.
15778
15779         * loader.c (mono_get_method_from_token): If we fail to load the
15780         method (mono_class_get) return NULL.   
15781
15782         * (method_from_memberref): Return NULL if we are unable to parse
15783         the method signature
15784
15785         (mono_loader_error_prepare_exception): Since we now use the
15786         loader_error flag internally to stop processing, and obtaining
15787         exceptions that might be thrown will walk this code path the
15788         proper way of going from a MonoLoaderError into a
15789         MonoException was convoluted.   This new routine encapsulates the
15790         process of turning the error into an exception and *clearing* the
15791         error afterwards.
15792         
15793 2006-04-27  Miguel de Icaza  <miguel@novell.com>
15794
15795         Work to catch the crashes from 75075 (cope in Assembly.GetTypes
15796         with missing assemblies), and to cope with:
15797
15798                 * Missing fieldref from a non-existing assembly.
15799                 * Missing methodref from a non-existing assembly.
15800
15801         The first batch of work to address *some* of the issues from 76661.
15802         
15803         * object.c (mono_class_create_runtime_vtable): If we fail to
15804         initialize the class raise the exception here. 
15805
15806         * metadata.c (mono_class_get_overrides_full): If any methods fail
15807         to load return the failure to the caller.
15808
15809         * assembly.c: Use REFERENCE_MISSING instead of (gpointer) -1 for
15810         flagging assemblies that failed to load.   
15811
15812         Do not crash if we are unable to load the assembly.
15813
15814         (mono_assembly_close): Do nothing with REFERENCE_MISSING
15815         assemblies. 
15816
15817         * loader.c (mono_loader_set_error_type_load): Change the
15818         convention to always pass unallocated strings, so we make our own
15819         copies (I know our own code had duplicated strings before, but
15820         this keeps the normal conventions).
15821         (method_from_memberref): Call mono_loader_set_error_method_load
15822         for all possible failures of loading the class. 
15823         Remove assert, turn into a loader error.
15824
15825         (mono_loader_error_to_exception): Move this routine from mini
15826         (mini_loader_error_to_exception) there was no need to have that in
15827         mini. 
15828
15829         * class.c (mono_class_from_typeref): If we were not able to load
15830         the assembly with mono_assembly_load_reference, call the
15831         mono_loader_set_error_type_load to register the problem.
15832
15833         (mono_class_setup_fields): If we fail to load the type from
15834         mono_metadata_parse_type_full, call mono_class_set_failure and
15835         break from the loop.
15836
15837         If class->exception_type is set, we do not layout the fields as
15838         that might crash the runtime, and instead return (from breaking
15839         from the previous loop).
15840
15841         (mono_class_setup_vtable): This now returns a boolean indicating
15842         whether the table was properly setup.   The decision is driven by
15843         mono_class_get_overrides_full which might run into non-existing
15844         methods. 
15845         
15846         (mono_class_init): Returns TRUE on success or FALSE if there was a
15847         problem in loading the type (incorrect assemblies, missing
15848         assemblies, methods, etc).
15849
15850         When we call mono_class_setup_fields we also check for a potential
15851         error inside this call (either a class exception or a general
15852         loader exception).
15853
15854         (mono_class_create_from_typedef): If the parent fails to load
15855         (calling mono_class_get_full) return NULL.
15856         
15857         ** Important **
15858
15859         calls to mono_metadata_parse_type_full should be checked
15860         everywhere and set the mono_class_set_failure
15861         (MONO_EXCEPTION_TYPE_LOAD) if we are not able to get the type.
15862
15863         The current patch checks the places where my manually constructed
15864         tests show the errors are showing up, but we should do it
15865         everywhere. 
15866
15867         ** Important2 **
15868
15869         mono_class_init return values should be tested everywhere, like
15870         the previous case this is something that we should audit
15871         everywhere and not only on the cases exposed by the tests I
15872         created. 
15873
15874 2006-04-26  Miguel de Icaza  <miguel@novell.com>
15875
15876         * file-io.c (ves_icall_System_IO_MonoIO_Open): Remove `async'
15877         boolean parameter and instead pass the information on `options'
15878         parameter (FileOptions).
15879
15880         * icall.c: Register the new signature for MonoIO.Open.
15881
15882         * debug-helpers.c (dis_one): Trying to understand how coverity
15883         works.  Fix Run 5, item 78.
15884
15885 2006-04-26  Dick Porter  <dick@ximian.com>
15886
15887         * socket-io.c (hostent_to_IPHostEntry2): Explicitly check for NULL
15888         dereference.
15889
15890 2006-04-25  Martin Baulig  <martin@ximian.com>
15891
15892         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 56.
15893
15894         * threads.c (mono_thread_attach): Set `thread->stack_ptr' and call
15895         debugger_thread_created().
15896         (debugger_gc_push_all_stacks): Don't handle the main thread in any
15897         special way.
15898         (mono_debugger_init_threads): Removed the `main_thread_stack' arg.
15899         (mono_debugger_finalize_threads): New function; undo the effects
15900         of mono_debugger_init_threads().
15901         (mono_debugger_create_all_threads): Removed.
15902
15903 2006-04-24  Zoltan Varga  <vargaz@gmail.com>
15904
15905         * image.c (mono_image_close): Tidy up trace messages.
15906
15907         * assembly.c (mono_assembly_close): Ditto.
15908
15909         * assembly.c (mono_assembly_close): Clear out image->assembly so the image
15910         no longer references an already freed assembly. Fixes #78168.
15911
15912 2006-04-21  Dick Porter  <dick@ximian.com>
15913
15914         * threads.c (mono_thread_detach): Fix reference counting when
15915         detaching threads.
15916
15917 2006-04-21  Zoltan Varga  <vargaz@gmail.com>
15918
15919         * icall.c (ves_icall_System_Enum_ToObject): Improve exception messages. Fixes
15920         #78155.
15921
15922 2006-04-19  Zoltan Varga  <vargaz@gmail.com>
15923
15924         * marshal.c (mono_type_to_ldind): New helper function moved here from mini.c
15925         (mono_type_to_stind): Ditto.
15926
15927         * marshal.c: Use the new helper functions to simplify code.
15928
15929         * image.c (mono_image_close): Add some code for help debug assembly unloading
15930         problems.
15931
15932         * metadata.c (mono_metadata_parse_type_full): Allocate MonoType's from the
15933         image mempool.
15934
15935         * assembly.c (mono_assembly_open_full): Invoke the load hook when the
15936         assembly was already loaded in another appdomain. Fixes #78083.
15937
15938 2006-04-13  Zoltan Varga  <vargaz@gmail.com>
15939
15940         * assembly.c (mono_assembly_load_reference): Increase the refcount of the
15941         referenced assemblies.
15942         (mono_assembly_close): Decrease the refcount of the referenced assemblies.
15943
15944         * domain.c (mono_domain_free): Add a trace message.
15945
15946         * appdomain.c (add_assemblies_to_domain): Ditto.        
15947
15948         * metadata-internals.h: (_MonoAssembly): Modify the meaning of the ref_count
15949         field.  
15950
15951 2006-04-12  Zoltan Varga  <vargaz@gmail.com>
15952
15953         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): Fix image reference counting.
15954
15955 2006-04-12  Martin Baulig  <martin@ximian.com>
15956
15957         * threads.c: Use `MONO_DEBUGGER_SUPPORTED' as the conditional, not
15958         `USE_INCLUDED_LIBGC'.   
15959
15960 2006-04-12  Zoltan Varga  <vargaz@gmail.com>
15961
15962         * image.c (canonicalize_path): Avoid calling strncpy on overlapping strings if
15963         the patch contains ../ and a small directory name later. Hopefully fixes
15964         #78035.
15965
15966 2006-04-10  Martin Baulig  <martin@ximian.com>
15967
15968         Clean up the debugger's thread-handling code.
15969
15970         The debugger's thread-handling code has been moved from
15971         ../mini/debug-debugger.c to threads.c.  We now iterate directly
15972         over the `threads' hash, keep track of exiting threads and also
15973         use proper locking.
15974
15975         We can now debug XSP and XSP based applications with the debugger.
15976
15977         * object-internals.h (MonoThread): Added `gpointer end_stack'.
15978
15979         * threads.h
15980         (MonoThreadCallbacks): Removed; this was only used by the debugger.
15981         (mono_install_thread_callbacks): Likewise.      
15982
15983         * threads.c (mono_thread_callbacks): Removed.
15984         (debugger_thread_created, debugger_thread_exited): New static functions.
15985         (start_wrapper): Call debugger_thread_created().
15986         (thread_cleanup): Call debugger_thread_exited().
15987         (mono_gc_stop_world, mono_gc_start_world): Removed; this was never used.
15988         (mono_debugger_init_threads): New public function.
15989         (debugger_thread_vtable): Moved here from debug-debugger.c; we now
15990         iterate directly over the `threads' hash and also use proper locking.
15991
15992         * mono-debug.h (MONO_DEBUGGER_VERSION): Bumped to 55.
15993
15994         * mono-debug-debugger.h
15995         (MonoDebuggerEvent): Added MONO_DEBUGGER_EVENT_THREAD_EXITED.
15996
15997 2006-04-10  Zoltan Varga  <vargaz@gmail.com>
15998
15999         * reflection.c (encode_cattr_value): Fix handling of parameter type=object, 
16000         argument type=array. Fixes #78057.
16001
16002 2006-04-10  Atsushi Enomoto  <atsushi@ximian.com>
16003
16004         * culture-info-table.h : regenerated. Fixed bug #69652.
16005
16006 2006-04-07  Zoltan Varga  <vargaz@gmail.com>
16007
16008         * loader.c metadata.c: Reapply a variant r59116.
16009         
16010         * loader.c metadata.c: Revert r59116 to see if it fixes the breakage.
16011
16012         * class.c (mono_class_setup_interface_offsets): New internal function.
16013
16014         * reflection.c (ensure_runtime_vtable): Setup interface offsets for dynamic
16015         interfaces too. Fixes #77398.
16016
16017         * reflection.c (encode_cattr_value): Add support for 
16018         parameter type=object, argument type=array.
16019         (load_cattr_value): Ditto. Fixes #77916.
16020
16021         * marshal.c (emit_object_to_ptr_conv): Add support for ARRAY_BYVALCHARARRAY.
16022         (emit_ptr_to_object_conv): Ditto. Fixes #77960.
16023
16024         * metadata.c (mono_type_to_unmanaged): Use ARRAY_BYVALCHARARRAY when converting
16025         a byval char array and CharSet is Ansi.
16026
16027         * metadata.h: Add new marshalling conversion ARRAY_BYVALCHARARRAY.
16028
16029 2006-04-06  Zoltan Varga  <vargaz@gmail.com>
16030
16031         * metadata.c: Add some locking comments.
16032         
16033         * metadata.c (mono_metadata_signature_alloc): Allocate signatures in the image
16034         mempool.
16035         (mono_metadata_free_method_signature): Don't free the signature itself.
16036
16037         * loader.c (mono_free_method): Don't free the signature in non-dynamic methods. 
16038
16039         * assembly.c (mono_assembly_open_full): Avoid the situation where two assemblies
16040         reference the same MonoImage.
16041         (mono_assembly_load_from_full): Add an assert.
16042
16043 2006-04-05  Zoltan Varga  <vargaz@gmail.com>
16044
16045         * image.c (mono_image_close): Don't put the image we are about to free into the
16046         loaded_images_guid_hash.
16047
16048         * marshal.c (mono_mb_emit_ptr): Refactor a common code sequence into this function
16049         to reduce code duplication.
16050
16051         * marshal.c: Register the native functions called by this module as icalls, to
16052         somewhat centralize the creation of MonoMethodSignature's.
16053
16054         * loader.c (mono_method_signature): Add a cache for method signatures.
16055
16056         * metadata.c (mono_metadata_get_param_attrs): New helper function to return
16057         the parameter attributes of a method.
16058         (mono_metadata_parse_method_signature_full): Refactored the computation of
16059         parameter attributes into a separate function. Also avoid one allocation in
16060         most cases.
16061
16062         * assembly.c (mono_assembly_close): Ditto.
16063
16064         * image.c (mono_image_close): Log trace messages with INFO level.
16065
16066         * metadata-internals.h (MonoImage): Add a new 'method_signature' cache.
16067
16068         * image.c reflection.c: Correct reference counting of image modules.
16069         
16070         * metadata.c (mono_metadata_interfaces_from_typedef_full): Allocate the result
16071         of this function from the image mempool.
16072         
16073         (mono_metadata_parse_type_full): Remove the mode != MONO_PARSE_PARAM restriction
16074         to allow more cached types to be used.
16075
16076         * mono-debug.c (mono_debug_add_method): Appled patch from
16077         David S. Miller  <davem@sunset.davemloft.net>: Access 
16078         minfo->lexical_blocks[] entry elements using read32().
16079
16080 2006-04-04  Zoltan Varga  <vargaz@gmail.com>
16081
16082         * loader.c (mono_free_method): No longer free the method header for non-dynamic
16083         methods as it is allocated from the mempool.
16084
16085         * metadata.c (mono_metadata_parse_mh_full): Allocate method headers from the
16086         image mempool.
16087
16088         * metadata-internals.h: Add comments describing the reference counting scheme
16089         used for MonoImage and MonoAssembly.
16090
16091         * image.c assembly.c reflection.c: Rework reference counting of images and 
16092         assemblies so they are freed when the runtime is shut down. Free some 
16093         additional memory structures when an image is unloaded.
16094         
16095 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
16096
16097         * class.c loader.c reflection.c: Allocate more data structures in
16098         the image mempool.
16099
16100 2006-03-31  Miguel de Icaza  <miguel@novell.com>
16101
16102         * icall.c
16103         (ves_icall_System_Environment_InternalSetEnvironmentVariable): Fix
16104         build on pre glib 2.4 systems.
16105
16106 2006-03-31  Zoltan Varga  <vargaz@gmail.com>
16107
16108         * icall.c (ves_icall_System_Environment_InternalSetEnvironmentVariable): New icall.
16109
16110         * icall.c: Fix some warnings.
16111
16112 2006-03-29  Atsushi Enomoto  <atsushi@ximian.com>
16113
16114         * culture-info-table.h : regenerated.
16115
16116 Wed Mar 29 18:24:42 CEST 2006 Paolo Molaro <lupus@ximian.com>
16117
16118         * threads.c, object-internals.h, verify.c: changed the culture caching
16119         code to use a normal MonoArray for storage so the GC can keep track of
16120         them easily. Fixed bits of the cache logic, too and simplified the
16121         code.
16122
16123 Wed Mar 29 17:18:16 CEST 2006 Paolo Molaro <lupus@ximian.com>
16124
16125         * gc-internal.h, null-gc.c, boehm-gc.c, gc.c: enable the finalizer
16126         thread for non-Boehm GCs.
16127
16128 Wed Mar 29 17:10:05 CEST 2006 Paolo Molaro <lupus@ximian.com>
16129
16130         * domain.c, object.c, domain-internals.h: reduce the amount of memory
16131         needed to keep track of the data for static fields.
16132
16133 2006-03-29  Raja R Harinath  <rharinath@novell.com>
16134
16135         Fix #75172
16136         * icall.c (ves_icall_Type_GetMethodsByName): Don't use vtable_size
16137         for interface classes.  Use 'num_methods' instead.
16138         (ves_icall_Type_GetPropertiesByName): Likewise.  Setup vtable
16139         before using '->vtable_size' field.
16140
16141 Wed Mar 29 12:53:28 CEST 2006 Paolo Molaro <lupus@ximian.com>
16142
16143         * domain.c, object.c, domain-internals.h: proxy_vtable_hash
16144         doesn't contain managed pointers, so use a normal hashtable.
16145
16146 Mon Mar 27 11:15:00 CEST 2006 Paolo Molaro <lupus@ximian.com>
16147
16148         * reflection.c, class-internals.h, domain.c: fixed handling of types
16149         used as values for objects in custom attributes (bug #77915):
16150
16151 2006-03-24  Martin Baulig  <martin@ximian.com>
16152
16153         * class.c (mono_class_setup_fields): Added support for generic
16154         instances; fixes #77580.
16155
16156 2006-03-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16157
16158         * assembly.c: publickeytoken is case insensitive. Fixes bug #77898.
16159
16160 2006-03-24  Dick Porter  <dick@ximian.com>
16161
16162         * file-io.c (get_file_attributes): More stat macro breakage.
16163         Fixes bug 77759.
16164
16165 Fri Mar 24 15:26:00 CET 2006 Paolo Molaro <lupus@ximian.com>
16166
16167         * profiler.c: added the file=filename option in the default profiler
16168         to output the profile data to filename.
16169
16170 2006-03-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16171
16172         * icall.c: CodeBase returns '/' instead of '\\' on windows. Fixes
16173         bug #77877.
16174
16175 2006-03-22  Martin Baulig  <martin@ximian.com>
16176
16177         * reflection.c (fieldbuilder_to_mono_class_field): Don't store the
16178         allocated `MonoClassField *' in `fb->handle'.
16179
16180 Tue Mar 21 17:19:37 CET 2006 Paolo Molaro <lupus@ximian.com>
16181
16182         * class.c, image.c, metadata-internals.h: implemented new mechanism to
16183         allocate interface ID to save memory and allow better ID reuse on
16184         appdomain unload. setup_generic_vtable () removal from Martin.
16185
16186 Tue Mar 21 15:54:30 CET 2006 Paolo Molaro <lupus@ximian.com>
16187
16188         * object.h, appdomain.c, domain.c, exception.c, icall.c,
16189         locales.c, marshal.c, object.c, reflection.c, threadpool.c,
16190         threads.c: introduced MONO_OBJECT_SETREF() macro to be able to insert
16191         write barriers for reference stores with managed objects accessed with
16192         C structures in the runtime and in embedding programs.
16193
16194 2006-03-20  Raja R Harinath  <rharinath@novell.com>
16195
16196         * icall.c (ves_icall_Type_GetInterfaces): Avoid using
16197         'interface_id' and 'max_interface_id' fields of MonoClasses
16198         representing open generic types.
16199
16200 Fri Mar 17 18:06:06 CET 2006 Paolo Molaro <lupus@ximian.com>
16201
16202         * object.h, object.c, icall.c: added functions to deal with
16203         storing valuetypes that contain references in managed objects.
16204         * reflection.c, string-icalls.c, threads.c, marshal.c: small
16205         fixes and comments around uses of mono_array_addr ().
16206
16207 Thu Mar 16 17:16:45 CET 2006 Paolo Molaro <lupus@ximian.com>
16208
16209         * object.h, icall.c, monitor.c: object.GetHashCode ()
16210         implementation that supports the moving garbage collector.
16211
16212 Wed Mar 15 16:31:38 CET 2006 Paolo Molaro <lupus@ximian.com>
16213
16214         * icall.c, threads-types.h, threads.c: implemented finalizer for
16215         LocalDataStoreSlot.
16216
16217 2006-03-15  Zoltan Varga  <vargaz@gmail.com>
16218
16219         * metadata.c (mono_type_size): Add a fixme.
16220         (mono_type_stack_size): Ditto.
16221
16222         * object-internals.h (MonoReflectionAssemblyBuilder): Added 
16223         'type_forwarders' field.
16224
16225         * tabledefs.h (TYPE_ATTRIBUTE_FORWARDER): Added new (undocumented) type
16226         attribute from net 2.0.
16227
16228         * object.c (mono_vtable_get_static_field_data): Moved this to object.c
16229         from class.c.
16230
16231         * class.c (mono_class_setup_fields): Fix a warning.
16232         
16233         * class.c (mono_class_from_name): Add support for assemblyref entries
16234         in the EXPORTEDTYPE table.
16235
16236         * reflection.c: Add support for handling type forwarders under net 2.0.
16237
16238         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.       
16239         
16240 2006-03-14  Zoltan Varga  <vargaz@gmail.com>
16241
16242         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Avoid
16243         overwriting entries in ModuleBuild->types, also clean up the code
16244         a little. Fixes #77774.
16245
16246 Tue Mar 14 20:21:18 CET 2006 Paolo Molaro <lupus@ximian.com>
16247
16248         * domain.c, assembly.c, metadata-internals.h, class-internals.h:
16249         load friend assembly info when present.
16250
16251 2006-03-14  Raja R Harinath  <rharinath@novell.com>
16252
16253         Fix crasher on gtest-158.cs.
16254         * metadata.c (mono_metadata_parse_type_full): Avoid canonicalizing
16255         the return value if the MonoClass we want is yet in an
16256         inconsistent state.
16257         * class.c (mono_class_create_from_typedef): Add an comment
16258         explaining an order dependency between mono_class_setup_parent and
16259         mono_class_setup_mono_type.
16260
16261 Mon Mar 13 21:13:27 CET 2006 Paolo Molaro <lupus@ximian.com>
16262
16263         * class.c: documentation updates and events bug fix.
16264
16265 Mon Mar 13 17:28:07 CET 2006 Paolo Molaro <lupus@ximian.com>
16266
16267         * class.c: some cleanup, locking fixes.
16268
16269 Mon Mar 13 10:46:17 CET 2006 Paolo Molaro <lupus@ximian.com>
16270
16271         * class.c: fix the generics code to setup nested
16272         type info to the instantiated type (bug #77770).
16273
16274 Sun Mar 12 16:21:31 CET 2006 Paolo Molaro <lupus@ximian.com>
16275
16276         * marshal.c: fixed a few type correctness issues.
16277
16278 Sat Mar 11 20:14:44 CET 2006 Paolo Molaro <lupus@ximian.com>
16279
16280         * loader.c: the Set/Get/Addrtess array methods should be public.
16281
16282 2006-03-11  Zoltan Varga  <vargaz@gmail.com>
16283
16284         * icall.c (mono_register_jit_icall_wrapper): Fix a warning.
16285         
16286         * icall.c (mono_register_jit_icall_wrapper): Register the argument, not
16287         info->wrapper.
16288
16289 2006-03-10  Zoltan Varga  <vargaz@gmail.com>
16290
16291         * icall.c (mono_register_jit_icall): Allocate the structure using g_new0.
16292
16293         * class-internals.h (MonoJitICallInfo): Add 'trampoline' field used by the JIT.
16294
16295         * mempool.c (mono_mempool_alloc): Speed this up a bit.
16296         (mono_mempool_alloc0): Ditto.
16297
16298 2006-03-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16299
16300         * socket-io.c:
16301         (create_object_from_sockaddr): it was allocating 4 extra bytes
16302         for the AF_UNIX data. Fixes bug #77747.
16303
16304 2006-03-09  Zoltan Varga  <vargaz@gmail.com>
16305
16306         * icall.c (ves_icall_System_MonoMethodInfo_get_retval_marshal): New icall.
16307
16308 2006-03-09  Dick Porter  <dick@ximian.com>
16309
16310         * file-io.c (get_file_attributes): Use S_ISLNK not "& S_IFLNK".
16311         Fixes bug 76966 again.
16312
16313 2006-03-07  Peter Dennis Bartok  <pbartok@novell.com>
16314
16315         * verify.c (dtfinfo_fields): Updated to match new (serializable) field
16316         names from r57532
16317         * appdomain.c: Bumped corlib version to 48 (due to r57532)
16318
16319 2006-03-07  Martin Baulig  <martin@ximian.com>
16320
16321         * object.c
16322         (mono_field_get_value_object): Add support for MONO_TYPE_GENERICINST.
16323
16324 2006-03-07  Martin Baulig  <martin@ximian.com>
16325
16326         * class.c
16327         (mono_class_get_full): Don't inflate TYPEDEF entries; fixes the
16328         regression introduced in r56970; see gtest-252.cs.
16329
16330         * loader.c (mono_get_method_constrained): Correctly handle generic
16331         methods; see gtest-253.cs.
16332
16333 2006-03-04  Zoltan Varga  <vargaz@gmail.com>
16334
16335         * icall.c (ves_icall_type_Equals): Handle NULLs. Fixes #77700.
16336
16337 2006-03-04  Martin Baulig  <martin@ximian.com>
16338
16339         * icall.c (ves_icall_MonoGenericClass_GetParentType): Dynamically
16340         compute the parent type at runtime, just like we're already doing
16341         it for interfaces.
16342
16343         * reflection.c
16344         (mono_reflection_bind_generic_parameters): Don't compute the
16345         parent type anymore.
16346
16347         * class-internals.h (MonoDynamicGenericClass): Removed `parent'.
16348
16349 2006-03-04  Martin Baulig  <martin@ximian.com>
16350
16351         * mono-debug-debugger.h
16352         (mono_debugger_create_notification_function): Allocate memory at
16353         runtime and return a pointer to it.
16354
16355 2006-03-03  Zoltan Varga  <vargaz@gmail.com>
16356
16357         * assembly.c: Fix windows build.
16358         
16359         * assembly.c: Fix build.
16360
16361         * assembly.c: Move the contents of os/{unix,win32}/util.c to this file. 
16362
16363         * gc_wrapper.h: Move the contents of os/gc_wrapper.h to this file.
16364         
16365 2006-03-03  Dick Porter  <dick@ximian.com>
16366
16367         * process.c
16368         (ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal):
16369         Check parameters before dereferencing them.  Fixes Aaron's part of
16370         bug 77393.
16371
16372 2006-03-03  Raja R Harinath  <rharinath@novell.com>
16373
16374         Fix performance regression.
16375         * loader.c (find_method_in_class): Add 'from_class' argument.
16376         Rename 'klass' argument to 'in_class'.  The signature is compared
16377         against the method in 'in_class', and the corresponding method is
16378         returned from 'from_class'.
16379         (find_method): Walk both 'in_class' and 'from_class' in parallel.
16380         (method_from_memberref) [PARENT_TYPESPEC]: Use it to walk the
16381         type definition and generic instantiation in parallel.
16382         (mono_get_method_constrained): Update to changes.
16383
16384 Thu Mar 2 12:27:41 CET 2006 Paolo Molaro <lupus@ximian.com>
16385
16386         * threads.c: make sure the domain is correct, too when doing
16387         mono_thread_attach ().
16388
16389 2006-03-01  Zoltan Varga  <vargaz@gmail.com>
16390
16391         * class.c (mono_class_create_from_typedef): Mark classes using CharSet.Auto as unicode on
16392         windows. Fixes #77683.
16393
16394 Wed Mar 1 20:09:25 CET 2006 Paolo Molaro <lupus@ximian.com>
16395
16396         * object.h, *: introduced specific way to set elements of an array
16397         of references to be used as write barrier. Still need to audit the
16398         uses of mono_array_addr.
16399
16400 2006-03-01  Miguel de Icaza  <miguel@novell.com>
16401
16402         * object-internals.h: New field to cache the assmebly name, patch
16403         from Tambet Ingo (tambet@ximian.com)
16404
16405 Wed Mar 1 19:13:30 CET 2006 Paolo Molaro <lupus@ximian.com>
16406
16407         * decimal.h, class-internals.h, metadata-internals.h,
16408         file-io.h: mark a few function declarations as internal, to
16409         reduce the number of PLT entries.
16410
16411 2006-02-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16412
16413         * file-io.c: fix typo in warning message.
16414
16415 Tue Feb 28 17:43:20 CET 2006 Paolo Molaro <lupus@ximian.com>
16416
16417         * loader.c: on unix, lookup the "*A" version of a function
16418         if charset is auto as a second option before failing.
16419
16420 2006-02-28  Raja R Harinath  <rharinath@novell.com>
16421
16422         * class.h (mono_class_inflate_generic_method): Revert to two
16423         argument version.
16424         * class-internals.h (MonoMethodInflated): Remove 'inflated' field.
16425         (mono_class_inflate_generic_method_full): Add.
16426         * class.c (mono_class_inflate_generic_method_full): Rename from
16427         'mono_class_inflate_generic_method'.  Don't set 'inflated' field.
16428         (mono_class_inflate_generic_method): New.  Wrapper around ..._full.
16429         * loader.c, reflection.c: Update to changes.
16430
16431 Sat Feb 25 17:57:21 CET 2006 Paolo Molaro <lupus@ximian.com>
16432
16433         * icall.c: const fixes and small improvements.
16434
16435 2006-02-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16436
16437         * threadpool.c: for asynchronous connect(), enable the same workaround
16438         for BSD 6 as for the Mac. Fixes bug #77637.
16439
16440 2006-02-24  Zoltan Varga  <vargaz@gmail.com>
16441
16442         * marshal.c (mono_marshal_free_asany): Fix handling of blittable
16443         formatted classes. Fixes #77524.
16444
16445 2006-02-24  Raja R Harinath  <rharinath@novell.com>
16446
16447         * class.c (inflate_generic_type): Add a couple more
16448         micro-optimizations.
16449         (inflate_generic_context): Don't use the 'gmethod' from
16450         'inflate_with'.
16451         (mono_class_inflate_generic_method): If the method has generic
16452         parameters, but the passed-in context doesn't have a 'gmethod',
16453         create one.  Use the possibly simplified generic instantiation
16454         from the declaring class instead of the one passed in.
16455
16456 2006-02-24  Raja R Harinath  <harinath@gmail.com>
16457
16458         Make generic method signature and method header handling lazy.
16459         * class.c (mono_class_inflate_generic_signature): Move to loader.c.
16460         (inflate_generic_header): Likewise.
16461         (mono_class_inflate_generic_method): Rewrite.  Add a 'klass_hint'
16462         parameter to avoid inflating types.
16463         (mono_get_inflated_method): Empty out.
16464         * class.h (mono_class_inflate_generic_method): Update to changes.
16465         * loader.c (mono_get_method_from_token): Don't parse signature for
16466         generic methods, nor methods of generic classes.
16467         (mono_method_signature): Rename from 'mono_method_signature'.
16468         Inflate signature on demand.
16469         (mono_method_get_header): Inflate method header on demand.
16470         * reflection.c: Update to changes.
16471
16472 2006-02-23  Raja R Harinath  <rharinath@novell.com>
16473
16474         * metadata.c (mono_metadata_inflate_generic_inst): If the
16475         instantiation is closed, don't bother expanding it in the new
16476         context.
16477         * class.c (inflate_generic_class): If the generic instantiation
16478         doesn't change after inflation, return the argument itself.
16479         (inflate_generic_type) [MONO_TYPE_MVAR, MONO_TYPE_VAR]:
16480         Add bounds checks.
16481         (inflate_generic_context): If neither the generic class nor the
16482         generic method instantiations change, return the original context.
16483         * reflection.c (mono_method_get_object): Do
16484         'mono_get_inflated_method' before accessing the ->klass field.
16485         (inflate_mono_method): Don't create a MonoGenericMethod unless
16486         necessary.
16487         (inflate_method): Don't pass a constructed type as the declaring
16488         type of a methodbuilder.
16489
16490 Thu Feb 23 11:57:54 CET 2006 Paolo Molaro <lupus@ximian.com>
16491
16492         * object.c: fix memory overwrite.
16493
16494 2006-02-22  Dick Porter  <dick@ximian.com>
16495
16496         * threads.c: Don't use G_GNUC_PRETTY_FUNCTION in debug messages,
16497         it doesn't work any more.
16498         (mono_threads_request_thread_dump): Fix unused variable warnings.
16499
16500 Wed Feb 22 15:08:44 CET 2006 Paolo Molaro <lupus@ximian.com>
16501
16502         * metadata.h, metadata-internals.h, monodiet.c, debug-helpers.c,
16503         mono-debug.c, profiler.c: cleanup: move MonoMethodHeader out of
16504         the public header file.
16505
16506 2006-02-21  Zoltan Varga  <vargaz@gmail.com>
16507
16508         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): Fix writing past memory. Fixes #77613.
16509
16510 Tue Feb 21 19:55:11 CET 2006 Paolo Molaro <lupus@ximian.com>
16511
16512         * class-internals.h, object.c: reduce the size of MonoVTable
16513         and store the interface_offsets array at negative offsets.
16514
16515 Tue Feb 21 19:53:26 CET 2006 Paolo Molaro <lupus@ximian.com>
16516
16517         * metadata.c: tweak table descriptors data structures to reduce
16518         size and runtime relocations.
16519
16520 Tue Feb 21 14:52:13 CET 2006 Paolo Molaro <lupus@ximian.com>
16521
16522         * marshal.c: fix some types and opcodes to be type-safe
16523         in marshaling wrappers.
16524
16525 2006-02-21  Ankit Jain  <jankit@novell.com>
16526
16527         * metadata.h (mono_metadata_decode_signed_value): Add declaration.
16528
16529 2006-02-21  Raja R Harinath  <rharinath@novell.com>
16530
16531         * metadata.c (get_constraints): Relax debugging checks for monodis.
16532
16533 2006-02-21  Ankit Jain  <jankit@novell.com>
16534
16535         * metadata.c (mono_metadata_load_generic_params): Move the code
16536         checking for ambiguous generic params from here to mono/dis/get.c
16537         * metadata-internals.h (mono_generic_params_with_ambiguous_names): Remove.
16538
16539 2006-02-21  Raja R Harinath  <harinath@gmail.com>
16540
16541         Fix assertion triggered when compiling nemerle.
16542         * class.c (mono_get_shared_generic_inst): Rename from
16543         get_shared_inst and make non-static.
16544         * loader.c (mono_get_shared_generic_method): New.  Used to create
16545         the MonoGenericContext-equivalent of a MonoGenericContainer.
16546         (mono_get_method_from_token): Initialize the 'context' field of
16547         the created MonoGenericContainer.
16548         * reflection.c (reflection_methodbuilder_to_mono_method): Likewise.
16549         * metadata.c (get_constraints): Add sanity check.
16550         * class-internals.h: Add new internal methods.
16551
16552         * reflection.c (verify_safe_for_managed_space): New sanity check.
16553         Currently checks that owner-less generic parameters aren't allowed
16554         in managed space.
16555         (mono_type_get_object): Use it.
16556         * icall.c (ves_icall_MonoType_GetGenericArguments): Remove checks
16557         that are now in mono_type_get_object.
16558         (ves_icall_MonoMethod_GetGenericArguments): Likewise.
16559
16560 2006-02-19  Raja R Harinath  <harinath@gmail.com>
16561
16562         * metadata.c (mono_type_create_from_typespec): Rename from
16563         mono_type_create_from_typespec_full.  Remove MonoGenericContainer*
16564         argument and caching of types in the generic container.
16565         (unwrap_arrays, find_generic_param): Remove.
16566         * metadata-internals.h: Update.
16567         * class-internals.h (_MonoGenericContainer): Remove 'types' field.
16568
16569 2006-02-18  Zoltan Varga  <vargaz@gmail.com>
16570
16571         * class.c (mono_class_get_exception_for_failure): Fix a warning.
16572
16573         * marshal.c (mono_marshal_emit_native_wrapper): Handle FNPTR args and
16574         return values. Fixes #77581.
16575
16576         * class.c (mono_fnptr_class_get): Switch name and name_space.
16577
16578         * marshal.c (mono_marshal_asany): Fix marshalling of blittable formatted
16579         classes and add support for [In, Out] attributes.
16580         (mono_marshal_free_asany): Ditto. Fixes #77524.
16581
16582 2006-02-18  Raja R Harinath  <harinath@gmail.com>
16583
16584         * class.c (mono_class_from_generic_parameter): Make more robust to
16585         incomplete MonoGenericContainers from monodis.
16586
16587 Fri Feb 17 16:10:34 CET 2006 Paolo Molaro <lupus@ximian.com>
16588
16589         * class-internals.h: added some more exception types.
16590         * class.c, metadata.c: added a few checks to handle missing
16591         types.
16592
16593 2006-02-17  Raja R Harinath  <rharinath@novell.com>
16594
16595         Use owner-less generic-params some more.
16596         * class.c (my_mono_class_from_generic_parameter): Remove.
16597         (mono_class_from_generic_parameter): Handle null image,
16598         param->name and param->owner.
16599         (mono_class_from_mono_type): Update.
16600         (mono_class_create_from_typespec): Remove 'container' parameter.
16601         If that parameter is non-null, the result is always inflated by
16602         'mono_class_get_full' anyway.
16603         (mono_class_get): Rename from _mono_class_get.  Remove 'container'
16604         parameter.
16605         (mono_class_get_full): Update.
16606
16607         * class.c (inflate_generic_type) [GENERICINST]: If the generic
16608         instance is not open, don't bother inflating.
16609         (mono_class_setup_fields): Hoist some loop-invariants.  Don't
16610         parse metadata for inflated classes.
16611         (_mono_class_get): Change GenericContext* parameter to
16612         GenericContainer*.
16613         (mono_class_create_from_typespec): Likewise.  Simplify, and
16614         implement trivially.  All the cases are handled in
16615         mono_class_from_mono_type.  Don't inflate returned class.
16616         (mono_class_get_full): Delegate GENERICINST optimization to
16617         inflate_generic_type.
16618         (mono_ldtoken) [TOKEN_TYPE_SPEC]: Use mono_class_get_full() here too.
16619
16620 2006-02-16  Dick Porter  <dick@ximian.com>
16621
16622         * socket-io.c (create_object_from_sockaddr): Fix typo.
16623         (create_sockaddr_from_object): Check array lengths before
16624         potentially accessing items off the end.
16625         (ves_icall_System_Net_Sockets_Socket_Receive_internal)
16626         (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal)
16627         (ves_icall_System_Net_Sockets_Socket_Send_internal)
16628         (ves_icall_System_Net_Sockets_Socket_SendTo_internal): Fix buffer
16629         length checks to avoid wraparound overflows.
16630         (ves_icall_System_Net_Sockets_Socket_Select_internal): Check the
16631         contents of the array of sockets
16632         (hostent_to_IPHostEntry2)
16633         (addrinfo_to_IPHostEntry): IPv6 printed addresses can be 48 bytes.
16634         Check return value of inet_ntop ().
16635         (addrinfo_to_IPHostEntry): Fix typo
16636
16637 2006-02-16  Raja R Harinath  <rharinath@novell.com>
16638
16639         Type metadata parsing doesn't use generic-instantiation information.
16640         * metadata.c (mono_metadata_parse_array_full): Change
16641         MonoGenericContext* parameter to MonoGenericContainer*.
16642         (mono_metadata_parse_type_full): Likewise.
16643         (mono_type_create_from_typespec_full): Likewise.
16644         (mono_metadata_parse_mh_full): Likewise.
16645         (mono_metadata_parse_generic_inst): Likewise.
16646         (do_mono_metadata_parse_generic_class): Likewise.
16647         (do_mono_metadata_parse_type): Likewise.
16648         * metadata-internals.h: Update to changes.
16649         * class.c (mono_class_find_enum_basetype): Likewise.
16650         (mono_class_setup_fields): Likewise.
16651         (mono_class_create_from_typespec): Likewise.
16652         * loader.c (method_from_methodspec): Likewise.
16653         (mono_get_method_from_token): Likewise.
16654         (mono_method_get_header): Likewise.
16655
16656 Thu Feb 16 15:42:13 CET 2006 Paolo Molaro <lupus@ximian.com>
16657
16658         * marshal.c: handle additional GENERICINST case (patch from
16659         Thong Nguyen <tum@veridicus.com>).
16660         Fix a few cases where LDIND_I/STIND_I was used for references.
16661
16662 2006-02-16  Raja R Harinath  <rharinath@novell.com>
16663
16664         * reflection.c (mono_reflection_get_token): Remove unused variable.
16665
16666 2006-02-16  Martin Baulig  <martin@ximian.com>
16667
16668         * reflection.c (mono_reflection_get_token): Add support for fields
16669         in instantiated generic types.
16670
16671         * icall.c
16672         (ves_icall_MonoField_Mono_GetGenericFieldDefinition): Removed.
16673
16674 2006-02-15  Martin Baulig  <martin@ximian.com>
16675
16676         * icall.c
16677         (ves_icall_MonoMethod_get_HasGenericParameters): Removed.
16678         (ves_icall_MonoMethod_get_Mono_IsInflatedMethod): Removed.
16679         (ves_icall_MonoMethod_get_IsGenericMethod): New icall.
16680         (ves_icall_MonoMethod_get_IsGenericMethodDefinition): New icall.
16681
16682 Wed Feb 15 16:19:24 CET 2006 Paolo Molaro <lupus@ximian.com>
16683
16684         * class.c, metadata.c, metadata.h, object.c, icall.c,
16685         marshal.c: changed mono_type_get_underlying_type () to do
16686         the sensible thing and introduced mono_type_generic_inst_is_valuetype().
16687         Fixed handling of instantiated generic valuetypes (bug #75479).
16688
16689 2006-02-15  Raja R Harinath  <rharinath@novell.com>
16690
16691         * metadata.c (mono_metadata_decode_signed_value): Simplify.
16692         Delegate to mono_metadata_decode_value, and work on the returned value.
16693
16694         * icall.c (ves_icall_MonoType_GetGenericArguments):
16695         Add consistency check here too.
16696         
16697 2006-02-15  Ankit Jain  <jankit@novell.com>
16698
16699         * metadata.c (mono_metadata_decode_signed_value): Use gint* instead of
16700         char/short etc.
16701
16702 2006-02-15  Ankit Jain  <jankit@novell.com>
16703
16704         * metadata.c (mono_metadata_decode_signed_value): New function to decode
16705         signed values, used only for representing lower bounds of arrays.
16706         (mono_metadata_parse_array_full): Use new
16707         mono_metadata_decode_signed_value to decode lower bounds.
16708
16709 2006-02-14  Martin Baulig  <martin@ximian.com>
16710
16711         * reflection.c
16712         (mono_reflection_get_token): Support "MonoGenericMethod" and
16713         "MonoGenericCMethod" and allow generic instances / methods.
16714
16715 2006-02-11  Zoltan Varga  <vargaz@gmail.com>
16716
16717         * console-io.c (ves_icall_System_ConsoleDriver_GetTtySize): New icall
16718         to obtain the terminal size using an ioctl.
16719
16720         * object.c (mono_nullable_init): Revert this as nullable reference
16721         types are not valid.
16722         (mono_nullable_box): Ditto.
16723
16724 2006-02-09  Dick Porter  <dick@ximian.com>
16725
16726         * threads.c (mono_thread_detach): Drop a reference to the thread
16727         we're detaching.
16728
16729 2006-02-09  Zoltan Varga  <vargaz@gmail.com>
16730
16731         * object.c (mono_nullable_init): Handle nullable reference types.
16732         (mono_nullable_box): Ditto. Fixes #77446.
16733
16734 2006-02-07  Martin Baulig  <martin@ximian.com>
16735
16736         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition): Removed.
16737
16738 2006-02-07  Ankit Jain  <jankit@novell.com>
16739
16740         * socket-io.h (MonoSocketFlags): New. Copy of System.Net.Sockets.SocketFlags
16741         * socket-io.c (convert_socketflags): New. Convert SocketFlags to native ones.
16742         (ves_icall_System_Net_Sockets_Socket_Receive_internal): Convert flags using convert_socketflags.
16743         (ves_icall_System_Net_Sockets_Socket_ReceiveFrom_internal): Likewise.
16744         (ves_icall_System_Net_Sockets_Socket_Send_internal): Likewise.
16745         (ves_icall_System_Net_Sockets_Socket_SendTo_internal): Likewise.
16746
16747 2006-02-02  Zoltan Varga  <vargaz@gmail.com>
16748
16749         * class.c (mono_class_create_generic): Set type_token as well.
16750
16751         * object.c (mono_runtime_invoke_array): Fix handling of byref vtypes to be
16752         compatible with MS.
16753
16754 2006-02-02  Martin Baulig  <martin@ximian.com>
16755
16756         * threads.c, gc.c: Removed the `WITH_INCLUDED_LIBGC' section; it
16757         has never been used so far.
16758
16759 2006-02-02  Martin Baulig  <martin@ximian.com>
16760
16761         * mono-debug-debugger.h: Changed comment at the top of this file;
16762         the header is not installed, but it's safe to #include it from
16763         within the JIT.
16764
16765         * mono-debug.c: Don't #define _IN_THE_MONO_DEBUGGER.
16766         * mono-debug-debugger.c, debug-mono-symfile.c: Likewise.
16767
16768 2006-02-02  Martin Baulig  <martin@ximian.com>
16769
16770         * mono-debug.h
16771         (MonoSymbolTable): Removed the `metadata_info' field.
16772
16773         * mono-debug.c
16774         (mono_debug_init_1): Always set `mono_symbol_table->corlib'.
16775
16776         * mono-debug-debugger.h (MonoDebuggerIOLayer): Removed.
16777         (mono_debugger_add_builtin_types): Removed.
16778         (MonoDebuggerInfo): Moved into ../mini/debug-debugger.h.
16779         (mono_debugger_create_notification_function): We now operate on a
16780         pre-allocated area; take a `gpointer' and return `void'.
16781
16782         * mono-debug-debugger.c
16783         (MonoDebuggerMetadataInfo): Moved into ../mini/debug-debugger.h.
16784         (mono_debugger_add_builtin_types): Removed.
16785
16786 2006-02-02  Martin Baulig  <martin@ximian.com>
16787
16788         * threads.c (mono_debugger_create_all_threads): New public method.
16789
16790 Wed Feb 1 18:22:34 CET 2006 Paolo Molaro <lupus@ximian.com>
16791
16792         * gc-internal.h, boehm-gc.c, null-gc.c: back out the patch, since it
16793         breaks on several platforms.
16794
16795 2006-02-01  Sebastien Pouliot  <sebastien@ximian.com>
16796
16797         * assembly.c: the VS.NET build doesn't supply default values for
16798         MONO_ASSEMBLIES and MONO_CFG_DIR.
16799
16800 2006-02-01  Zoltan Varga  <vargaz@gmail.com>
16801
16802         * gc-internal.h boehm-gc.c null-gc.c (mono_gc_unregister_thread): New
16803         helper function.
16804
16805         * threads.c (mono_thread_detach): Call mono_gc_unregister_thread ().
16806
16807         * loader.c (method_from_memberref): Fix a warning.
16808
16809         * metadata.c (mono_metadata_load_generic_params): Fix a warning.
16810
16811         * marshal.c (emit_struct_conv): Fix marshalling of embedded structs
16812         with explicit layout. Fixes #77433.
16813
16814 2006-01-31  Zoltan Varga  <vargaz@gmail.com>
16815
16816         * icall.c (ves_icall_Type_GetInterfaceMapData): Make sure 
16817         max_interface_id is initialized before using it. Fixes #77398.
16818         (ves_icall_Type_GetInterfaces): Ditto.
16819
16820 2006-01-30  Raja R Harinath  <rharinath@novell.com>
16821
16822         * metadata.c (mono_metadata_parse_method_signature_full): Don't
16823         allocate memory for parameter attributes when parsing memberref
16824         signatures.
16825         * loader.c (mono_loader_set_error_method_load): Don't warn.
16826         (method_from_memberref): Ensure MissingMethodException gets thrown
16827         if method is not found.  Make warning more informative.
16828
16829 2006-01-29  Raja R Harinath  <harinath@gmail.com>
16830
16831         Fix #77397
16832         * icall.c (ves_icall_MonoType_get_IsGenericParameter): Don't
16833         return true if is byref.
16834         (ves_icall_TypeBuilder_get_IsGenericParameter): Likewise.
16835         (ves_icall_MonoType_get_DeclaringType): Return NULL on byref classes.
16836         (ves_icall_MonoType_get_DeclaringMethod): Likewise.
16837
16838 2006-01-27  Raja R Harinath  <rharinath@novell.com>
16839
16840         Fix tests/find-method.2.il
16841         * loader.c (find_method, find_method_in_class): Remove is_inflated
16842         argument.  Revert 2006-01-18 change.
16843         (method_from_memberref) [MONO_MEMBERREF_PARENT_TYPESPEC]: If type
16844         is generic, search for method in its generic definition.
16845         * class.c (mono_class_setup_vtable_general): Print generic
16846         arguments of generic types in debugging printf.
16847
16848 2006-01-26  Zoltan Varga  <vargaz@gmail.com>
16849
16850         * object-internals.h (MonoThread): Add 'thread_dump_requested' field.
16851
16852         * threads.c (mono_threads_request_thread_dump): New helper function.
16853
16854 2006-01-25  Raja R Harinath  <rharinath@novell.com>
16855
16856         * metadata.c (mono_type_create_from_typespec_full): Fix caching of types.
16857
16858 2006-01-25  Ankit Jain  <jankit@novell.com>
16859
16860         * metadata-internals.h (mono_generic_params_with_ambiguous_names): Add declaration and
16861         move definition to ..
16862         * metadata.c (mono_generic_params_with_ambiguous_names): .. here.
16863         
16864 2006-01-25  Ankit Jain  <jankit@novell.com>
16865             Raja R Harinath  <rharinath@novell.com>
16866
16867         * metadata-internals.h (mono_generic_params_with_ambiguous_names): New.
16868         * metadata.c (mono_metadata_load_generic_params): Fill mono_generic_params_with_ambiguous_names
16869         as necessary.
16870
16871 2006-01-25  Martin Baulig  <martin@ximian.com>
16872
16873         * mono-debug-debugger.h: Moved `MonoDebuggerManager' and
16874         `MonoDebuggerThread' into debug-debugger.c.
16875
16876 Tue Jan 24 18:53:35 CET 2006 Paolo Molaro <lupus@ximian.com>
16877
16878         * profiler.c: fix printing of data.
16879
16880 2006-01-24  Atsushi Enomoto  <atsushi@ximian.com>
16881
16882         * object.c, marshal.c : Fixed runtime part of bug #77315. Reject
16883           invalid surrogate in UTF7/UTF8 bytes and don't return NULL.
16884
16885 Tue Jan 24 09:56:16 CET 2006 Paolo Molaro <lupus@ximian.com>
16886
16887         * object.c: fix deadlock related to string interning.
16888
16889 2006-01-23  Martin Baulig  <martin@ximian.com>
16890
16891         * mono-debug-debugger.h (MonoDebuggerIOLayer): Removed.
16892
16893         * mono-debug-debugger.c (mono_debugger_io_layer): Removed.
16894
16895 2006-01-23  Martin Baulig  <martin@ximian.com>
16896
16897         * mono-debug.h: Moved the prototypes of some functions which are
16898         used by the JIT here from mono-debug-debugger.h.
16899
16900 2006-01-21  Martin Baulig  <martin@ximian.com>
16901
16902         * Makefile.am: Don't install mono-debug-debugger.h.
16903
16904 2006-01-21  Martin Baulig  <martin@ximian.com>
16905
16906         * mono-debug-debugger.h: Enforce the private status of this header
16907         file and removed unneccessary #include's in metadata/*.c and mini/*.c.
16908         Moved some stuff from mono-debugger-jit-wrapper.h here.
16909
16910 2006-01-20  Raja R Harinath  <rharinath@novell.com>
16911
16912         * class.c (mono_class_from_typeref): Add a sanity test to help
16913         catch lack of assembly load/search hooks.
16914
16915 2006-01-19  Zoltan Varga  <vargaz@gmail.com>
16916
16917         * marshal.c (emit_struct_conv): Relax the fields with same offset
16918         check even more. Fixes #77230.
16919
16920 2006-01-18  Martin Baulig  <martin@ximian.com>
16921
16922         * loader.c (find_method_in_class): Added `gboolean is_inflated'
16923         argument; if false, we compare the uninstantiated signatures.
16924         (method_from_memberref): Compare the uninstantiated signatures;
16925         fixes #76417.
16926
16927 2006-01-18  Robert Jordan  <robertj@gmx.net>
16928
16929         * boehm-gc.c, null-gc.c (mono_gc_weak_link_remove):
16930         Clear the weak link. Fixes bug #77170.
16931
16932         * gc.c (mono_gchandle_free):
16933         Reflect *-gc.c changes (tiny optimization).
16934
16935 2006-01-18  Zoltan Varga  <vargaz@gmail.com>
16936
16937         * metadata.c (mono_metadata_signature_dup): Applied patch from
16938         Aras Pranckevicius (aras@otee.dk). Fix crash when compiled with MSVC.
16939         Fixes #77288.
16940
16941 2006-01-17  Zoltan Varga  <vargaz@gmail.com>
16942
16943         * marshal.c (emit_struct_conv): Allow fields with the same offset when
16944         marshalling from native to managed code. Fixes #77230.
16945
16946 2006-01-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16947
16948         * threadpool.c: fix problem (Mac only) when more than one asynchronous
16949         connect. Fixes bug #77020.
16950
16951 Mon Jan 16 19:20:43 CET 2006 Paolo Molaro <lupus@ximian.com>
16952
16953         * class.c: fixed id assignement for nested interfaces (bug #77275).
16954         Added also better info for --print-vtable debugging.
16955
16956 2006-01-12  Martin Baulig  <martin@ximian.com>
16957
16958         * icall.c (ves_icall_MonoGenericClass_GetInterfaces): Inflate the
16959         interfaces on-the-fly; fixes #76625.
16960
16961         * class-internals.h
16962         (MonoDynamicGenericClass): Removed `ifaces' and `count_ifaces'; we
16963         don't need that anymore.
16964
16965 2006-01-12  Miguel de Icaza  <miguel@novell.com>
16966
16967         * socket-io.c
16968         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
16969         To avoid initing the nested_classes when not needed I turned the
16970         PeerCredData as a toplevel internal class, as it has to be shared
16971         anyways. 
16972
16973         Fixes the CASA issue.
16974
16975 2006-01-11  Ben Maurer  <bmaurer@andrew.cmu.edu>
16976
16977         * domain.c: Accessors for MonoJitInfo
16978
16979         * profiler-private.h: Add jitinfo to the end jit hook
16980
16981         * profiler.[ch]: Define new hooks, called after jitting which give
16982         the MonoJitInfo that was compiled
16983
16984 2006-01-10  Martin Baulig  <martin@ximian.com>
16985
16986         * class.c (mono_class_setup_events): Add support for generic
16987         classes; fixes #76440.
16988
16989 2006-01-06  Raja R Harinath  <rharinath@novell.com>
16990
16991         Fix #77160.
16992         * icall.c (ves_icall_InternalInvoke): Use mono_get_inflated_method
16993         on passed-in method.
16994
16995 2006-01-03  Zoltan Varga  <vargaz@gmail.com>
16996
16997         * object.c (mono_runtime_invoke_array): Add Nullable support.
16998
16999         * icall.c (ves_icall_System_Activator_CreateInstanceInternal): Ditto.
17000
17001 2006-01-03  Sebastien Pouliot  <sebastien@ximian.com>
17002
17003         * file-io.c: Don't consider sockets as directory and avoid an endless
17004         loop. Fix bug #76966.
17005
17006 2006-01-03  Zoltan Varga  <vargaz@gmail.com>
17007
17008         * object.c (mono_nullable_init): New helper function.
17009         (mono_nullable_box): Ditto.
17010
17011         * marshal.c (mono_marshal_get_runtime_invoke): Handle Nullables.
17012
17013         * icall.c (ves_icall_FieldInfo_SetValueInternal): Handle Nullables.
17014
17015         * icall.c (ves_icall_MonoField_GetValueInternal): Handle Nullables.
17016         
17017 2006-01-02  Zoltan Varga  <vargaz@gmail.com>
17018
17019         * class.c (mono_class_is_assignable_from): Make T assignable to 
17020         Nullable<T>.
17021
17022 2005-12-23  Sebastien Pouliot  <sebastien@ximian.com>
17023
17024         * appdomain.c: Bump corlib version to 46.
17025         * icalls.c: Renamed CurrentTimeZone to CurrentSystemTimeZone (for
17026         serialization purpose) and changed ves_icall_System_Reflection_
17027         Assembly_get_code_base signature to accept a boolean (to escape, or 
17028         not, the assembly code base).
17029
17030 2005-12-23  Dick Porter  <dick@ximian.com>
17031
17032         * icall.c: 
17033         * threads-types.h: 
17034         * threads.c: Added OpenMutex, OpenSemaphore and OpenEvent icalls.
17035         CreateEvent icall now returns "created" boolean parameter.
17036
17037 2005-12-22  Zoltan Varga  <vargaz@gmail.com>
17038
17039         * marshal.c (mono_mb_emit_restore_result): Add generics support. Fixes
17040         #76967.
17041
17042         * reflection.c (mono_custom_attrs_construct_by_type): Handle the case 
17043         when attr_klass is an interface. Fixes #77045.
17044
17045 2005-12-20  Zoltan Varga  <vargaz@gmail.com>
17046
17047         * marshal.c (emit_struct_conv): Fix previous patch.
17048         
17049         * marshal.c (emit_struct_conv): Add a check for fields with the same
17050         offset.
17051
17052 2005-12-20  Raja R Harinath  <rharinath@novell.com>
17053
17054         Fix regression in Mono.C5.
17055         * class.c (mono_class_create_generic): If 'klass' is an interface
17056         set up the interface offsets.
17057         (mono_class_is_assignable_from): Don't throw away generic arguments.
17058
17059 2005-12-19  Raja R Harinath  <rharinath@novell.com>
17060
17061         * icall.c (ves_icall_System_MonoType_getFullName): Return NULL for
17062         type parameters.
17063
17064 2005-12-15  Raja R Harinath  <rharinath@novell.com>
17065
17066         * metadata.c (mono_metadata_parse_method_signature_full): Remove a
17067         dead store.
17068         (do_mono_metadata_parse_generic_class): Don't pass the current
17069         generic context when parsing the type being instantiated: it
17070         cannot use it, anyway.
17071
17072         * loader.c (method_from_memberref): Don't inflate a signature if
17073         it doesn't contain any type parameters.
17074
17075 2005-12-15  Zoltan Varga  <vargaz@gmail.com>
17076
17077         * class.c (mono_class_setup_vtable): Call mono_reflection_get_dynamic_overrides () to get the overrides in dynamic assemblies.
17078
17079 2005-12-14  Martin Baulig  <martin@ximian.com>
17080
17081         * class.c
17082         (mono_type_get_name_recurse): Don't return null for type
17083         parameters and open generic classes.
17084         (mono_class_setup_methods): Don't exclude generic instances.
17085         (mono_get_unique_iid): Use different IDs for different
17086         instantiations of the same generic type.
17087         (mono_class_setup_vtable): Only use setup_generic_vtable() for
17088         open generic instances; create a normal vtable for closed generic
17089         instances.
17090         (mono_class_setup_vtable_general): We're now also called for
17091         closed generic instances.
17092
17093         * reflection.c
17094         (mono_reflection_bind_generic_parameters): Correctly use
17095         mono_metadata_lookup_generic_inst() everywhere.
17096
17097 2005-12-14  Zoltan Varga  <vargaz@gmail.com>
17098
17099         * object.c (mono_class_create_runtime_vtable): Call 
17100         mono_class_setup_vtable ().
17101
17102         * reflection.c (mono_reflection_get_dynamic_overrides): New helper
17103         function.
17104         (ensure_runtime_vtable): Initialize the generic vtable lazily. Fixes
17105         #76959.
17106
17107         * loader.c (mono_loader_set_error_type_load): Print the type load
17108         warnings to the console so they are more visible to the user.
17109         (mono_loader_set_error_method_load): Ditto.
17110
17111         * reflection.c (ensure_runtime_vtable): Revert the last change as it
17112         is still broken.
17113         
17114         * reflection.c (ensure_runtime_vtable): Fix build.
17115
17116         * reflection.c (ensure_runtime_vtable): Disable an optimization which
17117         doesn't work in all cases.
17118
17119 2005-12-13  Zoltan Varga  <vargaz@gmail.com>
17120
17121         * object.c (mono_array_new_full): Treat a single dimensional array
17122         with 0 lower bounds as an szarray. Fixes #76973.
17123
17124         * reflection.c (custom_attr_visible): Really fix this.
17125
17126 2005-12-12  Zoltan Varga  <vargaz@gmail.com>
17127
17128         * reflection.c (custom_attr_visible): Allow nested public attributes
17129         as well.
17130
17131         * class.c (mono_class_setup_vtable_general): Add missing != -1 to an
17132         interface check.
17133
17134 2005-12-12  Raja R Harinath  <harinath@gmail.com>
17135
17136         * class.c (set_generic_param_owner): Delete.
17137         (mono_class_create_from_typedef): Don't set ->owner field of
17138         generic parameters to "param containers" of enclosing classes.
17139         * reflection.c (mono_reflection_initialize_generic_parameter):
17140         Likewise.
17141
17142 2005-12-11  Zoltan Varga  <vargaz@gmail.com>
17143
17144         * reflection.c (custom_attr_visible): Fix build.
17145
17146 2005-12-10  Zoltan Varga  <vargaz@gmail.com>
17147
17148         * reflection.c (mono_custom_attrs_from_builders): Avoid returning
17149         private attributes.
17150         
17151         * reflection.c (reflection_methodbuilder_to_mono_method): Fix
17152         handling of null parameter defaults.
17153
17154 2005-12-09  Raja R Harinath  <rharinath@novell.com>
17155
17156         * class.c (mono_class_from_generic_parameter): Don't set
17157         klass->generic_container.
17158         (my_mono_class_from_generic_parameter): Likewise.
17159
17160 2005-12-07  Zoltan Varga  <vargaz@gmail.com>
17161
17162         * reflection.c (load_public_key): Fix a warning.
17163         (method_encode_code): Fix unaligned accesses.
17164
17165 2005-12-07  Martin Baulig  <martin@ximian.com>
17166
17167         * object-internals.h (MonoReflectionGenericParam): Added `cattrs'.
17168
17169         * reflection.c
17170         (write_generic_param_entry): Encode our custom attrs.
17171
17172         * appdomain.c (MONO_CORLIB_VERSION): Bump to 45.
17173
17174 2005-12-07  Martin Baulig  <martin@ximian.com>
17175
17176         * reflection.c (encode_new_constraint): Removed; we don't use the
17177         `NewConstraintAttribute' anymore.
17178
17179 2005-12-06  Zoltan Varga  <vargaz@gmail.com>
17180
17181         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Do
17182         not fire a TypeResolve event when Assembly.GetType () is called.
17183
17184 2005-12-05  Ben Maurer  <bmaurer@ximian.com>
17185
17186         Beginning of support for nullable types in the runtime. Parts of
17187         this patch are from Martin.
17188
17189         * appdomain.c (MONO_CORLIB_VERSION): Bump
17190
17191         * domain.c (mono_init_internal): get the nullable type
17192
17193         * class.c (mono_class_is_nullable): New method
17194         (mono_class_get_nullable_param): New mehod
17195         (mono_class_create_generic): In types T? set cast_class to T
17196
17197         * class-internals.h (MonoDefaults): new nullable default class
17198         (mono_class_get_nullable_param, mono_class_get_nullable_param):
17199         new methods.
17200
17201 2005-12-05  Raja R Harinath  <rharinath@novell.com>
17202
17203         * metadata.c (select_container): New.  Refactor code to select the
17204         appropriate GenericContainer given the type of generic parameter
17205         we are looking for.
17206         (mono_metadata_parse_generic_param): Take a MonoGenericContainer,
17207         not a MonoGenericContext.  Use select_container.  Update parameters.
17208         (do_mono_metadata_parse_type): Combine the code for MONO_TYPE_VAR
17209         and MONO_TYPE_MVAR.
17210         (unwrap_arrays): Remove duplicate tests.
17211         (find_generic_param): Rename from 'has_same_context'.  Now walks a
17212         generic instantiated class to find any arguments that are generic
17213         parameters.
17214         (mono_type_create_from_typespec_full): Use find_generic_param to
17215         avoid evicting some generic instantiations from the typespec
17216         cache.
17217
17218 Mon Dec 5 15:07:42 GMT 2005 Paolo Molaro <lupus@ximian.com>
17219
17220         * reflection.c: fixed writing of doubles on ARM FPA.
17221
17222 2005-12-02  Robert Jordan  <robertj@gmx.net>
17223
17224         * icall.c: Fixed EventInfo.ReflectedType (#76829).
17225
17226 2005-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17227
17228         * filewatcher.c: try loading libgamin-1.so.0 before libfam, since at
17229         least on SUSE 10 they are not the same (on debian, they are just the
17230         same thing).
17231
17232 2005-12-01  Raja R Harinath  <rharinath@novell.com>
17233
17234         * icall.c (ves_icall_MonoType_get_DeclaringType): Implement
17235         DeclaringType for VARs and MVARs.
17236         * class.c (set_generic_param_owner): Fix initialization of owner
17237         fields.
17238
17239 Wed Nov 30 15:48:22 CET 2005 Paolo Molaro <lupus@ximian.com>
17240
17241         * icall.c: fixed Enum.ToObject() to correctly convert the values.
17242
17243 2005-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17244
17245         * threadpool.c: workaround for a bug that shows up on the Mac:
17246         select()+connect() on a blocking socket is not like it should
17247         be, so we proceed to connect() in that case, wasting the I/O
17248         threadpool thread until connect succeedes. Fixes bug #75436.
17249
17250 2005-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17251
17252         * threadpool.c: fix typo when setting file descriptor states.
17253
17254 2005-11-28  Raja R Harinath  <rharinath@novell.com>
17255
17256         * class-internals.h (MonoGenericContainer.is_signature): Remove.        
17257         * metadata.c (mono_metadata_parse_method_signature_full): Don't
17258         create a temporary signature container.
17259         (mono_metadata_parse_generic_param): Update to changes.
17260         (mono_type_create_from_typespec_full): Update to changes.
17261         * loader.c (method_from_memberref): Don't use a
17262         MonoGenericContainer while parsing a memberref signature.
17263         (method_from_methodspec): Remove dead-store of the 'container'
17264         variable.  It's overwritten before use.
17265
17266         * metadata.c (mono_type_create_from_typespec_full): Make debugging
17267         checks tighter.
17268         (mono_metadata_parse_generic_param): Likewise.
17269         * loader.c (find_method_in_class): Does not need a
17270         MonoGenericContainer.  Use 'mono_method_signature' rather than
17271         'mono_method_signature_full'.
17272         (find_method, mono_get_method_constrained, method_from_memberref):
17273         Update to changes.
17274
17275         * metadata.c (mono_type_create_from_typespec_full): Ensure that
17276         owner-less generic-parameters are never evicted from the typespec
17277         cache.
17278
17279         * loader.c (method_from_memberref): Don't use the current context
17280         when parsing signatures.
17281         (method_from_methodspec, mono_get_method_from_token): Update to changes.
17282
17283         * metadata.c (do_mono_metadata_parse_generic_class): Avoid
17284         side-effects in g_assert.
17285         * loader.c (mono_get_method_from_token): Resolve klass earlier so
17286         that we don't potentially lose information.
17287
17288 2005-11-26  Dick Porter  <dick@ximian.com>
17289
17290         * icall.c:
17291         * threads.c: icalls to implement basic (ie, not named)
17292         System.Threading.Semaphore.
17293
17294 2005-11-24  Dick Porter  <dick@ximian.com>
17295
17296         * process.c
17297         (ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal):
17298         Use GetProcessId() if it's available.
17299
17300 2005-11-23  Zoltan Varga  <vargaz@gmail.com>
17301
17302         * icall.c threads-types.h threads.c: Add Exchange<T> icall.
17303
17304 2005-11-23  Raja R Harinath  <rharinath@novell.com>
17305             Ankit Jain  <jankit@novell.com>
17306
17307         * loader.c (mono_get_method_from_token): Initialize 'method' field
17308         of all generic parameters before parsing the signature.  Remove
17309         code that "fixed"-up MVAR references.
17310
17311 2005-11-23  Ankit Jain  <jankit@novell.com>
17312
17313         * metadata.c (mono_metadata_has_generic_params):
17314         (mono_metadata_load_generic_param_constraints):
17315         (mono_metadata_load_generic_params): Move duplicate code ...
17316         (mono_metadata_get_generic_param_row): ... here. Returns the
17317         first row-id in GenericParam table for a given owner (token).
17318         * metadata-internals.h (mono_metadata_get_generic_param_row): Add
17319         prototype.
17320
17321 2005-11-23  Raja R Harinath  <rharinath@novell.com>
17322             Ankit Jain  <jankit@novell.com>
17323
17324         * metadata.c (mono_metadata_class_equal): Pass signature_only when
17325         comparing VARs too.
17326         * icall.c (ves_icall_MonoType_get_DeclaringMethod): Look at 
17327         type->data.generic_param only if the type is an MVAR.
17328         (ves_icall_MonoMethod_GetGenericArguments): Ensure that we don't
17329         leak owner-less VARs and MVARs into managed space.
17330
17331 2005-11-21  Martin Baulig  <martin@ximian.com>
17332
17333         * class-internals.h
17334         (MonoMethod): Moved the `generic_container' here from
17335         `MonoMethodNormal' since we now also need it for
17336         `MonoMethodPInvoke';
17337         (MonoMethodNormal): Moved the `generic_container' to `MonoMethod'.
17338         (MonoMethodInflated): Replaced the `MonoMethodNormal nmethod' with
17339         an union containing both `MonoMethodNormal' and
17340         `MonoMethodPInvoke'.
17341
17342         * loader.c
17343         (mono_get_method_from_token): Allow implementing generic methods
17344         as interncalls.
17345
17346         * threads.c
17347         (ves_icall_System_Threading_Interlocked_CompareExchange_T): New
17348         icall.
17349
17350 2005-11-17  Dick Porter  <dick@ximian.com>
17351
17352         * icall.c: 
17353         * process.h: 
17354         * process.c: Split the Process Start_internal icall into
17355         ShellExecuteEx_internal and CreateProcess_internal, which are
17356         called depending on whether UseShellExecute is true.  Fixes bug
17357         76670.
17358
17359         * appdomain.c (MONO_CORLIB_VERSION): Incremented
17360
17361 2005-11-17  Zoltan Varga  <vargaz@gmail.com>
17362
17363         * marshal.c (emit_ptr_to_object_conv): Get rid of the 'usize' and
17364         'msize' parameters, use the information in 'mspec' instead.
17365         (emit_object_to_ptr_conv): Ditto.
17366
17367         * marshal.c (emit_struct_conv): Handle explicit layout structs with
17368         fields out of order. Fixes #76733.
17369
17370 2005-11-17  Ankit Jain  <jankit@novell.com>
17371
17372         * metadata.c (mono_type_create_from_typespec_full): Remove unnecessary g_assert.
17373
17374 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
17375
17376         * icall.c : renamed MakeGenericMethod -> MakeGenericMethod_impl for
17377           bug #76575.
17378
17379 2005-11-16  Zoltan Varga  <vargaz@gmail.com>
17380
17381         * object.c (mono_class_compute_gc_descriptor): Disable typed allocation
17382         for types with non-auto layout. Fixes #76717.
17383
17384 2005-11-16  Ankit Jain  <jankit@novell.com>
17385
17386         * class.c (my_mono_class_from_generic_parameter): param->owner can be null.
17387         * metadata.c (mono_metadata_parse_generic_param): Create a dummy MonoGenericParam 
17388         if generic_context is null.
17389           (mono_metadata_generic_param_equal): param->owner can be null.
17390           (mono_type_create_from_typespec_full): Don't cache the MonoType if param->owner is
17391         null.
17392
17393 2005-11-16  Zoltan Varga  <vargaz@gmail.com>
17394
17395         * reflection.c (create_dynamic_mono_image): Set md_version_minor to
17396         the correct value.
17397
17398 2005-11-15  Martin Baulig  <martin@ximian.com>
17399
17400         * object.c (set_value): Use mono_class_from_mono_type() instead of
17401         the hack for generic instances; fixes #76136.
17402
17403 2005-11-15  Zoltan Varga  <vargaz@gmail.com>
17404
17405         * metadata-internals.h (_MonoImage): Add 'md_version_major/minor'
17406         fields.
17407
17408         * image.c (load_metadata_ptrs): Initialize the new fields.
17409
17410         * reflection.c (create_dynamic_mono_image): Ditto.
17411
17412         * reflection.c (build_compressed_metadata): Use the new fields.
17413
17414         * icall.c (ves_icall_System_Reflection_Module_get_MDStreamVersion): New
17415         icall.
17416
17417         * icall.c (mono_assembly_icalls): Remove obsolete get_MetadataToken
17418         icall.
17419         
17420 2005-11-15  Ankit Jain  <jankit@novell.com>
17421             Raja R Harinath  <harinath@gmail.com>
17422
17423         * class-internals.h (_MonoGenericContainer.types): New. Cache for MonoTypes.
17424         * metadata.c (mono_type_create_from_typespec_full): Use MonoType from the
17425         new per-generic_container cache if the cached MonoType's context matches
17426         the current context.
17427           (has_same_context): New. Check if the VARs or MVARs in a GENERIC_INST refer
17428         to the expected context.
17429           (unwrap_arrays): New. Get the element MonoType for an ARRAY/SZARRAY.
17430
17431 2005-11-14  Carlos Alberto Cortez <calberto.cortez@gmail.com>
17432
17433         * appdomain.c: Update MONO_CORLIB_VERSION to 42, since
17434         we changed the signature of an icall.
17435         * icall.c: Modify to mono_double_ParseImpl return true/false 
17436         depending on the success, instead of throwing the exception. This will
17437         help us in Double.TryParse methods.
17438         
17439 2005-11-14  Zoltan Varga  <vargaz@gmail.com>
17440
17441         * marshal.c (emit_marshal_object): Throw an exception when
17442         marshalling 'object' instead of crashing. Fixes #76696.
17443
17444 2005-11-11  Zoltan Varga  <vargaz@gmail.com>
17445
17446         * class-internals.h: Add prototype for mono_type_get_full_name ().
17447
17448 2005-11-11  Dick Porter  <dick@ximian.com>
17449
17450         * threads.c (mono_thread_manage): Make sure the main thread has
17451         abandoned all its mutexes when cleaning up.  Fixes bug 74680.
17452
17453 2005-11-11  Zoltan Varga  <vargaz@gmail.com>
17454
17455         * loader.c (mono_loader_set_error_type_load): Log a warning to the
17456         console about the missing type.
17457         (mono_loader_set_error_method_load): Ditto.
17458
17459 2005-11-09  Miguel de Icaza  <miguel@novell.com>
17460
17461         * mono-config.c (mono_get_config_dir): Set the system defaults if
17462         none is specified.
17463
17464         * assembly.c (mono_set_dirs): New API entry point to set the
17465         assembly and the config directory in one call
17466
17467 2005-11-09  Zoltan Varga  <vargaz@gmail.com>
17468
17469         * marshal.c (mono_ftnptr_to_delegate): Throw a NotSupportedException if
17470         the ftnptr was created from a delegate in a domain other than the
17471         current domain. Fixes #75377.
17472
17473         * exception.h exception.c: Add mono_get_exception_not_supported ().
17474
17475 2005-11-08  Martin Baulig  <martin@ximian.com>
17476
17477         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 53.
17478
17479 2005-11-07  Sebastien Pouliot  <sebastien@ximian.com>
17480
17481         * security-manager.h: Added definitions to deal with strongname key 
17482         pairs bigger (and smaller) than 1024 bits.
17483         * reflection.c: Remove hardcoded strongname size (128 bytes) and 
17484         adjust wrt the public key length being used.
17485
17486 2005-11-03  Atsushi Enomoto  <atsushi@ximian.com>
17487
17488         * marshal.c, icall.c : reverted sig->pinvoke changes which broke
17489           Windows build (r51396-51397).
17490
17491 2005-11-03  Martin Baulig  <martin@ximian.com>
17492
17493         * class.c (mono_class_setup_vtable_general): Also add generic
17494         methods to the vtable; fixes #76581.
17495
17496 2005-11-01  Miguel de Icaza  <miguel@novell.com>
17497
17498         * string-icalls.c (ves_icall_System_String_ctor_encoding): Make
17499         sure that we lookup GetString method from the System.Text.Encoding
17500         class, not the derived class or we get an empty method.
17501
17502         Fixed class #76612.
17503
17504 2005-10-25  Miguel de Icaza  <miguel@novell.com>
17505
17506         * assembly.c (mono_assemblies_init): Do not set the Mono root dir
17507         if it has been previously set (embedders). 
17508
17509         Make mono_set_rootdir available also on Unix.
17510
17511 005-10-24  Robert Jordan  <robertj@gmx.net>
17512
17513         * assembly.c: fixed MONO_ASSEMBLIES to be NULL on cygwin as well.
17514
17515 2005-10-30  Zoltan Varga  <vargaz@freemail.hu>
17516
17517         * marshal.c icall.c: Clean up the usage of sig->pinvoke flag. Now
17518         only calls which are made to native code use this flag.
17519
17520         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): Remove the check for FieldBuilders as it is now done in managed code.
17521
17522 2005-10-29  Zoltan Varga  <vargaz@freemail.hu>
17523
17524         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal):
17525         Add support for FieldBuilders.
17526
17527 2005-10-29  Martin Baulig  <martin@ximian.com>
17528
17529         * mono-debug.c
17530         (mono_debug_using_mono_debugger): New public method; returns
17531         whether we're running inside the debugger.
17532
17533 2005-10-27  Zoltan Varga  <vargaz@gmail.com>
17534
17535         * reflection.c (mono_reflection_get_custom_attrs_info): Add support
17536         for Method/Constructor/FieldBuilders.
17537
17538 2005-10-26  Zoltan Varga  <vargaz@gmail.com>
17539
17540         * reflection.c (module_add_cattrs): Save custom attributes for global methods
17541         and fields as well.
17542
17543 2005-10-26  Martin Baulig  <martin@ximian.com>
17544
17545         * mono-debug-debugger.c
17546         (MonoDebuggerMetadataInfo): Added `klass_parent_offset'.
17547
17548 2005-10-24  Raja R Harinath  <harinath@gmail.com>
17549
17550         * icall.c (base64_to_byte_array): Don't pass an out-of-range
17551         integer to isspace.
17552
17553 2005-10-21  Zoltan Varga  <vargaz@gmail.com>
17554
17555         * marshal.c (emit_marshal_vtype): Correctly handle [In,Out] modifiers
17556         when passing valuetypes byref. Fixes #76502.
17557
17558 2005-10-19  Jackson Harper  <jackson@ximian.com>
17559
17560         * profiler.c: Don't put a . in front of types that are not in a
17561         namespace.
17562
17563 2005-10-18  Zoltan Varga  <vargaz@gmail.com>
17564
17565         * icall.c (ves_icall_Type_GetField): Applied patch from Robert Jordan (robertj@gmx.net). Fixes #75515.
17566
17567 2005-10-15  Zoltan Varga  <vargaz@freemail.hu>
17568
17569         * marshal.c: Add generics support to the ldfld/stfld wrappers. Fixes
17570         #76436.
17571         (mono_marshal_get_ldflda_wrapper): Fix a warning.
17572
17573 2005-10-13  Carlos Alberto Cortez <calberto.cortez@gmail.com>
17574
17575         * assembly.c metadata-internals.h icall.c: Define an additional
17576         parameter for mono_assembly_name_parse_full, so we can avoid creating
17577         S.R.AssemblyName.Version when no version info wasn't passed.
17578         
17579 2005-10-09  Miguel de Icaza  <miguel@novell.com>
17580
17581         * class.c (mono_type_get_full_name): Reimplement method that was
17582         removed. 
17583
17584         * image.c: Some docs
17585
17586 2005-10-10  Zoltan Varga  <vargaz@gmail.com>
17587
17588         * profiler.c (output_newobj_profile): Fix printing of Total memory
17589         on x86.
17590
17591 2005-10-08  Zoltan Varga  <vargaz@freemail.hu>
17592
17593         * profiler.c: Add support for allocations > 2GB. Fixes #74886.
17594
17595 2005-10-08  Gert Driesen  <drieseng@users.sourceforge.net>
17596
17597         * threads.c: remove debug output.
17598
17599 2005-10-08  Zoltan Varga  <vargaz@freemail.hu>
17600
17601         * threads.c (mono_thread_manage): Fix crashes if more than 64
17602         threads need to be aborted. Hopefully fixes #75899.
17603
17604         * assembly.c (mono_stringify_assembly_name): New helper function.
17605
17606         * class.c: Use mono_stringify_assembly_name instead of the similar
17607         static function.
17608
17609         * assembly.h assembly.c: Add support for calling a postload search 
17610         hook if an assembly cannot be loaded.
17611
17612         * appdomain.c: Register new search hooks which call the AssemblyResolve
17613         events in AppDomain. Fixes #75231
17614
17615 2005-10-07  Martin Baulig  <martin@ximian.com>
17616
17617         * mono-debug.c (mono_debug_add_method): Create a wrapper entry for
17618         methods without debug info.
17619
17620 2005-10-07  Zoltan Varga  <vargaz@gmail.com>
17621
17622         * class-internals.h debug-helpers.c marshal.h marshal.c: Add ldflda
17623         wrappers.
17624
17625 2005-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17626
17627         * file-io.c: now that we return symlinks, use lstat and, when the file
17628         is a symbolic link, stat, to get the file attributes. Also avoid the
17629         conversion to/from utf16/external.
17630
17631 2005-10-06  Zoltan Varga  <vargaz@gmail.com>
17632
17633         * class.c (mono_class_layout_fields): Compute klass->has_references
17634         correctly if an embedded valuetype is not yet initialized. Fixes
17635         #76331.
17636
17637 2005-10-04  Martin Baulig  <martin@ximian.com>
17638
17639         * metadata.c
17640         (mono_metadata_load_generic_param_constraints): New public
17641         function; splitted the constraints loading out from
17642         mono_metadata_load_generic_params().
17643
17644         * class.c (mono_class_create_from_typedef): Call
17645         mono_metadata_load_generic_param_constraints() after setting up
17646         the type and creating our parent; fixes #75329.
17647
17648 2005-10-04  Martin Baulig  <martin@ximian.com>
17649
17650         * icall.c (ves_icall_MonoGenericClass_GetParentType): Allow
17651         non-dynamic parent classes.
17652
17653 2005-10-04  Atsushi Enomoto  <atsushi@ximian.com>
17654
17655         * file-io.c : win32 build fix (ETXTBSY seems not found).
17656
17657 2005-10-04  Martin Baulig  <martin@ximian.com>
17658
17659         * reflection.c
17660         (mono_image_get_methodspec_token): Make the cache actually work;
17661         fixes #75974.
17662
17663 2005-10-04  Martin Baulig  <martin@ximian.com>
17664
17665         * class.c (mono_class_name_from_token): Removed the unneccessary
17666         `MonoGenericContext *' argument.
17667
17668 2005-10-04  Martin Baulig  <martin@ximian.com>
17669
17670         * loader.c
17671         (method_from_methodspec): Make the caching work again; fixes the
17672         performance regression from #76262.
17673
17674 2005-10-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17675
17676         * file-io.c:
17677         * file-io.h:
17678         * icall.c: replace FindFirst/FindNext/FindClose calls with a new
17679         GetFileSystemEntries that performs the same work but without going
17680         into io-layer, locking, etc.
17681
17682 2005-09-30  Zoltan Varga  <vargaz@gmail.com>
17683
17684         * threads.c (ves_icall_System_Threading_Thread_Abort): Handle 
17685         ThreadState_Stopped as well. Fixes #76047.
17686
17687 2005-09-29  Martin Baulig  <martin@ximian.com>
17688
17689         * class.c
17690         (inflate_generic_context): If the new context has a `gmethod', set
17691         its `container' that that gmethod's `container'.
17692
17693         * metadata.c
17694         (mono_metadata_parse_generic_param): Simplify things;
17695         `generic_container = generic_context->container;' is just fine.
17696
17697         * loader.c (method_from_methodspec): Code cleanups.
17698
17699 Wed Sep 28 17:06:01 CEST 2005 Paolo Molaro <lupus@ximian.com>
17700
17701         * decimal.c: fix warning (and let gcc generate correct
17702         code on ARM with optimizations).
17703
17704 2005-09-28  Martin Baulig  <martin@ximian.com>
17705
17706         * loader.c
17707         (method_from_memberref): Added `MonoGenericContext *class_context'
17708         argument; this is used when parsing a MONO_MEMBERREF_PARENT_TYPESPEC.
17709         (method_from_methodspec): If we're a memberref, use the enclosing
17710         context when parsing its parent.  Fixes #76262; see gtest-206.cs.
17711
17712 2005-09-28  Martin Baulig  <martin@ximian.com>
17713
17714         * object.c (mono_runtime_invoke_array): Added support for
17715         MONO_TYPE_GENERICINST; fixes #75917.
17716
17717 2005-09-27  Martin Baulig  <martin@ximian.com>
17718
17719         * reflection.c (encode_type): For `MONO_TYPE_CLASS/VALUETYPE', use
17720         `k->byval_arg.type' to determine the actual type.
17721
17722         * loader.c (method_from_methodspec): Removed some hacks.
17723
17724 2005-09-27  Ben Maurer  <bmaurer@ximian.com>
17725
17726         * class-internals.h (mono_field_is_deleted): Do the test for
17727         rtspecialname before we check the actual name of the field. This
17728         prevents us from dereferencing a pointer into the string table,
17729         saving us from accessing a few pages
17730
17731         * *.c: Replace the use of {Enter,Leave}CriticalSection with
17732         macros. This will allow a deadlock debugger to easily be plugged
17733         in.
17734
17735 2005-09-27  Martin Baulig  <martin@ximian.com>
17736
17737         * loader.c (method_from_methodspec): Create a "signature"
17738         MonoGenericContainer and use mono_get_method_full().  Fixes #75584.
17739
17740 2005-09-27  Martin Baulig  <martin@ximian.com>
17741
17742         * class.c
17743         (inflate_generic_class): Correctly set the new context's
17744         container.
17745
17746         * loader.c
17747         (find_method, find_method_in_class): Take a `MonoGenericContainer *'
17748         instead of a `MonoGenericContext *'.
17749         (mono_method_signature_full): Take a `MonoGenericContainer *'
17750         instead of a `MonoGenericContext *'.
17751
17752         * metadata.c
17753         (mono_metadata_parse_signature_full): Take a `MonoGenericContainer *'
17754         instead of a `MonoGenericContext *'.
17755         (mono_metadata_parse_method_signature_full): Likewise.
17756
17757 2005-09-26  Martin Baulig  <martin@ximian.com>
17758
17759         * class.c
17760         (mono_class_from_generic_parameter): Set `klass->generic_container'
17761         (mono_class_from_generic_parameter): Likewise.
17762         (mono_bounded_array_class_get): We inherit the generic container
17763         from the element class.
17764
17765         * loader.c
17766         (find_method, find_method_in_class): Take a `MonoGenericContext *'
17767         argument rather than computing it here.
17768         (method_from_memberref): Correctly set the generic context before
17769         parsing the signature.  Fixes #75681.
17770
17771 2005-09-26  Zoltan Varga  <vargaz@gmail.com>
17772
17773         * object.c (mono_class_has_special_static_fields): Fix warnings.
17774
17775 2005-09-26  Carlos Alberto Cortez <calberto.cortez@gmail.com>
17776
17777         * assembly.c: Add parse_public_key function, to
17778         par the public keys. Also added mono_assembly_name_parse_full,
17779         to define it the parsed key should be freed or not.
17780         * icall.c: Added ves_icall_System_Reflection_AssemblyName_ParseName,
17781         to parse a long format assembly name.
17782         * metadata-internals.h: Keep mono_assembly_name_parse_full as
17783         private, since calling it to preserve the key requires
17784         freeing it manually.
17785         
17786 2005-09-26  Atsushi Enomoto  <atsushi@ximian.com>
17787
17788         * locales.c : removed HAVE_ICU part.
17789
17790 2005-09-24  Zoltan Varga  <vargaz@freemail.hu>
17791
17792         * object.c (mono_class_create_runtime_vtable): Avoid calling 
17793         field_is_special_static if the klass has no special static fields.
17794
17795         * class-internals.h (MonoClass): Add 'no_special_static_fields' flag.
17796         (MonoCachedClassInfo): Likewise.
17797
17798         * object.c (mono_class_has_special_static_fields): New helper function.
17799
17800 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
17801
17802         * class.c (mono_class_create_from_typedef): Don't call 
17803         interfaces_from_typedef_full for enums.
17804         (mono_class_create_from_typedef): Compute the base types of enums directly
17805         without calling mono_class_setup_fields ().
17806         (mono_class_find_enum_basetype): New helper function.
17807
17808         * reflection.c (mono_image_build_metadata): Emit type names+namespaces at
17809         one place inside the string heap.
17810         
17811 Fri Sep 23 19:37:46 CEST 2005 Paolo Molaro <lupus@ximian.com>
17812
17813         * class.c: locking fixes, code cleanups, some docs added.
17814         Allocate some data structures in the image mempool.
17815
17816 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
17817
17818         * rawbuffer.c: Remove unneccessary set_n_pagefaults () routine and update
17819         the example code.
17820         
17821 Fri Sep 23 18:27:02 CEST 2005 Paolo Molaro <lupus@ximian.com>
17822
17823         * class-internals.h, class.c, reflection.c: reduce memory taken by
17824         MonoClass.
17825
17826 Fri Sep 23 17:56:21 CEST 2005 Paolo Molaro <lupus@ximian.com>
17827
17828         * metadata.c, metadata.h, loader.h: documentation updates, code and
17829         API cleanups.
17830
17831 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
17832
17833         * rawbuffer.c: Remove unneccessary set_n_pagefaults () routine and update
17834         the example code.
17835
17836         * rawbuffer.h rawbuffer.c: Add code and APIs to help determine the number of
17837         page faults caused by the runtime while reading metadata.
17838
17839 2005-09-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17840
17841         * socket-io.c: the field names were changed 3 months ago and no one
17842         realized until bug #76077 got filed!
17843
17844 2005-09-20  Martin Baulig  <martin@ximian.com>
17845
17846         * icall.c (assembly_icalls): Removed some unused debugger icalls.
17847
17848 2005-09-20  Martin Baulig  <martin@ximian.com>
17849
17850         * mono-debug.c (mono_debug_add_type): Ignore array types and don't
17851         write the rank into the class entry.
17852
17853 2005-09-20  Martin Baulig  <martin@ximian.com>
17854
17855         * mono-debug-debugger.c (MonoDebuggerMetadataInfo): Added some stuff.
17856
17857 2005-09-19  Zoltan Varga  <vargaz@gmail.com>
17858
17859         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
17860
17861         * icall.c (custom_attrs_defined_internal): New icall.
17862
17863         * reflection.c (mono_reflection_get_custom_attrs_by_type): New helper
17864         function.
17865         (mono_custom_attrs_construct_by_type): New helper function.
17866
17867 2005-09-17  Zoltan Varga  <vargaz@freemail.hu>
17868
17869         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): Null
17870         terminate the resulting string. Fixes #76123.
17871
17872 2005-09-16  Martin Baulig  <martin@ximian.com>
17873
17874         * mono-debug.c
17875         (mono_debug_add_method): Ignore inflated methods for the moment.
17876
17877 2005-09-14  Martin Baulig  <martin@ximian.com>
17878
17879         * debug-mono-symfile.h (MONO_SYMBOL_FILE_VERSION): Bump version to 39.
17880
17881 2005-09-13  Zoltan Varga  <vargaz@gmail.com>
17882
17883         * metadata.c (mono_class_get_overrides_full): Modify signature to explicitly
17884         return a success/failure indication.
17885         (mono_metadata_interfaces_from_typedef_full): Ditto.
17886         (get_constraints): Ditto.
17887
17888 2005-09-12  Zoltan Varga  <vargaz@gmail.com>
17889
17890         * marshal.c (emit_marshal_array): Fix handling of null arrays.
17891         
17892         * marshal.c (emit_marshal_array): Add support for returning string
17893         arrays from delegates. Fixes #76063.
17894
17895         * marshal.c: Use the emit_ldloc/stloc macros where possible.
17896
17897 2005-09-11  Zoltan Varga  <vargaz@gmail.com>
17898
17899         * threads.c (ves_icall_System_Threading_Thread_MemoryBarrier): New
17900         icall.
17901
17902 2005-09-09  Zoltan Varga  <vargaz@gmail.com>
17903
17904         * reflection.c icall.c: Fix after mono_get_exception_type_load
17905         signature change.
17906
17907         * assembly.c (mono_assembly_get_assemblyref): New helper function.
17908         (mono_assembly_load_reference): Use the new helper.
17909
17910         * class-internals.h (MonoLoaderError): New structure containing 
17911         information about type loading errors.
17912
17913         * class-internals.h loader.c: Add APIs to store per-thread loader
17914         error information.
17915
17916         * loader.c class.c: Set the loader error if needed.
17917
17918         * exception.h exception.c: Add functions to throw MissingMethod/MissingFieldExceptions.
17919
17920 Thu Sep 8 18:54:07 BST 2005 Paolo Molaro <lupus@ximian.com>
17921
17922         * decimal.c: fixed to handle the broken ARM fp format.
17923
17924 Wed Sep 7 22:17:58 BST 2005 Paolo Molaro <lupus@ximian.com>
17925
17926         * icall.c: on ARM use the libc strtod(), since bsd_strtod() seems
17927         broken.
17928
17929 2005-09-06  Martin Baulig  <martin@ximian.com>
17930
17931         * domain.c (supported_runtimes): Added v2.0.50727.
17932
17933 Tue Sep 6 11:40:24 CEST 2005 Paolo Molaro <lupus@ximian.com>
17934
17935         * culture-info.h: reduce the size of some structures.
17936
17937 2005-09-05  Martin Baulig  <martin@ximian.com>
17938
17939         Reflect latest API changes in the August CTP.
17940
17941         * icall.c
17942         ("Type.BindGenericParameters"): Renamed to "MakeGenericType".
17943         ("MonoType.HasGenericArguments"): Removed.
17944         ("MonoMethod.BindGenericParameters"): Renamed to
17945         "MakeGenericMethod".
17946         ("MethodBuilder.BindGenericParameters"): Renamed to
17947         "MakeGenericMethod".    
17948
17949 2005-09-05  Martin Baulig  <martin@ximian.com>
17950
17951         * mono-debug-debugger.c: Moved the debugger icalls into icall.c.
17952
17953 2005-09-05  Martin Baulig  <martin@ximian.com>
17954
17955         Applying a patch from Michal Moskal <malekith@nemerle.org>.
17956
17957         * icall.c (ves_icall_Type_get_IsGenericType): Return true also if
17958         generic_container is non-NULL.
17959
17960 2005-09-05  Martin Baulig  <martin@ximian.com>
17961
17962         Applying a patch from Michal Moskal <malekith@nemerle.org>.
17963
17964         * object.c (set_value): In MONO_TYPE_VALUETYPE, add generics support.
17965
17966 2005-08-29  Michal Moskal  <malekith@nemerle.org>
17967
17968         * reflection.c (encode_locals,
17969         mono_reflection_sighelper_get_signature_local): Increase buffer sizes
17970         for large generic types.
17971
17972 2005-09-05  Martin Baulig  <martin@ximian.com>
17973
17974         Applying a patch from Michal Moskal <malekith@nemerle.org>.
17975
17976         * class.c (mono_dup_array_type): New public method.
17977         (mono_metadata_signature_deep_dup): New public method.
17978         (dup_type): Correctly duplicate array and function types.
17979
17980 2005-09-05  Martin Baulig  <martin@ximian.com>
17981
17982         Applying a patch from Michal Moskal <malekith@nemerle.org>.
17983
17984         * reflection.c (get_default_param_value_blobs): Handle generic types
17985         and generic methods.
17986
17987 2005-09-02  Sebastien Pouliot  <sebastien@ximian.com>
17988
17989         * class.c: Fixed error reporting (method/class were inversed) for 
17990         inheritance demands.
17991         * security-manager.c|h: Added the AppDomain when calling the managed
17992         System.Security.SecurityManager.InheritanceDemand method.
17993
17994 2005-09-01  Raja R Harinath  <rharinath@novell.com>
17995
17996         * reflection.c (encode_marshal_blob): 'marshaltype' and
17997         'marshaltyperef' are alternate sources for the custom marshaler
17998         name.
17999
18000 Wed Aug 31 17:39:54 CEST 2005 Paolo Molaro <lupus@ximian.com>
18001
18002         * class.c: fix creation of array classes with rank == 1
18003         (patch by Ankit Jain <jankit@novell.com>).
18004
18005 Wed Aug 31 17:35:19 CEST 2005 Paolo Molaro <lupus@ximian.com>
18006
18007         * object.c: fix check for creating the bound data for arrays vs
18008         szarrays.
18009
18010 2005-08-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18011
18012         * object.c: configuration file name is now based on the executable name,
18013         not the image name. Fixes bug #75931.
18014
18015 2005-08-29  Zoltan Varga  <vargaz@gmail.com>
18016
18017         * marshal.c (emit_thread_interrupt_checkpoint_call): Load the
18018         flag using LDIND_U4 since it leads to smaller and faster code on ia64.
18019
18020 2005-08-25  Zoltan Varga  <vargaz@gmail.com>
18021
18022         * rand.c: Use wincrypt.h instead of WinCrypt.h.
18023
18024 2005-08-24  Ankit Jain  <jankit@novell.com>
18025             Raja R Harinath  <rharinath@novell.com>
18026
18027         * class.c (mono_class_from_typeref): Don't call mono_class_init as we might've been
18028           called by it recursively.
18029           (mono_class_init): Remove special case in pending_init handling, since it's
18030           superseded by the fix to mono_class_from_typeref.
18031
18032 2005-08-22  Zoltan Varga  <vargaz@freemail.hu>
18033
18034         * threads.c (ves_icall_System_Threading_Thread_Thread_internal): Remove the 
18035         BROKEN_THREAD_START stuff.
18036
18037 2005-08-21  Zoltan Varga  <vargaz@freemail.hu>
18038
18039         * class-internals.h object.c: Add a new kind of trampoline called a delegate 
18040         trampoline.
18041
18042         * domain-internals.h domain.c: Add a has for delegate trampolines to MonoDomain.
18043         
18044         * object.c (mono_delegate_ctor): Replace the original function address with
18045         a delegate trampoline.
18046
18047 2005-08-21 Gert Driesen <drieseng@users.sourceforge.net>
18048
18049         * icall.c: add boolean argument to base64_to_byte_array and 
18050         InternalFromBase64String to control whether a whitespace-only string
18051         is allowed (or should casue a FormatException to be thrown). We need
18052         this as the behavior has changed between MS.NET 1.x and 2.0, and we
18053         to match the MS behaviour in both profiles.
18054         * appdomain.c: Bump corlib version.
18055
18056 2005-08-20  Carlos Alberto Cortez <calberto.cortez@gmail.com>
18057
18058         This patch implements a big portion of publisher policy
18059         support, used to bind assembly versions and redirect
18060         one assembly from version A to version B.
18061
18062         * assembly.c:
18063         New GSList loaded_assembly_bindings, for storing the cached
18064         assembly bindings.
18065         (assembly_binding_maps_name): New static function for checking if a 
18066         assembly binding information maps an assembly name.
18067         (mono_assembly_binding_info_free): New function for freeing
18068         assembly binding information resources.
18069         (get_publisher_policy_info): New static function for retrieving 
18070         assembly binding information from a MonoImage.
18071         (compare_versions): New static function for comparing an assembly
18072         binding information data and the version of an assembly name.
18073         (check_policy_versions): New static function for checking if an
18074         assembly binding info mapping an assembly name is valid for it.
18075         (mono_assembly_load_publisher_policy): New static function for
18076         loading the 'policy.major.minor.MyAssembly' image for an assembly
18077         with an assembly name 'aname'.
18078         (mono_assembly_bind_version): New static function for updating
18079         assembly redirection.
18080         (mono_assembly_apply_binding): New static function for applying
18081         assembly binding.
18082         (search_binding_loaded): New static function for searching 
18083         loaded assembly binding infos in the cache domain.
18084         (mono_assembly_load_full): Don't apply assembly binding for
18085         reflection only assemblies.
18086
18087         * metadata-internals.h: Add MonoAssemblyBindingInfo,
18088         which contains information about assembly binding. Also
18089         declare signature for mono_config_parse_publisher_policy ()
18090         function, used to retrieve pub policy info.
18091         
18092         * mono-config.c:
18093         (publisher_policy_start): New static function used to parse publisher 
18094         policy config files.
18095         (publisher_policy_parser): New static MonoParseHandler containing 
18096         the functions used when parsing config files.
18097         (mono_config_parse_publisher_policy): New function for parsing
18098         publisher policy files.
18099         
18100 2005-08-20  Zoltan Varga  <vargaz@freemail.hu>
18101
18102         * object.c (mono_delegate_ctor): Add support for IA64 function descriptors.
18103
18104         * marshal.c (mono_delegate_free_ftnptr): Ditto.
18105
18106         * object.c (mono_get_addr_from_ftnptr): New helper function.
18107
18108         * object.h (mono_array_addr): Fix unaligned access warnings on IA64.
18109
18110         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
18111
18112 2005-08-19  Dick Porter  <dick@ximian.com>
18113
18114         * threads.c, threads.h, appdomain.c, appdomain.h,
18115         profiler-private.h, monitor.c, object.c, object-internals.h,
18116         profiler.c, mono-debug-debugger.h, profiler.h: Use a gsize to
18117         store the thread ID, so it can hold a 64 bit value if needed.
18118
18119 2005-08-19  Zoltan Varga  <vargaz@freemail.hu>
18120
18121         * reflection.c (mono_reflection_create_dynamic_method): Store the
18122         handle class into the method references as well so ldtoken works in
18123         dynamic methods.
18124
18125         * icall.c (ves_icall_MonoField_GetValueInternal): Add support for generic
18126         types.
18127
18128 2005-08-19  Ankit Jain <jankit@novell.com>
18129
18130         Fix #75847.
18131         * marshal.c (mono_marshal_get_ptr_to_struct): Build method signature 
18132           here rather than using the method signature of a arbitrary function
18133           named 'System.Runtime.InteropServices.Marshal::PtrToStructure' with 
18134           two arguments.
18135           Hack done with Harinath.
18136
18137 2005-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18138
18139         * threadpool.c: disable printing stack traces when we get a exception
18140         in a threadpool thread. I need to do more testing to figure out which
18141         cases actually print this. Fixes bug #75828.
18142
18143 2005-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18144
18145         * icall.c: there might be ignored whitespace after the last '='. This
18146         fixes length computation and bug #75840.
18147
18148 2005-08-18  Zoltan Varga  <vargaz@freemail.hu>
18149
18150         * assembly.c (mono_assembly_load_full): Consider .exe extension as
18151         well. Fixes #75809.
18152
18153         * reflection.c (create_custom_attr): Fix unmanaged memory leak. Fixes
18154         #75784.
18155         
18156         * reflection.c (create_custom_attr_data): Ditto.
18157
18158 2005-08-17  Atsushi Enomoto  <atsushi@ximian.com>
18159
18160         * locales.c, culture-info.h : removed RegionLCIDMap.
18161         * culture-info-tables.h : regenerated.
18162
18163 2005-08-16  Martin Baulig  <martin@ximian.com>
18164
18165         * class.c (mono_type_get_name_recurse): Small fix.
18166
18167 2005-08-16  Atsushi Enomoto  <atsushi@ximian.com>
18168
18169         * locales.c : indentation fixie.
18170
18171 2005-08-15  Atsushi Enomoto  <atsushi@ximian.com>
18172
18173         * object-internals.h,
18174           locales.h,
18175           locales.c,
18176           culture-info.h,
18177           icall.c : added RegionInfo table support.
18178         * culture-info-table.h : regenerated for region support.
18179
18180 2005-08-14  Kamil Skalski  <nazgul@nemerle.org>
18181
18182         * reflection.c (resolve_object): handle all kinds of MonoMethod
18183         including generic ones
18184
18185 2005-08-12  Ankit Jain <jankit@novell.com>
18186
18187         * get.c (dis_stringify_variant_type): New. Stringify MonoMarshalVariant.
18188           (dis_stringify_marshal_spec): Add new case for MONO_NATIVE_SAFEARRAY. 
18189
18190 2005-09-12  Lluis Sanchez  <lluis@ximian.com>
18191
18192         * process.c: Don't close a thread handle when it's NULL. This is a
18193         workaround for bug #75733.
18194
18195 2005-08-11  Zoltan Varga  <vargaz@freemail.hu>
18196
18197         * marshal.c (mono_marshal_get_string_encoding): Fix handling of CharSet.Auto. Fixes #75769.
18198
18199 2005-08-10  Zoltan Varga  <vargaz@freemail.hu>
18200
18201         * icall.c (ves_icall_Type_get_IsGenericType): New icall.
18202
18203 2005-08-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18204
18205         * threadpool.c: if a work item in the thread pool has a callback that
18206         catches a exception, don't propagate it after invoking the callback.
18207         Fixes bug #75336.
18208
18209 2005-08-08  Zoltan Varga  <vargaz@freemail.hu>
18210
18211         * class.c (class_compute_field_layout): Rename this to mono_class_setup_fields.
18212
18213         * class-internals.h (MonoCachedClassInfo): Add some new fields.
18214
18215         * class.c (mono_class_init): Load field info lazily in the AOT case.    
18216
18217         * reflection.c (mono_image_load_module): Fix error checking. Fixes #75660.
18218
18219 2005-08-03  Ankit Jain  <jankit@novell.com>
18220
18221         Fix #75683.
18222         * loader.c (mono_method_signature_full): Use MONO_CALL_DEFAULT if
18223           PInvoke calling convention is 0.
18224
18225 2005-08-02  Zoltan Varga  <vargaz@freemail.hu>
18226
18227         * socket-io.c (convert_sockopt_level_and_name): Applied patch from 
18228         Julien Puydt (julien.puydt@laposte.net). Add check for IPV6_PKTINFO.
18229
18230 Mon Aug 1 16:52:12 CEST 2005 Paolo Molaro <lupus@ximian.com>
18231
18232         * gc-internal.h, threads.c, null-gc.c, boehm-gc.c: added interface
18233         to handle threads not started by the GC (patch by Michael Meeks
18234         <michael.meeks@novell.com>).
18235
18236 2005-07-31  Kamil Skalski  <nazgul@omega.pl>
18237
18238         * reflection.c: Make buffer used in emitting types larger for some
18239         big generic types (patch by Michal Moskal).
18240
18241 2005-07-30  Zoltan Varga  <vargaz@freemail.hu>
18242
18243         * mono-debug.c: Fix some (not all) alignment problems.
18244
18245 2005-07-29  Carlos Alberto Cortez <calberto.cortez@gmail.com>
18246
18247         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw):
18248         Invoke mono_image_load_from_data_full passing the refonly
18249         parameter.
18250
18251         * assembly.c
18252         (mono_assembly_open_from_bundle): Add the refonly argument, 
18253         in order to pass it to other methods it calls to.
18254         (do_mono_assembly_open): Add the refonly argument, in order 
18255         to pass it to other methods it calls to.
18256         (mono_assembly_open_full): Invoke do_mono_assembly_open passing
18257         the refonly parameter to it.
18258
18259         * image.c: Add loaded_images_refonly_hash and
18260         loaded_images_refonly_guid_hash to cache the reflection
18261         only loaded images.
18262         (mono_images_init): Initialize the hash tables used for
18263         caching the reflection only images.
18264         (load_modules): Invoke mono_image_open_full passing the refonly
18265         parameter to load the modules the correct way.
18266         (build_guid_table): Add the refonly argument, to re-build the 
18267         correct hash table.
18268         (do_mono_image_open): Added the refonly argument, in order to
18269         define it for the loaded image.
18270         (mono_image_loaded_full): New function, which receives an
18271         additional parameter to look for the image in the refonly or
18272         non-refonly section.
18273         (mono_image_loaded): Updated, using mono_image_loaded_full.
18274         (mono_image_loaded_by_guid_full): The same case that happens
18275         with mono_image_loaded_full.
18276         (mono_image_loaded_by_guid): Likewise.
18277         (register_image): Use the ref_only variable inside MonoImage
18278         to decide in which hash table store the current image.
18279         (mono_image_open_from_data_full): Rename
18280         mono_image_open_from_data to mono_image_open_from_data_full,
18281         adding the refonly argument, to define the ref_only variable 
18282         inside MonoImage.
18283         (mono_image_open_from_data): Return 
18284         mono_image_open_from_data_full.
18285         (mono_image_open_full): Rename mono_image_open to
18286         mono_image_open_full, receiving the new refonly argument,
18287         to pass it to inner methods.
18288         (mono_pe_file_open): Update this function, to open
18289         a MonoImage as a non-refonly image.
18290         (mono_image_close): Use the refonly variable inside
18291         MonoImage to remove the image from the correct caches.
18292
18293         * image.h: Add the signatures of mono_image_open_full,
18294         mono_image_open_from_data_full, mono_image_loaded_full,
18295         mono_image_loaded_by_guid_full.
18296
18297         * metadata-internals.h: Add the ref_only field to 
18298         MonoImage.
18299         
18300 2005-07-29  Carlos Alberto Cortez <calberto.cortez@gmail.com>
18301
18302         * icall.c (ves_icall_System_Reflection_GetReferencedAssemblies):
18303         Fix the last behavior, which used to load the assemblies and
18304         extract MonoReflectionAssemblyName information, instead of
18305         extract it from the metadata tables. Needed for Reflection
18306         Only assemblies.
18307         
18308 2005-07-29  Martin Baulig  <martin@ximian.com>
18309
18310         * mono-debug-debugger.c
18311         (mono_debugger_lock, mono_debugger_unlock): g_assert() if we're
18312         not initialized.
18313
18314         * mono-debug.c
18315         (mono_debug_address_from_il_offset): Check whether we have
18316         debugging support before attempting to take the lock.
18317         (mono_debug_source_location_from_address): Likewise.
18318         (mono_debug_source_location_from_il_offset): Likewise.
18319         (mono_debug_il_offset_from_address): Likewise.
18320         (mono_debug_address_from_il_offset): Likewise.
18321
18322 2005-07-29  Zoltan Varga  <vargaz@freemail.hu>
18323
18324         * class.c (mono_class_from_name_case): Add support for dynamic images.
18325         Fixes #75650.
18326
18327         * object.c (mono_class_compute_gc_descriptor): Add a workaround
18328         for #75479.
18329
18330 2005-07-28  Zoltan Varga  <vargaz@freemail.hu>
18331         
18332         * reflection.c (mono_method_get_object): Fix warning.
18333
18334 2005-07-28  Martin Baulig  <martin@ximian.com>
18335
18336         * mono-debug.c
18337         (mono_debug_add_wrapper): Also write the wrapper type.
18338
18339 2005-07-28  Zoltan Varga  <vargaz@freemail.hu>
18340
18341         * class-internals.h (MonoCachedClassInfo): Add has_nested_classes field.
18342         
18343         * class.c (mono_class_init): Avoid reading nested classes if the AOT
18344         data indicates the class has none.
18345
18346 2005-07-26  Ben Maurer  <bmaurer@ximian.com>
18347
18348         * mono-debug.c, debug-mono-symfile.c: Replace the use of the
18349         loader lock with the debugger lock. Prevents deadlocks for beagle.
18350
18351         Beagle can now run on an smp box for a weekend without any
18352         issues. Woohoo!
18353
18354 2005-07-26  Zoltan Varga  <vargaz@freemail.hu>
18355
18356         * class.c (mono_bounded_array_class_get): Avoid crash if eclass is
18357         in a module. Fixes #75629.
18358
18359 2005-07-26  Martin Baulig  <martin@ximian.com>
18360
18361         * mono-debug.c (mono_debug_add_wrapper): New static method.
18362         (mono_debug_add_method): Call mono_debug_add_wrapper() if we're an
18363         interncall or a wrapper.
18364
18365         * mono-debug.h (MonoDebugWrapperData): New public typedef.
18366         (MonoDebugDataItemType): Added `MONO_DEBUG_DATA_ITEM_WRAPPER'.
18367         (MONO_DEBUGGER_VERSION): Bump to 51.
18368
18369         * mono-debug-debugger.c
18370         (mono_debugger_add_type): Removed this empty function.
18371         (mono_debugger_add_method): Likewise.
18372
18373 2005-07-22  Zoltan Varga  <vargaz@freemail.hu>
18374
18375         * icall.c (ves_icall_Type_GetMethodsByName): Call setup_vtable () 
18376         before accessing method->slot.
18377
18378 2005-07-21  Jb Evain  <jbevain@gmail.com>
18379
18380         * reflection.c (method_encode_clauses/class): Handle filters clauses.
18381         Fixes #75010.
18382
18383 2005-07-21  Zoltan Varga  <vargaz@freemail.hu>
18384
18385         * marshal.c (emit_marshal_custom): Implement byref marshalling. Fixes
18386         #75587.
18387
18388 2005-07-20  Zoltan Varga  <vargaz@freemail.hu>
18389
18390         * image.h image.c: Add mono_image_get_guid () API function.
18391
18392 2005-07-19  Ben Maurer  <bmaurer@ximian.com>
18393
18394         There were issues when multiple threads tried to load
18395         assemblies. A deadlock was created between assemblies_mutex and
18396         mono_domain_assemblies_lock. This fixes the issue by making the
18397         assembly ref counting be lock free. See bug 75586.
18398         
18399         * image.c (mono_image_close): The add ref function here was using
18400         Interlocked operations while the unref was using a mutex and a
18401         --. I don't think this was ever a bug that would be exposed in a
18402         non-pendantic way (ie, by an embedder doing a ref on one thread
18403         and an unref on another), but for the sake of correctness, this is
18404         now Interlocked.
18405
18406         * assembly.c (mono_assembly_addref): Use InterlockedIncrement
18407         (mono_assembly_load_reference): Call mono_assembly_addref rather
18408         than touching the refcount ourselves.
18409         (mono_assembly_close): Use InterlockedDecrement to unref the
18410         assembly. Don't acquire the lock unless it is actually needed.
18411
18412 2005-07-12  Zoltan Varga  <vargaz@freemail.hu>
18413
18414         * class.c (mono_class_layout_fields): Fix calculation of has_references
18415         for generic types.
18416
18417 2005-07-12  Martin Baulig  <martin@ximian.com>
18418
18419         Applying a patch from Michal Moskal <malekith@nemerle.org>.
18420
18421         * metadata.c
18422         (mono_type_hash): Provide better hashing for generic instances.
18423         (mono_generic_inst_hash): Improve hashing.
18424         (mono_generic_class_hash): Likewise.
18425
18426         * reflection.c (mymono_metadata_type_hash): Improve hashing for
18427         generic instances.
18428
18429 2005-07-12  Martin Baulig  <martin@ximian.com>
18430
18431         * reflection.c (mono_reflection_create_runtime_class): Remove the
18432         hack for generic type definitions and non-`Run' assemblies.
18433         (mono_reflection_bind_generic_parameters): Also use
18434         `klass->wastypebuilder' to check for TypeBuilders.
18435
18436 2005-07-12  Zoltan Varga  <vargaz@freemail.hu>
18437
18438         * class.c (mono_class_layout_fields): Fix calculation of has_references
18439         for generic types.
18440
18441         * class.c (inflate_generic_class): Fix a leak.
18442         (mono_class_init): Fix calculation of gchimpl and has_finalize fields
18443         for generic types.
18444
18445 2005-07-11  Martin Baulig  <martin@ximian.com>
18446
18447         * icall.c (ves_icall_Type_BindGenericParameters): Don't crash here
18448         on error.
18449
18450 2005-07-11  Martin Baulig  <martin@ximian.com>
18451
18452         * loader.c (find_method): Also lookup in
18453         `mono_defaults.object_class' if we're an interfaces; fixes #75460.
18454
18455 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
18456
18457         * appdomain.c (mono_domain_unload): Don't free the error message
18458         before passing it to mono_get_exception_...
18459
18460         * reflection.c (CACHE_OBJECT): Fix the race introduced by the previous patch.
18461         
18462 Thu Jul 7 19:59:31 CEST 2005 Paolo Molaro <lupus@ximian.com>
18463
18464         * threads.c: try to better guess an available RT signal (bug #75387).
18465
18466 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
18467
18468         * reflection.c (CACHE_OBJECT): Don't hold the domain lock between CHECK_OBJECT
18469         and CACHE_OBJECT.
18470
18471 2005-07-07  Martin Baulig  <martin@ximian.com>
18472
18473         * class.c (mono_type_get_name_full): Return NULL for
18474         MONO_TYPE_NAME_FORMAT_FULL_NAME if we have any generic parameters;
18475         fixes #75408.
18476
18477 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
18478
18479         * threads.c (mono_threads_abort_appdomain_threads): Wait for threads to
18480         exit the appdomain as well being aborted.
18481
18482         * threadpool.c: Create all threadpool threads inside the root appdomain, and
18483         change back to the root domain after calling managed code. This enables
18484         appdomains using threadpools to be unloaded.
18485
18486 2005-07-07  Martin Baulig  <martin@ximian.com>
18487
18488         * class-internals.h
18489         (MonoInflatedGenericClass): Moved the `MonoType *parent' field
18490         into `MonoDynamicGenericClass' since we only need it for dynamic
18491         types.
18492
18493         * reflection.c (mono_class_bind_generic_parameters): We don't need
18494         to compute the `parent' here.
18495
18496 2005-07-07  Atsushi Enomoto  <atsushi@ximian.com>
18497
18498         * culture-info-table.h : regenerated.
18499
18500 2005-07-06  Martin Baulig  <martin@ximian.com>
18501
18502         * icall.c
18503         (ves_icall_FieldInfo_SetValueInternal): Add MONO_TYPE_GENERICINST.
18504
18505         * object.c (set_value): Add MONO_TYPE_GENERICINST; fixes #75299.
18506
18507 2005-07-06  Martin Baulig  <martin@ximian.com>
18508
18509         * metadata.c (mono_metadata_class_equal): Add MONO_TYPE_SZARRAY if
18510         we're doing a signature-only comparision; fixes #74945.
18511
18512 2005-07-06  Martin Baulig  <martin@ximian.com>
18513
18514         * class-internals.h (MonoGenericClass): Moved some things out into
18515         a new `MonoInflatedGenericClass' type.  
18516         (MonoInflatedGenericClass): New type; the `klass' of a
18517         `MonoGenericClass' is now computed lazyly in
18518         mono_get_inflated_generic_class().      
18519
18520         * class.c (mono_get_inflated_generic_class): New public function.
18521         (mono_class_inflate_generic_method): Removed the unused
18522         `MonoClass *' argument.
18523         (setup_generic_vtable): Don't call mono_get_inflated_method() on
18524         all the methods.
18525         (mono_class_create_generic): Make this static and merge it with
18526         mono_class_create_generic_2(); we're now called automatically from
18527         mono_get_inflated_generic_class().
18528
18529         * loader.c (mono_method_signature): Call
18530         mono_get_inflated_method() here.
18531
18532 2005-07-06  Zoltan Varga  <vargaz@freemail.hu>
18533
18534         * object.c (mono_class_create_runtime_vtable): Allow MONO_TYPE_FNPTR as
18535         type of fields with RVA.
18536
18537         * class.c (mono_class_from_generic_parameter): Avoid calling mono_class_init ()
18538         for this pseudo class.
18539         (my_mono_class_from_generic_parameter): Likewise.
18540         (mono_class_init): Allow interfaces to have cctors.
18541
18542 2005-07-05  Zoltan Varga  <vargaz@freemail.hu>
18543
18544         * domain-internals.h domain.c: Add functionality to create MonoJitInfo structures
18545         lazily for AOT methods.
18546
18547 2005-07-05  Martin Baulig  <martin@ximian.com>
18548
18549         * loader.c (mono_lookup_pinvoke_call): g_ascii_strcasecmp()
18550         returns FALSE for a successful match, not TRUE.
18551
18552 2005-07-05  Zoltan Varga  <vargaz@freemail.hu>
18553
18554         * loader.c (mono_method_get_index): Optimize this a bit.
18555
18556 2005-07-04  Martin Baulig  <martin@ximian.com>
18557
18558         * class.c
18559         (class_compute_field_layout): Move the check for generic type
18560         definitions into mono_class_layout_fields().  Fixes #74684.
18561         (mono_class_from_generic_parameter): Correctly compute
18562         `klass->parent'; fixes #75457.
18563
18564         * reflection.c (register_assembly, register_module): Make sure
18565         `domain->rejobject_hash' is already created.
18566
18567 2005-07-02  Martin Baulig  <martin@ximian.com>
18568
18569         * class-internals.h
18570         (MonoGenericClass): Move `count_ifaces' and `ifaces' into
18571         `MonoDynamicGenericClass'.      
18572
18573 2005-07-01  Lluis Sanchez  <lluis@ximian.com>
18574
18575         * icall.c: In ves_icall_InternalExecute() dont't assert if the value
18576         returned by a field getter is null, since null is a valid value.
18577
18578 2005-07-01  Martin Baulig  <martin@ximian.com>
18579
18580         * reflection.c (mono_reflection_generic_class_initialize): Update
18581         the `dgclass->fields [i].parent' to the correct class.
18582         (mono_image_get_fieldref_token): Use the declaring type, not the
18583         reflected type.
18584
18585 2005-07-01  Martin Baulig  <martin@ximian.com>
18586
18587         * loader.c (find_method): Also look in the interfaces; fixes #75429.
18588
18589 2005-06-30  Ben Maurer  <bmaurer@ximian.com>
18590
18591         * threads.c (thread_cleanup): assert that thread != NULL
18592         (wait_for_tids_or_state_change): We were using the wrong variable
18593         when accessing wait->threads. `i' was always out of the bounds of
18594         the array.
18595
18596 2005-06-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18597
18598         * loader.c: map user32 and kernel32 to libMonoSupportW
18599
18600 2005-06-28  Zoltan Varga  <vargaz@freemail.hu>
18601
18602         * appdomain.c (unload_thread_main): Mark this as WINAPI.
18603
18604 2005-06-28  Martin Baulig  <martin@ximian.com>
18605
18606         * loader.c (method_from_methodspec): Fix #75334.
18607
18608 2005-06-28  Martin Baulig  <martin@ximian.com>
18609
18610         Fix #74953 - Arrays now implement the generic IList<T> interface
18611         on the 2.0 platform.
18612
18613         * class-internals.h (MonoDefaults): Added `generic_array_class'.
18614
18615         * reflection.c (mono_class_bind_generic_parameters): New public
18616         function; similar to mono_reflection_bind_generic_parameters(),
18617         but operates on a `MonoType *' and not on a `MonoReflectionType *'.
18618
18619         * domain.c (mono_init_internal): Try to initialize.
18620         `mono_defaults.generic_array_class' here; this'll only succeed if
18621         we're using the 2.0 corlib.
18622
18623         * icall.c
18624         (ves_icall_System_Array_InternalArray_GetGenericValueImpl): Added
18625         interncall for "System.Array/InternalArray`1:GetGenericValueImpl".
18626         (mono_lookup_internal_call): Added support for nested classes.
18627
18628         * loader.c
18629         (mono_get_method_from_token): Set `result->signature->pinvoke' if
18630         we're an interncall and have generic arguments.
18631
18632         * class.c
18633         (mono_class_inflate_generic_methods): Allow interncalls and PInvoke.
18634         (mono_bounded_array_class_get): If we're on the 2.0 corlib, use an
18635         instance of System.Array.InternalArray<T> for arrays, so they
18636         implement the generic IList<T> interface.
18637
18638 2005-06-27  Zoltan Varga  <vargaz@freemail.hu>
18639
18640         * marshal.c (emit_marshal_string): Applied patch from Itamar Rogel
18641         (chastamar@yahoo.com). Fixes #75374.    
18642
18643 2005-06-27  Atsushi Enomoto <atsushi@ximian.com>
18644
18645         * culture-info-table.h: regenerated.
18646
18647 2005-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18648
18649         * icall.c: handle spaces correctly for base64 strings.
18650
18651 2005-06-26  Ben Maurer  <bmaurer@ximian.com>
18652
18653         * *.c: Kill some warnings.
18654
18655 2005-06-23  Duncan Mak  <duncan@novell.com>
18656
18657         * socket-io.c (is_loopback): Cast 'ptr' to 'struct in6_addr *' so
18658         that this builds on Solaris 10 (x86).
18659
18660 2005-06-23  Martin Baulig  <martin@ximian.com>
18661
18662         * class.c
18663         (mono_type_get_name_recurse): Don't use a duplicate '[', ']' for
18664         generic type definitions.
18665
18666 2005-06-23  Martin Baulig  <martin@ximian.com>
18667
18668         Fix #75331.
18669
18670         * metadata.c (mono_class_get_overrides): Renamed to
18671         mono_class_get_overrides_full() and added a `MonoGenericContext *'.
18672         (method_from_method_def_or_ref): Added `MonoGenericContext *' and
18673         pass it to mono_get_method_full().
18674
18675 2005-06-22  Ben Maurer  <bmaurer@ximian.com>
18676
18677         * reflection.c (mono_reflection_create_runtime_class): take the
18678         mono_domain_lock in this method. Prevents deadlocks
18679
18680 2005-06-22  Martin Baulig  <martin@ximian.com>
18681
18682         * loader.c (method_from_methodspec): Fix #75330.
18683
18684 2005-06-22  Martin Baulig  <martin@ximian.com>
18685
18686         * reflection.c (type_get_qualified_name): Use
18687         mono_type_get_name_full() with MONO_TYPE_NAME_FORMAT_REFLECTION.
18688         (_mono_reflection_get_type_from_info): Added `MonoImage *image'
18689         argument; use it if we don't have an assembly name.
18690
18691 2005-06-22  Lluis Sanchez Gual  <lluis@novell.com>
18692
18693         * object.c: In mono_message_init, set "copy out" flag for in
18694         parameters with the [Out] flag.
18695
18696 2005-06-21  Martin Baulig  <martin@ximian.com>
18697
18698         * class.c
18699         (mono_type_get_name_recurse): Correctly handle MONO_TYPE_SZARRAY
18700         and MONO_TYPE_PTR.
18701
18702 2005-06-21  Martin Baulig  <martin@ximian.com>
18703
18704         * class.c (mono_class_init): Don't initialize `class->fields' for
18705         generic instances since they're initialized again in
18706         compute_field_layout(). 
18707         (compute_field_layout): Set the field's `generic_info' here; fix
18708         #75320. 
18709
18710 2005-06-21  Martin Baulig  <martin@ximian.com>
18711
18712         * class-internals.h
18713         (MonoGenericMethod): Added `MonoGenericClass *generic_class'.
18714
18715         * metadata.c (mono_metadata_generic_method_equal): Also
18716         distinguish the `generic_class'; fixes #75334.
18717
18718 2005-06-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18719
18720         * domain.c:
18721         * appdomain.c:
18722         * domain-internals.h:
18723         * reflection.c: 'domain_assemblies' field is now protected by its own
18724         lock. Don't call into managed code to run the AssemblyLoad event if we
18725         now there are no registered delegates for it.
18726
18727 2005-06-20  Martin Baulig  <martin@ximian.com>
18728
18729         * class.c (mono_class_is_assignable_from): Use a custom version of
18730         mono_class_has_parent() to make things work for generic instances;
18731         fix #75300.
18732
18733 2005-06-20  Martin Baulig  <martin@ximian.com>
18734
18735         * loader.c (method_from_methodspec): Apply a patch from
18736         Kamil Skalski <nazgul@nemerle.org> to fix #75296.
18737
18738 2005-06-20  Martin Baulig  <martin@ximian.com>
18739
18740         * class.c (mono_class_init): Reverted Zoltan's last change; it
18741         breaks generics.
18742
18743 2005-06-19  Zoltan Varga  <vargaz@freemail.hu>
18744
18745         * threads.c (wait_for_tids_or_state_change): Add missing locking.
18746
18747 2005-06-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18748
18749         * socket-io.c: fix the index in the socket array for writable/error
18750         sockets. Fixes bug #75306.
18751
18752 2005-06-17  Zoltan Varga  <vargaz@freemail.hu>
18753
18754         * class.c (mono_class_init): Allow interfaces to have static ctors.
18755
18756 2005-06-17  Martin Baulig  <martin@ximian.com>
18757
18758         * loader.c (method_from_methodspec): Use `context->container' when
18759         parsing the `gmethod->inst'.
18760
18761 2005-06-17  Martin Baulig  <martin@ximian.com>
18762
18763         * class.c (mono_type_get_name_recurse): Don't add the assembly
18764         name for type arguments.
18765
18766 2005-06-15  Martin Baulig  <martin@ximian.com>
18767
18768         * reflection.c (mono_image_get_inflated_method_token): Encode
18769         correct klass; fixes #75260.
18770
18771 2005-06-13 Michal Moskal <malekith@nemerle.org>
18772
18773         * icall.c: Make GetCorrespondingMethod/Constructor take
18774         MonoReflectionMethod method not MonoMethod. Removed
18775         MonoType.GetCorrespondingField, and make
18776         MonoGenericType.GetCorrespondingField take name not
18777         MonoClassField.
18778
18779 2005-06-13  Michal Moskal <malekith@nemerle.org>
18780
18781         * reflection.c (field_encode_signature, encode_locals):
18782          Make sizes of buffers for types larger (for big generic types).
18783          (create_generic_typespec,
18784          mono_reflection_sighelper_get_signature_local,
18785          mono_reflection_sighelper_get_signature_field):
18786          Add asserts for too small buffers.
18787
18788 2005-06-15  Martin Baulig  <martin@ximian.com>
18789
18790         * icall.c (ves_icall_MonoGenericClass_GetParentType): Return NULL
18791         if our parent is not a dynamic type.
18792
18793 2005-06-15  Martin Baulig  <martin@ximian.com>
18794
18795         * class-internals.h (MonoTypeNameFormat): New enum.
18796
18797         * class.c
18798         (mono_class_get_name_full): Renamed to mono_type_get_name_full().
18799         (mono_type_get_full_name): Removed.
18800         (mono_type_get_name_full): Take a `MonoTypeNameFormat format'
18801         argument instead of the boolean's.
18802
18803         * icall.c (ves_icall_System_MonoType_getFullName):
18804         Added `gboolean assembly_qualified'.    
18805
18806         * reflection.h
18807         (MonoTypeNameParse): Added `GPtrArray *type_arguments'.
18808
18809         * reflection.c (mono_reflection_parse_type): Parse the new type
18810         name format.
18811
18812 2005-06-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18813
18814         * icall.c: no need to convert from utf16 to utf8 and then back again
18815         after the call to GetLogicalDrives.
18816
18817 2005-06-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18818
18819         * icall.c: frombase64. Fix problems exposed by new tests.
18820
18821 2005-06-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18822
18823         * icall.c: added internal calls for converting char [] and strings in
18824         base64 into byte [].
18825
18826 2005-06-10  Martin Baulig  <martin@ximian.com>
18827
18828         * class.c (mono_class_create_generic_2): Read the nested classes
18829         from the metadata rather than from `gklass->nested_classes' since
18830         `gklass' might not be initialized yet.
18831
18832 2005-06-09  Duncan Mak  <duncan@novell.com>
18833
18834         * *.h: Added G_BEGIN_DECLS and G_END_DECLS where appropriate to
18835         all public headers. Fixes #74919.
18836
18837 2005-06-09  Lluis Sanchez Gual  <lluis@novell.com>
18838
18839         * domain.c: The key for proxy_vtable_hash is now a pointer
18840         array. Added new GHashFunc and GCompareFunc functions for this.
18841
18842         * class.h: The list of interfaces in MonoRemoteClass is known in
18843         advance and can't grow (we create a new MonoRemoteClass if needed),
18844         so now the interface array can be allocated together with
18845         MonoRemoteClass.
18846         
18847         * object.c: Added a new method create_remote_class_key.
18848         Fixed mono_remote_class so it does not depend on
18849         mono_upgrade_remote_class.
18850         Removed extend_interface_array.
18851         Added new method clone_remote_class(), which makes a copy of a remote
18852         class and adds a new interface or class to it.
18853         mono_upgrade_remote_class() now creates a new remote class (or gets
18854         it from the cache) if an vtable upgrade is needed. In this way
18855         we make sure that other objects sharing the same remote class
18856         don't get the new vtable with unwanted interfaces.
18857         
18858         * object-internals.h:
18859         * object.h: Moved mono_upgrade_remote_class to object-internals.h.
18860         
18861         * marshal.c: Track changes in mono_upgrade_remote_class().
18862
18863 2005-06-08  Kamil Skalski <nazgul@nemerle.org>
18864         * icall.c: Add runtime methods for obtaining members of inflated
18865         class, which were created from supplied non-inflated members. It
18866         is used in internal Get{Method,Constructor,Field} methods in
18867         System.Type
18868
18869 2005-06-09  Martin Baulig  <martin@ximian.com>
18870
18871         * reflection.c
18872         (mono_reflection_bind_generic_method_parameters): Fix #75169.
18873
18874 2005-06-08  Carlos Alberto Cortez <calberto.cortez@gmail.com>
18875         * reflection.c (mono_image_basic_init): Define
18876         Version in MonoDynamicAssembly. 
18877         
18878 2005-06-08  Martin Baulig  <martin@ximian.com>
18879
18880         Fix #75136.
18881
18882         * loader.c
18883         (mono_method_signature_full): New public method; takes a
18884         `MonoGenericContext *'.
18885         (find_method): Use mono_method_signature_full() and pass the
18886         klass'es context to it.
18887
18888         * class.c (mono_class_is_inflated_method): Use
18889         mono_method_signature_full() and pass the context to it.
18890
18891 Wed Jun 8 19:26:38 CEST 2005 Paolo Molaro <lupus@ximian.com>
18892
18893         * object.c: add proper locking in mono_remote_class_vtable(),
18894         fixes possible memory corruption.
18895
18896 2005-06-08  Michael Meeks  <michael.meeks@novell.com>
18897
18898         * marshal.c (mono_remoting_marshal_init): set
18899         initialized after initialization.
18900
18901 2005-06-08  Atsushi Enomoto  <atsushi@ximian.com>
18902
18903         * locales.c : hush.
18904
18905 2005-06-06  Michael Meeks  <michael.meeks@novell.com>
18906
18907         * object.c (extend_interface_array): fix really silly
18908         memory corrupting / comparison bug.
18909
18910 2005-06-07  Carlos Alberto Cortez <calberto.cortez@gmail.com>
18911
18912         * reflection.c: Functions added to support the creation
18913         of CustomAttributeData, which includes Attribute data
18914         used by ReflectionOnly methods.
18915
18916         * reflection.h:  mono_reflection_get_custom_attrs_data and
18917          mono_custom_attrs_data_construct added (functions exposed).
18918
18919          * icall.c: Added mono_reflection_get_custom_attrs_data
18920          as icall.
18921         
18922 2005-06-07  Zoltan Varga  <vargaz@freemail.hu>
18923
18924         * Makefile.am (libmonoruntime_la_SOURCES): Revert last change at
18925         lupus's request.
18926
18927 2005-06-06  Zoltan Varga  <vargaz@freemail.hu>
18928
18929         * icall.c (ves_icall_Mono_Runtime_GetDisplayName): Fix warning.
18930
18931         * reflection.c (reflection_methodbuilder_to_mono_method): Fix encoding of
18932         dynamic DllImportAttribute.
18933
18934         * icall.c (ves_icall_MonoMethod_GetDllImportAttribute): Fix decoding of 
18935         dynamic DllImportAttribute.
18936
18937         * Makefile.am (libmonoruntimeinclude_HEADERS): Export tabledefs.h too.
18938         Fixes #75162.
18939
18940 2005-06-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18941
18942         * threads.c: avoid segfault when an unstarted thread is aborted.
18943
18944 2005-06-05  Kornél Pál <kornelpal@hotmail.com>
18945
18946         * icall.c: Added ves_icall_Mono_Runtime_GetDisplayName:
18947         Returns the name and version of the runtime for reporting.
18948
18949 2005-06-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18950
18951         * appdomain.c: bump corlib version.
18952         * object-internals.h: new field in MonoReflectionAssembly.
18953
18954 2005-06-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18955
18956         * object-internals.h: Carlos forgot to add this field.
18957
18958 2005-06-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
18959
18960         * icall.c: Added create_version to create instances
18961         of Version of MonoReflectionAssemblyName. This change helps
18962         the AssemblyName tests to keep running fine.
18963         
18964 2005-06-03  Lluis Sanchez Gual  <lluis@novell.com>
18965   
18966         * object.c (mono_method_return_message_restore): A somehow less
18967         intrusive fix for #75138.
18968
18969 2005-06-03  Raja R Harinath  <rharinath@novell.com>
18970
18971         * object.c (mono_method_return_message_restore): Fix computation
18972         of expected number of out args.
18973
18974 2005-06-02  Zoltan Varga  <vargaz@freemail.hu>
18975
18976         * reflection.c (mono_image_get_method_info): Fix the case when the
18977         charset is empty.
18978
18979 2005-06-02  Lluis Sanchez Gual  <lluis@novell.com> 
18980
18981         * object.c: Added missing null check in
18982           mono_method_return_message_restore.
18983
18984 2005-06-02  Zoltan Varga  <vargaz@freemail.hu>
18985
18986         * reflection.c (mono_image_get_method_info): Handle the case when
18987         dllentry is empty.
18988
18989 2005-06-02  Lluis Sanchez Gual  <lluis@novell.com>
18990
18991         * object.c: When creating the vtable for a proxy, take into account
18992         all inherited interfaces, not only the ones registered in
18993         iclass->interfaces. This fixs bug #74996.
18994         Also, in mono_method_return_message_restore, verify that the array
18995         of out args has the expected lengh.
18996
18997 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18998
18999         * socket-io.c: update the timeout in Poll when the call is interrupte.
19000
19001 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19002
19003         * socket-io.c: support abort/suspend in Select_internal after last
19004         change.
19005
19006 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19007
19008         * threadpool.c: remove warning.
19009
19010 2005-06-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19011
19012         * icall.c:
19013         * socket-io.[ch]: Select_internal uses poll() now when available, thus
19014         removing the 1024 limit from select(). Runtime part of the fix for
19015         bug #71203.
19016
19017 2005-05-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19018
19019         * socket-io.c: when resolving the addresses for the same
19020         host returned by gethostname(), get the local IPs from the interface
19021         list. Loopback addresses are discarded if the are interfaces up with
19022         non-loopback ones. Fixes bug #63265.
19023
19024 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
19025
19026         * appdomain.c, verify.c, object-internals.h, reflection.c:
19027         bumped corlib number to 36, and added new extra_flags field
19028         to ReflectionMethodBuilder and friends.  Fixes #75060.
19029
19030 Fri May 27 14:45:56 CEST 2005 Paolo Molaro <lupus@ximian.com>
19031
19032         * gc.c: register a new weak link only if the object is non-null
19033         (fixes bug#75047).
19034
19035 2005-05-26  Atsushi Enomoto  <atsushi@ximian.com>
19036
19037         * culture-info.h : short time pattern too.
19038
19039 2005-05-26  Atsushi Enomoto  <atsushi@ximian.com>
19040
19041         * culture-info.h : expand long time pattern string length.
19042
19043 2005-05-25  Atsushi Enomoto  <atsushi@ximian.com>
19044
19045         * culture-info-table.h : update (more French date format; #72788).
19046
19047 2005-05-25  Zoltan Varga  <vargaz@freemail.hu>
19048
19049         * icall.c (ves_icall_InternalInvoke): Avoid type checks on this if
19050         the method is static. Fixes #75029.
19051
19052 2005-05-25  Lluis Sanchez Gual  <lluis@novell.com>
19053
19054         * reflection.c: Update the table_idx field of method builders after
19055         saving the module, since it can change. This is a workaround for
19056         bug #74914. 
19057
19058 2005-05-25  Atsushi Enomoto  <atsushi@ximian.com>
19059
19060         * culture-info-table.h : update (additional French date format).
19061
19062 2005-05-20  Zoltan Varga  <vargaz@freemail.hu>
19063
19064         * icall.c (ves_icall_type_Equals): Revert last change.
19065         
19066         * icall.c (ves_icall_type_Equals): Turn the g_print into an assert.
19067
19068         * icall.c (ves_icall_type_GetTypeCode): Rename the icall to GetTypeCodeInternal.
19069
19070 2005-05-20  Sebastien Pouliot  <sebastien@ximian.com>
19071
19072         * class-internals.h: Added executioncontext_class field to 
19073         MonoDefaults structure.
19074         * domain.c: Cache System.Threading.ExecutionContext class in 
19075         mono_defaults.
19076         * object.c: Capture the ExecutionContext for asynchroneous calls in
19077          mono_async_result_new.
19078         * object-internals.h: Added execution_context and original_context 
19079         fields to MonoAsyncResult. Added execution_context to MonoThread.
19080         * security-manager.c|.h: Added mono_get_context_capture_method to 
19081         return the capture method (if required by the security manager or by
19082         the framework version used).
19083         * threadpool.c: Apply capture (if present) ExecutionContext in 
19084         mono_async_invoke and revert to original context after it completes.
19085
19086 2005-05-19  Atsushi Enomoto  <atsushi@ximian.com>
19087
19088         * culture-info-table.h : updated (real hacky solution for zh-CHT).
19089
19090 2005-05-18  Atsushi Enomoto  <atsushi@ximian.com>
19091
19092         * culture-info-table.h : zh-CHT related workaround.
19093
19094 2005-05-12  Zoltan Varga  <vargaz@freemail.hu>
19095
19096         * marshal.c (emit_marshal_custom): Add some error checking and call the
19097         methods in the ICustomMarshaler interface. Fixes #74875.
19098         
19099         * marshal.c (emit_marshal_array): Implement [Out] marshalling in
19100         native->managed wrappers.
19101
19102 2005-05-12  Martin Baulig  <martin@ximian.com>
19103
19104         * mono-debug-debugger.cs (mono_debugger_lock/unlock): Always lock
19105         here and use the loader lock.
19106
19107         * mono-debug.c: Properly lock when the debugger is not attached.
19108         (mono_debug_init): Release the initial lock if we're not running
19109         in the debugger.
19110
19111 2005-05-12  Zoltan Varga  <vargaz@freemail.hu>
19112
19113         * marshal.c (emit_marshal_custom): Pass through NULL values without
19114         calling the custom marshalling routines.
19115
19116         * marshal.c (emit_ptr_to_object_conv): Implement ftnptr->delegate
19117         conversion in structures. Fixes #74882.
19118
19119 2005-05-12  Atsushi Enomoto  <atsushi@ximian.com>
19120
19121         * culture-info-table.h : zh-* cultures were missing.
19122
19123 2005-05-12  Lluis Sanchez Gual  <lluis@novell.com>
19124
19125         * threads.c: Added a new event background_change_event which is signaled
19126         when a thread changes its background mode.
19127         Moved here several checks previously done in managed code. The checks
19128         require the thread lock, and using the thread lock in managed code
19129         can result in deadlocks.
19130         Merged Start_internal and Thread_internal into a single method. Now 
19131         Thread_internal does all work of creating and starting a thread.
19132         Added icalls for setting and getting the state of the object. Moved from
19133         managed code to avoid locking there.
19134         Added wait_for_tids_or_state_change() which is called instad of
19135         wait_for_tids when waiting for non-backround threads to end. This method
19136         will return if one of the threads ends or the background_change_event
19137         is signaled.
19138         * threadpool.c: use ves_icall_System_Threading_Thread_SetState() to set
19139         the background mode. This method signals the background_change_event
19140         event.
19141         * icall.c:
19142         * threads-types.h: Added icalls for ClrState, SetState and GetState, and
19143         removed Start_internal.
19144         
19145 2005-05-11  Martin Baulig  <martin@ximian.com>
19146
19147         * mono-debug.h (MonoSymbolTable, MonoDebugMethodAddress): Changed
19148         to order of some fields to get proper alignment on 64-bit machines.
19149
19150 2005-05-11  Martin Baulig  <martin@ximian.com>
19151
19152         * mono-debug.c, mono-debug-debugger.c: Revert Paolo's locking
19153         changes as they're broken and completely fuck up the debugger.
19154
19155         * mono-debug.c (mono_debug_add_method): Properly unlock on error.
19156
19157 2005-05-10  Martin Baulig  <martin@ximian.com>
19158
19159         * reflection.c (mono_reflection_generic_class_initialize): Don't
19160         call mono_class_setup_parent() here.
19161
19162 2005-05-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19163
19164         * metadata/socket-io.c: on windows, getsockopt/setsockopt for
19165         send/receive timeout use an integer in milliseconds. We were using a
19166         struct timeval.
19167
19168 2005-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19169
19170         * locales.c:
19171         (internal_get_cultures): reserve the first slot of the array for the
19172         InvariantCulture, which will be filled in managed code.
19173
19174 2005-05-06  Zoltan Varga  <vargaz@freemail.hu>
19175
19176         * reflection.c (mono_image_fill_module_table): Initialize the
19177         GENERATION field as well.
19178
19179 2005-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19180
19181         * monitor.c: ignore calls to Monitor.Exit even if no one ever called
19182         Monitor.Enter on the object.
19183
19184 2005-05-05  Lluis Sanchez Gual  <lluis@novell.com>
19185
19186         * threads.c: Enable the wait for running threads when exiting.
19187         * icall.c: Suspend all threads before exiting.
19188
19189 2005-05-05  Zoltan Varga  <vargaz@freemail.hu>
19190
19191         * assembly.c (mono_assembly_load_reference): Fix warning.
19192
19193 2005-05-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19194
19195         * threadpool.c: changed the default number of threads per cpu. From now
19196         on, the default will be 20 + (5 * number of cpus) instead of 50.
19197
19198 2005-05-04  Zoltan Varga  <vargaz@freemail.hu>
19199
19200         * loader.c (mono_method_get_signature_full): Add locking here.
19201
19202 2005-05-03  Lluis Sanchez Gual <lluis@novell.com>
19203
19204         * appdomain.c: Moved methods for parsing and freeing assembly
19205         names to assembly.c.
19206         * assembly.c, domain-internals.h: Created public methods for parsing
19207         assembly names. Fixed mono_assembly_load_with_partial_name:
19208         it now finds the best match, taking into account the version,
19209         token and culture specified in the partial name. Also return
19210         the latest version if no version information is specified.
19211
19212 Mon May 2 15:47:57 CEST 2005 Paolo Molaro <lupus@ximian.com>
19213
19214         * threadpool.c: replace check for SocketAsyncCall class.
19215
19216 2005-05-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19217
19218         * threadpool-internals.h:
19219         * Makefile.am: added threadpool-internals.h
19220
19221         * threadpool.c: call mono_unhandled_exception on exceptions not handled
19222         that happen in threadpool threads (tested on MS).
19223         (mono_thread_pool_remove_socket): new function that dispatch any pending
19224         AIO call on a socket that is closing. By now only epoll really needs it,
19225         as select/poll wake up when the socket closes.
19226
19227
19228         * socket-io.c: call mono_thread_pool_remove_socket in Close_internal.
19229
19230 2005-05-01  Zoltan Varga  <vargaz@freemail.hu>
19231
19232         * marshal.c (mono_marshal_get_managed_wrapper): Handle changing the calling convention.
19233
19234 2005-05-01  Lluis Sanchez Gual  <lluis@novell.com>
19235
19236         * gc.c: In mono_gc_cleanup(), wait for 2 seconds, not 2000 seconds.
19237
19238 2005-04-30  Lluis Sanchez Gual  <lluis@novell.com>
19239
19240         * threads.c: In mono_thread_suspend_all_other_threads, if a thread
19241         has an abort request, convert it into a suspend request.
19242
19243 2005-04-30  Ben Maurer  <bmaurer@ximian.com>
19244
19245         * marshal.c (mono_marshal_get_managed_wrapper): give a friendly
19246         warning for the usage of `UnmanagedFunctionPointerAttribute' which
19247         is not supported yet.
19248
19249 2005-04-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19250
19251         * image.c: register assemblies loaded from data (bundles) in the loaded
19252         assemblies hash. Fixes bug #74772.
19253
19254 2005-04-29  Martin Baulig  <martin@ximian.com>
19255
19256         * class.c (mono_type_get_name_recurse): Update to the new naming
19257         schema from the latest .NET 2.x beta2.
19258         (mono_class_setup_vtable_general): If we're a generic instance,
19259         copy the vtable from our generic type definition and inflate all
19260         the methods in it.
19261
19262         * loader.c (find_method): Update to the new naming schema from the
19263         latest .NET 2.x beta2.
19264
19265 2005-04-29  Raja R Harinath  <harinath@gmail.com>
19266
19267         * class.c (mono_class_init): Add a mono_loader_unlock to the
19268         #74734 fix.
19269
19270 2005-04-28  Zoltan Varga  <vargaz@freemail.hu>
19271
19272         * icall.c (ves_icall_System_Environment_Exit): Remove the 
19273         suspend_all_other_threads () call for the time being, since it can hang.
19274
19275         * threads.c (mono_thread_manage): Similarly, disable the waiting for
19276         the background threads to exit, since it can also hang.
19277
19278         * class.c (mono_class_init): Applied patch from Ankit Jain 
19279         (radical@gmail.com). Avoid pending init errors when a field refers
19280         to a nested class using a typeref. Fixes #74734.
19281
19282         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): Fix
19283         this for dynamic modules.
19284
19285 2005-04-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19286
19287         * threads.c: don't wait for threads that are in the process of aborting
19288         or aborted. Set the 'shutting_down' flag before cleaning the threadpool
19289         and waiting for background threads to finish. This makes xsp and
19290         mod-mono-server exit without random length delays and/or hangs.
19291
19292 2005-04-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19293
19294         * icall.c: remove duplicate assignment from GetReferencedAssemblies.
19295
19296 2005-04-25  Zoltan Varga  <vargaz@freemail.hu>
19297
19298         * class.c (mono_class_is_assignable_from): Call is_assignable_to for
19299         dynamic types to prevent infinite loops. Fixes #74727.
19300
19301         * reflection.c (mono_reflection_call_is_assignable_from): Rename to
19302         ..._is_assignable_to.
19303
19304 2005-04-25  Sebastien Pouliot  <sebastien@ximian.com>
19305
19306         * security.c: Fixed #74698 where sysconf returned -1 on FreeBSD.
19307
19308 2005-04-25  Martin Baulig  <martin@ximian.com>
19309
19310         Upgrade to the latest .NET 2.x beta (Visual Studio 2005 Beta 2).
19311
19312         * domain.c
19313         (supported_runtimes): Change "v2.0.40607" -> "v2.0.50215".
19314
19315         * row-indexes.h (MONO_GENERICPARAM_KIND): Removed.
19316
19317         * reflection.c (build_compressed_metadata): Set metadata header
19318         version to 2.0.
19319
19320 2005-04-23  Zoltan Varga  <vargaz@freemail.hu>
19321
19322         * sysmath.c (ves_icall_System_Math_Round2): Use modf to decompose the
19323         number into an integral and a decimal part. Fixes #70473.
19324
19325         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf): Ignore static fields. Fixes #74703.
19326
19327 2005-04-23  Atsushi Enomoto  <atsushi@ximian.com>
19328
19329         * culture-info-table.h : reflected the latest locale-builder output.
19330
19331 2005-04-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19332
19333         * threadpool.c: check for SuspendRequested too when deciding if
19334         mono_thread_interruption_checkpoint should be called.
19335
19336 2005-04-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19337
19338         * appdomain.[ch]: added function to set the shutting_down flag to TRUE.
19339         * threads.c: remove interruption_mutex and use Interlocked instead. When
19340         suspending all the threads, wait for all the suspended events at once.
19341         If we're shutting down and get an APC that is going to be queued,
19342         call mono_thread_execute_interruption immediately, as the thread might
19343         be sleeping on a pthread condition or mutex.
19344
19345         * icall.c: call mono_runtime_set_shutting_down before suspending the
19346         threads.
19347
19348         Fixes bug #74693. And now xsp is happier when exiting.
19349
19350 2005-04-22  Zoltan Varga  <vargaz@freemail.hu>
19351
19352         * loader.c (mono_stack_walk): Fix #74690.
19353
19354 2005-04-22  Martin Baulig  <martin@ximian.com>
19355
19356         * mono-debug.h (MonoDebugMethodJitInfo): Added
19357         `MonoDebugMethodJitInfo *jit'.
19358
19359         * mono-debug.c (mono_debug_read_method): Cache the
19360         MonoDebugMethodJitInfo in `address->jit'.
19361         (mono_debug_free_method_jit_info): New public method.
19362
19363 2005-04-22  Martin Baulig  <martin@ximian.com>
19364
19365         * class.c (mono_class_is_assignable_from): Disallow
19366         type parameter -> interface.
19367
19368 2005-04-21  Dick Porter  <dick@ximian.com>
19369
19370         * threads.c (mono_thread_create): Turn an assertion into an error.
19371
19372 2005-04-20  Zoltan Varga  <vargaz@freemail.hu>
19373
19374         * threads.c object.c icall.c: Fix some gcc 4.0 warnings.
19375         
19376         * threads.c marshal.h marshal.c exceptions.h exceptions.c appdomain.c: 
19377         Fix some gcc 4.0 warnings.
19378
19379 Wed Apr 20 16:09:06 CEST 2005 Paolo Molaro <lupus@ximian.com>
19380
19381         * file-io.c: fix alt dir separator char on unix systems
19382         and cleanup (fixes bug #71214).
19383
19384 2005-04-19  Lluis Sanchez Gual  <lluis@novell.com>
19385
19386         * marshal.c: Use CALLVIRT instead of CALL when dispatching
19387         a call to a remote domain, since the method may be an
19388         interface method in the client domain. This fixes bug #74192.
19389
19390 2005-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19391
19392         * threadpool.c: recv/send are now performed before going back to managed
19393         code to save one transition.
19394
19395 2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19396
19397         * metadata/socket-io.c: fixed semantics in Socket.Blocking icall.
19398
19399         * metadata/threadpool.c: removed hack to workaround the bug above.
19400
19401         Fixes bug #74618.
19402
19403 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
19404
19405         * reflection.c reflection.h: Fix handling of parameter defaults in
19406         dynamic methods. Also fixes handling of parameter attributes.
19407         Fixes #74609.
19408
19409         * mono-debug.c (mono_debug_close_image): Fix warning.
19410
19411 2005-04-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19412
19413         * socket-io.h: replaced old unused field with new 'blocking'.
19414         * threadpool.c: restore socket blocking state on windows(tm).
19415
19416 2005-04-14  Sebastien Pouliot  <sebastien@ximian.com>
19417
19418         * icall.c: don't return the codebase in the AssemblyName[] returned by
19419         ves_icall_System_Reflection_Assembly_GetReferencedAssemblies.
19420         * object-internals.h: Removed FIXME (fields were presents) and fixed
19421         versioncompat declaration.
19422
19423 2005-04-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19424
19425         * threadpool.c: sometimes we get EBADF from epoll but the epollfd is
19426         not closed, so don't cleanup when it happens.
19427
19428 2005-04-13  Chris Toshok  <toshok@ximian.com>
19429
19430         * mono-debug-debugger.h: change prototype for
19431         mono_debugger_lookup_type.
19432
19433         * mono-debug-debugger.c (mono_debugger_lookup_type): reinstate
19434         this function, although it should probably be named
19435         mono_debugger_init_type.
19436
19437 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19438
19439         * threadpool.c: fix non-AIO case.
19440
19441 2005-04-13  Zoltan Varga  <vargaz@freemail.hu>
19442
19443         * profiler.c (mono_profiler_install_simple): Add a 'jit' option to
19444         the built-in profiler to measure just JIT compilation times.
19445
19446 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19447
19448         * threadpool.c: the epollfd might be closed by another thread at
19449         any time, so ignore EBADF at treat it as a "we're closing" sign.
19450
19451 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19452
19453         * threadpool.c: release the semaphores with a count equals to the number
19454         of working threads in both IO and regular pools. Fixed typo that messed
19455         up the count of IO pool threads. Don't initialize the pipe handles if
19456         we're using epoll.
19457
19458 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19459
19460         * threadpool.c: some systems don't like a NULL when deleting the socket
19461         from epoll.
19462
19463 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19464
19465         * threadpool.c: fix semaphore allocation.
19466
19467 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19468
19469         * threadpool.c: added epoll() based implementation for asynchronous IO
19470         that is used instead of the default poll() when available.
19471         It can be disabled by setting MONO_DISABLE_AIO.
19472
19473 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19474
19475         * threadpool.c: windows needs 'closesocket' and instead of returning
19476         0 when the stream is closed while in select, it returns -1. Fixes bug
19477         #74573.
19478
19479 2005-04-12  Zoltan Varga  <vargaz@freemail.hu>
19480
19481         * class.c (class_compute_field_layout): Fix the regression caused by
19482         the previous try.
19483
19484 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19485
19486         * threadpool.c: separate pool for socket async. IO.
19487         * threadpool.h: mono_max_worker_threads is not a global any more.
19488
19489 2005-04-10  Zoltan Varga  <vargaz@freemail.hu>
19490
19491         * class.c (class_compute_field_layout): Fix #74549.
19492
19493 2005-04-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19494
19495         * threadpool.c: select() on windows doesn't allow pipe handles, soooo
19496         use 2 connected sockets instead.
19497
19498 2005-04-08  Miguel de Icaza  <miguel@novell.com>
19499
19500         * mono-config.c: Add new entry point for mkbundle
19501         mono_config_parse_memory. 
19502
19503 2005-04-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19504
19505         * threadpool.c: removed another unused function.
19506
19507 2005-04-08  Ankit Jain  <radical@corewars.org>
19508
19509         * reflection.c (get_default_param_value_blobs): Add 'types'
19510         parameter to get the types encoded in the constant table.
19511         (mono_param_get_objects): Use the type from the constant table,
19512         not the type of the parameter, when creating default values.
19513         Handle null default values correctly.
19514
19515 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19516
19517         * file-io.c:
19518         * file-io.h:
19519         * threadpool.c:
19520         * threadpool.h:
19521         * icall.c:
19522         * socket-io.c: removed dead code for async IO.
19523
19524 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19525
19526         * socket-io.h: 2 more fields in MonoSocketAsyncResult.
19527
19528         * threadpool.c: intercept socket async. calls and pass them to a thread
19529         that is polling and dispatching the job items to the threadpool as
19530         socket become ready. Fixes bugs #71217, #71933.
19531
19532         * icall.c: Removed AsyncReceive and AsyncSend. Speed up for copies
19533         between char and short/ushort arrays.
19534
19535         * socket-io.c: remove dead code.
19536
19537 2005-04-06  Atsushi Enomoto  <atsushi@ximian.com>
19538
19539         * locales.c,
19540           icall.c : removed InternalToUpper_Comp() and
19541           InternalToLower_Comp().
19542
19543 2005-04-06  Atsushi Enomoto  <atsushi@ximian.com>
19544
19545         * char-conversions.h : The tables were incorrectly generated. Should
19546           be generated against invariant culture.
19547
19548 2005-04-04  Zoltan Varga  <vargaz@freemail.hu>
19549
19550         * object.c (mono_runtime_invoke_array): Fix return value when 
19551         passing pre-created valuetype objects to ctors.
19552
19553         * gc.c (mono_gchandle_is_in_domain): Applied patch from Jon Larimer 
19554         (jlarimer@gmail.com). Avoid crashes when the wrapper object is null.
19555         Fixes #74338.
19556
19557 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
19558
19559         * domain.c: removed g_assert for runtimesecurityframe_class. This is 
19560         only used with --security and hides the wrong corlib version error.
19561
19562 2005-03-30  Joshua Tauberer  <tauberer@for.net>
19563
19564         * class.c: Changed mono_class_name_from_token so that types
19565         outside of a namespace don't have an initial period.  Improved
19566         the g_warning message used in _mono_class_get when loading
19567         fails.
19568         * assembly.c: In mono_assembly_load_reference, when an assembly
19569         can't be found, "No such file or directory" is misleading and
19570         unhelpful because a few paths were checked for the presence of
19571         the assembly.  When that happens (ENOENT), display a nicer
19572         message indicating the directories that were searched.  In all
19573         cases, the warning is made easier to read for non-hackers.
19574
19575 2005-03-29  Sebastien Pouliot  <sebastien@ximian.com>
19576
19577         * assembly.c: Set MONO_ASSEMBLIES to NULL when compiling from a VS.NET
19578         project/solution.
19579         * appdomain.h|domain.c: Removed inline from functions.
19580         * appdomain.c: Reduced warnings when compiling on windows.
19581         * icall.c: Fixed output_debug declaration to gunichar2*.
19582         * mono-config.c: Reduced warnings when compiling on windows.
19583         * rand.c: Added missing "windows.h". Added missing return value.
19584         * rawbuffer.c: Added missing winsock2.h for windows.
19585         * sysmath.h: Added mono-compiler.h header to allow/ease 
19586         compilation with non-GCC compilers.
19587         * threads.c: Fixed declarations to compile with VS.NET C compiler.
19588         Removed cast warnings.
19589
19590         Adapted from the work of J Lothian (for VC6).
19591
19592 2005-03-29  Zoltan Varga  <vargaz@freemail.hu>
19593
19594         * assembly.c (mono_assembly_load_corlib): Do not try loading corlib
19595         from default_path.
19596
19597 2005-03-27  Zoltan Varga  <vargaz@freemail.hu>
19598
19599         * marshal.c (mono_marshal_get_managed_wrapper): Fix bogus assert on
19600         the 2.0 profile.
19601
19602 2005-03-27  Raja R Harinath  <harinath@gmail.com>
19603
19604         * Makefile.am (assembliesdir): Fix.  If it is arch-dependent it
19605         has to be in $(exec_prefix).  $(prefix) is for arch-independent
19606         stuff, and it would probably use $(prefix)/share rather than
19607         $(prefix)/lib.
19608
19609 2005-03-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19610
19611         * console-io.c: added 2 includes that might be missing.
19612
19613 2005-03-24  Zoltan Varga  <vargaz@freemail.hu>
19614
19615         * marshal.c (mono_marshal_get_managed_wrapper): Fix crashes in 2.0
19616         profile.
19617
19618         * reflection.c (create_custom_attr): Allocate the params array using
19619         alloca so it gets GC tracking.
19620
19621 2005-03-23  Chris Toshok  <toshok@ximian.com>
19622
19623         * mono-debug-debugger.c (mono_debugger_runtime_invoke): comment
19624         out some spew.
19625
19626 2005-03-24  Raja R Harinath  <rharinath@novell.com>
19627
19628         * Makefile.am (assembly.lo, mono-config.lo): Rebuild when Makefile
19629         changes to pick up any changes in prefix, etc.
19630
19631 2005-03-23  Zoltan Varga  <vargaz@freemail.hu>
19632
19633         * marshal.c (mono_marshal_get_managed_wrapper): Remove fixme.
19634         
19635         * marshal.c (mono_marshal_get_managed_wrapper): Remove debugging output.
19636         * marshal.c (mono_marshal_get_managed_wrapper): Add support for the modopt(CallConvCdecl).
19637
19638 2005-03-23  Zoltan Varga  <vargaz@freemail.hu>
19639
19640         * class-internals.h object-internals.h class.c reflection.c: Extend the
19641         mono_lookup_dynamic_token () function to return the class of the
19642         token as well. 
19643
19644         * class.c (mono_ldtoken): Handle MEMBERREFS in the dynamic case as
19645         well. Fixes #73848.
19646
19647 2005-03-23  Sebastien Pouliot  <sebastien@ximian.com>
19648
19649         * security-manager.c: Skip inheritance checks for intra-corlib
19650         class inheritance and method overrides. This skips a lot of checks
19651         and (anyway) permissions cannot work until corlib is loaded.
19652
19653 2005-03-23  Martin Baulig  <martin@ximian.com>
19654
19655         * marshal.c (mono_marshal_get_stfld_wrapper): Add support for
19656         MONO_TYPE_GENERICINST.  
19657
19658 2005-03-23  Martin Baulig  <martin@ximian.com>
19659
19660         * metadata.c (mono_type_to_unmanaged): Add MONO_TYPE_GENERICINST.
19661
19662 Tue Mar 22 16:57:01 CET 2005 Paolo Molaro <lupus@ximian.com>
19663
19664         * class.c: added locking comments to some functions.
19665         Cache the interface offsets arrays (saves about 20 KB
19666         of runtime memory in a typical app).
19667         Reduce the time overhead in mono_class_setup_supertypes ().
19668
19669 Tue Mar 22 16:35:57 CET 2005 Paolo Molaro <lupus@ximian.com>
19670
19671         * icall.c: speedup and fix leaks in GetMethodsByName and
19672         GetPropertiesByName.
19673
19674 Tue Mar 22 16:34:29 CET 2005 Paolo Molaro <lupus@ximian.com>
19675
19676         * reflection.c: some locking fixes.
19677
19678 Tue Mar 22 15:13:54 CET 2005 Paolo Molaro <lupus@ximian.com>
19679
19680         * metadata.c: added missing break in case statement.
19681
19682 2005-03-22  Zoltan Varga  <vargaz@freemail.hu>
19683
19684         * marshal.c (mono_marshal_get_runtime_invoke): Add support for
19685         typedbyref return values. Fixes #73941.
19686
19687 2005-03-17  Sebastien Pouliot  <sebastien@ximian.com>
19688
19689         * security-manager.c|h: Added demandunmanaged method and 
19690         suppressunmanagedcodesecurity class to MonoSecurityManager.
19691         Renamed aptc class to allowpartiallytrustedcallers.
19692
19693 2005-03-17  Martin Baulig  <martin@ximian.com>
19694
19695         * class.c (inflate_generic_type): Add MONO_TYPE_ARRAY.
19696
19697 2005-03-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19698
19699         * file-io.c: disabled file async. IO using aio_*. It uses the
19700         threadpool now. Workaround for bug #73718.
19701
19702 Wed Mar 16 18:08:00 CET 2005 Paolo Molaro <lupus@ximian.com>
19703
19704         * assembly.h, mono-config.c: added code to deal with bundled configs
19705         for bundled assemblies.
19706
19707 Wed Mar 16 16:34:38 CET 2005 Paolo Molaro <lupus@ximian.com>
19708
19709         * *.c, private.h: cleanup, removing old private.h header file.
19710
19711 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
19712
19713         * reflection.c (mono_image_get_method_info): Encode best_fit_mapping
19714         and throw_on_unmappable_char attributes.
19715
19716 2005-03-13  Sebastien Pouliot  <sebastien@ximian.com>
19717
19718         * process.c: Fix buffer length in ves_icall_System_Diagnostics_Process
19719         _ProcessName_internal.
19720
19721 2005-03-13  Zoltan Varga  <vargaz@freemail.hu>
19722
19723         * object.c (mono_array_new_full): Fix aligning of array size. Fixes
19724         #73631.
19725
19726         * icall.c threads.c threads-types.h: Remove slothash icalls as they
19727         are no longer used.
19728
19729 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
19730
19731         * object.c (compute_class_bitmap): Add support for generics. Fixes
19732         #73527.
19733
19734 2005-03-10  Zoltan Varga  <vargaz@freemail.hu>
19735
19736         * reflection.c (mono_reflection_create_runtime_class): Fix 2.0 build.
19737
19738 2005-03-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19739
19740         * filewatcher.c: commented out the code for windows watcher, as we don't
19741         use it (we use the managed implementation instead).
19742
19743 2005-03-10  Zoltan Varga  <vargaz@freemail.hu>
19744
19745         * object-internals.h (MonoThread): Remove 'unused1' field.
19746
19747         * appdomain.c: Bump corlib version.
19748
19749         * marshal.c: Remove calls to Reset/RestoreDataStoreStatus ().
19750
19751         * reflection.c (mono_reflection_create_runtime_class): Remove the
19752         AssemblyBuilder.Save optimization since it causes too many problems.
19753
19754 2005-03-10  Sebastien Pouliot  <sebastien@ximian.com>
19755
19756         * exception.c|h: Added mono_get_exception_reflection_type_load to
19757         create a ReflectionTypeLoadException object.
19758         * icall.c: Updated ves_icall_System_Reflection_Assembly_InternalGetType
19759         to return NULL is a InheritanceDemand fails during reflection. Updated
19760         ves_icall_System_Reflection_Assembly_GetTypes to throw a 
19761         ReflectionTypeLoadException if an InheritanceDemand fails during 
19762         reflection. Added icall mapping for GetLinkDemandSecurity.
19763         * security-manager.c|h: Added ves_icall_System_Security_
19764         SecurityManager_GetLinkDemandSecurity internal call to return the
19765         class and methods permissions set for a LinkDemand. Removed unused
19766         fields in MonoSecurityManager.
19767
19768 2005-03-10  Martin Baulig  <martin@ximian.com>
19769
19770         * class.c (mono_bounded_array_class_get): Initialize `eclass' if
19771         it's a generic instance.
19772
19773 2005-03-09  Zoltan Varga  <vargaz@freemail.hu>
19774
19775         * reflection.c (mono_get_object_from_blob): Applied patch from
19776         Ankit Jain (radical@gmail.com). Fix enum default values. Fixes #73457.
19777
19778         * class.c (mono_class_is_assignable_from): Another try at fixing 
19779         #73469 without breaking anything.
19780
19781 2005-03-08  Zoltan Varga  <vargaz@freemail.hu>
19782
19783         * class.c: (mono_class_is_assignable_from): Revert the last changes
19784         since they don't work with generics.
19785         
19786         * class.c (mono_class_is_assignable_from): Fix build bustage.
19787
19788         * class.c (mono_class_is_assignable_from): If oklass is dynamic, call
19789         the managed IsAssignableFrom method. Fixes #73469.
19790
19791         * reflection.c (mono_reflection_call_is_assignable_from): New helper
19792         function.
19793
19794 2005-03-04  Zoltan Varga  <vargaz@freemail.hu>
19795
19796         * object.c (mono_load_remote_field_new): Fix returning uninitialized
19797         memory when the remoting callback does not sets the out arguments.
19798         Fixes #73007.
19799
19800         * marshal.c (mono_delegate_free_ftnptr): Remove debug array checked in
19801         by mistake.
19802
19803         * string-icalls.c: Return String.Empty where needed. Fixes #73310.
19804
19805         * object-internals.h (MonoStackFrame): Sync with managed object layout.
19806
19807         * appdomain.c: Bump corlib version.
19808
19809 2005-03-03  Zoltan Varga  <vargaz@freemail.hu>
19810
19811         * gc-internal.h boehm-gc.c null-gc.c: Add mono_gc_is_gc_thread () API
19812         function.
19813
19814         * threads.c (mono_thread_attach): Detect threads which are not started
19815         by the GC pthread wrappers.
19816
19817 2005-03-03  Sebastien Pouliot  <sebastien@ximian.com>
19818
19819         * icall.c: Added new icall for RNG.
19820         * rand.c|h: Added new icall to open the RNG. This allows to share a 
19821         single handle on Linux to access /dev/urandom and fix #73183.
19822
19823 Thu Mar 3 17:53:17 CET 2005 Paolo Molaro <lupus@ximian.com>
19824
19825         * object.c: setting the new vtable in a transparent proxy object must
19826         not change the GC descriptor.
19827
19828 Thu Mar 3 12:11:46 CET 2005 Paolo Molaro <lupus@ximian.com>
19829
19830         * object.c: fixed compilation without GCJ support.
19831         * reflection.c: for runtime-created types ensure klass->has_references
19832         is correct (bug #73215).
19833
19834 2005-03-02  Martin Baulig  <martin@ximian.com>
19835
19836         * class.c (mono_class_is_assignable_from): Make this work if
19837         `oklass' is a generic instance; fixes #72831.
19838
19839 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
19840
19841         * marshal.c (mono_marshal_get_managed_wrapper): Fix handling of methods
19842         with hasthis set.
19843         
19844         * marshal.c (emit_marshal_array): Emit native->managed marshalling of blittable arrays.
19845
19846         * marshal.c: Reorganize native->managed marshalling code to also use
19847         the emit_marshal_... functions.
19848
19849 Tue Mar 1 16:16:42 CET 2005 Paolo Molaro <lupus@ximian.com>
19850
19851         * object.c: typed allocs have issues with bitmap sizes > 30,
19852         so check for max_set >= 30.
19853
19854 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
19855
19856         * marshal.c (emit_marshal_array): Implement marshalling of arrays to
19857         managed code. Fixes #73012.
19858
19859         * metadata.h (MonoMarshalSpec): Add elem_mult field.
19860
19861         * metadata.c reflection.c: Load/Emit elem_mult as well.
19862         
19863         * metadata.h (MonoMarshalSpec): Add comment.
19864
19865         * metadata.h: Add MONO_MARSHAL_CONV_LPTSTR_STR.
19866
19867         * metadata.c (mono_metadata_parse_marshal_spec): Set param_num and
19868         num_elem to -1 if not given.
19869
19870         * object-internals.h (MonoReflectionMarshal): Add has_size field.
19871
19872         * reflection.c (encode_marshal_blob): Differentiate between 0 and not
19873         given values.
19874
19875 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
19876
19877         * null-gc.c (mono_gc_free_fixed): Was not compilable.
19878
19879 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
19880
19881         * reflection.c (encode_marshal_blob): Encode param_num field as well.
19882
19883         * object-internals.h (MonoReflectionMarshal): Add param_num field.
19884
19885 Mon Feb 28 11:59:42 CET 2005 Paolo Molaro <lupus@ximian.com>
19886
19887         * object.c: generalized the reference bitmap creation
19888         and added hooks for the new GC.
19889         * class-internals.c: removed the gc_bitmap field from MonoClass.
19890
19891 Sat Feb 26 16:06:59 CET 2005 Paolo Molaro <lupus@ximian.com>
19892
19893         * domain.c: help the compiler to produce better code
19894         in mono_jit_info_table_find ().
19895
19896 Fri Feb 25 16:50:14 CET 2005 Paolo Molaro <lupus@ximian.com>
19897
19898         * object.c: make all allocations look typed.
19899
19900 Fri Feb 25 16:18:59 CET 2005 Paolo Molaro <lupus@ximian.com>
19901
19902         * socket-io.c: load Mono.Posix if it's not loaded already
19903         (fixes bug#73033).
19904
19905 2005-02-24  Martin Baulig  <martin@ximian.com>
19906
19907         * class.c (dup_type): Correctly duplicate MONO_TYPE_PTR.
19908         * reflection.c (dup_type): Likewise.
19909
19910 2005-02-24  Zoltan Varga  <vargaz@freemail.hu>
19911
19912         * gc.c (run_finalize): Set the domain for finalizing delegates as well.
19913         Thanks to Willibald Krenn and Scott Mohekey for tracking this down.
19914
19915 Thu Feb 24 15:19:35 CET 2005 Paolo Molaro <lupus@ximian.com>
19916
19917         * domain.c, threads.c, object-internals.h: make the critical thread
19918         local vars use the fast access mode (even when we're compiled in
19919         a lib). Provide accessors to be used by the jit during codegen.
19920
19921 2005-02-24  Carlos Alberto Cortez <calberto.cortez@gmail.com>
19922
19923         * appdomain.c: Changed hook functios behavior to include
19924         support for the reflection only assemblies. Some icalls were changed
19925         to support the mentioned assemblies too. Signatures of static methods
19926         try_assembly_resolve and real_load now have an additional parameter:
19927         refonly.
19928
19929         * assembly.c: General changes to mono_assembly_ methods to support
19930         reflection only api. Functions mono_assembly_open, mono_assembly_load,
19931         mono_assembly_load_from and mono_assembly_loaded have got a '_full'
19932         suffix, to support an additional gbool parameter to specify whether
19933         the assembli is reflection only or not. Created some new hook functions 
19934         to add support for reflection only assemblies. Signatures of static 
19935         methods load_in_path, search_loaded, and mono_assembly_load_from_gac 
19936         have now an additional parameter: refonly.
19937
19938         * metadata-internals.h: MonoAssembly now has a gbool ref_only flag,
19939         indicating whether the assembly is reflection only or not.
19940
19941         * exception.c: Add mono_get_exception_invalid_operation.
19942
19943         * icall.c: Throw an InvalidOperationException when trying to invoke
19944         a property/method/event, or trying to set/get the value of a field.
19945         Also add an icall to retrieve the ref_only flag to the
19946         MonoReflectionAssembly.
19947
19948 2005-02-23  Chris Toshok  <toshok@ximian.com>
19949
19950         Part of fix for #72827.
19951         * mono-debug.c (mono_debug_add_method): add lexical block data to
19952         the info we write.  Kind of a hack at the moment - we copy the
19953         lexical block info from the MonoDebugMethodInfo to the
19954         MonoDebugMethodJitInfo here, before writing it.
19955         (mono_debug_read_method): read the lexical block info.
19956
19957         * mono-debug.h (_MonoDebugMethodJitInfo): add lexical block slots.
19958
19959         * debug-mono-symfile.h: add lexical block support.
19960
19961         * debug-mono-symfile.c (mono_debug_find_method): add lexical block
19962         support.
19963
19964 2005-02-23  Zoltan Varga  <vargaz@freemail.hu>
19965
19966         * loader.c (mono_lookup_pinvoke_call): Fix warning.
19967
19968         * object.c (mono_runtime_free_method): Call mono_free_method () and
19969         put the TODOs there.
19970
19971         * loader.c (mono_free_method): Free up most memory allocated for 
19972         dynamic methods.
19973
19974 Wed Feb 23 18:54:26 CET 2005 Paolo Molaro <lupus@ximian.com>
19975
19976         * reflection.c: properly flag a Type argument to a
19977         named custom attr value (bug #72248).
19978
19979 Wed Feb 23 18:32:35 CET 2005 Paolo Molaro <lupus@ximian.com>
19980
19981         * reflection.c: reduce code duplication in named custom
19982         attribute encoding.
19983
19984 Wed Feb 23 17:23:52 CET 2005 Paolo Molaro <lupus@ximian.com>
19985
19986         * reflection.c: properly encode custom attrs of type object
19987         (bug #72649).
19988
19989 2005-02-23  Zoltan Varga  <vargaz@freemail.hu>
19990
19991         * marshal.c (mono_delegate_free_ftnptr): Make this thread safe.
19992
19993 Tue Feb 22 21:54:47 CET 2005 Paolo Molaro <lupus@ximian.com>
19994
19995         * socket-io.c: load System.dll if it's not loaded already
19996         (bug #72850 and #70477).
19997
19998 2005-02-21  Martin Baulig  <martin@ximian.com>
19999
20000         * marshal.c (mono_marshal_get_runtime_invoke): Add support for
20001         generic instances.
20002
20003 2005-02-21  Martin Baulig  <martin@ximian.com>
20004
20005         * reflection.c (mono_image_build_metadata): We also need to
20006         "fixup" the MethodImpl table after we computed the final method
20007         indices.  Call fixup_methodimpl() to do that.
20008         (fixup_methodimpl): New private method.
20009
20010 Mon Feb 21 16:17:14 CET 2005 Paolo Molaro <lupus@ximian.com>
20011
20012         * assembly.c: special case mscorlib.dll (bug#72536),
20013         patch from Carlos Alberto Cortez.
20014
20015 2005-02-20  Zoltan Varga  <vargaz@freemail.hu>
20016
20017         * threads-types.h threads.c: Fix build bustage.
20018
20019         * threads.c: Use a union for long<->double conversions.
20020
20021         * threads-types.h threads.c icall.c: Implement the net 2.0 interlocked
20022         functions based on a patch by Luca Barbieri (luca.barbieri@gmail.com).
20023
20024         * marshal.c (emit_thread_interrupt_checkpoint_call): Mark the bblock 
20025         containing the checkpoint call with NOT_TAKEN.
20026         
20027         * marshal.c (mono_marshal_get_managed_wrapper): Emit interrupt 
20028         checkpoint before pushing the arguments, so they won't have to be
20029         spilled to stack.
20030
20031 Sat Feb 19 15:19:46 CET 2005 Paolo Molaro <lupus@ximian.com>
20032
20033         * domain.c, assembly.c, domain-internals.h: make some data
20034         const and relocation-free.
20035
20036 Sat Feb 19 11:12:34 CET 2005 Paolo Molaro <lupus@ximian.com>
20037
20038         * object.c, appdomain.c, class-internals.h: introduce the
20039         MonoClassRuntimeInfo structure to hold the info needed to
20040         use a class at runtime. Made mono_class_vtable() lock-free
20041         for all the appdomains.
20042
20043 Sat Feb 19 11:11:12 CET 2005 Paolo Molaro <lupus@ximian.com>
20044
20045         * metadata-internals.h, image.c: introduce a per-image mempool to
20046         be used for memory that has the same lifetime as the image.
20047
20048 2005-02-18  Lluis Sanchez Gual  <lluis@novell.com>
20049
20050         * domain.c: In mono_init_internal(), instead of selecting the first
20051         runtime version supported by an executable, get a list of all
20052         supported versions and select the one for which an mscorlib exists
20053         (since even if the runtime supports a given version, it doesn't mean
20054         that the framework for that version is installed).
20055         Modified get_runtimes_from_exe to support this behavior.
20056         In supported_runtimes, added information about additional system
20057         assembly versions.
20058         
20059         * assembly.c: Added support for more than one system assembly version
20060         per runtime version. Updated the assembly list.
20061         In mono_assembly_remap_version, removed the initial version check,
20062         since we don't know to which version we need to compare until we
20063         get the version set on which the assembly is based.
20064         Moved the code for loading corlib into the new method
20065         mono_assembly_load_corlib(), so it can be used by the initialization
20066         code.
20067         
20068         * domain-internals.h: Updated data structures and added declaration
20069         for mono_assembly_load_corlib.
20070
20071 2005-02-17  Zoltan Varga  <vargaz@freemail.hu>
20072
20073         * reflection.c (resolve_object): Fix the creation of the signature in 
20074         the SignatureHelper case.
20075
20076         * assembly.c (mono_assembly_remap_version): Fix binary search.
20077         
20078 2005-02-17  Sebastien Pouliot  <sebastien@ximian.com>
20079  
20080         * class.c: Added inheritance check when a method is overloaded (from a
20081         virtual method or when implementing an interface) and when a class is
20082         inherited. Added functions to set a failure for a class and to 
20083         retreive the exception from a failure.
20084         * class-internals.h: Added fields to MonoClass to keep the exception
20085         information status for inheritance (or other exceptions) to be thrown
20086         later (i.e. not at load time).
20087         * object.c: Throw the inheritance SecurityException when a type is to 
20088         be created with either class or method inheritance violations.
20089         * reflection.c|h: Fix when getting declsec from a class. Removed 
20090         unrequired code for class. Improved sanity in parameter naming.
20091         * security-manager.c|h: Added functions to check for class and method
20092         inheritance.
20093
20094 2005-02-17  Zoltan Varga  <vargaz@freemail.hu>
20095
20096         * reflection.c (mono_reflection_create_runtime_class): Set has_cctor
20097         and has_finalize in dynamic types as well.
20098
20099 2005-02-17  Atsushi Enomoto  <atsushi@ximian.com>
20100
20101         * culture-info-table.h : fixed currency format for en-GB (and so on).
20102
20103 Wed Feb 16 16:28:15 CET 2005 Paolo Molaro <lupus@ximian.com>
20104
20105         * gc.c: ensure the GC handles never have 0 as a value.
20106
20107 2005-02-16  Zoltan Varga  <vargaz@freemail.hu>
20108
20109         * marshal.c (emit_marshal_ptr): Raise an exception if trying to pass
20110         a pointer to a struct to unmanaged code. Fixes #72625.
20111
20112 2005-02-16  Martin Baulig  <martin@ximian.com>
20113
20114         * mono-debug.c (mono_debug_open_image): Ignore dynamic images.
20115
20116 2005-02-16  Zoltan Varga  <vargaz@freemail.hu>
20117
20118         * marshal.c (emit_marshal_array): Only marshal unicode char arrays as [Out].
20119
20120 2005-02-15  Zoltan Varga  <vargaz@freemail.hu>
20121
20122         * loader.c (mono_lookup_pinvoke_call): Fix stdcall name mangling.
20123
20124         * marshal.c (mono_ftnptr_to_delegate): If the delegate has the 
20125         UnmanagedFunctionPointerAttribute, use it for determining calling convention
20126         etc. Fixes #71471.
20127
20128         * reflection.c (mono_custom_attrs_get_attr): New helper function.
20129
20130         * object-internals.h: Add MonoReflectionUnmanagedFunctionPointerAttribute.
20131
20132 Tue Feb 15 18:03:41 CET 2005 Paolo Molaro <lupus@ximian.com>
20133
20134         * domain.c, appdomain.c, appdomain.h, object-internals.h, object.h:
20135         changes to make the current context a field in MonoThread.
20136
20137 2005-02-15  Zoltan Varga  <vargaz@freemail.hu>
20138
20139         * marshal.c (mono_marshal_get_native_wrapper): Fix a crash caused by
20140         the last change.
20141         
20142         * marshal.c (mono_marshal_emit_native_wrapper): New helper function
20143         extracted from mono_marshal_get_native_wrapper.
20144
20145         * marshal.c (mono_marshal_get_native_func_wrapper): New helper function
20146         to create wrappers around native functions.
20147
20148         * marshal.c (mono_ftnptr_to_delegate): Add support for creating 
20149         delegates for arbitrary function pointers. Fixes #71472.
20150
20151 Tue Feb 15 11:01:09 CET 2005 Paolo Molaro <lupus@ximian.com>
20152
20153         * threads.c: cleaned up the code a little.
20154
20155 2005-02-15  Martin Baulig  <martin@ximian.com>
20156
20157         * mono-debug.h (MonoSymbolTable): Allow variable-length chunks in
20158         the data table.
20159
20160         * mono-debug.c (DATA_TABLE_CHUNK_SIZE): Set to 32768; we may now
20161         allocate larger chunks if needed.
20162
20163 2005-02-14  Zoltan Varga  <vargaz@freemail.hu>
20164
20165         * threads.c (start_wrapper): Remove #ifdef PLATFORM_WIN32 probably left
20166         in by mistake.
20167
20168 Mon Feb 14 16:48:24 CET 2005 Paolo Molaro <lupus@ximian.com>
20169
20170         * domain.c: keep the domains in an array and ensure the domain ids
20171         are kept small, so they can be used as indexes to domain-specific data
20172         with a small memory overhead.
20173
20174 2005-02-14  Zoltan Varga  <vargaz@freemail.hu>
20175
20176         * icall.c: Handle byref types in Type icalls. Fixes #72544.
20177
20178 Mon Feb 14 15:39:56 CET 2005 Paolo Molaro <lupus@ximian.com>
20179
20180         * Makefile.am: remove libmetadata: we build just libmonoruntime now.
20181
20182 2005-02-13  Zoltan Varga  <vargaz@freemail.hu>
20183
20184         * tabledefs.h (MANIFEST_RESOURCE_VISIBILITY_MASK): Add flags for ManifestResource.
20185
20186         * loader.c (mono_lookup_pinvoke_call): Correct the search order used for different CharSet
20187         values.
20188
20189         * marshal.c (mono_marshal_get_string_encoding): CHAR_SET_AUTO means Unicode on windows.
20190         
20191 2005-02-12  Ben Maurer  <bmaurer@ximian.com>
20192
20193         * domain-internals.h: add the hashtable here.
20194
20195         * class-internals.h: Remove `info' from MonoMethod
20196
20197         * domain.c: Add a new hashtable, jit_trampoline_hash
20198
20199 Fri Feb 11 17:11:20 CET 2005 Paolo Molaro <lupus@ximian.com>
20200
20201         * object.c: don't set the value of static fields
20202         (fixes bug#72494).
20203
20204 2005-02-11  Martin Baulig  <martin@ximian.com>
20205
20206         * mono-debug.c (DATA_TABLE_CHUNK_SIZE): Increase to 131072.
20207         (mono_debug_add_method): Silently ignore the method if it's too big.
20208         (mono_debug_add_type): Likewise.
20209
20210 Fri Feb 11 16:22:10 CET 2005 Paolo Molaro <lupus@ximian.com>
20211
20212         * threads.c, appdomain.c: remove #ifdefs from the code.
20213
20214 2005-02-10  Sebastien Pouliot  <sebastien@ximian.com>
20215
20216         * metadata-internals.h: Added flags to MonoAssembly to cache the most
20217         common security informations. This allows us to stay in unmanaged code
20218         when doing LinkDemand and it's special cases (except for the first 
20219         time for initialization). The flags a very much used with --security.
20220         * reflection.c|h: Added code to get declarative security attributes 
20221         for LinkDemand and InheritanceDemand. This required to refactor the
20222         existing code for Demand.
20223         * security-manager.c|h: Added new method fields for the special cases
20224         of LinkDemand.
20225
20226 2005-02-10  Martin Baulig  <martin@ximian.com>
20227
20228         * icall.c (ves_icall_MonoDebugger_MakeArrayType): New interncall.
20229         (ves_icall_MonoDebugger_GetTypeToken): New interncall.
20230
20231 2005-02-10  Martin Baulig  <martin@ximian.com>
20232
20233         * mono-debug.c, mono-debug-debugger.c: Completely reworked the
20234         debugging code; this is almost a complete rewrite.
20235
20236         * icall.c (ves_icall_MonoDebugger_GetMethodIndex): New interncall.
20237
20238 Thu Feb 10 15:19:01 CET 2005 Paolo Molaro <lupus@ximian.com>
20239
20240         * domain.c, object.h: expose mono_string_equal () and 
20241         mono_string_hash ().
20242         * icall.c, string-icalls.c: remove the string.GetHashCode () icall,
20243         it's implemented in managed code.
20244
20245 Thu Feb 10 15:03:46 CET 2005 Paolo Molaro <lupus@ximian.com>
20246
20247         * icall.c, gc.c, gc-internal.h: make sure gchandles can't be used
20248         lo leak objects between appdomains.
20249
20250 Thu Feb 10 14:25:00 CET 2005 Paolo Molaro <lupus@ximian.com>
20251
20252         * assembly.c: old compilers compilation fix from 
20253         robertj@gmx.net (Robert Jordan).
20254
20255 2005-02-09  Ben Maurer  <bmaurer@ximian.com>
20256
20257         * class-internals.h: Little reminder for the future.
20258
20259         * debug-helpers.c: Fix up wrapper_type_names
20260
20261 Wed Feb 9 19:34:29 CET 2005 Paolo Molaro <lupus@ximian.com>
20262
20263         * image.c, metadata-internals.h: when loading an image from a file,
20264         mmap all of it and use the same codepaths as when using a
20265         in-memory image: the code is simpler and we use less memory
20266         (both writable and readonly).
20267
20268 Wed Feb 9 18:32:51 CET 2005 Paolo Molaro <lupus@ximian.com>
20269
20270         * gc-internal.h, null-gc.c, boehm-gc.c: added functions to the GC
20271         API to alloc runtime data structures that need to be tracked by the
20272         GC and contain pointers.
20273         * appdomain.c, threads.c, object.c, gc.c: use the above changes to
20274         make the code more readable and eventually use a different GC.
20275
20276 2005-02-09  Zoltan Varga  <vargaz@freemail.hu>
20277
20278         * marshal.c (emit_marshal_vtype): Don't do managed->native conversion
20279         for out arguments.
20280         
20281 2005-02-09  Lluis Sanchez Gual  <lluis@novell.com>
20282
20283         * object.c: In release_type_locks(), don't release the cctor lock
20284         if it has already been released. This fixes a crash in the
20285         thread5 test.
20286
20287 Tue Feb 8 19:02:59 CET 2005 Paolo Molaro <lupus@ximian.com>
20288
20289         * gc.c, marshal.c, icall.c: register a delegate for finalization
20290         only when the native function pointer has been allocated for it.
20291
20292 Tue Feb 8 18:12:27 CET 2005 Paolo Molaro <lupus@ximian.com>
20293
20294         * object.c: cleaned up some code, allocate objects that are
20295         pointer free with the atomic malloc variant. Allocate memory
20296         for static data from the mempool if it's pointer-free.
20297         Allocate the bounds array at the end of the array data, when needed.
20298         * object-internals.h, object.h: move a private function in a private
20299         header.
20300         * class.c: handle missing case in tracking references in fields.
20301
20302 Tue Feb 8 18:04:51 CET 2005 Paolo Molaro <lupus@ximian.com>
20303
20304         * class.c, class-internals.h: keep track if a type has
20305         reference fields in either the instance or static fields.
20306
20307 2005-02-07  Lluis Sanchez Gual  <lluis@novell.com>
20308
20309         * domain.c, domain-internals.h: Moved RuntimeInfo to domain-internals.h,
20310         and renamed to MonoRuntimeInfo. Added fields to store the expected
20311         framework assembly version. Changed mono_get_framework_version and
20312         mono_get_runtime_version for a single mono_get_runtime_info method.
20313         
20314         * assembly.c: Added method to remap system assembly versions to the
20315         current executing runtime version. Removed old mapping code.
20316         Remap assembly versions in mono_assembly_load and mono_assembly_loaded.
20317         
20318         * icall.c, reflection.c: Track api changes.
20319
20320 2005-02-06  Miguel de Icaza  <miguel@novell.com>
20321
20322         * loader.c (method_from_memberref): Improve error reporting,
20323         produce the class name instead of the typeref/typedef index. 
20324
20325 2005-02-07  Zoltan Varga  <vargaz@freemail.hu>
20326
20327         * marshal.c (mono_marshal_get_stfld_remote_wrapper): Fix wrapper type.
20328
20329 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
20330
20331         * loader.c (mono_lookup_pinvoke_call): Allow for combination of
20332         stdcall and charset name mangling.  Reorganize the code and add
20333         some tracing stuff.
20334
20335 2005-02-05  Ben Maurer  <bmaurer@ximian.com>
20336
20337         * monodiet.c: More iters!
20338
20339         * marshal.c: Iter usage.
20340
20341         * icall.c: Iter usage.
20342
20343         * object.c: Use iters.
20344
20345         * debug-helpers.c: More iters
20346
20347 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
20348
20349         * loader.c (mono_lookup_pinvoke_call): Add brute-force checking for mangled function names
20350         under win32.
20351
20352 2005-02-05  Ben Maurer  <bmaurer@ximian.com>
20353
20354         * mono-debug-debugger.c: use iters
20355
20356         * class.c, class-internals.h: mono_class_setup_events is static
20357         now
20358
20359         * All callers: use iters
20360
20361 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
20362
20363         * class.c string-icalls.c marshal.c reflection.c: Applied patch from
20364         Robert Jordan (robertj@gmx.net). Fix compilation errors under gcc-2.95.
20365
20366 2005-02-04  Zoltan Varga  <vargaz@freemail.hu>
20367
20368         * object.c (mono_class_proxy_vtable): Add missing _setup () calls.
20369
20370         * marshal.h: Add prototypes for ldfld/stfld_remote.
20371
20372         * appdomain.c (mono_domain_fire_assembly_load): Handle the case when
20373         this is called during startup.
20374         
20375 Fri Feb 4 20:27:58 CET 2005 Paolo Molaro <lupus@ximian.com>
20376
20377         * appdomain.c, monitor.c, monitor.h, threads-types.h: made the
20378         MonoThreadsSync struct private in monitor.c. Changed the way
20379         MonoThreadsSync is allocated so it's faster and there is no
20380         need to keep track of it with a finalizer and it uses less memory.
20381         This also finally allows us to allocate mono objects as ptrfree when
20382         there are no reference fields.
20383
20384 Fri Feb 4 20:24:03 CET 2005 Paolo Molaro <lupus@ximian.com>
20385
20386         * gc.c, null-gc.c, boehm-gc.c, gc-internal.h: added functions to deal with
20387         disappearing link to the GC interface and use them to simplify
20388         the gchandles code.
20389
20390 2005-02-04  Zoltan Varga  <vargaz@freemail.hu>
20391
20392         * class-internals.h marshal.c: Add two new wrappers, ldfld_remote and
20393         stfld_remote which call mono_load/store_field_new. This allows methods
20394         calling ldfld/stfld wrappers to be AOTed.
20395
20396         * console-io.c: Include sys/filio.h under solaris.
20397         
20398         * console-io.c: Include curses.h if needed correctly.
20399
20400 2005-02-03  Zoltan Varga  <vargaz@freemail.hu>
20401         
20402         * icall.c (ves_icall_MonoMethod_get_base_definition): Initialize
20403         method->klass as well.
20404
20405         * class-internals.h (MonoCachedClassInfo): Add 'finalize_image' field.
20406
20407         * class.c (mono_class_init): Switch on lazy initialization of 
20408         methods.
20409
20410         * class.c (mono_class_get_finalizer): Handle the case when the 
20411         finalizer is inherited.
20412
20413 2005-02-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20414
20415         * console-io.c: <curses.h> is needed by term.h on solaris.
20416
20417 2005-02-03  Ben Maurer  <bmaurer@ximian.com>
20418
20419         * icall.c, class-internals.h, monodiet.c, class.c: Remove
20420         mono_class_setup_properties where possible. Remove this ftn from
20421         the header file, and make it static.
20422
20423 2005-02-03  Zoltan Varga  <vargaz@freemail.hu>
20424
20425         * loader.c: Add missing setup_... call.
20426
20427         * class.c: Add missing setup_... calls.
20428
20429         * class.c (mono_class_init): Switch on lazy initialization of 
20430         the generic vtable.
20431         
20432         * class.c (mono_class_init): Fix generics broken by the recent changes.
20433
20434         * monodiet.c (handle_type): Add missing setup_... calls.
20435
20436         * class.c: Back out garbage in previous patch.
20437         
20438         * class.c: Add missing setup_... calls.
20439
20440         * class.c (mono_class_get_method_from_name_flags): Avoid calling
20441         mono_class_setup_methods () if possible.
20442
20443         * class-internals.h (MonoClass): Add 'has_cctor' flag.
20444
20445         * class-internals.h (MonoCachedClassInfo): New structure.
20446
20447         * class.c: Initialize properties and events fields of MonoClass lazily.
20448
20449         * class.c: Add infrastructure for lazily initializing the methods and
20450         vtable fields of MonoClass. Not yet used.
20451
20452         * class.c (mono_class_get_finalizer): New helper function.
20453
20454         * class.c: Add infrastructure for loading some class related data from
20455         an AOT file.
20456
20457         * object.c: Add infrastructure for initializing the vtable from data
20458         in the AOT file.
20459
20460         * gc.c (run_finalize): Use mono_class_get_finalizer ().
20461
20462         * class.c loader.c object.c icall.c gc.c reflection.c: Call the
20463         appropriate initialization function before accessing parts of the
20464         MonoClass structure.
20465
20466         * marshal.c: Fix warnings.
20467         
20468         * marshal.c (emit_marshal_array): Add missing 'break'. Fixes #72169.
20469
20470         * mono-debug-debugger.c (get_exception_message): Use 
20471         mono_class_get_method_from_name_flags ().
20472
20473 2005-02-02  Ben Maurer  <bmaurer@ximian.com>
20474
20475         * reflection.c, appdomain.c: Replace a few manual searches that
20476         Zoltan missed. (Paolo approved this part of my initial patch).
20477
20478 Wed Feb 2 16:32:08 CET 2005 Paolo Molaro <lupus@ximian.com>
20479
20480         * profiler.c: disable recording statistical events at report time.
20481
20482 Wed Feb 2 14:14:00 CET 2005 Paolo Molaro <lupus@ximian.com>
20483
20484         * icall.c: patch from Geoff Norton <gnorton@customerdna.com>
20485         to byteswap arrays of enum values, too (bug #72080).
20486
20487 2005-02-02  Zoltan Varga  <vargaz@freemail.hu>
20488
20489         * appdomain.c (set_domain_search_path): Allow this to be called if
20490         domain->setup is not yet set.
20491
20492         * loader.c (mono_method_get_index): New helper function.
20493
20494         * loader.c reflection.c: Use mono_method_get_index ().
20495
20496         * class.c (mono_class_get_method_from_name_flags): New helper method.
20497
20498         * debug-helpers.h debug-helpers.c (mono_find_method_by_name): Remove
20499         this.
20500
20501         * class.c (mono_class_get_cctor): New helper method.
20502
20503         * string-icalls.c object.c class.c marshal.c reflection.c: Use
20504         mono_class_get_method () to look up methods.
20505
20506 2005-02-01  Miguel de Icaza  <miguel@novell.com>
20507
20508         * console-io.c: Fix the build, this should work on Windows.
20509
20510 2005-01-31  Ben Maurer  <bmaurer@ximian.com>
20511
20512         * marshal.c (mono_marshal_xdomain_copy_out_value): cached_str must
20513         be set to null to keep things valid
20514
20515 2005-01-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20516
20517         * icall.c: added Console 2.0 icalls.
20518         * Makefile.am: added console-io.[ch]
20519         * console-io.[ch]: internal calls for Console 2.0 API.
20520
20521 Mon Jan 31 19:01:29 CET 2005 Paolo Molaro <lupus@ximian.com>
20522
20523         * class.c: make sure we consider all the interfaces
20524         when calculating max_interface_id (bug found by
20525         Jeroen Frijters running ikvm).
20526
20527 2005-01-31  Zoltan Varga  <vargaz@freemail.hu>
20528
20529         * icall.c (ves_icall_FieldInfo_SetValueInternal): Handle setting of
20530         valuetype fields to null.
20531
20532         * object.c (set_value): Ditto. Fixes #71669.    
20533
20534 2005-01-31  Martin Baulig  <martin@ximian.com>
20535
20536         * metadata.c (mono_metadata_has_generic_params): New public
20537         function; checks whether something is a generic method.
20538
20539 Sun Jan 30 20:19:48 CET 2005 Paolo Molaro <lupus@ximian.com>
20540
20541         * appdomain.c: fix infinite recursion when adding assemblies.
20542
20543 2005-01-30  Sebastien Pouliot  <sebastien@ximian.com>
20544
20545         * object.c: Fix small typo to return all items for Environment.
20546         GetCommandLineArgs.
20547
20548 Sun Jan 30 16:49:01 CET 2005 Paolo Molaro <lupus@ximian.com>
20549
20550         * domain.c, appdomain.c, assembly.c, image.c, domain-internals.h,
20551         reflection.c: more domain and assembly-unload related fixes
20552         and memory leaks plugs.
20553
20554 2005-01-30  Zoltan Varga  <vargaz@freemail.hu>
20555
20556         * 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.
20557
20558 2005-01-29  Ben Maurer  <bmaurer@ximian.com>
20559
20560         * loader.c (mono_method_signature): Make this method lazy
20561         (mono_get_method_from_token): Don't computate the signature here.
20562
20563         Doing this saves quite a bit of memory. I got 90 kb on starting up
20564         monodoc. It should also save some disk reads on startup.
20565
20566         * *: MonoMethod->signature might be NULL now. You *MUST* use
20567         mono_method_signature.
20568
20569 2005-01-29  Zoltan Varga  <vargaz@freemail.hu>
20570
20571         * object.c (mono_runtime_get_main_args): Return an array from the
20572         current domain here. Fixes #71938.
20573
20574 Sat Jan 29 15:59:05 CET 2005 Paolo Molaro <lupus@ximian.com>
20575
20576         * monitor.c: formatting changes to comply with the
20577         mono coding style and remove #ifdefs from the code.
20578
20579 Sat Jan 29 15:18:54 CET 2005 Paolo Molaro <lupus@ximian.com>
20580
20581         * metadata.c, private.h: remove some unneeded data
20582         and use a more compact representation for table schemas.
20583
20584 Fri Jan 28 18:23:44 CET 2005 Paolo Molaro <lupus@ximian.com>
20585
20586         * metadata.c, metadata-internals.h: add mono_aligned_addr_hash()
20587         to get a better distribution in hash tables.
20588         * *.c: use mono_aligned_addr_hash() where appropriate.
20589         * assembly.c: make var static.
20590
20591 2005-01-28  Zoltan Varga  <vargaz@freemail.hu>
20592
20593         * domain-internals.h: Put MonoJitInfo on a diet.
20594
20595         * domain.c: Fix a warning.
20596
20597 Wed Jan 26 22:20:46 CET 2005 Paolo Molaro <lupus@ximian.com>
20598
20599         * gc.c: rework the gc handles code to reuse handles
20600         when freed.
20601
20602 Wed Jan 26 17:34:09 CET 2005 Paolo Molaro <lupus@ximian.com>
20603
20604         * domain.c: fixed long standing bug in mono_string_equal() which
20605         was brought to light with the ldstr changes.
20606
20607 2005-01-26  Sebastien Pouliot  <sebastien@ximian.com>
20608
20609         * reflection.c: Remove warning by adding missing include for marshal.h
20610
20611 Tue Jan 25 18:06:00 CET 2005 Paolo Molaro <lupus@ximian.com>
20612
20613         * domain.c, object.c: change the ldstr_table to hold
20614         MonoString* as keys: makes the runtime isinterned lookup
20615         faster and simplifies memory management.
20616
20617 2005-01-25  Sebastien Pouliot  <sebastien@ximian.com> 
20618  
20619         * icall.c: Renamed GetEnvironmentVariable so internal* so it was
20620         possible to add imperative security checks before calling the icall.
20621         * reflection.c: Return security attributes on the original MonoMethod
20622         (and not the wrapped one). This fix permissions on icalls.
20623
20624 2005-01-25  Dick Porter  <dick@ximian.com>
20625
20626         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Make
20627         the check for mktime() support actually test the mktime() return
20628         value.  "Fixes" bug 71682, though the output is still different to
20629         MS.
20630
20631 2005-01-25  Martin Baulig  <martin@ximian.com>
20632
20633         * class.c (mono_class_is_assignable_from): Make this work for
20634         generic instances.
20635
20636 2005-01-24  Ben Maurer  <bmaurer@ximian.com>
20637
20638         * marshal.c (mono_string_utf8_to_builder)
20639         (mono_string_builder_to_utf16): We might not have ownership of the
20640         string. In thise case, we need to create a new buffer.
20641
20642         * object-internals.h (mono_stringbuilder_capacity): sb->str might
20643         be null, in which case, use the default capacity.
20644
20645 Mon Jan 24 16:42:29 CET 2005 Paolo Molaro <lupus@ximian.com>
20646
20647         * gc-internal.h, null-gc.c, profiler.c, boehm-gc.c: hook the
20648         GC events to the profiler.
20649
20650 Mon Jan 24 15:59:54 CET 2005 Paolo Molaro <lupus@ximian.com>
20651
20652         * gc.c: remove valgrind detection nonsense. Set GC_DONT_GC
20653         if you don't want the GC to run.
20654
20655 Mon Jan 24 15:53:25 CET 2005 Paolo Molaro <lupus@ximian.com>
20656
20657         * Makefile.am, gc.c, mono-gc.h, boehm-gc.c, null-gc.c, gc-internal.h:
20658         start providing a GC API and keeping different implementations in
20659         their own file.
20660         * profiler.h, profiler.c, profiler-private.h: provide the GC events API.
20661
20662 2005-01-22  Ben Maurer  <bmaurer@ximian.com>
20663
20664         * debug-mono-symfile.c (mono_debug_open_mono_symbol_file): Use
20665         mmap rather than allocating a huge buffer.
20666         (mono_debug_close_mono_symbol_file): Free the buffer allocated
20667         above.
20668
20669 2005-01-22  Sebastien Pouliot  <sebastien@ximian.com>
20670
20671         * icall.c: Add new internal calls for SecurityManager.SecurityEnabled
20672         and CheckExecutionRights.
20673         * reflection.c|h: Keep the index of the declarative security to be 
20674         used, instead of the pointer, when AOT compiler is used. Also add 
20675         class initialization when requesting demands.
20676         * security-manager.c|h: Implement SecurityManager.SecurityEnabled and
20677         CheckExecutionRights. Both properties are now FALSE by default, and
20678         unmodifiable, unless the --security option is used.
20679
20680 Fri Jan 21 15:29:27 CET 2005 Paolo Molaro <lupus@ximian.com>
20681
20682         * domain.c, appdomain.c, assembly.c, image.c, metadata-internals.h,
20683         reflection.c: properly refcount images and assemblies, many leaks fixed.
20684
20685 2005-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20686
20687         * threadpool.c: increase the timeout for threads in the thread pool to
20688         10s.  Fixes bug #67159.
20689
20690 2005-01-20  Bernie Solomon  <bernard@ugsolutions.com>
20691
20692         * class-internals.h: Sun's compiler insists on explicit
20693         signed on bit fields to handle then correctly.
20694
20695 2005-01-19  Miguel de Icaza  <miguel@ximian.com>
20696
20697         * file-io.c (ves_icall_System_IO_MonoIO_get_InvalidPathChars):
20698         Make the size of the array fit only the number of invalid path
20699         chars that we have.
20700
20701         * class.c (_mono_class_get): Improve the error reporting when a
20702         class referenced is not found, to assist debugging. 
20703
20704 Wed Jan 19 19:57:43 CET 2005 Paolo Molaro <lupus@ximian.com>
20705
20706         * threads.c: fix off-by-one error.
20707         * domain.c: free data allocated in the domain.
20708
20709 2005-01-19  Zoltan Varga  <vargaz@freemail.hu>
20710
20711         * reflection.c (mono_method_body_get_object): Fill out exception info
20712         as well.
20713
20714         * object-internals.h: Add MonoReflectionExceptionHandlingClause 
20715         structure.
20716         
20717 2005-01-19  Martin Baulig  <martin@ximian.com>
20718
20719         * loader.c (mono_get_method_constrained): Make this work again.
20720
20721 2005-01-19  Zoltan Varga  <vargaz@freemail.hu>
20722
20723         * object-internals.h (_MonoReflectionMethodBody): Make local_index a 
20724         guint16 to match the managed side.
20725
20726         * reflection.c (mono_reflection_body_get_object): Fill out local
20727         variables array.
20728
20729         * reflection.c (mono_method_body_get_object): Fill out local_var_sig_token
20730         as well.
20731
20732         * object-internals.h (_MonoReflectionMethodBody): Rename 'sig_token' to
20733         'local_var_sig_token'.
20734
20735 2005-01-18  Zoltan Varga  <vargaz@freemail.hu>
20736
20737         * loader.c (mono_lookup_pinvoke_call): Revert the previous patch as it breaks 
20738         System.Drawing.
20739
20740         * reflection.c (mono_method_body_get_object): Handle abstract and
20741         runtime methods.
20742
20743 Mon Jan 17 19:22:39 CET 2005 Paolo Molaro <lupus@ximian.com>
20744
20745         * marshal.c, loader.c, class-internals.h, reflection.c:
20746         store the emthod data for a wrapper in an array instead of a list.
20747
20748 Mon Jan 17 18:48:53 CET 2005 Paolo Molaro <lupus@ximian.com>
20749
20750         * marshal.c: change the code to allocate memory more
20751         conservatively for method wrappers.
20752
20753 Mon Jan 17 18:03:30 CET 2005 Paolo Molaro <lupus@ximian.com>
20754
20755         * class-internals.h, marshal.c: move the str_to_ptr and ptr_to_str
20756         fields from MonoClass to the marshal info structure where they belong.
20757
20758 Mon Jan 17 16:14:46 CET 2005 Paolo Molaro <lupus@ximian.com>
20759
20760         * class.c, object.c, class-internals.h, marshal.c: rearrange
20761         some fields and tweak some types to lower memory usage.
20762
20763 2005-01-17  Zoltan Varga  <vargaz@freemail.hu>
20764
20765         * threads.c (signal_thread_state_change): Handle the case when the
20766         target thread is the current thread.
20767
20768         * marshal.c (mono_struct_delete_old): Do not free lpwstr fields.
20769
20770         * marshal.c: Rename emit_ptr_to_str_conv and its pair to 
20771         emit_ptr_to_object_conv. 
20772
20773         * marshal.c (emit_ptr_to_object_conv): Add support for lpwstr->str
20774         marshalling. Fixes #71352.
20775
20776 Mon Jan 17 10:59:20 CET 2005 Paolo Molaro <lupus@ximian.com>
20777
20778         * metadata.h, blob.h: move table enum to blob.h so it can be included
20779         in any header.
20780         * image.c, metadata.c, metadata-internals.h, pedump.c, reflection.c:
20781         cut the size of MonoImage/MonoDynamicImage.
20782
20783 2005-01-16  Zoltan Varga  <vargaz@freemail.hu>
20784
20785         * profiler.c (mono_profiler_install_simple): Fix default arguments.
20786
20787 Sun Jan 16 12:25:22 CET 2005 Paolo Molaro <lupus@ximian.com>
20788
20789         * reflection.c, reflection.h, icall.c: add a function to check
20790         if an attribute type is defined for a metadata object.
20791
20792 2005-01-14  Lluis Sanchez Gual  <lluis@novell.com>
20793
20794         * object-internals.h: Added some needed fields from StringBuilder class.
20795         * marshal.c: Set the maxCapacity when creating a StringBuilder.
20796
20797 2005-01-13  Zoltan Varga  <vargaz@freemail.hu>
20798
20799         * icall.c (ves_icall_System_Environment_Exit): Suspend all managed
20800         threads before shutting down the runtime.
20801
20802         * threads.c (mono_thread_suspend_all_other_threads): New helper function.
20803
20804 Thu Jan 13 18:16:35 CET 2005 Paolo Molaro <lupus@ximian.com>
20805
20806         * object-internal.h, threads.c: implement stacksize and 
20807         parameterized thread start functionality (requires
20808         matching corlib). Marked broken code for later removal.
20809
20810 2005-01-12  Martin Baulig  <martin@ximian.com>
20811
20812         * class-internals.h (MonoGenericClass): Moved the `initialized'
20813         flag to MonoDynamicGenericClass, removed `init_pending'.
20814         (MonoGenericInst): Added `is_reference' flag.
20815
20816 2005-01-12  Zoltan Varga  <vargaz@freemail.hu>
20817
20818         * reflection.c (mono_image_create_pefile): Only set the pe_offset
20819         inside the MSDOS header. Fixes #71201.
20820
20821         * gc.c (mono_gc_cleanup): Handle the case when this is called from the
20822         gc thread.
20823         (mono_domain_finalize): Ditto.
20824
20825 2005-01-12  Martin Baulig  <martin@ximian.com>
20826
20827         * class.c (mono_get_shared_generic_class): Use the cache for
20828         non-dynamic generic classes.
20829
20830         * class-internals.h (mono_class_create_generic_2): Removed
20831         function prototype, this function is now static inside class.c.
20832
20833         * class.c (mono_class_create_generic_2): Made this static, only
20834         call it from mono_class_init() and mono_class_setup_parent().
20835         (collect_implemented_interfaces_aux): Call mono_class_init() on
20836         the interfaces we collect.
20837         (mono_class_setup_vtable): Call mono_class_init (class->parent).
20838
20839 2005-01-11  Zoltan Varga  <vargaz@freemail.hu>
20840
20841         * threads.c (mono_thread_attach): Call DuplicateHandle on the thread handle on win32 to make
20842         it a real thread handle.
20843
20844         * domain-internals.h: Move exvar_offset from MonoJitInfo to 
20845         MonoJitExceptionInfo, since each catch clause needs its own variable.
20846         
20847 2005-01-11  Dick Porter  <dick@ximian.com>
20848
20849         * image.c (mono_pe_file_open): New variant on mono_image_open()
20850         that does not set up the CLI metadata; used for FileVersionInfo so
20851         it can get the data for windows binaries too.
20852         
20853         * process.c (process_read_string_block): Don't read off the end of
20854         the StringTable block.
20855
20856         These both fix bug 70766.
20857
20858 Tue Jan 11 15:26:00 CET 2005 Paolo Molaro <lupus@ximian.comt>
20859
20860         * gc.c: set some fields to NULL at GC cleanup time.
20861         * threads.c: if we quit the main thread, call exit ().
20862
20863 2005-01-11  Zoltan Varga  <vargaz@freemail.hu>
20864
20865         * threads.c (interruption_request_apc): Decore APC callbacks with CALLBACK under win32.
20866
20867 Mon Jan 10 18:47:28 CET 2005 Paolo Molaro <lupus@ximian.com>
20868
20869         * threads.h, threads.c, object.c: added accessor and settor for
20870         main_thread. Handle it specially when exiting from it: wait
20871         for other foreground threads to exit.
20872
20873 Mon Jan 10 12:06:18 CET 2005 Paolo Molaro <lupus@ximian.com>
20874
20875         * process.c, verify.c: remove some bloat.
20876
20877 2005-01-09  Zoltan Varga  <vargaz@freemail.hu>
20878
20879         * loader.c (mono_lookup_pinvoke_call): If we found the function without name mangling, change
20880         the calling convention to cdecl under win32.
20881
20882 2005-01-08  Ben Maurer  <bmaurer@ximian.com>
20883
20884         * object.c (mono_object_get_size): New function to get the size of
20885         an object instance.
20886
20887         * profiler.c (simple_allocation): Use above.
20888
20889 2005-01-08  Sebastien Pouliot  <sebastien@ximian.com>
20890
20891         * appdomain.c: Replaced ves_icall_System_AppDomain_getDomainByID by
20892         ves_icall_System_AppDomain_getRootDomain (as it's not required to
20893         get an appdomain by it's id and we can't assume the root's id is 0).
20894         * domain-internals.h: Change the function prototype to match.
20895         * icall.c: Change the icall table for AppDomain.
20896
20897 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
20898
20899         * locales.c (string_invariant_compare_char): Only compute
20900         GUnicodeTypes in the case where we need them.  Test for ordinality
20901         first and return if so.
20902
20903         From the commit:
20904
20905                 /*
20906                  * FIXME: here we must use the information from c1type and c2type
20907                  * to find out the proper collation, even on the InvariantCulture, the
20908                  * sorting is not done by computing the unicode values, but their
20909                  * actual sort order.
20910                  */
20911
20912 Sat Jan 8 19:03:26 CET 2005 Paolo Molaro <lupus@ximian.com>
20913
20914         * loader.c: for P/Invoke methods, allow the "Internal" shared
20915         library name to refer to the calling process symbol namespace.
20916
20917 2005-01-07  Sebastien Pouliot  <sebastien@ximian.com>
20918
20919         * Makefile.am: Add the security manager to the build.
20920         * security-manager.c|h: New. Initialization of the security manager.
20921
20922 2005-01-07  Dick Porter  <dick@ximian.com>
20923
20924         * threads.c: 
20925         * monitor.c: Update thread state during Monitor and WaitHandle
20926         waits.  Fixes bug 71031.
20927
20928 2005-01-07  Zoltan Varga  <vargaz@freemail.hu>
20929
20930         * reflection.c (property_encode_signature): Correctly handle when the
20931         property has no methods.
20932
20933 2005-01-06  Zoltan Varga  <vargaz@freemail.hu>
20934
20935         * reflection.c (reflection_methodbuilder_to_mono_method): Remove debug stuff.
20936         
20937         * reflection.c (reflection_methodbuilder_from_method_builder): Copy
20938         fields from mb, not rmb. Fixes #71017.
20939
20940         * marshal.c (emit_ptr_to_str_conv): Add support for 
20941         ByValTStr -> string conversion. Fixes #71015.
20942
20943         * appdomain.c (mono_domain_owns_vtable_slot): New helper function.
20944
20945         * mempool.c (mono_mempool_contains_addr): New helper function.
20946
20947 2005-01-05  Zoltan Varga  <vargaz@freemail.hu>
20948
20949         * metadata.c (mono_metadata_compute_size): Fix size calculation of
20950         HasSematics encoded fields.
20951         
20952         * metadata.c (mono_type_to_unmanaged): Improve error message for 
20953         invalid string marshalling.
20954
20955         * metadata.c: Fix warnings.
20956         
20957 Wed Jan 5 16:17:27 CET 2005 Paolo Molaro <lupus@ximian.com>
20958
20959         * profiler-private.h, profiler.c, profiler.h, gc.c: sample statistical
20960         profiler support.
20961
20962 2005-01-05  Zoltan Varga  <vargaz@freemail.hu>
20963
20964         * domain.c object.c domain-internals.h: Revert part of r38077 since the
20965         keys to proxy_vtable_hash are GCd objects. Fixes running the class lib
20966         tests.
20967
20968 2005-01-03  Zoltan Varga  <vargaz@freemail.hu>
20969
20970         * marshal.c: Use MONO_CLASSCONST instead of MONO_LDPTR in some places,
20971         so methods containing these can be AOTed.
20972
20973 2005-01-03  Martin Baulig  <martin@ximian.com>
20974
20975         * loader.c (find_method): Removed the hack for generic instances.
20976         (method_from_memberref): If our parent is a generic instance, pass
20977         its generic type definition to find_method() and then inflate the
20978         method.
20979         (mono_get_method_constrained): Pass the generic type definition to
20980         find_method() and inflate the method later.
20981
20982         * class-internals.h (MonoStats): Added `generic_class_count'.
20983
20984         * icall.c (ves_icall_MonoGenericMethod_get_reflected_type):
20985         Renamed to ves_icall_MonoGenericMethod_get_ReflectedType().
20986
20987         * reflection.c (mono_custom_attrs_from_params): Don't ignore
20988         generic type definitions.
20989
20990 2004-12-30  Zoltan Varga  <vargaz@freemail.hu>
20991
20992         * loader.c icall.c: Fix warnings.
20993
20994 2004-12-29  Zoltan Varga  <vargaz@freemail.hu>
20995
20996         * marshal.c (mono_marshal_get_managed_wrapper): Fix returning of
20997         blittable types. Fixes #70864.
20998
20999 2004-12-29  Martin Baulig  <martin@ximian.com>
21000
21001         * icall.c
21002         (ves_icall_MonoGenericMethod_get_reflected_type): New interncall.
21003
21004         * reflection.c (mono_method_get_object): Create a
21005         "System.Reflection.MonoGenericMethod" for inflated methods; don't
21006         call mono_get_inflated_method().
21007
21008         * class-internals.h (MonoStats): Added `inflated_method_count_2'.
21009
21010 2004-12-27  Martin Baulig  <martin@ximian.com>
21011
21012         * class-internals.h (MonoMethod): Added `is_inflated' flag.
21013         (MonoMethodInflated): Added `inflated' field.
21014
21015         * class.c (mono_class_inflate_generic_method): Don't really
21016         inflate the method here; just set the `is_inflated' flag in the
21017         MonoMethod.
21018         (mono_class_get_inflated_method): Actually inflate the method here
21019         if it's not already inflated; we use the MonoMethodInflated's new
21020         `inflated' field as a cache.
21021
21022 2004-12-26  Martin Baulig  <martin@ximian.com>
21023
21024         * class.c
21025         (inflate_generic_class): Moved some code out of inflate_generic_type().
21026         (mono_class_inflate_generic_method): If we're already inflated,
21027         inflate the context and use the declaring method; ie. make sure
21028         the declaring method of an inflated method is always the generic
21029         method definition.
21030         (mono_class_create_from_typedef): Create
21031         `class->generic_container->context->gclass'.
21032
21033 2004-12-24  Ben Maurer  <bmaurer@ximian.com>
21034
21035         * metadata-internals.h, marshal.c, reflection.c: More
21036         MonoGHashTable->GHashTable.
21037
21038         * domain-internals.h, class.c: Change MonoGHashTable's into
21039         GHashTables for some cases where no gc stuff is used
21040
21041         All users: update apis
21042
21043 2004-12-23  Ben Maurer  <bmaurer@ximian.com>
21044
21045         * metadata.c (builtin_types): Make this `const'. Makes this get
21046         put into the shareable section.
21047         (mono_metadata_init): Casts to make gcc happy.
21048
21049 2004-12-22  Zoltan Varga  <vargaz@freemail.hu>
21050
21051         * gc.c (mono_gc_init): Add a '\n' to the valgrind warning.
21052
21053 2004-12-21  Sebastien Pouliot  <sebastien@ximian.com> 
21054
21055         * icall.c: Added an internal call to retrieve the position and length
21056         of assembly-level declarative security attributes (RequestMinimum, 
21057         RequestOptional and RequestRefuse). This is used by the Assembly class
21058         to re-create the corresponding permission sets.
21059
21060 Tue Dec 21 14:50:31 CET 2004 Paolo Molaro <lupus@ximian.com>
21061
21062         * marshal.c: fix the stelemref wrapper to be type correct
21063         (and faster).
21064
21065 2004-12-20  Ben Maurer  <bmaurer@ximian.com>
21066
21067         * icall.c (ves_icall_System_Object_GetHashCode): There was no need
21068         to do key & 0x7fffffff. Hashtable already does this. It just
21069         results in longer code.
21070
21071 2004-12-20  Sebastien Pouliot  <sebastien@ximian.com>
21072
21073         * appdomain.c: Bump corlib version.
21074         * class-internals.h: Added RuntimeSecurityFrame to mono_defaults.
21075         * domain.c: Add RuntimeSecurityFrame to mono_defaults.
21076         * reflection.c|h: Add functions to get declarative security infos
21077         (blob position and length) for assemblies, classes and methods.
21078
21079 Mon Dec 20 15:28:54 CET 2004 Paolo Molaro <lupus@ximian.com>
21080
21081         * reflection.c: sort the constant table (bug #70693).
21082
21083 Mon Dec 20 12:19:37 CET 2004 Paolo Molaro <lupus@ximian.com>
21084
21085         * object-internals.h, threads.c, domain.c: add accessors for
21086         the MonoThread and MonoDomain tls keys.
21087
21088 2004-12-18  Martin Baulig  <martin@ximian.com>
21089
21090         * class.c (inflate_generic_type): If we're inflating a generic
21091         instance, set `ngclass->context->container = context->container';
21092         ie. the container we inflated into.
21093
21094         * metadata.c (mono_metadata_parse_generic_param): Reflect above
21095         inflate_generic_type() changes.
21096
21097 2004-12-17  Martin Baulig  <martin@ximian.com>
21098
21099         * class-internals.h
21100         (MonoGenericClass): Replaced `MonoType *generic_type' with
21101         `MonoClass *generic_class'.  Removed `dynamic_info'; if
21102         `is_dynamic' is true, we're a `MonoDynamicGenericClass'.
21103         (MonoDynamicGenericClass): Derive from `MonoGenericClass'.
21104
21105 2004-12-16  Zoltan Varga  <vargaz@freemail.hu>
21106
21107         * exception.c (mono_exception_from_token): New helper function.
21108
21109 2004-12-15  Zoltan Varga  <vargaz@freemail.hu>
21110
21111         * assembly.c (mono_assembly_load_with_partial_name): Call 
21112         mono_assembly_loaded before invoking the preload hooks. Fixes
21113         #70564.
21114
21115         * object-internals.h (MonoThread): Change culture_info and 
21116         ui_culture_info into an array.
21117
21118         * threads.c: Cache culture info objects from more than one appdomain.
21119
21120         * threads.c threads-types.h icall.c: Add icalls for manipulating the 
21121         current UI culture.
21122
21123 2004-12-14  Zoltan Varga  <vargaz@freemail.hu>
21124
21125         * threads.h threads.c appdomain.c: Clear the culture_info field of
21126         all threads during unloading if they point to an object in the dying
21127         appdomain.
21128
21129 2004-12-13  Ben Maurer  <bmaurer@ximian.com>
21130
21131         * culture-info.h (TextInfoEntry): New struct
21132         * object-internals.h: sync with managed
21133         * locales.c: fill the `text_info_data' field
21134         * culture-info-tables.h: update
21135
21136 Mon Dec 13 18:10:50 CET 2004 Paolo Molaro <lupus@ximian.com>
21137
21138         * Makefile.am, monodiet.c: add monodiet, an IL code garbage
21139         collector.
21140
21141 2004-12-12  Ben Maurer  <bmaurer@ximian.com>
21142
21143         * icall.c (ves_icall_ModuleBuilder_getToken): Check for null
21144         (ves_icall_ModuleBuilder_getMethodToken): Ditto
21145
21146 2004-12-12  Martin Baulig  <martin@ximian.com>
21147
21148         * mono-debug-debugger.c (write_type): If we're an enum and the
21149         builtin types have already been initialized, call mono_class_init().
21150
21151 2004-12-11  Martin Baulig  <martin@ximian.com>
21152
21153         * metadata.c (mono_metadata_load_generic_params): Added
21154         `MonoGenericContainer *parent_container' argument; automatically
21155         compute `container->is_method'; pass the correct owner to
21156         get_constraints().      
21157
21158         * reflection.c (compare_genericparam): Sort the GenericParam table
21159         according to increasing owners. 
21160
21161 Fri Dec 10 18:43:46 CET 2004 Paolo Molaro <lupus@ximian.com>
21162
21163         * profiler.c: allow disabling the default profiler.
21164
21165 Fri Dec 10 18:42:11 CET 2004 Paolo Molaro <lupus@ximian.com>
21166
21167         * decimal.c, icall.c: allow disabling System.Decimal support.
21168
21169 2004-12-09  Marek Safar <marek.safar@seznam.cz>
21170
21171         * reflection.c: Add support for null attribute arguments.
21172
21173 2004-12-09  Martin Baulig  <martin@ximian.com>
21174
21175         * metadata.h, loader.h: Use `idx' instead of `index' in parameter
21176         names to get rid of compiler warnings.
21177
21178 2004-12-08  Zoltan Varga  <vargaz@freemail.hu>
21179
21180         * marshal.c (mono_marshal_get_struct_to_ptr): Call 
21181         mono_marshal_load_type_info (). Fixes #69625.
21182         (mono_marshal_get_ptr_to_struct): Likewise.
21183
21184 2004-12-08  Martin Baulig  <martin@ximian.com>
21185
21186         * mono-debug.h: Bumped version number to 47.
21187
21188         * mono-debug-debugger.c
21189         (mono_debugger_event_handler, mono_debugger_event): Take two
21190         guint64 arguments insteed of a gpointer and a guint32.  
21191
21192 2004-12-08  Martin Baulig  <martin@ximian.com>
21193
21194         * debug-mono-symfile.h
21195         (MonoDebugLineNumberEntry): Renamed `offset' to `il_offset' and
21196         `address' to `native_offset'.
21197
21198 2004-12-08  Martin Baulig  <martin@ximian.com>
21199
21200         * class.c (mono_class_create_from_typespec): Only inflate if we
21201         either have `context->gclass' or `context->gmethod'.
21202
21203 2004-12-08  Zoltan Varga  <vargaz@freemail.hu>
21204
21205         * metadata-internals.h (MonoAssembly): Add 'corlib_internal' field.
21206
21207         * object-internals.h (MonoReflectionAssemblyBuilder): Move 'corlib_internal' field from Assembly to AssemblyBuilder.
21208
21209         * reflection.c (mono_image_basic_init): Initialize assembly->corlib_internal from the assembly builder.
21210
21211         * reflection.c (mono_assembly_get_object): Remove the workaround put
21212         in for the release.
21213         
21214         * appdomain.c: Use the corlib_internal field from MonoAssembly.
21215
21216         * appdomain.c: Bump corlib version.
21217
21218         * reflection.c (mono_assembly_get_object): Add a workaround so __MetadataTypes won't
21219         be visible in other appdomains.
21220
21221 2004-12-07  Ben Maurer  <bmaurer@ximian.com>
21222
21223         * threads.c: Interlocked inc and dec for longs were messed up,
21224         use a KISS based impl for this. Fixes 70234
21225
21226 2004-12-07  Zoltan Varga  <vargaz@freemail.hu>
21227
21228         * threads.c (ves_icall_System_Threading_Thread_GetCachedCurrentCulture): Make this lock-less.
21229
21230 Tue Dec 7 10:47:09 CET 2004 Paolo Molaro <lupus@ximian.com>
21231
21232         * icall.c: fix to follow policy not to allow struct
21233         arguments in icalls.
21234
21235 2004-12-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21236
21237         * process.c: make the patch that handles spaces in file paths work
21238         on mono/windows too.
21239
21240 2004-12-06  Martin Baulig  <martin@ximian.com>
21241
21242         * class.c (mono_class_create_generic): Call
21243         mono_class_setup_supertypes() if we're dynamic.
21244         (mono_class_is_subclass_of): `g_assert (klass->idepth > 0)'.
21245
21246 2004-12-06  Zoltan Varga  <vargaz@freemail.hu>
21247
21248         * object-internals.h: Add new fields to MonoThread.
21249
21250         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
21251
21252         * icall.c threads-types.h threads.c: Add new icalls.
21253
21254         * object-internals.h (MonoThread): Remove unused 'unmanaged' field.
21255
21256         * object-internals.h (MonoReflectionAssembly): Sync object layout with
21257         managed side.
21258
21259         * appdomain.c: Bump corlib version.
21260
21261         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Skip
21262         internal assemblies. Fixes #69181.
21263
21264 2004-12-05  Martin Baulig  <martin@ximian.com>
21265
21266         * class.c (mono_class_inflate_generic_signature): Make this a
21267         no-op if `context' is NULL or we don't have any type parameters;
21268         also copy `sentinelpos'.        
21269
21270 2004-12-04  Zoltan Varga  <vargaz@freemail.hu>
21271
21272         * image.c: Add unbox_wrapper_cache.
21273
21274         * class-internals.h debug-helpers.c: Add MONO_WRAPPER_UNBOX.
21275
21276         * marshal.h marshal.c (mono_marshal_get_unbox_wrapper): New wrapper
21277         function generator.
21278         
21279         * object.c (mono_delegate_ctor): Call unbox wrapper if neccesary.
21280         Fixes #70173.
21281
21282         * metadata-internals.h image.c: Add MonoImage->unbox_wrapper_cache.
21283         
21284 2004-12-04  Martin Baulig  <martin@ximian.com>
21285
21286         * loader.c (mono_method_get_signature_full): New public function;
21287         like mono_method_get_signature(), but with an additional
21288         `MonoGenericContext *' argument.
21289
21290         * class.c (mono_class_inflate_generic_signature): Formerly known
21291         as inflate_generic_signature(); make this public.
21292
21293 2004-12-04  Martin Baulig  <martin@ximian.com>
21294
21295         * metadata.c
21296         (mono_metadata_parse_type_full): Take a `MonoGenericContext *'
21297         instead of a `MonoGenericContainer *'.  
21298         (mono_metadata_parse_array_full): Likewise.
21299         (mono_metadata_parse_signature_full): Likewise.
21300         (mono_metadata_parse_method_signature_full): Likewise.
21301         (mono_metadata_parse_generic_inst): Likewise.
21302         (mono_metadata_parse_generic_param): Likewise.
21303         (mono_metadata_parse_mh_full): Likewise.
21304         (mono_type_create_from_typespec_full): Likewise.
21305
21306 2004-12-03  Martin Baulig  <martin@ximian.com>
21307
21308         * class-internals.h (MonoGenericContainer): Replaced the
21309         `MonoGenericContext * pointer with a `MonoGenericContext'
21310         structure and made it the first element.
21311
21312 2004-12-03  Martin Baulig  <martin@ximian.com>
21313
21314         * class.c
21315         (inflate_generic_type): Set the `context->container' when creating
21316         a new MonoGenericContext.
21317         (mono_class_inflate_generic_method): Likewise.
21318         (mono_class_create_from_typespec): Just use `context->container'
21319         to get the container.
21320
21321         * loader.c (method_from_methodspec): Set `context->parent' from
21322         `context->container' - and if that's a method container, use its
21323         parent.  Also set the `context->container' when creating a new
21324         MonoGenericContext.
21325         (mono_get_method_from_token): Use just `context->container' to get
21326         the container.
21327
21328         * metadata.c (do_mono_metadata_parse_generic_class): Also set
21329         `gclass->context->container'.
21330
21331         * reflection.c (do_mono_reflection_bind_generic_parameters): Set
21332         the `context->container' when creating a new MonoGenericContext.
21333
21334 2004-12-03  Zoltan Varga  <vargaz@freemail.hu>
21335
21336         * reflection.c (compare_genericparam): Sort params with identical
21337         owner by their number. Fixes gen-111 on sparc.
21338
21339 2004-12-02  Zoltan Varga  <vargaz@freemail.hu>
21340
21341         * threadpool.c (async_invoke_thread): Call push/pop_appdomain_ref
21342         around the domain changes.
21343
21344         * appdomain.c (mono_domain_unload): Handle the case when the thread
21345         calling Unload is itself being aborted during unloading. Fixes #70022.
21346
21347         * appdomain.h: Add prototype for mono_install_runtime_cleanup.
21348
21349         * marshal.c (emit_thread_interrupt_checkpoint_call): Call 
21350         checkpoint_func as an icall so it gets a wrapper.
21351         (mono_marshal_get_xappdomain_invoke): Call push/pop_appdomain_ref ()
21352         in the cross-appdomain wrappers too.
21353
21354         * threads.c (mono_thread_has_appdomain_ref): Make this public.
21355
21356         * assembly.c (mono_assembly_open_from_bundle): Fix warning.
21357
21358         * reflection.c: Fix some memory leaks.
21359         
21360 2004-12-02  Martin Baulig  <martin@ximian.com>
21361
21362         * metadata-internals.h (MonoImage): Removed `generic_class_cache'.
21363
21364         * metadata.c (generic_class_cache): New static hashtable.
21365         (mono_metadata_lookup_generic_class): New public method.
21366
21367 2004-12-02  Martin Baulig  <martin@ximian.com>
21368
21369         * class.c (mono_class_create_from_typedef): Call
21370         mono_class_setup_parent() and mono_class_create_mono_type() before
21371         parsing the interfaces.
21372
21373 2004-12-02  Martin Baulig  <martin@ximian.com>
21374
21375         * metadata.c (generic_inst_cache): New static hashtable.
21376         (mono_metadata_lookup_generic_inst): New public function.
21377         (mono_metadata_inflate_generic_inst): New public function.
21378         (mono_metadata_parse_generic_inst): New public function.
21379         (do_mono_metadata_parse_generic_class): Use the new
21380         mono_metadata_parse_generic_inst() for parsing the `gclass->inst'
21381         since this'll also use the cache.
21382
21383         * reflection.c (mono_reflection_bind_generic_method_parameters):
21384         Use mono_metadata_lookup_generic_inst() to use the new cache.
21385
21386         * class.c (inflate_mono_type): Use
21387         mono_metadata_inflate_generic_inst() to inflate a generic
21388         instance; this'll also use the new cache.
21389
21390         * loader.c (method_from_methodspec): Use
21391         mono_metadata_parse_generic_inst() and
21392         mono_metadata_inflate_generic_inst() rather than parsing it
21393         manually, so we can use the new cache.
21394
21395 2004-12-02  Zoltan Varga  <vargaz@freemail.hu>
21396
21397         * threads.c (wait_for_tids): Do not incorrectly free threads when 
21398         the wait times out.
21399
21400 2004-12-01  Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
21401
21402         * icall.c (mono_ArgIterator_Setup) : Conditionally compile calculation of
21403         iter->args based on whether parameters are passed in registers (i.e.
21404         MONO_ARCH_REGPARMS is defined)
21405
21406 2004-12-01  Zoltan Varga  <vargaz@freemail.hu>
21407
21408         * loader.c (mono_lookup_pinvoke_call): Use the remapped dll name in
21409         the exception message. Fixes #70070.
21410         (method_from_methodspec): Fix warnings.
21411
21412 2004-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21413
21414         * process.c: (complete_path) return the path quoted
21415
21416 2004-12-01  Martin Baulig  <martin@ximian.com>
21417
21418         * class-internals.h (MonoGenericInst): New structure.
21419         (MonoGenericClass): Replaced `type_argc', `type_argv' and
21420         `is_open' with `MonoGenericInst *inst'.
21421         (MonoGenericMethod): Replaced `mtype_argc', `mtype_argv' and
21422         `is_open' with `MonoGenericInst *inst'.
21423
21424 2004-11-30  Martin Baulig  <martin@ximian.com>
21425
21426         Generics API cleanup: renamed MonoGenericInst -> MonoGenericClass.
21427
21428         * metadata-internals.h (MonoImage): Renamed `generic_inst_cache'
21429         to `generic_class_cache'.
21430
21431         * metadata.c
21432         (mono_generic_inst_hash): Renamed to mono_generic_class_hash().
21433         (mono_generic_inst_equal): Renamed to mono_generic_class_equal().
21434         (mono_generic_inst_is_valuetype): Renamed to
21435         mono_generic_class_is_valuetype().
21436
21437         * class-internals.h
21438         (MonoGenericInst): Renamed to MonoGenericClass.
21439         (MonoDynamicGenericInst): Renamed to MonoDynamicGenericClass.
21440         (MonoClass): Renamed `generic_inst' to `generic_class'.
21441         (MonoGenericContext): Renamed `ginst' to `gclass'.
21442
21443         * object-internals.h
21444         (MonoReflectionGenericInst): Renamed to MonoReflectionGenericClass.
21445
21446         * reflection.c (mono_reflection_generic_inst_initialize): Renamed to
21447         mono_reflection_generic_class_initialize().
21448
21449         * icall.c (icall_entries): "System.Reflection.MonoGenericInst" is
21450         now known as "System.Reflection.MonoGenericClass".
21451         (monogenericinst_icalls): Renamed to monogenericclass_icalls.
21452
21453 2004-11-29  Sebastien Pouliot  <sebastien@ximian.com>
21454
21455         * class-internals.h: Added a flag field to MonoClass to cache the
21456         declarative security attributes actions associated with the class.
21457         * domain-internals.h: Added booleans to MonoJitInfo to cache the
21458         (class or method level) stack modifiers (Assert, Deny and PermitOnly)
21459         applicable to the JITted method.
21460         * reflection.c|h: Added functions to extract (as flags) which security
21461         actions are available (declaratively) for a method, class or assembly.
21462         * metadata.c|h: Added functions to search the declarative security
21463         table in the metadata.
21464         
21465 2004-11-29  Ben Maurer  <bmaurer@ximian.com>
21466
21467         * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces):
21468         EXPORTEDTYPES are already in the class name cache, so there is no
21469         need to add extra code here to look at them. Just removes a bit of
21470         cruft.
21471
21472         (ves_icall_System_Environment_get_TickCount): No need for #if
21473         WINDOWS. We already have the code in io-layer.
21474
21475 2004-11-28  Martin Baulig  <martin@ximian.com>
21476
21477         * loader.c
21478         (method_from_methodspec): Also inflate the `gmethod->mtype_argv'.
21479         Fixes gen-112.cs.
21480
21481 2004-11-27  Miguel de Icaza  <miguel@ximian.com>
21482
21483         * assembly.c (do_mono_assembly_open): Instead of having a
21484         conditional WITH_BUNDLE, incorporate support for bundles here, by
21485         having a global `bundles' variable holding a pointer to the actual
21486         bundles. 
21487
21488         (mono_register_bundled_assemblies): New API call used by the
21489         bundle code. 
21490
21491         See mkbundle.1 for details.
21492         
21493 2004-11-27  Martin Baulig  <martin@ximian.com>
21494
21495         * object.c (mono_class_vtable): Store the `MonoMethod *' itself in
21496         the vtable for generic methods.
21497
21498 2004-11-26  Martin Baulig  <martin@ximian.com>
21499
21500         * metadata.c
21501         (mono_metadata_generic_method_hash): New public function.
21502         (mono_metadata_generic_method_equal): Likewise.
21503
21504         * class-internals.h
21505         (MonoGenericContainer): Added `GHashTable *method_hash'.
21506
21507         * reflection.c (ReflectionMethodBuilder): Added
21508         `MonoGenericContainer *generic_container'.
21509         (reflection_methodbuilder_to_mono_method): Don't create a new
21510         MonoGenericContainer each time we're called.
21511         (mono_reflection_bind_generic_method_parameters): Use
21512         `container->method_hash' to cache the results so we don't create a
21513         different method if we're called several times with the same
21514         arguments.
21515
21516         * loader.c (method_from_methodspec): Use the new
21517         `container->method_hash' here, too.
21518
21519 2004-11-26  Martin Baulig  <martin@ximian.com>
21520
21521         * class.c (inflate_generic_signature): Correctly compute
21522         `res->has_type_parameters'.
21523         (mono_class_vtable): Use the `has_type_parameters' flag to
21524         determine whether we're a generic method.
21525
21526         * metadata.c (mono_metadata_parse_method_signature_full): Likewise.
21527
21528 2004-11-25  Zoltan Varga  <vargaz@freemail.hu>
21529
21530         * object.c (mono_runtime_run_main): Fix a small memory leak.
21531
21532 2004-11-25  Martin Baulig  <martin@ximian.com>
21533
21534         * class.c (set_generic_param_owner): Fixed the loop.
21535
21536 2004-11-25  Martin Baulig  <martin@ximian.com>
21537
21538         * object.c (mono_class_vtable): Don't create any JIT wrappers for
21539         generic methods.
21540
21541 2004-11-24  Zoltan Varga  <vargaz@freemail.hu>
21542
21543         * reflection.c: Allow all kinds of whitespace, not just ' ' in type
21544         names. Fixes #69787.
21545
21546 2004-11-24  Martin Baulig  <martin@ximian.com>
21547
21548         * class.c (mono_class_create_generic_2): If we don't have a
21549         `ginst->parent', inflate `gklass->parent' to get our parent.
21550
21551 2004-11-24  Martin Baulig  <martin@ximian.com>
21552
21553         * reflection.c (compare_genericparam): Correctly sort the
21554         GenericParam table; fixes #69779.
21555
21556 2004-11-23  Ben Maurer  <bmaurer@ximian.com>
21557
21558         * reflection.c: When writing a PE file, don't create a huge
21559         buffer in memory. Just write the arrays we have to the file.
21560         This reduces memory usage.
21561
21562         * metadata-internals.h: MonoDynamicStream pefile is no longer used
21563         globally.
21564
21565 2004-11-17  Martin Baulig  <martin@ximian.com>
21566
21567         * class.c (mono_class_init): Don't setup `class->parent' for
21568         dynamic instances; moved this to mono_class_generic_2().
21569         (mono_class_create_generic): Also set `klass->inited' for dynamic
21570         generic instances.
21571         (mono_class_create_generic_2): Don't do anything for dynamic
21572         generic instances.  Set `klass->parent' here and also call
21573         mono_class_setup_parent() here. 
21574
21575         * reflection.c (do_mono_reflection_bind_generic_parameters): Added
21576         `MonoType *parent' argument; set `ginst->parent' before calling
21577         mono_class_create_generic_2(), so we set the correct parent.
21578
21579 Thu Nov 18 17:10:32 CET 2004 Paolo Molaro <lupus@ximian.com>
21580
21581         * reflection.c: allow getting attributes from ModuleBuilder
21582         (used by ikvm).
21583
21584 2004-11-17  Martin Baulig  <martin@ximian.com>
21585
21586         * class.c (mono_class_create_from_typedef): If a type parameter is
21587         inherited from an outer class, set its owner to that class.
21588
21589 2004-11-17  Atsushi Enomoto  <atsushi@ximian.com>
21590
21591         * reflection.c: (mono_image_create_pefile): Don't use NULL argument
21592           for (int*) written size. This fixes bug #69592.
21593
21594 2004-11-15  Sebastien Pouliot  <sebastien@ximian.com>
21595
21596         * icall.c: Added IsAuthenticodePresnet internal call.
21597         * image.c|h: New function that check a MonoImage for an Authenticode
21598         signature in the certificate PE data directory.
21599         * security.c|h: New internal call to ask the runtime if an 
21600         Authenticode signature seems referenced in the PE header.
21601
21602 2004-11-15  Zoltan Varga  <vargaz@freemail.hu>
21603
21604         * icall.c (ves_icall_type_isprimitive): Native int is a primitive type.
21605
21606         * reflection.c (mono_image_create_pefile): Free the assembly streams
21607         after writing out the assembly file.
21608
21609         * object.c (mono_runtime_run_main): Fix small memory leak.
21610
21611         * icall.c (ves_icall_Type_GetPropertiesByName): Add support for
21612         property access modifiers. Fixes #69389.
21613
21614 Mon Nov 15 11:54:22 CET 2004 Paolo Molaro <lupus@ximian.com>
21615
21616         * domain.c, object.c, object-internals.h, domain-internals.h,
21617         object.h, marshal.c: keep dynamic code info per domain.
21618
21619 2004-11-15  Martin Baulig  <martin@ximian.com>
21620
21621         * class.c (mono_type_get_name_recurse): Put type arguments in
21622         `[',`]' instead of in `<','>'.  Thanks to Atsushi for the patch,
21623         see bug #68387.
21624
21625 2004-11-15  Martin Baulig  <martin@ximian.com>
21626
21627         * class.c (mono_type_get_name_recurse): Added `include_ns' flag.
21628         (mono_class_setup_vtable): When computing `the_cname' for a
21629         generic instance, don't include the namespace since we'd otherwise
21630         add it twice.
21631
21632 2004-11-15  Martin Baulig  <martin@ximian.com>
21633
21634         * class.c (mono_class_create_generic): Changed return type to void.
21635         (mono_class_create_generic_2): New public function; setup
21636         `class->method', `class->field' and `class->interfaces' here
21637         instead of in mono_class_init().
21638
21639         * class.h (mono_class_create_generic): Moved to class-internals.h.
21640
21641 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
21642
21643         * reflection.c (mono_image_create_pefile): take a file HANDLE.
21644         rather than writing to memory, write to this file. Right now,
21645         we are just writting into a buffer, and copying that. However
21646         we can avoid the buffer later.
21647
21648         (mono_dynamic_stream_reset): new function
21649
21650         * icall.c, object-internals.h: update for the above.
21651
21652 2004-11-13  Ben Maurer  <bmaurer@ximian.com>
21653
21654         * reflection.c: Remove *_ATOMIC macros. We really shouldn't
21655         have been using gc'd memory. First it is slower, unlikely
21656         the comment in the source code said, secondly, it increases
21657         our footprint to do it in the gc.
21658
21659         * icall.c (WriteToFile): rename of getDataChunk. Rewrite
21660         the method so that it does not have to copy to managed code.
21661
21662 2004-11-12  Zoltan Varga  <vargaz@freemail.hu>
21663
21664         * loader.c (mono_method_get_header): Fix build for older glibs which does not define G_LIKELY.
21665
21666 2004-11-12  Martin Baulig  <martin@localhost>
21667
21668         * reflection.c (mono_image_create_token): Allow generic method
21669         definitions here, since they may appear in an `.override'; see
21670         gen-98/gen-99 for an example.
21671
21672 2004-11-11  Zoltan Varga  <vargaz@freemail.hu>
21673
21674         * icall.c (ves_icall_Type_GetField): Support BFLAGS_IgnoreCase. Fixes
21675         #69365.
21676
21677         * marshal.c (mono_string_to_ansibstr): Make g_error messages more
21678         descriptive.
21679
21680 2004-11-11  Martin Baulig  <martin@ximian.com>
21681
21682         * class.c (mono_class_setup_vtable): In an explicit interface
21683         implementation, the method name now includes the arity.
21684
21685 2004-11-10  Zoltan Varga  <vargaz@freemail.hu>
21686
21687         * object.c (mono_array_full_copy): Fix warning.
21688
21689 2004-11-10  Lluis Sanchez Gual  <lluis@novell.com>
21690
21691         * appdomain.c: Removed look_for_method_by_name(). Use the new method
21692         mono_class_get_method_from_name() instead.
21693         
21694         * class-internals.h: Added two new types of wrappers. 
21695         Added MonoRemotingTarget enum. Added new trampoline function type, which
21696         takes an additional MonoRemotingTarget value as parameter, so it is
21697         possible to request a trampoline for a specific target.
21698         
21699         * class.c: Added new mono_class_get_method_from_name() method.
21700         
21701         * class.h: In MonoRemoteClass, we can have now to vtables, one for
21702         general remoting sinks and one specific for cross domain calls.
21703         
21704         * debug-helpers.c: Added new wrapper names.
21705         
21706         * icall.c: Use the new method mono_remote_class_vtable() to get the vtable
21707         of a remote class.
21708         
21709         * image.c: Porperly delete value objects form the remoting invoke hashtable.
21710         
21711         * marshal.c: Added mono_marshal_get_xappdomain_invoke(), which together
21712         with several other methods (mono_marshal_get_xappdomain_dispatch,
21713         mono_marshal_get_xappdomain_target, mono_marshal_get_serialize_exception,
21714         and others) can generate a fast remoting wrapper for cross domain calls.
21715         More information can be found in docs/remoting.
21716         Other changes: Removed mono_find_method_by_name, and used
21717         mono_class_get_method_from_name instead.
21718         Remoting wrappers are now stored in a MonoRemotingMethods struct, which
21719         is stored in the remoting invoke hashtable.
21720         
21721         * marshal.h: published the new method for getting the xdomain wrapper,
21722         and also added a method for getting the adequate wrapper for a given
21723         method and target.
21724         
21725         * object-internals.h, object.c: Added a couple of methods for capying and
21726         cloning arrays.
21727         Modified mono_install_remoting_trampoline, which takes the new remoting
21728         trampoline that has a remoting target as parameter.
21729         mono_class_proxy_vtable now also takes a remoting target as parameter, and
21730         will return the most suitable vtable for the target.
21731         Added mono_remote_class_vtable, which returns the vtable of a remote class
21732         (which can be the normal remoting vtable or the xdomain vtable).
21733         
21734         * threads.c: the xdomain invoke and dispatch wrappers must also be
21735         protected against interruptions.
21736
21737 2004-11-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21738
21739         * icall.c: use memmove in BlockCopyInternal when the source and
21740         destination arrays are the same.
21741
21742 2004-11-09  Martin Baulig  <martin@ximian.com>
21743
21744         * class-internals.h (MonoGenericContainer): Removed `method' and
21745         `signature', replaced them with `is_method' and `is_signature'
21746         flags.  Added `context'.
21747
21748         * loader.c (method_from_methodspec): Take a `MonoGenericContext *'
21749         instead of a `MonoGenericContainer *'.
21750
21751         * metadata.c (mono_metadata_generic_param_equal): Removed the hack
21752         for dynamic type parameters.
21753         (mono_metadata_load_generic_params): Setup `container->context'.
21754
21755         * reflection.c (mono_reflection_setup_generic_class): Setup
21756         `tb->generic_container->context'.
21757         (do_mono_reflection_bind_generic_parameters): Use
21758         mono_class_inflate_generic_type() to correctly inflate types,
21759         rather than using our own hack just for MONO_TYPE_VAR.
21760
21761 2004-11-09  Martin Baulig  <martin@ximian.com>
21762
21763         * class.c (mono_class_inflate_generic_method): Small fix; don't
21764         crash here.
21765
21766         * icall.c
21767         (ves_icall_MonoType_GetGenericArguments): Don't ignore `byref' types.
21768         (ves_icall_Type_get_IsGenericTypeDefinition): Likewise.
21769         (ves_icall_Type_GetGenericTypeDefinition_impl): Likewise.
21770         (ves_icall_Type_BindGenericParameters): Likewise.
21771         (ves_icall_Type_get_IsGenericInstance): Likewise.
21772         (ves_icall_Type_GetGenericParameterPosition): Likewise.
21773         (ves_icall_MonoType_get_HasGenericArguments): Likewise.
21774         (ves_icall_MonoType_get_IsGenericParameter): Likewise.
21775         (ves_icall_MonoType_get_DeclaringMethod): Likewise.
21776
21777 2004-11-09  Zoltan Varga  <vargaz@freemail.hu>
21778
21779         * assembly.c (mono_assembly_names_equal): Reenable the comparison of
21780         assembly versions and public key tokens. Fixes #69113.
21781
21782 Tue Nov 9 17:34:05 CET 2004 Paolo Molaro <lupus@ximian.com>
21783
21784         * metadata.c: fix bug introduced with the type cache changes
21785         on 2004-11-06.
21786
21787 Tue Nov 9 17:26:29 CET 2004 Paolo Molaro <lupus@ximian.com>
21788
21789         * metadata.h, metadata.c, domain-internals.h, marshal.c: include
21790         the MonoClass pointer instead of the token in exception clauses.
21791         * reflection.c: updates for the above and make the code not depend
21792         on the structure of MonoExceptionClause.
21793
21794 2004-11-08  Zoltan Varga  <vargaz@freemail.hu>
21795
21796         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
21797         Add support for dynamic assemblies. Fixes #69114.
21798
21799         * loader.c (mono_method_get_header): Handle icalls and pinvoke methods.
21800
21801 2004-11-07  Ben Maurer  <bmaurer@ximian.com>
21802
21803         * class-internals.h (MonoMethod): Move addr to MonoMethodPInvoke
21804         since most only those methods use it. the code member of
21805         MonoMethodPInvoke was dead, so that can be removed too. Also,
21806         remove inline_count (again, not used), and move slot so that it
21807         can share bits with some other flags. This saves 8 bytes in the
21808         structure and gives us about 50 kb back for mcs helloworld.cs
21809
21810         * *.[ch]: Do naming changes for the above.
21811
21812         * loader.c (mono_method_get_header): Lazily init the header
21813         on first access.
21814         (mono_get_method_from_token): don't init the header here
21815         (mono_free_method): the header may never be allocated
21816
21817         Overall, this saves 150 kb of unmanaged allocations
21818         for mcs helloworld.cs. That accounts for 10% of the unmanaged
21819         memory at runtime.
21820         
21821         * loader.c, loader.h (mono_method_get_header): new accessor.
21822
21823         * *.[ch]: use the above method. Prepares us to lazily load
21824         the header.
21825
21826         * *.[ch]: Clean up all the pesky warnings. gcc now only gives
21827         three warnings, which are actual bugs (see 69206).
21828
21829         * class-internals.h (MonoMethod): Remove remoting_tramp. It is
21830         unused. Saves a cool 4 bytes / method.
21831
21832 2004-11-06  Ben Maurer  <bmaurer@ximian.com>
21833
21834         * metadata.c (builtin_types): Add types for System.Object here.
21835         (mono_metadata_parse_type_full): Cache MonoType*'s that are
21836         for a class or valuetype from klass->this_arg or klass->byval_arg.
21837
21838         On mcs for a hello world, this gets us down from 21836 MonoType's
21839         to 14560.
21840
21841         (mono_metadata_free_type): Account for the above change.
21842
21843 2004-11-06  Zoltan Varga  <vargaz@freemail.hu>
21844
21845         * appdomain.c (ves_icall_System_AppDomain_GetData): Throw an 
21846         exception instead of asserting if name is null.
21847         (ves_icall_System_AppDomain_GetData): Ditto.
21848
21849 2004-11-05  Zoltan Varga  <vargaz@freemail.hu>
21850
21851         (ves_icall_get_enum_info): Avoid crash when called on a non-finished
21852         EnumBuilder.
21853
21854         * icall.c (ves_icall_System_Reflection_Assembly_GetEntryAssembly): 
21855         Return NULL when the domain does not have entry_assembly set.
21856
21857         * icall.c (ves_icall_System_Reflection_Assembly_GetFilesInternal): 
21858         Add a 'resource_modules' argument.
21859         (ves_icall_type_GetTypeCode): Fix typecode of byref types.
21860
21861         * reflection.c (mono_reflection_create_runtime_class): Move setting
21862         of wastypebuilder here, so mono_get_type_object () returns a MonoType
21863         for enums too.
21864
21865         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi): Return NULL here instead of an empty string to match MS behavior.
21866         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi_len):
21867         Throw an ArgumentNullException if 'ptr' is null.
21868
21869         * appdomain.c (mono_domain_assembly_search): Avoid matching dynamic
21870         assemblies here. Fixes #69020.
21871
21872 2004-11-05  Geoff Norton  <gnorton@customerdna.com>
21873
21874         * reflection.c (build_compressed_metadata): Fix the previous patch for
21875         big endian systems.  GUINT32_FROM_LE isn't needed on strlen and was overwriting
21876         the stack.
21877
21878 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
21879
21880         * assembly.c (mono_assembly_names_equal): Allow a match if one of
21881         the cultures is false. Fixes #69090.
21882
21883         * reflection.c (build_compressed_metadata): Fix invalid memory read 
21884         detected by valgrind.
21885         
21886         * reflection.c (mono_reflection_get_type): Avoid triggering a 
21887         TypeResolve multiple times for the same type. Fixes #65577.
21888
21889 2004-11-04  Ben Maurer  <bmaurer@ximian.com>
21890
21891         * marshal.c: Avoid using ldftn to call managed functions. It is
21892         much slower than just a call.
21893
21894         * reflection.c (mono_module_get_object): free the basename we
21895         allocate here from glib.
21896         
21897         * reflection.c (ensure_runtime_vtable): make sure to free
21898         overrides.  Also, we were allocating an array of MonoMethod not an
21899         array of MonoMethod*.
21900
21901         * marshal.c (mono_marshal_get_stelemref): do a mono_mb_free here.
21902
21903         * image.c (mono_image_close): free image->guid here.
21904
21905 2004-11-02  Zoltan Varga  <vargaz@freemail.hu>
21906
21907         * reflection.c: Fix some spec conformance issues with the PE file
21908         structures so mcs compiled apps run on the Net 2.0 beta.
21909
21910 2004-11-01  Zoltan Varga  <vargaz@freemail.hu>
21911
21912         * string-icalls.c (ves_icall_System_String_ctor_encoding): 
21913         Implement this. Fixes #67264.
21914
21915         * debug-helpers.h debug-helpers.c marshal.c: Move 
21916         mono_find_method_by_name to debug-helpers.c.
21917
21918 2004-10-31  Zoltan Varga  <vargaz@freemail.hu>
21919
21920         * object.c (mono_release_type_locks): type_initialization_hash is
21921         a GHashTable.
21922
21923         * reflection.c object.c object-internals.h: Fix warnings.
21924
21925         * icall.c (ves_icall_Type_GetPropertiesByName): Handle properties
21926         without accessors. Fixes #61561.
21927
21928         * appdomain.c (ves_icall_System_AppDomain_createDomain): Inherit
21929         application base from the root domain if not set. Fixes #65641.
21930         (mono_runtime_init): Fix warning.
21931
21932 2004-10-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21933
21934         * appdomain.c: call mono_thread_pool_init.
21935         * threadpool.[ch]: new mono_thread_pool_init that sets the max. number
21936         of worker threads based on the number of CPUs and the environment
21937         variable MONO_THREADS_PER_CPU if present. The defaults are 50 (25)
21938         for non-windows (windows) systems.
21939
21940 2004-10-27  Chris Toshok  <toshok@ximian.com>
21941
21942         * mono-debug-debugger.c (write_class): don't call mono_class_init
21943         here, as even with the check for (!klass->init_pending), we get
21944         into a situation where we're hitting cycles in class
21945         initialization.  Fixes #68816.
21946
21947 2004-10-25  Zoltan Varga  <vargaz@freemail.hu>
21948
21949         * image.c: Avoid overwriting values in the loaded_images_hash when an
21950         assembly is loaded multiple times. Fixes #61152.
21951
21952         * assembly.c (mono_assembly_names_equal): Compare the cultures as well,
21953         so multiple satellite assemblies for the same name can be loaded.
21954         Fixes #68259.
21955
21956         * mono_domain_assembly_preload: Actually return the loaded assembly, 
21957         not NULL.
21958
21959         * icall.c (ves_icall_type_is_subtype_of): Fix this for byref types.
21960         (ves_icall_type_is_assignable_from): Ditto. Fixes #68582.
21961
21962         * gc.c (finalize_domain_objects): Call GC_invoke_finalizers () so
21963         pending finalizers are not invoked after the appdomain has been 
21964         unloaded. Fixes #67862.
21965
21966 2004-10-22  Martin Baulig  <martin@ximian.com>
21967
21968         * mono-debug-debugger.c
21969         (mono_debugger_runtime_invoke): Don't box valuetypes.
21970
21971 2004-10-22  Chris Toshok  <toshok@ximian.com>
21972
21973         * mono-debug-debugger.c (do_write_class): handle .cctors too, and
21974         don't hide private methods.
21975
21976 2004-10-22  Sebastien Pouliot  <sebastien@ximian.com>
21977
21978         * icall.c: Allows the runtime to "share" (when known) the public key
21979         token of an assembly. This avoid the need to recalculate the token 
21980         (from the public key) in managed code.
21981
21982 2004-10-21  Chris Toshok  <toshok@ximian.com>
21983
21984         * debug-helpers.c (append_class_name): argh, revert last patch.
21985         
21986 2004-10-21  Chris Toshok  <toshok@ximian.com>
21987
21988         * debug-helpers.c (append_class_name): use '+' as the delimiter,
21989         not '/', so that it matches what the debugger uses to look up
21990         methods.
21991
21992 2004-10-21  Martin Baulig  <martin@ximian.com>
21993
21994         * mono-debug-debugger.c (mono_debugger_throw_exception): New
21995         public method; this is called each time an exception is thrown and
21996         allows the debugger to use exception catch points.
21997
21998 2004-10-21  Martin Baulig  <martin@ximian.com>
21999
22000         * mono-debug-debugger.c (mono_debugger_handle_exception): Write
22001         the stack pointer and the exception object in some struct and pass
22002         that to the debugger.
22003
22004 2004-10-21  Chris Toshok  <toshok@ximian.com>
22005
22006         * mono-debug-debugger.c (do_write_class): add instance/static
22007         event support.  We don't expose "raise" or "other" yet.
22008         (event_is_static): new method.
22009
22010 2004-10-20  Bernie Solomon  <bernard@ugsolutions.com>
22011
22012         * mono-debug-debugger.c
22013         (mono_debugger_handle_exception): Remove
22014         bogus return value for fussy compilers.
22015
22016 2004-10-20  Martin Baulig  <martin@ximian.com>
22017
22018         * mono-debug-debugger.c
22019         (mono_debugger_unhandled_exception): Added `gpointer stack' argument.
22020         (mono_debugger_handled_exception): Likewise.
22021
22022 2004-10-20  Martin Baulig  <martin@ximian.com>
22023
22024         * mono-debug-debugger.h (MonoDebuggerEvent): Added
22025         MONO_DEBUGGER_EVENT_EXCEPTION.
22026
22027         * mono-debug-debugger.c (mono_debugger_handle_exception): New
22028         public function to send the debugger a notification for an
22029         exception and inform it about a catch/finally clause.
22030
22031 2004-10-19  Zoltan Varga  <vargaz@freemail.hu>
22032
22033         * marshal.c, icall.c: Applied patch from Alexandre Rocha Lima e
22034         Marcondes (alexandremarcondes@psl-pr.softwarelivre.org). Really
22035         fix 2.95 build. 
22036
22037         * icall.c (ves_icall_InternalExecute): Fix build for gcc-2.95.
22038
22039 2004-10-18  Zoltan Varga  <vargaz@freemail.hu>
22040
22041         * marshal.c (emit_marshal_object): Fix freeing of memory when a reference type is
22042         marshalled as [In,Out]. Fixes #58325.
22043
22044 2004-10-14  Zoltan Varga  <vargaz@freemail.hu>
22045
22046         * reflection.c (mono_method_body_get_object): Implement some fields.
22047
22048 2004-10-12  Martin Baulig  <martin@ximian.com>
22049
22050         * reflection.c (mono_reflection_bind_generic_parameters): Small
22051         fix, correctly retrieve our parent from a generic instance.
22052
22053 2004-10-12  Martin Baulig  <martin@ximian.com>
22054
22055         * metadata.c (mono_metadata_generic_param_equal): We always have
22056         an owner.
22057
22058         * class.c
22059         (mono_class_from_generic_parameter): We need to have an owner.
22060         (my_mono_class_from_generic_parameter): Likewise.
22061
22062         * reflection.c (mono_reflection_setup_generic_class): Renamed to
22063         mono_reflection_create_generic_class() and added a new
22064         mono_reflection_setup_generic_class().  
22065         (mono_reflection_initialize_generic_param): If we're a nested
22066         generic type and inherited from the containing class, set our
22067         owner to the outer class.
22068
22069 2004-10-11  Zoltan Varga  <vargaz@freemail.hu>
22070
22071         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodBodyInternal): New icall.
22072
22073         * reflection.c (mono_method_body_get_object): New function to create
22074         a MethodBody object.
22075
22076         * object-internals.h object.h: Add MonoReflectionMethodBody structure.
22077
22078 2004-10-11  Martin Baulig  <martin@ximian.com>
22079
22080         * metadata.c (_mono_metadata_type_equal): Renamed to
22081         do_mono_metadata_type_equal() and made static.
22082
22083 2004-10-11  Martin Baulig  <martin@ximian.com>
22084
22085         * appdomain.c: Bump corlib version number to 28.
22086
22087 2004-10-10  Martin Baulig  <martin@ximian.com>
22088
22089         * class-internals.h
22090         (MonoGenericInst): Added `MonoGenericContainer *container'.
22091         (MonoGenericMethod): Likewise.
22092         (MonoGenericContext): Likewise.
22093         (MonoGenericParam): Added `MonoGenericContainer *owner'.
22094
22095         * metadata.c
22096         (do_mono_metadata_parse_type): Added a `MonoGenericContainer *' argument.
22097         (do_mono_metadata_parse_generic_inst): Likewise.
22098         (mono_metadata_parse_type_full): New public method.  This is the actual
22099         mono_metadata_parse_type() implementation - with an additional
22100         `MonoGenericContainer *' argument.
22101         (mono_metadata_parse_array_full): Likewise.
22102         (mono_metadata_parse_signature_full): Likewise.
22103         (mono_metadata_parse_method_signature_full): Likewise.
22104         (mono_metadata_parse_mh_full): Likewise.
22105         (mono_type_create_from_typespec): Likewise.
22106         (mono_metadata_interfaces_from_typedef_full): New public method;
22107         this is similar to the other _full() methods, but we take a
22108         `MonoGenericContext *' since we have to pass it to mono_class_get_full().
22109         (mono_metadata_parse_generic_param): Take an additional
22110         `MonoGenericContainer *' argument and lookup the MonoGenericParam
22111         from that container.
22112         (mono_metadata_generic_param_equal): New static method to compare
22113         two type parameters.
22114         (_mono_metadata_type_equal): New static method; takes an
22115         additional `gboolean signature_only' argument - if true, we don't
22116         compare the owners of generic parameters.
22117         (mono_metadata_signature_equal): Call _mono_metadata_type_equal()
22118         with a TRUE argument - do a signature-only comparision.
22119
22120         * loader.c: Use the new _full() methods and pass the
22121         MonoGenericContainer to them.
22122
22123         * object-internals.h (MonoReflectionTypeBuilder): Added
22124         `MonoGenericContainer *generic_container' field.
22125         (MonoReflectionMethodBuilder): Likewise.
22126
22127 2004-10-08  Zoltan Varga  <vargaz@freemail.hu>
22128
22129         * icall.c (ves_icall_System_Reflection_Module_GetGlobalType): Special
22130         case initial images of dynamic assemblies.
22131
22132         * reflection.c (mono_image_basic_init): Set 'initial_image' field.
22133
22134         * metadata-internals.h (MonoDynamicImage): Add 'initial_image' field.
22135
22136         * reflection.c (mono_reflection_event_builder_get_event_info): Fix
22137         length of event->other array.
22138         (typebuilder_setup_events): Ditto.
22139
22140         * domain-internals.h (MonoDomain): Rename 'assemblies' hash table to
22141         'assembly_by_name' and add an 'assemblies' list.
22142
22143         * assembly.h assembly.c: Add a new search hook for determining whenever
22144         an assembly is already loaded. Use this instead of searching in the
22145         loaded_assemblies list.
22146
22147         * domain.c appdomain.c: Implement the new search hook so loaded 
22148         assemblies are now scoped by appdomain. Fixes #67727.
22149
22150 2004-10-07  Zoltan Varga  <vargaz@freemail.hu>
22151
22152         * threads.c (mono_thread_attach): Initialize synch_lock field so
22153         mono_thread_detach works again.
22154
22155         * loader.c (mono_lookup_pinvoke_call): Try the dllname prefixed with
22156         'lib' too. Fixes #63130.
22157
22158 2004-10-06  Jackson Harper  <jackson@ximian.com>
22159
22160         * culture-info-tables.h: regenerated.
22161
22162 2004-10-06  Zoltan Varga  <vargaz@freemail.hu>
22163
22164         * icall.c (ves_icall_Type_GetInterfaces): Include interfaces 
22165         implemented by other interfaces in the result. Fixes #65764.
22166         
22167         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
22168         Handle unloadable modules without crashing.
22169
22170         * image.c (load_modules): Revert the previous patch since modules must
22171         have a fixed index inside the array.
22172         
22173         * image.c (load_modules): Don't include native modules in the modules
22174         array.
22175
22176 2004-10-05  Zoltan Varga  <vargaz@freemail.hu>
22177
22178         * reflection.h: Add param_defaults field.
22179
22180         * reflection.c: Add support for parameter defaults in dynamic methods.
22181         Fixes #64595.
22182
22183         * icall.c (ves_icall_MonoType_get_Namespace): Return NULL instead of
22184         an empty string when a type has no namespace. Fixes #64230.
22185
22186 2004-10-04  Sebastien Pouliot  <sebastien@ximian.com>
22187
22188         * tabledefs.h: Added "internal" security actions to support non-CAS
22189         permissions NonCasDemand, NonCasLinkDemand and NonCasInheritance. 
22190         Note: they do not seems to be used anymore in 2.0 (new metadata format)
22191
22192 2004-10-04  Zoltan Varga  <vargaz@freemail.hu>
22193
22194         * icall.c (ves_icall_InternalInvoke): Throw an exception when calling
22195         constructor of abstract class. Fixes #61689.
22196
22197 2004-10-04  Martin Baulig  <martin@ximian.com>
22198
22199         * class-internals.h (MonoGenericContainer): New type.
22200         (MonoMethodNormal): Replaced `MonoGenericParam *gen_params' with
22201         `MonoGenericContainer *generic_container'.
22202         (MonoClass): Replaced `gen_params' and `num_gen_params' with
22203         `MonoGenericContainer *generic_container'.
22204
22205         * metadata.c (mono_metadata_load_generic_params): Return a
22206         `MonoGenericContainer *' instead of a `MonoGenericParam *';
22207         removed the `num' argument.
22208
22209 2004-10-03  Zoltan Varga  <vargaz@freemail.hu>
22210
22211         * icall.c (ves_icall_System_Reflection_Module_GetPEKind): Add support
22212         for dynamic images.
22213
22214         * object-internals.h (MonoReflectionAssemblyBuilder): Add pe_kind and
22215         machine fields.
22216
22217         * metadata-internals.h (MonoDynamicImage): Add pe_kind and machine fields.
22218
22219         * reflection.c: Save pe_kind and machine values into the generated
22220         image file.
22221
22222         * appdomain.c: Bump corlib version number.
22223
22224         * object-internals.h: Reorganize layout of LocalBuilder.
22225
22226         * class-internals.h class.c (mono_class_get_implemented_interfaces): 
22227         New helper function.
22228
22229         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Return the
22230         created MonoType for dynamic types. Fixes #66180.
22231
22232 2004-10-02  Ben Maurer  <bmaurer@ximian.com>
22233
22234         * threadpool.c: the ares hashtable needs a critical section around it.
22235         this prevents some nasty segfaults
22236
22237 2004-10-02  Massimiliano Mantione  <massi@ximian.com>
22238
22239         * process.c: Fixed alignments to 32 bits as casting to unsigned is unsafe
22240         on 64 bits platforms, patch by will@exomi.com (Ville-Pertti Keinonen), see
22241         bug 67324).
22242         
22243 2004-09-30  Zoltan Varga  <vargaz@freemail.hu>
22244
22245         * object-internals.h (MonoReflectionTypeBuilder): Add 'created' field.
22246         
22247 2004-09-30  Lluis Sanchez Gual  <lluis@novell.com>
22248
22249         * image.c: Always canonicalize image file names, to avoid loading
22250         the same assembly twice when referenced using a relative path.
22251
22252 2004-09-30  Zoltan Varga  <vargaz@freemail.hu>
22253
22254         * marshal.h marshal.c icall.c: Fix bugs in previous patch.
22255
22256         * marshal.c marshal.h icall.c: Add GetDelegateForFunctionPointerInternal icall.
22257
22258         * marshal.c: Fix warnings.
22259
22260 2004-09-29  Geoff Norton  <gnorton@customerdna.com>
22261
22262         * marshal.c (mono_ftnptr_to_delegate): This method was improperly
22263         attempting to marshal the delegate_trampoline as the method_addr.
22264         This patch has a static hashtable of marshalled delegates so that 
22265         we can map delegate_trampoline addresses back to delegates.  This
22266         allows a delegate passed to managed code to be passed back into native
22267         code.  Fixes #67039
22268
22269 2004-09-28  Zoltan Varga  <vargaz@freemail.hu>
22270
22271         * icall.c: Add GetFunctionPointerForDelegateInternal icall.
22272
22273         * reflection.c (method_encode_code): Align method headers properly.
22274         Fixes #66025.
22275
22276 2004-09-28  Lluis Sanchez Gual  <lluis@novell.com>
22277
22278         * marshal.c: In the runtime invoke wrapper, reset the abort
22279         exception if it is cached. This avoids the automatic rethrowal of 
22280         the exception after the catch of the wrapper. Also check for pending
22281         interruptions before calling the managed method. This is done using
22282         the new method emit_thread_force_interrupt_checkpoint, since the
22283         normal checkpoint method is ignored when running the invoke wrapper.
22284         * object.c: If the abort exception is rethrown, set the abort_exc
22285         field of the thread, so it will be rethrown aftere every catch.
22286         * threadpool.c: Only run an interruption checkpoint if what has been
22287         requested is a stop of the thread (aborts will be ignored).
22288         * threads.c: By default, a thread will now never be interrumped while
22289         running the runtime invoke wrapper (this ensures that runtime_invoke
22290         will always return to the caller if an exception pointer is provided).
22291         There is a new special method mono_thread_force_interruption_checkpoint()
22292         to force an interruption checkpoint even if running a protected
22293         wrapper, which is used by the same runtime invoke wrapper to do a check
22294         at a safe point.
22295
22296 2004-09-28  Lluis Sanchez Gual  <lluis@novell.com>
22297
22298         * object.c, object-internals.h: Implemented mono_release_type_locks,
22299         which releases the cctor locks held by a thread.
22300         * threads.c, threads.h: In thread_cleanup, release cctor locks held
22301         by a thread. Added mono_thread_exit() method to be used to safely stop
22302         a thread.
22303
22304 2004-09-28  Raja R Harinath  <rharinath@novell.com>
22305
22306         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
22307         Move null check before dereference.  Avoid indexing beyond the end
22308         of the 'modules' array.
22309
22310 2004-09-28  Raja R Harinath  <rharinath@novell.com>
22311
22312         * metadata-internals.h (MonoImage): Add module_count field.
22313         * image.c (load_modules): Set image->module_count.
22314         (mono_image_load_file_for_image): Use image->module_count.
22315         * reflection.c (mono_image_load_module): Append to image->modules array 
22316         of dynamic assembly.
22317         (mono_module_get_object): Fix loop to actually increment index.
22318         Use image->module_count.
22319         * assembly.c (mono_assembly_load_references): Use image->module_count.
22320         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal):
22321         Likewise.
22322
22323 2004-09-28  Zoltan Varga  <vargaz@freemail.hu>
22324
22325         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): 
22326         Avoid assert on generic types.
22327
22328 2004-09-26  Zoltan Varga  <vargaz@freemail.hu>
22329
22330         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): New icall.
22331
22332         * reflection.c (mono_param_get_objects): Fill out MarshalAsImpl field.
22333
22334         * reflection.c (mono_reflection_marshal_from_marshal_spec): New 
22335         function to convert a MarshalSpec structure to its managed counterpart.
22336
22337         * reflection.c: Fix warnings.
22338         
22339         * object-internals.h (MonoReflectionParameter): Add MarshalAsImpl
22340         field.
22341
22342         * icall.c (mono_create_icall_signature): Fix build.
22343
22344 2004-09-25  Zoltan Varga  <vargaz@freemail.hu>
22345
22346         * icall.c: Add MakePointType icall.
22347
22348         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage): Fix
22349         warnings.
22350
22351 2004-09-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22352
22353         * threadpool.c: reuse allocated slots in the queue.
22354
22355 2004-09-24  Zoltan Varga  <vargaz@freemail.hu>
22356
22357         * object-internals.h (MonoReflectionDllImportAttribute): New structure.
22358
22359         * icall.c: Add new icalls for GetDllImportAttribute and GetFieldOffset.
22360
22361         * reflection.h reflection.c (mono_reflection_get_custom_attrs): Revert
22362         previous change.
22363
22364         * tabledefs.h: Add constants for pinvoke attributes BestFit and
22365         ThrowOnUnmappableChar.
22366
22367         * icall.c (ves_icall_Type_GetPacking): New icall.
22368
22369 2004-09-24  Martin Baulig  <martin@ximian.com>
22370
22371         * icall.c (ves_icall_Type_GetGenericParameterConstraints): New interncall.
22372
22373 2004-09-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22374
22375         * appdomain.c:
22376         (mono_domain_set): allow setting a domain that is being unloaded.
22377         (mono_domain_unload): invoke the DomainUnload callbacks in the domain
22378         being unloaded.
22379
22380 2004-09-23  Zoltan Varga  <vargaz@freemail.hu>
22381
22382         * icall.c reflection.h reflection.c: Add a 'pseudo_attrs' argument to
22383         the GetCustomAttributes icall.
22384
22385 2004-09-23  Martin Baulig  <martin@ximian.com>
22386
22387         * object-internals.h (MonoReflectionGenericParam): Replaced
22388         'has_ctor_constraint', `has_reference_type' and `has_value_type'
22389         with `guint32 attrs'.
22390
22391 2004-09-23  Martin Baulig  <martin@ximian.com>
22392
22393         * icall.c (ves_icall_Type_GetGenericParameterAttributes): New interncall.
22394
22395 2004-09-23  Martin Baulig  <martin@ximian.com>
22396
22397         * object-internals.h (GenericParameterAttributes): New enum.
22398
22399 2004-09-23  Zoltan Varga  <vargaz@freemail.hu>
22400
22401         * object-internals.h (MonoEventInfo): Add 'other_methods' field.
22402         
22403         * class.c (init_events): Fill out event->other field.
22404
22405         * class.c: Fix warnings.
22406
22407         * icall.c (ves_icall_get_event_info): Fill out 'other_methods' field.
22408
22409 Wed Sep 22 19:04:32 CEST 2004 Paolo Molaro <lupus@ximian.com>
22410
22411         * class-internals.h, icall.c, loader.c, loader.h: added a faster stack
22412         walk which doesn't supply the IL offset.
22413
22414 2004-09-22  Martin Baulig  <martin@ximian.com>
22415
22416         * reflection.c (mono_reflection_setup_internal_class): If we're
22417         System.ValueType, System.Object or System.Enum, set
22418         `klass->instance_size' and create the vtable.
22419         (mono_reflection_create_internal_class): If we're an enum type,
22420         get the base class from our current corlib.
22421
22422 2004-09-22  Zoltan Varga  <vargaz@freemail.hu>
22423
22424         * reflection.h (MonoResolveTokenError): New type.
22425
22426         * icall.c (ves_icall_System_Reflection_Module_ResolveMemberToken): New
22427         icall.
22428
22429         * icall.c: Add an 'error' argument to the ResolveToken icalls.
22430
22431 2004-09-22  Lluis Sanchez Gual  <lluis@novell.com>
22432
22433         * icall.c: Support ContextBoundObject proxies in ves_icall_InternalExecute.
22434         Support also calling constructors, but only for already allocated objects.
22435
22436 2004-09-17  Geoff Norton <gnorton@customerdna.com>
22437
22438         * reflection.c (type_get_qualified_name): If the klass is null
22439         return the typename to avoid a NullRefEx.
22440         (encode_cattr_value): Get the qualified name of the boxed type,
22441         not the underlying enumtype.  Fixes #62984.
22442
22443 2004-09-21  Zoltan Varga  <vargaz@freemail.hu>
22444
22445         * marshal.c: Fix problems with previous checkin.
22446
22447 2004-09-21    <vargaz@freemail.hu>
22448
22449         * marshal.h marshal.c icall.c: Add new icalls for Alloc/FreeHGlobal. Change the
22450         existing mono_marshal_alloc/free functions to use CoTaskMemAlloc/Free under windows.
22451
22452         * marshal.c: Allocate marshaller memory using mono_marshal_alloc/free.
22453
22454 2004-09-21  Geoff Norton <gnorton@customerdna.com>
22455
22456         * icall.c (ves_icall_MonoType_GetElementType): GetElementType
22457         should only return a type for pointers, arrays, and passbyref types.
22458         Fixes bug #63841.
22459
22460 2004-09-21  Martin Baulig  <martin@ximian.com>
22461
22462         * domain.c (mono_debugger_check_runtime_version): New public
22463         function.
22464
22465         * icall.c (ves_icall_MonoDebugger_check_runtime_version): New icall.    
22466
22467 2004-09-20  Sebastien Pouliot  <sebastien@ximian.com>
22468
22469         * reflection.c: Added missing sort to the declarative security 
22470         attributes table. MS implementation stops seeing the attributes if the
22471         token number regress in the table (as shown by ildasm and permview).
22472
22473 2004-09-20  Zoltan Varga  <vargaz@freemail.hu>
22474
22475         * object-internals.h (MonoReflectionModule): Add 'token' field.
22476         
22477         * reflection.c (mono_reflection_get_token): Add support for Module
22478         and Assembly.
22479         (mono_module_get_object): Set 'token' field.
22480         (mono_module_file_get_object): Set 'token' field.
22481
22482         * icall.c: Add new Assembly and Module icalls.
22483
22484         * appdomain.c: Bump corlib version.
22485
22486 2004-09-19  Zoltan Varga  <vargaz@freemail.hu>
22487
22488         * loader.h loader.c class.h class.c: Add helper functions for obtaining
22489         tokens of metadata objects.
22490
22491         * reflection.h reflection.c (mono_reflection_get_token): New function
22492         to obtain the token of a metadata object.
22493
22494         * icall.c: Add icalls for MetadataToken and ModuleHandle methods.
22495
22496 2004-09-17  Zoltan Varga  <vargaz@freemail.hu>
22497
22498         * loader.c (mono_lookup_pinvoke_call): Try the underscore prefixed name as well.
22499         
22500         * loader.c (mono_lookup_pinvoke_call): Add support for stdcall name mangling.
22501
22502 2004-09-16  Sebastien Pouliot  <sebastien@ximian.com>
22503
22504         * appdomain.c: Bumped MONO_CORLIB_VERSION to 25.
22505         * object-internals.h: Added 3 MonoArray* members to MonoReflection
22506         AssemblyBuilder to access the permissions set in the class lib.
22507         * reflection.c: Added security attributes encoding step in 
22508         mono_image_build_metadata.
22509         * tabledefs.h: Added new security actions defined in 2.0:
22510         LinkDemandChoice, InheritanceDemandChoice and DemandChoice.
22511
22512 2004-09-16  Lluis Sanchez Gual  <lluis@novell.com>
22513
22514         * threads.c: Fixed SET_CURRENT_OBJECT macros, they were ignoring the
22515         macro parameter.
22516
22517 2004-09-16  Lluis Sanchez Gual  <lluis@novell.com>
22518  
22519         * locales.c: nullify the ICU_collator member of CompareInfo when it is
22520           finalized. There where random SIGSEVs at program termination, when
22521           an object being finalized was trying to do a string comparison and
22522           the current culture was already finalized.
22523  
22524 2004-09-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22525
22526         * threads.c: call thread_cleanup before finishing the thread if we get
22527         there.
22528
22529 2004-09-16  Zoltan Varga  <vargaz@freemail.hu>
22530
22531         * appdomain.c (ves_icall_System_AppDomain_createDomain): Load all
22532         assemblies from the parent. Fixes #65665.
22533
22534 2004-09-15  Zoltan Varga  <vargaz@freemail.hu>
22535
22536         * metadata.c (mono_metadata_parse_type): Fix parsing of custom
22537         modifiers.
22538
22539 2004-09-14  Bernie Solomon  <bernard@ugsolutions.com>
22540
22541         * reflection.h: add prototype for mono_get_dbnull_object
22542         * reflection.c: add prototypes for get_default_param_value_blobs 
22543         and mono_get_object_from_blob for fussier compilers
22544
22545 2004-09-14  Lluis Sanchez Gual  <lluis@novell.com>
22546  
22547         * object.c: Added a "done" flag to TypeInitializationLock. This avoids
22548         false deadlock checks in class initialization.
22549  
22550 2004-09-13  Zoltan Varga  <vargaz@freemail.hu>
22551
22552         * image.c (mono_image_addref): Fix comment.
22553
22554         * metadata.c (mono_metadata_parse_type): Avoid memory allocations if
22555         possible.
22556
22557 2004-09-12  Jambunathan K  <kjambunathan@novell.com>
22558
22559         * reflection.c (mono_param_get_objects): Modified to return
22560         ParameterInfo.DefaultValue object.
22561
22562         (get_default_param_value_blobs):
22563         (mono_get_object_from_blob):
22564         (mono_get_dbnull_object): New helper routines. 
22565
22566         * object.c (mono_get_constant_value_from_blob): New helper routine
22567         carved out from get_default_field_value ()
22568
22569         * object-internals.h (mono_get_constant_value_from_blob): Added
22570         function declaration.
22571
22572 2004-09-11  Zoltan Varga  <vargaz@freemail.hu>
22573
22574         * assembly.c assembly.h icall.c class.c appdomain.c: Lazily load 
22575         referenced assemblies. Fixes #62135.
22576
22577         * exception.h exception.c (mono_get_exception_file_not_found2): New
22578         helper function.
22579
22580 2004-09-10  Zoltan Varga  <vargaz@freemail.hu>
22581
22582         * class.h class.c: Add mono_type_get_underlying_type ().
22583
22584 2004-09-09  Geoff Norton <gnorton@customerndna.com>
22585
22586         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes):
22587         Fix GetTypes() to support dynamically created assemblies.
22588
22589 2004-09-09  Zoltan Varga  <vargaz@freemail.hu>
22590
22591         * reflection.c (reflection_methodbuilder_to_mono_method): Remove TODO.
22592         
22593         * reflection.c (reflection_methodbuilder_to_mono_method): Fix bug in
22594         previous patch.
22595
22596         * reflection.h reflection.c loader.c: Allow dynamic construction of
22597         pinvoke methods. Fixes #65571.
22598         
22599         * reflection.c (mono_reflection_get_type): Revert previous change since
22600         it causes regressions.
22601
22602 2004-09-08  Martin Baulig  <martin@ximian.com>
22603
22604         * class.c (class_compute_field_layout): Don't call
22605         mono_class_layout_fields() for open generic instances.
22606
22607 2004-09-08 Bernie Solomon <bernard@ugsolutions.com>
22608         * threads.c appdomain.c: fix typo in GC macro
22609
22610 2004-09-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22611
22612         * threads.c: don't call mono_thread_detach() in start_wrapper(),
22613         avoiding a possible hang in GetCurrentThreadId(0). Fixes bug #65379.
22614
22615 2004-09-08  Zoltan Varga  <vargaz@freemail.hu>
22616
22617         * image.c (mono_image_close): Applied patch from 
22618         vasantha.paulraj@honeywell.com (Vasantha selvi). Fix crash when an
22619         assembly is loaded multiple times from data.
22620         
22621         * image.c (mono_image_open): Fix warning.
22622
22623 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
22624
22625         * reflection.h reflection.c icall.c: Only call TypeResolve handlers
22626         once. Fixes #58334.
22627         
22628         * reflection.c (mono_reflection_create_runtime_class): Initialize
22629         klass->nested_classes. Fixes #61224.
22630
22631 Tue Sep 7 14:35:26 CEST 2004 Paolo Molaro <lupus@ximian.com>
22632
22633         * threads.c: sched_yield() on exit, to allow threads to quit.
22634
22635 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
22636
22637         * object.c (mono_unhandled_exception): Remove leftover debug code.
22638
22639 2004-09-07  Atsushi Enomoto  <atsushi@ximian.com>
22640
22641         * appdomain.c, threads.c : don't use GC_CreateThread when with-gc=none
22642
22643 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
22644
22645         * marshal.c (emit_marshal_array): Really null terminate string arrays.
22646         
22647         * marshal.c (emit_marshal_string): Fix freeing of unicode strings.
22648
22649 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
22650
22651         * marshal.c (emit_marshal_array): Null terminate string arrays.
22652         
22653         * marshal.c (raise_auto_layout_exception): Fix warning.
22654
22655         * reflection.c (mono_param_get_objects): Initialize the default value
22656         with DBNull.Value, not null. Fixes #62123.
22657
22658 2004-09-01  Miguel de Icaza  <miguel@ximian.com>
22659
22660         * marshal.c (mono_marshal_get_managed_wrapper): Remove FIXME and
22661         throw an exception with a cute explanation.
22662
22663 2004-09-06  Dick Porter  <dick@ximian.com>
22664
22665         * process.c (ves_icall_System_Diagnostics_Process_Start_internal):
22666         Close the new process's thread handle, as we don't use it.  The
22667         handle stays around forever otherwise.
22668
22669 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
22670
22671         * object.c (arith_overflow): Fix warning.
22672
22673         * reflection.c (mono_image_get_methodref_token): Do not emit unmanaged
22674         calling conventions in method refs. Fixes #65352.
22675
22676         * reflection.c: Fix warnings.
22677
22678 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
22679
22680         * icall.c: Add a new icall for Array.Clear
22681
22682 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
22683
22684         * object.c: When allocating an array, we have to throw
22685         an overflow exception if any of the lengths are < 0.
22686
22687 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
22688
22689         * marshal.h marshal.c: Free unmanaged memory allocated by managed code
22690         properly. Also move implementation of string array marshalling to 
22691         managed code. Fixes #42316.
22692
22693 2004-09-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22694
22695         * assembly.c: provide more information when loading an assembly fails.
22696
22697 2004-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22698
22699         * filewatcher.c: don't expect the development fam package to be
22700         installed.
22701
22702 2004-09-03  Zoltan Varga  <vargaz@freemail.hu>
22703
22704         * marshal.c: Make a copy of the signature cookie since it will be
22705         freed by the caller.
22706         
22707         * marshal.c (mono_delegate_to_ftnptr): Fix bug in previous patch.
22708
22709         * marshal.c (mono_delegate_to_ftnptr): Fix memory leaks.
22710
22711         * metadata.c (mono_metadata_free_marshal_spec): New function to free
22712         marshal specs.
22713
22714         * marshal.c: More refactoring.
22715         
22716         * marshal.c: Refactor the mono_marshal_get_native_wrapper function into
22717         smaller functions.
22718
22719 2004-09-03  Lluis Sanchez Gual  <lluis@novell.com>
22720
22721         * object.c: In mono_message_invoke, fill the output parameter array after
22722           calling the managed method (it was done before the call). This fixes
22723           bug #59299.
22724
22725 2004-09-02  Zoltan Varga  <vargaz@freemail.hu>
22726
22727         * marshal.c (mono_marshal_alloc): Return a valid pointer on size 0
22728         as well.
22729
22730 2004-09-02  Martin Baulig  <martin@ximian.com>
22731
22732         * class.c (mono_class_instance_size): Don't allow generic type
22733         definitions or open generic instances.
22734         (mono_class_array_element_size): If we're a value type, call
22735         mono_class_instance_size() on the original class.
22736
22737         * metadata.c (mono_type_size, mono_type_stack_size): Correctly
22738         handle generic instances.
22739
22740         * mono-debug-debugger.c (write_type): Handle generic instances
22741         like classes.
22742
22743 2004-09-02  Zoltan Varga  <vargaz@freemail.hu>
22744
22745         * marshal.c (mono_marshal_alloc): Raise an OutOfMemory exception if
22746         the allocation request fails. Fixes #65089.
22747
22748         * object.c (mono_runtime_free_method): Do not call mono_free_method.
22749         
22750         * object.c (mono_runtime_free_method): New function to free a dynamic
22751         method.
22752
22753         * marshal.c (mono_delegate_free_ftnptr): New function to free the
22754         delegate trampoline.
22755
22756         * marshal.c (mono_marshal_get_managed_wrapper): Mark managed wrapper
22757         with hasthis as dynamic,
22758
22759         * icall.c (ves_icall_System_Delegate_FreeTrampoline): New icall.
22760
22761         * domain.c (mono_jit_info_table_remove): New function to remove an
22762         entry from the jit info table.
22763
22764         * class-internals.h (MonoMethod): Add 'dynamic' field.
22765
22766         * loader.c: Fix warnings.
22767
22768 2004-09-01  Martin Baulig  <martin@ximian.com>
22769
22770         * mono-debug.c, debug-mono-symfile.c: Use mono_loader_lock()
22771         instead of mono_debugger_lock() because the latter one is a no-op
22772         unless running in the debugger.
22773
22774 2004-09-01  Zoltan Varga  <vargaz@freemail.hu>
22775
22776         * class.c (class_compute_field_layout): Classes with auto-layout or
22777         reference fields are not blittable.
22778         
22779 2004-09-01  Dick Porter  <dick@ximian.com>
22780
22781         * icall.c (ves_icall_System_Reflection_Assembly_get_location): Use
22782         mono_image_get_filename() to get the assembly location.
22783
22784         * icall.c:
22785         * metadata.h: Fix compile warnings
22786
22787 2004-09-01  Zoltan Varga  <vargaz@freemail.hu>
22788
22789         * class.c (class_compute_field_layout): System.Object is blittable.
22790
22791         * marshal.c (mono_marshal_get_native_wrapper): Pass blittable classes
22792         as in/out. Fixes #59909.
22793
22794 2004-09-01  Martin Baulig  <martin@ximian.com>
22795
22796         * metadata.h (MONO_TYPE_ISREFERENCE): Call
22797         mono_metadata_generic_inst_is_valuetype() if we're a generic
22798         instance to check whether our underlying type is a reference type.
22799
22800 2004-09-01  Martin Baulig  <martin@ximian.com>
22801
22802         * metadata.c (mono_type_size): If we're a generic instance, call
22803         mono_class_value_size() for value types.
22804
22805 2004-08-31  Zoltan Varga  <vargaz@freemail.hu>
22806
22807         * marshal.c: Implement more custom marshalling functionality. Fixes
22808         #64915.
22809
22810 Tue Aug 31 17:55:15 CEST 2004 Paolo Molaro <lupus@ximian.com>
22811
22812         * mono-debug.c, debug-mono-symfile.c: add some locking love.
22813
22814 2004-08-30  Zoltan Varga  <vargaz@freemail.hu>
22815
22816         * domain-internals.h domain.c: Add a per-domain jump trampoline hash.
22817
22818         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandle): Rename to ...Internal.
22819
22820         * icall.c: Fix some warnings.
22821
22822         * threads.c (abort_appdomain_thread): Fix unref errors.
22823         (mono_thread_current): Fix THREAD_DEBUG define.
22824
22825 2004-08-29  Zoltan Varga  <vargaz@freemail.hu>
22826
22827         * metadata.h (MONO_TYPE_ISSTRUCT): Fix warning.
22828
22829         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandle): New icall.
22830
22831 2004-08-28  Zoltan Varga  <vargaz@freemail.hu>
22832
22833         * marshal.c (mono_marshal_get_native_wrapper): Add support for byref 
22834         string arrays.
22835
22836 2004-08-28  Martin Baulig  <martin@ximian.com>
22837
22838         * metadata.c
22839         (mono_metadata_generic_inst_is_valuetype): New public function.
22840
22841         * metadata.h (MONO_TYPE_ISSTRUCT): Call
22842         mono_metadata_generic_inst_is_valuetype() if we're a generic
22843         instance to check whether our underlying type is a valuetype.
22844
22845 2004-08-26  Zoltan Varga  <vargaz@freemail.hu>
22846
22847         * class.c (mono_ptr_class_get): Fix name of pointer classes. Fixes
22848         #63768.
22849
22850 2004-08-25  Martin Baulig  <martin@ximian.com>
22851
22852         * loader.c (mono_get_method_from_token): Abstract methods can also
22853         be generic and thus have type parameters.
22854
22855         * metadata-internals.h
22856         (MonoDynamicImage): Added `GPtrArray *gen_params'.
22857
22858         * reflection.c (mono_image_get_generic_param_info): Don't create a
22859         metadata row, just add an entry to the `gen_params' array.
22860         (build_compressed_metadata): Sort the `gen_params' array and then
22861         actually create the metadata.
22862
22863 2004-08-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22864
22865         * threadpool.c: remove unneeded 'if' around mono_monitor_enter.
22866
22867 2004-08-25  Zoltan Varga  <vargaz@freemail.hu>
22868
22869         * debug-helpers.c: Handle MONO_TYPE_GENERICINST.
22870
22871 2004-08-24  Martin Baulig  <martin@ximian.com>
22872
22873         * class.cs (mono_class_is_subclass_of): Like an interface, a
22874         generic instance also derives from System.Object.
22875
22876 2004-08-23  Zoltan Varga  <vargaz@freemail.hu>
22877
22878         * metadata.c (mono_metadata_parse_type): Alloc pinned, byref and
22879         custom modifiers to be in any order. Fixes #61990.
22880
22881 2004-08-20  Zoltan Varga  <vargaz@freemail.hu>
22882
22883         * object.c: Register mono_object_new_fast icall.
22884         
22885         * object.c (mono_class_get_allocation_ftn): Return to calling
22886         mono_object_new_fast, since it seems faster to compute the object 
22887         size in unmanaged code than passing it as a parameter.
22888
22889         * object.c (mono_class_get_allocation_ftn): Add marshalbyref case.
22890
22891         * gc-internal.h gc.c: Add mono_gc_out_of_memory () function. Register
22892         this function with Boehm as the oom handler, so we don't have to check
22893         the result of GC_malloc.
22894
22895         * object.c: Remove checks for oom.
22896
22897         * object.h object.c (mono_class_get_allocation_ftn): New function to
22898         return the icall which can be used to allocate an instance of a given
22899         class. 
22900
22901         * object.c: Handle common allocation requests using GC_gcj_fast_malloc.
22902
22903         * class-internals.h: Add 'enabled' field.
22904
22905 2004-08-19  Zoltan Varga  <vargaz@freemail.hu>
22906
22907         * domain.c (mono_init_internal): Call MONO_GC_PRE_INIT ().
22908
22909 2004-08-18  Jambunathan K  <kjambunathan@novell.com>
22910         * tabledefs.h: Corretced PARAM_ATTRIBUTE_OPTIONAL to the right
22911         value 0x0010.
22912
22913 2004-08-18 Ben Maurer  <bmaurer@users.sourceforge.net>
22914
22915         * appdomain.c: use the Tls function for appdomain too,
22916         at Zoltan's request. Actually return in mono_context_get
22917
22918         * appdomain.c, profiler.c, threads.c: use __thread
22919
22920 2004-08-18  Zoltan Varga  <vargaz@freemail.hu>
22921
22922         * appdomain.c threads.c: Call GC_CreateThread on windows.
22923
22924         * Makefile.am (libmetadata_la_LIBADD): Avoid linking libmonoos into
22925         multiple libraries since this don't work on windows.
22926
22927 2004-08-18  Martin Baulig  <martin@ximian.com>
22928
22929         * class-internals.h
22930         (MonoMethodNormal): Moved `MonoGenericParam *gen_params' here from
22931         MonoMethodHeader.
22932
22933         * metadata.h (MonoMethodHeader): Moved the `gen_params' field to
22934         MonoMethodNormal since we also need it for abstract and interface
22935         methods.
22936
22937         * reflection.c
22938         (build_compressed_metadata): Sort the GenericParam table.
22939         (mono_image_create_token): Added `gboolean create_methodspec'
22940         argument; this is false when generating a MethodImpl token.
22941         (reflection_methodbuilder_to_mono_method): Abstract and interface
22942         methods may also have generic parameters.
22943
22944 2004-08-17 Ben Maurer  <bmaurer@users.sourceforge.net>
22945
22946         * appdomain.c: thread local alloc
22947
22948 2004-08-17  Martin Baulig  <martin@ximian.com>
22949
22950         * appdomain.c: Bumped MONO_CORLIB_VERSION to 24.
22951
22952         * icall.c
22953         (ves_icall_System_MonoType_getFullName): Added `gboolean full_name'
22954         argument.
22955
22956         * class.c (mono_type_get_full_name): New public function.
22957         (mono_type_get_name): Don't include the type arguments.
22958
22959 2004-08-16  Zoltan Varga  <vargaz@freemail.hu>
22960
22961         * Makefile.am: Build static versions of libmetadata and libmonoruntime
22962         for inclusion into the mono executable.
22963
22964 2004-08-16  Martin Baulig  <martin@ximian.com>
22965
22966         * metadata.c (do_mono_metadata_parse_generic_inst): Store the
22967         MonoGenericInst, not the MonoType in the `generic_inst_cache'.
22968
22969 2004-08-14  Martin Baulig  <martin@ximian.com>
22970
22971         * class.c (dup_type): Also copy the `byref' field.
22972
22973 2004-08-15  Zoltan Varga  <vargaz@freemail.hu>
22974
22975         * reflection.c (create_dynamic_mono_image): Revert the last change 
22976         since it breaks bootstrap.
22977
22978 2004-08-14  Zoltan Varga  <vargaz@freemail.hu>
22979
22980         * reflection.c (create_dynamic_mono_image): Set ref_count to 1.
22981
22982         * image.c (mono_image_close): Dynamic images are GC_MALLOCed, so do
22983         not free them with g_free.
22984
22985 2004-08-11  Martin Baulig  <martin@ximian.com>
22986
22987         * reflection.c (mono_reflection_setup_internal_class): Also call
22988         mono_class_setup_mono_type() if we already have a `tb->type.type'.
22989
22990 2004-08-09  Sebastien Pouliot  <sebastien@ximian.com>
22991
22992         * appdomain.c: Fix ves_icall_System_AppDomain_getDomainByID when 
22993         called during default (first) AppDomain creation. Keep track of
22994         Evidence when loading assemblies.
22995
22996 Mon Aug 9 14:41:45 CEST 2004 Paolo Molaro <lupus@ximian.com>
22997
22998         * opcodes.c, opcodes.h: reduce runtime relocations.
22999
23000 Mon Aug 9 13:30:53 CEST 2004 Paolo Molaro <lupus@ximian.com>
23001
23002         * culture-info.h, locales.c: fixes and chages to sue the new
23003         optimized format of the locale data.
23004         * culture-info-tables.h: regenerated.
23005
23006 2004-08-06  Geoff Norton <gnorton@customerdna.com>
23007         
23008         * filewatcher.c: If HAVE_KQUEUE return mode 3 to use the new kqueue watcher
23009
23010 2004-08-05  Sebastien Pouliot  <sebastien@ximian.com>
23011
23012         * appdomain.c: Bumped MONO_CORLIB_VERSION to 23. Added new icall
23013         ves_icall_System_AppDomain_getDomainByID to get an AppDomain by Id.
23014         * domain-internals.h: icall declaration.
23015         * icall.c: icall registration.
23016         * object-internals.h: New fields in MonoAssembly for CAS.
23017
23018 2004-08-05  Duncan Mak  <duncan@ximian.com>
23019
23020         * verify.c: Renamed CEE_STELEM to CEE_STELEM_ANY and CEE_LDELEM to
23021         CEE_LDELEM_ANY.
23022
23023 Thu Aug 5 17:11:44 CEST 2004 Paolo Molaro <lupus@ximian.com>
23024
23025         * reflection.c: fix to deal with object[] arrays in custom ctors
23026         (bug #62550).
23027
23028 2004-08-05  Martin Baulig  <martin@ximian.com>
23029
23030         * class.c (mono_class_array_element_size): Added support for
23031         generic instances and correctly handle "recursive" types.
23032
23033 2004-08-05  Zoltan Varga  <vargaz@freemail.hu>
23034
23035         * assembly.c: Fix warnings.
23036
23037 2004-08-04  Martin Baulig  <martin@ximian.com>
23038
23039         * class.c
23040         (mono_type_get_name_recurse): Added `gboolean include_arity'
23041         argument specifying whether or not we should include the generic
23042         arity in the type name.
23043         (_mono_type_get_name): New static function.
23044         (mono_class_setup_vtable): If we're a generic instance, don't
23045         include the generic arity in the names of explicit method
23046         implementations.        
23047
23048 2004-08-03  Martin Baulig  <martin@ximian.com>
23049
23050         * class.c (mono_type_get_name_recurse): Enclose the generic type
23051         arguments in `<', '>'.
23052
23053 Tue Aug 3 17:54:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
23054
23055         * gc.c: make GC warning messages use the trace API, they are just
23056         noise to most of the users.
23057
23058 2004-08-03  Martin Baulig  <martin@ximian.com>
23059
23060         * debug-mono-symfile.c (read_string): Correctly read the string.
23061
23062 2004-07-30  Zoltan Varga  <vargaz@freemail.hu>
23063
23064         * marshal.c (signature_dup_add_this): Fix bug in previous patch.
23065         
23066         * marshal.c (mono_marshal_get_icall_wrapper): Add support for vararg
23067         icalls.
23068         (mono_marshal_get_runtime_invoke): Correctly handle valuetype methods.
23069
23070 2004-07-30  Martin Baulig  <martin@ximian.com>
23071
23072         * debug-mono-symfile.c, mono-debug.c, mono-debug-debugger.c:
23073         Reflect latest symbol writer changes.   
23074
23075 Fri Jul 30 16:49:05 CEST 2004 Paolo Molaro <lupus@ximian.com>
23076
23077         * object.c: always create an object if null is passed
23078         to Invoke() where a valuetype is expected.
23079
23080 2004-07-29  Bernie Solomon  <bernard@ugsolutions.com>
23081
23082         * marshal.c (mono_marshal_init): make managed
23083         signatures match native ones better for 64bits.
23084
23085 2004-07-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23086
23087         * appdomain.c: hack to build correctly the private bin path on windows.
23088         Fixes bug #61991.
23089
23090 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
23091
23092         * assembly.c: Load mscorlib from the correct framework directory
23093           (mono/<version>/mscorlib.dll).
23094         * appdomain.h: Added prototypes for new functions.
23095         * internals.h: Added some prototypes.
23096         * domain.c: When initializing the runtime, get from the executable and
23097           the configuration files the runtime version that the app supports.
23098           Added support methods for reading app.exe.config. Added list of versions
23099           supported by the JIT. Added two new methods: mono_init_from_assembly,
23100           which initializes the runtime and determines the required version from
23101           the provided exe file, and mono_init_version, which initializes
23102           the runtime using the provided version.
23103         * icall.c: Get machine.config from version-specific directory.
23104         * reflection.c: When generating an image, embed the version number
23105           of the current runtime.
23106
23107 2004-07-28  Dick Porter  <dick@ximian.com>
23108
23109         * socket-io.c
23110         (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal): Check
23111         returned sockaddr size before creating the remote address object.
23112         Patch by Nick Vaughan (dev@6wardlaw.freeserve.co.uk), fixes bug
23113         61608.
23114
23115 2004-07-28  Dick Porter  <dick@ximian.com>
23116
23117         * locales.c (string_invariant_compare_char): Fix invariant char
23118         compares between upper and lower cases.  Fixes bug 61458.
23119
23120 2004-07-27  Ben Maurer  <bmaurer@ximain.com>
23121         
23122         * marshal.c: actually cache stelem.ref wrappers.
23123         
23124 Tue Jul 27 16:56:55 CEST 2004 Paolo Molaro <lupus@ximian.com>
23125
23126         * class.c, image.c, loader.c, cil-coff.h: lazily mmap the image 
23127         sections and remove the mono_cli_rva_map () function.
23128
23129 Tue Jul 27 15:58:19 CEST 2004 Paolo Molaro <lupus@ximian.com>
23130
23131         * debug-mono-symfile.c: fix one more endianess issue, from a patch
23132         by Geoff Norton (<gnorton@customerdna.com>).
23133
23134 Tue Jul 27 15:47:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
23135
23136         * class.c: fix class loads for pointer types (typeof(int) !=
23137         typeof(int*)).
23138
23139 2004-07-27  Martin Baulig  <martin@ximian.com>
23140
23141         * debug-mono-symfile.c (mono_debug_open_mono_symbol_file): Support
23142         reading the debugging information from an external ".mdb" file.
23143
23144 2004-07-24  Martin Baulig  <martin@ximian.com>
23145
23146         * reflection.c (mono_image_get_type_info): Only write a class
23147         layout entry if we actually have a size or a packing size.
23148
23149 2004-07-21  Bernie Solomon  <bernard@ugsolutions.com>
23150
23151         * reflection.c (type_get_fully_qualified_name): 
23152         insert cast to get type checking of ?: with non-gcc compilers
23153
23154 2004-07-21  Bernie Solomon  <bernard@ugsolutions.com>
23155
23156         * rand.c: use g_getenv for both lookups of
23157         MONO_EGD_SOCKET
23158
23159 2004-07-17  Martin Baulig  <martin@ximian.com>
23160
23161         * reflection.c (mono_reflection_bind_generic_method_parameters):
23162         Set `gmethod->reflection_info'.
23163
23164 2004-07-17  Martin Baulig  <martin@ximian.com>
23165
23166         * class.c (mono_class_create_from_typedef): Insert the newly
23167         created class into the hash table before computing the interfaces
23168         since we could be called recursively.
23169
23170 2004-07-16  Ben Maurer  <bmaurer@ximain.com>
23171
23172         * marshal.[ch] (mono_marshal_get_stelemref): a new wrapper
23173         function to implement stelem.ref in managed code
23174         * class-internals.h, debug-helpers.c: a new wrapper type
23175         for the above.
23176
23177 Wed Jul 14 19:26:05 CEST 2004 Paolo Molaro <lupus@ximian.com>
23178
23179         * gc.c: allow GC handles to work even when no GC is compiled in.
23180         Fix part of bug #61134 (GetAddrOfPinnedObject).
23181
23182 2004-07-13  Peter Williams  <peter@newton.cx>
23183  
23184         * process.c (complete_path): Make sure we don't attempt to execute
23185         directories.
23186  
23187 2004-07-12  Geoff Norton <gnorton@customerdna.com>
23188
23189         * DateTime.cs: Patch for bug #61112.  Our DateTime wasn't roundtripping over timezone
23190           boundaries properly.  This patch checkes ToLocalTime() to see if we're tripping over a boundary
23191           and will add/subtract the hour if needed
23192
23193 2004-07-12  Martin Baulig  <martin@ximian.com>
23194
23195         * reflection.c (mono_field_get_object): If we have
23196         `field->generic_info', take the attributes from
23197         `field->generic_info->generic_type'.    
23198
23199 2004-07-12  Martin Baulig  <martin@ximian.com>
23200
23201         * mono-debug.c (mono_debug_init): Don't take a `MonoDomain *'.
23202         This function must be called before initializing the runtime.
23203         (mono_debug_init_1): New function; call this after initializing
23204         the runtime, but before loading the assembly.  It tells the
23205         debugger to load corlib and the builtin types.
23206
23207         * mono-debug-debugger.c: Did some larger changes in the debugging
23208         code; support recursive class declarations, make sure we actually
23209         add all classes.
23210
23211 2004-07-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23212
23213         * debug-helpers.c: undo my previous patch and fixed the real issue in
23214         ../mini/exceptions-x86.c
23215
23216 2004-07-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23217
23218         * debug-helpers.c: prevent SIGSEGV. It happened running xsp on monodoc
23219         when no HOME env. variable was set and a NullRef was thrown in a .cctor
23220         called from other .cctors.
23221
23222 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
23223
23224         * loader.c: Removed the mono_loader_wine_init hack now that we are
23225         doing a managed version of Windows.Forms.
23226
23227 2004-07-09  Ben Maurer  <bmaurer@ximian.com>
23228
23229         * domain.c, gc.c, marshal.c, mono-debug-debugger.c,
23230         threadpool.c, threads.c: remove static data from rootset.
23231
23232 2004-07-09  Dick Porter  <dick@ximian.com>
23233
23234         * locales.c (ves_icall_System_String_InternalReplace_Str_Comp):
23235         Don't do any more processing if the matched length was 0.  It was
23236         increasing the size of the string before.  Fixes bug 61167.
23237
23238 2004-07-09  Dick Porter  <dick@ximian.com>
23239
23240         * socket-io.h:
23241         * socket-io.c
23242         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
23243         Add support for SO_PEERCRED if its available.
23244
23245 2004-07-09  Peter Bartok <pbartok@novell.com>
23246         * loader.c: winelib.exe.so error message is now only displayed if
23247         MONO_DEBUG is set. To help us avoid questions when people are trying
23248         out the new Managed.Windows.Forms.
23249
23250 2004-07-08  Zoltan Varga  <vargaz@freemail.hu>
23251
23252         * class-internals.h debug-helpers.c marshal.c: Add new wrapper types 
23253         for isinst and castclass wrappers.
23254
23255         * class-internals.h icall.c: Move registration and lookup of JIT icalls
23256         to libmetadata from the JIT, so they could be used by the marshalling
23257         code and the interpreter.
23258
23259         * marshal.c: Register marshalling related JIT icalls here instead of
23260         in mini.c. Use CEE_MONO_ICALL instead of the family of 
23261         CEE_MONO_PROC<x> opcodes to call marshalling functions.
23262
23263         * metadata.h: Remove unneeded marshalling conversions.
23264
23265         * opcodes.c: Update for new opcodes.
23266         
23267 2004-07-08  Martin Baulig  <martin@ximian.com>
23268
23269         * mono-debug.c: Check for `handle->symfile' being non-NULL everywhere.
23270         (mono_debug_get_domain_data): Make this function static.
23271
23272 Wed Jul 7 12:32:29 CEST 2004 Paolo Molaro <lupus@ximian.com>
23273
23274         * gc.c, object.h: add nice GC handle API for embedders.
23275
23276 2004-07-06  Ben Maurer  <bmaurer@ximian.com>
23277
23278         * reflection.c: more changes for the new api
23279
23280         * object.c: When we reflect on a field w/ a constant value, it
23281         will not have a memory location, so we must access metadata. Also,
23282         allow easier reading of strings so that we can read them from
23283         the constant data.
23284
23285         * class.c (mono_class_layout_fields): no need for literal fields here.
23286
23287         * class-internals.h: api changes for const fields
23288
23289         * icall.c (ves_icall_get_enum_info): use new apis for const fields
23290
23291 2004-07-06  Martin Baulig  <martin@ximian.com>
23292
23293         * mono-debug.h: Increment version number to 44.
23294
23295         * mono-debug.c (mono_debug_add_wrapper): The second argument is
23296         now a gpointer, rewrote this whole method.
23297
23298         * mono-debug-debugger.c (mono_debugger_add_wrapper): New
23299         function.  Add information about the wrapper in a new "misc table".
23300
23301         * mono-debug-debugger.h (MonoDebuggerSymbolTable): Added fields
23302         for the new misc table.
23303
23304 2004-07-05  Zoltan Varga  <vargaz@freemail.hu>
23305
23306         * metadata-internals.h image.c: Add a cache for helper signatures.
23307
23308         * monosn.c: Applied patch from "grompf" (grompf@sublimeintervention.com). Fix compilation under OSX.
23309
23310 2004-07-03  Zoltan Varga  <vargaz@freemail.hu>
23311
23312         * marshal.c (mono_marshal_get_managed_wrapper): Handle returning
23313         delegates from a delegate. Fixes #61033.
23314         
23315         * marshal.c: Fix managed->native stringbuilder marshalling. Implement
23316         marshalling of stringbuilder arrays. Fixes #59900.
23317
23318 2004-07-02  Zoltan Varga  <vargaz@freemail.hu>
23319
23320         * icall.c: Add EnumBuilder:setup_enum_type icall.
23321
23322 2004-06-30  Ben Maurer  <bmaurer@ximian.com>
23323
23324         * icall.c: Added a new icall for the property version of
23325         OffsetOfStringData.
23326
23327 2004-06-30  Zoltan Varga  <vargaz@freemail.hu>
23328
23329         * class-internals.h (MonoVTable): Make max_interface_id a guint32 so
23330         it has a constant size across platforms.
23331
23332         * marshal.c (mono_delegate_end_invoke): Avoid crash when there is no
23333         stack trace.
23334
23335 2004-06-29  Martin Baulig  <martin@ximian.com>
23336
23337         * mono-debug.c (mono_debug_add_method): Protect the whole function
23338         in mono_debugger_lock(), not just parts of it.
23339
23340 Fri Jun 25 21:36:26 CEST 2004 Paolo Molaro <lupus@ximian.com>
23341
23342         * reflection.c: make sure padding bytes in heaps are zeroed.
23343
23344 2004-06-24  David Waite  <mass@akuma.org>
23345
23346         * appdomain.c, class.c, domain.c, file-io.c, gc.c, icall.c,
23347         image.c, loader.c, locales.c, marshal.c, metadata.c,
23348         mono-debug.[ch], object.c, reflection.c, security.c, socket-io.c,
23349         string-icalls.c, threads.c: change to C90-style comments from C99 /
23350         C++ -style
23351
23352 2004-06-24  Dick Porter  <dick@ximian.com>
23353
23354         * threads.c
23355         (ves_icall_System_Threading_Mutex_CreateMutex_internal): Correctly
23356         return createdNew.  Fixes bug 60412.
23357
23358         * threads-types.h: 
23359         * icall.c: Add createdNew parameter to CreateMutex icall
23360
23361 Thu Jun 24 16:06:41 CEST 2004 Paolo Molaro <lupus@ximian.com>
23362
23363         * reflection.c, object-internals.h: save default value in params.
23364
23365 2004-06-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23366
23367         * appdomain.c: for paths in PrivateBinPath that are absolute, there's
23368         no need to build a new path combining that with the application base.
23369         Fixes bug #60442.
23370
23371 Wed Jun 23 18:36:58 CEST 2004 Paolo Molaro <lupus@ximian.com>
23372
23373         * reflection.c: fixed minor standard compliance issues.
23374
23375 Wed Jun 23 17:59:29 CEST 2004 Paolo Molaro <lupus@ximian.com>
23376
23377         * reflection.c: fixed issue with encoding some custom attributes
23378         (arrays in properties and fields, bug #60411).
23379
23380 2004-06-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23381
23382         * reflection.c: fix start address when copying the public key token.
23383
23384 2004-06-23  Martin Baulig  <martin@ximian.com>
23385
23386         * mono-debug-debugger.c (mono_debugger_unhandled_exception): Store
23387         the `exc' object in a static object to put it into the GC's root set.
23388
23389 Wed Jun 23 15:37:31 CEST 2004 Paolo Molaro <lupus@ximian.com>
23390
23391         * reflection.c: make mono_reflection_setup_internal_class ()
23392         callable a second time to setup a new parent class.
23393
23394 2004-06-23  Dick Porter  <dick@ximian.com>
23395
23396         * threads.c: Check for WAIT_IO_COMPLETION return values.
23397
23398 2004-06-22  Sebastien Pouliot  <sebastien@ximian.com>
23399
23400         * appdomain.c: Removed the g_free on the public key token. Now copy 
23401         the pk token string into the MonoAssemblyName buffer using g_strlcpy.
23402         * assembly.c: Added public key token string value when loading 
23403         assemblies. Fix bug #60439.
23404         * icall.c: Added missing informations (like public key) in 
23405         GetReferencedAssemblies. Fix #60519.
23406         * image.h: Changed definition for public key token from const char*
23407         public_tok_value to guchar public_key_token [17];
23408         * reflection.c: Updated for changes to public key token.
23409
23410 2004-06-22  Lluis Sanchez Gual
23411
23412         * icall.c: In ves_icall_InternalExecute, when setting a filed, also look 
23413         for the field in base classes.
23414
23415 Tue Jun 22 16:48:02 CEST 2004 Paolo Molaro <lupus@ximian.com>
23416
23417         * mono-debug.h, mono-debug-debugger.h, debug-mono-symfile.h:
23418         mark headers as not supported, they are installed only for use by the
23419         debugger.
23420
23421 Tue Jun 22 16:32:03 CEST 2004 Paolo Molaro <lupus@ximian.com>
23422
23423         * *.c, *.h: avoid namespace pollution in public headers.
23424
23425 2004-06-21  Martin Baulig  <martin@ximian.com>
23426
23427         * exception.c (mono_get_exception_security): It's in
23428         "System.Security", not in "System".
23429
23430         * mono-debug-debugger.c (mono_debugger_add_builtin_types): Add all
23431         the exception classes.
23432
23433 2004-06-21  Martin Baulig  <martin@ximian.com>
23434
23435         * mono-debug-debugger.c (mono_debugger_unhandled_exception):
23436         Protect the exception object from being finalized.
23437
23438 2004-06-21  Martin Baulig  <martin@ximian.com>
23439
23440         * mono-debug-debugger.h (mono_debugger_unhandled_exception): New
23441         public function.
23442
23443 2004-06-21  Sebastien Pouliot  <sebastien@ximian.com>
23444
23445         * reflection.c: Load the assembly in mono_reflection_type_from_name,
23446         if it was not loaded before. Fix parts of #60439.
23447
23448 Mon Jun 21 16:04:43 CEST 2004 Paolo Molaro <lupus@ximian.com>
23449
23450         * marshal.c, icall.c, object.c, image.c: fix the runtime_invoke ()
23451         code that was broken since Ben's change: wrappers are now
23452         dependent on the method signature only again.
23453
23454 2004-06-21  Martin Baulig  <martin@ximian.com>
23455
23456         * mono-debug-debugger.c (write_class): Cleaned this up a bit and
23457         added interface support.
23458
23459 2004-06-21  Martin Baulig  <martin@ximian.com>
23460
23461         * class.c (mono_vtable_get_static_field_data): New public method.
23462
23463 2004-06-20  Atsushi Enomoto  <atsushi@ximian.com>
23464
23465         * filewatcher.c : Windows build fix to be compliant with API changes.
23466
23467 Sat Jun 19 19:04:50 CEST 2004 Paolo Molaro <lupus@ximian.com>
23468
23469         * class.h, class.c: more accessors.
23470         * metadata.h, metadata.c: prepare for hiding MonoType and
23471         MonoMethodSignature: people should use the accessors from now on
23472         outside of the tree.
23473
23474 Sat Jun 19 17:56:50 CEST 2004 Paolo Molaro <lupus@ximian.com>
23475
23476         * *.c, *.h: more API cleanups.
23477
23478 2004-06-18  Jackson Harper  <jackson@ximian.com>
23479
23480         * assembly.c: Trace loading assemblies.
23481         * loader.c: Trace loading native libraries.
23482         * mono-config.c: Trace loading config files.
23483         
23484 2004-06-18  Dick Porter  <dick@ximian.com>
23485
23486         * locales.c: Tell ICU the lengths of strings, it can cope with
23487         embedded \0 then.  Fixes bug 59274, and doesn't break bug 55822.
23488
23489 Fri Jun 18 11:59:57 CEST 2004 Paolo Molaro <lupus@ximian.com>
23490
23491         * image.c: swapped name/filename;
23492
23493 2004-06-18  Martin Baulig  <martin@ximian.com>
23494
23495         * mono-debug-debugger.c (write_class): Write the parent class at
23496         the end of the header.
23497
23498 Thu Jun 17 16:50:44 CEST 2004 Paolo Molaro <lupus@ximian.com>
23499
23500         * *.c, *.h, Makefile.am: more API cleanups and bugfixes.
23501
23502 2004-06-17  Raja R Harinath  <rharinath@novell.com>
23503
23504         * Makefile.am (PLATFORM_LIB): New.  Possibly refer to ../os/libmonoos.la.
23505         (bundle_obj): New conditional define.
23506         (BUILT_SOURCES): Remove.
23507         ($(bundle_srcs)): Make parallel-make safe.
23508         (libmonoruntime_la_LIBADD): Make unconditional.
23509         (libmetadata_la_LIBADD): Make unconditional.  Refer to $(bundle_obj).
23510         (libmetadata_la_SOURCES): Don't refer to $(bundle_srcs).
23511
23512 2004-06-17  Atsushi Enomoto  <atsushi@ximian.com>
23513
23514         * culture-info-tables.h: It was inconsistent with the latest
23515           supp info files.
23516
23517 2004-06-17  Zoltan Varga  <vargaz@freemail.hu>
23518
23519         * assembly.c (mono_assembly_open): Fix crash when the assembly can't
23520         be loaded.
23521
23522         * threads.c (ves_icall_System_Threading_Thread_Resume): Fix compilation
23523         with gcc 2.95.
23524
23525 Wed Jun 16 18:23:45 CEST 2004 Paolo Molaro <lupus@ximian.com>
23526
23527         * threads.h, icall.c, object.c, threadpool.c, threads-types.h:
23528         cleaned up public header threads.h.
23529
23530 Wed Jun 16 18:11:41 CEST 2004 Paolo Molaro <lupus@ximian.com>
23531
23532         * Makefile.am, *.c, *.h: more API cleanups.
23533
23534 Wed Jun 16 14:33:22 CEST 2004 Paolo Molaro <lupus@ximian.com>
23535
23536         * Makefile.am: removed monosn from compilation.
23537         * appdomain.c, assembly.c, assembly.h, blob.h, class.c,
23538         debug-helpers.c, debug-mono-symfile.c, domain.c, icall.c,
23539         image.c, image.h, loader.c, marshal.c, metadata-internals.h,
23540         metadata.c, metadata.h, mono-config.c, mono-debug-debugger.c,
23541         mono-debug.c, object.c, opcodes.c, opcodes.h, pedump.c, process.c,
23542         reflection.c, reflection.h, verify.c: more API cleanups and fixes.
23543
23544 2004-06-15  Jackson Harper  <jackson@ximian.com>
23545
23546         * assembly.c: Make locales lower case when searching the GAC for
23547         assemblies. gacutil will always make locales lowercase when
23548         installing so this effectively makes them case insensitive.
23549         
23550 2004-06-15  Lluis Sanchez Gual  <lluis@ximian.com>
23551
23552         * locales.c, threadpool.c: use mono_monitor_enter instead of mono_monitor_try_enter.
23553         * monitor.c: New method mono_monitor_try_enter_internal, which takes a new
23554           parameter which allows to choose whether the wait can be interrupted or 
23555           not. Also added the method mono_monitor_enter(), which locks the monitor
23556           using an infinite wait and without allowing interruption.
23557           In the Monitor.Enter and Wait icalls, retry the lock if the wait is
23558           interrupted.
23559         * object.h: Added new fields in MonoThread. suspend_event holds the event
23560           used to susped/resume the thread. synch_lock is the lock object to use for
23561           modifying the thread state.
23562         * threads.c: Use the new synch_lock object for locking, instead of "this",
23563           which can generate deadlocks.
23564           Moved thread state change in Thread.Sleep and Thread.Join from managed
23565           to unmanaged code. This avoids a deadlock when the thread was suspended
23566           just after acquiring the thread lock.
23567           In general, use mono_monitor_enter instead of mono_monitor_try_enter.
23568           Implemented Thread.Suspend using an event instead of ThreadSuspend,
23569           which is not fully implemented in the io-layer.
23570         * socket-io.c: Only try IPv6 DNS lookup if IPv4 fails.
23571
23572 Tue Jun 15 18:34:21 CEST 2004 Paolo Molaro <lupus@ximian.com>
23573
23574         * Makefile.am, monitor.h, object.h, threadpool.c, threadpool.h,
23575         threads-types.h: more API cleanups.
23576
23577 Tue Jun 15 16:40:19 CEST 2004 Paolo Molaro <lupus@ximian.com>
23578
23579         * domain-internals.h, Makefile.am, appdomain.c, appdomain.h,
23580         domain.c, gc.c, icall.c, mono-debug.c, object.c, reflection.c,
23581         threadpool.c, threads.c: first pass at the exported API cleanup.
23582
23583 Tue Jun 15 15:29:47 CEST 2004 Paolo Molaro <lupus@ximian.com>
23584
23585         * icall.c: fix signatures of some VolatileRead and VolatileWrite icalls.
23586
23587 2004-06-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23588
23589         * icall.c: added internalGetHome.
23590
23591 2004-06-14  Dick Porter  <dick@ximian.com>
23592
23593         * file-io.c (ves_icall_System_IO_MonoIO_FindFirstFile): It was
23594         possible to return successfully when '.' or '..' were the only
23595         entries in a directory, but were skipped.  The MonoIOStat was not
23596         filled in in that case.  Now return ERROR_NO_MORE_FILES instead.
23597         Fixes bug 59574.
23598
23599 Mon Jun 14 00:27:15 CEST 2004 Paolo Molaro <lupus@ximian.com>
23600
23601         * reflection.c: make binaries run on .Net 1.1 by default.
23602
23603 Sun Jun 13 18:22:40 CEST 2004 Paolo Molaro <lupus@ximian.com>
23604
23605         * threadpool.c, threadpool.h: use the correct return type in SetMinThreads ().
23606
23607 Sun Jun 13 16:44:39 CEST 2004 Paolo Molaro <lupus@ximian.com>
23608
23609         * marshal.c: keep track of struct size with explicit layout
23610         (bug #59979).
23611
23612 2004-06-12  Martin Baulig  <martin@ximian.com>
23613
23614         * mono-debug-debugger.c: Comment out a debugging g_message().
23615
23616 Sat Jun 12 14:15:02 CEST 2004 Paolo Molaro <lupus@ximian.com>
23617
23618         * reflection.c, reflection.h: do not free custom attrs that are cached.
23619         * icall.c: use braces to make code clearer.
23620
23621 2004-06-11  Martin Baulig  <martin@ximian.com>
23622
23623         * class.h (MonoInflatedField): New type.
23624         (MonoClassField): Replaced `MonoType *generic_type' with
23625         `MonoInflatedField *generic_info'.
23626
23627         * icall.c
23628         (ves_icall_MonoField_Mono_GetGenericFieldDefinition): New icall.
23629
23630 2004-06-11  Martin Baulig  <martin@ximian.com>
23631
23632         * reflection.c (mono_image_create_method_token): Correctly encode
23633         varargs methods.
23634
23635 2004-06-11  Martin Baulig  <martin@ximian.com>
23636
23637         * metadata.c (mono_metadata_parse_method_signature): When parsing
23638         a MethodDef which has VarArgs, also set sentinelpos if we don't
23639         have any parameters.
23640
23641 2004-06-11  Martin Baulig  <martin@ximian.com>
23642
23643         * verify.c (mono_method_verify): In CEE_CALL, use
23644         mono_method_get_signature() to get the method's signature, unless
23645         we're a PInvoke method.
23646
23647 2004-06-10  Jackson Harper  <jackson@ximian.com>
23648
23649         * assembly.c: Use <path>/lib/mono/gac for the extra paths
23650         lookup. Rename MONO_GAC_PATH to MONO_GAC_PREFIX, this is a more
23651         logical name as the supplied path is just a prefix to the gac not
23652         the direct path to it.
23653         
23654 Thu Jun 10 20:10:16 CEST 2004 Paolo Molaro <lupus@ximian.com>
23655
23656         * reflection.c: make the token for a created method match
23657         the token of the MethodBuilder it was created from
23658         (IKVM requires this behaviour now).
23659
23660 Thu Jun 10 16:02:27 CEST 2004 Paolo Molaro <lupus@ximian.com>
23661
23662         * image.c, image.h, appdomain.c, assembly.c, loader.c, metadata.c,
23663         reflection.c, socket-io.c: leak fixes.
23664
23665 Wed Jun 9 18:23:59 CEST 2004 Paolo Molaro <lupus@ximian.com>
23666
23667         * icall.c: handle sentinel pos in vararg methods in position different
23668         from 0.
23669
23670 2004-06-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23671
23672         * culture-info-tables.h: freshly generated.
23673
23674 2004-06-09  Martin Baulig  <martin@ximian.com>
23675
23676         * loader.c (mono_get_method_constrained): Call `mono_class_init
23677         (constrained_class)'.   
23678
23679 2004-06-08  Gert Driesen <drieseng@users.sourceforge.net>
23680
23681         * icall.c (ves_icall_MonoType_GetEvent): Handle events without
23682         any methods. Fixes #59629.
23683
23684 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
23685
23686         * culture-info-tables.h: reflecting locale-builder updates.
23687
23688 2004-06-08  Dick Porter  <dick@ximian.com>
23689
23690         * object.h:
23691         * locales.c: Fixed compile warnings, including a real bug in
23692         CompareInfo_internal_compare.
23693         
23694 2004-06-08  Dick Porter  <dick@ximian.com>
23695
23696         * locales.c
23697         (ves_icall_System_Globalization_CompareInfo_internal_index):
23698         (ves_icall_System_Globalization_CompareInfo_internal_index_char):
23699         Double-check the resuls of usearches, because ICU currently
23700         ignores most of the collator settings here.  Fixes bug 59720.
23701         
23702 2004-06-08  Dick Porter  <dick@ximian.com>
23703
23704         * locales.c
23705         (ves_icall_System_Globalization_CompareInfo_internal_index_char):
23706         Fix memory leak and segfault-causing typo.  No idea how this one
23707         lasted so long without being noticed.
23708
23709 2004-06-09  Zoltan Varga  <vargaz@freemail.hu>
23710
23711         * icall.c (ves_icall_Type_GetEvents_internal): Handle events without
23712         any methods. Fixes #59629.
23713
23714 2004-06-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23715
23716         * assembly.c:
23717         (mono_assembly_load): search_loaded -> mono_assembly_loaded (we didn't
23718         own the critical section before). Removed dead code (that's done
23719         in the preload hook).
23720
23721         (mono_assembly_load_with_partial_name): call the preload hook.
23722
23723 2004-06-08  Martin Baulig  <martin@ximian.com>
23724
23725         * metadata.c (mono_metadata_signature_alloc): Default
23726         `sentinelpos' to -1.
23727
23728         * reflection.c (mono_image_get_array_token): Likewise.
23729
23730 2004-06-08  Martin Baulig  <martin@ximian.com>
23731
23732         * icall.c (ves_icall_ModuleBuilder_getMethodToken): New icall.
23733
23734         * metadata.c (mono_metadata_parse_method_signature): When parsing
23735         a MethodDef which has VarArgs, set sentinelpos.
23736
23737         * metadata.h (MonoMethodSignature): Make `sentinalpos' a signed
23738         `gint16' since we're using -1 for non-varargs methods.
23739
23740         * reflection.c
23741         (ReflectionMethodBuilder): Added `MonoArray *opt_types'.
23742         (method_encode_signature): Added varargs support.
23743         (method_builder_encode_signature): Likewise.
23744         (mono_image_get_varargs_method_token): New static method.
23745         (mono_image_create_method_token): New public method; this is
23746         called via an icall instead of mono_image_create_token() when
23747         calling a varargs method.       
23748
23749 2004-06-08  Lluis Sanchez Gual  <lluis@ximian.com>
23750
23751         * locales.c: Fixed memory leak in Char.ToLower/ToUpper.
23752
23753 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
23754
23755         * culture-info-tables.h : Reflecting the latest locale-builder that
23756           fixed empty array representation ({} to {0}).
23757
23758 2004-06-07  Jackson Harper  <jackson@ximian.com>
23759
23760         * assembly.c: It should be <MONO_GAC_PATH>/lib/mono/gac when
23761         looking up extra gac paths. This allows MONO_GAC_PATH to act
23762         exactly like a prefix.
23763         
23764 2004-06-08  Zoltan Varga  <vargaz@freemail.hu>
23765
23766         * reflection.c (mono_reflection_type_from_name): Make a copy of the
23767         type name before modifying it. Fixes #59405.
23768
23769 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
23770
23771         * culture-info.h: added fields for "all datetime patterns".
23772         * locales.c: (  ves_icall_System_Globalization_CultureInfo
23773           _construct_datetime_format ()): fill xxx_patterns fields.
23774         * object.h: added fields for "all datetime patterns" to
23775           MonoDateTimeFormatInfo.
23776         * culture-info-tables.h: reflecting locale-builder updates.
23777
23778 2004-06-08  Zoltan Varga  <vargaz@freemail.hu>
23779
23780         * icall.c (ves_icall_Type_GetEvents_internal): Handle the case when
23781         the event has no add and remove methods. Fixes #59629.
23782
23783 2004-06-05  Sebastien Pouliot  <sebastien@ximian.com>
23784
23785         * object.c: Fixed possible integer overflow when allocating large
23786         strings.
23787
23788 2004-06-05  Atsushi Enomoto  <atsushi@ximian.com>
23789
23790         * culture-info-tables.h: reflecting locale-builder updates.
23791
23792 2004-06-05  Atsushi Enomoto  <atsushi@ximian.com>
23793
23794         * culture-info-tables.h: reflecting locale-builder updates.
23795
23796 2004-06-03  Atsushi Enomoto  <atsushi@ximian.com>
23797
23798         * culture-info-tables.h: reflecting locale-builder updates.
23799
23800 2004-06-03  Lluis Sanchez Gual  <lluis@ximian.com>
23801
23802         * threads.c: Made Thread.Sleep abortable.
23803
23804 2004-06-02  Martin Baulig  <martin@ximian.com>
23805
23806         * mono-debug.h (MONO_DEBUGGER_VERSION): Bumped version to 41.
23807
23808         * debug-mono-symfile.h: Bumped symbol file version number to 37.
23809
23810 2004-05-31  Zoltan Varga  <vargaz@freemail.hu>
23811
23812         * marshal.c (mono_marshal_get_runtime_invoke): Fix CR/LFs.
23813
23814 2004-05-30  Jackson Harper  <jackson@ximian.com>
23815
23816         * reflection.c: Do not hardcode assembly versions or public key
23817         tokens anymore. All of this except the corlib section was dead
23818         code anyways.
23819         
23820 2004-05-29  Zoltan Varga  <vargaz@freemail.hu>
23821
23822         * object.c (mono_runtime_invoke_array): Automatically create boxed
23823         objects for byref valuetypes if needed. Fixes #59300.
23824         
23825         * object.c (mono_method_return_message_restore): Handle 
23826         MONO_TYPE_OBJECT as well.
23827
23828 2004-05-28  Jackson Harper  <jackson@ximian.com>
23829
23830         * reflection.c: The modified type encoding was causing build
23831         problems. Reverted for now.
23832         
23833 2004-05-28  Jackson Harper  <jackson@ximian.com>
23834
23835         * reflection.c/h: Take an assembly ref so that we dont create
23836         fully qualified names when encoding types in the same assembly as
23837         the custom attribute being emitted.
23838         * appdomain.c: Increment version number.
23839         
23840 2004-05-26  Duncan Mak  <duncan@ximian.com>
23841
23842         * icall.c
23843         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
23844         Set the full version number (major, minor, build, revision).
23845
23846 2004-05-28  Vladimir Vukicevic  <vladimir@pobox.com>
23847
23848         * marshal.c (emit_struct_conv): increment src/dst after blit
23849         (mono_marshal_get_managed_wrapper,
23850         mono_marshal_get_native_wrapper): make sure we have marshalling
23851         info before marshalling params (info computation affects
23852         blittable)
23853
23854         * class.c (class_compute_field_layout): correctly deal with
23855         blittable
23856         (mono_class_layout_fields): Don't do gc_aware_layout for AUTO
23857         value types (as per what windows dows by default)
23858         (mono_class_setup_mono_type): System.ValueType is blittable
23859         (mono_ptr_class_get, mono_fnptr_class_get): Pointer classes are
23860         blittable
23861
23862         * marshal.c (mono_marshal_load_type_info): flag types  as
23863         non-blittable if the native layout doesn't match the managed
23864         layout
23865
23866 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23867
23868         * appdomain.c: don't add stuff in the private search path that is
23869         above the application base. If application base is not set, there's
23870         no private search path.
23871
23872 2004-05-28  Zoltan Varga  <vargaz@freemail.hu>
23873
23874         * marshal.c (mono_marshal_get_managed_wrapper): Add proper support for
23875         byref struct arguments in native->managed marshalling.
23876
23877 2004-05-28      Patrik Torstensson      <totte@hiddenpeaks.com>
23878
23879         * marshal.c (mono_marshal_get_runtime_invoke): correctly
23880         cache methods using signature (special case for methods
23881         that are value type or string class)
23882         
23883         * image.c (mono_image_close): clean up allocated GSList's
23884         in runtime_invoke_cache.
23885
23886 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23887
23888         * mono-config.c: set the correct path for mono_cfg_dir on windows when
23889         there's no MONO_CFG_DIR environment variable defined.
23890
23891 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23892
23893         * threads.c: windows version must be >= 0x0500 to include OpenThread.
23894
23895 2004-05-28  Lluis Sanchez Gual  <lluis@ximian.com>
23896
23897         * threadpool.c: Really wait for 500ms after the async call, even if the wait
23898           is interrumped.
23899         * threads.c: In mono_thread_manage, call OpenThread to ref each handle
23900           before waiting for it, and call CloseHandle after the wait to unref it.
23901           This will make sure that handles are not disposed too early.
23902
23903 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23904
23905         * appdomain.c:
23906         * appdomain.h:
23907         * icall.c: removed
23908         ves_icall_System_AppDomainSetup_InitAppDomainSetup as it's not
23909         needed now.
23910
23911         * object.c: se the application_base only for the domain that runs
23912         Main. Fixes bug #59216,
23913
23914 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23915
23916         * appdomain.c:
23917         * object.c: only the domain in which Main is run have
23918         SetupInformation.ConfigurationFile set, so moved a few lines from
23919         appdomain.c to object.c.
23920
23921 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23922
23923         * appdomain.c: we tried to load [name].(dll|exe), but according
23924         to bug #57710, we must also try [culture]/[name].(dll|exe) and
23925         [culture]/[name]/[name](dll|exe). This patch fixes the bug.
23926         There's a test case attached to bug #58922.
23927
23928 2004-05-27  Dick Porter  <dick@ximian.com>
23929
23930         * icall.c:
23931         * file-io.c: Implemented icalls for locking and unlocking regions
23932         in a file.
23933         (ves_icall_System_IO_MonoIO_FindNextFile): FindNextFile() returns
23934         FALSE on error (fixes both compiler warning and real bug.)
23935
23936 2004-05-27  Atsushi Enomoto  <atsushi@ximian.com>
23937
23938         * culture-info-tables.h: reflecting locale-builder updates.
23939
23940           (Added missing ChangeLog entry for 05/26)
23941
23942 2004-05-27  Jackson Harper  <jackson@ximian.com>
23943
23944         * locales.c: Fix some cut and paste errors.
23945         
23946 2004-05-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23947
23948         * mono-config.c: set the correct path for config. directory on windows.
23949
23950 2004-05-26  Atsushi Enomoto  <atsushi@ximian.com>
23951
23952         * icall.c : Fixed ves_icall_System_DateTime_GetNow() to return utc
23953           on win32.
23954
23955 2004-05-26  Zoltan Varga  <vargaz@freemail.hu>
23956
23957         * marshal.c (mono_marshal_get_native_wrapper): Free strings returned
23958         from pinvoke functions.
23959         
23960         * marshal.c (mono_ftnptr_to_delegate): Implement this.
23961
23962 2004-05-26  Atsushi Enomoto  <atsushi@ximian.com>
23963
23964         * culture-info-tables.h: reflecting locale-builder updates.
23965
23966 2004-05-26  Zoltan Varga  <vargaz@freemail.hu>
23967
23968         * profiler.c (simple_allocation): Skip icall wrapper methods. Fixes
23969         #59086.
23970
23971 2004-05-26  Sebastien Pouliot  <sebastien@ximian.com>
23972
23973         * appdomain.cs: Bumped MONO_CORLIB_VERSION to 20.
23974         * icall.c: Modified icalls for RNG.
23975         * rand.c|h: Changed RNG interface to allow thread-safe usage under 
23976         Windows (CryptoAPI).
23977
23978 2004-05-25  Zoltan Varga  <vargaz@freemail.hu>
23979
23980         * locales.c: Fix build.
23981
23982 2004-05-25  Atsushi Enomoto  <atsushi@ximian.com>
23983
23984         * culture-info-tables.h: reflecting locale-builder updates.
23985
23986 2004-05-25  Jackson Harper  <jackson@ximian.com>
23987
23988         * locales.c: When creating the current culture use the $LANGs
23989         specific culture. So DateTimeFormat and NumberFormat entries are created.
23990         
23991 2004-05-25  Zoltan Varga  <vargaz@freemail.hu>
23992
23993         * string-icalls.{h,c} icalls.c: Add new icalls for Strcpy which take
23994         a char array as parameter.
23995
23996 2004-05-24  Lluis Sanchez Gual  <lluis@ximian.com>
23997
23998         * image.c: In mono_image_open(), always use an absolute path name to
23999           look for already loaded images.
24000
24001 2004-05-24  Sebastien Pouliot  <sebastien@ximian.com>
24002
24003         * icall.c: Added define for CSIDL_FLAG_CREATE (0x8000) in case it is
24004         missing in the windows build (like older cygwin include files).
24005
24006 2004-05-23  Sebastien Pouliot  <sebastien@ximian.com>
24007
24008         * icall.c: Fixed check for possible integer overflow in Buffer_
24009         BlockCopy icall. Replaced comments style // by /* */.
24010
24011 2004-05-22  Zoltan Varga  <vargaz@freemail.hu>
24012
24013         * marshal.c (mono_ftnptr_to_delegate): Fix warning.
24014         
24015         * marshal.c (mono_marshal_get_proxy_cancast): Move thread interrupt
24016         check after MONO_VTADDR. Fixes pinvoke2.exe.
24017
24018         * marshal.h marshal.c metadata.h: Add beginnings of support for
24019         ftnptr -> delegate marshalling.
24020
24021 2004-05-21  Zoltan Varga  <vargaz@freemail.hu>
24022
24023         * threads.c (ves_icall_System_Threading_Thread_ResetAbort): Fix compilation on gcc-2.95.
24024         * threads.c: Fix warnings.
24025
24026 2004-05-20  Lluis Sanchez Gual  <lluis@ximian.com>
24027
24028         * appdomain.c, gc.c: Make use of the new WaitForSingleObjectEx.
24029         * icall.c: Registered icalls for Suspend and Resume.
24030         * locales.c: Beware, mono_monitor_try_enter can now be interrupted by
24031           Thread.Abort.
24032         * monitor.c: Use WaitForSingleObjectEx. Added some interruption checkpoints.
24033         * mono-debug-debugger.c: Use WaitForSingleObjectEx et al.
24034         * process.c: Use WaitForSingleObjectEx.
24035         * threadpool.c: Use WaitForSingleObjectEx. Added some interruption 
24036           checkpoints.
24037         * threads.c, threads.h: Make use of new Ex wait methods. Improved
24038           implementation of Thread.Abort and Thread.ResetAbort icalls. Added icalls
24039           for Suspend and Resume. Added new mono_thread_stop, used for stoping
24040           background threads. Added basic support for Abort in Windows.
24041           Start new threads using a managed delegate invoke wrapper. This wrapper
24042           has an interruption checkpoint that is needed since an interruption
24043           can be requested before the thread leaves the unmanaged code that starts 
24044           the thread.
24045         * marshal.c: Added interruption checkpoint after every native call, and
24046           also before managed calls for wrappers called from unmanaged code to
24047           go into managed code.
24048         * object.h: Added new field in MonoThread to keep track of interruption
24049           requests.
24050
24051 2004-05-20  Zoltan Varga  <vargaz@freemail.hu>
24052
24053         * marshal.c: Insert SAVE_LMF and RESTORE_LMF opcodes around native
24054         calls.
24055
24056 2004-05-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24057
24058         * appdomain.c:
24059         * assembly.c:
24060         * gc.c:
24061         * locales.c:
24062         * mono-config.c:
24063         * rand.c: getenv -> g_getenv (windows!)
24064
24065         * process.c: complete_path is also used on non-windows platforms.
24066
24067 2004-05-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24068
24069         * icall.c: new signature for Process_Start.
24070
24071         * process.[ch]: new signature for Process_Start. If we're on windows
24072         and UseShellExecute is false, we have to search for the program by
24073         ourselves if we don't get a full path.
24074
24075 2004-05-18  Zoltan Varga  <vargaz@freemail.hu>
24076
24077         * marshal.c (mono_marshal_get_native_wrapper): Fix up custom 
24078         marshalling and call CleanUpNativeData if needed. Fixes #58646.
24079
24080 2004-05-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24081
24082         * socket-io.c: field value changed for Int32 from 'value' to 'm_value'.
24083         Fixes bug #58373.
24084
24085 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24086
24087         * process.c: use double quotes to quote program name and arguments on
24088         windows. Fixes bug #58575.
24089
24090 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24091
24092         * file-io.c: don't return "." and ".." when using windows Find*File.
24093
24094 2003-05-17      Patrik Torstensson <totte@hiddenpeaks.com>
24095
24096         * marshal.c: Don't pass wrappers to message init because method 
24097         addressed used to lookup metadata. part of remoting[2|3] fix.
24098
24099 2004-05-15  Jackson Harper  <jackson@ximian.com>
24100
24101         * assembly.c: Remove user gac and implement MONO_GAC_PATH, this
24102         path is essentially the same as MONO_PATH except that it points to
24103         GACs instead of lib directories.
24104         * loader.h: The user gac is gone so we dont need function to
24105         enable/disable it.
24106         * mono-config.c: user gac option is now gone.
24107         
24108 2004-05-15  Jackson Harper  <jackson@ximian.com>
24109
24110         * culture-info.h: Make defines more consistent, add calendar data
24111         to the culture info table.
24112         * culture-info-tables.h: Add basic calendar data. Basically
24113         everyone gets default gregorian until all the data is
24114         updated.
24115         * locales.c: Use the new consistent defines. Set calendar data for
24116         culture info objects.
24117         * object.h: add a field for calendar data to CultureInfo
24118         
24119 2004-05-14 Ben Maurer  <bmaurer@users.sourceforge.net>
24120
24121         * image.c: image->runtime_invoke_cache is keyed on signatures now.
24122         * marshal.c (mono_mb_emit_calli): new helper to emit a CEE_CALLI with
24123         a signature.
24124         (mono_mb_emit_managed_call, mono_mb_emit_native_call): use the above.
24125         (mono_marshal_get_runtime_invoke): The runtime invoke method now takes
24126         an extra param that is the pointer of the method to invoke. The IL for
24127         the invoke method is no longer specific to the method, but to the
24128         signature of the method. Thus, we can share the same code for multiple
24129         methods. This reduces the number of methods that have to be compiled.
24130
24131 2004-05-14  Zoltan Varga  <vargaz@freemail.hu>
24132
24133         * icall.c (ves_icall_System_Reflection_Assembly_load_with_partial_name): Fix warning.
24134
24135         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
24136
24137         * icall.c: Optimize Buffer.BlockCopy.
24138
24139 2004-05-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24140
24141         * culture-info-tables.h: seems like Spanish and Portuguese cultures had
24142         DateTimeFormatInfo.YearMonthPattern like "MMMM' yyyy" (note the single
24143         quote). Changed them to "MMMM yyyy".
24144
24145 2004-05-12  Miguel de Icaza  <miguel@ximian.com>
24146
24147         * rand.c
24148         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_InternalGetBytes): Always close the file. 
24149
24150 2004-05-13  Zoltan Varga  <vargaz@freemail.hu>
24151
24152         * reflection.h: Updated after changes to managed structures.
24153
24154         * appdomain.c: Bump corlib version.
24155
24156 2004-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24157
24158         * Makefile.am: also add libmonoos to libmetadata. Fixes the build on
24159         windows.
24160
24161 2004-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24162
24163         * Makefile.am: link to ../os/libmonoos.la on windows.
24164
24165         * assembly.c:
24166                 -If MONO_DEBUG, warn about non-existing directories in
24167                 MONO_PATH.
24168                 -Added mono_assembly_getrootdir() that replaces MONO_ASSEMBLIES
24169                 compile time variable.
24170                 -Removed init_default_path and call mono_set_rootdir from
24171                 libmonoos.a instead (windows only).
24172
24173         * assembly.h: declare mono_assembly_getrootdir().
24174
24175         * domain.c:
24176         * icall.c: use mono_assembly_getrootdir() instead of MONO_ASSEMBLIES.
24177
24178         * loader.c: s/getenv/g_getenv/
24179
24180 2004-05-11  Zoltan Varga  <vargaz@freemail.hu>
24181
24182         * marshal.{h,c}: Add support for UnmanagedType.AsAny.
24183
24184         * marshal.c: Use mono_metadata_signature_{alloc,dup} where appropriate.
24185
24186         * metadata.h: Add new marshalling conversions.
24187
24188         * metadata.h metadata.c (mono_metadata_signature_dup): New helper
24189         function.
24190
24191         * reflection.c (mono_reflection_get_type): Lookup the type in all
24192         modules of a multi-module assembly. Fixes #58291.
24193
24194 2004-05-11  Lluis Sanchez Gual  <lluis@ximian.com>
24195
24196         * threads.c: Before aborting a background, set the StopRequested
24197         state.  This avoids throwing the Abort exception.
24198         In mono_thread_manage, don't continue with the shutdown until all
24199         aborted threads have actually stopped.
24200
24201 2004-05-10  Jackson Harper  <jackson@ximian.com>
24202
24203         * locales.c: Remove the modifier from culture names.
24204         
24205 2004-05-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24206
24207         * Makefile.am: monosn is not installed any more. It has been deprecated
24208         in favor of sn.
24209
24210 2004-05-07  Jackson Harper  <jackson@ximian.com>
24211
24212         * locales.c
24213         (ves_icall_System_Globalization_CultureInfo_internal_get_cultures):
24214         Fix array construction, add bailout if the length is 0.
24215
24216 2004-05-07  Dick Porter  <dick@ximian.com>
24217
24218         * socket-io.c (addrinfo_to_IPHostEntry): Don't crash if the
24219         machine doesn't have a DNS entry.  Patch by Urs Muff
24220         (umuff@quark.com), fixes bug 57928.
24221
24222 2004-05-06  Jackson Harper  <jackson@ximian.com>
24223
24224         * reflection.c: Handle null PublicTokens properly. alloc mem for
24225         assembly names culture so we dont crash when freeing it.
24226         
24227 2004-05-06  Jackson Harper  <jackson@ximian.com>
24228
24229         * assembly.c: Check the usergac when loading with partial names.
24230         
24231 2004-05-05  Sebastien Pouliot  <sebastien@ximian.com>
24232
24233         * rand.c|h: Added new icall for (optionally) seeding the PRNG. This 
24234         does nothing for now (not required for Linux/Windows) but the class
24235         library can call it (and a newer or modified runtime could need it).
24236         * icall.c: Registred icall.
24237
24238 2004-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24239
24240         * loader.c: prints a message on module loading error we set MONO_DEBUG
24241         environment variable.
24242
24243 2004-05-05  Jackson Harper  <jackson@ximian.com>
24244
24245         * appdomain.c: Handle PublicKeyToken=null properly.
24246         
24247 2004-05-05  Sebastien Pouliot  <sebastien@ximian.com>
24248
24249         * environment.c|h: Added icall ves_icall_System_Environment_
24250         GetOSVersionString to get the current OS version as a string.
24251         * icall.c: Registred icall.
24252
24253 2004-05-05  Lluis Sanchez Gual  <lluis@ximian.com>
24254
24255         * object.c: in mono_object_get_virtual_method(), take into account that
24256         non-virtual methods don't have a slot in the vtable. Check needed when
24257         the object is a proxy.
24258
24259 2004-05-05  Zoltan Varga  <vargaz@freemail.hu>
24260
24261         * marshal.h marshal.c icall.c: Applied patch from vladimir@pobox.com
24262         (Vladimir Vukicevic). Implement UnsafeAddrOfPinnedArrayElement.
24263
24264         * object.c (mono_class_compute_gc_descriptor): Fix warning.
24265
24266         * object.c (mono_runtime_invoke_array): Add an assert so null cannot be
24267         passed when a valuetype is expected.
24268
24269         * object.c (mono_unhandled_exception): Only set the exit code if the
24270         exception happens in the main thread. Fixes thread5.exe.
24271
24272         * appdomain.c (get_info_from_assembly_name): Fix infinite loop on
24273         invalid names. Fixes #58047.
24274
24275 2004-05-03  Jackson Harper  <jackson@ximian.com>
24276
24277         * assembly.c: This line was committed accidently and is unneeded.
24278         
24279 2004-05-03  Jackson Harper  <jackson@ximian.com>
24280
24281         * icall.c: Add new icall for Assembly::LoadWithPartialName
24282         * assembly.c/.h: new function that probes the GAC to load partial
24283         assembly names by Paolo Molaro.
24284         
24285 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24286
24287         * appdomain.c: use g_strncasecmp when looking for 'Culture=' et al.
24288         * reflection.c: use g_strncasecmp when looking for 'Culture=' et al.
24289         (type_get_fully_qualified_name): Added PublicKeyToken when building a
24290         full type name.
24291
24292 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24293
24294         * appdomain.c: fixed check for 'neutral' culture and removed warning.
24295         * reflection.c: fix bug when parsing a full type name and Version is not
24296         the last thing in the string.
24297
24298 2004-05-03  Zoltan Varga  <vargaz@freemail.hu>
24299
24300         * appdomain.c (get_info_from_assembly_name): Strdup "" to prevent
24301         crashes when it is freed.
24302
24303 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24304
24305         * assembly.c: print the compat warning to stderr.
24306
24307 2004-05-01  Miguel de Icaza  <miguel@ximian.com>
24308
24309         * assembly.c (mono_assembly_load_references): Add a compatibility
24310         hack to run old applications that might be still referencing the
24311         3300-based assemblies, only do this for System.xxx.
24312
24313 2004-05-01  Jackson Harper  <jackson@ximian.com>
24314
24315         * appdomain.c: If the culture is neutral we set it to "".
24316         
24317 2004-04-29  Jackson Harper  <jackson@ximian.com>
24318
24319         * locales.c: Add some missing MONO_ARCH_SAVE_REGS'.
24320
24321 2004-04-29  Andreas Nahr <ClassDevelopment@A-SoftTech.com>
24322  
24323         * string-icalls.c: added low overhead function for copying chars
24324         * icall.c: added needed icall for the above function
24325  
24326 2004-04-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24327
24328         * icall.c: fix return value of get_global_assembly_cache.  Implemented
24329         Environment.GetLogicalDrives.
24330
24331 2004-04-28  Bernie Solomon  <bernard@ugsolutions.com>
24332
24333         * rand.c: try and talk to egd or prngd
24334         for random bytes if opening devices fail.
24335
24336 2004-04-28  Zoltan Varga  <vargaz@freemail.hu>
24337
24338         * marshal.c (mono_marshal_load_type_info): Calculate the minimum
24339         alignment for the type using the native alignment of its members 
24340         instead of using klass->min_align.
24341
24342         * metadata.c (mono_type_stack_size): Fix size of TYPEDBYREF.
24343
24344 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24345
24346         * file-io.c:
24347         * socket-io.c: added check for sys/aio.h.
24348
24349 2004-04-28  Dick Porter  <dick@ximian.com>
24350
24351         * threads.c: Don't abort a thread thats already aborting, when
24352         terminating everything.
24353
24354 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24355
24356         * icall.c: added 2 new async calls for Socket.
24357
24358         * socket-io.[ch]: fixed some warnings. Added support for asynchronous
24359         IO on *nix systems.
24360
24361         * threadpool.c: removed unused variable.
24362
24363 2004-04-27  Zoltan Varga  <vargaz@freemail.hu>
24364
24365         * marshal.c: Handle null properly in PtrToString* icalls. Fixes #57706.
24366
24367 Tue Apr 27 15:55:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
24368
24369         * locales.c: put back string_invariant_tolower () and
24370         string_invariant_toupper ().
24371
24372 2004-04-26 David Waite <mass@akuma.org>
24373
24374         * file-io.h:
24375         * socket-io.h:
24376         * threads.h:
24377         * unicode.h: remove comma from end of enumeration declarations
24378
24379 2004-04-26 David Waite <mass@akuma.org>
24380
24381         * debug-mono-symfile.h:
24382         * decimal.c:
24383         * mono_debug.h:
24384         * sysmath.c: Define 64 bit constants as long long types (i.e. 10ULL)
24385
24386
24387 2004-04-26  Jackson Harper  <jackson@ximian.com>
24388
24389         * appdomain.c: Increment version number.
24390         
24391 2004-04-26  Jackson Harper  <jackson@ximian.com>
24392
24393         * appdomain.c: Set assembly references public token value when
24394         PublicKeyToken is specified, not the hash_value. Free public token
24395         values when free assembly name data. Previously the public key
24396         token was hex decoded, however we are using hex encoded public key
24397         tokens, so this is not neccasary.
24398         * assembly.c: Lookup assemblies in the gac if their public token
24399         value is set. Add function to allow enabling user gac
24400         lookups. Specify whether or not the assembly was loaded from the
24401         GAC. Compare full assembly names when checking the cache for
24402         assemblies (Temporarily disabled see comment in code). Remove
24403         mscorlib -> corlib mapping cruft. Add trace-loading. When a user
24404         specifies trace-loader they get extra info to stdout on the
24405         loading of assemblies.
24406         * image.h: Add a field for an assembly references public token
24407         value to MonoAssemblyname. Add a field to MonoAssembly to specifiy
24408         whether an assembly has been loaded from the GAC.
24409         * image.c: Remove a corlib -> mscorlib name mapping.
24410         * loader.h: Add function to enable/disable the user gac.
24411         * mono-config.c: Check if the usergac is enabled in the config
24412         file.
24413         * icall.c: New icall to determine whether or not an assembly has
24414         been loaded from the GAC. Remove some mscorlib -> corlib mappings.
24415         * tabldefs.h: Add constant for assemblyref flag that specifies a
24416         full public key is used instead of a public token.
24417         * reflection.c: Remove mscorlib -> corlib mappings. Set
24418         PublicTokenValue instead of hash value. This value is a hex
24419         string so it does not need to be expanded.
24420
24421 2004-04-26  Martin Baulig  <martin@ximian.com>
24422
24423         * mono-debug-debugger.c (mono_debugger_initialize): Set
24424         `mono_debugger_initialized' before calling mono_debug_lock().
24425
24426 2004-04-42  Robert Shade <rshade@dvsconsulting.com>
24427
24428         * icall.c: icalls for Char.ToUpper/ToLower are now hooked to
24429           InternalToUpper/InternalToLower.
24430         * locales.c: (ves_icall_System_{Char,String}_InternalTo{Upper,Lower}_Comp)
24431           removed invariant culture shortcut.  This is now done in managed code.
24432         * locales.c: (string_invariant_toupper/tolower) removed.
24433
24434 2004-04-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24435
24436         * icall.c: added GetSupportsAsync for Socket (same as MonoIO).
24437         Added Poll internal call.
24438
24439         * socket-io.[ch]: _wapi_socket == WSASocket. Added internal
24440         call for Poll. Select was too heavy for polling a single socket.
24441
24442         * threadpool.[ch]: added mono_threadpool_cleanup.
24443         * threads.c: use it. Don't use Thread_Abort on windows.
24444
24445 2004-04-23  Martin Baulig  <martin@ximian.com>
24446
24447         * mono-debug-debugger.c (mono_debugger_lookup_assembly): New function.
24448
24449 2004-04-23  Sebastien Pouliot  <sebastien@ximian.com>
24450
24451         * icall.c: Registred new icalls for key pair protection and added an
24452         icall for Environment.GetFolderPath on Windows.
24453         * security.c|h: Added new icalls for key pair protection.
24454
24455 2004-04-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24456
24457         * socket-io.c: don't display the non-supported family warning for known
24458         families. Now this is not displayed on windows when checking support
24459         for IPv4/IPv6.
24460
24461 2004-04-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24462
24463         * class.c: don't display the layout warning for static fields.
24464
24465 2004-04-21  Lluis Sanchez Gual <lluis@ximian.com>
24466
24467         * icall.cs: Registered new icalls for Char.ToLower and Char.ToUpper.
24468         * locales.c, locales.h: Added new icalls for culture-specific
24469         Char.ToLower and Char.ToUpper.
24470
24471 2004-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24472
24473         * threads.c: the 2nd argument when aborting a thread is NULL now. Patch
24474         by David Waite.
24475
24476 2004-04-20  Martin Baulig  <martin@ximian.com>
24477
24478         * mono-debug-debugger.c (mono_debugger_lookup_type): Make a copy
24479         of the type name before passing it to mono_reflection_type_from_name().
24480
24481 2004-04-19  Zoltan Varga  <vargaz@freemail.hu>
24482
24483         * marshal.c (mono_marshal_get_managed_wrapper): Handle different string
24484         encodings here. Fixes #56965.
24485
24486 2004-04-18  Bernie Solomon <bernard@ugsolutions.com>
24487
24488         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage):
24489         fix test on strstr result not that I can see anything that
24490         relies on the result.
24491
24492 2004-04-18  Zoltan Varga  <vargaz@freemail.hu>
24493
24494         * metadata.c (mono_type_to_unmanaged): Handle MONO_NATIVE_FUNC as well.
24495         Fixes #57081.
24496
24497         * marshal.c (mono_marshal_get_string_encoding): New helper function.
24498
24499         * marshal.c (mono_marshal_get_native_wrapper): Use the new helper
24500         function to determine which marshalling to use for strings. Fixes
24501         #56965.
24502
24503         * marshal.c (mono_marshal_string_array_to_unicode): Fix warning.
24504
24505         * reflection.c (encode_marshal_blob): Add support for LPARRAY.
24506
24507 2004-04-15  Bernie Solomon  <bernard@ugsolutions.com>
24508
24509         * icall.c: #include mono-config.h
24510
24511 2004-04-15  Jackson Harper  <jackson@ximian.com>
24512
24513         * culture-info-tables.h: Fix date formats for en-US culture.
24514         
24515 2004-04-15  Lluis Sanchez Gual  <lluis@ximian.com>
24516
24517         * icall.c: Registered icalls for ThreadPool.GetMinThreads and 
24518         ThreadPool.SetMinThreads.
24519         * threadpool.c: Implemented ThreadPool.GetMinThreads and
24520         ThreadPool.SetMinThreads.
24521
24522 Thu Apr 15 15:36:40 CEST 2004 Paolo Molaro <lupus@ximian.com>
24523
24524         * mono-config.c: also load the .config file in the directory
24525         where the assembly was found.
24526
24527 Thu Apr 15 14:24:49 CEST 2004 Paolo Molaro <lupus@ximian.com>
24528
24529         * assembly.c: load per-assembly config files.
24530         * icall.c: decrapified code to get the config dir and moved to
24531         mono-config.c.
24532         * image.h, loader.c, loader.h, mono-config.c, mono-config.h: allow
24533         per-assembly config files. When doing a dll map lookup give precedence
24534         to the per-assembly data.
24535
24536 2004-04-14  Martin Baulig  <martin@ximian.com>
24537
24538         * mono-debug-debugger.h (MonoDebuggerEvent): Removed
24539         MONO_DEBUGGER_EVENT_TYPE_ADDED and MONO_DEBUGGER_EVENT_METHOD_ADDED
24540         and added MONO_DEBUGGER_EVENT_RELOAD_SYMTABS.
24541
24542         * mono-debugger-debugger.c: While the debugger is locked, remember
24543         whether the symbol tables have changes and send one single
24544         MONO_DEBUGGER_EVENT_RELOAD_SYMTABS when releasing the lock.
24545
24546 2004-04-14  Zoltan Varga  <vargaz@freemail.hu>
24547
24548         * metadata.h: Add STRARRAY_STRWLPARRAY marshalling convention.
24549
24550         * marshal.h marshal.c (mono_marshal_string_array_to_unicode): New 
24551         function.
24552
24553         * marshal.c (mono_marshal_get_native_wrapper): Take CharSet into
24554         account when marshalling string arrays. Fixes #56965.
24555
24556 2004-04-13  Sebastien Pouliot  <sebastien@ximian.com>
24557
24558         * icall.c: Add new icalls mapping for security.
24559         * security.c|h: Add internal calls for WindowsIdentity,
24560         WindowsImpersonationContext and WindowsPrincipal.
24561
24562 2004-04-13  Gert Driesen (drieseng@users.sourceforge.net)
24563
24564         * class.c: Added comment to ensure the System.MonoDummy class
24565         is removed when no longer necessary
24566
24567 2004-04-13  Miguel de Icaza  <miguel@ximian.com>
24568
24569         * appdomain.c: Pass arguments to the bootstraping exceptions to
24570         minimize JITed methods at boot
24571
24572         * metadata.c (mono_exception_from_name_two_strings): Allow for the
24573         second string to be null.
24574
24575         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage):
24576         Change the protocol to minimize the JIT methods at startup.  Now
24577         it Returns the internal codepage, if the value of "int_code_page"
24578         is 1 at entry, and we can not compute a suitable code page
24579         number, returns the code page as a string.
24580
24581 2004-04-13  Jackson Harper  <jackson@ximian.com>
24582
24583         * culture-info-tables.h: Fix number of decimal digits for all
24584         english locales.
24585
24586 2004-04-13  Jackson Harper  <jackson@ximian.com>
24587
24588         * icall.c: Clairfy out of sync error message. It is not always
24589         your corlib that is out of sync.
24590
24591 2004-04-13  Zoltan Varga  <vargaz@freemail.hu>
24592
24593         * icall.c (ves_icall_Type_GetPropertiesByName): Avoid duplicate
24594         properties when only the set accessor is overriden. Fixes #55874.
24595
24596 2004-04-09  Zoltan Varga  <vargaz@freemail.hu>
24597
24598         * assembly.c (mono_assembly_load_references): Make this thread safe.
24599         Fixes #56327.
24600
24601 2004-04-08  Zoltan Varga  <vargaz@freemail.hu>
24602
24603         * monosn.c: Add missing initialization calls.
24604
24605 2004-04-08  Bernie Solomon  <bernard@ugsolutions.com>
24606
24607         * locales.c:
24608         ves_icall_System_Globalization_CultureInfo_construct_number_format
24609         Fix g_assert so it compiles on fussier compilers re int/ptr
24610         mismatch
24611
24612 2004-04-08  Dick Porter  <dick@ximian.com>
24613
24614         * socket-io.h:
24615         * socket-io.c: Don't set SO_REUSEADDR on windows.  Fixes bug
24616         53992.  Also rearrange the code so that the internal calls return
24617         an error value and exceptions are thrown from managed code.
24618
24619         * icall.c: Add type info to the socket icalls.
24620
24621 2004-04-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24622
24623         * object.h: synchronize MonoCompareInfo with CompareInfo class. Someone
24624         owes me a beer.
24625
24626 2004-04-07  Martin Baulig  <martin@ximian.com>
24627
24628         * class.c (mono_class_from_generic_parameter): Don't default
24629         `klass->parent' to `mono_defaults.object_type'.
24630
24631 2004-04-07  Martin Baulig  <martin@ximian.com>
24632
24633         * reflection.c (mono_reflection_initialize_generic_parameter): Set
24634         `param->pklass->reflection_info'.       
24635
24636 2004-04-07  Jackson Harper  <jackson@ximian.com>
24637
24638         * culture-info-tables.h: Fix date separator symbol.
24639         
24640 2004-04-07  Martin Baulig  <martin@ximian.com>
24641
24642         * icall.c (ves_icall_Type_GetGenericArguments): Moved this icall
24643         from System.Type to System.MonoType.
24644
24645 2004-04-07  Martin Baulig  <martin@ximian.com>
24646
24647         * reflection.h
24648         (MonoReflectionGenericParam): Added `has_reference_type' and
24649         `has_value_type' fields.
24650
24651         * reflection.c (mono_image_get_generic_param_info): Encode the
24652         correct flags if we have the `class' or `struct' constraint.
24653
24654 2004-04-07  Martin Baulig  <martin@ximian.com>
24655
24656         * reflection.h
24657         (MonoReflectionGenericParam): Added `MonoBoolean has_ctor_constraint'.
24658
24659 2004-04-07  Jackson Harper  <jackson@ximian.com>
24660
24661         * appdomain.c: Revert extra patches, just wanted to bump the
24662         version number.
24663         
24664 2004-04-07  Jackson Harper  <jackson@ximian.com>
24665
24666         * Makefile.am: Add culture-info private headers.
24667         * icall.c: Add new icalls for contructing locales.
24668         * locales.c: Construct CultureInfo objects from lookup tables instead of using ICU.
24669         * locales.h: Declare new culture info construction methods.
24670         * object.h: Add new fields used to avoid the CultureMap to
24671         MonoCultureInfo.
24672         * culture-info.h: Definition of structs used in the culture info
24673         tables.
24674         * culture-info-tables.h: Autogenerated tables that contain culture
24675         info data. This file was generated with the locale-builder tool.
24676         * appdomain.c: Incement corlib version number.
24677         
24678 2004-04-07  Bernie Solomon  <bernard@ugsolutions.com>
24679
24680         * appdomain.c: (mono_runtime_init) move mono_thread_init
24681         to before mono_object_new calls so critical sections
24682         are initialized before use.
24683
24684 2004-04-07  Martin Baulig  <martin@ximian.com>
24685
24686         * icall.c
24687         (ves_icall_TypeBuilder_define_generic_parameter): Removed.
24688         (ves_icall_MethodBuilder_define_generic_parameter): Removed.
24689         (ves_icall_MonoGenericParam_initialize): Removed.
24690         (monogenericparam_icalls): Removed.
24691         (generictypeparambuilder_icalls): Added new table for
24692         System.Reflection.Emit.GenericTypeParameterBuilder.
24693
24694         * reflection.c
24695         (mono_reflection_define_generic_parameter): Removed.
24696         (mono_reflection_initialize_generic_parameter): This is now called
24697         from GenericTypeParameterBuilder's .ctor.
24698
24699 2004-04-06  Martin Baulig  <martin@ximian.com>
24700
24701         * class.c (mono_class_init): Don't inflate nested classes in a
24702         generic instance.
24703         (mono_type_get_name_recurse): Include the generic arguments for
24704         generic instances and generic type declarations.
24705         (inflate_generic_type): Correctly inflate MONO_TYPE_SZARRAY.
24706         (_mono_class_get_instantiation_name): Removed.
24707         (mono_class_create_generic): Always use `gklass->name' as our name.
24708
24709         * class.h (MonoGenericInst): Removed `nested_in', and `nested'.
24710
24711         * icall.c (ves_icall_MonoGenericInst_GetDeclaringType): Removed.
24712         (ves_icall_MonoGenericInst_GetNestedTypes): Removed.
24713         (ves_icall_MonoMethod_GetGenericParameters): Renamed to
24714         ves_icall_MonoMethod_GetGenericArguments() and correctly handle
24715         closed generic methods here.
24716
24717         * reflection.c
24718         (mono_reflection_generic_inst_get_nested_types): Removed.
24719         (inflate_mono_method): Copy the generic parameters from the
24720         MonoMethodHeader into out MonoGenericMethod.
24721
24722 2004-04-06  Martin Baulig  <martin@ximian.com>
24723
24724         * row-indexes.h
24725         (MONO_GENERICPARAM_DEPRECATED_CONSTRAINT): Removed.
24726
24727         * metadata.c (GenericParamSchema): Removed "DeprecatedConstraint".
24728
24729         * reflection.c (build_compressed_metadata): If we have any entries
24730         in the GenericParam, MethodSpec or GenericParamConstraint tables,
24731         set the header version to 1.1.
24732
24733 2004-04-06  Martin Baulig  <martin@ximian.com>
24734
24735         * class.c (mono_class_init): If we're a generic instance,
24736         initialize our nested classes, too.
24737         (_mono_class_get_instantiation_name): Deal with the new `!%d'
24738         suffix. 
24739
24740 2004-04-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24741
24742         * process.c: quote the argument passed to the shell on windows.
24743
24744 2004-04-05  Zoltan Varga  <vargaz@freemail.hu>
24745
24746         * threads.c (mono_alloc_special_static_data): Allow this to be
24747         called during startup.
24748
24749 2004-04-02  Martin Baulig  <martin@ximian.com>
24750
24751         * icall.c
24752         (ves_icall_MonoGenericInst_GetDeclaringType): New icall.
24753
24754 2004-04-02  Zoltan Varga  <vargaz@freemail.hu>
24755
24756         * icall.c: Fix build.
24757
24758 2004-04-02  Sebastien Pouliot  <sebastien@ximian.com>
24759
24760         * Makefile.am: Added security.c|h.
24761         * icall.c: Added icall for get_UserName;
24762         * security.c: New file for security related icalls. Added function
24763         get_UserName for System.Environment (fix #56144).
24764         * security.h: New. Header file for security.c
24765
24766 2004-04-02  Dick Porter  <dick@ximian.com>
24767
24768         * icall.c: Deleted the icalls that were obsoleted some time ago
24769         by the ICU string code, and which were mixed into the icall
24770         rearranging.  Fixes bug 55969.
24771
24772         * string-icalls.h: 
24773         * string-icalls.c: Deleted the code that those icalls reference.
24774
24775 2004-04-01  Martin Baulig  <martin@ximian.com>
24776
24777         * metadata.h (MONO_CLASS_IS_INTERFACE): New macro.
24778
24779         * class.c (mono_class_from_generic_parameter): Don't set 
24780         TYPE_ATTRIBUTE_INTERFACE.
24781         (my_mono_class_from_generic_parameter): Likewise.
24782
24783 2004-04-01  Martin Baulig  <martin@ximian.com>
24784
24785         * loader.c (find_method): Added an optional `MonoClass *ic'
24786         argument to search in a specific interface.
24787         (mono_get_method_constrained): New public function.
24788
24789 2004-04-01  Martin Baulig  <martin@ximian.com>
24790
24791         * reflection.c (mono_image_get_generic_field_token): Use the
24792         `handleref' cache here.
24793
24794 2004-04-01  Martin Baulig  <martin@ximian.com>
24795
24796         * reflection.h (MonoDynamicImage): Added `GHashTable *typespec'.
24797
24798         * reflection.c (create_generic_typespec): Use the `typespec' hash
24799         here, not the `typeref' one.    
24800
24801 2004-04-01  Martin Baulig  <martin@ximian.com>
24802
24803         * class.c (mono_class_inflate_generic_type): Moved the
24804         functionality into a new static inflate_generic_type() which
24805         returns NULL if it didn't do anything.  Only increment the
24806         `mono_stats.inflated_type_count' if we actually inflated
24807         something.
24808         (mono_class_get_full): Check the classes type to see whether we
24809         need to inflate it; also inflate MONO_TYPE_(M)VAR.
24810
24811 2004-04-01  Jackson Harper  <jackson@ximian.com>
24812
24813         * reflection.c: Set culture for assembly references.
24814         
24815 2004-04-01 Ben Maurer  <bmaurer@users.sourceforge.net>
24816
24817         * reflection.[ch], icall.[ch], Fix support for pinning variables.
24818
24819 2004-04-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24820
24821         * assembly.c:
24822         (do_mono_assembly_open): the critical section also covers
24823         mono_image_open and mono_image_open_from_data. Fixes bug #56327.
24824
24825 2004-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24826
24827         * threads.c:
24828         (mono_manage_threads): abort the background threads when finishing.
24829         Fixes bug #47232.
24830
24831 2004-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24832
24833         * gc.c: only close the done_event handle if there was no timeout.
24834         C-ified comments.
24835
24836 2004-03-30  Martin Baulig  <martin@ximian.com>
24837
24838         * icall.c (icall_entries): It's called "System.Activator", not
24839         "System.Activation".    
24840
24841 2004-03-30  Martin Baulig  <martin@ximian.com>
24842
24843         * class.c (mono_ldtoken): Added `MonoGenericContext *' argument.
24844         (mono_class_create_from_typespec): Likewise.
24845
24846 2004-03-30  Martin Baulig  <martin@ximian.com>
24847
24848         * reflection.h (MonoReflectionGenericParam): Use MonoBoolean for
24849         `has_ctor_constraint' and `initialized'.
24850
24851 2004-03-30  Martin Baulig  <martin@ximian.com>
24852
24853         * reflection.c (encode_new_constraint): New static function to add
24854         the constructor constraint attribute to a type parameter.
24855         (encode_constraints): Call encode_new_constraint() if necessary.
24856
24857         * reflection.h
24858         (MonoReflectionGenericParam): Added `guint32 has_ctor_constraint'.
24859
24860         * row-indexes.h: Added CUSTOM_ATTR_GENERICPAR.
24861         
24862 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
24863
24864         * reflection.c, icall.c: add support for pinning variables. 
24865
24866 2004-03-29  Bernie Solomon  <bernard@ugsolutions.com>
24867
24868         * marshal.c (mono_marshal_get_managed_wrapper):
24869         init bool local with zero rather than null.
24870
24871 2004-03-29  Martin Baulig  <martin@ximian.com>
24872
24873         * icall.c (ves_icall_MonoMethod_get_HasGenericParameters): Show
24874         the "official" behavior here.
24875         (ves_icall_MonoMethod_get_Mono_IsInflatedMethod): New interncall.
24876
24877 2004-03-29  Martin Baulig  <martin@ximian.com>
24878
24879         * icall.c: Reflect latest API changes.
24880
24881 2004-03-29  Martin Baulig  <martin@ximian.com>
24882
24883         * loader.c (mono_get_method_from_token): Also call
24884         mono_metadata_load_generic_params () for abstract and interface
24885         methods; replace the type arguments in the method signature with
24886         the ones which are loaded from the metadata.
24887
24888 2004-03-29  Lluis Sanchez Gual  <lluis@ximian.com>
24889
24890         * monitor.c: In mono_monitor_exit(), don't throw an exception if the owner
24891         of the lock is not the current thread. MS.NET don't do it, in spite of
24892         what the documentation says. See bug #56157.
24893
24894 2004-03-28  Martin Baulig  <martin@ximian.com>
24895
24896         * class.c (mono_class_init): Don't call init_properties() and
24897         init_events() for generic instances; set `prop->parent' when
24898         inflating properties.
24899
24900         * reflection.c (mono_generic_inst_get_object): Call
24901         `mono_class_init (ginst->klass)'.
24902         (mono_type_get_object): Only create a MonoGenericInst if your
24903         generic type is a TypeBuilder.
24904         (do_mono_reflection_bind_generic_parameters): Only set
24905         `ginst->is_dynamic' if our generic type is a TypeBuilder.
24906
24907 2004-03-28  Zoltan Varga  <vargaz@freemail.hu>
24908
24909         * appdomain.c (unload_thread_main): Do not clear proxy_vtable_hash.
24910         Fixes #56091.
24911
24912 2004-03-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24913
24914         * icall.c: added Kill_internal icall.
24915         * process.[ch]: added Kill_internal icall.
24916
24917 2004-03-25  Martin Baulig  <martin@ximian.com>
24918
24919         * class.h (MonoStats): Added `generic_instance_count',
24920         `inflated_method_count', `inflated_type_count' and
24921         `generics_metadata_size'.       
24922
24923 2004-03-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24924
24925         * reflection.c: no warnings now.
24926
24927 2004-03-25  Martin Baulig  <martin@ximian.com>
24928
24929         * class.c (mono_class_get_full): New public function; does a
24930         mono_class_get(), but also takes a `MonoGenericContext *'.
24931
24932         * loader.c (mono_field_from_memberref): Renamed to
24933         `field_from_memberref', made static and added `MonoGenericContext *'
24934         argument.
24935         (mono_field_from_token): Added `MonoGenericInst *' argument.
24936         (method_from_memberef): Likewise.
24937         (mono_get_method_from_token): Likewise.
24938         (mono_get_method_full): New public function; does a
24939         mono_get_method(), but also takes a `MonoGenericContext *'.
24940
24941         * verify.c (mono_method_verify): Get the method's generic context
24942         and pass it to mono_field_from_token(), mono_get_method_full() and
24943         mono_class_get_full().
24944
24945 2004-03-25  Martin Baulig  <martin@ximian.com>
24946
24947         * class.c (mono_class_inflate_generic_type): Take a
24948         `MonoGenericContext *' instead of a `MonoGenericInst *' and a
24949         `MonoGenericMethod *'.
24950
24951 2004-03-25  Martin Baulig  <martin@ximian.com>
24952
24953         * loader.h (MonoMethodInflated): Store the MonoGenericContext
24954         instead of the MonoGenericMethod here.
24955
24956 2004-03-25  Martin Baulig  <martin@ximian.com>
24957
24958         * class.h (MonoGenericInst): Added `MonoGenericContext *context';
24959         each time we create a new MonoGenericInst, we also create a new
24960         context which points back to us.
24961
24962         * class.c (inflate_method): Use `ginst->context' instead of
24963         creating a new context.
24964
24965         * loader.c (method_from_memberref): Use
24966         `klass->generic_inst->context' instead of creating a new context.
24967
24968 2004-03-25  Martin Baulig  <martin@ximian.com>
24969
24970         * class.h (MonoGenericContext): New struct.
24971         (MonoGenericMethod): Removed `generic_inst'.
24972
24973         * class.c (mono_class_inflate_generic_method): Take a
24974         `MonoGenericContext *' instead of a `MonoGenericMethod *'.
24975
24976 2004-03-25  Martin Baulig  <martin@ximian.com>
24977
24978         * loader.h (MonoMethodInflated): New typedef.
24979
24980         * metadata.h (MonoMethodSignature): Removed `gen_method', make
24981         `generic_param_count' consume just 30 bits, added `is_inflated'
24982         and `has_type_parameters' flags (one bit each).
24983
24984         * class.c (mono_class_inflate_generic_method): Create a
24985         MonoMethodInflated instead of a MonoMethodNormal and set
24986         `is_inflated' in the method signature.
24987
24988         * class.h (MonoGenericMethod): Removed `generic_method'.
24989
24990 2004-03-25  Lluis Sanchez Gual  <lluis@ximian.com>
24991
24992         * image.c: Make sure the name of a MonoImage is always an absolute path.
24993           This fixes bug #54415.
24994
24995 2004-03-24  Martin Baulig  <martin@ximian.com>
24996
24997         * class.c (mono_class_setup_vtable): If we're a generic instance,
24998         use our generic type's vtable size.
24999
25000 2004-03-24  Zoltan Varga  <vargaz@freemail.hu>
25001
25002         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Add
25003         MONO_NO_UNLOAD env var as a temporary workaround for unloading 
25004         problems.
25005
25006 2004-03-23  Martin Baulig  <martin@ximian.com>
25007
25008         * class.h (MonoDynamicGenericInst): Added `int count_events' and
25009         `MonoEvent *events'.
25010
25011         * icall.c (ves_icall_MonoGenericInst_GetEvents): New interncall.
25012         (typebuilder_icalls): Added "get_event_info"; calls
25013         mono_reflection_event_builder_get_event_info(). 
25014
25015         * reflection.c (mono_reflection_generic_inst_initialize): Added
25016         `MonoArray *events'.
25017         (mono_reflection_event_builder_get_event_info): New function.
25018
25019 2004-03-23  Bernie Solomon  <bernard@ugsolutions.com>
25020
25021         * object.h: add mono_type_initialization_init
25022
25023         * object.c (mono_runtime_class_init): 
25024         implement class constructor synchronization rules
25025         to cope with threading issues.  
25026         add mono_type_initialization_init
25027
25028         * appdomain.c (mono_runtime_init): call 
25029         mono_type_initialization_init
25030
25031         * class.h: removing initializing field from MonoVTable
25032
25033 2004-03-23  Martin Baulig  <martin@ximian.com>
25034
25035         * class.c (my_mono_class_from_generic_parameter): Use
25036         `param->name' if it's not NULL. 
25037
25038 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
25039
25040         * class.c: do not insert non-virtual methods in the vtable.
25041         * icall.c, mono-debug-debugger.c, object.c: if method->slot == -1,
25042         that means the method is non-virtual. This never would have
25043         happened before.
25044
25045 2004-03-22  Lluis Sanchez Gual  <lluis@ximian.com>
25046
25047         * profiler.c: Added lock for accessing coverage_hash.
25048
25049 2004-03-22  Martin Baulig  <martin@ximian.com>
25050
25051         * icall.c (ves_icall_MethodInfo_get_IsGenericMethod): Use
25052         `method->method->signature->generic_param_count != 0' to make it
25053         work for interface methods.
25054
25055 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25056
25057         * process.c: quote the string passed to the shell using g_shell_quote.
25058
25059 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25060
25061         * threads.c:
25062         (mono_threads_manage): don't remove the finalizer thread and self
25063         from the threads hash table so that mono_thread_manage can be called
25064         more than once.
25065
25066 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25067
25068         * process.c: quote the arguments when UseShellExecute is true. Fixes
25069         bug #55790.
25070
25071 2004-03-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25072
25073         * threads.c: set mono_thread_detach as a cleanup routine for every
25074         thread. This way it's always executed upon thread termination, either
25075         aborted or finished normally. No more xsp hangs!
25076
25077 2004-03-17  Martin Baulig  <martin@ximian.com>
25078
25079         * class.h (MonoGenericInst): Replaced the `GList *nested' with an
25080         `int count_nested' and a `MonoType **nested'.
25081
25082         * reflection.c (mono_reflection_bind_generic_parameters): Moved
25083         most of the functionality into a new static
25084         do_mono_reflection_bind_generic_parameters() and don't take a
25085         `MonoType *nested_in' argument any more.  Don't compute nested
25086         types here.
25087         (mono_reflection_generic_inst_get_nested_types): New public method
25088         to get nested types.
25089
25090         * class.c (mono_class_create_generic): Set `klass->nested_in' if
25091         we're a nested class.
25092
25093         * icall.c (ves_icall_MonoGenericInst_GetNestedTypes): Call
25094         mono_reflection_generic_inst_get_nested_types() to compute the
25095         nested types.
25096
25097 2004-03-17  Zoltan Varga  <vargaz@freemail.hu>
25098
25099         * threads.c (ves_icall_System_Threading_Thread_Abort): Add a more
25100         descriptive error message under windows.
25101         
25102 2004-03-17  Martin Baulig  <martin@ximian.com>
25103
25104         * class.c (dup_type): Added `const MonoType *original' argument;
25105         copy the attrs from the original type.
25106
25107 2004-03-17  Martin Baulig  <martin@ximian.com>
25108
25109         * metadata.c (do_mono_metadata_parse_generic_inst): Use the
25110         `m->generic_inst_cache' here.
25111
25112 2004-03-17  Zoltan Varga  <vargaz@freemail.hu>
25113
25114         * exception.h exception.c: Add stack_overflow_exception.
25115
25116 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25117
25118         * threadpool.c:
25119         (overlapped_callback): call SetEvent *after* invoking the callback.
25120         No need to call CloseHandle.
25121
25122 2004-03-16  Martin Baulig  <martin@ximian.com>
25123
25124         * reflection.c (mono_image_get_fieldref_token): Take a
25125         `MonoReflectionField *' instead of a `MonoClassField *' and a
25126         `MonoClass *'; store the `MonoReflectionField *' in the hash.
25127
25128 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25129
25130         * appdomain.c: don't add the culture to the filename we're looking for
25131         if it's neutral or NULL. Fixes bug #53788. Removed redundant memset.
25132
25133 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25134
25135         * locales.c: don't ignore symbols when doing case insensitive compares.
25136         Thanks Dick! Fixes bug #54046.
25137
25138         * threads.c: surround 'threads' usage with enter/leave in
25139         mono_thread_manage.
25140
25141 2004-03-16  Zoltan Varga  <vargaz@freemail.hu>
25142
25143         * marshal.c (mono_marshal_get_native_wrapper): Char arrays are 
25144         implicitly marshalled as [Out]. Fixes #55450.
25145
25146         (mono_marshal_get_runtime_invoke): Zero out the result if there is
25147         an exception.
25148
25149 2004-03-16  Martin Baulig  <martin@ximian.com>
25150
25151         * class.c (mono_class_from_generic_parameter): Use the actual
25152         parameter name. 
25153
25154 2004-03-16  Martin Baulig  <martin@ximian.com>
25155
25156         * reflection.c (type_get_signature_size): New static function.
25157         Compues the size of the type in a method signature.
25158         (method_get_signature_size): New static function; calls
25159         type_get_signature_size() to compute the actual size of the
25160         method's signature.
25161         (method_encode_signature): Use method_get_signature_size() to get
25162         the signature's size rather than using `nparams * 10'.
25163
25164 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25165
25166         * file-io.h: define here WapiOverlapped on windows. I don't want the
25167         regular OVERLAPPED one.
25168
25169         * file-io.c:
25170         * threadpool.c: somehow, BindIoCompletionCallback is not found.
25171         Disabling AIO on windows.
25172
25173 2004-03-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25174
25175         * marshal.c: Marshal.SizeOf throws an exception for AutoLayout. Fixes
25176         bug #55385.
25177
25178 2004-03-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25179
25180         * appdomain.c: upgraded corlib version.
25181
25182         * file-io.c: implemented new icalls: GetSupportsAIO, BeginRead
25183         and BeginWrite. Allow opening files for asynchrnous operations.
25184
25185         * file-io.h: new struct that maps FileStreamAsyncResult.
25186         * icall.c: added new icalls.
25187         * process.[ch]: support setting child process environment variables
25188         and use the SHELL or COMSPEC when UseShellExecute is true.
25189
25190         * threadpool.[ch]: fixed warnings, moved ThreadPool icalls here. The
25191         callback for async. IO is here and also BindHandle.
25192
25193         * threads.[ch]: added mono_thread_detach and removed ThreadPool icalls
25194         from here.
25195
25196 2004-03-14  Zoltan Varga  <vargaz@freemail.hu>
25197
25198         * reflection.c (create_custom_attr): Allow len == 0.
25199
25200         * object.c (mono_class_compute_gc_descriptor): Fix descriptor
25201         computation on big-endian machines.
25202
25203 2004-03-13  Martin Baulig  <martin@ximian.com>
25204
25205         * class.h (MonoGenericInst): Added `int count_ifaces'.
25206
25207         * iclass.c (ves_icall_MonoGenericInst_GetInterfaces): Use
25208         `ginst->count_ifaces' instead `klass->interface_count' since we
25209         may get called before the vtable is created.
25210
25211         * loader.c (mono_method_get_param_names): If we're a generic
25212         instance, return and don't initialize the class.
25213
25214         * reflection.c (mono_reflection_setup_generic_class): Don't call
25215         ensure_runtime_vtable().
25216         (mono_reflection_bind_generic_parameters): Set
25217         `ginst->count_ifaces'.
25218
25219 2004-03-11  Jackson Harper <jackson@ximian.com>
25220
25221         * icall.c:
25222         * unicode.c:
25223         * unicode.h: Remove unused System.Char icalls.
25224         
25225 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
25226
25227         * loader.c (mono_lookup_pinvoke_call): Call the Windows.Forms init
25228         code when we P/Invoke the first library in Windows.Forms, instead
25229         of when we first open the assembly.
25230
25231         * assembly.c: Drop the lookup from here.
25232
25233 2004-03-10  Martin Baulig  <martin@ximian.com>
25234
25235         * reflection.c (mono_reflection_get_custom_attrs): Use the correct
25236         class for properties, fields and events.  Finally fixes #54945.
25237
25238 2004-03-10  Martin Baulig  <martin@ximian.com>
25239
25240         * metadata.c (mono_metadata_class_equal): New static function;
25241         checks whether two generic instances or two generic parameters are
25242         equal.
25243         (mono_metadata_type_equal): Use mono_metadata_class_equal() to
25244         compare classes.        
25245
25246 2004-03-10  Martin Baulig  <martin@ximian.com>
25247
25248         * class.h (MonoGenericMethod): Added `gpointer reflection_info'.
25249
25250         * reflection.c (inflate_mono_method): Added `MonoObject *obj'
25251         argument and write it into the `reflection_info' field.
25252
25253         * icall.c
25254         (ves_icall_MethodBase_GetGenericMethodDefinition): New interncall.
25255         (ves_icall_MethodBase_get_HasGenericParameters): New interncall.
25256
25257 2004-03-09  Jackson Harper  <jackson@ximian.com>
25258
25259         * char-conversions.h: use 8 bits for numeric data its all we need
25260         * icall.c: numeric data is only 8 bits now.
25261
25262 2004-03-09  Martin Baulig  <martin@ximian.com>
25263
25264         * class.h (MonoProperty, MonoEvent): Added `MonoClass *parent'.
25265
25266         * class.c (init_properties, init_events): Initialize the new
25267         `parent' field.
25268
25269         * reflection.c (typebuilder_setup_properties): Likewise.
25270         (typebuilder_setup_events): Likewise.
25271
25272         * reflection.h (MonoEventInfo): Replaced `parent with
25273         `declaring_type' and `reflected_type'.
25274
25275         * icall.c (ves_icall_get_property_info): Distinguish between
25276         declaring and reflected type.
25277         (ves_icall_get_event_info): Likewise.
25278
25279 2004-03-09  Martin Baulig  <martin@ximian.com>
25280
25281         * icall.c (ves_icall_Type_GetTypeCode): Added MONO_TYPE_GENERICINST.
25282         (ves_icall_Type_GetField): Correctly set field->klass.
25283
25284 2004-03-09  Zoltan Varga  <vargaz@freemail.hu>
25285
25286         * loader.h: Fix warning.
25287
25288 2004-03-08  Miguel de Icaza  <miguel@ximian.com>
25289
25290         *  loader.c, loader.h (mono_loader_wine_init): Loads the Wine/Lib
25291         library routine if present.  Notice that it will still continue
25292         executing even if its missing, for those working on the Gtk#
25293         edition of Windows.Forms.
25294
25295         * assembly.c (do_mono_assembly_open): If loading the
25296         System.Windows.Forms call mono_loader_wini_init.
25297
25298 2004-03-04  Lluis Sanchez Gual  <lluis@ximian.com>
25299
25300         * class.h: Added MonoRemoteClass struct.
25301         * domain.c: Changed hash function for proxy_vtable_hash. It now uses a
25302         function for MonoStrings.
25303         * icall.c: In GetTransparentProxy, assign a MonoRemoteClass to the proxy.
25304         Added internal call for getting the proxy type.
25305         * marshal.c: Get the type of transparent proxies from its remote_class.
25306         Added methods that generate the IL for type checks and casts:
25307         mono_marshal_get_isinst, mono_marshal_get_castclass, 
25308         mono_marshal_get_proxy_cancast.
25309         * marshal.h: Declaration of the previous new methods.
25310         * object.c: Added new moethods for creating and updating MonoRemoteClass
25311         instances: mono_remote_class, mono_upgrade_remote_class, 
25312         * object.h: Added MonoRemoteClass reference in MonoTransparentProxy.
25313         * verify.c: FIx transparent_proxy_fields layout.
25314         * appdomain.c: Bump corlib version.
25315
25316 2004-03-04  Jackson Harper  <jackson@ximian.com>
25317
25318         * icall.c: Add icall to access char conversion tables.
25319         * char-conversions.h: Character conversion tables.
25320         * Makefile.am: Add char-conversions.h private header file.
25321         
25322 2004-03-04  Zoltan Varga  <vargaz@freemail.hu>
25323
25324         * appdomain.c (unload_thread_main): Increase unloading timeout to
25325         10 sec as a temporary workaround for Nant problems.
25326
25327 2004-02-29  Zoltan Varga  <vargaz@freemail.hu>
25328
25329         * gc.c: Add checks for GC_enable and GC_disable.
25330
25331         * string-icalls.c locales.c: Applied patch from Jaroslaw Kowalski
25332         (jaak@zd.com.pl). Fix memory corruption in String.Replace 
25333         (bug #54988).
25334         
25335 2004-02-27  Martin Baulig  <martin@ximian.com>
25336
25337         * reflection.c (mono_reflection_bind_generic_parameters): Take a
25338         `MonoReflectionType *' instead of a `MonoType *'.
25339
25340 2004-02-26  Zoltan Varga  <vargaz@freemail.hu>
25341
25342         * gc.c (run_finalize): Avoid finalizing the object representing the
25343         finalizer thread.
25344         (finalizer_thread): Fix warning.
25345
25346 2004-02-25  Martin Baulig  <martin@ximian.com>
25347
25348         * class.c (_mono_class_get_instantiation_name): Added `int offset'
25349         argument for nested types.
25350         (mono_class_create_generic): Added support for nested generictypes.
25351
25352         * class.h (MonoGenericInst): Added `MonoType *nested_in' and
25353         `GList *nested'.
25354
25355         * icall.c (ves_icall_MonoGenericInst_GetNestedTypes): New icall.
25356
25357         * reflection.c (method_encode_signature): Increase the minimum
25358         value of `size' from 10 to 11.
25359         (mono_reflection_bind_generic_parameters): Take `int type_argc'
25360         and `MonoType **types' arguments instead of the `MonoArray
25361         *types'; added `MonoType *nested_in'.  Recursively instantiate
25362         nested classes. 
25363
25364 2004-02-23  Zoltan Varga  <vargaz@freemail.hu>
25365
25366         * appdomain.h (MonoDomain): Add preallocated null_reference_ex and 
25367         stack_overflow_ex members which are used by exception handling.
25368
25369         * appdomain.c (mono_runtime_init): Initialize the new members.
25370
25371         * gc.c (mono_gc_enable): New helper function.
25372         * gc.c (mono_gc_disable): New helper function.
25373
25374 2004-02-23  Martin Baulig  <martin@ximian.com>
25375
25376         * icall.c: I must have been really stupid - make it actually work
25377         this time ;-)
25378
25379 2004-02-23  Martin Baulig  <martin@ximian.com>
25380
25381         * loader.c (method_from_memberref): Only inflate the method if
25382         it's in another klass.
25383
25384 2004-02-23  Martin Baulig  <martin@ximian.com>
25385
25386         * class.c (mono_class_inflate_generic_type): Fixed two bugs.
25387         (mono_class_init): If we're a generic instance and an interface,
25388         compute `class->interface_id'; also create `class->interfaces'
25389         here and inflate them.
25390
25391         * metadata.c (do_mono_metadata_parse_generic_inst): Compute
25392         `ginst->is_open'.
25393         (mono_type_stack_size): Fix for MONO_TYPE_GENERICINST.
25394
25395         * reflection.c (mono_image_create_token): Allow "MonoGenericInst".
25396
25397 2004-02-15  Miguel de Icaza  <miguel@ximian.com>
25398
25399         * reflection.c (method_encode_code): Improved the error message
25400         generated by the exception.
25401
25402 2004-02-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25403
25404         * icall.c: Martin did not do what he said in the ChangeLog for
25405         2004-02-18, but put back the changes for properties and events.
25406         Commenting those changes out again and adding comment to bug #54518.
25407         
25408         * process.c: removed warning.
25409
25410 2004-02-20  Zoltan Varga  <vargaz@freemail.hu>
25411
25412         * marshal.c (emit_struct_conv): Print an error message instead of
25413         asserting when a type does not have the StructLayout attribute.
25414
25415 2004-02-20  Martin Baulig  <martin@ximian.com>
25416
25417         * reflection.c (mono_type_get_object): Also use the cache for
25418         generic instances.
25419         (mono_reflection_bind_generic_parameters): Always compute
25420         `ginst->ifaces'.        
25421
25422 2004-02-20  Martin Baulig  <martin@ximian.com>
25423
25424         * class.h (MonoGenericMethod): Removed `klass'.
25425
25426         * class.c (mono_class_inflate_generic_method): Added `MonoClass
25427         *klass' argument.
25428
25429 2004-02-20  Martin Baulig  <martin@ximian.com>
25430
25431         * reflection.c (method_encode_methodspec): Actually use the
25432         uninflated signature for the memberref.
25433
25434 2004-02-20  Martin Baulig  <martin@ximian.com>
25435
25436         * class.h (MonoGenericMethod): Removed `declaring'.
25437
25438         * class.c (mono_class_inflate_generic_method): If `gmethod->klass'
25439         is NULL, compute it here.
25440
25441 2004-02-20  Martin Baulig  <martin@ximian.com>
25442
25443         * image.h (MonoImage): Added `GHashTable *generic_inst_cache'.
25444
25445         * metadata.c (mono_metadata_generic_inst_hash): New method.
25446         (mono_metadata_generic_inst_equal): New method.
25447
25448         * reflection.c (mono_reflection_bind_generic_parameters): Use the
25449         `klass->image->generic_inst_cache' cache to avoid creating
25450         duplicate MonoGenericInst's.
25451
25452         * class.c (mono_class_inflate_generic_type): Use the cache.
25453
25454 Thu Feb 19 19:39:09 CET 2004 Paolo Molaro <lupus@ximian.com>
25455
25456         * object.c: fixed gc descriptor calculation for embedded valuetypes.
25457
25458 2004-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25459
25460         * icall.c: added Socket.WSAIoctl icall.
25461
25462         * socket-io.[ch]: implemented
25463         ves_icall_System_Net_Sockets_Socket_WSAIoctl.
25464
25465 2004-02-19  Atsushi Enomoto  <atsushi@ximian.com>
25466
25467         * icall.c: removed IsDigit, IsSeparator, IsWhiteSpace from char_icalls.
25468
25469 2004-02-18  Urs C Muff  <umuff@quark.com>
25470
25471         * debug-mono-symfile.c, mono-debug-debugger.c, mono-debug.c: Make
25472         this work on PPC and other big-endian architectures.
25473
25474         * debug-mono-symfile.h: Prepended the names of all the `guint32'
25475         fields with an underscore to make sure they're only accessed by
25476         the read32() macro.
25477
25478 2004-02-18  Martin Baulig  <martin@ximian.com>
25479
25480         * icall.c: Put the klass->refclass changes back for methods and
25481         fields, but not for properties and events.  We're currently not
25482         distinguishing between DeclaringType and ReflectedType for
25483         properties and events, that's what caused the regressions.
25484
25485 2004-02-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25486
25487         * object.c:
25488         (mono_async_result_new): the handle can be NULL.
25489
25490         * threadpool.c: Use an event instead of a semaphore, don't initialize
25491         it until needed. This saves quite a few semaphores from being created
25492         when using the threadpool.
25493
25494 2004-02-18  Zoltan Varga  <vargaz@freemail.hu>
25495
25496         * object.c (mono_string_is_interned_lookup): Fix interning of long
25497         strings. Fixes #54473.
25498
25499         * domain.c (ldstr_equal): Optimize if the two strings are equal.
25500
25501         * icall.c: Revert the klass->refclass changes since they introduce
25502         regressions (bug #54518).
25503
25504 2004-02-18  Martin Baulig  <martin@ximian.com>
25505
25506         * class.c (mono_class_init): If we're a generic instance and don't
25507         come from a TypeBuilder, inflate our members here.
25508         (mono_class_from_generic): Removed; just use `ginst->klass' instead.
25509         (mono_class_create_generic): New public method.
25510         (mono_class_initialize_generic): Removed.
25511         (get_instantiation_name): Renamed to
25512         _mono_class_get_instantiation_name() and made it public.
25513
25514 2004-02-18  Martin Baulig  <martin@ximian.com>
25515
25516         * class.c (mono_class_inflate_generic_type): Clear the new
25517         instance's `nginst->klass' when inflating a generic instance.
25518         (mono_class_is_subclass_of): Added (basic) support for generic
25519         instances.
25520
25521 Tue Feb 17 21:40:16 CET 2004 Paolo Molaro <lupus@ximian.com>
25522
25523         * appdomain.h, domain.c: use a MonoCodeManager instead of a
25524         MonoMempool to hold compiled native code.
25525
25526 2004-02-17  Martin Baulig  <martin@ximian.com>
25527
25528         * class.h (MonoDynamicGenericInst): Added `count_properties' and
25529         `properties'.
25530
25531         * reflection.c (mono_reflection_generic_inst_initialize): Added
25532         `MonoArray *properties' argument.
25533
25534         * icall.c (ves_icall_MonoGenericInst_GetProperties): New interncall.    
25535
25536 2004-02-17  Martin Baulig  <martin@ximian.com>
25537
25538         * icall.c (ves_icall_Type_GetFields): Renamed to
25539         ves_icall_Type_GetFields_internal() and added a
25540         `MonoReflectionType *rtype' argument; pass it to
25541         mono_field_get_object() to set the field's "reflected" type.
25542         (ves_icall_Type_GetConstructors): Likewise.
25543         (ves_icall_Type_GetEvents): Likewise.
25544         (ves_icall_Type_GetMethodsByName): Added `MonoReflectionType *rtype'
25545         argument; pass it to mono_method_get_object() to set the method's
25546         "reflected" type.       
25547
25548 2004-02-17  Martin Baulig  <martin@ximian.com>
25549
25550         * class.h (MonoDynamicGenericInst): New type.
25551         (MonoGenericInst): Added `dynamic_info' and `is_dynamic' fields.
25552
25553         * icall.c (ves_icall_MonoGenericInst_GetMethods): New interncall.
25554         (ves_icall_MonoGenericInst_GetConstructors): New interncall.
25555         (ves_icall_MonoGenericInst_GetFields): New interncall.
25556
25557         * class.c (mono_class_from_generic): Don't call
25558         mono_class_initialize_generic() if this is a dynamic instance;
25559         ie. it's being created from a TypeBuilder.
25560         Use MONO_TYPE_GENERICINST for `class->this_arg.type' and
25561         `class->byval_arg.type'.
25562
25563         * reflection.c (mono_reflection_inflate_method_or_ctor): Renamed
25564         to `inflate_method' and made static.
25565         (mono_reflection_inflate_field): Removed.
25566         (mono_reflection_generic_inst_initialize): New public method.
25567
25568         * reflection.h (MonoReflectionGenericInst): Removed `methods',
25569         `ctors' and `fields'; added `initialized'.
25570
25571 2004-02-14  Zoltan Varga  <vargaz@freemail.hu>
25572
25573         * debug-helpers.c (mono_method_full_name): Fix output for empty
25574         namespaces.
25575
25576 2004-02-12  Martin Baulig  <martin@ximian.com>
25577
25578         * class.h (MonoClassField): Added `MonoType *generic_type'.
25579
25580         * reflection.c (mono_image_get_fieldref_token): Added support for
25581         instantiated generic types.
25582         (field_encode_inflated_field): Removed.
25583         (mono_image_get_inflated_field_token): Removed.
25584         (mono_reflection_inflate_field): Return a `MonoReflectionField *'.
25585
25586         * reflection.h (MonoReflectionInflatedField): Removed.
25587
25588 2004-02-12  Martin Baulig  <martin@ximian.com>
25589
25590         * metadata.h (MonoMethodHeader, MonoMethodSignature): Moved the
25591         `gen_method' field from MonoMethodHeader to MonoMethodSignature.
25592
25593         * reflection.c (mono_image_get_methodspec_token): Take a
25594         `MonoMethod *' instead of a `MonoReflectionInflatedMethod *'.
25595         (mono_image_create_token): Check whether we have a
25596         `method->signature->gen_method' and call
25597         mono_image_get_methodspec_token() if appropriate.
25598         (inflated_method_get_object): Removed.
25599         (mono_reflection_bind_generic_method_parameters): Return a
25600         `MonoReflectionMethod *', not a `MonoReflectionInflatedMethod *'.
25601         (mono_reflection_inflate_method_or_ctor): Likewise.
25602
25603         * reflection.h (MonoReflectionInflatedMethod): Removed.
25604
25605 2004-02-12  Zoltan Varga  <vargaz@freemail.hu>
25606
25607         * marshal.c (mono_marshal_get_native_wrapper): Implement proper support
25608         for custom valuetype marshalling.
25609
25610         * icall.c (icall_entries): Diagnostic -> Diagnostics. Fixes #54261.
25611
25612 2004-02-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25613
25614         * icall.c: fixed WSAGetLastError_internal name.
25615
25616 2004-02-11  Zoltan Varga  <vargaz@freemail.hu>
25617
25618         * threads.c (mono_thread_attach): Allow this to be called multiple
25619         times for a thread.
25620         
25621         * threads.c (build_wait_tids): Do not wait for ourselves.
25622
25623         * threads.c (mono_thread_pop_appdomain_ref): Avoid crash if the 
25624         appdomain list is empty.
25625
25626         * marshal.c (mono_marshal_get_native_wrapper): Do not free the
25627         memory returned by mono_string_builder_to_utf16, since it points into
25628         managed memory. Thanks to Bernie Solomon for noticing this.
25629
25630         * icall.c: Add AppDomainSetup icalls.
25631
25632         * reflection.h (MonoReflectionMethodAux): Add 'param_cattr' field.
25633
25634         * reflection.c (mono_custom_attrs_from_param): Add support for dynamic
25635         types.
25636
25637         * reflection.c (reflection_methodbuilder_to_mono_method): Save
25638         custom attributes to the method_aux struct. Also fix array indexes etc.
25639
25640         * loader.c (mono_method_get_param_names): Make dynamic case work again.
25641         
25642 Tue Feb 10 17:03:04 CET 2004 Paolo Molaro <lupus@ximian.com>
25643
25644         * icall.c, loader.c: icall cleanup: we save quite a bit of memory
25645         (both static and runtime) and reduce startup time.
25646
25647 2004-02-10  Zoltan Varga  <vargaz@freemail.hu>
25648
25649         * marshal.c (mono_marshal_get_native_wrapper): Throw an exception on
25650         AsAny marshalling conversion instead of crashing.
25651
25652         * marshal.c: Fix warnings.
25653
25654 2004-02-09  Martin Baulig  <martin@ximian.com>
25655
25656         * class.h (MonoGenericMethod): Added `MonoMethod *declaring'.
25657
25658         * reflection.h (MonoReflectionInflatedMethod): Removed the
25659         `declaring' field, it's now in the unmanaged MonoGenericMethod.
25660
25661         * reflection.c (method_encode_methodspec): Removed the `method'
25662         argument; we get it from `gmethod->declaring'.
25663         (inflated_method_get_object): Removed the `declaring' argument.
25664
25665 2004-02-09  Martin Baulig  <martin@ximian.com>
25666
25667         * class.h (MonoGenericMethod): New type.
25668         (MonoGenericInst): Remove `mtype_argc', `mtype_argv' and
25669         `generic_method'.
25670
25671         * metadata.h (MonoMethodHeader): Replaced the `geninst' field with
25672         a `MonoGenericMethod *gen_method' one.
25673
25674         * class.c (mono_class_inflate_generic_type): Take an additional
25675         `MonoGenericMethod * argument.  This is only non-NULL if we're
25676         inflating types for a generic method.   
25677         (mono_class_inflate_generic_signature): Renamed to
25678         inflate_generic_signature() and made static; take a
25679         `MonoGenericMethod *' argument instead of a `MonoGenericInst *'.
25680         (inflate_generic_header): Take a `MonoGenericMethod *' argument
25681         instead of a `MonoGenericInst *' one.
25682         (mono_class_inflate_generic_method): Likewise.
25683
25684         * reflection.c (encode_generic_method_sig): Take a
25685         `MonoGenericMethod *' argument instead of a `MonoGenericInst *'.
25686         (method_encode_methodspec): Likewise.
25687         (inflated_method_get_object): Likewise. 
25688
25689         * reflection.h (MonoReflectionGenericInst): Replaced the `ginst'
25690         field with a `MonoGenericMethod *gmethod' one.  
25691
25692 2004-02-08  Bernie Solomon  <bernard@ugsolutions.com>
25693
25694         * class.h (mono_class_has_parent): add parens to expansion
25695         so you can ! this.
25696
25697 2004-02-08  Martin Baulig  <martin@ximian.com>
25698
25699         * image.h (MonoImage): Removed `generics_cache'.
25700
25701         * class.c (mono_class_from_generic): Take a `MonoGenericInst *'
25702         instead of a `MonoType *' argument; removed the `inflate_methods'
25703         argument.  Don't inflate methods here.
25704
25705         * loader.c (find_method): If it's a generic instance, call
25706         mono_class_init() on the `sclass->generic_inst->generic_type'.
25707
25708         * metadata.c (mono_type_size): Make this work on uninitialized
25709         generic instances; call it on the `ginst->generic_type's class.
25710
25711         * reflection.c (mono_reflection_bind_generic_parameters): Call
25712         mono_class_from_generic() to create the `ginst->klass'.
25713
25714 2004-02-08  Martin Baulig  <martin@ximian.com>
25715
25716         * class.h (MonoClass): Changed type of `generic_inst' from
25717         `MonoType *' to `MonoGenericInst *'.
25718
25719 2004-02-08  Martin Baulig  <martin@ximian.com>
25720
25721         * icall.c (ves_icall_Type_BindGenericParameters): Just call
25722         mono_type_get_object(), this is now creating a `MonoGenericInst'
25723         for MONO_TYPE_GENERICINST.
25724         (ves_icall_MonoGenericInst_GetParentType): Likewise.
25725         (ves_icall_MonoGenericInst_GetInterfaces): Likewise.
25726
25727         * reflection.c (mono_type_get_object): Return a `MonoGenericInst'
25728         instead instead of a `MonoType' for MONO_TYPE_GENERICINST.
25729         (inflated_method_get_object): Added `MonoClass *refclass' argument.
25730         (mono_reflection_inflate_method_or_ctor): Correctly set declaring
25731         and reflected type.
25732
25733         * reflection.h (MonoReflectionInflatedMethod): Removed
25734         `declaring_type' and `reflected_type'.
25735
25736 2004-02-08  Martin Baulig  <martin@ximian.com>
25737
25738         * class.h (MonoGenericInst): Added `MonoType *parent' and
25739         `MonoType **ifaces'.
25740
25741         * reflection.h (MonoReflectionGenericInst): Removed `klass',
25742         `parent' and `interfaces'.
25743
25744         * reflection.c (mono_reflection_bind_generic_parameters): Take a
25745         `MonoType *' argument and return a `MonoType *'.
25746
25747         * icall.c
25748         (ves_icall_MonoGenericInst_GetParentType): New interncall.
25749         (ves_icall_MonoGenericInst_GetInterfaces): Likewise.    
25750
25751 2004-02-06  Zoltan Varga  <vargaz@freemail.hu>
25752
25753         * marshal.c (mono_marshal_get_native_wrapper): Add support for custom
25754         valuetype marshalling.
25755
25756 2004-02-06  Martin Baulig  <martin@ximian.com>
25757
25758         * class.c
25759         (mono_class_from_generic_parameter): Added TYPE_ATTRIBUTE_PUBLIC.
25760         (my_mono_class_from_generic_parameter): Likewise.
25761
25762 2004-02-06  Zoltan Varga  <vargaz@freemail.hu>
25763
25764         * debug-mono-symfile.c debug-mono-symfile.h mono-debug.c: Read the
25765         contents of the symbol files lazily.
25766
25767         * object.h (MonoThread): Add 'name' and 'name_len' fields.
25768
25769         * threads.h threads.c icall.c: New icalls for getting and setting the
25770         threads name.
25771
25772 2004-02-05  Zoltan Varga  <vargaz@freemail.hu>
25773
25774         * appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRefByID): 
25775         Raise an exception when the domain is not found.
25776
25777 2004-02-03  Martin Baulig  <martin@ximian.com>
25778
25779         * reflection.c (mono_image_get_methodspec_token): Use the
25780         uninflated signature; fixes gen-33.
25781
25782 2004-02-02  Zoltan Varga  <vargaz@freemail.hu>
25783
25784         * gc.c threads.c: Make the finalizer thread a normal managed thread so
25785         the finalizer code can use thread functionality.
25786
25787         * gc.c (ves_icall_System_GC_WaitForPendingFinalizers): Fix check for 
25788         the finalizer thread.
25789
25790         * threads.c: Make some functions more robust.
25791
25792         * loader.c (mono_lookup_pinvoke_call): Another attempt at fixing #22532.
25793
25794         * metadata.h: Add new marshalling conventions.
25795
25796         * marshal.c (mono_marshal_get_native_wrapper): Add support for unicode
25797         stringbuilder marshalling. Fixes #53700.
25798
25799         * reflection.h (MonoReflectionTypeBuilder): Add 'permissions' field.
25800
25801         * reflection.c (mono_image_get_type_info): Save declarative security
25802         info.
25803
25804         * reflection.c (mono_image_get_field_info): Handle uninitialized 
25805         unmanaged fields as well.
25806
25807         * appdomain.c: Bump corlib version.
25808
25809 2004-02-01  Martin Baulig  <martin@ximian.com>
25810
25811         * loader.c (method_from_methodspec): Use `ginst->mtype_argc/v' for
25812         method type arguments.  
25813
25814 2004-01-30  Duncan Mak  <duncan@ximian.com>
25815
25816         * marshal.h: Add prototype for
25817         "ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem"
25818         and
25819         "ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem" to
25820         fix the build.
25821
25822 2004-01-30  Zoltan Varga  <vargaz@freemail.hu>
25823
25824         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem): New icall.
25825         (ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem): New icall.
25826
25827 2004-01-29  Zoltan Varga  <vargaz@freemail.hu>
25828
25829         * marshal.c (mono_marshal_get_native_wrapper): Add support for
25830         custom marshalling of valuetypes.
25831
25832         * marshal.c: Fix some warnings.
25833
25834 2004-01-29  Martin Baulig  <martin@ximian.com>
25835
25836         * class.h (MonoGenericInst): Added `mtype_argc' and `mtype_argv'
25837         for generic method parameters.
25838
25839         * reflection.c (method_encode_methodspec): Write the uninflated
25840         signature into the methodspec table.
25841         (mono_reflection_inflate_method_or_ctor): Ensure `res->declaring'
25842         is always the uninflated method.
25843         (reflection_methodbuilder_to_mono_method): Copy the generic
25844         parameters from the MethodBuilder into `header->gen_params'.
25845
25846 2004-01-29  Zoltan Varga  <vargaz@freemail.hu>
25847
25848         * class.c (mono_class_from_generic_parameter): Fix warning.
25849
25850 2004-01-27  Martin Baulig  <martin@ximian.com>
25851
25852         * class.c (mono_class_from_generic_parameter): Don't create
25853         `klass->methods' here.  
25854
25855 2004-01-26  Zoltan Varga  <vargaz@freemail.hu>
25856
25857         * loader.c (mono_lookup_pinvoke_call): Disable trimming of .dll
25858         extension since it does not work with libraries named lib<FOO>.dll.so.
25859
25860 2004-01-25  Martin Baulig  <martin@ximian.com>
25861
25862         * class.c (mono_class_inflate_generic_type): Added support for
25863         MONO_TYPE_GENERICINST.
25864
25865         * reflection.c (mono_reflection_inflate_method_or_ctor): Also
25866         inflate methods on open constructed types.      
25867
25868 2004-01-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25869
25870         * object.c: fire ProcessExit event in the root AppDomain after running
25871         Main. Fixes bug #53299.
25872
25873 Fri Jan 23 21:27:40 CET 2004 Paolo Molaro <lupus@ximian.com>
25874
25875         * socket-io.c: include the new socket-wrappers.h header.
25876         Use the wrappers instead of the unix socket functions to make the code
25877         more clear.
25878
25879 2004-01-23  Zoltan Varga  <vargaz@freemail.hu>
25880
25881         * profiler.c (merge_methods): Fix merging of profile info. Fixes #53010.
25882
25883         * loader.c (mono_lookup_pinvoke_call): Strip .dll from library names.
25884         Fixes #22532.
25885
25886 2004-01-22  Zoltan Varga  <vargaz@freemail.hu>
25887
25888         * reflection.c (mono_image_create_pefile): Handle the case when the
25889         entry point is not a MethodBuilder.
25890
25891         * reflection.h (MonoReflectionAssemblyBuilder): Change 'entry_point'
25892         field to ReflectionMethod since it is not allways a builder.
25893
25894         * reflection.c (type_get_fully_qualified_name): New helper function to
25895         return the fully qualified name of a type.
25896
25897         * reflection.c (encode_marshal_blob): Always emit the fully qualified
25898         type name for custom marshallers.
25899
25900         * reflection.c (mono_marshal_spec_from_builder): Ditto.
25901
25902         * class.c (mono_class_setup_vtable): If a parent class already 
25903         implements an interface, use the implementing methods from that class.
25904         Fixes #53148.
25905
25906 2004-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25907
25908         * threadpool.c: just return instead of ExitThread to allow for thread
25909         clean up earlier.
25910
25911 2004-01-21  Zoltan Varga  <vargaz@freemail.hu>
25912
25913         * icall.c (ves_icall_System_Reflection_Module_Close): Prevent assertion
25914         when closing resource modules.
25915
25916         * reflection.c (mono_image_create_pefile): Handle the case when the
25917         entry point is not a MethodBuilder.
25918
25919         * reflection.h (MonoReflectionAssemblyBuilder): Change 'entry_point'
25920         field to ReflectionMethod since it is not allways a builder.
25921
25922 2004-01-20  Bernie Solomon  <bernard@ugsolutions.com>
25923
25924         * marshal.c (mono_marshal_get_managed_wrapper): 
25925         mono_marshal_alloc takes native int so CONV_I
25926         the arg for 64bits.
25927
25928 2004-01-20  Zoltan Varga  <vargaz@freemail.hu>
25929
25930         * reflection.c (fixup_cattrs): New function to fixup the methoddef
25931         tokens in the cattr table. Fixes #53108.
25932
25933 2004-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25934
25935         * loader.c: don't trim ".dll" before looking up in the config file.
25936         Don't leak orig_scope. Reopened bug #22532 in the meanwhile.
25937
25938 2004-01-19  Zoltan Varga  <vargaz@freemail.hu>
25939
25940         * icall.c (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal): 
25941         Return the module which contains the resource as well.
25942         (ves_icall_System_Reflection_Module_Close): New icall.
25943
25944         * appdomain.c: Bump corlib version number.
25945
25946         * image.c (mono_image_addref): New public function.
25947
25948         * assembly.c: Call mono_image_addref.
25949
25950         * reflection.c (mono_module_get_object): Increase reference count of 
25951         the image.
25952
25953         * loader.c (mono_lookup_pinvoke_call): Strip .dll from library names.
25954         Fixes #22532.
25955
25956         * exception.h exception.c loader.h loader.c icall.c marshal.h marshal.c:
25957         Applied patch from Bernie Solomon  <bernard@ugsolutions.com>. Throw
25958         proper exceptions on DllImport problems.
25959
25960 Mon Jan 19 17:50:27 CET 2004 Paolo Molaro <lupus@ximian.com>
25961
25962         * class.c, metadata.c: eliminate CSIZE macro.
25963
25964 2004-01-19  Lluis Sanchez Gual  <lluis@ximian.com>
25965
25966         * icall.c: Added ves_icall_type_IsInstanceOf internal call.
25967         * object.h: Added async_callback field in MonoAsyncResult.
25968         * marshal.c: In mono_delegate_begin_invoke, set the value of async_callback.
25969         * verify.c: Added async_callback in MonoAsyncResult layout.
25970
25971 2004-01-17  Zoltan Varga  <vargaz@freemail.hu>
25972
25973         * reflection.c (mono_reflection_get_custom_attrs): Add support
25974         for Modules.
25975
25976 2004-01-16  Zoltan Varga  <vargaz@freemail.hu>
25977
25978         * marshal.c (mono_string_builder_to_utf8): Fix stringbuilder 
25979         marshalling.
25980         (mono_marshal_method_from_wrapper): Add null pointer check.
25981
25982 2004-01-16  Martin Baulig  <martin@ximian.com>
25983
25984         * debug-mono-symfile.h: Set version number to 36 and reflect
25985         latest symbol writer changes.
25986
25987 2004-01-16  Zoltan Varga  <vargaz@freemail.hu>
25988
25989         * class.c (mono_bounded_array_class_get): Set 'bounded' to FALSE for
25990         multi-dimensional arrays.
25991         (mono_class_is_assignable_from): Check vectors<->one dim. arrays.
25992         (mono_class_from_mono_type): Use bounded_array_class_get.
25993         
25994         * class.c (mono_bounded_array_class_get): New function which takes
25995         a 'bounded' bool argument to distinguish vectors from one dimensional
25996         arrays.
25997
25998         * icall.c (ves_icall_System_Array_CreateInstanceImpl): Call 
25999         bounded_array_class_get if the array has bounds.
26000
26001         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
26002         Search modules loaded using AssemblyBuilder:AddModule as well.
26003
26004 2004-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26005
26006         * appdomain.c: increased corlib version.
26007         * filewatcher.c: removed g_print.
26008         * icall.c:
26009         (get_property_info): only allocate what is actually requested.
26010         (ves_icall_Type_GetInterfaces): free the bitset in case of early error.
26011
26012 2004-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26013
26014         * Makefile.am: added filewatcher.[ch]
26015         * filewatcher.[ch]: FileSystemWatcher runtime support.
26016         * icall.c: added new FSW icalls.
26017
26018 Tue Jan 13 20:03:17 CET 2004 Paolo Molaro <lupus@ximian.com>
26019
26020         * string-icalls.c: fix stringbuilder regression as suggested by
26021         Iain McCoy <iain@mccoy.id.au>.
26022
26023 2004-01-13  Zoltan Varga  <vargaz@freemail.hu>
26024
26025         * process.c (process_read_stringtable_block): Recognize '007f' as
26026         a language neutral stringtable block.
26027
26028 2004-01-12  Patrik Torstensson
26029
26030         * object.h (MonoStringBuilder) : Changed layout to support our
26031         new stringbuilder class.
26032         * marshal.c: Change marshalling to support the new layout of 
26033         string builder.
26034         * appdomain.c: increased version number because new layout of
26035         string builder.
26036
26037 2004-01-12  Zoltan Varga  <vargaz@freemail.hu>
26038
26039         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Receive the
26040         assembly name as an string instead of an AssemblyName, since it is
26041         easier to extract info from it.
26042
26043         * appdomain.c (mono_domain_assembly_preload): Look for assemblies in
26044         the culture subdirectories too. Fixes #52231.
26045
26046 2004-01-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26047
26048         * icall.c: renamed ves_icall_Type_GetMethods to GetMethodsByName.
26049         It takes 2 new parameters with an optional name for the method to look
26050         for and case ignoring info.
26051
26052         * threadpool.c: removed unused variable.
26053
26054 2004-01-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26055
26056         * icall.c: renamed ves_icall_Type_GetProperties to GetPropertiesByName.
26057         It takes 2 new parameters with an optional name for the property to look
26058         for and case ignoring info.
26059         Fixes bug #52753.
26060
26061 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
26062
26063         * reflection.c: Applied patch from Benjamin Jemlich (pcgod@gmx.net).
26064         Fix #52451.
26065
26066 2004-01-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26067
26068         * appdomain.c:
26069         * assembly.c: escape the uri before passing it to g_filename_from_uri.
26070         Fixes bug #52630.
26071
26072 2004-01-07  Zoltan Varga  <vargaz@freemail.hu>
26073
26074         * reflection.c: Add support for more than one unmanaged resource.
26075
26076         * icall.c (ves_icall_get_enum_info): Store the value of the enum fields
26077         in field->def_value, as done in all other cases.
26078
26079         * reflection.c (mono_reflection_get_custom_attrs): Add support for
26080         TypeBuilders.
26081
26082         * reflection.c (mono_reflection_create_runtime_class): Remove 
26083         errorneous assignment to klass->element_class, since it is already
26084         done in mono_reflection_setup_internal_class.
26085
26086 2004-01-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26087
26088         * gc.c: added missing LeaveCriticalSection.
26089         * icall.c: indented a couple of lines.
26090         * threadpool.c: remove dangling LeaveCriticalSection. Don't wait forever
26091         if we call EndInvoke inside a callback. Fixes bug #52601.
26092
26093 2004-01-07  Martin Baulig  <martin@ximian.com>
26094
26095         * mono-debug-debugger.h
26096         (MonoDebuggerIOLayer): Added `GetCurrentThreadID'.
26097
26098 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
26099
26100         * appdomain.c: Use messages in NotImplementedException.
26101
26102         * exception.c (mono_get_exception_not_implemented): Now this takes
26103         a message argument.
26104
26105         * marshal.c (emit_str_to_ptr_conv): g_warning and throw an
26106         exception instead of g_asserting an aborting when something is not
26107         implemented.
26108
26109         Add some inline docs.
26110
26111 2004-01-05  Zoltan Varga  <vargaz@freemail.hu>
26112
26113         * reflection.h: Update after changes to object layout.
26114
26115         * reflection.c: Implement saving of unmanaged aka win32 resources.
26116
26117         * appdomain.c: Bump version number.
26118
26119         * appdomain.c (ves_icall_System_AppDomain_InternalSetDomainByID): 
26120         Handle missing domains gracefully.
26121
26122 2004-01-05  Atsushi Enomoto <atsushi@ximian.com>
26123
26124         * file-io.c : On Windows, there are much more invalid_path_chars.
26125
26126 Fri Jan 2 13:35:48 CET 2004 Paolo Molaro <lupus@ximian.com>
26127
26128         * class.h, object.c: prepare for GetType () speedup.
26129
26130 2003-12-24  Atsushi Enomoto <atsushi@ximian.com>
26131
26132         * profiler.c: workaround for --profile null reference exception on
26133           cygwin. Patch by Patrik Torstensson.
26134
26135 2003-12-22  Bernie Solomon  <bernard@ugsolutions.com>
26136
26137         * marshal.c: (ves_icall_System_Runtime_InteropServices_Marshal_Read/WriteXXX)
26138         make work for unaligned access.
26139
26140 Mon Dec 22 18:37:02 CET 2003 Paolo Molaro <lupus@ximian.com>
26141
26142         * class.c: small cleanup (class->fields [i] -> field).
26143         * image.c: check address of metadata is valid.
26144
26145 2003-12-22  Zoltan Varga  <vargaz@freemail.hu>
26146
26147         * assembly.h assembly.c (mono_assembly_loaded): New public function to
26148         search the list of loaded assemblies.
26149
26150         * reflection.c (mono_reflection_type_from_name): Use 
26151         mono_assembly_loaded instead of mono_image_loaded.
26152
26153         * reflection.c: Fix warnings.
26154
26155 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
26156
26157         * image.h (MonoImage): Add a new 'dynamic' field to denote that the image 
26158         is dynamic. This is needed since an assembly can contain both dynamic and
26159         non-dynamic images.
26160
26161         * class.c loader.c metadata.c object.c: Use image->dynamic instead of 
26162         assembly->dynamic.
26163
26164         * icall.c reflection.c: Add new AssemblyBuilder:AddModule icall.
26165
26166         * reflection.h (MonoReflectionAssemblyBuilder): Add 'loaded_modules' field
26167         to store modules loaded using AddModule.
26168
26169         * reflection.c (mono_image_fill_file_table): Generalize this so it works
26170         on Modules.
26171
26172         * reflection.c (mono_image_fill_export_table_from_class): New helper function.
26173
26174         * reflection.c (mono_image_fill_export_table_from_module): New function to
26175         fill out the EXPORTEDTYPES table from a module.
26176
26177         * reflection.c (mono_image_emit_manifest): Refactor manifest creation code
26178         into a separate function. Also handle loaded non-dynamic modules.
26179
26180         * reflection.c (mono_image_basic_init): Fix memory allocation.
26181
26182         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
26183
26184         * assembly.c (mono_assembly_load_references): Make this public.
26185
26186 2003-12-19  Martin Baulig  <martin@ximian.com>
26187
26188         * class.c (mono_class_initialize_generic): Made this static, take
26189         a `MonoGenericInst *' instead of a `MonoClass *'.
26190         (mono_class_from_generic): Call mono_class_initialize_generic()
26191         unless we're already initialized or being called from
26192         do_mono_metadata_parse_generic_inst().
26193
26194         * class.h (MonoGenericInst): Added `initialized' and
26195         `init_pending' flags.
26196
26197         * metadata.c (do_mono_metadata_parse_generic_inst): Don't call
26198         `mono_class_init (gklass)' or mono_class_initialize_generic()
26199         here; set `generic_inst->init_pending' while parsing the
26200         `type_argv'.
26201
26202 2003-12-19  Bernie Solomon  <bernard@ugsolutions.com>
26203
26204         * locales.c: include string.h for memxxx prototypes
26205
26206 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
26207
26208         * icall.c (ves_icall_MonoField_GetValueInternal): Do not run the class
26209         constructor when accessing literal fields.
26210
26211 2003-12-17  Zoltan Varga  <vargaz@freemail.hu>
26212
26213         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
26214
26215         * reflection.c (assembly_add_resource_manifest): New function to fill
26216         the MANIFESTRESOURCE table.
26217
26218         * reflection.c (mono_image_build_metadata): Emit MANIFESTRESOURCE table.
26219
26220         * reflection.h: Update to changes in class layout.
26221
26222         * icall.c (ves_icall_System_Environment_get_HasShutdownStarted): 
26223         Reenable call to mono_runtime_is_shutting_down ().
26224
26225         * appdomain.c (mono_runtime_is_shutting_down): New helper function to
26226         determine if the runtime is shutting down.
26227
26228 2003-12-16  Jackson Harper <jackson@ximian.com>
26229
26230         * icall.c: comment out call to mono_runtime_is_shutting_down to
26231         fix build.
26232         
26233 2003-12-16  Zoltan Varga  <vargaz@freemail.hu>
26234
26235         * icall.c (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal): Add support for loading resources from modules.
26236         (ves_icall_System_Environment_get_HasShutdownStarted): New icall.
26237
26238 2003-12-15  Bernie Solomon  <bernard@ugsolutions.com>
26239
26240         * reflection.c: move definition of swap_with_size
26241         to before its first call
26242
26243 2003-12-15  Zoltan Varga  <vargaz@freemail.hu>
26244
26245         * appdomain.c (mono_runtime_is_shutting_down): New public function.
26246
26247         * icall.c (ves_icall_System_Environment_get_HasShutdownStarted): New
26248         icall.
26249
26250         * object.c: Fix warnings.
26251
26252         * icall.c (ves_icall_Type_Get...): Only consider inherited static
26253         members if FlattenHierarchy is set.
26254
26255         * reflection.c (mono_image_add_decl_security): New function to emit
26256         declarative security.
26257
26258         * reflection.h reflection.c: Add support for declarative security.
26259
26260         * appdomain.c (MONO_CORLIB_VERSION): Bump version number.
26261         
26262 2003-12-13  Zoltan Varga  <vargaz@freemail.hu>
26263
26264         appdomain.c (MONO_CORLIB_VERSION): Bump version number.
26265         
26266         * appdomain.c verify.c: Moved corlib version checking into its own
26267         function in appdomain.c since it needs to create vtables etc.
26268
26269 2003-12-13  Patrik Torstensson <p@rxc.se>
26270
26271         * marshal.c (mono_remoting_wrapper): Fix bug 48015, using TP as this 
26272         instead of unwrapped server.
26273
26274 2003-12-12  Zoltan Varga  <vargaz@freemail.hu>
26275
26276         * verify.c (check_corlib): Fix field index.
26277
26278 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
26279
26280         * icall.c: Applied patch from Todd Berman (tbermann@gentoo.org). New
26281         GetGacPath icall.
26282
26283 2003-12-10  Bernie Solomon  <bernard@ugsolutions.com>
26284
26285         * process.c:  (ves_icall_System_Diagnostics_Process_GetWorkingSet_internal
26286         ves_icall_System_Diagnostics_Process_SetWorkingSet_internal):
26287         cope with sizeof(size_t) != sizeof(guint32).
26288
26289 2003-12-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26290
26291         * process.[ch]: the 'pid' field in MonoProcInfo stores GetLastError
26292         in case of failure.
26293
26294 2003-12-10  Mark Crichton <crichton@gimp.org>
26295
26296         * icall.c: removed the GetNonZeroBytes.  We now handle this case
26297         in managed code.
26298
26299         * rand.c, rand.h: Same here.  Also cleaned up the clode slightly.
26300
26301 Tue Dec 9 15:36:18 CET 2003 Paolo Molaro <lupus@ximian.com>
26302
26303         * class.h, class.c, icall.c, marshal.c, object.c: ignore fields
26304         marked as deleted.
26305
26306 2003-12-09  Zoltan Varga  <vargaz@freemail.hu>
26307
26308         * verify.c (check_corlib): Handle the case when the version field is 
26309         initialized by a static constructor.
26310
26311 2003-12-08  Patrik Torstensson  <p@rxc.se>
26312
26313     * rand.c (InternalGetBytes): Implemented win32 version with cryptapi
26314
26315 2003-12-08  Martin Baulig  <martin@ximian.com>
26316
26317         * icall.c (ves_icall_TypeBuilder_define_generic_parameter): Return
26318         a MonoReflectionGenericParameter, also take the parameter index
26319         and name as arguments.
26320         (ves_icall_MethodBuilder_define_generic_parameter): Likewise.
26321         (ves_icall_MonoGenericParam_initialize): New interncall.
26322         (ves_icall_Type_make_byref_type): New interncall.
26323
26324         * reflection.h (MonoReflectionGenericParam): Derive from
26325         MonoReflectionType, not just from MonoObject.  Added `refobj' and
26326         `index' fields.
26327
26328         * reflection.c (mono_reflection_define_generic_parameter): Create
26329         and return a new MonoReflectionGenericParam; don't initialize the
26330         constraints here.
26331         (mono_reflection_initialize_generic_parameter): New public method;
26332         initializes the constraints and creates the `param->pklass'.
26333
26334 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
26335
26336         * reflection.h reflection.c: Use the new fields 'num_types', 
26337         'num_fields' and 'num_methods' to track the number of types etc.
26338
26339         * verify.c (check_corlib): Check corlib version number.
26340
26341 2003-12-07  Zoltan Varga  <vargaz@freemail.hu>
26342
26343         * marshal.c (mono_marshal_method_from_wrapper): Remove assert so this
26344         function works on all methods.
26345
26346 2003-12-07  Lluis Sanchez Gual  <lluis@ximian.com>
26347
26348         * domain.c, loader.h: Added IRemotingTypeInfo interface in MonoDefaults.
26349         * icall.c: in, ves_icall_Remoting_RealProxy_GetTransparentProxy set
26350         the custom_type_info flag of the transparent proxy.
26351         * object.c: Added method mono_object_isinst_mbyref for casting mbyref
26352         objects that supports IRemotingTypeInfo.
26353         * object.h: Added custom_type_info field in transparent proxy.
26354
26355 2003-12-06  Martin Baulig  <martin@ximian.com>
26356
26357         * class.c (mono_class_create_from_generic): Removed.
26358         (mono_class_from_generic): Check `ginst->klass' before doing
26359         anything else.  This is important to fully support "recursive"
26360         generic types.
26361
26362         * metadata.c (do_mono_metadata_parse_generic_inst): Create an
26363         empty `generic_inst->klass' before doing anything else.
26364
26365 2003-12-06  Dick Porter  <dick@ximian.com>
26366
26367         * verify.c: 
26368         * object.h:
26369         * icall.c:
26370         * locales.c: Use C structs to access class fields.  Don't do a
26371         conversion between MonoString and UChar because both are
26372         platform-endian UTF-16.  Compare now takes startindex and count
26373         parameters.  Add a char overload for IndexOf.  Speed up the
26374         invariant string IndexOf.
26375
26376 2003-12-05  Zoltan Varga  <vargaz@freemail.hu>
26377
26378         * Makefile.am (monosn_LDADD): Fix parallel build.
26379
26380 2003-12-04  Martin Baulig  <martin@ximian.com>
26381
26382         * icall.c
26383         (ves_icall_type_GetTypeCode): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
26384         (ves_icall_Type_make_array_type): New interncall.       
26385
26386 2003-12-04  Martin Baulig  <martin@ximian.com>
26387
26388         * locales.c: also change it in the !HAVE_ICU case.
26389
26390 2003-12-04  Dick Porter  <dick@ximian.com>
26391
26392         * icall.c:
26393         * locales.c: construct_compareinfo is now in CompareInfo, not
26394         CultureInfo.
26395
26396 2003-12-04  Zoltan Varga  <vargaz@freemail.hu>
26397
26398         * image.c (mono_image_load_file_for_image): Cache loaded images in the
26399         image->files array.
26400
26401         * image.c (load_class_name): Load class names from the EXPORTEDTYPES
26402         table as well.
26403
26404         * assembly.c (mono_assembly_load_references): Only load references
26405         once.
26406
26407         * class.c (mono_class_from_name): Avoid linear search of the 
26408         EXPORTEDTYPE table.
26409
26410         * loader.c (mono_field_from_token): Cache lookups of fieldrefs as well.
26411
26412 2003-12-03  Zoltan Varga  <vargaz@freemail.hu>
26413
26414         * image.h (MonoImage): Add 'field_cache' field.
26415
26416         * loader.c (mono_field_from_token): Cache field lookups.
26417         
26418         * reflection.c (mono_module_get_object): Fix name property.
26419
26420         * icall.c (ves_icall_get_enum_info): Update after changes to 
26421         mono_metadata_get_constant_index ().
26422
26423         * icall.c: Get rid of get_type_info icall, use a separate icall for
26424         each type property to avoid needless memory allocations. Fixes #51514.
26425
26426         * metadata.c (mono_metadata_get_constant_index): Add a 'hint' parameter
26427         to avoid needless binary searches.
26428
26429         * class.c (class_compute_field_layout): Move the initialization of
26430         field->def_value to mono_class_vtable ().
26431
26432         * class.c (mono_class_layout_fields): Enable GC aware auto layout for
26433         non-corlib types.
26434
26435         * object.c (mono_object_allocate): Make it inline.
26436
26437         * object.c (mono_object_allocate_spec): Make it inline.
26438         
26439 2003-12-02  Dick Porter  <dick@ximian.com>
26440
26441         * locales.c (create_NumberFormat): NumberFormatInfo construction.
26442         Patch by Mohammad DAMT (mdamt@cdl2000.com).
26443
26444 2003-12-01  Dick Porter  <dick@ximian.com>
26445
26446         * threads.c: Fix signature and call in CreateMutex and
26447         CreateEvent.
26448
26449 2003-12-01  Dick Porter  <dick@ximian.com>
26450
26451         * icall.c: 
26452         * locales.c: Implement string compares and searching
26453
26454         * object.h: Add extra Thread field
26455
26456 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
26457
26458         * reflection.c (fixup_method): Add support for MonoCMethod.
26459
26460 2003-11-28  Zoltan Varga  <vargaz@freemail.hu>
26461
26462         * gc.c: Fix hangs and error messages when GC_DONT_GC is set.
26463
26464         * reflection.c (assembly_name_to_aname): Allow extra characters in
26465         assembly names. Fixes #51468.
26466
26467 2003-11-26  Zoltan Varga  <vargaz@freemail.hu>
26468
26469         * exception.c (mono_exception_from_name_domain): New helper function.
26470
26471         * appdomain.c (ves_icall_System_AppDomain_createDomain): Create the
26472         exception object in the correct domain.
26473
26474         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw): Fix 
26475         formatting + make a copy a the input data.
26476
26477         * loader.c (mono_get_method_from_token): Methods which contain
26478         native code do not have entries in the ImplMap.
26479
26480         (ves_icall_System_AppDomain_LoadAssemblyRaw): Fix exception throw.
26481         Thanks to Gonzalo for spotting this.
26482         
26483         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw): Applied
26484         patch from ztashev@openlinksw.co.uk (Zdravko Tashev). New icall.
26485
26486         * assembly.h (mono_assembly_load_from): Split the second part of 
26487         assembly loading into a new public function.
26488
26489         * exception.h (mono_get_exception_bad_image_format): New function.
26490
26491 2003-11-24  Zoltan Varga  <vargaz@freemail.hu>
26492
26493         icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
26494         Enumerate all modules inside a dynamic assembly. Fixes #51293.
26495         
26496         * icall.c: Add new icall for creating dynamic methods.
26497
26498         * loader.h debug-helpers.c: Add new wrapper type for dynamic methods.
26499
26500         * reflection.h (MonoReflectionDynamicMethod): Fix type of bool fields.
26501
26502         * reflection.c (mono_reflection_create_dynamic_method): New icall to
26503         create a dynamic method.
26504
26505         * reflection.c (resolve_object): New helper function.
26506
26507         * reflection.c: Generalize ReflectionMethodBuilder and the functions
26508         which manipulate it so they can also work on dynamic methods.
26509
26510         * reflection.c (reflection_method_builder_to_mono_method): Avoid 
26511         creating the MonoReflectionMethodAux structure if it is not needed.
26512         
26513         * reflection.h verify.c: Update after changes to object layout.
26514
26515         * reflection.c (method_builder_encode_signature): Fix compilation on
26516         gcc 2.95.x.
26517
26518 2003-11-21  Lluis Sanchez Gual  <lluis@ximian.com>
26519
26520         * appdomain.h: Added support for context static fields. Added static_data
26521           field to MonoAppContext and renamed thread_static_fields to a more
26522           generic special_static_fields in MonoAppDomain, since it can now contain
26523           context static fields.
26524         * domain.c: Updated hashtable name.
26525         * object.c: Replaced field_is_thread_static() for a more generic
26526           field_is_special_static() which also checks for context static attribute.
26527           In mono_class_vtable(), added support for static context fields.
26528         * threads.c: Changed methods that manage thread static fields to more
26529           generic methods so they can be reused both for thread and context static
26530           data.
26531         * threads.h: Declared some new methods.
26532
26533 2003-11-21  Zoltan Varga  <vargaz@freemail.hu>
26534
26535         * reflection.h: Update after changes to the managed types.
26536
26537         * reflection.c (encode_custom_modifiers): New helper function.
26538
26539         * reflection.c (method_encode_signature): Emit custom modifiers.
26540
26541         * reflection.c (field_encode_signature): Emit custom modifiers.
26542
26543 2003-11-18  Zoltan Varga  <vargaz@freemail.hu>
26544
26545         * reflection.h (MonoReflectionAssemblyName): Applied patch from Laurent Morichetti (l_m@pacbell.net). Fix type of 'flags' field.
26546
26547         * icall.c (ves_icall_System_ValueType_Equals): New optimized 
26548         implementation.
26549
26550         * icall.c (ves_icall_System_ValueType_InternalGetHashCode): New 
26551         icall.
26552
26553         * object.c (mono_field_get_value_object): New function.
26554
26555         * object.c appdomain.h appdomain.c: Make out_of_memory_ex domain
26556         specific.
26557
26558 2003-11-17  Zoltan Varga  <vargaz@freemail.hu>
26559
26560         * appdomain.c (mono_runtime_get_out_of_memory_ex): New function to
26561         return a preallocated out-of-memory exception instance.
26562
26563         * object.c (out_of_memory): Use the new function.
26564
26565         * metadata.c (mono_metadata_parse_type): Handle the case when the byref
26566         flag is before the custom modifiers. Fixes #49802.
26567
26568 2003-11-16  Martin Baulig  <martin@ximian.com>
26569
26570         * class.c (mono_class_is_open_constructed_type): Implemented the
26571         MONO_TYPE_GENERICINST case.
26572
26573 2003-11-16  Zoltan Varga  <vargaz@freemail.hu>
26574
26575         * assembly.c (mono_assembly_fill_assembly_name): New function to
26576         fill out the MonoAssemblyName structure.
26577         (mono_assembly_open): Use the new function.
26578
26579         * icall.c (fill_reflection_assembly_name): New helper function.
26580
26581         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Use the
26582         new function.
26583
26584         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): New icall.
26585
26586 2003-11-15  Martin Baulig  <martin@ximian.com>
26587
26588         * class.c (mono_class_is_open_constructed_type): New public
26589         function; checks whether a type is an open constructed type,
26590         ie. whether it still contains type parameters.
26591         (mono_class_inflate_generic_type): If we're a type parameter and
26592         the inflated type is also a MONO_TYPE_(M)VAR, return the original
26593         type.
26594
26595         * class.h (MonoGenericInst): Added `guint32 is_open'.
26596
26597         * loader.c (method_from_methodspec): Check whether we're an open
26598         or closed constructed type and set `ginst->is_open'.
26599
26600         * reflection.c (mono_reflection_bind_generic_parameters): Check
26601         whether we're an open or closed constructed type and set
26602         `ginst->is_open'.
26603         (mono_reflection_inflate_method_or_ctor): Don't inflate methods
26604         from open constructed types.
26605
26606 2003-11-15  Martin Baulig  <martin@ximian.com>
26607
26608         * reflection.c (mono_reflection_bind_generic_parameters): If we're
26609         a generic instance (instead of a generic type declaration) with
26610         unbound generic parameters, bind them to our actual types.
26611
26612 2003-11-14  Martin Baulig  <martin@ximian.com>
26613
26614         * reflection.h (MonoReflectionGenericInst): Added `MonoArray *interfaces'.
26615
26616         * reflection.c (mono_reflection_bind_generic_parameters): If we're
26617         an interface type, populate `res->interfaces' with instantiated
26618         versions of all the interfaces we inherit.
26619
26620 2003-11-13  Aleksey Demakov  <avd@openlinksw.com>
26621
26622         * assembly.c (mono_assembly_load): Fixed problem finding mscorlib.dll
26623         when MONO_PATH is set but doesn't contain the install dir.
26624
26625 2003-11-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26626
26627         * icall.c:
26628         (ves_icall_Type_GetInterfaces): don't return an interface twice when
26629         it's also implemented in base classes. Fixes bug #50927.
26630
26631 2003-11-13  Zoltan Varga  <vargaz@freemail.hu>
26632
26633         * gc.c (ves_icall_System_GC_WaitForPendingFinalizers): Avoid deadlocks
26634         if this method is called from a finalizer. Fixes #50913.
26635
26636 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
26637
26638         * threads.c: Implement VolatileRead/VolatileWrite
26639
26640         * icall.c: Add new icalls for VolatileRead/VolatileWrite
26641
26642 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
26643
26644         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Applied 
26645         patch from Danilo Sagan (dsegan@gmx.net). Fix compilation under gcc
26646         2.95.3.
26647
26648         * assembly.c (mono_assembly_open): Fix windows build. Applied patch 
26649         from Peter Ross (pro@missioncriticalit.com).
26650         
26651 2003-11-12  Lluis Sanchez Gual  <lluis@ximian.com>
26652
26653         * icall.c: Added internal call for System.Environment::GetMachineConfigPath
26654
26655 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
26656
26657         * assembly.c (mono_assembly_load_references): Disable check because it
26658         triggers on older corlibs which lots of people have.
26659
26660 2003-11-12  Jackson Harper  <jackson@ximian.com>
26661
26662         * assembly.c: Change corlib name to mscorlib. Add a temp. hack to
26663         load corlib.dll if mscorlib.dll is not found.
26664         * assembly.h: Remove corlib name define.
26665         * class.c:
26666         * domain.c:
26667         * image.c: Change corlib name to mscorlib.
26668         
26669 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
26670
26671         * debug-mono-symfile.c: Add patch from FreeBSD ports tree.
26672
26673 2003-11-11  Miguel de Icaza  <miguel@ximian.com>
26674
26675         * appdomain.h: Added loader_optimization here to sync with the C#
26676         code, and add disallow_binding_redirects field.
26677
26678 2003-11-11  Zoltan Varga  <vargaz@freemail.hu>
26679
26680         * mono-debug.c (mono_debug_add_method): Ignore unknown modules.
26681
26682         * reflection.c (mono_image_build_metadata): Fix crash on modules
26683         with no types.
26684
26685         * reflection.h (MonoMethodInfo): Track changes to the managed structure.
26686
26687         * icall.c (ves_icall_get_method_info): Return callingConvention as
26688         well.
26689
26690         * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces): Add 
26691         namespaces from the EXPORTEDTYPE table as well.
26692
26693         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Merge types
26694         from all modules inside the assembly.
26695         
26696 2003-11-11  Martin Baulig  <martin@ximian.com>
26697
26698         * reflection.c (mono_reflection_bind_generic_parameters): Make
26699         this work for interfaces.
26700
26701 2003-11-11  Martin Baulig  <martin@ximian.com>
26702
26703         * mono-debug.c (mono_debug_add_type): Ignore unknown modules.
26704
26705 2003-11-11  Martin Baulig  <martin@ximian.com>
26706
26707         * reflection.c (mono_reflection_inflate_method_or_ctor): Allow
26708         "MonoInflatedMethod" and "MonoInflatedCtor".
26709
26710 2003-11-11  Zoltan Varga  <vargaz@freemail.hu>
26711
26712         * reflection.c (resolution_scope_from_image): Use the assembly table
26713         from the manifest module, since other modules don't have it.
26714
26715         * debug-helpers.c (mono_type_full_name): New helper function.
26716
26717         * image.h (MonoAssembly): Change 'dynamic' to a boolean.
26718
26719         * image.c (mono_image_load_file_for_image): New public function which
26720         is a replacement for the load_file_for_image in class.c.
26721
26722         * assembly.c (mono_assembly_load_module): A wrapper for the function
26723         above which does assembly association and reference loading too.
26724
26725         * class.c (mono_class_from_name): Call mono_assembly_load_module.
26726
26727 2003-11-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26728
26729         * appdomain.c: not all of the attributes for the full assembly name
26730         are required and the order doesn't matter. Fixes bug #50787.
26731
26732 2003-11-10  Dick Porter  <dick@ximian.com>
26733
26734         * locales.c: Use platform-endian UTF16
26735
26736 2003-11-10  Zoltan Varga  <vargaz@freemail.hu>
26737
26738         * reflection.c: Emit FILE and EXPORTEDTYPE tables.
26739         
26740 2003-11-10  Martin Baulig  <martin@ximian.com>
26741
26742         * metadata.c
26743         (mono_metadata_load_generic_params): Make this actually work.
26744
26745         * reflection.c (mono_reflection_bind_generic_parameters): If our
26746         parent is a generic instance, pass all the `types' to it, no
26747         matter whether it has the same number of type parameters or not.
26748
26749 2003-11-10  Zoltan Varga  <vargaz@freemail.hu>
26750
26751         * reflection.c: Emit FILE and EXPORTEDTYPE tables.
26752
26753         * assembly.c (mono_assembly_load_references): Move the image<->assembly
26754         assignment code to this function so it gets called recursively for all
26755         modules.
26756
26757         * image.c (load_modules): Remove the assembly assignment since it is
26758         now done by mono_assembly_load_references.
26759         
26760         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
26761         Add 'module' argument.
26762         (mono_module_get_types): New helper function.
26763         (ves_icall_System_Reflection_Module_InternalGetTypes): New icall.
26764
26765 2003-11-08  Martin Baulig  <martin@ximian.com>
26766
26767         * class.c (mono_class_inflate_generic_method): Interface method
26768         don't have a header.
26769
26770         * reflection.c (mono_image_get_methodspec_token): Take an
26771         additional `MonoGenericInst *' argument instead of reading it from
26772         the header; this is necessary to support interfaces.
26773         (mono_image_create_token): Pass the `MonoGenericInst *' from the
26774         MonoReflectionInflatedMethod to mono_image_get_methodspec_token().
26775         (inflated_method_get_object): Take an additional `MonoGenericInst *'
26776         argument.
26777
26778         * reflection.h (MonoReflectionInflatedMethod): Added
26779         `MonoGenericInst *ginst'.
26780
26781 2003-11-07  Zoltan Varga  <vargaz@freemail.hu>
26782
26783         * gc.c (mono_domain_finalize): Fix compilation for no GC case.
26784
26785 2003-11-06  Zoltan Varga  <zovarga@ws-zovarga2>
26786
26787         * appdomain.c (mono_domain_unload): Add a workaround for bug #27663.
26788
26789 2003-11-06  Zoltan Varga  <vargaz@freemail.hu>
26790
26791         * reflection.c 
26792         (reflection_methodbuilder_from_method_builder):
26793         (reflection_methodbuilder_from_ctor_builder): New helper functions to 
26794         initialize a ReflectionMethodBuilder structure.
26795         (mono_image_get_methodbuilder_token):
26796         (mono_image_get_ctorbuilder_token): New functions to emit memberref
26797         tokens which point to types in another module inside the same assembly.
26798
26799         * reflection.c: Use the new helper functions.
26800         
26801         * reflection.c (mono_image_basic_init): Initialize basedir and culture.
26802
26803         * icall.c loader.c reflection.c: Use ModuleBuilder->dynamic_image 
26804         instead of AssemblyBuilder->dynamic_assembly in the appropriate places.
26805
26806         * reflection.c (resolution_scope_from_image): Emit a moduleref if
26807         neccesary.
26808
26809         * reflection.c (mono_image_build_metadata): Emit metadata only for the
26810         current module. Emit the manifest only for the main module.
26811
26812         * reflection.c (mono_image_create_token): Add assertion when a 
26813         memberref needs to be created.
26814
26815         * reflection.c reflection.h (MonoDynamicAssembly): Remove unused fields.
26816
26817         * reflection.c (mono_reflection_get_custom_attrs_blob): Allocate a 
26818         larger buffer for the custom attribute blob. Fixes #50637.
26819         
26820 2003-11-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26821
26822         * threadpool.c: notify listener on async processing handles after
26823         invoking the async callback. Thanks to Zoltan.
26824
26825 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
26826
26827         * reflection.c (create_dynamic_mono_image): Call mono_image_init to 
26828         avoid code duplication.
26829
26830         * reflection.h (MonoDynamicImage): New type which is currently unused,
26831         but will be used through the ref.emit code in place of 
26832         MonoDynamicAssembly.
26833
26834         * reflection.h (MonoReflectionAssemblyBuilder): Track changes to the
26835         object layout.
26836
26837         * reflection.c (create_dynamic_mono_image): Rewrote so it now creates
26838         a MonoDynamicImage instead of just a MonoImage.
26839         
26840         * reflection.h reflection.c icall.c: Move nearly all AssemblyBuilder
26841         icalls to ModuleBuilder but keep their semantics, so they will work
26842         with moduleb->assemblyb. This will change later.
26843         
26844 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
26845
26846         * reflection.h (MonoReflectionAssemblyBuilder): Track changes to the
26847         object layout.
26848
26849         * reflection.c (mono_image_build_metadata): Avoid creation of a default
26850         main module, since it is now done by the managed code.
26851
26852 2003-11-03  Martin Baulig  <martin@ximian.com>
26853
26854         * reflection.c (mono_reflection_inflate_method_or_ctor): Set
26855         `ginst->klass' here.
26856         (method_encode_methodspec): Don't use the `ginst->generic_method's
26857         klass if it's a generic instance, use `ginst->klass' in this case.
26858
26859 2003-11-03  Martin Baulig  <martin@ximian.com>
26860
26861         * reflection.c (mono_image_get_generic_method_param_info):
26862         Removed, use mono_image_get_generic_param_info() instead.
26863         (mono_image_get_type_info): Write the GenericParam table before
26864         the Method table.  This is neccessary because in the GenericParam
26865         table, type parameters of the class (ie. '!0' etc.) must come
26866         before the ones from its generic methods (ie. '!!0' etc).
26867
26868 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
26869
26870         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Fill out AssemblyName->codebase. Fixes #50469.
26871
26872 2003-11-02  Martin Baulig  <martin@ximian.com>
26873
26874         * reflection.c (create_generic_typespec): Take a
26875         `MonoReflectionTypeBuilder *' instead of a `MonoType *' and get
26876         the generic parameters from it.
26877
26878 2003-11-02  Martin Baulig  <martin@ximian.com>
26879
26880         * reflection.c (fieldref_encode_signature): Take a `MonoType *'
26881         instead of a `MonoClassField *' since we just need the type.
26882         (create_generic_typespec): New static function.  Creates a
26883         TypeSpec token for a generic type declaration.
26884         (mono_image_get_generic_field_token): New static function.
26885         (mono_image_create_token): If we're a FieldBuilder in a generic
26886         type declaration, call mono_image_get_generic_field_token() to get
26887         the token.
26888
26889 2003-11-02  Martin Baulig  <martin@ximian.com>
26890
26891         * reflection.h
26892         (MonoReflectionInflatedMethod, MonoReflectionInflatedField): Added
26893         `MonoReflectionGenericInst *declaring_type' and
26894         `MonoReflectionGenericInst *reflected_type' fields.
26895
26896         * reflection.c (mono_reflection_inflate_method_or_ctor): Take a
26897         `MonoReflectionGenericInst *declaring_type' and a
26898         `MonoReflectionGenericInst *reflected_type' argument instead of a
26899         single `MonoReflectionGenericInst *type' one.  Set
26900         `res->declaring_type' and `res->reflected_type' from them.
26901         (mono_reflection_inflate_field): Likewise.      
26902
26903 2003-11-02  Martin Baulig  <martin@ximian.com>
26904
26905         * class.c (mono_class_setup_vtable): Don't store generic methods
26906         in the vtable.  
26907
26908 2003-11-02  Martin Baulig  <martin@ximian.com>
26909
26910         * reflection.h (MonoReflectionGenericInst): Added
26911         `MonoReflectionType *declaring_type'.
26912
26913         * reflection.c (mono_reflection_bind_generic_parameters): Use
26914         `if (tb->parent)' instead of `klass->parent'.
26915
26916 2003-11-01  Zoltan Varga  <vargaz@freemail.hu>
26917
26918         * assembly.c (mono_assembly_open): Avoid crash if a module is loaded
26919         with an empty ASSEMBLY table.
26920
26921         * reflection.c (mono_image_build_metadata): Avoid using the same loop
26922         variable in the inner and outer loops.
26923
26924 2003-10-31  Zoltan Varga  <vargaz@freemail.hu>
26925
26926         * metadata.h (mono_metadata_make_token): Put parentheses around macro
26927         argument.
26928
26929         * appdomain.h appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRef): Fix signature.
26930         
26931         * appdomain.c appdomain.h icall.c: Get rid of the InvokeInDomain 
26932         icalls. Instead, do everything in managed code. This is needed since
26933         it is hard to restore the original domain etc. in unmanaged code in the
26934         presence of undeniable exceptions.
26935
26936         * appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRef): 
26937         New icalls to push and pop appdomain refs.
26938
26939 2003-10-31  Martin Baulig  <martin@ximian.com>
26940
26941         * class.c (inflate_generic_type): Renamed to
26942         mono_class_inflate_generic_type() and made it public.
26943
26944         * icall.c ("System.Reflection.MonoGenericInst::inflate_field"):
26945         New interncall.
26946
26947         * loader.c (mono_field_from_memberref): Also set the retklass for
26948         typespecs.
26949
26950         * fielder.c (mono_image_get_inflated_field_token): New static
26951         method; creates a metadata token for an inflated field.
26952         (mono_image_create_token, fixup_method): Added support for
26953         "MonoInflatedField".
26954         (fieldbuilder_to_mono_class_field): New static function.
26955         (mono_reflection_inflate_field): New public function.
26956
26957         * reflection.h
26958         (MonoReflectionGenericInst): Added `MonoArray *fields'.
26959         (MonoReflectionInflatedField): New typedef.     
26960
26961 2003-10-30  Bernie Solomon  <bernard@ugsolutions.com>
26962
26963         * socket-io.c (in6_addr ipaddress_to_struct_in6_addr): fix
26964         for Solaris and other platforms without s6_addr16
26965
26966 2003-10-30  Martin Baulig  <martin@ximian.com>
26967
26968         * class.c (inflate_generic_type): Take just one `MonoGenericInst *'
26969         argument instead of two.
26970         (mono_class_inflate_generic_signature): Likewise.
26971         (inflate_generic_header): Likewise.
26972         (mono_class_inflate_generic_method): Likewise.  In addition, if
26973         `ginst->klass' is set, it becomes the new `method->klass'.
26974
26975         * class.h (MonoGenericInst): Removed the `gpointer mbuilder'
26976         field.
26977
26978         * reflection.c (encode_generic_method_sig): Write a 0xa as the
26979         first byte. [FIXME]
26980         (method_encode_methodspec): If we have generic parameters, create
26981         a MethodSpec instead of a MethodRef.
26982         (fixup_method): Added support for "MonoInflatedMethod" and
26983         "MonoInflatedCtor".
26984         (mono_image_create_token): Added support for "MonoInflatedMethod"
26985         and "MonoInflatedCtor".
26986         (inflated_method_get_object): New static function; returns a
26987         managed "System.Reflection.MonoInflatedMethod" object.
26988         (mono_reflection_bind_generic_method_parameters): Return a
26989         `MonoReflectionInflatedMethod' instead of a `MonoReflectionMethod'.
26990         (mono_reflection_inflate_method_or_ctor): Likewise.
26991         (mono_image_get_generic_method_param_info): Initialize unused
26992         fields to zero.
26993         (mono_image_get_generic_param_info): Likewise.
26994
26995         * reflection.h (MonoReflectionInflatedMethod): New public
26996         typedef.  Corresponds to the managed "S.R.MonoInflatedMethod" and
26997         "S.R.MonoInflatedCtor" classes.
26998
26999         * loader.c (method_from_memberref): If we're a TypeSpec and it
27000         resolves to a generic instance, inflate the method.
27001
27002 2003-10-28  Dick Porter  <dick@ximian.com>
27003
27004         * object.c (mono_runtime_run_main): Convert command-line arguments
27005         into utf8, falling back to the user's locale encoding to do so.
27006
27007 2003-10-27  Zoltan Varga  <vargaz@freemail.hu>
27008
27009         * loader.c (mono_get_method_from_token): Avoid looking up the icalls
27010         at this time.
27011
27012         * marshal.c (mono_marshal_get_native_wrapper): Lookup icalls here.
27013
27014         * reflection.c (reflection_methodbuilder_to_mono_method): Avoid looking
27015         up icalls at method definition time. Partially fixes #33569.
27016
27017 2003-10-25  Zoltan Varga  <vargaz@freemail.hu>
27018
27019         * marshal.c (mono_marshal_get_native_wrapper): Add support for [Out]
27020         marshalling of arrays. Fixes #50116.
27021
27022         * appdomain.c (ves_icall_System_AppDomain_InternalIsFinalizingForUnload): New icall.
27023
27024         * appdomain.c (unload_thread_main): Clear class->cached_vtable if it
27025         points to a vtable in the dying appdomain.
27026
27027         * appdomain.c (mono_domain_unload): Move the notification of OnUnload
27028         listeners into unmanaged code inside the lock.
27029
27030         * object.c (mono_class_vtable): Turn off typed allocation in non-root
27031         domains and add some comments.
27032
27033 2003-10-25  Martin Baulig  <martin@ximian.com>
27034
27035         * class.h (MonoGenericInst): Added `MonoClass *klass' field.
27036
27037         * image.h (MonoImage): Added `GHashTable *typespec_cache'.
27038
27039         * metadata.c (mono_metadata_parse_generic_inst): Renamed to
27040         `do_mono_metadata_parse_generic_inst'; pass it the MonoType we're
27041         currently parsing.  Create the generic class and store it in
27042         `generic_inst->klass' before parsing the type arguments.  This is
27043         required to support "recursive" definitions; see mcs/tests/gen-23.cs
27044         for an example.
27045         (mono_type_create_from_typespec): Use a new `image->typespec_cache'
27046         to support recursive typespec entries.
27047
27048         * class.c (mono_class_setup_parent): If our parent is a generic
27049         instance, we may get called before it has its name set.
27050         (mono_class_from_generic): Splitted into
27051         mono_class_create_from_generic() and mono_class_initialize_generic().
27052
27053 2003-10-25  Martin Baulig  <martin@ximian.com>
27054
27055         * icall.c (ves_icall_Type_BindGenericParameters): Return a
27056         `MonoReflectionGenericInst *' instead of a `MonoReflectionType *'.
27057         ("System.Reflection.MonoGenericInst::inflate_method"): New interncall.
27058         ("System.Reflection.MonoGenericInst::inflate_ctor"): New interncall.
27059
27060         * reflection.c (my_mono_class_from_mono_type): Added MONO_TYPE_GENERICINST.
27061         (create_typespec): Likewise.
27062         (mono_reflection_bind_generic_parameters): Return a
27063         `MonoReflectionGenericInst *' instead of a `MonoClass *'.
27064         (mono_reflection_inflate_method_or_ctor): New public function.
27065
27066         * reflection.h (MonoReflectionGenericInst): New typedef.        
27067
27068 2003-10-24  Zoltan Varga  <vargaz@freemail.hu>
27069
27070         * object.c (mono_class_proxy_vtable): Run the whole vtable construction
27071         inside the domain lock. Fixes #49993.
27072         
27073         * object.c (mono_class_vtable): When typed allocation is used, 
27074         allocate vtables in the GC heap instead of in the mempool, since the
27075         vtables contain GC descriptors which are used by the collector even
27076         after the domain owning the mempool is unloaded.
27077
27078         * domain.c (mono_domain_set): Rename to mono_domain_set_internal.
27079
27080         * domain.c (mono_domain_unload): Rename to mono_domain_free to better
27081         reflect what it does. Also invalidate mempools instead of freeing
27082         them if a define is set.
27083
27084         * appdomain.h (MonoAppDomainState): New enumeration to hold the state
27085         of the appdomain.
27086         
27087         * appdomain.h (_MonoDomain): New field 'finalizable_object_hash' to
27088         hold the finalizable objects in this domain.
27089
27090         * appdomain.h (_MonoDomain): New field 'state' to hold the state of the
27091         appdomain.
27092
27093         * appdomain.c (mono_domain_set): New function to set the current
27094         appdomain, but only if it is not being unloaded.
27095
27096         * appdomain.c threads.c threadpool.c object.c: Avoid entering an
27097         appdomain which is being unloaded.
27098         
27099         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Prevent
27100         unloading of the root appdomain.
27101
27102         * appdomain.c (ves_icall_System_AppDomain_InternalInvokeInDomain): New
27103         icall to execute a method in another appdomain. Intended as a 
27104         replacement for InternalSetDomain, which can confuse the code 
27105         generation in the JIT.
27106
27107         * appdomain.c (mono_domain_is_unloading): New function to determine
27108         whenever an appdomain is unloading.
27109
27110         * appdomain.c (mono_domain_unload): New function to correctly unload
27111         an appdomain.
27112
27113         * assembly.c (mono_assembly_load_references): Check that an assembly
27114         does not references itself.
27115
27116         * gc.c (mono_domain_finalize): Rewrote so instead of finalizing a
27117         domain manually, it asks the finalizer thread to do it, then waits for
27118         the result. Also added a timeout.
27119
27120         * icall.c: Register the new icalls.
27121
27122         * threads.h threads.c: Export the mono_gc_stop_world and 
27123         mono_gc_start_world functions.
27124         
27125         * mempool.h mempool.c (mono_mempool_invalidate): New debugging 
27126         function to fill out the mempool with 0x2a.
27127
27128 2003-10-22  Zoltan Varga  <vargaz@freemail.hu>
27129
27130         * reflection.h (MonoReflectionMethodAux): New structure to store
27131         information which is rarely used, thus is not in the MonoMethod
27132         structure.
27133
27134         * reflection.h (MonoDynamicAssembly): New field 'method_aux_hash' to
27135         store the aux info.
27136
27137         * reflection.c (mono_methodbuilder_to_mono_method): Store param names
27138         and marshalling info into the aux structure.
27139
27140         * loader.c (mono_method_get_marshal_info): Retrieve the marshal info
27141         from the aux structure.
27142
27143         * loader.c (mono_method_get_param_names): Retrieve the param names from
27144         the aux structure.
27145         
27146 2003-10-21  Zoltan Varga  <vargaz@freemail.hu>
27147
27148         * exception.h exception.c: Add AppDomainUnloadedException && fix 
27149         warning.
27150
27151 2003-10-21  Dick Porter  <dick@ximian.com>
27152
27153         * socket-io.c
27154         (ves_icall_System_Net_Sockets_Socket_Select_internal): Applied
27155         patch from Laramie Leavitt moving divide out of loop. (Bug 45381).
27156
27157 2003-10-21  Martin Baulig  <martin@ximian.com>
27158
27159         * reflection.c (mono_reflection_bind_generic_parameters):
27160         `klass->parent' is NULL for interfaces.
27161
27162 2003-10-21  Martin Baulig  <martin@ximian.com>
27163
27164         * reflection.c (create_typespec): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
27165
27166 2003-10-20  Zoltan Varga  <vargaz@freemail.hu>
27167
27168         * exception.c (mono_exception_from_name_msg): New helper function for
27169         creating exceptions and initializing their message field.
27170
27171         * exception.c: Simplify functions using the new helper.
27172
27173         * exception.h exception.c (mono_get_exception_cannot_unload_appdomain):
27174         New function.
27175
27176         * object.h object.c: Remove G_GNUC_NORETURN from the signature of
27177         mono_raise_exception, since otherwise gcc doesn't generate the function
27178         epilog for raise_exception, confusing the stack unwinding in the JIT.
27179         Fixes #45043.
27180
27181         * rawbuffer.c (mono_raw_buffer_load_mmap): Map mmap-ed memory with
27182         PROT_EXEC. This seems to prevent segmentation faults on Fedora Linux.
27183         Fixes #49499.
27184
27185 2003-10-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27186
27187         * icall.c: OutputDebugStringW expects 16-bit unicode characters, not
27188         utf8.
27189
27190 2003-10-18  Lluis Sanchez Gual  <lluis@ximian.com>
27191
27192         * icall.c: Removed GetUninitializedObject method because
27193           AllocateUninitializedClassInstance does the same.
27194
27195 2003-10-18  Martin Baulig  <martin@ximian.com>
27196
27197         * class.c (inflate_generic_signature): Renamed to
27198         mono_class_inflate_generic_signature() and made it public.
27199         (my_mono_class_from_generic_parameter): New static function; if we
27200         don't already have the generic parameter's MonoClass, create a
27201         very simple one which is just used internally in the runtime and
27202         not passed back to managed code.
27203
27204         * class.h (MonoGenericInst): Added `gpointer mbuilder' field.
27205
27206         * metadata.h (MonoMethodSignature): Moved the
27207         `MonoGenericParam *gen_params' to the MonoMethodHeader.
27208         (MonoMethodHeader): Moved the `MonoGenericParam *gen_params' here.
27209
27210         * icall.c (ves_icall_MethodInfo_GetGenericArguments): Renamed to
27211         ves_icall_MonoMethod_GetGenericArguments(); this is now an
27212         interncall on the MonoMethod class, not on MethodInfo.
27213         (ves_icall_MethodInfo_BindGenericParameters): Removed, we're now
27214         calling mono_reflection_bind_generic_method_parameters() directly.
27215
27216         * loader.c (mono_method_get_signature): If this is a MethodSpec;
27217         return the already computed `method->signature'.
27218         (method_from_methodspec): New static function to load a method
27219         from a MethodSpec entry.
27220         (mono_get_method_from_token): Call the new method_from_methodspec()
27221         for MethodSpec tokens.  
27222         (mono_get_method_from_token): If we're a generic method, load the
27223         type parameters.
27224
27225         * reflection.c (mono_image_get_memberref_token): Allow
27226         MEMBERREF_PARENT_TYPEDEF here; this will be used in the MethodSpec
27227         table.
27228         (fixup_method): Added support for MONO_TABLE_METHODSPEC.
27229         (mono_image_create_token): First check whether it's a generic
27230         method (so we'd need to create a MethodSpec), then do the other
27231         two alternatives.
27232         (mono_reflection_bind_generic_method_parameters): Return a
27233         `MonoReflectionMethod *' instead of a `MonoMethod *'; we're now
27234         called directly from the interncall.
27235
27236 2003-10-17  Zoltan Varga  <vargaz@freemail.hu>
27237
27238         * reflection.c (load_public_key): Move loading of the public key
27239         into managed code.
27240
27241         * image.h (MonoAssemblyName): Add public_key and hash_alg fields.
27242
27243         * assembly.c (mono_assembly_open): Fill in public_key and hash_alg
27244         fields.
27245
27246         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Fill in
27247         culture, hash_alg and public_key. Fixes #49555.
27248
27249 2003-10-17  Martin Baulig  <martin@ximian.com>
27250
27251         * class.h (MonoGenericInst): Moved this declaration here and added
27252         `MonoMethod *generic_method'.
27253
27254         * icall.c
27255         (ves_icall_MethodInfo_GetGenericArguments): New interncall.
27256         (ves_icall_MethodInfo_BindGenericParameters): New interncall.
27257
27258         * metadata.c (mono_metadata_type_equal): Two types of
27259         MONO_TYPE_VAR or MONO_TYPE_MVAR equals if they have the same
27260         index; ie. don't compare the address of the `MonoGenericParam'
27261         structure.
27262         (mono_metadata_load_generic_params): Removed the `MonoMethod
27263         *method' argument.
27264
27265         * metadata.h (MonoGenericInst): Moved declaration to class.h.
27266         (MonoMethodHeader): Added `MonoGenericInst *geninst'.
27267
27268         * reflection.c (method_encode_signature): Encode the number of
27269         generic parameters.
27270         (encode_generic_method_sig): New static function.
27271         (method_encode_methodspec): New static function; creates an entry
27272         in the MethodSpec table for a generic method.
27273         (mono_image_get_methodspec_token): New static function.
27274         (mono_image_create_token): Call mono_image_get_methodspec_token()
27275         for generic methods.
27276         (mono_reflection_bind_generic_method_parameters): New public
27277         function.  Instantiates a generic method.
27278
27279 2003-10-16  Martin Baulig  <martin@ximian.com>
27280
27281         * metadata.h (MonoMethodSignature): Moved `MonoGenericParam
27282         *gen_params' here from MonoMethodHeader.
27283
27284         * metadata.c (mono_metadata_parse_method_signature): If we have
27285         generic parameters, initialize `method->gen_params' and then set
27286         the correct `type->data.generic_param' in all the parameters.
27287
27288 2003-10-16  Zoltan Varga  <vargaz@freemail.hu>
27289
27290         * threads.c (mono_threads_get_default_stacksize): New function to 
27291         return the default stacksize.
27292
27293         * gc.c (mono_gc_cleanup): Use a separate event for waiting for the
27294         termination of the finalizer thread, since the previous method had
27295         race conditions. Fixes #49628.
27296
27297         * gc.c (mono_gc_init): Use the same stacksize for the finalizer thread
27298         as for the other managed threads.
27299
27300 2003-10-16  Martin Baulig  <martin@ximian.com>
27301
27302         * class.c (inflate_generic_signature): Copy `generic_param_count'
27303         and `gen_params'.
27304
27305         * icall.c (ves_icall_MethodInfo_get_IsGenericMethodDefinition):
27306         New interncall.
27307
27308         * metadata.c (mono_metadata_parse_method_signature): Actually set
27309         the `method->generic_param_count' here.
27310         (mono_metadata_load_generic_params): Initialize `pklass' to NULL.
27311
27312 2003-10-15  Zoltan Varga  <vargaz@freemail.hu>
27313
27314         * object.h: Add a new field to TypedRef to simplify the implementation
27315         of the REFANY opcodes in the JIT.
27316
27317         * icall.c: Make use of the new field.
27318
27319         * metadata.c (mono_type_size): Compute the size of TYPEDBYREF types
27320         dynamically.
27321
27322 2003-10-15  Martin Baulig  <martin@ximian.com>
27323
27324         * class.c (mono_class_from_gen_param): Renamed to
27325         mono_class_from_generic_parameter() and moved most of the
27326         functionality from mono_reflection_define_generic_parameter()
27327         here; ie. we create a "real" class here.
27328         (mono_class_from_mono_type): Only allow MONO_TYPE_VAR and
27329         MONO_TYPE_MVAR if mono_class_from_generic_parameter() has
27330         previously been called.
27331
27332         * class.h (MonoGenericParam): Moved the declaration of this struct
27333         here from metadata.h and added `MonoMethod *method'.
27334
27335         * icall.c (ves_icall_MonoType_get_DeclaringMethod): New
27336         interncall.
27337
27338         * loader.c (mono_get_method_from_token): If we have any generic
27339         parameters, call mono_metadata_load_generic_params() to read them
27340         from the MONO_TABLE_GENERICPAR.
27341
27342         * metadata.c (mono_metadata_load_generic_params): Added
27343         `MonoMethod *method' argument which is used MONO_TYPE_MVAR.
27344
27345         * metadata.h (MonoMethodSignature): Replaced
27346         `MonoGenericInst *geninst' with `guint16 generic_param_count'.
27347         (MonoMethodHeader): Added `MonoGenericParam *gen_params'.
27348
27349         * reflection.c (mono_reflection_define_generic_parameter): Moved
27350         most of the functionality into the new
27351         mono_class_from_generic_parameter(); set the `method' field if
27352         we're a method parameter.       
27353
27354 2003-10-13 Bernie Solomon  <bernard@ugsolutions.com>
27355
27356         * marshal.c (emit_struct_conv): if native size is 0
27357         emit no code.
27358
27359 2003-10-14  Martin Baulig  <martin@ximian.com>
27360
27361         * icall.c: The generics API has changed in the spec since it was
27362         added to System.Type; these modifications make it match the spec
27363         again.
27364         (ves_icall_Type_GetGenericParameters): Renamed to
27365         `ves_icall_Type_GetGenericArguments'.
27366         (ves_icall_Type_get_IsGenericTypeDefinition): New interncall.
27367         (ves_icall_MonoType_get_HasGenericParameteres): Renamed to
27368         `ves_icall_MonoType_get_HasGenericArguments'.
27369         (ves_icall_MonoType_get_IsUnboundGenericParameter): Renamed to
27370         `ves_icall_MonoType_get_IsGenericParameter'.
27371         (ves_icall_MonoType_get_HasUnboundGenericParameters): Removed;
27372         this is no interncall anymore.
27373         (ves_icall_TypeBuilder_get_IsUnboundGenericParameter): Renamed to
27374         `ves_icall_TypeBuilder_get_IsGenericParameter'.
27375
27376 2003-10-14  Martin Baulig  <martin@ximian.com>
27377
27378         * reflection.c (mono_reflection_bind_generic_parameters): Also
27379         inflate generic methods if we're reading the class from IL.
27380
27381 2003-10-13  Martin Baulig  <martin@ximian.com>
27382
27383         * reflection.c (mono_reflection_define_generic_parameter): This
27384         method isn't called directly from the icall anymore; take a
27385         `MonoReflectionAssemblyBuilder *' so we can use this for type and
27386         method generic parameters.
27387         (ReflectionMethodBuilder): Added `MonoArray *generic_param'.
27388         (method_builder_encode_signature): Encode generic parameters.
27389         (mono_image_get_method_info): Write generic params to the
27390         MONO_TABLE_GENERICPARAM table.
27391
27392         * reflection.h (MonoReflectionMethodBuilder): Added
27393         `MonoArray *generic_params'.
27394
27395         * metadata.h (MonoMethodSignature): Added `MonoGenericInst *geninst'.
27396
27397         * icall.c (ves_icall_TypeBuilder_define_generic_parameter): Added
27398         wrapper for mono_reflection_define_generic_parameter().
27399         (ves_icall_MethodBuilder_define_generic_parameter): Likewise.   
27400
27401 2003-10-13  Zoltan Varga  <vargaz@freemail.hu>
27402
27403         * marshal.h: Add missing function to fix build.
27404
27405         * marshal.c (mono_marshal_get_native_wrapper): Add support for 
27406         the SetLastError pinvoke attribute.
27407
27408         * marshal.c (mono_marshal_set_last_error): New helper function called
27409         by the generated code.
27410         
27411         * marshal.c (mono_mb_emit_branch): New helper function.
27412
27413         * marshal.c (mono_mb_emit_exception): Added exception name parameter.
27414
27415         * marshal.c (mono_marshal_get_managed_wrapper): Added support for
27416         classes as parameters and return values of delegates. Fixes #29256. 
27417
27418 2003-10-12  Bernie Solomon  <bernard@ugsolutions.com>
27419
27420         * locales.c: use gint32 in non HAVE_ICU case
27421
27422 2003-10-11  Martin Baulig  <martin@ximian.com>
27423
27424         * mono-debug.c (mono_debug_add_method): Added a workaround for
27425         bug #48591.
27426
27427 2003-10-10  Zoltan Varga  <vargaz@freemail.hu>
27428
27429         * marshal.c (mono_marshal_get_managed_wrapper): Under windows,
27430         delegates passed to native code must use the STDCALL calling 
27431         convention. Fixes #35987.
27432
27433 2003-10-10  Martin Baulig  <martin@ximian.com>
27434
27435         * class.c (inflate_generic_type): If we're inflating for a generic
27436         type instance (and not for a generic method), return
27437         MONO_TYPE_MVAR unchanged.
27438
27439 2003-10-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27440
27441         * string-icalls.c: Join ignores null strings in the source array.
27442         * threadpool.[ch]: export busy_worker_threads, not mono_worker_threads.
27443         * threads.c: GetAvailableTheads is slightly more accurate.
27444
27445 2003-10-09  Bernie Solomon  <bernard@ugsolutions.com>
27446
27447         * threads.h threads.c : add mono_threads_set_default_stacksize
27448         and pass default to CreateThread calls.
27449
27450 2003-10-09  Dick Porter  <dick@ximian.com>
27451
27452         * icall.c:
27453         * locales.h:
27454         * locales.c: Internal calls for constructing CultureInfo and
27455         related objects from libicu (if its available.)
27456
27457 2003-10-09  Zoltan Varga  <vargaz@freemail.hu>
27458
27459         * debug-helpers.c (wrapper_type_names): Add 'unknown' wrapper type.
27460
27461 2003-10-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27462
27463         * threadpool.c: added an argument to async_invoke_thread that is the
27464         item to process, pass the MonoAsyncResult to the thread start function
27465         when creating a new thread. This way we don't need to acquire any lock
27466         when we're creating a new thread. Readded a semaphore for faster
27467         response times (instead of that Sleep i added).
27468
27469 2003-10-08  Bernie Solomon  <bernard@ugsolutions.com>
27470
27471         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData):
27472         get daylight change dates better on Windows, fix handling
27473         of platforms without tm_gmtoff.
27474
27475 2003-10-06  Martin Baulig  <martin@ximian.com>
27476
27477         * class.c (inflate_generic_method): Renamed to
27478         mono_class_inflate_generic_method() and made public.
27479         (mono_class_init): Don't inflate the generic methods here.
27480         (mono_class_from_generic): Added `gboolean inflate_methods'
27481         argument.  Inflate the methods here.
27482
27483         * loader.c (mono_method_get_param_names): Ignore instances of
27484         generic types for the moment.
27485
27486         * reflection.c (fixup_method): Added support for inflated methods.
27487         (mono_image_create_token): Use mono_image_get_methodref_token()
27488         for inflated methods.
27489         (mono_custom_attrs_from_param): Ignore instances of generic types
27490         for the moment.
27491         (mono_reflection_bind_generic_parameters): New public function.
27492         Moved all the functionality from
27493         ves_icall_Type_BindGenericParameters() here and added support for
27494         dynamic types.
27495         (mono_reflection_define_generic_parameter): Initialize
27496         `klass->methods' here.
27497
27498         * icall.c (ves_icall_Type_BindGenericParameters): Moved all the
27499         functionality into mono_reflection_define_generic_parameter().
27500         (ves_icall_Type_GetGenericTypeDefinition): If we're coming from a
27501         TypeBuilder, return that TypeBuilder.
27502
27503 2003-10-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27504
27505         * appdomain.c: removed mono_delegate_semaphore.
27506
27507         * threadpool.c:
27508         (mono_thread_pool_add): moved hash table creation inside and the thread 
27509         creation outside of the critical region.
27510         (mono_thread_pool_finish): removed obsolete code.
27511         (async_invoke_thread): don't use the semaphore. Use a plain Sleep and
27512         continue or exit the thread depending on the queue.
27513
27514 2003-10-07  Bernie Solomon  <bernard@ugsolutions.com>
27515
27516         * metadata.c (mono_type_to_unmanaged): allow bools to marshal as I1
27517         marshal.c (emit_ptr_to_str_conv & mono_marshal_get_native_wrapper):
27518         handle more bool marshalling options
27519
27520 2003-10-07  Zoltan Varga  <vargaz@freemail.hu>
27521
27522         * marshal.c (mono_marshal_get_native_wrapper): Fix marshalling of
27523         arrays of structs. Also add a more descriptive error message when
27524         a structure member is marshalled as LPArray.
27525
27526 2003-10-06  Zoltan Varga  <vargaz@freemail.hu>
27527
27528         * marshal.c (mono_marshal_get_native_wrapper): Add support for
27529         marshalling arrays of complex types. Fixes #29098. Also remove an
27530         usused and incomplete function.
27531
27532 Mon Oct 6 15:38:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
27533
27534         * gc.c: report heap_size - free_bytes as total memory allocated
27535         (bug#49362).
27536
27537 2003-10-05  Zoltan Varga  <vargaz@freemail.hu>
27538
27539         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Finally 
27540         fix timezone handling problems on Windows.
27541         
27542         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Avoid
27543         asserts when the year is outside the range handled by ms the functions.
27544
27545         * class.c (setup_interface_offsets): If the class is an interface,
27546         fill out its interface_offsets slot.
27547
27548 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27549
27550         * threadpool.c: mark threadpool threads as background.
27551
27552 2003-10-03  Bernie Solomon  <bernard@ugsolutions.com>
27553
27554         * decimal.c - define DECINLINE to nothing if not using GCC
27555
27556 2003-10-03  Zoltan Varga  <vargaz@freemail.hu>
27557
27558         * assembly.c: More refcount fixes.
27559
27560 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27561
27562         * string-icalls.c: if we're not trimming, return the same string.
27563         When not splitting, don't create a new string.
27564
27565 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27566
27567         * image.c:
27568         (mono_image_open): increment the ref_count inside the critical section.
27569
27570 2003-10-02  Zoltan Varga  <vargaz@freemail.hu>
27571
27572         * image.c (mono_image_open): Fix reference counting bug.
27573
27574 2003-09-30  Bernie Solomon  <bernard@ugsolutions.com>
27575
27576         * marshal.c (mono_marshal_type_size) struct alignment changed for 
27577         64bit machines.  (emit_ptr_to_str_conv) Fix bool conversions for 
27578         64bits. Avoid leak in mono_marshal_get_native_wrapper when
27579         mono_lookup_pinvoke_call throws.        
27580
27581 2003-09-30  Zoltan Varga  <vargaz@freemail.hu>
27582
27583         * reflection.c (mono_reflection_parse_type): Fix #49114.
27584
27585         * file-io.c (ves_icall_System_IO_MonoIO_GetFileAttributes): Add
27586         temporary workaround for cygwin header problem.
27587
27588         * object.c (mono_object_isinst): Synchronize this with the code
27589         generated by the JIT for casts.
27590
27591 2003-09-29  Zoltan Varga  <vargaz@freemail.hu>
27592
27593         * reflection.c (encode_type): Fix #38332.
27594
27595 2003-09-26  Zoltan Varga  <vargaz@freemail.hu>
27596
27597         * marshal.c (mono_marshal_method_from_wrapper): New function to return
27598         the original method from the wrapper method.
27599
27600 2003-09-25  Martin Baulig  <martin@ximian.com>
27601
27602         * icall.c (ves_icall_Type_IsGenericTypeDefinition): Removed this
27603         interncall since it was identical to `Type.GetGenericTypeDefinition()'.
27604         (ves_icall_Type_get_IsGenericInstance): New interncall.
27605
27606 2003-09-24 Bernie Solomon <bernard@ugsolutions.com>
27607
27608         * object.c: fix cast warning in big endian code.
27609
27610 2003-09-19 Jackson Harper <jackson@latitudegeo.com>
27611
27612         * icall.c: Timezone patch from Zoltan Varga (vargaz@freemail.hu)
27613         
27614 2003-09-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27615
27616         * assembly.c: don't call check_env from mono_assembly_load. It's
27617         already done once in mono_assemblies_init and may cause headaches when
27618         multiple threads are loading assemblies.
27619
27620 2003-09-19  Martin Baulig  <martin@ximian.com>
27621
27622         * reflection.c (mono_reflection_define_generic_parameter): Don't
27623         allocate `klass->methods', set `klass->flags' to
27624         TYPE_ATTRIBUTE_INTERFACE, not TYPE_ATTRIBUTE_ABSTRACT.
27625
27626 2003-09-18  Martin Baulig  <martin@ximian.com>
27627
27628         * class.c (mono_class_init): Don't create `class->methods' if it's
27629         already initialized.
27630
27631         * metadata.c (mono_metadata_load_generic_params): Make this
27632         actually work.
27633
27634         * reflection.c (mono_reflection_define_generic_parameter): Set
27635         parent class and interfaces from the constraints.
27636
27637         * reflection.h (MonoReflectionGenericParam): Added `guint32 flags'
27638         to keep this struct in sync with the declaration in TypeBuilder.cs.
27639
27640 2003-09-17  Martin Baulig  <martin@ximian.com>
27641
27642         * metadata.h (MonoType): Replaced the data's `int type_param'
27643         field with `MonoGenericParam *generic_param'.
27644         (MonoGenericParam): Added `MonoClass *klass'.
27645
27646         * class.c (mono_class_from_gen_param): Removed the
27647         `MonoImage *image' and `int type_num' arguments.
27648
27649         * metadata.c (mono_metadata_parse_generic_param): New static
27650         method; creates a MonoGenericParam which just contains the index.
27651         (do_mono_metadata_parse_type): Call
27652         mono_metadata_parse_generic_param() for MONO_TYPE_VAR and
27653         MONO_TYPE_MVAR.
27654
27655         * reflection.c (mono_image_typedef_or_ref): Generic type
27656         parameters may be in the same assembly, but never use a typedef
27657         for them.
27658         (mono_reflection_define_generic_parameter): We're now creating a
27659         "real" class for the type parameter; it's now safe to call
27660         mono_class_from_mono_type() on the class'es type, it'll do the
27661         right thing.
27662
27663 2003-09-16  Martin Baulig  <martin@ximian.com>
27664
27665         * mono-debug-debugger.c (allocate_symbol_file_entry): Initialize
27666         `symfile->range_entry_size' and `symfile->class_entry_size' here;
27667         the `symfile' data structure must be fully initialized before it
27668         gets added to the table.
27669
27670 2003-09-15  Zoltan Varga  <vargaz@freemail.hu>
27671
27672         * icall.c (ves_icall_Type_IsArrayImpl): Added MONO_ARCH_SAVE_REGS.
27673
27674         * appdomain.h domain.c (MonoDomain): Added new hashtable to store the
27675         class init trampolines.
27676
27677 2003-09-11  Zoltan Varga  <vargaz@freemail.hu>
27678
27679         * profiler.c (mono_profiler_load): Added '-time' and '-alloc' options
27680         to the built-in profiler to turn off time and allocation profiling
27681         respectively.
27682
27683 2003-09-10  Zoltan Varga  <vargaz@freemail.hu>
27684
27685         * profiler.c (mono_profiler_coverage_alloc): Use NULL instead of
27686         g_direct_equal.
27687
27688         * debug-helpers.c (mono_method_full_name): Print the wrapper type
27689         in human readable form.
27690
27691 2003-09-08  Zoltan Varga  <vargaz@freemail.hu>
27692
27693         * reflection.c icall.c: Fixed warnings.
27694
27695         * image.c (load_class_names): Use a temporary hash table to hold the
27696         namespaces in order to avoid doing many string comparisons.
27697
27698         * image.h: Fix typo.
27699
27700         * image.c class.c rawbuffer.c reflection.c threads.c verify.c domain.c:
27701         Pass NULL instead of g_direct_equal to the GHashTable constructor 
27702         since the NULL case is short-circuited inside g_hash_table_lookup, 
27703         leading to better performance.  
27704
27705         * metadata.c (mono_metadata_custom_attrs_from_index): New function to
27706         obtain the first custom attribute for a given index. Depends on the
27707         CustomAttribute table being sorted by the parent field.
27708
27709         * reflection.c (mono_custom_attrs_from_index): Use the new function 
27710         for better performance.
27711
27712 2003-09-07  Martin Baulig  <martin@ximian.com>
27713
27714         * class.c (mono_class_init): If we're a generic instance, inflate
27715         all our methods instead of loading them from the image.
27716         (mono_class_from_generic): Set `class->methods = gklass->methods'.
27717
27718 2003-09-07  Martin Baulig  <martin@ximian.com>
27719
27720         * mono-debug-debugger.c: Added support for constructors.
27721
27722 2003-09-06  Martin Baulig  <martin@ximian.com>
27723
27724         * icall.c (ves_icall_TypeBuilder_get_IsUnboundGenericParameter):
27725         New interncall.
27726
27727         * reflection.c (mono_reflection_setup_generic_class): Call
27728         ensure_runtime_vtable() to create the vtable.
27729
27730 2003-09-05  Martin Baulig  <martin@ximian.com>
27731
27732         * class.c (mono_class_array_element_size): Added MONO_TYPE_VAR and
27733         MONO_TYPE_MVAR.
27734
27735 2003-09-04  Martin Baulig  <martin@ximian.com>
27736
27737         * reflection.c (mono_reflection_define_generic_parameter): Generic
27738         parameters start with zero.
27739
27740 2003-09-04  Martin Baulig  <martin@ximian.com>
27741
27742         * metadata.c (mono_type_size): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
27743
27744         * reflection.h (MonoReflectionGenericParam): New typedef.
27745         (MonoReflectionTypeBuilder): Added `generic_params' fields to get
27746         the generic parameters from the managed TypeBuilder.
27747
27748         * reflection.c (mono_reflection_define_generic_parameter): New function.
27749         (mono_reflection_create_runtime_class): Encode generic parameters.
27750         (mono_reflection_setup_generic_class): New function; this is
27751         called after adding adding all generic params to the TypeBuilder.
27752         (encode_type): Added MONO_TYPE_VAR.
27753
27754 2003-09-04  Zoltan Varga  <vargaz@freemail.hu>
27755
27756         * class.h class.c (mono_class_needs_cctor_run): Moved this method
27757         here from the JIT.
27758
27759         * assembly.h assembly.c: Moved the AOT loading code into an assembly
27760         load hook.
27761
27762 2003-09-03  Zoltan Varga  <vargaz@freemail.hu>
27763
27764         * reflection.h reflection.c class.h class.c: Delete duplicate 
27765         definition of mono_type_get_name () from reflection.c and export the
27766         one in class.c.
27767
27768         * class.c: Class loading fixes from Bernie Solomon 
27769         (bernard@ugsolutions.com).
27770
27771         * reflection.c: Endianness fixes from Bernie Solomon 
27772         (bernard@ugsolutions.com).
27773         
27774 2003-09-01  Zoltan Varga  <vargaz@freemail.hu>
27775
27776         * assembly.h assembly.c: Define a file format version for AOT
27777         libraries.
27778         
27779         * assembly.c (mono_assembly_open): Fix leaking of MonoImage-s.
27780
27781         * appdomain.h (MonoJitInfo): New field to determine whenever the
27782         code is domain neutral.
27783         
27784 2003-08-31  Miguel de Icaza  <miguel@ximian.com>
27785
27786         * marshal.c (emit_struct_conv): Add MONO_TYPE_CHAR
27787
27788 2003-08-30  Zoltan Varga  <vargaz@freemail.hu>
27789
27790         * icall.c (ves_icall_System_Web_Util_ICalls_get_machine_install_dir): 
27791         (ves_icall_System_Configuration_DefaultConfig_get_machine_config_path):
27792         Avoid caching the result since strings must be domain specific. Fixes
27793         #48050.
27794
27795 2003-08-29  Zoltan Varga  <vargaz@freemail.hu>
27796
27797         * marshal.c (mono_marshal_init): Make this callable multiple times
27798         since it is hard to find a correct place to call it.
27799
27800         * object.c (mono_runtime_class_init): Execute static constructors in
27801         the correct appdomain.
27802
27803         * image.c (build_guid_table): Handle the case when multiple images have
27804         the same GUID.
27805
27806 2003-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27807
27808         * icall.c: added a couple of icalls for System.Web.
27809
27810 2003-08-28  Martin Baulig  <martin@ximian.com>
27811
27812         * icall.c (ves_icall_Type_BindGenericParameters): Use
27813         `klass->generic_inst' instead of `&klass->byval_arg' in the
27814         mono_type_get_object() call.  The returned type must be
27815         MONO_TYPE_GENERICINST and not MONO_TYPE_CLASS.
27816
27817 2003-08-27  Zoltan Varga  <vargaz@freemail.hu>
27818
27819         * NOTES: New file.
27820
27821         * object.c (mono_class_proxy_vtable): Make it thread safe.
27822
27823         * pedump.c: Fix warning.
27824
27825         * object.c appdomain.h: Get rid of metadata_section. 
27826         It is no longer needed and it was causing deadlocks with domain->lock.
27827
27828         * appdomain.c (add_assemblies_to_domain): Make it thread safe.
27829
27830 2003-08-26  Martin Baulig  <martin@ximian.com>
27831
27832         * pedump.c (main): Don't call mono_image_close() if `verify_pe'.
27833
27834 2003-08-26  Martin Baulig  <martin@ximian.com>
27835
27836         * pedump.c (main): Call mono_metadata_init(),
27837         mono_raw_buffer_init(), mono_images_init(), mono_assemblies_init()
27838         and mono_loader_init().
27839
27840 2003-08-26  Zoltan Varga  <vargaz@freemail.hu>
27841
27842         * loader.h: Add missing include to fix build.
27843
27844         * image.h: mono_image_load_references is no more.
27845
27846         * assembly.c: Reworked assembly loading to make it really thread safe.
27847         After these changes, the assembly returned by mono_assembly_open is
27848         fully initialized, i.e. all its references assemblies are loaded.
27849
27850         * assembly.c (mono_image_load_references): Renamed to 
27851         mono_assembly_load_references, and made private, since clients no
27852         longer need to call it.
27853
27854         * class.c: Removed calls to mono_assembly_load_references, since it was
27855         a source of deadlocks.
27856
27857         * loader.h loader.c class.h class.c: Protect data structures using a 
27858         new lock, the loader lock.
27859
27860         * class.c (mono_class_setup_vtable): Create temporary hash tables and
27861         GPtrArrays only when needed.
27862
27863         * class.c (mono_class_layout_fields): Ignore the dummy field inserted 
27864         into empty structures by mcs. Fixes pinvoke7.cs.
27865         
27866         * domain.c (mono_init): Call a new initialization function.
27867
27868         * appdomain.c (mono_runtime_init): Call the new initializer function
27869         of the marshal module.
27870
27871         * marshal.c (mono_marshal_load_type_info): Ignore the dummy field
27872         inserted into empty structures by mcs. Fixes pinvoke7.cs.
27873
27874         * marshal.h marshal.c: Added locks around the wrapper caches to make
27875         this module thread safe.
27876
27877         * icall.c (ves_icall_InternalInvoke): Method wrappers doesn't require a
27878         this argument. Fixes pinvoke1.exe.
27879
27880 2003-08-25  Lluis Sanchez <lluis@ximian.com>
27881
27882         * object.h: Added call_type field to MonoMethodMessage and the corresponding
27883         enumeration of values. Removed fields to store remote call output values in
27884         MonoAsyncResult. Not needed any more.
27885         * object.c: Initialize call_type and async_result fields in mono_message_init.
27886         * marshal.c: mono_delegate_begin_invoke(): for proxies, set call_type before
27887         dispatching the message.
27888         mono_delegate_end_invoke (): delegate to the proxy the work of waiting for the
27889         async call to finish. To do it use a message with EndInvoke call type.
27890
27891 2003-08-25  Zoltan Varga  <vargaz@freemail.hu>
27892
27893         * loader.h loader.c (mono_method_hash_marhal_info): New function which
27894         determines whenever a method has marshalling info.
27895
27896 2003-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27897
27898         * assembly.c: fix the build on windows.
27899
27900 2003-08-22 Lluis Sanchez <lluis@ximian.com>
27901
27902         * object.cs: Fixed bug #47785.
27903
27904 2003-08-22 Jackson Harper <jackson@latitudegeo.com>
27905
27906         * string-icalls.c (StringReplace): If their are no occurances of
27907         the old string found return a reference to the supplied
27908         string. This saves some memory and matches MS behavoir.
27909         
27910 2003-08-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27911
27912         * socket-io.c: fixed compilation for systems that define AF_INET6
27913         and don't define SOL_IP/SOL_IPV6.
27914
27915 2003-08-21  Zoltan Varga  <vargaz@freemail.hu>
27916
27917         * object.c (mono_object_isinst): Fix casts to TransparentProxy in
27918         the interpreter. Patch by Bernie Solomon (bernard@ugsolutions.com).
27919
27920         * rawbuffer.c rawbuffer.h: Make this module thread safe.
27921
27922         * domain.c: Make this module thread safe.
27923
27924         * domain.c (mono_init): Call new initialization function.
27925
27926         * icall.c (ves_icall_System_Array_SetValueImpl): Check types for
27927         reference types too. Fixes #38812.
27928
27929         * image.c (mono_image_init): Fixed warnings.
27930
27931         * class.c (mono_class_from_typeref): Handle assembly load failure
27932         correctly.
27933
27934         * appdomain.c (add_assemblies_to_domain): Handle the case when
27935         the references of an assembly are not yet loaded.
27936
27937         * metadata.c image.c assembly.c: Moved initialization of global
27938         variables to a separate function called at startup since lazy 
27939         initialization of these variables is not thread safe.
27940         
27941         * image.c assembly.c: Made this module thread safe by adding locks in 
27942         the appropriate places.
27943
27944         * domain.c (mono_init): Call the new initialization functions of the
27945         three modules.
27946
27947 2003-08-20  Lluis Sanchez Gual  <lluis@ximian.com>
27948
27949         * marshal.c: mono_delegate_begin_invoke(): If the target is a proxy,
27950           make a direct call. It is proxy's work to make the call asynchronous.
27951           mono_delegate_end_invoke(): If the targe is a proxy, just collect
27952           the return values.
27953         * object.cs: mono_method_call_message_new(): read AsyncResult and
27954           state object from parameters list, if this info is requested.
27955         * object.h: Added fields to store remote call output values in
27956           MonoAsyncResult. Added AsyncResult field in MonoMethodMessage.
27957
27958 Wed Aug 20 12:57:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
27959
27960         * object.h: add needed fields to MonoThread.
27961         * threads.c, threads.h: allow registering a function to cleanup data
27962         allocated per thread by the JIT.
27963
27964 Tue Aug 19 18:22:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
27965
27966         * loader.h: portability fix by Bernie Solomon
27967         * <bernard@ugsolutions.com>.
27968
27969 2003-08-16  Zoltan Varga  <vargaz@freemail.hu>
27970
27971         * reflection.h reflection.c (mono_param_get_objects): Changed this to 
27972         return a MonoArray. This simplifies the code and also ensures that
27973         the cache allways contains an object reference as a value.
27974
27975         * icall.c (ves_icall_get_parameter_info): Simplified using the new
27976         function.
27977
27978 2003-08-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27979
27980         * socket-io.c: patch by Bernie Solomon <bernard@ugsolutions.com> that
27981         fixes a problem with byte ordering when getting the address family for
27982         a socket.
27983
27984 2003-08-15  Zoltan Varga  <vargaz@freemail.hu>
27985
27986         * .cvsignore: Added monosn.
27987
27988         * reflection.h reflection.c loader.c: Added support for parameter
27989         marshalling to dynamically created types. Fixes #47295.
27990
27991 Fri Aug 15 11:42:46 CEST 2003 Paolo Molaro <lupus@ximian.com>
27992
27993         * rand.c: remove useless warnings.
27994
27995 Wed Aug 13 15:49:57 CEST 2003 Paolo Molaro <lupus@ximian.com>
27996
27997         * class.c: implemented ldtoken for methods and fieldrefs.
27998
27999 2003-08-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28000
28001         * threadpool.c: when mono_async_invoke was called, no one took care of
28002         monitoring the queue. So if the method invoked took some time and we
28003         got new async invoke requests after 500 ms (the thread created waited
28004         that long in WaitForSingleObject), the new async invoke was not called
28005         until the previous one finished.
28006
28007         This is fixed now. Thanks to Totte for helping with it.
28008
28009 2003-08-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28010
28011         * threadpool.c: set threadpool_thread to TRUE. Patch by totte.
28012
28013 2003-08-11  Martin Baulig  <martin@ximian.com>
28014
28015         * mono-debug-debugger.c (mono_debugger_lookup_type): New function.
28016
28017 2003-08-06  Martin Baulig  <martin@ximian.com>
28018
28019         * mono-debug-debugger.c: Added support for static fields,
28020         properties and methods.
28021
28022 2003-08-06  Martin Baulig  <martin@ximian.com>
28023
28024         * mono-debug-debugger.c: Don't store the MonoString's vtable to
28025         make this work for applications with multiple application domains.
28026
28027 2003-08-04  Martin Baulig  <martin@ximian.com>
28028
28029         * mono-debug-debugger.c: Completely reworked the type support; the
28030         most important thing is that we're now just using one single
28031         `MonoType' instance per type.
28032
28033 Sat Aug  2 13:05:27 BST 2003 Malte Hildingson <malte@amy.udd.htu.se>
28034
28035         * mono-endian.h, mono-endian.c, icall.c: Added icall
28036         ves_icall_System_Double_AssertEndianity to assert double word endianity
28037         on ARM (FPA). The icall uses a macro defined in mono-endian.h.
28038
28039 Fri Aug 1 16:51:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
28040
28041         * class.c, class.h, reflection.c, metadata.c, icall.c: more generics
28042         support, icalls and fixes.
28043
28044 2003-07-31  Miguel de Icaza  <miguel@ximian.com>
28045
28046         * unicode.c (ves_icall_System_Char_IsPunctuation): The set of
28047         classes that are a punctuation character in .NET is not the same a
28048         g_unichar_ispunct.
28049
28050 Tue Jul 29 18:07:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
28051
28052         * socket-io.c: ipv6 portability fixes from Felix Ortga (guile@lared.es).
28053
28054 2003-07-29  Miguel de Icaza  <miguel@ximian.com>
28055
28056         * icall.c: Add new MemCopy internalcall.
28057         (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal):
28058         Simplified code; It is not necessary to handle all the cases here,
28059         as the C# code takes care of it.  Only handle the case of the name
28060         resource embedded into the assembly.
28061
28062         Changed signature to return the data pointer and the size of the
28063         data. 
28064
28065 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
28066
28067         * reflection.c (mono_image_get_method_info): Allow for 0x40 to be
28068         encoded.        (Partition II.22.1.7: PInvokeAttribute:SupportsLastErr).
28069
28070 2003-07-29  Lluis Sanchez Gual  <lluis@ximian.com>
28071
28072         * socket-io.c: ignore EINTR error in select.
28073
28074 Tue Jul 29 15:25:01 CEST 2003 Paolo Molaro <lupus@ximian.com>
28075
28076         * class.h, class.c: removed unused subclasses field in MonoClass.
28077
28078 2003-07-29  Lluis Sanchez Gual  <lluis@ximian.com>
28079
28080         * icall.c: improve fix of get_base_definition(). If the parent class
28081           doesn't have the mehod, look at the parent of the parent.
28082         * object.c: mono_message_init(): use the attribute PARAM_ATTRIBUTE_OUT
28083           to check if a parameter is an in or out parameter
28084           (PARAM_ATTRIBUTE_IN is not set by default).
28085           mono_method_return_message_restore(): Use mono_class_value_size to
28086           get the size of a value type. mono_type_stack_size (parameterType)
28087           does not return the correct value if parameterType is byRef.
28088           mono_load_remote_field(), mono_load_remote_field_new(),
28089           mono_store_remote_field(), mono_store_remote_field_new():
28090           raise exception if the remote call returns an exception.
28091
28092 2003-07-28  Martin Baulig  <martin@ximian.com>
28093
28094         * mono-debug-debugger.c (mono_debugger_runtime_invoke): New
28095         method.  This is a wrapper around mono_runtime_invoke() which
28096         boxes the instance object if neccessary.
28097
28098 Fri Jul 25 19:14:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
28099
28100         * class.c, class.h, image.c, image.h, loader.c, metadata.c,
28101         metadata.h, row-indexes.h, verify.c: first cut of generics support.
28102
28103 Thu Jul 24 11:34:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
28104
28105         * icall.c: disable mcs bug workaround.
28106
28107 2003-07-21  Miguel de Icaza  <miguel@ximian.com>
28108
28109         * object.c (mono_runtime_class_init): Take the metadata_section
28110         mutex before obtaining the domain mutex.
28111
28112         * appdomain.h: Added definition of metadata_section mutex here. 
28113
28114         * object.c: define metadata_mutex here.
28115
28116 2003-07-24  Ravi Pratap  <ravi@ximian.com>
28117
28118         * icall.c: Remove the FIXED_MCS_45127 workarounds - this has been
28119         fixed.
28120
28121 2003-07-24  Lluis Sanchez Gual  <lluis@ximian.com>
28122
28123         * reflection.c: Fix bug #46669
28124
28125 2003-07-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28126
28127         * exception.c:
28128         * exception.h:
28129         * icall.c:
28130         * object.h: fill in the type name for TypeLoadException.
28131
28132 2003-07-23  Ravi Pratap  <ravi@ximian.com>
28133
28134         * class.c: Fixes from Paolo in response to bug #45415 (Subclass
28135         relationship between TypeBuilders while compiling corlib) and bug
28136         45993 (Array types returned from the runtime while compiling
28137         corlib were from the loaded corlib).
28138
28139 2003-07-22  Martin Baulig  <martin@ximian.com>
28140
28141         * mono-debug-debugger.c: Reworked the type support a bit more;
28142         distinguish between types and classes.
28143
28144 Tue Jul 22 15:48:50 CEST 2003 Paolo Molaro <lupus@ximian.com>
28145
28146         * icall.c: add IsArrayImpl icall.
28147
28148 2003-07-22  Zoltan Varga  <vargaz@freemail.hu>
28149
28150         * class.c (mono_class_layout_fields): Fix gc aware auto layout by
28151         initializing real_size only once. Also fix bug #46602.
28152
28153 2003-07-21  Jerome Laban <jlaban@wanadoo.fr>
28154
28155         * object.c: Renamed mono_metadata_section to metadata_section.
28156
28157 2003-07-21  Lluis Sanchez Gual  <lluis@ximian.com>
28158
28159         * icall.c: in MS.NET ves_icall_Type_GetInterfaces returns an
28160           empty array if the type is an array. Fixed.
28161           ves_icall_MonoMethod_get_base_definition: if the base method
28162           is abstract, get the MethodInfo from the list of methods of
28163           the class.
28164         * reflection.c: ParameterInfo.PositionImpl should be zero-based
28165           and it was 1-based. Fixed in mono_param_get_objects.
28166
28167 2003-07-20  Martin Baulig  <martin@ximian.com>
28168
28169         * mono-debug.h: Set version number to 31.
28170         (mono_debug_init): Added `MonoDomain *' argument.
28171
28172         * mono-debug-debugger.c: Reworked the type support; explicitly
28173         tell the debugger about builtin types; pass the `klass' address to
28174         the debugger.
28175
28176 2003-07-20 Jackson Harper <jackson@latitudegeo.com>
28177
28178         * image.c: Allow new metadata tables to be loaded without a
28179         warning. Also update the warning message to give the new constant value.
28180                 
28181 Fri Jul 18 13:12:21 CEST 2003 Paolo Molaro <lupus@ximian.com>
28182
28183         * class.c, class.h, debug-helpers.c, icall.c, image.c, marshal.c,
28184         metadata.c, metadata.h, mono-debug-debugger.c, object.c, reflection.c: 
28185         array type representation changes.
28186
28187 Fri Jul 18 11:26:58 CEST 2003 Paolo Molaro <lupus@ximian.com>
28188
28189         * icall.c, appdomain.h, appdomain.c: support full runtime shutdown
28190         on Environment.Exit () call.
28191
28192 Thu Jul 17 17:21:57 CEST 2003 Paolo Molaro <lupus@ximian.com>
28193
28194         * icall.c, reflection.h, reflection.c, verify.c: cleanups,
28195         requires a matching corlib.
28196
28197 2003-07-17  Lluis Sanchez Gual  <lluis@ximian.com>
28198
28199         * Changelog: My editor decided to add a CR to each line. Sorry about that.
28200           Committed again without the CRs.
28201         
28202 2003-07-17  Lluis Sanchez Gual  <lluis@ximian.com>
28203
28204         * socket-io.c: Get system_assembly using mono_image_loaded(), instead
28205           getting it from the "this" socket instance. Did not work
28206           if the socket is a subclass of Socket.
28207           Also fixed bug #35371.
28208
28209 Thu Jul 17 13:39:32 CEST 2003 Paolo Molaro <lupus@ximian.com>
28210
28211         * metadata.c: fixed size for TypedByRef.
28212         * loader.c: when searching for a method, consider the vararg amrker.
28213         * unicode.c, decimal.c: constify some arrays.
28214
28215 2003-07-15  Dick Porter  <dick@ximian.com>
28216
28217         * socket-io.c: Fixed compilation for gcc < 3.2.
28218
28219         Fixed compilation for machines that don't have AF_INET6 (thanks to
28220         Bernie Solomon <bernard@ugsolutions.com> for that part.)
28221
28222         Fixed compile warnings.
28223         
28224         Fixed formatting and line endings.
28225
28226 2003-07-14  Jerome Laban <jlaban@wanadoo.fr>
28227
28228         * socket-io.h:
28229         * socket-io.c: Added IPv6 support.
28230
28231 2003-07-13  Zoltan Varga  <vargaz@freemail.hu>
28232
28233         * class.c (mono_class_is_assignable_from): New function to implement
28234         the is_assignable_from logic. Used by mono_object_isinst, 
28235         Type::IsAssignableFrom () and the interpreter.
28236
28237         * class.c (mono_class_is_subclass_of): Make all classes a subclass of
28238         Object, even interfaces.
28239         
28240         * object.c (mono_object_isinst): Implement in terms of 
28241         is_assignable_from.
28242
28243         * icall.c (ves_icall_type_is_assignable_from): New icall.
28244
28245 2003-07-11  Zoltan Varga  <vargaz@freemail.hu>
28246
28247         * domain.c (foreach_domain): fix compiler warning.
28248
28249 2003-07-11  Dietmar Maurer  <dietmar@ximian.com>
28250
28251         * image.c (load_metadata_ptrs): use g_strndup because strndup is
28252         not available on all plattforms
28253
28254 2003-07-10  Zoltan Varga  <vargaz@freemail.hu>
28255
28256         * image.h image.c: Store the metadata version string in MonoImage.
28257         * icall.c: New icall to retrieve the image version.
28258         * reflection.c (create_dynamic_image): Fill in the image version field
28259         * reflection.c (build_compressed_metadata): Use the image version
28260         from the image structure.
28261
28262 2003-07-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28263
28264         * appdomain.c: modified comment.
28265         * gc.c: finalizer_thread can call finalizers even when finished == TRUE.
28266         That will be its last iteration when mono_gc_cleanup is called from
28267         mono_runtime_cleanup and before the domain is unloaded.
28268
28269         Fixes bug #45962.
28270
28271 2003-07-04  Dietmar Maurer  <dietmar@ximian.com>
28272
28273         * marshal.c (mono_marshal_get_native_wrapper): fixes for [out]
28274         attributes.
28275
28276 Thu Jul 3 17:22:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
28277
28278         * object.c, file-io.c, metadata.c, mono-endian.h, reflection.c,
28279         rawbuffer.c: more 64 bit and picky (or old) compiler fixes from
28280         Bernie Solomon <bernard@ugsolutions.com>.
28281
28282 Thu Jul 3 17:17:39 CEST 2003 Paolo Molaro <lupus@ximian.com>
28283
28284         * object.c, object.h: provide mono_object_new_fast() for faster
28285         allocation in some special cases.
28286
28287 Wed Jul 2 13:21:26 CEST 2003 Paolo Molaro <lupus@ximian.com>
28288
28289         * object.h, reflection.h, verify.c: fixes for some 64bit issues,
28290         mostly from a patch by Laramie Leavitt <lar@leavitt.us>.
28291
28292 Tue Jul 1 21:24:14 CEST 2003 Paolo Molaro <lupus@ximian.com>
28293
28294         * threadpool.c: fix leaks.
28295
28296 2003-07-01  Dick Porter  <dick@ximian.com>
28297
28298         * threadpool.c (mono_async_invoke): Use mono_g_hash_table_remove when
28299         using MonoGHashTables.  Fixes threadpool bug posted to list.
28300
28301 Tue Jul 1 11:45:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
28302
28303         * image.h, image.c: added support to load an assembly from a byte array.
28304         * Makefile.am, assembly.c, make-bundle.pl, sample-bundle: added 
28305         assembly bundle support.
28306
28307 2003-06-27  Dietmar Maurer  <dietmar@ximian.com>
28308
28309         * threadpool.c (mono_thread_pool_add): keep a reference to the
28310         AsyncResult to prevent GC
28311
28312 Thu Jun 26 12:13:25 CEST 2003 Paolo Molaro <lupus@ximian.com>
28313
28314         * class.c: leak fix.
28315
28316 2003-06-25  Dick Porter  <dick@ximian.com>
28317
28318         * threadpool.c (mono_thread_pool_add): Don't set up a finaliser
28319         for the async object, the WaitHandle object will close the handle.
28320         Fixes bug 45321.
28321
28322 Wed Jun 25 18:12:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
28323
28324         * class.c: in mono_array_class_get (), lookup from the hash with the
28325         same type we insert: this works around a bug in
28326         mono_metadata_type_hash() with SZARRAY and fixes a leak reported by
28327         lluis. The real fix will have to wait for after the release.
28328
28329 Wed Jun 25 13:14:41 CEST 2003 Paolo Molaro <lupus@ximian.com>
28330
28331         * icall.c: fix memory leak when getting type members.
28332
28333 Mon Jun 23 16:12:48 CEST 2003 Paolo Molaro <lupus@ximian.com>
28334
28335         * reflection.c: added more pubtoken special cases.
28336
28337 Mon Jun 23 15:29:06 CEST 2003 Paolo Molaro <lupus@ximian.com>
28338
28339         * class.c: handle field offset correctly when class size
28340         is set (bug# 45182, partially from a patch by jlaban@wanadoo.Fr (Jerome Laban)).
28341
28342 2003-06-20  Martin Baulig  <martin@ximian.com>
28343
28344         * mono-debug-debugger.h (MonoDebuggerSymbolFile): Added `MonoImage
28345         *image' field.
28346
28347 2003-06-20  Martin Baulig  <martin@ximian.com>
28348
28349         * image.h, mono-debug-debugger.h: Fixed compiler warnings.
28350
28351 2003-06-20  Martin Baulig  <martin@ximian.com>
28352
28353         * mono-debug.h (MONO_DEBUG_VAR_ADDRESS_MODE_STACK): Removed.  We
28354         just distinguish between variables in registers and variables at
28355         an offset relative to a register.
28356
28357 2003-06-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28358
28359         * icall.c: #ifdef out latest changes until mcs is fixed.
28360
28361 Thu Jun 19 11:03:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
28362
28363         * icall.c: return members in metadata order.
28364
28365 Wed Jun 18 15:26:58 CEST 2003 Paolo Molaro <lupus@ximian.com>
28366
28367         * icall.c: avoid infinite loop in GetTimeZoneData.
28368
28369 Wed Jun 18 12:47:43 CEST 2003 Paolo Molaro <lupus@ximian.com>
28370
28371         * icall.c: added Marshal.Prelink/All icalls.
28372
28373 Wed Jun 18 12:17:48 CEST 2003 Paolo Molaro <lupus@ximian.com>
28374
28375         * object.c, object.h: fix warnings and do some overflow checking
28376         when creating arrays.
28377
28378 2003-06-17  Dick Porter  <dick@ximian.com>
28379
28380         * file-io.h:
28381         * file-io.c: File attributes need to be tweaked slightly when
28382         passed from the managed to the w32 world.
28383
28384 2003-06-17  Zoltan Varga  <vargaz@freemail.hu>
28385         * profiler.h profiler-private.h profiler.c: Rework last patch
28386         based on suggestion by Paolo.
28387         
28388 2003-06-17  Zoltan Varga  <vargaz@freemail.hu>
28389
28390         * profiler.h profiler-private.h profiler.c: Added infrastructure for 
28391         instruction level coverage data collection.
28392         * profiler.h profiler.c (: Added new callback function which can be
28393         used by the profiler to limit which functions should have coverage
28394         instrumentation.
28395         * profiler.c (mono_profiler_load): Call g_module_build_path to
28396         generate the file name of the profiler library.
28397
28398 Mon Jun 16 18:11:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
28399
28400         * profiler.c, profiler.h, profiler-private.h: added basic block 
28401         coverage profiling API.
28402
28403 2003-06-15  Zoltan Varga  <vargaz@freemail.hu>
28404
28405         * reflection.c (mono_reflection_create_runtime_class): Add support
28406         for events in dynamically generated code.
28407
28408         * gc.c: Start GCHandle indexes from 1, since 0 means the handle is
28409         not allocated.
28410
28411 Sat Jun 14 19:01:32 CEST 2003 Paolo Molaro <lupus@ximian.com>
28412
28413         * icall.c: when getting timezone info, return reasonable values if we
28414         can't get the actual data.
28415
28416 2003-06-14  Dick Porter  <dick@ximian.com>
28417
28418         * threads.c (start_wrapper): Remove the reference to the thread
28419         object in the TLS data, so the thread object can be finalized.
28420         This won't be reached if the thread threw an uncaught exception,
28421         so those thread handles will stay referenced :-( (This is due to
28422         missing support for scanning thread-specific data in the Boehm GC
28423         - the io-layer keeps a GC-visible hash of pointers to TLS data.)
28424
28425 Sat Jun 14 13:16:17 CEST 2003 Paolo Molaro <lupus@ximian.com>
28426
28427         * reflection.c: ensure streams and tables are first allocated with
28428         ALLOC_ATOMIC (GC_realloc uses plain GC_malloc otherwise).
28429
28430 Sat Jun 14 13:13:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
28431
28432         * icall.c: fixed GetElementType for byrefs (bug# 44792).
28433
28434 2003-06-13  Zoltan Varga  <vargaz@freemail.hu>
28435
28436         * reflection.c (mono_reflection_create_runtime_class): Add support for
28437         properties to dynamically created classes.
28438         * reflection.c: Fix a few places where non-MonoObjects were inserted
28439         into the tokens hashtable.
28440
28441 Fri Jun 13 19:10:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
28442
28443         * object.c: some support to handle out of memory exceptions.
28444
28445 2003-06-12  Dietmar Maurer  <dietmar@ximian.com>
28446
28447         * marshal.c (mono_marshal_get_native_wrapper): support reference
28448         return types
28449
28450 Wed Jun 11 18:32:51 CEST 2003 Paolo Molaro <lupus@ximian.com>
28451
28452         * object.h, object.c: more portability stuff from Bernie Solomon.
28453         Unexport mono_object_allocate(). Added mono_object_unbox ().
28454         Set exitcode when an unhandled exception is thrown.
28455
28456 2003-06-11  Dietmar Maurer  <dietmar@ximian.com>
28457
28458         * marshal.c (mono_marshal_get_native_wrapper): use custom
28459         marshaler for return types.
28460
28461 2003-06-10  Dick Porter  <dick@ximian.com>
28462
28463         * socket-io.c: Don't assume that one of struct ip_mreqn or struct
28464         ip_mreq is available
28465
28466 Tue Jun 10 17:35:03 CEST 2003 Paolo Molaro <lupus@ximian.com>
28467
28468         * debug-mono-symfile.c, marshal.c, metadata.c, monitor.c,
28469         mono-debug-debugger.c, mono-debug.c, process.c: portability fixes
28470         by Bernie Solomon <bernard@ugsolutions.com>.
28471
28472 2003-06-10  Zoltan Varga  <vargaz@freemail.hu>
28473
28474         * gc.c (mono_gc_init): Avoid error message on shutdown when
28475         GC_DONT_GC=1 is used.
28476
28477         * icall.c (ves_icall_System_Reflection_Module_GetGuidInternal): 
28478         New icall to return the GUID of a module.
28479
28480 Mon Jun 9 19:33:51 CEST 2003 Paolo Molaro <lupus@ximian.com>
28481
28482         * class.c: ensure instance size always includes the parent's size
28483         even whem class size is set explicitly (fixes bug#44294).
28484
28485 Thu Jun 5 19:51:49 CEST 2003 Paolo Molaro <lupus@ximian.com>
28486
28487         * profiler.h, profiler.c: made the simple profiler thread-safe,
28488         get more accurate timing info. Allow the loading of an
28489         externally-developed profiler module.
28490
28491 2003-06-05  Dietmar Maurer  <dietmar@ximian.com>
28492
28493         * marshal.c (mono_marshal_get_native_wrapper): improved
28494         class/byref arguments.
28495         (mono_marshal_get_native_wrapper): better string marshaling support.
28496
28497 Wed Jun 4 18:01:22 CEST 2003 Paolo Molaro <lupus@ximian.com>
28498
28499         * class.c: ensure .pack and .size are handled correctly and
28500         simplified layout of static fields.
28501
28502 2003-06-04  Dietmar Maurer  <dietmar@ximian.com>
28503
28504         * appdomain.c
28505         (ves_icall_System_AppDomainSetup_InitAppDomainSetup): fix for bug 42934
28506
28507         * loader.c (mono_lookup_pinvoke_call): look for modules in the
28508         current directory (fix bug 44008)
28509
28510 2003-06-03  Dietmar Maurer  <dietmar@ximian.com>
28511
28512         * marshal.c (mono_marshal_get_native_wrapper): started support for
28513         custom marshalers.
28514         (mono_delegate_to_ftnptr): consider marshalling specifications
28515
28516 Tue Jun 3 11:17:02 CEST 2003 Paolo Molaro <lupus@ximian.com>
28517
28518         * reflection.c, reflection.h: emit custom marshal info.
28519
28520 2003-06-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28521
28522         * object.c: free the GError.
28523         * icall.c: added CloseEvent_internal.
28524         * threads.[ch]:
28525         (ves_icall_System_Threading_Events_CloseEvent_internal): new internal
28526         call.
28527
28528 2003-06-01  Zoltan Varga  <vargaz@freemail.hu>
28529
28530         * loader.c (mono_method_get_signature): Add support for dynamic
28531         assemblies.
28532
28533 Sat May 31 15:22:07 CEST 2003 Paolo Molaro <lupus@ximian.com>
28534
28535         * reflection.c: fixed bug #43905.
28536
28537 Fri May 30 12:56:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
28538
28539         * class.c, domain.c, icall.c, metadata.h, object.h: support for
28540         handling TypedReference and ArgIterator.
28541         * loader.c, loader.h: added function to get signature at call site.
28542
28543 Thu May 29 11:34:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
28544
28545         * metadata.c, metadata.h, private.h, tokentype.h, loader.c: make more 
28546         data readonly. Buglets and warning fixes. Some MethodSpec support.
28547
28548 Tue May 27 16:34:39 CEST 2003 Paolo Molaro <lupus@ximian.com>
28549
28550         * class.h, class.c, object.c: remove relative numbering support.
28551
28552 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
28553
28554         * marshal.c (mono_marshal_get_native_wrapper): For now, do not
28555         free the string, until we get a chance to fix Gtk#
28556
28557 2003-05-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28558
28559         * marshal.c: revert last patch.
28560
28561 Mon May 26 20:21:52 CEST 2003 Paolo Molaro <lupus@ximian.com>
28562
28563         * icall.c: updates for new mono_class_vtable() not calling
28564         the type constructor anymore.
28565
28566 Mon May 26 12:10:35 CEST 2003 Paolo Molaro <lupus@ximian.com>
28567
28568         * object.h, object.c: separate vtable creation from type
28569         initialization. Make running the .cctor thread safe.
28570
28571 2003-05-26  Dietmar Maurer  <dietmar@ximian.com>
28572
28573         * marshal.c (mono_marshal_get_native_wrapper): free string return values.
28574
28575 2003-05-21  Dietmar Maurer  <dietmar@ximian.com>
28576
28577         * loader.c (mono_get_method): consider calling convention
28578
28579 2003-05-21  Zoltan Varga  <vargaz@freemail.hu>
28580
28581         * icall.c (ves_icall_System_Reflection_Module_GetGlobalType): New icall
28582         to return the invisible global type for a module.
28583
28584         * reflection.c (mono_image_build_metadata): Emit global fields too.
28585
28586 2003-05-20  Peter Williams  <peterw@ximian.com>
28587
28588         * loader.c (mono_lookup_internal_call): Add a few newlines.
28589
28590 2003-05-20  Zoltan Varga  <vargaz@freemail.hu>
28591
28592         * reflection.c (mono_reflection_lookup_dynamic_token): Intern dynamic
28593         literal strings.
28594
28595         * appdomain.c (set_domain_search_path): Recalculate search path when
28596         AppDomainSetup.PrivateBinPath changes.
28597
28598         * object.c (mono_class_compute_gc_descriptor): It turns out some
28599         parts of the class libs (like System.Thread) holds pointers to
28600         GC_MALLOC()-d memory in IntPtrs, which is wrong. The workaround is
28601         to treat native int a pointer type here.
28602         
28603 Tue May 20 17:18:16 CEST 2003 Paolo Molaro <lupus@ximian.com>
28604
28605         * appdomain.h, domain.c: add hashtable for jump target resolution.
28606
28607 2003-05-19  Zoltan Varga  <vargaz@freemail.hu>
28608
28609         * reflection.h reflection.c icall.c: Added new icalls 
28610         GetManifestResourceInfoInternal, GetModulesInternal and support
28611         infrastructure.
28612
28613 2003-05-16  Dick Porter  <dick@ximian.com>
28614
28615         * icall.c:
28616         * file-io.h:
28617         * file-io.c: Implement System.IO.MonoIO::GetTempPath
28618
28619 2003-05-14  Lluis Sanchez Gual  <lluis@ideary.com>
28620
28621         * object.c: mono_store_remote_field: little fix to previous patch.
28622
28623 Wed May 14 18:10:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
28624
28625         * class.c: add constructors to array classes.
28626         * icall.c: special case array construction for InternalInvoke (),
28627
28628 2003-05-14  Zoltan Varga  <vargaz@freemail.hu>
28629
28630         * class.h class.c reflection.c object.c: Added support for field
28631         defaults in dynamically generated classes.
28632
28633 Wed May 14 13:35:27 CEST 2003 Paolo Molaro <lupus@ximian.com>
28634
28635         * reflection.c: properly encode charset for ddlimport.
28636
28637 Wed May 14 11:14:54 CEST 2003 Paolo Molaro <lupus@ximian.com>
28638
28639         * threads.c: allow compiling without GC.
28640
28641 Tue May 13 16:41:49 CEST 2003 Paolo Molaro <lupus@ximian.com>
28642
28643         * appdomain.h, object.c, object.h, threads.c, threads.h: added
28644         handling of thread static data.
28645
28646 Tue May 13 16:36:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
28647
28648         * reflection.h, reflection.c: added mono_custom_attrs_free ().
28649
28650 2003-05-13  Dietmar Maurer  <dietmar@ximian.com>
28651
28652         * class.c (mono_array_class_get): always set the serializable flags
28653         (mono_array_class_get): always set the SEALED attribute for array types
28654
28655 2003-05-12  Dietmar Maurer  <dietmar@ximian.com>
28656
28657         * loader.c (mono_lookup_pinvoke_call): consider Ansi/Unicode
28658         attributes (fix for bug 42021).
28659
28660 2003-05-12  Dick Porter  <dick@ximian.com>
28661
28662         * gc.c: Don't run finalizers when the finalizer thread is
28663         finishing up, because the default domain has already been
28664         destroyed.
28665
28666 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
28667
28668         * string-icalls.c (ves_icall_System_String_ctor_chara_int_int): if
28669         value is null, we should throw an exception.   This is slightly
28670         different than the other conventions used for the constructor.
28671
28672 2003-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28673
28674         * socket-io.c: fixed windows build.
28675
28676 2003-05-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28677
28678         * socket-io.c: patch by Jerome Laban that fixes bug #42393.
28679
28680 2003-05-10  Zoltan Varga  <vargaz@freemail.hu>
28681
28682         * object.c (mono_string_new_wrapper): Compatibility fix for MS
28683         compilers.
28684
28685 2003-05-09  Zoltan Varga  <vargaz@freemail.hu>
28686
28687         * class.c (mono_class_layout_fields): Add experimental GC aware
28688         auto layout facility. Requires class library changes to work correctly.
28689
28690         (mono_class_setup_vtable): Avoid overriding explicit interface
28691         method implementations. Fixes iface3.exe test.
28692
28693         * object.c (mono_class_compute_gc_descriptor): Type I can't hold an
28694         object reference.
28695         (mono_array_new_specific): Add MONO_ARCH_SAVE_REGS.
28696         (mono_string_new_wrapper): Add MONO_ARCH_SAVE_REGS.
28697
28698         * metadata.h: Add new type classification macro which determines
28699         whenever the type holds an object reference.
28700
28701 2003-05-08  Dietmar Maurer  <dietmar@ximian.com>
28702
28703         * marshal.c (mono_marshal_get_native_wrapper): cleanups
28704
28705 2003-05-07  Zoltan Varga  <vargaz@freemail.hu>
28706
28707         * gc.c (finalizer_thread): Work around a GC bug.
28708
28709 2003-05-07  Dietmar Maurer  <dietmar@ximian.com>
28710
28711         * marshal.c (emit_struct_conv): allow unions
28712
28713         * class.c (class_compute_field_layout): added patches from Jerome Laban <jlaban@wanadoo.fr>
28714
28715 2003-05-06  Dietmar Maurer  <dietmar@ximian.com>
28716
28717         * marshal.c (mono_marshal_get_native_wrapper): free strings after pinvoke
28718
28719 2003-05-06  Martin Baulig  <martin@ximian.com>
28720
28721         * mono-debug-debugger.h: #include <mono/io-layer/io-layer.h>.
28722
28723 2003-05-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28724
28725         * socket-io.c:
28726         (Select_internal): allow NULLs, don't create arrays if not needed.
28727         Coupled with Socket.cs changes.
28728
28729         * threadpool.c:
28730         (mono_thread_pool_add): use GC_MALLOC to allocate the ASyncCall and
28731         register a finalizer for it that will close the semaphore handle. This
28732         fixes the leak and make Lupus' test run with > 4080 loops.
28733
28734 2003-05-05  Dietmar Maurer  <dietmar@ximian.com>
28735
28736         * marshal.c (mono_marshal_get_struct_to_ptr): added fixes from
28737         Jerome Laban (bug #42287)
28738
28739 2003-05-02  Martin Baulig  <martin@ximian.com>
28740
28741         * debug-mono-symfile.h
28742         (MonoSymbolFile): Moved declaration into mono-debug.h.
28743         (MonoDebugMethodJitInfo): Likewise.
28744         (mono_debug_open_mono_symbol_file): Take the MonoDebugHandle as
28745         argument.
28746         (_mono_debug_address_from_il_offset): Take a
28747         MonoDebugMethodJitInfo instead of a MonoDebugMethodInfo.
28748
28749         * mono-debug.h
28750         (MonoDebugDomainData): New struct.
28751         (mono_debug_get_domain_data): New function.
28752         (mono_debug_add_method): Take an additional `MonoDomain *'
28753         argument.
28754         (mono_debug_source_location_from_address): Likewise.
28755         (mono_debug_il_offset_from_address): Likewise.
28756         (mono_debug_address_from_il_offset): Likewise.
28757
28758 Thu May 1 19:40:37 CEST 2003 Paolo Molaro <lupus@ximian.com>
28759
28760         * reflection.c: one more check for null type in custom attrs.
28761
28762 2003-05-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28763
28764         * reflection.c: avoid warning (comparison is always false due to limited
28765         range of data type).
28766
28767 2003-05-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28768
28769         * icall.c: throw an exception in Type.GetField if the argument 'name'
28770         is NULL.
28771
28772 Wed Apr 30 10:53:09 CEST 2003 Paolo Molaro <lupus@ximian.com>
28773
28774         * reflection.c: fixed handling of enums in named arguments to custom
28775         attributes (bug #42123).
28776
28777 Tue Apr 29 19:15:10 CEST 2003 Paolo Molaro <lupus@ximian.com>
28778
28779         * reflection.c: use the right array element type and handle
28780         a null for a Type argument, too.
28781
28782 Tue Apr 29 15:46:00 CEST 2003 Paolo Molaro <lupus@ximian.com>
28783
28784         * reflection.c: handle arrays as arguments to custom attributes.
28785
28786 Tue Apr 29 11:43:01 CEST 2003 Paolo Molaro <lupus@ximian.com>
28787
28788         * reflection.c: handle a string value in a custom attr
28789         ctor that takes an object.
28790
28791 2003-04-29  Dietmar Maurer  <dietmar@ximian.com>
28792
28793         * marshal.c (mono_mb_emit_restore_result): support MONO_TYPE_PTR
28794         (fix bug #42063)
28795
28796 2003-04-28  Zoltan Varga  <vargaz@freemail.hu>
28797
28798         * icall.c (ves_icall_Type_GetNestedType): Fixed warnings.
28799
28800 2003-04-27  Martin Baulig  <martin@ximian.com>
28801
28802         * mono-debug-debugger.h (MonoDebuggerEvent): Renamed
28803         MONO_DEBUGGER_EVENT_BREAKPOINT_TRAMPOLINE to
28804         MONO_DEBUGGER_EVENT_BREAKPOINT.
28805         (mono_breakpoint_trampoline_code): Removed.
28806         (mono_debugger_event_handler): The last argument is now a
28807         `guint32'.
28808         (mono_debugger_insert_breakpoint_full): Removed the
28809         `use_trampoline' argument.
28810         (mono_debugger_method_has_breakpoint): Likewise.
28811         (mono_debugger_trampoline_breakpoint_callback): Renamed to
28812         mono_debugger_breakpoint_callback(); take the method and
28813         breakpoint number as arguments.
28814
28815 Sat Apr 26 19:25:31 CEST 2003 Paolo Molaro <lupus@ximian.com>
28816
28817         * metadata.c: fix off by one when loading parameters attributes.
28818
28819 2003-04-24  Martin Baulig  <martin@ximian.com>
28820
28821         * mono-debug-debugger.c (mono_debugger_io_layer): Put this back.
28822
28823 2003-04-24  Martin Baulig  <martin@ximian.com>
28824
28825         * mono-debug-debugger.c: Moved all code which interacts with the
28826         Mono Debugger here.
28827
28828         * debug-mono-symfile.c: This code now just deals with the symbol
28829         file itself, the debugger code is now in mono-debug-debugger.c.
28830
28831 2003-04-23  Martin Baulig  <martin@ximian.com>
28832
28833         * mono-debug.c (mono_debug_source_location_from_il_offset):
28834         New method; like mono_debug_source_location_from_address(), but
28835         takes an IL offset instead of a machine address.
28836
28837 2003-04-23  Martin Baulig  <martin@ximian.com>
28838
28839         * debug-mono-symfile.h (MonoDebugLineNumberEntry): Removed the
28840         `line' field; this is now computed by the debugger.
28841
28842 2003-04-23  Martin Baulig  <martin@ximian.com>
28843
28844         * mono-debug.[ch]: New files.  This is the new debugging interface.
28845
28846         * mono-debug-debugger.[ch]: New files.  Moved all code which
28847         interacts with the Mono Debugger here.
28848
28849 2003-04-22  Dietmar Maurer  <dietmar@ximian.com>
28850
28851         * domain.c (mono_init): initialize mono_defaults.monitor_class
28852
28853 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
28854
28855         * reflection.c (method_encode_code): Add a spicy exception to help
28856         future compiler authors.
28857
28858 2003-04-21  Martin Baulig  <martin@ximian.com>
28859
28860         * icall.c
28861         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
28862         Make this work with relative pathnames; g_filename_to_uri() needs
28863         an absolute filename.
28864
28865 2003-04-18  Zoltan Varga  <vargaz@freemail.hu>
28866
28867         * icall.c: Track name changes in Object and ValueType.
28868
28869 2003-04-18  Dietmar Maurer  <dietmar@ximian.com>
28870
28871         * metadata.c (mono_type_stack_size): size should be a multiple of
28872         sizeof (gpointer)
28873
28874 2003-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28875
28876         * gc.c:
28877         (internal_domain_finalize): moved into mono_domain_finalize. No need
28878         to create another thread because the finalizers will be run in the
28879         finalizer thread.
28880         
28881         (ves_icall_System_GC_WaitForPendingFinalizers): implemented.
28882         (finalizer_notify): if shutting down, wait 2 seconds for the finalizers
28883         to be run (MS does this too).
28884
28885 2003-04-17  Zoltan Varga  <vargaz@freemail.hu>
28886
28887         * object.c (mono_class_compute_gc_descriptor): Update comment.
28888
28889         * loader.h marshal.h marshal.c: Added synchronized method wrappers.
28890
28891         * image.h: Add synchronized wrapper cache.
28892
28893         * image.c (do_mono_image_open): Initialize cache.
28894
28895         * reflection.c (create_dynamic_mono_image): Initialize cache.
28896
28897 2003-04-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28898
28899         * icall.c: patch by Jerome Laban <jlaban@wanadoo.fr> that fixes
28900         ves_icall_System_Buffer_ByteLengthInternal.
28901
28902 Tue Apr 15 13:56:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
28903
28904         * reflection.c: setup klass->nested_in earlier. Allow
28905         a dash in the assembly name.
28906
28907 2003-04-15  Dietmar Maurer  <dietmar@ximian.com>
28908
28909         * metadata.c (mono_type_to_unmanaged): dont access
28910         type->data.klass for MONO_TYPE_OBJECT
28911         (mono_type_to_unmanaged): consider System.Delegate class
28912
28913 Tue Apr 15 11:16:05 CEST 2003 Paolo Molaro <lupus@ximian.com>
28914
28915         * class.c: just setup supertypes in the proper place instead of
28916         initializing the full element class for arrays.
28917
28918 Tue Apr 15 11:03:25 CEST 2003 Paolo Molaro <lupus@ximian.com>
28919
28920         * class.c: ensure the element class of arrays is initialized.
28921         Setup the supertype info for array classes, too.
28922
28923 2003-04-14  Miguel de Icaza  <miguel@ximian.com>
28924
28925         * icall.c (ves_icall_Type_GetNestedType): Add new internal call.
28926
28927 2003-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28928
28929         * Makefile.am: re-added -m option when running cygpath. This way,
28930         MONO_ASSEMBLIES and MONO_CFG_DIR will contain '/' as directory
28931         separator.
28932         * mono-config.c: same codepath for locating mono config file for WIN32
28933         and the rest.
28934         * assembly.c: if mono_assembly_setrootdir is called, don't override
28935         the value set.
28936
28937 2003-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28938
28939         * Makefile.am: patch by Urs Muff <umuff@quark.com> that fixes
28940         MONO_ASSEMBLIES variable.
28941
28942 Fri Apr 11 12:44:15 CEST 2003 Paolo Molaro <lupus@ximian.com>
28943
28944         * icall.c: added Assembly::GetNamespaces() icall.
28945
28946 2003-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28947
28948         * reflection.c: fix from Jaak <jaak@zd.com.pl>.
28949
28950 2003-04-10  Lluis Sanchez Gual  <lluis@ideary.com>
28951
28952         * appdomain.c,appdomain.h,icall.c: Added internal method that returns the process guid
28953         * object.c: fixed bug in the construction of vtable for proxies
28954
28955 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
28956
28957         * object.c (mono_array_new): Mark mono_array_new as an icall.
28958
28959 2003-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28960
28961         * class.c: fixed test for public method when overriding interfaces.
28962         Closes bug #40970.
28963
28964 Wed Apr 9 15:19:41 CEST 2003 Paolo Molaro <lupus@ximian.com>
28965
28966         * appdomain.h, domain.c: added mono_domain_foreach() to
28967         be able to access the currently loaded appdomains.
28968         * object.c: make string interning work across sppdomains.
28969         Mark some functions for use as icalls.
28970
28971 2003-04-09  Zoltan Varga  <vargaz@freemail.hu>
28972
28973         * class.c reflection.c: Fix memory leaks reported by ccmalloc.
28974
28975         * reflection.h reflection.c: Allocate long living data using 
28976         GC_MALLOC_ATOMIC so the collector does not need to scan it.
28977
28978         * reflection.c: Double the allocation size in streams instead of
28979         increasing it, to prevent unneccesary copying on large assemblies.
28980         
28981         * reflection.c (mono_reflection_create_runtime_class): Avoid vtable
28982         creation if the assembly does not have the Run flag set.
28983
28984 Tue Apr 8 11:19:53 CEST 2003 Paolo Molaro <lupus@ximian.com>
28985
28986         * class.h: avoid the C++ keywords in header files (Jerome Laban
28987         spotted and fixed this).
28988
28989 2003-04-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28990
28991         * object.c:
28992         (mono_unhandled_exception): fill in the arguments for the
28993         UnhandledException event. Only trigger that event for the default
28994         domain (as MS does).
28995
28996 2003-04-04  Zoltan Varga  <vargaz@freemail.hu>
28997
28998         * object.c: Improve typed allocation stuff based on suggestions from
28999         Paolo. Also turn it on if the GC library supports it.
29000
29001 2003-04-03  Zoltan Varga  <vargaz@freemail.hu>
29002
29003         * object.c object.h class.h: Added experimental typed allocation
29004         facility using the interfaces in gc_gcj.h.
29005
29006         * os/gc_wrapper.h: Added new include files.
29007         
29008 2003-04-03  Martin Baulig  <martin@ximian.com>
29009
29010         All the following changes are conditional to `WITH_INCLUDED_LIBGC'
29011         which is not yet enabled by default.
29012
29013         * gc.c (mono_gc_init): Set the gc_thread_vtable to our thread
29014         functions.
29015         (mono_gc_lock, mono_gc_unlock): New static functions.
29016
29017         * threads.c (mono_gc_stop_world, mono_gc_start_world): New public
29018         functions; stop/start the world for the garbage collector.  This
29019         is using the windows API; we need to complete the SuspendThread()/
29020         ResumeThread() implementation in the io-layer to make this work on Unix.
29021         (mono_gc_push_all_stacks): New public function; tells the garbage
29022         collector about the stack pointers from all managed threads.
29023
29024 2003-04-03  Martin Baulig  <martin@ximian.com>
29025
29026         * object.h (MonoThread): Added `gpointer stack_ptr'.
29027
29028         * threads.c (start_wrapper): Save the stack pointer in `stack_ptr'.
29029
29030 2003-04-03  Martin Baulig  <martin@ximian.com>
29031
29032         * Makefile.am: It's called `cygpath -w', not `cygpath -m'.
29033
29034 2003-04-03  Zoltan Varga  <vargaz@freemail.hu>
29035
29036         * reflection.c (typebuilder_setup_fields): Initialize field.first and
29037         field.last.
29038
29039 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
29040
29041         * loader.c (mono_lookup_internal_call): Report the corlib that is
29042         out of sync.
29043
29044 2003-03-05  Aleksey Demakov <avd@openlinksw.com>
29045
29046         * icall.c (ves_icall_type_GetTypeCode): fixed check for
29047         System.DBNull (it's class not valuetype).
29048
29049 Wed Apr 2 18:37:35 CEST 2003 Paolo Molaro <lupus@ximian.com>
29050
29051         * reflection.c: set table_idx in MonoReflectionArrayMethod object even 
29052         if the array method was already assigned a token (fixes bug#40646).
29053
29054 2003-04-02  Zoltan Varga  <vargaz@freemail.hu>
29055
29056         * reflection.c (mono_reflection_get_type): Attempt type resolve even
29057         if no assembly is given.
29058
29059 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
29060
29061         * metadata.h: Added the new tables.
29062
29063         * row-indexes.h: Added definitions for new tables.
29064
29065         * metadata.c: Add schemas for new tables, and add support for
29066         computing the sizes of them.
29067
29068         * class.c: Update for handling the new type cases.
29069
29070 2003-04-01  Dietmar Maurer  <dietmar@ximian.com>
29071
29072         * metadata.h (MONO_TYPE_IS_VOID): new macro
29073
29074 2003-03-31  Martin Baulig  <martin@ximian.com>
29075
29076         * threads.h (MonoThreadCallbacks): Added `thread_created'.
29077
29078         * threads.c (mono_thread_new_init): Call `thread_created' in the
29079         mono_thread_callbacks.
29080
29081 2003-03-31  Lluis Sanchez Gual <lluis@ideary.com>
29082
29083         * loader.h: added marshalbyrefobject_class to mono_defaults
29084         * domain.c: added initialization of mono_defaults.marshalbyrefobject_class 
29085         * icall.c: ves_icall_InternalExecute: fixed bug in field setter and in the
29086           generation of output parameters.
29087           ves_icall_Remoting_RealProxy_GetTransparentProxy: added support for interfaces.
29088         * marshal.c: mono_remoting_wrapper(): avoided call through proxy when the type is
29089           contextbound and the target object belongs to the context of the caller.
29090         * object.h: added context and unwrapped_server variables in MonoRealProxy.
29091         * object.c: Implemented support for interfaces and abstract classes
29092           in mono_class_proxy_vtable. Fixed several methods to avoid unneeded calls through
29093           proxy. Fixed problem when dealing with output parameters in mono_runtime_invoke_array.
29094
29095 2003-03-30  Zoltan Varga  <vargaz@freemail.hu>
29096
29097         * class.h class.c (mono_class_is_subclass_of): New function.
29098         
29099         * icall.c (ves_icall_System_Array_FastCopy): Added optimized copy
29100         routines for most common case (calls from ArrayList::ToArray).
29101
29102         * icall.c (ves_icall_System_Environment_Exit): Call profiler shutdown 
29103         routine so programs which call Environment::Exit() can be profiled.
29104
29105         * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle): 
29106         Added MONO_ARCH_SAVE_REGS.
29107
29108         * icall.c (ves_icall_type_is_subtype_of): Use new function.
29109
29110 2003-03-29  Miguel de Icaza  <miguel@ximian.com>
29111
29112         * blob.h: Add a couple of new MonoType types definitions.
29113
29114         * tabledefs.h: Add a couple of new call convs.
29115
29116 2003-03-27  Zoltan Varga  <vargaz@freemail.h>
29117
29118         * reflection.h (MonoReflectionDynamicAssembly): track changes in
29119         the layout of the class.
29120
29121         * reflection.c (alloc_table): double the size on overflow to avoid
29122         unnecessary copying.
29123
29124         * reflection.h reflection.c: If AssemblyBuilderAccess is Run, then
29125         avoid filling out metadata tables and blobs. Also set mb->ilgen to
29126         null so it can be garbage collected.
29127         
29128 2003-03-27  Zoltan Varga  <vargaz@freemail.hu>
29129
29130         * reflection.c (mono_reflection_get_type): Return the resolved type
29131         only if it is in the assembly we searched.
29132
29133         * reflection.c (ensure_runtime_vtable): Initialize method slots.
29134
29135         * class.c (mono_class_setup_vtable): Set the slot of the overriding
29136         method.
29137
29138 2003-03-26  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29139
29140         * appdomain.c:
29141         (set_domain_search_path): allow 'file://blah'. It's an invalid URI,
29142         the right one is 'file:///blah', but MS allows it.
29143         * assembly.c:
29144         (mono_assembly_open): allow 'file://blah'
29145
29146         Fixes bug #40306. Thanks to Mitko Iliev (imitko@openlinksw.co.uk).
29147
29148 2003-03-26  Aleksey Demakov <avd@openlinksw.com>
29149
29150         * socket-io.c: fixes bug #40310.
29151
29152 2003-03-25  Zoltan Varga  <vargaz@freemail.hu>
29153
29154         * reflection.c (mono_reflection_parse_type): handle deeply nested
29155         types correctly.
29156
29157         * reflection.c (mono_image_create_token): Use unique token values
29158         since they will be put into a hash table.
29159
29160         * class.c (mono_class_setup_vtable): If a method occurs in more than
29161         one place in the vtable, and it gets overriden, then change the
29162         other occurances too.
29163
29164         * marshal.c (mono_marshal_get_managed_wrapper): Added support for
29165         object as return type.
29166
29167 2003-03-22  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
29168
29169         * icall.c: Deleted "ToString" implementation for double and float
29170         because they are full implemented in managed code.
29171
29172 Wed Mar 19 18:05:57 CET 2003 Paolo Molaro <lupus@ximian.com>
29173
29174         * reflection.c, reflection.h: implemented and exported functions
29175         to retrieve info about custom attributes.
29176
29177 2003-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29178
29179         * appdomain.c: moved Uri handling to assembly.c
29180         * assembly.c: use g_filename_from_uri (). This makes assembly.LoadFrom
29181         work when using a file Uri in *nix and windows.
29182
29183         * icall.c: fixed Assembly.CodeBase to return a valid Uri. The same for
29184         GetReferencedAssemblies.
29185
29186 2003-03-18  Dick Porter  <dick@ximian.com>
29187
29188         * icall.c: Rename a couple of internal calls
29189
29190         * threads.c: Set the thread state to Stopped when a thread exits.
29191         Fixes bug 39377.
29192
29193 2003-03-17  Zoltan Varga  <vargaz@freemail.hu>
29194
29195         * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle):
29196         New icall.
29197
29198         * object.c (mono_class_vtable): fix warning.
29199
29200 2003-03-17  Zoltan Varga  <vargaz@freemail.hu>  
29201
29202         * icall.c (ves_icall_type_is_subtype_of): Avoid vtable creation.
29203
29204         * reflection.c (mono_blob_entry_hash): Avoid reading uninitialized
29205         memory.
29206         (method_encode_clauses): Create exception info structures in the right
29207         order.
29208         (mono_reflection_setup_internal_class): Initialize supertypes field.
29209
29210         * class.c object.c: Handle interfaces which implement other interfaces 
29211         correctly.
29212
29213         * class.h class.c: Move the supertypes array initialization code into 
29214         a separate function so it can be used for dynamic types too. Also call
29215         it earlier, in mono_class_init(), since it can be used before the
29216         type is initialized.
29217
29218 2003-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29219
29220         * Makefile.am:
29221         * assembly.c:
29222         * icall.c: make MONO_ASSEMBLIES and MONO_CFG_DIR work on windows.
29223
29224         * appdomain.c:
29225         * appdomain.h:
29226         * marshal.c:
29227         * object.c: remove warnings.
29228
29229 2003-03-13  Martin Baulig  <martin@ximian.com>
29230
29231         * debug-mono-symfile.h (MonoSymbolFileLexicalBlockEntry): New type.
29232         (MonoDebugLexicalBlockEntry): New types.
29233
29234         * debug-mono-symfile.c
29235         (_mono_debug_address_from_il_offset): Moved here from ../jit/debug.c.
29236
29237 2003-03-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29238
29239         * process.c: ret can be any non-zero value accroding to MS doc.
29240
29241 2003-03-07  Miguel de Icaza  <miguel@ximian.com>
29242
29243         * class.c (mono_marshal_load_type_info): Fix buglet:  Noticed when
29244         fixing a warning for a miss-used prototype, would have cause
29245         random memory corruption.
29246
29247 2003-03-07  Martin Baulig  <martin@ximian.com>
29248
29249         * marshal.c (mono_marshal_free_array): That "TESTFREE %p" was
29250         getting really annoying ....
29251
29252 2003-03-07  Zoltan Varga  <vargaz@freemail.hu>
29253
29254         * reflection.c (fixup_method): added support for array methods.
29255
29256 Tue Mar 4 18:03:27 CET 2003 Paolo Molaro <lupus@ximian.com>
29257
29258         * socket-io.c:  handle case when AF_INET6 and AF_IPX are not defined
29259         (pointed out by Michael Adams).
29260
29261 2003-03-04  Dick Porter  <dick@ximian.com>
29262
29263         * icall.c: Temporarily reverted the Double and Single ToString()
29264         change, because it broke nunit.
29265
29266 Tue Mar 4 12:40:58 CET 2003 Paolo Molaro <lupus@ximian.com>
29267
29268         * object.h, threads.h: make include files compatible with C++
29269         (patch by Jerome Laban <jlaban@wanadoo.fr>).
29270
29271 2003-03-04  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
29272
29273         * icall.c: Erased ToString helper functions for Double and Single.
29274         Now, that implementations ar all in managed code (Double and Single
29275         Formatters).
29276
29277 2003-03-03  Lluis Sanchez Gual  <lluis@ideary.com>
29278
29279         * appdomain.c: Added method for initializing the default context of
29280         a domain. Added internal call for getting the default context.
29281         * appdomain.h: Added context variable in MonoDomain struct.
29282         * domain.c: mono_domain_set also sets the default context of the domain
29283         * icall.c: Mapped internal method InternalGetDefaultContext.
29284         * object.c: mono_object_get_virtual_method returns always a remoting
29285         wrapper if the object is a transparent proxy.
29286         mono_runtime_invoke_array: when creating an object by calling the
29287         constructor, if the created object is a proxy, then the constructor should
29288         be called using the a remoting wrapper.
29289
29290 2003-03-03  Dick Porter  <dick@ximian.com>
29291
29292         * socket-io.c (create_sockaddr_from_object): Rename sockaddr_un
29293         variable so it compiles on solaris.  Problem spotted by
29294         Christopher Taylor <ct@cs.clemson.edu>
29295
29296 2003-03-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29297
29298         * appdomain.c:
29299         (get_info_from_assembly_name): don't leak value.
29300
29301         * icall.c:
29302         (ves_icall_System_Reflection_Assembly_GetFilesInternal): initialize
29303         result.
29304
29305 Sat Mar 1 15:32:56 CET 2003 Paolo Molaro <lupus@ximian.com>
29306
29307         * assembly.c: export mono_image_load_references ().
29308         * class.c: handle function pointers. mono_class_from_name() now
29309         supports nested type names directly.
29310
29311 2003-02-28  Zoltan Varga  <vargaz@freemail.hu>
29312
29313         * reflection.h reflection.c: Encode already created dynamic methods 
29314         and fields correctly as a DEF instead of a REF.
29315
29316         * reflection.c: Get rid of the force_ref argument to 
29317         mono_image_typedef_or_ref since it was wrong in the first place.
29318
29319         * string-icalls.c: add error checking to string constructors according
29320         to the MSDN docs.
29321
29322         * reflection.c: Emit types in the order their TypeBuilders were 
29323         created. Previously, a new table index was assigned to each type before
29324         the tables were emitted. This was wrong because the signature blob
29325         might already refer to a type by its original table index.
29326
29327 2003-02-27  Zoltan Varga  <vargaz@freemail.hu>
29328
29329         * metadata.c (mono_metadata_nesting_typedef): fix bug in previous
29330         change.
29331         
29332 2003-02-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29333
29334         * Makefile.am: make assemblies dir have \ instead of / on windows.
29335
29336 2003-02-27  Zoltan Varga  <vargaz@freemail.hu>  
29337
29338         * metadata.c metadata.h (mono_metadata_nesting_typedef): changed to
29339         iterate over the NESTEDCLASS table using a linear search since the
29340         table is not guaranteed to be sorted by the secondary key.
29341
29342         * class.c (mono_class_create_from_typedef): fixed up call to
29343         mono_metadata_nesting_typedef.
29344         
29345 2003-02-27  Dietmar Maurer  <dietmar@ximian.com>
29346
29347         * marshal.c (mono_string_to_byvalstr): clear the memory as
29348         suggested by Jerome Laban <jlaban@wanadoo.fr>
29349
29350 2003-02-26  Dick Porter  <dick@ximian.com>
29351
29352         * process.c: Cope with padding in .rsrc blocks
29353
29354 2003-02-26  Dietmar Maurer  <dietmar@ximian.com>
29355
29356         * metadata.h: reverted the filter_len change, it breaks reflection
29357         
29358 2003-02-26  Dietmar Maurer  <dietmar@ximian.com>
29359
29360         * metadata.h: added a new field to store the filter_len
29361         
29362
29363 Tue Feb 25 10:56:16 CET 2003 Paolo Molaro <lupus@ximian.com>
29364
29365         * reflection.c: handle custom attributes for types and members
29366         created with Reflection.Emit (bug#38422).
29367
29368 2003-02-22  Zoltan Varga  <vargaz@freemail.hu>
29369
29370         * reflection.c: define RTSpecialName automatically for constructors for
29371         compatibility with MS.NET.
29372
29373         * reflection.c (mono_reflection_create_runtime_class): initialize
29374         nested_in field of dynamically created classes.
29375
29376 2003-02-22  Martin Baulig  <martin@ximian.com>
29377
29378         * debug-mono-symfile.h: Incremented version number.
29379
29380 2003-02-21  Zoltan Varga  <vargaz@freemail.hu>
29381
29382         * object.h icall.c process.c: fix warnings.
29383
29384 2003-02-21  Zoltan Varga  <vargaz@freemail.hu>
29385
29386         * appdomain.h appdomain.c:
29387         (mono_domain_try_type_resolve): split the 
29388         name_or_tb argument into a name and a tb argument.
29389         (mono_domain_has_type_resolve): new function to check whenever the
29390         application has registered a TypeResolve event handler.
29391         
29392         * icall.c reflection.h reflection.c: move the type resolve logic into
29393         mono_reflection_get_type () so it will be invoked when 
29394         Assembly::GetType () is called.
29395
29396         * reflection.c:
29397         (mono_reflection_get_type): renamed to get_type_internal.
29398         (mono_reflection_get_type): fixed type name generation so it works 
29399         for nested types too.
29400         (mono_reflection_get_type): call has_type_resolve () to avoid the 
29401         costly type name generation if there is no resolve event handler.
29402
29403 Fri Feb 21 11:36:57 CET 2003 Paolo Molaro <lupus@ximian.com>
29404
29405         * class.c, image.c: load exported types from file references.
29406
29407 2003-02-19  Lluis Sanchez Gual  <lluis@ideary.com>
29408
29409         * appdomain.h: Added in MonoDomain a couple of MonoMethod* variables
29410           used to cache the managed methods used to create proxies and make 
29411           remote invocation of methods.
29412         * class.h: Added in MonoVTable a flag to indicate that a class needs 
29413           to be remotely created.
29414         * object.c: Modified the method mono_class_vtable(). It now initializes 
29415           the remote flag of the vtable. Modified mono_object_new_specific(), 
29416           so now it checks the remote flag.
29417         * icall.c: Added a couple of internal methods, one for enabling instance 
29418           creation interception for a type, and one for creating objects bypassing
29419           the remote check.
29420
29421 2003-02-18  Martin Baulig  <martin@ximian.com>
29422
29423         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetMethodToken):
29424         New interncall to get a method's metadata token.
29425
29426         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetMethodToken"):
29427         New interncall for the debugger.
29428
29429 2003-02-18  Dietmar Maurer  <dietmar@ximian.com>
29430
29431         * class.c (mono_class_setup_vtable): allocate supertype array
29432
29433 2003-02-18  Martin Baulig  <martin@ximian.com>
29434
29435         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Added `has_this'.
29436
29437 2003-02-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29438
29439         * reflection.c:
29440         (assembly_name_to_aname): jump over unknown properties (i've found
29441         something like: 'type, assembly, version=xxx, custom=null, public...',
29442         so now will ignore custom=null and still get the rest of the values).
29443
29444 2003-02-17  Dick Porter  <dick@ximian.com>
29445
29446         * threads.c: Have Thread.Start() wait for a semaphore to signal
29447         that the thread has set up all its local data.  This fixes bug
29448         34323, where Abort() raced the new thread's TLS data.
29449
29450         Also removes the handle_store() call from start_wrapper, because
29451         threads are now always created suspended and there is no longer a
29452         race between the parent and child threads to store the info.
29453
29454 Mon Feb 17 13:13:31 CET 2003 Paolo Molaro <lupus@ximian.com>
29455
29456         * image.c: explain the #- heap issue in a message, hopefully
29457         avoiding FAQs on mono-list.
29458
29459 2003-02-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29460
29461         * icall.c:
29462         (GetEntryAssembly): if the domain has not invoked
29463         AppDomain.ExecuteAssembly yet, return the assembly of the default
29464         AppDomain.
29465
29466 2003-02-16  Zoltan Varga  <vargaz@freemail.hu>
29467
29468         * class.c (mono_ldtoken): make it work in dynamic assemblies.
29469
29470 Sun Feb 16 13:10:06 CET 2003 Paolo Molaro <lupus@ximian.com>
29471
29472         * metadata.c, reflection.c: simple speedup to type hash
29473         and equals code.
29474
29475 Sat Feb 15 15:15:03 CET 2003 Paolo Molaro <lupus@ximian.com>
29476
29477         * image.c, image.h, class.c, assembly.c: move module loading
29478         to MonoImage. When loading metadata, consider alignemnet from
29479         the start of metadata, not from the metadata address in memory.
29480
29481 2003-02-13  Zoltan Varga  <vargaz@freemail.hu>
29482
29483         * reflection.c (mono_reflection_get_custom_attrs): Added support for 
29484         AssemblyBuilder objects. Factored out custom attribute creation into
29485         a separate function.
29486         (create_custom_attr): new function to create custom attributes.
29487
29488 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
29489
29490         * Makefile.am: Got tired of typing the full pathname to pedump.
29491         Until there is another option, am installing this.
29492
29493 2003-02-12  Dietmar Maurer  <dietmar@ximian.com>
29494
29495         * class.c (class_compute_field_layout): always set field->parent 
29496         (mono_ldtoken): use mono_defaults.fieldhandle_class;
29497
29498 2003-02-11  Dick Porter  <dick@ximian.com>
29499
29500         * threads-types.h:
29501         * monitor.c: Rewrote Monitor, making lock much faster and
29502         Pulse/Wait work as specified.  Also uses much fewer handles, and only
29503         creates them as needed.
29504
29505         * exception.c: Added SynchronizationLockException
29506
29507         * threads.c: Deleted old Monitor implementation.  The new one is
29508         in a new file.
29509
29510 Mon Feb 10 17:54:10 CET 2003 Paolo Molaro <lupus@ximian.com>
29511
29512         * class.c: handled TypedReference type code. Set the correct size for
29513         class data. Setup interface_offsets for interface classes, too.
29514
29515 2003-02-09  Martin Baulig  <martin@ximian.com>
29516
29517         * debug-mono-symfile.h: Reflect latest symbol writer changes.
29518
29519 Sun Feb 9 18:37:01 CET 2003 Paolo Molaro <lupus@ximian.com>
29520
29521         * loader.c: implemented MEMBERREF_PARENT_TYPEDEF.
29522         * metadata.c, reflection.c: missing MONO_TYPE_TYPEDBYREF handling.
29523         * object.c: fixed mono_object_get_virtual_method () for interfaces.
29524         * verify.c: check for code that runs after the end of the method.
29525
29526 2003-02-08  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
29527
29528         * icall.c: Added "System.Math::Floor", "System.Math::Round" and
29529         "System.Math::Round2".
29530         * sysmath.h: Added Floor, Round and Round2 definitions.
29531         * sysmath.c: Modified certain functions that were not 100% compliant
29532         with MS.NET (math precision) and added the implementation of Floor,
29533         Round and Round2.
29534
29535 2003-02-07  Martin Baulig  <martin@ximian.com>
29536
29537         * debug-mono-symfile.c (mono_debug_symfile_add_method): Ignore interncalls.
29538
29539 2003-02-07  Martin Baulig  <martin@ximian.com>
29540
29541         * debug-mono-symfile.c: Reflected latest symwriter changes.
29542         (mono_debug_create_mono_symbol_file): Removed.
29543         (mono_debug_open_mono_symbol_file): Take an argument which
29544         specifies whether to create a dynamic symbol file.
29545
29546 2003-02-07  Dietmar Maurer  <dietmar@ximian.com>
29547
29548         * class.c (mono_class_from_mono_type): added MONO_TYPE_TYPEDBYREF
29549
29550 2003-02-05  Martin Baulig  <martin@ximian.com>
29551
29552         * reflection.c (mono_image_build_metadata): Make this public,
29553         protect it against being called multiple times, don't create
29554         resources and don't build the compressed metadata here.
29555         (mono_image_create_pefile): Do this here.
29556
29557         * icall.c
29558         ("System.Reflection.Emit.AssemblyBuilder::build_metadata"): Added.
29559
29560 2003-02-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29561
29562         * socket-io.c: fixed bug #36322.
29563
29564 2003-02-06  Piers Haken <piersh@friskit.com>
29565
29566         * appdomain.[ch]:
29567         * class.h:
29568         * debug-mono-symfile.c:
29569         * icall.c:
29570         * loader.c:
29571         * mono-config.c:
29572         * monosn.c:
29573         * reflection.c:
29574         * socket-io.c: warning cleanups
29575
29576 2003-02-06  Dietmar Maurer  <dietmar@ximian.com>
29577
29578         * marshal.c (mono_marshal_get_remoting_invoke_with_check): new
29579         function. works like remoting invoke, but does a check for the Proxy first.
29580
29581 2003-02-05  Miguel de Icaza  <miguel@ximian.com>
29582
29583         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Make it compiler.
29584
29585 2003-02-05  Dietmar Maurer  <dietmar@ximian.com>
29586
29587         * marshal.c (mono_marshal_get_native_wrapper): only allocate an
29588         array of pointers.
29589         (mono_marshal_get_ldfld_wrapper): only generate necessary ldfld wrappers.
29590         (mono_marshal_get_stfld_wrapper): only generate necessary stfld wrappers.
29591
29592         * object.c (mono_store_remote_field_new): used by the new jit
29593         instead of mono_store_remote_field
29594         (mono_load_remote_field_new): used by the new jit
29595         instead of mono_load_remote_field
29596
29597 2003-02-05  Patrik Torstensson
29598
29599         * appdomain.c: changed unload to take the domain id instead
29600         of domain
29601         
29602         * icall.c: changed icall for AppDomain.Unload to AppDomain.InternalUnload
29603
29604
29605 2003-02-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29606
29607         * appdomain.c: don't look for assemblies in ApplicationBase if
29608         PrivateBinPathProbe is set.
29609
29610 2003-02-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29611
29612         * object.c: make the first argument in main_args contain the absolute
29613         path to the assembly. Fixes bug #37511.
29614
29615 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29616
29617         * icall.c: get correct UTC offset for countries not using daylight
29618         time saving. Fixes bug #30030.
29619
29620 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29621
29622         * socket-io.c: support AF_UNIX and use the same layout as MS (bytes 0
29623         and 1 are the family).
29624
29625 2003-02-04  Dietmar Maurer  <dietmar@ximian.com>
29626
29627         * icall.c (ves_icall_InternalExecute): removed wrong assertion
29628
29629         * marshal.c (mono_marshal_get_remoting_invoke): generate valid IL
29630
29631 2003-02-04  Zoltan Varga  <vargaz@freemail.hu>
29632
29633         * reflection.c: added support for SignatureHelper tokens, which is
29634         needed by the Calli opcode.
29635
29636         * reflection.h: track changes to SignatureHelper class.
29637
29638         * metadata.c (mono_metadata_parse_signature): handle dynamic tokens.
29639
29640 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29641
29642         * appdomain.c: fixed loading assemblies from PrivateBinPath.
29643
29644 2003-02-03  Patrik Torstensson
29645         * appdomain.[c|h], domain.c : 
29646          - Added support for getting a domain via domain id
29647          - Support for setting and getting domain from System.AppDomain 
29648            (used in cross appdomain channel)
29649          - Added support for get/set for a MonoAppContext on a thread 
29650            (Context class in System.Runtime.Remoting.Contexts),
29651          - Removed hack in Get/SetData and ExecuteAssembly.
29652         
29653         * icall.c : renamed GetTransparantProxy to InternalGetTransparantProxy to allow
29654         the managed world to get control when a proxy is created.
29655
29656         * icall.c (ves_icall_InternalExecute) : bug fix, must return empty array
29657         
29658 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
29659
29660         * icall.c
29661         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
29662         Populate the codebase field as well.
29663
29664 2003-02-02  Martin Baulig  <martin@ximian.com>
29665
29666         * debug-mono-symfile.c
29667         (MonoSymbolFileMethodAddress): Added `wrapper_address' field.
29668         (mono_debug_symfile_add_method): Allow interncalls.
29669
29670 2003-01-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29671
29672         * icall.c: throw parse exception if strtod fails or the string is empty.
29673
29674 Fri Jan 31 16:09:48 CET 2003 Paolo Molaro <lupus@ximian.com>
29675
29676         * marshal.c: handle object type separately from defined
29677         class types.
29678
29679 Fri Jan 31 16:01:20 CET 2003 Paolo Molaro <lupus@ximian.com>
29680
29681         * marshal.c: handle NATIVE_LPSTR for strings when it's
29682         explicitly specified.
29683
29684 Fri Jan 31 11:51:43 CET 2003 Paolo Molaro <lupus@ximian.com>
29685
29686         * reflection.c, reflection.h, icall.c: setup the reflection
29687         handle cache for ModuleBuilders and AssemblyBuilders.
29688
29689 2003-01-30  Dietmar Maurer  <dietmar@ximian.com>
29690
29691         * reflection.c (reflection_methodbuilder_to_mono_method): set
29692         pinvoke flag
29693
29694 2003-01-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29695
29696         * icall.c: implemented ves_icall_MonoMethod_get_base_definition.
29697
29698 2003-01-29  Dick Porter  <dick@ximian.com>
29699
29700         * threads.c: No need for the fake_thread kludge now that Thread
29701         doesn't run a class constructor
29702         
29703 2003-01-29  Dick Porter  <dick@ximian.com>
29704
29705         * threads.c: Use g_direct_hash instead of the rather bogus
29706         g_int_hash
29707
29708 2003-01-29  Dietmar Maurer  <dietmar@ximian.com>
29709
29710         * marshal.c (mono_marshal_get_native_wrapper): add check for null
29711         (fix pinvoke12.exe)
29712         (mono_marshal_get_struct_to_ptr): generate valid IL code
29713         (mono_marshal_get_ptr_to_struct): generate valid IL code
29714         (*): correctly set sig->pinvoke, we need to memdup the signature
29715         to do that
29716
29717 Tue Jan 28 22:57:57 CET 2003 Paolo Molaro <lupus@ximian.com>
29718
29719         * marshal.c, marshal.h: use larger integers in mono_mb_emit_add_to_local()
29720         to avoid overflows (bug spotted and fixed by Jerome Laban <jlaban@wanadoo.fr>).
29721
29722 Tue Jan 28 18:55:19 CET 2003 Paolo Molaro <lupus@ximian.com>
29723
29724         * profiler.c: provide more callers information.
29725
29726 2003-01-28  Dietmar Maurer  <dietmar@ximian.com>
29727
29728         * marshal.c (mono_marshal_get_managed_wrapper): generate valid IL code
29729
29730         * appdomain.h:added fix from Patrik: _MonoAppDomain is a MBR object
29731
29732         * marshal.c (mono_marshal_get_native_wrapper): generate valid IL code
29733
29734 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
29735
29736         * icall.c: (ves_icall_System_CurrentTimeZone_GetTimeZoneData): raise an
29737         exception instead of going into an infinite loop on dates which it 
29738         can't yet handle.
29739
29740         * string-icalls.c (ves_icall_System_String_get_Chars): raise 
29741         out-of-range exception if needed.
29742
29743         * class.c (mono_class_setup_vtable): allow a virtual method to provide
29744         an implementation for an interface method and to override an inherited
29745         method at the same time. 
29746         Imagine a scenario when a virtual method is used to override a
29747         virtual abstract method in a parent class, and this same method 
29748         provides an implementation for an method inherited from an interface. 
29749         In this case, the interface resolution code will set im->slot, which 
29750         means that the virtual method override pass will skip this method 
29751         which means a pointer to the abstract method inherited from the parent
29752         will remain in the vtable of this non-abstract class.
29753
29754         * class.c: (mono_class_setup_vtable): continue search for a real 
29755         method if only an abstract method is found.     
29756
29757 Mon Jan 27 17:12:19 CET 2003 Paolo Molaro <lupus@ximian.com>
29758
29759         * reflection.c: add size to encoding for ByValStr and ByValArray
29760         marshal blob (from "Jerome Laban" <jlaban@wanadoo.fr>).
29761
29762 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
29763
29764         * class.c (mono_class_setup_vtable): pass the override info as an
29765         argument.
29766
29767         * class.c (mono_class_setup_vtable): set the slot of overriding methods
29768         correctly.
29769         
29770         * reflection.c (ensure_runtime_vtable); add support for method 
29771         overrides.
29772         
29773 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
29774
29775         * reflection.c (resolution_scope_from_image): Hack to work to work with
29776         dynamic assemblies.
29777
29778         * reflection.c (mono_image_typedef_or_ref): renamed to ..._aux and 
29779         added a 'force_ref' argument to force this function to allways return 
29780         a TypeRef. This is needed by mono_image_get_memberref_token ().
29781         
29782 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
29783
29784         * reflection.c (mono_image_get_type_info): interfaces really don't have
29785         a parent.
29786
29787         * reflection.c (mono_image_basic_init): fill out missing fields of
29788         image structure.
29789
29790         * reflection.c (mono_image_basic_init): Invoke assembly load hooks for 
29791         dynamic assemblies. This is required so dynamic assemblies show up in
29792         AppDomain.GetAssemblies (), emit an AssembyLoadEvent, gets searched by
29793         Type::GetType() etc. This is consistent with MS behaviour.
29794
29795         * image.c image.h reflection.c: add newly created classes to the name 
29796         cache so mono_class_get () will find them.      
29797
29798 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
29799
29800         First part of changes to get IKVM.NET running under mono.
29801         
29802         * appdomain.h, appdomain.c: added new function 
29803         mono_domain_try_type_resolve() which will emit TypeResolve events. 
29804         This function will call AppDomain::DoTypeResolve to do the actual work.
29805
29806         * class.h, class.c, loader.c, object.c, reflection.h, reflection.c: 
29807         moved existing code dealing with dynamic tokens to a new function 
29808         called mono_reflection_lookup_dynamic_token (). This function will 
29809         raise TypeResolve events when appropriate. Since reflection.c is not 
29810         part of libmetadata, a new hook function called 
29811         mono_lookup_dynamic_token() is added to class.c which will call this.
29812
29813         * assembly.h assembly.c: make the invoke_load_hook function public,
29814         so it can be called for dynamic assemblies.
29815
29816         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): skip interfaces since they do not have initializers.
29817
29818         * icall.c (ves_icall_type_from_name): emit a TypeResolve event if the 
29819         type isn't found.
29820
29821         * reflection.c reflection.h: change MonoDynamicAssembly.tokens to a 
29822         MonoGHashTable, since it contains pointers to objects which the GC 
29823         needs to track.
29824
29825         * assembly.c (search_loaded): remove unused variable.
29826         
29827 Mon Jan 27 12:18:45 CET 2003 Paolo Molaro <lupus@ximian.com>
29828
29829         * object.c: fixed issue exposed by gcc-generated IL programs
29830         that use RVA data for pointers.
29831
29832 2003-01-25  Martin Baulig  <martin@ximian.com>
29833
29834         * threads.c (start_wrapper): Moved the initialization of
29835         `start_func' above the mono_new_thread_init() call to which we
29836         pass it as argument.
29837
29838 2003-01-24  Martin Baulig  <martin@ximian.com>
29839
29840         * threads.h (MonoThreadCallbacks): Pass the thread ID instead of
29841         the MonoThread pointer.
29842
29843 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
29844
29845         * icall.c: Rename `PowImpl' to Pow.
29846
29847 2003-01-23  Dick Porter  <dick@ximian.com>
29848
29849         * threads.c (start_wrapper): Create a Thread object if needed, so
29850         the Main() thread can do the class initialisation in a subthread
29851         that has been set up to allow managed code execution.
29852
29853         Pass the thread ID instead of the MonoThread pointer to the thread
29854         start and attach callbacks.  This change is required, because the
29855         jit thread start callback must be called _before_ the Thread
29856         object can be created.
29857         
29858         (mono_thread_init): Removed much object creation code that is no
29859         longer needed.  No managed code is called from here now.
29860
29861         * object.c (mono_runtime_exec_managed_code): Create a subthread
29862         for Main, and call back to the runtime to use it.
29863         Set the exit code when Main exits.
29864
29865         * gc.c: Make sure domain finalisation happens in a subthread.
29866         Re-enable threaded GC, fixing bug 31333 (again).
29867
29868         * environment.c: System.Environment internall calls (so far just
29869         ExitCode is here, the others are still in icall.c)
29870
29871         * appdomain.c (mono_runtime_cleanup): All threads running managed
29872         code should have finished before mono_runtime_cleanup() is
29873         reached, so no need to clean up threads.
29874
29875 2003-01-22  Martin Baulig  <martin@ximian.com>
29876
29877         * appdomain.h (MonoThreadStartCB): Added `MonoThread *thread' and
29878         `gpointer func' arguments.      
29879         (MonoThreadAttachCB): New typedef; like the old MonoThreadStartCB,
29880         but added `MonoThread *thread' argument.
29881         (mono_runtime_init): The last argument is now a MonoThreadAttachCB.
29882
29883         * threads.c (mono_new_thread_init): Added `gpointer func' argument
29884         and pass it to the mono_thread_start_cb callback.
29885         (mono_install_thread_callbacks): New public function to install a
29886         set of callbacks which are set by the debugger.
29887         (mono_thread_init): The last argument is now a MonoThreadAttachCB.
29888
29889 2003-01-22  Martin Baulig  <martin@ximian.com>
29890
29891         * Makefile.am: Install debug-mono-symfile.h.
29892
29893 2003-01-21  Aleksey Demakov <avd@openlinksw.com>
29894
29895         * marshal.c: fixed copy_from_managed and copy_to_unmanaged for 0 length.
29896
29897 2003-01-21  Dietmar Maurer  <dietmar@ximian.com>
29898
29899         * added the following fix from Jackson Harper <jackson@latitudegeo.com>
29900         * class.c (mono_ptr_class_get): correctly set access levels of pointers
29901         (mono_array_class_get): correctly set access levels of arrays
29902
29903 2003-01-20      Patrik Torstensson
29904         * image.h (MonoAssemblyName): changed major, minor, build, revision
29905         from signed to unsigned.
29906
29907 2003-01-20  sean kasun <skasun@azstarnet.com>
29908
29909         * reflection.c (load_cattr_value): Now this handles
29910         MONO_TYPE_SZARRAY.  Fixes bug #35629
29911
29912 2003-01-20  Miguel de Icaza  <miguel@ximian.com>
29913
29914         * marshal.c (emit_struct_conv): Handle MONO_TYPE_PTR as an
29915         integer value
29916
29917 2003-01-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29918
29919         * decimal.c: fixed bug #26056.
29920
29921 2003-01-17  Martin Baulig  <martin@ximian.com>
29922
29923         * gc.c: Raise an ExecutionEngineException instead of using g_error().
29924
29925 2003-01-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29926
29927         * exception.[ch]:
29928         (mono_get_exception_type_initialization): new function.
29929
29930         * object.c: throw a TypeInitializationException when an exception is
29931         thrown invoking the class constructor.
29932
29933 2003-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29934
29935         * reflection.c: fixed attribute reading.
29936
29937 2003-01-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29938
29939         * icall.c:
29940         (ves_icall_type_from_name): make it work as MS. Ie, if no assembly name
29941         provided, look for the type in the calling assembly and then in
29942         mscorlib; if the assembly name is provided, only try that one.
29943
29944 Tue Jan 14 14:52:52 CET 2003 Paolo Molaro <lupus@ximian.com>
29945
29946         * object.c: register the vtable before there is a chance it's
29947         queried again recursively.
29948
29949 2003-01-13  Duncan Mak  <duncan@ximian.com>
29950
29951         * Makefile.am (libmonoruntime_la_SOURCES): Change gc.h to
29952         gc-internal.h. 
29953         
29954 2003-01-12  Patrik Torstensson <totte@race-x-change.com>
29955
29956         * string-icall.[c|h], icall.c: Added support for CompareOrdinal mode
29957
29958 2003-01-11  Martin Baulig  <martin@ximian.com>
29959
29960         * debug-mono-symfile.h (MONO_SYMBOL_FILE_DYNAMIC_VERSION): Incremented
29961         this to 20 for the release.
29962
29963 2003-01-10  Dietmar Maurer  <dietmar@ximian.com>
29964
29965         * marshal.c (emit_struct_conv): added support for EXPLICIT_LAYOUT
29966
29967         * loader.c (mono_method_get_marshal_info): bug fix
29968
29969         * marshal.c (mono_marshal_get_ptr_to_struct): don't convert
29970         structures with explicit layout
29971
29972 Fri Jan 10 15:58:09 CET 2003 Paolo Molaro <lupus@ximian.com>
29973
29974         * profiler.c: made the output more readable (and sorted). 
29975         Added caller information for the allocation profiler.
29976
29977 2003-01-09  Sebastien Pouliot  <spouliot@videotron.ca>
29978
29979         * icall.c, rand.c, rand.h: Prepended RNG functions with Internal.
29980
29981 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29982
29983         * icall.c: added ves_icall_System_Activator_CreateInstanceInternal. Used
29984         to get value types.
29985         
29986 Thu Jan 9 19:43:11 CET 2003 Paolo Molaro <lupus@ximian.com>
29987
29988         * object.c, profiler.h, profiler.c, profiler-private.h:
29989         Added object allocation profiler.
29990
29991 Thu Jan 9 16:17:00 CET 2003 Paolo Molaro <lupus@ximian.com>
29992
29993         * reflection.h, reflection.c: handle global methods.
29994         Compress blob entries.
29995
29996 Thu Jan 9 15:54:53 CET 2003 Paolo Molaro <lupus@ximian.com>
29997
29998         * marshal.c: fix compilation.
29999
30000 2003-01-09  Dietmar Maurer  <dietmar@ximian.com>
30001
30002         * loader.c (mono_method_get_marshal_info): impl.
30003
30004         * metadata.c (mono_metadata_field_info): use mono_metadata_get_marshal_info
30005
30006 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30007
30008         * icall.c: applied fix from Zoltan Varga that fixes Type.IsPrimitive
30009         for reference types.
30010
30011 Wed Jan 8 20:11:46 CET 2003 Paolo Molaro <lupus@ximian.com>
30012
30013         * loader.c: fixed off by one error in loaded parameter names.
30014
30015 2003-01-08  Dietmar Maurer  <dietmar@ximian.com>
30016
30017         * marshal.c (mono_marshal_get_icall_wrapper): like
30018         mono_marshal_get_native_wrapper, but simpler and use a MonoMethodSignature
30019         instead of a MonoMethod.
30020
30021 2003-01-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30022
30023         * decimal.c: fixed bug #36537.
30024
30025 Mon Jan 6 19:37:59 CET 2003 Paolo Molaro <lupus@ximian.com>
30026
30027         * marshal.c: throw a missing method exception if a
30028         P/Invoke method is not found.
30029
30030 Sun Jan 5 11:57:09 CET 2003 Paolo Molaro <lupus@ximian.com>
30031
30032         * icall.c: allow a null this for constructors.
30033
30034 Sat Jan 4 18:28:42 CET 2003 Paolo Molaro <lupus@ximian.com>
30035
30036         * icall.c: raise the proper exceptions if the arguments to the
30037         internal Invoke are incorrect.
30038
30039 2003-01-03  Dietmar Maurer  <dietmar@ximian.com>
30040
30041         * marshal.c (mono_marshal_get_ptr_to_struct): code cleanups
30042
30043 2003-01-03  Martin Baulig  <martin@ximian.com>
30044
30045         * debug-mono-symfile.h: Increment MONO_SYMBOL_FILE_DYNAMIC_VERSION.
30046
30047 2002-12-31  Martin Baulig  <martin@ximian.com>
30048
30049         * debug-mono-symfile.c: Completely rewrote the type section.
30050         Instead of using individual malloc()ed fields, we use one big
30051         continuous memory area and offsets into this area.
30052         See the comments in the source code for details.
30053
30054 2002-12-30  Martin Baulig  <martin@ximian.com>
30055
30056         * debug-mono-symfile.h (MonoDebugTypeInfo): Renamed to MonoDebugClassInfo.
30057
30058 2002-12-30  Martin Baulig  <martin@ximian.com>
30059
30060         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Include the
30061         line number table in this data blob instead of using an external
30062         pointer.
30063
30064 2002-12-28  Martin Baulig  <martin@ximian.com>
30065
30066         * debug-mono-symfile.h: Increment MONO_SYMBOL_FILE_DYNAMIC_VERSION.
30067
30068 2002-12-22  Rachel Hestilow  <hestilow@ximian.com>
30069
30070         * marshal.c (mono_marshal_get_runtime_invoke): Support MONO_TYPE_CHAR
30071         as a boxed return type.
30072
30073 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
30074
30075         * appdomain.c
30076         (ves_icall_System_AppDomainSetup_InitAppDomainSetup): Use
30077         g_build_filename to properly get separators on the filename created.
30078
30079         * object.h: Small change, introduce MonoMarshalByRefObject to
30080         track the layout of that structure in the C# universe as we make
30081         changes there.
30082
30083 Thu Dec 19 16:23:19 CET 2002 Paolo Molaro <lupus@ximian.com>
30084
30085         * object.c: removed assert to allow static fields on interfaces.
30086         * loader.c: a TypeSpec may be used for any type, not just arrays.
30087
30088 Thu Dec 19 14:19:42 CET 2002 Paolo Molaro <lupus@ximian.com>
30089
30090         * class.c, class.h: added mono_class_array_element_size ().
30091         Ignore static methods in interfaces.
30092
30093 2002-12-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30094
30095         * threads.c: fixed the build under cygwin.
30096
30097 Wed Dec 18 18:43:47 CET 2002 Paolo Molaro <lupus@ximian.com>
30098
30099         * reflection.c: handle nullref constants. Allocate keys for
30100         reflection handles with the GC.
30101
30102 Wed Dec 18 11:34:18 CET 2002 Paolo Molaro <lupus@ximian.com>
30103
30104         * threads.c, threads.h: added mono_thread_get_abort_signal()
30105         to get a suitable signal for thread abort.
30106
30107 Wed Dec 18 11:26:18 CET 2002 Paolo Molaro <lupus@ximian.com>
30108
30109         * metadata.c: fix handling of ExportedType table.
30110
30111 2002-12-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30112
30113         * icall.c: added WriteWindowsDebugString internal call.
30114
30115 2002-12-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30116
30117         * reflection.h: added fields to match C# implementation.
30118
30119 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30120
30121         * icall.c: patch from Jaroslaw Kowalski to fix Environment.MachineName.
30122
30123 2002-12-12  Juli Mallett  <jmallett@FreeBSD.org>
30124
30125         * gc.h, gc-internal.h: Rename header for GC internal calls to
30126         gc-internal.h from gc.h as to not clash with Boehm GC having its
30127         header installed as <gc.h> in outside include paths.
30128         * appdomain.c, gc.c, icall.c, object.c: Account for aforementioned.
30129         * threads.c: If SIGRTMIN is not defined, fall back to SIGUSR1.
30130
30131 2002-12-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30132
30133         * icall.c: assign minor, build and revision in FillName.
30134
30135 2002-12-11  Zoltan Varga  <vargaz@freemail.hu>
30136
30137         * image.h reflection.h reflection.c class.h class.c loader.c object.c:
30138         Added support for running code generated by Reflection.Emit.
30139
30140 2002-12-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30141
30142         * appdomain.c: check for NULL argument in LoadFrom.
30143
30144 2002-12-10  Dick Porter  <dick@ximian.com>
30145
30146         * threads.c: WaitHandle fixes from Tum <tum@veridicus.com>
30147
30148 2002-12-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30149
30150         * appdomain.c: fix buglet when building exe file name.  Handle full
30151         assembly name (needed after latest changes to AssemblyName).
30152         * image.c:
30153         (mono_image_close): free some hashtables.
30154
30155 2002-12-05  Dietmar Maurer  <dietmar@ximian.com>
30156
30157         * threads.c (ves_icall_System_Threading_Thread_Abort): we use SIGRTMIN 
30158         instead of SIGUSR1, because SIGUSR1 is used by the pthread implementation 
30159         on some systems (redhat 7.3) 
30160
30161 Thu Dec 5 16:13:40 CET 2002 Paolo Molaro <lupus@ximian.com>
30162
30163         * threads.c: delete the critical section of a sync block,
30164         spotted and fixed by tum@veridicus.com (Thong (Tum) Nguyen).
30165
30166 Thu Dec 5 12:52:52 CET 2002 Paolo Molaro <lupus@ximian.com>
30167
30168         * pedump.c, cil-coff.h, monosn.c: add strong name cli header flag.
30169
30170 2002-12-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30171
30172         * appdomain.[ch]: handle the assembly preload event to try loading the
30173         assemblies using the paths we have in the current domain.
30174
30175         * assembly.[ch]: created an assembly preload hook that is called to try
30176         loading the assembly by other means that the ones provided here.
30177
30178         * domain.c: initialize the domain search path.
30179
30180         From now on, assemblies (TODO: except corlib and System) are loaded
30181         according to these rules when using mono_assembly_load ():
30182
30183                 1. It tries to load the assembly from the ApplicationBase
30184                 of the current domain appending .dll and .exe (TODO: have to
30185                 try loading from name/name.dll and name/name.exe).
30186
30187                 2. It tries the search path specified in PrivateBinPath for the
30188                 current domain (if any).
30189
30190                 3. Previous behavior.
30191
30192 Wed Dec 4 16:02:25 CET 2002 Paolo Molaro <lupus@ximian.com>
30193
30194         * icall.c: implemented GetInterfaceMap() related icall.
30195         * domain.c, loader.h: load MethodInfo in mono_defaults.
30196
30197 Wed Dec 4 11:02:30 CET 2002 Paolo Molaro <lupus@ximian.com>
30198
30199         * gc.c: disable the finalizer thread for now, untill all the issues
30200         with it are resolved.
30201
30202 Wed Dec 4 10:44:01 CET 2002 Paolo Molaro <lupus@ximian.com>
30203
30204         * string-icalls.c: handle embedded nulls in string ctor when the
30205         length is specified.
30206
30207 Tue Dec 3 19:29:20 CET 2002 Paolo Molaro <lupus@ximian.com>
30208
30209         * class.c: look for explicit interface implementation in parent
30210         classes, too.
30211
30212 2002-12-03  Dietmar Maurer  <dietmar@ximian.com>
30213
30214         * gc.c (run_finalize): dont run the finalizer (strange behaviour on rh7.3) 
30215
30216 Tue Dec 3 12:40:06 CET 2002 Paolo Molaro <lupus@ximian.com>
30217
30218         * gc.c: protect handles with a critical section.
30219
30220 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30221
30222         * icall.c:
30223         (ves_icall_type_from_name): it now has throwOnError and ignoreCase
30224         parameters. If no assembly specified, try getting the type from all
30225         the assemblies in the current domain, else, load the assembly and get
30226         the type from it.
30227
30228 2002-11-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30229
30230         * marshal.c: applied patch from Aleksey Demakov that fixes
30231         ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringUni.
30232
30233 2002-11-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30234
30235         * icall.c: fixed get_location.
30236
30237 2002-11-28  Dietmar Maurer  <dietmar@ximian.com>
30238
30239         * icall.c: moved MONO_ARCH_SAVE_REGS to the end of the
30240         declarations to make it work with older gcc. 
30241
30242         * loader.c (mono_get_method): set signature->pinvoke for native calls
30243
30244 2002-11-20  Dick Porter  <dick@ximian.com>
30245
30246         * threads.c (mono_thread_init): Set the main thread's handle
30247
30248 Tue Nov 19 14:15:34 CET 2002 Paolo Molaro <lupus@ximian.com>
30249
30250         * gc.c: allow compilation without GC support. Changed to match the
30251         mono coding style.
30252
30253 Mon Nov 18 18:41:51 CET 2002 Paolo Molaro <lupus@ximian.com>
30254
30255         * gc.c: don't start the finalizer thread if the env var GC_DONT_GC is set.
30256
30257 Mon Nov 18 16:35:22 CET 2002 Paolo Molaro <lupus@ximian.com>
30258
30259         * reflection.c: set a public key token on the core assemblies.
30260
30261 2002-11-18  Dick Porter  <dick@ximian.com>
30262
30263         * threads.c: Split out some thread initialisation so that other
30264         files can set the start callback function.
30265
30266         * gc.c: Run finalisers in a separate thread, to avoid stack
30267         overflow.  Fixes bug 31333.
30268
30269         * appdomain.c: Set up GC finalisation thread.
30270
30271         * reflection.c: 
30272         * object.c: 
30273         * domain.c: Use gc.h macros for GC_malloc
30274         
30275 2002-11-15  Dick Porter  <dick@ximian.com>
30276
30277         * threadpool.c: 
30278         * threads.c:
30279         * appdomain.c: Removed mono_runtime_init_with_attach(),
30280         mono_thread_create_arg(), and mono_thread_init_with_attach(), by
30281         merging the extra parameter with the existing function.  Removed
30282         unneeded code in mono_thread_attach().
30283
30284 2002-11-14  Dietmar Maurer  <dietmar@ximian.com>
30285
30286         * image.c (mono_image_loaded_by_guid): a method to get loaded
30287         images by guid. 
30288         (load_metadata_ptrs): we store the guid as string.
30289
30290 2002-11-11  Dietmar Maurer  <dietmar@ximian.com>
30291
30292         * assembly.c (mono_assembly_open): check the guid of aot compiled lib.
30293
30294         * metadata.c (mono_guid_to_string): imported method form Zoltan
30295         Varga (slightly modified)
30296
30297         * assembly.c (mono_assembly_open): load precompiled code
30298
30299         * loader.h (MonoMethod): we store the method token for use in the
30300         aot compiler. 
30301
30302 2002-11-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30303
30304         * appdomain.c: insert the loaded assemblies in the domain->assemblies in
30305         the hook function called when an assembly is loaded.
30306         
30307         * domain.c: Modified file.
30308         (mono_domain_assembly_load): removed hash table insertion of assemblies.
30309
30310         Fixes bug #33196.
30311
30312 2002-11-07  Miguel de Icaza  <miguel@ximian.com>
30313
30314         * reflection.c: Map PEFileKind to the value expected by the WinNT
30315         image loader. 
30316
30317 2002-11-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30318
30319         * rand.c: use /dev/urandom. If it fails to open, use the previous one.
30320         Read until the buffer is filled completely.
30321
30322 2002-11-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30323
30324         * icall.c: implemented MonoType.InternalGetEvent ().
30325
30326 2002-11-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30327
30328         * appdomain.c: implemented InitAppDomainSetup. Delayed
30329         AppDomain.SetupInformation until mono_runtime_exec_main, where we get
30330         the entry_assembly.
30331
30332         * assembly.c: base_dir is now an absolute path ending with
30333         G_DIR_SEPARATOR.
30334
30335         * icall.c: modified get_location according to the above changes.
30336
30337         * object.c: init AppDomain.SetupInformation for the default domain after
30338         we have the entry assembly.
30339
30340         * domain.c: when unloading a domain, setup = NULL.
30341
30342 2002-11-04  Dietmar Maurer  <dietmar@ximian.com>
30343
30344         * marshal.c (emit_ptr_to_str_conv): try to fix bug 29548
30345
30346 Sun Nov 3 15:39:28 CET 2002 Paolo Molaro <lupus@ximian.com>
30347
30348         * object.h, object.c: introduced mono_object_get_virtual_method ()
30349         to lookup the method invoked on an object when a callvirt is done on
30350         a method.
30351         * icall.c: make MethodInfo::Invoke() always do a virtual call.
30352
30353 2002-11-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30354
30355         * appdomain.c: invoke AssemblyLoad and AsemblyResolve events in the
30356         current domain when loaded an assembly and failed to load it.
30357
30358         * icall.c: changed ...Assembly_GetType to Assembly_InternalGetType.
30359
30360 2002-10-31  Dick Porter  <dick@ximian.com>
30361
30362         * icall.c: 
30363         * file-io.h: 
30364         * file-io.c: Return the error status in a parameter, as the
30365         GetLastError() value has long since been blown away if we try and
30366         look it up in a subsequent internal call invocation.  Delete the
30367         GetLastError() internal call, because it's useless.
30368
30369 2002-10-31  Dietmar Maurer  <dietmar@ximian.com>
30370
30371         * class.[ch]: added cast_class to fix bug 29517
30372
30373 Wed Oct 30 19:37:32 CET 2002 Paolo Molaro <lupus@ximian.com>
30374
30375         * marshal.c: create valid IL code in the filter clause:
30376         the new JIT is less forgiving:-)
30377
30378 2002-10-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30379
30380         * icall.c: removed get_property internal call.
30381
30382 2002-10-25  Zoltan Varga  <vargaz@freemail.hu>
30383
30384         * appdomain.h domain.c: Added an ID to appdomains.
30385         
30386         * threads.c threads.h icall.c: Implement icall
30387         Thread:GetDomainID(), and remove unused icall 
30388         CurrentThreadDomain_internal.
30389
30390 2002-10-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30391
30392         * icall.c: Don't recurse through the base types in GetConstructor.
30393         Fixes bug #32063. 
30394
30395 Thu Oct 24 16:56:00 CEST 2002 Paolo Molaro <lupus@ximian.com>
30396
30397         * mempool.h, mempool.c: added mono_mempool_empty() and
30398         mono_mempool_stats().
30399
30400 2002-10-23  Dick Porter  <dick@ximian.com>
30401
30402         * file-io.c: 
30403         * file-io.h: 
30404         * icall.c: Added MonoIO.GetFileType internal call
30405
30406 2002-10-17  Dick Porter  <dick@ximian.com>
30407
30408         * appdomain.c (mono_runtime_cleanup): Don't signal the async
30409         delegate semaphore before waiting for all threads to finish,
30410         because new threads can also call async delegates.  Fixes bug
30411         32004.
30412
30413         * threadpool.c (async_invoke_thread): Only wait for 500ms instead
30414         of 3 seconds, in case another async job is queued.  (This part is
30415         needed because the bug fix reintroduced the 3s exit lag.)  This
30416         makes the mono_runtime_shutdown flag superfluous.
30417
30418 Thu Oct 17 13:11:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
30419
30420         * reflection.c: include ehader size in method section headers.
30421         Really check for suplicated modules entries.
30422
30423 2002-10-17  Martin Baulig  <martin@gnome.org>
30424
30425         * debug-mono-symfile.c: Added back support for locals.
30426
30427 2002-10-14  Martin Baulig  <martin@gnome.org>
30428
30429         * debug-mono-symfile.c: Added MONO_TYPE_I, MONO_TYPE_U and
30430         MONO_TYPE_VOID.
30431
30432 2002-10-14  Martin Baulig  <martin@gnome.org>
30433
30434         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetType): Use
30435         mono_class_get() instead of looking in the class cache. 
30436
30437 2002-10-13  Martin Baulig  <martin@gnome.org>
30438
30439         * debug-mono-symfile.c: Set version number to 28, include the
30440         signature in method names.
30441
30442 2002-10-13  Martin Baulig  <martin@gnome.org>
30443
30444         * debug-mono-symfile.h: Set version number to 27.
30445
30446 2002-10-11  Martin Baulig  <martin@gnome.org>
30447
30448         * gc.c: Don't register/unregister NULL pointers as disappearing links.
30449
30450 Thu Oct 10 14:56:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
30451
30452         * metadata.c, metadata.h: added helper function to allocate signatures.
30453
30454 2002-10-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30455
30456         * icall.c: added internal call to get the location of machine.config.
30457
30458 2002-10-08  Martin Baulig  <martin@gnome.org>
30459
30460         * debug-mono-symfile.c: Ignore classes with a pending init for the
30461         moment.
30462
30463 2002-10-03  Dick Porter  <dick@ximian.com>
30464
30465         * threads.c: Freebsd pthread_t is a pointer
30466
30467 2002-10-03  Dick Porter  <dick@ximian.com>
30468
30469         * socket-io.c: Implemented GetHostName_internal
30470
30471 2002-10-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30472
30473         * mono-config.c:
30474         (mono_config_parse_file): don't leak the text.
30475
30476 2002-10-02  Martin Baulig  <martin@gnome.org>
30477
30478         * debug-mono-symfile.c: Added support for methods.
30479
30480 2002-10-01  Martin Baulig  <martin@gnome.org>
30481
30482         * debug-mono-symfile.c: Don't emit methods and line numbers for
30483         the dynamic symbol file, just write the type table.  We can easily
30484         have an external helper program which creates a symbol file for an
30485         IL file.        
30486
30487 2002-10-01  Dick Porter  <dick@ximian.com>
30488
30489         * threads.c (ves_icall_System_Threading_Thread_Start_internal):
30490         Only add the handle to the cleanup array when we're about to
30491         launch the thread.  Bug 31425 deadlocked when the test was run on
30492         mono under w32.
30493
30494 2002-10-01  Martin Baulig  <martin@gnome.org>
30495
30496         * debug-mono-symfile.c: Added support for properties.
30497
30498 Fri Sep 27 18:55:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
30499
30500         * reflection.c: unaligned store fix from Mark Crichton
30501         <crichton@gimp.org>.
30502
30503 2002-09-27  Martin Baulig  <martin@gnome.org>
30504
30505         * icall.c ("System.Reflection.Assembly::GetReferencedAssemblies"):
30506         New interncall.
30507
30508 Fri Sep 27 15:38:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
30509
30510         * assembly.h, assembly.c: use a sane API to hook into the assembly
30511         loading process instead of a useless special-purpouse hack
30512         (ngen needs a hook, too, for example).
30513
30514 2002-09-27  Dick Porter  <dick@ximian.com>
30515
30516         * threads.c (mono_thread_init): Call GetCurrentProcess() so
30517         io-layer can set up some process handle info.  Not needed on w32,
30518         but doesn't hurt either.
30519
30520         * process.c: Pass the program name in the second parameter to
30521         CreateProcess, so the path is searched.  Include the working
30522         directory. Implemented process name, process enumeration, and some
30523         process detail internal calls.
30524         
30525         * icall.c: Added internal calls for process lookup, and some
30526         process details
30527
30528 2002-09-26  Martin Baulig  <martin@gnome.org>
30529
30530         * assembly.c (mono_install_open_assembly_hook): New global
30531         function to install a function to be invoked each time a new
30532         assembly is loaded.
30533         (mono_assembly_open): Run this callback function if set.
30534
30535         * debug-mono-symfile.c: Put back line numbers for the dynamic
30536         symbol file and also record the .il file as source file.  This
30537         allows us to install the temporary symbol file as `file.dbg' just
30538         like a compiler-generated one.
30539
30540 2002-09-26  Nick Zigarovich <nick@chemlab.org>
30541
30542         * Corrected typo in gc.c (BOHEM vs BOEHM).
30543
30544 2002-09-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30545
30546         * icall.c: fixed bug #31235 by copying a few lines from GetMethods to
30547         GetProperties. Also avoid calling g_slist_length in GetProperties and
30548         GetMethods.
30549
30550 Wed Sep 25 22:18:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
30551
30552         * reflection.c: avoid unaligned stores (bug spotted by
30553         Mark Crichton  <crichton@gimp.org>).
30554
30555 2002-09-25  Martin Baulig  <martin@gnome.org>
30556
30557         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Use pointers
30558         instead of guint64 for addresses and added prologue/epilogue info.
30559
30560 2002-09-25  Martin Baulig  <martin@gnome.org>
30561
30562         * debug-mono-symfile.h (MonoDebugLineNumberEntry): New type to
30563         store line number info.  For the dynamic symbol file, we only need
30564         to provide the JIT generated dynamic line number info for the dynamic
30565         symbol file.
30566
30567 2002-09-25  Martin Baulig  <martin@gnome.org>
30568
30569         * debug-mono-symfile.h: Incremented version number.
30570
30571 2002-09-24  Martin Baulig  <martin@gnome.org>
30572
30573         * class.c (mono_debugger_class_init_func): New global function
30574         pointer variable.
30575         (mono_class_init): If mono_debugger_class_init_func is non-NULL,
30576         call it.
30577
30578         * debug-mono-symfile.c (mono_debug_symfile_add_type): New
30579         function.  This is called via the mono_debugger_class_init_func
30580         hook to add all types to the dynamic type table.
30581         (ves_icall_MonoDebugger_GetType): New interncall to get a class
30582         from its metadata token.
30583
30584         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetType"):
30585         New interncall for the debugger.
30586
30587 2002-09-24  Nick Drochak <ndrochak@gol.com>
30588
30589         * icall.c (ves_icall_System_Enum_ToObject): validate the type parameter
30590         before using it in case it is null.
30591         
30592 Tue Sep 24 13:24:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
30593
30594         * metadata.c: allow custom modifiers in local var signatures
30595         (bug spotted by Zoltan Varga).
30596
30597 Tue Sep 24 12:12:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
30598
30599         * class.c: deal with the <Module> class that may have a NULL vtable.
30600         Eliminate warnings.
30601
30602 Tue Sep 24 11:28:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
30603
30604         * image.c, image.h: more strong name helpers.
30605         * monosn.c: more work: convert pem keys to cryptoapi format.
30606
30607 Tue Sep 24 11:27:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
30608
30609         * string-icalls.c: speedup IndexOf.
30610
30611 Tue Sep 24 11:17:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
30612
30613         * icall.c: updates from Zoltan.2.Varga@nokia.com.
30614
30615 Tue Sep 24 11:09:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
30616
30617         * icall.c: cleanup: use mono_object_domain ().
30618
30619 2002-09-23  Martin Baulig  <martin@gnome.org>
30620
30621         * debug-mono-symfile.c: Improved type support.
30622
30623 2002-09-22  Martin Baulig  <martin@gnome.org>
30624
30625         * debug-mono-symfile.c: Added support for reference types and strings.
30626
30627 2002-09-22  Martin Baulig  <martin@gnome.org>
30628
30629         * debug-mono-symfile.c: Started to work on the type table.
30630
30631 2002-09-21  Martin Baulig  <martin@gnome.org>
30632
30633         * debug-mono-symfile.c: Largely reworked the symbol table format.
30634         The symbol table is now incrementally updated each time a new
30635         method is added.  We're now also using our own magic and version
30636         so that you don't need to recompile all your classes if the
30637         dynamic table changes.
30638         (mono_debug_update_mono_symbol_file): Removed.
30639         (mono_debug_symfile_add_method): New function to add a method.
30640
30641 2002-09-21  Martin Baulig  <martin@gnome.org>
30642
30643         * icall.c
30644         ("System.Reflection.Assembly::MonoDebugger_GetLocalTypeFromSignature"):
30645         New interncall.
30646
30647         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetLocalTypeFromSignature):
30648         New interncall to get a method from its metadata token.
30649
30650 2002-09-21  Martin Baulig  <martin@gnome.org>
30651
30652         * debug-mono-symfile.c: Create type table.
30653
30654 2002-09-20  Martin Baulig  <martin@gnome.org>
30655
30656         * debug-mono-symfile.c: Reflect latest Mono.CSharp.Debugger changes.
30657
30658 2002-09-20  Martin Baulig  <martin@gnome.org>
30659
30660         * debug-mono-symfile.c: Provide information about params and locals.
30661
30662 2002-09-20  Martin Baulig  <martin@gnome.org>
30663
30664         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetMethod"):
30665         New interncall.
30666
30667         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetMethod): New
30668         interncall to get a method from its metadata token.
30669
30670 2002-09-20  Martin Baulig  <martin@gnome.org>
30671
30672         * debug-mono-symfile.c: Added a few checks for method->header
30673         being non-NULL.  This should never happen, but for the moment
30674         let's use a g_warning() rather than a g_assert().
30675
30676 2002-09-19  Mark Crichton  <crichton@gimp.org>
30677
30678         * gc.c: ves_icall_System_GCHandle_FreeHandle made a call to libgc
30679         even if support for it isn't present.  Added an #ifdef to fix this.
30680
30681         * socket-io.c: Added checks back for Solaris support.
30682
30683 2002-09-19  Martin Baulig  <martin@gnome.org>
30684
30685         * debug-mono-symfile.c (read_string, write_string): Reflect latest
30686         changes in the symbol file format.
30687
30688 2002-09-18  Martin Baulig  <martin@gnome.org>
30689
30690         * debug-mono-symfile.c: Set version number to 21.
30691
30692 2002-09-18  Dick Porter  <dick@ximian.com>
30693
30694         * threads.c (mon_new): Use the GC_MALLOC macro to hide differences
30695         on netbsd.  Fixes bug 30051.
30696
30697 2002-09-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30698
30699         * reflection.c:
30700         (set_version_from_string): little fix.
30701
30702 Mon Sep 16 18:57:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
30703
30704         * monosn.c, Makefile.am: added strong name utility.
30705         * reflection.h, reflection.c: implemented delayed signing,
30706         locale, version and hash id assembly attributes.
30707
30708 Mon Sep 16 18:51:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
30709
30710         * loader.c, metadata.c: load param attributes in signatures.
30711
30712 2002-09-16  Martin Baulig  <martin@gnome.org>
30713
30714         * debug-mono-symfile.c: Added string table with all method names.
30715
30716 2002-09-14  Martin Baulig  <martin@gnome.org>
30717
30718         * debug-mono-symfile.h (MonoSymbolFile): Added method range table for
30719         fast method lookup.
30720
30721 Fri Sep 13 16:04:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
30722
30723         * reflection.c: record the public key token of referenced assemblies.
30724
30725 Fri Sep 13 15:41:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
30726
30727         * image.c, image.h: added functions to get the strong name and the
30728         public key of an assembly.
30729         * pedump.c: use them.
30730
30731 2002-09-12  Dietmar Maurer  <dietmar@ximian.com>
30732
30733         * marshal.c (emit_str_to_ptr_conv): support marshalling of delegates.
30734
30735 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
30736
30737         * marshal.c (mono_marshal_get_managed_wrapper): Added
30738         MONO_TYPE_BOOLEAN 
30739
30740 2002-09-11  Martin Baulig  <martin@gnome.org>
30741
30742         * gc.c: Call GC_unregister_disappearing_link() on all links when
30743         finalizing them, this is necessary to aviod a crash in boehm's
30744         finalize handler.
30745
30746 Wed Sep 11 17:06:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
30747
30748         * gc.c: handle GetTarget for finalized objects spotted and fixed by
30749         nick@chemlab.org.
30750
30751 Wed Sep 11 15:27:20 CEST 2002 Paolo Molaro <lupus@ximian.com>
30752
30753         * icall.c: implemented MonoType::Module.
30754         * reflection.c, reflection.h: mono_module_get_object () from
30755         Tomi Pakarinen <tomi.pakarinen@welho.com>.
30756
30757 Wed Sep 11 12:53:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
30758
30759         * icall.c: ignore overridden methods in GetMethods ().
30760         Fix for FieldInfo::SetValue().
30761         * object.c: handle float/double in runtime invoke.
30762
30763 Tue Sep 10 15:51:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
30764
30765         * object.c: allow a constructor to be called again on an object.
30766
30767 Tue Sep 10 11:58:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
30768
30769         * class.h, class.c: move field layout code to it's own function and
30770         export it. Get an interface id earlier. Move fields in MonoClass
30771         so they are more cache friendly and align the bitfields.
30772         * loader.c: temporary handle get_param_names() for a runtime method.
30773         * reflection.c, reflection.h: more code to handle runtime creation of
30774         types.
30775
30776 2002-09-09  Martin Baulig  <martin@gnome.org>
30777
30778         * marshal.c (mono_marshal_get_native_wrapper): We need to use a special
30779         signature with the pinvoke field being set for the actual call.
30780
30781 Sat Sep 7 10:12:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
30782
30783         * icall.c: removed some unused icalls. Start of map of glib charsets
30784         to corlib names. Implemented RuntimeMethod::GetFunctionPointer ().
30785
30786 Fri Sep 6 16:08:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
30787
30788         * debug-helpers.c: break infinite loop (found and fixed by
30789         Holger Arnold <harnold@gmx.de>).
30790
30791 Thu Sep 5 18:50:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
30792
30793         * icall.c: target may be null in create_delegate.
30794
30795 Thu Sep 5 17:42:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
30796
30797         * marshal.c: handle a boolean return type.
30798
30799 Thu Sep 5 13:09:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
30800
30801         * gc.c: put HIDE_POINTER/REVEAL_POINTER only here.
30802
30803 Wed Sep 4 19:23:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
30804
30805         * gc.c: fix weakreferences.
30806
30807 Wed Sep 4 13:59:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
30808
30809         * icall.c: added icall to get default codepage.
30810
30811 2002-09-03  Dick Porter  <dick@ximian.com>
30812
30813         * threads.h: 
30814         * threads.c: Use MonoThread instead of MonoObject where
30815         apropriate.
30816
30817         Store running thread objects in a hash table, so that we have all
30818         the info to hand when waiting for them to finish
30819         (means we don't need OpenThread() any more, so mingw builds should
30820         be fully functional again.)
30821
30822         * verify.c:
30823         * object.h: Added thread ID to MonoThread
30824
30825 2002-09-03  Martin Baulig  <martin@gnome.org>
30826
30827         * icall.c (System.Reflection.Assembly::get_location): New interncall.
30828
30829 2002-09-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30830
30831         * icall.c: fixed leak in get_temp_path. Thanks lupus.
30832
30833 2002-09-03  Martin Baulig  <martin@gnome.org>
30834
30835         * debug-helpers.c (mono_disasm_code_one): Added `const guchar **endp'
30836         argument to store the end address of the disassembled instruction.
30837
30838         * debug-mono-symfile.h (MonoDebugMethodInfo, MonoDebugVarInfo): Moved
30839         here from debug-symfile.h.
30840         (MonoDebugMethodJitInfo): Moved all fields which are filled out by the
30841         JIT into this struct.
30842         (MonoSymbolFile): Added `char *image_file' field.
30843         (MonoDebugGetMethodFunc): Removed.
30844         (mono_debug_update_mono_symbol_file): Removed the hash table argument.
30845         (mono_debug_create_mono_symbol_file): Removed the `source_file' argument.
30846         (mono_debug_find_method): New method.
30847
30848         * debug-mono-symfile.c (mono_debug_create_mono_symbol_file): Always
30849         create a full symbol file.
30850         (mono_debug_update_mono_symbol_file): Don't distinguish between dynamic
30851         and static symbol files.
30852         (mono_debug_find_method): The symbol file keeps an internal method hash,
30853         call this to get a MonoDebugMethodInfo from a MonoMethod.
30854
30855         * debug-symfile.[ch]: Removed.
30856
30857 2002-08-29  Miguel de Icaza  <miguel@ximian.com>
30858
30859         * image.c (do_mono_image_open): Remove linker version check.
30860
30861 2002-08-29  Dietmar Maurer  <dietmar@ximian.com>
30862
30863         * marshal.c (mono_marshal_get_managed_wrapper): don't cache
30864         wrappers for instance methods.
30865         
30866 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30867
30868         * icall.c: added ves_icall_System_IO_Path_get_temp_path.
30869
30870 2002-08-28  Dick Porter  <dick@ximian.com>
30871
30872         * Makefile.am: Export HOST_CC for w32 builds
30873
30874 Tue Aug 27 18:34:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
30875
30876         * file-io.c process.c: MonoString are null terminated, no
30877         need for mono_string_to_utf16() anymore.
30878
30879 Tue Aug 27 17:51:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
30880
30881         * icall.c, unicode.h, unicode.c: removed unused iconv stuff.
30882
30883 Tue Aug 27 16:38:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
30884
30885         * icall.c, reflection.h: speedup System.MonoType.
30886
30887 Tue Aug 27 16:37:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
30888
30889         * reflection.c: allow null as the value of a string argument in
30890         custom attributes constructors.
30891
30892 2002-08-27  Martin Baulig  <martin@gnome.org>
30893
30894         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Removed the
30895         `trampoline_address' field.
30896
30897 2002-08-27  Dietmar Maurer  <dietmar@ximian.com>
30898
30899         * marshal.c (mono_marshal_get_native_wrapper): removed wrong null
30900         check (fixes bug #29486) 
30901
30902 2002-08-27  Martin Baulig  <martin@gnome.org>
30903
30904         * debug-mono-symfile.c: Changed the file format in a way that allows us
30905         open it read-only and to use a specially malloced area for all the
30906         dynamic data.  We can now also generate a symbol file on-the-fly if we're
30907         debugging IL code and there is no MCS generated symbol file for it.
30908
30909 Mon Aug 26 16:47:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
30910
30911         * object.c: added a define for a good string and array
30912         creation speedup (not enabled by default because we need to deal with
30913         the synch stuff).
30914
30915 2002-08-26  Martin Baulig  <martin@gnome.org>
30916
30917         * debug-mono-symfile.c (mono_debug_create_mono_symbol_file): New
30918         function to create a dynamic symbol file.  This is used by the
30919         debugger to create a symbol file for IL code on-the-fly.
30920
30921 2002-08-26  Martin Baulig  <martin@gnome.org>
30922
30923         * loader.c (mono_lookup_pinvoke_call): Include the error message
30924         from g_module_error() in the error message.
30925
30926 2002-08-24  Martin Baulig  <martin@gnome.org>
30927
30928         * debug-mono-symfile.c (mono_debug_update_mono_symbol_file): New
30929         function to update the symbol file.  The symbol file is mmap()ed
30930         writable, but private.  This allows us to install the symbol file
30931         together with the assembly.
30932
30933 2002-08-24  Martin Baulig  <martin@gnome.org>
30934
30935         * debug-mono-symfile.[ch]: New files.  Similar to debug-symfile.[ch]
30936         but they can read the new symbol file format which mcs is now creating.
30937
30938         * debug-symfile.c (mono_debug_find_source_location): Moved to
30939         debug-mono-symfile.c; this is now operating on the new symbol file.
30940
30941 2002-08-23  Martin Baulig  <martin@gnome.org>
30942
30943         * debug-helpers.c (mono_method_desc_from_method): New function to get
30944         a MonoMethodDesc from a MonoMethod.
30945
30946 Fri Aug 23 15:54:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
30947
30948         * object.c: fixes assertion failure caused by multiple ExecuteAssembly
30949         calls for same domain (patch by Tomi Pakarinen <Tomi.Pakarinen@iki.fi>).
30950
30951 Fri Aug 23 12:14:45 CEST 2002 Paolo Molaro <lupus@ximian.com>
30952
30953         * string-icalls.[ch]: make helper methods static.
30954
30955 2002-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30956
30957         * icall.c: re-applied patch to GetValueInternal. Also added R4 and R8
30958         types to it and to SetValueInternal.
30959
30960         * object.c: Moved handle_enum label to its proper place. This was the
30961         f... bug! ;-)
30962
30963         This time i compiled mcs and gtk-sharp and they both work.
30964
30965 2002-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30966
30967         * icall.c: reverted partially my previous patch until 
30968         object.c:set_value handles enums correcly.
30969
30970 2002-08-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30971
30972         * icall.c:
30973         (ves_icall_MonoField_GetValue): changed to use mono_field_get_value.
30974         (ves_icall_System_Environment_get_MachineName): removed warning when
30975         compiling under cygwin.
30976
30977 Thu Aug 22 18:49:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
30978
30979         * object.c: fixed field_get_value() for reference types.
30980
30981 2002-08-22  Dick Porter  <dick@ximian.com>
30982
30983         * socket-io.c (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal):
30984         Don't free a buffer while it's still needed.  Patch from Jonathan
30985         Liger <Jonathan.liger@wanadoo.fr>
30986
30987 2002-08-21  Miguel de Icaza  <miguel@ximian.com>
30988
30989         * icall.c (ves_icall_System_Environment_get_Platform): Add new
30990         internal call.
30991
30992 2002-08-21  Dietmar Maurer  <dietmar@ximian.com>
30993
30994         * icall.c (ves_icall_get_method_info): s/MonoMethod/MonoReflectionMethod/
30995         (ves_icall_get_parameter_info): s/MonoMethod/MonoReflectionMethod/
30996
30997         * marshal.c (mono_marshal_get_remoting_invoke): save lmf, because
30998         we call unmanaged code which throws exceptions.
30999
31000 Wed Aug 21 12:56:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
31001
31002         * appdomain.h: added per-domain entry_assembly.
31003         * appdomain.c: ensure mono_runtime_exec_main () gets non-null
31004         arguments.
31005         * icall.c: Assembly::GetEntryAssembly icall.
31006         * object.c: set domain->entry_assembly in mono_runtime_exec_main().
31007         Changes above from a patch by Tomi Pakarinen <tomi.pakarinen@welho.com>.
31008
31009 Tue Aug 20 15:42:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
31010
31011         * appdomain.h, gc.c: added mono_domain_finalize ().
31012
31013 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31014
31015         * object.c:
31016         (mono_print_unhandled_exception): changed g_warning by g_printerr
31017         because g_log has a 1024 characters limit (yeah, i got a big stack
31018         trace). Don't print exception name, that should be in ToString 
31019         returned string.
31020
31021 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31022
31023         * icall.c: added ves_icall_FieldInfo_SetValueInternal.
31024         * object.c: added missing MONO_TYPE_ARRAY in mono_runtime_invoke_array.
31025
31026 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31027
31028         * object.c:
31029         (mono_print_unhandled_exception): after previous commit, i realized
31030         that MS calls ToString on the exception. I changed this function to
31031         do that. This way we get stack_trace for free.
31032
31033 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31034
31035         * object.c:
31036         (mono_print_unhandled_exception): invoke Message property instead of
31037         getting 'message' field from Exception. Don't allocate memory for
31038         'trace' and 'message' if not needed.
31039
31040 2002-08-18  Dick Porter  <dick@ximian.com>
31041
31042         * unicode.c: Fix asserts to match Encoder.cs checks
31043
31044 Fri Aug 16 21:42:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
31045
31046         * marshal.c: fix unaligned store issue and a few wrong
31047         opcode argument types.
31048
31049 2002-08-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31050
31051         * icall.c: added GetUninitializedObjectInternal internal call.
31052
31053 2002-08-16  Dietmar Maurer  <dietmar@ximian.com>
31054
31055         * appdomain.c (mono_runtime_invoke_in_domain): transfer Exception
31056         to the right domain.
31057
31058 2002-08-14  Dietmar Maurer  <dietmar@ximian.com>
31059
31060         * marshal.c (mono_marshal_get_runtime_invoke): unbox value types
31061
31062         * class.c (class_compute_field_layout): set blittable to false for Strings
31063
31064         * appdomain.c (mono_domain_transfer_object): added support for ISerializable
31065
31066 Wed Aug 14 17:26:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
31067
31068         * appdomain.h, reflection.c, icall.c, object.c, reflection.h:
31069         first chunk of code to create types at runtime. Code to
31070         handle ReflectedType/DeclaringType. Make reflection handles
31071         domain specific.
31072
31073 Wed Aug 14 17:24:21 CEST 2002 Paolo Molaro <lupus@ximian.com>
31074
31075         * class.c: set correct name in arrays.
31076
31077 2002-08-13  Dietmar Maurer  <dietmar@ximian.com>
31078
31079         * appdomain.c (mono_domain_transfer_object): make it work with
31080         valuetypes. bug fixes.
31081
31082 2002-08-12  Dick Porter  <dick@ximian.com>
31083
31084         * object.h: Rename some parameters to avoid c++ keywords (Patch
31085         from Joseph Wenninger <kde@jowenn.at>)
31086
31087 Thu Aug 8 13:04:18 CEST 2002 Paolo Molaro <lupus@ximian.com>
31088
31089         * icall.c: added icall to implement Assembly.GetFile*.
31090
31091 Thu Aug 8 10:18:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
31092
31093         * reflection.h, reflection.c: code to embed managed resources.
31094
31095 Tue Aug 6 17:59:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
31096
31097         * class.c: move all the type size stuff into
31098         class_compute_field_layout().
31099
31100 Tue Aug 6 11:20:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
31101
31102         * class.c: ensure enums have always the correct instance size.
31103         * unicode.c: remove wrong assert.
31104
31105 Mon Aug 5 19:30:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
31106
31107         * assembly.c: fix mem corruption issue.
31108         * image.h, image.c: added mono_image_get_resource () to access
31109         managed resources.
31110         * icall.c: implemented Assembly.EntryPoint property and some
31111         Managed Resources related internalcalls.
31112
31113
31114 Mon Aug 5 18:18:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
31115
31116         * image.c, image.h: impemented mono_image_get_entry_point ().
31117         * appdomain.c: use mono_image_get_entry_point.
31118
31119 Mon Aug 5 13:08:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
31120
31121         * reflection.c: support the object type argument when loading
31122         custom attributes.
31123
31124 2002-08-05  Dietmar Maurer  <dietmar@ximian.com>
31125
31126         * marshal.c (mono_marshal_get_managed_wrapper): add suppport for
31127         String as return type.
31128
31129 Fri Aug 2 21:15:42 CEST 2002 Paolo Molaro <lupus@ximian.com>
31130
31131         * reflection.c: fix encoding of named args for custom attrs to match
31132         the ms implementation. Read them back when instantiating custom
31133         attributes.
31134
31135 2002-08-02  Radek Doulik  <rodo@ximian.com>
31136
31137         * marshal.c (mono_mb_add_data): convert ret value to LE, suggested
31138         by Dietmar as quick fix
31139         (mono_marshal_get_delegate_begin_invoke): use sig->param_count +
31140         16 as stack size, used on more places as quick fix before Dietmar
31141         will fix it properly
31142
31143 Fri Aug 2 17:48:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
31144
31145         * object.h, object.c: added accessors for fields and properties.
31146
31147 Fri Aug 2 17:45:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
31148
31149         * class.c, class.h: made mono_class_get_field_from_name ()
31150         loop on parent types.
31151         Added mono_class_get_property_from_name ().
31152
31153 Fri Aug 2 11:40:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
31154
31155         * class.c, class.h: move the code to setup the type vtable in its own
31156         function so that it can be reused also for types created at runtime.
31157         Eliminate the "class" identifier from the header file.
31158         * reflection.c: setup the vtable for enums so that we can create
31159         objects for use in SetConstant ().
31160
31161 2002-08-02  Dietmar Maurer  <dietmar@ximian.com>
31162
31163         * marshal.c (mono_delegate_to_ftnptr): pass delegate->target
31164         instead of the delegate itself as this pointer (bug #28383)
31165
31166 2002-08-01  Dietmar Maurer  <dietmar@ximian.com>
31167
31168         * marshal.c (mono_marshal_get_managed_wrapper): added return type
31169         conversions.
31170
31171 Wed Jul 31 16:49:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
31172
31173         * loader.c: don't set the pinvoke bit on icalls.
31174
31175 2002-07-31  Dietmar Maurer  <dietmar@ximian.com>
31176
31177         * debug-helpers.c (mono_method_full_name): only print a number to
31178         indicate wrapper type (so that the output is more readable in traces).
31179
31180 2002-07-30  Dietmar Maurer  <dietmar@ximian.com>
31181
31182         * class.c (mono_class_init): include method override patch from Paolo
31183
31184 Tue Jul 30 15:20:08 CEST 2002 Paolo Molaro <lupus@ximian.com>
31185
31186         * icall.c: fixed GetTypeCode().
31187
31188 2002-07-29  Dietmar Maurer  <dietmar@ximian.com>
31189
31190         * threads.c (ves_icall_System_Threading_Thread_Thread_internal):
31191         use real delegate invoke function to make it work with multicast
31192         delegates (fix bug# 28291).
31193
31194 Fri Jul 26 11:58:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
31195
31196         * object.c: load constant strings.
31197
31198 Fri Jul 26 11:36:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
31199
31200         * reflection.c: no magic numbers.
31201         * tabledefs.h: security action enum.
31202
31203 Fri Jul 26 11:22:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
31204
31205         * assembly.c: fix possible memory corruption.
31206
31207 Thu Jul 25 13:58:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
31208
31209         * reflection.h, reflection.c: added support for linking resources.
31210         * verify.c: check we have an updated corlib.
31211
31212 2002-07-25  Dietmar Maurer  <dietmar@ximian.com>
31213
31214         * marshal.c (mono_marshal_get_native_wrapper): correctly marshal
31215         string arrays.
31216         (mono_marshal_string_array): null terminate unmanaged string arrays.
31217         (mono_marshal_get_managed_wrapper): print warning for arrays (not implemented)
31218
31219 Wed Jul 24 13:32:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
31220
31221         * icall.c: Type.GetType () can now return also types from the
31222         calling assembly.
31223
31224 Wed Jul 24 13:04:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
31225
31226         * loader.h, loader.c: stack walking support.
31227         * icall.c: implemented GetCurrentMethod, GetExecutingAssembly,
31228         GetCallingAssembly.
31229
31230 2002-07-24  Dietmar Maurer  <dietmar@ximian.com>
31231
31232         * marshal.c: added optimisations for blittable types 
31233
31234         * class.c (mono_array_class_get): do not set blittable attribute on arrays
31235         (mono_class_setup_mono_type): set blittable attribute for single
31236         and double.
31237
31238         * marshal.c (mono_string_utf8_to_builder): impl.
31239         (mono_string_builder_to_utf8): impl.
31240         (mono_marshal_get_native_wrapper): impl. StringBuilder marshaling
31241
31242 2002-07-23  Dietmar Maurer  <dietmar@ximian.com>
31243
31244         * marshal.c (mono_marshal_get_native_wrapper): impl. byref types
31245         (mono_marshal_get_managed_wrapper): impl. byref types
31246
31247 2002-07-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31248
31249         * icall.c:
31250         (search_method): don't display debug message. 
31251
31252 2002-07-22  Dietmar Maurer  <dietmar@ximian.com>
31253
31254         * metadata.c (mono_type_stack_size): removed temporary fix for new gcc
31255
31256 Mon Jul 22 18:17:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
31257
31258         * appdomain.c: set the missing filename when throwing exception.
31259
31260 2002-07-22  Dietmar Maurer  <dietmar@ximian.com>
31261
31262         * metadata.c (mono_type_size): code cleanup
31263         (mono_type_stack_size): removed some test code
31264
31265 2002-07-21  Miguel de Icaza  <miguel@ximian.com>
31266
31267         * appdomain.c (ves_icall_System_Reflection_Assembly_LoadFrom): Use
31268         mono_get_exception_file_not_found now.
31269
31270         * exception.c (mono_exception_from_name_two_strings): New version
31271         that will call a constructor with two string arguments. 
31272         (mono_get_exception_file_not_found): New helper routine, used to
31273         report file-not-found errors.
31274
31275 2002-07-20  Dick Porter  <dick@ximian.com>
31276
31277         * process.h:
31278         * process.c: Pass file handles to CreateProcess
31279         
31280         * icall.c:
31281         * file-io.h:
31282         * file-io.c: Implemented CreatePipe
31283
31284 2002-07-19  Dietmar Maurer  <dietmar@ximian.com>
31285
31286         * metadata.c (mono_get_param_info): set alignment for value types
31287
31288 Fri Jul 19 18:58:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
31289
31290         * appdomain.h, domain.c, threads-types.h: don't include config.h in headers.
31291         Constify mono_domain_assembly_open().
31292         * loader.c: handle null namespace in icalls.
31293
31294 2002-07-19  Dietmar Maurer  <dietmar@ximian.com>
31295
31296         * marshal.c (emit_ptr_to_str_conv): marshal object as structs
31297         (emit_str_to_ptr_conv): marshal object as structs
31298
31299         * metadata.c (mono_type_to_unmanaged): marshal object as structs
31300
31301         * marshal.c (mono_marshal_get_runtime_invoke): support value types
31302
31303 2002-07-18  Dietmar Maurer  <dietmar@ximian.com>
31304
31305         * marshal.c (mono_marshal_get_runtime_invoke): use exception filters
31306         (mono_marshal_get_native_wrapper): we an now return value types
31307
31308 Wed Jul 17 18:21:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
31309
31310         * verify.c: more checks implemented.
31311
31312 2002-07-17  Dietmar Maurer  <dietmar@ximian.com>
31313
31314         * marshal.c (mono_delegate_to_ftnptr): invoke the right method
31315         (fix bug #27695)
31316         (mono_marshal_get_native_wrapper): allow byref arguments
31317         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringXXX):
31318         impl. PtrToStringXXX methods
31319         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure_type): impl.
31320         (ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf): impl.
31321         (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi): impl.
31322         (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): impl.
31323         (ves_icall_System_Runtime_InteropServices_Marshal_DestroyStructure): impl.
31324
31325 Tue Jul 16 19:00:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
31326
31327         * reflection.c: fix buglet in parsing an assembly name.
31328
31329 2002-07-16  Dietmar Maurer  <dietmar@ximian.com>
31330
31331         * marshal.c (emit_ptr_to_str_conv): first impl.
31332
31333 Tue Jul 16 12:39:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
31334
31335         * object.c, class.h: cache the vtable in the class as suggested by
31336         vargaz@freemail.hu (Zoltan Varga).
31337
31338 Tue Jul 16 11:27:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
31339
31340         * class.h, loader.c: added mono_field_from_token().
31341         * verify.c: first cut of type checking code.
31342
31343 2002-07-16  Dietmar Maurer  <dietmar@ximian.com>
31344
31345         * marshal.c (mono_marshal_get_native_wrapper): support valuetypes
31346
31347 2002-07-15  Dietmar Maurer  <dietmar@ximian.com>
31348
31349         * marshal.c (mono_marshal_get_native_wrapper): handle enum types
31350         (fix bug #27782)
31351         (mono_marshal_get_remoting_invoke): impl.
31352         (mono_delegate_begin_invoke): impl.
31353         (mono_mb_emit_save_args): impl.
31354         (mono_delegate_end_invoke): impl.
31355         (mono_marshal_get_delegate_begin_invoke):
31356         (mono_marshal_get_delegate_end_invoke):
31357         (mono_marshal_get_delegate_invoke): generate a special name for
31358         those methods (including the signature) and associate them whith
31359         the delegate class. 
31360
31361 2002-07-13  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
31362
31363         * reflection.[ch]: 
31364         (mono_reflection_type_from_name): now it has a MonoImage parameter
31365         which is used as the default image to search the type in. If the image
31366         is NULL or getting the type from it fails, it defaults to corlib.
31367
31368         * icall.c: changed 1 call to mono_reflection_type_from_name to match
31369         new parameter.
31370
31371 Sat Jul 13 19:32:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
31372
31373         * reflection.c: update the parameter table index.
31374
31375 Sat Jul 13 17:34:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
31376
31377         * domain.c: don't include the mark byte in the string hash.
31378
31379 Sat Jul 13 15:06:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
31380
31381         * icall.cs: icall for Type.GetTypeCode ().
31382         * verify: a couple of fixes and disabled local initialization checks.
31383
31384 2002-07-12  Dietmar Maurer  <dietmar@ximian.com>
31385
31386         * marshal.c: better debugging support (DEBUG_RUNTIME_CODE)
31387
31388         * debug-helpers.c (mono_method_full_name): print the type of the
31389         runtime wrapper
31390
31391         * metadata.c (mono_signature_hash): a hash function for signatures
31392         (mono_signature_hash): better hash algorithm
31393
31394         * marshal.c (mono_marshal_get_delegate_invoke): cache methods by signature
31395
31396         * debug-helpers.c (mono_method_full_name): this can now generate
31397         method names with signatures
31398
31399         * marshal.c (mono_marshal_get_managed_wrapper): bug fix: unmanaged
31400         method dont have this pointers.
31401
31402 Fri Jul 12 11:35:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
31403
31404         * reflection.c: fixup typebuilder tokens.
31405         * image.c: fix buglet.
31406         * marshal.h: remove whitespace.
31407         * metadata.h, metadata.c: reinstate code that was removed.
31408         * verify.c: handle catch directives and fix another couple of bugs.
31409
31410 2002-07-11  Dietmar Maurer  <dietmar@ximian.com>
31411
31412         * marshal.c (mono_marshal_get_native_wrapper): support BOOLEAN
31413         (mono_marshal_get_native_wrapper): make it comp. with the old code
31414         (mono_marshal_get_native_wrapper): support boolean
31415         (mono_marshal_get_managed_wrapper): support more types
31416
31417 2002-06-25  Dietmar Maurer  <dietmar@ximian.com>
31418
31419         * class.c (class_compute_field_layout): compute class->blittable attribute.
31420
31421 2002-07-09  Dick Porter  <dick@ximian.com>
31422
31423         * threads.c: Make the thread cleaning up cope with threads that
31424         call ExitThread()
31425
31426 2002-07-08  Radek Doulik  <rodo@ximian.com>
31427
31428         * reflection.c (method_encode_code): use non-translated values to
31429         compute finally_start, this fixes exception handling on ppc, yay!
31430
31431         * decimal.h (struct signscale): fix endianess
31432
31433 2002-07-07  Radek Doulik  <rodo@ximian.com>
31434
31435         * reflection.c: swap box_val and not val
31436
31437 Mon Jul 8 15:18:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
31438
31439         * reflection.c, reflection.h: handle full assembly info in type name.
31440         Handle Type arguments when loading custom attributes.
31441         * icall.c: updated to use new mono_reflection_type_from_name () method.
31442
31443 2002-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31444
31445         * loader.c:
31446         (method_from_memberref): also print assembly name when method not found.
31447
31448 2002-07-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31449
31450         * icall.c:
31451         (ves_icall_TypeGetProperties): fixed bug #27473. 
31452
31453 2002-07-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31454
31455         * reflection.c: display image name and token when cannot find the
31456         .ctor for an attribute.
31457
31458 2002-07-05  Martin Baulig  <martin@gnome.org>
31459
31460         * debug-symfile.c: Reflect latest MonoDwarfFileWriter changes.
31461
31462 2002-07-04  Dick Porter  <dick@ximian.com>
31463
31464         * threads.c (mono_thread_cleanup): Nasty kludge to get this to
31465         compile on mingw.  This will cause mingw builds to not wait for
31466         subthreads to terminate after the main thread does.  I've lodged a
31467         bug with the mingw developers for them to wrap OpenThread().
31468
31469 2002-07-03  Dick Porter  <dick@ximian.com>
31470
31471         * threads.c: Store thread IDs instead of handles, because
31472         GetCurrentThread() returns a pseudohandle and therefore stores
31473         useless values.  mono_thread_cleanup() continues checking the
31474         array of threads until it is empty, to cope with subthreads
31475         spawning new threads after the main thread has finished.
31476
31477         * profiler.h:
31478         * profiler.c:
31479         * profiler-private.h: Pass the thread ID to thread profiler
31480         functions, instead of a handle
31481
31482 Wed Jul 3 17:43:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
31483
31484         * verify.c: fixes to make it more usable.
31485         * pedump.c: added --verify code to verify IL code in an assembly.
31486
31487 Tue Jul 2 20:40:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
31488
31489         * reflection.c: turn errors into warnings to allow compiling corlib.
31490
31491 Tue Jul 2 19:33:20 CEST 2002 Paolo Molaro <lupus@ximian.com>
31492
31493         * reflection.c: add special cases to compile corlib.
31494
31495 Mon Jul 1 18:00:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
31496
31497         * reflection.c: handle properties with only a set method.
31498
31499 Mon Jul 1 17:11:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
31500
31501         * opcodes.h: add enum with opcodes in opval order.
31502
31503 2002-07-01  Dick Porter  <dick@ximian.com>
31504         
31505         * object.h:
31506         * object.c (mono_runtime_run_main): Removed unneeded argument
31507
31508 2002-06-28  Martin Baulig  <martin@gnome.org>
31509
31510         * debug-symfile.c: Reflect latest MonoDwarfFileWriter changes.
31511
31512 2002-06-27  Dick Porter  <dick@ximian.com>
31513
31514         * threads.c: Store the handle in both the parent thread and in the
31515         subthread, to minimise the time between starting a new thread and
31516         storing its ID.
31517
31518 2002-06-26  Dick Porter  <dick@ximian.com>
31519
31520         * appdomain.c (mono_runtime_cleanup): Close the socket library
31521         after all the threads have finished, not before
31522
31523 2002-06-26  Martin Baulig  <martin@gnome.org>
31524
31525         * debug-symfile.c (mono_debug_find_source_location): Added
31526         `guint32 *line_number' argument.  If it's not NULL, store the line number
31527         there and return the file name without the line number.
31528
31529 2002-06-25  Dick Porter  <dick@ximian.com>
31530
31531         * icall.c:
31532         * process.h:
31533         * process.c: Process forking and other support functions
31534
31535 2002-06-25  Dick Porter  <dick@ximian.com>
31536
31537         * image.c (do_mono_image_open): Set ref_count to 1, so that bad
31538         things dont happen when the image is closed.
31539         (mono_image_lookup_resource): Walk the resource section looking
31540         for a particular entry
31541
31542         * cil-coff.h: PE resource section decoding
31543
31544 2002-06-25  Dick Porter  <dick@ximian.com>
31545         
31546         * assembly.h:
31547         * assembly.c: 
31548         (mono_assembly_foreach): Accessor functions to walk the list of
31549         loaded assemblies
31550         (mono_assembly_set_main):
31551         (mono_assembly_get_main): Process methods need to know which
31552         assembly is the "main" one
31553
31554         * object.c (mono_runtime_run_main): Record the main assembly
31555
31556         * debug-helpers.c: Fix typo
31557
31558 2002-06-24  Dietmar Maurer  <dietmar@ximian.com>
31559
31560         * icall.c (ves_icall_System_Runtime_InteropServices_Marshal_copy_to_unmanaged): impl.
31561         (ves_icall_System_Runtime_InteropServices_Marshal_copy_from_unmanaged): impl.
31562
31563 Sat Jun 22 11:37:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
31564
31565         * icall.c: fix off-by-one in Assembly.GetTypes() reported by bob@karr.ath.cx.
31566
31567 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
31568
31569         * image.c (do_mono_image_open): Initialize reference count,
31570         otherwise we leak the MonoImage.
31571
31572 Fri Jun 21 19:16:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
31573
31574         * reflection.c: small tweak to handle self-hosting.
31575
31576 Thu Jun 20 23:28:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
31577
31578         * reflection.c: fix type name parse code.
31579
31580 Thu Jun 20 19:24:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
31581
31582         * reflection.c: break out of the loop.
31583         * image.c: special case corlib.
31584
31585 Thu Jun 20 16:43:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
31586
31587         * reflection.c: add all the custom attrs at the end to ensure the
31588         ctors have been properly initialized when the attributes are defined
31589         in the current assembly.
31590
31591 Thu Jun 20 13:46:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
31592
31593         * reflection.c: handle correctly multiple-nested types.
31594
31595 Thu Jun 20 11:49:00 CEST 2002 Paolo Molaro <lupus@ximian.com>
31596
31597         * row-indexes.h: fix typos.
31598         * reflection.c: adjust for typos and fix method_def_or_ref
31599         encoding in MethodImpl table.
31600
31601 Wed Jun 19 21:57:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
31602
31603         * reflection.c: fix entry point patching (thanks Serge!).
31604
31605 2002-06-18  Dietmar Maurer  <dietmar@ximian.com>
31606
31607         * verify.c: add check for System.Exception
31608
31609 Mon Jun 17 20:23:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
31610
31611         * image.c, class.c: minifix for code just c&p'ed.
31612         * reflection.c: warning fix.
31613         * object.h, loader.h, domain.c: load also StringBuilder.
31614
31615 Mon Jun 17 17:29:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
31616
31617         * marshal.h, marshal.c: some support code to handle complex marshaling.
31618
31619 Mon Jun 17 16:32:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
31620
31621         * class.h, class.c, reflection.c: handle ignorecase in GetType ().
31622         Better signatures with vtable error dump.
31623
31624 Mon Jun 17 16:13:35 CEST 2002 Paolo Molaro <lupus@ximian.com>
31625
31626         * reflection.c, reflection.h, icall.c: fixes for multiple-nested types.
31627
31628 2002-06-17  Dietmar Maurer  <dietmar@ximian.com>
31629
31630         * icall.c (ves_icall_Type_GetField): impl.
31631
31632 Mon Jun 17 16:08:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
31633
31634         * metadata.h, metadata.c: added mono_metadata_get_marshal_info()
31635         to retrieve a marshal description blob for a field or param.
31636
31637 Mon Jun 17 14:57:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
31638
31639         * reflection.h, reflection.c: change order of nested type emission
31640         to avoid table corruption. The NestedTypes table is sorted.
31641         * icall.c: change order of GetConstructor results to workaround mcs bug.
31642
31643 Fri Jun 14 16:24:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
31644
31645         * reflection.h, reflection.c: handle field and param marshal
31646         information.
31647
31648 Wed Jun 12 16:30:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
31649
31650         * icall.c, marshal.c marshal.h: more Marshal class implementation.
31651
31652 Tue Jun 11 17:29:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
31653
31654         * reflection.c: fix call convention.
31655
31656 Tue Jun 11 16:52:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
31657
31658         * reflection.h, reflection.c: mono_image_get_memberref_token()
31659         takes a type instead of a class, now. Added
31660         mono_image_get_array_token() to create tokens for the special
31661         multi-dim array methods.
31662
31663 Tue Jun 11 13:21:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
31664
31665         * assembly.c: handle modules (no assembly table). Split
31666         loading references in its own function.
31667         * class.c: handle moduleref resolution scope.
31668         * image.c, image.h: cache module name in image.
31669
31670 2002-06-07  Martin Baulig  <martin@gnome.org>
31671
31672         * reflection.c (mono_image_get_type_info): Only add a class layout entry
31673         if we actually have a `tb->class_size' (ie. it's not UnspecifiedTypeSize).
31674
31675 Fri Jun 7 22:07:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
31676
31677         * icall.c: more signature fixes that used uint instead of int.
31678
31679 Fri Jun 7 20:41:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
31680
31681         * reflection.c: fixed signature of field refs.
31682
31683 Fri Jun 7 19:41:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
31684
31685         * class.c, reflection.c: handle typerefs of nested types
31686         (both on read and when writing files).
31687
31688 Fri Jun 7 17:46:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
31689
31690         * icall.c: fix method signatures that tried to workaround the previous
31691         typo, d'oh!
31692
31693 Fri Jun 7 17:36:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
31694
31695         * debug-helpers.c: fix typo.
31696
31697 Fri Jun 7 17:00:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
31698
31699         * cil-coff.h, icall.c, image.c, reflection.c, reflection.h:
31700         rewrote the PE/COFF writing code (our programs are understood by the
31701         ms runtime, now).
31702
31703 Tue Jun 4 18:10:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
31704
31705         * gc.c, gc.h, icall.c: weakreference support.
31706
31707 Tue Jun 4 16:06:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
31708
31709         * Makefile.am, mono-config.c: use $(sysconfdir).
31710
31711 Mon Jun 3 13:13:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
31712
31713         * icall.c: changed default precision of Double.ToString() to 15.
31714         Fixed memory leak. Unified with Single.ToString.
31715
31716 Sat Jun 1 14:26:45 CEST 2002 Paolo Molaro <lupus@ximian.com>
31717
31718         * sysmath.c: workaround systems missing NAN and/or HUGE_VAL.
31719
31720 Sat Jun 1 13:46:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
31721
31722         * pedump.c, appdomain.c, appdomain.h, assembly.c, domain.c,
31723         gc.c, icall.c, image.c, mono-config.c, reflection.c: killed
31724         warnings and compilation fixes from Dennis Haney (davh@davh.dk)
31725         and myself.
31726
31727 Fri May 31 16:58:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
31728
31729         * debug-symfile.c, sysmath.c: yet more compilation fixes.
31730
31731 Fri May 31 16:35:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
31732
31733         * reflection.c, socket-io.c: more compilation fixes.
31734
31735 Fri May 31 15:58:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
31736
31737         * appdomain.c, class.c, class.h, debug-symfile.c, decimal.c,
31738         domain.c, loader.c, object.c, object.h, reflection.c, string-icalls.h,
31739         unicode.c: warning and compiler compatibility fixes.
31740
31741 Fri May 31 15:36:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
31742
31743         * class.h, metadata.c: fixed warnings/compilation errors.
31744
31745 Fri May 31 13:08:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
31746
31747         * Makefile.am, mono-config.c, mono-config.h: configuration file
31748         support routines.
31749         * loader.c, loader.h: make Dll mapping configurable at runtime in the
31750         config file. Export methods to insert and lookup mappings.
31751
31752 Fri May 31 12:45:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
31753
31754         * reflection.c: handle types and boxed objects in custom attr
31755         constructors.
31756
31757 2002-05-30  Martin Baulig  <martin@gnome.org>
31758
31759         * debug-symfile.c
31760         (ves_icall_Debugger_MonoSymbolWriter_method_builder_from_token): Removed.
31761
31762 Thu May 30 14:15:02 CEST 2002 Paolo Molaro <lupus@ximian.com>
31763
31764         * metadata.c, metadata.h: added mono_metadata_implmap_from_method()
31765         to lookup the implmap row for a P/Invoke method.
31766         * loader.c: added mono_lookup_pinvoke_call(): we only lookup a
31767         P/Invoke method from the runtime on an as needed basis.
31768
31769 2002-05-28  Dietmar Maurer  <dietmar@ximian.com>
31770
31771         * metadata.c (mono_metadata_parse_signature): impl.
31772
31773 Tue May 28 16:02:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
31774
31775         * class.c: handle .pack directive.
31776
31777 Tue May 28 11:04:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
31778
31779         * object.c: initialize static fields with RVA data.
31780
31781 2002-05-25  Martin Baulig  <martin@gnome.org>
31782
31783         * debug-symfile.c
31784         (ves_icall_Debugger_DwarfFileWriter_get_type_token): Removed.
31785
31786 2002-05-24  Martin Baulig  <martin@gnome.org>
31787
31788         * debug-symfile.c
31789         (ves_icall_Debugger_MonoSymbolWriter_get_local_type_from_sig): Removed.
31790         (ves_icall_Debugger_MonoSymbolWriter_method_from_token): Renamed to
31791         `ves_icall_Debugger_MonoSymbolWriter_method_builder_from_token'.
31792
31793 Thu May 23 18:44:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
31794
31795         * object.c: special case string ctros in invoke.
31796         * gc.c: silly whitespace changes.
31797
31798 2002-05-23  Dietmar Maurer  <dietmar@ximian.com>
31799
31800         * threadpool.[ch]: impl. a threadpool that can
31801         be used by mint and mono.
31802
31803 2002-05-22  Martin Baulig  <martin@gnome.org>
31804
31805         * debug-symfile.c (ves_icall_Debugger_MonoSymbolWriter_method_from_token):
31806         The first argument is now a `MonoReflectionModuleBuilder *', the return
31807         value is a `MonoReflectionModuleBuilder *'.  Use the AssemblyBuilder's
31808         `methods' field to get the method builder.  The `token' argument is the
31809         unfixed token.
31810
31811         * unicode.c (iconv_get_length, iconv_convert): Silently ignore all
31812         invalid characters instead of g_assert_not_reached()ing.  This seems
31813         to be the behaviour of mscorlib.
31814
31815 2002-05-22  Dietmar Maurer  <dietmar@ximian.com>
31816
31817         * object.c (mono_runtime_invoke_array): applied patch from Rachel
31818         Hestilow to fix bug #25104
31819
31820 2002-05-21  Martin Baulig  <martin@gnome.org>
31821
31822         * debug-symfile.c (mono_debug_find_source_location): New function.
31823         Looks up an IL offset in the line number table and returns the source
31824         location as a string.
31825
31826 2002-05-21  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31827
31828         * icall.c:
31829         (mono_double_ToStringImpl): changed %f by %g until we have something
31830         better.
31831
31832 2002-05-21  Nick Drochak  <ndrochak@gol.com>
31833
31834         * icall.c : Use different name for Math.Pow's icall.  Needed to check
31835         parameters first in C#.
31836
31837 Mon May 20 17:36:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
31838
31839         * icall.c, reflection.h: added icall to get info about an event.
31840
31841 2002-05-20  Radek Doulik  <rodo@ximian.com>
31842
31843         * object.c (mono_value_box): don't use memcpy for boxing on BIG
31844         endian
31845         (mono_value_box): don't use memcpy for small sizes on
31846         architectures with unaligned access
31847
31848 2002-05-20  Martin Baulig  <martin@gnome.org>
31849
31850         * reflection.c (mono_reflection_setup_internal_class): Don't crash
31851         if `tb->parent == NULL'.
31852         (mono_reflection_create_internal_class): New function.  This is
31853         called from TypeBuilder.CreateType() and sets `klass->enum_basetype'
31854         for enum types.
31855
31856         * icall.c ("System.Reflection.Emit.TypeBuilder::create_internal_class"):
31857         New interncall.
31858
31859 2002-05-19  Martin Baulig  <martin@gnome.org>
31860
31861         * unicode.c (ves_icall_iconv_get_bytes): Actually use the `charCount'
31862         argument to get the length, don't default to the array length.
31863
31864 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
31865
31866         * assembly.c (mono_assembly_setrootdir): New function used to
31867         override the MONO_ASSEMBLIES directory.
31868
31869 Fri May 17 20:39:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
31870
31871         * icall.c: ValueType_GetHashCode() initialize local var.
31872
31873 Thu May 16 17:20:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
31874
31875         * reflection.c: sort custom attributes table.
31876
31877 Thu May 16 16:08:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
31878
31879         * reflection.c: support named args in custom attributes (write support).
31880
31881 Thu May 16 13:04:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
31882
31883         * reflection.c: fix finally position calculation.
31884
31885 2002-05-15  Radek Doulik  <rodo@ximian.com>
31886
31887         * reflection.c: fixed endianess at many places
31888
31889         * icall.c (ves_icall_InitializeArray): comment out debug msg
31890
31891 2002-05-15  Dietmar Maurer  <dietmar@ximian.com>
31892
31893         * object.c (mono_unhandled_exception): new function to handle
31894         unhandled exceptions.
31895         (mono_unhandled_exception): call the UnhandledException event.
31896         (mono_runtime_delegate_invoke): impl.
31897
31898 Wed May 15 15:59:55 CEST 2002 Paolo Molaro <lupus@ximian.com>
31899
31900         * metadata.h, metadata.c, class.c: mono_metadata_field_info ()
31901         returns the RVA, not the direct pointer to the data. Handle the case
31902         when the class size is fixed.
31903
31904 Tue May 14 16:59:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
31905
31906         * reflection.c: fix some endianess issues.
31907
31908 2002-05-14  Dietmar Maurer  <dietmar@ximian.com>
31909
31910         * object.c (mono_runtime_invoke): is now able to catch exceptions.
31911
31912         * threads.c (mono_thread_init): added a callback which is invoked
31913         at thread start.
31914
31915 2002-05-14  Dan Lewis  <dihlewis@yahoo.co.uk>
31916         
31917         * icall.c: make GetHashCode return non-negative values.
31918
31919 2002-05-14  Dan Lewis  <dihlewis@yahoo.co.uk>
31920
31921         * object.c, icall.c, gc.c: revert to address-based hashcode.
31922
31923 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
31924
31925         * icall.c (mono_double_ParseImpl): Added ParseImpl method.
31926
31927 Mon May 13 16:40:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
31928
31929         * icall.c, class.c: special case <Module>.
31930
31931 2002-05-13  Dan Lewis  <dihlewis@yahoo.co.uk>
31932
31933         * icall.c: fix bug in GetNow().
31934
31935 2002-05-11  Dietmar Maurer  <dietmar@ximian.com>
31936
31937         * object.c (mono_runtime_class_init): make sure that we call all
31938         static class constructors.
31939
31940 Fri May 10 18:14:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
31941
31942         * reflection.c: sort methodsemantics table.
31943
31944 Fri May 10 16:31:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
31945
31946         * reflection.h, reflection.c: honour init locals setting.
31947
31948 Thu May 9 18:50:00 EDT 2002 Daniel Morgan <danmorg@sc.rr.com>
31949
31950         * icall.c: copied Double ToStringImpl for Single ToStringImpl
31951
31952 Wed May 8 12:28:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
31953
31954         * reflection.c: support ContructorBuilders in attribute blob creation.
31955
31956 Wed May 8 12:06:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
31957
31958         * reflection.c: some changes to build a binary that can be run
31959         directly in windows.
31960
31961 Mon May 6 13:10:34 CEST 2002 Paolo Molaro <lupus@ximian.com>
31962
31963         * loader.c: print a big message when an icall can't be found.
31964
31965 2002-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31966
31967         * string-icalls.c: fix bug 24248.
31968
31969 Sat May 4 14:03:21 CEST 2002 Paolo Molaro <lupus@ximian.com>
31970
31971         * appdomain.c, appdomain.h, assembly.c, assembly.h, image.h,
31972         icall.c, reflection.h: separate assembly loading by pathname and by
31973         assembly name. Use the MONO_PATH env var to search for assemblies.
31974
31975 Thu May 2 17:56:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
31976
31977         * assembly.c, image.h: add some support for assemblies
31978         with multiple modules.
31979         * class.c, class.h: export mono_class_from_typeref().
31980         * loader.c: remove duplicated code and use mono_class_from_typeref(),
31981         instead.
31982
31983 Thu May 2 15:51:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
31984
31985         * unicode.c: Char.IsNumber doesn't include hex digits as the ms
31986         documentation says (the ECMA one is correct).
31987
31988 2002-05-02  Dick Porter  <dick@ximian.com>
31989
31990         * threads.c: Use GC_debug_register_finalizer with GC_debug_malloc.
31991         Don't name the synchronisation mutex.
31992
31993 2002-04-30  Jeffrey Stedfast  <fejj@ximian.com>
31994
31995         * rand.c
31996         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_GetBytes):
31997         Make the prototypes match.
31998         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_GetNonZeroBytes):
31999         Same.
32000
32001         * icall.c
32002         (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Fixed for
32003         systems that use 'timezone' rather than tm.tm_gmtoff. Also, not
32004         all systems have tm.tm_zone, so use strftime() with %Z to print
32005         the timezone abreviation into a temp string.
32006
32007         * object.c (mono_ldstr): Fixed to use mono_string_chars() macro
32008         rather than mono_array_addr() on a MonoString on Big Endian
32009         machines.
32010
32011 2002-04-30  Dietmar Maurer  <dietmar@ximian.com>
32012
32013         * string-icalls.c (ves_icall_System_String_InternalReplace_Str):
32014         fix bug 24041
32015
32016 2002-04-30  Dick Porter  <dick@ximian.com>
32017
32018         * socket-io.c: Cope with SOCKET being an integer rather than a
32019         pointer now.
32020
32021         * threads.c: Added Thread_free_internal, to deal with thread
32022         handle cleanup.  Moved calls to handle_store() and handle_remove()
32023         to start_wrapper(), so each can only be called once.  Allocate
32024         synchronisation blocks with GC_malloc(), and use GC finalisation
32025         to close the handles.
32026
32027         * icall.c: added System.Threading.Thread::Thread_free_internal
32028
32029 Mon Apr 29 15:33:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
32030
32031         * icall.c: support Environment.Exit, CommandLineArgs().
32032
32033 Mon Apr 29 15:15:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
32034
32035         * object.c, object.h: added mono_runtime_run_main () and
32036         mono_runtime_get_main_args () for use in System.Environment.
32037
32038 Mon Apr 29 13:45:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
32039
32040         * gc.c: fix thinko, enable actual finalization since the jit is now
32041         fixed.
32042
32043 Mon Apr 29 12:47:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
32044
32045         * gc.c, object.c: take into account that an object may be offset wrt the address
32046         returned by GC_malloc().
32047
32048 Mon Apr 29 12:14:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
32049
32050         * image.c: handle files without entries in the assembly table (modules).
32051
32052 2002-04-28 Patrik Torstensson <patrik.torstensson@intel.com>
32053
32054         * reflection.c (mono_reflection_setup_internal_class): remove g_assert_not_reached() to allow 
32055         mcs selfhosting again (build breaker) and did move the check to class instead. parent is
32056         allowed to be null when it's System.Object class setup.
32057
32058 2002-04-27  Martin Baulig  <martin@gnome.org>
32059
32060         * reflection.c (mono_reflection_setup_internal_class): g_assert_not_reached()
32061         if `tb->parent == NULL' rather than crashing.
32062
32063 2002-04-28  Nick Drochak  <ndrochak@gol.com>
32064
32065         * sysmath.c (ves_icall_System_Math_Asin): Fix copy-paste error.  Was
32066         calling acos() where asin() should have been called.
32067
32068 2002-04-26  Martin Baulig  <martin@gnome.org>
32069
32070         * assembly.c (default_assembly_name_resolver): Use G_FILE_TEST_IS_REGULAR
32071         instead of G_FILE_TEST_EXISTS - if you're in mcs/class/corlib/System/Test,
32072         there's a subdirectory called `System', but we don't want to read that
32073         subdirectory as an assembly.
32074
32075 2002-04-25  Martin Baulig  <martin@gnome.org>
32076
32077         * debug-symfile.c: Reflect latest MonoString changes.
32078
32079 Thu Apr 25 16:38:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
32080
32081         * rand.c, rand.h: instance method icalls need to have an explicit
32082         this pointer as first argument in the C implementation.
32083
32084 2002-04-25  Nick Drochak <ndrochak@gol.com>
32085
32086         * icall.c: Fix typo in map for GetNonZeroBytes
32087
32088 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
32089
32090         * string-icalls.c : String does now passes unit tests without any 
32091         errors, the following changes has been made:
32092         
32093         Implemented replace methods.
32094         Renaming of methods to (try) follow the standard.
32095         Fixed compare ordinal
32096         Made all memory allocated directly to function instead of via icall function.
32097         Small performance fix in is_in_array function
32098                         
32099  (2002-04-23) Changes from Duncan Mak <duncan@ximian.com>
32100
32101         c (mono_string_Internal_ctor_charp_int_int):
32102         (mono_string_Internal_ctor_sbytep_int_int):  Removed check for
32103         sindex < 0, throw ArgumentOutOfRangeException instead of
32104         ArgumentNullException.
32105
32106         Added new check for length == 0, however
32107         I need to make it return String.Empty from the C code.
32108         
32109         (mono_string_Internal_ctor_sbytep): Use mono_string_new, and let
32110         that calculate the length for us here.
32111         
32112         (mono_string_Internal_ctor_sbytep_int_int): Replaced
32113         mono_string_new_utf16 with mono_string_new, since value is utf8.
32114
32115 Wed Apr 24 18:43:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
32116
32117         * object.c: register the object for finalization if needed.
32118         Allocate one more char in the string for the terminating 0 char.
32119
32120 Wed Apr 24 18:22:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
32121
32122         * class.c, class.h, image.c: check if a type implemenst a destructor.
32123         Use the proper key for array class lookups.
32124         * icall.c: register the icalls in the System.GC class.
32125         * gc.c, gc.h: GC-related functions and icalls.
32126
32127 2002-04-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32128
32129         * icall.c:
32130         * socket-io.c:
32131         * unicode.c: free some strings gotten from mono_string_to_utf8 and
32132         changed a couple of free () by g_free ().
32133
32134         * decimal.c: one-liner in the comments for decimal2string ().
32135
32136 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
32137
32138         * object.c (mono_runtime_invoke_array) : Bug because of my incompetence.
32139
32140 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
32141
32142         * reflection.c (mono_reflection_get_custom_attrs) : fixed image bug (crash)
32143         * object.c (mono_runtime_invoke_array) : handle null in params
32144
32145 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
32146
32147         * string-icalls.c: fixed bug in split (one off bug)
32148
32149 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
32150
32151         * string-icalls.c: fixed bug in remove and lastindexofany, add equals icall.
32152         * icalls.c: added String::Equals as internal method
32153
32154 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
32155
32156         * threads.c: fixed bug in the double interlocked functions
32157
32158 2002-04-22      Patrik Torstensson <patrik.torstensson@labs2.com>
32159
32160         * threads.c: implemented all of the new interlocked icalls.
32161         * string-icalls.c: fix a bug in insert.
32162         * icalls.c: added the icalls for interlocked, removed old string functions.
32163         
32164 Mon Apr 22 19:44:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
32165
32166         * loader.c: fix off-by-one error when reading argument names.
32167
32168 Mon Apr 22 19:28:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
32169
32170         * profiler.c: win32 counter implementation (untested).
32171         * icall.cs: win32 GetNow() and GetTimeZoneData() implementations
32172         (the latter needs testing and more complete impl. from win32 folks).
32173
32174 2002-04-21  Dan Lewis  <dihlewis@yahoo.co.uk>
32175
32176         * object.c: mono_array_new_full workaround mono_array_class_get
32177         problem.
32178
32179 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
32180
32181         * string-icalls.c (mono_string_InternalRemove): Fixed overwrite bug.
32182         * object.h (mono_string_chars): Changed casting type.
32183
32184 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
32185
32186         * string-icalls.c: Fixed trim method, added the constructors done by Duncan, fixed
32187                            method signatures to use gunichar2 instead of gint16.
32188
32189 2002-04-20  Dan Lewis  <dihlewis@yahoo.co.uk>
32190
32191         * object.h, object.c: domain-specific versions of mono_object_new and
32192         mono_array_new.
32193
32194 2002-04-20  Dietmar Maurer  <dietmar@ximian.com>
32195
32196         * object.c: changed String layout
32197
32198         * string-icalls.c (mono_string_Internal_ctor_chara): added
32199         internal string constructors.
32200
32201 Sat Apr 20 13:33:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
32202
32203         * threads.c: pass 'this' to the thread start routine.
32204
32205 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32206
32207         * string-icalls.c: fix IndexOf and LastIndexOf. Now
32208         InternalCompareStr don't call twice mono_string_cmp_char for the last
32209         character. Improved performance in mono_string_cmp_char.
32210
32211 Fri Apr 19 19:26:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
32212
32213         * Makefile.am, appdomain.c, class.c, object.c: split runtime-depended
32214         code into its own library: libmonoruntime.
32215
32216 2002-04-19  Dan Lewis  <dihlewis@yahoo.co.uk>
32217
32218         * object.h, object.c: changed array format so that szarrays do not
32219         require a bounds structure.
32220         * icall.c, appdomain.c: support for new szarray format.
32221
32222 Fri Apr 19 18:04:34 CEST 2002 Paolo Molaro <lupus@ximian.com>
32223
32224         * metadata.c: compare also the retuns type when comparing signatures:
32225         we didn't do this as an optimization since really overloaded methods
32226         must differ also in the arguments, but this doesn't work with
32227         low-level IL code (or when using explicit conversion operators: see
32228         bug#23498 for an example).
32229
32230 Fri Apr 19 16:14:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
32231
32232         * loader.c: SZARRAY types can be saved as TYPESPEC, too.
32233
32234 Thu Apr 18 17:15:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
32235
32236         * icall.c: make MonoType::GetElementType its own icall.
32237
32238 Thu Apr 18 16:41:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
32239
32240         * icall.c: remove MonoMethod_get_Name().
32241         * reflection.c, reflection.h, verify: cache the method name in the MonoMethod
32242         object.
32243
32244 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
32245
32246         * string-icalls.c: optimized a few methods.
32247
32248 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
32249
32250         * icall.c: added all new string internal calls
32251         * string-icalls.c: added, new string internal call implementation.
32252         * object.c: added mono_string_new_size for allocating a string a size
32253
32254 2002-04-17  Dietmar Maurer  <dietmar@ximian.com>
32255
32256         * object.c (mono_object_isinst): use the same code as in the
32257         optimized x86 version.
32258
32259 Wed Apr 17 14:14:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
32260
32261         * profiler.c: TSC-based timer code (faster and more accurate).
32262         Not hooked up in configure, yet (set USE_X86TSC to 1).
32263
32264 Wed Apr 17 12:33:10 CEST 2002 Paolo Molaro <lupus@ximian.com>
32265
32266         * profiler.c, profiler.h: track time spent compiling methods.
32267         * threads.c: track thread creation/destruction.
32268
32269 Tue Apr 16 20:08:43 CEST 2002 Paolo Molaro <lupus@ximian.com>
32270
32271         * profiler.c, profiler.h, profiler-private.h: profiling interface
32272         and sample implementation. Moved here so that it can be used also by
32273         the jit.
32274
32275 Tue Apr 16 12:58:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
32276
32277         * reflection.c, reflection.h: keep types and other handles separate in
32278         the hash tables for referred tokens. Add guid for modules.
32279
32280 Mon Apr 15 11:37:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
32281
32282         * assembly.c: fix bugs found with valgrind.
32283         * metadata.h, metadata.c: added mono_metadata_guid_heap().
32284
32285 2002-04-14      Patrik Torstensson <patrik.torstensson@labs2.com>
32286
32287         * threads: added icall support for getting current domain for
32288                    the thread.
32289  
32290 2002-04-13  Martin Baulig  <martin@gnome.org>
32291
32292         * debug-symfile.h (MonoDebugLocalInfo): Renamed to MonoDebugVarInfo.
32293         (MonoDebugVarInfo): Added `index' field for register based addresses.
32294         (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 9.
32295         (MonoDebugMethodInfo): Replaced `guint32 *param_offsets' with
32296         `MonoDebugVarInfo *params' and `guint32 this_offset' with
32297         `MonoDebugVarInfo *this_var'.
32298
32299         * debug-symfile.c (relocate_variable): New static function to write
32300         a location description for a local variable or method parameter.
32301
32302 2002-04-12  Martin Baulig  <martin@gnome.org>
32303
32304         * debug-symfile.h (MonoDebugLocalInfo): New type. This contains the
32305         stack offset and begin/end scope address of a local variable.
32306         (MonoDebugMethodInfo): Replaced `guint32 *local_offsets' with
32307         'MonoDebugLocalInfo *locals', added `prologue_end' and `epilogue_begin'.
32308         (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 8.
32309
32310         * debug-symfile.c (MRT_variable_start_scope, MRT_variable_end_scope):
32311         Added new relocation types for start/end scope of a local variable.
32312
32313 Fri Apr 12 18:30:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
32314
32315         * object.h: add mono_object_domain() macro.
32316         * reflection.c: handle typespecs.
32317         * icall.c: MonoMethod::get_Name() implementation.
32318
32319 Thu Apr 11 12:29Ni:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
32320
32321         * icall.c: String::GetHashCode() icall implementation.
32322
32323 Wed Apr 10 21:16:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
32324
32325         * icall.c: String::IndexOfAny icall.
32326         * object.c, object.h: make array->max_length more useful.
32327         Intrduced mono_object_class() and mono_string_length() macros.
32328
32329 2002-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32330
32331         * unicode.c (ves_icall_System_Char_IsNumber): use g_unichar_isxdigit
32332         instead of g_unichar_isdigit.
32333
32334 2002-04-11  Nick Drochak  <ndrochak@gol.com>
32335
32336         * icall.c: Implement a simple Double.ToString().
32337
32338 Tue Apr 9 21:31:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
32339
32340         * appdomain.h: only io-layer.h is supposed to be included.
32341         * icall.c: explicitly import environ. Fix warning.
32342
32343 2002-04-10  Nick Drochak  <ndrochak@gol.com>
32344
32345         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData) :
32346                 return true even if it's not Daylight Savings time.
32347                 Only return false for the case where the function isn't
32348                 implemented for a plaform (read Windows).
32349
32350 Tue Apr 9 13:05:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
32351
32352         * appdomain.h, appdomain.c, class.c, object.c: protect MonoDomain
32353         data with a mutex.
32354
32355 2002-04-09  Dietmar Maurer  <dietmar@ximian.com>
32356
32357         * mempool.c (mono_mempool_alloc): only use g_malloc when
32358         absolutely necessary.
32359
32360 2002-04-08  Dietmar Maurer  <dietmar@ximian.com>
32361
32362         * mempool.c (MEM_ALIGN): hardcode MEM_ALIGN to 8
32363
32364         * class.c (mono_class_vtable): use domain mempool to allocate vtable
32365         (mono_class_proxy_vtable): use domain mempool
32366
32367 Mon Apr 8 17:17:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
32368
32369         * appdomain.h, appdomain.c: split initialization that requires the
32370         execution engine support into mono_runtime_init().
32371
32372 2002-04-08  Dietmar Maurer  <dietmar@ximian.com>
32373
32374         * class.c (mono_class_init): don't include vtable inside MonoClass
32375         to save some memory, gather some statistics.
32376         (mono_class_vtable): use g_malloc instead of GC_malloc when possible
32377
32378 Sat Apr 6 20:07:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
32379
32380         * icall.c: internalcall implementation for ValueType.Equals().
32381
32382 2002-04-06  Dietmar Maurer  <dietmar@ximian.com>
32383
32384         * object.c (mono_message_init): moved 
32385         (mono_runtime_exec_main): new arch. independent impl.
32386         (mono_runtime_invoke_array): new method - like
32387         mono_runtime_invoke, but you can pass an array of objects.
32388         (mono_remoting_invoke): new arch. independent impl.
32389         (mono_message_invoke): new arch. independent impl.
32390         (mono_runtime_class_init): new arch. independent impl.
32391         (mono_runtime_object_init): new arch. independent impl.
32392
32393 Fri Apr 5 18:29:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
32394
32395         * metadata.c, object.c, reflection.c: documented the exported
32396         functions.
32397
32398 Fri Apr 5 15:42:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
32399
32400         * icall.c: simpler code to pass the assembly builder data to corlib.
32401         Implement GetNestedTypes() internalcall.
32402
32403 Thu Apr 4 21:46:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
32404
32405         * class.c: warn if a type can't be loaded.
32406
32407 2002-04-04  Dietmar Maurer  <dietmar@ximian.com>
32408
32409         * image.h: typedef MonoImageOpenStatus
32410         * types.h: removed unused file
32411         
32412 2002-04-04  Dan Lewis  <dihlewis@yahoo.co.uk>
32413
32414         * icall.c: Enum_ToObject accepts enum value arguments.
32415
32416 Thu Apr 4 11:35:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
32417
32418         * class.c: move initialization of properties, events and nested
32419         classes, so that they happen for interfaces, too.
32420
32421 Wed Apr 3 20:03:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
32422
32423         * icall.c: cleanup some ugly casts in Array_SetValue*.
32424
32425 Wed Apr 3 19:49:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
32426
32427         * icall.c: the values array fro enums is of the correct type, now.
32428         Implement (correctly) getFullName instead of assQualifiedName for
32429         MonoType.
32430         * reflection.h, reflection.c: added mono_type_get_name ().
32431
32432 Wed Apr 3 17:56:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
32433
32434         * assembly.c, image.h: for each MonoImage, record from wich assembly
32435         it was loaded.
32436         * reflection.h, icall.c: added System_Reflection_Assembly_GetTypes().
32437         Make Type.Assembly work.
32438
32439 2002-04-03  Dietmar Maurer  <dietmar@ximian.com>
32440
32441         * debug-symfile.h: use char* instead of gpointer to avoid
32442         unnecessary casts.
32443
32444         * appdomain.c (mono_jit_info_table_find): use char* instead of gpointer
32445
32446         * icall.c (ves_icall_InternalExecute): impl. FielSetter
32447         (ves_icall_System_Array_SetValueImpl): removed strange MonoArray cast
32448
32449 2002-03-30  Dietmar Maurer  <dietmar@ximian.com>
32450
32451         * icall.c (mono_message_init): impl. (code cleanup)
32452         (ves_icall_InternalExecute): impl. FieldGetter
32453
32454         * class.c (mono_class_init): added exerimental EXT_VTABLE_HACK, if
32455         defined we call all (non-static)methods through the vtable. 
32456
32457 Fri Mar 29 18:09:08 CET 2002 Paolo Molaro <lupus@ximian.com>
32458
32459         * class.c: it seems GC_debug_malloc() makes the Boehm GC call the
32460         finalizer even though the memory is still referenced (and the chunk of
32461         memory is not freed).
32462
32463 Fri Mar 29 17:43:04 CET 2002 Paolo Molaro <lupus@ximian.com>
32464
32465         * assembly.c: fix brokeness.
32466
32467 Fri Mar 29 16:09:54 CET 2002 Paolo Molaro <lupus@ximian.com>
32468
32469         * class.c: kill some warnings. Check explicit interface method
32470         implementation also without considering the namespace.
32471         Load also literal strings in static class data.
32472
32473 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
32474
32475         * assembly.c (default_assembly_name_resolver): Kill memory leak. 
32476         (default_assembly_name_resolver): Make the resolver take the
32477         "base" directory where the assembly was originally defined, so we
32478         can load DLLs that are in the same directory as the assembly that
32479         is being referenced.
32480
32481 2002-03-28  Dick Porter  <dick@ximian.com>
32482
32483         * file-io.h: 
32484         * file-io.c:
32485         * socket-io.c: 
32486         * unicode.h: 
32487         * unicode.c: Warning cleanups
32488
32489 Thu Mar 28 18:06:14 CET 2002 Paolo Molaro <lupus@ximian.com>
32490
32491         * object.h, reflection.h: use the correct type instead of MonoObject.
32492
32493 2002-03-28  Martin Baulig  <martin@gnome.org>
32494
32495         * debug-symfile.c (mono_debug_class_get): Don't look in referenced assemblies.
32496         (mono_debug_update_symbol_file): Initialize classes if necessary.
32497
32498 Thu Mar 28 15:58:43 CET 2002 Paolo Molaro <lupus@ximian.com>
32499
32500         * assembly.c, debug-helpers.c, image.c, image.h, metadata.c, pedump.c,
32501         rawbuffer.c, reflection.c, verify.c: mare warning cleanups.
32502
32503 Thu Mar 28 15:20:39 CET 2002 Paolo Molaro <lupus@ximian.com>
32504
32505         * assembly.h: fix function prototype.
32506         * metadata.h, metadata.c, object.h, private.h: get rid of warnings.
32507         * mono-endian.h: use const cast.
32508
32509 2002-03-28  Dietmar Maurer  <dietmar@ximian.com>
32510
32511         * icall.c (ves_icall_MonoMethodMessage_InitMessage): moved from message.c
32512
32513 Thu Mar 28 12:32:00 CET 2002 Paolo Molaro <lupus@ximian.com>
32514
32515         * loader.c: don't assert when a typeref can't be loaded, give
32516         a chance to the runtime to trow an exception instead.
32517         * loader.h: fix warning.
32518
32519 2002-03-28  Dietmar Maurer  <dietmar@ximian.com>
32520
32521         * class.c (mono_class_proxy_vtable): added proxy support
32522
32523 2002-03-27  Dan Lewis <dihlewis@yahoo.co.uk>
32524
32525         * icall.c: removed last of PAL calls, added System.Environment
32526         * file-io.h, file-io.c: MonoIO implementation
32527         * object.h, object.c: mono_string_to_utf16() now returns gunichar2*
32528
32529 Tue Mar 26 19:56:10 CET 2002 Paolo Molaro <lupus@ximian.com>
32530
32531         * appdomain.c: do not use the byte marker in ldstr table lookup.
32532         * debug-helpers.c: allow two ':' to separate class and method name.
32533         * object.c: allocate arrays bounds with the GC, too.
32534         * verify: add a few more checks.
32535
32536 Tue Mar 26 18:45:46 CET 2002 Paolo Molaro <lupus@ximian.com>
32537
32538         * reflection.c: output also literal strings. Allocate parameter data
32539         with GC_malloc() (thanks, Martin, for catching this!).
32540
32541 2002-03-26  Martin Baulig  <martin@gnome.org>
32542
32543         * debug-symfile.h (MonoDebugMethodInfo): Added `this_offset', don't
32544         include the `this' offset in the `param_offsets'.
32545
32546 2002-03-25  Martin Baulig  <martin@gnome.org>
32547
32548         * debug-symfile.c (mono_debug_update_symbol_file): Use a new
32549         mono_debug_get_class() function to get the classes. Added new
32550         relocation types for arrays and strings.
32551         (mono_debug_get_class): New static function to search in all
32552         referenced assemblies for a metadata token.
32553
32554         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 7.
32555
32556 Mon Mar 25 13:08:18 CET 2002 Paolo Molaro <lupus@ximian.com>
32557
32558         * reflection.h, reflection.c: use a gc-safe hash for hash tables that
32559         hold gc-allocated objects. Make the string heap a stream like the
32560         others. Removed duplicated code when writing stream info.
32561         Added asserts to catch possible buffer overflows. Set the sorted map
32562         for tables that need sorting. Added some documentation.
32563
32564 Mon Mar 25 13:04:56 CET 2002 Paolo Molaro <lupus@ximian.com>
32565
32566         * appdomain.h, appdomain.c, class.c, object.c: use a GC-safe hash table 
32567         for interned strings and vtables.
32568
32569 2002-03-24  Martin Baulig  <martin@gnome.org>
32570
32571         * icall.c (ves_icall_Type_GetFields): Reverse the list before storing
32572         it in the array since it was created with g_slist_prepend().
32573
32574 2002-03-24  Martin Baulig  <martin@gnome.org>
32575
32576         * debug-symfile.c (mono_debug_local_type_from_signature): Renamed
32577         to ves_icall_Debugger_MonoSymbolWriter_get_local_type_from_sig().
32578         (mono_debug_method_from_token): Renamed to
32579         ves_icall_Debugger_MonoSymbolWriter_method_from_token().
32580         (ves_icall_Debugger_DwarfFileWriter_get_type_token): New interncall.
32581
32582         * debug-symfile.c (MRT_type_sizeof, MRT_type_field_offset): New
32583         relocation types.
32584
32585         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 6.
32586
32587 2002-03-24  Martin Baulig  <martin@gnome.org>
32588
32589         * debug-symfile.c (mono_debug_local_type_from_signature): New func.
32590         (mono_debug_method_from_token): New func.
32591
32592         * icall.c (Mono.CSharp.Debugger.MonoSymbolWriter::get_local_type_from_sig):
32593         New interncall, calls mono_debug_local_type_from_signature().
32594         (Mono.CSharp.Debugger.MonoSymbolWriter::get_method): New interncall,
32595         calls mono_debug_method_from_token().
32596
32597 2002-03-23  Martin Baulig  <martin@gnome.org>
32598
32599         * unicode.c (ves_icall_iconv_get_char_count): The `count' argument
32600         specifies the number of bytes to be converted, not the array size.
32601         Return the number of chars, not the number of bytes.
32602         (ves_icall_iconv_get_chars): The `byteCount' argument
32603         specifies the number of bytes to be converted, not the array size.
32604
32605 2002-03-23  Martin Baulig  <martin@gnome.org>
32606
32607         * reflection.h (MonoReflectionSigHelper): New type.
32608
32609         * reflection.c (mono_reflection_sighelper_get_signature_local),
32610         (mono_reflection_sighelper_get_signature_local): New functions.
32611
32612         * icall.c (System.Reflection.Emit.SignatureHelper::get_signature_local),
32613         (System.Reflection.Emit.SignatureHelper::get_signature_field): New
32614         interncalls.
32615
32616 2002-03-23  Martin Baulig  <martin@gnome.org>
32617
32618         * rawbuffer.c (mono_raw_buffer_load_mmap): Use MAP_SHARED when
32619         is_writeable is set.
32620         (mono_raw_buffer_update): New function to write the modified map
32621         back to disk.
32622
32623         * debug-symfile.h (MonoDebugSymbolFile): Added `raw_contents_size'.
32624
32625         * debug-symfile.c (mono_debug_update_symbol_file): Call
32626         mono_raw_buffer_update() when done writing.
32627
32628 2002-03-23  Martin Baulig  <martin@gnome.org>
32629
32630         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 5.
32631
32632         * debug-symfile.c: Added support for arguments and local variables.
32633
32634 2002-03-23  Dick Porter  <dick@ximian.com>
32635
32636         * debug-symfile.c: Remove extraneous 'include <elf.h>' that wasn't
32637         protected by ifdefs, hence breaking the w32 build.
32638
32639 Thu Mar 21 17:35:01 CET 2002 Paolo Molaro <lupus@ximian.com>
32640
32641         * object.c: implement is_interned() the right way.
32642
32643 2002-03-21  Martin Baulig  <martin@gnome.org>
32644
32645         * debug-symfile.[ch]: New files to handle debugging information
32646         files. There's also support to dynamically update these symbol
32647         files to include machine dependent information.
32648
32649 2002-03-20  Dietmar Maurer  <dietmar@ximian.com>
32650
32651         * threads.c (mono_thread_create): new function to create thread
32652         from C
32653
32654 2002-03-20  Martin Baulig  <martin@gnome.org>
32655
32656         * icall.c (ves_icall_InternalInvoke): Create a new object if the
32657         method is a constructor.
32658         (icall_map): Added "System.Reflection.MonoCMethod::InternalInvoke",
32659         points to ves_icall_InternalInvoke().
32660
32661 2002-03-20  Dan Lewis <dihlewis@yahoo.co.uk>
32662
32663         * file-io.c: Flush shouldn't throw exceptions.
32664
32665 2002-03-19  Dan Lewis <dihlewis@yahoo.co.uk>
32666
32667         * file-io.c: FileStream flush support; FileSetLength now
32668         restores file pointer.
32669
32670 Tue Mar 19 18:17:21 CET 2002 Paolo Molaro <lupus@ximian.com>
32671
32672         * class.c: set image for pointer classes.
32673
32674 2002/03/19  Nick Drochak <ndrochak@gol.com>
32675
32676         * sysmath.c: Forgot one.
32677
32678 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
32679
32680         * sysmath.c: Avoid redefining existing names.
32681
32682 2002-03-18  Dan Lewis <dihlewis@yahoo.co.uk>
32683
32684         * sysmath.c, sysmath.h, icall.c, Makefile.am: math routines now
32685         handled by runtime as icall rather than dllimport from libm.so
32686         * file-io.c, file-io.h: fixed handle argument type.
32687
32688 2002-03-18  Dick Porter  <dick@ximian.com>
32689
32690         * reflection.c (mono_image_get_type_info): rename interface to
32691         iface, because of "#define interface struct" on windows.
32692
32693 Sat Mar 16 19:18:38 CET 2002 Paolo Molaro <lupus@ximian.com>
32694
32695         * class.c, class.h: rename and export mono_ptr_class_get().
32696         * metadata.c: support MONO_TYPE_ARRAY in MonoType compare.
32697         * reflection.c, reflection.h, icall.c: better/saner type name
32698         parsing and MonoType creation. Handle MONO_TYPE_ARRAY in
32699         method signatures.
32700
32701 2002-03-14  Dietmar Maurer  <dietmar@ximian.com>
32702
32703         * class.c (mono_class_init): removed hardcoded GHC_SLOT
32704
32705         * icall.c (ves_icall_InternalInvoke): impl.
32706
32707 Wed Mar 13 00:27:30 CET 2002 Paolo Molaro <lupus@ximian.com>
32708
32709         * reflection.c: output the interface map table, too.
32710
32711 2002-03-12  Dietmar Maurer  <dietmar@ximian.com>
32712
32713         * class.c (class_compute_field_layout): separate computation of 
32714         static field layout
32715
32716 2002-03-12  Dan Lewis <dihlewis@yahoo.co.uk>
32717
32718         * icall.c: added System.Buffer support.
32719         * file-io.c: moved file icalls from PAL to FileStream.
32720
32721 2002-03-12  Dietmar Maurer  <dietmar@ximian.com>
32722
32723         * icall.c (ves_icall_System_Object_GetHashCode): impl.
32724
32725 2002-03-11  Dietmar Maurer  <dietmar@ximian.com>
32726
32727         * icall.c (ves_icall_System_ValueType_GetHashCode): impl.
32728
32729 Mon Mar 11 14:45:42 CET 2002 Paolo Molaro <lupus@ximian.com>
32730
32731         * verify.c, verify.h: moved here the corlib/runtime consistency checks.
32732
32733 Mon Mar 11 11:12:23 CET 2002 Paolo Molaro <lupus@ximian.com>
32734
32735         * debug-helpers.{c,h}: moved here from monograph some useful functions
32736         to locate a method by name/signature in a class or image. Included
32737         also a small and flexible IL disassembler.
32738
32739 Fri Mar 8 16:29:29 CET 2002 Paolo Molaro <lupus@ximian.com>
32740
32741         * reflection.c: fixup tokens in methods with small header size, too.
32742
32743 2002-03-08  Dietmar Maurer  <dietmar@ximian.com>
32744
32745         * object.c (mono_string_to_utf8): remove assert(!error), instead
32746         print a warning. 
32747
32748 Thu Mar 7 18:55:15 CET 2002 Paolo Molaro <lupus@ximian.com>
32749
32750         * icall.c: update to the new mono_Array_class_get interface.
32751
32752 Thu Mar 7 17:23:26 CET 2002 Paolo Molaro <lupus@ximian.com>
32753
32754         * appdomain.c, object.c: Boehm-GC enable.
32755         * icall.c: make get_data_chunk() support split data requests.
32756         Ensure a class is initialized in more cases. Return only the first
32757         property found in GetProperties() or the compiler gets confused. 
32758         Implemented GetEvents(). Temporary fix to GetType(), needs rewriting.
32759         * reflection.h, reflection.c: add fixup mechanism for field and method
32760         tokens. Initialize assembly->typeref in a single place. Output
32761         properties after events. Support custom attributes for events, too.
32762         Typo fix for paramter custom attrs.
32763
32764 2002-03-07  Martin Baulig  <martin@gnome.org>
32765
32766         * icall.c (ves_icall_System_Array_FastCopy): Small fix.
32767
32768 2002-03-07  Dietmar Maurer  <dietmar@ximian.com>
32769
32770         * class.c (mono_array_class_get): fix. for multi. dim. arrays
32771
32772 2002-03-06  Martin Baulig  <martin@gnome.org>
32773
32774         * icall.c (ves_icall_System_Array_CreateInstanceImpl): Make this work with
32775         non-zero lower bounds. See testcases #F10-#F13.
32776
32777 2002-03-05  Martin Baulig  <martin@gnome.org>
32778
32779         * exception.c (mono_get_exception_argument_out_of_range): New exception.
32780
32781         * icall.c (ves_icall_System_Array_GetValue): Moved actual implementation to
32782         ves_icall_System_Array_GetValue(), only calculate the absolute array position
32783         here.
32784         (ves_icall_System_Array_SetValue): Likewise.
32785         (ves_icall_System_Array_GetValueImpl): New interncall. Takes an array position
32786         as argument and does the actual work. This function is used when copying a
32787         multi-dimensional array.
32788         (ves_icall_System_Array_SetValueImpl): Almost completely rewrote this. It can
32789         now do all the widening conversions of value types.
32790         (ves_icall_System_Array_CreateInstanceImpl): Implemented.
32791
32792 Tue Mar 5 18:14:01 CET 2002 Paolo Molaro <lupus@ximian.com>
32793
32794         * class.c: remove some magic numbers and use the smbolic names,
32795         instead. Added init_events() to load event info at class init time.
32796         * metadata.h, metadata.c: added mono_metadata_events_from_typedef()
32797         and mono_metadata_methods_from_event().
32798         * reflection.h, reflection.c: added support for writing out the evnets
32799         related information.
32800
32801 Mon Mar 4 20:32:43 CET 2002 Paolo Molaro <lupus@ximian.com>
32802
32803         * reflection.h, icall.c: use a different method (GetInterfaces)
32804         to gather interface info and add isbyref, isprimitive and
32805         ispointer to the ves_icall_get_type_info() return value.
32806
32807 Mon Mar 4 11:22:26 CET 2002 Paolo Molaro <lupus@ximian.com>
32808
32809         * class.h: stared adding support for events.
32810         * icall.c: split find_members implementation. Added debug icall to get
32811         the address of an object.
32812         * reflection.c: handle TypeBuilders in mono_type_get_object().
32813
32814 2002-03-01  Martin Baulig  <martin@gnome.org>
32815
32816         * icall.c (ves_icall_System_Array_GetLength): This must throw an
32817         ArgumentOutOfRangeException(), not an ArgumentException().
32818         (ves_icall_System_Array_GetLowerBound): Likewise.
32819         (ves_icall_System_Array_GetValue): Improved argument checking.
32820         (ves_icall_System_Array_SetValue): Improved argument checking.
32821
32822 2002-03-01  Martin Baulig  <martin@gnome.org>
32823
32824         * icall.c (ves_icall_System_Array_GetValue): Raise an exception when
32825         called with invalid arguments rather than just dying with g_assert().
32826         (ves_icall_System_Array_SetValue): Likewise.
32827         (ves_icall_System_Array_CreateInstanceImpl): Don't g_assert_not_reached(),
32828         raise a NotImplementedException instead.
32829         (ves_icall_System_Array_GetLength): Added argument checking.
32830         (ves_icall_System_Array_GetLowerBound): Added argument checking.
32831
32832 2002-03-01  Dietmar Maurer  <dietmar@ximian.com>
32833
32834         * object.h (mono_assert): new macros mono_assert and
32835         mono_assert_not_reached
32836
32837 2002-02-28  Martin Baulig  <martin@gnome.org>
32838
32839         * icall.c: Rename "System::String::Intern" to "System::String::_Intern"
32840         and "System::String::IsInterned" to "System::String::_IsInterned".
32841
32842 Thu Feb 28 19:19:35 CET 2002 Paolo Molaro <lupus@ximian.com>
32843
32844         * icall.c: remove hacks for typebuilder. Added icall to create a
32845         modified type from a tybebuilder.
32846         * reflection.c: removed hacks for TypeBuilder. Create also a MonoImage
32847         in mono_image_basic_init (). Added mono_reflection_setup_internal_class ()
32848         to create a backing MonoClass for a TypeBuilder.
32849
32850 Thu Feb 28 15:35:51 CET 2002 Paolo Molaro <lupus@ximian.com>
32851
32852         * class.c, class.h: more refactoring of class init.
32853         Export mono_class_setup_mono_type() and mono_class_setup_parent().
32854
32855 Thu Feb 28 12:33:41 CET 2002 Paolo Molaro <lupus@ximian.com>
32856
32857         * marshal.c, marshal.h: start of marshaling interface.
32858
32859 Wed Feb 27 22:15:17 CET 2002 Paolo Molaro <lupus@ximian.com>
32860
32861         * icall.c: fix order in assembly qualified name icall.
32862
32863 Wed Feb 27 18:45:03 CET 2002 Paolo Molaro <lupus@ximian.com>
32864
32865         * class.c: do not free str, since we store it in the hash table.
32866         * reflection.h: add label field to MonoILExceptionInfo.
32867         * reflection.c: handle references to more than one assembly. Handle
32868         case when there isn't a module created in the assembly.
32869
32870 Wed Feb 27 12:35:10 CET 2002 Paolo Molaro <lupus@ximian.com>
32871
32872         * class.c: Fix typo. Start refactoring of class init code.
32873
32874 Wed Feb 27 12:23:00 CET 2002 Paolo Molaro <lupus@ximian.com>
32875
32876         * appdomain.c: exit with 1 on error.
32877         * class.c: we already have the name in MonoClassField.
32878         * image.c, image.h, metadata.c, pedump.c: use directly a pointer in
32879         MonoStreamHeader instead of an offset of image->raw_metadata.
32880
32881 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
32882
32883         * appdomain.c (mono_init): Be even more descriptive about the error.
32884
32885 Tue Feb 26 16:18:07 CET 2002 Paolo Molaro <lupus@ximian.com>
32886
32887         * appdomain.c: give the user an informative message when corlib can't
32888         be loaded.
32889
32890 2002-02-26  Martin Baulig  <martin@gnome.org>
32891
32892         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData):
32893         New icall to get the time zone data.
32894
32895 Mon Feb 25 15:51:51 CET 2002 Paolo Molaro <lupus@ximian.com>
32896
32897         * reflection.c: set virtual and raw size of section correctly.
32898         * threads.c: transfer domain information to newly created threads.
32899
32900 Fri Feb 22 18:55:57 CET 2002 Paolo Molaro <lupus@ximian.com>
32901
32902         * class.c: when instancing a class in a domain, load the default
32903         vaules for static fields from the constant table. Fix System.Enum to
32904         not be an enum.
32905         * icall.c: implement Object::GetType() internalcall. Implemented
32906         MonoField::GetValue() internalcall. Avoid SEGV in search_method().
32907         Fixed checking of binding flags in find_members().
32908         * metadata.c, metadata.h: introduce mono_metadata_type_hash().
32909         * reflection.c: handle enumerations when writing to the constant
32910         table. Use a different object cache for types.
32911
32912
32913 2002-02-22  Dietmar Maurer  <dietmar@ximian.com>
32914
32915         * object.c (mono_object_isinst): fix for arrays
32916
32917         * icall.c (ves_icall_type_is_subtype_of): fix for 2 interfaces
32918
32919 Thu Feb 21 21:00:13 CET 2002 Paolo Molaro <lupus@ximian.com>
32920
32921         * object.c: don't use mprotect ()  and fix intern pool hash table
32922         lookup for big endian systems.
32923
32924 Thu Feb 21 19:30:29 CET 2002 Paolo Molaro <lupus@ximian.com>
32925
32926         * icall.c: change type_is_subtype_of () signature.
32927
32928 2002-02-21  Mark Crichton  <crichton@gimp.org>
32929
32930         * rand.c, rand.h: Added random number generator for
32931         System.Security.Cryptography classes.
32932
32933         * exception.c, exception.h: Added mono_get_exception_not_implemeted.
32934
32935         * icall.c: Added System.Security.Cryptography calls.
32936
32937 Thu Feb 21 16:45:34 CET 2002 Paolo Molaro <lupus@ximian.com>
32938
32939         * class.c, icall.c, metadata.c: better support for pointer types.
32940         Create a class for them as suggested by dietmar. Fix TYPE_ARRAY class.
32941         * reflection.c: Add support for getting custom attrs for properties
32942         and simplify some code.
32943
32944 Wed Feb 20 22:20:29 CET 2002 Paolo Molaro <lupus@ximian.com>
32945
32946         * icall.c: change getToken () and add custom attribute GetBlob()helper
32947         method.
32948         * reflection.h: add custom attrs array to the reflection builder structures.
32949         * reflection.c: encode and emit custom attributes for all the relevant
32950         reflection objects. Cache fieldref and methodref tokens. Change
32951         mono_image_create_token() interface to take a MonoDynamicAssembly.
32952         More complete custom attributes decoder. Load custom attributes for
32953         Assembly, Field, Method and Constructor objects, too. Make the
32954         returned array an Attribute[] one, not object[]. Added
32955         mono_reflection_get_custom_attrs_blob() to encode the arguments of a
32956         custom attribute constructor.
32957
32958 2002-02-20  Dick Porter  <dick@ximian.com>
32959
32960         * icall.c:
32961         * rawbuffer.c:
32962         * socket-io.c: Windows portability fixes (sometimes just ifdeffing
32963         problem code out for now).
32964
32965 2002-02-19  Radek Doulik  <rodo@ximian.com>
32966
32967         * object.c (mono_ldstr): use hash table to avoid multiple swapping
32968
32969 Tue Feb 19 20:23:11 CET 2002 Paolo Molaro <lupus@ximian.com>
32970
32971         * icall.c: register the GetCustomAttributes method.
32972         * object.c, object.h: add mono_string_new_len ().
32973         * reflection.h, reflection.c: added mono_runtime_invoke(),
32974         mono_install_runtime_invoke(). Added
32975         mono_reflection_get_custom_attrs () to load custom attributes and
32976         create the attribute objects.
32977
32978 2002-02-19  Dick Porter  <dick@ximian.com>
32979         * threads-dummy-types.c:
32980         * threads-dummy-types.h:
32981         * threads-dummy.c:
32982         * threads-dummy.h:
32983         * threads-pthread-types.c:
32984         * threads-pthread-types.h:
32985         * threads-pthread.c:
32986         * threads-pthread.h:  Deleted obsolete files
32987
32988 2002-02-19  Dietmar Maurer  <dietmar@ximian.com>
32989
32990         * class.c (mono_class_vtable): runtime init the class when we
32991         allocate static class data.
32992
32993         * icall.c (ves_icall_System_Array_SetValue): check for null values.
32994
32995         * appdomain.c (mono_domain_transfer_object): impl. hack for Arrays
32996         and String - but we will need generic marshalling support in the
32997         future. 
32998         (mono_init): set the domain name in a ms compatible way
32999
33000         * object.c (mono_string_new_utf16): bug fix: use char[] instead of
33001         String[].
33002
33003 2002-02-18  Dietmar Maurer  <dietmar@ximian.com>
33004
33005         * object.c (mono_array_clone): use alloca() instead of g_malloc  
33006         for sizes
33007
33008         * appdomain.c (mono_domain_unload): impl.
33009
33010 Mon Feb 18 15:52:20 CET 2002 Paolo Molaro <lupus@ximian.com>
33011
33012         * appdomain.c, object.c: fix intern pool implementation.
33013         * class.c: fix alignment code.
33014
33015 2002-02-16  Radek Doulik  <rodo@ximian.com>
33016
33017         * icall.c (ves_icall_System_Enum_ToObject): in case of big endian
33018         and s2 > s1, just copy lower bytes to be compatible with little
33019         endian (i.e. 64bit value & 0xffffffff --> 32bit value)
33020         (ves_icall_System_Enum_ToObject): and likewise for s1 > s2
33021
33022         * unicode.c (ves_icall_iconv_new_encoder): decide on big_endian,
33023         force big_endian to be 1 for big endian machines 
33024         (ves_icall_iconv_new_decoder): ditto
33025
33026 2002-02-16  Jeffrey Stedfast  <fejj@ximian.com>
33027
33028         * socket-io.c (convert_sockopt_level_and_name): If the system
33029         doesn't define SOL_IP or SOL_TCP, get them by hand using
33030         getprotobyname() and caching the values (because this could be a
33031         slow operation).
33032         (ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal):
33033         Use the appropriate struct when the system does support it. Ie,
33034         not all systems have struct ip_mreqn so use struct ip_mreq when
33035         appropriate.
33036
33037 Fri Feb 15 18:15:44 CET 2002 Paolo Molaro <lupus@ximian.com>
33038
33039         * reflection.c: handle finally clauses.
33040
33041 Fri Feb 15 15:06:33 CET 2002 Paolo Molaro <lupus@ximian.com>
33042
33043         * socket-io.c: use g_snprintf() instead of snprintf.
33044
33045 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
33046
33047         * reflection.c (mono_param_get_objects): Cast second argument to
33048         mono_method_get_param_names to a const char** to silence the
33049         compiler warning.
33050
33051         * appdomain.c (mono_domain_assembly_open): Put parens around the
33052         truth statement in the for-loop.
33053
33054         * unicode.c (iconv_convert): Got rid of a compiler warning about
33055         int i being unused when the system has a new iconv.
33056         (iconv_get_length): Same.
33057
33058         * image.c (load_class_names): Cast the second argument to
33059         g_hash_table_insert() to char* to hush compiler warnings about the
33060         arg being a const.
33061         (mono_image_open): Same here.
33062
33063         * socket-io.c: Don't conditionally include sys/filio.h or
33064         sys/sockio.h here anymore since we now get them from
33065         io-layer/io-layer.h
33066         (inet_pton): If the system doesn't support inet_aton, implement
33067         using inet_addr and also #define INADDR_NONE if it isn't defined
33068         by the system.
33069
33070 Thu Feb 14 19:01:06 CET 2002 Paolo Molaro <lupus@ximian.com>
33071
33072         * metadata.c, metadata.h: added function to get packing and size info
33073         of a typedef.
33074         * reflection.h, reflection.c: handle field RVA data. Save info about
33075         the table layout if needed. Assign typedef indexes to all the types
33076         before dumping the info about them to avoid forward reference problems.
33077
33078 2002-02-14  Dietmar Maurer  <dietmar@ximian.com>
33079
33080         * socket-io.c (convert_sockopt_level_and_name): ifdef
33081         SO_ACCEPTCONN because it is not defined on my system (old debian)
33082
33083 Thu Feb 14 11:49:30 CET 2002 Paolo Molaro <lupus@ximian.com>
33084
33085         * opcode.c: use stddef.h to get NULL.
33086
33087 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
33088
33089         * socket-io.c: conditionally include sys/filio.h and sys/sockio.h
33090         for FIONBIO, FIONREAD and SIOCATMARK.
33091         (ves_icall_System_Net_Dns_GetHostByAddr_internal): SunOS doesn't
33092         define INADDR_NONE and besides, inet_addr() is deprecated and
33093         should not be used. Use inet_pton() instead - it also has the
33094         added bonus that it can easily handle IPv6 addresses as well.
33095         (inet_pton): Implement using inet_aton() ifndef HAVE_INET_PTON.
33096
33097 Wed Feb 13 23:00:21 CET 2002 Paolo Molaro <lupus@ximian.com>
33098
33099         * decimal.c: remove _MSC_VER conditional.
33100
33101 2002-02-13  Dick Porter  <dick@ximian.com>
33102
33103         * socket-io.c: 
33104         * icall.c: Internal calls for Blocking, Select, Shutdown,
33105         GetSocketOption and SetSocketOption
33106
33107 Wed Feb 13 19:20:01 CET 2002 Paolo Molaro <lupus@ximian.com>
33108
33109         * assembly.cs: better resolver: use it instead of some kludgy
33110         code.
33111
33112 Wed Feb 13 18:25:55 CET 2002 Paolo Molaro <lupus@ximian.com>
33113
33114         * reflection.c: the best way to speed-up the compiler is to avoid
33115         infinite loops.
33116
33117 2002-02-13  Dietmar Maurer  <dietmar@ximian.com>
33118
33119         * class.c (mono_class_vtable): changed the object layout
33120         (obj->vtable->class). 
33121         (mono_class_create_from_typespec): consider MONO_TYPE_PTR
33122
33123 Tue Feb 12 20:06:01 CET 2002 Paolo Molaro <lupus@ximian.com>
33124
33125         * assembly.c: look for assemblies in the assembly dir, too.
33126
33127 Tue Feb 12 14:03:42 CET 2002 Paolo Molaro <lupus@ximian.com>
33128
33129         * class.c: fix thinko in mono_class_from_type().
33130
33131 Mon Feb 11 19:43:51 CET 2002 Paolo Molaro <lupus@ximian.com>
33132
33133         * exception.h, exception.c: added TypeLoadException.
33134         * object.h, object.c: added mono_array_clone ().
33135         * icall.c: handle throwOnError in AssemblyGetType().
33136         Added Array.Clone().
33137         * opcode.h, opcode.c: use a single value for the opcode val.
33138         Compile fix for non-gcc compilers.
33139
33140 Fri Feb 8 12:26:37 CET 2002 Paolo Molaro <lupus@ximian.com>
33141
33142         * opcodes.c, opcodes.h: export interesting info about opcodes.
33143
33144 2002-02-05  Dietmar Maurer  <dietmar@ximian.com>
33145
33146         * object.h (MONO_CHECK_ARG, MONO_CHECK_ARG_NULL): new macro for
33147         icalls. 
33148
33149         * class.c (class_compute_field_layout): set element_class for enums
33150         (mono_class_create_from_typedef): set element_class for normal classes
33151
33152         * icall.c (ves_icall_System_Enum_get_value): impl.
33153
33154         * class.c (mono_class_create_from_typedef): do not set valuetype
33155         flag for System.ValueType and System.Enum
33156
33157 2002-02-04  Dietmar Maurer  <dietmar@ximian.com>
33158
33159         * unicode.c (iconv_convert): fix big endian problem.
33160
33161 Fri Feb 1 16:13:20 CET 2002 Paolo Molaro <lupus@ximian.com>
33162
33163         * class.c: add asserts if we are ever going to scribble over memory.
33164         * socket-io.c: not all systems have AF_IRDA defined.
33165
33166 2002-01-31  Dietmar Maurer  <dietmar@ximian.com>
33167
33168         * class.c (class_compute_field_layout): do not consider static
33169         fields to compute alignment
33170
33171 2002-01-25  Dietmar Maurer  <dietmar@ximian.com>
33172
33173         * appdomain.c (mono_appdomain_get): impl.
33174         (ves_icall_System_AppDomain_ExecuteAssembly): impl.
33175
33176 Thu Jan 24 12:59:23 CET 2002 Paolo Molaro <lupus@ximian.com>
33177
33178         * icall.c: ignore "file://" prefix when loading an assembly.
33179
33180 2002-01-23  Dick Porter  <dick@ximian.com>
33181
33182         * socket-io.c:
33183         * icall.c:
33184         * Makefile.am: Added socket support
33185
33186 2002-01-23  Miguel de Icaza  <miguel@ximian.com>
33187
33188         * icall.c (ves_icall_appdomain_get_default_assemblies): put this
33189         code back.  This should return the assemblies that are loaded by
33190         the runtime on behalf of an application domain. 
33191
33192         The current implementation is still broken, it just returns every
33193         assembly loaded, but until we get real applications domain this
33194         will do.
33195
33196 2002-01-23  Dietmar Maurer  <dietmar@ximian.com>
33197
33198         * icall.c (ves_icall_appdomain_get_cur_domain): runtime_init the
33199         AppDomain object.
33200
33201 2002-01-23  Miguel de Icaza  <miguel@ximian.com>
33202
33203         * icall.c (ves_icall_appdomain_get_cur_domain): Cache the value of
33204         the mono_class_from_name lookup.
33205         (ves_icall_get_parameter_info): ditto.
33206         (ves_icall_appdomain_get_assemblies, add_assembly): Implement new internal
33207         method.
33208         (ves_icall_System_Reflection_Assembly_get_code_base): Another new call.
33209
33210 Tue Jan 22 22:43:47 CET 2002 Paolo Molaro <lupus@ximian.com>
33211
33212         * class.c: load also nested classes on class init.
33213         System.ValueType instance methods gets passed boxed
33214         values, unless methods in derived classed that get a pointer to the
33215         data.
33216         * icall.c: use better name parsing code in GetType().
33217         * image.c, image.h: add mono_image_loaded ().
33218         * metadata.c, metadata.h: add mono_metadata_nesting_typedef ().
33219         * reflection.c, reflection.h: added mono_reflection_parse_type().
33220
33221 2002-01-22  Veronica De Santis <veron78@interfree.it>
33222
33223         * icall.c : Added mapping of internal calls for Manual and Auto reset events
33224         * threads.c : Added the implementation of internal calls for events
33225         * threads.h : Added prototypes of internal calls for events
33226         
33227 2002-01-21  Radek Doulik  <rodo@ximian.com>
33228
33229         * icall.c (ves_icall_InitializeArray): swap bytes on big endians
33230
33231 2002-01-21  Dietmar Maurer  <dietmar@ximian.com>
33232
33233         * class.c (mono_class_init): set min_align to 1 (instead of 0)
33234         (mono_class_value_size): use min_align
33235
33236 2002-01-20  Dick Porter  <dick@ximian.com>
33237
33238         * threads.h:
33239         * threads.c: Replaced all instances of WapiHandle * with HANDLE,
33240         so it compiles on w32.
33241
33242 2002-01-17  Dietmar Maurer  <dietmar@ximian.com>
33243
33244         * metadata.c (mono_type_stack_size): impl.
33245
33246         * class.c (mono_class_get_field): impl. memberref token
33247
33248 2002-01-16 Veronica De Santis <veron78@@interfree.it>
33249
33250         * icall.h : Added the internal calls mapping for CreateMutex_internal
33251                     and ReleaseMutex_internal.
33252         * threads.h : Added the prototype of mutexes internal calls.
33253         * threads.c : Added the implementations of mutexes internal calls.
33254
33255 Tue Jan 15 22:47:57 CET 2002 Paolo Molaro <lupus@ximian.com>
33256
33257         * metaparse.h: removed unused file.
33258         * reflection.c, reflection.h: added stream_data_align () function 
33259         to align data in streams and keep stream aligned. Add support for
33260         exception support in method headers.
33261
33262 Tue Jan 15 19:42:50 CET 2002 Paolo Molaro <lupus@ximian.com>
33263
33264         * unicode.c: make iconv_convert () return the number of bytess written
33265         in the output buffer.
33266
33267 2002-01-15  Dick Porter  <dick@ximian.com>
33268         * threads.c: Make the runtime's idea of infinite timeouts coincide
33269         with the class library's
33270
33271         Fix a particularly egregious bug in mono_thread_cleanup(). That
33272         code was so utterly bogus it must have been written on a Monday.
33273
33274 Mon Jan 14 17:01:03 CET 2002 Paolo Molaro <lupus@ximian.com>
33275
33276         * reflection.h: add subtypes field to TypeBuilder.
33277         * reflection.c: encode constants for literal fields.
33278         Handle subtypes. Fix user string token (and add a zero byte)
33279         at the end.
33280         
33281 2002-01-14  Dietmar Maurer  <dietmar@ximian.com>
33282
33283         * class.c (mono_class_init): bug fix: assign slot numbers for
33284         abstract methods.
33285
33286 Fri Jan 11 18:54:42 CET 2002 Paolo Molaro <lupus@ximian.com>
33287
33288         * reflection.c: don't try to output a code RVA for abstract methods.
33289         Small fixes for method header format. Output parameter info to the
33290         ParamDef table. Save method overriding info to MethodImpl table.
33291         Fix property support. Allow typedef.extends to be a type in the
33292         building assembly.
33293         * verify.c: fix off-by-one error.
33294
33295 Thu Jan 10 19:36:27 CET 2002 Paolo Molaro <lupus@ximian.com>
33296
33297         * class.c: fix mono_class_from_mono_type () for szarray types.
33298         Remove unused cache check in mono_class_from_type_spec().
33299         * icall.c: *type_from_name () functions handle simple arrays and byref.
33300         * reflection.c: handle byref and szarray types. Handle methods without
33301         body (gets P/Invoke compilation working). Handle types and fields in
33302         get_token ().
33303         * reflection.h: add rank to MonoTypeInfo.
33304
33305 2002-01-10  Dick Porter  <dick@ximian.com>
33306
33307         * threads.c: Implemented WaitAll(), WaitAny() and WaitOne()
33308         internal calls
33309
33310 Wed Jan 9 19:27:13 CET 2002 Paolo Molaro <lupus@ximian.com>
33311
33312         * icall.c: initialize class in type_from_handle ().
33313         Loop also in parent classes for get_method ().
33314         * reflection.c: properly encode class and valuetype types.
33315         Start on encoding TypeBuilder types. Handle fieldrefs.
33316         Use correct length when registering a user string.
33317         Handle ConstructorBuilder and MonoMethod in get_token ().
33318         Make mono_type_get_object () aware of cached types.
33319         * object.c: back out change to mono_string_new ().
33320
33321 Tue Jan 8 22:47:44 EST 2002 Matt Kimball <matt@kimball.net>
33322         * object.c: mono_string_new should return a NULL when the string 
33323         passed in is NULL -- not try to deference it.
33324         
33325 Sat Jan 5 15:48:04 CET 2002 Paolo Molaro <lupus@ximian.com>
33326
33327         * icall.c: hack to make IsSubType work for TypeBuilders.
33328         * reflection.c: emit constructors before methods.
33329         Retrieve param names in mono_param_get_objects().
33330
33331 2002/01/05  Nick Drochak  <ndrochak@gol.com>
33332
33333         * Makefile.am: fix list of headers and sources so automake 1.5
33334         doesn't complain. Removed \# at end of list.
33335
33336 Thu Jan 3 23:17:17 CET 2002 Paolo Molaro <lupus@ximian.com>
33337
33338         * reflection.c: get token for a method ref. Set return type of
33339         constructor to void.
33340         * loader.c: debug message.
33341         * class.c: typo fix.
33342
33343 Mon Dec 24 17:18:10 CET 2001 Paolo Molaro <lupus@ximian.com>
33344
33345         * icall.c: fix array init with rank > 1. FindMembers
33346         loops in parent class as well.
33347         * image.c: do not insert nested types in name cache.
33348         * reflection.c: warning fix.
33349         * reflection.h: add override method (for interface impl).
33350
33351 Mon Dec 24 16:16:56 CET 2001 Paolo Molaro <lupus@ximian.com>
33352
33353         * metadata.c: fix customattr decoding.
33354
33355 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
33356
33357         * rawbuffer.cs: Added native Win32 implementation, avoids using
33358         mmap on Cygwin.  This patch is from Dan Lewis (dihlewis@yahoo.co.uk)
33359
33360 Thu Dec 20 20:11:26 CET 2001 Paolo Molaro <lupus@ximian.com>
33361
33362         * class.c: make the low-level routines handle the cache.
33363
33364 Thu Dec 20 15:20:35 CET 2001 Paolo Molaro <lupus@ximian.com>
33365
33366         * image.c: fopen (file, "rb") ("David Dawkins" <david@dawkins.st>).
33367
33368 Tue Dec 18 18:50:00 CET 2001 Paolo Molaro <lupus@ximian.com>
33369
33370         * class.c: fix mono_array_element_size() for objects.
33371         * class.h, class.c: add properties to MonoClass and load them
33372         at init time.
33373         * icall.c: check with isinst() when assigning a value to an array
33374         instead of requiring the classes to match exactly.
33375         Implemented icall for System.Type::GetType().
33376         Implemented icalls to get ParameterInfo, ProprtyInfo and info about
33377         enums. Handle bindingflags when looking for methods and fields.
33378         * metadata.h, metadata.c: implemented mono_metadata_properties_from_typedef()
33379         and mono_metadata_methods_from_property().
33380         * reflection.h, reflection.c: added structures for propreties,
33381         parameters and enums. Implemented mono_property_get_object() and
33382         mono_param_get_objects().
33383
33384 2001-12-18  Dick Porter  <dick@ximian.com>
33385
33386         * file-io.c: Use mono_string_to_utf16() instead of
33387         mono_string_chars()
33388
33389         * object.c: Added mono_string_to_utf16(), which copies the non
33390         NULL-terminated MonoString into a new double-null-terminated
33391         buffer.
33392
33393 2001-12-17  Dietmar Maurer  <dietmar@ximian.com>
33394
33395         * icall.c (ves_icall_System_DateTime_GetNow): added EPOCH adjustment
33396
33397 2001-12-16  Dietmar Maurer  <dietmar@ximian.com>
33398
33399         * file-io.c: raise exceptions if handle is invalid.
33400
33401 Thu Dec 13 20:27:08 CET 2001 Paolo Molaro <lupus@ximian.com>
33402
33403         * assembly.c: yet another check for mscorlib.
33404         * class.c, class.h: load nesting info for classes.
33405         * icall.c: many new functions to support the Reflection classes.
33406         * metadata.c, metadata.h: mono_metadata_nested_in_typedef() added.
33407         * reflection.h, reflection.c: mono_image_create_token(),
33408         mono_assembly_get_object(), mono_type_get_object(),
33409         mono_method_get_object(), mono_field_get_object(): methods to return
33410         objects that parallel the C representation of assemblies, types,
33411         methods, fields.
33412
33413 2001-12-11  Dick Porter  <dick@ximian.com>
33414
33415         * icall.c:
33416         * file-io.c: Internal calls for file IO.
33417
33418 Thu Dec 6 16:21:30 CET 2001 Paolo Molaro <lupus@ximian.com>
33419
33420         * tabledefs.h: missing FileAttributes.
33421         * verify.h, verify.c: use is_valid_string () to simplify and check for
33422         valid strings more correctly. Fix warnings and speeling.
33423         Check more tables: Filed, File, ModuleRef, StandAloneSig.
33424         Check code: branches, maxstack, method calls.
33425
33426 2001-12-04  Dietmar Maurer  <dietmar@ximian.com>
33427
33428         * object.c (mono_object_allocate): removed static, so that the jit
33429         can allocate value types.
33430
33431         * icall.c (ves_icall_System_DateTime_GetNow): impl.
33432
33433 Mon Dec 3 17:02:01 CET 2001 Paolo Molaro <lupus@ximian.com>
33434
33435         * class.c: init enum types right away and register the
33436         token->MonoClass map in mono_class_create_from_typedef ().
33437         * verify.h, verify.c: first cut of the verifier.
33438         * pedump.c: add --verify switch to verify metadata tables.
33439         * tabledefs.h: add some missing enums.
33440
33441 2001-11-30  Dietmar Maurer  <dietmar@ximian.com>
33442
33443         * class.c (mono_install_runtime_class_init): impl.
33444         (mono_class_init): renamed mono_class_metadata_init to
33445         mono_class_init, also removed the metadata_inited flag
33446
33447         * object.c (mono_object_isinst): use faster algorithm
33448
33449 2001-11-30  Radek Doulik  <rodo@ximian.com>
33450
33451         * mono-endian.h: reverted last change
33452         added function prototypes
33453
33454         * Makefile.am (libmetadata_a_SOURCES): reverted my last change and
33455         add mono-endian.c back
33456
33457         * mono-endian.c: returned back, as Paolo pointed out, it's needed
33458         for unaligned access, I've mistaked it with endianess. I am
33459         sorry.
33460         (mono_read16): fix reverted endianess
33461         (mono_read64): ditto
33462         (mono_read32): ditto
33463
33464 2001-11-30  Dick Porter  <dick@ximian.com>
33465
33466         * exception.c: Implement mono_exception_from_name()
33467
33468 Fri Nov 30 12:01:02 CET 2001 Paolo Molaro <lupus@ximian.com>
33469
33470         * metadata.h, metadata.c: remove params_size and locals_size and their
33471         calculation from the metadata code: they are only usefult to the
33472         interp.
33473
33474 2001-11-29  Radek Doulik  <rodo@ximian.com>
33475
33476         * object.c (mono_ldstr): swap bytes here, it's probably not the
33477         best place, but works for me now, I'll redo it once I know mono
33478         better, also note that I add PROT_WRITE and don't reset back, also
33479         note that it's only affects big endians, so x86 should be OK
33480
33481         * mono-endian.h (read16): use just glib macros for both endians
33482
33483         * mono-endian.c: removed as glib macros are used in in
33484         mono-endian.h so we don't need to care about endianess for read
33485         macros as glib does that for us already
33486
33487 Thu Nov 29 18:20:58 CET 2001 Paolo Molaro <lupus@ximian.com>
33488
33489         * class.h, class.h: take minimum alignment into consideration so
33490         that the fields of a class remain aligned also when in an array.
33491
33492 Tue Nov 27 16:39:01 CET 2001 Paolo Molaro <lupus@ximian.com>
33493
33494         * loader.h, loader.c: add mono_method_get_param_names().
33495         * class.c: 0-init class fields.
33496
33497 2001-11-26  Dick Porter  <dick@ximian.com>
33498
33499         * icall.c:
33500         * threads-types.h:
33501         * threads.c: New file that handles System.Threading on all platforms
33502
33503         * object.c: 
33504         * object.h: Remove the synchronisation struct from MonoObject,
33505         replace it with a pointer that gets initialised on demand
33506
33507         * Makefile.am: Replace all the system-specific threading code with
33508         a single file that uses the new wrapper library
33509
33510 Mon Nov 19 11:37:14 CET 2001 Paolo Molaro <lupus@ximian.com>
33511
33512         * class.c, class.h: add mono_install_trampoline() so that the runtime
33513         can register a function to create a trampoline: removes the ugly
33514         requirement that a runtime needed to export arch_create_jit_trampoline.
33515         * object.h, object.c: added mono_install_handler() so that the runtime
33516         can install an handler for exceptions generated in C code (with
33517         mono_raise_exception()). Added C struct for System.Delegate.
33518         * pedump.c: removed arch_create_jit_trampoline.
33519         * reflection.c: some cleanups to allow registering user strings and
33520         later getting a token for methodrefs and fieldrefs before the assembly
33521         is built.
33522         * row-indexes.h: updates and fixes from the new ECMA specs.
33523
33524 Thu Nov 15 17:44:49 CET 2001 Paolo Molaro <lupus@ximian.com>
33525
33526         * class.h, class.c: add enum_basetype field to MonoClass.
33527         * metadata.h, metadata.c: add mono_metadata_get_constant_index()
33528         to get index in the constant table reated to a field, param or
33529         property.
33530         * reflection.h, reflection.c: handle constructors. Set public-key and
33531         version number of the built assembly to 0.
33532         * row-indexes.h: update from new ECMA spec.
33533
33534 Wed Nov 14 19:26:06 CET 2001 Paolo Molaro <lupus@ximian.com>
33535
33536         * class.h, class.c: add a max_interface_id to MonoClass.
33537         * icall.c: rename my_mono_new_object() to my_mono_new_mono_type()
33538         since it's used to do that. Added mono_type_type_from_obj().
33539         Make GetType() return NULL instead of segfaulting if the type was not
33540         found. Handle simple arrays in assQualifiedName.
33541         * object.h: add a struct to represent an Exception.
33542         * reflection.c: output call convention in method signature.
33543         Add code to support P/Invoke methods and fixed offsets for fields.
33544
33545 Mon Nov 12 12:41:32 CET 2001 Paolo Molaro <lupus@ximian.com>
33546
33547         * decimal.c, decimal.h: mono_double2decimal() get the sign bit from
33548         the value.
33549         * icall.c: use mono_array_addr instead of array->vector: fixes the
33550         reflection image writing.
33551         * reflection.c: init call convention byte to 0 in method signature.
33552         Encode the property signature. Don't output property-related methods
33553         twice. Really process the properties for a type (don't cast a field to
33554         a property, my mom always told me that).
33555         Fix 64 bit issues in pointer alignment in a different and more
33556         readable way.
33557
33558 2001-11-10  Sean MacIsaac  <macisaac@ximian.com>
33559
33560         * loader.h: Removed type class from MonoDefaults, added monotype
33561
33562         * loader.c: Loaded MonoType, removed loading of Type
33563
33564         * icall.c (my_mono_new_object): Now returns a System.MonoType,
33565         and fills in System.Type._impl with a RuntimeTypeHandle rather
33566         than the actual MonoClass *
33567
33568         (ves_icall_type_from_handle): change from type_class to
33569         monotype_class
33570
33571         (ves_icall_System_Runtime_InteropServices_Marshal_ReadIntPtr):
33572         implemented
33573
33574         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAuto):
33575         implemented
33576
33577         (ves_icall_System_Reflection_Assembly_LoadFrom): implemented
33578
33579         (ves_icall_System_Reflection_Assembly_GetType): implemented
33580
33581         (ves_icall_System_MonoType_assQualifiedName): implemented
33582
33583         (ves_icall_System_PAL_OpSys_GetCurrentDirecotry): implemented
33584
33585 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
33586
33587         * assembly.c (mono_assembly_open): Implement a cache for the
33588         assemblies. 
33589
33590         (mono_assembly_close): only destroy the assembly when the last
33591         reference is gone.
33592         
33593 2001-11-09  Dick Porter  <dick@ximian.com>
33594
33595         * Makefile.am (pedump_LDADD): Don't need THREAD_LIBS any more
33596
33597 2001-11-09  Dietmar Maurer  <dietmar@ximian.com>
33598
33599         * class.c (mono_class_metadata_init): bug fix: compute the right slot
33600
33601 Fri Nov 9 15:48:02 CET 2001 Paolo Molaro <lupus@ximian.com>
33602
33603         * icall.c, decimal.h, decimal.c: integrated decimal internalcalls
33604         from Martin Weindel.
33605         * object.h: add mono_string_chars ().
33606
33607 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
33608
33609         * reflection.c (build_compressed_metadata): Eliminates warnings
33610         and uses 64-bit clean code.
33611
33612         * metadata.c (mono_type_hash): Change signature to eliminate warnings.
33613         (mono_type_equal): Change signature to eliminate warnings.
33614
33615 Wed Nov 7 15:40:01 CET 2001 Paolo Molaro <lupus@ximian.com>
33616
33617         * icall.c, loader.c: remove the internalcall array constructors.
33618         Changes to match the new MonoArray structure.
33619         * object.h, object.c: an array object doesn't allocate an extra
33620         vector. Add mono_array_new_full () to create jagged arrays easily.
33621
33622 Mon Nov 5 19:51:06 CET 2001 Paolo Molaro <lupus@ximian.com>
33623
33624         * metadata.h, metadata.c: add mono_metadata_field_info () to
33625         retreive all the info about a field from vairous tables.
33626         * icall.c: implement S.Runtime.CServices::InitializeArray () icall.
33627         * class.h, class.c: augment MonoClassField with more info.
33628         Implemented mono_ldtoken for fields. Implemented ExplicitLayout
33629         policy and load a field's RVA if needed.
33630
33631 2001-11-05  Dietmar Maurer  <dietmar@ximian.com>
33632
33633         * class.c (mono_class_metadata_init): create a trampoline for all
33634         virtual functions instead of actually compiling them.
33635
33636 Fri Nov 2 19:37:51 CET 2001 Paolo Molaro <lupus@ximian.com>
33637
33638         * class.h, class.c: include name in MonoClassField.
33639         * class.c: fix fundamental type of System.Object and System.String.
33640         Set the right fundamental type for SZARRAY, too. Handle TypeSpec
33641         tokens in ldtoken.
33642         * icall.c: remove internalcalls for the Reflection stuff that is now
33643         done in C# code.
33644         * loader.c: mono_field_from_memberref () implementation.
33645         * mono-endian.c: thinko (s/struct/union/g).
33646         * object.c, object.h: make the mono_string_* prototypes actually use
33647         MonoString instead of MonoObject.
33648         * reflection.c, reflection.h: updates for changes in the reflection
33649         code in corlib: we use C structures that map to the actual C# classes.
33650         Handle SZARRAYs when encoding types. Handle locals in methods. Use a
33651         fat method header if needed and use the info from the ILGenerator for
33652         methods. Handle fields in types. Misc fixes.
33653
33654 2001-10-17  Dietmar Maurer  <dietmar@ximian.com>
33655
33656         * class.c (mono_class_metadata_init): bug fix: always allocate
33657         space for static class data
33658
33659 2001-10-25  Dietmar Maurer  <dietmar@ximian.com>
33660
33661         * class.c (mono_compute_relative_numbering): use relative
33662         numbering to support fast runtime type checks.
33663
33664 2001-10-17  Sean MacIsaac  <macisaac@ximian.com>
33665
33666         * class.c (mono_class_create_from_typeref): added debugging output
33667         to print class name when MonoDummy is returned instead of real class
33668
33669 2001-10-15  Dietmar Maurer  <dietmar@ximian.com>
33670
33671         * class.c (mono_class_metadata_init): interface offset table now
33672         contains pointers into the vtable - this is more efficient for the jit
33673
33674 2001-10-12  Dietmar Maurer  <dietmar@ximian.com>
33675
33676         * class.c (mono_class_metadata_init): use a temporary vtable (the
33677         old algorithm only worked for the interpreter, but not for the jit)
33678
33679 2001-10-11  Dietmar Maurer  <dietmar@ximian.com>
33680
33681         * loader.c (method_from_memberref): use mono_class_get to get the
33682         class of an array instead of using System.Array directly.
33683         (mono_get_method): also add MEMBERREF methods to the method cache
33684         which usefull for arrays.
33685
33686 2001-10-10  Dietmar Maurer  <dietmar@ximian.com>
33687
33688         * pedump.c (arch_compile_method): added to compute vtable entry
33689
33690         * metadata.c (mono_metadata_interfaces_from_typedef): also return the
33691         number of interfaces.
33692         
33693         * class.h: merged MonoArrayClass into MonoClass
33694
33695         * class.c (mono_class_create_from_typedef): compute the vtable size and
33696         allocate space to include the vtable inside MonoClass
33697         (mono_class_metadata_init): initialize the vtable
33698
33699 Mon Oct 8 16:12:38 CEST 2001 Paolo Molaro <lupus@ximian.com>
33700
33701         * metadata.c, metadata.h: use MonoArrayType to describe the shape of an array.
33702         Guard against calling bsearch with a NULL pointer (pointed out by Laurent Rioux, smoux).
33703         * image.c: endian fixes by Laurent Rioux.
33704         * object.h, object.c: rename MonoStringObject to MonoString and
33705         MonoArrayObject to MonoArray. Change some function names to conform to
33706         the style mono_<object>_<action>. mono_string_new_utf16 () takes a
33707         guint16* as first argument, so don't use char*.
33708         Provide macros to do the interesting things on arrays in a portable way.
33709         * threads-pthread.c: updates for the API changes and #include <sched.h>
33710         (required for sched_yield()).
33711         * icall.c: updates for the API changes above.
33712         * Makefile.am, mono-endian.c. mono-endian.h: include unaligned read routines for
33713         platforms that need them.
33714
33715 Mon Oct 8 10:43:23 CEST 2001 Paolo Molaro <lupus@ximian.com>
33716
33717         * class.c: set the correct type for all the fundamental
33718         type when loading the class.
33719
33720 2001-10-05  Dick Porter  <dick@ximian.com>
33721
33722         * threads-pthread.c (pthread_mutex_timedlock): Simple
33723         compatibility version for C libraries that lack this call.
33724
33725 Thu Oct 4 19:10:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
33726
33727         * class.c: MonoTypes stored in MonoClass are stored as
33728         fundamental MonoTypes when the class represents a
33729         fundamental type (System.Int32, ...).
33730         The TypeHandle return by ldtoken is a MonoType*.
33731         * icall.c: ves_icall_get_data_chunk () write out all the
33732         PE/COFF stuff. Implement ves_icall_define_method (),
33733         ves_icall_set_method_body (), ves_icall_type_from_handle ().
33734         * image.c: properly skip unknown streams.
33735         * loader.h, loader.c: add type_class to mono_defaults.
33736         * metadata.c, metadata.h: export compute_size () as
33737         mono_metadata_compute_size () with a better interface.
33738         Typo and C&P fixes.
33739         * pedump.c: don't try to print the entry point RVA if there is no entry point.
33740         * reflection.c, reflection.h: many cleanups, fixes, output method
33741         signatures and headers, typedef and typeref info, compress the metadata
33742         tables, output all the heap streams, cli header etc.
33743         * row-indexes.h: typo fixes.
33744
33745 2001-10-04  Dick Porter  <dick@ximian.com>
33746
33747         * object.h: Add a synchronisation mutex struct to MonoObject
33748
33749         * object.c (mono_new_object): Initialise the object
33750         synchronisation mutexes
33751
33752         * icall.c: System.Threading.Monitor internal calls
33753         
33754         * threads-pthread.h:
33755         * threads-pthread.c: System.Threading.Monitor internal calls
33756
33757         * threads-types.h: New file, includes the system-specific thread
33758         structures
33759         
33760         * threads-pthread-types.h:
33761         * threads-pthread-types.c: New files, handle pthread-specific
33762         synchronisation types
33763
33764         * threads-dummy-types.h: 
33765         * threads-dummy-types.c: New files of dummy support for
33766         thread-specific types
33767
33768         * metadata.c:
33769         * image.c:
33770         * pedump.c: include mono-endian.h not endian.h
33771         
33772         * Makefile.am: More threads files.
33773         Name mono-endian.h not endian.h
33774
33775 Tue Oct 2 20:33:48 CEST 2001 Paolo Molaro <lupus@ximian.com>
33776
33777         * Makefile.am, reflection.h, reflection.c: move here the reflection related 
33778         stuff and implement a few more bits.
33779         * icall.c: a field needs to be dereferenced twice. Do not use the same
33780         name for two variables in the same scope.
33781         * image.c, image.h: cleanups.
33782
33783 2001-10-02  Dietmar Maurer  <dietmar@ximian.com>
33784
33785         * class.c (mono_class_metadata_init): bug fix: compute the right size
33786
33787 Mon Oct 1 20:43:57 CEST 2001 Paolo Molaro <lupus@ximian.com>
33788
33789         * icall.c: implemented some of the Reflection internalcalls.
33790         * image.c, image.h: start writing out the PE/COFF image.
33791         * metadata.h, metadata.c: implement mono_metadata_encode_value ()
33792         that does the reverse than decode_blob_size ().
33793         * object.c: use mono_metadata_encode_value (). Move here
33794         temporary implementation of mono_string_to_utf8 ().
33795         * rawbuffer.c: make malloc_map static.
33796
33797 Fri Sep 28 19:26:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
33798
33799         * metadata.c: fix type comparison for arrays.
33800         * loader.h, loader.c: half-assed fix to get more tests work in cygwin.
33801         Added a couple of new classes to monodefaults.
33802         * icall.c: added a couple of Reflection-related internalcalls.
33803         * class.h, class.c: implemented mono_ldtoken () for RuntimeTypeHandles.
33804         Added a byval_arg MonoType to MonoClass.
33805
33806 2001-09-28  Dick Porter  <dick@ximian.com>
33807
33808         * icall.c:
33809         * threads-pthread.h: 
33810         * threads-pthread.c: Implemented internal calls for
33811         LocalDataStoreSlot operations.  Applied mutexes around all shared
33812         data.  Reworked the thread creation and Start() operations to
33813         avoid a race condition.
33814         
33815         * threads-dummy.h:
33816         * threads-dummy.c: Dummy calls for the LocalDataStoreSlot operations
33817
33818 Thu Sep 27 21:45:55 CEST 2001 Paolo Molaro <lupus@ximian.com>
33819
33820         * rawbuffer.c: disable mmap on cygwin since it seems to be broken there.
33821
33822 Thu Sep 27 19:52:11 CEST 2001 Paolo Molaro <lupus@ximian.com>
33823
33824         * class.c, loader.c: warn and return NULL instead of erroring out.
33825         * icall.c: added System.AppDomain::getCurDomain().
33826         * loader.c: we don't need to lookup the typedef again for p/invoke calls.
33827
33828 2001-09-25  Dick Porter  <dick@ximian.com>
33829
33830         * threads-pthread.h:
33831         * threads-pthread.c: Implemented timed thread joining and added
33832         System.Threading.Thread::Join_internal internal call
33833
33834         * icall.c: Added System.Threading.Thread::Join_internal internal call
33835
33836         * threads-dummy.h:
33837         * threads-dummy.c: Dummy calls for System.Thread.Thread::Join_internal
33838
33839 Mon Sep 24 18:56:59 CEST 2001 Paolo Molaro <lupus@ximian.com>
33840
33841         * object.c, object.h: added mono_ldstr (), mono_string_is_interned () and
33842         mono_string_intern () to implement the semantics of the ldstr opcode
33843         and the interning of System.Strings.
33844         * icall.c: provide hooks to make String::IsIntern and String::Intern
33845         internalcalls.
33846
33847 2001-09-23  Dick Porter  <dick@ximian.com>
33848
33849         * threads-dummy.c: 
33850         * threads-dummy.h: New files of dummy threading routines
33851
33852         * Makefile.am (THREAD_SOURCE): Arrange to compile different thread
33853         support code based on system specifics
33854
33855         Rename PTHREAD_LIBS to THREAD_LIBS
33856         
33857 2001-09-23  Dick Porter  <dick@ximian.com>
33858
33859         * threads-pthread.c: Implement the System.Threading.Thread::Sleep,
33860         Schedule (called when asked to Sleep for 0 ms) and CurrentThread
33861         internal calls.
33862         (mono_thread_init): Set up a Thread object instance to return when
33863         the main thread calls Thread.CurrentThread
33864         (mono_thread_cleanup): Wait for all subthreads to exit
33865
33866         * icall.c: New internal calls for System.Threading.Thread::Sleep
33867         (including Schedule) and CurrentThread
33868
33869         * threads.h: New file, to insulate thread-specific stuff from the
33870         rest of the code
33871
33872 2001-09-21  Dick Porter  <dick@ximian.com>
33873
33874         * threads-pthread.h: 
33875         * threads-pthread.c: New file, for handling pthreads-style
33876         threading support.  Start() now starts a new thread and executes
33877         the ThreadStart delegate instance.
33878
33879         * icall.c: Added the internalcall for
33880         System.Threading.Thread::Start_internal
33881
33882         * Makefile.am: Added new files, and PTHREADS_LIBS to the link line
33883
33884 Thu Sep 20 19:37:39 CEST 2001 Paolo Molaro <lupus@ximian.com>
33885
33886         * loader.c: work around the different signatures for delegates
33887         constructors csc generates in compiled code vs the ones compiled in mscorlib.
33888
33889 Tue Sep 18 13:16:32 CEST 2001 Paolo Molaro <lupus@ximian.com>
33890
33891         * class.h, class.c: add mono_class_get_field_from_name ().
33892         * *: Fix C comments and other ANSI C issues.
33893
33894 Mon Sep 10 20:21:34 CEST 2001 Paolo Molaro <lupus@ximian.com>
33895
33896         * endian.h, assembly.c: fix some endianness issues.
33897
33898 Fri Sep 7 18:40:40 CEST 2001 Paolo Molaro <lupus@ximian.com>
33899
33900         * loader.h, load.c: add delegate_class to mono_defaults.
33901         Handle runtime provided methods in mono_get_method ().
33902
33903 2001-08-29  Dietmar Maurer  <dietmar@ximian.com>
33904
33905         * loader.c (mono_get_method): use pinvoke for internal call
33906
33907         * icall.c: use pinvoke for internal call
33908
33909         * loader.c (method_from_memberref): set the method name
33910
33911 Wed Aug 29 12:43:41 CEST 2001 Paolo Molaro <lupus@ximian.com>
33912
33913         * metadata.c: help the compiler generate better code for
33914         mono_class_from_mono_type ().
33915
33916 2001-08-28  Dietmar Maurer  <dietmar@ximian.com>
33917
33918         * class.c (mono_class_metadata_init): delayed computing of the
33919         class size to mono_class_metadata_init ()
33920
33921 Tue Aug 28 15:47:15 CEST 2001 Paolo Molaro <lupus@ximian.com>
33922
33923         * class.c, class.h: add an interfaces member to MonoClass.
33924         * image.c, image.h: add assembly_name field to MonoImage
33925         from the assembly table.
33926         * metadata.c, metadata.h: add mono_metadata_interfaces_from_typedef ().
33927
33928 Mon Aug 27 20:12:01 CEST 2001 Paolo Molaro <lupus@ximian.com>
33929
33930         * class.c: Handle Array in mono_class_from_mono_type ().
33931         * metadata.c, pedump.c: some endian fixes.
33932
33933 Mon Aug 27 15:23:23 CEST 2001 Paolo Molaro <lupus@ximian.com>
33934
33935         * class.c, loader.c, loader.h: More types handled in mono_class_from_mono_type ().
33936         * metadata.c: fix small problem introduced with the latest commit.
33937
33938 Mon Aug 27 12:17:17 CEST 2001 Paolo Molaro <lupus@ximian.com>
33939
33940         * loader.c, metadata.c, metadata.h: Export mono_metadata_type_equal().
33941         We don't need a MonoMetadata pointer anymore to compare signatures in
33942         mono_metadata_signature_equal (), update callers.
33943         Reduced memory usage an number of allocations for MonoMethodHeader and
33944         MonoMethodSignature.
33945
33946 Sun Aug 26 23:03:09 CEST 2001 Paolo Molaro <lupus@ximian.com>
33947
33948         * metadata.c: added compare for szarray.
33949
33950 Sun Aug 26 11:34:24 CEST 2001 Paolo Molaro <lupus@ximian.com>
33951
33952         * class.h, class.c, loader.h, loader.c: export mono_class_from_mono_type ()
33953         and add a couple more types to it and mono_defaults. Give an hint on
33954         classes that need implementing in our corlib and are referenced
33955         in mscorlib.
33956
33957 Sat Aug 25 12:52:54 CEST 2001 Paolo Molaro <lupus@ximian.com>
33958
33959         * class.h, class.c: keep track if a class is also an Enum.
33960         * loader.c: Implement a couple more types for use in libffi
33961         marshalling. Gives better diagnostics when failing to dlopen
33962         a library. Set method->klass for P/Invoke methods, too.
33963
33964 Fri Aug 24 19:30:25 CEST 2001 Paolo Molaro <lupus@ximian.com>
33965
33966         * class.c, class.h: add a MonoType this_arg to MonoClass that
33967         represents a pointer to an object of the class' type that
33968         can be used by the interpreter and later the type cache.
33969         Add best guess alignment info for valuetype objects.
33970
33971 Fri Aug 24 15:50:31 CEST 2001 Paolo Molaro <lupus@ximian.com>
33972
33973         * metadata.h, metadata.c, class.h, class.c: squeezed MonoParam
33974         into MonoType: one less level of indirection and allocation and
33975         simplifies quite a bit of code. Added cache for MonoTypes that are
33976         used frequently, so that we don't need to allocate them all the time.
33977
33978 2001-08-24  Dietmar Maurer  <dietmar@ximian.com>
33979
33980         * class.c (mono_class_create_from_typedef): System.Enum is also a
33981         value type, although it does not derive from System.ValueType
33982         (maybe a bug in the ms compiler?)
33983
33984         * metadata.c (mono_type_size): return the right size for value types
33985
33986         * loader.c (mono_get_method): only initialize method header if not abstract
33987
33988         * class.c (mono_class_from_mono_type): use mono_default values. 
33989
33990 2001-08-23  Dietmar Maurer  <dietmar@ximian.com>
33991
33992         * *: use MonoClass pointers instead of <type_tokens>
33993         
33994         * class.h: new flag: metadata_inited.
33995
33996         * class.c (mono_class_metadata_init): impl.
33997         (mono_class_instance_size): impl.
33998         (mono_class_data_size): impl.
33999
34000 Wed Aug 22 16:27:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
34001
34002         * metadata.c, loader.h, loader.c, image.h, image.c, class.h, class.c:
34003         MonoClass now has the name and name_space fields. 
34004         MonoMethod has a pointer to its MonoClass, instead of MonoImage.
34005         mono_get_method () takes and optional MonoClass as argument.
34006         Removed mono_typedef_from_name() and added mono_class_token_from_name()
34007         instead that takes advantage of a map from class names to typedef
34008         tokens in MonoImage.
34009
34010 Tue Aug 21 18:54:58 CEST 2001 Paolo Molaro <lupus@ximian.com>
34011
34012         * metadata.c: zero is not a valid alignment boundary.
34013         Merge MONO_TYPE_VOID in default decoding code.
34014
34015 2001-08-21  Dietmar Maurer  <dietmar@ximian.com>
34016
34017         * image.h: merged MonoMetadata into MonoImage
34018
34019         * class.h: cleanup of MonoArrayClass, use a MonoClass pointer to
34020         identify the type of elements.
34021
34022 Mon Aug 20 19:39:00 CEST 2001 Paolo Molaro <lupus@ximian.com>
34023
34024         * blob.h: fix MONO_TYPE_TYPEDBYREF value.
34025         * cil-coff.h: split MonoMSDOSHeader and add size info.
34026         * image.c: add some consistency checks.
34027         * metadata.c: fix row size computation: one programmer
34028         error and one LAMESPEC. Handle MONO_TYPE_TYPEDBYREF.
34029         add explanation for the locator routine.
34030         Fix decoding of size in method header.
34031         
34032 2001-08-20  Miguel de Icaza  <miguel@ximian.com>
34033
34034         * assembly.c    (g_concat_dir_and_file): Use _S for string concat.
34035         (g_concat_dir_and_file): Bring g_concat_dir_and_file
34036         function from gnome-libs.  This uses the right path separator
34037         based on the OS, and also works around a bug in some systems where
34038         a double slash is not allowed. 
34039         (default_assembly_name_resolver): Use g_concat_dir_and_file
34040         (mono_assembly_open): ditto.
34041
34042 2001-08-20  Dietmar Maurer  <dietmar@ximian.com>
34043
34044         * metadata.c (mono_metadata_signature_equal): impl.
34045
34046         * *: void is now a realy MonoType (instead of using NULL)
34047         
34048         * metadata.c (do_mono_metadata_parse_type): use
34049         mono_metadata_parse_type to parse void value.
34050
34051 Sat Aug 18 12:51:28 CEST 2001 Paolo Molaro <lupus@ximian.com>
34052
34053         * metadata.c, metadata.h: in the signature and method header store
34054         only the space required for holding the loca vars and incoming arguments.
34055
34056 2001-08-15  Dietmar Maurer  <dietmar@ximian.com>
34057
34058         * metadata.c (do_mono_metadata_parse_type): treat void like any
34059         other type (instead of assigning NULL);
34060
34061 2001-08-14  Dietmar Maurer  <dietmar@ximian.com>
34062
34063         * metadata.c (mono_metadata_parse_mh): fixxed pinned/byref value
34064
34065 2001-08-09  Dietmar Maurer  <dietmar@ximian.com>
34066
34067         * image.c (do_mono_image_open): added a cache for arrays.
34068
34069 Sat Aug 4 12:46:02 CEST 2001 Paolo Molaro <lupus@ximian.com>
34070
34071         * metadata.h, metadata.c: add mono_metadata_decode_row_col () to
34072         decode a single column from a row in a metadata table and changes
34073         to take advantage of it in the typedef locator (gives a nice speed up).
34074         Store offset info for function params.
34075
34076 2001-08-02  Dietmar Maurer  <dietmar@ximian.com>
34077
34078         * image.h (MONO_IMAGE_IS_CORLIB): removed 
34079
34080 Wed Aug 1 22:54:08 CEST 2001 Paolo Molaro <lupus@ximian.com>
34081
34082         * assembly.c: how could mono_assembly_close () had ever worked?
34083         * metadata.c, metadata.h: provide offset info for local vars.
34084         Implement mono_type_size () to take care of alignment as well
34085         as size (it was mono_field_type_size in cli/class.c before).
34086
34087 2001-08-01  Dietmar Maurer  <dietmar@ximian.com>
34088
34089         * image.h (MONO_IMAGE_IS_CORLIB): new macro to check root image
34090
34091         * assembly.h (CORLIB_NAME): set to corlib.dll
34092
34093         * assembly.c (mono_assembly_open): replaced strcmp() with !strcmp()
34094
34095 Tue Jul 31 17:54:02 CEST 2001 Paolo Molaro <lupus@ximian.com>
34096
34097         * metadata.h, metadata.c, Makefile.am, private.h, assembly.c, blob.h,
34098         cil-coff.h, image.c, image.h, pedump.c, rawbuffer.c, rawbuffer.h, row-indexes.h,
34099         tokentype.h: massive namespace cleanup.
34100
34101 Mon Jul 30 20:11:01 CEST 2001 Paolo Molaro <lupus@ximian.com>
34102
34103         * metadata.h, metadata.c: decode exception clauses when parsing method header.
34104
34105 2001-07-27  Dietmar Maurer  <dietmar@ximian.com>
34106
34107         * metadata.c (mono_metadata_free_type): added check for type !=
34108         NULL (void) before calling mono_metadata_free_type()
34109
34110 Thu Jul 26 19:11:19 CEST 2001 Paolo Molaro <lupus@ximian.com>
34111
34112         * metadata.h, row_indexes.h: added header with enumerations to use
34113         to index in the columns from tables in metadata and to decode coded
34114         tokens: we should start using this instead of embedding magic numbers
34115         all over the code.
34116
34117 Thu Jul 26 13:03:27 CEST 2001 Paolo Molaro <lupus@ximian.com>
34118
34119         * assembly.c, cil-coff.h, image.c, image.h, pedump.c, typedef.c:
34120         Move metadata_t info from cli_image_info_t to MonoImage, where
34121         it's easily accessible. Changed all the uses accordingly.
34122         Added the method and class caches to MonoImage.
34123         * metadata.c, metadata.h: Changed mono_metadata_decode_blob_size ()
34124         and mono_metadata_decode_value () signature to be more consistent
34125         with the other parse functions (and simplify code). Taken advantage
34126         of zero-length array allocation with GCC. Removed reduntant (and
34127         wrong) MonoFieldType struct and use MonoParam instead. Changed
34128         mono_metadata_parse_field_type () to use common code for parsing.
34129         Added mono_metadata_typedef_from_field () and
34130         mono_metadata_typedef_from_method () to lookup a typedef index from a
34131         field or method token.
34132         Pack the MonoRetType structure more tightly (fits in 8 bytes now).
34133
34134 2001-07-23  Miguel de Icaza  <miguel@ximian.com>
34135
34136         * metadata.c (mono_metadata_parse_field_type): Implement. 
34137         (do_mono_metadata_parse_type): Split engine from
34138         mono_metadata_parse_type, so that we can create smaller structures
34139         for things that just have one pointer to the MonoType (look at
34140         the MonoFieldType)
34141
34142 2001-07-20  Miguel de Icaza  <miguel@ximian.com>
34143
34144         * metadata.c (mono_metadata_parse_mh): Correct the implementation,
34145         as Jan Gray found out, it is incorrect. 
34146
34147 2001-07-18  Miguel de Icaza  <miguel@ximian.com>
34148
34149         * assembly.c: Implement asssembly loading.  This loads an image
34150         and loads all the referenced assemblies.  Come to think of it, we
34151         could always do lazy loading of the assemblies. 
34152
34153         * image.c (mono_image_open): Keep loaded images in a hashtable.
34154
34155         * image.h (MonoImage): Add reference count.
34156
34157 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
34158
34159         * assembly.c (mono_assembly_open): Keep track of the file name in
34160         case the assembly has no ASSEMBLY table.
34161
34162         * metadata.h: Fixed Paolo's quick hack.  Put the documnentation
34163         from get.c here.
34164
34165 Sun Jul 15 19:39:06 CEST 2001 Paolo Molaro <lupus@ximian.com>
34166
34167         * metadata.c, metadata.h: decode local vars in method header
34168         parse function. Change callers accordingly.
34169
34170 Sun Jul 15 17:40:47 CEST 2001 Paolo Molaro <lupus@ximian.com>
34171
34172         * metadata.h, cil-coff.h: protect against multiple inclusion.
34173         Added some new structures to hold information decoded from metadata:
34174         MonoType, MonoParam, MonoArray, MonoMethod, MonoMethodSignature
34175         and relevant decoding/free functions.
34176         * metadata.c: implement decoding functions. Add warning for out of bounds
34177         index in mono_metadata_locate(). Implement mono_get_method () to retreive
34178         all the info about a method signature and invocation. Remove check on
34179         uninitialized local var in parse_mh() and fix memory leak.
34180
34181 2001-07-12  Miguel de Icaza  <miguel@ximian.com>
34182
34183         * metadata.h: More macros.
34184
34185         * tokentype.h: New file.
34186
34187 Fri Jul  6 11:30:53 CEST 2001 Paolo Molaro <lupus@ximian.com>
34188
34189         * assembly.c: added a consistency check and initialize
34190         some structures with g_new0().
34191         * metadata.c: fixed a couple more bugs in table size computation
34192         and add other checks for out-of bound access to metadata.
34193
34194 Thu Jul  5 22:34:21 CEST 2001 Paolo Molaro <lupus@ximian.com>
34195
34196         * metatada.c: fix bugs computing table sizes. Spew a
34197         warning when index in string heap is out of bounds.
34198
34199 2001-07-04  Miguel de Icaza  <miguel@ximian.com>
34200
34201         * metadata.h: Add a couple of macros to manipulate tokens. 
34202
34203 Tue Jul  3 18:33:32 CEST 2001 Paolo Molaro <lupus@ximian.com>
34204
34205         * assembly.c: g_free(ii->cli_sections) (and avoid double free of
34206         cli_section_tables).
34207
34208 2001-07-01  Miguel de Icaza  <miguel@ximian.com>
34209
34210         * metadata.c (mono_metadata_user_string): New function, provides
34211         access to the UserString heap. 
34212
34213 2001-06-27  Miguel de Icaza  <miguel@ximian.com>
34214
34215         * metadata.c: Add inline documentation.
34216
34217 2001-06-26  Miguel de Icaza  <miguel@ximian.com>
34218
34219         * propertyattr.h, paramattr.h, methodsem.h, methodattr.h: New
34220         files. 
34221
34222 2001-06-22  Miguel de Icaza  <miguel@ximian.com>
34223
34224         * typeattr.h: New file, TypeAttribute flags. 
34225
34226 2001-06-21  Miguel de Icaza  <miguel@ximian.com>
34227
34228         * mono/metadata/assembly.c (mono_assembly_ensure_section_idx,
34229         mono_assembly_ensure_section): Section loading code.
34230         (load_section_tables): Load the sections.
34231
34232         * mono/metadata/metadata.c (mono_metadata_locate_token,
34233         mono_metadata_locate): Functions to locate the information
34234         definition given a token or a table and an index.
34235         (mono_metadata_compute_table_bases): New.
34236         (compute_size): New function to compute the sizes of the various
34237         tables.
34238
34239         * mono/metadata/metadata.h: Finish listing the different index
34240         types. 
34241
34242         * mono/metadata/pedump.c: Improve to dump new information.
34243
34244 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
34245
34246         * mono/metadata/metadata.c: Entered all the tables matching
34247         Beta2. 
34248
34249         * mono/metadata/assembly.c (load_metadata_ptrs): Fix for Beta2
34250
34251
34252
34253