2009-02-10 Zoltan Varga <vargaz@gmail.com>
[mono.git] / mono / metadata / ChangeLog
1 2009-02-10  Zoltan Varga  <vargaz@gmail.com>
2
3         * marshal.c (mono_marshal_get_native_func_wrapper): Use get_cache to
4         lazily initialize the native wrapper cache.
5         (mono_marshal_get_native_wrapper): Put aot-ed native wrappers into a separate
6         cache, since they are different from the normal wrappers.
7
8         * image.c (mono_image_init): Initialize native_wrapper_cache lazily as well.
9
10         * metadata-internals.h (struct _MonoImage): Add a new wrapper for
11         AOT compiled native wrappers.
12
13 2009-02-09  Geoff Norton  <gnorton@novell.com>
14
15         * appdomain.h:
16         * security-core-clr.c: Allow enabling core-clr from the embedding
17         API.
18
19 2009-02-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
20
21         * socket-io.c: when requesting all the local ips, if there are no
22         interfaces up and running, MS returns 127.0.0.1.
23
24 2009-02-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
25
26         * mono-perfcounters-def.h: processor time is an inverse time.
27         Fixes bug #468625.
28
29 2009-02-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
30
31         * socket-io.c: an empty host name returns the list of local IPs.
32         Fixes bug #386637 part 1/2.
33
34 2009-02-07  Zoltan Varga  <vargaz@gmail.com>
35
36         * verify.c (mono_class_interface_implements_interface): Call
37         mono_class_setup_interfaces ().
38         (merge_stacks): Ditto.
39
40 2009-02-06  Zoltan Varga  <vargaz@gmail.com>
41
42         * class.c (mono_class_setup_interfaces): New function to lazily initalize
43         klass->interfaces.
44         (mono_generic_class_get_class): Don't initalize klass->interfaces.
45         (mono_generic_class_get_class): Ditto.
46
47 2009-02-06  U-QUACK\miguel  <miguel@quack>
48
49         * icall-defs.h: Include also the Encrypt/Decrypt string methods as
50         they live in security.c
51
52         * debug-mono-symfile.c (mono_debug_open_mono_symbols): Integrated
53         another bit from Paolo's code.
54
55 2009-02-06  Zoltan Varga  <vargaz@gmail.com>
56
57         * object.c (build_imt_slots): Add a small optimization to avoid inflating
58         methods which will be discarded by add_imt_builder_entry ().
59
60         * marshal.c (get_runtime_invoke_type): Avoid sharing enum types since they
61         need to be boxed.
62
63         * loader.c: Add a statistics for the size of the memberref signature cache.
64         
65         * loader.c (find_cached_memberref_sig): New helper function.
66         (cache_memberref_sig): Ditto.
67
68         * loader.c: Cache the result of parsing memberref signatures, since otherwise
69         they will be parsed again for every generic instantiation, leading to unbounded
70         memory growth.
71
72 2009-02-05  Zoltan Varga  <vargaz@gmail.com>
73
74         * loader.c (mono_get_method_from_token): Avoid creating class for the generic
75         parameters of generic methods.
76
77         * class.c (mono_class_inflate_generic_method_full): Set is_mb_open again
78         after the original method is copied to the inflated method.
79         (mono_class_get_vtable_entry): Handle rgctx invoke wrappers more efficiently.
80
81         * class-internals.h (struct _MonoMethodInflated): Move the is_mb_open
82         field to MonoMethod since it only consumes 1 bit there, and 4/8 bytes here.
83
84         * class.c metadata.c: Update after the changes above.
85
86 2009-02-05 Rodrigo Kumpera  <rkumpera@novell.com>
87
88         * metadata-verify.c: Simplified error handling and added
89         section table validation.
90
91 2009-02-05  Zoltan Varga  <vargaz@gmail.com>
92
93         * class-internals.h (MonoClassExt): New structure containing rarely used
94         fields of MonoClass.
95         (struct _MonoClass): Move rarely used fields to MonoClassExt, accessed
96         through a new 'ext' field.
97
98         * class.c (mono_class_alloc_ext): New helper function to allocate 
99         class->ext.
100
101         * class.c metadata.c reflection.c: Update after MonoClass structure changes.
102
103 2009-02-05  Mark Probst  <mark.probst@gmail.com>
104
105         * object.c (mono_object_get_virtual_method): Properly inflate
106         generic methods.  Fixes #472692.
107
108 2009-02-05 Rodrigo Kumpera  <rkumpera@novell.com>
109
110         * class.c (mono_class_create_from_typedef): The CLR supports SystemF
111         recursive types such as List<T>:Cons<T,List<T>> so when doing the lookup
112         for the parent type, the created type must be ready to be used on a generic
113         instantiation.
114         We fill this_arg/byval_arg if the parent is a generic instance to make sure
115         we won't have duplicated entries in generic_inst_cache.
116
117         Fixes #469553.
118
119 2009-02-05  Miguel De Icaza  <miguel@novell.com>
120
121         * threadpool.c (socket_io_add_poll): Remove the BSD6 define and
122         replace with plain BSD per the comments on the bug MONO77637.
123
124 2009-02-05  Zoltan Varga  <vargaz@gmail.com>
125
126         * class.c (mono_class_get_generic_class): New accessor function.
127         (mono_class_get_generic_container): Ditto.
128
129         * class-internals.h (struct _MonoClass): Add 'is_generic' and 'is_inflated'
130         fields, similar to the ones in MonoMethod.
131
132         * class.c (mono_generic_class_get_class): Set klass->is_inflated.
133         (mono_class_create_from_typedef): Set klass->is_generic if needed.
134
135         * reflection.c (mono_reflection_create_generic_class): Set klass->is_generic.
136         
137         * class-internals.h (struct _MonoClass): Remove enum_basetype, it contains
138         the same information as element_class->byval_arg.
139
140         * class.c reflection.c: Remove references to class->byval_arg.
141
142         * class.c marshal.c: Use mono_class_enum_basetype () instead of accessing 
143         klass->enum_basetype directly.
144
145         * verify.c metadata.c object.c icall.c reflection.c: Use 
146         mono_class_enum_basetype () instead of accessing klass->enum_basetype 
147         directly.
148
149 2009-02-04  Miguel de Icaza  <miguel@novell.com>
150
151         * icall-def.h: Remove internal calls for sockets when
152         DISABLE_SOCKET is defined, file system writing features when the
153         OS only support reading and not writing data and Policy support if
154         the Policy is disabled.
155         
156         * image.c (do_mono_image_open): Apply Paolo's patches for using
157         mono_file_map_ APIs here.
158
159         * assembly.c: Add support for platforms to avoid prefix
160         auto-detection. 
161
162 2009-02-04  Zoltan Varga  <vargaz@gmail.com>
163
164         * generic-sharing.c (mono_method_fill_runtime_generic_context): Fix a
165         warning.
166
167         * class.c (mono_class_inflate_generic_class): New helper function.
168
169         * class.c: Use mono_class_inflate_generic_class in a few places. Add
170         statistics for inflated methods/classes.
171
172         * loader.c (inflate_generic_header): Use mono_class_inflate_generic_class.
173
174         * icall.c (ves_icall_Type_GetMethodsByName): Optimize the case when
175         the call is made from Delegate.CreateDelegate () for the invoke method of
176         a delegate.
177
178         * loader.c: Add a statistics for the memory occupied by inflated signatures.
179
180         * metadata.c (mono_metadata_signature_size): New helper function.
181
182         * class.c (mono_class_get_method_from_name_flags): Add an optimization for
183         generic instances.
184
185         * metadata.c (inflated_method_in_image): Avoid calling 
186         mono_method_signature () if the method does not already have a signature.
187
188 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
189
190         * verify.c (is_compatible_boxed_valuetype): When checking if the boxed 
191         valuetype is compatible with target type, check by inheritance as a
192         VT is not really compatible with System.ValueType, for example.
193
194         * verify.c (do_invoke_method): Improve error message.
195
196         * verify.c (do_box_value): If boxing a nullable, use the type argument
197         on stack instead.
198
199         * verify.c (do_newobj): Improve error message.  
200
201         Fixes #469549.
202
203 2009-02-03  Miguel de Icaza  <miguel@novell.com>
204
205         * appdomain.c: Add support for DISABLE_SOCKETS and DISABLE_SHADOW_COPY
206
207 2009-02-03  Mark Probst  <mark.probst@gmail.com>
208
209         * generic-sharing.c: Don't hold domain lock when calling
210         instantiate_other_info().  Fixes #471958.
211
212         * domain-internals.h, loader.c: Describe locking policy of domain
213         lock vs loader lock.
214
215 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
216
217         * verify.c (mono_delegate_signature_equal): Make it possible to check
218         first-arg-bound delegates to static method.
219
220         * verify.c (verify_delegate_compatibility): Correctly verify delegates to
221         static methods with the first arg bound.
222
223         Fixes #469529.
224
225 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
226
227         * verify.c: Added stack_slot_full_name to provide decent and more meanfull
228         errors.
229
230         * verify.c (is_compatible_boxed_valuetype): Be less restrictive when not
231         under strict mode. Any type, when boxed can be seen as a reference type.
232
233         Fixes #469528.
234
235 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
236
237         * object.h: The lower bound of an array is a signed integer value.
238         Introduce mono_array_lower_bound_t typedef. It should be used instead of
239         gint32 as under MONO_BIG_ARRAYS it will be a gint64.
240
241         * icall.c: Cast MonoArrayBounds::length to a signed value so correctly
242         calculate the upper bound.
243         
244         Fixes #471252.
245
246 2009-02-02  Miguel de Icaza  <miguel@novell.com>
247
248         From Paolo's work, refactored, cleared up:
249         
250         * threadpool.c, icall.c: ifdef code that requires a working socket
251         stack.
252
253         * metadata.c (mono_metadata_field_info): Do not attempt to return
254         a value from a function declared as void.
255
256         * console-io.c: Use MONO_NULL_TTYDRIVER to remove the tty driver
257         from the console stack.
258
259         * assembly.c: use strrchr instead of rindex.
260
261         * class.c, object.c, marshal.c, icall.c, reflection.c: include
262         alloca.h on systems that have it.
263
264         * environment.c: Avoid code that uses stuff from
265         HAVE_SYS_UTSNAME_H
266         
267         * appdomain.c: Include sys/time.h.
268
269         * console-io.c: include sys/ioctl.h if it is available.
270
271 2009-02-03  Zoltan Varga  <vargaz@gmail.com>
272
273         * method-builder.h (_MonoMethodBuilder): Add a 'skip_visibility' flag.
274
275         * method-builder.c (mono_mb_create_method): Set method->skip_visibility from
276         the method builder.
277
278         * marshal.c: Set mb->skip_visibility instead of setting it on the method
279         after it was created and cached, as the later is not thread safe.
280         
281 2009-02-02  Zoltan Varga  <vargaz@gmail.com>
282
283         * mono-debug.c (mono_debug_print_stack_frame): Avoid crashes when this is
284         called while the debugging module is not initialized. Fixes #471669.
285
286 2009-02-02 Rodrigo Kumpera  <rkumpera@novell.com>
287
288         * icall.c (type_from_name): Ignore reflection frames to find out the real caller.
289
290         Fixes #471255.
291
292 2009-02-02  Mark Probst  <mark.probst@gmail.com>
293
294         * generic-sharing.c (lookup_or_register_other_info): Make sure the
295         loader lock is not taken while the templates lock is held.  Fixes
296         #471089.
297
298 2009-02-02  Mark Probst  <mark.probst@gmail.com>
299
300         * metadata.c (type_in_image): Added a check to fix a monodis
301         crash.
302
303 2009-02-02  Zoltan Varga  <vargaz@gmail.com>
304
305         * marshal.c (mono_marshal_get_runtime_invoke): Add support for byref
306         nullable arguments.
307
308         * object.c (mono_runtime_invoke_array): Ditto.
309         
310         * marshal.c (mono_marshal_free_dynamic_wrappers): New function for
311         freeing wrappers of dynamic methods.
312
313         * loader.c (mono_free_method): Call it. Fixes #463323.
314         
315         * marshal.c (mono_marshal_get_runtime_invoke): Disable sharing for
316         methods taking vtype/byref arguments, to fix yet another bug caused by
317         the sharing of runtime invoke wrappers. Partly fixes #471259.
318
319 2009-02-01  Zoltan Varga  <vargaz@gmail.com>
320
321         * debug-mono-symfile.c (check_line): Return NULL instead of returning
322         <first file in file table>:1 when the IL offset does not have an associated
323         line number.
324
325 2009-01-31  Zoltan Varga  <vargaz@gmail.com>
326
327         * mono-debug.c (mono_debug_lookup_locals): New function to return local
328         variable info for a method.
329
330         * debug-mono-symfile.c (mono_debug_symfile_lookup_locals): Ditto.
331         
332 2009-01-30  Jb Evain  <jbevain@novell.com>
333
334         * pedump.c: reuse code from monodis to make sure pedump honors
335         MONO_PATH, which is needed to verify net_2_1 assemblies.
336
337 2009-01-29  Zoltan Varga  <vargaz@gmail.com>
338
339         * mono-debug.c (mono_debug_print_stack_frame): Print the IL offset even when
340         there is no line number info.
341
342 2009-01-29  Raja R Harinath  <harinath@hurrynot.org>
343
344         Avoid some MonoType allocations
345         * reflection.c (mono_reflection_initialize_generic_parameter):
346         Reuse MonoType from param->pklass rather than allocating one.
347         (mono_dynamic_image_free): Update to changes.
348
349 2009-01-28  Raja R Harinath  <harinath@hurrynot.org>
350
351         Rearrange some code to improve consistency
352         * reflection.c (mono_reflection_setup_generic_class): Move body ...
353         (mono_reflection_initialize_generic_parameter): ... here.
354
355 2009-01-28  Zoltan Varga  <vargaz@gmail.com>
356
357         * generic-sharing.c (has_constraints): Enable gshared for methods/classes
358         with type constraints as an experiment.
359
360         * boehm-gc.c (on_gc_notification): Update mono_stats.
361
362 2009-01-28  Raja R Harinath  <harinath@hurrynot.org>
363
364         Avoid some allocations
365         * class-internals.h (_MonoGenericInst::type_argv): Convert from
366         pointer to tail array to avoid extra allocation.
367         * metadata.c (free_generic_inst): Update to changes.
368         (mono_metadata_get_generic_inst): Likewise.  Use alloca instead of
369         on-stack struct.
370
371 2009-01-27  Zoltan Varga  <vargaz@gmail.com>
372
373         * icall.c (ves_icall_System_Type_EqualsInternal): For user-defined types,
374         return TRUE if the two type objects are the same.
375
376 2009-01-26  Zoltan Varga  <vargaz@gmail.com>
377
378         * marshal.c (mono_marshal_load_type_info): Fill out info->min_align.
379         (mono_class_native_size): Use klass->marshal_info->min_align instead of
380         klass->min_align, since klass->min_align contains the managed alignment,
381         while the native alignment can be different, like for longs on x86.
382         Fixes #469135.
383
384         * class-internals.h (MonoMarshalType): Add a min_align field.
385
386 2009-01-26 Rodrigo Kumpera  <rkumpera@novell.com>
387
388         * assembly.c (mono_assembly_try_decode_skip_verification): Add a hack to check
389         the 1.0 format.
390
391 2009-01-26  Zoltan Varga  <vargaz@gmail.com>
392
393         * domain-internals.h (struct _MonoJitInfo): Add a 'from_aot' field plus
394         some comments about the usage of the used_regs field.
395
396         * marshal.c (emit_marshal_ptr): Allow pointers to blittable structures.
397         Fixes #469217.
398
399 2009-01-24 Gonzalo Paniagua Javier <gonzalo@novell.com>
400
401         * appdomain.c: return NULL instead of throwing FileNotFoundException
402         when LoadAssembly() fails.
403
404 2009-01-23  Mark Probst  <mark.probst@gmail.com>
405
406         * metadata.c (mono_metadata_generic_param_equal): Only compare the
407         image if the owner is NULL.  Fixes the AOT failures.
408
409 2009-01-23  Zoltan Varga  <vargaz@gmail.com>
410
411         * metadata.c (mono_metadata_load_generic_params): Initialize the 
412         MonoGenericParam structure using memset so the image field is initialized
413         as well.
414
415 2009-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
416
417         * appdomain.c (mono_domain_unload): Change the InterlockedIncrement to
418         a plain store.
419
420 2009-01-21  Zoltan Varga  <vargaz@gmail.com>
421
422         * class.c (mono_class_setup_vtable_general): In the generic instance
423         optimization, set method->slot for abstract virtual methods. Fixes part of
424         #467834.
425
426 2009-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
427
428         * domain-internals.h: Add new appdomain state MONO_APPDOMAIN_UNLOADING_START
429         which signals that the unloading has started but all appdomain services must
430         remain operational.
431
432         * appdomain.c (mono_domain_unload): The initial state for unloading now
433         is unloading_start and we switch to unloading after the managed call to
434         AppDomain::DomainUnload has finished.
435
436         The new unloading state has to be created because managed code in the
437         DomainUnload event can depend on things like the threadpool still working.
438         The domain must remain fully functional while the event executes.
439
440         This shown as an issue due to Process::WaitForExit, which waits for
441         async reads of stdout and stderr to complete. Since those are processed
442         in the threadpool the code deadlocks because the DomainUnload callback 
443         waits for the async read finished event, which should have been set by a
444         threadpool job but has been discarded due to the domain been in unload
445         state.
446
447 2009-01-21  Mark Probst  <mark.probst@gmail.com>
448
449         * metadata.c (mono_metadata_generic_param_equal): Owner as well as
450         image must match.
451
452 2009-01-21  Mark Probst  <mark.probst@gmail.com>
453
454         * reflection.c (resolve_object): For fields, inflate the class and
455         then get the field in the inflated class.
456
457 2009-01-20  Mark Probst  <mark.probst@gmail.com>
458
459         * object-internals.h (struct _MonoException): Added a comment
460         explaining the new use of trace_ips.
461
462 2009-01-20  Mark Probst  <mark.probst@gmail.com>
463
464         * generic-sharing.c (inflate_other_data): Inflate array methods
465         correctly.
466
467         * loader.c, class-internals.h: Rename search_in_array_class() to
468         mono_method_search_in_array_class() and make it non-static.
469
470 2009-01-19  Zoltan Varga  <vargaz@gmail.com>
471
472         * metadata.c (inflated_signature_in_image): Call signature_in_image as well.
473         Hopefully fixes #458168.
474
475 2009-01-19  Christian Hergert  <christian.hergert@gmail.com>
476
477         * object.c (mono_raise_exception): Remove call to InterlockedIncrement
478         as it is performed elsewhere.
479
480         Code is contributed under MIT/X11 license
481
482 2009-01-19  Christian Hergert  <christian.hergert@gmail.com>
483
484         * mono-perfcounters-def.h: Add counters for asp.net requests total and
485         requests queued.
486         * object.c (mono_raise_exception): Increment the exceptions total
487         counter when an exception is thrown.
488         * class-internals.h: Add a location for storing the total number of
489         asp.net requests served.
490         * mono-perfcounters.c: Implement update support for asp.net counters
491         from the class libraries. Implement read support for asp.net counters
492         and exceptions total counter.
493
494 2009-01-19  Zoltan Varga  <vargaz@gmail.com>
495
496         * loader.c (search_in_array_class): Call mono_class_setup_methods () before
497         accessing klass->methods. Fixes #467385.
498
499 2009-01-18  Zoltan Varga  <vargaz@gmail.com>
500
501         * marshal.c (emit_marshal_custom): Avoid calling MarshalNativeToManaged
502         for byval arguments without an [Out] attribute. Fixes #467212.
503
504         * attach.c: Applied patch from Koushik Dutta (koush@koushikdutta.com). 
505         Fix compilation under android.
506         
507         * sgen-gc.c: Instead of scanning gray objects after all roots have been 
508         processed, scan them directly after they are copied, to achieve better locality
509         and cache usage.
510
511         * socket-io.c: Applied patch from Koushik Dutta
512         (koush@koushikdutta.com). Disable IPV6 when running under android.
513
514 2009-01-18  Zoltan Varga  <vargaz@gmail.com>
515
516         * icall.c (ves_icall_InternalExecute): Add write barriers.
517
518         * marshal.c (mono_marshal_get_write_barrier): Remove, this is now done in
519         the GC code.
520
521         * sgen-gc.c: Implement write barriers in IL code.
522
523 2009-01-17  Geoff Norton  <gnorton@novell.com>
524
525         * image.c: Avoid trying to walk the reference table of dynamic assemblies.
526
527 2009-01-17  Geoff Norton  <gnorton@novell.com>
528
529         * image.c: When unloading the image->references table, there can be gaps
530         in it.  Ensure that we iterate every entry to avoid leaking assembly references
531         when unloading an appdomain.
532
533 2009-01-16  Zoltan Varga  <vargaz@gmail.com>
534
535         * sgen-gc.c: Add support for allocating a nursery at an aligned address, to
536         speed up ptr-in-nursery checks.
537
538         * threads.c (mono_threads_abort_appdomain_threads): Abort threads outside the
539         threads_lock () to prevent deadlocks.
540
541         * sgen-gc.c gc-internal.h: Add a new root type root-with-wbarrier, which
542         does not need to be scanned during minor collections, since writes to it
543         must use write barriers.
544
545 2009-01-15 Rodrigo Kumpera  <rkumpera@novell.com>
546
547         * metadata-verify.c: Add pe nt header verification.
548         
549 2009-01-15  Zoltan Varga  <vargaz@gmail.com>
550
551         * gc.c: Fix a few warnings when using SGEN.
552
553 2009-01-14 Rodrigo Kumpera  <rkumpera@novell.com>
554
555         * metadata-verify.c: Add pe optional header verification.
556
557 2009-01-15  Zoltan Varga  <vargaz@gmail.com>
558
559         * sgen-gc.c: Add support for user defined marker functions, used by
560         MonoGHashTable to avoid registering a GC root for every hash node.
561
562 2009-01-14  Zoltan Varga  <vargaz@gmail.com>
563
564         * sgen-gc.c: Fix warnings. Optimize copy_object () a bit. Split pinned/
565         non-pinned roots into separate hashes to avoid having to traverse them
566         in functions which are only interested in one kind.
567
568 2009-01-13 Rodrigo Kumpera  <rkumpera@novell.com>
569
570         * metadata-verify.c: Add pe header machine field verification.
571         
572 2009-01-13 Rodrigo Kumpera  <rkumpera@novell.com>
573
574         * metadata-verify.c: Add pe header size verification.
575
576 2009-01-14  Zoltan Varga  <vargaz@gmail.com>
577
578         * reflection.c (ALLOC_REFENTRY): Don't allocate the ReflectionEntry structures
579         using the GC, they don't contain references.
580
581         * domain.c (mono_domain_create): Create ldstr_table using MONO_HASH_KEY_VALUE_GC.
582
583 2009-01-13  Geoff Norton  <gnorton@novell.com>
584
585         * appdomain.c|h: Expose mono_domain_unload to the embedding api so that 
586         AppDomains created on the native side can be cleaned up on the native side.
587
588 2009-01-13  Geoff Norton  <gnorton@novell.com>
589
590         * appdomain.c: Ensure that we call mono_context_init for the embedding api
591         as well as the managed api.
592
593 2009-01-13  Geoff Norton  <gnorton@novell.com>
594
595         * appdomain.h|c: New API for creating a MonoDomain in the embedding api
596         with a MonoAppDomain initialized against it.
597
598 2009-01-13  Zoltan Varga  <vargaz@gmail.com>
599
600         * reflection.c (MOVING_GC_REGISTER): Fix a warning.
601         
602         * reflection.c (mono_image_get_generic_param_info): Use MOVING_GC_REGISTER.
603
604         * marshal.c: Avoid setting the exception clauses after a method has been entered 
605         into the wrapper caches. Fixes #465700.
606
607         * method-builder.c (mono_mb_set_clauses): New function to set the clauses of the
608         method builder.
609         (mono_mb_create_method): Set the clauses from the method builder.
610
611 2009-01-13 Gonzalo Paniagua Javier <gonzalo@novell.com>
612
613         * threadpool.c: include sys/socket.h. Fixes compilation on FreeBSD.
614         Patch from Makoto Kishimoto.
615
616 2009-01-13  Zoltan Varga  <vargaz@gmail.com>
617
618         * sgen-gc.c (mono_gc_make_descr_from_bitmap): Handle large bitmaps by 
619         encoding them as ROOT_DESC_COMPLEX.
620         (precisely_scan_objects_from): Implement support for ROOT_DESC_COMPLEX.
621
622 2009-01-12  Zoltan Varga  <vargaz@gmail.com>
623
624         * sgen-gc.c (scan_from_remsets): Clear the global remset of pointers which
625         no longer point to the nursery.
626
627         * sgen-gc.c: Add a few comments/FIXMEs.
628         
629         * sgen-gc.c: Implement scanning of the alloc_pinned objects.
630
631         * marshal.c (mono_marshal_get_synchronized_wrapper): Make the 
632         initialization of the various _method variables thread safe. Fixes
633         #465377.
634
635 2009-01-12  Mark Probst  <mark.probst@gmail.com>
636
637         * domain.c, domain-internals.h: Remove the shared_generics_hash
638         and its lookup functions.
639
640 2009-01-12  Bill Holmes  <billholmes54@gmail.com>
641
642         * socket-io.c:  Fixing the MSVC build. 
643
644         Code is contributed under MIT/X11 license.
645
646 2009-01-12 Rodrigo Kumpera  <rkumpera@novell.com>
647
648         * metadata-verify.c: Add pe header watermark verification.
649
650 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
651
652         * metadata-verify.c: Add lfanew verification.
653
654 2009-01-12  Jb Evain  <jbevain@novell.com>
655
656         * tabldefs.h: rename METHOD_ATTRIBUTE_CHECK_ACCESS_ON_OVERRIDE to
657         METHOD_ATTRIBUTE_STRICT to match the ECMA terminology.
658
659 2009-01-10  Zoltan Varga  <vargaz@gmail.com>
660
661         * socket-io.c: Fix the build.
662
663         * environment.c: Fix an #ifdef.
664
665 2009-01-09  Zoltan Varga  <vargaz@gmail.com>
666
667         * threadpool.c (async_invoke_thread): Handle the wait function returning
668         WAIT_IO_COMPLETION as well.
669         (async_invoke_io_thread): Ditto.
670
671 2009-01-09  Bill Holmes  <billholmes54@gmail.com>
672
673         * threads.c: Fixing the Windows build.
674
675         Code is contributed under MIT/X11 license.
676
677 2009-01-09  Zoltan Varga  <vargaz@gmail.com>
678  
679         * threads.c (signal_thread_state_change): Call wapi_interrupt_thread () to
680         interrupt a wait.
681         (mono_thread_execute_interruption): Call wapi_clear_interruption () to enable
682         the thread to wait again.
683
684 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
685
686         * metadata-verify.c: Initial skeleton of the metadata verifier.
687
688         * pedump.c: Add support for the metadata verifier.
689
690         * verify-internal.h: Export the whole assembly metadata verifier function.
691
692 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
693
694         * gc.c (mono_gc_init): Fix the comments about deadlock on windows.
695
696 2009-01-09  Zoltan Varga  <vargaz@gmail.com>
697
698         * Makefile.am: Upgrade dtrace-prelink.sh location.
699
700 2009-01-08 Rodrigo Kumpera  <rkumpera@novell.com>
701
702         * gc.c (mono_gc_init): Wait for finalizer thread to init on windows as
703         well. Otherwise the shutdown deadlock that happens on unix will can happen
704         as well.
705         If the main thread code finishes too fast it's possible that the finalizer
706         thread won't have executed yet, won't record itself as the finalizer thread
707         and the shutdown sequence will wait on it forever.
708
709 2009-01-08 Rodrigo Kumpera  <rkumpera@novell.com>
710
711         * threads.c (mono_thread_current): Make THREAD_DEBUG work on windows
712         with MSVC.
713
714 2009-01-08  Miguel de Icaza  <miguel@novell.com>
715
716         * appdomain.c: Initialize the mono_strtod_mutex here, thanks to
717         Robert Jordan for pointing this out.
718
719 2009-01-08  Christian Prochnow  <cproch@seculogix.de>
720
721         * icall.c
722         * icall-def.h: added internal calls ves_icall_System_IO_DriveInfo_GetDiskFreeSpace,
723         ves_icall_System_IO_DriveInfo_GetDriveType.
724
725 2009-01-07  Miguel de Icaza  <miguel@novell.com>
726
727         * icall.c: Wrap calls to mono_strtod in CriticalSection
728         invocations when using eglib, to work around #464316.
729
730 2009-01-07 Rodrigo Kumpera  <rkumpera@novell.com>
731
732         * file-io.c (ves_icall_System_IO_MonoIO_GetCurrentDirectory): Double check the
733         return value of GetCurrentDirectory to never access unitialized memory.
734
735 2009-01-07 Rodrigo Kumpera  <rkumpera@novell.com>
736
737         * file-io.c (ves_icall_System_IO_MonoIO_GetCurrentDirectory): Properly check the
738         return value of GetCurrentDirectory and expand the buffer if needed.
739
740         Fixes #459094.
741
742 2009-10-07 Tom Hindle  <tom_hindle@sil.org>
743
744         * marshal.c (GetIUnknownForObjectInternal, GetIUnknownForObjectInternal) : 
745           Adding a call to mono_init_com_types.
746
747         Code is contributed under MIT/X11 license.
748
749 2009-01-07  Geoff Norton  <gnorton@novell.com>
750
751         * socket-io.c: ioctlsocket(FIONREAD) returns the size of the UDP header as well on 
752         darwin.  Use getsockopt SO_NREAD instead to get the right values for TCP and UDP.
753         ai_canonname can be null in some cases on darwin, where the runtime assumes it will 
754         be the value of the ip buffer.
755
756 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
757
758         * verify.c (mono_class_interface_implements_interface): Verify parents as we can't rely on
759         interfaces_packed here.
760
761         Fixes part of #463294.
762
763 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
764
765         * verify.c (is_array_type_compatible): Ignore bounds and sizes when checking array compatibility.
766
767         Fixes part of #463294.
768
769 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
770
771         * verify.c (stack_slot_is_complex_type_not_reference_type): Check if the type
772         is a boxed complex as well.
773
774         Fixes part of #463294.
775
776 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
777
778         * reflection.c (mono_image_get_methodref_token): Add an extra create_typespec parameter to
779         control if a methodspec should be created for the generic method definition from external assemblies.
780         Caching of methodspec is done using the handleref hash table.
781
782         Fixes #462592.
783
784 2009-01-05 Rodrigo Kumpera  <rkumpera@novell.com>
785
786         * loader.c (find_method): When searching the interfaces of a class
787         check the transitive closure of implemented interfaces.
788
789         Fixes #463303.
790
791 2009-01-03 Rodrigo Kumpera  <rkumpera@novell.com>
792
793         * class.c (get_implicit_generic_array_interfaces): Improve debugging code.
794         
795 2009-01-03 Rodrigo Kumpera  <rkumpera@novell.com>
796
797         * class.c (get_implicit_generic_array_interfaces): Extract valuetype
798         interfaces calculation to fill_valuetype_array_derived_types.
799
800         * class.c (get_implicit_generic_array_interfaces): Valuetypes need IList /
801         ICollection / IEnumerator interfaces for their extra twin type - sbyte for byte
802         for example.
803
804         * class.c (get_implicit_generic_array_interfaces): InternalEnumerator gets
805         interfaces for valuetypes if needed.    
806
807         * class.c (fill_valuetype_array_derived_types): Enums should have interfaces
808         for their basetype as well. Types are array expanded if rank is > 0.
809
810         Fixes #400716.
811
812 2008-12-30  Bill Holmes  <billholmes54@gmail.com>
813
814         * socket-io.h : Changing the signature of
815           ves_icall_System_Net_Sockets_Socket_Accept_internal to pass
816           the blocking state.
817
818         * icall-def.h :  Changing the signature of
819           System.Net.Sockets.Socket.Accept_internal to pass the blocking state.
820
821         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Accept_internal) :
822           For Windows only.  Avoid blocking when calling accept by
823           querying for a connection via select.  The loop also queries
824           the thread state every 1000 micro seconds for the thread
825           stop state.  This will avoid the process hanging on shutdown
826           when using a TcpChannel that is never connected to.
827
828         Code is contributed under MIT/X11 license.
829
830 2008-12-30  Marek Safar  <marek.safar@gmail.com>
831
832         * tabledefs.h: Add METHOD_ATTRIBUTE_CHECK_ACCESS_ON_OVERRIDE.
833
834 2008-12-26 Rodrigo Kumpera  <rkumpera@novell.com>
835
836         * class.c (get_implicit_generic_array_interfaces): Extract common
837         code to a helper function making it a lot easier on the eyes.
838
839 2008-12-26 Rodrigo Kumpera  <rkumpera@novell.com>
840
841         * class.c (get_implicit_generic_array_interfaces): If the internal
842         enumerator is an interface inflate System.Object instead of itself.
843
844         Fixes #461261.
845
846 2008-12-24 Rodrigo Kumpera  <rkumpera@novell.com>
847
848         * object.c (mono_runtime_invoke_array): Don't assert with
849         byref nullable types.
850
851         * marshal.c (mono_marshal_get_runtime_invoke): To handle
852         byref nullables we unbox the object and store it on the
853         stack. 
854         We can't use the boxed object since it is the T of Nullable<T>
855         and the boxed representation of a nullable it's underlying type
856         or null.
857         We could cheat and create a boxed nullable and use the same
858         machinery of other byref VTs but this feels like a hack and
859         using the stack has the bonus of reducing heap pressure.
860
861         Fixes #461941.
862
863 2008-12-23 Rodrigo Kumpera  <rkumpera@novell.com>
864
865         * marshal.c (mono_marshal_emit_managed_wrapper): Handle char
866         return value.
867
868         Fixes #461867.
869
870 2008-12-19  Bill Holmes  <billholmes54@gmail.com>
871
872         * icall-def.h : Adding an internal call definition for 
873           System.Environment.internalBroadcastSettingChange.
874
875         * icall.c : Adding a Windows only implementation to broadcast a 
876           WM_SETTINGCHANGE when an environment variable has changed.
877
878         Code is contributed under MIT/X11 license.
879
880 2008-12-19  Mark Probst  <mark.probst@gmail.com>
881
882         * class.c, class-internals.h: Made
883         mono_class_has_parent_and_ignore_generics() non-static.
884
885 Thu Dec 18 16:35:22 CET 2008 Paolo Molaro <lupus@ximian.com>
886
887         * image.c: deal with the mmap failing when loading an image.
888
889 2008-12-17  Geoff Norton  <gnorton@novell.com>
890
891         * threadpool.c: Ensure that the io_queue_lock is initialized
892         in all circumstances, as we always attempt to cleanup against it.
893
894 2008-12-17  Miguel de Icaza  <miguel@novell.com>
895
896         * icall.c (ves_icall_System_Environment_get_Platform): For
897         compatibility reasons for existing client code we will keep
898         returning 4 for a while.   
899
900         For how long will depend on the documentation being updated, and
901         for us to give client code a chance to be updated.
902
903         This reverts the original decison on #433108 since we did not
904         catch roughly 33 instances of the broken code in our own source
905         code base, we did not catch failures on the buildbots, and QA did
906         not bring this as a problem.
907
908         Only today I found some customer's code breaking due to our own
909         class libraries not being fully updated and tracked it down to
910         this change.  I am reverting it because if we could not even get
911         our story straight in our own code base, how can we hope that our
912         end user code be fixed?
913
914         As of this morning, our Wiki page that documents how to detect
915         Unix had not been fixed.    
916
917 2008-12-16  Zoltan Varga  <vargaz@gmail.com>
918
919         * metadata.c (inflated_method_in_image): Add a workaround for #458168.
920
921         * class.c (mono_class_get_fields): Handle loading errors.
922
923 2008-12-12 Mark Mason <mmason@upwardaccess.com>
924
925         * 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.
926         
927 2008-12-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
928
929         * mono-perfcounters.c: avoid warning.
930
931 2008-12-12 Rodrigo Kumpera  <rkumpera@novell.com>
932
933         * reflection.c (ensure_runtime_vtable): Work on generic instances and
934         make sure all interfaces have MonoClass::interface_id set.
935
936         * reflection.c (ensure_generic_class_runtime_vtable): Ensure the
937         method table is property set.
938
939 2008-12-12 Rodrigo Kumpera  <rkumpera@novell.com>
940
941         * class.c: New function mono_class_setup_interface_id that setup
942         MonoClass::interface_id if needed.
943
944         * class-internals.h: Export new function.
945
946 2008-12-12 Rodrigo Kumpera  <rkumpera@novell.com>
947
948         * class.c: Add code to sanity check the vtable after setup_vtable_general
949         has done it's work.
950
951 2008-12-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
952
953         * icall.c: make Assembly.GetExecutingAssembly work properly when
954         reflection is used to invoke the method.
955         Bug #321781 fixed.
956
957 2008-12-11  Mark Probst  <mark.probst@gmail.com>
958
959         * metadata/generic-sharing.c: Look for constraints in all type
960         arguments, not just the first one.
961
962 2008-12-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
963
964         * appdomain.c: return the correct CodeBase for an Assembly instance
965         that was loaded from the shadow-copy directories.
966         Bug #458190 fixed.
967
968 2008-12-10  Zoltan Varga  <vargaz@gmail.com>
969
970         * sgen-gc.c (build_nursery_fragments): Clear nursery_next/nursery_frag_real_end.
971
972         * sgen-gc.c (check_object): New debugging helper function.
973
974         * object.c: Fix calls to mono_value_copy_array ().
975
976 2008-12-10 Rodrigo Kumpera  <rkumpera@novell.com>
977
978         * class.c (mono_class_setup_fields): If working on an inflated class
979         first check if the generic definition did init with success.
980
981         Fixes #445361.
982
983 2008-12-10 Rodrigo Kumpera  <rkumpera@novell.com>
984
985         pedump.c (main): Fix a warning.
986
987 2008-12-10  Bill Holmes  <billholmes54@gmail.com>
988
989         * object-internals.h : Adding a definition for 
990           MonoReflectionComVisibleAttribute.
991
992         * marshal.c (cominterop_com_visible) :  Method added to check the 
993           ComVisible attribute of a class.
994
995         * marshal.c (cominterop_raise_hr_exception, cominterop_get_interface) :  
996           cominterop_raise_hr_exception added to consolidate common code 
997           to raise hr exceptions.
998
999         * marshal.c (cominterop_can_support_dispatch) :  Method added to determine 
1000           if a managed class should support IDispatch.
1001
1002         * marshal.c 
1003           (cominterop_get_idispatch_for_objec, cominterop_ccw_queryinterfacet) :  
1004           Added additional checks for managed object when getting 
1005           an IDispatch interface.
1006
1007         Code is contributed under MIT/X11 license.
1008
1009 2008-12-10 Rodrigo Kumpera  <rkumpera@novell.com>
1010
1011         pedump.c (main): Handle mono_get_method () returning NULL. 
1012
1013 2008-12-09  Zoltan Varga  <vargaz@gmail.com>
1014
1015         * marshal.h: Fix a warning.
1016
1017 2008-12-09  Bill Holmes  <billholmes54@gmail.com>
1018
1019         * marshal.c : Adding cominterop_release_all_rcws to release all
1020           runtime callable wrappers held by the runtime.
1021
1022         * marshal.h : Adding declaration for cominterop_release_all_rcws.
1023           
1024         Code is contributed under MIT/X11 license.
1025
1026 2008-12-09  Zoltan Varga  <vargaz@gmail.com>
1027
1028         * metadata.c (mono_image_alloc_lock): New helper function.
1029         (mono_image_alloc0_lock): Ditto.
1030
1031         * metadata.c: Use the alloc_lock () helper functions for allocating
1032         memory from the image mempool.
1033
1034 2008-12-08 Rodrigo Kumpera  <rkumpera@novell.com>
1035
1036         * class.c (mono_class_from_generic_parameter): Document it's
1037         locking behavior. Fix double checked locking here, we stored in
1038         param->pklass a partially initialized MonoClass and no membar was used.
1039
1040 2008-12-05  Marek Habersack  <mhabersack@novell.com>
1041
1042         * sysmath.c (ves_icall_System_Math_Round2): if round (3) and rint
1043         (3) functions are present in the C library use them to do the
1044         job. If they are absent, make sure that the sum of int_part and
1045         dec_part is rounded before returning. This is necessary due to the
1046         division of dec_part by the power of 10 before the final addition
1047         is performed - if the result is not rounded in some cases it will
1048         yield invalid results.
1049
1050 2008-12-04  Zoltan Varga  <vargaz@gmail.com>
1051
1052         * marshal.c (mono_marshal_emit_native_wrapper): Add AOT support for pinvoke
1053         wrappers by emitting the function address using a CEE_MONO_ICALL_ADDR 
1054         instruction instead of a pointer constant.
1055
1056 2008-12-03  Zoltan Varga  <vargaz@gmail.com>
1057
1058         * loader.c (mono_method_get_header): Do most of the work outside the
1059         loader lock, to avoid assembly load hook deadlocks.
1060
1061         * metadata.c (mono_metadata_parse_mh_full): Use finer-grained locking.
1062         (mono_metadata_parse_type_full): Ditto.
1063
1064 2008-12-02 Rodrigo Kumpera  <rkumpera@novell.com>
1065
1066         * mempool.c (mono_backtrace): Take the number of allocated bytes as argument.
1067         Make the stack depth fixed. Ensure proper argument passing to the backtrace
1068         funtions. Finally, use a lock to produce well ordered output.
1069
1070         The lock looks silly, as all calls to the corlib mempool should be guarded
1071         with the loader lock, but for some reason this fact doesn't help. 
1072
1073         * mempool.c (mono_mempool_alloc0): Add support for TRACE_ALLOCATIONS.
1074
1075 2008-12-02  Mark Probst  <mark.probst@gmail.com>
1076
1077         * socket-io.c: 64 bit big-endian fixes.
1078
1079 2008-12-01 Rodrigo Kumpera  <rkumpera@novell.com>
1080
1081         * verify.c (is_compatible_boxed_valuetype): Rewrite function to work properly with
1082         targets that require strict compatibility between the types.
1083
1084         * verify.c (verify_stack_type_compatibility_full): Boxed values are not compatible
1085         to unboxed types. All cases that this is true are checked by is_compatible_boxed_valuetype.
1086         Kill the strict argument and create a new one valuetype_must_be_boxed.
1087
1088         * verify.c (verify_delegate_compatibility): Use verify_stack_type_compatibility_full to
1089         state that all valuetypes must be boxed.
1090
1091         Fixes #448560.
1092
1093 2008-11-29  Kornél Pál  <kornelpal@gmail.com>
1094
1095         * coree.c (MonoFixupExe): Use sizeof(IMAGE_BASE_RELOCATION) instead of
1096         IMAGE_SIZEOF_BASE_RELOCATION as newer Vista SDKs no longer define the latter.
1097
1098         Contributed under MIT/X11 license.
1099
1100 2008-11-28 Rodrigo Kumpera  <rkumpera@novell.com>
1101
1102         * class.c (mono_class_setup_fields): Don't copy MonoType::attrs as
1103         the inflate_generic_type machinery should handle it.
1104
1105         This avoids a crash when the field's flags is zero and it's type is
1106         a primitive.
1107         What happens is that mono_metadata_parse_type_full will see that opt_attrs
1108         is zero and will return one of the cached built-in primitive types. Since
1109         those types live in read-only memory, the code that copies it crashes.  
1110
1111 2008-11-28  Mark Probst  <mark.probst@gmail.com>
1112
1113         * object.c: Don't put function descriptors into generalized IMT
1114         thunks.
1115
1116 2008-11-28  Mark Probst  <mark.probst@gmail.com>
1117
1118         * class.c: Enable generic code sharing on PPC64.
1119
1120 2008-11-27  Mark Probst  <mark.probst@gmail.com>
1121
1122         * mempool.c, mempool-internals.h: Added g_slist_append_mempool()
1123         from mini/mini.c.
1124
1125         * generic-sharing.c: Allocate the method template slists from the
1126         image mempool so it doesn't leak.
1127
1128 2008-11-27 Rodrigo Kumpera  <rkumpera@novell.com>
1129
1130         * class.c (generic_array_methods): Release the linked list.
1131
1132 2008-11-27  Mark Probst  <mark.probst@gmail.com>
1133
1134         * marshal.c (mono_string_builder_to_utf8): Fixed a wrong
1135         invocation to g_utf16_to_utf8().
1136
1137 2008-11-26  Mark Probst  <mark.probst@gmail.com>
1138
1139         * icall.c (mono_ArgIterator_IntGetNextArg): Handle sub-word sized
1140         arguments on big endian archs.
1141
1142 2008-11-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
1143
1144         * reflection.c: (_mono_reflection_parse_type) skip leading spaces in
1145         the type name (test added in corlib).
1146
1147 2008-11-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
1148
1149         * pedump.c: initialize perf. counters. Fixes a segv.
1150
1151 2008-11-25  Martin Baulig  <martin@ximian.com>
1152
1153         * mono-debug-debugger.c
1154         (mono_debugger_runtime_invoke): Return the exception object if an
1155         exception was thrown.  Visual Studio displays the exception object
1156         in the locals window.
1157
1158 2008-11-24  Mark Probst  <mark.probst@gmail.com>
1159
1160         * mini-trampolines.c (mono_delegate_trampoline): Don't return a
1161         ftnptr.
1162
1163 2008-11-24  Mark Probst  <mark.probst@gmail.com>
1164
1165         * marshal.c (mono_type_native_stack_size): MONO_TYPE_I and
1166         MONO_TYPE_U are sizeof (gpointer), too.
1167
1168 2008-11-24  Mark Probst  <mark.probst@gmail.com>
1169
1170         * marshal.c (mono_type_native_stack_size): Fixed size and
1171         alignment for reference types.
1172
1173 2008-11-23  Mark Probst  <mark.probst@gmail.com>
1174
1175         * class.c (mono_class_generic_sharing_enabled): Disable generic
1176         code sharing for PPC64.
1177
1178 2008-11-21 Rodrigo Kumpera  <rkumpera@novell.com>
1179
1180         * icall.c (mono_method_get_equivalent_method): Make sure
1181         method->klass->methods is inited before looping over it.
1182
1183 2008-11-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
1184
1185         * object.c: when calling ExecuteAssembly in a newly created domain,
1186         the configuration file and application base are already set up.
1187         Bug #446353 take 2 fixed.
1188
1189 2008-11-20  Zoltan Varga  <vargaz@gmail.com>
1190
1191         * marshal.c: Add support for MONO_TYPE_GENERICINST to some functions.
1192         Fixes #444715. Fix a warning.
1193
1194 2008-11-18 Gonzalo Paniagua Javier <gonzalo@novell.com>
1195
1196         * appdomain.c: write the full path of the assembly to the .ini file
1197         created when "shadow-copying"
1198         Bug #446353 fixed.
1199
1200 2008-11-18  Zoltan Varga  <vargaz@gmail.com>
1201
1202         * debug-helpers.c (mono_method_full_name): Stringify wrapper types even
1203         if signature==FALSE.
1204
1205 2008-11-17  Bill Holmes  <billholmes54@gmail.com>
1206
1207         * marshal.h : Fix the cygwin build.
1208            marshal.c:12442: undefined reference to `_IID_IMarshal'
1209           
1210         Code is contributed under MIT/X11 license.
1211
1212 2008-11-17  Bill Holmes  <billholmes54@gmail.com>
1213
1214         * marshal.h : cominterop_ccw_getfreethreadedmarshaler added to return the
1215           free threaded marshaler when QueryInterface is called on a COM callable
1216           wrapper requesting the IMarshal interface.
1217           
1218         Code is contributed under MIT/X11 license.
1219
1220 2008-11-14  Zoltan Varga  <vargaz@gmail.com>
1221
1222         * domain-internals.h (MonoDomain): Update MONO_DOMAIN_LAST_GC_TRACKED.
1223
1224         * reflection.c (mono_type_get_object): Special case the very common
1225         void type.
1226
1227         * domain-internals.h (struct _MonoDomain): Add 'typeof_void' field to
1228         hold typeof(void).
1229
1230 2008-11-13  Bill Holmes  <billholmes54@gmail.com>
1231
1232         * process.h : Adding method declaration for
1233           ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
1234           
1235         * process.c : Adding implementation for
1236           ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
1237           
1238         * icall-def.h : Registering ICALL Processs.WaitForInputIdle_internal
1239           to ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
1240
1241         Code is contributed under MIT/X11 license.
1242
1243 2008-11-10  Rodrigo Kumpera  <rkumpera@novell.com>
1244
1245         * appdomain.c (unload_thread_main): Clean up threadpool by
1246         calling mono_thread_pool_remove_domain_jobs.
1247
1248         * domain-internals.h (struct _MonoDomain): Add new fields to
1249         help coordinate the cleanup of the threadpool.
1250
1251         * threadpool.c (mono_thread_pool_remove_domain_jobs): New fuction
1252         that cleans up the threadpool of all jobs associated with an appdomain.
1253         It does that by cleaning up the queues and making sure all active
1254         threads are accounted.
1255
1256         * threadpool.c (async_invoke_io_thread): Ignore job if its domain is
1257         unloaded or in the process of. Take this is such way that there is
1258         no race condition between another thread starting the unload and the
1259         current thread acknowledging it.
1260
1261         * threadpool.c (async_invoke_thread): Same.
1262
1263         * threadpool.c (start_io_thread_or_queue): Increment threadpool_jobs before
1264         firing the new thread.
1265
1266         * threadpool.c (start_tpthread): Same.
1267
1268         * theadpool.c (append_job): Increment threadpool_jobs before queueing.
1269
1270         * threadpool.h: Add mono_thread_pool_remove_domain_jobs.
1271
1272 2008-11-06  Jonathan Chambers  <joncham@gmail.com>
1273
1274         * file-io.c (ves_icall_System_IO_MonoIO_DuplicateHandle): 
1275         Add support for DuplicateHandle.
1276         
1277         * file-io.h (ves_icall_System_IO_MonoIO_DuplicateHandle): 
1278         Add support for DuplicateHandle.
1279         
1280         * icall-def.h (ves_icall_System_IO_MonoIO_DuplicateHandle): 
1281         Add support for DuplicateHandle.
1282
1283         Code is contributed under MIT/X11 license.
1284
1285 2008-11-06  Mark Probst  <mark.probst@gmail.com>
1286
1287         * class-internals.h: Make min_align into a whole byte.
1288
1289         * class.c: Set min_align for SIMD types to 16.
1290
1291 2008-11-05  Geoff Norton  <gnorton@novell.com>
1292
1293         * attach.c: Default the attacher to enabled for all cases including
1294         embedded.
1295
1296 Wed Nov 5 16:33:41 CET 2008 Paolo Molaro <lupus@ximian.com>
1297
1298         * monitor.c, class-internals.h, wrapper-types.h: revert incorrect
1299         change r117650.
1300
1301 2008-11-04  Mark Probst  <mark.probst@gmail.com>
1302
1303         * monitor.c, monitor.h: New function for querying offsets of
1304         members of MonoThreadsSync.
1305
1306 2008-11-04  Zoltan Varga  <vargaz@gmail.com>
1307
1308         * marshal.c (mono_marshal_get_runtime_invoke): Use runtime_invoke_direct_cache
1309         to speed up this function and to avoid the boundless memory growth caused by
1310         the signature_dup () calls.
1311
1312 2008-11-02  Zoltan Varga  <vargaz@gmail.com>
1313
1314         * monitor.c (mono_monitor_get_fast_enter_method): Add a proper type for the
1315         wrapper.
1316
1317         * class-internals.h (struct _MonoMethod): Increase the size of 'wrapper_type'
1318         by 1 bit.
1319
1320         * wrapper-types.h: Add MONO_WRAPPER_MONITOR_FAST_ENTER/EXIT.
1321
1322 2008-10-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
1323
1324         * appdomain.c:
1325         * domain-internals.h: made mono_set_private_bin_path_from_config()
1326         "internal".
1327         * object.c: call the above function after setting the configuration
1328         file path for the root domain.
1329         Fixes bug #314478.
1330
1331 2008-10-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
1332
1333         * assembly.c: when the assembly is loaded from an absolute path, end
1334         basedir with a directory separator.
1335         Bug #440781 fixed.
1336
1337 2008-10-30  Mark Probst  <mark.probst@gmail.com>
1338
1339         * monitor.c (mono_monitor_get_fast_enter_method): If
1340         CompareExchange is not available, don't create the fastpath
1341         instead of asserting.  (The method is missing in the 1.1 profile.)
1342
1343 2008-10-30  Mark Probst  <mark.probst@gmail.com>
1344
1345         * marshal.c, marshal.h: Rename signature_no_pinvoke() and make it non-static.
1346
1347         * monitor.c, monitor.h: Code for generating Monitor.Enter and
1348         Monitor.Exit IL fastpaths.
1349
1350 2008-10-28  Rodrigo Kumpera  <rkumpera@novell.com>
1351
1352         * class.c (mono_class_create_from_typedef): Added Vector2ul.
1353
1354 2008-10-28  Rodrigo Kumpera  <rkumpera@novell.com>
1355
1356         * class.c (mono_class_create_from_typedef): Added Vector2l.
1357
1358 2008-10-27  Rodrigo Kumpera  <rkumpera@novell.com>
1359
1360         * class.c (mono_class_create_from_typedef): Added Vector2d.
1361
1362 2008-10-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
1363
1364         * appdomain.c: translate \ into / for cache_path.
1365         * domain-internals.h: new mono_is_shadow_copy_enabled().
1366         * icall.c: (fill_reflection_assembly_name) do the same path
1367         manipulations that get_code_base does.
1368         (get_code_base) use mono_is_shadow_copy_enabled.
1369
1370 2008-10-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
1371
1372         * appdomain.c: shadow-copied assemblies go to CachePath +
1373         ApplicationName when both are set. DynamicBase has nothing to do with
1374         shadow copies.
1375         Bug #406877 fixed.
1376
1377 2008-10-26  Zoltan Varga  <vargaz@gmail.com>
1378
1379         * reflection.c (encode_locals): Use a cache to avoid duplicate entries in the
1380         STANDALONESIG table.
1381
1382         * metadata-internals.h (struct _MonoDynamicImage): Add cache for
1383         standalone signatures.
1384
1385         * marshal.c (mono_marshal_get_runtime_invoke): Rewrite the signature 
1386         comparison code: instead of comparing the signatures using a custom
1387         equals function, transform them to a common signature and compare that. This
1388         works better with AOT.
1389
1390 2008-10-25  Zoltan Varga  <vargaz@gmail.com>
1391
1392         * Reapply r116521 with (!mono_debug_using_mono_debugger ()) checks.
1393
1394         * class.c (mono_class_init): Remove unneccesary mono_class_setup_properties ()
1395         call for generic instances.
1396         (mono_class_setup_properties): Call setup_properties () before accessing
1397         gklass->properties.
1398
1399         * class.c (mono_class_get_virtual_methods): New helper function to iterate
1400         over the virtual methods of a class using metadata if possible, avoiding the
1401         creation of MonoMethod's for non-virtual methods.
1402         
1403         * class.c (mono_class_setup_vtable_general): Rewrite this to use 
1404         get_virtual_methods () to iterate over the virtual methods of classes.
1405
1406 2008-10-25  Martin Baulig  <martin@ximian.com>
1407
1408         * mono-debug.h (MONO_DEBUG_VAR_ADDRESS_MODE_DEAD): New #define.
1409
1410 2008-10-24  Rodrigo Kumpera  <rkumpera@novell.com>
1411
1412         * class.c (mono_class_create_from_typedef): Added Vector4i.
1413
1414 2008-10-24  Mark Probst  <mark.probst@gmail.com>
1415
1416         * marshal.c (mono_marshal_get_synchronized_wrapper): Emit
1417         ldtoken+GetTypeFromHandle instead of i4+icall so that the JIT
1418         special-casing applies to eliminate the call completely.
1419
1420 2008-10-24  Rodrigo Kumpera  <rkumpera@novell.com>
1421
1422         * class.c (mono_class_create_from_typedef): Added Vector8s.
1423
1424 2008-10-23  Rodrigo Kumpera  <rkumpera@novell.com>
1425
1426         * class.c (mono_class_create_from_typedef): Added Vector16sb.
1427
1428 2008-10-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
1429
1430         * icall.c: get rid of annoying warning.
1431
1432 2008-10-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
1433
1434         * threadpool.c: in 1.x, if you change the background status of the
1435         threadpool thread, it's not reset.
1436         Remove unnecessary calls to SetState.
1437
1438 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
1439
1440         * threadpool.c: asynchronously create a set of idle threads upon first
1441         use of the threadpool. SetMinThreads will now start the appropriate
1442         number of idle threads if they are not already running. The default is
1443         1 threadpool thread per CPU. Increased the maximum number of threads
1444         per CPU to 10.
1445
1446 2008-10-22  Martin Baulig  <martin@ximian.com>
1447
1448         Revert r116521 from Zoltan, it breaks the debugger:
1449
1450         * class.c (mono_class_get_virtual_methods): New helper function to iterate
1451         over the virtual methods of a class using metadata if possible, avoiding the
1452         creation of MonoMethod's for non-virtual methods.
1453         
1454         * class.c (mono_class_setup_vtable_general): Rewrite this to use 
1455         get_virtual_methods () to iterate over the virtual methods of classes.
1456
1457 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
1458
1459         * threads.c: when creating a threadpool thread, set its state to
1460         'background'.
1461         * threadpool.c: reset the background state of a threadpool thread
1462         after finishing each work item
1463         Bug #437888 fixed.
1464
1465 2008-10-22  Zoltan Varga  <vargaz@gmail.com>
1466
1467         * class.c (mono_class_get_vtable_entry): Add an optimization for szarrays.
1468         
1469         * class.c (mono_class_setup_vtable_general): Add an optimized version for
1470         generic instances which works by inflating the methods in the container
1471         class's vtable.
1472
1473         * class.c (mono_class_inflate_generic_type_with_mempool_no_copy): New
1474         variant which doesn't make a copy if no inflation was done.
1475         (mono_class_setup_fields): Use it.
1476
1477         * metadata.c (mono_metadata_get_shared_type): New helper function to
1478         return a shared instance of a given MonoType.
1479
1480         * class.c (mono_class_inflate_generic_type_with_mempool): Avoid making
1481         a copy of most non-generic types.
1482
1483 Wed Oct 22 18:00:46 CEST 2008 Paolo Molaro <lupus@ximian.com>
1484
1485         * threadpool.c: remove one more GetSystemInfo () call.
1486
1487 Wed Oct 22 17:45:48 CEST 2008 Paolo Molaro <lupus@ximian.com>
1488
1489         * mono-perfcounters.c, icall-def.h, environment.c, environment.h:
1490         use the code in mono-proclib.h to get processor information.
1491
1492 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
1493
1494         * appdomain.c: fixed the logic that determines whether assemblies in a
1495         directory are "shadow-copied" or not. Bug #433483 fixed.
1496
1497 2008-10-22  Zoltan Varga  <vargaz@gmail.com>
1498
1499         * process.c (ves_icall_System_Diagnostics_Process_GetProcessData): Fix a
1500         warning.
1501
1502 2008-10-21  Zoltan Varga  <vargaz@gmail.com>
1503
1504         * marshal.c (runtime_invoke_signature_equal): Don't shared wrappers
1505         returning a vtype.
1506
1507         * class.c debug-helpers.c object.c class-internals.h marshal.c icall.c
1508         reflection.c: Use mono_field_get_name () for accessing a field's name.
1509
1510         * class-internals.h (MONO_CLASS_HAS_STATIC_METADATA): Move this here from
1511         class.c
1512
1513         * class.c (mono_field_get_rva): Fix crash if this is called on a dynamic
1514         field.
1515
1516         * loader.c (find_method_in_class): Reenable the metadata optimization by
1517         not using it for generic instances.
1518
1519         * class-internals.h (MonoFieldDefaultValue): Extract the rarely used 
1520         data/def_type fields from MonoClassField into a separate structure.
1521         (struct MonoClassField): Remove data/def_type fields.
1522         (struct _MonoClass): Add a 'field_def_values' array to store the default
1523         values/RVA for fields.
1524
1525         * class.c reflection.c: Update after the changes.
1526         
1527         * object.c (mono_class_create_runtime_vtable): Use mono_field_get_data ()
1528         for accessing field->data.
1529
1530         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_InitializeArray): Ditto.
1531
1532         * loader.c (find_method_in_class): Revert the last change for now as
1533         it breaks Mono.C5 unit tests.
1534
1535         * class-internals.h (struct _MonoDynamicGenericClass): Add fields
1536         'field_generic_types' and 'field_objects' which contain the information
1537         previously stored in MonoInflatedField.
1538         (MonoInflatedField): Delete.
1539         (struct _MonoClassField): Delete 'generic_info' field.
1540
1541         * reflection.c: Store the information which was previously in 
1542         field->generic_info in MonoDynamicGenericClass instead.
1543
1544         * metadata.c (free_generic_class): Update after MonoDynamicGenericClass/
1545         MonoClassField changes.
1546
1547 Tue Oct 21 17:07:55 CEST 2008 Paolo Molaro <lupus@ximian.com>
1548
1549         * marshal.c, method-builder.c: get rid of wrapper_hash and instead
1550         store the value inside the data array of the MonoMethodWrapper.
1551         This saves memory, is faster and fixes the lifetime issues (methods
1552         were never removed from the hash previously). May also fix bug#436996.
1553
1554 2008-10-21  Zoltan Varga  <vargaz@gmail.com>
1555
1556         * reflection.c (mono_image_get_fieldref_token): For fields of non-dynamic 
1557         generic instances, compute the type from the generic definition instead of
1558         looking in field->generic_info.
1559
1560         * class.c (mono_class_setup_fields): Don't create a MonoInflatedField
1561         for inflated fields, the only user was get_fieldref_token () which no
1562         longer needs it.
1563
1564         * class.c (mono_class_init): Revert the last change as it seems to cause
1565         crashes.
1566
1567         * class-internals.h (struct _MonoClassField): Reorder fields to save 4
1568         bytes on 64 bit platforms.
1569
1570         * object.c (mono_class_create_runtime_vtable): Fix a warning.
1571         
1572         * object.c (mono_class_create_runtime_vtable): Don't initalize
1573         field->data/field->def_type here, it is done lazily by 
1574         mono_class_get_field_default_value ().
1575
1576         * icall.c (ves_icall_get_enum_info): Call 
1577         mono_class_get_field_default_value () instead of directly accessing
1578         field->data and field->def_type.
1579
1580         * object.c (get_default_field_value): Ditto.
1581
1582         * class.c (mono_field_get_data): Ditto.
1583         
1584         * class.c (mono_class_init): Remove unneccesary mono_class_setup_methods ()
1585         call for generic instances.
1586
1587         * loader.c (find_method_in_class): If klass != from_class, then inflate
1588         the method with the context of from_class, since the caller assumes this.
1589
1590 2008-10-20  Zoltan Varga  <vargaz@gmail.com>
1591
1592         * class.c (mono_method_get_vtable_index): Use mono_method_get_vtable_slot ()
1593         for accessing method->slot.
1594
1595 2008-10-20  Cedric Vivier  <cedricv@neonux.com>
1596
1597         * icall-def.h, icall.c: Add icall for Debugger.IsAttached.
1598
1599 2008-10-19  Zoltan Varga  <vargaz@gmail.com>
1600
1601         * class.c (mono_method_get_vtable_index): Use
1602         mono_method_get_vtable_slot () for accessing method->slot.
1603
1604         * object.c (build_imt_slots): Use mono_class_get_method_by_index () for
1605         accessing klass->methods.
1606
1607         * class.c (mono_method_get_vtable_slot): New helper function.
1608         (mono_class_get_vtable_entry): Ditto.
1609         (mono_class_setup_vtable_general): Use mono_method_get_vtable_slot () for
1610         accessing method->slot.
1611
1612         * generic-sharing.c (mono_class_get_method_generic): Pass the declaring
1613         method to get_inflated_method ().
1614
1615         * class.c (mono_class_get_inflated_method): New helper method to obtain
1616         a method of an inflated class without calling setup_methods ().
1617         (mono_class_get_cctor): Use get_inflated_method.
1618
1619         * generic-sharing.c (mono_class_get_method_generic): Ditto.
1620         
1621         * marshal.c image.c: Lazily create all the marshal caches.
1622
1623         * image.c (mono_image_init): Move initialization of runtime_invoke
1624         caches to marshal.c.
1625
1626         * marshal.c (get_cache): New helper function to lazily initialize a 
1627         wrapper cache.
1628         (mono_marshal_get_runtime_invoke): Share more runtime invoke wrappers.
1629
1630         * debug-helpers.c (mono_method_full_name): Include generic arguments.
1631
1632 Fri Oct 17 10:51:32 CEST 2008 Paolo Molaro <lupus@ximian.com>
1633
1634         * loader.c: fixed check for interface type.
1635
1636 Thu Oct 16 20:59:11 CEST 2008 Paolo Molaro <lupus@ximian.com>
1637
1638         * appdomain.c: check for NULL setup before it's referenced.
1639
1640 p
1641 Thu Oct 16 16:12:23 CEST 2008 Paolo Molaro <lupus@ximian.com>
1642
1643         * class.c: remove the unused old vtable setup code.
1644
1645 Thu Oct 16 12:53:29 CEST 2008 Paolo Molaro <lupus@ximian.com>
1646
1647         * class.c: don't depend on interface order in
1648         setup_interface_offsets (bug #435777).
1649         * reflection.c: sort the InterfaceImpl table (patch from
1650         Jb Evain  <jbevain@novell.com>).
1651
1652 2008-10-13  Zoltan Varga  <vargaz@gmail.com>
1653
1654         * assembly.c (mono_assembly_open_full): Avoid loading images while holding
1655         the low level assemblies lock.
1656
1657 Mon Oct 13 16:35:26 CEST 2008 Paolo Molaro <lupus@ximian.com>
1658
1659         * domain-internals.h, domain.c, icall.c, image.c, marshal.c,
1660         object.c, reflection.c, socket-io.c, threads.c: introduced
1661         mono_framework_version () to return the major framewrok version,
1662         changed the code that was using more complex patterns to use it.
1663         Return the correct value for PlatformID for OSX.
1664
1665 Mon Oct 13 14:38:01 CEST 2008 Paolo Molaro <lupus@ximian.com>
1666
1667         * icall-def.h, process.h, process.c: added an icall to get info about
1668         processes using mono-proclib.
1669
1670 Mon Oct 13 11:14:44 CEST 2008 Paolo Molaro <lupus@ximian.com>
1671
1672         * mono-perfcounters.c: use the mono-proclib functions to
1673         access process information.
1674
1675 Mon Oct 13 11:00:49 CEST 2008 Paolo Molaro <lupus@ximian.com>
1676
1677         * domain.c, assembly.c, debug-mono-symfile.c, debug-mono-symfile.h,
1678         monosn.c, Makefile.am, pedump.c, image.c, metadata-internals.h,
1679         reflection.c: remove rawbuffer usage: mmap support is more sanely
1680         provided by utils/mono-mmap.
1681
1682 Sat Oct 11 19:46:19 CEST 2008 Paolo Molaro <lupus@ximian.com>
1683
1684         * gc.c: use posix semaphores when possible so that
1685         mono_gc_finalize_notify() is signal safe.
1686
1687 2008-10-11  Zoltan Varga  <vargaz@gmail.com>
1688
1689         * reflection.c: Implement DISABLE_REFLECTION_EMIT, remove some
1690         #ifdef DISABLE_REFLECTION_SAVE stuff, only the exported functions need to
1691         be #ifdef-ed out, the linker will remove the rest.
1692
1693         * marshal.c: Implement DISABLE_COM.
1694
1695         * reflection.c: Implement DISABLE_REFLECTION_EMIT_SAVE.
1696
1697 2008-10-11  Miguel de Icaza  <miguel@novell.com>
1698
1699         * locales.c (string_invariant_compare_char): Optimization: do not
1700         call g_unichar_type unless we actually need the information.
1701
1702 2008-10-10  Mark Probst  <mark.probst@gmail.com>
1703
1704         * object.c, class-internals.h: Also create remoting trampolines
1705         for generic methods.  Pass the domain to the remoting trampoline
1706         creation function, too.
1707
1708 2008-10-10  Zoltan Varga  <vargaz@gmail.com>
1709
1710         * class.c (mono_class_init): Fix+re-enable the finalize optimization.
1711
1712 2008-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
1713
1714         * class.c (mono_class_create_from_typedef): Vector4u was renamed to
1715         Vector4ui.
1716
1717 2008-10-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
1718
1719         * assembly.c:
1720         * locales.c: remove the use of g_strdown. Fixes bug #322313.
1721
1722 Fri Oct 10 17:01:42 CEST 2008 Paolo Molaro <lupus@ximian.com>
1723
1724         * assembly.c: in mono_assembly_load_friends() take the assemblies lock
1725         for the least possible amount of time (extending the fix in r113458).
1726
1727 2008-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
1728
1729         * class.c (mono_class_create_from_typedef): Retrofit to new type names.
1730
1731 2008-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
1732
1733         * class.c (mono_class_create_from_typedef): Added Vector8u and Vector16u
1734         as possible simd intrinsic types.
1735         Optimized the test to check for the common prefix first.
1736
1737 Thu Oct 9 17:38:24 CEST 2008 Paolo Molaro <lupus@ximian.com>
1738
1739         * class.c: back out part of a broken optimization committed on
1740         May 23th (bug #433908).
1741
1742 2008-10-09  Mark Probst  <mark.probst@gmail.com>
1743
1744         * profiler.c (simple_shutdown): Don't call mono_thread_attach() on
1745         Win32.  Should fix #432388 for most cases until we have the new
1746         profiler on Win32.
1747
1748 2008-10-08  Zoltan Varga  <vargaz@gmail.com>
1749
1750         * metadata.c (mono_metadata_generic_context_hash): Call generic_inst_hash
1751         instead of using inst->id so the hash is stable for AOT.
1752
1753 2008-10-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
1754
1755         * appdomain.c:
1756         * icall.c: create a .ini file for shadow-copied assemblies that
1757         contains the location of the original assembly. Use this to return the
1758         proper CodeBase for shadow-copied assemblies. Fixes bug #323606.
1759         Also fix the number of '/' for windows when returning the CodeBase.
1760         Fixes bug #430920.
1761
1762 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
1763
1764         * marshal.c (cominterop_get_ccw) : Fixing a copy paste error from r115126.
1765
1766         Code is contributed under MIT/X11 license.
1767
1768 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
1769
1770         * marshal.c (cominterop_get_native_wrapper) : Adding a call to mono_class_setup_vtable
1771           if if the class vtable needs initialized.
1772
1773         Code is contributed under MIT/X11 license.
1774
1775 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
1776
1777         * marshal.c (cominterop_get_native_wrapper_adjusted, cominterop_get_ccw) : 
1778           Adding default MonoMarshalSpecs for COM methods.  OBJECT->STRUCT,
1779           STRING->BSTR, and CLASS->INTERFACE.
1780
1781         Code is contributed under MIT/X11 license.
1782
1783 2008-10-07  Marek Habersack  <mhabersack@novell.com>
1784
1785         * sysmath.h: changed the declaration of the
1786         ves_icall_System_Math_Round2 icall by adding an extra
1787         away_from_zero parameter.
1788
1789         * sysmath.c (ves_icall_System_Math_Round2): added support for
1790         away from zero rounding. The icall now takes an extra boolean
1791         parameter to signal that away from zero operation is requested.
1792
1793 2008-10-06  Zoltan Varga  <vargaz@gmail.com>
1794
1795         * marshal.c (mono_marshal_get_delegate_begin_invoke): Put the wrapper in
1796         the delegate klass so it can work with full-aot.
1797         (mono_marshal_get_delegate_end_invoke): Ditto.
1798         (mono_marshal_get_delegate_invoke): Ditto.
1799
1800 Mon Oct 6 16:10:02 CEST 2008 Paolo Molaro <lupus@ximian.com>
1801
1802         * gc.c, attach.h, attach.c: remove a bad pattern:
1803         add_finalizer_callback () is not implemented correctly, it can't
1804         without adding more overhead to the finalizer loop and it's not
1805         even needed, since we know exactly what we need to call, so there is
1806         no need to do so through an expensive function pointer.
1807
1808 2008-10-04  Zoltan Varga  <vargaz@gmail.com>
1809
1810         * gc.c: Define a dummy version of mono_gc_add_finalizer_thread_callback ()
1811         for the no-gc case.
1812         * attach.c (mono_attach_init): Remove the #ifdef.
1813
1814 2008-10-04  Andreas Färber  <andreas.faerber@web.de>
1815
1816         * attach.c (mono_attach_init): Don't use
1817         mono_gc_add_finalizer_thread_callback when compiling without GC.
1818         Fixes #432306.
1819         
1820         Code is contributed under MIT/X11 license.
1821
1822 2008-10-03  Zoltan Varga  <vargaz@gmail.com>
1823
1824         * class.c (mono_class_create_from_typedef): Remove the 
1825         #ifndef DISABLE_SIMD stuff.
1826
1827 2008-10-03  Rodrigo Kumpera  <rkumpera@novell.com>
1828
1829         * class-internals.h (MonoClass): Added simd_type bit field.
1830
1831         * class.c (mono_class_create_from_typedef): Check if type is a simd
1832         intrinsic.
1833
1834 2008-10-03  Mark Probst  <mark.probst@gmail.com>
1835
1836         * object.c (mono_method_add_generic_virtual_invocation): Only add
1837         instantiations to the thunk whose count is at least as large as
1838         the threshold.
1839
1840 2008-10-02 Gonzalo Paniagua Javier <gonzalo@novell.com>
1841
1842         * icall.c: changed the Type of the exception thrown when trying to
1843         invoke a constructor on an abstract class. Part of the fix for bug
1844         #324185.
1845
1846 2008-10-02  Mark Probst  <mark.probst@gmail.com>
1847
1848         * class.c, class-internals.h (mono_method_get_vtable_index): New
1849         function which returns the index into the vtable and properly
1850         handles inflated virtual generic methods.
1851
1852 2008-10-01  Mark Probst  <mark.probst@gmail.com>
1853
1854         * object.c, domain.c, object-internals.h, domain-internals.h:
1855         Generalize IMT thunk machinery to also handle thunks for virtual
1856         generic method invokes.  When a virtual generic method is invoked
1857         more than a number of times we insert it into the thunk so that it
1858         can be called without lookup in unmanaged code.
1859
1860         * generic-sharing.c, class-internals.h: Fetching a
1861         MonoGenericInst* for a method from an (M)RGCTX.
1862
1863 2008-10-01  Zoltan Varga  <vargaz@gmail.com>
1864
1865         * marshal.c (emit_marshal_string): Applied a variant of a patch by
1866         tom hindle <tom_hindle@sil.org>. Fix byref native-to-managed string
1867         marshalling. Fixes #431304.
1868
1869 2008-10-01  Bill Holmes  <billholmes54@gmail.com>
1870
1871         * marshal.c (emit_marshal_variant) : Change the attribute checks to 
1872           handle when ref is specified without In or Out.
1873
1874         Code is contributed under MIT/X11 license.
1875
1876 2008-09-30  Mark Probst  <mark.probst@gmail.com>
1877
1878         * loader.c (mono_get_method_constrained): Don't expand method with
1879         the class's context, because it's already a method of that class.
1880
1881 2008-09-30  Atsushi Enomoto  <atsushi@ximian.com>
1882
1883         * attach.c : should be correct build fix.
1884
1885 2008-09-29  Zoltan Varga  <vargaz@gmail.com>
1886
1887         * attach.c: Fix the previous change.
1888
1889 2008-09-29  Atsushi Enomoto  <atsushi@ximian.com>
1890
1891         * attach.c : quick w32 build fix.
1892
1893 2008-09-27  Miguel de Icaza  <miguel@novell.com>
1894
1895         * Turn off MONO_GENERIC_SHARING=all and go back to corlib as it
1896         crashes MonoDevelop: #430455.
1897
1898 2008-09-27  Zoltan Varga  <vargaz@gmail.com>
1899
1900         * domain-internals.h (struct _MonoDomain): Move most fields used only by
1901         the JIT do MonoJitDomainInfo in ../mini/mini.h.
1902
1903         * domain.c: Remove initialization/cleanup of the removed fields.
1904
1905 2008-09-27  Mark Probst  <mark.probst@gmail.com>
1906
1907         * class.c (mono_class_generic_sharing_enabled): Enable generic
1908         code sharing for PPC.
1909
1910 2008-09-26  Bill Holmes  <billholmes54@gmail.com>
1911
1912         * attach.c : Fixing the Windows builds.
1913
1914         Code is contributed under MIT/X11 license.
1915
1916 2008-09-25  Zoltan Varga  <vargaz@gmail.com>
1917
1918         * class.c (mono_class_generic_sharing_enabled): Experimentally change 
1919         the default generic sharing mode to 'all'.
1920
1921 2008-09-25  Mark Probst  <mark.probst@gmail.com>
1922
1923         * generic-sharing.c, class-internals.h: New function for checking
1924         whether a method needs a static RGCTX invoke wrapper.  A few
1925         funtions moved from mini/generic-sharing.c.
1926
1927         * icall.c: New function used.
1928
1929 2008-09-25  Mark Probst  <mark.probst@gmail.com>
1930
1931         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal):
1932         Static RGCTX invoke wrapping applies to value type methods, too.
1933
1934         * class.c (mono_class_setup_vtable_general): In generic-shared
1935         value types, wrap methods with a static RGCTX invoke wrapper.
1936
1937 2008-09-25  Zoltan Varga  <vargaz@gmail.com>
1938
1939         * attach.c (ipc_connect): Use AF_UNIX instead of AF_FILE to fix the
1940         osx build.
1941
1942 2008-09-24  Zoltan Varga  <vargaz@gmail.com>
1943
1944         * gc.c (mono_gc_add_finalizer_thread_callback): New function to
1945         register a callback which is called when the finalizer thread is woken
1946         up.
1947         (finalizer_thread): Call the callback if it exists.
1948
1949         * attach.h attach.c: New files, implementing the attach mechanism.
1950
1951         * appdomain.c: Init/cleanup the attach mechanism on startup/shutdown.
1952         
1953         * object.c (mono_object_get_virtual_method): Fix an assertion introduced
1954         by the previous change.
1955
1956 Tue Sep 23 15:24:03 CEST 2008 Paolo Molaro <lupus@ximian.com>
1957
1958         * class.c, domain-internals.h, domain.c, generic-sharing.c, image.c,
1959         loader.c, marshal.c, metadata-internals.h, metadata.c,
1960         method-builder.c, object.c, reflection.c: introduced specific functions
1961         to allocate from the domain and image mempools and cleaned up most of
1962         the code to use them (still missing a few in reflection.c).
1963         Keep the loader bytes counter updated.
1964
1965 Mon Sep 22 17:33:12 CEST 2008 Paolo Molaro <lupus@ximian.com>
1966
1967         * domain.c, monitor.c, boehm-gc.c, gc.c: update some of the GC and
1968         loader-related counters.
1969
1970 Mon Sep 22 17:29:54 CEST 2008 Paolo Molaro <lupus@ximian.com>
1971
1972         * mono-perfcounters-def.h, mono-perfcounters.c, class-internals.h:
1973         added more MS-compatible counters.
1974
1975 2008-09-22  Zoltan Varga  <vargaz@gmail.com>
1976
1977         * class.c (mono_class_setup_fields): Call setup_fields before accessing
1978         class->blittable. Fixes #428217.
1979
1980 2008-09-21  Zoltan Varga  <vargaz@gmail.com>
1981
1982         * reflection.c (mono_image_get_field_on_inst_token): Call 
1983         field_encode_signature () since that handles custom modifiers too.
1984         Fixes #424663.
1985
1986 2008-09-20  Zoltan Varga  <vargaz@gmail.com>
1987
1988         * reflection.c (add_custom_modifiers): New helper function to merge custom
1989         modifiers stored in objects to a MonoType.
1990         (fieldref_encode_signature): Encode custom modifiers.
1991         (mono_image_get_generic_field_token): Call add_custom_modifiers ().
1992         (fieldbuilder_to_mono_class_field): Ditto. Fixes #424663.
1993
1994 2008-09-19  Kornél Pál  <kornelpal@gmail.com>
1995
1996         * coree.c (_CorValidateImage): Some 64-bit IL only images have entry point
1997         calling _CorDllMain imported from mscoree.dll. Set entry point RVA to 0 for
1998         64-bit IL only images because imports are not resolved for IL only images.
1999         Special thanks to Bill Holmes for finding this bug and testing the patch.
2000         Also fail for 64-bit images marked as CLI_FLAGS_32BITREQUIRED.
2001
2002         Contributed under MIT/X11 license.
2003
2004 2008-09-19  Miguel de Icaza  <miguel@novell.com>
2005
2006         * mono-config.c (dllmap_start): Add support for the bits keyword
2007         on dllentry and dllmap to easily detect 32 vs 64 bit systems.
2008
2009 2008-09-19  Mark Probst  <mark.probst@gmail.com>
2010
2011         * reflection.c (inflate_mono_method): When the class the method is
2012         to be inflated for is itself not inflated, just return the method.
2013
2014 Fri Sep 19 11:51:36 CEST 2008 Paolo Molaro <lupus@ximian.com>
2015
2016         * mono-perfcounters.c: use more user friendly process instance names.
2017
2018 2008-09-18  Bill Holmes  <billholmes54@gmail.com>
2019
2020         * marshal.c (emit_marshal_variant) : Change the attribute checks to 
2021           handle "[in] ref" and "[in][out] ref" cases.
2022
2023         * marshal.c (cominterop_get_ccw) : The wrong signature was being passed
2024           to mono_mb_create_method.  This was causing problems calling native to
2025           managed passing Variants by value.
2026
2027         Code is contributed under MIT/X11 license.
2028
2029 2008-09-18  Zoltan Varga  <vargaz@gmail.com>
2030
2031         * class.c (can_access_internals): Call mono_assembly_load_friends ()
2032         before accessing the friend_assembly_names field.
2033
2034         * assembly.c (mono_assembly_load_friends): Make this callable multiple
2035         times.
2036         (mono_assembly_load_from_full): Avoid calling load_friends (), it is
2037         called lazily when it is needed.
2038
2039         * metadata-internals.h (struct _MonoAssembly): Add 
2040         'friend_assembly_names_inited' flag.
2041
2042 Thu Sep 18 18:18:47 CEST 2008 Paolo Molaro <lupus@ximian.com>
2043
2044         * mono-perfcounters-def.h: fix the types of a few counters.
2045         * mono-perfcounters.c: implemented the instance names getter
2046         and a few bugfixes.
2047
2048 2008-09-18  Atsushi Enomoot  <atsushi@ximian.com>
2049
2050         * culture-info-table.h : regenerated.
2051
2052 2008-09-17  Robert Jordan  <robertj@gmx.net>
2053
2054         * marshal.c (mono_marshal_get_ldflda_wrapper): Add support for
2055         context bound objects. Fixes #415577.
2056
2057         Code is contributed under MIT/X11 license.
2058
2059 Tue Sep 16 21:03:58 CEST 2008 Paolo Molaro <lupus@ximian.com>
2060
2061         * icall-def.h, threads-types.h, threads.c: fixed SpinWait()
2062         implementation (bug #423582).
2063
2064 2008-09-16  Zoltan Varga  <vargaz@gmail.com>
2065
2066         * object.c (mono_object_get_virtual_method): Handle the case method->slot
2067         is not set. Fixes #426309.
2068
2069 2008-09-16  Jb Evain  <jbevain@novell.com>
2070
2071         * class.c (mono_class_from_name): fix the exported type look up
2072         when the type is defined in a referenced assembly.
2073
2074 2008-09-16  Jb Evain  <jbevain@novell.com>
2075
2076         * reflection.c (mono_image_fill_export_table_from_type_forwarders):
2077         increment the next index counter on each iteration to make that work
2078         for more than one type forwarder. Unmanaged part to fix #422929.
2079
2080 2008-09-15  Mark Probst  <mark.probst@gmail.com>
2081
2082         * object-internals.h: enum ComInterfaceType in
2083         MonoInterfaceTypeAttribute is guint32, not guint16.
2084
2085 2008-09-12  Mark Probst  <mark.probst@gmail.com>
2086
2087         * cil-coff.h, image.c, reflection.c: Endianness fixes in image
2088         writing code.
2089
2090 2008-09-11  Mark Probst  <mark.probst@gmail.com>
2091
2092         * icall.c: Boolean arguments to a runtime invoke are MonoBoolean,
2093         not gboolean.
2094
2095 2008-09-11  Mark Probst  <mark.probst@gmail.com>
2096
2097         * debug-mono-symfile.c (mono_debug_symfile_lookup_location):
2098         Endianness fixes for MonoSymbolFileOffsetTable.
2099
2100 2008-09-10  Bill Holmes  <billholmes54@gmail.com>
2101
2102         * process.c (complete_path) : Removing quotes from the 
2103           input path.  The glib file routines do not handle file paths
2104           that have quotes around them.
2105
2106         Code is contributed under MIT/X11 license.
2107
2108 2008-09-10  Bill Holmes  <billholmes54@gmail.com>
2109
2110         * socket-io.h : Adding a comment to provide locations where 
2111           changes to MonoSocketAsyncResult need to be synced.
2112
2113         Code is contributed under MIT/X11 license.
2114
2115 2008-09-10  Zoltan Varga  <vargaz@gmail.com>
2116
2117         * marshal.c (emit_marshal_custom): Call NativeToManaged for non-out 
2118         parameters as well. Fixes #425001.
2119
2120 2008-09-08  Miguel de Icaza  <miguel@novell.com>
2121
2122         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup): Fix
2123         windows build.
2124
2125 2008-09-07  Miguel de Icaza  <miguel@novell.com>
2126
2127         * console-io.c: Add support for tracking the window size if it
2128         changes.
2129
2130         The setup is very simple: the TtySetup function will now return a
2131         pointer to a location in memory that tracks the current console
2132         size.  The managed code checks its current value every time its
2133         queried against the last value set, and updates accordingly.
2134
2135         With this setup we can work with multiple consoles, and we do not
2136         require to poke into managed code from a signal handler.
2137
2138         Additionally, the environment for COLUMNS and LINES is now handled
2139         in unmanaged code.
2140
2141         (ves_icall_System_ConsoleDriver_GetTtySize): This is now gone.
2142
2143 2008-09-07  Mark Probst  <mark.probst@gmail.com>
2144
2145         * marshal.c (mono_type_native_stack_size): Treat
2146         MONO_TYPE_TYPEDBYREF like MONO_TYPE_VALUETYPE.
2147
2148 2008-09-04  Jb Evain  <jbevain@novell.com>
2149
2150         * class.c (mono_class_is_assignable_from): fix assignability of nullables
2151         to nullables.
2152
2153 2008-09-03 Rodrigo Kumpera  <rkumpera@novell.com>
2154
2155         * verify.c (verify_type_compatibility_full): Revert change
2156         to allow converting a native int to unmanaged pointer be verifiable
2157         under non-strict mode.
2158         It turns out that "(IntPtr)null" is indeed unverifiable, go figure.
2159
2160         * verify.c: Added some TODOs.
2161
2162 2008-09-02  Bill Holmes  <billholmes54@gmail.com>
2163
2164         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi,
2165           ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni) :
2166           Changed to use GlobalAlloc for the memory returned on Windows platforms.
2167
2168         Code is contributed under MIT/X11 license.
2169
2170 2008-09-02  Jb Evain  <jbevain@novell.com>
2171
2172         * object.c (mono_ldstr_metdata_sig): renamed to mono_ldstr_metadata_sig.
2173
2174 2008-09-02 Rodrigo Kumpera  <rkumpera@novell.com>
2175
2176         reflection.c (typebuilder_setup_fields): Handle classes with
2177         explicit size.
2178
2179 2008-09-01 Rodrigo Kumpera  <rkumpera@novell.com>
2180
2181         class.c (mono_class_setup_events): Add memory barrier due to
2182         double checked locking.
2183         
2184         class.c (mono_class_setup_properties): Same.
2185
2186 2008-08-31  Zoltan Varga  <vargaz@gmail.com>
2187
2188         * class.c (mono_class_is_assignable_from): Fix the build.
2189         
2190         * class.c (mono_class_is_assignable_from): Call mono_class_setup_vtable ()
2191         before accessing klass->interface_bitmap. Fixes #421744.
2192
2193 2008-08-28  Zoltan Varga  <vargaz@gmail.com>
2194
2195         * appdomain.c (mono_runtime_set_no_exec): New internal function setting
2196         the runtime into no-exec mode, useful when running the AOT compiler.
2197
2198         * appdomain.c gc.c object.c: Avoid executing managed code when running
2199         in no-exec mode.
2200         
2201         * rawbuffer.c (mono_raw_buffer_load_mmap): Disable this on the iphone.
2202
2203         * reflection.c (_mono_reflection_get_type_from_info): Handle the 
2204         special case when the mono_assembly_loaded () returns NULL because the 
2205         search hook is not installed.
2206
2207 2008-08-25  Zoltan Varga  <vargaz@gmail.com>
2208
2209         * marshal.c: Applied patch from tom hindle (tom_hindle@sil.org) to fix
2210         crashes in bstr marshalling on linux.
2211
2212 2008-08-24  Zoltan Varga  <vargaz@gmail.com>
2213
2214         * debug-helpers.c (mono_type_get_desc): Fix printing of generic instances
2215         with more than one parameter.
2216
2217 2008-08-24  Miguel de Icaza  <miguel@novell.com>
2218
2219         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup): Disable
2220         start/stop flow control as well when turning off ICANON (allows
2221         C-s and C-q to be read by Console.ReadKey).
2222
2223 2008-08-24  Zoltan Varga  <vargaz@gmail.com>
2224
2225         * class.c (mono_class_init): Move the initialization of nested classes
2226         into mono_class_get_nested_types (). Fixes #418433.
2227
2228         * class-internals.h (struct _MonoClass): Add a new 'nested_classes_inited'
2229         flag.
2230
2231         * class.c reflection.c icall.c: Use mono_class_get_nested_types () for 
2232         iterating tough the nested classes of a class.
2233
2234 2008-08-23  Zoltan Varga  <vargaz@gmail.com>
2235
2236         * class.c (mono_class_generic_sharing_enabled): Enable generic sharing
2237         on arm.
2238
2239 2008-08-22  Miguel de Icaza  <miguel@novell.com>
2240
2241         * console-io.c (sigcont_handler): Support signal chaining for
2242         SIGCONT.
2243
2244         (console_set_signal_handlers): Use best practices with sigaction,
2245         clear the structure before using it. 
2246
2247 2008-08-22  Robert Jordan  <robertj@gmx.net>
2248
2249         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup):
2250         Fix the Windows build.
2251
2252 2008-08-22  Zoltan Varga  <vargaz@gmail.com>
2253
2254         * class.c (mono_class_generic_sharing_enabled): Make the default
2255         sharing mode 'corlib'.
2256
2257 2008-08-21  Zoltan Varga  <vargaz@gmail.com>
2258
2259         * console-io.c (console_set_signal_handlers): Fix a warning.
2260
2261         * marshal.c (mono_marshal_get_synchronized_wrapper): Call the wrapper
2262         method normally, the JIT will take care of avoiding recursion.
2263
2264 2008-08-20  Bill Holmes  <billholmes54@gmail.com>
2265
2266         * console-io.c : Fixing builds for platforms that do not have <termios.h>.
2267
2268         Code is contributed under MIT/X11 license.
2269
2270 2008-08-20  Miguel de Icaza  <miguel@novell.com>
2271
2272         * console-io.c (sigcont_handler): We need to restore the entire
2273         termios state, not only the original settings, as things like echo
2274         can be controlled after this (Booish exposes this issue with its
2275         own ReadLine implementation).
2276
2277         Additionally, we need to set the terminal back into keypad_xmit
2278         mode.
2279         
2280         (ves_icall_System_ConsoleDriver_TtySetup): Take the keypad xmit
2281         string as a paramter as well.   Otherwise we get different
2282         keyboard sequences.
2283
2284 2008-08-20  Zoltan Varga  <vargaz@gmail.com>
2285
2286         * marshal.c (emit_marshal_object): Avoid managed-to-native marshalling of
2287         delegates with byref out parameter passing. Fixes #351520.
2288
2289         * debug-helpers.c (mono_context_get_desc): New helper function to stringify
2290         a generic context.
2291         (mono_type_get_desc): Add the type arguments for GENERICINST.
2292         (mono_method_full_name): Stringify the class name using mono_type_full_name
2293         so it picks up generic arguments.
2294
2295 2008-08-19  Gert Driesen  <drieseng@users.sourceforge.net>
2296
2297         * console-io.c: Removed debug output.
2298
2299 2008-08-19 Rodrigo Kumpera  <rkumpera@novell.com>
2300
2301         reflection.c (mono_reflection_create_runtime_class): Alloc
2302         the nested classes linked list using the dynamic image mempool.
2303         Fixes leak in corlib compilation.
2304
2305 2008-08-19  Miguel de Icaza  <miguel@novell.com>
2306
2307         * console-io.c: Fix incredibly annoying behavior on the console
2308         after resuming execution after control-z.   This affected every
2309         console application.
2310
2311 2008-08-18 Rodrigo Kumpera  <rkumpera@novell.com>
2312
2313         * mempool-internals.h: Header for mono private mempool functions. The first
2314         two function are for allocating glib linked lists using pools.
2315
2316         * mempool.c: Added g_list_prepend_mempool and g_slist_prepend_mempool.
2317
2318         * Makefile.am: Added mempool-internals.h.
2319
2320 2008-08-16  Zoltan Varga  <vargaz@gmail.com>
2321
2322         * domain.c (mono_domain_create): Call the JIT domain hook if installed.
2323         (mono_domain_free): Ditto.
2324
2325         * domain-internals.h (struct _MonoDomain): Add 'runtime_info' field, this could
2326         be used by the JIT to store its domain-specific information, instead of putting
2327         it directly into MonoDomain.
2328
2329         * domain.c (mono_install_create_domain_hook): New helper function to install
2330         a hook which initializes domain->runtime_info.
2331
2332         * domain.c (mono_install_free_domain_hook): Ditto.
2333         
2334 2008-08-15  Zoltan Varga  <vargaz@gmail.com>
2335
2336         * marshal.c (mono_delegate_end_invoke): Raise an exception instead of
2337         asserting if the ares parameter is null.
2338
2339         * mono-perfcounters.c: Fix warnings.
2340
2341         * marshal.c (mono_marshal_get_delegate_begin_invoke): Don't set save_lmf, it
2342         is not needed, don't check for interruptions either.
2343         (mono_marshal_get_delegate_end_invoke): Ditto.
2344
2345 2008-08-15  Marek Habersack  <mhabersack@novell.com>
2346
2347         * mono-perfcounters.c (predef_readonly_counter): added support for
2348         reading the ASP.NET Requests Queued counter from another process.
2349
2350 2008-08-12  Zoltan Varga  <vargaz@gmail.com>
2351
2352         * metadata-internals.h: Move the 'aot_module' field from MonoAssembly to
2353         MonoImage to simplify the AOT code.
2354
2355 2008-08-10  Zoltan Varga  <vargaz@gmail.com>
2356
2357         * marshal.c (emit_marshal_object): Implement native-to-managed StringBuilder
2358         marshalling. Fixes #416078.
2359
2360 2008-08-08  Zoltan Varga  <vargaz@gmail.com>
2361         
2362         * marshal.c (mono_marshal_get_native_wrapper): Add an 'aot' argument, when
2363         it is set, looking up the icall address is deferred to the JIT, since 
2364         in embedded scenarios, the icall might not be registered in the runtime
2365         doing the AOT compilation. Backported from the 2.0 branch.
2366
2367 2008-08-08  Zoltan Varga  <vargaz@gmail.com>
2368
2369         * marshal.c (mono_remoting_wrapper): Handle nullable types correctly.
2370         Fixes #415621.
2371
2372 2008-08-05  Marek Habersack  <mhabersack@novell.com>
2373
2374         * Makefile.am: added support for cross-compilation.
2375
2376 2008-08-04  Zoltan Varga  <vargaz@gmail.com>
2377
2378         * socket-io.c (get_socket_assembly): Make 'moonlight' variable static.
2379
2380 Fri Aug 1 18:47:48 CEST 2008 Paolo Molaro <lupus@ximian.com>
2381
2382         * mono-perfcounters.c: jitted methods and jitted bytes counters.
2383
2384 Fri Aug 1 16:07:09 CEST 2008 Paolo Molaro <lupus@ximian.com>
2385
2386         * class-internals.h, icall-def.h, mono-perfcounters-def.h,
2387         mono-perfcounters.c: performance counters implementation.
2388
2389 2008-07-31  Zoltan Varga  <vargaz@gmail.com>
2390
2391         * metadata-internals.h (struct _MonoAssembly): Change the type of 'aot_module'
2392         to gpointer, letting the AOT code decide what to store in it.
2393
2394 2008-07-31  Bill Holmes  <billholmes54@gmail.com>
2395
2396         * marshal.c (cominterop_get_native_wrapper) : Adding a call to 
2397           mono_class_setup_methods if the methods are not initialized.
2398
2399         Code is contributed under MIT/X11 license.
2400
2401 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
2402
2403         * verify.c: Remove some debug code I commited by accident.
2404
2405         * verify.c (mono_method_is_valid_in_context): Change the return value
2406         to make possible to distinguish between invalid and unverifiable.
2407
2408         * verify.c (verifier_load_method): Don't return NULL for unverifiable
2409         methods.
2410
2411 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
2412
2413         * verify.c (mono_generic_param_is_constraint_compatible): Inflate type
2414         constraints. Fixes regression in gtest-253.
2415
2416 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
2417
2418         * verify.c (mono_verifier_verify_class): Don't allow generic types
2419         with explicit layout.
2420
2421         * verify.c (mono_method_verify): Check locals and argument types.
2422
2423 2008-07-29  Zoltan Varga  <vargaz@gmail.com>
2424
2425         * monitor.c (mono_monitor_try_enter_internal): Allow nterruption of the
2426         wait if the thread is in StopRequested state.
2427
2428         * class.c (mono_class_from_name): Refactor the module searching code into
2429         a separate function so it can be reused in the AOT case too.
2430
2431 2008-07-28 Rodrigo Kumpera  <rkumpera@novell.com>
2432
2433         * verify.c (mono_type_is_valid_in_context): Improve the error message.
2434         Check both the type and it's generic type definition for loader errors.
2435         
2436         * verify.c (mono_method_is_valid_in_context): Don't generate another
2437         error when a type errors occur, this leads to the wrong exception been
2438         thrown.
2439
2440 2008-07-28  Dick Porter  <dick@ximian.com>
2441
2442         * icall-def.h
2443         * process.c
2444         (ves_icall_System_Diagnostics_Process_ProcessHandle_duplicate):
2445         New internal calls to duplicate and close a process handle.
2446
2447 2008-07-27  Andreas Färber  <andreas.faerber@web.de>
2448
2449         * object.c (CHECK_ADD_OVERFLOW_UN): Add missing bracket. Fixes #412499.
2450
2451 2008-07-27  Zoltan Varga  <vargaz@gmail.com>
2452
2453         * appdomain.c (unload_thread_main): Attach the unload thread to the runtime.
2454
2455 2008-07-27  Robert Jordan  <robertj@gmx.net>
2456
2457         * class.c (mono_class_init): Don't compute class.has_finalize for
2458         valuetypes. Fixes #412477.
2459
2460 2008-07-25 Rodrigo Kumpera  <rkumpera@novell.com>
2461
2462         * verify.c: Implement constraint equivalence checking.
2463         This is required when a generic parameter is used as
2464         argument to a constrained one.
2465
2466         Fixes #410637.
2467
2468 2008-07-24  Zoltan Varga  <vargaz@gmail.com>
2469
2470         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
2471
2472         * domain-internals.h (struct _MonoDomain): Add 'method_code_hash' field.
2473
2474         * object-internals.h (struct _MonoDelegate): Add 'method_code' field,
2475         synch with managed object layout.
2476
2477 2008-07-24 Rodrigo Kumpera  <rkumpera@novell.com>
2478
2479         * verify.c (do_branch_op): Handle valuetypes and generic
2480         arguments properly.
2481
2482         * verify.c (do_cmp_op): Same.
2483
2484         Fixes #410383.
2485
2486 2008-07-24  Mark Probst  <mark.probst@gmail.com>
2487
2488         * generic-sharing.c: Fix memory leaks.
2489
2490         * class.c, class-internals.h: Make
2491         mono_class_inflate_generic_type_with_mempool() non-static.
2492
2493 2008-07-24 Rodrigo Kumpera  <rkumpera@novell.com>
2494
2495         * pedump.c (dump_verify_info): Dump full class name.
2496
2497 2008-07-24  Mark Probst  <mark.probst@gmail.com>
2498
2499         * generic-sharing.c: Removed some old code that didn't do anything.
2500
2501 2008-07-24  Massimiliano Mantione  <massi@ximian.com>
2502         * profiler.c: Added runtime_initialized_event,
2503         mono_profiler_install_runtime_initialized and
2504         mono_profiler_runtime_initialized. This new hook tells the profiler
2505         when the runtime is sufficiently initialized to be able to call
2506         mono_thread_attach on the root appdomain.
2507         * profiler.h, profiler-private.h: Likewise.
2508
2509 2008-07-23 Rodrigo Kumpera  <rkumpera@novell.com>
2510
2511         * verify.c (do_cast): Do boxing for generic arguments as well.
2512
2513         * class.c (is_nesting_type): Drop generic instantiations before
2514         checking for nesting.
2515
2516         * class.c (can_access_instantiation): Allow access to generic
2517         arguments.
2518
2519 2008-07-23 Rodrigo Kumpera  <rkumpera@novell.com>
2520
2521         * verify.c (verify_class_for_overlapping_reference_fields):
2522         On some cases, the field size might be zero, guard against that.
2523         Fix the explicit layout check to work as expected.
2524
2525 2008-07-23  Zoltan Varga  <vargaz@gmail.com>
2526
2527         * threads.c (ves_icall_System_Threading_Thread_Abort): Avoid calling 
2528         mono_thread_resume () during shutdown, since the thread we want to abort
2529         might be suspended.
2530
2531 2008-07-22  Zoltan Varga  <vargaz@gmail.com>
2532
2533         * mono-debug-debugger.c (mono_debugger_check_breakpoints): Fix a 
2534         warning.
2535
2536         * debug-mono-symfile.c: Fix a warning.
2537
2538         * mono-perfcounters.c (get_cpu_times): Fix a warning.
2539
2540         * object.c (mono_class_vtable): Check if exception_type is set, and return
2541         NULL as defined by the function comments.
2542
2543 2008-07-22  Mark Probst  <mark.probst@gmail.com>
2544
2545         * mempool.c: Use malloc for every single mempool allocation if the
2546         configure option is set.  This makes it easier to track mempool
2547         allocations with tools like Valgrind.
2548
2549 2008-07-22  Jb Evain  <jbevain@novell.com>
2550
2551         * reflection.c (create_dynamic_mono_image): emit the same
2552         metadata version that SL2 does when creating a SL2 image.
2553
2554 2008-07-21 Rodrigo Kumpera  <rkumpera@novell.com>
2555
2556         * icall-def.h:
2557         * icall.c: New icall System.Enum:get_hashcode. This function
2558         avoids the overhead of boxing the enum to the underlying type.
2559
2560 2008-07-21  Mark Probst  <mark.probst@gmail.com>
2561
2562         * reflection.c (mono_method_get_object): Don't let static RGCTX
2563         invoke wrappers get into MonoReflectionMethods.
2564
2565 2008-07-17 Rodrigo Kumpera  <rkumpera@novell.com>
2566
2567         * object-internals.h:
2568         * object.c: New mono_runtime_class_init_full function
2569         that makes throwing the exception optinal.
2570
2571         * class-internals.h: New exception type MONO_EXCEPTION_OBJECT_SUPPLIED
2572         for the case where the exception object is supplied.
2573
2574 2008-07-16  Kornél Pál  <kornelpal@gmail.com>
2575
2576         * coree.h: Define __ImageBase as _image_base__ on cygwin that fixes build with
2577         old ld versions.
2578
2579         Contributed under MIT/X11 license.
2580
2581 2008-07-16 Rodrigo Kumpera  <rkumpera@novell.com>
2582
2583         * string-icalls.c (ves_icall_System_String_InternalSplit):
2584         Optimize array allocation by caching the MonoClass of the
2585         array type.
2586
2587         * icall.c (ves_icall_Type_GetMethodsByName): Same.
2588
2589         * reflection.c (mono_param_get_objects): Same.
2590
2591 2008-07-16 Rodrigo Kumpera  <rkumpera@novell.com>
2592
2593         * icall-def.h:
2594         * icall.c: New ves_icall_MonoGenericClass_InflateType icall.
2595         It inflates the given type using the class context.
2596
2597 2008-07-15 Rodrigo Kumpera  <rkumpera@novell.com>
2598
2599         * object.c (mono_class_try_get_vtable): New function. Tries to fetch
2600         the vtable if it already exists.
2601
2602         * object-internals.h: Add mono_class_try_get_vtable as part of the
2603         internal API.
2604
2605         * reflection.c (mono_type_get_object): Use the MonoObject from the
2606         vtable when possible. Reduces locking contention on reflection heavy
2607         code.
2608
2609 2008-07-15  Zoltan Varga  <vargaz@gmail.com>
2610
2611         * decimal.c (my_g_bit_nth_msf): Implement this directly without calling
2612         g_bit_nth_msf () since that macro is not implemented in eglib.
2613
2614 2008-07-13  Zoltan Varga  <vargaz@gmail.com>
2615
2616         * class.c (mono_class_generic_sharing_enabled): Always disable generic sharing
2617         on platforms which do not support it.
2618
2619 2008-07-12  Zoltan Varga  <vargaz@gmail.com>
2620
2621         * marshal.c (mono_signature_to_name): Encode sig->hasthis as well.
2622
2623 2008-07-11  Martin Baulig  <martin@ximian.com>
2624
2625         * mono-debug-debugger.h
2626         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_INTERRUPTION_REQUEST'.
2627
2628         * mono-debug-debugger.c
2629         (_mono_debugger_interruption_request): New global volatile variable.
2630         (mono_debugger_check_interruption): New public function.
2631
2632         * threads.c
2633         (mono_thread_current_check_pending_interrupt): Call
2634         mono_debugger_check_interruption().
2635         (mono_thread_interruption_checkpoint_request): Likewise.
2636
2637 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
2638
2639         * verify.c: Add more type checks for loaded types. Verify the result
2640         handle from ldtoken.
2641
2642 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
2643
2644         * loader.c (field_from_memberref): Don't crash if the field
2645         wasn't found.
2646
2647 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
2648
2649         * verify.c: Verify if type and method instantiations
2650         don't have invalid VAR or MVAR arguments.
2651
2652 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
2653
2654         * verify.c: Fix double free of function pointer list.
2655
2656 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
2657
2658         * object.c (mono_string_to_utf8): Comment the new code as it
2659         breaks under eglib.
2660
2661 2008-07-08 Rodrigo Kumpera  <rkumpera@novell.com>
2662
2663         * object.c (mono_string_to_utf8): Avoid allocating a temp array.
2664
2665 2008-07-07  Bill Holmes  <billholmes54@gmail.com>
2666
2667         * threads.c : Thread.Interrupt changes to ensure that ThreadInterruptedException
2668           is not throw too many times.
2669
2670         Code is contributed under MIT/X11 license.
2671
2672 2008-07-07  Zoltan Varga  <vargaz@gmail.com>
2673
2674         * mono-debug.c (mono_debug_find_method): Allow this to be called even when
2675         debugging is turned off.
2676
2677 2008-07-06  Zoltan Varga  <vargaz@gmail.com>
2678
2679         * generic-sharing.c (mono_method_lookup_rgctx): Fix a warning.
2680
2681 2008-07-04  Mark Probst  <mark.probst@gmail.com>
2682
2683         * class-internals.h, class.c: Added new generic sharing option:
2684         Share only stuff in System.Collections.Generic, which is now the
2685         default.
2686
2687 2008-07-04  Mark Probst  <mark.probst@gmail.com>
2688
2689         * generic-sharing.c, class-internals.h: New function for getting a
2690         generic method in a generic class given the corresponding method
2691         for a different instantiation of the class.  Partly refactored
2692         from mini-trampolines.c.
2693
2694         * class.c: Make sure generic methods have a class_inst if they are
2695         part of a generic class.
2696
2697         * metadata.c (mono_type_stack_size_internal): Handle type
2698         variables.
2699
2700 2008-07-04  Mark Probst  <mark.probst@gmail.com>
2701
2702         * domain-internals.h: New field (has_this) in MonoGenericJitInfo.
2703         Signifies whether information on the this/vtable/mrgctx variable
2704         is available.
2705
2706 2008-07-04  Mark Probst  <mark.probst@gmail.com>
2707
2708         * object.c, object-internals.h, icall.c: New function
2709         mono_delegate_ctor_with_method(), which does the same as
2710         mono_delegate_ctor(), but takes an explicit method argument
2711         instead of taking the method from the jit info.
2712
2713         * marshal.c: When creating a delegate with an inflated method take
2714         the "this" argument as the target class for the castclass.
2715
2716 2008-07-03  Mark Probst  <mark.probst@gmail.com>
2717
2718         * domain.c (mono_jit_info_table_find): Fixed a bug that caused
2719         mono_jit_info_table_find() to perform very badly in some cases.
2720
2721 2008-07-02  Zoltan Varga  <vargaz@gmail.com>
2722
2723         * icall.c (type_from_typename): Handle 'string'.
2724
2725         * marshal.c (mono_marshal_get_runtime_invoke): Don't insert runtime invoke
2726         wrappers into the wrapper_hash, since the key is not a MonoMethod.
2727
2728 2008-07-01  Zoltan Varga  <vargaz@gmail.com>
2729
2730         * icall.c (mono_get_jit_icall_info): New function to return the jit icall hash table.
2731
2732         * *-gc.c (mono_gc_get_managed_allocator_types): New function to return the
2733         number of available managed allocator types.
2734
2735         * marshal.c (mono_marshal_init): Register Thread:ResetAbort as an icall ().
2736         (mono_marshal_get_runtime_invoke): Call ResetAbort as an icall.
2737
2738 2008-06-30  Zoltan Varga  <vargaz@gmail.com>
2739
2740         * domain-internals.h (struct _MonoDomain): Add 'jit_code_hash_lock' field,
2741         which is a low level lock protecting just the 'jit_code_hash' hash table.
2742
2743         * domain.c: Initialize+cleanup jit_code_hash_lock.
2744         
2745 2008-06-30  Kornél Pál  <kornelpal@gmail.com>
2746
2747         * coree.c (mono_load_coree): Set coree_module_handle global variable only
2748         after initialization.
2749
2750         * coree.h: Make MonoFixupExe internal.
2751
2752         Contributed under MIT/X11 license.
2753
2754 2008-06-30  Kornél Pál  <kornelpal@gmail.com>
2755
2756         * coree.c (_CorValidateImage): Retain IMAGE_DIRECTORY_ENTRY_SECURITY
2757         because that is platform independent. Check NumberOfRvaAndSizes in PE32
2758         as well.
2759         (MonoLoadImage): New wrapper function around LoadLibrary to ensure that the
2760         image being loaded is a CLI image and _CorValidateImage gets called.
2761
2762         * coree.h: Add MonoLoadImage.
2763
2764         * image.c (mono_image_open_full): Load CLI images using MonoLoadImage
2765         instead of LoadLibrary.
2766
2767         Contributed under MIT/X11 license.
2768
2769 2008-06-29 Rodrigo Kumpera  <rkumpera@novell.com>
2770
2771         * icall.c (ves_icall_System_ValueType_Equals): Avoid allocating objects
2772         for any primitive type.
2773
2774 2008-06-29  Zoltan Varga  <vargaz@gmail.com>
2775
2776         * object.c (mono_array_new_specific): Optimize this and the other allocation
2777         functions a bit.
2778         
2779         * object.c (mono_class_create_runtime_vtable): Use typed allocation in other
2780         domains too if mono_dont_free_domains is set.
2781
2782         * domain-internals.h (mono_dont_free_domains): New internal option controlling
2783         whenever to free appdomain data after it has been unloaded.
2784
2785         * domain.c (mono_domain_free): Don't free appdomain data if the option is set.
2786         
2787 2008-06-28  Zoltan Varga  <vargaz@gmail.com>
2788
2789         * icall.c (ves_icall_System_Enum_get_underlying_type): New icall.
2790         (mono_method_get_equivalent_method): Fix a warning.
2791
2792         * object.c (mono_message_init): Avoid looking up array types for each call.
2793
2794 2008-06-27  Zoltan Varga  <vargaz@gmail.com>
2795
2796         * object.c (mono_message_invoke): Avoid looking up the object[] type for each
2797         call.
2798
2799         * icall.c (ves_icall_System_ValueType_Equals): Optimize the comparison of enums
2800         even more.
2801
2802         * class.c (mono_class_get_fields): Avoid calling setup_fields_locking () for
2803         each iteration.
2804
2805         * icall.c (ves_icall_System_ValueType_Equals): Avoid traversing all the static
2806         fields of an enum.
2807
2808 2008-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
2809
2810         * object.c (mono_value_box): Fix boxing of nullables.
2811
2812 2008-06-26  Kornél Pál  <kornelpal@gmail.com>
2813
2814         * assembly.c (mono_set_rootdir): Use __ImageBase instead of
2815         mono_module_handle that is defined by the linker; no initialization required.
2816         * coree.h: Remove mono_module_handle, add __ImageBase, update
2817         mono_image_open_from_module_handle.
2818         * coree.c (_CorValidateImage): Convert platform independent PE32 images to
2819         PE32+ on 64-bit Windows that makes the OS able to load CIL images as modules.
2820         (MonoFixupCorEE): Export Address Table RVAs are 32-bit unsigned integers so
2821         memory has to be allocated for trampolines (x64) or procedure labels (IA64) up
2822         to 4 GB away from image base address. IA64 version is not tested but was very
2823         easy to implement and should work if we ever need it.
2824         * domain.c (mono_init_internal): Avoid system error message boxes.
2825         * image.c (mono_image_open_from_module_handle): Replace ref_count argument
2826         with has_entry_point. Handle do_mono_image_load fauilre correctly.
2827         (mono_image_open_full, mono_image_close): Use has_entry_point instead of
2828         coff_attributes that is a more reliable way to detect if _CorDllMain was called.
2829         * metadata-internals.h: Add has_entry_point to _MonoImage on Windows.
2830
2831         Contributed under MIT/X11 license.
2832
2833 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
2834
2835         * class.c, class-internals.h: Export mono_class_get_generic_type_definition
2836         as part of the private mono API.
2837         
2838         * loader.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandleInternalType):
2839         Do proper argument checking for methods that belong to generic classes.
2840         Do proper type resolution for GMFH/2.
2841         Fixes #377324.
2842         
2843 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
2844
2845         * verify.c (do_switch): Fix a memory corruption bug with
2846         the jump index is out of bound.
2847
2848 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
2849
2850         * verify.c: Disable debug code.
2851
2852 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
2853
2854         * reflection.c (mono_image_get_methodbuilder_token): Use
2855         mono_image_get_methodspec_token_for_generic_method_definition
2856         instead of mono_image_get_memberref_token. We cache more memberef
2857         entries now.
2858
2859 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
2860
2861         * verify.c: Inflate exception clause types.
2862         Fixes #402606.
2863         
2864 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
2865
2866         * reflection.c (mono_image_get_methodbuilder_token): Don't leak
2867         name.
2868
2869         * reflection.c (mono_image_get_ctorbuilder_token): Same.
2870
2871         * reflection.c (mono_image_create_method_token): Same.
2872
2873 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
2874
2875         * reflection.c: Added mono_image_get_methodref_token_for_methodbuilder.
2876         It does the same as mono_image_get_methodref_token but works on
2877         MethodBuilder.
2878
2879         * reflection.c: Use mono_image_get_methodspec_token_for_generic_method_definition
2880         and always generate a methodspec. This follows the old behavior and fixes
2881         the regressions in System.Core. 
2882
2883 2008-06-24  Zoltan Varga  <vargaz@gmail.com>
2884
2885         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Collect exceptions for classes where 
2886         don't event mono_class_get () succeeds. Fixes #402182.
2887
2888 2008-06-20 Rodrigo Kumpera  <rkumpera@novell.com>
2889
2890         * metadata-internals.h: Added MonoDynamicImage::methodspec
2891         hashtable to store methodspec tokens created for MethodBuilders.
2892
2893         * reflection.c (mono_image_get_methodbuilder_token): Encode generic
2894         MethodBuilders as open instantiations if a methodspec was requested.
2895
2896         * reflection.c (fixup_method): Skip MethodBuilder with methodspec tokens.
2897
2898         * reflection.c (create_dynamic_mono_image): Create the methodspec hashtable.
2899
2900         * reflection.c (mono_dynamic_image_free): Release the methodspec hashtable.
2901
2902         Fixes bug #349190.
2903
2904 2008-06-20 Rodrigo Kumpera  <rkumpera@novell.com>
2905
2906         * loader.c (method_from_methodspec): Avoid crashing if the
2907         method lookup fails.
2908
2909 2008-06-20  Dick Porter  <dick@ximian.com>
2910
2911         * socket-io.c (get_socket_assembly): Cope with Moonlight network
2912         classes being in a different assembly.  Fixes bug 399184.
2913
2914 2008-06-20  Zoltan Varga  <vargaz@gmail.com>
2915
2916         * loader.c (mono_loader_init): Make this callable multiple times.
2917         (mono_dllmap_insert): Call mono_loader_init () so this works even before
2918         the runtime is initialized. Fixes #401755.
2919
2920 2008-06-19  Dick Porter  <dick@ximian.com>
2921
2922         * socket-io.c (convert_socketflags): Ignore SocketFlags.Partial.
2923         Fixes bug 349688.
2924
2925 2008-06-19  Dick Porter  <dick@ximian.com>
2926
2927         * socket-io.c:
2928         * icall-def.h: Implement Socket generic Send() and Receive()
2929         methods.  Fixes bug 395168.
2930
2931 2008-06-19  Kornél Pál  <kornelpal@gmail.com>
2932
2933         * icall-def.h, icall.c: Add ves_icall_System_Reflection_Module_GetHINSTANCE.
2934
2935         Contributed under MIT/X11 license.
2936
2937 2008-06-18  Martin Baulig  <martin@ximian.com>
2938
2939         * mono-debug.h (MONO_DEBUGGER_VERSION): Split into
2940         `MONO_DEBUGGER_MAJOR_VERSION' and `MONO_DEBUGGER_MINOR_VERSION';
2941         set to 80.0.  The debugger <-> runtime interface is now frozen as
2942         well.   
2943
2944         * mono-debug.c
2945         (mono_debug_debugger_version): Bump to 4.
2946
2947 2008-06-18  Martin Baulig  <martin@ximian.com>
2948
2949         * debug-mono-symfile.c
2950         (load_symfile): Don't check the minor version.
2951
2952         * debug-mono-symfile.h: Bump the version number to 50.0.
2953
2954 2008-06-18  Martin Baulig  <martin@ximian.com>
2955
2956         * debug-mono-symfile.c
2957         (load_symfile): Treat `MONO_SYMBOL_FILE_MINOR_VERSION' as a
2958         minimum required version.
2959
2960 2008-06-17 Rodrigo Kumpera  <rkumpera@novell.com>
2961
2962         * reflection.c (mono_custom_attrs_from_property): Fix support for
2963         retriveving cattrs of dynamic inflated generic types.
2964
2965         * reflection.c (mono_custom_attrs_from_event): Same.
2966
2967         * reflection.c (mono_custom_attrs_from_field): Same;
2968
2969         * reflection.c (typebuilder_setup_events): Same cattrs of events.
2970
2971         * loader.c (-mono_metadata_get_corresponding_field_from_generic_type_definition):
2972         Moved to metadata.c.
2973
2974         * metadata.c: New functions to retrive the equivalent field, event
2975         of property from the generic type definition.
2976
2977         * metadata-internals.h: Added new functions from metadata.c.
2978
2979 2008-06-17 Rodrigo Kumpera  <rkumpera@novell.com>
2980
2981         * reflection.c (mono_custom_attrs_from_builders): Mark MonoCustomAttrInfo
2982         to cached in a mempool is used.
2983
2984         * metadata.c (free_generic_class): In some situations field generic_info type
2985         is not properly dup'ed and leads to double free'ing.
2986
2987         Fixes #400643.
2988
2989 2008-06-17  Mark Probst  <mark.probst@gmail.com>
2990
2991         * marshal.c (mono_marshal_get_static_rgctx_invoke): Also handle
2992         this arguments (will be needed later for generic methods).
2993         Collect stats.
2994
2995 2008-06-17  Mark Probst  <mark.probst@gmail.com>
2996
2997         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal):
2998         Create a static RGCTX invoke wrapper for methods which require it.
2999
3000 2008-06-17  Mark Probst  <mark.probst@gmail.com>
3001
3002         * object.c, class-internals.h: New function for checking whether
3003         an individual field is special static.
3004
3005 2008-06-15  Zoltan Varga  <vargaz@gmail.com>
3006
3007         * metadata.c (mono_metadata_get_generic_param_row): Use bsearch instead of
3008         linear search since the table is sorted.
3009
3010         * gc.c (mono_gc_cleanup): Abort the finalizer thread more gracefully.
3011         Fixes #324180.
3012
3013 2008-06-14  Zoltan Varga  <vargaz@gmail.com>
3014
3015         * appdomain.c (unload_thread_main): Applied patch from Tim Howard 
3016         (timh@ict.om.org). Remove the timeouts when waiting for appdomains to unload.
3017
3018         * gc.c (mono_domain_finalize): Allow an infinite timeout.
3019
3020         * threads.c (mono_threads_abort_appdomain_threads): Ditto.
3021         
3022         * threads.c (mono_thread_request_interruption): Get rid of locking, use
3023         InterlockedCompareExchange to query and modify 
3024         thread->interruption_requested.
3025
3026         * object-internals.h (struct _MonoThread): Change interruption_requested
3027         to a gint32 so it can be modified by atomic operations. Add 
3028         'critical_region_level' from the managed side, change small_id to a guint32,
3029         add new set of 'unused' fields.
3030
3031         * appdomain.c: Bump corlib version.
3032
3033 2008-06-13  Zoltan Varga  <vargaz@gmail.com>
3034
3035         * class.c (mono_class_from_name): Search modules as well. Fixes
3036         #322332.
3037
3038 2008-06-13  Mark Probst  <mark.probst@gmail.com>
3039
3040         * generic-sharing.c: Code for maintaining the MRGCTX and MRGCTX
3041         templates.  Templates are generalized with an additional type_argc
3042         argument.  RGCTX templates have type_argc==0, MRGCTX templates
3043         have type_argc>0.
3044
3045         * domain-internals.h, domain.c: New hash table for looking up
3046         MRGCTXs.
3047
3048         * metadata.c, metadata-internals.h: Rename hash and equal
3049         functions for MonoGenericInst's and make them public.
3050
3051         * class-internals.h: New data structures for the MRGCTX.  Macros
3052         for distinguishing slots in the RGCTX and the MRGCTX.
3053
3054 2008-06-13  Mark Probst  <mark.probst@gmail.com>
3055
3056         * object.c (mono_method_get_imt_slot): Put the same methods of
3057         different instantiations of the same generic interface in the same
3058         IMT slots, to make generic sharing simpler.
3059
3060 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
3061
3062         * metadata-internals.h: Added mono_metadata_field_info_with_mempool.
3063
3064         * metadata.c (mono_metadata_field_info_with_mempool): Added.
3065         This function works just like mono_metadata_field_info, but
3066         accept a mempool as argument to be used allocating memory.
3067
3068         * marshal.c (mono_marshal_load_type_info): Use new function
3069         to load marshal data into image mempool.
3070
3071 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
3072
3073         * class.c (mono_class_inflate_generic_type_with_mempool):
3074         This function allows to inflate a generic type using
3075         a mempool.
3076
3077         * class.c (inflate_generic_type): Take a mempool as argument
3078         and use it to do type dup'ing.
3079
3080         * class.c (mono_class_setup_fields): Field type for generic
3081         generic classes are allocated from the image mempool.
3082
3083         * metadata.c (free_generic_class): Inflated field type is
3084         now allocated in the image mempool.
3085
3086 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
3087
3088         * threads.c (thread_cleanup): Free MonoThread::name.
3089
3090 2008-06-12  Marek Habersack  <mhabersack@novell.com>
3091
3092         * appdomain.c (ensure_directory_exists): avoid unnecessary
3093         mkdir(2) calls when the shadow directory already exists.
3094         (mono_make_shadow_copy): copy also satellite assemblies from the
3095         private bin directories.
3096
3097 2008-06-11  Zoltan Varga  <vargaz@gmail.com>
3098
3099         * threads.c (mono_thread_get_stack_bounds): Align the stack in all cases.
3100         
3101         * threads.c (mono_thread_get_stack_bounds): Align the stack address to
3102         a page boundary. Fixes #396219.
3103
3104 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
3105
3106         * marshal.c (mono_marshal_load_type_info): Add a memory barrier
3107         due to double-checked locking.
3108
3109 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
3110
3111         * assembly.c (build_assembly_name): Release memory on failure.
3112
3113         * assembly.c (mono_assembly_name_parse_full): Release memory on failure.
3114
3115 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
3116
3117         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Release
3118         memory on failure.
3119
3120 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
3121
3122         * icall.c (ves_icall_System_Reflection_AssemblyName_ParseName): Release
3123         memory on failure.
3124
3125 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
3126
3127         * loader.c (field_from_memberref): Check if field signature type is equal
3128         to the non-inflated type of the field. Fixes #398980.
3129
3130 2008-06-11  Zoltan Varga  <vargaz@gmail.com>
3131
3132         * assembly.c (mono_assembly_load_from_full): Call 
3133         mono_assembly_load_friends () outside the assemblies lock, since it can
3134         acquire the loader lock. Fixes #323696.
3135
3136         * reflection.c (resolve_object): Inflate the inst with the context for
3137         FieldOnTypeBuilderInst. Fixes #399010.
3138
3139 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
3140
3141         * reflection.c (mono_image_get_field_on_inst_token): Don't
3142         inflate the field to encode it's signature. If it's a
3143         VAR or MVAR it should stay that way in the signature.
3144         Fixes #399047.
3145
3146 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
3147
3148         * reflection.c (resolve_object): Release memory of inflated types.
3149
3150 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
3151
3152         * loader.c (mono_method_get_signature_full): Remove assert about
3153         loading a methodspec to a generic method. We have such methods, such as
3154         System.Threading.Interlocked::CompareExchange<T>.
3155         This assert was removed since it crashes the verifier when it checks
3156         methods calling CompareExchange<T>.
3157
3158 2008-06-10  Marek Safar  <marek.safar@gmail.com>
3159
3160         * icall.c (ves_icall_MonoMethod_GetGenericArguments): Creates an instance
3161         of Type array and not MonoType.
3162
3163 2008-06-10  Marek Habersack  <mhabersack@novell.com>
3164
3165         * profiler.c: fix a segfault on shutdown. Patch from Paolo Molaro
3166         <lupus@ximian.com>
3167
3168 2008-06-10  Martin Baulig  <martin@ximian.com>
3169
3170         * debug-mono-symfile.h
3171         (MONO_SYMBOL_FILE_MINOR_VERSION): Bump to 6.  There were no
3172         changes to the file format, but we were generating incorrect
3173         source file indices in the line number table due to a bug, which
3174         made backtraces report an incorrect source file.
3175
3176 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
3177
3178         * mono-debug.c: Moved mono_debug_free_method_jit_info from
3179         mini/debug-mini.c to here.
3180
3181         * mono-debug.c (il_offset_from_address): Free memory from find_method.
3182
3183         * mono-debug.h: Export mono_debug_free_method_jit_info, users should
3184         use it to release structs returned by mono_debug_find_method.
3185
3186 2008-06-10  Zoltan Varga  <vargaz@gmail.com>
3187
3188         * class.c (mono_class_setup_vtable): Call setup_methods even for interfaces
3189         since it needs to set method->slot for all interface methods.
3190
3191 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
3192
3193         * class-internals.h: Forgot to add.
3194
3195 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
3196
3197         * class-internals.h: Added MONO_PROP_DYNAMIC_CATTR.
3198
3199         * reflection.c (lookup_custom_attr): Added a MonoImage argument.
3200         Lookup the custom attributes from property_hash.
3201
3202         * reflection.c (mono_save_custom_attrs): Save the custom attributes
3203         in property_hash. Allocate all data using the image mempool.
3204
3205         * reflection.c: Removed dynamic_custom_attrs. Changed all checks
3206         for dynamic_custom_attrs to checks if the image is dynamic.
3207
3208 2008-06-09  Zoltan Varga  <vargaz@gmail.com>
3209
3210         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Free the
3211         assemblies array.
3212         
3213         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Avoid calling
3214         runtime functions while holding the domain assemblies lock.
3215
3216 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
3217
3218         * verify.c: Reapplied the last bit of the reverted changes.
3219
3220 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
3221
3222         * verify.c: Reapplied more of the reverted changes.
3223
3224 2008-06-09  Martin Baulig  <martin@ximian.com>
3225
3226         * debug-mono-symfile.c (load_symfile): Check the major version
3227         first; if it's wrong, don't print the minor version in the error message.
3228
3229 2008-06-09  Zoltan Varga  <vargaz@gmail.com>
3230
3231         * appdomain.c (set_domain_search_path): Make this use the domain assemblies
3232         lock instead of the domain lock to avoid deadlocks, since the thread might
3233         already hold the loader lock.
3234
3235         * threads.c (start_wrapper): Call mono_monitor_init_tls ().
3236         (mono_thread_attach): Ditto.
3237
3238         * monitor.c: Use a TLS variable for holding the current thread id instead
3239         of calling pthread_self ().
3240         (mono_monitor_init_tls): New internal function to initialize the TLS
3241         variable.
3242         (mono_monitor_try_enter_internal): Put the owner == id check after the
3243         owner == 0 check.
3244
3245         * object-internals.h (_G_BOOLEAN_EXPR): Redefine this glib macro to avoid
3246         missed optimizations when using gcc-4.3.
3247
3248 2008-06-08 Rodrigo Kumpera  <rkumpera@novell.com>
3249
3250         * reflection.c (mono_dynamic_image_free): Free the memory
3251         used by MonoGenericParam in MonoDynamicImage::gen_param.
3252
3253         * reflection.c (mono_reflection_setup_generic_class): Allocate
3254         container from mempool.
3255
3256         * reflection.c (mono_reflection_initialize_generic_parameter): Allocate
3257         container from mempool.
3258
3259 2008-06-07  Zoltan Varga  <vargaz@gmail.com>
3260
3261         * threads.c (mono_set_pending_exception): New internal function to set the
3262         pending exception of the current thread.
3263         (mono_thread_get_and_clear_pending_exception): Check for 
3264         thread->pending_exception as well.
3265
3266         * object-internals.h (struct _MonoThread): Add 'pending_exception' field.
3267
3268         * boehm-gc.c (mono_gc_base_init): Set GC_no_dls before calling GC_init () since
3269         it can trigger a collection.
3270
3271 2008-06-06  Martin Baulig  <martin@ximian.com>
3272
3273         Merged the `debugger-kahalo' branch.
3274
3275         * mono-debug.h
3276         (MONO_DEBUGGER_VERSION): Bumped to 72.
3277
3278         * debug-mono-symfile.h
3279         (MonoSymbolFileMethodIndexEntry): Removed.
3280         (MonoSymbolFileMethodEntry): New public typedef.
3281         (MonoSymbolFileOffsetTable): Added `_is_aspx_source'.
3282         (MonoSymbolFileSourceEntry): Remove everything except `index' and
3283         `data_offset'.
3284         (MonoSymbolFileMethodEntry): Removed.
3285         (MonoSymbolFileLexicalBlockEntry): Removed.
3286         (MonoSymbolFileLineNumberEntry): Removed.
3287         (MonoDebugLexicalBlockEntry): Removed.
3288         (MonoDebugMethodInfo): Replaced `entry' by `guint32 entry_offset';
3289         removed `num_il_offsets' and `il_offsets'.
3290         (MonoSymbolFile): Replace `version' with `major_version' and
3291         `minor_version'.
3292         (MONO_SYMBOL_FILE_VERSION): Replace with
3293         `MONO_SYMBOL_FILE_MAJOR_VERSION' and
3294         `MONO_SYMBOL_FILE_MINOR_VERSION'.
3295
3296         * debug-mono-symfile.c
3297         (mono_debug_symfile_lookup_location): Add support for the new line
3298         number table format.
3299
3300 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
3301
3302         * metadata.c (free_generic_class): Release the inflated
3303         MonoClass of dynamic generic classes if it's not a generic
3304         type definition.
3305
3306 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
3307
3308         * verify.c: Reapplied more of the reverted changes.
3309
3310 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
3311
3312         * reflection.c (lookup_custom_attr): Clean the cached flag or
3313         nobody will free it. Fixes a memleak in MonoCustomAttrs::IsDefinedInternal
3314         for SRE types.
3315
3316 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
3317
3318         * verify.c: Reapplied a small part of the reverted changes.
3319
3320 2008-06-07  Zoltan Varga  <vargaz@gmail.com>
3321
3322         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
3323
3324         * monitor.c (mono_monitor_try_enter_internal): Add NULL check which was 
3325         previously in managed code.
3326         (mono_monitor_exit): Ditto.
3327         (ves_icall_System_Threading_Monitor_Monitor_exit): Removed, not needed anymore.
3328
3329         * icall-def.h: Rename the Enter/Exit icalls to simply Enter/Exit to match
3330         the managed definition.
3331
3332 2008-06-06 Rodrigo Kumpera  <rkumpera@novell.com>
3333
3334         * verify.c: Revert changes to see if it helps with weird buildbot crashes.
3335
3336 2008-06-06  Zoltan Varga  <vargaz@gmail.com>
3337
3338         * monitor.c: Redefine GetCurrentThreadId () with a macro on !win32.
3339         
3340         * monitor.c: Add some micro optimizations.
3341
3342         * icall.c (type_from_typename): Handle 'bool'.
3343
3344 2008-06-06 Rodrigo Kumpera  <rkumpera@novell.com>
3345
3346         * verify.c: Implement constructor verification per P III 1.8.1.4.
3347         Fixes #396716.
3348
3349 2008-06-06  Zoltan Varga  <vargaz@gmail.com>
3350
3351         * assembly.c (mono_assembly_loaded_full): Avoid calling the search hooks while
3352         holding the assemblies lock here too.
3353
3354 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
3355
3356         * verify.c: Kill stack_top function.
3357
3358 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
3359
3360         * verify.c: Kill stack_get function.
3361
3362 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
3363
3364         * verify.c (mono_method_verify): Last change broke the build. Fixed.
3365
3366 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
3367
3368         * verify.c (verify_type_compatibility_full): Make SZARRAY checks
3369         more reliable.
3370
3371         * verify.c (mono_method_verify): Inflate params and locals to avoid
3372         mismatch when checking for compatibility.
3373
3374 2008-06-05  Jonathan Chambers  <joncham@gmail.com>
3375
3376         * metadata.c (mono_string_from_bstr): Fix BSTR marshalling.
3377         Length prefix should be size in bytes. Fix bug #339530.
3378         
3379         * metadata.c (mono_string_to_bstr): Fix BSTR marshalling.
3380         Length prefix should be size in bytes. Fix bug #339530.
3381
3382         Code is contributed under MIT/X11 license.
3383
3384 2008-06-05  Bill Holmes <billholmes54@gmail.com>
3385
3386         * decimal.c:  Adding MSVC implementation to my_g_bit_nth_msf.
3387
3388         Contributed under MIT/X11 license.
3389
3390 2008-06-05  Martin Baulig  <martin@ximian.com>
3391
3392         * mono-debug-debugger.c
3393         (mono_debugger_check_breakpoints): Reflect latest runtime changes.
3394
3395 2008-06-05  Zoltan Varga  <vargaz@gmail.com>
3396
3397         * assembly.c (mono_assembly_load_from_full): Avoid calling the search hooks
3398         while holding the assemblies lock to prevent deadlocks. Handle the case
3399         where the search hook returns NULL but the assembly was still loaded.
3400         Fixes #323696.
3401
3402         * appdomain.c (set_domain_search_path): Acquire the domain lock since we
3403         modify domain state.
3404
3405 2008-06-05  Andreas Färber  <andreas.faerber@web.de>
3406
3407         * boehm-gc.c: Add DTrace probes gc-{begin,end}.
3408         * Makefile.am (pedump_LDADD): Post-process object files and
3409         add dtrace-generated object file, if necessary.
3410
3411         Code is contributed under MIT/X11 license.
3412
3413 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
3414
3415         * reflection.c (mono_dynamic_image_free): Free MonoDynamicImage::public_key.
3416
3417 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
3418
3419         * class.c (mono_type_get_full): Add a work-around for generic type definitions.
3420
3421 2008-06-04  Mark Probst  <mark.probst@gmail.com>
3422
3423         * threads.c: Try to free everything from the delayed free table
3424         when shutting down threads, and set the variable to NULL after the
3425         table is freed so that calling
3426         mono_thread_hazardous_try_free_all() when shutting down the root
3427         domain doesn't crash.
3428
3429 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
3430
3431         * class.c (mono_type_retrieve_from_typespec): Add an argument to inform
3432         the caller if resulting type was inflated.
3433
3434         * class.c (mono_class_create_from_typespec): Free the MonoType if it
3435         was inflated.
3436
3437         * class.c (mono_type_get_full): Free the MonoType if it was inflated.
3438
3439
3440 2008-06-04  Zoltan Varga  <vargaz@gmail.com>
3441
3442         * decimal.c (rescale128): Rework the code a bit so it no longer crashes the
3443         class library tests.
3444
3445         * icall.c (ves_icall_InternalInvoke): Applied patch from Andy Hume 
3446         (andyhume32@yahoo.co.uk). Add more useful exception messages. Fixes
3447         #396989.
3448
3449 2008-06-04  Mark Probst  <mark.probst@gmail.com>
3450
3451         * domain.c, domain-internals.h: The JIT infos are now freed by the
3452         JIT info table code.  They are freed immediately if there only a
3453         single JIT info table in circulation.  If there is more, the free
3454         is delayed via a queue.
3455
3456         * threads.c, threads-types.h: New hazard pointer function for
3457         freeing all freeable delayed items in one sitting.
3458
3459 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
3460
3461         * reflection.c (typebuilder_setup_fields): Use mempool for allocations.
3462
3463         * reflection.c (typebuilder_setup_properties): Same.
3464
3465         * reflection.c (typebuilder_setup_events): Same.
3466
3467 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
3468
3469         * reflection.c (mono_custom_attrs_from_builders): Receive a MonoMemPool
3470         and use it for allocating memory.
3471
3472         * reflection.c (mono_marshal_spec_from_builder): Same.
3473
3474         * reflection.c: Change code to use new signatures.
3475
3476         * metadata.c (mono_metadata_type_dup): Add a FIXME note.
3477
3478 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
3479
3480         * decimal.c (rescale128): Put back one line which was accidently commented
3481         out.
3482         
3483         * decimal.c (rescale128): Disable the code added by the last patch, as it seems
3484         to cause crashes.
3485
3486 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
3487
3488         * reflection.c (mono_reflection_generic_class_initialize): Name must
3489         be always malloc'ed so we can free it later on. Do this for field, property
3490         and event.
3491
3492         * metadata.c (free_generic_class): Free field, property and event names.
3493
3494 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
3495
3496         * reflection.c (fieldbuilder_to_mono_class_field): Use mono_metadata_type_dup
3497         instead of g_memdup.
3498
3499         * reflection.c (typebuilder_setup_fields): Same.
3500
3501 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
3502
3503         * decimal.c (rescale128): Optimize this function a bit more.
3504
3505 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
3506
3507         * metadata.c (free_generic_class): Release some memory from
3508         SRE generic classes.
3509
3510 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
3511
3512         * reflection.c (mono_image_get_generic_field_token): No reference
3513         to name is kept, free it.
3514
3515         * reflection.c (mono_reflection_generic_class_initialize): Free
3516         more memory of the inflated field.
3517
3518 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
3519
3520         * decimal.c (mono_decimalDiv): Moved equality checks here from managed
3521         code.
3522
3523 2008-06-02 Rodrigo Kumpera  <rkumpera@novell.com>
3524
3525         * reflection.c (mono_dynamic_image_free): Release memory used by
3526         MonoDynamicImage::array_methods elements.
3527
3528         * reflection.c (assembly_add_win32_resources): Release memory after
3529         encoding.
3530
3531 2008-06-02  Zoltan Varga  <vargaz@gmail.com>
3532
3533         * decimal.c (log2_32): Use an optimized version for this function too.
3534         
3535         * decimal.c (log2_64): Fix this on 32 bit machines.
3536
3537 2008-06-02 Rodrigo Kumpera  <rkumpera@novell.com>
3538
3539         * class.c (mono_dup_array_type): Implement allocation using a mempool.
3540
3541         * class.c (mono_metadata_signature_deep_dup): Same.
3542
3543         * metadata.c (mono_metadata_signature_dup_full): Added, allow dup'ng with
3544         a mempool.
3545
3546         * metadata.c (mono_metadata_signature_dup): Delegate to the _full version.
3547
3548         * metadata.c (mono_metadata_type_dup): Remove asserts and FIXME.
3549
3550         * metadata-internals.h: Added mono_metadata_signature_dup_full.
3551
3552         * class-internals.h: Update signatures to take a MonoMemPool.
3553
3554 2008-06-02  Dick Porter  <dick@ximian.com>
3555
3556         * icall.c (ves_icall_System_ComponentModel_Win32Exception_W32ErrorMessage): 
3557         * icall-def.h: Add
3558         System.ComponentModel.Win32Exception.W32ErrorMessage, using the
3559         FormatMessage API to get the error text.  Fixes bug 321827.
3560
3561 2008-06-02  Zoltan Varga  <vargaz@gmail.com>
3562
3563         * decimal.c: Add some micro optimizations to make decimal operations faster.
3564
3565 2008-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
3566
3567         * reflection.c (method_encode_clauses): Take a mempool
3568         as parameter and use it to allocate the clause array.
3569
3570         * reflection.c (mono_image_get_field_on_inst_token): Free
3571         the inflated type after encoding it.
3572
3573         * reflection.c (mono_dynamic_image_free): Free each element
3574         of MonoDynamicImage::gen_params.
3575
3576         * reflection.c (reflection_methodbuilder_to_mono_method):
3577         Allocate the generic param array from the mempool.
3578         Allocate signature params from the mempool.
3579
3580         * reflection.c (mono_reflection_generic_class_initialize):
3581         Free inflated fields after been used.
3582
3583 2008-05-30 Rodrigo Kumpera  <rkumpera@novell.com>
3584
3585         * icall.c: Reapply the memory leak fixes as they no
3586         longer make mono crash.
3587
3588 2008-05-30 Rodrigo Kumpera  <rkumpera@novell.com>
3589
3590         * reflection.c (mono_type_get_object): Don't store the suplied
3591         MonoType with type_hash. A caller which pass a type that
3592         was mono_metadata_type_dup'ed cannot free it reliably, as type_hash
3593         might end with a pointer to freed memory.
3594         The solution is to use byval_arg or this_arg from the associated
3595         MonoClass of the supplied type.
3596
3597 2008-05-29  Zoltan Varga  <vargaz@gmail.com>
3598
3599         * icall.c: Revert the rest of the last change as it breaks the build too.
3600
3601 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
3602
3603         * icall.c: Revert a leak fix as it's breaking the build.
3604
3605 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
3606
3607         * appdomain.c (mono_make_shadow_copy): Fix another leak of dir_name.
3608
3609 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
3610
3611         * appdomain.c (mono_make_shadow_copy): We leaked dir_name.
3612
3613 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
3614
3615         * icall.c: Fix some memory leaks.
3616
3617 2008-05-29  Dick Porter  <dick@ximian.com>
3618
3619         * threadpool.c (mono_thread_pool_remove_socket): Always remove the
3620         async socket operations from the pending list when a socket
3621         closes.  Leaving it until the threadpool services the event
3622         exposes a race condition when a socket descriptor is reused.
3623         Fixes bug 377589.
3624
3625 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
3626
3627         * object.c: Fix negative index check for array alocation.
3628
3629 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
3630
3631         * icall.c, marshal.c: Delegate wrappers should skip visibility.
3632         This check is performed by the verifier for IL created delegates
3633         and by Delegate::CreateDelegate for programatically created ones.
3634         Fixes #372406.
3635
3636 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
3637
3638         * sockey-io.c (ves_icall_System_Net_Sockets_Socket_Select_internal):
3639         Fix code to use mono_array_size_t instead of int.
3640
3641         Based on patch by Luis F. Ortiz.
3642         Contributed under X11 license.
3643         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
3644
3645 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
3646
3647         * icall.c: Added ves_icall_System_Array_GetLongLength and
3648         ves_icall_System_Array_CreateInstanceImpl64. Both allow handling big
3649         arrays.
3650
3651         * icall.h: Export both new functions.
3652
3653         Based on patch by Luis F. Ortiz.
3654         Contributed under X11 license.
3655         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
3656
3657 2008-05-28  Martin Baulig  <martin@ximian.com>
3658
3659         The debugger now requires exactly r103463.
3660
3661         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 71.
3662         This version is not supported by the debugger, wait for 72.
3663
3664 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
3665
3666         * object.h: Changed array related functions to use
3667         mono_array_size_t instead of guint32. Forgot to commit this file.
3668
3669         Patch by Luis F. Ortiz.
3670         Contributed under X11 license.
3671         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
3672
3673
3674 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
3675
3676         * object.h: Don't use G_MAXINT32 or G_MAXUINT32 as old glibs
3677         don't define it. Use the number literal instead.
3678
3679 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
3680
3681         * icall.c: Changed array related functions to use
3682         mono_array_size_t instead of guint32.
3683
3684         * icall.c (ves_icall_System_Array_GetLength): Check for length
3685         overflow under MONO_BIG_ARRAYS.
3686
3687         Based on patch by Luis F. Ortiz.
3688         Contributed under X11 license.
3689         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
3690
3691 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
3692
3693         * object.c: Add 64bits bounds check for arrays under MONO_BIG_ARRAYS.
3694
3695         Based on patch by Luis F. Ortiz.
3696         Contributed under X11 license.
3697         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
3698
3699 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
3700
3701         * object.c, object.h: Changed array related functions to use
3702         mono_array_size_t instead of guint32.
3703
3704         Patch by Luis F. Ortiz.
3705         Contributed under X11 license.
3706         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
3707
3708 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
3709
3710         * object.h: Introduced mono_array_size_t typedef. This must be used
3711         in all places an array length is expected. This is 64bits wide if
3712         MONO_BIG_ARRAYS is enabled.
3713
3714         Patch by Luis F. Ortiz.
3715         Contributed under X11 license.
3716         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
3717
3718 2008-05-27  Zoltan Varga  <vargaz@gmail.com>
3719
3720         * security-manager.c class.c: Set the class exception info by calling
3721         mono_class_set_failure ().
3722
3723         * class.c (mono_class_get_exception_data): New accessor function.
3724         (mono_class_set_failure): Store exception_data in the property hash.
3725
3726         * class-internals.h (struct _MonoClass): Store 'exception_data' outside
3727         the struct as a property.
3728
3729         * loader.c (mono_get_method_full): Store the lookup result for method
3730         tokens in method_cache, the others in methodref_cache to decrease the memory
3731         usage of hash tables.
3732
3733         * image.c (mono_image_close): Destroy method_cache and methodref_cache.
3734         (mono_image_init): method_cache is lazy inited now.
3735
3736         * metadata-internals.h (struct _MonoImage): Change method_cache to
3737         a MonoValueHashTable, add a separate methodref_cache.
3738
3739 2008-05-27  Eyal Alaluf <eyala@mainsoft.com>
3740
3741         * number-formatter.h: Fix tables to avoid arithemtic overflow in
3742           Double.ToString as exposed by Bug #383531.
3743
3744 2008-05-26  Zoltan Varga  <vargaz@gmail.com>
3745
3746         * number-formatter.h: Make some tables static.
3747
3748         * class.c (mono_method_set_generic_container): New accessor function.
3749         (mono_method_get_generic_container): Ditto.
3750
3751         * class-internals.h (struct _MonoMethod): Remove rarely used 
3752         'generic_container' field, store it in the property hash instead. Add 
3753         'is_generic' boolean field instead.
3754
3755         * image.c (mono_image_init): Initialize property_hash.
3756         (mono_image_close): Destroy property_hash.
3757
3758         * metadata-internals.h (struct _MonoImage): Add 'property_hash' hash table to
3759         hold rarely used fields of runtime structures belonging to this image.
3760
3761         * class.c loader.c verify.c icall.c reflection.c: Use the new accessor functions
3762         to get/set method->generic_container.
3763
3764         * loader.c (mono_get_method_from_token): Avoid loading the method header for
3765         generic methods.
3766
3767 2008-05-25  Zoltan Varga  <vargaz@gmail.com>
3768
3769         * class.c (mono_class_inflate_generic_method_full): Don't increase
3770         mono_stats.inflated_method_count for methods found in the cache.
3771
3772         * threads.c (mono_thread_request_interruption): Add a comment about 
3773         QueueUserAPC ().
3774
3775 2008-05-24  Zoltan Varga  <vargaz@gmail.com>
3776
3777         * class.c (setup_interface_offsets): Use sizeof (guint16) when allocating the
3778         interface_offsets_packed table.
3779         
3780         * class.c (mono_class_init): Remove some dead code.
3781
3782         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Call
3783         mono_class_setup_vtable () when CAS is active to detect security problems.
3784
3785 2008-05-23 Rodrigo Kumpera  <rkumpera@novell.com>
3786
3787         * verify.c (mono_delegate_type_equal): Handle VAR, MVAR and GENERICINST.
3788
3789         * verify.c (mono_delegate_signature_equal): Don't compar number of generic
3790         parameters as it's irrelevant for delegate checking.
3791
3792 2008-05-23  Zoltan Varga  <vargaz@gmail.com>
3793
3794         * class-internals.h class.c: Correct the name of the 'mono_no_setup_vtable_in_class_init' variable.
3795
3796         * class.c (mono_class_init): Control the creation of a generic vtable using
3797         a global which is true by default, but set to false by the runtime startup code.
3798         
3799         * class.c (mono_class_init): Avoid constructing a generic vtable in most cases.
3800         Disabled for now since it breaks the embedding API.
3801         Move the setup of class->methods for arrays to mono_class_setup_methods ().
3802         (mono_class_setup_methods): Add a memory barrier.
3803
3804         * object.c (mono_class_create_runtime_vtable): Add code to handle the case
3805         when mono_class_init () doesn't compute the generic vtable.
3806         
3807 2008-05-23  Massimiliano Mantione  <massi@ximian.com>
3808         * profiler.c: Added mono_profiler_install_statistical_call_chain,
3809         mono_profiler_stat_get_call_chain_depth and mono_profiler_stat_call_chain
3810         to support call chains (backtrace) in the stat profiler.
3811         * profiler.c, profiler-private.h: Likewise.
3812
3813 2008-05-22  Mark Probst  <mark.probst@gmail.com>
3814
3815         * generic-sharing.c: Init generic class when a method of it is
3816         requested via a runtime generic context.
3817
3818 2008-05-22  Zoltan Varga  <vargaz@gmail.com>
3819
3820         * class.c (mono_class_init): Add a comment about trying to avoid calling this.
3821
3822         * reflection.c (mono_type_get_object): Add a FIXME.
3823
3824         * loader.c (find_method_in_class): Use mono_class_get_method_by_index ().
3825
3826         * class.c (mono_class_get_method_by_index): New helper function, returning an
3827         entry in the class->methods array.
3828
3829 2008-05-21  Zoltan Varga  <vargaz@gmail.com>
3830
3831         * class.c (mono_class_init): Only do the array optimization for szarrays. 
3832         Avoid creating a generic vtable for generic instances as well.
3833         (mono_class_get_method_from_name_flags): Don't search in the metadata for
3834         generic instances.
3835
3836 2008-05-21 Rodrigo Kumpera  <rkumpera@novell.com>
3837
3838         * loader.c (mono_get_method_constrained): Inflate the signature
3839         with class context. Fix #325283.
3840
3841 2008-05-21  Zoltan Varga  <vargaz@gmail.com>
3842
3843         * object.c (mono_class_create_runtime_vtable): Add a comment.
3844
3845         * class.c (get_implicit_generic_array_interfaces): Call mono_class_init ()
3846         where needed.
3847         (setup_interface_offsets): Handle the case when this is called twice for arrays.
3848         (mono_class_setup_vtable_general): Add an assert.
3849         (mono_class_init): Avoid creating a generic vtable for arrays.
3850
3851         * class.c (mono_generic_class_get_class): Don't call setup_interface_offsets ()
3852         here, let mono_class_init () do that.
3853
3854         * class.c (mono_class_init): Avoid calling mono_class_setup_methods () for
3855         interfaces in mscorlib.
3856
3857         * class.c (mono_class_setup_vtable): Avoid calling setup_methods () for
3858         interfaces. Add some comments.
3859         (mono_class_init): Call mono_class_setup_methods () here since it is no
3860         longer called by mono_class_setup_vtable ().
3861
3862         * object.c (mono_class_proxy_vtable): Null out entries in pvt->vtable which are
3863         not set in class->vtable.
3864         (mono_class_create_runtime_vtable): Reenable the disabled code.
3865
3866         * object.c (mono_class_create_runtime_vtable): Disable the last change for
3867         now as it causes some test failures.
3868
3869         * object.c (mono_class_create_runtime_vtable): Avoid creating a generic vtable
3870         if using the vtable trampoline. Also remove some strange code which put the
3871         generic methods themselves into the vtable slots. Remove the AOT init_vtable
3872         stuff as it is no longer needed.
3873
3874 2008-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
3875
3876         * pedump.c: Give make --verify all option check code as well.
3877         Using --verify code won't check for metadata now.
3878
3879 2008-05-19  Martin Baulig  <martin@ximian.com>
3880
3881         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 70.
3882
3883         * mono-debug.c
3884         (_mono_debug_using_mono_debugger): New global variable; it's set
3885         directly by the debugger, so mono_debug_using_mono_debugger() also
3886         works after attaching.
3887
3888 2008-05-18 Rodrigo Kumpera  <rkumpera@novell.com>
3889
3890         * object.c (mono_class_create_runtime_vtable): Use memory barriers
3891         as we do double checked locking on MonoClass::runtime_info and
3892         MonoClassRuntimeInfo::domain_vtables.
3893
3894 2008-05-18  Zoltan Varga  <vargaz@gmail.com>
3895
3896         * debug-helpers.c (print_field_value): Fix a warning.
3897
3898 2008-05-16  Zoltan Varga  <vargaz@gmail.com>
3899
3900         * object.c (mono_object_get_virtual_method): Fix a crash if method->slot is not
3901         set in the AOT case.
3902
3903 2008-05-16 Rodrigo Kumpera  <rkumpera@novell.com>
3904
3905         * class.c (mono_class_setup_vtable_general): Use memory barriers
3906         as we do double checked locking on MonoClass::vtable.
3907
3908 2008-05-16 Rodrigo Kumpera  <rkumpera@novell.com>
3909
3910         * reflection.c (resolve_object): Inflate only if the generic context
3911         is not null. Fixes #389886.
3912
3913 2008-05-15  Jonathan Chambers  <joncham@gmail.com>
3914
3915         * metadata.c (emit_marshal_string): Free return strings using mono_marshal_free
3916         instead of g_free.
3917
3918         Code is contributed under MIT/X11 license.
3919
3920 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
3921
3922         * class.c: Revert unrelated change.
3923
3924 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
3925
3926         * verify.c (check_is_valid_type_for_field_ops): Type on stack can be
3927         a generic instantiation, use mono_class_from_mono_type instead of playing
3928         with MonoType directly.
3929
3930 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
3931
3932         * class.c: Added mono_class_has_parent_and_ignore_generics. Visibility
3933         checks must ignore generic instantiations, so mono_class_has_parent is not
3934         suitable. Fixes #390128.
3935
3936 2008-05-14  Zoltan Varga  <vargaz@gmail.com>
3937
3938         * reflection.c (mono_image_create_token): Add a 'register_token' argument, and use
3939         it to avoid registering tokens during metadata generation. Fixes #390023.
3940
3941 2008-05-14  Kornél Pál  <kornelpal@gmail.com>
3942
3943         * coree.c: Rename dwOldProtect to OldProtect that makes naming convention
3944         consistent.
3945
3946         Contributed under MIT/X11 license.
3947
3948 2008-05-14  Kornél Pál  <kornelpal@gmail.com>
3949
3950         * domain.c (mono_init_internal): Enable LoadLibrary support. Load EXE image
3951         even when get_runtimes_from_exe didn't load it that allows mono_fixup_exe_image
3952         to fixup the EXE image.
3953         (mono_cleanup): Use mono_close_exe_image.
3954         (mono_close_exe_image): New function.
3955         * image.c: Include "marshal.h".
3956         (mono_image_open_from_module_handle): Add ref_count argument. Return the image.
3957         (mono_image_open_full, mono_image_close): Fix LoadLibrary/FreeLibrary reference
3958         counting when the image is loaded outside of mono_image_open_full. Set status
3959         based on GetLastError.
3960         * coree.c: Include required headers. Add init_from_coree.
3961         (_CorDllMain): Support fix in mono_image_open_full, mono_image_close. Call
3962         mono_assembly_open only when the image has vtfixups. Set init_from_coree.
3963         (_CorExeMain): Set init_from_coree.
3964         (CorExitProcess): Only call ExitProcess for now.
3965         (CorBindToRuntimeEx): New stub implementation.
3966         (CorBindToRuntime): New function.
3967         (MonoFixupCorEE): Fixup CorBindToRuntime and CorBindToRuntimeEx.
3968         (MonoFixupExe): ILONLY executables require no fixups.
3969         (mono_set_act_ctx): New function to set activation context.
3970         (mono_load_coree): Use init_from_coree. Call mono_set_act_ctx.  
3971         * coree.h: Move STATUS_SUCCESS and STATUS_INVALID_IMAGE_FORMAT to header.
3972         Declare mono_module_handle, coree_module_handle, mono_get_module_file_name,
3973         mono_load_coree, mono_fixup_exe_image and mono_image_open_from_module_handle
3974         as MONO_INTERNAL.
3975         * domain-internals.h: Add mono_close_exe_image.
3976
3977         Contributed under MIT/X11 license.
3978
3979 2008-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
3980
3981         * metadata.c (mono_metadata_compute_size): Correctly calculate field
3982         size for generic param and event tables. Fixes #388977.
3983
3984 2008-05-13  Zoltan Varga  <vargaz@gmail.com>
3985
3986         * loader.c (mono_method_signature): Use memory barriers because of the double
3987         checked locking pattern.
3988
3989         * threads.c (remove_and_abort_threads): Stop and wait for threads which are
3990         aborting or aborted as well. Fixes #376391.
3991         
3992         * threads.c (mono_thread_execute_interruption): Avoid depending on no longer
3993         existing runtime state in the Suspend handler during shutdown.
3994
3995 2008-05-12  Zoltan Varga  <vargaz@gmail.com>
3996
3997         * threads.c (mono_thread_request_interruption): Add some FIXMEs.
3998
3999         * threads.c (mono_thread_suspend_all_other_threads): Add support for threads 
4000         which are starting up or shutting down.
4001
4002         * threads.c (mono_threads_set_shutting_down): Don't return a value since
4003         this function never returns if the runtime is already shutting down.
4004
4005         * icall.c (ves_icall_System_Environment_Exit): Update after 
4006         mono_threads_set_shutting_down () signature change.
4007         
4008 2008-05-09 Rodrigo Kumpera  <rkumpera@novell.com>
4009
4010         * class.c: Added can_access_instantiation to verify if the instantiation
4011         is visible. Fix access check for nested types as they returned TRUE
4012         before doing type and generic instantiation visibility checks.
4013
4014 2008-05-08 Rodrigo Kumpera  <rkumpera@novell.com>
4015
4016         * reflection.c (mono_reflection_create_generic_class): The created type
4017         must have a different container from its TypeBuilder. Otherwise they
4018         will end sharing generic arguments, which is wrong.
4019
4020         Due to the sharing, making a generic instance of the created type using
4021         the TypeBuider generic arguments resulted in the generic type definition
4022         been returned, which is wrong as well.
4023
4024         As a bonus the code was leaking the type_params array. This memory should
4025         be allocated from the image mempool.
4026
4027         This fixes bug #354047.
4028
4029 2008-05-08 Rodrigo Kumpera  <rkumpera@novell.com>
4030
4031         * metadata-internals.h: Move MONO_SECMAN_FLAG macros from mini/declsec.h
4032         to here         as they are now used in assembly.c new code.
4033         Added a skipverification flag to MonoAssembly.
4034         New internal function mono_assembly_has_skip_verification.
4035
4036         * assembly.c: New function mono_assembly_has_skip_verification. It checks
4037         if an assembly has a version 2.0 SkipVerification security attribute. Fixes
4038         part of #387274.
4039
4040 2008-05-07  Zoltan Varga  <vargaz@gmail.com>
4041
4042         * object.c (mono_object_get_virtual_method): Inflate the resulting method if
4043         needed. Fixes #387034.
4044
4045         * class.c (mono_class_inflate_generic_type): Avoid a crash if context is NULL.
4046
4047 2008-05-06  Miguel de Icaza  <miguel@novell.com>
4048
4049         * assembly.c (mono_assembly_load_reference): Prevent crash while
4050         disassembling Silverlight 2.0 executables while we still do not
4051         have GACed libraries.
4052
4053 2008-05-07  Zoltan Varga  <vargaz@gmail.com>
4054
4055         * reflection.c: Special case generic type definitions as well. Fixes #383444.
4056
4057 2008-05-06  Zoltan Varga  <vargaz@gmail.com>
4058
4059         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Fix handling
4060         of the dynamic case. Fixes #387404.
4061
4062 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
4063
4064         *verify.c (mono_verifier_is_class_full_trust): If under
4065         verify_all and the verifier mode was not set, only
4066         gac and corlib types are fulltrust. This makes --verify-all
4067         usable to detect unverifiable code, which is the expected
4068         use case.
4069
4070 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
4071
4072         * verify.h: Ops, commited the header with debug
4073         enabled.
4074
4075 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
4076
4077         * verify.c (merge_stack): Use the new value on unverifiable
4078         stack merges.
4079
4080         * verify.c (verify_type_compatibility_full): Comparison
4081         of nullable types can't use mono_class_is_assignable_from.
4082
4083         * verify.c, verify.h: Added MONO_VERIFY_REPORT_ALL_ERRORS
4084         that makes all verification errors be reported.
4085
4086         * pedump.c: Pass MONO_VERIFY_REPORT_ALL_ERRORS to
4087         mono_method_verify.
4088
4089 2008-05-05  Robert Jordan  <robertj@gmx.net>
4090
4091         * marshal.c (mono_marshal_get_thunk_invoke_wrapper):
4092         support for value types. See #386415.
4093
4094         * object.c: comments.
4095
4096         Code is contributed under MIT/X11 license.
4097
4098 2008-05-05  Martin Baulig  <martin@ximian.com>
4099
4100         * debug-mono-symfile.h
4101         (MONO_SYMBOL_FILE_COMPATIBILITY_VERSION): Removed; dropped support
4102         for old pre-terrania symbol files.
4103
4104 2008-05-05  Andreas Färber  <andreas.faerber@web.de>
4105
4106         * mono-config.c: Add ppc64 architecture.
4107
4108         Code is contributed under MIT/X11 license.
4109
4110 2008-05-05  Andreas Färber  <andreas.faerber@web.de>
4111
4112         * object.c (mono_create_ftnptr, mono_get_addr_from_ftnptr):
4113           PPC64 uses function descriptors as well.
4114
4115         Code is contributed under MIT/X11 license.
4116
4117 2008-05-04  Zoltan Varga  <vargaz@gmail.com>
4118
4119         * object.c (compute_class_bitmap): Ignore literal static fields.
4120
4121         * sgen-gc.c (mono_gc_base_init): Print some help when the MONO_GC_DEBUG env
4122         var has an invalid format.
4123         (describe_ptr): Add some sanity checks for the vtable.
4124         (add_nursery_frag): Clear unused nursery fragments.
4125         (major_collection): Clear all remaining nursery fragments.
4126
4127 2008-05-03  Robert Jordan  <robertj@gmx.net>
4128
4129         * image.c, metadata-internals.h: add thunk_invoke_cache.
4130
4131         * marshal.c, marshal.h: implement
4132         mono_marshal_get_thunk_invoke_wrapper ().
4133
4134         * object.c, object.h: implement mono_method_get_unmanaged_thunk ().
4135
4136         Code is contributed under MIT/X11 license.
4137
4138 2008-05-02 Rodrigo Kumpera  <rkumpera@novell.com>
4139
4140         * verify.c (do_leave): Empty the stack.
4141
4142 2008-05-02 Rodrigo Kumpera  <rkumpera@novell.com>
4143
4144         * class.c (mono_class_is_assignable_from): Variance
4145         doesn't work between reference and value types. For example,
4146         given type C<T+>, C<int32> is not assignable to C<object>.
4147         Break the argument checking loop on first error. 
4148
4149 2008-05-02  Atsushi Enomoto  <atsushi@ximian.com>
4150
4151         * icall.c : base64_to_byte_array() needs some more strict
4152           check for sequence of '=' characters. Patch by Santa
4153           Marta (http://deee.g.hatena.ne.jp/santamarta).
4154
4155           Contributed under MIT/X11 license.
4156           (see http://www.lingr.com/room/mono-jp/archives/2008/04/20)
4157
4158 2008-05-02  Jonathan Chambers  <joncham@gmail.com>
4159
4160         * domain.c: Disable LoadLibrary support to fix Win32 build.
4161
4162         Code is contributed under MIT/X11 license.
4163
4164 2008-05-02  Zoltan Varga  <vargaz@gmail.com>
4165
4166         * sgen-gc.c: Add support for clearing nursery memory when a tlab is allocated,
4167         to help with cache behaviour.
4168
4169 2008-05-01  Miguel de Icaza  <miguel@novell.com>
4170
4171         * appdomain.c (mono_domain_from_appdomain): Add new accessor
4172         method. 
4173
4174 2008-05-01  Zoltan Varga  <vargaz@gmail.com>
4175
4176         * sgen-gc.c: Implement thread-local allocation and a managed allocation routine.
4177
4178 2008-05-01  Dick Porter  <dick@ximian.com>
4179
4180         * process.c (process_get_fileversion): Only pass 16 bits of
4181         language ID to VerLanguageName.  Fixes bug 381204.
4182
4183 2008-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
4184
4185         * verify.c (mono_method_verify): Fix the comparison
4186         operator for code bounds check.
4187
4188 2008-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
4189
4190         * verify.c (mono_method_verify): Check the bounds of
4191         all access of the code array.
4192
4193 2008-04-29  Kornél Pál  <kornelpal@gmail.com>
4194
4195         * appdomain.c: Use HAVE_SYS_UTIME_H that fixes MSVC build.
4196
4197 2008-04-28  Zoltan Varga  <vargaz@gmail.com>
4198
4199         * image.c (mono_image_strong_name_position): Fix return value when the rva is
4200         not valid.
4201
4202 2008-04-28  Kornél Pál  <kornelpal@gmail.com>
4203
4204         * loader.c (mono_get_method_from_token, mono_method_signature): Add
4205         support for METHOD_IMPL_ATTRIBUTE_NATIVE.
4206         * domain.c (mono_init_internal): Load and fixup mscoree.dll on startup and
4207         fixup main EXE images when using mono.exe for mixed-mode assembly support.
4208         * domain-internals.h: Add MonoLoadFunc, mono_install_runtime_load and
4209         mono_runtime_load.
4210         * appdomain.c: Add mono_install_runtime_load, mono_runtime_load to support
4211         runtime initialization from metadata.
4212         * assembly.c: Remove obsolete ceGetModuleFileNameA.
4213         (mono_set_rootdir): Use mono_get_module_file_name.
4214         (mono_assembly_load_from_full): Call mono_image_fixup_vtable for module
4215         handles.
4216         * cil-coff.h: Add MonoVTableFixup. Update mono_cli_rva_image_map signature.
4217         * metadata-internals.h: Add is_module_handle to _MonoImage on Windows.
4218         * image.c (mono_cli_rva_image_map): Use MonoImage instead of
4219         MonoCLIImageInfo. Add support for module handles.
4220         (load_cli_header): Update mono_cli_rva_image_map signature.
4221         (load_metadata_ptrs): Update mono_cli_rva_image_map signature.
4222         (mono_image_strong_name_position): Use mono_cli_rva_image_map.
4223         (mono_image_rva_map): Add support for module handles.
4224         (mono_image_ensure_section_idx): Add support for module handles.
4225         (mono_image_close): Add support for module handles.
4226         (do_load_header): Add support for module handles.
4227         (mono_image_open_from_module_handle): New function for internal use.
4228         (mono_image_open_full): Load normal images using LoadLibrary on Windows.
4229         (mono_image_load_module): Call mono_image_fixup_vtable for module handles.
4230         (mono_image_load_file_for_image): Call mono_image_fixup_vtable for module
4231         handles.
4232         (mono_image_fixup_vtable): New function for mixed-mode assembly support.
4233         * image.h: Add mono_image_fixup_vtable.
4234         * coree.c: New file for mscoree.dll functions and mixed-mode assembly
4235         support.
4236         * coree.h: New file.
4237         * marshal.c (mono_marshal_get_native_wrapper): Throw exception for
4238         unsupported native code.
4239         (mono_marshal_set_callconv_from_modopt): New function splitted from
4240         mono_marshal_get_managed_wrapper.
4241         (mono_marshal_get_managed_wrapper): Use
4242         mono_marshal_set_callconv_from_modopt.
4243         (mono_marshal_get_vtfixup_ftnptr): New function for mixed-mode assembly support.
4244         * marshal.h: Add mono_marshal_get_vtfixup_ftnptr.
4245         * gc.c (mono_gc_init): Don't wait for the finalizer thread on Windows because
4246         that results in a deadlock when the runtime is loaded in _CorDllMain.
4247         * Makefile.am: Add coree.c and coree.h.
4248
4249         Contributed under MIT/X11 license.
4250
4251 2008-04-28  Mark Probst  <mark.probst@gmail.com>
4252
4253         * generic-sharing.c: Search for type arguments in array element
4254         types as well.
4255
4256 2008-04-28  Mark Probst  <mark.probst@gmail.com>
4257
4258         * class-internals.h, generic-sharing.c: New, small runtime generic context.
4259
4260         * metadata-internals.h, domain.c, image.c: Less bookkeeping is required for the new RGCTX.
4261
4262         * object.c: Don't setup the RGCTX when the vtable is created,
4263         because we're setting it up lazily now.
4264
4265 2008-04-26  Zoltan Varga  <vargaz@gmail.com>
4266
4267         * sgen-gc.c: Make the 'desc' variables an mword instead of a guint32 to fix 
4268         64 bit support.
4269
4270 2008-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
4271
4272         * verify.c (verify_class_for_overlapping_reference_fields): 
4273         If class is under fulltrust allow reference types to overllap
4274         if they have the same RVA.
4275
4276 2008-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
4277
4278         * pedump.c: Added new flag valid-only, that makes the verifier
4279         behaves just like --security=validil. It won't fail type load
4280         due to unverifiable restrictions.
4281
4282 2008-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
4283
4284         * class-internals.h (struct MonoMethod): Added a verification_success
4285         field to cache verifier executions. Reduced MonoMethod:slot size by
4286         one bit.
4287
4288 2008-04-23  Zoltan Varga  <vargaz@gmail.com>
4289
4290         * sgen-gc.c (OBJ_RUN_LEN_SIZE): Make this and other macros take a 'desc' argument
4291         instead of a 'vt' argument to save an indirection and to allow these to be used
4292         for valuetypes.
4293         (scan_vtype): New helper function to scan an area using a gc descriptor.
4294         (mono_gc_wbarrier_value_copy): Implement this.
4295         (handle_remset): Add support for REMSET_VTYPE.
4296         (find_in_remset_loc): Ditto.
4297         (mono_gc_base_init): Allow some debugging options to be controlled through the
4298         use of the MONO_GC_DEBUG env variable.
4299         (mono_gc_alloc_obj): Add support the 'collect-before-allocs' debug option.
4300         (collect_nursery): Add support for the 'check-at-minor-collection' debug option.
4301
4302 2008-04-23  Martin Baulig  <martin@ximian.com>
4303
4304         * domain.c (mono_domain_create): Move the call to
4305         mono_debug_domain_create() down, after allocating the domain id.
4306
4307 2008-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
4308
4309         verify.c (verify_class_for_overlapping_reference_fields): Skip
4310         static fields while verifying for overlapping fields as they
4311         don't matter at all.
4312
4313 2008-04-23  Marek Habersack  <mhabersack@novell.com>
4314
4315         * domain-internals.h: added a declaration of
4316         mono_make_shadow_copy.
4317
4318         * assembly.c (mono_assembly_open_full): shadow copying of
4319         assemblies moved to here, so that all the assemblies within the
4320         application domain's private binary directories can be
4321         processed. Fixes bug #380546
4322
4323         * appdomain.c (mono_make_shadow_copy): make_shadow_copy renamed to
4324         mono_make_shadow_copy and made non-static. The decision whether
4325         to shadow-copy an assembly is made based on its location - it's
4326         copied if it's in one of the private application domain binary
4327         directories and its different to the target file in the shadow
4328         directory. Fixes bug #380546
4329
4330 2008-04-22  Zoltan Varga  <vargaz@gmail.com>
4331
4332         * reflection.c (fixup_method): Handle {Method|Constructor}OnTypeBuilderInst.
4333
4334         * object-internals.h: Add MonoReflection{Method|Constructor}OnTypeBuilderInst
4335         types.
4336
4337         * reflection.c (mono_image_create_token): Handle 
4338         Method/ConstructorOnTypeBuilderInst.
4339         (resolve_object): Ditto.
4340         (inflate_mono_method): Receive the inflated class instead of a MonoGenericClass
4341         so it can be called from resolve_object. Also handle the case when the inflated
4342         class already has its methods setup.
4343
4344 2008-04-21  Martin Baulig  <martin@ximian.com>
4345
4346         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 69.
4347
4348 2008-04-20  Geoff Norton  <gnorton@novell.com>
4349
4350         * icall.c: Fix the _NSGetEnviron define to prevent an impropoer
4351         pointer dereference.
4352
4353 2008-04-15  Marek Habersack  <mhabersack@novell.com>
4354
4355         * appdomain.c (try_load_from): if IOMAP is in effect, call the
4356         portability API to look up the assembly file. Fixes behavior in
4357         situations when the application has a bin/ directory, but the
4358         assembly search patch refers to Bin/ (and thus the requested file
4359         name is Bin/SomeLibrary.dll). Fixes bug #379888
4360
4361 2008-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
4362
4363         verify.c (mono_type_is_generic_argument): Extracted this check
4364         from a dozen places to here.
4365
4366         verify.c: Fixed all issues related to boxing generic arguments
4367         and their constraints.
4368
4369 2008-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
4370
4371         verify.c (mono_class_interface_implements_interface): Fix win32 build.
4372
4373 2008-04-14  Zoltan Varga  <vargaz@gmail.com>
4374
4375         * reflection.c (mono_custom_attrs_construct): Fix crash when the cattr type
4376         isn't finished yet. Fixes #363447.
4377
4378 2008-04-13  Zoltan Varga  <vargaz@gmail.com>
4379
4380         * class.c (mono_bounded_array_class_get): Fix the name of bounded array types.
4381         Fixes #346419.
4382
4383 2008-04-13  Jb Evain  <jbevain@novell.com>
4384
4385         * domain.c: update the 2.1 profile versions.
4386         Merged from the Moonlight 2 branch.
4387
4388 2008-04-12  Zoltan Varga  <vargaz@gmail.com>
4389
4390         * assembly.c (mono_assembly_load_from_full): Do the check for loading other
4391         mscorlibs for the non-refonly case as well.
4392
4393         * image.c (do_mono_image_load): Remove the mscorlib check, it is already done
4394         in mono_assembly_load_from_full (). Fixes #378924.
4395
4396 2008-04-11  Geoff Norton  <gnorton@novell.com>
4397
4398         * icall.c: The global extern environ doesn't exist on Mac.  We
4399         need to call NSGetEnviron instead.
4400
4401 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
4402
4403         verify.c: Add generic method constraint verification.
4404
4405 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
4406
4407         class.c (mono_class_inflate_generic_method_full): Add a long
4408         explanation to the is_mb_open hack. Remove the FIXME.
4409
4410 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
4411
4412         * verify.c (mono_method_verify): Mark all unknown opcodes
4413         as invalid. Mark jmp as unverifiable.
4414
4415 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
4416
4417         * verify.c: Add code to do type constraint verification on class instances.
4418
4419         * verify.c (mono_verifier_verify_class): Use the type constraint 
4420         verification code.
4421
4422 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
4423
4424         * class.c (mono_class_get_field_default_value): Don't pass cindex
4425         as hint to mono_metadata_get_constant_index. The local is not initialized
4426         and should contain garbage most of the time. This could only work
4427         with a lot of luck.
4428
4429 2008-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
4430
4431         * tokentype.h: Add MONO_TOKEN_GENERIC_PARAM.
4432
4433 2008-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
4434
4435         * class-internals.h: Add generic_param_token to MonoClass::sizes union.
4436
4437         * class.c (mono_class_from_generic_parameter): Save the token of the
4438         generic param in MonoClass::sizes.generic_param_token.
4439
4440         * reflection.c (mono_custom_attrs_from_class): If the class type is
4441         VAR or MVAR retrieve the attributes of the generic param.
4442
4443 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
4444
4445         * class.c (mono_class_init): Do class verification if the verifier
4446         is enabled.
4447
4448 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
4449
4450         * verify-internal.h: Added mono_verifier_verify_class.
4451
4452         * verify.c: Added mono_verifier_verify_class. It checks for
4453         classes with explicit layout that have overlapping reference fields.
4454
4455         * pedump.c: Init the verifier state prior to verification. Fixed
4456         command line arguments.
4457
4458 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
4459
4460         * Makefile.am: Added verify-internals.h, hopefully fix the build.
4461
4462 2008-04-08  Zoltan Varga  <vargaz@gmail.com>
4463
4464         * verify-internals.h: Fix a warning.
4465
4466 2008-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
4467
4468         * verify-internals.h: New header with the verifier configuration
4469         extracted from mini.c.
4470
4471         * verify.c: Implemented the new functions exported by verify-internals.h.
4472
4473 2008-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
4474
4475         * verify.c: Add proper verification of ckfinite.
4476
4477 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
4478
4479         * verify.c (do_conversion): Improved error message to something
4480         more meanfull.
4481
4482         * verify.c (check_is_valid_type_for_field_ops): Fix to work
4483         with primitive types.
4484
4485 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
4486
4487         * verify.c: Added tail prefix checking. Marked icall
4488         as unverifible.
4489
4490 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
4491
4492         * verify.c: Fix the detection of branches to the middle
4493         of an instruction.
4494
4495 2008-04-03 Rodrigo Kumpera  <rkumpera@novell.com>
4496
4497         * verify.c: Implemented verification of volatile. and
4498         unaligned. prefix. Check if a type is valid after retrieving it.
4499
4500 2008-04-01  Dick Porter  <dick@ximian.com>
4501
4502         * process.c (process_get_fileversion): If there's no string block,
4503         set the file language to en_US.  Fixes the other new part of bug
4504         374600.
4505
4506 2008-03-29 Rodrigo Kumpera  <rkumpera@novell.com>
4507
4508         * class.c: New functions mono_method_can_access_field_full and
4509         mono_method_can_access_method_full. They perform type visibility
4510         and type site check.
4511
4512         * class-internal.h: Added exported functions.
4513
4514         * verify.c: Use new functions to implement proper visibility checks.
4515
4516 2008-03-29  Zoltan Varga  <vargaz@gmail.com>
4517
4518         * mono-config.h: Add missing G_BEGIN_DECLS/G_END_DECLS. Fixes #375188.
4519
4520 2008-03-28  Dick Porter  <dick@ximian.com>
4521
4522         * process.c (process_get_fileversion): Use the first language ID
4523         we see, rather than insisting on an invariant language.  Fixes bug
4524         374600.
4525
4526 2008-03-28  Zoltan Varga  <vargaz@gmail.com>
4527
4528         * reflection.c (calc_section_size): Use add_stream_zero to align the size of
4529         the streams to fix reading of invalid memory later.
4530
4531         * metadata.h (MonoType): Use 'MonoTypeEnum' instead of int for the 'type' field
4532         to ease debugging.
4533
4534 2008-03-26  Zoltan Varga  <vargaz@gmail.com>
4535
4536         * marshal.c (signature_dup): Use mono_metadata_signature_alloc ().
4537         (cominterop_method_signature): Ditto. Fix the size passed to memcpy.
4538
4539 2008-03-26  Massimiliano Mantione  <massi@ximian.com>
4540         * threads.h: Added MonoThreadManageCallback type and
4541         mono_thread_set_manage_callback prototype
4542         * object-internals.h: In _MonoThread, renamed unused6 to manage_callback
4543         (used to store the mono_thread_manage callback).
4544         * threads.c: Added mono_thread_set_manage_callback, and handle
4545         "MonoThread->manage_callback" in build_wait_tids.
4546
4547 2008-03-26  Dick Porter  <dick@ximian.com>
4548
4549         * process.c (process_get_fileversion): Set FileVersionInfo strings
4550         to Empty when the resource doesn't have the particular info.
4551         Fixes bug 355717.
4552
4553 2008-03-25 Rodrigo Kumpera  <rkumpera@novell.com>
4554
4555         * verify.c (mono_method_verify): Proper prefix validation.
4556
4557 2008-03-25  Zoltan Varga  <vargaz@gmail.com>
4558
4559         * icall.c (ves_icall_InternalInvoke): Return exceptions thrown by the icall
4560         itself in a separate argument instead of throwing them. Fixes #373448.
4561
4562         * appdomain.c: Bump corlib version.
4563
4564 2008-03-24 Rodrigo Kumpera  <rkumpera@novell.com>
4565
4566         * verify.c: Implemented readonly prefix and verify controled mutability pointers.
4567
4568 2008-03-20  Kornél Pál  <kornelpal@gmail.com>
4569
4570         * file-io.c, filewatcher.c, threadpool.c, threads.c: Removed Windows
4571         version macros.
4572
4573 2008-03-20  Mark Probst  <mark.probst@gmail.com>
4574
4575         * generic-sharing.c, class-internals.h: Code for putting
4576         reflection types into the runtime generic context.
4577
4578 2008-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
4579
4580         * icall.c (ves_icall_get_method_info): Return correct values for the call convention.
4581         Fixes #340662. 
4582
4583
4584 2008-03-17 Rodrigo Kumpera  <rkumpera@novell.com>
4585
4586         * verify.c (VerifyContext): Added instruction prefix data to the struct.
4587
4588         * verify.c (is_compatible_boxed_valuetype): Don't check if the type is a valuetype, been boxed is enough.
4589
4590         * verify.c (do_invoke): Support constrained callvirt form. Grouped similar checks together.
4591
4592         * verify.c (do_cast): Let the result value keep the boxed status.
4593
4594         * verify.c (mono_method_verify): Add proper support for prefixed and implement contrained.
4595
4596 2008-03-17  Jb Evain  <jbevain@novell.com>
4597
4598         * reflection.c: when running on a 2.0 runtime, emit
4599         unconditionally the #~ header version as 2.0, and the
4600         CLI header version as 2.5, for symmetry's sake with csc.
4601
4602 2008-03-16  Zoltan Varga  <vargaz@gmail.com>
4603
4604         * class.c: Remove the unused cache_interface_offsets stuff.
4605
4606         * class.c loader.c domain.c verify.c metadata.c debug-helpers.c threadpool.c
4607         profiler.c: Fix warnings.
4608
4609 2008-03-16  Mark Probst  <mark.probst@gmail.com>
4610
4611         * generic-sharing.c, class-internals.h: Support for putting
4612         methods into the runtime generic context.
4613
4614 2008-03-16  Zoltan Varga  <vargaz@gmail.com>
4615
4616         * class.c (mono_class_setup_fields): Ignore calls made to this function for
4617         classes which are generic instances of not-yet finished typebuilders. Fixes
4618         #351172.
4619
4620         * reflection.c (fixup_method): Add support for FieldOnTypeBuilderInst.
4621
4622 2008-03-15  Zoltan Varga  <vargaz@gmail.com>
4623
4624         * metadata-internals.h (MonoDynamicImage): Add 'generic_def_objects' hash table.
4625
4626         * class-internals.h (MonoMethodInflated): Remove the rarely used reflection_info
4627         field, replace it with a hash table in MonoDynamicImage.
4628
4629         * reflection.c (inflate_mono_method): Access the generic definition object from
4630         image->generic_def_objects instead of imethod->reflection_info.
4631
4632         * reflection.c (mono_reflection_bind_generic_method_parameters): Ditto. 
4633
4634         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition): Ditto.
4635         
4636         * image.c (mono_image_close): Move the dynamic image freeing code to a separate
4637         function in reflection.c so it is easier to keep in sync with the dynamic image
4638         creation code.
4639
4640         * reflection.c (mono_dynamic_image_free): New internal function, extracted from
4641         mono_image_close ().
4642
4643 2008-03-15  Mark Probst  <mark.probst@gmail.com>
4644
4645         * class.c (mono_class_generic_sharing_enabled): Disable generic
4646         sharing for all architectures except AMD64 and x86 to fix build.
4647
4648 2008-03-14 Rodrigo Kumpera  <rkumpera@novell.com>
4649
4650         * verify.c: Use the generic definition MonoGenericContext when available.
4651         Remove code for checking generics instance compatibility in favor of
4652         mono_class_is_assignable_from.
4653
4654 2008-03-14  Mark Probst  <mark.probst@gmail.com>
4655
4656         * marshal.c, marshal.h, metadata-internals.h, image.c,
4657         wrapper-types.h: New wrapper for invoking a shared static method
4658         without having to pass the runtime generic context argument.
4659
4660 2008-03-14 Rodrigo Kumpera  <rkumpera@novell.com>
4661
4662         * icall-def.h: Add missing function PerformanceCounterCategory::GetInstanceNames.
4663
4664 2008-03-14  Zoltan Varga  <vargaz@gmail.com>
4665
4666         * reflection.c (mono_image_get_field_on_inst_token): Add caching.
4667         
4668         * reflection.c (mono_image_get_field_on_inst_token): New helper function to
4669         create a token from a FieldOnTypeBuilderInst.
4670         (mono_image_create_token): Handle FieldOnTypeBuilderInst.
4671         (resolve_object): Ditto.
4672
4673         * object-internals.h (MonoReflectionFieldOnTypeBuilderInst): New structure
4674         mirroring System.Reflection.Emit.FieldOnTypeBuilderInst.
4675
4676 2008-03-14  Martin Baulig  <martin@ximian.com>
4677
4678         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 68.
4679
4680         * debug-mono-symfile.h
4681         (MONO_SYMBOL_FILE_VERSION): Bump to 41.
4682         (MONO_SYMBOL_FILE_COMPATIBILITY_VERSION): New #define.
4683
4684 2008-03-10  Martin Baulig  <martin@ximian.com>
4685
4686         * debug-mono-symfile.h
4687         (MonoSymbolFileMethodAddress): Removed `num_lexical_blocks' and
4688         `lexical_block_table_offset'.
4689         (MonoDebugMethodInfo): Removed `num_lexical_blocks' and
4690         `lexical_blocks'.
4691         (MonoSymbolFile): Added `version'.
4692
4693         * mono-debug.h
4694         (MonoDebugLexicalBlockEntry): Removed.
4695         (MonoDebugMethodJitInfo): Removed `num_lexical_blocks' and
4696         `lexical_blocks'.
4697
4698         * mono-debug.c (mono_debug_add_method): Don't compute lexical
4699         blocks here; the debugger now does this internally.
4700
4701 2008-02-27  Martin Baulig  <martin@ximian.com>
4702
4703         * object.c (mono_runtime_exec_main): Call
4704         `mono_debugger_event (MONO_DEBUGGER_EVENT_REACHED_MAIN)' and
4705         `mono_debugger_event (MONO_DEBUGGER_EVENT_MAIN_EXITED)' here.
4706
4707 2008-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
4708
4709         * verify.c (verify_type_compatibility_full): Allow native int to be converted
4710         to native pointer in non-strict mode. Required to "(IntPtr)null" work.
4711
4712 2008-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
4713
4714         * verify.c (verify_ldftn_delegate): Accept a sealed type when using
4715         ldftn with a virtual method.
4716
4717 2008-03-13  Geoff Norton  <gnorton@novell.com>
4718
4719         * decimal.c:  Only include memory.h if the platform has it.
4720
4721 Wed Mar 12 12:11:06 CET 2008 Paolo Molaro <lupus@ximian.com>
4722
4723         * assembly.c, class.c, metadata-internals.h: make sure public key
4724         tokesns are compared in a case-insensitive way. Also, all
4725         the lookups in the GAC use a lowercase public key token
4726         (gaacutil already does the lowercasing on install). Fixes
4727         bug #369541.
4728
4729 2008-03-11 Rodrigo Kumpera  <rkumpera@novell.com>
4730
4731         * verify.c (mono_delegate_signature_equal): Do proper variance check on arguments
4732         and return value.
4733
4734 Tue Mar 11 17:41:38 CET 2008 Paolo Molaro <lupus@ximian.com>
4735
4736         * image.c: when someone loads a mscorlib from a file, return the
4737         currently loaded mscorlib (fixes bug #369253).
4738
4739 Tue Mar 11 16:47:32 CET 2008 Paolo Molaro <lupus@ximian.com>
4740
4741         * class.c: handle types with no parents by forcing them to have
4742         System.Object as a parent and marking them as broken (this currently
4743         allows the first part of bug #369173 to work as well, likely because
4744         we don't check for typeload exceptions everywhere yet).
4745
4746 Tue Mar 11 15:23:54 CET 2008 Paolo Molaro <lupus@ximian.com>
4747
4748         * class.c: more complete check that types belong to corlib
4749         (fixes second part of bug #369173).
4750
4751 2007-03-10  Bill Holmes  <billholmes54@gmail.com>
4752
4753         * generic-sharing.c:  Including glib.h for the MSVC builds to define
4754           "inline" to "__inline" before including mono-membar.h.
4755           
4756         * mono-perfcounters.c:  Adding HAVE_SYS_TIME_H check for MSVC builds.
4757           Rename "Unknown" to "CatTypeUnknown" to avoid name collisions for 
4758           MSVC builds.
4759
4760         Contributed under MIT/X11 license.
4761
4762 2008-03-10 Rodrigo Kumpera  <rkumpera@novell.com>
4763
4764         * verify.c (do_invoke_method): Remove return type validation.
4765
4766         * verify.c (do_ret): Do return type validation at return site instead of
4767         call site.
4768
4769 2008-03-10 Rodrigo Kumpera  <rkumpera@novell.com>
4770
4771         * verify.c (do_invoke_method): Mark callvirt to static methods unverifiable.
4772
4773         * verify.c: Some todos cleaned and improved a few error messages.
4774
4775 2008-03-08  Zoltan Varga  <vargaz@gmail.com>
4776
4777         * class.c (mono_class_setup_mono_type): Improve the test for corlib.
4778
4779 2008-03-07  Zoltan Varga  <vargaz@gmail.com>
4780
4781         * class.c (mono_class_setup_mono_type): Handle types whose name clashes with
4782         system types correctly.
4783
4784         * exception.h exception.c (mono_exception_from_token_two_strings): New helper
4785         function.
4786
4787 2008-03-06  Zoltan Varga  <vargaz@gmail.com>
4788
4789         * assembly.c (build_assembly_name): Fix a warning.
4790
4791 Thu Mar 6 19:43:41 CET 2008 Paolo Molaro <lupus@ximian.com>
4792
4793         * marshal.c: ldfld_remote and stfld_remote needs just one wrapper as
4794         the called function takes an object type argument. Fixes storing or
4795         valuetypes across remoting as well as reducing memory usage.
4796         * image.c, metadata-internals.h: remove now unused ldfld_remote and
4797         stfld_remote wrapper caches.
4798
4799 2008-03-06  Zoltan Varga  <vargaz@gmail.com>
4800
4801         * icall.c (mono_lookup_internal_call): Update the exception message when an icall
4802         is not found.
4803
4804         * reflection.c (mono_image_register_token): New helper function to save
4805         a token->object mapping.        
4806
4807         * icall.c (ves_icall_ModuleBuilder_RegisterToken): New icall to access it from
4808         managed code.
4809
4810         * reflection.c (_mono_reflection_parse_type): Distinguish between vectors and
4811         one dimension arrays. Fixes #367670.
4812         (mono_reflection_get_type_internal): Ditto.
4813
4814 Tue Mar 4 19:04:02 CET 2008 Paolo Molaro <lupus@ximian.com>
4815
4816         * marshal.c: mono_load_remote_field_new() always returns object.
4817         so use the proper signature (fixes bug #366445).
4818
4819 2008-03-04  Zoltan Varga  <vargaz@gmail.com>
4820         
4821         * class-internals.h (MonoMethod): Remove unused uses_this flag, 
4822         add an 'inline_failure' flag instead.
4823
4824 2008-03-04  Mark Probst  <mark.probst@gmail.com>
4825
4826         * domain-internals.h, domain.c: Replaced MonoGenericSharingContext
4827         with a new structure, MonoGenericJitInfo, in the MonoJitInfo.  It
4828         contains the location of "this", used for exception handling.
4829
4830 2008-03-04  Zoltan Varga  <vargaz@gmail.com>
4831
4832         * class.c (mono_class_layout_fields): Set the min alignment of small structs to
4833         their size on all platforms for perf reasons.
4834
4835 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
4836
4837         * reflection.h: Move mono_reflection_is_valid_dynamic_token to
4838         object-internal.h
4839
4840         * object-internal.h: Same.
4841
4842 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
4843
4844         * reflection.h: Fix the build I just broke.
4845
4846 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
4847
4848         * reflection.c (mono_reflection_is_valid_dynamic_token): New function,
4849         Test if a token is valid, this remove explicit usage of 
4850         MonoDynamicImage::tokens from the verifier code.
4851
4852         * reflection.h: Added mono_reflection_is_valid_dynamic_token.
4853
4854         * verify.c (token_bounds_check): Use mono_reflection_is_valid_dynamic_token
4855         instead of direct access to MonoDynamicImage::tokens.
4856
4857 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
4858
4859         * verify.c (token_bounds_check): Fix the build I just broke.
4860
4861 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
4862
4863         * verify.c (token_bounds_check): Fix bounds check for dynamic images.
4864
4865         * verify.c (verifier_load_method): Fixed the errors message.
4866
4867         * verify.c (mono_method_verify): Fixed a debug message.
4868
4869 Thu Feb 28 19:49:45 CET 2008 Paolo Molaro <lupus@ximian.com>
4870
4871         * icall-def.h, domain.c, mono-perfcounters-def.h, mono-perfcounters.c,
4872         mono-perfcounters.h, class-internals.h: support for predefined
4873         writable counters, query of categories and counters, bugfixes.
4874
4875 2008-02-28 Rodrigo Kumpera  <rkumpera@novell.com>
4876
4877         * verify.c (do_refanytype): Verify the refanytype opcode.
4878
4879         * verify.c (mono_method_verify): Use do_refanytype.
4880
4881 2008-02-28 Rodrigo Kumpera  <rkumpera@novell.com>
4882
4883         * verify.c (do_mkrefany): Verify the mkrefany opcode.
4884
4885         * verify.c (mono_method_verify): Use do_mkrefany.
4886
4887 Wed Feb 27 19:49:16 CET 2008 Paolo Molaro <lupus@ximian.com>
4888
4889         * Makefile.am, icall-def.h, icall.c, mono-perfcounters-def.h,
4890         mono-perfcounters.c, mono-perfcounters.h: basic performance counter
4891         implementation.
4892
4893 2008-02-27  Zoltan Varga  <vargaz@gmail.com>
4894
4895         * marshal.c (mono_marshal_get_synchronized_wrapper): Fix the code which throws
4896         the type load exception.
4897
4898 2008-02-27 Rodrigo Kumpera  <rkumpera@novell.com>
4899
4900         * verify.c: Added a few FIXME for method signatures
4901
4902         * verify.c (do_invoke_method): Use mono_method_get_signature_full instead
4903         of mono_method_get_signature and get vararg call working. Removed unused
4904         checks for return value.
4905
4906         * verify.c (do_refanyval): Verify the refanyval opcode.
4907
4908         * verify.c (mono_method_verify): Implemented verification of arglist and
4909         use do_refanyval.
4910
4911 2008-02-27  Zoltan Varga  <vargaz@gmail.com>
4912
4913         * class.c (mono_class_setup_methods): Move the check for synchronized methods on
4914         vtypes to marshal.c.
4915
4916         * marshal.c (mono_marshal_get_synchronized_wrapper): Do the vtype check here so
4917         it works for AOT as well.
4918
4919 Tue Feb 26 17:46:32 CET 2008 Paolo Molaro <lupus@ximian.com>
4920
4921         * monitor.c, threads.c, threadpool.c: replace the use of GetTickCount ()
4922         with mono_msec_ticks () which is monotonic and doesn't cause bugs when
4923         the system time is adjusted.
4924
4925 Tue Feb 26 17:40:10 CET 2008 Paolo Molaro <lupus@ximian.com>
4926
4927         * icall.c, icall-def.h: use the new time functions (fixes the
4928         non-monotonic behaviour of TickCount).
4929
4930 2008-02-26  Zoltan Varga  <vargaz@gmail.com>
4931
4932         * reflection.c (mono_custom_attrs_from_builders): Revert the last change as
4933         it breaks the build.
4934         
4935         * reflection.c (mono_custom_attrs_from_builders): Assert instead of a crash if the
4936         cattr is not finished yet.
4937
4938 2008-02-25 Rodrigo Kumpera  <rkumpera@novell.com>
4939
4940         * verify.c: Proper token validation for field, method and type.
4941
4942 2008-02-25 Rodrigo Kumpera  <rkumpera@novell.com>
4943
4944         * loader.c (field_from_memberref): Generate a loader error if the type is not found.
4945
4946         * loader.c (method_from_memberref): Generate type load error instead of method missing
4947         if the type is not found.
4948
4949 2008-02-23  Zoltan Varga  <vargaz@gmail.com>
4950
4951         * marshal.c (mono_marshal_emit_managed_wrapper): Avoid generating invalid IL if
4952         some of the conversions caused the generation of a marshal directive exception.
4953
4954 2008-02-21 Rodrigo Kumpera  <rkumpera@novell.com>
4955
4956         verify.c: Report which exception should be thrown by the JIT.
4957         Added a lot of FIXME notes.
4958
4959 2008-02-22  Mark Probst  <mark.probst@gmail.com>
4960
4961         * generic-sharing.c: Runtime generic context slots are not
4962         instantiated on init anymore.  Instead, provide function to do the
4963         instantiating on demand.
4964
4965         * class-internals.h: Added vtable to runtime generic context.
4966         Macros for encoding direct and indirect slot offsets in one
4967         guint32.
4968
4969 2008-02-21  Mark Probst  <mark.probst@gmail.com>
4970
4971         * object.c, generic-sharing.c: Moved some generic sharing code
4972         from object.c to generic-sharing.c.
4973
4974         * generic-sharing.c: Added support for extensible runtime generic
4975         context.
4976
4977         * metadata-internals.h: Two new hash tables in MonoImage for
4978         extensible runtime generic context support.
4979
4980         * domain.c: Unregister generic vtables upon domain unloading.
4981
4982         * image.c: Destroy new hash tables upon image unloading.
4983
4984         * metadata.c: Unregister generic subclasses upon image unloading.
4985
4986         * class-internals.h: New data structure for runtime generic
4987         context template.  New fields in the runtime generic context for
4988         extensible part.
4989
4990         * Makefile.am: Added generic-sharing.c.
4991
4992 2008-02-21 Rodrigo Kumpera  <rkumpera@novell.com>
4993
4994         icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): If
4995         there is a pending loader exception, raise it.
4996
4997         icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): 
4998         same.
4999
5000         icall.c (ves_icall_System_Reflection_Module_ResolveFieldToken): 
5001         same.
5002
5003         Fixes #363450.
5004
5005 2008-02-20  Zoltan Varga  <vargaz@gmail.com>
5006
5007         * icall.c (ves_icall_Type_GetPacking): Handle dynamic types.
5008
5009         * assembly.c (mono_assembly_load_from_full): Fix a leak in the previous patch.
5010         
5011         * assembly.c (mono_assembly_load_from_full): Return the non-refonly corlib for
5012         ref-only requests for compatibility with MS.
5013
5014 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
5015
5016         * reflection.c (mono_custom_attrs_from_method): Don't silently
5017         return an empty list for generic method instances.
5018         (mono_custom_attrs_from_param): Likewise.
5019
5020 2008-02-20  Rodrigo Kumpera  <rkumpera@novell.com>
5021             Raja R Harinath  <harinath@hurrynot.org>
5022
5023         Fix #354757
5024         * class-internals.h (struct _MonoMethodInflated.is_mb_open): Add.
5025         * class.c (mono_class_inflate_generic_method_full): Initialize it
5026         when a fully-open method is instantiated.
5027         * metadata.c (inflated_method_equal, inflated_method_hash): Update
5028         to new field.
5029         * reflection.c (inflate_mono_method): Don't create a temporary context.
5030
5031 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
5032
5033         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition):
5034         Compute correct value, to prepare for imethod->reflection_info going away.
5035
5036 2008-02-19  Zoltan Varga  <vargaz@gmail.com>
5037
5038         * class.c (mono_class_setup_vtable_general): Ignore static methods in interfaces.
5039
5040 2008-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
5041
5042         * verify.c: Implement skip visibility flag.
5043
5044 2008-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
5045
5046         * verify.h: Added MONO_VERIFY_SKIP_VISIBILITY and struct MonoVerifyInfoExtended
5047         which contains an extra field to tell the kind of exception that should be thrown.
5048
5049         * verify.c: Use MonoVerifyInfoExtended instead of MonoVerifyInfo.
5050
5051 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
5052
5053         * loader.c (mono_method_get_param_names): Initialize 'klass' after
5054         'method' is updated.
5055
5056 2008-02-11  Zoltan Varga  <vargaz@gmail.com>
5057
5058         * class.c (mono_class_layout_fields): Set class->min_align for classes using
5059         explicit layout as well. Fixes #360375.
5060
5061 2008-02-11  Geoff Norton  <gnorton@novell.com>
5062
5063         * loader.c: Guard and dereference against inflated generic methods
5064
5065 2008-02-10  Gert Driesen  <drieseng@users.sourceforge.net>
5066
5067         * class.c: Include Retargetable spec in assembly name.
5068         * assembly.c: Always include PublicKeyToken spec in assembly name
5069         (with value "null" if assembly is not signed), and include
5070         Retargetable spec.
5071         * icall-def.h: Added icall for Assembly.get_fullname.
5072         * icall.c: Added icall returning the fullname of an assembly.
5073
5074 2008-02-09  Zoltan Varga  <vargaz@gmail.com>
5075
5076         * class.c (mono_class_setup_vtable_general): Add a missing call to
5077         mono_class_setup_methods () which is needed in the AOT case.
5078
5079 2008-02-08 Rodrigo Kumpera  <rkumpera@novell.com>
5080
5081         * verify.c (mono_type_get_stack_name): Added. Return the name for the
5082         stack type of the given MonoType.
5083
5084         * verify.c (verify_type_compatibility_full): Handle the void type.
5085
5086         * verify.c (is_compatible_boxed_valuetype): Changed to fit the
5087         way stack merging works.
5088
5089         * verify.c (store_local): Improved verification message.
5090
5091         * verify.c (do_branch_op): If the merging is invalid, the method
5092         is unverifiable and not invalid. Improved error message.
5093
5094         * verify.c (merge_stacks): Properly merge a boxed valuetype and
5095         a reference type diferent than System.Object. Improved error
5096         message.
5097
5098 2008-02-07 Rodrigo Kumpera  <rkumpera@novell.com>
5099
5100         * verify.c (mono_type_is_enum_type): Added. Test if a type is an enum.
5101
5102         * verify.c (mono_type_get_underlying_type_any): Added. Return the underlying
5103         type of an enum even if the argument is byref.
5104
5105         * verify.c: Replace all explicit uses of enumtype and enum_basetype
5106         to calls to mono_type_is_enum_type and mono_type_get_underlying_type_any.
5107
5108         * verify.c: Check for an enum in all cases of MONO_TYPE_GENERICINST.
5109
5110         *verify.c (verify_type_compatibility_full): Make enum types
5111         compatible with their base types.
5112
5113         * verify.c (is_compatible_boxed_valuetype): Added. Check if both
5114         types are compatible for the special case of a boxed valuetype and
5115         System.Object.
5116
5117         * verify.c (verify_stack_type_compatibility): The function
5118         is_compatible_boxed_valuetype was extracted from here.
5119
5120         * verify.c (push_arg): Only set ctx->has_this_store if the method
5121         is not static.
5122
5123         * verify.c (do_ldelem): Fixed a typo in an error message and added
5124         strict check for mixing int32 and native int as the array type
5125         and ldelem type.
5126
5127         * verify.c (merge_stacks): Consider boxed valuetypes in the
5128         compatibility checks.
5129
5130 2008-02-07  Massimiliano Mantione  <massi@ximian.com>
5131         * profiler.h: (MonoGCEvent): Added start-stop the world events.
5132
5133 2008-02-06  Massimiliano Mantione  <massi@ximian.com>
5134         *class.c: use_new_interface_vtable_code: renamed the env var to have
5135         a "MONO_" prefix, and fix the logic to enable it by default.
5136
5137 2008-02-06  Massimiliano Mantione  <massi@ximian.com>
5138         *class.c:
5139         mono_class_setup_vtable_general: rewrote the way in which interface
5140         methods are added to vtables. Makes bug-77127.exe pass, and hopefully
5141         makes the code more maintainable.
5142         For now the old code is still there, and can be activated setting
5143         the env var "USE_NEW_INTERFACE_VTABLE_CODE".
5144
5145 2008-02-06 Rodrigo Kumpera  <rkumpera@novell.com>
5146
5147         * verify.c: guarded some debug functions around and #ifdef.
5148
5149         * verify.c (merge_stacks): implement proper PIII 1.8.1.3 stack state merging.
5150
5151 2008-02-06  Zoltan Varga  <vargaz@gmail.com>
5152
5153         * marshal.c (mono_marshal_get_runtime_invoke): Revert the direct_wrapper
5154         changes for now since they seem to break too many things.
5155
5156 2008-02-05  Mark Probst  <mark.probst@gmail.com>
5157
5158         * marshal.c, marshal.h (mono_marshal_find_bitfield_offset,
5159         mono_marshal_find_nonzero_bit_offset): Added macro and function
5160         for finding the byte- and bit-offset of a bitfield within a
5161         struct.
5162
5163 2008-02-05  Zoltan Varga  <vargaz@gmail.com>
5164
5165         * marshal.c (mono_marshal_get_ptr_to_struct): Make the signature non-pinvoke.
5166         (mono_marshal_get_struct_to_ptr): Ditto.
5167
5168         * marshal.c (mono_marshal_get_runtime_invoke): Fix the signature of 
5169         cctor_signature.
5170
5171 2008-02-03  Zoltan Varga  <vargaz@gmail.com>
5172
5173         * marshal.c (mono_marshal_get_runtime_invoke): Fix sharing of runtime wrappers
5174         between methods for non-corlib types.
5175
5176 2008-02-02  Geoff Norton  <gnorton@novell.com>
5177
5178         * loader.c (mono_method_get_param_names): Populate the parameter name for 
5179         generic parameters as well. (Fixes #342536)
5180
5181 2008-01-31 Rodrigo Kumpera  <rkumpera@novell.com>
5182
5183         * verify.c (is_valid_bool_arg): Allow boxed values and null literals as well.
5184
5185         * verify.c (do_invoke_method): Fix for calling with byref structs.
5186
5187         * verify.c (do_cast): push a boxed value type based on the type token and not
5188         the type of stack.
5189
5190 2008-01-31  William Holmes  <billholmes54@gmail.com>
5191
5192         * process.c (process_module_string_read): Check the size returned form 
5193           VerQueryValue to avoid out of memory exception. 
5194
5195 2008-01-30  Zoltan Varga  <vargaz@gmail.com>
5196
5197         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
5198         Handle properly modules which are not in the moduleref table. Fixes
5199         #356938.
5200
5201 2008-01-29  Zoltan Varga  <vargaz@gmail.com>
5202
5203         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): Remove
5204         the dynamic case which is now in managed code.
5205         (ves_icall_System_Reflection_Assembly_GetTypes): Ditto.
5206
5207         * marshal.c (mono_string_to_bstr): Fix a warning.
5208         (init_com_provider_ms): Ditto.
5209
5210         * appdomain.c (ves_icall_System_AppDomain_createDomain): Add some FIXMEs.
5211
5212         * exception.c (mono_get_exception_out_of_memory): New helper function.
5213
5214 2008-01-28  Jonathan Chambers  <joncham@gmail.com>
5215
5216         * marshal.c: Add support for BSTR marshalling
5217         using other COM systems.
5218
5219         Code is contributed under MIT/X11 license.
5220
5221 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
5222
5223         * object.c (mono_runtime_invoke_array): reverted previous
5224         commit as it breaks the build.
5225
5226 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
5227
5228         * object.c (mono_runtime_invoke_array): Verify arguments for
5229         invalid types. Fixes #348522.
5230
5231 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
5232
5233         * verify.c: added IL_CODE_CALL_NONFINAL_VIRTUAL to track calls to
5234         non-final virtual calls using call. 
5235
5236         * verify.c (do_invoke): fixed some TODOs.
5237
5238         * verify.c (push_arg): set has_this_store for "ldarga 0".
5239
5240 2008-01-27  Zoltan Varga  <vargaz@gmail.com>
5241
5242         * reflection.c (reflection_methodbuilder_to_mono_method): Allow DynamicMethods
5243         which belong to an inflated class. Fixes #356531.
5244
5245 2008-01-26  Robert Jordan  <robertj@gmx.net>
5246
5247         * file-io.c: Implement and use wrappers for GetFileAttribute|Ex ()
5248         which resort to FindFirstFile when a certain error condition
5249         (ERROR_SHARING_VIOLATION) occured. Fixes bug #325212.
5250         Code is contributed under MIT/X11 license.
5251
5252 2008-01-24  Jonathan Chambers  <joncham@gmail.com>
5253
5254         * marshal.c (emit_marshal_string): Fix out string marshalling
5255         to use specified encoding. Fixes #323900.
5256
5257         Code is contributed under MIT/X11 license.
5258
5259 2008-01-24  Raja R Harinath  <harinath@hurrynot.org>
5260
5261         * class.c (mono_class_inflate_generic_method_full): Don't modify
5262         iresult->context after cache check.
5263
5264 2008-01-23  Zoltan Varga  <vargaz@gmail.com>
5265
5266         * class.c (mono_class_inflate_generic_method_full): Change the
5267         struct assignments to memcpy for better visibility and add some comments.
5268
5269 2008-01-23  Dick Porter  <dick@ximian.com>
5270
5271         * threads.c (mono_threads_set_shutting_down): Simplify shutdown
5272         procedure, and make it work on windows.
5273
5274 2008-01-22  Zoltan Varga  <vargaz@gmail.com>
5275
5276         * object-internals.h (MonoReflectionGenericClass): Make the 'generic_type' field
5277         a MonoReflectionTypeBuilder since it is always of that type.
5278
5279         * reflection.c (mono_type_get_object): Remove an unneccesary check.     
5280
5281         * reflection.c (mono_generic_class_get_object): Simplify this a bit.
5282
5283         * reflection.c (mono_reflection_bind_generic_parameters): Ditto.
5284         
5285         * icall.c (ves_icall_MonoGenericClass_GetParentType): Ditto.
5286
5287         * icall.c (ves_icall_MonoGenericClass_GetInterfaces): Ditto.
5288
5289         * reflection.c (mono_reflection_create_runtime_class): Remove already created
5290         instantiations from the type cache.
5291
5292 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
5293
5294         * verify.c (do_ldstr): fixed token verification. previous code was 100% broken.
5295
5296         * verify.c (do_unbox_value): push a controled mutability managed pointer.
5297
5298 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
5299
5300         * verify.c (do_ldstr): added, verifies if the #US token is valid.
5301
5302         * verify.c (mono_method_verify): removed old TODO
5303
5304 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
5305
5306         * verify.c (do_newobj): add visibility check.
5307
5308 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
5309
5310         * verify.c (do_load_function_ptr): add visibility check.
5311
5312 2008-01-21  Massimiliano Mantione  <massi@ximian.com>
5313         *class.c:
5314         mono_generic_class_get_class: hook profiler events.
5315         mono_field_get_offset: added to support heap-shot in the new profiler.
5316         *class.h: exported mono_field_get_offset.
5317         * reflection.c:
5318         mono_reflection_setup_internal_class: hook profiler events.
5319
5320 2008-01-20  Zoltan Varga  <vargaz@gmail.com>
5321
5322         * marshal.c (mono_marshal_emit_native_wrapper): Add a 'check_exceptions' 
5323         argument here too and use it to avoid checking for pending exceptions if 
5324         possible.
5325
5326 2008-01-20  Gert Driesen  <drieseng@users.sourceforge.net>
5327
5328         * assembly.c (build_assembly_name): add arg for passing the assembly
5329         flags. Do not consider a PublicKey with value "null" valid.
5330         (mono_assembly_name_parse_full): added boolean argument that will be
5331         set if the assembly name contains a PublicKeyToken spec. Added support
5332         for the Retargetable spec for which only Yes or No are allowed as valid
5333         value. Consider assembly name invalid if Retargetable spec is set, but
5334         either version, culture or public key (token) are not specified.
5335         * metadata-internals.h: sync signature of mono_assembly_name_parse_full
5336         with implementation in assembly.c.
5337         * icall.c (fill_reflection_assembly_name): also copy assembly flags
5338         from MonoAssemblyName.
5339         (ves_icall_System_Reflection_AssemblyName_ParseName): use newly
5340         introduced argument for mono_assembly_name_parse_full to know if the
5341         assembly name has a PublicKeyToken spec, and if it has instruct
5342         fill_reflection_assembly_name to use default value for keyToken (if
5343         PublicKeyToken is null).
5344
5345 2008-01-18  Rodrigo Kumpera  <rkumpera@novell.com>
5346
5347         * verify.c (mono_method_verify): fixed ovf ops with
5348         float values. They are unverifiable now.
5349
5350 2008-01-18  Rodrigo Kumpera  <rkumpera@novell.com>
5351
5352         * class.c (set_failure_from_loader_error): add BadImageException to the
5353         list of exceptions that can cause a type to fail to load.
5354
5355         * class.c (mono_class_get_exception_for_failure): same.
5356
5357 2008-01-17  Rodrigo Kumpera  <rkumpera@novell.com>
5358
5359         * verify.c (in_any_exception_block): added, check if offset
5360         is part of any exception handling clause.
5361
5362         * verify.c (get_stack_type): added VAR and MVAR types.
5363
5364         * verify.c (do_stobj): better error messages.
5365
5366         * verify.c (do_cpobj): added, check cpobj.
5367
5368         * verify.c (do_initobj): added, check initobj.
5369
5370         * verify.c (do_sizeof): added, check sizeof.
5371
5372         * verify.c (do_localloc): added, check localloc.
5373
5374         * verify.c: adde proper verification for cpobj, initobj, sizeof and localloc.
5375
5376 2008-01-17  Zoltan Varga  <vargaz@gmail.com>
5377
5378         * method-builder.c (mono_mb_emit_native_call): Get rid of the unused
5379         save_lmf/restore_lmf opcodes.
5380
5381         * threads.c (mono_threads_install_notify_pending_exc): New function to
5382         install a callback notifying the JIT there is a pending exception on a thread.
5383         (mono_thread_request_interruption): Call the new callback.
5384         (mono_thread_get_and_clear_pending_exception): New function to return the
5385         exception pending on a thread.
5386
5387         * marshal.c (mono_marshal_get_icall_wrapper): Add a check_exceptions argument
5388         to turn off checking for pending exceptions.
5389         (mono_marshal_get_native_wrapper): Ditto.
5390
5391 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
5392
5393         * threads-types.h: Get rid of the unnecessary extern declarations.
5394
5395 2008-01-16  Gert Driesen  <drieseng@users.sourceforge.net>
5396
5397         * icall.c (ves_icall_Type_GetField): if NonPublic flag is set, only
5398         return field from parent class if not private.
5399         (ves_icall_Type_GetFields_internal): if NonPublic flag is set, only
5400         returns fields from parent class if they are not private.
5401         (method_nonpublic): added function to determine if a given method
5402         should be considered non-public. Returns false for private methods
5403         on parent class, and internal methods from parent on the 1.0 profile.
5404         (ves_icall_Type_GetMethodsByName): if NonPublic flag is set, then
5405         use method_nonpublic function to determine whether method should be
5406         returned.
5407         (property_accessor_public): use newly introduced method_nonpublic
5408         function to determine whether accessor is non-public. 
5409         (ves_icall_MonoType_GetEvent): If NonPublic flag is set, only return
5410         event from parent class if not private. Only return static event if
5411         Static flag is set, and only return static event from parent class if
5412         FlattenHierarchy flag is set.
5413         (ves_icall_Type_GetEvents_internal): If NonPublic flag is set, only
5414         include non-private events from parent class.
5415
5416 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
5417
5418         * icall.c (ves_icall_System_NumberFormatter_GetFormatterTables): Fix a
5419         warning.
5420
5421 2008-01-16  Wade Berrier <wberrier@novell.com>
5422
5423         * security.c: Add assembly.h header to appease some warnings
5424
5425 2008-01-16  Dick Porter  <dick@ximian.com>
5426
5427         * process.c (process_module_string_read): Remove trailing null
5428         when saving string.
5429
5430 2008-01-16  Mark Probst  <mark.probst@gmail.com>
5431
5432         * class-internals.h: A new data structure describing the layout of
5433         a runtime generic context (MonoRuntimeGenericContextTemplate).
5434
5435         * metadata-internals.h: Added a hash table to MonoDomain that maps
5436         from open generic classes to their runtime generic context
5437         templates.
5438
5439         * object.c: Building of the runtime generic context, including
5440         proper handling of generic type arguments of superclasses.
5441         Building of the runtime generic context according to the template.
5442
5443 2008-01-15  Zoltan Varga  <vargaz@gmail.com>
5444
5445         * class.c (mono_class_setup_fields): Set field.count for generic instances.
5446         Fixes #350856.
5447
5448         * image.c (do_mono_image_open): Pass TRUE as last_exists to 
5449         mono_portability_find_file (). Fixes #325466.
5450         (mono_image_get_public_key): Fix a warning.
5451
5452 2008-01-14  Zoltan Varga  <vargaz@gmail.com>
5453
5454         * class.c (mono_class_from_name): Fix comments for NULL-ness of image parameter.
5455         Fixes #353550.
5456         (mono_class_from_name_case): Ditto.
5457
5458 2008-01-13  Eyal Alaluf <eyala@mainsoft.com>
5459
5460         * icall-def.h number-formatter.h icall.c: Implemented a cross app-domain
5461           common storage for the tables used in the System/NumberFormatter class.
5462
5463 2008-01-13  Zoltan Varga  <vargaz@gmail.com>
5464
5465         * marshal.c (mono_marshal_get_runtime_invoke): Fix a typo.
5466
5467 2008-01-11  Rodrigo Kumpera  <rkumpera@novell.com>
5468
5469         * verify.c (get_boxable_mono_type): check if the token is valid.
5470
5471         * verify.c (set_stack_value): changed to add an error if an
5472         invalid type is set on stack. Changed all callers due to signature change.
5473
5474         * verify.c (do_stobj): implement stobj validation.
5475
5476 2008-01-11  Zoltan Varga  <vargaz@gmail.com>
5477
5478         * reflection.c (reflection_methodbuilder_to_mono_method): No need to
5479         set container->is_method, it was set earlier.
5480
5481         * metadata.c (type_in_image): Handle MVARs which belong to not finished
5482         generic methods.
5483
5484         * reflection.c (mono_reflection_initialize_generic_parameter): Set
5485         is_method of the generic container to TRUE for methods.
5486
5487 2008-01-10  Zoltan Varga  <vargaz@gmail.com>
5488
5489         * metadata.c (type_in_image): Handle type parameters properly.
5490
5491         * class-internals.h (MonoGenericParam): Add an 'image' argument to track
5492         memory ownership of this structure.
5493
5494 2008-01-10  Rodrigo Kumpera  <rkumpera@novell.com>
5495
5496         * verify.c (get_boxable_mono_type): make typedref types been just
5497         unverifiable. check for void type.
5498
5499         * verify.c (do_unbox_any): added, verify opcode unbox.any.
5500
5501         * verify.c (do_load_function_ptr): accept method spec tokens.
5502
5503 2008-01-10  Zoltan Varga  <vargaz@gmail.com>
5504
5505         * marshal.c (mono_class_native_size): Always set *align even if this is called
5506         recursively.
5507
5508 2008-01-09  Zoltan Varga  <vargaz@gmail.com>
5509
5510         * verify.c (mono_verify_corlib): Remove this as it was not used and was 
5511         out-of-date.
5512
5513 2008-01-09  Rodrigo Kumpera  <rkumpera@novell.com>
5514
5515         * verify.c: removed some old unused tables. A huge bunch of small fixes
5516         to things found while testing the verifier with mono basic.
5517
5518         * verify.c (dump_stack_value): dump null literal flag to.
5519
5520         * verify.c (verify_type_compatibility_full): fix comparison
5521         for types that have a generic super type.
5522
5523         * verify.c (verify_stack_type_compatibility): fix compatibility
5524         between null literals and reference types. fix compatibility between
5525         boxed valuetypes and object. fix corner case test for enums.
5526
5527         * verify.c (do_cmp_op): proper verification of cgt.un in case
5528         of reference types.
5529
5530         * verify.c (do_invoke_method): fix error message.
5531
5532         * verify.c (do_store_indirect
5533
5534         * verify.c (check_is_valid_type_for_field_ops): proper verification
5535         of managed pointers to valuetypes and boxed valuetypes. proper verification
5536         of null literals.
5537
5538         * verify.c (do_unbox_value): expect valuetypes to be always boxed. don't
5539         allow token to be a reference type.
5540
5541         * verify.c (do_cast): proper handling of boxes valuetypes.
5542
5543         * verify.c (do_stelem): proper handling of storing a boxed valuetype
5544         in object[].
5545
5546         * verify.c (mono_method_verify): pass the opcode to do_cmp_op
5547         to handle cgt.un properly. Implement add/mul/sub ovf opcodes.
5548         fixed the decoding of unbox_any
5549
5550 2008-01-08  Zoltan Varga  <vargaz@gmail.com>
5551
5552         * boehm-gc.c (mono_gc_deregister_root): Fix the size passed to libgc.
5553
5554 2008-01-08  Rodrigo Kumpera  <rkumpera@novell.com>
5555
5556         * verify.c (do_newobj): do delegate verification.
5557
5558         * verify.c (verify_delegate_compatibility): perform delegate
5559         verification.
5560
5561         * verify.c (verify_ldftn_delegate): perform tests related to
5562         ldftn delegates.
5563
5564         * verify.c (mono_delegate_signature_equal): perform the
5565         slightly diferent signature comparison required by delegates.
5566
5567         * metadata.c (mono_metadata_type_equal_full): added and exported
5568         as MONO_INTERNAL. This is a version of mono_metadata_type_equal that
5569         allows signature only comparison.
5570
5571         * metadata-internal.h (mono_metadata_type_equal_full): added and exported
5572         as MONO_INTERNAL.
5573
5574 2008-01-07  Rodrigo Kumpera  <rkumpera@novell.com>
5575
5576         * verify.c: added a bunch of stack_slot_* functions to
5577         make access to stack slot type easier. This is required to
5578         allow optional flags, like null literal, boxed value and
5579         this pointer.
5580         All access paths to IlStackDesc::stype have been changed 
5581         to use these new funcions.
5582         Removed a bunch of unused functions and cleared all warnings.
5583         This patch introduces the usage of the this pointer and 
5584         boxed value flags.
5585
5586 2008-01-07  Zoltan Varga  <vargaz@gmail.com>
5587
5588         * boehm-gc.c (mono_gc_deregister_root): Fix win32 build.
5589
5590 2008-01-06  Zoltan Varga  <vargaz@gmail.com>
5591
5592         * appdomain.c (ves_icall_System_AppDomain_ExecuteAssembly): Change signature to
5593         match managed version.
5594
5595         * appdomain.c: Bump corlib version.
5596         
5597         * appdomain.c (ves_icall_System_AppDomain_ExecuteAssembly): Check for a null
5598         argument.
5599
5600 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
5601
5602         * icall.c (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies)
5603         Set public key token to zero-length byte array if assembly is not
5604         strongnamed.
5605
5606 2008-01-05  Zoltan Varga  <vargaz@gmail.com>
5607
5608         * icall.c (ves_icall_System_Array_SetValueImpl): Use a write barrier when
5609         writing a vtype array elem.
5610
5611 2007-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
5612
5613         * assembly.c (build_assembly_name): return FALSE if length of token is
5614         not 16 (if not "null").
5615         (mono_assembly_name_parse_full): return FALSE if value of version,
5616         culture, token or key is 0.
5617         * icall.c (fill_reflection_assembly_name): add boolean arguments to
5618         specify whether public key and public key token must be set to default
5619         value (zero-length byte array) if not available. Set versioncompat to
5620         SameMachine. If public key is available or the default is set, then
5621         set PublicKey flag.
5622         (ves_icall_System_Reflection_Assembly_FillName): if no public key
5623         is available, use empty byte array as default value. On the 2.0
5624         profile, use default value for public key token if not set.
5625         (ves_icall_System_Reflection_InternalGetAssemblyName): on the 1.0
5626         profile, use default value for public key if not set. On the 2.0
5627         profile, use default value for public key token if not set.
5628         (ves_icall_System_Reflection_AssemblyName_ParseName): do not set
5629         default values for public key and public key token.
5630
5631 2008-01-05  Zoltan Varga  <vargaz@gmail.com>
5632
5633         * object-internals.h (MonoReflectionAssemblyName): Add 'processor_architecture'
5634         field to keep it in synch with the managed object.
5635
5636         * marshal.c (emit_marshal_object): Add support for byref marshalling of
5637         delegates. Fixes #351520.
5638
5639         * sgen-gc.c (conservatively_pin_objects_from): Tell valgrind that the pin queue
5640         contains defined memory.
5641         
5642         * sgen-gc.c: Fix 64 bit warnings. Fix some typos. Update GC stats in mono_stats.
5643
5644         * sgen-gc.c (build_nursery_fragments): Handle half-constructed objects correctly.
5645         
5646         * sgen-gc.c (check_consistency): New helper function to do a consistency check
5647         of the GC data structures.
5648
5649         * gc-internal.h: Moved the REGISTER/UNREGISTER macros here from os/gc_wrapper.h.
5650
5651         * *.c: Include metadata/gc-internal.h instead of os/gc_wrapper.h.
5652         
5653         * object.c (mono_array_full_copy): Fix detection of whenever to use a write
5654         barrier.
5655         (mono_array_clone_in_domain): Ditto.
5656         (mono_array_clone_in_domain): Ditto.
5657
5658         * threads.c (start_wrapper): Register the thread start argument as a GC root.
5659         (cache_culture): Use a write barrier.
5660
5661         * icall.c (ves_icall_System_Array_SetValueImpl): Call a write barrier.
5662         (ves_icall_get_property_info): Ditto.
5663
5664         * object.h (MONO_STRUCT_SETREF): New macro.
5665
5666         * class-internals.h (MonoStats): Add some GC statistics.
5667
5668         * boehm-gc.c null-gc.c: Define mono_gc_deregister_root ().
5669
5670 2008-01-04  Andreas Faerber  <andreas.faerber@web.de>
5671
5672         * exception.c (mono_exception_from_name_two_strings):
5673         Break from loop after method is found.
5674
5675 2008-01-04  Dick Porter  <dick@ximian.com>
5676
5677         * process.c (process_module_string_read): Rename variable to
5678         reflect correct usage, after fixing bug 345972.
5679
5680 2008-01-03  Rodrigo Kumpera  <rkumpera@novell.com>
5681
5682         * verify.c (mono_type_create_fnptr_from_mono_method): 
5683         created a MonoType function pointer instance to be used during
5684         verification. The verifier releases this memory at end.
5685
5686         * verify.c (mono_method_is_constructor): extracted repeated
5687         checks for constructor into a single class.
5688
5689         * verify.c (do_push_field): use new extracted method
5690         for constructor check.
5691
5692         * verify.c (do_newobj): same.
5693
5694         * verify.c (do_ldftn): renamed to do_load_function_ptr
5695         and make it verify ldvirtftn too.
5696
5697         * verify.c (mono_method_verify: proper verification
5698         of ldvirtftn. release created MonoMethod instances.
5699
5700 2007-12-31  Rodrigo Kumpera  <rkumpera@novell.com>
5701
5702         * verify.c (token_bounds_check): added.
5703
5704         * verify.c (do_ldftn): added.
5705
5706         * verify.c (mono_method_verify): proper verificartion of ldftn.
5707
5708 2007-12-31  Rodrigo Kumpera  <rkumpera@novell.com>
5709
5710         * metadata.c (mono_metadata_decode_row): Assert if index is bigger
5711         than the table row count. It's the resposibility of the caller to
5712         make the bounds check and raise the correct error.
5713
5714         * metadata.c (mono_metadata_decode_row_col): Same.
5715
5716         * loader.c (mono_get_method_from_token): perform bounds check
5717         on token for methoddef table.
5718
5719 2007-12-29  Miguel de Icaza  <miguel@novell.com>
5720
5721         * icall.c
5722         (ves_icall_System_CurrentSystemTimeZone_GetTimeZoneData): Turn the
5723         assert into a negative result, the managed code already coped with
5724         that.
5725
5726         Some folks on Windows reported this error. 
5727
5728 2007-12-28  Gert Driesen  <drieseng@users.sourceforge.net>
5729
5730         * appdomain.c: Bump corlib version.
5731         * icall.c:
5732         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies): Use
5733         CultureInfo.CreateCulture to create CultureInfo for name.
5734         (fill_reflection_assembly_name): Use CultureInfo.CreateCulture to
5735         create CultureInfo for name. Fixes bug #347174.
5736
5737 2007-12-27  Rodrigo Kumpera  <rkumpera@novell.com>
5738
5739         * verify.c: added IL_CODE_FLAG_STACK_INITED and IL_CODE_STACK_MERGED
5740         flags.
5741
5742         * verify.c (is_valid_branch_instruction): allow branching to the
5743         first instruction of the protected block.
5744
5745         * verify.c (is_valid_cmp_branch_instruction): same.
5746
5747         * verify.c (stack_init): use IL_CODE_FLAG_STACK_INITED flag to
5748         avoid double initialization.
5749
5750         * verify.c (merge_stacks): use IL_CODE_STACK_MERGED to
5751         detect which cases the eval stack should just be copied.
5752
5753         * verify.c (mono_method_verify): check if the eval stack
5754         is empty when entering a protected block.
5755
5756 2007-12-27  Rodrigo Kumpera  <rkumpera@novell.com>
5757
5758         * verify.c: added is_clause_in_range, is_clause_inside_range,
5759         is_clause_nested and verify_clause_relationship. They perform
5760         the verifications stated in P1 12.4.2.7.
5761
5762         * verify.c (mono_method_verify): remove some unused variables,
5763         add the new exception clause checks, add instruction border
5764         checks for protected block start/end, improved some error 
5765         messages and fixed a bug in the way invalid instruction access
5766         is detected.
5767
5768 2007-12-26  Zoltan Varga  <vargaz@gmail.com>
5769
5770         * boehm-gc.c (mono_gc_register_thread): Use the new GC_register_my_thread () routine
5771         from GC 7.0 if available.
5772
5773         * object.c: Remove an unused define.
5774         
5775         * object.c (mono_class_compute_gc_descriptor): Fix a warning.
5776
5777         * boehm-gc.c (mono_gc_make_descr_for_array): Implement.
5778
5779         * null-gc.c (mono_gc_make_descr_for_array): Implement.
5780
5781         * object.c (mono_class_compute_gc_descriptor): Remove an #ifdef SGEN_GC.
5782
5783         * gc-internal.h: Change the signature of mono_gc_make_descr_for_string ()
5784         to take the same arguments as the other make_descr functions.
5785
5786         * boehm-gc.c null-gc.c: Add implementation for make_descr functions.
5787
5788         * objects.c: Get rid of the MAKE_DESCRIPTOR macros, call make_descr functions
5789         directly.
5790
5791         * boehm-gc.c (mono_gc_base_init): Moved the setting of GC_stackbottom here from
5792         mini.c.
5793
5794         * object.c (mono_class_compute_gc_descriptor): Move the GC_init_gcj_malloc () 
5795         call to boehm-gc.c.
5796
5797         * boehm-gc.c (mono_gc_register_root): Fix a warning.
5798
5799         * null-gc.c (mono_gc_register_root): Fix a warning.
5800
5801         * reflection.c (ALLOC_REFENTRY): Use mono_gc_alloc_fixed for boehm as well.
5802
5803         * boehm-gc.c (mono_gc_register_root): Moved definition here from gc_wrapper.h.
5804         (mono_gc_base_init): Call GC_init ().
5805
5806         * null-gc.c: Define mono_gc_register_root () as a no-op.
5807
5808         * domain.c appdomain.c: Call mono_gc_base_init () instead of MONO_GC_PRE_INIT ().
5809
5810 2007-12-24  Rodrigo Kumpera  <rkumpera@novell.com>
5811
5812         * verify.c: add prototype for merge_stacks at top
5813
5814         * verify.c (do_switch): added.
5815
5816         * verify.c (merge_stacks): on some cases the stack merging
5817         was not happening properly. Unequal stack sizes at merge
5818         points should be invalid.
5819
5820         * verify.c (mono_method_verify): added more debug info on stack state.
5821         verify switch properly.
5822
5823 2007-12-24  Zoltan Varga  <vargaz@gmail.com>
5824
5825         * method-builder.h: New file, moved the mono_mb_ declarations here from 
5826         marshal.h.
5827
5828         * boehm-gc.c marshal.c: Include method-builder.h.
5829
5830         * marshal.c: Use mono_mb_emit_branch_label () in a few places.
5831
5832         * marshal.c: Remove some code which is now in method-builder.c.
5833
5834 2007-12-23  Zoltan Varga  <vargaz@gmail.com>
5835
5836         * method-builder.c: New file, extraction of the method builder functionality 
5837         from marshal.c.
5838
5839         * marshal.c: Move the mb functions into method-builder.c.
5840
5841         * marshal.h marshal.c: Export some mono_mb_... functions.
5842
5843         * marshal.c: Use mono_mb_get_label () and mono_mb_patch_branch () in all places.
5844
5845         * loader.c (field_from_memberref): Remove the dynamic case, it is handled in
5846         the caller.
5847
5848         * class.c (mono_class_get_full): Check the token type in the dynamic case.
5849
5850         * loader.c (mono_field_from_token): Ditto.      
5851
5852         * loader.c (mono_get_method_from_token): Change the check so it checks memberref
5853         type as well.
5854         
5855         * loader.c (mono_get_method_from_token): Check the token type in the dynamic case.
5856         Fixes #342565.
5857
5858         * class-internals.h: Add new loader error type MONO_EXCEPTION_BAD_IMAGE plus
5859         a helper function for setting it.
5860
5861         * loader.c (mono_loader_error_prepare_exception): Handle MONO_EXCEPTION_BAD_IMAGE.
5862
5863         
5864         * assembly.c: Significally simplify code now that referenced assemblies are 
5865         loaded lazily. Get rid of the 'loading' hashtables. Hopefully fixes #347629.
5866
5867         * threads.h: Don't include  the internal threads-types.h header file. Fixes
5868         #349952.
5869
5870 2007-12-21  Rodrigo Kumpera  <rkumpera@novell.com>
5871
5872         * verify.c: added enum value IL_CODE_FLAG_WAS_TARGET, to represent
5873         instructions that were target of branches or are at protected block boundaries.
5874
5875         * verify.c (in_same_block): handle filter clauses.
5876
5877         * verify.c (is_valid_branch_instruction): added. checks the target of
5878         instructions br or brtrue/false.
5879
5880         * verify.c (is_valid_cmp_branch_instruction): added. checks the target of
5881         binary branch instructions such as beq and bge.
5882
5883         * verify.c (init_stack_with_value): renamed to init_stack_with_value_at_exception_boundary
5884         and made it pin the instruction as been part of the exception block.
5885
5886         * verify.c (do_boolean_branch_op): use is_valid_branch_instruction instead
5887         of in_same_block.
5888
5889         * verify.c (do_branch_op): use is_valid_cmp_branch_instruction instead
5890         of in_same_block.
5891
5892         * verify.c (do_ret): ret from a protected block is unverifiable and
5893         not invalid.
5894
5895         * verify.c (do_static_branch): verify br and br.s instructions.
5896
5897         * verify.c (merge_stacks): add extra param to support detection
5898         of branches in the middle of instructions.
5899         
5900         * verify.c (mono_method_verify): verify branches and exception blocks
5901         that target the middle of instructions. Proper verification of br and br.s.
5902
5903 2007-12-21  Zoltan Varga  <vargaz@gmail.com>
5904
5905         * reflection.c (reflection_methodbuilder_from_ctor_builder): Initialize
5906         skip_visibility field.
5907         (reflection_methodbuilder_from_dynamic_method): Ditto.
5908
5909         * object.c (mono_class_compute_gc_descriptor): Remove more unused icall
5910         registrations. Fixes #348193.
5911
5912         * threads.h: Move the internal mono_thread_get_pending_exception () to
5913         threads-types.h and rename it to mono_thread_get_undeniable_exception ().
5914
5915 2007-12-20  Zoltan Varga  <vargaz@gmail.com>
5916
5917         * object.c (mono_class_compute_gc_descriptor): Remove unused GC_gcj_fast_malloc
5918         icall registration. Fixes #348193.
5919
5920         * marshal.c (mono_marshal_get_runtime_invoke): Put all runtime invoke wrappers
5921         for corlib classes into object. Fixes #349621.
5922
5923 2007-12-20  Gert Driesen  <drieseng@users.sourceforge.net>
5924
5925         * icall.c (property_accessor_nonpublic): new function to determine
5926         whether an accessor allows a property to be considered non-public.
5927         Returns false for private accessor(s) from parent class, and internal
5928         accessor(s) from parent on 2.0 profile (and higher).
5929         (ves_icall_Type_GetPropertiesByName): Use newly introduced function
5930         to determine whether property should be included if NonPublic flag
5931         is set. Fixes bug #349078.
5932
5933 2007-12-20  Rodrigo Kumpera  <rkumpera@novell.com>
5934
5935         * verify.c (init_stack_with_value): added.
5936
5937         * verify.c (mono_method_verify): extracted common
5938         code for exception initialization into init_stack_with_value.
5939
5940         * verify.c (mono_method_verify): initialize the exception
5941         for handler clauses as well.
5942
5943         * verify.c (mono_method_verify): fix the exception clause
5944         ordering rules, it should use handler end offset and not
5945         start offset.
5946
5947 Thu Dec 20 12:27:24 CET 2007 Paolo Molaro <lupus@ximian.com>
5948
5949         * rawbuffer.c: remove useless warning.
5950
5951 Thu Dec 20 12:10:38 CET 2007 Paolo Molaro <lupus@ximian.com>
5952
5953         * threads.h, threads-types.h: move functions to the correct header
5954         (fixes bug#349952).
5955
5956 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
5957
5958         * verify.c (mono_method_verify): proper verification
5959         of exception handling clauses ranges and fallthru in
5960         and out of protected blocks.
5961
5962 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
5963
5964         * verify.c (mono_method_verify): fixed compilation issue.
5965
5966 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
5967
5968         * verify.c (mono_method_verify): a printf slipped in, changed
5969         to use verifier debug macro.
5970
5971 2007-12-18  Rodrigo Kumpera  <rkumpera@novell.com>
5972
5973         * verify.c (is_correct_leave): check for filter clauses.
5974
5975         * verify.c (do_filter): added.
5976
5977         * verify.c (mono_method_verify): property verification of leave.
5978
5979
5980 2007-12-18  Mark Probst  <mark.probst@gmail.com>
5981
5982         * threads.c: Disable calls to _wapi_thread_signal_self() to fix
5983         Win32 build, until we figure out how to do the proper thing on
5984         Win32.
5985
5986 2007-12-17  Zoltan Varga  <vargaz@gmail.com>
5987
5988         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Fix a crash introduced
5989         by the previous patch.
5990         
5991         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Avoid calling
5992         the assembly resolve handler for refonly assemblies.
5993
5994 2007-12-17  Mark Probst  <mark.probst@gmail.com>
5995
5996         * threads.c, thread-types.h, icall.c: New shutdown safeguards.
5997         Make sure only one thread is allowed to commence shutdown, and
5998         don't allow new threads to be started once shutdown is in
5999         progress.
6000
6001 2007-12-14  Rodrigo Kumpera  <rkumpera@novell.com>
6002
6003         * verify.c (is_correct_endfilter): added.
6004
6005         * verify.c (is_unverifiable_endfilter): added.
6006
6007         * verify.c (do_endfilter): added.
6008
6009         * verify.c (mono_method_verify): property verification of endfilter
6010         and fixed a corner case or endfinally.
6011
6012 2007-12-13  Rodrigo Kumpera  <rkumpera@novell.com>
6013
6014         * verify.h: new flags to support fail fast of unverifiable code and
6015         do non-strict verification. Non-strict verification is required to
6016         have MS runtime compatibility. There are a huge amount of unverifiable
6017         code that it accepts as verifiable. The strict mode verifies the code
6018         as the specs says.
6019         Non-strict mode will be required in cases where code needs to be
6020         accepted as verifiable but fails under strict mode.
6021
6022         * pedump.c: added support to fail fast and non-strict verification.
6023
6024         * verify.c: added support for both fail fast and non-strict verification.
6025
6026 2007-12-12  Rodrigo Kumpera  <rkumpera@novell.com>
6027
6028         * verify.c (is_correct_endfinally): added.
6029
6030         * verify.c (mono_method_verify): property verification of endfinally.
6031
6032 2007-12-11  Rodrigo Kumpera  <rkumpera@novell.com>
6033
6034         * verify.c (in_any_block): check for filter clauses.
6035
6036         * verify.c (is_correct_rethrow): added.
6037
6038         * verify.c (mono_method_verify): property verification of rethrow.
6039
6040         * metadata.h: added MONO_OFFSET_IN_FILTER macro.
6041
6042 2007-12-11  Rodrigo Kumpera  <rkumpera@novell.com>
6043
6044         * verify.c (do_throw): added.
6045
6046         * verify.c (mono_method_verify): property verification of throw
6047
6048 2007-12-11  Zoltan Varga  <vargaz@gmail.com>
6049
6050         * assembly.c (mono_assembly_load_reference): Try an assembly resolve for ref-only
6051         assemblies. Fixes #346425.
6052
6053 2007-12-10  Zoltan Varga  <vargaz@gmail.com>
6054
6055         * reflection.c (mono_reflection_get_token): Call mono_image_create_token () for
6056         FieldBuilders.
6057
6058         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): Fix a warning.
6059
6060         * class.c (mono_lookup_dynamic_token_class): Add a 'valid token' argument to
6061         prevent asserts when this is called with a token which might not be valid.
6062
6063         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Call
6064         lookup_dynamic_token_class with valid_token == FALSE.
6065
6066         * icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): Ditto.       
6067
6068         * icall.c (ves_icall_System_Reflection_Module_ResolveStringToken): Ditto.
6069
6070         * icall.c (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
6071         
6072 2007-12-10  Mark Probst  <mark.probst@gmail.com>
6073
6074         * gc.c: Don't delay threadpool thread finalization unless Mono is
6075         shutting down.
6076
6077 Mon Dec 10 11:06:23 CET 2007 Paolo Molaro <lupus@ximian.com>
6078
6079         * threads.c: turn an assert into a non-fatal warning.
6080
6081 2007-12-09  Robert Jordan  <robertj@gmx.net>
6082
6083         * icall.c (GetVirtualMethod): Add missing argument validation.
6084
6085 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
6086
6087         * verify.c (do_cast): added.
6088
6089         * verify.c (mono_method_verify): property verification of castclass and isinst.
6090
6091
6092 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
6093
6094         * verify.c (mono_type_from_opcode): added opcodes for stelem.X.
6095
6096         * verify.c (do_stelem): added.
6097
6098         * verify.c (mono_method_verify): property verification of stelem.X.
6099
6100 2007-12-07  Mark Probst  <mark.probst@gmail.com>
6101
6102         * class.c, class-internals.h: Introduce an environment variable
6103         (MONO_GENERIC_SHARING) through which the extent of generic code
6104         sharing can be controlled (share all classes, share only corlib
6105         classes, or share nothing).
6106
6107         * object.c: Only create runtime generic context for classes for
6108         which sharing is enabled.
6109
6110 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
6111
6112         * verify.c (do_ldelem): refactor it to work with ldelem.any.
6113
6114         * verify.c (mono_method_verify): property verification of ldelem.any.
6115
6116 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
6117
6118         * verify.c (get_indirect_op_mono_type): renamed to mono_type_from_opcode,
6119         added ldelem.X opcodes.
6120
6121         * verify.c (do_ldelema): fixed possible invalid usage of MonoType.
6122
6123         * verify.c: proper verification of ldelem.X 
6124
6125 2007-12-06  Zoltan Varga  <vargaz@gmail.com>
6126
6127         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): Allow interface cctors to be called too.
6128
6129 2007-12-05  Rodrigo Kumpera  <rkumpera@novell.com>
6130
6131         * verify.c (mono_method_verify): null literal requires special handling,
6132         the value pushed on stack need to be flagged as so.
6133
6134         * verify.c (do_ldelema): Verify ldelema properly.
6135
6136 2007-12-05  Rodrigo Kumpera  <rkumpera@novell.com>
6137
6138         * verify.c: Verify ldlen properly.
6139
6140 2007-12-05  Zoltan Varga  <vargaz@gmail.com>
6141
6142         * icall.c (ves_icall_MonoField_GetValueInternal): Check that the field belongs
6143         to the target object's type. Fixes #346160.
6144
6145 2007-12-05  Dick Porter  <dick@ximian.com>
6146
6147         * threadpool.c (socket_io_add_poll): Asynchronous connect() on
6148         Solaris needs the same workaround as BSD-derived systems.  Fixes
6149         bug 323524, patch by Burkhard Linke
6150         <burkhard.linke@CeBiTec.Uni-Bielefeld.DE>
6151
6152 2007-12-04  Gert Driesen  <drieseng@users.sourceforge.net>
6153
6154         * process.c: When ProcessStartInfo.ErrorDialog is true, pass window
6155         handle to use when error dialog is shown; otherwise, update mask
6156         to show no error dialog when an error occurs.
6157
6158 2007-12-03  Zoltan Varga  <vargaz@gmail.com>
6159
6160         * icall.c (ves_icall_MonoField_GetRawConstantValue): New icall.
6161
6162         * class.c (mono_class_get_field_default_value): New helper function to initialize
6163         field->def_type and field->data.
6164
6165 2007-11-30  Zoltan Varga  <vargaz@gmail.com>
6166
6167         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Use the delegate trampoline instead of
6168         the general one.
6169
6170         * object.c (mono_runtime_create_delegate_trampoline): New helper function.
6171
6172         * marshal.c: Avoid depending on delegate->method_info being set.
6173
6174         * object.c (mono_delegate_ctor): Avoid initializing delegate->method_info.
6175         
6176         * object.c (mono_delegate_ctor): Set delegate->method.
6177
6178         * object-internals.h (struct _MonoDelegate): Add 'method' field.
6179
6180         * appdomain.c: Bump corlib version.
6181
6182 2007-11-27  Raja R Harinath  <harinath@gmail.com>
6183
6184         * metadata.c (mono_generic_inst_equal_full): Short-circuit
6185         equality check if we're comparing canonicalized MonoGenericInsts.
6186
6187 2007-11-23  Zoltan Varga  <vargaz@gmail.com>
6188
6189         * class.c (generic_array_methods): Call mono_class_setup_methods () before
6190         accessing class->methods.
6191
6192 2007-11-22  Dick Porter  <dick@ximian.com>
6193
6194         * threads.c: Ensure that the synch_cs is set before trying to use
6195         it.
6196
6197 Thu Nov 22 12:34:04 CET 2007 Paolo Molaro <lupus@ximian.com>
6198
6199         * profiler.c: r89126 broke the statistial profiler, unbreak.
6200
6201 2007-11-22  Martin Baulig  <martin@ximian.com>
6202
6203         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 66.
6204
6205         * mono-debug.c
6206         (mono_debug_debugger_version): Bump to 3.
6207         (mono_debug_init): Hook `mono_debugger_class_loaded_methods_func'
6208         -> mono_debugger_class_initialized().
6209
6210         * mono-debug-debugger.c
6211         (mono_debugger_add_type): Renamed into mono_debugger_class_initialized().
6212
6213         * class.c
6214         (mono_debugger_start_class_init_func): Removed.
6215         (mono_debugger_class_loaded_methods_func): Added.
6216         (mono_class_setup_methods): Call it here.
6217
6218 2007-11-22  Martin Baulig  <martin@ximian.com>
6219
6220         * mono-debug.c
6221         (mono_debug_add_delegate_trampoline): New public method.
6222         (MonoDebugDataItemType): Added `MONO_DEBUG_DATA_ITEM_DELEGATE_TRAMPOLINE'.
6223
6224         * mono-debug.h
6225         (MonoSymbolTable): Added `global_data_table'.
6226         (MonoDebuggerTypeKind): Removed.
6227
6228 2007-11-21  Zoltan Varga  <vargaz@gmail.com>
6229
6230         * marshal.c (mono_marshal_get_generic_array_helper): Skip visibility checks for
6231         these methods.
6232
6233         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
6234         
6235 Tue Nov 20 23:10:41 CET 2007 Paolo Molaro <lupus@ximian.com>
6236
6237         * object.c: some fields don't have a valid rva: ignore them (bug #343083).
6238
6239 2007-11-20  Martin Baulig  <martin@ximian.com>
6240
6241         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 65.
6242
6243         * mono-debug-debugger.c
6244         (mono_debugger_insert_method_breakpoint): Moved here from debug-mini.c
6245         (mono_debugger_remove_breakpoint): Likewise.
6246         (mono_debugger_check_breakpoints): Likewise.
6247         (mono_debugger_register_class_init_callback): New public method.
6248         (mono_debugger_remove_class_init_callback): Likewise.
6249         (mono_debugger_add_type): Likewise.
6250
6251         * mono-debug-debugger.h
6252         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_CLASS_INITIALIZED'.
6253
6254 Tue Nov 20 20:54:12 CET 2007 Paolo Molaro <lupus@ximian.com>
6255
6256         * class.c: more interface implementations needed for the
6257         array enumerator (fixes bug #341112).
6258
6259 2007-11-18  Gert Driesen  <drieseng@users.sourceforge.net>
6260
6261         * icall.c: Renamed arguments for ves_icall_System_Enum_ToObject to
6262         fix ParamName of ArgumentNullExceptions.
6263
6264 2007-11-17  Miguel de Icaza  <miguel@novell.com>
6265
6266         * reflection.c (mono_reflection_encode_sighelper): Generate the
6267         modopts and modreqs.   I have a useless test that crashes monodis,
6268         but that shows the code working.
6269
6270 2007-11-17  Zoltan Varga  <vargaz@gmail.com>
6271
6272         * boehm-gc.c (create_allocator): Fix size calculation for the string allocator.
6273         (mono_gc_get_managed_allocator): Enable the string allocator on amd64.
6274
6275 2007-11-15  Dick Porter  <dick@ximian.com>
6276
6277         * threads.c (ves_icall_System_Threading_Thread_Join_internal):
6278         When joining a thread, it's the thread that's calling Join that
6279         gets WaitSleepJoin state not the target.  Fixes the standalone
6280         test case in bug 334740, and hopefully the whole bug too.
6281
6282 2007-11-15  Dick Porter  <dick@ximian.com>
6283
6284         * process.c: Read file version info from the files pointed at by
6285         process modules, not the current process.  Fixes bug 315969.
6286
6287         Use windows typedef names in some places to fix warnings on the
6288         windows build.
6289
6290 2007-11-15  Mark Probst  <mark.probst@gmail.com>
6291
6292         * image.c, metadata-internals.h: Added a generic_class_cache hash
6293         to MonoImage for looking up generic classes when sharing generics.
6294
6295 Thu Nov 15 16:11:30 CET 2007 Paolo Molaro <lupus@ximian.com>
6296
6297         * sgen-gc.c: warning cleanups.
6298
6299 2007-11-15  Zoltan Varga  <vargaz@gmail.com>
6300
6301         * icall.c (ves_icall_Type_GetPropertiesByName): Implement proper hiding of
6302         inherited properties.
6303
6304 2007-11-14  Mark Probst  <mark.probst@gmail.com>
6305
6306         * object.c, class-internals.h: Added more information to the
6307         runtime generic context.
6308
6309 2007-11-13  Zoltan Varga  <vargaz@gmail.com>
6310
6311         * marshal.c (mono_marshal_get_delegate_invoke): Take a delegate as argument
6312         instead of just the target method. Generalize the abstract method handling to
6313         handle any non-static method.
6314
6315         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Update after
6316         mono_marshal_get_delegate_invoke () signature change.
6317
6318 2007-11-13  Mark Probst  <mark.probst@gmail.com>
6319
6320         * class.c, class-internals.h: Made
6321         mono_type_get_basic_type_from_generic () public.  Fixed member
6322         access check for shared generics.
6323
6324         * loader.c: Don't insert field into field cache if it's part of a
6325         non-inflated generic class.
6326
6327         * domain.c, domain-internals.h: The generic sharing context is now
6328         part of the jit info data structure.  Added two accessor
6329         functions.
6330
6331 2007-11-12  Zoltan Varga  <vargaz@gmail.com>
6332
6333         * marshal.c (mono_marshal_get_runtime_invoke): Create a non-shared wrapper for
6334         the array Get/Set/Address methods, since the JIT inlines them.
6335
6336         * metadata-internals.h (MonoImage): Add 'runtime_invoke_direct_cache'.
6337
6338         * image.c (mono_image_close): Free runtime_invoke_direct_cache.
6339         (mono_image_init): Initialize runtime_invoke_direct_cache.      
6340
6341         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Update after
6342         mono_marshal_get_delegate_invoke signature change.
6343
6344         * marshal.c (mono_marshal_get_delegate_invoke): Receive the target_method as
6345         an additional argument. Add support for invoking abstract methods.
6346
6347         * metadata-internals.h (MonoImage): Add 'delegate_abstract_invoke_cache'.
6348
6349         * image.c (mono_image_close): Free delegate_abstract_invoke_cache.      
6350
6351 2007-11-09  Mark Probst  <mark.probst@gmail.com>
6352
6353         * class.c: Do field layout for open generic classes as well.
6354
6355 2007-11-09  Mark Probst  <mark.probst@gmail.com>
6356
6357         * gc.c, gc-internal.h: Don't finalize threadpool threads with
6358         other objects, because the threadpool is still around.  Put them
6359         in a list instead and after finalizing all other objects in the
6360         root domain shut down the thread pool and then finalize the
6361         threads.  Fixes bug #337383.
6362
6363         * threads.c, thread-types.h: New mono_thread_create_internal()
6364         function for marking a thread with the threadpool flag before it
6365         started.  Set synch_cs to NULL after freeing it.
6366
6367         * threadpool.c: Mark threadpool threads before they start.
6368
6369 Thu Nov 8 15:31:21 CET 2007 Paolo Molaro <lupus@ximian.com>
6370
6371         * reflection.h, reflection.c: don't export random functions
6372         and lazy load dbnull and missing objects.
6373
6374 2007-11-07  Jonathan Chambers <joncham@gmail.com>
6375
6376         * class.c: Initialize COM types if COM interfaces
6377         are present (not just COM classes).
6378         
6379         Code is contributed under MIT/X11 license.
6380
6381 2007-11-07  Massimiliano Mantione  <massi@ximian.com>
6382         * reflection.c:
6383         create_dynamic_mono_image: hook module profiler events (dynamic case).
6384         mono_image_basic_init: hook assembly profiler events (dynamic case).
6385
6386 2007-11-07  Massimiliano Mantione  <massi@ximian.com>
6387         * profiler.c:
6388         simple_appdomain_unload: completely terminate the profiler
6389         instead of only processing the statistical samples.
6390         simple_shutdown: make sure this is really called exactly once,
6391         even in multithreaded applications, and always listen to
6392         appdomain events.
6393         * gc.c (mono_domain_finalize): don't call mono_profiler_appdomain_event
6394         here, the "[un]load" functions will do it.
6395         Fixes bugs #333791 and #325261.
6396
6397 2007-11-07  Geoff Norton  <gnorton@novell.com>
6398
6399         * socket-io.c:  Use the configure defines for HAVE_SOCKADDR_IN(6)_SIN_LEN
6400         rather than depend on __APPLE__.
6401
6402 2007-11-07  Mark Probst  <mark.probst@gmail.com>
6403
6404         * icall.c: Safety checks in InitializeArray.  Fixes bug #324535.
6405
6406 2007-11-06  Sebastien Pouliot  <sebastien@ximian.com> 
6407
6408         * object.c: Fix mono_string_to_utf8 to handle NULL values inside the
6409         UTF16 MonoString. Fix the crash from bug #335488
6410
6411 2007-11-06  Sebastien Pouliot  <sebastien@ximian.com>
6412
6413         * marshal.c: Correct (for non-Win32 OS) length != size in 
6414         mono_string_from_bstr. Fix #339530.
6415
6416 2007-11-06  Geoff Norton  <gnorton@novell.com>
6417
6418         * socket-io.c: Apple requires sin(6)_len to be set for getnameinfo
6419         to succeed
6420
6421 2007-11-05  Kornél Pál  <kornelpal@gmail.com>
6422
6423         * process.c: Added run-time GetProcessId API detection for Windows.
6424
6425 2007-11-04  Miguel de Icaza  <miguel@novell.com>
6426
6427         * reflection.c  (mono_param_get_objects): If a parameter has the
6428         attribute [System.Runtime.InteropServices.Optional] we should
6429         set the DefaultValue of the ParameterInfo to be
6430         System.Reflection.Missing instead of DBNull.
6431
6432         See bug #339013.
6433
6434         (mono_get_reflection_missing_object): New method,
6435         returns the System.Reflection.Missing.Value singleton instance.
6436
6437 2007-11-03  Atsushi Enomoto  <atsushi@ximian.com>
6438
6439         * culture-info-table.h : regenerated.
6440
6441 2007-11-02  Jonathan Chambers <joncham@gmail.com>
6442
6443         * icall.c: Use GetEnvironmentStrings on windows
6444         so we are using the same environment block as 
6445         GetEnvironmentVariable/SetEnvironmentVariable. Fixes
6446         #333740.
6447         
6448         Code is contributed under MIT/X11 license.
6449
6450 2007-10-31  Martin Baulig  <martin@ximian.com>
6451
6452         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 64.
6453
6454         * mono-debug-debugger.h
6455         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_TRAMPOLINE'.
6456
6457 2007-10-30  Zoltan Varga  <vargaz@gmail.com>
6458
6459         * reflection.c (mono_custom_attrs_from_class): Add support for dynamic inflated 
6460         classes.
6461
6462 2007-10-30  Atsushi Enomoto  <atsushi@ximian.com>
6463
6464         * culture-info-table.h : regenerated.
6465
6466 2007-10-30  Robert Jordan  <robertj@gmx.net>
6467
6468         * icall-def.h, icall.c:
6469         Add ves_icall_Remoting_RemotingServices_GetVirtualMethod ().
6470
6471         Code is contributed under MIT/X11 license.
6472
6473 2007-10-29  Zoltan Varga  <vargaz@gmail.com>
6474
6475         * class.c (mono_class_setup_vtable): Find the inflated methods in the
6476         inflated class instead of inflating them again.
6477         
6478         * class.c (mono_class_setup_vtable): Inflate the override methods in the 
6479         dynamic case.
6480
6481         * class.c (mono_generic_class_get_class): Set klass->property.count as well.
6482         Call setup_supertypes () after klass->parent is set.
6483         (mono_class_setup_properties): Enable this to work on dynamic generic classes.
6484
6485         * reflection.c (mono_type_get_object): Only return a MonoGenericClass object
6486         for inflated instances of not yet created dynamic generic classes.
6487         (ctorbuilder_to_mono_method): Handle the case when this is called multiple
6488         times from inflated_method.
6489         (methodbuilder_to_mono_method): Ditto.
6490
6491 Mon Oct 29 21:02:53 CET 2007 Paolo Molaro <lupus@ximian.com>
6492
6493         * gc.c: code cleanup and removed old untested option of not creating the
6494         finalizer thread.
6495
6496 2007-10-29  Zoltan Varga  <vargaz@gmail.com>
6497
6498         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Avoid
6499         creating a jump trampoline for dynamic methods.
6500
6501 2007-10-29 Rodrigo Kumpera <rkumpera@novell.com>
6502
6503         * reflection.c (mono_image_create_token): Correctly encode methods and constructors of
6504         generic TypeBuilders when called from another method of the same type (bug #335131).
6505
6506
6507 2007-10-27  Zoltan Varga  <vargaz@gmail.com>
6508
6509         * reflection.c (methodbuilder_to_mono_method): Revert the last change as it
6510         doesn't seem to work perfectly.
6511         
6512         * reflection.c (ctorbuilder_to_mono_method): Handle the case when this is
6513         called multiple times.
6514         (methodbuilder_to_mono_method): Ditto.
6515         (resolve_object): Inflate FieldBuilder's.
6516
6517 Fri Oct 26 19:38:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
6518
6519         * string-icalls.c, string-icalls.h, appdomain.c: patch from
6520         Tyler Larson <mono-devel@tlarson.com> to fix the handling of
6521         RemoveEmptyEntries in the string.Split implementation (bug #322375).
6522
6523 2007-10-26  Dick Porter  <dick@ximian.com>
6524
6525         * appdomain.c (MONO_CORLIB_VERSION): Bump version because of
6526         Thread initialisation changes
6527
6528 2007-10-26 Rodrigo Kumpera <rkumpera@novell.com>
6529
6530         * verify.c: fix compatibility check between arrays and System.Array
6531
6532 2007-10-26  Zoltan Varga  <vargaz@gmail.com>
6533
6534         * reflection.c (mono_reflection_get_custom_attrs_info): Handle MonoGenericClass
6535         too. Fixes #336999.
6536
6537 2007-10-25  Zoltan Varga  <vargaz@gmail.com>
6538
6539         * object.c (mono_value_box): Use typed allocation here.
6540
6541 2007-10-23  Zoltan Varga  <vargaz@gmail.com>
6542
6543         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Create a jump
6544         trampoline instead of compiling the method right away.
6545
6546         * class-internals.h object.c: Add a JIT callback to create a jump trampoline.
6547
6548 2007-10-21  Zoltan Varga  <vargaz@gmail.com>
6549
6550         * class.c (mono_generic_class_get_class): Avoid setting klass->size_inited and
6551         related fields for dynamic classes. Fixes #334493.
6552
6553 2007-10-20  Zoltan Varga  <vargaz@gmail.com>
6554
6555         * class.c (mono_generic_class_get_class): Set klass->field.count as well.
6556         
6557         * class.c (mono_class_layout_fields): Use 1 instead of TRUE for consistency.
6558
6559         * class.c (mono_class_layout_fields): Set size_inited for generic classes as well.
6560         (mono_class_setup_vtable): Obtain overrides for dynamic generic classes correctly.
6561
6562         * class.c (mono_class_setup_methods): Handle dynamic inflated classes correctly.
6563
6564         * reflection.c (create_generic_typespec): Initialize klass->generic_container
6565         if needed.
6566         (reflection_methodbuilder_to_mono_method): Set container->is_method to TRUE.
6567
6568 2007-10-18  Jonathan Chambers <joncham@gmail.com>
6569
6570         * marshal.c: Use correct key when removing item
6571         from ccw_hash.
6572         
6573         Code is contributed under MIT/X11 license.
6574
6575 2007-10-17  William Holmes  <billholmes54@gmail.com>
6576
6577         *marshal.c: Adding a case to marshal booleans to U1
6578
6579         Code is contributed under MIT/X11 license.
6580
6581 2007-10-18  Zoltan Varga  <vargaz@gmail.com>
6582
6583         * class.c (mono_class_from_name): Search the modules compromising dynamic
6584         assemblies. Fixes #331601.
6585
6586 2007-10-16  Zoltan Varga  <vargaz@gmail.com>
6587
6588         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Throw an
6589         exception if the type name contains an assembly component. Fixes #334203.
6590
6591         * reflection.c (mono_reflection_get_type_with_rootimage): Search all the
6592         modules inside dynamic assemblies. Fixes #334200.
6593         
6594         * reflection.c: Set image->public_key and image->public_key_length;
6595
6596         * metadata-internals.h (MonoDynamicImage): Add public_key and public_key_len
6597         fields.
6598
6599         * image.c (mono_image_get_public_key): Handle dynamic assemblies. Fixes #334173.        
6600         
6601 2007-10-16  Mark Probst  <mark.probst@gmail.com>
6602
6603         * metadata.c: Implemented correct comparing of generic classes.
6604         An inflated generic class can be equal to a non-inflated one if it
6605         is inflated with generic type variables as type arguments.  Fixes
6606         bug #333798.
6607
6608 2007-10-15  Dick Porter  <dick@ximian.com>
6609
6610         * monitor.c (mono_monitor_try_enter_internal): Set thread state to
6611         WaitSleepJoin while it is waiting to acquire a lock.  Fixes bug
6612         81646.
6613
6614         * threads.c: Turn the thread synch_lock into a CRITICAL_SECTION,
6615         instead of a monitor lock.  This means that monitor_try_enter and
6616         co can set the thread state safely.
6617         (ves_icall_System_Threading_Thread_Interrupt_internal): Always set
6618         thread_interrupt_requested, so interrupt actually works.
6619
6620         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal,
6621         ves_icall_System_Net_Sockets_Socket_Select_internal): Use thread
6622         state accessor function
6623
6624 2007-10-15  Martin Baulig  <martin@ximian.com>
6625
6626         * mono-debug.h
6627         (MONO_DEBUGGER_VERSION): Bump to 63 to make it impossible to use
6628         the debugger with the current runtime.
6629
6630 Mon Oct 15 10:20:56 CEST 2007 Paolo Molaro <lupus@ximian.com>
6631
6632         * object.c, object-internals.h: added the ability to set a single
6633         trampoline for all the slots in a vtable.
6634
6635 Fri Oct 12 17:50:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
6636
6637         * marshal.c: deal with a possible race condition during multicast
6638         delegate invocation.
6639
6640 Fri Oct 12 13:31:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
6641
6642         * class.c: ensure value type methods don't have the synchronized
6643         flag set.
6644
6645 Fri Oct 12 08:10:59 CEST 2007 Paolo Molaro <lupus@ximian.com>
6646
6647         * string-icalls.c, string-icalls.h: reverted unapproved patch that
6648         breaks the build.
6649
6650 2007-10-11  Joel Reed  <joelwreed@comcast.com>
6651
6652         * string-icalls.c, string-icalls.h: modify System_String_InternalSplit
6653         to take an options parameter so that empty entries can be removed during
6654         the split procedure. Patch from: Tyler Larson <mono-devel@tlarson.com>
6655
6656 Thu Oct 11 20:16:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
6657
6658         * marshal.c: make sure we don't store the signature from a dynamic
6659         method into the runtime invoke cache (bug #327189).
6660
6661 Thu Oct 11 18:22:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
6662
6663         * marshal.c: make sure the wrapper methods are properly initialized.
6664
6665 2007-10-11  Mark Probst  <mark.probst@gmail.com>
6666
6667         * metadata.c, metadata-internals.h: Generalized
6668         mono_type_stack_size() to mono_type_stack_size_internal() which
6669         takes an additional argument specifying whether it allows open
6670         types.
6671
6672 2007-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
6673
6674         * verify.c (do_invoke_method): handle typedbyref params
6675         correctly and check for unverifiable return values.
6676
6677         * verify.c (do_newobj): fix a warning.
6678
6679 2007-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
6680
6681         * verify.c: don't tread typedbyref as allways unverifable,
6682         so uses, like (ld/st)loc.0 are valid. verify for the cases
6683         that it matters, like boxing related operations.
6684
6685 2007-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
6686
6687         * verify.c: add verification of the newobj opcode. verification
6688         of delegate instantation still missing due ldftn and virldftn not
6689         pushing the function type on stack
6690
6691 2007-10-08  Mark Probst  <mark.probst@gmail.com>
6692
6693         * class-internals.h: Runtime generic context data structure
6694         definition.
6695
6696         * object.c: Initialization of runtime generic context at runtime
6697         vtable creation time.
6698
6699 2007-10-08  Massimiliano Mantione  <massi@ximian.com>
6700         * class.c (mono_class_create_from_typedef,
6701         mono_class_from_generic_parameter, mono_ptr_class_get,
6702         mono_fnptr_class_get, mono_bounded_array_class_get)
6703         * domain.c (mono_domain_create, mono_domain_free)
6704         * assembly.c (mono_assembly_load_from_full, mono_assembly_close)
6705         * image.c (do_mono_image_load, mono_image_close):
6706         Hooked up load-unload profiler events.
6707
6708 Mon Oct 8 11:38:04 CEST 2007 Paolo Molaro <lupus@ximian.com>
6709
6710         * domain.c: track statistics about the actual amount of native code
6711         allocated.
6712
6713 Sat Oct 6 10:01:42 CEST 2007 Paolo Molaro <lupus@ximian.com>
6714
6715         * class.c: the valuetype enumerators don't have the additional
6716         supertypes interfaces.
6717
6718 Fri Oct 5 20:33:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
6719
6720         * class.c: need more interfaces setup for the IEnumerator<T>
6721         object created for arrays (tests/ienumerator-interfaces.2.cs).
6722
6723 2007-10-05  Zoltan Varga  <vargaz@gmail.com>
6724
6725         * class.c (mono_ldtoken): Handle methodspec tokens as well. Fixes #331097.
6726
6727 2007-10-05  Alp Toker  <alp@atoker.com>
6728
6729         * icall.c (ves_icall_MonoType_GetElementType): For enums, return null
6730         rather than the underlying type. Based on a patch by Ben Maurer. Fixes
6731         #315863.
6732
6733 2007-10-04  Rodrigo Kumpera  <rkumpera@novell.com>
6734
6735         * verify.c (verify_type_compatibility_full): verification of
6736         compatibility improved, validates correctly non-strict checks between
6737         native int and I4 types different than (unsigned)int32.
6738
6739         * verify.c (do_store_indirect): added, do all verification of
6740         ldind.X opcodes. 
6741
6742         * verify.c (get_load_indirect_mono_type): renamed to
6743         get_indirect_op_mono_type, as it now returns the MonoType for 
6744         ldind.X and stind.X opcodes.
6745
6746 2007-10-04  Rodrigo Kumpera  <rkumpera@novell.com>
6747
6748         * reflection.c: Fix the encoding of generic type definition for
6749         TypeBuilders.
6750
6751         * reflection.c (mono_image_typedef_or_ref_full: do the same thing as
6752         mono_image_typedef_or_ref but allows to specify if typespec lookups should
6753         be made. Typespec check is done prior to typeref cache lookup.
6754
6755         * reflection.c (mono_image_typedef_or_ref): now just delegate to
6756         mono_image_typedef_or_ref_full.
6757
6758         * reflection.c (encode_generic_class): encode the generic class
6759         directly instead of calling encode_type.
6760
6761         * reflection.c (encode_type): encode the generic type definition
6762         MonoClass as a generic instantiation.
6763
6764         * reflection.c (create_typespec): cache typespec tokens in
6765         the assembly->typespec cache. Don't create typespec for a generic
6766         instance MonoClass. Create typespec for the generic type defintion.
6767
6768         * reflection.c (create_generic_typespec): encode the generic
6769         class directly instead of calling encode_type.
6770
6771         * reflection.c (mono_image_create_token): encode the generic
6772         type definition not using a typespec for MonoType instances.
6773
6774
6775 2007-10-04  Raja R Harinath  <rharinath@novell.com>
6776
6777         Fix #328812
6778         * class.c (mono_image_init_name_cache): Don't return nested
6779         'protected internal' classes.
6780         (mono_class_from_name_case): Likewise.
6781
6782 2007-10-04  Atsushi Enomoto  <atsushi@ximian.com>
6783
6784         * icall-def.h, icall.c : get_bundled_machine_config() is now the
6785           common function used by both DefaultConfig in System.dll and
6786           InternalConfigurationHost in System.Configuration.dll.
6787
6788 Wed Oct 3 17:26:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
6789
6790         * class.c: automatically add to vectors only a few essential explicit
6791         generic interfaces. The rest of the interfaces that arrays should
6792         provide are currently implicitly added (but still not lazily, see the
6793         design in the discussion of bug#325495 for the details of what is
6794         needed for that). Additionally, implicit interfaces are assigned the
6795         same vtable slot as the explicit interfaces (as they are compatible):
6796         this enables huge memory savings since we don't need to instantiate
6797         as many memthods and as large vtables anymore. Also, Since
6798         GetEnumerator<T> returns an instance of a type that is required to
6799         support a similarly large set of interfaces as arrays, we add
6800         implicit interfaces and interface offset sharing support to those
6801         types, too. This change adds all the required interfaces so that
6802         the anonarray.cs test case in the bug report works (we don't add
6803         all the interfaces to arrays of arrays 3-level deep and more because
6804         of the memory requirements explained in the bug and since they are much
6805         less common: the lazy-loading support will enabled them to work, too).
6806
6807 2007-10-02  Rodrigo Kumpera  <rkumpera@novell.com>
6808
6809         * verify.c (merge_stacks): major clean up, all type compatibility
6810         checks are done by verify_type_compatibility. This fix my earlier lack
6811         of understanding of the CLR type system and merge_stacks no longer looks
6812         scary.
6813
6814         * verify.c: fixed some bad spelling.
6815
6816 2007-10-02  Rodrigo Kumpera  <rkumpera@novell.com>
6817
6818         * verify.c (mono_type_from_stack_slot): added. returns the MonoType for
6819         a given stack slock.
6820         
6821         * verify.c: killed verify_type_compat in favor of verify_type_compatibility and
6822         verify_type_compatibility_full. This removed a near indentical function and fixed
6823         handling of Int32 and IntPtr across all opcodes.
6824
6825 Tue Oct 2 15:24:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
6826
6827         * class.c: only vectors have the additional generic interfaces.
6828
6829 2007-10-01  Jonathan Chambers <joncham@gmail.com>
6830
6831         * mono-config.c: Use g_strcasecmp instead of
6832         strcasecmp like everywhere else to fix
6833         compilation with MSVC.
6834         
6835         Code is contributed under MIT/X11 license.
6836
6837 Mon Oct 1 14:39:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
6838
6839         * object.c, object-internals.h: refactored the IMT code to enable
6840         building a single slot at a time and lazily creating the IMT trampolines
6841         and thunks.
6842
6843 2007-09-29  Zoltan Varga  <vargaz@gmail.com>
6844
6845         * loader.c (inflate_generic_signature): Allocate inflated signatures from the heap.
6846
6847         * metadata.c (mono_metadata_free_inflated_signature): Free the signature itself too.
6848         Fixes #328501.
6849         
6850 2007-09-29  Raja R Harinath  <harinath@gmail.com>
6851
6852         * loader.c (method_from_methodspec): Rearrange to avoid
6853         un-necessary exposition.  Don't assert out if the method's
6854         declaring type is a generic type definition.
6855
6856 2007-09-28  Martin Baulig  <martin@ximian.com>
6857
6858         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 61.
6859
6860 Fri Sep 28 20:15:47 CEST 2007 Paolo Molaro <lupus@ximian.com>
6861
6862         * class-internals.h: optimize field layout of MonoClass to
6863         requires less cachelines at runtime and save a few bytes on 64 bit
6864         systems.
6865
6866 2007-09-28  Jb Evain  <jbevain@novell.com>
6867
6868         * reflection.c: when encoding type names in custom attributes,
6869         if the type is a closed generic type, its generic arguments
6870         have to be serialized as AssemblyQualifiedName, so that when
6871         they are deserialized, it's possible to re-create them properly.
6872         Fixes #329450.
6873
6874
6875 Fri Sep 28 19:19:49 CEST 2007 Paolo Molaro <lupus@ximian.com>
6876
6877         * object.c, class-internals.h: added delegate-creation counter.
6878
6879 Fri Sep 28 18:07:53 CEST 2007 Paolo Molaro <lupus@ximian.com>
6880
6881         * class.c: cleanup of the code that synthetizes interfaces for
6882         arrays in 2.0: saves quit a bit of corlib mempool memory.
6883         Code to fix bug #325495 ifdeffed out for now until the issues
6884         with memory usage and O(n^2) behaviour are fixed.
6885
6886 Fri Sep 28 17:19:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
6887
6888         * marshal.c: when possible, do not duplicate the name of the methods
6889         in the method builder and in the generated MonoMethod.
6890
6891 2007-09-27  Rodrigo Kumpera  <rkumpera@novell.com>
6892         * verify.c: added support for type checking ldind_* opcodes.
6893
6894 2007-09-27  Rodrigo Kumpera  <rkumpera@novell.com>
6895
6896         * class-internals.h (struct _MonoGenericClass): new field is_tb_open
6897         which is used to distinguish the fully open instantiation of a TypeBuilder
6898         with the rest. This temporary hack is required to restore the property that
6899         the fully open instantiation is the same type of the generic type definition.
6900
6901         * class-internals.h (mono_generic_class_is_generic_type_definition):
6902         new function as part of the internal API.
6903
6904         * class.c (inflate_generic_type): return NULL when the generic inst is
6905         fully open. The fully open generic type is now the same as the generic type
6906         definition for non TypeBuilder types.
6907
6908         * class.c (mono_generic_class_get_class): removed assert since it is
6909         no longer valid, gklass->cached_class can point to the generic type definition.
6910
6911         * class.c (mono_generic_class_is_generic_type_definition): new.
6912
6913         * metadata.c (mono_generic_class_hash): added is_tb_open field
6914         to the hash calculation.
6915
6916         * metadata.c (free_generic_class): if the generic class is associated
6917         with the generic type definition, its field will come from the mempool and
6918         must not be freed.
6919
6920         * metadata.c (mono_metadata_is_type_builder_generic_type_definition):
6921         new, this function identifies the corner case of a TypeBuilder fully open
6922         instantiation.
6923
6924         * metadata.c (mono_metadata_lookup_generic_class): use is_tb_open
6925         for lookup. Set gclass->cached_class to be the container class in case of
6926         the fully open instantiation of non TypeBuilder types.
6927
6928         * metadata.c (_mono_metadata_generic_class_equal): use is_tb_open
6929         to compare generic classes.
6930
6931         * reflection.c (method_encode_methodspec): remove assert that
6932         no longer is valid.
6933
6934         * reflection.c (mono_reflection_generic_class_initialize): add
6935         an aditional assert to ensure the proper type is used.
6936
6937 2007-09-26  Rodrigo Kumpera  <rkumpera@novell.com>
6938
6939         * verify.c: disabled all debug spew by default, define MONO_VERIFIER_DEBUG
6940         to enjoy it.
6941
6942 2007-09-25  Rodrigo Kumpera  <rkumpera@novell.com>
6943
6944         * verify.c (push_arg): Fixed support for ldarga
6945         * verify.c (set_stack_value): Removed superfluous parameter, fixed the
6946         MonoType used as first arg in case of instance calls.
6947
6948 2007-09-25  Rodrigo Kumpera  <rkumpera@novell.com>
6949
6950         * verify.c: Support for verifying VAR and MVAR types, 
6951
6952 2007-09-25  Zoltan Varga  <vargaz@gmail.com>
6953
6954         * icall.c (ves_icall_get_property_info): Set the reflected type of the
6955         accessors correctly.
6956
6957 Tue Sep 25 14:56:03 CEST 2007 Paolo Molaro <lupus@ximian.com>
6958
6959         * threads.c: support OSX and other systems in
6960         mono_thread_get_stack_bounds (bug #328026).
6961
6962 2007-09-25  Martin Baulig  <martin@ximian.com>
6963
6964         * mono-debug.h
6965         (MonoDebugVarInfo): Replace `MonoClass *klass' with `MonoType *type'.
6966
6967 2007-09-24  Martin Baulig  <martin@ximian.com>
6968
6969         * mono-debug.h
6970         (MonoDebugClassEntry): Moved the definition of this struct into
6971         mono-debug.c to make it private.
6972
6973         * mono-debug.c
6974         (MonoDebugClassEntry): Removed `symfile_id'; since we now use one
6975         type table per symbol file, we don't need to store the symfile id
6976         any longer.
6977
6978 2007-09-24  Martin Baulig  <martin@ximian.com>
6979
6980         Create one type table per symbol file, since a `MonoClass *' gets
6981         invalid when its image is unloaded.
6982
6983         * mono-debug.h (MonoSymbolTable): Removed `type_table'.
6984         (MonoDebugHandle): Added `type_table'.
6985
6986 Mon Sep 24 17:25:43 CEST 2007 Paolo Molaro <lupus@ximian.com>
6987
6988         * mempool.c, mempool.h: added mono_mempool_new_size () API
6989         to be able to specify a smaller initial size for the pool.
6990         Adjusted the code to slowly increase pool size before using
6991         the previous default size.
6992         * image.c: use a small initial size for image mempools.
6993
6994 2007-09-23  Zoltan Varga  <vargaz@gmail.com>
6995
6996         * marshal.c (emit_marshal_array): Generate valid IL for byref array case.
6997         Fixes ##320990.
6998
6999         * icall.c (ves_icall_System_Reflection_Assembly_get_ManifestModuleInternal): 
7000         Rename this to ves_icall_System_Reflection_Assembly_GetManifestModuleInternal.
7001
7002 2007-09-22  Zoltan Varga  <vargaz@gmail.com>
7003
7004         * metadata.c (mono_type_create_from_typespec): Remove an invalid
7005         free. Fixes #327438.
7006
7007 2007-09-21  Raja R Harinath  <harinath@gmail.com>
7008
7009         * metadata.c (type_in_image) <MONO_TYPE_SZARRAY>: Handle arrays of
7010         generic instantiations, etc.
7011         <MONO_TYPE_ARRAY>: Likewise.
7012
7013 2007-09-21  Martin Baulig  <martin@ximian.com>
7014
7015         * mono-debug.h (MonoSymbolFilePriv, MonoDebugHandlePriv): Removed;
7016         these structs were never defined.
7017         (MonoDebugHandle): Removed the `_priv' field, it was never used.
7018
7019 2007-09-21  Martin Baulig  <martin@ximian.com>
7020
7021         * mono-debug.h (MonoDebugVarInfo): Add `MonoClass *klass'.
7022
7023 Fri Sep 21 14:39:45 CEST 2007 Paolo Molaro <lupus@ximian.com>
7024
7025         * image.c: removed the guid hash tables: we can get the same info
7026         without the additional memory usage hit (partially fixes also bug #327052).
7027
7028 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
7029
7030         * profiler.h, profiler-private.h, profiler.c: add a new profiler
7031         event to handle unloading methods. After the event is called, the
7032         corresponding MonoMethod* must be considered invalid.
7033         * loader.c (mono_free_method): call the new mono_profiler_method_free
7034         event.
7035
7036 2007-09-20  Mark Probst  <mark.probst@gmail.com>
7037
7038         * domain-internals.h: New flag in MonoJitInfo which marks shared
7039         generic methods.  New hash table (shared_generics_hash) in
7040         MonoDomain to keep track of shared generic methods.  Prototypes
7041         for functions to register and lookup shared generic methods.
7042
7043         * domain.c: Support for registering and looking up shared generic
7044         methods via a hash table (shared_generics_hash) in MonoDomain.
7045
7046         * class-internals.h: New exception to signal failure of shared
7047         compilation of a generic method.  New counters for generics
7048         sharing in MonoStats.
7049
7050 Thu Sep 20 16:59:36 CEST 2007 Paolo Molaro <lupus@ximian.com>
7051
7052         * image.c, metadata-internals.h: don't keep a file descriptor open
7053         for loaded assemblies (bug#325988).
7054
7055 2007-09-19  Raja R Harinath  <rharinath@novell.com>
7056
7057         * metadata.c (signature_in_image): New.  Carve out of type_in_image.
7058         (ginst_in_image, gclass_in_image): Simplify.  Change signature to
7059         use the corresponding datatypes.
7060         (type_in_image): Update to changes.
7061         (CleanForImageUserData): Simplify.
7062         (steal_gclass_in_image): Carved out of old 'gclass_in_image'.
7063         Avoid quadratic behaviour in handling the "stolen" list by
7064         separating the filter predicate out, and by prepending the stolen
7065         items rather than appending them.
7066         (steal_ginst_in_image): Likewise.
7067         (mono_metadata_clean_for_image): Update to changes.
7068
7069 2007-09-19  Martin Baulig  <martin@ximian.com>
7070
7071         * domain.c (mono_cleanup): Call mono_debug_cleanup() here.
7072
7073 2007-09-19  Martin Baulig  <martin@ximian.com>
7074
7075         * mono-debug.c (mono_debug_cleanup): Don't call
7076         mono_debugger_cleanup(); this is now called earlier from mini_cleanup().
7077
7078 2007-09-19  Raja R Harinath  <harinath@gmail.com>
7079
7080         Fix crash on 'make run-test' in mcs/errors
7081         * metadata.c (type_in_image): New.  Carve out of ginst_in_image.
7082         Avoid more potential allocations in mono_class_from_mono_type.
7083         (ginst_in_image): Update to changes.
7084         (gclass_in_image): Rearrange slightly.
7085
7086 2007-09-18  Zoltan Varga  <vargaz@gmail.com>
7087
7088         * class.c (mono_class_init): Move the code that sets up class->methods to 
7089         mono_class_setup_methods () for inflated generic classes too. Ditto for properties.
7090
7091         * metadata.c (mono_metadata_get_inflated_signature): New function to return a
7092         canonical instance of an inflated generic signature.
7093         (mono_type_create_from_typespec): Remove an invalid free.
7094
7095         * loader.c (mono_method_get_signature_full): Use mono_metadata_get_inflated_signature.  
7096
7097 2007-09-18  Marek Habersack  <mhabersack@novell.com>
7098
7099         * domain-internals.h: added a declaration of the
7100         mono_assembly_load_full_nosearch internal function.
7101
7102         * assembly.c (mono_assembly_load_with_partial_name): use
7103         mono_try_assembly_resolve return value properly.
7104         (mono_assembly_load_full_nosearch): copied the function body from
7105         mono_assembly_load_full, without the code to invoke assembly
7106         search hooks.
7107         (mono_assembly_load_full): calls the above new function and if the
7108         assembly is not resolved, invokes the search hooks.
7109
7110         * appdomain.c (mono_runtime_init): restore the global postload
7111         assembly search handlers.
7112
7113 2007-09-18  Zoltan Varga  <vargaz@gmail.com>
7114
7115         * class.c (mono_class_init): Make sure class->methods and class->properties
7116         are never NULL in the generics case.
7117
7118         * metadata.c (free_generic_class): Enable this again, skip the dynamic case.
7119
7120 2007-09-17  Zoltan Varga  <vargaz@gmail.com>
7121
7122         * metadata.c (free_generic_class): Disable some code to fix the build.
7123
7124         * domain.c (mono_cleanup): Fix a crash introduced by a previous patch.
7125
7126         * marshal.c (mono_marshal_get_xappdomain_dispatch): Allocate a piece of data
7127         from the image mempool.
7128
7129         * metadata.c (free_generic_class): Free more data from the inflated class.
7130
7131         * class.c (mono_class_from_generic_parameter): Allocate memory from the mempool.
7132
7133         * metadata.c (mono_metadata_parse_generic_param): Allocate memory from the image
7134         mempool.
7135         (mono_type_create_from_typespec): Ditto.
7136
7137         * domain.c (get_runtimes_from_exe): Add an out parameter to return the opened
7138         MonoImage to the caller.
7139         (mono_init_internal): Save the opened image in a global variable.
7140         (mono_cleanup): Close the image opened in get_runtimes_from_exe.
7141
7142         * reflection.c (resolve_object): Fix a leak.
7143
7144         * metadata.c: Fix the freeing of data in the generics caches.
7145         
7146         * metadata.c (free_generic_inst): Comment this out to fix the build.
7147         (free_generic_class): Ditto.
7148
7149         * metadata.c: Free cached generic methods, instantinations and classes when
7150         they are removed from the caches.
7151         (mono_metadata_free_type): Free the type itself.
7152
7153         * class.c: Free the result of mono_class_inflate_generic_type () in a few
7154         places.
7155
7156 Mon Sep 17 16:14:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
7157
7158         * boehm-gc.c: restrict managed allocs to __thread supporting
7159         architectures.
7160
7161 2007-09-16  Zoltan Varga  <vargaz@gmail.com>
7162
7163         * class.c (mono_class_inflate_generic_type): Add a comment describing memory ownership.
7164         (mono_generic_class_get_class): Fix a leak.
7165
7166         * metadata.c (do_mono_metadata_parse_type): Remove an unneccesary call to
7167         mono_metadata_free_type ().
7168         (mono_metadata_inflate_generic_inst): Fix a leak.
7169
7170 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
7171
7172         * mono-debug.c (free_header_data): Fix a leak missed earlier.
7173
7174         * metadata.c (mono_metadata_parse_array_full): Allocate memory from the image
7175         mempool.
7176
7177         * mono-debug.c (mono_debug_close_image): Fix call to 
7178         g_hash_table_remove ().
7179
7180 Fri Sep 14 19:36:37 CEST 2007 Paolo Molaro <lupus@ximian.com>
7181
7182         * icall-def.h: redirect all the string ctor to the managed
7183         CreateString () methods.
7184         * string-icalls.c, string-icalls.h: removed dead code for string
7185         ctors and icalls.
7186
7187 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
7188
7189         * mono-debug.c: Fix memory leaks.
7190
7191 2007-09-14  Jonathan Chambers <joncham@gmail.com>
7192
7193         * threads-types.h: Implement mono_hazard_pointer_set and 
7194         mono_hazard_pointer_clear macros using do/while(0) to fix
7195         compilation with MSVC.
7196         
7197         Code is contributed under MIT/X11 license.
7198
7199 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
7200
7201         * gc.c (ves_icall_System_GCHandle_GetAddrOfPinnedObject): Use a return value of
7202         -2 to communicate to managed code that the handle is not pinned. Fixes #82848.
7203
7204 Fri Sep 14 14:04:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
7205
7206         * icall-def.h, string-icalls.c: get rid of old, no longer used, string
7207         icalls.
7208
7209 Fri Sep 14 11:41:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
7210
7211         * boehm-gc.c, gc-internal.h, object.c: allow strings to be
7212         managed-code allocated as well.
7213
7214 2007-09-13  Zoltan Varga  <vargaz@gmail.com>
7215
7216         * class.c (mono_class_is_assignable_from): Add support for generic variance.
7217
7218 Thu Sep 13 11:55:55 CEST 2007 Paolo Molaro <lupus@ximian.com>
7219
7220         * boehm-gc.c: fixed the build after the AOT changes.
7221
7222 2007-09-13  Zoltan Varga  <vargaz@gmail.com>
7223
7224         * wrapper-types.h: Add an ALLOC wrapper type.
7225
7226         * gc-internals.h boehm-gc.c null-gc.c sgen-gc.c: Add functions needed by AOT to
7227         reference managed allocator methods.
7228
7229 2007-09-12  Marek Safar  <marek.safar@gmail.com>
7230
7231         * icall.c (ves_icall_MonoType_GetGenericArguments): Create an instance
7232         of Type array and not MonoType, a fix suggested by Hari.
7233         
7234 2007-09-12  Jonathan Chambers <joncham@gmail.com>
7235
7236         * domain-internals.h, domain.c : Remove delegate_invoke_impl_with_target_hash
7237         and delegate_invoke_impl_no_target_hash from _MonoDomain struct.
7238         
7239         Code is contributed under MIT/X11 license.
7240
7241 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
7242
7243         * domain.c, object.c, mono-config.c, object-internals.h: Fixed  #82416.
7244
7245 2007-09-12  Marek Habersack  <mhabersack@novell.com>
7246
7247         * image.c (do_mono_image_open): if assembly file fails to open and
7248         MONO_IOMAP is in effect, try to find the path in a
7249         case-insensitive way.
7250
7251         * appdomain.c (mono_runtime_init): do not install postload hooks -
7252         tests show that MS.NET doesn't use anything of that sort to
7253         trigger the AppDomain.AssemblyResolve event.
7254         (mono_try_assembly_resolve): renamed from try_assembly_resolve and
7255         made non-static.
7256         (mono_runtime_init): init portability helpers here.
7257
7258         * assembly.c (mono_assembly_load_with_partial_name): if other   
7259         attempts fail, trigger the AppDomain.AssemblyResolve event handler
7260         to resolve the assembly.
7261
7262         * domain-internals.h: added mono_try_assembly_resolve and marked
7263         it as internal.
7264
7265 2007-09-11  Jb Evain  <jbevain@novell.com>
7266
7267         * object-internals.h (MonoReflectionDynamicMethod): add
7268         a `MonoReflectionType *owner` field. The owner is used
7269         * reflection.c:
7270         (mono_reflection_create_dynamic_method): use the owner of the dynamic
7271         method as the class declaring the dynamic method.
7272         (reflection_methodbuilder_from_dynamic_method): copy the owner of the
7273         dynamic method to the declaring type of the methodbuilder.
7274
7275 2007-09-11  Mark Probst  <mark.probst@gmail.com>
7276
7277         * icall.c (ves_icall_InternalInvoke): Enforce CoreCLR security
7278         rules for calling methods via reflection.
7279
7280 2007-09-11  Zoltan Varga  <vargaz@gmail.com>
7281
7282         * reflection.c (resolve_object): Add support for MonoGenericClass. 
7283         Inflate MonoType's.
7284
7285 Tue Sep 11 16:08:08 CEST 2007 Paolo Molaro <lupus@ximian.com>
7286
7287         * gc-internal.h, boehm-gc.c, null-gc.c, sgen-gc.c: allow the GC to
7288         provide a managed method that does fast allocations without needing
7289         a managed->unmanaged transition. Boehm GC implementation currently
7290         enabled for ptrfree objects on sane architectures.
7291
7292 Tue Sep 11 16:00:35 CEST 2007 Paolo Molaro <lupus@ximian.com>
7293
7294         * marshal.c, marshal.h: exported a couple of useful functions and
7295         added mono_mb_get_label () to easily handle backward branches.
7296
7297 2007-09-10  Zoltan Varga  <vargaz@gmail.com>
7298
7299         * reflection.c (resolve_object): Inflate generic methods. Fixes #82782.
7300
7301 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
7302
7303         * loader.c (find_method): Fixed the regression introduced while
7304         fixing bug #81466.
7305
7306 2007-09-09  Zoltan Varga  <vargaz@gmail.com>
7307
7308         * class.c (mono_lookup_dynamic_token_class): Pass along the context here as
7309         well.
7310         
7311         * class.c loader.c metadata.c object.c class-internals.h object-internals.h
7312         icall.c reflection.c: Pass a MonoGenericContext argument to 
7313         mono_lookup_dynamic_token ().
7314
7315         * reflection.c (resolve_object): Handle GenericTypeParameterBuilder. Fixes
7316         #82744.
7317         
7318 2007-09-09  Robert Jordan  <robertj@gmx.net>
7319
7320         * object.c (mono_class_proxy_vtable): Don't create remoting trampolines
7321         for generic methods.
7322
7323         * object.c (mono_object_get_virtual_method): Handle generic methods.
7324         Fixes bug #78882.
7325
7326         Code is contributed under MIT/X11 license.
7327
7328 Sat Sep 8 18:16:01 CEST 2007 Paolo Molaro <lupus@ximian.com>
7329
7330         * image.c: fix locking in mono_image_load_file_for_image ().
7331
7332 Thu Sep 6 19:48:00 CEST 2007 Paolo Molaro <lupus@ximian.com>
7333
7334         * reflection.c, icall.c, icall-def.h: the methodinfos name field is
7335         used only as a cache: added an icall to fill it.
7336
7337 2007-09-16  Rodrigo Kumpera  <rkumpera@novell.com>
7338
7339         * reflection.h: exposed mono_reflection_free_type_info
7340         * reflection.c (mono_reflection_get_type_internal): type_args is always freed
7341         since mono_reflection_bind_generic_parameters makes a copy of it.
7342         * reflection.c (free_type_info): subinfos should be freed.
7343         * reflection.c (free_type_info): renamed to mono_reflection_free_type_info and 
7344         made non static.
7345         * icall.c (type_from_name and ves_icall_System_Reflection_Assembly_InternalGetType):
7346         replaced explicit cleanup of MonoTypeNameParse struct with a call to mono_reflection_free_type_info,
7347         this fixes #82695 and #81726.
7348    
7349
7350 2007-09-03  Atsushi Enomoto  <atsushi@ximian.com>
7351
7352         * process.h, process.c:  added support for user profile/info in
7353           ProcessStartInfo. For now only Windows works.
7354
7355 Fri Aug 31 17:30:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
7356
7357         * metadata.c: consider the generic arguments when comparing
7358         signatures (bug #82614).
7359
7360 Thu Aug 30 18:34:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
7361
7362         * cil-coff.h, image.c: updated assembly loader to cope with the
7363         PE32+ 64 bit file format.
7364
7365 Thu Aug 30 16:47:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
7366
7367         * assembly.c, class.c, domain.c, loader.c: remove useless
7368         inclusion of cil-coff.h.
7369
7370 2007-08-29  Jonathan Chambers  <joncham@gmail.com>
7371
7372         * marshal.c (cominterop_get_ccw): Walk up interface hierarchy
7373         if interface is marked with CoClassAttribute. 
7374    
7375         Code is contributed under MIT/X11 license.
7376
7377 Wed Aug 29 19:27:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
7378
7379         * sgen-gc.c: ensure no object from the to space is copied again or finalized
7380         if it's seen twice in major collections.
7381
7382 Wed Aug 29 18:46:49 CEST 2007 Paolo Molaro <lupus@ximian.com>
7383
7384         * sgen-gc.c: big objects are not copied to the gray area, but they
7385         need to be considered for scanning, too, if they are brought alive
7386         by an object ready for finalizations or a survived one.
7387
7388 Wed Aug 29 18:43:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
7389
7390         * sgen-gc.c: properly account the number of disappearing links when
7391         they are nullified.
7392
7393 Wed Aug 29 18:37:37 CEST 2007 Paolo Molaro <lupus@ximian.com>
7394
7395         * sgen-gc.c: share the code to scan the registered roots between the
7396         different types of collections.
7397
7398 2007-08-28  Zoltan Varga  <vargaz@gmail.com>
7399
7400         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunModuleConstructor): New icall.
7401
7402 2007-08-28  Zoltan Varga  <vargaz@gmail.com>
7403
7404         * object.c (mono_class_proxy_vtable): Use max_interface_id instead of
7405         class->max_interface_id in a one place. Fixes transparentproxy.exe test on ia64.
7406
7407 2007-08-28  Mark Probst  <mark.probst@gmail.com>
7408
7409         * security-manager.c (mono_security_manager_get_methods):
7410         LinkDemandSecurityException now has 2 arguments instead of 3.
7411
7412 2007-08-27  Zoltan Varga  <vargaz@gmail.com>
7413
7414         * class.c (mono_class_layout_fields): Only do the struct alignment hack on
7415         platforms which need it.
7416
7417 Mon Aug 27 18:29:12 CEST 2007 Paolo Molaro <lupus@ximian.com>
7418
7419         * sgen-gc.c: unregister thread data structures with a pthread_key_t
7420         dtor.
7421
7422 Mon Aug 27 18:27:35 CEST 2007 Paolo Molaro <lupus@ximian.com>
7423
7424         * threads.c: free the thread static data on thread exit.
7425
7426 Mon Aug 27 10:55:54 CEST 2007 Paolo Molaro <lupus@ximian.com>
7427
7428         * class.c: walk the hierarchy to find the generic definition for
7429         a class (fixes runtime part of bug #82498).
7430
7431 2007-08-24  Zoltan Varga  <vargaz@gmail.com>
7432
7433         * assembly.c (mono_assembly_close): Move the closing of the referenced assemblies to
7434         ...
7435
7436         * image.c (mono_image_close): Here. Hopefully fixes #82510.
7437
7438 2007-08-24  Mark Probst  <mark.probst@gmail.com>
7439
7440         * monodiet.c (handle_cattrs): Fixed a custom attr leak.
7441
7442 2007-08-24  Robert Jordan  <robertj@gmx.net>
7443
7444         * appdomain.c: don't perform the ':'->';' substitution on Win32.
7445
7446 2007-08-24  Jb Evain  <jbevain@novell.com>
7447
7448         * class.c (mono_type_get_name_recurse): fix AssemblyQualifiedName
7449         for byref types.
7450
7451 2007-08-24  Mark Probst  <mark.probst@gmail.com>
7452
7453         * threads.c: Make sure a thread gets cleaned up only once.  Fixes
7454         #82286.
7455
7456 2007-08-24  Zoltan Varga  <vargaz@gmail.com>
7457
7458         * assembly.c: Fix a warning.
7459         
7460 2007-08-23  Marek Habersack  <mhabersack@novell.com>
7461
7462         * appdomain.c: parse the <runtime> section looking for the probing
7463         element with the 'privatePath' attribute, which sets additional
7464         directories in which the runtime should look for assemblies.
7465
7466 2007-08-23  Robert Jordan  <robertj@gmx.net>
7467
7468         * marshal.c (Marshal_ReAllocHGlobal) : Fix GlobalReAlloc's flags.
7469         Fixes #82499.
7470
7471 2007-08-23  Martin Baulig  <martin@ximian.com>
7472
7473         * mono-debug.[ch]: Rename mono_debug_init_corlib() into
7474         _mono_debug_init_corlib() and remove it from the header file.
7475
7476 2007-08-23  Martin Baulig  <martin@ximian.com>
7477
7478         * mono-debug-debugger.c
7479         (mono_debugger_unhandled_exception): Ignore `ThreadAbortException';
7480         don't notify the debugger about it.
7481
7482         * mono-debug-debugger.h
7483         (MonoDebuggerEvent): Removed `THREAD_ABORT'.
7484
7485 2007-08-23  Robert Jordan  <robertj@gmx.net>
7486
7487         * icall-def.h, process.*: implemented Get|SetPriorityClass icalls.
7488         Code is contributed under MIT/X11 license.
7489
7490 Wed Aug 22 18:35:12 CEST 2007 Paolo Molaro <lupus@ximian.com>
7491
7492         * sgen-gc.h, sgen-gc.c: abstracted most of the OS-specific code.
7493
7494 2007-08-22  Martin Baulig  <martin@ximian.com>
7495
7496         * mono-debug.c: Store debugging info on a per-domain basis and
7497         free it on domain unload.  Add support for unloading symbol files.
7498
7499         * mono-debug.h
7500         (MonoDebugList): New typedef.
7501         (MonoSymbolTable):
7502         - add `data_tables and `type_table'.
7503         - replace 'symbol_files' and `num_symbol_files' with a
7504           `MonoDebugList *'.
7505         (mono_debug_data_table): Removed.
7506         (mono_debug_list_add): New public function.
7507         (mono_debug_list_remove): New public function.
7508         (mono_debug_init_1): Renamed into mono_debug_init_corlib().
7509         (mono_debug_init_2_memory): Renamed into
7510         mono_debug_open_image_from_memory().
7511         (mono_debug_close_image): New public function.
7512         (mono_debug_domain_create): Likewise.
7513         (mono_debug_domain_unload): Likewise.
7514         (MONO_DEBUGGER_VERSION): Bump to 60.
7515
7516         * mono-debug-debugger.h
7517         (MonoDebuggerEvent):
7518         - remove `RELOAD_SYMTABS' and `METHOD_COMPILED'.
7519         - rename `ADD_MODULE' into `LOAD_MODULE'; add `UNLOAD_MODULE'.
7520         - add `DOMAIN_CREATE' and `DOMAIN_UNLOAD'.
7521         - rename `THREAD_CREATED' and `THREAD_EXITED' into
7522           `GC_THREAD_CREATED' and `GC_THREAD_EXITED'.
7523         - re-add `THREAD_CREATED' and `THREAD_EXITED'; with different
7524           meaning.
7525         (mono_debugger_add_symbol_file): Removed.
7526         (mono_debugger_add_type): Removed.
7527         (mono_debugger_lookup_type): Removed.
7528         (mono_debugger_lookup_assembly): Removed.
7529
7530         * domain.c
7531         (mono_domain_create): Call mono_debug_domain_create().
7532         (mono_init_internal): Call mono_debug_init_corlib().
7533
7534         * assembly.c
7535         (mono_assembly_close): Call mono_debug_close_image().
7536
7537 Wed Aug 22 17:26:02 CEST 2007 Paolo Molaro <lupus@ximian.com>
7538
7539         * sgen-gc.c: use the mono-mmap facilitites instead of hard-coding the
7540         mmap call.
7541
7542 Wed Aug 22 17:17:09 CEST 2007 Paolo Molaro <lupus@ximian.com>
7543
7544         * sgen-gc.c: ensure section->pin_queue_end is initialized
7545         correctly when non pinning objects in the section have been found.
7546
7547 2007-08-22  Marek Habersack  <mhabersack@novell.com>
7548
7549         * appdomain.c (set_domain_search_path): cope with PrivateBinPath
7550         containing a list of directories separated by ':'. MSDN docs say
7551         the directories should be separated with ';'. Part of a bugfix for
7552         bug #81446
7553
7554 2007-08-21  Rodrigo Kumpera  <rkumpera@novell.com>
7555
7556         * class.c (mono_type_retrieve_from_typespec) : fixed the return type
7557         it should MonoType and not MonoClass.
7558
7559 2007-08-21  Atsushi Enomoto  <atsushi@ximian.com>
7560
7561         * culture-info-table.h : regenerated.
7562
7563 2007-08-20  William Holmes  <billholmes54@gmail.com>
7564
7565         *file-io.c: Added ves_icall_System_IO_MonoIO_ReplaceFile
7566          to call ReplaceFile Kernel32 on windows or in io-layer.
7567         *file-io.h: Added deceleration for ves_icall_System_IO_MonoIO_ReplaceFile
7568         *icall-def.h: Register ves_icall_System_IO_MonoIO_ReplaceFile
7569          as an internal call.
7570
7571         Code is contributed under MIT/X11 license.
7572
7573 2007-08-20  Jb Evain  <jbevain@novell.com>
7574
7575         * class-internals: add definitions for MONO_EXCEPTION_METHOD_ACCESS
7576         and MONO_EXCEPTION_FIELD_ACCESS.
7577
7578         * debug-helpers.[c|h]: new mono_field_full_name function.
7579
7580 2007-08-20  Mark Probst  <mark.probst@gmail.com>
7581
7582         * class.c: Removed class_security_level() and moved it to
7583         security-core-clr.c.
7584
7585         * security-core-clr.c, security-core-clr.h: class_security_level()
7586         is now public and renamed to mono_security_core_clr_class_level().
7587         It also looks for security attributes in the classes a class is
7588         nested in.
7589
7590 2007-08-20  Mark Probst  <mark.probst@gmail.com>
7591
7592         * security-core-clr.c, security-core-clr.h: CoreCLR security
7593         utility functions.
7594
7595         * Makefile.am: Added security-core-clr.[ch].
7596
7597         * security-manager.c, security-manager.h: Functions and enum for
7598         setting and getting the security mode.
7599
7600         * class.c: CoreCLR security checks.
7601
7602 Mon Aug 20 12:38:42 CEST 2007 Paolo Molaro <lupus@ximian.com>
7603
7604         * icall-def.h, process.c, process.h: implemented icall to get
7605         user/system processor times.
7606
7607 2007-08-17  Mark Probst  <mark.probst@gmail.com>
7608
7609         * domain.c, threads.c, class-internals.h, domain-internals.h: New
7610         reader-lock-free jit_info_table.
7611
7612 2007-08-17  Zoltan Varga  <vargaz@gmail.com>
7613
7614         * metadata.c (mono_type_to_unmanaged): Handle MONO_NATIVE_CUSTOM.
7615
7616         * marshal.c (mono_marshal_type_size): Ditto. Fixes #82465 and #82466.   
7617
7618         * object-internals.h (MonoException): Add missing _data member.
7619
7620 2007-08-08  Massimiliano Mantione  <massi@ximian.com>
7621
7622         * loader.c (find_method, find_method_in_class): Fixed bug #81466,
7623         checking that only methods with matching qname or fqname are picked
7624         from implemented interfaces.
7625
7626 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
7627
7628         * verify.c (do_newarr):added, do type verification of
7629         newarr ops, push the right value on the eval stack.
7630         * verify.c (mono_method_verify): use do_newarr
7631
7632
7633 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
7634
7635         * verify.c (do_ldobj_value, do_unbox_value and do_box_value):
7636         factored the common code into get_boxable_mono_type, which
7637         is now using mono_type_get_full, this fixed byref related tests.
7638
7639 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
7640
7641         * class.c: added mono_type_get_full, this function has the same
7642         behavior of mono_class_get_full but the returned MonoType has
7643         all metadata of the associated token in case of a typespec token.
7644         * class.c: added mono_type_retrieve_from_typespec, used by 
7645         mono_type_get_full to retrieve the token type.
7646         * class.c (mono_class_create_from_typespec): changed to use
7647         mono_type_retrieve_from_typespec.
7648         * class.c (mono_ldtoken): changed to use mono_type_get_full
7649         for MONO_TOKEN_TYPE_(DEF|REF|SPEC).
7650         * class-internals.h: exported mono_type_get_full for internal use.
7651
7652 2007-08-16  Jb Evain  <jbevain@novell.com>
7653
7654         * domain.c (supported_runtimes): add entry for
7655         the 'moonlight' runtime version.
7656
7657 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
7658
7659         * verify.c (mono_method_verify): small typo sliped in.  
7660
7661 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
7662
7663         * verify.c (do_unbox_value): added, do type verification of
7664         unboxing ops
7665         * verify.c (mono_method_verify): use do_unbox_value
7666
7667
7668 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
7669
7670         * verify.c (dump_stack_value): fixed typo, was printing string
7671         instead of object on stack.
7672         * verify.c (do_box_value): moved the byref check up as it leads
7673         to invalid code and should be done earlier.
7674         * verify.c: improved error messages for and ldobj
7675
7676 2007-08-15  William Holmes  <billholmes54@gmail.com>
7677
7678         * marshal.c (emit_marshal_custom): Omit the call to 
7679           marshal_native_to_managed when calling native to managed 
7680           and the argument is specified as an out argument.
7681
7682         Code is contributed under MIT/X11 license.
7683
7684 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
7685
7686         * verify.c: fixed the type checks for generics, function pointers and vectors.
7687         Added type verification for ldobj and ldtoken. The verifier
7688         would segfault if header or signature of a method contained references
7689         to non-existant types.
7690
7691 2007-08-15  Jonathan Chambers  <joncham@gmail.com>
7692
7693         * marshal.c (cominterop_get_ccw): Patch from
7694         Bill Holmes to no walk up interface hierarchy. 
7695         All parent methods should be present in the interface for COM.
7696    
7697         Code is contributed under MIT/X11 license.
7698
7699 2007-08-15  Jonathan Chambers  <joncham@gmail.com>
7700
7701         * marshal.c (emit_marshal_com_interface): Patch from
7702         Bill Holmes to handle COM Interfaces as return values
7703         for native->managed calls.
7704    
7705         Code is contributed under MIT/X11 license.
7706
7707 2007-08-14  Jonathan Chambers  <joncham@gmail.com>
7708
7709         * marshal.c (cominterop_get_idispatch_for_object): Implement
7710         for runtime callable wrappers.
7711    
7712         Code is contributed under MIT/X11 license.
7713
7714 2007-08-13  Rodrigo Kumpera  <rkumpera@novell.com>
7715
7716         * pedump.c (main): changed from mono_init to mono_init_from_assembly
7717         so 2.0 types are accessible
7718
7719
7720 2007-08-13  Miguel de Icaza  <miguel@novell.com>
7721
7722         * domain.c (mono_init_internal): Call mono_assembly_load_friends
7723         once we load mscorlib.   Due to the order in which we initialize,
7724         the mono_assembly_load_full routine that loads mscorlib did not
7725         load friends.   We now load it once we load the
7726         mono_defaults.internals_visible_class class. 
7727
7728         * assembly.c: Expose the mono_load_friend_assemblies method.
7729
7730 2007-08-11  Rodrigo Kumpera  <rkumpera@novell.com>
7731
7732         * verify.c: improved the handling of boxing, better
7733         type checking for unary ops and conversion. Fix bug
7734         regarding managed pointer compatibility checking
7735
7736 2007-08-11  Zoltan Varga  <vargaz@gmail.com>
7737
7738         * icall.c (ves_icall_System_Array_SetGenericValueImpl): New icall.
7739
7740         * threads.c threads-types.h: Export mono_thread_get_stack_bounds.
7741
7742 2007-08-09  Raja R Harinath  <rharinath@novell.com>
7743
7744         * reflection.c (dup_type): Remove.
7745         * class.c (dup_type): Remove.
7746         (mono_metadata_signature_deep_dup): Use 'mono_metadata_type_dup'
7747         instead of the dodgy 'dup_type'.
7748         (inflate_generic_type): Likewise.  Fix the VAR/MVAR cases to
7749         handle the case where 'dup_type' needed the second argument.
7750
7751 2007-08-08  Zoltan Varga  <vargaz@gmail.com>
7752
7753         * domain.c: Fix a warning.
7754
7755 2007-08-08  Massimiliano Mantione  <massi@ximian.com>
7756
7757         * class.c (mono_class_setup_vtable_general): Fixed bug #77127,
7758         checking that methods with the same fqname are not overridden
7759         with a method from an ancestor.
7760
7761 2007-08-07  Zoltan Varga  <vargaz@gmail.com>
7762
7763         * threads.c (free_thread_static_data_helper): Avoid a crash if
7764         thread->static_data is not yet set.
7765
7766 2007-08-07  Jonathan Chambers  <joncham@gmail.com>
7767
7768         * marshal.c: Use correct image when emitting
7769         native wrapper for COM calls.
7770    
7771         Code is contributed under MIT/X11 license.
7772
7773 2007-08-07  Atsushi Enomoto  <atsushi@ximian.com>
7774
7775         * icall-def.h, security.c, security.h :
7776           added icall wrapper to ProtectedMemory.[Unprotect|Protect]Data().
7777
7778 2007-08-07  Martin Baulig  <martin@ximian.com>
7779
7780         * mono-debug-debugger.h
7781         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_DOMAIN_UNLOAD'.
7782
7783         * domain.c (mono_domain_free): Call
7784         `mono_debugger_event (MONO_DEBUGGER_EVENT_DOMAIN_UNLOAD)'.
7785
7786 2007-08-06  Rodrigo Kumpera  <rkumpera@novell.com>
7787
7788         * verify.c (check_underflow, check_overflow): error message now returns IL offset
7789         * verify.c (in_same_block): code should test if either offset is inside the clauses
7790         * verify.c (mono_method_verify): push the exception into the eval stack of exception
7791         and filter blocks
7792
7793 2007-08-03  Zoltan Varga  <vargaz@gmail.com>
7794
7795         * image.c (mono_image_close): Fix a leak.
7796
7797         * object.c (mono_runtime_invoke_array): Avoid using alloca.
7798
7799         * icall.c (ves_icall_FieldInfo_SetValueInternal): Ditto.        
7800
7801 Fri Aug 3 19:54:23 CEST 2007 Paolo Molaro <lupus@ximian.com>
7802
7803         * domain.c, threads.c, threads-types.h: fix memory retention issue
7804         with thread static variables not being cleared on domain unload.
7805         Reuse thread static slots after domain unload.
7806
7807 2007-08-03  Zoltan Varga  <vargaz@gmail.com>
7808
7809         * object.c (mono_runtime_invoke_array): Handle the case when the receiver is a
7810         nullable type.
7811
7812         * marshal.c (mono_marshal_get_runtime_invoke): Revert the previous change, it is
7813         now done in mono_runtime_invoke_array.
7814
7815         * marshal.c (mono_marshal_get_runtime_invoke): Handle the case when the 
7816         receiver is a nullable type.
7817
7818         * class.c (mono_class_is_assignable_from): Handle the case when klass is a 
7819         generic parameter.
7820
7821 2007-08-03  Jonathan Chambers  <joncham@gmail.com>
7822
7823         * marshal.c: Implement COM Objects as return type for 
7824         managed->unmanaged calls. Added Release calls for COM Object
7825         out/return values in managed->unmanaged calls.
7826
7827         Code is contributed under MIT/X11 license.
7828
7829 Fri Aug 3 17:00:51 CEST 2007 Paolo Molaro <lupus@ximian.com>
7830
7831         * threads.h, threads-type.h: move the hazard pointer declarations
7832         to the private header.
7833
7834 Fri Aug 3 13:13:39 CEST 2007 Paolo Molaro <lupus@ximian.com>
7835
7836         * file-io.c, appdomain.c: memory leak fixes.
7837
7838 2007-08-02  Dick Porter  <dick@ximian.com>
7839
7840         * socket-io.c
7841         (ves_icall_System_Net_Sockets_Socket_Socket_internal): Move the
7842         SO_REUSEADDR setting into io-layer/sockets.c.
7843
7844 2007-08-01  Zoltan Varga  <vargaz@gmail.com>
7845
7846         * icall.c (ves_icall_Type_GetMethodsByName): Return the members inherited
7847         from Object when called on a generic parameter. Fixes #82211.
7848
7849 2007-08-01  Dick Porter  <dick@ximian.com>
7850
7851         * file-io.c (convert_share): Test FileShare values bit-by-bit.
7852         Fixes bug 79250 yet again.
7853
7854 2007-07-30  Martin Baulig  <martin@ximian.com>
7855
7856         Merged the `debugger-dublin' branch.
7857
7858         * mono-debug.h
7859         (MonoDebugDataTable): New typedef.
7860         (MonoDebugMethodAddressList): New typedef.
7861         (MonoDebugWrapperData): Removed.
7862         (MonoDebugSymbolTable): Removed `current_data_table',
7863         `current_data_table_size', `current_data_table_offset'.
7864         (MonoDebugDataItemType): Moved into mono-debug.c.
7865         (MonoDebugMethodJitInfo): Remove `address'.
7866         (mono_debug_data_table): New global variable.
7867         (mono_debug_lookup_method_addresses): New public function.
7868         (mono_debug_find_method): Take a `MonoMethod *', not a
7869         `MonoDebugMethodInfo *'.
7870
7871         * mono-debug.c: Drop support for the old symbol tables.
7872
7873 2007-06-28  Martin Baulig  <martin@ximian.com>
7874
7875         * mono-debug.c (mono_debug_debugger_version): New public variable.
7876
7877 2007-07-31  William Holmes  <billholmes54@gmail.com>
7878
7879         * metadata.c Changed mono_type_create_from_typespec to not insert
7880           the type into the hash map until after
7881           do_mono_metadata_parse_type has completed.
7882         Fixes Bug #82194
7883         Code is contributed under MIT/X11 license.
7884
7885 2007-07-31  Zoltan Varga  <vargaz@gmail.com>
7886
7887         * icall.c (ves_icall_Type_GetMethodsByName): Avoid a crash when called on a
7888         generic parameter. Fixes #82211.
7889
7890 2007-07-27  Jb Evain  <jbevain@novell.com>
7891
7892         * pedump.c (dump_metadata, dump_metadata_header): dump
7893         versions contained in the metadata header.
7894
7895 Fri Jul 27 17:07:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
7896
7897         * threads.c: register small_id_table with the GC.
7898
7899 2007-07-27  Mark Probst  <mark.probst@gmail.com>
7900
7901         * threads.c, threads.h, class-internals.h, object-internals.h:
7902         Hazard pointers, to be used by lock-free parallel algorithms.
7903
7904 2007-07-26  Dick Porter  <dick@ximian.com>
7905
7906         * appdomain.c (mono_runtime_cleanup): Invoke io-layer cleanup
7907         routine on non-windows platforms, as I've not managed to think of
7908         a non-kludgy way of doing this.  Finishes off bug 78739.
7909
7910 Wed Jul 25 18:06:33 CEST 2007 Paolo Molaro <lupus@ximian.com>
7911
7912         * object.c: properly setup interface_bitmap in proxy vtables.
7913
7914 2007-07-25  Marek Habersack  <mhabersack@novell.com>
7915
7916         * appdomain.c (get_shadow_assembly_location): do not use TickCount
7917         to create unique shadow copy target directories, use the domain's
7918         serial number instead. Each domain gets a unique target directory
7919         that way.
7920
7921         * domain.c (mono_domain_create): added code to increment domain
7922         shadow copy serial number and cache the value in the current
7923         domain structure.
7924
7925         * domain-internals.h (struct _MonoDomain): added a new field -
7926         shadow_serial to hold the serial number used in generation of
7927         shadow-copy directories. This is to make sure that the directory
7928         name is unique for each and every domain created. We avoid a race
7929         condition with overriding assemblies already in use by other app
7930         domains.
7931
7932 2007-07-24  Rodrigo Kumpera  <rkumpera@novell.com>
7933
7934         * class.c (mono_bounded_array_class_get): fixed memory leak when 
7935         binding generic parameters.
7936
7937 2007-07-24  Raja R Harinath  <rharinath@novell.com>
7938
7939         * metadata.c (do_mono_metadata_parse_generic_class): Use
7940         mono_metadata_lookup_generic_class.  Don't g_assert on a metadata
7941         error.
7942
7943 Tue Jul 24 15:15:19 CEST 2007 Paolo Molaro <lupus@ximian.com>
7944
7945         * loader.c, class-internals.h, reflection.c: removed the per-method
7946         generics hashtable: we use the global one through the call of
7947         mono_class_inflate_generic_method ().
7948
7949 Mon Jul 23 19:43:14 CEST 2007 Paolo Molaro <lupus@ximian.com>
7950
7951         * class.c, metadata.c, class-internals.h: introduce yet another
7952         generics global cache for inflated methods (fixes 98% of the perf
7953         issue in bug #81806).
7954
7955 2007-07-23  Raja R Harinath  <rharinath@novell.com>
7956
7957         Fix #81035 -- avoid allocating MonoGenericInsts willy-nilly
7958         * metadata.c (mono_metadata_lookup_generic_inst): Kill.
7959         (mono_metadata_get_generic_inst): New.  Given a list of MonoType*,
7960         return a MonoGenericInst containing (a copy) of those types.
7961         (mono_metadata_inflate_generic_inst): Update to changes.
7962         (mono_metadata_parse_generic_inst): Likewise.
7963         (mono_get_shared_generic_inst): Likewise.
7964         * reflection.c (mono_class_bind_generic_parameters): Likewise.
7965         (mono_reflection_bind_generic_method_parameters): Likewise.
7966         * metadata-internals.h: Likewise.
7967         * icall.c (free_generic_context): Kill.
7968         (init_generic_context_from_args): Use mono_metadata_get_generic_inst.
7969
7970         * reflection.c (reflection_methodbuilder_to_mono_method): Use
7971         mono_metadata_type_dup.
7972         * marshal.c (mono_mb_create_method): Likewise.
7973
7974         * metadata.c (mono_metadata_type_dup): Rename from
7975         mono_metadata_type_dup_mp.  Take an optional mempool instead of a
7976         MonoImage.  Handle a few more cases, esp. when no mempool is given.
7977         * marshal.c, metadata-internals.h: Update to changes.
7978
7979 Mon Jul 23 11:43:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
7980
7981         * class.c: fixed a small leak for array classes and removed warning.
7982
7983 2007-07-22  Zoltan Varga  <vargaz@gmail.com>
7984
7985         * loader.c (mono_method_get_param_token): Make this work on generic methods.
7986         Return 0x8000000 for return parameters. Fixes #82161.
7987
7988 2007-07-21  Marek Habersack  <grendello@gmail.com>
7989
7990         * appdomain.c (get_shadow_assembly_location): append the current
7991         ticks value to the path. Avoids overwriting the same assemblies by
7992         several threads at the same time.
7993
7994 2007-07-20  Atsushi Enomoto  <atsushi@ximian.com>
7995         and Raja R Harinath  <rharinath@novell.com>
7996
7997         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition):
7998         Simplify slightly.
7999         (ves_icall_MonoMethod_GetGenericMethodDefinition): Update
8000         property for testing if a method is a generic method definition.
8001
8002 2007-07-20  Atsushi Enomoto  <atsushi@ximian.com>
8003
8004         * domain-internals.h : added 2.0 member fields to MonoAppDomainSetup.
8005
8006 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
8007
8008         * verify.c: used function from private branch, reverted to the one in class.h 
8009
8010 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
8011
8012         * verify.c: a typo slipped in and the code wont compile
8013
8014 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
8015
8016         * verify.c: now all code use IS_MANAGED_POINTER and UNMASK_TYPE macros.
8017         disabled box instruction as it is doing the wrong thing
8018         improved stack dump messages, now it is easier to debug type related issues
8019
8020
8021 2007-07-19  Juraj Skripsky  <js@hotfeet.ch>
8022
8023         * icall.c (ves_icall_System_MonoType_getFullName): Fix a leak. 
8024
8025 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
8026
8027         * verify.c: changed MONO_TYPE_TYPEDBYREF stack type from 
8028         TYPE_COMPLEX to TYPE_PTR, it did not make any sense to be
8029         grouped with class and valuetype. This change will simply 
8030         the code as it should be handled just like unmanaged pointers.
8031
8032 2007-07-19  Mark Probst  <mark.probst@gmail.com>
8033
8034         * class.c (concat_two_strings_with_zero): Fixed a silly bug.
8035
8036 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
8037
8038         * verify.c: several stack merge issues fixed, reference comparisons now
8039         check the type size. strict type check now works correctly.
8040         added more uses of IS_MANAGED_POINTER macro.
8041         fixed issues pointed by running the test suite against .net.
8042         
8043
8044 2007-07-19  Mark Probst  <mark.probst@gmail.com>
8045
8046         * class.c, loader.c, class-internals.h: Removed the
8047         MonoLoaderErrorKind enum and replaced it with the MONO_EXCEPTION_
8048         defines.
8049
8050         * icall.c: Better error checking in some internal reflection
8051         methods.
8052
8053 2007-07-18  William Holmes  <billholmes54@gmail.com>
8054
8055         * filewatcher.c : removed unused variable 'filename' in 
8056           ves_icall_System_IO_FSW_SupportsFSW
8057
8058 Mon Jul 16 19:36:16 CEST 2007 Paolo Molaro <lupus@ximian.com>
8059
8060         * reflection.c, class.c, icall.c, loader.c: mono_get_inflated_method () is
8061         obsolete, removed.
8062
8063 2007-07-15  Zoltan Varga  <vargaz@gmail.com>
8064
8065         * icall.c (ves_icall_System_Reflection_FieldInfo_GetTypeModifiers): New icall.
8066         
8067         * icall.c (ves_icall_System_Reflection_Module_ResolveSignature): New icall.
8068
8069 2007-07-14  Zoltan Varga  <vargaz@gmail.com>
8070
8071         * icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): 
8072         Implement generics support.
8073         (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
8074
8075         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Add new
8076         type_args and method_args arguments.
8077         (ves_icall_System_Reflection_Module_ResolveMethodToken): Ditto.
8078         (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
8079         (ves_icall_System_Reflection_Module_ResolveMemberToken): Ditto.
8080
8081 2007-07-13  Rodrigo Kumpera  <rkumpera@novell.com>
8082
8083         * reflection.c: patch from Thong Nguyen to fix atribute resolution.
8084           It adds a rootimage parameter to mono_reflection_get_type_internal,
8085           adds new function mono_reflection_get_type_with_rootimage and use
8086           the rootimage to resolve the types instead of the current image
8087
8088 2007-07-13  Rolf Bjarne Kvinge  <RKvinge@novell.com>
8089
8090         * culture-info-table.h: Forgot to update after r78304.
8091
8092 2007-07-13  Raja R Harinath  <rharinath@novell.com>
8093
8094         * class.c (mono_class_is_open_constructed_type)
8095         <MONO_TYPE_GENERICINST>: Don't recompute a computed field.
8096
8097 2007-07-12  Rodrigo Kumpera  <rkumpera@novell.com>
8098
8099         * class.c (mono_bounded_array_class_get):  method fails if used with
8100         an incomplete TypeBuilder enum (no basetype field), fixed it by 
8101         avoiding calculating the size for such array as it cannot be instantiated.
8102         Fix bug #82015
8103
8104 2007-07-12  Raja R Harinath  <rharinath@novell.com>
8105
8106         * class-internals.h (_MonoGenericInst::is_reference): Remove bogus
8107         field.
8108         * metadata.c, reflection.c: Update to changes.
8109
8110 2007-07-11  Rodrigo Kumpera  <rkumpera@novell.com>
8111
8112         * class.c, class-internal.h: added mono_type_is_valid_enum_basetype and
8113         mono_class_is_valid_enum, they are used to valide a enum when loading.
8114         * reflection.c: used new functions to throw TypeLoadException when and
8115         invalid enum is build with TypeBuilder. Fixes #82018
8116   
8117 Wed Jul 11 14:47:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
8118
8119         * object.c: forgot commit of mono_class_setup_methods () to access
8120         iface->methods.
8121         * object-internals.h: added a few more handy fields to
8122         MonoIMTCheckItem.
8123
8124 2007-07-11  Zoltan Varga  <vargaz@gmail.com>
8125
8126         * object.c (build_imt): Call mono_class_setup_methods () before accessing 
8127         iface->methods.
8128
8129 Tue Jul 10 16:49:01 CEST 2007 Paolo Molaro <lupus@ximian.com>
8130
8131         * class-internals.h, object-internals.h, object.c: IMT-based
8132         interface invocation core from Massimiliano Mantione
8133         (massi@ximian.com) with a reworked arch-specific interface,
8134         bsearch implementation and a few bugfixes and memory savings by me.
8135
8136 2007-07-10  Rodrigo Kumpera  <rkumpera@novell.com>
8137
8138         * class.c (mono_class_create_from_typedef): mono would segfault if 
8139         an enum did not have a __value field. It now throws a TypeLoadException
8140         for such cases. Fix bug #82022
8141
8142 2007-07-10  Zoltan Varga  <vargaz@gmail.com>
8143
8144         * marshal.c (mono_marshal_string_to_utf16_copy): Fix allocation size.
8145
8146 2007-07-09  Mark Probst  <mark.probst@gmail.com>
8147
8148         * class.c (mono_class_init): If a class is already inited but has
8149         an exception_type set, return FALSE, not TRUE.  Fixes: 82050.
8150
8151 2007-07-09  Mark Probst  <mark.probst@gmail.com>
8152
8153         * class.c: Properly handle the case of an unimplemented interface
8154         method.  Fixes: 81673.
8155
8156 Mon Jul 9 16:21:43 CEST 2007 Paolo Molaro <lupus@ximian.com>
8157
8158         * class-internals.h, object.c: cleanup patch from massi: use
8159         MonoVTable->interface_bitmap since the vtable interfaces offset array
8160         is going away.
8161
8162 2007-07-10  Zoltan Varga  <vargaz@gmail.com>
8163
8164         * icall-def.h icall.c: Remove Module:get_MDStreamVersion icall and add a new
8165         GetMDStreamVersion icall instead.
8166
8167 Mon Jul 9 11:34:17 CEST 2007 Paolo Molaro <lupus@ximian.com>
8168
8169         * filewatcher.c: patch from Thong Nguyen <tum@veridicus.com> to
8170         not use mono_dl_build_path() with a full library name: makes
8171         fallbacks to libgaim and libfam work.
8172
8173 2007-07-06  William Holmes  <billholmes54@gmail.com>
8174
8175         * assembly.c: Added a continue statement in probe_for_partial_name when
8176          parse_assembly_directory_name fails.  Fixes : 82002
8177
8178 2007-07-06  Rodrigo Kumpera  <rkumpera@novell.com>
8179
8180         * verify.c (check_unmanaged_pointer_type): renamed to check_unverifiable_type
8181         and added a verification  for TYPEDBYREF.
8182         * verify.c (verify_stack_type_compatibility): fix handling of byref types,
8183         make native int interchangeable with int32 and some small cleanup and formating.
8184         * verify.c (push_arg): only ldarg on invalid argument is valid (but not verifiable) and
8185         handle byref of byref.
8186         * verify.c (push_local): handle byref of byref.
8187         * verify.c (do_binop): invalid mix of values is unverifiable
8188         * verify.c (do_invoke_method): fixed the handling of bad params on stack and
8189         added visibility checks
8190         * verify.c (field related method): added visibility checks
8191         * verify.c (do_push_field): cannot take the address of a temporary valuetype field
8192
8193 2007-07-06  Zoltan Varga  <vargaz@gmail.com>
8194
8195         * marshal.c (mono_marshal_string_to_utf16_copy): Null terminate the
8196         string.
8197
8198 2007-07-05  Zoltan Varga  <vargaz@gmail.com>
8199
8200         * profiler.c (mono_profiler_load): Fix an off-by-one error.
8201
8202         * marshal.c (emit_marshal_string): When returning a string from managed code,
8203         allways make a copy even for unicode strings. Fixes #81990.
8204
8205 Wed Jul 4 11:53:57 CEST 2007 Paolo Molaro <lupus@ximian.com>
8206
8207         * object.c: cleaned up mono_runtime_invoke_array () and fixed handling
8208         of byref generic inst types (bug #81997).
8209
8210 2007-07-03  Rodrigo Kumpera  <rkumpera@novell.com>
8211
8212         * class.c: moved methods mono_method_can_access_field and mono_method_can_access_method from mini/mini.c
8213         * class.h: added declarations of mono_method_can_access_field() and mono_method_can_access_method()
8214
8215 2007-07-02  Zoltan Varga  <vargaz@gmail.com>
8216
8217         * marshal.c (emit_marshal_string): Add support for unicode strings in
8218         MARSHAL_ACTION_MANAGED_CONV_RESULT. Fixes #81990.
8219
8220 2007-07-02 Rodrigo Kumpera  <rkumpera@novell.com>
8221
8222         * verify.c: field load/store are now verified, missing only access checks now
8223
8224 2007-06-28  Martin Baulig  <martin@ximian.com>
8225
8226         * mono-debug.c (mono_debug_debugger_version): New public variable.
8227
8228 2007-06-24  Gert Driesen  <drieseng@users.sourceforge.net>
8229
8230         * locales.c: When constructing DateTimeFormat or NumberFormat for
8231         MonoCultureInfo, inherit readonly bit from MonoCultureInfo. The
8232         MonoCultureInfo contructed from the current locale is always
8233         read-only and has UseUserOverride set to true. All MonoCultureInfo
8234         instances returned for GetCultures have both IsReadOnly and
8235         UseUserOverride set to true. Fixes part of bug #81930.
8236
8237 2007-06-22  Jonathan Chambers  <joncham@gmail.com>
8238
8239        * icall-def.h: Update System.__ComObject icalls
8240        * marshal.c: Avoid managed transition (and object creation)
8241        when looking up COM interface in RCW.
8242        * marshal.h: Ditto.
8243        
8244        Code is contributed under MIT/X11 license.
8245
8246 2007-06-22  Zoltan Varga  <vargaz@gmail.com>
8247
8248         * marshal.c (mono_marshal_get_runtime_invoke): Cache in the method image for now
8249         to avoid crashes during assembly unloading.
8250
8251 2007-06-22  Raja R Harinath  <rharinath@novell.com>
8252
8253         Fix MethodInfo.IsGenericMethodDefinition
8254         * reflection.c (mono_reflection_bind_generic_method_parameters):
8255         Rearrange code to ensure we always uses a generic method definition.
8256         * class.c (mono_class_inflate_generic_method_full): Set
8257         'generic_container' field only for generic method definitions.
8258         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition):
8259         Use presense of 'generic_container' field as indication of being a
8260         generic method definition.
8261
8262 2007-06-21  Zoltan Varga  <vargaz@gmail.com>
8263
8264         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
8265
8266         * object-internals.h: Reflect changes in the layout of the managed Delegate
8267         class.
8268         
8269         * object-internals.h reflection.c icall-def.h: Applied patch from Robert
8270         Jordan (robertj@gmx.net). Add a dtor to dynamic methods which frees up the
8271         runtime memory used by the dynamic method. Fixes #77146.
8272
8273 2007-06-21  Dick Porter  <dick@ximian.com>
8274
8275         * file-io.h: 
8276         * file-io.c (convert_share): Cope with FileShare.Delete.  Patch
8277         from Wojtek Krawczyk <krawczyk.wojciech@gazeta.pl>, fixes bug
8278         81767.
8279
8280 2007-06-21  Raja R Harinath  <rharinath@novell.com>
8281
8282         * reflection.c (method_encode_methodspec): Add a tripwire.
8283         * class.c (inflate_generic_type): The fully open generic type is
8284         not the same as the generic type definition.
8285
8286 2007-06-21  Martin Baulig  <martin@ximian.com>
8287
8288         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 59.
8289
8290         * mono-debug-debugger.h
8291         (MonoDebuggerBreakpointInfo): Removed.
8292         (mono_debugger_insert_breakpoint_full): Moved to ../mini/debug-mini.h.
8293         (mono_debugger_remove_breakpoint): Likewise.
8294         (mono_debugger_breakpoint_callback): Likewise.
8295         (mono_debugger_start_add_type): Renamed into mono_debugger_add_type().
8296
8297 2007-06-21  Raja R Harinath  <rharinath@novell.com>
8298
8299         * metadata.c (mono_metadata_lookup_generic_class): The fully open
8300         generic type is not the same as the generic type definition.
8301         * class.c (mono_generic_class_get_class): Likewise.
8302
8303 2007-06-20  Geoff Norton  <gnorton@customerdna.com>
8304
8305         * icall.c: The second argument to 
8306         System.Reflection.MethodBase.GetMethodFromHandleInternalType
8307         is a MonoType not a MonoClass.
8308
8309 2007-06-20  Rodrigo Kumpera  <kumpera@gmail.com>
8310
8311         * verify.c: support for function pointers in the verifier
8312
8313 2007-06-20  Rodrigo Kumpera  <kumpera@gmail.com>
8314
8315         * verify.c: unmanaged pointer verification checks (loading unmanaged pointers is unverifiable)
8316
8317 Wed Jun 20 10:22:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
8318
8319         * assembly.c: removed Mono.Data.SqliteClient from the list of
8320         forward-compatible assemblies as it breaks the ABI (bug #81899).
8321
8322 2007-06-19  Raja R Harinath  <rharinath@novell.com>
8323
8324         * metadata.c (mono_metadata_lookup_generic_class): Protect cache
8325         lookup/update with the loader lock.
8326         * reflection.c (mono_class_bind_generic_parameters): No need to
8327         protect mono_metadata_lookup_* with the loader lock.
8328         * class.c (inflate_generic_type): Likewise.
8329         
8330         * metadata.c (ginst_in_image): Avoid mono_class_from_mono_type
8331         on a generic instantiated type.
8332
8333 2007-06-18  Rodrigo Kumpera <kumpera@gmail.com>
8334
8335         *verify.c: produce meanfull error messages on verification error
8336         *verify.c: fixed some cases of verification errors reported as validation errors
8337         *pedump.c: fixed the error name array, now it shows validation errors properly
8338         *verify.h: fixed the contant that should be used for verification errors
8339
8340 Mon Jun 18 17:07:22 CEST 2007 Paolo Molaro <lupus@ximian.com>
8341
8342         * metadata.c, image.c, metadata-internals.h: part of the fixes needed
8343         for bug #77596, 81858 and 80743 (generics data structures on domain
8344         unload).
8345
8346 2007-06-15  Raja R Harinath  <rharinath@novell.com>
8347
8348         Avoid allocating 'MonoGenericContext' on the heap.
8349         * class-internals (_MonoMethodInflated::context): Make field
8350         inline, not a pointer.
8351         * loader.c (method_from_methodspec): Allocate 'new_context' on the
8352         stack.  Use the context embedded within the inflated method as the
8353         hash key, rather than 'new_context'.
8354         * class.c (inflate_generic_context): Simplify.  Return a struct
8355         rather than allocating on the heap.
8356         (mono_class_inflate_generic_method_full): Update to changes.  Now,
8357         doesn't salt away a copy of the context -- simplifying the
8358         lifetime rules of a 'MonoGenericContext *'.
8359         (mono_method_get_context): Return pointer to embedded context.
8360         (setup_generic_array_ifaces): Allocate temporary context on stack.
8361         * reflection.c (inflate_mono_method): Likewise.
8362         (mono_reflection_bind_generic_method_parameters): Likewise.
8363         Use the context embedded within the inflated method as the hash key.
8364
8365         Avoid a source of allocation of 'MonoGenericContext'.
8366         * class-internals.h (_MonoGenericClass::context): Combine 'inst'
8367         and 'cached_context' fields into embedded 'MonoGenericContext' field.
8368         * class.c: Update to changes.
8369         (mono_generic_class_get_context): Simplify drastically.  Now just
8370         returns a pointer to the field.
8371         * metadata-internals.h (mono_metadata_generic_context_hash): Mark
8372         argument as a const pointer.
8373         (mono_metadata_generic_context_equal): Likewise.
8374         * metadata.c, loader.c, icall.c, reflection.c, verify.c:
8375         Update to changes.
8376
8377 2007-06-14  Rodrigo Kumpera  <kumpera@gmail.com>
8378
8379         * verify.c improved the handling of brtrue/brfalse, factored out common code
8380
8381 2007-06-14  Raja R Harinath  <rharinath@novell.com>
8382
8383         Kill MonoGenericMethod.
8384         * class-internals.h (MonoGenericContext::method_inst): Rename from
8385         'gmethod' and convert to a MonoGenericInst.
8386         (MonoGenericMethod): Remove.
8387         * metadata.h (MonoGenericMethod): Note that the name is obsolete.
8388         * loader.c (method_from_methodspec): Update to changes.  Use a
8389         MonoGenericContext as the key to the hashtable.
8390         * metadata.c (mono_metadata_generic_context_equal): Rename from 
8391         'mono_metadata_generic_method_equal' and take MonoGenericContext.
8392         (mono_metadata_generic_context_hash): Likewise from
8393         'mono_metadata_generic_method_hash'.  Change hash function.
8394         (mono_metadata_load_generic_params): Update to changes.
8395         (mono_get_shared_generic_method): Remove.
8396         * metadata-internals.h (mono_get_shared_generic_method): Remove.
8397         * class.c (inflate_generic_type) [MONO_TYPE_MVAR]: Update to changes.
8398         (inflate_generic_context): Likewise.
8399         (mono_class_inflate_generic_method_full): Likewise.
8400         (setup_generic_array_ifaces): Likewise.
8401         (mono_class_create_from_typespec): Likewise.
8402         * reflection.c (encode_generic_method_sig): Take a MonoGenericContext.
8403         (method_encode_methodspec): Update callsite.
8404         (reflection_methodbuilder_to_mono_method): Update to changes.
8405         (mono_reflection_bind_generic_method_parameters): Likewise.  Use a
8406         MonoGenericContext as the key to the hashtable.
8407         (inflate_mono_method): Update to changes.
8408
8409         * class-internals.h (MonoGenericMethod::container): Remove.
8410         * class.c, loader.c, metadata.c, reflection.c: Update to changes.
8411
8412 Thu Jun 14 12:40:05 CEST 2007 Paolo Molaro <lupus@ximian.com>
8413
8414         * profiler-private.h, profiler.c, profiler.h: added API to profile
8415         exception events.
8416
8417 2007-06-13  Rodrigo Kumpera  <kumpera@gmail.com>
8418
8419         * verify.c: Fixed pointer type handling, some code and message formating and two invalid assigments 
8420
8421 2007-06-13  Rodrigo Kumpera  <kumpera@gmail.com>
8422
8423         * verify.c: method invocation is now validated, now we verify parameter types on stack.
8424         Fixed overflow and underflow not aborting the verification process.
8425
8426 2007-06-13  Mark Probst  <mark.probst@gmail.com>
8427
8428         * class-internals.h (MonoStats): Added stats entries for dynamic
8429         code allocations.
8430
8431 2007-06-12  Zoltan Varga  <vargaz@gmail.com>
8432
8433         * loader.c (mono_free_method): Free header->locals and header->clauses.
8434
8435         * marshal.c (mono_mb_create_method): Make a copy of the locals as well in the
8436         dynamic case.
8437
8438         * threads.c (mono_thread_get_stack_bounds): Fix memory leak.
8439
8440         * class.c (setup_interface_offsets): Allocate memory from the image mempool.
8441
8442 2007-06-12  Raja R Harinath  <rharinath@novell.com>
8443
8444         * verify.c (TYPE_MAX): Set it to 8 to match the dimensions of all
8445         the tables.
8446
8447 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
8448
8449         *pedump.c (main): return error code 4 if assembly cannot be loaded instead of segfaulting
8450
8451 2007-06-11  Raja R Harinath  <harinath@gmail.com>
8452
8453         MonoGenericMethod on a diet
8454         * class-internals.h (_MonoMethodInflated::reflection_info): Move
8455         here ...
8456         (_MonoGenericMethod::reflection_info): ... from here.
8457         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition):
8458         Update to changes.
8459         * reflection.c (inflate_mono_method): Likewise.
8460         (mono_reflection_bind_generic_method_parameters): Likewise.
8461
8462 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
8463
8464         *verify.c: all debu printf statements are now guarded by VERIFY_DEBUG
8465         *verify.c: factored long ldarg forms to share code with short forms
8466
8467 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
8468
8469         *verify.c: fixed code formating factored some duplicate code
8470         into a new function
8471
8472         *verify.h: fixed binary incompatibility introduced earlier
8473
8474         *pedump.c: fixed formating
8475
8476 2007-06-11  Raja R Harinath  <harinath@gmail.com>
8477
8478         Fix assertion when disassembling Mono.C5.dll
8479         * loader.c (method_from_methodspec): Avoid inflating a method
8480         twice with the same context.  If the methodref is inflated, use
8481         the declaring method instead.
8482
8483         * class.c (mono_class_from_generic_parameter): Fix case similar to
8484         bug #81830 handled below, but for method containers.
8485
8486 2007-06-10  Raja R Harinath  <harinath@gmail.com>
8487
8488         * class.c (inflate_generic_type) [MONO_TYPE_CLASS]: Don't call
8489         get_shared_generic_class.  Directly inflate the instance.
8490         [MONO_TYPE_GENERICINST]: Inline inflate_generic_class.
8491         (inflate_generic_class): Delete.
8492         (get_shared_generic_class): Delete.  Move setting of
8493         'cached_class' and 'cached_context' ...
8494         * metadata.c (mono_metadata_lookup_generic_class): ... here.
8495
8496         * metadata.c (mono_metadata_lookup_generic_class): Change
8497         signature to take the components of a MonoGenericClass rather than
8498         an allocated MonoGenericClass.  Change semantics to be intern-like.
8499         * reflection.c (mono_class_bind_generic_parameters): Update to
8500         changes.  Make locking region tighter.
8501         * class.c (inflate_generic_class): Update to changes.
8502         (get_shared_generic_class): Likewise.
8503         * metadata-internals.h: Likewise.
8504
8505         * reflection.c (mono_class_bind_generic_parameters): Take and
8506         return a MonoClass*, not a MonoType*.  Add 'is_dynamic' parameter.
8507         (mono_reflection_bind_generic_parameters): Use
8508         'mono_class_bind_generic_parameters' rather than duplicate the code.
8509         * class.c (mono_bounded_array_class_get): Update to changes.
8510         * object-internals.h: Likewise.
8511
8512         * reflection.c (mono_class_bind_generic_parameters): Only support
8513         parameterizing generic type definitions.  Remove support for other
8514         open types.
8515
8516 2007-06-08  Zoltan Varga  <vargaz@gmail.com>
8517
8518         * loader.c (mono_free_method): Free method->signature as well. Fixes #81832.
8519
8520         * marshal.c (mono_marshal_get_managed_wrapper): Allocate the signature using malloc
8521         in the dynamic case.
8522
8523 2007-06-08  Gert Driesen  <drieseng@users.sourceforge.net>
8524
8525         * threads.c: When cleaning up thread, reset the Background bit.
8526         Fixes bug #81720.
8527
8528 2007-06-08  Jonathan Chambers  <joncham@gmail.com>
8529
8530        * metadata.c: Move variable declarations to top of scope.
8531        * verify.c: Move variable declarations to top of scope.
8532
8533        Code is contributed under MIT/X11 license.
8534
8535 2007-06-08  Raja R Harinath  <rharinath@novell.com>
8536
8537         * reflection.c (mono_class_bind_generic_parameters): Replace
8538         open-coded loop with mono_metadata_inflate_generic_inst.
8539
8540         * class.c (get_shared_generic_class): Don't call
8541         mono_get_shared_generic_inst.  Use the container's own
8542         'class_inst'.
8543
8544         * metadata.c (mono_metadata_load_generic_params): Move
8545         initialization of 'context' field here from ...
8546         * class.c (mono_class_create_from_typedef): ... here, and ...
8547         * loader.c (mono_get_method_from_token): ... here.
8548
8549         * class.c (get_shared_generic_class): Rename from
8550         mono_get_shared_generic_class and make static.
8551         (mono_get_shared_generic_inst): Move to metadata.c.
8552         * loader.c (mono_get_shared_generic_method): Likewise.
8553         * class-internals.h, metadata-internals.h: Update to changes.
8554
8555         Fix #81830
8556         * class.c (mono_class_from_generic_parameter): Don't assume a
8557         generic container owner exists.  Generic containers from monodis
8558         don't have any.
8559
8560 2007-06-06  Rodrigo Kumpera  <kumpera@gmail.com>
8561
8562         * pedump.c: pedump exists with 2 if assembly is not verifiable and 3 if invalid
8563         * verify.h: new typedefs to returns the non-verifiable status
8564         * verify.c: initial implementation of generics, stack merging and object compatibility check
8565
8566 2007-06-06  Mark Probst  <mark.probst@gmail.com>
8567
8568         * class.c, image.c, class-internals.h (MonoImage): class_cache is
8569         a MonoInternalHashTable again (fixed bug in internal hash table
8570         code).
8571
8572 2007-06-06  Mark Probst  <mark.probst@gmail.com>
8573
8574         * domain.c, domain-internals.h (MonoDomain): jit_code_hash is a
8575         MonoInternalHashTable again (fixed bug in internal hash table
8576         code).
8577
8578 2007-06-06  Mark Probst  <mark.probst@gmail.com>
8579
8580         * class.c, image.c, class-internals.h, domain.c,
8581         domain-internals.h (MonoImage): Reverting MonoInternalHashTable
8582         changes.  Have to figure out what makes them break the SWF
8583         regression.
8584
8585 2007-06-04  Mark Probst  <mark.probst@gmail.com>
8586
8587         * class.c, image.c, class-internals.h (MonoImage): class_cache is
8588         a MonoInternalHashTable now.
8589
8590 2007-06-04  Mark Probst  <mark.probst@gmail.com>
8591
8592         * domain.c, domain-internals.h (MonoDomain): jit_code_hash is a
8593         MonoInternalHashTable now.
8594
8595 2007-05-31  Zoltan Varga  <vargaz@gmail.com>
8596
8597         * domain-internals.h (MonoDomain): Add two new hash tables to store delegate
8598         invoke_impl code.
8599
8600         * object-internals.h (_MonoDelegate): Reflect changes to managed object layout.
8601
8602         * object.c (mono_delegate_ctor): Initialize invoke_impl field with an arch
8603         dependent trampoline.
8604
8605         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
8606
8607         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): New icall.
8608
8609 2007-05-29  Robert Jordan  <robertj@gmx.net>
8610
8611         * marshal.[c|h]: add mono_win32_compat_* wrappers. Fixes #81754.
8612
8613 2007-05-28  Zoltan Varga  <vargaz@gmail.com>
8614
8615         * icall.c (ves_icall_get_method_info): Handle loader errors. Fixes #81724.
8616
8617 2007-05-25  Jonathan Chambers  <joncham@gmail.com>
8618
8619        * marshal.c: Fix interface lookup loops for
8620        cominterop_get_com_slot_for_method and 
8621        cominterop_get_method_interface. Only need to lookup
8622        if type is a class, else use interface type method is on.
8623
8624        Code is contributed under MIT/X11 license.
8625
8626 2007-05-25  Sebastien Pouliot  <sebastien@ximian.com>
8627
8628         * reflection.c: HasSecurity can be present even if no specially 
8629         encoded (CAS) attributes are available (e.g. SuppressUnmanagedCode
8630         SecurityAttribute). Fix CAS regression tests on buildbot.
8631
8632 2007-05-24  Jonathan Chambers  <joncham@gmail.com>
8633
8634        * appdomain.c: Add configure checks for header files.
8635        * image.c: Add configure checks for header files.
8636        * file-io.c: Add configure checks for header files.
8637        * debug-mono-symfile.c: Add configure checks for header files.
8638        * threadpool.c: Add configure checks for header files.
8639        * console-io.c: Add configure checks for header files.
8640        * profiler.c: Add configure checks for header files.
8641        * rawbuffer.c: Add configure checks for header files.
8642        * icall.c: Add configure checks for header files.
8643        * rand.c: Add configure checks for header files.
8644        * socket-io.c: Add configure checks for header files.
8645
8646        Code is contributed under MIT/X11 license.
8647
8648 2007-05-24  Zoltan Varga  <vargaz@gmail.com>
8649
8650         * reflection.c (mono_custom_attrs_from_builders): Remove the 
8651         assertion as it breaks the build.
8652         
8653         * reflection.c (mono_custom_attrs_from_builders): Add an assertion.
8654
8655         * reflection.c (lookup_custom_attr): Make a copy here too.
8656
8657         * image.c (mono_image_check_for_module_cctor): Avoid accessing metadata in
8658         dynamic images.
8659
8660         * class.c (mono_class_init): Avoid accessing the metadata in dynamic
8661         images.
8662
8663         * reflection.c (mono_custom_attrs_from_param): Make a copy of the dynamic attr
8664         info.
8665
8666 2007-05-22  Zoltan Varga  <vargaz@gmail.com>
8667
8668         * reflection.c (encode_cattr_value): Fix yet another object cattr encoding issue.
8669         (load_cattr_value): Ditto.
8670
8671 2007-05-20  Zoltan Varga  <vargaz@gmail.com>
8672
8673         * marshal.c (mono_marshal_get_delegate_invoke): Improve the generated IL a little.
8674
8675 2007-05-19  Gert Driesen  <drieseng@users.sourceforge.net>
8676
8677         * threads.c: In "start_wrapper", set apartment_state to MTA if
8678         apartment_state is Unknown and we're running on 2.0 profile or
8679         higher.
8680         * object.c: In "mono_runtime_exec_main", if STAThread is not applied
8681         to main method, then set apartment_state to Unknown on 1.0 profile,
8682         and MTA on 2.0 profile.
8683
8684 2007-05-16  Jb Evain  <jb@nurv.fr>
8685
8686         * class-internals.h (MonoDefaults): Add an attribute_class and
8687           customattribute_data_class.
8688         * domain.c (mono_init_internal): Populate them.
8689         * reflection.c: Use them to remove duplicates. Make a vew
8690         MonoClass variables `static'.
8691
8692 2007-05-15  Massimiliano Mantione  <massi@ximian.com>
8693
8694         * class-internals.h: Added "MonoVTable.interface_bitmap" as a next
8695         step in implementing IMT, so that all isinst checks now can go
8696         through the bitmap.
8697         This was needed because vtables for TransparentProxy need to look
8698         like the vtable of the "target" class, so they need to point to
8699         its interface bitmap directly.
8700
8701         * object.c: inside "mono_class_create_runtime_vtable" and
8702         "mono_class_proxy_vtable", initialize "MonoVTable.interface_bitmap".
8703
8704 2007-05-15  Atsushi Enomoto  <atsushi@ximian.com>
8705
8706         * object-internals.h
8707           culture-info.h : added territory field in MonoCulture and
8708           CultureInfoEntry foreach. Added lcid field in RegionInfoEntry.
8709         * locales.c : fill territory field above too.
8710         * culture-info-table.h : regenerated.
8711
8712 2007-05-12  Zoltan Varga  <vargaz@gmail.com>
8713
8714         * class-internals.h (_MonoGenericContainer): Widen type_argc filed to 31 bits.
8715         Fixes #81599.
8716
8717 2007-05-11  Jonathan Chambers  <joncham@gmail.com>
8718
8719         * object.c: Always initialize apartment, even if 
8720         there is no custom attributes on entry point.
8721         
8722         Code is contributed under MIT/X11 license.
8723
8724 2007-05-10  Jonathan Chambers  <joncham@gmail.com>
8725
8726         * marshal.c: LPTSTR == LPWSTR on Win32. Fixes #81370.
8727         * metadata.c: If no encoding is set, check for unicode
8728         on class.
8729         
8730         Code is contributed under MIT/X11 license.
8731
8732 2007-05-09  Jonathan Chambers  <joncham@gmail.com>
8733
8734         * threads.c: Handle if mono_thread_current returns NULL 
8735         
8736         Code is contributed under MIT/X11 license.
8737
8738 2007-05-09  Jonathan Chambers  <joncham@gmail.com>
8739
8740         * threads.c: Initialize Thread.AprtmentState and set on Thread.Start
8741         in start_wrapper. Added mono_thread_init_apartment_state and
8742         mono_thread_cleanup_apartment_state.
8743         * object.c: Initialize thread apartment state on main thread
8744         by checking for STAThreadAttribute on entry point.
8745         * object-internals.h: Add apartment_state field to MonoThread.
8746         * threads-types.h: Add unmanaged definition of 
8747         System.Threading.ApartmentState, MonoThreadApartmentState.
8748         
8749         Code is contributed under MIT/X11 license.
8750         
8751 2007-05-08  Jonathan Chambers  <joncham@gmail.com>
8752
8753         * class.c: Fix windows build.
8754         * class-internals.h: Fix windows build.
8755         
8756         Code is contributed under MIT/X11 license.
8757
8758 2007-05-08  Robert Jordan  <robertj@gmx.net>
8759
8760         * process.c (CreateProcess_internal):
8761         Pass CREATE_NO_WINDOW to CreateProcess when ProcessStartupInfo
8762         .CreateNoWindow was specified. Fixes #81496.
8763
8764 2007-05-08  Massimiliano Mantione  <massi@ximian.com>
8765
8766         * class-internals.h: Removed "MonoClass.interface_offsets" as a first
8767         step in implementing IMT, replaced it with two compact arrays
8768         (interfaces_packed and interface_offsets_packed) and a bitmap that
8769         is used for isinst checks (interface_bitmap).
8770
8771         * class.c: (compare_interface_ids): compare function to pass to
8772         bsearch when looking for an interface with a given id.
8773         (mono_class_interface_offset): reimplemented using bsearch on
8774         interfaces_packed, getting the offset from interface_offsets_packed.
8775         (print_implemented_interfaces): utility debugging function.
8776         (setup_interface_offsets): reworked to initialize interfaces_packed,
8777         interface_offsets_packed and interface_bitmap.
8778
8779         * object.c: replaced all accesses to "MonoClass.interface_offsets"
8780         with uses of interfaces_packed and interface_offsets_packed.
8781
8782 2007-05-08  Massimiliano Mantione  <massi@ximian.com>
8783
8784         * class-internals.h: Added MONO_CLASS_IMPLEMENTS_INTERFACE macro and
8785         mono_class_interface_offset prototype to wrap all accesses to
8786         "MonoClass.interface_offsets".
8787
8788         * class.c: Implemented mono_class_interface_offset, and wrapped all
8789         accesses to "MonoClass.interface_offsets".
8790
8791         * monodiet.c, object.c, marshal.c, icall.c: wrapped all accesses to
8792         "MonoClass.interface_offsets".
8793
8794 Tue May 8 13:02:09 CEST 2007 Paolo Molaro <lupus@ximian.com>
8795
8796         * icall.c, icall-def.h: implemented new GetFieldFromHandle and
8797         GetMethodFromHandle overloads (bug #78637).
8798
8799 Tue May 8 12:22:14 CEST 2007 Paolo Molaro <lupus@ximian.com>
8800
8801         * assembly.c: parse ProcessorArchitecture in assembly name and ignore
8802         it for now (see mono-devel, from Marek Sieradzki <marek.sieradzki@gmail.com>).
8803
8804 2007-05-01  Zoltan Varga  <vargaz@gmail.com>
8805
8806         * icall.c (custom_attrs_get_by_type): Handle loading errors gracefully. Fixes
8807         #81498.
8808
8809         * reflection.c (mono_reflection_get_custom_attrs_by_type): Handle loading errors
8810         gracefully.
8811         (mono_custom_attrs_from_index): Ditto.
8812
8813         * icall.c (ves_icall_InternalInvoke): Allow calling ctors of abstract classes. 
8814         Fixes #81501.
8815
8816 2007-04-30  Zoltan Varga  <vargaz@gmail.com>
8817
8818         * metadata.c (mono_metadata_parse_type_full): Avoid an invalid free since the type
8819         is now allocated from a mempool.
8820
8821 2007-04-28  Zoltan Varga  <vargaz@gmail.com>
8822
8823         * threads.c (build_wait_tids): Do not call mono_monitor_enter () here since the
8824         caller holds threads_lock, leading to deadlocks. Fixes #81476.
8825
8826 2007-04-26  Zoltan Varga  <vargaz@gmail.com>
8827
8828         * loader.c (mono_loader_error_prepare_exception): Fix crash caused by calling
8829         mono_loader_clear_error () too late. Fixes #81463.
8830
8831 2007-04-26  Atsushi Enomoto  <atsushi@ximian.com>
8832
8833         * culture-info-table.h : regenerated.
8834
8835 2007-04-25  Zoltan Varga  <vargaz@gmail.com>
8836
8837         * appdomain.c (add_assemblies_to_domain): Fix crash when an assembly reference
8838         is missing.
8839
8840 2007-04-25  Dick Porter  <dick@ximian.com>
8841
8842         * Makefile.am: Put the mingw enforced-optimisation back into the
8843         PLATFORM_WIN32 section.
8844
8845 2007-04-24  Zoltan Varga  <vargaz@gmail.com>
8846
8847         * reflection.c (mono_image_load_module_dynamic): Fix crash introduced by previous
8848         patch.
8849
8850         * image.c (mono_image_load_module): New API function to load a module reference.
8851
8852         * image.c (load_modules): Load modules lazily. Fixes #80812.
8853
8854         * class.c (mono_class_from_typeref): Use mono_image_load_module.
8855         
8856         * reflection.c (mono_image_load_module_dynamic): Copy image->modules_loaded too.
8857
8858         * object-internals.h reflection.c icall-def.h (mono_image_load_module): Rename this 
8859         to mono_image_load_module_dynamic.
8860
8861 2007-04-23  Jonathan Chambers  <joncham@gmail.com>
8862
8863         * marshal.c: Fix calling convention for CCW on non-windows
8864         platforms. STDCALL on windows, CDECL everywhere else to work 
8865         with XPCOM and MainWin COM.
8866         
8867         Code is contributed under MIT/X11 license.
8868
8869 2007-04-23  Martin Baulig  <martin@ximian.com>
8870
8871         Fix #80969.
8872
8873         * loader.c
8874         (method_from_memberref): Added `gboolean *used_context' argument.
8875         (mono_get_method_from_token): Likewise.
8876         (mono_get_method_full): Don't insert the method in the cache when
8877         `used_context' is true.
8878
8879 2007-04-23  Raja R Harinath  <rharinath@novell.com>
8880
8881         * monodiet.c (add_types_from_method): Fix "wrong type" warning.
8882
8883         * reflection.c (mono_reflection_bind_generic_parameters): Don't
8884         create new MonoTypes for returned types.
8885         * class.c (mono_generic_class_get_class): Export mono-internal.
8886         * class-internals.h: Update to changes.
8887
8888 Thu Apr 19 16:45:55 CEST 2007 Paolo Molaro <lupus@ximian.com>
8889
8890         * threadpool.c, threadpool.h, icall-def.h: patch from
8891         Robert Jordan to implemnt ThreadPool.SetMaxThreads.
8892
8893 2007-04-18  Zoltan Varga  <vargaz@gmail.com>
8894
8895         * threads.c (mono_thread_get_stack_bounds): Fix windows build.
8896         
8897         * threads.c (mono_thread_get_stack_bounds): Remove an assert which can be triggered.
8898
8899         * threads.c (mono_thread_get_stack_bounds): New helper function.
8900
8901         * threads.c (mono_thread_attach): Applied patch from horst.reiterer@fabasoft.com.
8902         Correctly compute stack bounds when attaching. Fixes #81394.
8903
8904 Wed Apr 18 18:28:41 BST 2007 Paolo Molaro <lupus@ximian.com>
8905
8906         * reflection.c: fix handling of doubles in custom attributes
8907         for the arm-fpa format (bug #81368).
8908
8909 2007-04-18  Raja R Harinath  <rharinath@novell.com>
8910
8911         * reflection.c (assembly_add_win32_resources): Mildly relax an
8912         bounds check to let the end pointer point just past the end of the
8913         allocated buffer.  (may fix #81384)
8914
8915 2007-04-17  Atsushi Enomoto  <atsushi@ximian.com>
8916
8917         * culture-info-table.h : regenerated.
8918
8919 2007-04-07  Zoltan Varga  <vargaz@gmail.com>
8920
8921         * threads.c (start_wrapper): Call push_appdomain_ref () earlier to fix races where
8922         the thread is aborted early.
8923
8924 2007-04-05  Dick Porter  <dick@ximian.com>
8925
8926         * file-io.c (ves_icall_System_IO_MonoIO_GetFileSystemEntries): use
8927         FindFirstFile()/FindNextFile() to find entries.  This lets the
8928         io-layer versions use MONO_IOMAP compatibility helpers.  Fixes bug
8929         81038.
8930
8931         * appdomain.c (MONO_CORLIB_VERSION): Increment, as the usage of
8932         the parameters of
8933         ves_icall_System_IO_MonoIO_GetFileSystemEntries() has changed.
8934
8935 2007-04-04  Martin Baulig  <martin@ximian.com>
8936
8937         * debug-helpers.c
8938         (mono_method_desc_full_match): Add support for nested classes.
8939
8940 2007-04-02  Zoltan Varga  <vargaz@gmail.com>
8941
8942         * marshal.c (cominterop_get_managed_wrapper_adjusted): Fix warnings.
8943
8944 2007-04-01  Zoltan Varga  <vargaz@gmail.com>
8945
8946         * threads.c (abort_appdomain_thread): Avoid handle leakage if we are
8947         waiting for too many threads.
8948
8949 2007-03-28  Sebastien Pouliot  <sebastien@ximian.com>
8950
8951         * environment.c: Fix return value check on uname so we can get the 
8952         executing version on Solaris operating systems.
8953
8954 2007-03-28  Jb Evain  <jbevain@gmail.com>
8955
8956         * class.c (mono_type_get_name_recurse): Complete the
8957         fix for the creation of assembly qualified names for
8958         pointer types. Fixes #81208.
8959
8960 2007-03-27  Dick Porter  <dick@ximian.com>
8961
8962         * appdomain.c (MONO_CORLIB_VERSION): Increment, as the signature
8963         of ves_icall_System_Threading_Mutex_ReleaseMutex_internal() has
8964         changed.
8965
8966         * threads.c
8967         (ves_icall_System_Threading_Mutex_ReleaseMutex_internal): Return
8968         the value of ReleaseMutex().
8969
8970 2007-03-27  Dick Porter  <dick@ximian.com>
8971
8972         * socket-io.c (ipaddress_to_struct_in_addr): IPAddress is stored
8973         in little-endian order, not network endian, so must be converted
8974         to host endian here.  Fixes bug 80593.
8975
8976 2007-03-22  Jb Evain  <jbevain@gmail.com>
8977
8978         * class.c (mono_type_get_name_recurse): Fix the creation of assembly
8979         qualified names for pointer types. Fixes #81208.
8980
8981 2007-03-21  Jonathan Chambers  <joncham@gmail.com>
8982
8983         * marshal.c: Add support for PreserveSigAttribute. 
8984         
8985         Code is contributed under MIT/X11 license.
8986
8987 2007-03-14  Zoltan Varga  <vargaz@gmail.com>
8988
8989         * process.c: Fix endianness issues. Fixes #81126.
8990
8991         * reflection.c (mono_reflection_create_dynamic_method): Fix the last change so
8992         multiple circular calls made from the same DynamicMethod work. Fixes #81141.
8993
8994         * image.c (mono_image_lookup_resource): Make this work on big-endian
8995         machines.Change API contract so the caller needs to free the return value.
8996         
8997         * process.c (process_get_fileversion): Adapt to mono_image_lookup_resource ()
8998         API change.
8999         
9000 2007-03-14  Martin Baulig  <martin@ximian.com>
9001
9002         * debug-helpers.c (mono_type_get_desc): In `MONO_TYPE_ARRAY', use
9003         mono_type_get_desc() as well.
9004
9005 2007-03-13  Jonathan Chambers  <joncham@gmail.com>
9006
9007         * icall.c:  Fix environ access in VS.  
9008         
9009 2007-03-13  Alp Toker  <alp@atoker.com>
9010
9011         * icall.c (ves_icall_MonoType_GetElementType): For enums, return null
9012         rather than the underlying type. Based on a patch by Ben Maurer. Fixes
9013         #63841.
9014
9015 2007-03-12  Zoltan Varga  <vargaz@gmail.com>
9016
9017         * reflection.c (mono_reflection_create_dynamic_method): Add support for 
9018         circular references among dynamic methods. Fixes #81091.
9019
9020         * object-internals.h (MonoReflectionDynamicMethod): Add 'referenced_by' field.
9021
9022 2007-03-09  Martin Baulig  <martin@ximian.com>
9023
9024         * reflection.c (encode_constant): Add support for MONO_TYPE_GENERICINST.
9025
9026 2007-03-09  Jonathan Chambers  <joncham@gmail.com>
9027
9028         * appdomain.c:  Fix shadow copy on Windows. Use g_snprintf instead
9029         of snprintf as it doesn't exist on Win32 (VS build); also for uniformity.  
9030         
9031         Code is contributed under MIT/X11 license.
9032         
9033 2007-03-09  Gert Driesen  <drieseng@users.souceforge.net>
9034
9035         * loader.c: Reapply patch for bug #79424.
9036
9037 2007-03-06  Zoltan Varga  <vargaz@gmail.com>
9038
9039         * metadata.c (mono_type_to_unmanaged): Only convert object to
9040         MARSHAL_CONV_SAFEHANDLE on the 2.0 profile.
9041
9042 Tue Mar 6 15:39:48 CET 2007 Paolo Molaro <lupus@ximian.com>
9043
9044         * class-internals.h, class.c, metadata.c, reflection.c: removed unused
9045         (and incorrectly set) is_reference field from MonoGenericInst.
9046
9047 2007-03-06  Zoltan Varga  <vargaz@gmail.com>
9048
9049         * assembly.c (mono_assembly_load_from_full): Call mono_assemblies_unlock ()
9050         a little earlier.
9051
9052         * icall.c (ves_icall_type_Equals): Rename this to ves_icall_System_Type_EqualsInternal.
9053
9054         * icall-def.h: Rename Type:Equals to Type:EqualsInternal.
9055
9056 2007-03-05  Miguel de Icaza  <miguel@novell.com>
9057
9058         * file-io.c (ves_icall_System_IO_MonoIO_Open): Use the new
9059         FileOptions.1 value to mean "temporary", map that to
9060         FILE_ATTRIBUTE_TEMPORARY and use that to signal 600 permissions.
9061
9062         Fixes 80688
9063
9064 2007-03-03  Marek Habersack  <mhabersack@novell.com>
9065
9066         * appdomain.c: implement MS .Net style shadow copying. Copies of
9067         the assemblies are made in a subdirectory of the dynamic base
9068         directory, the assembly names are preserved.
9069         Copy .mdb and .config files along with the assemblies being shadowed.
9070
9071 2007-02-28  Zoltan Varga  <vargaz@gmail.com>
9072
9073         * marshal.c (emit_object_to_ptr_conv): Emit valid IL for handling HandleRefs.
9074         (emit_marshal_handleref): Ditto.
9075
9076         * profiler.c: Applied patch from Tor Lillqvist (tml@novell.com) to fix output
9077         on Visual C++. Fixes #80671.
9078
9079 Wed Feb 28 16:53:40 CET 2007 Paolo Molaro <lupus@ximian.com>
9080
9081         * boehm-gc.c, null-gc.c, object.h, object.c: sgen gc fixes
9082         for clone operations.
9083
9084 2007-02-28  Zoltan Varga  <vargaz@gmail.com>
9085
9086         * marshal.c: Fix warnings.
9087
9088 Fri Feb 23 15:06:57 CET 2007 Paolo Molaro <lupus@ximian.com>
9089
9090         * loader.c: allow case-insensitive matching of the dll name
9091         in dllmap handling when prefixed with "i:".
9092
9093 2007-02-20  Jonathan Chambers  <joncham@gmail.com>
9094
9095         * threads.c: Fix #ifdef for dummy_apc function for VS.
9096
9097 Tue Feb 20 11:59:42 CET 2007 Paolo Molaro <lupus@ximian.com>
9098
9099         * threads.c: don't throw in MemoryBarrier (), use lock/unlock.
9100
9101 2007-02-19  Massimiliano Mantione  <massi@ximian.com>
9102         * class.c (mono_class_setup_vtable_general): Fix bug 75903,
9103         giving precedence to the methods with a fully qualified name
9104         (InterfaceName.MethodName) when building the interface sections
9105         of the vtable.
9106
9107 2007-02-16  Dick Porter  <dick@ximian.com>
9108
9109         * threadpool.c (append_job): Fix fast-path array handling, so it's
9110         less likely the array will grow exponentially when the load is
9111         heavy.
9112
9113 Fri Feb 16 19:17:30 CET 2007 Paolo Molaro <lupus@ximian.com>
9114
9115         * metadata-internals.h, loader.c: fix dllmap lookup order
9116         for non-function maps, too, and prepare for fallback code.
9117
9118 2007-02-12  Robert Jordan  <robertj@gmx.net>
9119
9120         * marshal.c, marshal.h, icall-def.h: rename mono_marshal_realloc
9121         to ves_icall_System_Runtime_InteropServices_Marshal_ReAllocHGlobal
9122         and use GlobalReAlloc on WIN32 to be in sync with GlobalAlloc,
9123         GlobalFree. Fixes a part of bug #77075.
9124
9125 Mon Feb 12 21:10:07 CET 2007 Paolo Molaro <lupus@ximian.com>
9126
9127         * loader.c: implemented typedef parent in field memberref.
9128
9129 2007-02-11  Jonathan Chambers  <joncham@gmail.com>
9130
9131         * marshal.c: Fix warnings and remember to call Release on
9132         IUnknown of RCW.
9133         
9134         Code is contributed under MIT/X11 license.
9135
9136 2007-02-10  Miguel de Icaza  <miguel@novell.com>
9137
9138         * class-internals.h: Add MonoHandleRef definition, and
9139         handleref_class to mono_defaults. 
9140
9141         * metadata.c (mono_type_to_unmanaged): If we find HandleRefs in a
9142         structure, use new conversion MONO_MARSHAL_CONV_HANDLEREF.
9143
9144         * marshal.c (emit_ptr_to_object_conv): Add support for HandleRefs
9145         (do nothing on this stage)
9146         (emit_object_to_ptr_conv): Extract the handle from the HandleRef.  
9147         (emit_marshal_handleref): New method, used for argument handling
9148         of HandleRefs. 
9149
9150 2007-02-08  Jonathan Chambers  <joncham@gmail.com>
9151
9152         * class.c (mono_class_setup_parent): Lazily init com types.
9153         * domain.c (mono_init_internal, mono_init_com_types): Lazily 
9154         init com types.
9155         * object.c (mono_remote_class_vtable): Lazily init com types.
9156         * class-internals.h: Add iunknown and idispatch to MonoDefaults.
9157         * object-internals.h: Add MonoComInteropProxy and MonoReflectionGuidAttribute.
9158         * domain-internals.h: Expose mono_init_com_types.
9159         * icall-def.h: Add icalls for ComInteropProxy, __ComObject, and Marshal.
9160         * marshal.c: Add mutex for cominterop use. Init locals for wrapper methods.
9161         Add support for COM Callable Wrapper marshalling.
9162         * marshal.h: Add icall definitions.
9163         * gc.c: Handle freeing of CCWs in finalizer code.
9164         
9165         Code is contributed under MIT/X11 license.
9166
9167 Thu Feb 8 12:46:18 CET 2007 Paolo Molaro <lupus@ximian.com>
9168
9169         * reflection.c: changed all the signature encoding code to use
9170         a variable-sized buffer.
9171
9172 Wed Feb 7 20:37:23 CET 2007 Paolo Molaro <lupus@ximian.com>
9173
9174         * marshal.c: locking fixes: never take the loader lock
9175         or other runtime locks when holding the marshal lock
9176         (fixes bug#80664).
9177
9178 Wed Feb 7 18:49:10 CET 2007 Paolo Molaro <lupus@ximian.com>
9179
9180         * marshal.c: make the delegate function pointer mapping
9181         work for the moving GC.
9182
9183 Mon Jan 29 11:30:46 CET 2007 Paolo Molaro <lupus@ximian.com>
9184
9185         * marshal.c: fix from Robert Jordan (robertj@gmx.net)
9186         for bug #80618.
9187
9188 Fri Jan 26 12:49:23 CET 2007 Paolo Molaro <lupus@ximian.com>
9189
9190         * image.h, loader.c, metadata-internals.h: use mono-dl instead of
9191         gmodule.
9192
9193 Fri Jan 26 12:00:45 CET 2007 Paolo Molaro <lupus@ximian.com>
9194
9195         * threadpool.c: made the code moving-GC safe.
9196
9197 Thu Jan 25 20:31:41 CET 2007 Paolo Molaro <lupus@ximian.com>
9198
9199         * assembly.c, boehm-gc.c, class-internals.h, class.c,
9200         debug-mono-symfile.c, domain.c, locales.c, marshal.c, metadata.c,
9201         monitor.c, mono-debug.c, mono-debug.h, object.c, profiler.c:
9202         warning cleanup.
9203         * reflection.c: warning cleanup, some threading and moving GC fixes.
9204
9205 Thu Jan 25 16:22:36 CET 2007 Paolo Molaro <lupus@ximian.com>
9206
9207         * class.c, loader.c: create the needed Set/Get/Address array methods
9208         as well as the .ctors in mono_class_init (), fixes bug #80567.
9209
9210 2007-01-24  Zoltan Varga  <vargaz@gmail.com>
9211
9212         * class.c (mono_class_layout_fields): When force-aligning a field, make sure
9213         we doesn't decrease its alignment. Should fix the sparc build.
9214
9215 2007-01-24  Dick Porter  <dick@ximian.com>
9216
9217         * socket-io.c
9218         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
9219         Create the returned object if we need to ignore an unsupported
9220         socket option.  Fixes a segfault reported by Atsushi.
9221
9222 Tue Jan 23 18:09:21 CET 2007 Paolo Molaro <lupus@ximian.com>
9223
9224         * class.c, object.c: restrict GC-tracked fields to
9225         UIntPtr fields used inside corlib, so we provide better
9226         type info to the GC and also allow broken packing as in
9227         bug #80580.
9228
9229 Mon Jan 22 11:24:27 CET 2007 Paolo Molaro <lupus@ximian.com>
9230
9231         * sgen-gc.c: removed duplicated function.
9232
9233 2007-01-19  Miguel de Icaza  <miguel@novell.com>
9234
9235         *  socket-io.c (convert_sockopt_level_and_name): return -2 as a
9236         value that means that the value is not supported, but that we
9237         should not return a failure, but instead report this as a
9238         successful operation.
9239
9240 2007-01-19  Raja R Harinath  <rharinath@novell.com>
9241
9242         Fix tests/bug79956.2.il
9243         * class.c (mono_type_get_underlying_type): Handle genericinst enums.
9244         (mono_generic_class_get_class): If the generic definition in an
9245         enum, copy over other fields related to it.
9246
9247 Thu Jan 18 18:37:28 CET 2007 Paolo Molaro <lupus@ximian.com>
9248
9249         * metadata.h: fix MONO_TYPE_ISSTRUCT() to not consider
9250         genericinst enums (bug #79215).
9251
9252 2007-01-17  Massimiliano Mantione  <massi@ximian.com>
9253         * class.c: Fix bug 80307.
9254
9255 Wed Jan 17 17:09:20 CET 2007 Paolo Molaro <lupus@ximian.com>
9256
9257         * image.c: if the file table is not present, try to load
9258         all the modules, since we don't have info about them
9259         having or not metadata (bug #80517).
9260         * assembly.c: allow mono_assembly_load_references () to
9261         work for netmodules.
9262
9263 Wed Jan 17 14:28:30 CET 2007 Paolo Molaro <lupus@ximian.com>
9264
9265         * image.c, metadata-internals.h, object.c: execute module
9266         cctors when running on the 2 runtime if present (bug #80487).
9267
9268 Tue Jan 16 15:32:53 CET 2007 Paolo Molaro <lupus@ximian.com>
9269
9270         * icall.c: optimized InitializeArray() on bigendian.
9271
9272 Tue Jan 16 13:18:51 CET 2007 Paolo Molaro <lupus@ximian.com>
9273
9274         * icall.c: fix for the broken ARM FPA double format.
9275
9276 Tue Jan 16 12:51:16 CET 2007 Paolo Molaro <lupus@ximian.com>
9277
9278         * icall.c: handle endian issues for r4 and r8 types, too, in
9279         the InitializeArray() icall.
9280
9281 2007-01-15  Miguel de Icaza  <miguel@novell.com>
9282
9283         * loader.c (mono_loader_error_prepare_exception): Clear the error
9284         once we have extracted the information from it, do this before we
9285         call into the JIT's class loading mechanisms.
9286
9287         * object.c (mono_class_create_runtime_vtable): Do not clear the
9288         loader error before calling mono_class_get_exception_for_failure
9289         as the loader error is needed inside
9290         mono_class_get_exception_for_failure to throw the error (thinko).
9291
9292         Fixes #80521
9293         
9294 Mon Jan 15 10:27:31 CET 2007 Paolo Molaro <lupus@ximian.com>
9295
9296         * reflection.c: align fields rva data so it's faster to load at
9297         runtime.
9298
9299 2007-01-12  Raja R Harinath  <rharinath@novell.com>
9300
9301         Prepare to simplify GenericMethod handling.
9302         * class-internals.h (mono_method_get_context): New accessor function.
9303         * class.c, icall.c, loader.c, reflection.c, verify.c: Use accessor
9304         rather than directly accessing '->context' field.
9305
9306         * class-internals.h (_MonoGenericParam.method): Move ...
9307         (_MonoGenericContainer): ... here.  Add into union with klass field.
9308         * class.c, icall.c, loader.c, metadata.c, reflection.c:
9309         Update to changes.
9310
9311 Fri Jan 12 11:58:52 CET 2007 Paolo Molaro <lupus@ximian.com>
9312
9313         * Makefile.am, class-internals.h, debug-helpers.c: consolidate
9314         the wrapper type enum and reduce relocations.
9315
9316 2007-01-12  Raja R Harinath  <rharinath@novell.com>
9317
9318         * reflection.c (inflate_mono_method): Reuse method instantiation
9319         from the generic method, if available.
9320
9321 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
9322
9323         * marshal.c (emit_marshal_variant): Fix conv_arg
9324         type in last commit, based on whether parameter is byref.
9325         
9326 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
9327
9328         * marshal.c (emit_marshal_variant): Handle unmanaged->managed
9329         marshalling.
9330         (mono_marshal_emit_managed_wrapper): Convert byref arguments of type
9331         MONO_TYPE_OBJECT back for VARIANT support.
9332
9333 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
9334
9335         * marshal.c, marshal.h, icall-def.h: Implement 
9336         Marshal.ReAllocCoTaskMem.
9337
9338 Thu Jan 11 19:00:03 CET 2007 Paolo Molaro <lupus@ximian.com>
9339
9340         * marshal.c: memory retention fixes: use the proper
9341         image cache for runtime_invoke method lookups.
9342
9343 Thu Jan 11 18:53:19 CET 2007 Paolo Molaro <lupus@ximian.com>
9344
9345         * mempool.c: added code to help debug mempool allocations.
9346
9347 2007-01-11  Dick Porter  <dick@ximian.com>
9348
9349         * socket-io.c (convert_sockopt_level_and_name): Add DontFragment
9350         support (experimenting with faking it with IP_MTU_DISCOVER for
9351         systems that don't have IP_DONTFRAGMENT.)
9352         (ves_icall_System_Net_Sockets_Socket_Disconnect_internal): New
9353         icall.
9354
9355         * icall-def.h: new System.Net.Sockets.Disconnect icall.
9356
9357         * socket-io.h: Add new fields to MonoSocketAsyncResult
9358         corresponding to the new ones in Socket.cs.
9359
9360 2007-01-11  Raja R Harinath  <rharinath@novell.com>
9361
9362         Fix IronPython regression mentioned in #80249
9363         * metadata.c (do_mono_metadata_parse_generic_class): Clear
9364         'cached_context' field, since it may have been initialized as a
9365         side-effect of metadata parsing.
9366
9367         * class-internals.h (_MonoGenericClass.is_inflated): Remove.
9368         (_MonoGenericClass.cached_class): Move here and rename from lone
9369         remaining field of ...
9370         (_MonoInflatedGenericClass): ... this.  Remove.
9371         * metadata.h, class.c, reflection.c, metadata.c, icall.c: Update
9372         to changes.
9373
9374         Fix mcs/tests/test-128.cs regression.
9375         * reflection.c (encode_cattr_value) [MONO_TYPE_SZARRAY]: Revert
9376         2007-01-10 change below.
9377         [MONO_TYPE_OBJECT]: Recurse into array case.
9378
9379 2007-01-11  Raja R Harinath  <harinath@gmail.com>
9380
9381         * class-internals.h (mono_get_inflated_generic_class): Remove.
9382         * class.c (mono_get_inflated_generic_class): Remove.
9383         (mono_generic_class_get_class): Rename from
9384         mono_class_create_generic.
9385         (mono_class_from_mono_type) [GENERICINST]: Use it.
9386         * reflection.c, metadata.c: Update to changes.  Use
9387         'mono_class_from_mono_type'.
9388
9389 Wed Jan 10 16:19:54 CET 2007 Paolo Molaro <lupus@ximian.com>
9390
9391         * reflection.c: use passed type when encoding an array element
9392         in custom attributes (patch from David Mitchell, dmitchell@logos.com).
9393
9394 2007-01-09  Robert Jordan  <robertj@gmx.net>
9395
9396         * marshal.c (mono_delegate_end_invoke): Add check for unpaired asyc
9397         result arguments (someDelegate.EndInvoke (unrelatedAres)).
9398         Fixes bug #80392.
9399
9400 2007-01-09  Raja R Harinath  <rharinath@novell.com>
9401
9402         * class-internals.h (_MonoInflatedGenericClass.is_initialized): Remove.
9403
9404         * object.c (set_value): Avoid aliasing between type->data.klass
9405         and type->data.generic_class.
9406
9407         * class.c (mono_class_create_generic): Don't use 'is_initialized' field.
9408
9409 2007-01-08  Raja R Harinath  <rharinath@novell.com>
9410
9411         * marshal.c (mono_marshal_get_runtime_invoke): Avoid aliasing
9412         between type->data.klass and type->data.generic_class.
9413
9414 2007-01-08  Lluis Sanchez  <lluis@ximian.com>
9415
9416         * marshal.c: In MS.NET, StringBuilder objects are not copied by
9417         value in out parameters.
9418
9419 2007-01-08  Raja R Harinath  <rharinath@novell.com>
9420
9421         Simplify invariant for MonoGenericClass::klass field.
9422         * class.c (mono_class_create_generic): Verify 'klass' is null.
9423         * metadata.c (do_mono_metadata_parse_generic_class): Don't
9424         initialize 'klass' field.
9425
9426 2007-01-05  Raja R Harinath  <rharinath@novell.com>
9427
9428         Ongoing work to avoid redundant data and simplify invariants.
9429         * class-internals.h (_MonoGenericMethod.class_inst): Rename from
9430         'generic_class', and change type to a GenericInst.
9431         (_MonoGenericContext.class_inst): Likewise, rename from 'gclass'.
9432         * class.c, loader.c, metadata.c, reflection.c: Update to changes.
9433
9434 2007-01-05  Atsushi Enomoto  <atsushi@ximian.com>
9435
9436         * class.c : skip io-layer under PLATFORM_WIN32.
9437
9438 2007-01-03  Tor Lillqvist  <tml@novell.com>
9439
9440         Fix #80305: In a bundled executable, look in the bundled exe
9441         assembly to determine the runtime version. Add the possibility to
9442         bundle also the machine.config file.
9443         
9444         * assembly.c (mono_assembly_open_from_bundle): Make
9445         non-static. Allow being called even if we have no bundled
9446         assemblies, and return NULL right away in that case.
9447
9448         * domain-internals.h: Declare mono_assembly_open_from_bundle()
9449         here.
9450
9451         * domain.c (app_config_parse): Take an assembly exe file name as
9452         parameter instead of a config file name. Check for a bundled
9453         config file for that assembly by calling
9454         mono_config_string_for_assembly_file() (see below) before looking
9455         for one in the file system.
9456         (get_runtimes_from_exe): Corrsponding change to call of
9457         app_config_parse().
9458         (get_runtimes_from_exe): Check for bundled assembly exe file first
9459         by calling mono_assembly_open_from_bundle(). If no bundled
9460         assembly exe file is found, call mono_image_open() as before to
9461         look it up in the file system.
9462
9463         * mono-config.c: Add variable bundled_machinec_onfig.
9464         (mono_config_string_for_assembly_file): New function.
9465         (mono_config_for_assembly): Move code snippet that looks for a
9466         bundled assembly .config file into the above new function. Call
9467         it.
9468         (mono_register_machine_config, mono_get_machine_config): New
9469         functions to set and retrieve
9470
9471         * assembly.h: Declare mono_register_machine_config().
9472
9473         * mono-config.h: Declare mono_get_machine_config() and
9474         mono_config_string_for_assembly_file().
9475
9476         * icall.c: No declaration of environ necessary on Win32. It is
9477         declared (as a macro expanding to a function call) in stdlib.h.
9478         (ves_icall_System_Configuration_DefaultConfig_get_bundled_machine_config):
9479         New internal mono function. Returns the value of
9480         mono_get_machine_config() as a Mono string.
9481
9482         * icall-def.h: Add get_bundled_machine_config().
9483
9484 2007-01-04  Raja R Harinath  <rharinath@novell.com>
9485
9486         Remove redundant field
9487         * class-internals.h (_MonoGenericContext.container): Remove field.
9488         * loader.c (mono_method_get_signature_full): Don't parse a
9489         "container" for a signature parse when the signature is inflated
9490         immediately.
9491         (method_from_methodspec): Likewise, for a generic_inst.
9492         * class.c, metadata.c, reflection.c: Update to changes.
9493
9494 2006-01-04  Raja R Harinath  <rharinath@novell.com>
9495
9496         * class-internals.h (_MonoGenericClass): Rename 'context' field to
9497         'cached_context', and change semantics -- it starts off NULL, and
9498         is initialized on demand.
9499         * class.c (mono_generic_class_get_context): New accessor to
9500         replace 'context' field accesses.
9501         (mono_class_get_context): New helper.
9502         (*): Update to changes.
9503         * icall.c, loader.c, metadata.c, reflection.c: Update to changes.
9504
9505 2007-01-03  Miguel de Icaza  <miguel@novell.com>
9506
9507         * marshal.c (mono_string_to_byvalstr): Fix thinko, shorten len
9508         before the memcpy.   Fixes Marshal2 regression.
9509
9510 2007-01-02  Jb Evain  <jbevain@gmail.com>
9511
9512         * blob.h: add a MONO_TYPE_ENUM definition
9513         * reflection.c (load_cattr_value, create_custom_attr, create_custom_attr_data):
9514         fix the encoding of arrays of enums in custom attributes.
9515
9516         Fixes #79666.
9517
9518 2007-01-01  Miguel de Icaza  <miguel@novell.com>
9519
9520         * marshal.c (mono_string_to_byvalwstr): Fix this routine.   The
9521         string is null terminated, but only cut the string short if it
9522         overflows the buffer.   
9523         
9524         (mono_string_to_byvalstr): Also fix this routine.   The code here
9525         was not properly terminating a string (it was only terminated
9526         because of the previous catch-all memset). 
9527
9528         I left the memset, because I do not know if applications expect
9529         the runtime to clear this region. 
9530
9531         Fixes #79944.
9532
9533         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType):
9534         Clear the error before returning to unmanaged code to prevent the
9535         runtime from being confused later on (fixes  80420).
9536         (ves_icall_type_from_name): Always call mono_loader_clear_error
9537         after parsing a type that could have failed.
9538         (ves_icall_System_Reflection_Assembly_GetTypes): ditto.
9539
9540         * loader.c (mono_loader_clear_error): Fix indentation.
9541
9542 2006-12-28  Martin Baulig  <martin@ximian.com>
9543
9544         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 58.
9545
9546 Fri Dec 22 20:04:57 CET 2006 Paolo Molaro <lupus@ximian.com>
9547
9548         * reflection.c: patch from Rolf Bjarne Kvinge to fix
9549         getting a token for an EnumBuilder.
9550
9551 Fri Dec 22 19:49:07 CET 2006 Paolo Molaro <lupus@ximian.com>
9552
9553         * reflection.c: be more careful in case resource generation
9554         fails to create the data array.
9555
9556 Fri Dec 22 18:17:40 CET 2006 Paolo Molaro <lupus@ximian.com>
9557
9558         * sgen-gc.c: write barrier for clone and fix unregister handles.
9559
9560 Fri Dec 22 18:15:33 CET 2006 Paolo Molaro <lupus@ximian.com>
9561
9562         * reflection.c: some fixes needed in the generics code for the moving GC.
9563
9564 2006-12-22  Robert Jordan  <robertj@gmx.net>
9565
9566         * icall.c (ves_icall_System_Array_SetValueImpl): Take enums into
9567         account. Fixes bug #80299.
9568
9569 2006-12-21  Raja R Harinath  <rharinath@novell.com>
9570
9571         Fix WaitHandle usage in delegates.
9572         * object-internals.h (mono_wait_handle_get_HANDLE): Declare.
9573         * object.c (mono_wait_handle_new): Use the property set method to
9574         initialize the handle.
9575         (mono_wait_handle_get_handle): New.
9576         * threadpool.c (mono_async_invoke): Use it.
9577         * threads.c (ves_icall_System_Threading_WaitHandle_WaitAll_internal):
9578         Likewise.
9579         (ves_icall_System_Threading_WaitHandle_WaitAny_internal): Likewise.
9580
9581 2006-12-21  Jonathan Chambers  <joncham@gmail.com>
9582
9583         * marshal.c (emit_marshal): Call emit_marshal_variant and
9584         emit_marshal_com_interface when applicable.
9585         (emit_marshal_variant, emit_marshal_com_interface): Add
9586         methods for this case and remove if's from emit_marshal_object.
9587         
9588 Wed Dec 20 11:03:56 CET 2006 Paolo Molaro <lupus@ximian.com>
9589
9590         * filewatcher.c: updated to use the mono-dl API instead of gmodule.
9591
9592 2006-12-19  Jonathan Chambers  <joncham@gmail.com>
9593
9594         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_AllocHGlobal,
9595         ves_icall_System_Runtime_InteropServices_Marshal_FreeHGlobal): Use GlobalAlloc
9596         and GlobalFree on Windows. Remove FIXME.
9597
9598 Tue Dec 19 16:18:16 CET 2006 Paolo Molaro <lupus@ximian.com>
9599
9600         * mono-mlist.h, mono-mlist.c, Makefile.am: linked list
9601         implementation for managed objects.
9602
9603 Tue Dec 19 14:28:03 CET 2006 Paolo Molaro <lupus@ximian.com>
9604
9605         * object.c: implemented code to be used for checking
9606         that no reference field overlaps with non-references.
9607
9608 Tue Dec 19 14:10:37 CET 2006 Paolo Molaro <lupus@ximian.com>
9609
9610         * threadpool.c: fix queue code to be compatible with the
9611         moving GC.
9612
9613 2006-12-18  Miguel de Icaza  <miguel@novell.com>
9614
9615         * marshal.c (emit_object_to_ptr_conv): Handle null safehandles
9616         in structures by throwing ArgumentNullException.
9617
9618         (emit_marshal_safehandle): Also when they are null parameters.
9619
9620         (emit_marshal_safehandle): Add support for ref
9621         SafeHandles parameters
9622
9623 Mon Dec 18 19:14:44 CET 2006 Paolo Molaro <lupus@ximian.com>
9624
9625         * profiler.c: updated to use the mono-dl API instead of
9626         gmodule.
9627
9628 Mon Dec 18 19:02:37 CET 2006 Paolo Molaro <lupus@ximian.com>
9629
9630         * profiler.c: updated to use the mono-dl dynamic loading
9631         API instead of gmodule.
9632
9633 Mon Dec 18 18:16:22 CET 2006 Paolo Molaro <lupus@ximian.com>
9634
9635         * profiler.c: use readlink, older versions of glib don't have
9636         g_file_read_link ().
9637
9638 Mon Dec 18 16:40:34 CET 2006 Paolo Molaro <lupus@ximian.com>
9639
9640         * profiler.c: try to detect the path to mono if libc fails to provide
9641         a useful name (bug #80286).
9642
9643 2006-12-16  Raja R Harinath  <rharinath@novell.com>
9644
9645         Fix #80242
9646         * icall.c (ves_icall_Type_GetNestedType): If the type is a generic
9647         instance, use the generic type definition instead.
9648         (ves_icall_Type_GetNestedTypes): Likewise.
9649         * class.c (mono_class_create_generic): Always set the
9650         nested_classes of a generic instance to NULL, even if the generic
9651         type definition has nested types.
9652
9653 2006-12-15  Jonathan Chambers  <joncham@gmail.com>
9654
9655         * marshal.c (mono_string_from_bstr): Revert previous Windows change
9656         and fix on Linux.
9657         
9658 2006-12-15  Miguel de Icaza  <miguel@novell.com>
9659
9660         * marshal.c (mono_string_from_bstr): Jon Chambers pointed out that
9661         my arguments were in the wrong order.   I also fixed the Windows
9662         version which seems to have had the same issue.
9663
9664         (mono_free_bstr): On Unix, this is g_free.
9665         (mono_string_from_bstr, mono_string_to_bstr): Implement bstr
9666         conversions (for the tests in corlib to pass).
9667
9668 2006-12-14  Miguel de Icaza  <miguel@novell.com>
9669
9670         * marshal.c (emit_ptr_to_object_conv): For now, ignore
9671         MONO_MARSHAL_CONV_SAFEHANDLE on return values (we need to throw an
9672         exception if a ref SafeHandle in a struct has changed).
9673         
9674         (emit_struct_conv): Do not perform layout checks for classes
9675         derived from SafeHandle, as those are specially handled. 
9676
9677         (emit_object_to_ptr_conv): Add support for
9678         MONO_MARSHAL_CONV_SAFEHANDLE conversion. 
9679
9680         (emit_marshal_safehandle): Implement conversion of return values
9681         of safehandles (MARSHAL_ACTION_CONV_RESULT).
9682         
9683         * threads.c: WaitHandle now is compiled with two different handles
9684         "IntPtr os_handle" for 1.x and "SafeWaitHandle safe_wait_handle"
9685         for 2.0.
9686         
9687         (ves_icall_System_Threading_WaitHandle_WaitAll_internal) 
9688         (ves_icall_System_Threading_WaitHandle_WaitAny_internal): Adjust
9689         these routines to cope with both kinds of fields.
9690
9691 2006-12-12  Miguel de Icaza  <miguel@novell.com>
9692
9693         * metadata.c (mono_type_to_unmanaged): Handle the case where
9694         type->data.klass is a SafeHandle, and in that case, return the
9695         size of a pointer (MONO_NATIVE_INT) and set the conversion to be
9696         MONO_MARSHAL_CONV_SAFEHANDLE. 
9697
9698 2006-12-11  Miguel de Icaza  <miguel@novell.com>
9699
9700         * marshal.c (emit_marshal): Hook up to the MONO_TYPE_CLASS and
9701         MONO_TYPE_OBJECT cases and check for a SafeHandle here before
9702         calling emit_marshal_object.
9703
9704         (emit_marshal_safehandle): Implement marshalling of
9705         SafeHandle parameters (no ref support yet).
9706
9707         (MarshalAction): Document the defines as I implement
9708         them for SafeHandle.
9709
9710         (emit_marshal_object): indentation police.
9711
9712         * class-internals.h: Define MonoSafeHandle.
9713         Add safehandle_class to MonoDefaults type.
9714
9715         * verify.c: Add System.Runtime.InteropServices.SafeHandle to the
9716         list of classes to check for fields. 
9717
9718         * domain.c (mono_init_internal): Add SafeHandle to the list of
9719         mono_defaults loaded.
9720
9721 2006-12-15  Raja R Harinath  <rharinath@novell.com>
9722
9723         Fix #80253
9724         * reflection.c (mono_reflection_bind_generic_parameters): If the
9725         generic type definition is a type builder, ensure that it is fully
9726         initialized before instantiating it.  Kill some dead code.
9727
9728 Thu Dec 14 17:02:59 CET 2006 Paolo Molaro <lupus@ximian.com>
9729
9730         * object.c: clear the loader_error () before loading
9731         more metadata stuff (bug #80258).
9732
9733 Thu Dec 14 12:49:47 CET 2006 Paolo Molaro <lupus@ximian.com>
9734
9735         * icall.c, icall-defs.h: type modifiers icalls for
9736         parameters and properties.
9737
9738 Wed Dec 13 19:29:50 CET 2006 Paolo Molaro <lupus@ximian.com>
9739
9740         * object.c, icall.c: fixed warnings.
9741
9742 Mon Dec 11 11:03:10 CET 2006 Paolo Molaro <lupus@ximian.com>
9743
9744         * marshal.c: fixed a couple of leaks and coding style in a few places.
9745
9746 2006-12-08  Dick Porter  <dick@ximian.com>
9747
9748         * process.c: Cope with NULL ProcessStartInfo arguments on windows
9749         too.  Patch from Jonathan Chambers <joncham@gmail.com>, fixes bug
9750         80173.
9751
9752 Thu Dec 7 15:20:31 CET 2006 Paolo Molaro <lupus@ximian.com>
9753
9754         * process.c: ProcessStartInfo may have only filename set and
9755         arguments can be NULL.
9756
9757 Tue Dec 5 19:19:34 CET 2006 Paolo Molaro <lupus@ximian.com>
9758
9759         * icall.c: fix leak found by Robert Jordan.
9760
9761 Tue Dec 5 17:53:10 CET 2006 Paolo Molaro <lupus@ximian.com>
9762
9763         * marshal.c, marshal.h: generate managed method to access an element
9764         of a multi-dimensional array.
9765
9766 2006-11-30  Paolo Molaro (lupus@ximian.com)
9767
9768         * metadata.c, marshal.c: locking fixes when writing to image->mempool.
9769
9770 Thu Nov 30 11:11:37 CET 2006 Paolo Molaro <lupus@ximian.com>
9771
9772         * icall.c: back out GetFields () fix until the serialization code is
9773         fixed to not depend on the incorrect behaviour.
9774
9775 Wed Nov 29 22:01:46 CET 2006 Paolo Molaro <lupus@ximian.com>
9776
9777         * profiler.c: provide defaults if none are set.
9778
9779 Tue Nov 28 12:54:51 CET 2006 Paolo Molaro <lupus@ximian.com>
9780
9781         * Makefile.am, attrdefs.h: new public header file with
9782         constants for attributes for use by embedders.
9783
9784 Tue Nov 28 11:44:52 CET 2006 Paolo Molaro <lupus@ximian.com>
9785
9786         * icall.c: GetFields () fix for bug #80064.
9787
9788 Tue Nov 28 10:56:01 CET 2006 Paolo Molaro <lupus@ximian.com>
9789
9790         * filewatcher.c, filewatcher.h, icall-def.h, icall.c, locales.c:
9791         removed long unused icalls.
9792
9793 2006-11-27  Jonathan Chambers  <joncham@gmail.com>
9794   
9795         * marshal.c: 
9796                 (mono_marshal_emit_managed_wrapper): Level of indirection for 
9797                 mono_marshal_get_managed_wrapper so that a wrapper for a managed method
9798                 can be generated without a delegate class.
9799                 (mono_marshal_get_managed_wrapper): Move wrapper logic to mono_marshal_emit_managed_wrapper.
9800         
9801         Signed-off-by: Jonathan Chambers <joncham@gmail.com>
9802
9803 2006-11-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9804
9805         * console-io.c: add the 'signal' call removed by mistake. Fixes bug
9806         #80069.
9807
9808 Mon Nov 27 19:29:13 CET 2006 Paolo Molaro <lupus@ximian.com>
9809
9810         * boehm-gc.c, null-gc.c, sgen-gc.c, mono-gc.h, icall.c,
9811         icall-def.h: added icalls needed by System.GC.
9812
9813 Thu Nov 23 20:01:12 CET 2006 Paolo Molaro <lupus@ximian.com>
9814
9815         * loader.c: ensure the class in catch clauses is handled
9816         correctly for generics methods (fixes bug#79980).
9817
9818 Thu Nov 23 17:31:58 CET 2006 Paolo Molaro <lupus@ximian.com>
9819
9820         * monitor.h, monitor.c: added mono_locks_dump () function
9821         to help debug deadlocks involving managed locks.
9822
9823 2006-11-13  Dick Porter  <dick@ximian.com>
9824
9825         * file-io.c (get_file_attributes): If the file is a symlink try
9826         and get the stat data for the target, but also add the
9827         FILE_ATTRIBUTE_REPARSE_POINT flag.  This is an attempt to follow
9828         the specs for the windows symlink support, but will probably have
9829         to be reworked when I have test data from a vista machine.  Fixes
9830         bug 79887.
9831
9832 2006-11-13  Dick Porter  <dick@ximian.com>
9833
9834         * gc.c (mono_domain_finalize): 
9835         * marshal.c (mono_delegate_begin_invoke): 
9836         * threadpool.c (socket_io_init, mono_thread_pool_init)
9837         (mono_thread_pool_finish): 
9838         * monitor.c (mono_monitor_try_enter_internal): 
9839         * threads.c (mono_thread_resume, mono_thread_init)
9840         (mono_thread_suspend_all_other_threads)
9841         (mono_thread_execute_interruption): 
9842         * appdomain.c (mono_domain_unload): Check for NULL error returns
9843         from CreateThread(), CreateEvent() and CreateSemaphore().  See bug
9844         75733.
9845
9846 2006-11-11  Miguel de Icaza  <miguel@novell.com>
9847
9848         * process.c
9849         (ves_icall_System_Diagnostics_Process_CreateProcess_internal):
9850         Only close the handle if the value of the handle is not
9851         INVALID_HANDLE_VALUE.  This just makes the process a bit more
9852         robust.
9853
9854         Improvement for #75733, so that we do not run into this problem. 
9855
9856         
9857         * assembly.c (check_path_env, check_extra_gac_path_env): Do not
9858         include empty directories from MONO_PATH or MONO_GAC_PREFIX in our
9859         internal variables.  Fixes #79462 
9860         
9861
9862 2006-11-09  Dick Porter  <dick@ximian.com>
9863
9864         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal):
9865         Use poll() not select().  Fixes bug 79397.
9866
9867 2006-11-09  Raja R Harinath  <rharinath@novell.com>
9868
9869         Fix #79872
9870         * assembly.c (mono_assembly_load_from_full): Check that the given
9871         image has an assembly manifest.
9872
9873 2006-11-09  Ankit Jain  <jankit@novell.com>
9874
9875         * tabledefs.h (ASSEMBLYREF_RETARGETABLE_FLAG):
9876         (ASSEMBLYREF_ENABLEJITCOMPILE_TRACKING_FLAG):
9877         (ASSEMBLYREF_DISABLEJITCOMPILE_OPTIMIZER_FLAG): Add AssemblyRef flags.
9878
9879 2006-11-07  Dick Porter  <dick@ximian.com>
9880
9881         * socket-io.c (ves_icall_System_Net_Dns_GetHostByAddr_internal):
9882         Put the old resolver behaviour back for pre-2.0 profiles.
9883
9884 Tue Nov 7 16:56:24 CET 2006 Paolo Molaro <lupus@ximian.com>
9885
9886         * threadpool.c: precise GC and locking fixes.
9887
9888 Tue Nov 7 11:02:42 CET 2006 Paolo Molaro <lupus@ximian.com>
9889
9890         * class.c: don't load types that have an explicit unaligned
9891         managed reference. Provide better info in the TypeLoad exception.
9892         Part of the fix for bug #79744.
9893         * object.c: use the correct check for class type load issues.
9894
9895 Mon Nov 6 17:07:43 CET 2006 Paolo Molaro <lupus@ximian.com>
9896
9897         * class.c: enforce alignment of fields with managed references
9898         even when Pack=1 is forced by the user (bug #77788).
9899
9900 2006-11-03  Dick Porter  <dick@ximian.com>
9901
9902         * socket-io.c (ves_icall_System_Net_Dns_GetHostByAddr_internal):
9903         If the address reverse lookup fails, return it as the hostname
9904         anyway.  Fixes bug 79721.
9905
9906 2006-11-03  Dick Porter  <dick@ximian.com>
9907
9908         * threads.c (ves_icall_System_Threading_Thread_SpinWait_internal):
9909         Fix build on Windows.
9910
9911 2006-11-02  Dick Porter  <dick@ximian.com>
9912
9913         * icall-def.h: 
9914         * object-internals.h: 
9915         * exception.c (mono_get_exception_thread_interrupted): 
9916         * threads.c: Implement Thread.Interrupt and Thread.SpinWait.
9917         Fixes bug 74525.
9918
9919         * monitor.c (ves_icall_System_Threading_Monitor_Monitor_wait):
9920         Check for pending Thread.Interrupt.
9921
9922 2006-10-27  Massimiliano Mantione  <massi@ximian.com>
9923         * loader.c: Fixed bug 79684.
9924
9925 2006-10-27  Dick Porter  <dick@ximian.com>
9926
9927         * file-io.c (get_file_attributes): Force symlinks to directories
9928         to be returned as a regular file.  Fixes bug 79733.
9929 2006-10-26  Dick Porter  <dick@ximian.com>
9930
9931         * file-io.c (ves_icall_System_IO_MonoIO_Open): If we're calling
9932         CreateFile to open a directory then we need to set the
9933         FILE_FLAG_BACKUP_SEMANTICS flag.  Fixes bug 75285.
9934
9935 2006-10-23  Zoltan Varga  <vargaz@gmail.com>
9936
9937         * reflection.c (mono_method_get_object): Cache the MonoMethod class and its
9938         friends.
9939
9940 Mon Oct 23 03:06:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
9941
9942         * sgengc.c: small cleanup of timer code.
9943
9944 Mon Oct 23 02:49:08 CEST 2006 Paolo Molaro <lupus@ximian.com>
9945
9946         * sgen-gc.c: fix some warnings and start adding support for
9947         complete object removal on domain unload.
9948
9949 2006-10-22  Gert Driesen  <drieseng@users.sourceforge.net>
9950
9951         * assembly.c: build_assembly_name should not consider a version
9952         number without build or revision number invalid. Fixes bug #79715.
9953
9954 2006-10-18  Jonathan Chambers  <joncham@gmail.com>
9955
9956         * icall.c: Have ves_icall_System_Diagnostics_DefaultTraceListener_WriteWindowsDebugString
9957         call kernel32 function OutputDebugString directly.
9958         
9959         Signed-off-by: Jonathan Chambers <joncham@gmail.com>
9960         
9961 Tue Oct 17 16:59:59 CEST 2006 Paolo Molaro <lupus@ximian.com>
9962
9963         * reflection.c: small cleanup, using a function to insert a MonoString
9964         in the string heap.
9965
9966 Tue Oct 17 16:45:27 CEST 2006 Paolo Molaro <lupus@ximian.com>
9967
9968         * reflection.c: moving GC fixes.
9969
9970 Mon Oct 16 16:53:12 CEST 2006 Paolo Molaro <lupus@ximian.com>
9971
9972         * sgen-gc.c, gc-internal.h, gc.c: added API to collect and remove
9973         all the objects with finalizers belonging to an unloading appdomain.
9974
9975 Mon Oct 16 15:08:41 CEST 2006 Paolo Molaro <lupus@ximian.com>
9976
9977         * sgen-gc.c: added ability to allocate even when the nursery is fully
9978         pinned and fixed a couple of bugs.
9979
9980 2006-10-15  Zoltan Varga  <vargaz@gmail.com>
9981
9982         * threads.h: Revert the last change for now.
9983
9984         * threads.h (mono_thread_get_pending_exception): Rename this to
9985         mono_thread_get_undeniable_exception ().
9986
9987 2006-10-15  Gert Driesen  <drieseng@users.sourceforge.net>
9988
9989         * appdomain.c: Use mono_get_exception_bad_image_format2 to construct
9990         BadImageFormatException in ves_icall_System_Reflection_Assembly_LoadFrom
9991         when fname does not refer to valid assembly. This result in a more
9992         meaningful error message.
9993         * exception.c: added mono_get_exception_bad_image_format2 which 
9994         constructs a BadImageFormatException using the ctor taking a custom
9995         message and the file name. Passing in a NULL msg results in a default
9996         message.
9997         * exception.h: define mono_get_exception_bad_image_format2 function.
9998         * icall.c: in InternalGetAssemblyName, throw BadImageFormatException 
9999         when file name pointed to an invalid IL image. Use 
10000         mono_get_exception_file_not_found2 to construct FileNotFoundException,
10001         as this results in a more meaningful error message.
10002
10003 2006-10-15  Zoltan Varga  <vargaz@gmail.com>
10004
10005         * reflection.c (encode_named_val): Implement proper encoding of arrays. Fixes
10006         #79465.
10007
10008 2006-10-12  Zoltan Varga  <vargaz@gmail.com>
10009
10010         * metadata.c (mono_type_size): Change the align parameter to guint32 for
10011         consistency with the other _size functions.
10012         (mono_type_stack_size): Ditto.
10013
10014         * class.c object.c icall.c: Fix warnings caused by the above change.
10015
10016         * class.c (mono_class_get_method_from_name_flags): Fix a typo.
10017
10018         * image.c (load_metadata_ptrs): Reenable loading of modules with uncompressed metadata.
10019
10020         * metadata.c class.c loader.c: Add proper support for uncompressed metadata.
10021
10022 Wed Oct 11 17:27:05 CEST 2006 Paolo Molaro <lupus@ximian.com>
10023
10024         * console-io.h, filewatcher.h, locales.h, marshal.h, monitor.h,
10025         process.h, rand.h, rawbuffer.h, security-manager.h, security.h,
10026         socket-io.h, string-icalls.h, sysmath.h, threadpool-internals.h,
10027         threadpool.h, threads-types.h: mark more internal functions.
10028
10029 2006-10-11  Dick Porter  <dick@ximian.com>
10030
10031         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal):
10032         Fix typo spotted by Robert Jordan in bug 79352 (though I can't
10033         reproduce the bug even before applying the fix.)
10034
10035 Tue Oct 10 15:39:39 CEST 2006 Paolo Molaro <lupus@ximian.com>
10036
10037         * reflection.c: allow retrieving attributes for arguments in generic
10038         methods (bug #79241).
10039
10040 Tue Oct 10 11:45:50 CEST 2006 Paolo Molaro <lupus@ximian.com>
10041
10042         * debug-mono-symfile.c: properly check fopen () result (found by
10043         coverity).
10044
10045 Tue Oct 10 11:30:52 CEST 2006 Paolo Molaro <lupus@ximian.com>
10046
10047         * reflection.c: make error message clearer and fixed two
10048         issuelets found by Coverity.
10049
10050 2006-10-10  Zoltan Varga  <vargaz@gmail.com>
10051
10052         * object-internals.h: Remove duplicate definition of mono_method_get_signature_full ().
10053
10054 Mon Oct 9 19:41:44 CEST 2006 Paolo Molaro <lupus@ximian.com>
10055
10056         * object-internals.h, gc-internal.h, profiler-private.h:
10057         mark internal functions.
10058
10059 Mon Oct 9 19:28:56 CEST 2006 Paolo Molaro <lupus@ximian.com>
10060
10061         * reflection.c: put data in the text section.
10062         * icall.c: recognize more types in type_from_typename ().
10063         * process.c, marshal.c: added some GC FIXMEs.
10064
10065 Mon Oct 9 19:27:26 CEST 2006 Paolo Molaro <lupus@ximian.com>
10066
10067         * loader.c: check for NULL before initializing.
10068
10069 2006-10-09  Zoltan Varga  <vargaz@gmail.com>
10070
10071         * gc.c (finalizer_thread): Use a non-alertable wait here.
10072
10073         * class.c loader.c metadata.c: Revert the mono_metadata_decode_table_... changes,
10074         until the correct solution is found.
10075
10076 2006-10-06  Zoltan Varga  <vargaz@gmail.com>
10077
10078         * reflection.c (mono_module_get_object): Avoid an assert when operating on
10079         modules with no metadata. Fixes #79596.
10080
10081         * image.c (load_metadata_ptrs): Put back the error message when
10082         the #- heap is encountered since the support is not complete yet.
10083
10084 Fri Oct 6 16:57:26 CEST 2006 Paolo Molaro <lupus@ximian.com>
10085
10086         * gc.c: do not allow the user to SuppressFinalize () a
10087         delegate because it would leak the trampoline if present.
10088
10089 2006-10-06  Zoltan Varga  <vargaz@gmail.com>
10090
10091         * class.c metadata.c row-indexes.h blob.h: Applied patch from Jb. Add support for the
10092         PropertyPtr table.
10093
10094 2006-10-05  Zoltan Varga  <vargaz@gmail.com>
10095
10096         * loader.c (mono_method_signature): Fix a use of MONO_TABLE_METHOD missed earlier.
10097
10098         * metadata.c (mono_metadata_get_param_attrs): Ditto.
10099
10100         * row-indexes.h: Add definitions for *Ptr tables.
10101
10102         * metadata-internals.h (MonoImage): Add an 'uncompressed_metadata' flag.
10103
10104         * metadata.c (mono_metadata_translate_token_index): New helper function to
10105         translate table indexes used in uncompressed metadata.
10106         (mono_metadata_decode_table_row): Ditto.
10107         (mono_metadata_decode_table_row_col): Ditto.
10108
10109         * metadata.c: Add table schema for *Ptr tables.
10110
10111         * class.c loader.c: Use the new helper function to access the affected metadata
10112         tables.
10113         
10114         * image.c (load_metadata_ptrs): Allow assemblies with uncompressed metadata. Fixes
10115         #38532.
10116         
10117 2006-10-04  Zoltan Varga  <vargaz@gmail.com>
10118
10119         * marshal.c (emit_object_to_ptr_conv): Avoid using short branches around IL
10120         sequences which can be unbounded in size. Fixes #79583.
10121
10122 2006-10-02  Zoltan Varga  <vargaz@gmail.com>
10123
10124         * object.c (mono_runtime_class_init): Handle a corner case in handling failure of
10125         static initialization.
10126
10127         * domain-internals.h (MonoDomain): Add a 'type_init_exception_hash' field.
10128
10129         * class-internals.h (MonoVTable): Add an 'init_failed' flag.
10130
10131         * domain.c (mono_domain_free): Free up type_init_exception_hash.
10132
10133         * object.c (mono_runtime_class_init): Implement correct semantics when a static
10134         ctor fails, i.e. throw the same exception on subsequent accesses.
10135         
10136 2006-09-0  Jonathan Chambers  <joncham@gmail.com>
10137
10138         * domain.c, class-internals.h: Added ComInteropProxy class to MonoDefaults.
10139         * marshal.c: Return correct unmanaged size for object when MarshalAs.Struct.
10140         Emit exception rather than crash in case of COM Callable Wrapper (not yet implemented).
10141         Handle marshalling of interfaces and VARIANTs contained in structs.
10142         
10143         Code is contributed under MIT/X11 license.
10144         
10145 2006-09-30  Zoltan Varga  <vargaz@gmail.com>
10146
10147         * marshal.c (emit_marshal_custom): Fix some corner cases. Fixes #79471.
10148         
10149         * marshal.c (mono_marshal_load_type_info): Allocate memory from the image
10150         mempool.
10151
10152 2006-09-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10153
10154         * console-io.c: ignore previous SIGINT handler.
10155
10156 2006-09-27  Zoltan Varga  <vargaz@gmail.com>
10157
10158         * metadata.c class.c: Applied patch from Ricardo Fernandez Pascual 
10159         (ricardo.fernandez@st.com). Add some new MonoClass and MonoType accessors. Fixes
10160         #79460, #79461, #79485.
10161
10162         * class.c (mono_class_from_name_case): Fix incorrect comments. Fixes #79504.
10163
10164         * marshal.c (mono_marshal_load_type_info): Fix a typo which caused an assert. Fixes
10165         #79217.
10166
10167 2006-09-26  Zoltan Varga  <vargaz@gmail.com>
10168
10169         * marshal.c (mono_marshal_get_delegate_invoke): Tweak the IL a little so better code
10170         could be generated from it.
10171
10172 Mon Sep 25 13:29:53 CEST 2006 Paolo Molaro <lupus@ximian.com>
10173
10174         * rand.c: fix read loop to correctly handle EINTR.
10175
10176 Mon Sep 25 11:33:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
10177
10178         * Makefile.am, icall-def.h, icall.c, verify.c: changed the way
10179         internal calls are defined to keep methods closer to the declaring
10180         type and allow a significant reduction in runtime relocations and
10181         memory usage.
10182
10183 2006-09-21 Gert Driesen  <drieseng@users.sourceforge.net>
10184
10185         * appdomain.c: Pass NULL to mono_get_exception_file_not_found2 as
10186         exception message to have FileNotFoundException use the default
10187         assembly load error message. Fixes bug #79426.
10188         * exception.c: Support NULL msg in mono_get_exception_file_not_found2.
10189
10190 2006-09-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10191
10192         * threadpool.c: (start_thread_or_queue) use the root domain when
10193         creating the thread instead of the async object one.
10194
10195 Thu Sep 21 19:30:04 CEST 2006 Paolo Molaro <lupus@ximian.com>
10196
10197         * class.c, object.c, class-internals.h, reflection.c:
10198         for arrays, store element_size inside MonoClass (speedup
10199         for array object creation).
10200
10201 Thu Sep 21 17:06:43 CEST 2006 Paolo Molaro <lupus@ximian.com>
10202
10203         * icall.c: fixed CodeBase to use the file name and not the module
10204         name (bug #79365).
10205
10206 Thu Sep 21 12:09:34 CEST 2006 Paolo Molaro <lupus@ximian.com>
10207
10208         * mono-debug.c, mono-debug.h: export find_method as
10209         mono_debug_find_method ().
10210
10211 Wed Sep 20 19:59:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
10212
10213         * debug-helpers.c, class-internals.h: added a few functions useful
10214         when debugging under gdb.
10215
10216 2006-09-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10217
10218         * console-io.[ch]: trigger the ConsoleCancelEvent and retrieve
10219         characters that need special handling.
10220
10221 Tue Sep 19 18:57:38 CEST 2006 Paolo Molaro <lupus@ximian.com>
10222
10223         * mono-config.c: make the os/cpu specification more flexible,
10224         allowing lists and negation.
10225
10226 2006-09-18  Jonathan Chambers  <joncham@gmail.com>
10227
10228         * marshal.c: COM Interop fixes. Handle case where method->klass.
10229         is interface. Handle BSTR/MonoString when null. Use CDECL as 
10230         calling convention on non-windows platforms. This is for
10231         compatibility with XPCOM and MainWin COM.
10232         
10233         Code is contributed under MIT/X11 license.
10234         
10235
10236 2006-09-18  Zoltan Varga  <vargaz@gmail.com>
10237
10238         * marshal.c (mono_marshal_load_type_info): Handle concurrent and recursive calls
10239         correctly. Fixes #79217.
10240
10241         * class-internals.h (MonoClass): Remove unused marshal_info_init_pending field.
10242
10243 Mon Sep 18 16:59:54 CEST 2006 Paolo Molaro <lupus@ximian.com>
10244
10245         * mono-config.c: allow both an os and cpu attribute for dllmap
10246         and dllentry elemnets to enable a single config file to be used
10247         for multiple architectures.
10248
10249 2006-09-18  Gert Driesen  <drieseng@users.sourceforge.net>
10250
10251         * loader.c: MonoLoaderError was cleared too soon on load failure.
10252         Fixes bug #79424.
10253
10254 Mon Sep 18 15:37:13 CEST 2006 Paolo Molaro <lupus@ximian.com>
10255
10256         * icall.c: use the defining class vtable when accessing a
10257         static field, not a pobblibly derived class.
10258
10259 2006-09-17  Zoltan Varga  <vargaz@gmail.com>
10260
10261         * icall.c string-icalls.c: Remove references to unicode.h.
10262
10263         * unicode.h unicode.c Makefile.am: Remove these unused source files.
10264
10265         * NOTES: Moved to ../../docs and renamed to thread-safety.txt.
10266
10267         * marshal.c (mono_marshal_emit_native_wrapper): Add an 'image' argument, 
10268         indicating the image where custom marshaller types should be looked up.
10269         (mono_ftnptr_to_delegate): Use the image of the delegate type to look up
10270         custom marshallers, instead of corlib. Fixes #79425.
10271
10272 2006-09-14  Zoltan Varga  <vargaz@gmail.com>
10273
10274         * marshal.c (emit_marshal_object): Fix marshalling of blittable classes and null.
10275
10276 2006-09-14  Jonathan Chambers  <joncham@gmail.com>
10277
10278         * environment.c (ves_icall_System_Environment_get_ProcessorCount): 
10279         Implement Environment.ProcessorCount.
10280         
10281         * environment.h (ves_icall_System_Environment_get_ProcessorCount): 
10282         Implement Environment.ProcessorCount.
10283         
10284         * icall.c: 
10285         Add Environment.ProcessorCount icall.
10286         
10287         Patch by Jason McFall.
10288
10289 2006-09-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10290
10291         * assembly.c: don't append .exe/.dll when the filename already contains
10292         one of those extensions.
10293
10294 2006-09-12  Martin Baulig  <martin@ximian.com>
10295
10296         * class.c (mono_bounded_array_class_get): Also add `IList<object>'
10297         to array interfaces.
10298
10299 2006-09-11  Martin Baulig  <martin@ximian.com>
10300
10301         * reflection.c (mono_image_build_metadata): Create the
10302         MethodImpl's after emitting all types and methods, so we don't
10303         need another fixup pass for them.
10304
10305 2006-09-11  Zoltan Varga  <vargaz@gmail.com>
10306
10307         * class.c (mono_class_from_name_case): Fix regression introduced by the last
10308         change.
10309
10310 Mon Sep 11 12:57:15 CEST 2006 Paolo Molaro <lupus@ximian.com>
10311
10312         * gc-internal.h, appdomain.c, gc.c: force-destroy GC handles on domain
10313         unload.
10314
10315 2006-09-10  Zoltan Varga  <vargaz@gmail.com>
10316
10317         * object.c (mono_method_return_message_restore): Avoid a crash if one of the out
10318         args is not set. Fixes #78926.
10319
10320 2006-09-08  Zoltan Varga  <vargaz@gmail.com>
10321
10322         * class.c (mono_class_init): Init class->no_special_static_fields from the cached info.
10323
10324         * image.c (load_class_names): Move this to class.c, and rename it to 
10325         'mono_image_init_name_cache'.
10326         (load_modules): Fix a warning.
10327
10328         * class.c icall.c image.c: Initialize image->name_cache lazily.
10329
10330         * class-internals.h (MonoGetClassFromName): New hook function to find a class based
10331         on its name using information in the AOT file.
10332
10333         * class.c (mono_class_from_name): Use the new hook function.
10334
10335 2006-09-06  Zoltan Varga  <vargaz@gmail.com>
10336
10337         * reflection.c (mono_param_get_objects): Handle enum default parameter values
10338         correctly.
10339
10340         * marshal.c (emit_marshal_object): Implement [In, Out] byval marshalling of classes.
10341         Fixes #79289.
10342         
10343 2006-09-06  Martin Baulig  <martin@ximian.com>
10344
10345         * icall.c (mono_lookup_internal_call): Small fix.
10346
10347 2006-09-05  Raja R Harinath  <rharinath@novell.com>
10348
10349         * debug-mono-symfile.c (mono_debug_open_mono_symbols): Remove
10350         double g_free.
10351
10352 2006-09-04  Sebastien Pouliot  <sebastien@ximian.com>
10353
10354         * debug-mono-symfile.c: Fix *some* memory leaks that happens only 
10355         when --debug is specified.
10356
10357 2006-09-04  Zoltan Varga  <vargaz@gmail.com>
10358
10359         * class.c (setup_generic_array_ifaces): Fix a warning.
10360
10361 2006-09-04  Miguel de Icaza  <miguel@novell.com>
10362
10363         * Temporarily remove the patch to assemly.c that checks the
10364         assembly versions as it breaks our gacutil.
10365
10366 2006-09-03  Zoltan Varga  <vargaz@gmail.com>
10367
10368         * metadata.c (mono_metadata_parse_mh_full): Fix an invalid free.
10369
10370         * assembly.c (mono_assembly_load_from_full): Avoid loading net 2.0 assemblies into
10371         a net 1.0 runtime.
10372
10373         * marshal.c (mono_string_builder_to_utf8): Fix marshalling of StringBuilders
10374         created using the default ctor. Fixes #79152.
10375         (mono_string_builder_to_utf16): Ditto.
10376
10377 2006-09-01  Martin Baulig  <martin@ximian.com>
10378
10379         Fix handling of the generic array interfaces.
10380
10381         * class-internals.h
10382         (MonoDefaults): Removed `generic_array_class' and added
10383         `generic_ilist' class.
10384
10385         * class.c
10386         (mono_bounded_array_class_get): Add the new generic array interfaces.
10387         (setup_generic_array_ifaces): New static method; create vtable
10388         entries for each method in the generic array interfaces.
10389
10390         * metadata.c
10391         (select_container): Allow "parent-less" generic methods.
10392
10393         * marshal.c
10394         (mono_marshal_get_generic_array_helper): New public method.
10395
10396         * icall.c
10397         (ves_icall_System_Array_InternalArray_GetGenericValueImpl):
10398         Renamed into ves_icall_System_Array_GetGenericValueImpl() and
10399         moved the interncall into System.Array.
10400
10401 2006-09-01  Raja R Harinath  <rharinath@novell.com>
10402
10403         A few more cases of avoiding work on types with ->byref set.
10404         Has the real fix for #79238
10405         * icall.c (is_generic_parameter): New helper.
10406         (ves_icall_Type_GetGenericParameterPosition): Use it.
10407         (ves_icall_Type_GetGenericParameterAttributes): Likewise.
10408         (ves_icall_MonoType_get_IsGenericParameter): Likewise.
10409         (ves_icall_TypeBuilder_get_IsGenericParameter): Likewise.
10410         (ves_icall_Type_GetGenericTypeDefinition_impl): Return NULL on
10411         reference types.
10412         (ves_icall_Type_get_IsGenericTypeDefinition): Return FALSE on
10413         reference types.
10414         (ves_icall_Type_get_IsGenericInstance): Likewise.
10415         (ves_icall_Type_get_IsGenericType): Likewise.
10416
10417 2006-09-01  Zoltan Varga  <vargaz@gmail.com>
10418
10419         * class.c (mono_class_setup_vtable_general): Share identical vtables with the parent
10420         class if possible.
10421
10422         * mempool.h (mono_mempool_get_allocated): New helper function.
10423
10424         * object.c (mono_class_create_runtime_vtable): Fix problem introduced by last
10425         change.
10426
10427         * mempool.c: Fix warnings and the calculation of stats.
10428
10429         * object.c (mono_class_create_runtime_vtable): Fix the AOT optimization.
10430
10431         * class.c (mono_class_setup_vtable): Update generic_vtable_count stat.
10432
10433         * loader.c (mono_get_method_from_token): Update method_count stat.
10434
10435         * class-internals.h (MonoStats): Add some stats.
10436
10437 2006-08-31 Robert Jordan  <robertj@gmx.net>
10438
10439         * icall.c: Replace the PtrToStringAuto, StringToHGlobalAuto icalls
10440         with managed variants.
10441         All code is contributed under the MIT/X11 license.
10442         
10443 2006-08-31  Zoltan Varga  <vargaz@gmail.com>
10444
10445         * reflection.c (reflection_methodbuilder_to_mono_method): Set 
10446         method->skip_visibility based up the skipVisibility parameter of DynamicMethods.
10447
10448         * class-internals.h (MonoMethod): Add a 'skip_visibility' field.
10449
10450         * marshal.c (mono_marshal_load_type_info): Revert the last change as it can't cope
10451         with cycles in classes.
10452
10453         * icall.c (ves_icall_MonoType_get_Name): Add a '&' for byref types. Fixes #79110.
10454
10455         * marshal.c (emit_marshal_array): Avoid crash when a parameter with type array is 
10456         missing a [MarshalAs] directive. Fixes #79203.
10457
10458         * marshal.c (mono_marshal_load_type_info): Fix a race in initializing 
10459         klass->marshal_info. Fixes #79217.
10460
10461 2006-08-30  Martin Baulig  <martin@ximian.com>
10462
10463         Committing a patch from Joachim Ante <joe@otee.dk>:
10464         Add support for binary data symbol stores.
10465
10466         * debug-mono-symfile.c
10467         (mono_debug_open_mono_symbol_file): Renamed into
10468         mono_debug_open_mono_symbols() and added `raw_contents' and `size'
10469         arguments.
10470
10471         * mono-debug.c
10472         (mono_debug_open_image): Added `raw_contents' and `size' args.
10473         (mono_debug_init_2_memory): New public function.
10474
10475 Fri Aug 25 18:25:23 CEST 2006 Paolo Molaro <lupus@ximian.com>
10476
10477         * icall.c: handle TypedReference in GetTypeCode (bug #79150).
10478
10479 2006-08-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10480
10481         * appdomain.c: implement support for ShadowCopyFiles.
10482
10483 2006-08-22  Sebastien Pouliot  <sebastien@ximian.com>
10484
10485         * string-icalls.c: Add shortcut in ves_icall_System_String_ctor_charp
10486         when value is NULL (and should remove CID #51).
10487
10488 2006-08-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10489
10490         * image.c: moved 2 functions to ../utils.
10491
10492 Tue Aug 22 15:53:29 CEST 2006 Paolo Molaro <lupus@ximian.com>
10493
10494         * gc.c: cope with the target object of a GC handle being NULL
10495         (bug #78877).
10496
10497 Tue Aug 22 11:10:33 CEST 2006 Paolo Molaro <lupus@ximian.com>
10498
10499         * class.c: recursively check parent's explicit implementations
10500         of interface methods (fixes bug #79125).
10501
10502 2006-08-19  Miguel de Icaza  <miguel@novell.com>
10503
10504         * filewatcher.c: Avoid warnings when building, do not redefine
10505         constants that are defined.
10506
10507         Remove warnings.
10508
10509 2006-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10510
10511         * image.c: don't fail when the link points to an absolute path.
10512
10513 2006-08-18  Sebastien Pouliot  <sebastien@ximian.com>
10514
10515         * decimal.c: Remove dead code (unrequired check) in mono_decimalIncr.
10516         Fix CID #3.
10517
10518 2006-08-17  Miguel de Icaza  <miguel@novell.com>
10519
10520         * image.c (full_path): A new method used to obtain the actual path
10521         of an assembly even in the presence of symbolic links.  
10522
10523         This is necessary for the case where we are running a binary that
10524         has been GACed, but we are using the "published" path name
10525         ($prefix/mono/1.0/blah.exe) which happens to point to the real
10526         file in the GAC.
10527
10528         This was the source of the failure for the `xsp' command with the
10529         recent AppDomain changes, as far as the runtime was concerned,
10530         there were two different assemblies: $prefix/mono/1.0/blah.exe and
10531         $prefix/mono/gac/blah/version/blah.exe.
10532
10533         (do_mono_image_open): use full path
10534
10535 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
10536
10537         * object.c (mono_class_create_runtime_vtable): Add a FIXME.
10538
10539 2006-08-17  Sebastien Pouliot  <sebastien@ximian.com>
10540
10541         * marshal.c: Fix mono_marshal_check_domain_image if an invalid 
10542         domain_id is supplied. Fix CID #241 and corlib's unit tests.
10543
10544 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
10545
10546         * class.c (mono_class_layout_fields): Set min_align to a bigger value for
10547         small structures. Fixes #78990.
10548
10549 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
10550
10551         * marshal.c (mono_marshal_get_xappdomain_invoke): Use the new helper functions here.
10552
10553         * appdomain.c (ves_icall_System_AppDomain_createDomain): Fix a warning.
10554
10555 2006-08-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10556
10557         * appdomain.c:
10558         * marshal.c: don't load all the assemblies from a domain into newly
10559         created ones. The new domains might have different rules and load
10560         assemblies from different locations. Fixes bug #76757.
10561
10562         Patch by Lluis. Conflicts resolved by Brian Crowell.
10563
10564 2006-08-16  Alp Toker  <alp@atoker.com>
10565
10566         * socket-io.c: First half of the fix for #79084.
10567         Set sa_size to the length of the content, not that of the struct.
10568         Don't add NULL suffix to the content, this should be done in
10569         managed code if needed.
10570
10571 2006-08-14  Raja R Harinath  <rharinath@novell.com>
10572
10573         Fix part of #79012
10574         * metadata.c (do_mono_metadata_parse_generic_class): Don't SEGV if
10575         mono_metadata_parse_type returns NULL.
10576
10577 2006-08-13  Atsushi Enomoto  <atsushi@ximian.com>
10578
10579         * normalization-tables.h : new file for string normalization data.
10580         * locales.c, locales.h, icall.c :
10581           added load_normalization_resource() for string normalization,
10582           and icall as well.
10583         * Makefile.am : added normalization-tables.h to the sources.
10584
10585 2006-08-13  Zoltan Varga  <vargaz@gmail.com>
10586
10587         * marshal.c: Add more helper functions to reduce code duplication and use them
10588         everywhere.
10589
10590 2006-08-12  Zoltan Varga  <vargaz@gmail.com>
10591
10592         * marshal.c: Fix non-x86 stdcall warnings.
10593         
10594         * marshal.c marshal.h: Add some helper functions to emit/patch branches, and use 
10595         them everywhere.
10596
10597 2006-08-11  Jonathan Chambers  <joncham@gmail.com>
10598
10599         * class.c (mono_bounded_array_class_get): Fix if statement that caused incorrect
10600         type check on multi-dimensional arrays. Fixes #79000.
10601
10602 2006-08-10  Jonathan Chambers  <joncham@gmail.com>
10603
10604         * class.c (mono_class_setup_parent): setup is_com_object during class initialization.
10605         * object.c (mono_remote_class_vtable/mono_object_new_specific): Changed checks
10606         to use is_com_object instead of MONO_CLASS_IS_IMPORT() macro.
10607         * class-internals.h: add is_com_object to class structure.
10608         * marshal.c: Fixed marshalling for IDispatch and IUnknown, added
10609         null checks to COM object marshalling. Fix .ctor call on RCW.
10610         * icall.c: Added icall implementation for MonoType.IsCOMObjectImpl.
10611         
10612         All code is contributed under the MIT/X11 license.
10613
10614 2006-08-09  Dick Porter  <dick@ximian.com>
10615
10616         * monitor.c (mono_monitor_cleanup): mono_monitor_cleanup() is
10617         racing mono_monitor_allocator_lock() somewhere, so don't delete
10618         the critical section for now.  Found by running and exiting
10619         monodevelop.
10620
10621 2006-08-10  Zoltan Varga  <vargaz@gmail.com>
10622
10623         * marshal.c (cominterop_get_native_wrapper): Fix a warning.
10624         (ves_icall_System_ComObject_FindInterface): Ditto.
10625         (ves_icall_System_ComObject_CacheInterface): Ditto.
10626
10627         * metadata.c (do_mono_metadata_type_equal): Applied patch from Roberto Costa
10628         (roberto.costa@st.com). Add support for MONO_TYPE_FNPTR.
10629
10630 2006-08-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10631
10632         * threadpool.c: treat pipes from process asynchronous reads as sockets
10633         when reading from them, so we get select/poll or epoll to wait for
10634         data.
10635
10636 2006-08-07  Sebastien Pouliot  <sebatien@ximian.com>
10637
10638         * loader.c: Fix a typo (CID #233) in the null check.
10639
10640 2006-08-07  Zoltan Varga  <vargaz@gmail.com>
10641
10642         * appdomain.c (mono_domain_unload): Close the thread handle of the unload thread.
10643         Hopefully fixes #78949.
10644         
10645         * metadata.c (mono_metadata_parse_method_signature_full): Applied patch from 
10646         Roberto Costa (roberto.costa@st.com). Handle vararg signatures without SENTINEL
10647         bytes. Fixes #78972.
10648
10649 2006-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10650
10651         * filewatcher.c: we need to set errno here.
10652
10653 2006-08-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10654
10655         * filewatcher.c: let Win32Exception get the error value.
10656
10657 2006-08-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10658
10659         * filewatcher.c: translate errno into win32 errors for Win32Exception
10660         to know what happened.
10661
10662 2006-08-01  Zoltan Varga  <vargaz@gmail.com>
10663
10664         * threadpool.c: Fix more warnings.
10665
10666         * assembly.c (search_loaded): Fix warnings.
10667
10668         * threadpool.c (mono_thread_pool_finish): Fix warnings.
10669         (mono_async_invoke): Ditto.
10670
10671 2006-07-28  Jonathan Chambers  <joncham@gmail.com>
10672
10673         * object.c (mono_remote_class_vtable): Need to create proxy vtable
10674         entries for __ComObject type in addition to ComImport types.
10675         * marshal.c: Added support for marshalling COM RCWs. Fixed warning
10676         about hash table.
10677         
10678         All code is contributed under the MIT/X11 license.
10679
10680 Fri Jul 28 19:04:34 CEST 2006 Paolo Molaro <lupus@ximian.com>
10681
10682         * image.c: avoid tentative loading of modulerefs that contain
10683         no metadata (P/Invoke library names).
10684
10685 2006-07-28  Dick Porter  <dick@ximian.com>
10686
10687         * loader.c (mono_loader_cleanup): mono_loader_cleanup() is racing
10688         mono_loader_lock() somewhere, so don't delete the critical section
10689         for now.  Found by running and exiting monodevelop.
10690
10691 2006-07-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10692
10693         * filewatcher.c: define the inotify syscalls when we're building on
10694         linux and have sys/syscall.h. The build system might not have support
10695         for inotify but the target system might have it.
10696
10697 2006-07-26  Miguel de Icaza  <miguel@novell.com>
10698
10699         * domain.c: Documentation updates.
10700
10701         * loader.c (mono_free_method): Do not release the method
10702         information if we are being profiled, as profilers will use this
10703         information at shut down to present some data to the user.
10704
10705         This is needed so that the profiler does not crash, as the
10706         profiler tends to keep MonoMethods around, and they might become
10707         invalid if we free these.
10708
10709         (mono_get_method_constrained): Return the original CIL stream
10710         method as well, so verification can be performed against it.
10711
10712 2006-07-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10713
10714         * filewatcher.[ch]: support for inotify file system watcher.
10715         * icall.c: add new internal calls for the inotify file system watcher.
10716
10717 2006-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10718
10719         * threadpool.c: Windows also misbehaves on async. connects. Fixes bug
10720         #78888.
10721
10722 2006-07-20  Dick Porter  <dick@ximian.com>
10723
10724         * file-io.c (ves_icall_System_IO_MonoIO_Seek): Fix signed/unsigned
10725         warning.
10726
10727 2006-07-20  Dick Porter  <dick@ximian.com>
10728
10729         * threads.c (start_wrapper): Do the thread cleanup while we still
10730         hold a reference to its object.  Fixes bug 78123.
10731
10732 2006-07-18  Kornél Pál  <kornelpal@gmail.com>
10733
10734         * class-internals.h: Added MONO_WRAPPER_MANAGED_TO_MANAGED wrapper type.
10735         * debug-helpers.c: Map MONO_WRAPPER_MANAGED_TO_MANAGED to
10736           "managed-to-managed".
10737         * icall.c: Redirect string constructors that take sbyte* to
10738           ves_icall_System_String_ctor_RedirectToCreateString.
10739         * marshal.c: Redirect ves_icall_System_String_ctor_RedirectToCreateString
10740           to CreateString () methods with matching signature.
10741         * reflection.c: Use original security informations for
10742           MONO_WRAPPER_MANAGED_TO_MANAGED.
10743         * security-manager.c: Use original security informations for
10744           MONO_WRAPPER_MANAGED_TO_MANAGED.
10745         * string-icalls.c: Added ves_icall_System_String_ctor_RedirectToCreateString
10746           that is a placeholder and only its address should be used.
10747         * string-icalls.h: Added ves_icall_System_String_ctor_RedirectToCreateString
10748           that is a placeholder and only its address should be used.
10749
10750 2006-07-15  Jonathan Chambers  <joncham@gmail.com>
10751
10752         Begin implementing COM Interop.
10753         * appdomain.c: Increment corlib version.
10754         * class.c: Set ComImport classes' parent to __ComObject.
10755         * loader.c: Mark cominterop methods as such.
10756         * domain.c: Add __ComObject class to MonoDefaults structure.
10757         * image.c: Add 2 hashtables to the image for COM Interop related methods
10758         * metadata.c: Added mono_metadata_type_dup_mp to duplicate a type
10759         using the mempool allocator
10760         
10761         * metadata-internals.h: Add 2 hashtables to the image for COM Interop related methods
10762         * metadata.h: Added cominterop field to _MonoMethodSignature struct and
10763         declaration for mono_metadata_type_dup_mp.
10764         
10765         * debug-helpers.c: Added strings for two additional wrapper types
10766         * object.c: Create proxy objects for ComImport classes
10767         * class-internals.h: Define 2 new method wrapper types, COM Interop remoting target,
10768         and added __ComObject class to MonoDefaults structure.
10769         
10770         * object-internals.h: Finish MonoRealProxy definition, and add definition of
10771         MonoComInteropProxy and MonoComObject.
10772         
10773         * marshal.c: Added support for COM Interop
10774         (signature_cominterop): Converts managed signature to corresponding
10775         unmanaged COM signature.
10776         (cominterop_get_function_pointer): gets unmanaged function pointer via
10777         COM object vtable
10778         (cominterop_get_com_slot_for_method): returns vtable slot in COM interface of method
10779         (cominterop_get_method_interface): returns interface type that method is defined on
10780         (mono_mb_emit_cominterop_call): emits native call to function pointer
10781         gotten from vtable
10782         (cominterop_get_native_wrapper_adjusted): actual wrapper around unmanaged COM call
10783         that matches signature of unmanaged function.
10784         (cominterop_get_native_wrapper): wrapper around adjusted method call.
10785         (cominterop_get_invoke): forwards call from proxy to __ComObject
10786         (ves_icall_System_Runtime_InteropServices_Marshal_AddRef): Implements Marshal.AddRef 
10787         (ves_icall_System_Runtime_InteropServices_Marshal_QueryInterface): Implements Marshal.QueryInterface 
10788         (ves_icall_System_Runtime_InteropServices_Marshal_Release): Implements Marshal.Release 
10789         
10790         * marshal.h: Added Marshal icall declarations.
10791         * icall.c: Added __ComObject icalls. Need to store interfaces in unmanaged code
10792         so we can access them in finalizer
10793         
10794 2006-07-14  Dick Porter  <dick@ximian.com>
10795
10796         * object.c (mono_type_initialization_cleanup): Fix a race
10797         condition by temporarily commenting out the critical section
10798         deletion.
10799
10800 2006-07-14  Zoltan Varga  <vargaz@gmail.com>
10801
10802         * reflection.c (create_custom_attr): Fix some warnings.
10803         (create_custom_attr_data): Ditto.
10804         (typebuilder_setup_properties): Save custom attrs for properties in dynamic
10805         types. Fixes #78855.
10806
10807 2006-07-11  Zoltan Varga  <vargaz@gmail.com>
10808
10809         * class.c (mono_type_get_name_recurse): Fix the name of 1 dimensional non-szarrays.
10810
10811         * reflection.c (mono_custom_attrs_free): Fix freeing of dynamic cattr info.
10812
10813 2006-07-08  Zoltan Varga  <vargaz@gmail.com>
10814
10815         * reflection.c (resolve_object): Add support for DynamicMethod.
10816
10817         * domain.c appdomain.c threads.c monitor.c object.c gc.c: Applied patch from
10818         Joachim Ante (joe@otee.dk). Fix some shutdown leaks.
10819
10820 2006-07-06  Sebastien Pouliot  <sebastien@ximian.com>
10821
10822         * process.c: In ves_icall_System_Diagnostics_Process_GetModules_internal 
10823         don't leak GPtrArray's pdata has we have no use (nor free) for it.
10824
10825 2006-07-01  Zoltan Varga  <vargaz@gmail.com>
10826
10827         * marshal.c (mono_marshal_get_runtime_invoke): Fix passing of generic valuetypes.
10828         Fixes #77888.
10829
10830 2006-06-30  Raja R Harinath  <rharinath@novell.com>
10831
10832         * icall.c (ves_icall_MonoMethod_get_base_definition): Simplify
10833         slightly: remove a shadow local variable.
10834
10835 2006-06-29  Raja R Harinath  <rharinath@novell.com>
10836
10837         * icall.c (ves_icall_MonoMethod_get_base_definition): Return the
10838         definition that introduces the virtual function slot.
10839         Also fix Coverity #105.
10840
10841 2006-06-29  Zoltan Varga  <vargaz@gmail.com>
10842
10843         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Fix support
10844         for dynamic assemblies. Fixes #78724.
10845
10846 2006-06-28  Zoltan Varga  <vargaz@gmail.com>
10847
10848         * marshal.c (mono_string_to_byvalwstr): Fix this completely broken function.
10849         Fixes #78722.
10850
10851 2006-06-21  Martin Baulig  <martin@ximian.com>
10852
10853         * reflection.c
10854         (method_encode_clauses): Don't assert on `ex_info->handlers' here;
10855         fixes #76484.
10856
10857 2006-06-21  Zoltan Varga  <vargaz@gmail.com>
10858
10859         * object.h (mono_array_setref): Cast value to (MonoObject*) to fix warnings.
10860
10861 2006-06-20  Raja R Harinath  <rharinath@novell.com>
10862
10863         Make 'mono_class_get_full' only inflate TYPESPECs, not TYPEDEFs
10864         nor TYPEREFs.
10865         * class.c (mono_class_create_from_typespec): Add 'context' argument.
10866         Inflate result if necessary.
10867         (mono_class_get_full): Remove old version.  Rename from
10868         'mono_class_get' and add 'context' argument.  Pass it to
10869         ..._create_from_typespec.
10870         (mono_class_get): New.  Simple wrapper to mono_class_get_full.
10871         (mono_ldtoken): Revert change below.
10872
10873 2006-06-20  Martin Baulig  <martin@ximian.com>
10874
10875         * class.c (mono_ldtoken): Don't pass the generic context to
10876         mono_class_get_full() for MONO_TOKEN_TYPE_DEF/REF.  Fixes #78053.
10877
10878 2006-06-15  Zoltan Varga  <vargaz@gmail.com>
10879
10880         * marshal.c (mono_ftnptr_to_delegate): Avoid allocating signature from mempool
10881         and later freeing it. Fixes #78638.
10882
10883 2006-06-15  Miguel de Icaza  <miguel@novell.com>
10884
10885         * icall.c (mono_class_get_throw): Revert over-zealous error
10886         throwing, the caller for mono_class_get_throw will cope with
10887         errors when classes are not properly initialized already.
10888
10889         The code still copes with loader exceptions though.
10890
10891         Fixes the regression in reftype1 and reftype3 from the CAS tests.
10892         
10893 2006-06-14  Miguel de Icaza  <miguel@novell.com>
10894
10895         Fixes the `make run1' version of RuntimeAbort (to be commited,
10896         source is in Bugzilla).
10897         
10898         * metadata.c (mono_metadata_interfaces_from_typedef_full): Return
10899         FALSE on class loading failure instead of returning true.
10900
10901         * class.c (mono_class_create_from_typedef): It is possible for
10902         mono_metadata_interfaces_from_typedef_full to fail if a class is
10903         not found, cope with this.
10904         
10905
10906 2006-06-14  Dick Porter  <dick@ximian.com>
10907
10908         * socket-io.c: 
10909         * process.c: Fix a bunch of signed/unsigned warnings from gcc
10910         4.1.1
10911
10912 2006-06-12  Atsushi Enomoto  <atsushi@ximian.com>
10913
10914         * culture-info-table.h : oops, forgot to make it nsync with r61548.
10915
10916 2006-06-09  Jonathan Chambers  <jonathan.chambers@ansys.com>
10917
10918         * icall.c: Another fix for building mono in Visual Studio.
10919
10920 2006-06-09  Jonathan Chambers  <jonathan.chambers@ansys.com>
10921
10922         * marshal.c icall.c: Minor fixes for building mono in Visual Studio.
10923         
10924 2006-06-09  Martin Baulig  <martin@ximian.com>
10925
10926         * debug-mono-symfile.c: Put this back and really fix it this
10927         time. Sorry for all the trouble.
10928
10929 2006-06-08  Zoltan Varga  <vargaz@gmail.com>
10930
10931         * icall.c (mono_class_get_throw): Fix a warning.
10932         (ves_icall_System_Reflection_Assembly_GetTypes): Allways throw 
10933         ReflectionTypeLoadException if needed. Fixes #78606.
10934
10935         * class.c (mono_class_setup_vtable_general): Handle loader errors a bit better.
10936         (mono_class_init): Ditto.
10937
10938         * loader.c (mono_loader_set_error_assembly_load): Display a separate warning for
10939         ref_only exceptions.
10940         (mono_loader_clear_error): Make this work even if there is no error.
10941
10942 2006-06-08  Jonathan Chambers  <jonathan.chambers@ansys.com>
10943
10944         * object-internals.h marshal.c marshal.h icall.c: Implement method 
10945         Marshal.GetComSlotForMethodInfo using internal call.
10946
10947 2006-06-07  Zoltan Varga  <vargaz@gmail.com>
10948
10949         * class-internals.h: Add a new kind of loader error LOADER_ERROR_ASSEMBLY plus
10950         a function for signalling it.
10951
10952         * class.c (mono_class_from_typeref): Use the new kind of loader error when
10953         a referenced assembly is not found.
10954
10955         * loader.c (mono_loader_error_prepare_exception): Add support for 
10956         LOADER_ERROR_ASSEMBLY. Fix formatting.
10957
10958 2006-06-05  Jonathan Chambers  <jonathan.chambers@ansys.com>
10959
10960         * domain.c appdomain.c class-internals.h marshal.c: Add support 
10961         for VARIANT marshalling on windows and increment corlib version
10962         since Variant struct was added.
10963
10964 2006-06-03  Miguel de Icaza  <miguel@novell.com>
10965
10966         * debug-mono-symfile.c: Revert Martin's previous patch which broke
10967         stack trace line information:
10968
10969         (Martin) (mono_debug_symfile_lookup_location): Fix the algorithm:
10970         (Martin) when looking up B which is between A and C, return A not C.
10971
10972         Bug is #78573.
10973
10974         Thanks to Alexander Olk for tracking this down.
10975
10976 2006-06-02  Zoltan Varga  <vargaz@gmail.com>
10977
10978         * marshal.c (mono_marshal_set_last_error_windows): Fix build.
10979         
10980         * marshal.c (mono_marshal_emit_native_wrapper): Call GetLastError () early and without a wrapper to
10981         avoid clobbering its value.
10982         (mono_string_to_lpstr): Fix a warning on windows.
10983
10984 2006-05-31  Zoltan Varga  <vargaz@gmail.com>
10985
10986         * class-internals.h (MonoClass): Removed obsolete 'dummy' flag.
10987
10988         * reflection.c loader.c: Removed references to 'dummy' flag.
10989
10990         * loader.c (mono_loader_error_prepare_exception): Fix a warning.
10991
10992         * threadpool.c: Make ASyncCall a copy of the managed MonoAsyncCall class so
10993         it gets GC tracking.
10994
10995         * object-internals.h (MonoAsyncResult): Add an 'object_data' field which has
10996         GC tracking.
10997         
10998         * object.c (mono_async_result_new): Add an additional parameter 'object_data'.
10999
11000         * marshal.c threadpool.c: Update callers of mono_async_result_new.
11001
11002         * appdomain.c: Bump corlib version.
11003
11004 2006-05-30  Zoltan Varga  <vargaz@gmail.com>
11005
11006         * marshal.c: Use mono_mb_emit_stloc in more places. Use CEE_LDIND_REF and
11007         CEE_STIND_REF when working with object references.
11008
11009 2006-05-31  Zoltan Varga  <vargaz@gmail.com>
11010
11011         * class.c (mono_class_setup_fields): Call mono_class_init () for class->parent.
11012         Fixes #78539.
11013
11014 2006-05-30  Miguel de Icaza  <miguel@novell.com>
11015
11016         * loader.c (method_from_memberref): Fix argument value for
11017         mono_loader_set_error_method_load (I was passing the MonoClass
11018         instead of the class name char *).
11019
11020 2006-05-30  Zoltan Varga  <vargaz@gmail.com>
11021
11022         * marshal.c: Use mono_mb_emit_stloc in more places. Use CEE_LDIND_REF and
11023         CEE_STIND_REF when working with object references.
11024
11025 2006-05-30  Martin Baulig  <martin@ximian.com>
11026
11027         * mono-debug.c (mono_debug_print_stack_frame): Reverted the
11028         mono_method_full_name() change and replace the ':' with a '.'
11029         here.
11030
11031 2006-05-30  Martin Baulig  <martin@ximian.com>
11032
11033         * debug-mono-symfile.c
11034         (mono_debug_symfile_lookup_location): Fix the algorithm:
11035         when looking up B which is between A and C, return A not C.
11036
11037 2006-05-29  Martin Baulig  <martin@ximian.com>
11038
11039         * mono-debug.h
11040         (MonoDebugMethodInfo): Make the typedef public.
11041         (MonoDebugSourceLocation): New public struct.
11042
11043         * mono-debug.c
11044         (mono_debug_source_location_from_address): Removed.
11045         (mono_debug_source_location_from_il_offset): Removed.
11046         (mono_debug_il_offset_from_address): Removed.
11047         (mono_debug_address_from_il_offset): Removed.
11048         (mono_debug_lookup_method): New public function.
11049         (mono_debug_lookup_source_location): New public function; replaces
11050         the old mono_debug_source_location_from_*() functions; see the
11051         inline documentation.
11052         (mono_debug_free_source_location): New public function.
11053         (mono_debug_print_stack_frame): New public function; see the
11054         inline documentation.
11055
11056         * debug-mono-symfile.c
11057         (mono_debug_find_source_location): Renamed into
11058         mono_debug_symfile_lookup_location(); only take a
11059         `MonoDebugMethodInfo *' and an `offset' argument; added inline
11060         documentation.
11061         (mono_debug_find_method): Renamed into
11062         mono_debug_symfile_lookup_method().
11063
11064 2006-05-27  Zoltan Varga  <vargaz@gmail.com>
11065
11066         * assembly.c (mono_assembly_open_full): Dont overwrite the status
11067         returned by mono_image_open_full ().
11068
11069         * appdomain.c (ves_icall_System_Reflection_Assembly_LoadFrom): Convert
11070         MONO_IMAGE_IMAGE_INVALID into a BadImageFormatException. Fixes
11071         #78517.
11072
11073         * object.c (compute_class_bitmap): Use class->class_size for static fields. Fixes
11074         #78518.
11075
11076 2006-05-27  Miguel de Icaza  <miguel@novell.com>
11077
11078         * class.c (mono_class_from_typeref): handle missing images
11079         earlier, deals with bug #78418.   Refactor code; 
11080
11081         Fix a warning introduced in my previous commit (some stale code
11082         from before I revisited my patch).
11083
11084         * class.c (mono_class_create_from_typedef): On failure, remove the
11085         class from the MonoImage->class_cache as the class is not
11086         initialized;   Fixes the leak pointed out by Paolo.
11087
11088 2006-05-25  Dick Porter  <dick@ximian.com>
11089
11090         * threads.c (mono_thread_cleanup): Build fix.  Comment out the
11091         DeleteCriticalSections until I figure out which one may still be
11092         sometimes locked when mono_thread_cleanup is called.
11093
11094 2006-05-24  Dick Porter  <dick@ximian.com>
11095
11096         * threads.c (mono_thread_cleanup): Move the threading cleanup out
11097         of mono_thread_manage and back into its own function, so it can be
11098         called after the finalizer thread has finished.
11099
11100         * appdomain.c (mono_runtime_cleanup): Call mono_thread_cleanup
11101
11102 2006-05-24  Zoltan Varga  <vargaz@gmail.com>
11103
11104         * assembly.c (mono_assembly_open_full): Fix typo introduced by a previous change.
11105         Fixes #78495.
11106
11107         * marshal.c (emit_ptr_to_object_conv): Implement marshalling of byval arrays
11108         with non-blittable elements.
11109         (emit_object_to_ptr_conv): Ditto. Fixes #78492.
11110
11111 2006-05-24  Martin Baulig  <martin@ximian.com>
11112
11113         * mono-debug-debugger.h (MonoDebuggerEvent): Added
11114         `MONO_DEBUGGER_EVENT_FINALIZE_MANAGED_CODE'.    
11115
11116         * mono-debug-debugger.c (mono_debugger_cleanup): Send a
11117         `MONO_DEBUGGER_EVENT_FINALIZE_MANAGED_CODE' and then set
11118         `mono_debugger_event_handler' to NULL.
11119
11120 2006-05-24  Martin Baulig  <martin@ximian.com>
11121
11122         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 57.
11123
11124 2006-05-24  Martin Baulig  <martin@ximian.com>
11125
11126         * mono-debug-debugger.h
11127         (mono_debugger_create_notification_function): Added
11128         `MonoCodeManager *' argument.
11129
11130 Tue May 23 16:05:47 CEST 2006 Paolo Molaro <lupus@ximian.com>
11131
11132         * boehm-gc.c, null-gc.c: fix compilation on 64 bit systems.
11133
11134 Tue May 23 13:44:11 CEST 2006 Paolo Molaro <lupus@ximian.com>
11135
11136         * Makefile.am, gc-internal.h, reflection.c: updates for the new GC.
11137         * sgen.-gc.c, sgen-gc.h: simple generational compacting GC
11138         implementation.
11139
11140 Tue May 23 13:40:30 CEST 2006 Paolo Molaro <lupus@ximian.com>
11141
11142         * icall.c: precise GC support: objects can't be stored in unmanaged
11143         memory anymore, even if they are kept alive by other references: since
11144         they can move the GC needs to be able to always find them.
11145
11146 Tue May 23 12:57:08 CEST 2006 Paolo Molaro <lupus@ximian.com>
11147
11148         * object.c: precise GC support for static fields. Support
11149         for moving GCs: write barriers and pinned allocation for interned
11150         strings.
11151
11152 Tue May 23 12:41:44 CEST 2006 Paolo Molaro <lupus@ximian.com>
11153
11154         * domain.c, domain-internals.h: precise GC support for the MonoDomain
11155         structure.
11156
11157 Tue May 23 12:38:56 CEST 2006 Paolo Molaro <lupus@ximian.com>
11158
11159         * class.c, gc.c: sgen and precise GC updates.
11160
11161 Tue May 23 12:33:24 CEST 2006 Paolo Molaro <lupus@ximian.com>
11162
11163         * marshal.h, marshal.c: added write barrier wrapper and precise type
11164         fixes.
11165
11166 Tue May 23 12:31:22 CEST 2006 Paolo Molaro <lupus@ximian.com>
11167
11168         * object.h, null-gc.c, boehm-gc.c: more write barrier functions and
11169         support.
11170
11171 Tue May 23 12:27:14 CEST 2006 Paolo Molaro <lupus@ximian.com>
11172
11173         * reflection.c: precise and sgen GC updates.
11174
11175 Tue May 23 12:21:46 CEST 2006 Paolo Molaro <lupus@ximian.com>
11176
11177         * debug-helpers.c, class-internals.h: added write barrier wrapper type.
11178
11179 2006-05-22  Zoltan Varga  <vargaz@gmail.com>
11180
11181         * threads.c (start_wrapper): Fix a missed guint32 tid declaration.
11182
11183 2006-05-20  Zoltan Varga  <vargaz@gmail.com>
11184
11185         * reflection.c (encode_cattr_value): Fix yet another bug in the encoding of
11186         MONO_TYPE_OBJECT. Fixes #78462.
11187
11188 2006-05-18  Zoltan Varga  <vargaz@gmail.com>
11189
11190         * marshal.c (emit_marshal_vtype): Add support for UnmanagedType.LPStruct 
11191         and blittable types.
11192
11193 2006-05-17  Miguel de Icaza  <miguel@novell.com>
11194
11195         * class.c (mono_class_get_exception_for_failure): Implement parts
11196         of a TODO: if the loader error is set (instead of the class
11197         error), we return a Loader exception that can be properly thrown
11198         elsewhere.
11199
11200         This was exposed by some Winforms 2.0 code that I tried to run
11201         (Atsushi pointed me to it).
11202
11203 2006-05-17  Zoltan Varga  <vargaz@gmail.com>
11204
11205         * marshal.c (mono_marshal_emit_native_wrapper): Make the marshalling code more
11206         uniform by moving stuff from this function to the proper emit_marshal_XXX functions.
11207         
11208         * marshal.c (emit_marshal_vtype): Add limited support for 
11209         UnmanagedType.LPStruct. Fixes #78427.
11210
11211         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure): 
11212         Applied a patch from kangaroo to fix #77523.
11213
11214 2006-05-17  Martin Baulig  <martin@ximian.com>
11215
11216         * threads.c
11217         (debugger_thread_vtable): Moved into ../mini/debug-debugger.c.
11218         (debugger_thread_created): Removed.
11219         (debugger_thread_exited): Removed.
11220
11221 2006-05-15  Zoltan Varga  <vargaz@gmail.com>
11222
11223         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
11224
11225         * object-internals.h (MonoReflectionResource): Sync with managed version.
11226
11227 2006-05-12  Wade Berrier <wberrier@novell.com>
11228
11229         * threads.c: Define G_GSIZE_FORMAT for systems with glib < 2.6
11230
11231 2006-05-12  Zoltan Varga  <vargaz@gmail.com>
11232
11233         * class.c (mono_fnptr_class_get): Set class->image to corlib for now, since other
11234         functions try to allocate from the image mempool.
11235
11236 2006-05-12  Dick Porter  <dick@ximian.com>
11237
11238         * threads.c (mono_thread_attach): Fix usage of GetCurrentThread().
11239
11240 2006-05-12  Lluis Sanchez  <lluis@ximian.com>
11241
11242         * object.c: The FieldGetter and FieldSetter methods require the full
11243         name of the class, not only the name. Fixes bug #78277.
11244
11245 2006-05-11  Miguel de Icaza  <miguel@novell.com>
11246
11247         * loader.c (method_from_memberref): Do not pass the NULL klass to
11248         mono_loader_set_error_() methods.  Pass the non-NULL value
11249         (class). 
11250
11251 2006-05-11  Zoltan Varga  <vargaz@gmail.com>
11252
11253         * assembly.c (mono_assembly_load_from_full): Fix a bunch of warnings.
11254         (mono_assembly_close): Null out assembly->image->references after freeing it.
11255
11256         * image.c (mono_image_close): Free image->references.
11257         
11258         * reflection.c (mono_image_basic_init): Fix a small memory leak.
11259
11260 2006-05-10  Sebastien Pouliot  <sebastien@ximian.com>
11261
11262         * marshal.c: In function mono_mb_add_local don't use the mb pointer 
11263         before checking if it's NULL (g_assert).
11264
11265 2006-05-10  Martin Baulig  <martin@ximian.com>
11266
11267         * metadata.c (mono_type_size): Kill the g_assert() in MONO_TYPE_GENERICINST;
11268         I thought I already killed that two months ago, but now it somehow reappeared.
11269
11270 2006-05-10  Martin Baulig  <martin@ximian.com>
11271
11272         * mono-debug.c (mono_debug_add_method): Allow instantiated generic methods.
11273
11274 2006-05-10  Zoltan Varga  <vargaz@gmail.com>
11275
11276         * reflection.c: Allocate memory for dynamically created methods in the image
11277         mempools.
11278
11279 2006-05-10  Sebastien Pouliot  <sebastien@ximian.com>
11280
11281         * appdomain.c: In ves_icall_System_AppDomain_[Get|Set]Data functions, 
11282         don't use the ad pointer before checking if it's NULL (g_assert).
11283
11284 2006-05-09  Zoltan Varga  <vargaz@gmail.com>
11285
11286         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): Remove
11287         a redundant (and incorrect) addref. Hopefully fixes sn.exe on windows.
11288
11289         * marshal.c: Allocate all signatures from mempools.
11290
11291         * marshal.c: Allocate some more signatures from mempools.
11292
11293 2006-05-09  Miguel de Icaza  <miguel@novell.com>
11294
11295         * object.c (mono_load_remote_field): The code used to provide a
11296         temporary variable for returning results if the user did not
11297         provide a result pointer.  But our temporary variable was allocted
11298         on the satck.
11299
11300         Fix calling code to always pass a result area.   Coverity ID 103.
11301
11302 2006-05-06  Zoltan Varga  <vargaz@gmail.com>
11303
11304         * threads.c (ves_icall_System_Threading_Interlocked_Add_Int): Return the new
11305         value, not the old. Fixes #78312.
11306         (ves_icall_System_Threading_Interlocked_Add_Long): Ditto.
11307
11308         * class.c (mono_bounded_array_class_get): Allocate data from the image mempool.
11309         (mono_ptr_class_get): Ditto. Also change the cache from a global one to a 
11310         per-image cache.
11311
11312         * assembly.c (mono_assembly_close): Free image->references.
11313
11314         * assembly.c (mono_assembly_names_equal): Fix a warning.
11315         (mono_assemblies_cleanup): Cleanup more global data.
11316
11317         * metadata-internals.h (MonoImage): Add 'ptr_cache'.
11318
11319         * image.c (mono_image_close): Free up the contents of 'array_cache', free up
11320         ptr_cache and image->modules.
11321
11322         * image.c (mono_image_init): Allocate array_cache lazily.
11323         
11324 2006-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11325
11326         * assembly.c: use GetCurrentThreadId for the hash, as GetCurrentThread
11327         behavior was changed recently and has bad side effects.
11328
11329 2006-05-05  Zoltan Varga  <vargaz@gmail.com>
11330
11331         * assembly.c (mono_assembly_open_full): Add a missing mono_image_close ().
11332         
11333         * assembly.c (mono_assembly_close): Remove a debug printf.
11334
11335         * profiler.c (create_profiler): Use mono_aligned_addr_hash.
11336
11337         * metadata-internals.h image.c assembly.c: Change the reference counting scheme
11338         to also allow for temporary references between mono_image_open ()/close ().
11339
11340         * domain.c (get_runtimes_from_exe): Add a FIXME.        
11341
11342 2006-05-04  Zoltan Varga  <vargaz@gmail.com>
11343
11344         * marshal.c: Fix support for dynamic methods.
11345
11346         * appdomain.c (mono_runtime_cleanup): Call mono_marshal_cleanup ().
11347
11348         * marshal.c (mono_marshal_cleanup): New cleanup function.
11349
11350         * marshal.c: Rewrite the wrapper code to allocate most of its memory from the 
11351         image mempools.
11352
11353         * class.c (mono_class_init): Fix leaking class->nested_classes.
11354
11355         * metadata-internals.h (MonoImage): Add a couple of new wrapper caches.
11356
11357         * image.c (mono_image_init): Initialize the new cashes.
11358
11359         * image.c (mono_image_close): Destroy the new cashes.
11360
11361         * marshal.c: Get rid of most of the static caches in favor of per-image caches.
11362
11363         * mempool.c (mono_mempool_strdup): New helper function.
11364
11365         * class-internals.h: Add prototype for mono_loader_unlock ().
11366
11367         * domain.c (mono_jit_info_table_find): Fix a warning.
11368         (mono_debugger_check_runtime_version): Ditto.
11369
11370         * rawbuffer.h rawbuffer.c metadata-internals.h metadata.c class-internals.h 
11371         class.c loader.c image.h image.c assembly.h assembly.c: Add init () and cleanup ()
11372         functions to these modules.
11373
11374         * domain-internals.h domain (mono_cleanup): New internal method to cleanup most
11375         metadata modules.
11376         
11377         * marshal.c (mono_free_bstr): Fix a warning.
11378
11379         * assembly.c (mono_assembly_open_full): Fix another small leak.
11380
11381         * object.c: Fix some unload leaks in the remoting code.
11382
11383         * object-internals.h object-internal.c (mono_string_to_utf8_mp): New helper
11384         function.
11385
11386         * assembly.c (mono_assembly_close): Fix a leak when unloading dynamic assemblies.
11387
11388         * reflection.c: Fix some unload leaks in dynamic assemblies.
11389
11390 2006-05-02  Jonathan Chambers  <jonathan.chambers@ansys.com>
11391
11392         * marshal.c: Add BSTR support on Win32 (all changes under MIT X11)
11393         * marshal.h: Add BSTR support on Win32
11394         * icall.c: Add BSTR icalls
11395         * metadata.h: Add BSTR enums
11396
11397 2006-04-28  Miguel de Icaza  <miguel@novell.com>
11398
11399         Work to catch the crash from #76795 and turn it into an
11400         exception.   As I stubbed out pieces of the VisualBasic support,
11401         I found a number of places where the code was failing and I added
11402         checks to those places. 
11403         
11404         * metadata.c (do_mono_metadata_parse_generic_class): Make this
11405         function return a status code.  If we fail to parse the signature
11406         from mono_metadata_parse_generic_inst, return FALSE.
11407
11408         * loader.c (mono_get_method_from_token): If we fail to load the
11409         method (mono_class_get) return NULL.   
11410
11411         * (method_from_memberref): Return NULL if we are unable to parse
11412         the method signature
11413
11414         (mono_loader_error_prepare_exception): Since we now use the
11415         loader_error flag internally to stop processing, and obtaining
11416         exceptions that might be thrown will walk this code path the
11417         proper way of going from a MonoLoaderError into a
11418         MonoException was convoluted.   This new routine encapsulates the
11419         process of turning the error into an exception and *clearing* the
11420         error afterwards.
11421         
11422 2006-04-27  Miguel de Icaza  <miguel@novell.com>
11423
11424         Work to catch the crashes from 75075 (cope in Assembly.GetTypes
11425         with missing assemblies), and to cope with:
11426
11427                 * Missing fieldref from a non-existing assembly.
11428                 * Missing methodref from a non-existing assembly.
11429
11430         The first batch of work to address *some* of the issues from 76661.
11431         
11432         * object.c (mono_class_create_runtime_vtable): If we fail to
11433         initialize the class raise the exception here. 
11434
11435         * metadata.c (mono_class_get_overrides_full): If any methods fail
11436         to load return the failure to the caller.
11437
11438         * assembly.c: Use REFERENCE_MISSING instead of (gpointer) -1 for
11439         flagging assemblies that failed to load.   
11440
11441         Do not crash if we are unable to load the assembly.
11442
11443         (mono_assembly_close): Do nothing with REFERENCE_MISSING
11444         assemblies. 
11445
11446         * loader.c (mono_loader_set_error_type_load): Change the
11447         convention to always pass unallocated strings, so we make our own
11448         copies (I know our own code had duplicated strings before, but
11449         this keeps the normal conventions).
11450         (method_from_memberref): Call mono_loader_set_error_method_load
11451         for all possible failures of loading the class. 
11452         Remove assert, turn into a loader error.
11453
11454         (mono_loader_error_to_exception): Move this routine from mini
11455         (mini_loader_error_to_exception) there was no need to have that in
11456         mini. 
11457
11458         * class.c (mono_class_from_typeref): If we were not able to load
11459         the assembly with mono_assembly_load_reference, call the
11460         mono_loader_set_error_type_load to register the problem.
11461
11462         (mono_class_setup_fields): If we fail to load the type from
11463         mono_metadata_parse_type_full, call mono_class_set_failure and
11464         break from the loop.
11465
11466         If class->exception_type is set, we do not layout the fields as
11467         that might crash the runtime, and instead return (from breaking
11468         from the previous loop).
11469
11470         (mono_class_setup_vtable): This now returns a boolean indicating
11471         whether the table was properly setup.   The decision is driven by
11472         mono_class_get_overrides_full which might run into non-existing
11473         methods. 
11474         
11475         (mono_class_init): Returns TRUE on success or FALSE if there was a
11476         problem in loading the type (incorrect assemblies, missing
11477         assemblies, methods, etc).
11478
11479         When we call mono_class_setup_fields we also check for a potential
11480         error inside this call (either a class exception or a general
11481         loader exception).
11482
11483         (mono_class_create_from_typedef): If the parent fails to load
11484         (calling mono_class_get_full) return NULL.
11485         
11486         ** Important **
11487
11488         calls to mono_metadata_parse_type_full should be checked
11489         everywhere and set the mono_class_set_failure
11490         (MONO_EXCEPTION_TYPE_LOAD) if we are not able to get the type.
11491
11492         The current patch checks the places where my manually constructed
11493         tests show the errors are showing up, but we should do it
11494         everywhere. 
11495
11496         ** Important2 **
11497
11498         mono_class_init return values should be tested everywhere, like
11499         the previous case this is something that we should audit
11500         everywhere and not only on the cases exposed by the tests I
11501         created. 
11502
11503 2006-04-26  Miguel de Icaza  <miguel@novell.com>
11504
11505         * file-io.c (ves_icall_System_IO_MonoIO_Open): Remove `async'
11506         boolean parameter and instead pass the information on `options'
11507         parameter (FileOptions).
11508
11509         * icall.c: Register the new signature for MonoIO.Open.
11510
11511         * debug-helpers.c (dis_one): Trying to understand how coverity
11512         works.  Fix Run 5, item 78.
11513
11514 2006-04-26  Dick Porter  <dick@ximian.com>
11515
11516         * socket-io.c (hostent_to_IPHostEntry2): Explicitly check for NULL
11517         dereference.
11518
11519 2006-04-25  Martin Baulig  <martin@ximian.com>
11520
11521         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 56.
11522
11523         * threads.c (mono_thread_attach): Set `thread->stack_ptr' and call
11524         debugger_thread_created().
11525         (debugger_gc_push_all_stacks): Don't handle the main thread in any
11526         special way.
11527         (mono_debugger_init_threads): Removed the `main_thread_stack' arg.
11528         (mono_debugger_finalize_threads): New function; undo the effects
11529         of mono_debugger_init_threads().
11530         (mono_debugger_create_all_threads): Removed.
11531
11532 2006-04-24  Zoltan Varga  <vargaz@gmail.com>
11533
11534         * image.c (mono_image_close): Tidy up trace messages.
11535
11536         * assembly.c (mono_assembly_close): Ditto.
11537
11538         * assembly.c (mono_assembly_close): Clear out image->assembly so the image
11539         no longer references an already freed assembly. Fixes #78168.
11540
11541 2006-04-21  Dick Porter  <dick@ximian.com>
11542
11543         * threads.c (mono_thread_detach): Fix reference counting when
11544         detaching threads.
11545
11546 2006-04-21  Zoltan Varga  <vargaz@gmail.com>
11547
11548         * icall.c (ves_icall_System_Enum_ToObject): Improve exception messages. Fixes
11549         #78155.
11550
11551 2006-04-19  Zoltan Varga  <vargaz@gmail.com>
11552
11553         * marshal.c (mono_type_to_ldind): New helper function moved here from mini.c
11554         (mono_type_to_stind): Ditto.
11555
11556         * marshal.c: Use the new helper functions to simplify code.
11557
11558         * image.c (mono_image_close): Add some code for help debug assembly unloading
11559         problems.
11560
11561         * metadata.c (mono_metadata_parse_type_full): Allocate MonoType's from the
11562         image mempool.
11563
11564         * assembly.c (mono_assembly_open_full): Invoke the load hook when the
11565         assembly was already loaded in another appdomain. Fixes #78083.
11566
11567 2006-04-13  Zoltan Varga  <vargaz@gmail.com>
11568
11569         * assembly.c (mono_assembly_load_reference): Increase the refcount of the
11570         referenced assemblies.
11571         (mono_assembly_close): Decrease the refcount of the referenced assemblies.
11572
11573         * domain.c (mono_domain_free): Add a trace message.
11574
11575         * appdomain.c (add_assemblies_to_domain): Ditto.        
11576
11577         * metadata-internals.h: (_MonoAssembly): Modify the meaning of the ref_count
11578         field.  
11579
11580 2006-04-12  Zoltan Varga  <vargaz@gmail.com>
11581
11582         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): Fix image reference counting.
11583
11584 2006-04-12  Martin Baulig  <martin@ximian.com>
11585
11586         * threads.c: Use `MONO_DEBUGGER_SUPPORTED' as the conditional, not
11587         `USE_INCLUDED_LIBGC'.   
11588
11589 2006-04-12  Zoltan Varga  <vargaz@gmail.com>
11590
11591         * image.c (canonicalize_path): Avoid calling strncpy on overlapping strings if
11592         the patch contains ../ and a small directory name later. Hopefully fixes
11593         #78035.
11594
11595 2006-04-10  Martin Baulig  <martin@ximian.com>
11596
11597         Clean up the debugger's thread-handling code.
11598
11599         The debugger's thread-handling code has been moved from
11600         ../mini/debug-debugger.c to threads.c.  We now iterate directly
11601         over the `threads' hash, keep track of exiting threads and also
11602         use proper locking.
11603
11604         We can now debug XSP and XSP based applications with the debugger.
11605
11606         * object-internals.h (MonoThread): Added `gpointer end_stack'.
11607
11608         * threads.h
11609         (MonoThreadCallbacks): Removed; this was only used by the debugger.
11610         (mono_install_thread_callbacks): Likewise.      
11611
11612         * threads.c (mono_thread_callbacks): Removed.
11613         (debugger_thread_created, debugger_thread_exited): New static functions.
11614         (start_wrapper): Call debugger_thread_created().
11615         (thread_cleanup): Call debugger_thread_exited().
11616         (mono_gc_stop_world, mono_gc_start_world): Removed; this was never used.
11617         (mono_debugger_init_threads): New public function.
11618         (debugger_thread_vtable): Moved here from debug-debugger.c; we now
11619         iterate directly over the `threads' hash and also use proper locking.
11620
11621         * mono-debug.h (MONO_DEBUGGER_VERSION): Bumped to 55.
11622
11623         * mono-debug-debugger.h
11624         (MonoDebuggerEvent): Added MONO_DEBUGGER_EVENT_THREAD_EXITED.
11625
11626 2006-04-10  Zoltan Varga  <vargaz@gmail.com>
11627
11628         * reflection.c (encode_cattr_value): Fix handling of parameter type=object, 
11629         argument type=array. Fixes #78057.
11630
11631 2006-04-10  Atsushi Enomoto  <atsushi@ximian.com>
11632
11633         * culture-info-table.h : regenerated. Fixed bug #69652.
11634
11635 2006-04-07  Zoltan Varga  <vargaz@gmail.com>
11636
11637         * loader.c metadata.c: Reapply a variant r59116.
11638         
11639         * loader.c metadata.c: Revert r59116 to see if it fixes the breakage.
11640
11641         * class.c (mono_class_setup_interface_offsets): New internal function.
11642
11643         * reflection.c (ensure_runtime_vtable): Setup interface offsets for dynamic
11644         interfaces too. Fixes #77398.
11645
11646         * reflection.c (encode_cattr_value): Add support for 
11647         parameter type=object, argument type=array.
11648         (load_cattr_value): Ditto. Fixes #77916.
11649
11650         * marshal.c (emit_object_to_ptr_conv): Add support for ARRAY_BYVALCHARARRAY.
11651         (emit_ptr_to_object_conv): Ditto. Fixes #77960.
11652
11653         * metadata.c (mono_type_to_unmanaged): Use ARRAY_BYVALCHARARRAY when converting
11654         a byval char array and CharSet is Ansi.
11655
11656         * metadata.h: Add new marshalling conversion ARRAY_BYVALCHARARRAY.
11657
11658 2006-04-06  Zoltan Varga  <vargaz@gmail.com>
11659
11660         * metadata.c: Add some locking comments.
11661         
11662         * metadata.c (mono_metadata_signature_alloc): Allocate signatures in the image
11663         mempool.
11664         (mono_metadata_free_method_signature): Don't free the signature itself.
11665
11666         * loader.c (mono_free_method): Don't free the signature in non-dynamic methods. 
11667
11668         * assembly.c (mono_assembly_open_full): Avoid the situation where two assemblies
11669         reference the same MonoImage.
11670         (mono_assembly_load_from_full): Add an assert.
11671
11672 2006-04-05  Zoltan Varga  <vargaz@gmail.com>
11673
11674         * image.c (mono_image_close): Don't put the image we are about to free into the
11675         loaded_images_guid_hash.
11676
11677         * marshal.c (mono_mb_emit_ptr): Refactor a common code sequence into this function
11678         to reduce code duplication.
11679
11680         * marshal.c: Register the native functions called by this module as icalls, to
11681         somewhat centralize the creation of MonoMethodSignature's.
11682
11683         * loader.c (mono_method_signature): Add a cache for method signatures.
11684
11685         * metadata.c (mono_metadata_get_param_attrs): New helper function to return
11686         the parameter attributes of a method.
11687         (mono_metadata_parse_method_signature_full): Refactored the computation of
11688         parameter attributes into a separate function. Also avoid one allocation in
11689         most cases.
11690
11691         * assembly.c (mono_assembly_close): Ditto.
11692
11693         * image.c (mono_image_close): Log trace messages with INFO level.
11694
11695         * metadata-internals.h (MonoImage): Add a new 'method_signature' cache.
11696
11697         * image.c reflection.c: Correct reference counting of image modules.
11698         
11699         * metadata.c (mono_metadata_interfaces_from_typedef_full): Allocate the result
11700         of this function from the image mempool.
11701         
11702         (mono_metadata_parse_type_full): Remove the mode != MONO_PARSE_PARAM restriction
11703         to allow more cached types to be used.
11704
11705         * mono-debug.c (mono_debug_add_method): Appled patch from
11706         David S. Miller  <davem@sunset.davemloft.net>: Access 
11707         minfo->lexical_blocks[] entry elements using read32().
11708
11709 2006-04-04  Zoltan Varga  <vargaz@gmail.com>
11710
11711         * loader.c (mono_free_method): No longer free the method header for non-dynamic
11712         methods as it is allocated from the mempool.
11713
11714         * metadata.c (mono_metadata_parse_mh_full): Allocate method headers from the
11715         image mempool.
11716
11717         * metadata-internals.h: Add comments describing the reference counting scheme
11718         used for MonoImage and MonoAssembly.
11719
11720         * image.c assembly.c reflection.c: Rework reference counting of images and 
11721         assemblies so they are freed when the runtime is shut down. Free some 
11722         additional memory structures when an image is unloaded.
11723         
11724 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
11725
11726         * class.c loader.c reflection.c: Allocate more data structures in
11727         the image mempool.
11728
11729 2006-03-31  Miguel de Icaza  <miguel@novell.com>
11730
11731         * icall.c
11732         (ves_icall_System_Environment_InternalSetEnvironmentVariable): Fix
11733         build on pre glib 2.4 systems.
11734
11735 2006-03-31  Zoltan Varga  <vargaz@gmail.com>
11736
11737         * icall.c (ves_icall_System_Environment_InternalSetEnvironmentVariable): New icall.
11738
11739         * icall.c: Fix some warnings.
11740
11741 2006-03-29  Atsushi Enomoto  <atsushi@ximian.com>
11742
11743         * culture-info-table.h : regenerated.
11744
11745 Wed Mar 29 18:24:42 CEST 2006 Paolo Molaro <lupus@ximian.com>
11746
11747         * threads.c, object-internals.h, verify.c: changed the culture caching
11748         code to use a normal MonoArray for storage so the GC can keep track of
11749         them easily. Fixed bits of the cache logic, too and simplified the
11750         code.
11751
11752 Wed Mar 29 17:18:16 CEST 2006 Paolo Molaro <lupus@ximian.com>
11753
11754         * gc-internal.h, null-gc.c, boehm-gc.c, gc.c: enable the finalizer
11755         thread for non-Boehm GCs.
11756
11757 Wed Mar 29 17:10:05 CEST 2006 Paolo Molaro <lupus@ximian.com>
11758
11759         * domain.c, object.c, domain-internals.h: reduce the amount of memory
11760         needed to keep track of the data for static fields.
11761
11762 2006-03-29  Raja R Harinath  <rharinath@novell.com>
11763
11764         Fix #75172
11765         * icall.c (ves_icall_Type_GetMethodsByName): Don't use vtable_size
11766         for interface classes.  Use 'num_methods' instead.
11767         (ves_icall_Type_GetPropertiesByName): Likewise.  Setup vtable
11768         before using '->vtable_size' field.
11769
11770 Wed Mar 29 12:53:28 CEST 2006 Paolo Molaro <lupus@ximian.com>
11771
11772         * domain.c, object.c, domain-internals.h: proxy_vtable_hash
11773         doesn't contain managed pointers, so use a normal hashtable.
11774
11775 Mon Mar 27 11:15:00 CEST 2006 Paolo Molaro <lupus@ximian.com>
11776
11777         * reflection.c, class-internals.h, domain.c: fixed handling of types
11778         used as values for objects in custom attributes (bug #77915):
11779
11780 2006-03-24  Martin Baulig  <martin@ximian.com>
11781
11782         * class.c (mono_class_setup_fields): Added support for generic
11783         instances; fixes #77580.
11784
11785 2006-03-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11786
11787         * assembly.c: publickeytoken is case insensitive. Fixes bug #77898.
11788
11789 2006-03-24  Dick Porter  <dick@ximian.com>
11790
11791         * file-io.c (get_file_attributes): More stat macro breakage.
11792         Fixes bug 77759.
11793
11794 Fri Mar 24 15:26:00 CET 2006 Paolo Molaro <lupus@ximian.com>
11795
11796         * profiler.c: added the file=filename option in the default profiler
11797         to output the profile data to filename.
11798
11799 2006-03-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11800
11801         * icall.c: CodeBase returns '/' instead of '\\' on windows. Fixes
11802         bug #77877.
11803
11804 2006-03-22  Martin Baulig  <martin@ximian.com>
11805
11806         * reflection.c (fieldbuilder_to_mono_class_field): Don't store the
11807         allocated `MonoClassField *' in `fb->handle'.
11808
11809 Tue Mar 21 17:19:37 CET 2006 Paolo Molaro <lupus@ximian.com>
11810
11811         * class.c, image.c, metadata-internals.h: implemented new mechanism to
11812         allocate interface ID to save memory and allow better ID reuse on
11813         appdomain unload. setup_generic_vtable () removal from Martin.
11814
11815 Tue Mar 21 15:54:30 CET 2006 Paolo Molaro <lupus@ximian.com>
11816
11817         * object.h, appdomain.c, domain.c, exception.c, icall.c,
11818         locales.c, marshal.c, object.c, reflection.c, threadpool.c,
11819         threads.c: introduced MONO_OBJECT_SETREF() macro to be able to insert
11820         write barriers for reference stores with managed objects accessed with
11821         C structures in the runtime and in embedding programs.
11822
11823 2006-03-20  Raja R Harinath  <rharinath@novell.com>
11824
11825         * icall.c (ves_icall_Type_GetInterfaces): Avoid using
11826         'interface_id' and 'max_interface_id' fields of MonoClasses
11827         representing open generic types.
11828
11829 Fri Mar 17 18:06:06 CET 2006 Paolo Molaro <lupus@ximian.com>
11830
11831         * object.h, object.c, icall.c: added functions to deal with
11832         storing valuetypes that contain references in managed objects.
11833         * reflection.c, string-icalls.c, threads.c, marshal.c: small
11834         fixes and comments around uses of mono_array_addr ().
11835
11836 Thu Mar 16 17:16:45 CET 2006 Paolo Molaro <lupus@ximian.com>
11837
11838         * object.h, icall.c, monitor.c: object.GetHashCode ()
11839         implementation that supports the moving garbage collector.
11840
11841 Wed Mar 15 16:31:38 CET 2006 Paolo Molaro <lupus@ximian.com>
11842
11843         * icall.c, threads-types.h, threads.c: implemented finalizer for
11844         LocalDataStoreSlot.
11845
11846 2006-03-15  Zoltan Varga  <vargaz@gmail.com>
11847
11848         * metadata.c (mono_type_size): Add a fixme.
11849         (mono_type_stack_size): Ditto.
11850
11851         * object-internals.h (MonoReflectionAssemblyBuilder): Added 
11852         'type_forwarders' field.
11853
11854         * tabledefs.h (TYPE_ATTRIBUTE_FORWARDER): Added new (undocumented) type
11855         attribute from net 2.0.
11856
11857         * object.c (mono_vtable_get_static_field_data): Moved this to object.c
11858         from class.c.
11859
11860         * class.c (mono_class_setup_fields): Fix a warning.
11861         
11862         * class.c (mono_class_from_name): Add support for assemblyref entries
11863         in the EXPORTEDTYPE table.
11864
11865         * reflection.c: Add support for handling type forwarders under net 2.0.
11866
11867         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.       
11868         
11869 2006-03-14  Zoltan Varga  <vargaz@gmail.com>
11870
11871         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Avoid
11872         overwriting entries in ModuleBuild->types, also clean up the code
11873         a little. Fixes #77774.
11874
11875 Tue Mar 14 20:21:18 CET 2006 Paolo Molaro <lupus@ximian.com>
11876
11877         * domain.c, assembly.c, metadata-internals.h, class-internals.h:
11878         load friend assembly info when present.
11879
11880 2006-03-14  Raja R Harinath  <rharinath@novell.com>
11881
11882         Fix crasher on gtest-158.cs.
11883         * metadata.c (mono_metadata_parse_type_full): Avoid canonicalizing
11884         the return value if the MonoClass we want is yet in an
11885         inconsistent state.
11886         * class.c (mono_class_create_from_typedef): Add an comment
11887         explaining an order dependency between mono_class_setup_parent and
11888         mono_class_setup_mono_type.
11889
11890 Mon Mar 13 21:13:27 CET 2006 Paolo Molaro <lupus@ximian.com>
11891
11892         * class.c: documentation updates and events bug fix.
11893
11894 Mon Mar 13 17:28:07 CET 2006 Paolo Molaro <lupus@ximian.com>
11895
11896         * class.c: some cleanup, locking fixes.
11897
11898 Mon Mar 13 10:46:17 CET 2006 Paolo Molaro <lupus@ximian.com>
11899
11900         * class.c: fix the generics code to setup nested
11901         type info to the instantiated type (bug #77770).
11902
11903 Sun Mar 12 16:21:31 CET 2006 Paolo Molaro <lupus@ximian.com>
11904
11905         * marshal.c: fixed a few type correctness issues.
11906
11907 Sat Mar 11 20:14:44 CET 2006 Paolo Molaro <lupus@ximian.com>
11908
11909         * loader.c: the Set/Get/Addrtess array methods should be public.
11910
11911 2006-03-11  Zoltan Varga  <vargaz@gmail.com>
11912
11913         * icall.c (mono_register_jit_icall_wrapper): Fix a warning.
11914         
11915         * icall.c (mono_register_jit_icall_wrapper): Register the argument, not
11916         info->wrapper.
11917
11918 2006-03-10  Zoltan Varga  <vargaz@gmail.com>
11919
11920         * icall.c (mono_register_jit_icall): Allocate the structure using g_new0.
11921
11922         * class-internals.h (MonoJitICallInfo): Add 'trampoline' field used by the JIT.
11923
11924         * mempool.c (mono_mempool_alloc): Speed this up a bit.
11925         (mono_mempool_alloc0): Ditto.
11926
11927 2006-03-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11928
11929         * socket-io.c:
11930         (create_object_from_sockaddr): it was allocating 4 extra bytes
11931         for the AF_UNIX data. Fixes bug #77747.
11932
11933 2006-03-09  Zoltan Varga  <vargaz@gmail.com>
11934
11935         * icall.c (ves_icall_System_MonoMethodInfo_get_retval_marshal): New icall.
11936
11937 2006-03-09  Dick Porter  <dick@ximian.com>
11938
11939         * file-io.c (get_file_attributes): Use S_ISLNK not "& S_IFLNK".
11940         Fixes bug 76966 again.
11941
11942 2006-03-07  Peter Dennis Bartok  <pbartok@novell.com>
11943
11944         * verify.c (dtfinfo_fields): Updated to match new (serializable) field
11945         names from r57532
11946         * appdomain.c: Bumped corlib version to 48 (due to r57532)
11947
11948 2006-03-07  Martin Baulig  <martin@ximian.com>
11949
11950         * object.c
11951         (mono_field_get_value_object): Add support for MONO_TYPE_GENERICINST.
11952
11953 2006-03-07  Martin Baulig  <martin@ximian.com>
11954
11955         * class.c
11956         (mono_class_get_full): Don't inflate TYPEDEF entries; fixes the
11957         regression introduced in r56970; see gtest-252.cs.
11958
11959         * loader.c (mono_get_method_constrained): Correctly handle generic
11960         methods; see gtest-253.cs.
11961
11962 2006-03-04  Zoltan Varga  <vargaz@gmail.com>
11963
11964         * icall.c (ves_icall_type_Equals): Handle NULLs. Fixes #77700.
11965
11966 2006-03-04  Martin Baulig  <martin@ximian.com>
11967
11968         * icall.c (ves_icall_MonoGenericClass_GetParentType): Dynamically
11969         compute the parent type at runtime, just like we're already doing
11970         it for interfaces.
11971
11972         * reflection.c
11973         (mono_reflection_bind_generic_parameters): Don't compute the
11974         parent type anymore.
11975
11976         * class-internals.h (MonoDynamicGenericClass): Removed `parent'.
11977
11978 2006-03-04  Martin Baulig  <martin@ximian.com>
11979
11980         * mono-debug-debugger.h
11981         (mono_debugger_create_notification_function): Allocate memory at
11982         runtime and return a pointer to it.
11983
11984 2006-03-03  Zoltan Varga  <vargaz@gmail.com>
11985
11986         * assembly.c: Fix windows build.
11987         
11988         * assembly.c: Fix build.
11989
11990         * assembly.c: Move the contents of os/{unix,win32}/util.c to this file. 
11991
11992         * gc_wrapper.h: Move the contents of os/gc_wrapper.h to this file.
11993         
11994 2006-03-03  Dick Porter  <dick@ximian.com>
11995
11996         * process.c
11997         (ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal):
11998         Check parameters before dereferencing them.  Fixes Aaron's part of
11999         bug 77393.
12000
12001 2006-03-03  Raja R Harinath  <rharinath@novell.com>
12002
12003         Fix performance regression.
12004         * loader.c (find_method_in_class): Add 'from_class' argument.
12005         Rename 'klass' argument to 'in_class'.  The signature is compared
12006         against the method in 'in_class', and the corresponding method is
12007         returned from 'from_class'.
12008         (find_method): Walk both 'in_class' and 'from_class' in parallel.
12009         (method_from_memberref) [PARENT_TYPESPEC]: Use it to walk the
12010         type definition and generic instantiation in parallel.
12011         (mono_get_method_constrained): Update to changes.
12012
12013 Thu Mar 2 12:27:41 CET 2006 Paolo Molaro <lupus@ximian.com>
12014
12015         * threads.c: make sure the domain is correct, too when doing
12016         mono_thread_attach ().
12017
12018 2006-03-01  Zoltan Varga  <vargaz@gmail.com>
12019
12020         * class.c (mono_class_create_from_typedef): Mark classes using CharSet.Auto as unicode on
12021         windows. Fixes #77683.
12022
12023 Wed Mar 1 20:09:25 CET 2006 Paolo Molaro <lupus@ximian.com>
12024
12025         * object.h, *: introduced specific way to set elements of an array
12026         of references to be used as write barrier. Still need to audit the
12027         uses of mono_array_addr.
12028
12029 2006-03-01  Miguel de Icaza  <miguel@novell.com>
12030
12031         * object-internals.h: New field to cache the assmebly name, patch
12032         from Tambet Ingo (tambet@ximian.com)
12033
12034 Wed Mar 1 19:13:30 CET 2006 Paolo Molaro <lupus@ximian.com>
12035
12036         * decimal.h, class-internals.h, metadata-internals.h,
12037         file-io.h: mark a few function declarations as internal, to
12038         reduce the number of PLT entries.
12039
12040 2006-02-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12041
12042         * file-io.c: fix typo in warning message.
12043
12044 Tue Feb 28 17:43:20 CET 2006 Paolo Molaro <lupus@ximian.com>
12045
12046         * loader.c: on unix, lookup the "*A" version of a function
12047         if charset is auto as a second option before failing.
12048
12049 2006-02-28  Raja R Harinath  <rharinath@novell.com>
12050
12051         * class.h (mono_class_inflate_generic_method): Revert to two
12052         argument version.
12053         * class-internals.h (MonoMethodInflated): Remove 'inflated' field.
12054         (mono_class_inflate_generic_method_full): Add.
12055         * class.c (mono_class_inflate_generic_method_full): Rename from
12056         'mono_class_inflate_generic_method'.  Don't set 'inflated' field.
12057         (mono_class_inflate_generic_method): New.  Wrapper around ..._full.
12058         * loader.c, reflection.c: Update to changes.
12059
12060 Sat Feb 25 17:57:21 CET 2006 Paolo Molaro <lupus@ximian.com>
12061
12062         * icall.c: const fixes and small improvements.
12063
12064 2006-02-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12065
12066         * threadpool.c: for asynchronous connect(), enable the same workaround
12067         for BSD 6 as for the Mac. Fixes bug #77637.
12068
12069 2006-02-24  Zoltan Varga  <vargaz@gmail.com>
12070
12071         * marshal.c (mono_marshal_free_asany): Fix handling of blittable
12072         formatted classes. Fixes #77524.
12073
12074 2006-02-24  Raja R Harinath  <rharinath@novell.com>
12075
12076         * class.c (inflate_generic_type): Add a couple more
12077         micro-optimizations.
12078         (inflate_generic_context): Don't use the 'gmethod' from
12079         'inflate_with'.
12080         (mono_class_inflate_generic_method): If the method has generic
12081         parameters, but the passed-in context doesn't have a 'gmethod',
12082         create one.  Use the possibly simplified generic instantiation
12083         from the declaring class instead of the one passed in.
12084
12085 2006-02-24  Raja R Harinath  <harinath@gmail.com>
12086
12087         Make generic method signature and method header handling lazy.
12088         * class.c (mono_class_inflate_generic_signature): Move to loader.c.
12089         (inflate_generic_header): Likewise.
12090         (mono_class_inflate_generic_method): Rewrite.  Add a 'klass_hint'
12091         parameter to avoid inflating types.
12092         (mono_get_inflated_method): Empty out.
12093         * class.h (mono_class_inflate_generic_method): Update to changes.
12094         * loader.c (mono_get_method_from_token): Don't parse signature for
12095         generic methods, nor methods of generic classes.
12096         (mono_method_signature): Rename from 'mono_method_signature'.
12097         Inflate signature on demand.
12098         (mono_method_get_header): Inflate method header on demand.
12099         * reflection.c: Update to changes.
12100
12101 2006-02-23  Raja R Harinath  <rharinath@novell.com>
12102
12103         * metadata.c (mono_metadata_inflate_generic_inst): If the
12104         instantiation is closed, don't bother expanding it in the new
12105         context.
12106         * class.c (inflate_generic_class): If the generic instantiation
12107         doesn't change after inflation, return the argument itself.
12108         (inflate_generic_type) [MONO_TYPE_MVAR, MONO_TYPE_VAR]:
12109         Add bounds checks.
12110         (inflate_generic_context): If neither the generic class nor the
12111         generic method instantiations change, return the original context.
12112         * reflection.c (mono_method_get_object): Do
12113         'mono_get_inflated_method' before accessing the ->klass field.
12114         (inflate_mono_method): Don't create a MonoGenericMethod unless
12115         necessary.
12116         (inflate_method): Don't pass a constructed type as the declaring
12117         type of a methodbuilder.
12118
12119 Thu Feb 23 11:57:54 CET 2006 Paolo Molaro <lupus@ximian.com>
12120
12121         * object.c: fix memory overwrite.
12122
12123 2006-02-22  Dick Porter  <dick@ximian.com>
12124
12125         * threads.c: Don't use G_GNUC_PRETTY_FUNCTION in debug messages,
12126         it doesn't work any more.
12127         (mono_threads_request_thread_dump): Fix unused variable warnings.
12128
12129 Wed Feb 22 15:08:44 CET 2006 Paolo Molaro <lupus@ximian.com>
12130
12131         * metadata.h, metadata-internals.h, monodiet.c, debug-helpers.c,
12132         mono-debug.c, profiler.c: cleanup: move MonoMethodHeader out of
12133         the public header file.
12134
12135 2006-02-21  Zoltan Varga  <vargaz@gmail.com>
12136
12137         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): Fix writing past memory. Fixes #77613.
12138
12139 Tue Feb 21 19:55:11 CET 2006 Paolo Molaro <lupus@ximian.com>
12140
12141         * class-internals.h, object.c: reduce the size of MonoVTable
12142         and store the interface_offsets array at negative offsets.
12143
12144 Tue Feb 21 19:53:26 CET 2006 Paolo Molaro <lupus@ximian.com>
12145
12146         * metadata.c: tweak table descriptors data structures to reduce
12147         size and runtime relocations.
12148
12149 Tue Feb 21 14:52:13 CET 2006 Paolo Molaro <lupus@ximian.com>
12150
12151         * marshal.c: fix some types and opcodes to be type-safe
12152         in marshaling wrappers.
12153
12154 2006-02-21  Ankit Jain  <jankit@novell.com>
12155
12156         * metadata.h (mono_metadata_decode_signed_value): Add declaration.
12157
12158 2006-02-21  Raja R Harinath  <rharinath@novell.com>
12159
12160         * metadata.c (get_constraints): Relax debugging checks for monodis.
12161
12162 2006-02-21  Ankit Jain  <jankit@novell.com>
12163
12164         * metadata.c (mono_metadata_load_generic_params): Move the code
12165         checking for ambiguous generic params from here to mono/dis/get.c
12166         * metadata-internals.h (mono_generic_params_with_ambiguous_names): Remove.
12167
12168 2006-02-21  Raja R Harinath  <harinath@gmail.com>
12169
12170         Fix assertion triggered when compiling nemerle.
12171         * class.c (mono_get_shared_generic_inst): Rename from
12172         get_shared_inst and make non-static.
12173         * loader.c (mono_get_shared_generic_method): New.  Used to create
12174         the MonoGenericContext-equivalent of a MonoGenericContainer.
12175         (mono_get_method_from_token): Initialize the 'context' field of
12176         the created MonoGenericContainer.
12177         * reflection.c (reflection_methodbuilder_to_mono_method): Likewise.
12178         * metadata.c (get_constraints): Add sanity check.
12179         * class-internals.h: Add new internal methods.
12180
12181         * reflection.c (verify_safe_for_managed_space): New sanity check.
12182         Currently checks that owner-less generic parameters aren't allowed
12183         in managed space.
12184         (mono_type_get_object): Use it.
12185         * icall.c (ves_icall_MonoType_GetGenericArguments): Remove checks
12186         that are now in mono_type_get_object.
12187         (ves_icall_MonoMethod_GetGenericArguments): Likewise.
12188
12189 2006-02-19  Raja R Harinath  <harinath@gmail.com>
12190
12191         * metadata.c (mono_type_create_from_typespec): Rename from
12192         mono_type_create_from_typespec_full.  Remove MonoGenericContainer*
12193         argument and caching of types in the generic container.
12194         (unwrap_arrays, find_generic_param): Remove.
12195         * metadata-internals.h: Update.
12196         * class-internals.h (_MonoGenericContainer): Remove 'types' field.
12197
12198 2006-02-18  Zoltan Varga  <vargaz@gmail.com>
12199
12200         * class.c (mono_class_get_exception_for_failure): Fix a warning.
12201
12202         * marshal.c (mono_marshal_emit_native_wrapper): Handle FNPTR args and
12203         return values. Fixes #77581.
12204
12205         * class.c (mono_fnptr_class_get): Switch name and name_space.
12206
12207         * marshal.c (mono_marshal_asany): Fix marshalling of blittable formatted
12208         classes and add support for [In, Out] attributes.
12209         (mono_marshal_free_asany): Ditto. Fixes #77524.
12210
12211 2006-02-18  Raja R Harinath  <harinath@gmail.com>
12212
12213         * class.c (mono_class_from_generic_parameter): Make more robust to
12214         incomplete MonoGenericContainers from monodis.
12215
12216 Fri Feb 17 16:10:34 CET 2006 Paolo Molaro <lupus@ximian.com>
12217
12218         * class-internals.h: added some more exception types.
12219         * class.c, metadata.c: added a few checks to handle missing
12220         types.
12221
12222 2006-02-17  Raja R Harinath  <rharinath@novell.com>
12223
12224         Use owner-less generic-params some more.
12225         * class.c (my_mono_class_from_generic_parameter): Remove.
12226         (mono_class_from_generic_parameter): Handle null image,
12227         param->name and param->owner.
12228         (mono_class_from_mono_type): Update.
12229         (mono_class_create_from_typespec): Remove 'container' parameter.
12230         If that parameter is non-null, the result is always inflated by
12231         'mono_class_get_full' anyway.
12232         (mono_class_get): Rename from _mono_class_get.  Remove 'container'
12233         parameter.
12234         (mono_class_get_full): Update.
12235
12236         * class.c (inflate_generic_type) [GENERICINST]: If the generic
12237         instance is not open, don't bother inflating.
12238         (mono_class_setup_fields): Hoist some loop-invariants.  Don't
12239         parse metadata for inflated classes.
12240         (_mono_class_get): Change GenericContext* parameter to
12241         GenericContainer*.
12242         (mono_class_create_from_typespec): Likewise.  Simplify, and
12243         implement trivially.  All the cases are handled in
12244         mono_class_from_mono_type.  Don't inflate returned class.
12245         (mono_class_get_full): Delegate GENERICINST optimization to
12246         inflate_generic_type.
12247         (mono_ldtoken) [TOKEN_TYPE_SPEC]: Use mono_class_get_full() here too.
12248
12249 2006-02-16  Dick Porter  <dick@ximian.com>
12250
12251         * socket-io.c (create_object_from_sockaddr): Fix typo.
12252         (create_sockaddr_from_object): Check array lengths before
12253         potentially accessing items off the end.
12254         (ves_icall_System_Net_Sockets_Socket_Receive_internal)
12255         (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal)
12256         (ves_icall_System_Net_Sockets_Socket_Send_internal)
12257         (ves_icall_System_Net_Sockets_Socket_SendTo_internal): Fix buffer
12258         length checks to avoid wraparound overflows.
12259         (ves_icall_System_Net_Sockets_Socket_Select_internal): Check the
12260         contents of the array of sockets
12261         (hostent_to_IPHostEntry2)
12262         (addrinfo_to_IPHostEntry): IPv6 printed addresses can be 48 bytes.
12263         Check return value of inet_ntop ().
12264         (addrinfo_to_IPHostEntry): Fix typo
12265
12266 2006-02-16  Raja R Harinath  <rharinath@novell.com>
12267
12268         Type metadata parsing doesn't use generic-instantiation information.
12269         * metadata.c (mono_metadata_parse_array_full): Change
12270         MonoGenericContext* parameter to MonoGenericContainer*.
12271         (mono_metadata_parse_type_full): Likewise.
12272         (mono_type_create_from_typespec_full): Likewise.
12273         (mono_metadata_parse_mh_full): Likewise.
12274         (mono_metadata_parse_generic_inst): Likewise.
12275         (do_mono_metadata_parse_generic_class): Likewise.
12276         (do_mono_metadata_parse_type): Likewise.
12277         * metadata-internals.h: Update to changes.
12278         * class.c (mono_class_find_enum_basetype): Likewise.
12279         (mono_class_setup_fields): Likewise.
12280         (mono_class_create_from_typespec): Likewise.
12281         * loader.c (method_from_methodspec): Likewise.
12282         (mono_get_method_from_token): Likewise.
12283         (mono_method_get_header): Likewise.
12284
12285 Thu Feb 16 15:42:13 CET 2006 Paolo Molaro <lupus@ximian.com>
12286
12287         * marshal.c: handle additional GENERICINST case (patch from
12288         Thong Nguyen <tum@veridicus.com>).
12289         Fix a few cases where LDIND_I/STIND_I was used for references.
12290
12291 2006-02-16  Raja R Harinath  <rharinath@novell.com>
12292
12293         * reflection.c (mono_reflection_get_token): Remove unused variable.
12294
12295 2006-02-16  Martin Baulig  <martin@ximian.com>
12296
12297         * reflection.c (mono_reflection_get_token): Add support for fields
12298         in instantiated generic types.
12299
12300         * icall.c
12301         (ves_icall_MonoField_Mono_GetGenericFieldDefinition): Removed.
12302
12303 2006-02-15  Martin Baulig  <martin@ximian.com>
12304
12305         * icall.c
12306         (ves_icall_MonoMethod_get_HasGenericParameters): Removed.
12307         (ves_icall_MonoMethod_get_Mono_IsInflatedMethod): Removed.
12308         (ves_icall_MonoMethod_get_IsGenericMethod): New icall.
12309         (ves_icall_MonoMethod_get_IsGenericMethodDefinition): New icall.
12310
12311 Wed Feb 15 16:19:24 CET 2006 Paolo Molaro <lupus@ximian.com>
12312
12313         * class.c, metadata.c, metadata.h, object.c, icall.c,
12314         marshal.c: changed mono_type_get_underlying_type () to do
12315         the sensible thing and introduced mono_type_generic_inst_is_valuetype().
12316         Fixed handling of instantiated generic valuetypes (bug #75479).
12317
12318 2006-02-15  Raja R Harinath  <rharinath@novell.com>
12319
12320         * metadata.c (mono_metadata_decode_signed_value): Simplify.
12321         Delegate to mono_metadata_decode_value, and work on the returned value.
12322
12323         * icall.c (ves_icall_MonoType_GetGenericArguments):
12324         Add consistency check here too.
12325         
12326 2006-02-15  Ankit Jain  <jankit@novell.com>
12327
12328         * metadata.c (mono_metadata_decode_signed_value): Use gint* instead of
12329         char/short etc.
12330
12331 2006-02-15  Ankit Jain  <jankit@novell.com>
12332
12333         * metadata.c (mono_metadata_decode_signed_value): New function to decode
12334         signed values, used only for representing lower bounds of arrays.
12335         (mono_metadata_parse_array_full): Use new
12336         mono_metadata_decode_signed_value to decode lower bounds.
12337
12338 2006-02-14  Martin Baulig  <martin@ximian.com>
12339
12340         * reflection.c
12341         (mono_reflection_get_token): Support "MonoGenericMethod" and
12342         "MonoGenericCMethod" and allow generic instances / methods.
12343
12344 2006-02-11  Zoltan Varga  <vargaz@gmail.com>
12345
12346         * console-io.c (ves_icall_System_ConsoleDriver_GetTtySize): New icall
12347         to obtain the terminal size using an ioctl.
12348
12349         * object.c (mono_nullable_init): Revert this as nullable reference
12350         types are not valid.
12351         (mono_nullable_box): Ditto.
12352
12353 2006-02-09  Dick Porter  <dick@ximian.com>
12354
12355         * threads.c (mono_thread_detach): Drop a reference to the thread
12356         we're detaching.
12357
12358 2006-02-09  Zoltan Varga  <vargaz@gmail.com>
12359
12360         * object.c (mono_nullable_init): Handle nullable reference types.
12361         (mono_nullable_box): Ditto. Fixes #77446.
12362
12363 2006-02-07  Martin Baulig  <martin@ximian.com>
12364
12365         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition): Removed.
12366
12367 2006-02-07  Ankit Jain  <jankit@novell.com>
12368
12369         * socket-io.h (MonoSocketFlags): New. Copy of System.Net.Sockets.SocketFlags
12370         * socket-io.c (convert_socketflags): New. Convert SocketFlags to native ones.
12371         (ves_icall_System_Net_Sockets_Socket_Receive_internal): Convert flags using convert_socketflags.
12372         (ves_icall_System_Net_Sockets_Socket_ReceiveFrom_internal): Likewise.
12373         (ves_icall_System_Net_Sockets_Socket_Send_internal): Likewise.
12374         (ves_icall_System_Net_Sockets_Socket_SendTo_internal): Likewise.
12375
12376 2006-02-02  Zoltan Varga  <vargaz@gmail.com>
12377
12378         * class.c (mono_class_create_generic): Set type_token as well.
12379
12380         * object.c (mono_runtime_invoke_array): Fix handling of byref vtypes to be
12381         compatible with MS.
12382
12383 2006-02-02  Martin Baulig  <martin@ximian.com>
12384
12385         * threads.c, gc.c: Removed the `WITH_INCLUDED_LIBGC' section; it
12386         has never been used so far.
12387
12388 2006-02-02  Martin Baulig  <martin@ximian.com>
12389
12390         * mono-debug-debugger.h: Changed comment at the top of this file;
12391         the header is not installed, but it's safe to #include it from
12392         within the JIT.
12393
12394         * mono-debug.c: Don't #define _IN_THE_MONO_DEBUGGER.
12395         * mono-debug-debugger.c, debug-mono-symfile.c: Likewise.
12396
12397 2006-02-02  Martin Baulig  <martin@ximian.com>
12398
12399         * mono-debug.h
12400         (MonoSymbolTable): Removed the `metadata_info' field.
12401
12402         * mono-debug.c
12403         (mono_debug_init_1): Always set `mono_symbol_table->corlib'.
12404
12405         * mono-debug-debugger.h (MonoDebuggerIOLayer): Removed.
12406         (mono_debugger_add_builtin_types): Removed.
12407         (MonoDebuggerInfo): Moved into ../mini/debug-debugger.h.
12408         (mono_debugger_create_notification_function): We now operate on a
12409         pre-allocated area; take a `gpointer' and return `void'.
12410
12411         * mono-debug-debugger.c
12412         (MonoDebuggerMetadataInfo): Moved into ../mini/debug-debugger.h.
12413         (mono_debugger_add_builtin_types): Removed.
12414
12415 2006-02-02  Martin Baulig  <martin@ximian.com>
12416
12417         * threads.c (mono_debugger_create_all_threads): New public method.
12418
12419 Wed Feb 1 18:22:34 CET 2006 Paolo Molaro <lupus@ximian.com>
12420
12421         * gc-internal.h, boehm-gc.c, null-gc.c: back out the patch, since it
12422         breaks on several platforms.
12423
12424 2006-02-01  Sebastien Pouliot  <sebastien@ximian.com>
12425
12426         * assembly.c: the VS.NET build doesn't supply default values for
12427         MONO_ASSEMBLIES and MONO_CFG_DIR.
12428
12429 2006-02-01  Zoltan Varga  <vargaz@gmail.com>
12430
12431         * gc-internal.h boehm-gc.c null-gc.c (mono_gc_unregister_thread): New
12432         helper function.
12433
12434         * threads.c (mono_thread_detach): Call mono_gc_unregister_thread ().
12435
12436         * loader.c (method_from_memberref): Fix a warning.
12437
12438         * metadata.c (mono_metadata_load_generic_params): Fix a warning.
12439
12440         * marshal.c (emit_struct_conv): Fix marshalling of embedded structs
12441         with explicit layout. Fixes #77433.
12442
12443 2006-01-31  Zoltan Varga  <vargaz@gmail.com>
12444
12445         * icall.c (ves_icall_Type_GetInterfaceMapData): Make sure 
12446         max_interface_id is initialized before using it. Fixes #77398.
12447         (ves_icall_Type_GetInterfaces): Ditto.
12448
12449 2006-01-30  Raja R Harinath  <rharinath@novell.com>
12450
12451         * metadata.c (mono_metadata_parse_method_signature_full): Don't
12452         allocate memory for parameter attributes when parsing memberref
12453         signatures.
12454         * loader.c (mono_loader_set_error_method_load): Don't warn.
12455         (method_from_memberref): Ensure MissingMethodException gets thrown
12456         if method is not found.  Make warning more informative.
12457
12458 2006-01-29  Raja R Harinath  <harinath@gmail.com>
12459
12460         Fix #77397
12461         * icall.c (ves_icall_MonoType_get_IsGenericParameter): Don't
12462         return true if is byref.
12463         (ves_icall_TypeBuilder_get_IsGenericParameter): Likewise.
12464         (ves_icall_MonoType_get_DeclaringType): Return NULL on byref classes.
12465         (ves_icall_MonoType_get_DeclaringMethod): Likewise.
12466
12467 2006-01-27  Raja R Harinath  <rharinath@novell.com>
12468
12469         Fix tests/find-method.2.il
12470         * loader.c (find_method, find_method_in_class): Remove is_inflated
12471         argument.  Revert 2006-01-18 change.
12472         (method_from_memberref) [MONO_MEMBERREF_PARENT_TYPESPEC]: If type
12473         is generic, search for method in its generic definition.
12474         * class.c (mono_class_setup_vtable_general): Print generic
12475         arguments of generic types in debugging printf.
12476
12477 2006-01-26  Zoltan Varga  <vargaz@gmail.com>
12478
12479         * object-internals.h (MonoThread): Add 'thread_dump_requested' field.
12480
12481         * threads.c (mono_threads_request_thread_dump): New helper function.
12482
12483 2006-01-25  Raja R Harinath  <rharinath@novell.com>
12484
12485         * metadata.c (mono_type_create_from_typespec_full): Fix caching of types.
12486
12487 2006-01-25  Ankit Jain  <jankit@novell.com>
12488
12489         * metadata-internals.h (mono_generic_params_with_ambiguous_names): Add declaration and
12490         move definition to ..
12491         * metadata.c (mono_generic_params_with_ambiguous_names): .. here.
12492         
12493 2006-01-25  Ankit Jain  <jankit@novell.com>
12494             Raja R Harinath  <rharinath@novell.com>
12495
12496         * metadata-internals.h (mono_generic_params_with_ambiguous_names): New.
12497         * metadata.c (mono_metadata_load_generic_params): Fill mono_generic_params_with_ambiguous_names
12498         as necessary.
12499
12500 2006-01-25  Martin Baulig  <martin@ximian.com>
12501
12502         * mono-debug-debugger.h: Moved `MonoDebuggerManager' and
12503         `MonoDebuggerThread' into debug-debugger.c.
12504
12505 Tue Jan 24 18:53:35 CET 2006 Paolo Molaro <lupus@ximian.com>
12506
12507         * profiler.c: fix printing of data.
12508
12509 2006-01-24  Atsushi Enomoto  <atsushi@ximian.com>
12510
12511         * object.c, marshal.c : Fixed runtime part of bug #77315. Reject
12512           invalid surrogate in UTF7/UTF8 bytes and don't return NULL.
12513
12514 Tue Jan 24 09:56:16 CET 2006 Paolo Molaro <lupus@ximian.com>
12515
12516         * object.c: fix deadlock related to string interning.
12517
12518 2006-01-23  Martin Baulig  <martin@ximian.com>
12519
12520         * mono-debug-debugger.h (MonoDebuggerIOLayer): Removed.
12521
12522         * mono-debug-debugger.c (mono_debugger_io_layer): Removed.
12523
12524 2006-01-23  Martin Baulig  <martin@ximian.com>
12525
12526         * mono-debug.h: Moved the prototypes of some functions which are
12527         used by the JIT here from mono-debug-debugger.h.
12528
12529 2006-01-21  Martin Baulig  <martin@ximian.com>
12530
12531         * Makefile.am: Don't install mono-debug-debugger.h.
12532
12533 2006-01-21  Martin Baulig  <martin@ximian.com>
12534
12535         * mono-debug-debugger.h: Enforce the private status of this header
12536         file and removed unneccessary #include's in metadata/*.c and mini/*.c.
12537         Moved some stuff from mono-debugger-jit-wrapper.h here.
12538
12539 2006-01-20  Raja R Harinath  <rharinath@novell.com>
12540
12541         * class.c (mono_class_from_typeref): Add a sanity test to help
12542         catch lack of assembly load/search hooks.
12543
12544 2006-01-19  Zoltan Varga  <vargaz@gmail.com>
12545
12546         * marshal.c (emit_struct_conv): Relax the fields with same offset
12547         check even more. Fixes #77230.
12548
12549 2006-01-18  Martin Baulig  <martin@ximian.com>
12550
12551         * loader.c (find_method_in_class): Added `gboolean is_inflated'
12552         argument; if false, we compare the uninstantiated signatures.
12553         (method_from_memberref): Compare the uninstantiated signatures;
12554         fixes #76417.
12555
12556 2006-01-18  Robert Jordan  <robertj@gmx.net>
12557
12558         * boehm-gc.c, null-gc.c (mono_gc_weak_link_remove):
12559         Clear the weak link. Fixes bug #77170.
12560
12561         * gc.c (mono_gchandle_free):
12562         Reflect *-gc.c changes (tiny optimization).
12563
12564 2006-01-18  Zoltan Varga  <vargaz@gmail.com>
12565
12566         * metadata.c (mono_metadata_signature_dup): Applied patch from
12567         Aras Pranckevicius (aras@otee.dk). Fix crash when compiled with MSVC.
12568         Fixes #77288.
12569
12570 2006-01-17  Zoltan Varga  <vargaz@gmail.com>
12571
12572         * marshal.c (emit_struct_conv): Allow fields with the same offset when
12573         marshalling from native to managed code. Fixes #77230.
12574
12575 2006-01-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12576
12577         * threadpool.c: fix problem (Mac only) when more than one asynchronous
12578         connect. Fixes bug #77020.
12579
12580 Mon Jan 16 19:20:43 CET 2006 Paolo Molaro <lupus@ximian.com>
12581
12582         * class.c: fixed id assignement for nested interfaces (bug #77275).
12583         Added also better info for --print-vtable debugging.
12584
12585 2006-01-12  Martin Baulig  <martin@ximian.com>
12586
12587         * icall.c (ves_icall_MonoGenericClass_GetInterfaces): Inflate the
12588         interfaces on-the-fly; fixes #76625.
12589
12590         * class-internals.h
12591         (MonoDynamicGenericClass): Removed `ifaces' and `count_ifaces'; we
12592         don't need that anymore.
12593
12594 2006-01-12  Miguel de Icaza  <miguel@novell.com>
12595
12596         * socket-io.c
12597         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
12598         To avoid initing the nested_classes when not needed I turned the
12599         PeerCredData as a toplevel internal class, as it has to be shared
12600         anyways. 
12601
12602         Fixes the CASA issue.
12603
12604 2006-01-11  Ben Maurer  <bmaurer@andrew.cmu.edu>
12605
12606         * domain.c: Accessors for MonoJitInfo
12607
12608         * profiler-private.h: Add jitinfo to the end jit hook
12609
12610         * profiler.[ch]: Define new hooks, called after jitting which give
12611         the MonoJitInfo that was compiled
12612
12613 2006-01-10  Martin Baulig  <martin@ximian.com>
12614
12615         * class.c (mono_class_setup_events): Add support for generic
12616         classes; fixes #76440.
12617
12618 2006-01-06  Raja R Harinath  <rharinath@novell.com>
12619
12620         Fix #77160.
12621         * icall.c (ves_icall_InternalInvoke): Use mono_get_inflated_method
12622         on passed-in method.
12623
12624 2006-01-03  Zoltan Varga  <vargaz@gmail.com>
12625
12626         * object.c (mono_runtime_invoke_array): Add Nullable support.
12627
12628         * icall.c (ves_icall_System_Activator_CreateInstanceInternal): Ditto.
12629
12630 2006-01-03  Sebastien Pouliot  <sebastien@ximian.com>
12631
12632         * file-io.c: Don't consider sockets as directory and avoid an endless
12633         loop. Fix bug #76966.
12634
12635 2006-01-03  Zoltan Varga  <vargaz@gmail.com>
12636
12637         * object.c (mono_nullable_init): New helper function.
12638         (mono_nullable_box): Ditto.
12639
12640         * marshal.c (mono_marshal_get_runtime_invoke): Handle Nullables.
12641
12642         * icall.c (ves_icall_FieldInfo_SetValueInternal): Handle Nullables.
12643
12644         * icall.c (ves_icall_MonoField_GetValueInternal): Handle Nullables.
12645         
12646 2006-01-02  Zoltan Varga  <vargaz@gmail.com>
12647
12648         * class.c (mono_class_is_assignable_from): Make T assignable to 
12649         Nullable<T>.
12650
12651 2005-12-23  Sebastien Pouliot  <sebastien@ximian.com>
12652
12653         * appdomain.c: Bump corlib version to 46.
12654         * icalls.c: Renamed CurrentTimeZone to CurrentSystemTimeZone (for
12655         serialization purpose) and changed ves_icall_System_Reflection_
12656         Assembly_get_code_base signature to accept a boolean (to escape, or 
12657         not, the assembly code base).
12658
12659 2005-12-23  Dick Porter  <dick@ximian.com>
12660
12661         * icall.c: 
12662         * threads-types.h: 
12663         * threads.c: Added OpenMutex, OpenSemaphore and OpenEvent icalls.
12664         CreateEvent icall now returns "created" boolean parameter.
12665
12666 2005-12-22  Zoltan Varga  <vargaz@gmail.com>
12667
12668         * marshal.c (mono_mb_emit_restore_result): Add generics support. Fixes
12669         #76967.
12670
12671         * reflection.c (mono_custom_attrs_construct_by_type): Handle the case 
12672         when attr_klass is an interface. Fixes #77045.
12673
12674 2005-12-20  Zoltan Varga  <vargaz@gmail.com>
12675
12676         * marshal.c (emit_struct_conv): Fix previous patch.
12677         
12678         * marshal.c (emit_struct_conv): Add a check for fields with the same
12679         offset.
12680
12681 2005-12-20  Raja R Harinath  <rharinath@novell.com>
12682
12683         Fix regression in Mono.C5.
12684         * class.c (mono_class_create_generic): If 'klass' is an interface
12685         set up the interface offsets.
12686         (mono_class_is_assignable_from): Don't throw away generic arguments.
12687
12688 2005-12-19  Raja R Harinath  <rharinath@novell.com>
12689
12690         * icall.c (ves_icall_System_MonoType_getFullName): Return NULL for
12691         type parameters.
12692
12693 2005-12-15  Raja R Harinath  <rharinath@novell.com>
12694
12695         * metadata.c (mono_metadata_parse_method_signature_full): Remove a
12696         dead store.
12697         (do_mono_metadata_parse_generic_class): Don't pass the current
12698         generic context when parsing the type being instantiated: it
12699         cannot use it, anyway.
12700
12701         * loader.c (method_from_memberref): Don't inflate a signature if
12702         it doesn't contain any type parameters.
12703
12704 2005-12-15  Zoltan Varga  <vargaz@gmail.com>
12705
12706         * class.c (mono_class_setup_vtable): Call mono_reflection_get_dynamic_overrides () to get the overrides in dynamic assemblies.
12707
12708 2005-12-14  Martin Baulig  <martin@ximian.com>
12709
12710         * class.c
12711         (mono_type_get_name_recurse): Don't return null for type
12712         parameters and open generic classes.
12713         (mono_class_setup_methods): Don't exclude generic instances.
12714         (mono_get_unique_iid): Use different IDs for different
12715         instantiations of the same generic type.
12716         (mono_class_setup_vtable): Only use setup_generic_vtable() for
12717         open generic instances; create a normal vtable for closed generic
12718         instances.
12719         (mono_class_setup_vtable_general): We're now also called for
12720         closed generic instances.
12721
12722         * reflection.c
12723         (mono_reflection_bind_generic_parameters): Correctly use
12724         mono_metadata_lookup_generic_inst() everywhere.
12725
12726 2005-12-14  Zoltan Varga  <vargaz@gmail.com>
12727
12728         * object.c (mono_class_create_runtime_vtable): Call 
12729         mono_class_setup_vtable ().
12730
12731         * reflection.c (mono_reflection_get_dynamic_overrides): New helper
12732         function.
12733         (ensure_runtime_vtable): Initialize the generic vtable lazily. Fixes
12734         #76959.
12735
12736         * loader.c (mono_loader_set_error_type_load): Print the type load
12737         warnings to the console so they are more visible to the user.
12738         (mono_loader_set_error_method_load): Ditto.
12739
12740         * reflection.c (ensure_runtime_vtable): Revert the last change as it
12741         is still broken.
12742         
12743         * reflection.c (ensure_runtime_vtable): Fix build.
12744
12745         * reflection.c (ensure_runtime_vtable): Disable an optimization which
12746         doesn't work in all cases.
12747
12748 2005-12-13  Zoltan Varga  <vargaz@gmail.com>
12749
12750         * object.c (mono_array_new_full): Treat a single dimensional array
12751         with 0 lower bounds as an szarray. Fixes #76973.
12752
12753         * reflection.c (custom_attr_visible): Really fix this.
12754
12755 2005-12-12  Zoltan Varga  <vargaz@gmail.com>
12756
12757         * reflection.c (custom_attr_visible): Allow nested public attributes
12758         as well.
12759
12760         * class.c (mono_class_setup_vtable_general): Add missing != -1 to an
12761         interface check.
12762
12763 2005-12-12  Raja R Harinath  <harinath@gmail.com>
12764
12765         * class.c (set_generic_param_owner): Delete.
12766         (mono_class_create_from_typedef): Don't set ->owner field of
12767         generic parameters to "param containers" of enclosing classes.
12768         * reflection.c (mono_reflection_initialize_generic_parameter):
12769         Likewise.
12770
12771 2005-12-11  Zoltan Varga  <vargaz@gmail.com>
12772
12773         * reflection.c (custom_attr_visible): Fix build.
12774
12775 2005-12-10  Zoltan Varga  <vargaz@gmail.com>
12776
12777         * reflection.c (mono_custom_attrs_from_builders): Avoid returning
12778         private attributes.
12779         
12780         * reflection.c (reflection_methodbuilder_to_mono_method): Fix
12781         handling of null parameter defaults.
12782
12783 2005-12-09  Raja R Harinath  <rharinath@novell.com>
12784
12785         * class.c (mono_class_from_generic_parameter): Don't set
12786         klass->generic_container.
12787         (my_mono_class_from_generic_parameter): Likewise.
12788
12789 2005-12-07  Zoltan Varga  <vargaz@gmail.com>
12790
12791         * reflection.c (load_public_key): Fix a warning.
12792         (method_encode_code): Fix unaligned accesses.
12793
12794 2005-12-07  Martin Baulig  <martin@ximian.com>
12795
12796         * object-internals.h (MonoReflectionGenericParam): Added `cattrs'.
12797
12798         * reflection.c
12799         (write_generic_param_entry): Encode our custom attrs.
12800
12801         * appdomain.c (MONO_CORLIB_VERSION): Bump to 45.
12802
12803 2005-12-07  Martin Baulig  <martin@ximian.com>
12804
12805         * reflection.c (encode_new_constraint): Removed; we don't use the
12806         `NewConstraintAttribute' anymore.
12807
12808 2005-12-06  Zoltan Varga  <vargaz@gmail.com>
12809
12810         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Do
12811         not fire a TypeResolve event when Assembly.GetType () is called.
12812
12813 2005-12-05  Ben Maurer  <bmaurer@ximian.com>
12814
12815         Beginning of support for nullable types in the runtime. Parts of
12816         this patch are from Martin.
12817
12818         * appdomain.c (MONO_CORLIB_VERSION): Bump
12819
12820         * domain.c (mono_init_internal): get the nullable type
12821
12822         * class.c (mono_class_is_nullable): New method
12823         (mono_class_get_nullable_param): New mehod
12824         (mono_class_create_generic): In types T? set cast_class to T
12825
12826         * class-internals.h (MonoDefaults): new nullable default class
12827         (mono_class_get_nullable_param, mono_class_get_nullable_param):
12828         new methods.
12829
12830 2005-12-05  Raja R Harinath  <rharinath@novell.com>
12831
12832         * metadata.c (select_container): New.  Refactor code to select the
12833         appropriate GenericContainer given the type of generic parameter
12834         we are looking for.
12835         (mono_metadata_parse_generic_param): Take a MonoGenericContainer,
12836         not a MonoGenericContext.  Use select_container.  Update parameters.
12837         (do_mono_metadata_parse_type): Combine the code for MONO_TYPE_VAR
12838         and MONO_TYPE_MVAR.
12839         (unwrap_arrays): Remove duplicate tests.
12840         (find_generic_param): Rename from 'has_same_context'.  Now walks a
12841         generic instantiated class to find any arguments that are generic
12842         parameters.
12843         (mono_type_create_from_typespec_full): Use find_generic_param to
12844         avoid evicting some generic instantiations from the typespec
12845         cache.
12846
12847 Mon Dec 5 15:07:42 GMT 2005 Paolo Molaro <lupus@ximian.com>
12848
12849         * reflection.c: fixed writing of doubles on ARM FPA.
12850
12851 2005-12-02  Robert Jordan  <robertj@gmx.net>
12852
12853         * icall.c: Fixed EventInfo.ReflectedType (#76829).
12854
12855 2005-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12856
12857         * filewatcher.c: try loading libgamin-1.so.0 before libfam, since at
12858         least on SUSE 10 they are not the same (on debian, they are just the
12859         same thing).
12860
12861 2005-12-01  Raja R Harinath  <rharinath@novell.com>
12862
12863         * icall.c (ves_icall_MonoType_get_DeclaringType): Implement
12864         DeclaringType for VARs and MVARs.
12865         * class.c (set_generic_param_owner): Fix initialization of owner
12866         fields.
12867
12868 Wed Nov 30 15:48:22 CET 2005 Paolo Molaro <lupus@ximian.com>
12869
12870         * icall.c: fixed Enum.ToObject() to correctly convert the values.
12871
12872 2005-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12873
12874         * threadpool.c: workaround for a bug that shows up on the Mac:
12875         select()+connect() on a blocking socket is not like it should
12876         be, so we proceed to connect() in that case, wasting the I/O
12877         threadpool thread until connect succeedes. Fixes bug #75436.
12878
12879 2005-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12880
12881         * threadpool.c: fix typo when setting file descriptor states.
12882
12883 2005-11-28  Raja R Harinath  <rharinath@novell.com>
12884
12885         * class-internals.h (MonoGenericContainer.is_signature): Remove.        
12886         * metadata.c (mono_metadata_parse_method_signature_full): Don't
12887         create a temporary signature container.
12888         (mono_metadata_parse_generic_param): Update to changes.
12889         (mono_type_create_from_typespec_full): Update to changes.
12890         * loader.c (method_from_memberref): Don't use a
12891         MonoGenericContainer while parsing a memberref signature.
12892         (method_from_methodspec): Remove dead-store of the 'container'
12893         variable.  It's overwritten before use.
12894
12895         * metadata.c (mono_type_create_from_typespec_full): Make debugging
12896         checks tighter.
12897         (mono_metadata_parse_generic_param): Likewise.
12898         * loader.c (find_method_in_class): Does not need a
12899         MonoGenericContainer.  Use 'mono_method_signature' rather than
12900         'mono_method_signature_full'.
12901         (find_method, mono_get_method_constrained, method_from_memberref):
12902         Update to changes.
12903
12904         * metadata.c (mono_type_create_from_typespec_full): Ensure that
12905         owner-less generic-parameters are never evicted from the typespec
12906         cache.
12907
12908         * loader.c (method_from_memberref): Don't use the current context
12909         when parsing signatures.
12910         (method_from_methodspec, mono_get_method_from_token): Update to changes.
12911
12912         * metadata.c (do_mono_metadata_parse_generic_class): Avoid
12913         side-effects in g_assert.
12914         * loader.c (mono_get_method_from_token): Resolve klass earlier so
12915         that we don't potentially lose information.
12916
12917 2005-11-26  Dick Porter  <dick@ximian.com>
12918
12919         * icall.c:
12920         * threads.c: icalls to implement basic (ie, not named)
12921         System.Threading.Semaphore.
12922
12923 2005-11-24  Dick Porter  <dick@ximian.com>
12924
12925         * process.c
12926         (ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal):
12927         Use GetProcessId() if it's available.
12928
12929 2005-11-23  Zoltan Varga  <vargaz@gmail.com>
12930
12931         * icall.c threads-types.h threads.c: Add Exchange<T> icall.
12932
12933 2005-11-23  Raja R Harinath  <rharinath@novell.com>
12934             Ankit Jain  <jankit@novell.com>
12935
12936         * loader.c (mono_get_method_from_token): Initialize 'method' field
12937         of all generic parameters before parsing the signature.  Remove
12938         code that "fixed"-up MVAR references.
12939
12940 2005-11-23  Ankit Jain  <jankit@novell.com>
12941
12942         * metadata.c (mono_metadata_has_generic_params):
12943         (mono_metadata_load_generic_param_constraints):
12944         (mono_metadata_load_generic_params): Move duplicate code ...
12945         (mono_metadata_get_generic_param_row): ... here. Returns the
12946         first row-id in GenericParam table for a given owner (token).
12947         * metadata-internals.h (mono_metadata_get_generic_param_row): Add
12948         prototype.
12949
12950 2005-11-23  Raja R Harinath  <rharinath@novell.com>
12951             Ankit Jain  <jankit@novell.com>
12952
12953         * metadata.c (mono_metadata_class_equal): Pass signature_only when
12954         comparing VARs too.
12955         * icall.c (ves_icall_MonoType_get_DeclaringMethod): Look at 
12956         type->data.generic_param only if the type is an MVAR.
12957         (ves_icall_MonoMethod_GetGenericArguments): Ensure that we don't
12958         leak owner-less VARs and MVARs into managed space.
12959
12960 2005-11-21  Martin Baulig  <martin@ximian.com>
12961
12962         * class-internals.h
12963         (MonoMethod): Moved the `generic_container' here from
12964         `MonoMethodNormal' since we now also need it for
12965         `MonoMethodPInvoke';
12966         (MonoMethodNormal): Moved the `generic_container' to `MonoMethod'.
12967         (MonoMethodInflated): Replaced the `MonoMethodNormal nmethod' with
12968         an union containing both `MonoMethodNormal' and
12969         `MonoMethodPInvoke'.
12970
12971         * loader.c
12972         (mono_get_method_from_token): Allow implementing generic methods
12973         as interncalls.
12974
12975         * threads.c
12976         (ves_icall_System_Threading_Interlocked_CompareExchange_T): New
12977         icall.
12978
12979 2005-11-17  Dick Porter  <dick@ximian.com>
12980
12981         * icall.c: 
12982         * process.h: 
12983         * process.c: Split the Process Start_internal icall into
12984         ShellExecuteEx_internal and CreateProcess_internal, which are
12985         called depending on whether UseShellExecute is true.  Fixes bug
12986         76670.
12987
12988         * appdomain.c (MONO_CORLIB_VERSION): Incremented
12989
12990 2005-11-17  Zoltan Varga  <vargaz@gmail.com>
12991
12992         * marshal.c (emit_ptr_to_object_conv): Get rid of the 'usize' and
12993         'msize' parameters, use the information in 'mspec' instead.
12994         (emit_object_to_ptr_conv): Ditto.
12995
12996         * marshal.c (emit_struct_conv): Handle explicit layout structs with
12997         fields out of order. Fixes #76733.
12998
12999 2005-11-17  Ankit Jain  <jankit@novell.com>
13000
13001         * metadata.c (mono_type_create_from_typespec_full): Remove unnecessary g_assert.
13002
13003 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
13004
13005         * icall.c : renamed MakeGenericMethod -> MakeGenericMethod_impl for
13006           bug #76575.
13007
13008 2005-11-16  Zoltan Varga  <vargaz@gmail.com>
13009
13010         * object.c (mono_class_compute_gc_descriptor): Disable typed allocation
13011         for types with non-auto layout. Fixes #76717.
13012
13013 2005-11-16  Ankit Jain  <jankit@novell.com>
13014
13015         * class.c (my_mono_class_from_generic_parameter): param->owner can be null.
13016         * metadata.c (mono_metadata_parse_generic_param): Create a dummy MonoGenericParam 
13017         if generic_context is null.
13018           (mono_metadata_generic_param_equal): param->owner can be null.
13019           (mono_type_create_from_typespec_full): Don't cache the MonoType if param->owner is
13020         null.
13021
13022 2005-11-16  Zoltan Varga  <vargaz@gmail.com>
13023
13024         * reflection.c (create_dynamic_mono_image): Set md_version_minor to
13025         the correct value.
13026
13027 2005-11-15  Martin Baulig  <martin@ximian.com>
13028
13029         * object.c (set_value): Use mono_class_from_mono_type() instead of
13030         the hack for generic instances; fixes #76136.
13031
13032 2005-11-15  Zoltan Varga  <vargaz@gmail.com>
13033
13034         * metadata-internals.h (_MonoImage): Add 'md_version_major/minor'
13035         fields.
13036
13037         * image.c (load_metadata_ptrs): Initialize the new fields.
13038
13039         * reflection.c (create_dynamic_mono_image): Ditto.
13040
13041         * reflection.c (build_compressed_metadata): Use the new fields.
13042
13043         * icall.c (ves_icall_System_Reflection_Module_get_MDStreamVersion): New
13044         icall.
13045
13046         * icall.c (mono_assembly_icalls): Remove obsolete get_MetadataToken
13047         icall.
13048         
13049 2005-11-15  Ankit Jain  <jankit@novell.com>
13050             Raja R Harinath  <harinath@gmail.com>
13051
13052         * class-internals.h (_MonoGenericContainer.types): New. Cache for MonoTypes.
13053         * metadata.c (mono_type_create_from_typespec_full): Use MonoType from the
13054         new per-generic_container cache if the cached MonoType's context matches
13055         the current context.
13056           (has_same_context): New. Check if the VARs or MVARs in a GENERIC_INST refer
13057         to the expected context.
13058           (unwrap_arrays): New. Get the element MonoType for an ARRAY/SZARRAY.
13059
13060 2005-11-14  Carlos Alberto Cortez <calberto.cortez@gmail.com>
13061
13062         * appdomain.c: Update MONO_CORLIB_VERSION to 42, since
13063         we changed the signature of an icall.
13064         * icall.c: Modify to mono_double_ParseImpl return true/false 
13065         depending on the success, instead of throwing the exception. This will
13066         help us in Double.TryParse methods.
13067         
13068 2005-11-14  Zoltan Varga  <vargaz@gmail.com>
13069
13070         * marshal.c (emit_marshal_object): Throw an exception when
13071         marshalling 'object' instead of crashing. Fixes #76696.
13072
13073 2005-11-11  Zoltan Varga  <vargaz@gmail.com>
13074
13075         * class-internals.h: Add prototype for mono_type_get_full_name ().
13076
13077 2005-11-11  Dick Porter  <dick@ximian.com>
13078
13079         * threads.c (mono_thread_manage): Make sure the main thread has
13080         abandoned all its mutexes when cleaning up.  Fixes bug 74680.
13081
13082 2005-11-11  Zoltan Varga  <vargaz@gmail.com>
13083
13084         * loader.c (mono_loader_set_error_type_load): Log a warning to the
13085         console about the missing type.
13086         (mono_loader_set_error_method_load): Ditto.
13087
13088 2005-11-09  Miguel de Icaza  <miguel@novell.com>
13089
13090         * mono-config.c (mono_get_config_dir): Set the system defaults if
13091         none is specified.
13092
13093         * assembly.c (mono_set_dirs): New API entry point to set the
13094         assembly and the config directory in one call
13095
13096 2005-11-09  Zoltan Varga  <vargaz@gmail.com>
13097
13098         * marshal.c (mono_ftnptr_to_delegate): Throw a NotSupportedException if
13099         the ftnptr was created from a delegate in a domain other than the
13100         current domain. Fixes #75377.
13101
13102         * exception.h exception.c: Add mono_get_exception_not_supported ().
13103
13104 2005-11-08  Martin Baulig  <martin@ximian.com>
13105
13106         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 53.
13107
13108 2005-11-07  Sebastien Pouliot  <sebastien@ximian.com>
13109
13110         * security-manager.h: Added definitions to deal with strongname key 
13111         pairs bigger (and smaller) than 1024 bits.
13112         * reflection.c: Remove hardcoded strongname size (128 bytes) and 
13113         adjust wrt the public key length being used.
13114
13115 2005-11-03  Atsushi Enomoto  <atsushi@ximian.com>
13116
13117         * marshal.c, icall.c : reverted sig->pinvoke changes which broke
13118           Windows build (r51396-51397).
13119
13120 2005-11-03  Martin Baulig  <martin@ximian.com>
13121
13122         * class.c (mono_class_setup_vtable_general): Also add generic
13123         methods to the vtable; fixes #76581.
13124
13125 2005-11-01  Miguel de Icaza  <miguel@novell.com>
13126
13127         * string-icalls.c (ves_icall_System_String_ctor_encoding): Make
13128         sure that we lookup GetString method from the System.Text.Encoding
13129         class, not the derived class or we get an empty method.
13130
13131         Fixed class #76612.
13132
13133 2005-10-25  Miguel de Icaza  <miguel@novell.com>
13134
13135         * assembly.c (mono_assemblies_init): Do not set the Mono root dir
13136         if it has been previously set (embedders). 
13137
13138         Make mono_set_rootdir available also on Unix.
13139
13140 005-10-24  Robert Jordan  <robertj@gmx.net>
13141
13142         * assembly.c: fixed MONO_ASSEMBLIES to be NULL on cygwin as well.
13143
13144 2005-10-30  Zoltan Varga  <vargaz@freemail.hu>
13145
13146         * marshal.c icall.c: Clean up the usage of sig->pinvoke flag. Now
13147         only calls which are made to native code use this flag.
13148
13149         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): Remove the check for FieldBuilders as it is now done in managed code.
13150
13151 2005-10-29  Zoltan Varga  <vargaz@freemail.hu>
13152
13153         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal):
13154         Add support for FieldBuilders.
13155
13156 2005-10-29  Martin Baulig  <martin@ximian.com>
13157
13158         * mono-debug.c
13159         (mono_debug_using_mono_debugger): New public method; returns
13160         whether we're running inside the debugger.
13161
13162 2005-10-27  Zoltan Varga  <vargaz@gmail.com>
13163
13164         * reflection.c (mono_reflection_get_custom_attrs_info): Add support
13165         for Method/Constructor/FieldBuilders.
13166
13167 2005-10-26  Zoltan Varga  <vargaz@gmail.com>
13168
13169         * reflection.c (module_add_cattrs): Save custom attributes for global methods
13170         and fields as well.
13171
13172 2005-10-26  Martin Baulig  <martin@ximian.com>
13173
13174         * mono-debug-debugger.c
13175         (MonoDebuggerMetadataInfo): Added `klass_parent_offset'.
13176
13177 2005-10-24  Raja R Harinath  <harinath@gmail.com>
13178
13179         * icall.c (base64_to_byte_array): Don't pass an out-of-range
13180         integer to isspace.
13181
13182 2005-10-21  Zoltan Varga  <vargaz@gmail.com>
13183
13184         * marshal.c (emit_marshal_vtype): Correctly handle [In,Out] modifiers
13185         when passing valuetypes byref. Fixes #76502.
13186
13187 2005-10-19  Jackson Harper  <jackson@ximian.com>
13188
13189         * profiler.c: Don't put a . in front of types that are not in a
13190         namespace.
13191
13192 2005-10-18  Zoltan Varga  <vargaz@gmail.com>
13193
13194         * icall.c (ves_icall_Type_GetField): Applied patch from Robert Jordan (robertj@gmx.net). Fixes #75515.
13195
13196 2005-10-15  Zoltan Varga  <vargaz@freemail.hu>
13197
13198         * marshal.c: Add generics support to the ldfld/stfld wrappers. Fixes
13199         #76436.
13200         (mono_marshal_get_ldflda_wrapper): Fix a warning.
13201
13202 2005-10-13  Carlos Alberto Cortez <calberto.cortez@gmail.com>
13203
13204         * assembly.c metadata-internals.h icall.c: Define an additional
13205         parameter for mono_assembly_name_parse_full, so we can avoid creating
13206         S.R.AssemblyName.Version when no version info wasn't passed.
13207         
13208 2005-10-09  Miguel de Icaza  <miguel@novell.com>
13209
13210         * class.c (mono_type_get_full_name): Reimplement method that was
13211         removed. 
13212
13213         * image.c: Some docs
13214
13215 2005-10-10  Zoltan Varga  <vargaz@gmail.com>
13216
13217         * profiler.c (output_newobj_profile): Fix printing of Total memory
13218         on x86.
13219
13220 2005-10-08  Zoltan Varga  <vargaz@freemail.hu>
13221
13222         * profiler.c: Add support for allocations > 2GB. Fixes #74886.
13223
13224 2005-10-08  Gert Driesen  <drieseng@users.sourceforge.net>
13225
13226         * threads.c: remove debug output.
13227
13228 2005-10-08  Zoltan Varga  <vargaz@freemail.hu>
13229
13230         * threads.c (mono_thread_manage): Fix crashes if more than 64
13231         threads need to be aborted. Hopefully fixes #75899.
13232
13233         * assembly.c (mono_stringify_assembly_name): New helper function.
13234
13235         * class.c: Use mono_stringify_assembly_name instead of the similar
13236         static function.
13237
13238         * assembly.h assembly.c: Add support for calling a postload search 
13239         hook if an assembly cannot be loaded.
13240
13241         * appdomain.c: Register new search hooks which call the AssemblyResolve
13242         events in AppDomain. Fixes #75231
13243
13244 2005-10-07  Martin Baulig  <martin@ximian.com>
13245
13246         * mono-debug.c (mono_debug_add_method): Create a wrapper entry for
13247         methods without debug info.
13248
13249 2005-10-07  Zoltan Varga  <vargaz@gmail.com>
13250
13251         * class-internals.h debug-helpers.c marshal.h marshal.c: Add ldflda
13252         wrappers.
13253
13254 2005-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13255
13256         * file-io.c: now that we return symlinks, use lstat and, when the file
13257         is a symbolic link, stat, to get the file attributes. Also avoid the
13258         conversion to/from utf16/external.
13259
13260 2005-10-06  Zoltan Varga  <vargaz@gmail.com>
13261
13262         * class.c (mono_class_layout_fields): Compute klass->has_references
13263         correctly if an embedded valuetype is not yet initialized. Fixes
13264         #76331.
13265
13266 2005-10-04  Martin Baulig  <martin@ximian.com>
13267
13268         * metadata.c
13269         (mono_metadata_load_generic_param_constraints): New public
13270         function; splitted the constraints loading out from
13271         mono_metadata_load_generic_params().
13272
13273         * class.c (mono_class_create_from_typedef): Call
13274         mono_metadata_load_generic_param_constraints() after setting up
13275         the type and creating our parent; fixes #75329.
13276
13277 2005-10-04  Martin Baulig  <martin@ximian.com>
13278
13279         * icall.c (ves_icall_MonoGenericClass_GetParentType): Allow
13280         non-dynamic parent classes.
13281
13282 2005-10-04  Atsushi Enomoto  <atsushi@ximian.com>
13283
13284         * file-io.c : win32 build fix (ETXTBSY seems not found).
13285
13286 2005-10-04  Martin Baulig  <martin@ximian.com>
13287
13288         * reflection.c
13289         (mono_image_get_methodspec_token): Make the cache actually work;
13290         fixes #75974.
13291
13292 2005-10-04  Martin Baulig  <martin@ximian.com>
13293
13294         * class.c (mono_class_name_from_token): Removed the unneccessary
13295         `MonoGenericContext *' argument.
13296
13297 2005-10-04  Martin Baulig  <martin@ximian.com>
13298
13299         * loader.c
13300         (method_from_methodspec): Make the caching work again; fixes the
13301         performance regression from #76262.
13302
13303 2005-10-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13304
13305         * file-io.c:
13306         * file-io.h:
13307         * icall.c: replace FindFirst/FindNext/FindClose calls with a new
13308         GetFileSystemEntries that performs the same work but without going
13309         into io-layer, locking, etc.
13310
13311 2005-09-30  Zoltan Varga  <vargaz@gmail.com>
13312
13313         * threads.c (ves_icall_System_Threading_Thread_Abort): Handle 
13314         ThreadState_Stopped as well. Fixes #76047.
13315
13316 2005-09-29  Martin Baulig  <martin@ximian.com>
13317
13318         * class.c
13319         (inflate_generic_context): If the new context has a `gmethod', set
13320         its `container' that that gmethod's `container'.
13321
13322         * metadata.c
13323         (mono_metadata_parse_generic_param): Simplify things;
13324         `generic_container = generic_context->container;' is just fine.
13325
13326         * loader.c (method_from_methodspec): Code cleanups.
13327
13328 Wed Sep 28 17:06:01 CEST 2005 Paolo Molaro <lupus@ximian.com>
13329
13330         * decimal.c: fix warning (and let gcc generate correct
13331         code on ARM with optimizations).
13332
13333 2005-09-28  Martin Baulig  <martin@ximian.com>
13334
13335         * loader.c
13336         (method_from_memberref): Added `MonoGenericContext *class_context'
13337         argument; this is used when parsing a MONO_MEMBERREF_PARENT_TYPESPEC.
13338         (method_from_methodspec): If we're a memberref, use the enclosing
13339         context when parsing its parent.  Fixes #76262; see gtest-206.cs.
13340
13341 2005-09-28  Martin Baulig  <martin@ximian.com>
13342
13343         * object.c (mono_runtime_invoke_array): Added support for
13344         MONO_TYPE_GENERICINST; fixes #75917.
13345
13346 2005-09-27  Martin Baulig  <martin@ximian.com>
13347
13348         * reflection.c (encode_type): For `MONO_TYPE_CLASS/VALUETYPE', use
13349         `k->byval_arg.type' to determine the actual type.
13350
13351         * loader.c (method_from_methodspec): Removed some hacks.
13352
13353 2005-09-27  Ben Maurer  <bmaurer@ximian.com>
13354
13355         * class-internals.h (mono_field_is_deleted): Do the test for
13356         rtspecialname before we check the actual name of the field. This
13357         prevents us from dereferencing a pointer into the string table,
13358         saving us from accessing a few pages
13359
13360         * *.c: Replace the use of {Enter,Leave}CriticalSection with
13361         macros. This will allow a deadlock debugger to easily be plugged
13362         in.
13363
13364 2005-09-27  Martin Baulig  <martin@ximian.com>
13365
13366         * loader.c (method_from_methodspec): Create a "signature"
13367         MonoGenericContainer and use mono_get_method_full().  Fixes #75584.
13368
13369 2005-09-27  Martin Baulig  <martin@ximian.com>
13370
13371         * class.c
13372         (inflate_generic_class): Correctly set the new context's
13373         container.
13374
13375         * loader.c
13376         (find_method, find_method_in_class): Take a `MonoGenericContainer *'
13377         instead of a `MonoGenericContext *'.
13378         (mono_method_signature_full): Take a `MonoGenericContainer *'
13379         instead of a `MonoGenericContext *'.
13380
13381         * metadata.c
13382         (mono_metadata_parse_signature_full): Take a `MonoGenericContainer *'
13383         instead of a `MonoGenericContext *'.
13384         (mono_metadata_parse_method_signature_full): Likewise.
13385
13386 2005-09-26  Martin Baulig  <martin@ximian.com>
13387
13388         * class.c
13389         (mono_class_from_generic_parameter): Set `klass->generic_container'
13390         (mono_class_from_generic_parameter): Likewise.
13391         (mono_bounded_array_class_get): We inherit the generic container
13392         from the element class.
13393
13394         * loader.c
13395         (find_method, find_method_in_class): Take a `MonoGenericContext *'
13396         argument rather than computing it here.
13397         (method_from_memberref): Correctly set the generic context before
13398         parsing the signature.  Fixes #75681.
13399
13400 2005-09-26  Zoltan Varga  <vargaz@gmail.com>
13401
13402         * object.c (mono_class_has_special_static_fields): Fix warnings.
13403
13404 2005-09-26  Carlos Alberto Cortez <calberto.cortez@gmail.com>
13405
13406         * assembly.c: Add parse_public_key function, to
13407         par the public keys. Also added mono_assembly_name_parse_full,
13408         to define it the parsed key should be freed or not.
13409         * icall.c: Added ves_icall_System_Reflection_AssemblyName_ParseName,
13410         to parse a long format assembly name.
13411         * metadata-internals.h: Keep mono_assembly_name_parse_full as
13412         private, since calling it to preserve the key requires
13413         freeing it manually.
13414         
13415 2005-09-26  Atsushi Enomoto  <atsushi@ximian.com>
13416
13417         * locales.c : removed HAVE_ICU part.
13418
13419 2005-09-24  Zoltan Varga  <vargaz@freemail.hu>
13420
13421         * object.c (mono_class_create_runtime_vtable): Avoid calling 
13422         field_is_special_static if the klass has no special static fields.
13423
13424         * class-internals.h (MonoClass): Add 'no_special_static_fields' flag.
13425         (MonoCachedClassInfo): Likewise.
13426
13427         * object.c (mono_class_has_special_static_fields): New helper function.
13428
13429 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
13430
13431         * class.c (mono_class_create_from_typedef): Don't call 
13432         interfaces_from_typedef_full for enums.
13433         (mono_class_create_from_typedef): Compute the base types of enums directly
13434         without calling mono_class_setup_fields ().
13435         (mono_class_find_enum_basetype): New helper function.
13436
13437         * reflection.c (mono_image_build_metadata): Emit type names+namespaces at
13438         one place inside the string heap.
13439         
13440 Fri Sep 23 19:37:46 CEST 2005 Paolo Molaro <lupus@ximian.com>
13441
13442         * class.c: locking fixes, code cleanups, some docs added.
13443         Allocate some data structures in the image mempool.
13444
13445 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
13446
13447         * rawbuffer.c: Remove unneccessary set_n_pagefaults () routine and update
13448         the example code.
13449         
13450 Fri Sep 23 18:27:02 CEST 2005 Paolo Molaro <lupus@ximian.com>
13451
13452         * class-internals.h, class.c, reflection.c: reduce memory taken by
13453         MonoClass.
13454
13455 Fri Sep 23 17:56:21 CEST 2005 Paolo Molaro <lupus@ximian.com>
13456
13457         * metadata.c, metadata.h, loader.h: documentation updates, code and
13458         API cleanups.
13459
13460 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
13461
13462         * rawbuffer.c: Remove unneccessary set_n_pagefaults () routine and update
13463         the example code.
13464
13465         * rawbuffer.h rawbuffer.c: Add code and APIs to help determine the number of
13466         page faults caused by the runtime while reading metadata.
13467
13468 2005-09-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13469
13470         * socket-io.c: the field names were changed 3 months ago and no one
13471         realized until bug #76077 got filed!
13472
13473 2005-09-20  Martin Baulig  <martin@ximian.com>
13474
13475         * icall.c (assembly_icalls): Removed some unused debugger icalls.
13476
13477 2005-09-20  Martin Baulig  <martin@ximian.com>
13478
13479         * mono-debug.c (mono_debug_add_type): Ignore array types and don't
13480         write the rank into the class entry.
13481
13482 2005-09-20  Martin Baulig  <martin@ximian.com>
13483
13484         * mono-debug-debugger.c (MonoDebuggerMetadataInfo): Added some stuff.
13485
13486 2005-09-19  Zoltan Varga  <vargaz@gmail.com>
13487
13488         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
13489
13490         * icall.c (custom_attrs_defined_internal): New icall.
13491
13492         * reflection.c (mono_reflection_get_custom_attrs_by_type): New helper
13493         function.
13494         (mono_custom_attrs_construct_by_type): New helper function.
13495
13496 2005-09-17  Zoltan Varga  <vargaz@freemail.hu>
13497
13498         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): Null
13499         terminate the resulting string. Fixes #76123.
13500
13501 2005-09-16  Martin Baulig  <martin@ximian.com>
13502
13503         * mono-debug.c
13504         (mono_debug_add_method): Ignore inflated methods for the moment.
13505
13506 2005-09-14  Martin Baulig  <martin@ximian.com>
13507
13508         * debug-mono-symfile.h (MONO_SYMBOL_FILE_VERSION): Bump version to 39.
13509
13510 2005-09-13  Zoltan Varga  <vargaz@gmail.com>
13511
13512         * metadata.c (mono_class_get_overrides_full): Modify signature to explicitly
13513         return a success/failure indication.
13514         (mono_metadata_interfaces_from_typedef_full): Ditto.
13515         (get_constraints): Ditto.
13516
13517 2005-09-12  Zoltan Varga  <vargaz@gmail.com>
13518
13519         * marshal.c (emit_marshal_array): Fix handling of null arrays.
13520         
13521         * marshal.c (emit_marshal_array): Add support for returning string
13522         arrays from delegates. Fixes #76063.
13523
13524         * marshal.c: Use the emit_ldloc/stloc macros where possible.
13525
13526 2005-09-11  Zoltan Varga  <vargaz@gmail.com>
13527
13528         * threads.c (ves_icall_System_Threading_Thread_MemoryBarrier): New
13529         icall.
13530
13531 2005-09-09  Zoltan Varga  <vargaz@gmail.com>
13532
13533         * reflection.c icall.c: Fix after mono_get_exception_type_load
13534         signature change.
13535
13536         * assembly.c (mono_assembly_get_assemblyref): New helper function.
13537         (mono_assembly_load_reference): Use the new helper.
13538
13539         * class-internals.h (MonoLoaderError): New structure containing 
13540         information about type loading errors.
13541
13542         * class-internals.h loader.c: Add APIs to store per-thread loader
13543         error information.
13544
13545         * loader.c class.c: Set the loader error if needed.
13546
13547         * exception.h exception.c: Add functions to throw MissingMethod/MissingFieldExceptions.
13548
13549 Thu Sep 8 18:54:07 BST 2005 Paolo Molaro <lupus@ximian.com>
13550
13551         * decimal.c: fixed to handle the broken ARM fp format.
13552
13553 Wed Sep 7 22:17:58 BST 2005 Paolo Molaro <lupus@ximian.com>
13554
13555         * icall.c: on ARM use the libc strtod(), since bsd_strtod() seems
13556         broken.
13557
13558 2005-09-06  Martin Baulig  <martin@ximian.com>
13559
13560         * domain.c (supported_runtimes): Added v2.0.50727.
13561
13562 Tue Sep 6 11:40:24 CEST 2005 Paolo Molaro <lupus@ximian.com>
13563
13564         * culture-info.h: reduce the size of some structures.
13565
13566 2005-09-05  Martin Baulig  <martin@ximian.com>
13567
13568         Reflect latest API changes in the August CTP.
13569
13570         * icall.c
13571         ("Type.BindGenericParameters"): Renamed to "MakeGenericType".
13572         ("MonoType.HasGenericArguments"): Removed.
13573         ("MonoMethod.BindGenericParameters"): Renamed to
13574         "MakeGenericMethod".
13575         ("MethodBuilder.BindGenericParameters"): Renamed to
13576         "MakeGenericMethod".    
13577
13578 2005-09-05  Martin Baulig  <martin@ximian.com>
13579
13580         * mono-debug-debugger.c: Moved the debugger icalls into icall.c.
13581
13582 2005-09-05  Martin Baulig  <martin@ximian.com>
13583
13584         Applying a patch from Michal Moskal <malekith@nemerle.org>.
13585
13586         * icall.c (ves_icall_Type_get_IsGenericType): Return true also if
13587         generic_container is non-NULL.
13588
13589 2005-09-05  Martin Baulig  <martin@ximian.com>
13590
13591         Applying a patch from Michal Moskal <malekith@nemerle.org>.
13592
13593         * object.c (set_value): In MONO_TYPE_VALUETYPE, add generics support.
13594
13595 2005-08-29  Michal Moskal  <malekith@nemerle.org>
13596
13597         * reflection.c (encode_locals,
13598         mono_reflection_sighelper_get_signature_local): Increase buffer sizes
13599         for large generic types.
13600
13601 2005-09-05  Martin Baulig  <martin@ximian.com>
13602
13603         Applying a patch from Michal Moskal <malekith@nemerle.org>.
13604
13605         * class.c (mono_dup_array_type): New public method.
13606         (mono_metadata_signature_deep_dup): New public method.
13607         (dup_type): Correctly duplicate array and function types.
13608
13609 2005-09-05  Martin Baulig  <martin@ximian.com>
13610
13611         Applying a patch from Michal Moskal <malekith@nemerle.org>.
13612
13613         * reflection.c (get_default_param_value_blobs): Handle generic types
13614         and generic methods.
13615
13616 2005-09-02  Sebastien Pouliot  <sebastien@ximian.com>
13617
13618         * class.c: Fixed error reporting (method/class were inversed) for 
13619         inheritance demands.
13620         * security-manager.c|h: Added the AppDomain when calling the managed
13621         System.Security.SecurityManager.InheritanceDemand method.
13622
13623 2005-09-01  Raja R Harinath  <rharinath@novell.com>
13624
13625         * reflection.c (encode_marshal_blob): 'marshaltype' and
13626         'marshaltyperef' are alternate sources for the custom marshaler
13627         name.
13628
13629 Wed Aug 31 17:39:54 CEST 2005 Paolo Molaro <lupus@ximian.com>
13630
13631         * class.c: fix creation of array classes with rank == 1
13632         (patch by Ankit Jain <jankit@novell.com>).
13633
13634 Wed Aug 31 17:35:19 CEST 2005 Paolo Molaro <lupus@ximian.com>
13635
13636         * object.c: fix check for creating the bound data for arrays vs
13637         szarrays.
13638
13639 2005-08-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13640
13641         * object.c: configuration file name is now based on the executable name,
13642         not the image name. Fixes bug #75931.
13643
13644 2005-08-29  Zoltan Varga  <vargaz@gmail.com>
13645
13646         * marshal.c (emit_thread_interrupt_checkpoint_call): Load the
13647         flag using LDIND_U4 since it leads to smaller and faster code on ia64.
13648
13649 2005-08-25  Zoltan Varga  <vargaz@gmail.com>
13650
13651         * rand.c: Use wincrypt.h instead of WinCrypt.h.
13652
13653 2005-08-24  Ankit Jain  <jankit@novell.com>
13654             Raja R Harinath  <rharinath@novell.com>
13655
13656         * class.c (mono_class_from_typeref): Don't call mono_class_init as we might've been
13657           called by it recursively.
13658           (mono_class_init): Remove special case in pending_init handling, since it's
13659           superseded by the fix to mono_class_from_typeref.
13660
13661 2005-08-22  Zoltan Varga  <vargaz@freemail.hu>
13662
13663         * threads.c (ves_icall_System_Threading_Thread_Thread_internal): Remove the 
13664         BROKEN_THREAD_START stuff.
13665
13666 2005-08-21  Zoltan Varga  <vargaz@freemail.hu>
13667
13668         * class-internals.h object.c: Add a new kind of trampoline called a delegate 
13669         trampoline.
13670
13671         * domain-internals.h domain.c: Add a has for delegate trampolines to MonoDomain.
13672         
13673         * object.c (mono_delegate_ctor): Replace the original function address with
13674         a delegate trampoline.
13675
13676 2005-08-21 Gert Driesen <drieseng@users.sourceforge.net>
13677
13678         * icall.c: add boolean argument to base64_to_byte_array and 
13679         InternalFromBase64String to control whether a whitespace-only string
13680         is allowed (or should casue a FormatException to be thrown). We need
13681         this as the behavior has changed between MS.NET 1.x and 2.0, and we
13682         to match the MS behaviour in both profiles.
13683         * appdomain.c: Bump corlib version.
13684
13685 2005-08-20  Carlos Alberto Cortez <calberto.cortez@gmail.com>
13686
13687         This patch implements a big portion of publisher policy
13688         support, used to bind assembly versions and redirect
13689         one assembly from version A to version B.
13690
13691         * assembly.c:
13692         New GSList loaded_assembly_bindings, for storing the cached
13693         assembly bindings.
13694         (assembly_binding_maps_name): New static function for checking if a 
13695         assembly binding information maps an assembly name.
13696         (mono_assembly_binding_info_free): New function for freeing
13697         assembly binding information resources.
13698         (get_publisher_policy_info): New static function for retrieving 
13699         assembly binding information from a MonoImage.
13700         (compare_versions): New static function for comparing an assembly
13701         binding information data and the version of an assembly name.
13702         (check_policy_versions): New static function for checking if an
13703         assembly binding info mapping an assembly name is valid for it.
13704         (mono_assembly_load_publisher_policy): New static function for
13705         loading the 'policy.major.minor.MyAssembly' image for an assembly
13706         with an assembly name 'aname'.
13707         (mono_assembly_bind_version): New static function for updating
13708         assembly redirection.
13709         (mono_assembly_apply_binding): New static function for applying
13710         assembly binding.
13711         (search_binding_loaded): New static function for searching 
13712         loaded assembly binding infos in the cache domain.
13713         (mono_assembly_load_full): Don't apply assembly binding for
13714         reflection only assemblies.
13715
13716         * metadata-internals.h: Add MonoAssemblyBindingInfo,
13717         which contains information about assembly binding. Also
13718         declare signature for mono_config_parse_publisher_policy ()
13719         function, used to retrieve pub policy info.
13720         
13721         * mono-config.c:
13722         (publisher_policy_start): New static function used to parse publisher 
13723         policy config files.
13724         (publisher_policy_parser): New static MonoParseHandler containing 
13725         the functions used when parsing config files.
13726         (mono_config_parse_publisher_policy): New function for parsing
13727         publisher policy files.
13728         
13729 2005-08-20  Zoltan Varga  <vargaz@freemail.hu>
13730
13731         * object.c (mono_delegate_ctor): Add support for IA64 function descriptors.
13732
13733         * marshal.c (mono_delegate_free_ftnptr): Ditto.
13734
13735         * object.c (mono_get_addr_from_ftnptr): New helper function.
13736
13737         * object.h (mono_array_addr): Fix unaligned access warnings on IA64.
13738
13739         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
13740
13741 2005-08-19  Dick Porter  <dick@ximian.com>
13742
13743         * threads.c, threads.h, appdomain.c, appdomain.h,
13744         profiler-private.h, monitor.c, object.c, object-internals.h,
13745         profiler.c, mono-debug-debugger.h, profiler.h: Use a gsize to
13746         store the thread ID, so it can hold a 64 bit value if needed.
13747
13748 2005-08-19  Zoltan Varga  <vargaz@freemail.hu>
13749
13750         * reflection.c (mono_reflection_create_dynamic_method): Store the
13751         handle class into the method references as well so ldtoken works in
13752         dynamic methods.
13753
13754         * icall.c (ves_icall_MonoField_GetValueInternal): Add support for generic
13755         types.
13756
13757 2005-08-19  Ankit Jain <jankit@novell.com>
13758
13759         Fix #75847.
13760         * marshal.c (mono_marshal_get_ptr_to_struct): Build method signature 
13761           here rather than using the method signature of a arbitrary function
13762           named 'System.Runtime.InteropServices.Marshal::PtrToStructure' with 
13763           two arguments.
13764           Hack done with Harinath.
13765
13766 2005-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13767
13768         * threadpool.c: disable printing stack traces when we get a exception
13769         in a threadpool thread. I need to do more testing to figure out which
13770         cases actually print this. Fixes bug #75828.
13771
13772 2005-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13773
13774         * icall.c: there might be ignored whitespace after the last '='. This
13775         fixes length computation and bug #75840.
13776
13777 2005-08-18  Zoltan Varga  <vargaz@freemail.hu>
13778
13779         * assembly.c (mono_assembly_load_full): Consider .exe extension as
13780         well. Fixes #75809.
13781
13782         * reflection.c (create_custom_attr): Fix unmanaged memory leak. Fixes
13783         #75784.
13784         
13785         * reflection.c (create_custom_attr_data): Ditto.
13786
13787 2005-08-17  Atsushi Enomoto  <atsushi@ximian.com>
13788
13789         * locales.c, culture-info.h : removed RegionLCIDMap.
13790         * culture-info-tables.h : regenerated.
13791
13792 2005-08-16  Martin Baulig  <martin@ximian.com>
13793
13794         * class.c (mono_type_get_name_recurse): Small fix.
13795
13796 2005-08-16  Atsushi Enomoto  <atsushi@ximian.com>
13797
13798         * locales.c : indentation fixie.
13799
13800 2005-08-15  Atsushi Enomoto  <atsushi@ximian.com>
13801
13802         * object-internals.h,
13803           locales.h,
13804           locales.c,
13805           culture-info.h,
13806           icall.c : added RegionInfo table support.
13807         * culture-info-table.h : regenerated for region support.
13808
13809 2005-08-14  Kamil Skalski  <nazgul@nemerle.org>
13810
13811         * reflection.c (resolve_object): handle all kinds of MonoMethod
13812         including generic ones
13813
13814 2005-08-12  Ankit Jain <jankit@novell.com>
13815
13816         * get.c (dis_stringify_variant_type): New. Stringify MonoMarshalVariant.
13817           (dis_stringify_marshal_spec): Add new case for MONO_NATIVE_SAFEARRAY. 
13818
13819 2005-09-12  Lluis Sanchez  <lluis@ximian.com>
13820
13821         * process.c: Don't close a thread handle when it's NULL. This is a
13822         workaround for bug #75733.
13823
13824 2005-08-11  Zoltan Varga  <vargaz@freemail.hu>
13825
13826         * marshal.c (mono_marshal_get_string_encoding): Fix handling of CharSet.Auto. Fixes #75769.
13827
13828 2005-08-10  Zoltan Varga  <vargaz@freemail.hu>
13829
13830         * icall.c (ves_icall_Type_get_IsGenericType): New icall.
13831
13832 2005-08-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13833
13834         * threadpool.c: if a work item in the thread pool has a callback that
13835         catches a exception, don't propagate it after invoking the callback.
13836         Fixes bug #75336.
13837
13838 2005-08-08  Zoltan Varga  <vargaz@freemail.hu>
13839
13840         * class.c (class_compute_field_layout): Rename this to mono_class_setup_fields.
13841
13842         * class-internals.h (MonoCachedClassInfo): Add some new fields.
13843
13844         * class.c (mono_class_init): Load field info lazily in the AOT case.    
13845
13846         * reflection.c (mono_image_load_module): Fix error checking. Fixes #75660.
13847
13848 2005-08-03  Ankit Jain  <jankit@novell.com>
13849
13850         Fix #75683.
13851         * loader.c (mono_method_signature_full): Use MONO_CALL_DEFAULT if
13852           PInvoke calling convention is 0.
13853
13854 2005-08-02  Zoltan Varga  <vargaz@freemail.hu>
13855
13856         * socket-io.c (convert_sockopt_level_and_name): Applied patch from 
13857         Julien Puydt (julien.puydt@laposte.net). Add check for IPV6_PKTINFO.
13858
13859 Mon Aug 1 16:52:12 CEST 2005 Paolo Molaro <lupus@ximian.com>
13860
13861         * gc-internal.h, threads.c, null-gc.c, boehm-gc.c: added interface
13862         to handle threads not started by the GC (patch by Michael Meeks
13863         <michael.meeks@novell.com>).
13864
13865 2005-07-31  Kamil Skalski  <nazgul@omega.pl>
13866
13867         * reflection.c: Make buffer used in emitting types larger for some
13868         big generic types (patch by Michal Moskal).
13869
13870 2005-07-30  Zoltan Varga  <vargaz@freemail.hu>
13871
13872         * mono-debug.c: Fix some (not all) alignment problems.
13873
13874 2005-07-29  Carlos Alberto Cortez <calberto.cortez@gmail.com>
13875
13876         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw):
13877         Invoke mono_image_load_from_data_full passing the refonly
13878         parameter.
13879
13880         * assembly.c
13881         (mono_assembly_open_from_bundle): Add the refonly argument, 
13882         in order to pass it to other methods it calls to.
13883         (do_mono_assembly_open): Add the refonly argument, in order 
13884         to pass it to other methods it calls to.
13885         (mono_assembly_open_full): Invoke do_mono_assembly_open passing
13886         the refonly parameter to it.
13887
13888         * image.c: Add loaded_images_refonly_hash and
13889         loaded_images_refonly_guid_hash to cache the reflection
13890         only loaded images.
13891         (mono_images_init): Initialize the hash tables used for
13892         caching the reflection only images.
13893         (load_modules): Invoke mono_image_open_full passing the refonly
13894         parameter to load the modules the correct way.
13895         (build_guid_table): Add the refonly argument, to re-build the 
13896         correct hash table.
13897         (do_mono_image_open): Added the refonly argument, in order to
13898         define it for the loaded image.
13899         (mono_image_loaded_full): New function, which receives an
13900         additional parameter to look for the image in the refonly or
13901         non-refonly section.
13902         (mono_image_loaded): Updated, using mono_image_loaded_full.
13903         (mono_image_loaded_by_guid_full): The same case that happens
13904         with mono_image_loaded_full.
13905         (mono_image_loaded_by_guid): Likewise.
13906         (register_image): Use the ref_only variable inside MonoImage
13907         to decide in which hash table store the current image.
13908         (mono_image_open_from_data_full): Rename
13909         mono_image_open_from_data to mono_image_open_from_data_full,
13910         adding the refonly argument, to define the ref_only variable 
13911         inside MonoImage.
13912         (mono_image_open_from_data): Return 
13913         mono_image_open_from_data_full.
13914         (mono_image_open_full): Rename mono_image_open to
13915         mono_image_open_full, receiving the new refonly argument,
13916         to pass it to inner methods.
13917         (mono_pe_file_open): Update this function, to open
13918         a MonoImage as a non-refonly image.
13919         (mono_image_close): Use the refonly variable inside
13920         MonoImage to remove the image from the correct caches.
13921
13922         * image.h: Add the signatures of mono_image_open_full,
13923         mono_image_open_from_data_full, mono_image_loaded_full,
13924         mono_image_loaded_by_guid_full.
13925
13926         * metadata-internals.h: Add the ref_only field to 
13927         MonoImage.
13928         
13929 2005-07-29  Carlos Alberto Cortez <calberto.cortez@gmail.com>
13930
13931         * icall.c (ves_icall_System_Reflection_GetReferencedAssemblies):
13932         Fix the last behavior, which used to load the assemblies and
13933         extract MonoReflectionAssemblyName information, instead of
13934         extract it from the metadata tables. Needed for Reflection
13935         Only assemblies.
13936         
13937 2005-07-29  Martin Baulig  <martin@ximian.com>
13938
13939         * mono-debug-debugger.c
13940         (mono_debugger_lock, mono_debugger_unlock): g_assert() if we're
13941         not initialized.
13942
13943         * mono-debug.c
13944         (mono_debug_address_from_il_offset): Check whether we have
13945         debugging support before attempting to take the lock.
13946         (mono_debug_source_location_from_address): Likewise.
13947         (mono_debug_source_location_from_il_offset): Likewise.
13948         (mono_debug_il_offset_from_address): Likewise.
13949         (mono_debug_address_from_il_offset): Likewise.
13950
13951 2005-07-29  Zoltan Varga  <vargaz@freemail.hu>
13952
13953         * class.c (mono_class_from_name_case): Add support for dynamic images.
13954         Fixes #75650.
13955
13956         * object.c (mono_class_compute_gc_descriptor): Add a workaround
13957         for #75479.
13958
13959 2005-07-28  Zoltan Varga  <vargaz@freemail.hu>
13960         
13961         * reflection.c (mono_method_get_object): Fix warning.
13962
13963 2005-07-28  Martin Baulig  <martin@ximian.com>
13964
13965         * mono-debug.c
13966         (mono_debug_add_wrapper): Also write the wrapper type.
13967
13968 2005-07-28  Zoltan Varga  <vargaz@freemail.hu>
13969
13970         * class-internals.h (MonoCachedClassInfo): Add has_nested_classes field.
13971         
13972         * class.c (mono_class_init): Avoid reading nested classes if the AOT
13973         data indicates the class has none.
13974
13975 2005-07-26  Ben Maurer  <bmaurer@ximian.com>
13976
13977         * mono-debug.c, debug-mono-symfile.c: Replace the use of the
13978         loader lock with the debugger lock. Prevents deadlocks for beagle.
13979
13980         Beagle can now run on an smp box for a weekend without any
13981         issues. Woohoo!
13982
13983 2005-07-26  Zoltan Varga  <vargaz@freemail.hu>
13984
13985         * class.c (mono_bounded_array_class_get): Avoid crash if eclass is
13986         in a module. Fixes #75629.
13987
13988 2005-07-26  Martin Baulig  <martin@ximian.com>
13989
13990         * mono-debug.c (mono_debug_add_wrapper): New static method.
13991         (mono_debug_add_method): Call mono_debug_add_wrapper() if we're an
13992         interncall or a wrapper.
13993
13994         * mono-debug.h (MonoDebugWrapperData): New public typedef.
13995         (MonoDebugDataItemType): Added `MONO_DEBUG_DATA_ITEM_WRAPPER'.
13996         (MONO_DEBUGGER_VERSION): Bump to 51.
13997
13998         * mono-debug-debugger.c
13999         (mono_debugger_add_type): Removed this empty function.
14000         (mono_debugger_add_method): Likewise.
14001
14002 2005-07-22  Zoltan Varga  <vargaz@freemail.hu>
14003
14004         * icall.c (ves_icall_Type_GetMethodsByName): Call setup_vtable () 
14005         before accessing method->slot.
14006
14007 2005-07-21  Jb Evain  <jbevain@gmail.com>
14008
14009         * reflection.c (method_encode_clauses/class): Handle filters clauses.
14010         Fixes #75010.
14011
14012 2005-07-21  Zoltan Varga  <vargaz@freemail.hu>
14013
14014         * marshal.c (emit_marshal_custom): Implement byref marshalling. Fixes
14015         #75587.
14016
14017 2005-07-20  Zoltan Varga  <vargaz@freemail.hu>
14018
14019         * image.h image.c: Add mono_image_get_guid () API function.
14020
14021 2005-07-19  Ben Maurer  <bmaurer@ximian.com>
14022
14023         There were issues when multiple threads tried to load
14024         assemblies. A deadlock was created between assemblies_mutex and
14025         mono_domain_assemblies_lock. This fixes the issue by making the
14026         assembly ref counting be lock free. See bug 75586.
14027         
14028         * image.c (mono_image_close): The add ref function here was using
14029         Interlocked operations while the unref was using a mutex and a
14030         --. I don't think this was ever a bug that would be exposed in a
14031         non-pendantic way (ie, by an embedder doing a ref on one thread
14032         and an unref on another), but for the sake of correctness, this is
14033         now Interlocked.
14034
14035         * assembly.c (mono_assembly_addref): Use InterlockedIncrement
14036         (mono_assembly_load_reference): Call mono_assembly_addref rather
14037         than touching the refcount ourselves.
14038         (mono_assembly_close): Use InterlockedDecrement to unref the
14039         assembly. Don't acquire the lock unless it is actually needed.
14040
14041 2005-07-12  Zoltan Varga  <vargaz@freemail.hu>
14042
14043         * class.c (mono_class_layout_fields): Fix calculation of has_references
14044         for generic types.
14045
14046 2005-07-12  Martin Baulig  <martin@ximian.com>
14047
14048         Applying a patch from Michal Moskal <malekith@nemerle.org>.
14049
14050         * metadata.c
14051         (mono_type_hash): Provide better hashing for generic instances.
14052         (mono_generic_inst_hash): Improve hashing.
14053         (mono_generic_class_hash): Likewise.
14054
14055         * reflection.c (mymono_metadata_type_hash): Improve hashing for
14056         generic instances.
14057
14058 2005-07-12  Martin Baulig  <martin@ximian.com>
14059
14060         * reflection.c (mono_reflection_create_runtime_class): Remove the
14061         hack for generic type definitions and non-`Run' assemblies.
14062         (mono_reflection_bind_generic_parameters): Also use
14063         `klass->wastypebuilder' to check for TypeBuilders.
14064
14065 2005-07-12  Zoltan Varga  <vargaz@freemail.hu>
14066
14067         * class.c (mono_class_layout_fields): Fix calculation of has_references
14068         for generic types.
14069
14070         * class.c (inflate_generic_class): Fix a leak.
14071         (mono_class_init): Fix calculation of gchimpl and has_finalize fields
14072         for generic types.
14073
14074 2005-07-11  Martin Baulig  <martin@ximian.com>
14075
14076         * icall.c (ves_icall_Type_BindGenericParameters): Don't crash here
14077         on error.
14078
14079 2005-07-11  Martin Baulig  <martin@ximian.com>
14080
14081         * loader.c (find_method): Also lookup in
14082         `mono_defaults.object_class' if we're an interfaces; fixes #75460.
14083
14084 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
14085
14086         * appdomain.c (mono_domain_unload): Don't free the error message
14087         before passing it to mono_get_exception_...
14088
14089         * reflection.c (CACHE_OBJECT): Fix the race introduced by the previous patch.
14090         
14091 Thu Jul 7 19:59:31 CEST 2005 Paolo Molaro <lupus@ximian.com>
14092
14093         * threads.c: try to better guess an available RT signal (bug #75387).
14094
14095 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
14096
14097         * reflection.c (CACHE_OBJECT): Don't hold the domain lock between CHECK_OBJECT
14098         and CACHE_OBJECT.
14099
14100 2005-07-07  Martin Baulig  <martin@ximian.com>
14101
14102         * class.c (mono_type_get_name_full): Return NULL for
14103         MONO_TYPE_NAME_FORMAT_FULL_NAME if we have any generic parameters;
14104         fixes #75408.
14105
14106 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
14107
14108         * threads.c (mono_threads_abort_appdomain_threads): Wait for threads to
14109         exit the appdomain as well being aborted.
14110
14111         * threadpool.c: Create all threadpool threads inside the root appdomain, and
14112         change back to the root domain after calling managed code. This enables
14113         appdomains using threadpools to be unloaded.
14114
14115 2005-07-07  Martin Baulig  <martin@ximian.com>
14116
14117         * class-internals.h
14118         (MonoInflatedGenericClass): Moved the `MonoType *parent' field
14119         into `MonoDynamicGenericClass' since we only need it for dynamic
14120         types.
14121
14122         * reflection.c (mono_class_bind_generic_parameters): We don't need
14123         to compute the `parent' here.
14124
14125 2005-07-07  Atsushi Enomoto  <atsushi@ximian.com>
14126
14127         * culture-info-table.h : regenerated.
14128
14129 2005-07-06  Martin Baulig  <martin@ximian.com>
14130
14131         * icall.c
14132         (ves_icall_FieldInfo_SetValueInternal): Add MONO_TYPE_GENERICINST.
14133
14134         * object.c (set_value): Add MONO_TYPE_GENERICINST; fixes #75299.
14135
14136 2005-07-06  Martin Baulig  <martin@ximian.com>
14137
14138         * metadata.c (mono_metadata_class_equal): Add MONO_TYPE_SZARRAY if
14139         we're doing a signature-only comparision; fixes #74945.
14140
14141 2005-07-06  Martin Baulig  <martin@ximian.com>
14142
14143         * class-internals.h (MonoGenericClass): Moved some things out into
14144         a new `MonoInflatedGenericClass' type.  
14145         (MonoInflatedGenericClass): New type; the `klass' of a
14146         `MonoGenericClass' is now computed lazyly in
14147         mono_get_inflated_generic_class().      
14148
14149         * class.c (mono_get_inflated_generic_class): New public function.
14150         (mono_class_inflate_generic_method): Removed the unused
14151         `MonoClass *' argument.
14152         (setup_generic_vtable): Don't call mono_get_inflated_method() on
14153         all the methods.
14154         (mono_class_create_generic): Make this static and merge it with
14155         mono_class_create_generic_2(); we're now called automatically from
14156         mono_get_inflated_generic_class().
14157
14158         * loader.c (mono_method_signature): Call
14159         mono_get_inflated_method() here.
14160
14161 2005-07-06  Zoltan Varga  <vargaz@freemail.hu>
14162
14163         * object.c (mono_class_create_runtime_vtable): Allow MONO_TYPE_FNPTR as
14164         type of fields with RVA.
14165
14166         * class.c (mono_class_from_generic_parameter): Avoid calling mono_class_init ()
14167         for this pseudo class.
14168         (my_mono_class_from_generic_parameter): Likewise.
14169         (mono_class_init): Allow interfaces to have cctors.
14170
14171 2005-07-05  Zoltan Varga  <vargaz@freemail.hu>
14172
14173         * domain-internals.h domain.c: Add functionality to create MonoJitInfo structures
14174         lazily for AOT methods.
14175
14176 2005-07-05  Martin Baulig  <martin@ximian.com>
14177
14178         * loader.c (mono_lookup_pinvoke_call): g_ascii_strcasecmp()
14179         returns FALSE for a successful match, not TRUE.
14180
14181 2005-07-05  Zoltan Varga  <vargaz@freemail.hu>
14182
14183         * loader.c (mono_method_get_index): Optimize this a bit.
14184
14185 2005-07-04  Martin Baulig  <martin@ximian.com>
14186
14187         * class.c
14188         (class_compute_field_layout): Move the check for generic type
14189         definitions into mono_class_layout_fields().  Fixes #74684.
14190         (mono_class_from_generic_parameter): Correctly compute
14191         `klass->parent'; fixes #75457.
14192
14193         * reflection.c (register_assembly, register_module): Make sure
14194         `domain->rejobject_hash' is already created.
14195
14196 2005-07-02  Martin Baulig  <martin@ximian.com>
14197
14198         * class-internals.h
14199         (MonoGenericClass): Move `count_ifaces' and `ifaces' into
14200         `MonoDynamicGenericClass'.      
14201
14202 2005-07-01  Lluis Sanchez  <lluis@ximian.com>
14203
14204         * icall.c: In ves_icall_InternalExecute() dont't assert if the value
14205         returned by a field getter is null, since null is a valid value.
14206
14207 2005-07-01  Martin Baulig  <martin@ximian.com>
14208
14209         * reflection.c (mono_reflection_generic_class_initialize): Update
14210         the `dgclass->fields [i].parent' to the correct class.
14211         (mono_image_get_fieldref_token): Use the declaring type, not the
14212         reflected type.
14213
14214 2005-07-01  Martin Baulig  <martin@ximian.com>
14215
14216         * loader.c (find_method): Also look in the interfaces; fixes #75429.
14217
14218 2005-06-30  Ben Maurer  <bmaurer@ximian.com>
14219
14220         * threads.c (thread_cleanup): assert that thread != NULL
14221         (wait_for_tids_or_state_change): We were using the wrong variable
14222         when accessing wait->threads. `i' was always out of the bounds of
14223         the array.
14224
14225 2005-06-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14226
14227         * loader.c: map user32 and kernel32 to libMonoSupportW
14228
14229 2005-06-28  Zoltan Varga  <vargaz@freemail.hu>
14230
14231         * appdomain.c (unload_thread_main): Mark this as WINAPI.
14232
14233 2005-06-28  Martin Baulig  <martin@ximian.com>
14234
14235         * loader.c (method_from_methodspec): Fix #75334.
14236
14237 2005-06-28  Martin Baulig  <martin@ximian.com>
14238
14239         Fix #74953 - Arrays now implement the generic IList<T> interface
14240         on the 2.0 platform.
14241
14242         * class-internals.h (MonoDefaults): Added `generic_array_class'.
14243
14244         * reflection.c (mono_class_bind_generic_parameters): New public
14245         function; similar to mono_reflection_bind_generic_parameters(),
14246         but operates on a `MonoType *' and not on a `MonoReflectionType *'.
14247
14248         * domain.c (mono_init_internal): Try to initialize.
14249         `mono_defaults.generic_array_class' here; this'll only succeed if
14250         we're using the 2.0 corlib.
14251
14252         * icall.c
14253         (ves_icall_System_Array_InternalArray_GetGenericValueImpl): Added
14254         interncall for "System.Array/InternalArray`1:GetGenericValueImpl".
14255         (mono_lookup_internal_call): Added support for nested classes.
14256
14257         * loader.c
14258         (mono_get_method_from_token): Set `result->signature->pinvoke' if
14259         we're an interncall and have generic arguments.
14260
14261         * class.c
14262         (mono_class_inflate_generic_methods): Allow interncalls and PInvoke.
14263         (mono_bounded_array_class_get): If we're on the 2.0 corlib, use an
14264         instance of System.Array.InternalArray<T> for arrays, so they
14265         implement the generic IList<T> interface.
14266
14267 2005-06-27  Zoltan Varga  <vargaz@freemail.hu>
14268
14269         * marshal.c (emit_marshal_string): Applied patch from Itamar Rogel
14270         (chastamar@yahoo.com). Fixes #75374.    
14271
14272 2005-06-27  Atsushi Enomoto <atsushi@ximian.com>
14273
14274         * culture-info-table.h: regenerated.
14275
14276 2005-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14277
14278         * icall.c: handle spaces correctly for base64 strings.
14279
14280 2005-06-26  Ben Maurer  <bmaurer@ximian.com>
14281
14282         * *.c: Kill some warnings.
14283
14284 2005-06-23  Duncan Mak  <duncan@novell.com>
14285
14286         * socket-io.c (is_loopback): Cast 'ptr' to 'struct in6_addr *' so
14287         that this builds on Solaris 10 (x86).
14288
14289 2005-06-23  Martin Baulig  <martin@ximian.com>
14290
14291         * class.c
14292         (mono_type_get_name_recurse): Don't use a duplicate '[', ']' for
14293         generic type definitions.
14294
14295 2005-06-23  Martin Baulig  <martin@ximian.com>
14296
14297         Fix #75331.
14298
14299         * metadata.c (mono_class_get_overrides): Renamed to
14300         mono_class_get_overrides_full() and added a `MonoGenericContext *'.
14301         (method_from_method_def_or_ref): Added `MonoGenericContext *' and
14302         pass it to mono_get_method_full().
14303
14304 2005-06-22  Ben Maurer  <bmaurer@ximian.com>
14305
14306         * reflection.c (mono_reflection_create_runtime_class): take the
14307         mono_domain_lock in this method. Prevents deadlocks
14308
14309 2005-06-22  Martin Baulig  <martin@ximian.com>
14310
14311         * loader.c (method_from_methodspec): Fix #75330.
14312
14313 2005-06-22  Martin Baulig  <martin@ximian.com>
14314
14315         * reflection.c (type_get_qualified_name): Use
14316         mono_type_get_name_full() with MONO_TYPE_NAME_FORMAT_REFLECTION.
14317         (_mono_reflection_get_type_from_info): Added `MonoImage *image'
14318         argument; use it if we don't have an assembly name.
14319
14320 2005-06-22  Lluis Sanchez Gual  <lluis@novell.com>
14321
14322         * object.c: In mono_message_init, set "copy out" flag for in
14323         parameters with the [Out] flag.
14324
14325 2005-06-21  Martin Baulig  <martin@ximian.com>
14326
14327         * class.c
14328         (mono_type_get_name_recurse): Correctly handle MONO_TYPE_SZARRAY
14329         and MONO_TYPE_PTR.
14330
14331 2005-06-21  Martin Baulig  <martin@ximian.com>
14332
14333         * class.c (mono_class_init): Don't initialize `class->fields' for
14334         generic instances since they're initialized again in
14335         compute_field_layout(). 
14336         (compute_field_layout): Set the field's `generic_info' here; fix
14337         #75320. 
14338
14339 2005-06-21  Martin Baulig  <martin@ximian.com>
14340
14341         * class-internals.h
14342         (MonoGenericMethod): Added `MonoGenericClass *generic_class'.
14343
14344         * metadata.c (mono_metadata_generic_method_equal): Also
14345         distinguish the `generic_class'; fixes #75334.
14346
14347 2005-06-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14348
14349         * domain.c:
14350         * appdomain.c:
14351         * domain-internals.h:
14352         * reflection.c: 'domain_assemblies' field is now protected by its own
14353         lock. Don't call into managed code to run the AssemblyLoad event if we
14354         now there are no registered delegates for it.
14355
14356 2005-06-20  Martin Baulig  <martin@ximian.com>
14357
14358         * class.c (mono_class_is_assignable_from): Use a custom version of
14359         mono_class_has_parent() to make things work for generic instances;
14360         fix #75300.
14361
14362 2005-06-20  Martin Baulig  <martin@ximian.com>
14363
14364         * loader.c (method_from_methodspec): Apply a patch from
14365         Kamil Skalski <nazgul@nemerle.org> to fix #75296.
14366
14367 2005-06-20  Martin Baulig  <martin@ximian.com>
14368
14369         * class.c (mono_class_init): Reverted Zoltan's last change; it
14370         breaks generics.
14371
14372 2005-06-19  Zoltan Varga  <vargaz@freemail.hu>
14373
14374         * threads.c (wait_for_tids_or_state_change): Add missing locking.
14375
14376 2005-06-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14377
14378         * socket-io.c: fix the index in the socket array for writable/error
14379         sockets. Fixes bug #75306.
14380
14381 2005-06-17  Zoltan Varga  <vargaz@freemail.hu>
14382
14383         * class.c (mono_class_init): Allow interfaces to have static ctors.
14384
14385 2005-06-17  Martin Baulig  <martin@ximian.com>
14386
14387         * loader.c (method_from_methodspec): Use `context->container' when
14388         parsing the `gmethod->inst'.
14389
14390 2005-06-17  Martin Baulig  <martin@ximian.com>
14391
14392         * class.c (mono_type_get_name_recurse): Don't add the assembly
14393         name for type arguments.
14394
14395 2005-06-15  Martin Baulig  <martin@ximian.com>
14396
14397         * reflection.c (mono_image_get_inflated_method_token): Encode
14398         correct klass; fixes #75260.
14399
14400 2005-06-13 Michal Moskal <malekith@nemerle.org>
14401
14402         * icall.c: Make GetCorrespondingMethod/Constructor take
14403         MonoReflectionMethod method not MonoMethod. Removed
14404         MonoType.GetCorrespondingField, and make
14405         MonoGenericType.GetCorrespondingField take name not
14406         MonoClassField.
14407
14408 2005-06-13  Michal Moskal <malekith@nemerle.org>
14409
14410         * reflection.c (field_encode_signature, encode_locals):
14411          Make sizes of buffers for types larger (for big generic types).
14412          (create_generic_typespec,
14413          mono_reflection_sighelper_get_signature_local,
14414          mono_reflection_sighelper_get_signature_field):
14415          Add asserts for too small buffers.
14416
14417 2005-06-15  Martin Baulig  <martin@ximian.com>
14418
14419         * icall.c (ves_icall_MonoGenericClass_GetParentType): Return NULL
14420         if our parent is not a dynamic type.
14421
14422 2005-06-15  Martin Baulig  <martin@ximian.com>
14423
14424         * class-internals.h (MonoTypeNameFormat): New enum.
14425
14426         * class.c
14427         (mono_class_get_name_full): Renamed to mono_type_get_name_full().
14428         (mono_type_get_full_name): Removed.
14429         (mono_type_get_name_full): Take a `MonoTypeNameFormat format'
14430         argument instead of the boolean's.
14431
14432         * icall.c (ves_icall_System_MonoType_getFullName):
14433         Added `gboolean assembly_qualified'.    
14434
14435         * reflection.h
14436         (MonoTypeNameParse): Added `GPtrArray *type_arguments'.
14437
14438         * reflection.c (mono_reflection_parse_type): Parse the new type
14439         name format.
14440
14441 2005-06-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14442
14443         * icall.c: no need to convert from utf16 to utf8 and then back again
14444         after the call to GetLogicalDrives.
14445
14446 2005-06-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14447
14448         * icall.c: frombase64. Fix problems exposed by new tests.
14449
14450 2005-06-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14451
14452         * icall.c: added internal calls for converting char [] and strings in
14453         base64 into byte [].
14454
14455 2005-06-10  Martin Baulig  <martin@ximian.com>
14456
14457         * class.c (mono_class_create_generic_2): Read the nested classes
14458         from the metadata rather than from `gklass->nested_classes' since
14459         `gklass' might not be initialized yet.
14460
14461 2005-06-09  Duncan Mak  <duncan@novell.com>
14462
14463         * *.h: Added G_BEGIN_DECLS and G_END_DECLS where appropriate to
14464         all public headers. Fixes #74919.
14465
14466 2005-06-09  Lluis Sanchez Gual  <lluis@novell.com>
14467
14468         * domain.c: The key for proxy_vtable_hash is now a pointer
14469         array. Added new GHashFunc and GCompareFunc functions for this.
14470
14471         * class.h: The list of interfaces in MonoRemoteClass is known in
14472         advance and can't grow (we create a new MonoRemoteClass if needed),
14473         so now the interface array can be allocated together with
14474         MonoRemoteClass.
14475         
14476         * object.c: Added a new method create_remote_class_key.
14477         Fixed mono_remote_class so it does not depend on
14478         mono_upgrade_remote_class.
14479         Removed extend_interface_array.
14480         Added new method clone_remote_class(), which makes a copy of a remote
14481         class and adds a new interface or class to it.
14482         mono_upgrade_remote_class() now creates a new remote class (or gets
14483         it from the cache) if an vtable upgrade is needed. In this way
14484         we make sure that other objects sharing the same remote class
14485         don't get the new vtable with unwanted interfaces.
14486         
14487         * object-internals.h:
14488         * object.h: Moved mono_upgrade_remote_class to object-internals.h.
14489         
14490         * marshal.c: Track changes in mono_upgrade_remote_class().
14491
14492 2005-06-08  Kamil Skalski <nazgul@nemerle.org>
14493         * icall.c: Add runtime methods for obtaining members of inflated
14494         class, which were created from supplied non-inflated members. It
14495         is used in internal Get{Method,Constructor,Field} methods in
14496         System.Type
14497
14498 2005-06-09  Martin Baulig  <martin@ximian.com>
14499
14500         * reflection.c
14501         (mono_reflection_bind_generic_method_parameters): Fix #75169.
14502
14503 2005-06-08  Carlos Alberto Cortez <calberto.cortez@gmail.com>
14504         * reflection.c (mono_image_basic_init): Define
14505         Version in MonoDynamicAssembly. 
14506         
14507 2005-06-08  Martin Baulig  <martin@ximian.com>
14508
14509         Fix #75136.
14510
14511         * loader.c
14512         (mono_method_signature_full): New public method; takes a
14513         `MonoGenericContext *'.
14514         (find_method): Use mono_method_signature_full() and pass the
14515         klass'es context to it.
14516
14517         * class.c (mono_class_is_inflated_method): Use
14518         mono_method_signature_full() and pass the context to it.
14519
14520 Wed Jun 8 19:26:38 CEST 2005 Paolo Molaro <lupus@ximian.com>
14521
14522         * object.c: add proper locking in mono_remote_class_vtable(),
14523         fixes possible memory corruption.
14524
14525 2005-06-08  Michael Meeks  <michael.meeks@novell.com>
14526
14527         * marshal.c (mono_remoting_marshal_init): set
14528         initialized after initialization.
14529
14530 2005-06-08  Atsushi Enomoto  <atsushi@ximian.com>
14531
14532         * locales.c : hush.
14533
14534 2005-06-06  Michael Meeks  <michael.meeks@novell.com>
14535
14536         * object.c (extend_interface_array): fix really silly
14537         memory corrupting / comparison bug.
14538
14539 2005-06-07  Carlos Alberto Cortez <calberto.cortez@gmail.com>
14540
14541         * reflection.c: Functions added to support the creation
14542         of CustomAttributeData, which includes Attribute data
14543         used by ReflectionOnly methods.
14544
14545         * reflection.h:  mono_reflection_get_custom_attrs_data and
14546          mono_custom_attrs_data_construct added (functions exposed).
14547
14548          * icall.c: Added mono_reflection_get_custom_attrs_data
14549          as icall.
14550         
14551 2005-06-07  Zoltan Varga  <vargaz@freemail.hu>
14552
14553         * Makefile.am (libmonoruntime_la_SOURCES): Revert last change at
14554         lupus's request.
14555
14556 2005-06-06  Zoltan Varga  <vargaz@freemail.hu>
14557
14558         * icall.c (ves_icall_Mono_Runtime_GetDisplayName): Fix warning.
14559
14560         * reflection.c (reflection_methodbuilder_to_mono_method): Fix encoding of
14561         dynamic DllImportAttribute.
14562
14563         * icall.c (ves_icall_MonoMethod_GetDllImportAttribute): Fix decoding of 
14564         dynamic DllImportAttribute.
14565
14566         * Makefile.am (libmonoruntimeinclude_HEADERS): Export tabledefs.h too.
14567         Fixes #75162.
14568
14569 2005-06-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14570
14571         * threads.c: avoid segfault when an unstarted thread is aborted.
14572
14573 2005-06-05  Kornél Pál <kornelpal@hotmail.com>
14574
14575         * icall.c: Added ves_icall_Mono_Runtime_GetDisplayName:
14576         Returns the name and version of the runtime for reporting.
14577
14578 2005-06-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14579
14580         * appdomain.c: bump corlib version.
14581         * object-internals.h: new field in MonoReflectionAssembly.
14582
14583 2005-06-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14584
14585         * object-internals.h: Carlos forgot to add this field.
14586
14587 2005-06-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
14588
14589         * icall.c: Added create_version to create instances
14590         of Version of MonoReflectionAssemblyName. This change helps
14591         the AssemblyName tests to keep running fine.
14592         
14593 2005-06-03  Lluis Sanchez Gual  <lluis@novell.com>
14594   
14595         * object.c (mono_method_return_message_restore): A somehow less
14596         intrusive fix for #75138.
14597
14598 2005-06-03  Raja R Harinath  <rharinath@novell.com>
14599
14600         * object.c (mono_method_return_message_restore): Fix computation
14601         of expected number of out args.
14602
14603 2005-06-02  Zoltan Varga  <vargaz@freemail.hu>
14604
14605         * reflection.c (mono_image_get_method_info): Fix the case when the
14606         charset is empty.
14607
14608 2005-06-02  Lluis Sanchez Gual  <lluis@novell.com> 
14609
14610         * object.c: Added missing null check in
14611           mono_method_return_message_restore.
14612
14613 2005-06-02  Zoltan Varga  <vargaz@freemail.hu>
14614
14615         * reflection.c (mono_image_get_method_info): Handle the case when
14616         dllentry is empty.
14617
14618 2005-06-02  Lluis Sanchez Gual  <lluis@novell.com>
14619
14620         * object.c: When creating the vtable for a proxy, take into account
14621         all inherited interfaces, not only the ones registered in
14622         iclass->interfaces. This fixs bug #74996.
14623         Also, in mono_method_return_message_restore, verify that the array
14624         of out args has the expected lengh.
14625
14626 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14627
14628         * socket-io.c: update the timeout in Poll when the call is interrupte.
14629
14630 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14631
14632         * socket-io.c: support abort/suspend in Select_internal after last
14633         change.
14634
14635 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14636
14637         * threadpool.c: remove warning.
14638
14639 2005-06-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14640
14641         * icall.c:
14642         * socket-io.[ch]: Select_internal uses poll() now when available, thus
14643         removing the 1024 limit from select(). Runtime part of the fix for
14644         bug #71203.
14645
14646 2005-05-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14647
14648         * socket-io.c: when resolving the addresses for the same
14649         host returned by gethostname(), get the local IPs from the interface
14650         list. Loopback addresses are discarded if the are interfaces up with
14651         non-loopback ones. Fixes bug #63265.
14652
14653 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
14654
14655         * appdomain.c, verify.c, object-internals.h, reflection.c:
14656         bumped corlib number to 36, and added new extra_flags field
14657         to ReflectionMethodBuilder and friends.  Fixes #75060.
14658
14659 Fri May 27 14:45:56 CEST 2005 Paolo Molaro <lupus@ximian.com>
14660
14661         * gc.c: register a new weak link only if the object is non-null
14662         (fixes bug#75047).
14663
14664 2005-05-26  Atsushi Enomoto  <atsushi@ximian.com>
14665
14666         * culture-info.h : short time pattern too.
14667
14668 2005-05-26  Atsushi Enomoto  <atsushi@ximian.com>
14669
14670         * culture-info.h : expand long time pattern string length.
14671
14672 2005-05-25  Atsushi Enomoto  <atsushi@ximian.com>
14673
14674         * culture-info-table.h : update (more French date format; #72788).
14675
14676 2005-05-25  Zoltan Varga  <vargaz@freemail.hu>
14677
14678         * icall.c (ves_icall_InternalInvoke): Avoid type checks on this if
14679         the method is static. Fixes #75029.
14680
14681 2005-05-25  Lluis Sanchez Gual  <lluis@novell.com>
14682
14683         * reflection.c: Update the table_idx field of method builders after
14684         saving the module, since it can change. This is a workaround for
14685         bug #74914. 
14686
14687 2005-05-25  Atsushi Enomoto  <atsushi@ximian.com>
14688
14689         * culture-info-table.h : update (additional French date format).
14690
14691 2005-05-20  Zoltan Varga  <vargaz@freemail.hu>
14692
14693         * icall.c (ves_icall_type_Equals): Revert last change.
14694         
14695         * icall.c (ves_icall_type_Equals): Turn the g_print into an assert.
14696
14697         * icall.c (ves_icall_type_GetTypeCode): Rename the icall to GetTypeCodeInternal.
14698
14699 2005-05-20  Sebastien Pouliot  <sebastien@ximian.com>
14700
14701         * class-internals.h: Added executioncontext_class field to 
14702         MonoDefaults structure.
14703         * domain.c: Cache System.Threading.ExecutionContext class in 
14704         mono_defaults.
14705         * object.c: Capture the ExecutionContext for asynchroneous calls in
14706          mono_async_result_new.
14707         * object-internals.h: Added execution_context and original_context 
14708         fields to MonoAsyncResult. Added execution_context to MonoThread.
14709         * security-manager.c|.h: Added mono_get_context_capture_method to 
14710         return the capture method (if required by the security manager or by
14711         the framework version used).
14712         * threadpool.c: Apply capture (if present) ExecutionContext in 
14713         mono_async_invoke and revert to original context after it completes.
14714
14715 2005-05-19  Atsushi Enomoto  <atsushi@ximian.com>
14716
14717         * culture-info-table.h : updated (real hacky solution for zh-CHT).
14718
14719 2005-05-18  Atsushi Enomoto  <atsushi@ximian.com>
14720
14721         * culture-info-table.h : zh-CHT related workaround.
14722
14723 2005-05-12  Zoltan Varga  <vargaz@freemail.hu>
14724
14725         * marshal.c (emit_marshal_custom): Add some error checking and call the
14726         methods in the ICustomMarshaler interface. Fixes #74875.
14727         
14728         * marshal.c (emit_marshal_array): Implement [Out] marshalling in
14729         native->managed wrappers.
14730
14731 2005-05-12  Martin Baulig  <martin@ximian.com>
14732
14733         * mono-debug-debugger.cs (mono_debugger_lock/unlock): Always lock
14734         here and use the loader lock.
14735
14736         * mono-debug.c: Properly lock when the debugger is not attached.
14737         (mono_debug_init): Release the initial lock if we're not running
14738         in the debugger.
14739
14740 2005-05-12  Zoltan Varga  <vargaz@freemail.hu>
14741
14742         * marshal.c (emit_marshal_custom): Pass through NULL values without
14743         calling the custom marshalling routines.
14744
14745         * marshal.c (emit_ptr_to_object_conv): Implement ftnptr->delegate
14746         conversion in structures. Fixes #74882.
14747
14748 2005-05-12  Atsushi Enomoto  <atsushi@ximian.com>
14749
14750         * culture-info-table.h : zh-* cultures were missing.
14751
14752 2005-05-12  Lluis Sanchez Gual  <lluis@novell.com>
14753
14754         * threads.c: Added a new event background_change_event which is signaled
14755         when a thread changes its background mode.
14756         Moved here several checks previously done in managed code. The checks
14757         require the thread lock, and using the thread lock in managed code
14758         can result in deadlocks.
14759         Merged Start_internal and Thread_internal into a single method. Now 
14760         Thread_internal does all work of creating and starting a thread.
14761         Added icalls for setting and getting the state of the object. Moved from
14762         managed code to avoid locking there.
14763         Added wait_for_tids_or_state_change() which is called instad of
14764         wait_for_tids when waiting for non-backround threads to end. This method
14765         will return if one of the threads ends or the background_change_event
14766         is signaled.
14767         * threadpool.c: use ves_icall_System_Threading_Thread_SetState() to set
14768         the background mode. This method signals the background_change_event
14769         event.
14770         * icall.c:
14771         * threads-types.h: Added icalls for ClrState, SetState and GetState, and
14772         removed Start_internal.
14773         
14774 2005-05-11  Martin Baulig  <martin@ximian.com>
14775
14776         * mono-debug.h (MonoSymbolTable, MonoDebugMethodAddress): Changed
14777         to order of some fields to get proper alignment on 64-bit machines.
14778
14779 2005-05-11  Martin Baulig  <martin@ximian.com>
14780
14781         * mono-debug.c, mono-debug-debugger.c: Revert Paolo's locking
14782         changes as they're broken and completely fuck up the debugger.
14783
14784         * mono-debug.c (mono_debug_add_method): Properly unlock on error.
14785
14786 2005-05-10  Martin Baulig  <martin@ximian.com>
14787
14788         * reflection.c (mono_reflection_generic_class_initialize): Don't
14789         call mono_class_setup_parent() here.
14790
14791 2005-05-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14792
14793         * metadata/socket-io.c: on windows, getsockopt/setsockopt for
14794         send/receive timeout use an integer in milliseconds. We were using a
14795         struct timeval.
14796
14797 2005-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14798
14799         * locales.c:
14800         (internal_get_cultures): reserve the first slot of the array for the
14801         InvariantCulture, which will be filled in managed code.
14802
14803 2005-05-06  Zoltan Varga  <vargaz@freemail.hu>
14804
14805         * reflection.c (mono_image_fill_module_table): Initialize the
14806         GENERATION field as well.
14807
14808 2005-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14809
14810         * monitor.c: ignore calls to Monitor.Exit even if no one ever called
14811         Monitor.Enter on the object.
14812
14813 2005-05-05  Lluis Sanchez Gual  <lluis@novell.com>
14814
14815         * threads.c: Enable the wait for running threads when exiting.
14816         * icall.c: Suspend all threads before exiting.
14817
14818 2005-05-05  Zoltan Varga  <vargaz@freemail.hu>
14819
14820         * assembly.c (mono_assembly_load_reference): Fix warning.
14821
14822 2005-05-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14823
14824         * threadpool.c: changed the default number of threads per cpu. From now
14825         on, the default will be 20 + (5 * number of cpus) instead of 50.
14826
14827 2005-05-04  Zoltan Varga  <vargaz@freemail.hu>
14828
14829         * loader.c (mono_method_get_signature_full): Add locking here.
14830
14831 2005-05-03  Lluis Sanchez Gual <lluis@novell.com>
14832
14833         * appdomain.c: Moved methods for parsing and freeing assembly
14834         names to assembly.c.
14835         * assembly.c, domain-internals.h: Created public methods for parsing
14836         assembly names. Fixed mono_assembly_load_with_partial_name:
14837         it now finds the best match, taking into account the version,
14838         token and culture specified in the partial name. Also return
14839         the latest version if no version information is specified.
14840
14841 Mon May 2 15:47:57 CEST 2005 Paolo Molaro <lupus@ximian.com>
14842
14843         * threadpool.c: replace check for SocketAsyncCall class.
14844
14845 2005-05-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14846
14847         * threadpool-internals.h:
14848         * Makefile.am: added threadpool-internals.h
14849
14850         * threadpool.c: call mono_unhandled_exception on exceptions not handled
14851         that happen in threadpool threads (tested on MS).
14852         (mono_thread_pool_remove_socket): new function that dispatch any pending
14853         AIO call on a socket that is closing. By now only epoll really needs it,
14854         as select/poll wake up when the socket closes.
14855
14856
14857         * socket-io.c: call mono_thread_pool_remove_socket in Close_internal.
14858
14859 2005-05-01  Zoltan Varga  <vargaz@freemail.hu>
14860
14861         * marshal.c (mono_marshal_get_managed_wrapper): Handle changing the calling convention.
14862
14863 2005-05-01  Lluis Sanchez Gual  <lluis@novell.com>
14864
14865         * gc.c: In mono_gc_cleanup(), wait for 2 seconds, not 2000 seconds.
14866
14867 2005-04-30  Lluis Sanchez Gual  <lluis@novell.com>
14868
14869         * threads.c: In mono_thread_suspend_all_other_threads, if a thread
14870         has an abort request, convert it into a suspend request.
14871
14872 2005-04-30  Ben Maurer  <bmaurer@ximian.com>
14873
14874         * marshal.c (mono_marshal_get_managed_wrapper): give a friendly
14875         warning for the usage of `UnmanagedFunctionPointerAttribute' which
14876         is not supported yet.
14877
14878 2005-04-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14879
14880         * image.c: register assemblies loaded from data (bundles) in the loaded
14881         assemblies hash. Fixes bug #74772.
14882
14883 2005-04-29  Martin Baulig  <martin@ximian.com>
14884
14885         * class.c (mono_type_get_name_recurse): Update to the new naming
14886         schema from the latest .NET 2.x beta2.
14887         (mono_class_setup_vtable_general): If we're a generic instance,
14888         copy the vtable from our generic type definition and inflate all
14889         the methods in it.
14890
14891         * loader.c (find_method): Update to the new naming schema from the
14892         latest .NET 2.x beta2.
14893
14894 2005-04-29  Raja R Harinath  <harinath@gmail.com>
14895
14896         * class.c (mono_class_init): Add a mono_loader_unlock to the
14897         #74734 fix.
14898
14899 2005-04-28  Zoltan Varga  <vargaz@freemail.hu>
14900
14901         * icall.c (ves_icall_System_Environment_Exit): Remove the 
14902         suspend_all_other_threads () call for the time being, since it can hang.
14903
14904         * threads.c (mono_thread_manage): Similarly, disable the waiting for
14905         the background threads to exit, since it can also hang.
14906
14907         * class.c (mono_class_init): Applied patch from Ankit Jain 
14908         (radical@gmail.com). Avoid pending init errors when a field refers
14909         to a nested class using a typeref. Fixes #74734.
14910
14911         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): Fix
14912         this for dynamic modules.
14913
14914 2005-04-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14915
14916         * threads.c: don't wait for threads that are in the process of aborting
14917         or aborted. Set the 'shutting_down' flag before cleaning the threadpool
14918         and waiting for background threads to finish. This makes xsp and
14919         mod-mono-server exit without random length delays and/or hangs.
14920
14921 2005-04-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14922
14923         * icall.c: remove duplicate assignment from GetReferencedAssemblies.
14924
14925 2005-04-25  Zoltan Varga  <vargaz@freemail.hu>
14926
14927         * class.c (mono_class_is_assignable_from): Call is_assignable_to for
14928         dynamic types to prevent infinite loops. Fixes #74727.
14929
14930         * reflection.c (mono_reflection_call_is_assignable_from): Rename to
14931         ..._is_assignable_to.
14932
14933 2005-04-25  Sebastien Pouliot  <sebastien@ximian.com>
14934
14935         * security.c: Fixed #74698 where sysconf returned -1 on FreeBSD.
14936
14937 2005-04-25  Martin Baulig  <martin@ximian.com>
14938
14939         Upgrade to the latest .NET 2.x beta (Visual Studio 2005 Beta 2).
14940
14941         * domain.c
14942         (supported_runtimes): Change "v2.0.40607" -> "v2.0.50215".
14943
14944         * row-indexes.h (MONO_GENERICPARAM_KIND): Removed.
14945
14946         * reflection.c (build_compressed_metadata): Set metadata header
14947         version to 2.0.
14948
14949 2005-04-23  Zoltan Varga  <vargaz@freemail.hu>
14950
14951         * sysmath.c (ves_icall_System_Math_Round2): Use modf to decompose the
14952         number into an integral and a decimal part. Fixes #70473.
14953
14954         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf): Ignore static fields. Fixes #74703.
14955
14956 2005-04-23  Atsushi Enomoto  <atsushi@ximian.com>
14957
14958         * culture-info-table.h : reflected the latest locale-builder output.
14959
14960 2005-04-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14961
14962         * threadpool.c: check for SuspendRequested too when deciding if
14963         mono_thread_interruption_checkpoint should be called.
14964
14965 2005-04-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14966
14967         * appdomain.[ch]: added function to set the shutting_down flag to TRUE.
14968         * threads.c: remove interruption_mutex and use Interlocked instead. When
14969         suspending all the threads, wait for all the suspended events at once.
14970         If we're shutting down and get an APC that is going to be queued,
14971         call mono_thread_execute_interruption immediately, as the thread might
14972         be sleeping on a pthread condition or mutex.
14973
14974         * icall.c: call mono_runtime_set_shutting_down before suspending the
14975         threads.
14976
14977         Fixes bug #74693. And now xsp is happier when exiting.
14978
14979 2005-04-22  Zoltan Varga  <vargaz@freemail.hu>
14980
14981         * loader.c (mono_stack_walk): Fix #74690.
14982
14983 2005-04-22  Martin Baulig  <martin@ximian.com>
14984
14985         * mono-debug.h (MonoDebugMethodJitInfo): Added
14986         `MonoDebugMethodJitInfo *jit'.
14987
14988         * mono-debug.c (mono_debug_read_method): Cache the
14989         MonoDebugMethodJitInfo in `address->jit'.
14990         (mono_debug_free_method_jit_info): New public method.
14991
14992 2005-04-22  Martin Baulig  <martin@ximian.com>
14993
14994         * class.c (mono_class_is_assignable_from): Disallow
14995         type parameter -> interface.
14996
14997 2005-04-21  Dick Porter  <dick@ximian.com>
14998
14999         * threads.c (mono_thread_create): Turn an assertion into an error.
15000
15001 2005-04-20  Zoltan Varga  <vargaz@freemail.hu>
15002
15003         * threads.c object.c icall.c: Fix some gcc 4.0 warnings.
15004         
15005         * threads.c marshal.h marshal.c exceptions.h exceptions.c appdomain.c: 
15006         Fix some gcc 4.0 warnings.
15007
15008 Wed Apr 20 16:09:06 CEST 2005 Paolo Molaro <lupus@ximian.com>
15009
15010         * file-io.c: fix alt dir separator char on unix systems
15011         and cleanup (fixes bug #71214).
15012
15013 2005-04-19  Lluis Sanchez Gual  <lluis@novell.com>
15014
15015         * marshal.c: Use CALLVIRT instead of CALL when dispatching
15016         a call to a remote domain, since the method may be an
15017         interface method in the client domain. This fixes bug #74192.
15018
15019 2005-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15020
15021         * threadpool.c: recv/send are now performed before going back to managed
15022         code to save one transition.
15023
15024 2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15025
15026         * metadata/socket-io.c: fixed semantics in Socket.Blocking icall.
15027
15028         * metadata/threadpool.c: removed hack to workaround the bug above.
15029
15030         Fixes bug #74618.
15031
15032 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
15033
15034         * reflection.c reflection.h: Fix handling of parameter defaults in
15035         dynamic methods. Also fixes handling of parameter attributes.
15036         Fixes #74609.
15037
15038         * mono-debug.c (mono_debug_close_image): Fix warning.
15039
15040 2005-04-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15041
15042         * socket-io.h: replaced old unused field with new 'blocking'.
15043         * threadpool.c: restore socket blocking state on windows(tm).
15044
15045 2005-04-14  Sebastien Pouliot  <sebastien@ximian.com>
15046
15047         * icall.c: don't return the codebase in the AssemblyName[] returned by
15048         ves_icall_System_Reflection_Assembly_GetReferencedAssemblies.
15049         * object-internals.h: Removed FIXME (fields were presents) and fixed
15050         versioncompat declaration.
15051
15052 2005-04-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15053
15054         * threadpool.c: sometimes we get EBADF from epoll but the epollfd is
15055         not closed, so don't cleanup when it happens.
15056
15057 2005-04-13  Chris Toshok  <toshok@ximian.com>
15058
15059         * mono-debug-debugger.h: change prototype for
15060         mono_debugger_lookup_type.
15061
15062         * mono-debug-debugger.c (mono_debugger_lookup_type): reinstate
15063         this function, although it should probably be named
15064         mono_debugger_init_type.
15065
15066 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15067
15068         * threadpool.c: fix non-AIO case.
15069
15070 2005-04-13  Zoltan Varga  <vargaz@freemail.hu>
15071
15072         * profiler.c (mono_profiler_install_simple): Add a 'jit' option to
15073         the built-in profiler to measure just JIT compilation times.
15074
15075 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15076
15077         * threadpool.c: the epollfd might be closed by another thread at
15078         any time, so ignore EBADF at treat it as a "we're closing" sign.
15079
15080 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15081
15082         * threadpool.c: release the semaphores with a count equals to the number
15083         of working threads in both IO and regular pools. Fixed typo that messed
15084         up the count of IO pool threads. Don't initialize the pipe handles if
15085         we're using epoll.
15086
15087 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15088
15089         * threadpool.c: some systems don't like a NULL when deleting the socket
15090         from epoll.
15091
15092 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15093
15094         * threadpool.c: fix semaphore allocation.
15095
15096 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15097
15098         * threadpool.c: added epoll() based implementation for asynchronous IO
15099         that is used instead of the default poll() when available.
15100         It can be disabled by setting MONO_DISABLE_AIO.
15101
15102 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15103
15104         * threadpool.c: windows needs 'closesocket' and instead of returning
15105         0 when the stream is closed while in select, it returns -1. Fixes bug
15106         #74573.
15107
15108 2005-04-12  Zoltan Varga  <vargaz@freemail.hu>
15109
15110         * class.c (class_compute_field_layout): Fix the regression caused by
15111         the previous try.
15112
15113 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15114
15115         * threadpool.c: separate pool for socket async. IO.
15116         * threadpool.h: mono_max_worker_threads is not a global any more.
15117
15118 2005-04-10  Zoltan Varga  <vargaz@freemail.hu>
15119
15120         * class.c (class_compute_field_layout): Fix #74549.
15121
15122 2005-04-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15123
15124         * threadpool.c: select() on windows doesn't allow pipe handles, soooo
15125         use 2 connected sockets instead.
15126
15127 2005-04-08  Miguel de Icaza  <miguel@novell.com>
15128
15129         * mono-config.c: Add new entry point for mkbundle
15130         mono_config_parse_memory. 
15131
15132 2005-04-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15133
15134         * threadpool.c: removed another unused function.
15135
15136 2005-04-08  Ankit Jain  <radical@corewars.org>
15137
15138         * reflection.c (get_default_param_value_blobs): Add 'types'
15139         parameter to get the types encoded in the constant table.
15140         (mono_param_get_objects): Use the type from the constant table,
15141         not the type of the parameter, when creating default values.
15142         Handle null default values correctly.
15143
15144 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15145
15146         * file-io.c:
15147         * file-io.h:
15148         * threadpool.c:
15149         * threadpool.h:
15150         * icall.c:
15151         * socket-io.c: removed dead code for async IO.
15152
15153 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15154
15155         * socket-io.h: 2 more fields in MonoSocketAsyncResult.
15156
15157         * threadpool.c: intercept socket async. calls and pass them to a thread
15158         that is polling and dispatching the job items to the threadpool as
15159         socket become ready. Fixes bugs #71217, #71933.
15160
15161         * icall.c: Removed AsyncReceive and AsyncSend. Speed up for copies
15162         between char and short/ushort arrays.
15163
15164         * socket-io.c: remove dead code.
15165
15166 2005-04-06  Atsushi Enomoto  <atsushi@ximian.com>
15167
15168         * locales.c,
15169           icall.c : removed InternalToUpper_Comp() and
15170           InternalToLower_Comp().
15171
15172 2005-04-06  Atsushi Enomoto  <atsushi@ximian.com>
15173
15174         * char-conversions.h : The tables were incorrectly generated. Should
15175           be generated against invariant culture.
15176
15177 2005-04-04  Zoltan Varga  <vargaz@freemail.hu>
15178
15179         * object.c (mono_runtime_invoke_array): Fix return value when 
15180         passing pre-created valuetype objects to ctors.
15181
15182         * gc.c (mono_gchandle_is_in_domain): Applied patch from Jon Larimer 
15183         (jlarimer@gmail.com). Avoid crashes when the wrapper object is null.
15184         Fixes #74338.
15185
15186 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
15187
15188         * domain.c: removed g_assert for runtimesecurityframe_class. This is 
15189         only used with --security and hides the wrong corlib version error.
15190
15191 2005-03-30  Joshua Tauberer  <tauberer@for.net>
15192
15193         * class.c: Changed mono_class_name_from_token so that types
15194         outside of a namespace don't have an initial period.  Improved
15195         the g_warning message used in _mono_class_get when loading
15196         fails.
15197         * assembly.c: In mono_assembly_load_reference, when an assembly
15198         can't be found, "No such file or directory" is misleading and
15199         unhelpful because a few paths were checked for the presence of
15200         the assembly.  When that happens (ENOENT), display a nicer
15201         message indicating the directories that were searched.  In all
15202         cases, the warning is made easier to read for non-hackers.
15203
15204 2005-03-29  Sebastien Pouliot  <sebastien@ximian.com>
15205
15206         * assembly.c: Set MONO_ASSEMBLIES to NULL when compiling from a VS.NET
15207         project/solution.
15208         * appdomain.h|domain.c: Removed inline from functions.
15209         * appdomain.c: Reduced warnings when compiling on windows.
15210         * icall.c: Fixed output_debug declaration to gunichar2*.
15211         * mono-config.c: Reduced warnings when compiling on windows.
15212         * rand.c: Added missing "windows.h". Added missing return value.
15213         * rawbuffer.c: Added missing winsock2.h for windows.
15214         * sysmath.h: Added mono-compiler.h header to allow/ease 
15215         compilation with non-GCC compilers.
15216         * threads.c: Fixed declarations to compile with VS.NET C compiler.
15217         Removed cast warnings.
15218
15219         Adapted from the work of J Lothian (for VC6).
15220
15221 2005-03-29  Zoltan Varga  <vargaz@freemail.hu>
15222
15223         * assembly.c (mono_assembly_load_corlib): Do not try loading corlib
15224         from default_path.
15225
15226 2005-03-27  Zoltan Varga  <vargaz@freemail.hu>
15227
15228         * marshal.c (mono_marshal_get_managed_wrapper): Fix bogus assert on
15229         the 2.0 profile.
15230
15231 2005-03-27  Raja R Harinath  <harinath@gmail.com>
15232
15233         * Makefile.am (assembliesdir): Fix.  If it is arch-dependent it
15234         has to be in $(exec_prefix).  $(prefix) is for arch-independent
15235         stuff, and it would probably use $(prefix)/share rather than
15236         $(prefix)/lib.
15237
15238 2005-03-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15239
15240         * console-io.c: added 2 includes that might be missing.
15241
15242 2005-03-24  Zoltan Varga  <vargaz@freemail.hu>
15243
15244         * marshal.c (mono_marshal_get_managed_wrapper): Fix crashes in 2.0
15245         profile.
15246
15247         * reflection.c (create_custom_attr): Allocate the params array using
15248         alloca so it gets GC tracking.
15249
15250 2005-03-23  Chris Toshok  <toshok@ximian.com>
15251
15252         * mono-debug-debugger.c (mono_debugger_runtime_invoke): comment
15253         out some spew.
15254
15255 2005-03-24  Raja R Harinath  <rharinath@novell.com>
15256
15257         * Makefile.am (assembly.lo, mono-config.lo): Rebuild when Makefile
15258         changes to pick up any changes in prefix, etc.
15259
15260 2005-03-23  Zoltan Varga  <vargaz@freemail.hu>
15261
15262         * marshal.c (mono_marshal_get_managed_wrapper): Remove fixme.
15263         
15264         * marshal.c (mono_marshal_get_managed_wrapper): Remove debugging output.
15265         * marshal.c (mono_marshal_get_managed_wrapper): Add support for the modopt(CallConvCdecl).
15266
15267 2005-03-23  Zoltan Varga  <vargaz@freemail.hu>
15268
15269         * class-internals.h object-internals.h class.c reflection.c: Extend the
15270         mono_lookup_dynamic_token () function to return the class of the
15271         token as well. 
15272
15273         * class.c (mono_ldtoken): Handle MEMBERREFS in the dynamic case as
15274         well. Fixes #73848.
15275
15276 2005-03-23  Sebastien Pouliot  <sebastien@ximian.com>
15277
15278         * security-manager.c: Skip inheritance checks for intra-corlib
15279         class inheritance and method overrides. This skips a lot of checks
15280         and (anyway) permissions cannot work until corlib is loaded.
15281
15282 2005-03-23  Martin Baulig  <martin@ximian.com>
15283
15284         * marshal.c (mono_marshal_get_stfld_wrapper): Add support for
15285         MONO_TYPE_GENERICINST.  
15286
15287 2005-03-23  Martin Baulig  <martin@ximian.com>
15288
15289         * metadata.c (mono_type_to_unmanaged): Add MONO_TYPE_GENERICINST.
15290
15291 Tue Mar 22 16:57:01 CET 2005 Paolo Molaro <lupus@ximian.com>
15292
15293         * class.c: added locking comments to some functions.
15294         Cache the interface offsets arrays (saves about 20 KB
15295         of runtime memory in a typical app).
15296         Reduce the time overhead in mono_class_setup_supertypes ().
15297
15298 Tue Mar 22 16:35:57 CET 2005 Paolo Molaro <lupus@ximian.com>
15299
15300         * icall.c: speedup and fix leaks in GetMethodsByName and
15301         GetPropertiesByName.
15302
15303 Tue Mar 22 16:34:29 CET 2005 Paolo Molaro <lupus@ximian.com>
15304
15305         * reflection.c: some locking fixes.
15306
15307 Tue Mar 22 15:13:54 CET 2005 Paolo Molaro <lupus@ximian.com>
15308
15309         * metadata.c: added missing break in case statement.
15310
15311 2005-03-22  Zoltan Varga  <vargaz@freemail.hu>
15312
15313         * marshal.c (mono_marshal_get_runtime_invoke): Add support for
15314         typedbyref return values. Fixes #73941.
15315
15316 2005-03-17  Sebastien Pouliot  <sebastien@ximian.com>
15317
15318         * security-manager.c|h: Added demandunmanaged method and 
15319         suppressunmanagedcodesecurity class to MonoSecurityManager.
15320         Renamed aptc class to allowpartiallytrustedcallers.
15321
15322 2005-03-17  Martin Baulig  <martin@ximian.com>
15323
15324         * class.c (inflate_generic_type): Add MONO_TYPE_ARRAY.
15325
15326 2005-03-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15327
15328         * file-io.c: disabled file async. IO using aio_*. It uses the
15329         threadpool now. Workaround for bug #73718.
15330
15331 Wed Mar 16 18:08:00 CET 2005 Paolo Molaro <lupus@ximian.com>
15332
15333         * assembly.h, mono-config.c: added code to deal with bundled configs
15334         for bundled assemblies.
15335
15336 Wed Mar 16 16:34:38 CET 2005 Paolo Molaro <lupus@ximian.com>
15337
15338         * *.c, private.h: cleanup, removing old private.h header file.
15339
15340 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
15341
15342         * reflection.c (mono_image_get_method_info): Encode best_fit_mapping
15343         and throw_on_unmappable_char attributes.
15344
15345 2005-03-13  Sebastien Pouliot  <sebastien@ximian.com>
15346
15347         * process.c: Fix buffer length in ves_icall_System_Diagnostics_Process
15348         _ProcessName_internal.
15349
15350 2005-03-13  Zoltan Varga  <vargaz@freemail.hu>
15351
15352         * object.c (mono_array_new_full): Fix aligning of array size. Fixes
15353         #73631.
15354
15355         * icall.c threads.c threads-types.h: Remove slothash icalls as they
15356         are no longer used.
15357
15358 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
15359
15360         * object.c (compute_class_bitmap): Add support for generics. Fixes
15361         #73527.
15362
15363 2005-03-10  Zoltan Varga  <vargaz@freemail.hu>
15364
15365         * reflection.c (mono_reflection_create_runtime_class): Fix 2.0 build.
15366
15367 2005-03-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15368
15369         * filewatcher.c: commented out the code for windows watcher, as we don't
15370         use it (we use the managed implementation instead).
15371
15372 2005-03-10  Zoltan Varga  <vargaz@freemail.hu>
15373
15374         * object-internals.h (MonoThread): Remove 'unused1' field.
15375
15376         * appdomain.c: Bump corlib version.
15377
15378         * marshal.c: Remove calls to Reset/RestoreDataStoreStatus ().
15379
15380         * reflection.c (mono_reflection_create_runtime_class): Remove the
15381         AssemblyBuilder.Save optimization since it causes too many problems.
15382
15383 2005-03-10  Sebastien Pouliot  <sebastien@ximian.com>
15384
15385         * exception.c|h: Added mono_get_exception_reflection_type_load to
15386         create a ReflectionTypeLoadException object.
15387         * icall.c: Updated ves_icall_System_Reflection_Assembly_InternalGetType
15388         to return NULL is a InheritanceDemand fails during reflection. Updated
15389         ves_icall_System_Reflection_Assembly_GetTypes to throw a 
15390         ReflectionTypeLoadException if an InheritanceDemand fails during 
15391         reflection. Added icall mapping for GetLinkDemandSecurity.
15392         * security-manager.c|h: Added ves_icall_System_Security_
15393         SecurityManager_GetLinkDemandSecurity internal call to return the
15394         class and methods permissions set for a LinkDemand. Removed unused
15395         fields in MonoSecurityManager.
15396
15397 2005-03-10  Martin Baulig  <martin@ximian.com>
15398
15399         * class.c (mono_bounded_array_class_get): Initialize `eclass' if
15400         it's a generic instance.
15401
15402 2005-03-09  Zoltan Varga  <vargaz@freemail.hu>
15403
15404         * reflection.c (mono_get_object_from_blob): Applied patch from
15405         Ankit Jain (radical@gmail.com). Fix enum default values. Fixes #73457.
15406
15407         * class.c (mono_class_is_assignable_from): Another try at fixing 
15408         #73469 without breaking anything.
15409
15410 2005-03-08  Zoltan Varga  <vargaz@freemail.hu>
15411
15412         * class.c: (mono_class_is_assignable_from): Revert the last changes
15413         since they don't work with generics.
15414         
15415         * class.c (mono_class_is_assignable_from): Fix build bustage.
15416
15417         * class.c (mono_class_is_assignable_from): If oklass is dynamic, call
15418         the managed IsAssignableFrom method. Fixes #73469.
15419
15420         * reflection.c (mono_reflection_call_is_assignable_from): New helper
15421         function.
15422
15423 2005-03-04  Zoltan Varga  <vargaz@freemail.hu>
15424
15425         * object.c (mono_load_remote_field_new): Fix returning uninitialized
15426         memory when the remoting callback does not sets the out arguments.
15427         Fixes #73007.
15428
15429         * marshal.c (mono_delegate_free_ftnptr): Remove debug array checked in
15430         by mistake.
15431
15432         * string-icalls.c: Return String.Empty where needed. Fixes #73310.
15433
15434         * object-internals.h (MonoStackFrame): Sync with managed object layout.
15435
15436         * appdomain.c: Bump corlib version.
15437
15438 2005-03-03  Zoltan Varga  <vargaz@freemail.hu>
15439
15440         * gc-internal.h boehm-gc.c null-gc.c: Add mono_gc_is_gc_thread () API
15441         function.
15442
15443         * threads.c (mono_thread_attach): Detect threads which are not started
15444         by the GC pthread wrappers.
15445
15446 2005-03-03  Sebastien Pouliot  <sebastien@ximian.com>
15447
15448         * icall.c: Added new icall for RNG.
15449         * rand.c|h: Added new icall to open the RNG. This allows to share a 
15450         single handle on Linux to access /dev/urandom and fix #73183.
15451
15452 Thu Mar 3 17:53:17 CET 2005 Paolo Molaro <lupus@ximian.com>
15453
15454         * object.c: setting the new vtable in a transparent proxy object must
15455         not change the GC descriptor.
15456
15457 Thu Mar 3 12:11:46 CET 2005 Paolo Molaro <lupus@ximian.com>
15458
15459         * object.c: fixed compilation without GCJ support.
15460         * reflection.c: for runtime-created types ensure klass->has_references
15461         is correct (bug #73215).
15462
15463 2005-03-02  Martin Baulig  <martin@ximian.com>
15464
15465         * class.c (mono_class_is_assignable_from): Make this work if
15466         `oklass' is a generic instance; fixes #72831.
15467
15468 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
15469
15470         * marshal.c (mono_marshal_get_managed_wrapper): Fix handling of methods
15471         with hasthis set.
15472         
15473         * marshal.c (emit_marshal_array): Emit native->managed marshalling of blittable arrays.
15474
15475         * marshal.c: Reorganize native->managed marshalling code to also use
15476         the emit_marshal_... functions.
15477
15478 Tue Mar 1 16:16:42 CET 2005 Paolo Molaro <lupus@ximian.com>
15479
15480         * object.c: typed allocs have issues with bitmap sizes > 30,
15481         so check for max_set >= 30.
15482
15483 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
15484
15485         * marshal.c (emit_marshal_array): Implement marshalling of arrays to
15486         managed code. Fixes #73012.
15487
15488         * metadata.h (MonoMarshalSpec): Add elem_mult field.
15489
15490         * metadata.c reflection.c: Load/Emit elem_mult as well.
15491         
15492         * metadata.h (MonoMarshalSpec): Add comment.
15493
15494         * metadata.h: Add MONO_MARSHAL_CONV_LPTSTR_STR.
15495
15496         * metadata.c (mono_metadata_parse_marshal_spec): Set param_num and
15497         num_elem to -1 if not given.
15498
15499         * object-internals.h (MonoReflectionMarshal): Add has_size field.
15500
15501         * reflection.c (encode_marshal_blob): Differentiate between 0 and not
15502         given values.
15503
15504 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
15505
15506         * null-gc.c (mono_gc_free_fixed): Was not compilable.
15507
15508 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
15509
15510         * reflection.c (encode_marshal_blob): Encode param_num field as well.
15511
15512         * object-internals.h (MonoReflectionMarshal): Add param_num field.
15513
15514 Mon Feb 28 11:59:42 CET 2005 Paolo Molaro <lupus@ximian.com>
15515
15516         * object.c: generalized the reference bitmap creation
15517         and added hooks for the new GC.
15518         * class-internals.c: removed the gc_bitmap field from MonoClass.
15519
15520 Sat Feb 26 16:06:59 CET 2005 Paolo Molaro <lupus@ximian.com>
15521
15522         * domain.c: help the compiler to produce better code
15523         in mono_jit_info_table_find ().
15524
15525 Fri Feb 25 16:50:14 CET 2005 Paolo Molaro <lupus@ximian.com>
15526
15527         * object.c: make all allocations look typed.
15528
15529 Fri Feb 25 16:18:59 CET 2005 Paolo Molaro <lupus@ximian.com>
15530
15531         * socket-io.c: load Mono.Posix if it's not loaded already
15532         (fixes bug#73033).
15533
15534 2005-02-24  Martin Baulig  <martin@ximian.com>
15535
15536         * class.c (dup_type): Correctly duplicate MONO_TYPE_PTR.
15537         * reflection.c (dup_type): Likewise.
15538
15539 2005-02-24  Zoltan Varga  <vargaz@freemail.hu>
15540
15541         * gc.c (run_finalize): Set the domain for finalizing delegates as well.
15542         Thanks to Willibald Krenn and Scott Mohekey for tracking this down.
15543
15544 Thu Feb 24 15:19:35 CET 2005 Paolo Molaro <lupus@ximian.com>
15545
15546         * domain.c, threads.c, object-internals.h: make the critical thread
15547         local vars use the fast access mode (even when we're compiled in
15548         a lib). Provide accessors to be used by the jit during codegen.
15549
15550 2005-02-24  Carlos Alberto Cortez <calberto.cortez@gmail.com>
15551
15552         * appdomain.c: Changed hook functios behavior to include
15553         support for the reflection only assemblies. Some icalls were changed
15554         to support the mentioned assemblies too. Signatures of static methods
15555         try_assembly_resolve and real_load now have an additional parameter:
15556         refonly.
15557
15558         * assembly.c: General changes to mono_assembly_ methods to support
15559         reflection only api. Functions mono_assembly_open, mono_assembly_load,
15560         mono_assembly_load_from and mono_assembly_loaded have got a '_full'
15561         suffix, to support an additional gbool parameter to specify whether
15562         the assembli is reflection only or not. Created some new hook functions 
15563         to add support for reflection only assemblies. Signatures of static 
15564         methods load_in_path, search_loaded, and mono_assembly_load_from_gac 
15565         have now an additional parameter: refonly.
15566
15567         * metadata-internals.h: MonoAssembly now has a gbool ref_only flag,
15568         indicating whether the assembly is reflection only or not.
15569
15570         * exception.c: Add mono_get_exception_invalid_operation.
15571
15572         * icall.c: Throw an InvalidOperationException when trying to invoke
15573         a property/method/event, or trying to set/get the value of a field.
15574         Also add an icall to retrieve the ref_only flag to the
15575         MonoReflectionAssembly.
15576
15577 2005-02-23  Chris Toshok  <toshok@ximian.com>
15578
15579         Part of fix for #72827.
15580         * mono-debug.c (mono_debug_add_method): add lexical block data to
15581         the info we write.  Kind of a hack at the moment - we copy the
15582         lexical block info from the MonoDebugMethodInfo to the
15583         MonoDebugMethodJitInfo here, before writing it.
15584         (mono_debug_read_method): read the lexical block info.
15585
15586         * mono-debug.h (_MonoDebugMethodJitInfo): add lexical block slots.
15587
15588         * debug-mono-symfile.h: add lexical block support.
15589
15590         * debug-mono-symfile.c (mono_debug_find_method): add lexical block
15591         support.
15592
15593 2005-02-23  Zoltan Varga  <vargaz@freemail.hu>
15594
15595         * loader.c (mono_lookup_pinvoke_call): Fix warning.
15596
15597         * object.c (mono_runtime_free_method): Call mono_free_method () and
15598         put the TODOs there.
15599
15600         * loader.c (mono_free_method): Free up most memory allocated for 
15601         dynamic methods.
15602
15603 Wed Feb 23 18:54:26 CET 2005 Paolo Molaro <lupus@ximian.com>
15604
15605         * reflection.c: properly flag a Type argument to a
15606         named custom attr value (bug #72248).
15607
15608 Wed Feb 23 18:32:35 CET 2005 Paolo Molaro <lupus@ximian.com>
15609
15610         * reflection.c: reduce code duplication in named custom
15611         attribute encoding.
15612
15613 Wed Feb 23 17:23:52 CET 2005 Paolo Molaro <lupus@ximian.com>
15614
15615         * reflection.c: properly encode custom attrs of type object
15616         (bug #72649).
15617
15618 2005-02-23  Zoltan Varga  <vargaz@freemail.hu>
15619
15620         * marshal.c (mono_delegate_free_ftnptr): Make this thread safe.
15621
15622 Tue Feb 22 21:54:47 CET 2005 Paolo Molaro <lupus@ximian.com>
15623
15624         * socket-io.c: load System.dll if it's not loaded already
15625         (bug #72850 and #70477).
15626
15627 2005-02-21  Martin Baulig  <martin@ximian.com>
15628
15629         * marshal.c (mono_marshal_get_runtime_invoke): Add support for
15630         generic instances.
15631
15632 2005-02-21  Martin Baulig  <martin@ximian.com>
15633
15634         * reflection.c (mono_image_build_metadata): We also need to
15635         "fixup" the MethodImpl table after we computed the final method
15636         indices.  Call fixup_methodimpl() to do that.
15637         (fixup_methodimpl): New private method.
15638
15639 Mon Feb 21 16:17:14 CET 2005 Paolo Molaro <lupus@ximian.com>
15640
15641         * assembly.c: special case mscorlib.dll (bug#72536),
15642         patch from Carlos Alberto Cortez.
15643
15644 2005-02-20  Zoltan Varga  <vargaz@freemail.hu>
15645
15646         * threads-types.h threads.c: Fix build bustage.
15647
15648         * threads.c: Use a union for long<->double conversions.
15649
15650         * threads-types.h threads.c icall.c: Implement the net 2.0 interlocked
15651         functions based on a patch by Luca Barbieri (luca.barbieri@gmail.com).
15652
15653         * marshal.c (emit_thread_interrupt_checkpoint_call): Mark the bblock 
15654         containing the checkpoint call with NOT_TAKEN.
15655         
15656         * marshal.c (mono_marshal_get_managed_wrapper): Emit interrupt 
15657         checkpoint before pushing the arguments, so they won't have to be
15658         spilled to stack.
15659
15660 Sat Feb 19 15:19:46 CET 2005 Paolo Molaro <lupus@ximian.com>
15661
15662         * domain.c, assembly.c, domain-internals.h: make some data
15663         const and relocation-free.
15664
15665 Sat Feb 19 11:12:34 CET 2005 Paolo Molaro <lupus@ximian.com>
15666
15667         * object.c, appdomain.c, class-internals.h: introduce the
15668         MonoClassRuntimeInfo structure to hold the info needed to
15669         use a class at runtime. Made mono_class_vtable() lock-free
15670         for all the appdomains.
15671
15672 Sat Feb 19 11:11:12 CET 2005 Paolo Molaro <lupus@ximian.com>
15673
15674         * metadata-internals.h, image.c: introduce a per-image mempool to
15675         be used for memory that has the same lifetime as the image.
15676
15677 2005-02-18  Lluis Sanchez Gual  <lluis@novell.com>
15678
15679         * domain.c: In mono_init_internal(), instead of selecting the first
15680         runtime version supported by an executable, get a list of all
15681         supported versions and select the one for which an mscorlib exists
15682         (since even if the runtime supports a given version, it doesn't mean
15683         that the framework for that version is installed).
15684         Modified get_runtimes_from_exe to support this behavior.
15685         In supported_runtimes, added information about additional system
15686         assembly versions.
15687         
15688         * assembly.c: Added support for more than one system assembly version
15689         per runtime version. Updated the assembly list.
15690         In mono_assembly_remap_version, removed the initial version check,
15691         since we don't know to which version we need to compare until we
15692         get the version set on which the assembly is based.
15693         Moved the code for loading corlib into the new method
15694         mono_assembly_load_corlib(), so it can be used by the initialization
15695         code.
15696         
15697         * domain-internals.h: Updated data structures and added declaration
15698         for mono_assembly_load_corlib.
15699
15700 2005-02-17  Zoltan Varga  <vargaz@freemail.hu>
15701
15702         * reflection.c (resolve_object): Fix the creation of the signature in 
15703         the SignatureHelper case.
15704
15705         * assembly.c (mono_assembly_remap_version): Fix binary search.
15706         
15707 2005-02-17  Sebastien Pouliot  <sebastien@ximian.com>
15708  
15709         * class.c: Added inheritance check when a method is overloaded (from a
15710         virtual method or when implementing an interface) and when a class is
15711         inherited. Added functions to set a failure for a class and to 
15712         retreive the exception from a failure.
15713         * class-internals.h: Added fields to MonoClass to keep the exception
15714         information status for inheritance (or other exceptions) to be thrown
15715         later (i.e. not at load time).
15716         * object.c: Throw the inheritance SecurityException when a type is to 
15717         be created with either class or method inheritance violations.
15718         * reflection.c|h: Fix when getting declsec from a class. Removed 
15719         unrequired code for class. Improved sanity in parameter naming.
15720         * security-manager.c|h: Added functions to check for class and method
15721         inheritance.
15722
15723 2005-02-17  Zoltan Varga  <vargaz@freemail.hu>
15724
15725         * reflection.c (mono_reflection_create_runtime_class): Set has_cctor
15726         and has_finalize in dynamic types as well.
15727
15728 2005-02-17  Atsushi Enomoto  <atsushi@ximian.com>
15729
15730         * culture-info-table.h : fixed currency format for en-GB (and so on).
15731
15732 Wed Feb 16 16:28:15 CET 2005 Paolo Molaro <lupus@ximian.com>
15733
15734         * gc.c: ensure the GC handles never have 0 as a value.
15735
15736 2005-02-16  Zoltan Varga  <vargaz@freemail.hu>
15737
15738         * marshal.c (emit_marshal_ptr): Raise an exception if trying to pass
15739         a pointer to a struct to unmanaged code. Fixes #72625.
15740
15741 2005-02-16  Martin Baulig  <martin@ximian.com>
15742
15743         * mono-debug.c (mono_debug_open_image): Ignore dynamic images.
15744
15745 2005-02-16  Zoltan Varga  <vargaz@freemail.hu>
15746
15747         * marshal.c (emit_marshal_array): Only marshal unicode char arrays as [Out].
15748
15749 2005-02-15  Zoltan Varga  <vargaz@freemail.hu>
15750
15751         * loader.c (mono_lookup_pinvoke_call): Fix stdcall name mangling.
15752
15753         * marshal.c (mono_ftnptr_to_delegate): If the delegate has the 
15754         UnmanagedFunctionPointerAttribute, use it for determining calling convention
15755         etc. Fixes #71471.
15756
15757         * reflection.c (mono_custom_attrs_get_attr): New helper function.
15758
15759         * object-internals.h: Add MonoReflectionUnmanagedFunctionPointerAttribute.
15760
15761 Tue Feb 15 18:03:41 CET 2005 Paolo Molaro <lupus@ximian.com>
15762
15763         * domain.c, appdomain.c, appdomain.h, object-internals.h, object.h:
15764         changes to make the current context a field in MonoThread.
15765
15766 2005-02-15  Zoltan Varga  <vargaz@freemail.hu>
15767
15768         * marshal.c (mono_marshal_get_native_wrapper): Fix a crash caused by
15769         the last change.
15770         
15771         * marshal.c (mono_marshal_emit_native_wrapper): New helper function
15772         extracted from mono_marshal_get_native_wrapper.
15773
15774         * marshal.c (mono_marshal_get_native_func_wrapper): New helper function
15775         to create wrappers around native functions.
15776
15777         * marshal.c (mono_ftnptr_to_delegate): Add support for creating 
15778         delegates for arbitrary function pointers. Fixes #71472.
15779
15780 Tue Feb 15 11:01:09 CET 2005 Paolo Molaro <lupus@ximian.com>
15781
15782         * threads.c: cleaned up the code a little.
15783
15784 2005-02-15  Martin Baulig  <martin@ximian.com>
15785
15786         * mono-debug.h (MonoSymbolTable): Allow variable-length chunks in
15787         the data table.
15788
15789         * mono-debug.c (DATA_TABLE_CHUNK_SIZE): Set to 32768; we may now
15790         allocate larger chunks if needed.
15791
15792 2005-02-14  Zoltan Varga  <vargaz@freemail.hu>
15793
15794         * threads.c (start_wrapper): Remove #ifdef PLATFORM_WIN32 probably left
15795         in by mistake.
15796
15797 Mon Feb 14 16:48:24 CET 2005 Paolo Molaro <lupus@ximian.com>
15798
15799         * domain.c: keep the domains in an array and ensure the domain ids
15800         are kept small, so they can be used as indexes to domain-specific data
15801         with a small memory overhead.
15802
15803 2005-02-14  Zoltan Varga  <vargaz@freemail.hu>
15804
15805         * icall.c: Handle byref types in Type icalls. Fixes #72544.
15806
15807 Mon Feb 14 15:39:56 CET 2005 Paolo Molaro <lupus@ximian.com>
15808
15809         * Makefile.am: remove libmetadata: we build just libmonoruntime now.
15810
15811 2005-02-13  Zoltan Varga  <vargaz@freemail.hu>
15812
15813         * tabledefs.h (MANIFEST_RESOURCE_VISIBILITY_MASK): Add flags for ManifestResource.
15814
15815         * loader.c (mono_lookup_pinvoke_call): Correct the search order used for different CharSet
15816         values.
15817
15818         * marshal.c (mono_marshal_get_string_encoding): CHAR_SET_AUTO means Unicode on windows.
15819         
15820 2005-02-12  Ben Maurer  <bmaurer@ximian.com>
15821
15822         * domain-internals.h: add the hashtable here.
15823
15824         * class-internals.h: Remove `info' from MonoMethod
15825
15826         * domain.c: Add a new hashtable, jit_trampoline_hash
15827
15828 Fri Feb 11 17:11:20 CET 2005 Paolo Molaro <lupus@ximian.com>
15829
15830         * object.c: don't set the value of static fields
15831         (fixes bug#72494).
15832
15833 2005-02-11  Martin Baulig  <martin@ximian.com>
15834
15835         * mono-debug.c (DATA_TABLE_CHUNK_SIZE): Increase to 131072.
15836         (mono_debug_add_method): Silently ignore the method if it's too big.
15837         (mono_debug_add_type): Likewise.
15838
15839 Fri Feb 11 16:22:10 CET 2005 Paolo Molaro <lupus@ximian.com>
15840
15841         * threads.c, appdomain.c: remove #ifdefs from the code.
15842
15843 2005-02-10  Sebastien Pouliot  <sebastien@ximian.com>
15844
15845         * metadata-internals.h: Added flags to MonoAssembly to cache the most
15846         common security informations. This allows us to stay in unmanaged code
15847         when doing LinkDemand and it's special cases (except for the first 
15848         time for initialization). The flags a very much used with --security.
15849         * reflection.c|h: Added code to get declarative security attributes 
15850         for LinkDemand and InheritanceDemand. This required to refactor the
15851         existing code for Demand.
15852         * security-manager.c|h: Added new method fields for the special cases
15853         of LinkDemand.
15854
15855 2005-02-10  Martin Baulig  <martin@ximian.com>
15856
15857         * icall.c (ves_icall_MonoDebugger_MakeArrayType): New interncall.
15858         (ves_icall_MonoDebugger_GetTypeToken): New interncall.
15859
15860 2005-02-10  Martin Baulig  <martin@ximian.com>
15861
15862         * mono-debug.c, mono-debug-debugger.c: Completely reworked the
15863         debugging code; this is almost a complete rewrite.
15864
15865         * icall.c (ves_icall_MonoDebugger_GetMethodIndex): New interncall.
15866
15867 Thu Feb 10 15:19:01 CET 2005 Paolo Molaro <lupus@ximian.com>
15868
15869         * domain.c, object.h: expose mono_string_equal () and 
15870         mono_string_hash ().
15871         * icall.c, string-icalls.c: remove the string.GetHashCode () icall,
15872         it's implemented in managed code.
15873
15874 Thu Feb 10 15:03:46 CET 2005 Paolo Molaro <lupus@ximian.com>
15875
15876         * icall.c, gc.c, gc-internal.h: make sure gchandles can't be used
15877         lo leak objects between appdomains.
15878
15879 Thu Feb 10 14:25:00 CET 2005 Paolo Molaro <lupus@ximian.com>
15880
15881         * assembly.c: old compilers compilation fix from 
15882         robertj@gmx.net (Robert Jordan).
15883
15884 2005-02-09  Ben Maurer  <bmaurer@ximian.com>
15885
15886         * class-internals.h: Little reminder for the future.
15887
15888         * debug-helpers.c: Fix up wrapper_type_names
15889
15890 Wed Feb 9 19:34:29 CET 2005 Paolo Molaro <lupus@ximian.com>
15891
15892         * image.c, metadata-internals.h: when loading an image from a file,
15893         mmap all of it and use the same codepaths as when using a
15894         in-memory image: the code is simpler and we use less memory
15895         (both writable and readonly).
15896
15897 Wed Feb 9 18:32:51 CET 2005 Paolo Molaro <lupus@ximian.com>
15898
15899         * gc-internal.h, null-gc.c, boehm-gc.c: added functions to the GC
15900         API to alloc runtime data structures that need to be tracked by the
15901         GC and contain pointers.
15902         * appdomain.c, threads.c, object.c, gc.c: use the above changes to
15903         make the code more readable and eventually use a different GC.
15904
15905 2005-02-09  Zoltan Varga  <vargaz@freemail.hu>
15906
15907         * marshal.c (emit_marshal_vtype): Don't do managed->native conversion
15908         for out arguments.
15909         
15910 2005-02-09  Lluis Sanchez Gual  <lluis@novell.com>
15911
15912         * object.c: In release_type_locks(), don't release the cctor lock
15913         if it has already been released. This fixes a crash in the
15914         thread5 test.
15915
15916 Tue Feb 8 19:02:59 CET 2005 Paolo Molaro <lupus@ximian.com>
15917
15918         * gc.c, marshal.c, icall.c: register a delegate for finalization
15919         only when the native function pointer has been allocated for it.
15920
15921 Tue Feb 8 18:12:27 CET 2005 Paolo Molaro <lupus@ximian.com>
15922
15923         * object.c: cleaned up some code, allocate objects that are
15924         pointer free with the atomic malloc variant. Allocate memory
15925         for static data from the mempool if it's pointer-free.
15926         Allocate the bounds array at the end of the array data, when needed.
15927         * object-internals.h, object.h: move a private function in a private
15928         header.
15929         * class.c: handle missing case in tracking references in fields.
15930
15931 Tue Feb 8 18:04:51 CET 2005 Paolo Molaro <lupus@ximian.com>
15932
15933         * class.c, class-internals.h: keep track if a type has
15934         reference fields in either the instance or static fields.
15935
15936 2005-02-07  Lluis Sanchez Gual  <lluis@novell.com>
15937
15938         * domain.c, domain-internals.h: Moved RuntimeInfo to domain-internals.h,
15939         and renamed to MonoRuntimeInfo. Added fields to store the expected
15940         framework assembly version. Changed mono_get_framework_version and
15941         mono_get_runtime_version for a single mono_get_runtime_info method.
15942         
15943         * assembly.c: Added method to remap system assembly versions to the
15944         current executing runtime version. Removed old mapping code.
15945         Remap assembly versions in mono_assembly_load and mono_assembly_loaded.
15946         
15947         * icall.c, reflection.c: Track api changes.
15948
15949 2005-02-06  Miguel de Icaza  <miguel@novell.com>
15950
15951         * loader.c (method_from_memberref): Improve error reporting,
15952         produce the class name instead of the typeref/typedef index. 
15953
15954 2005-02-07  Zoltan Varga  <vargaz@freemail.hu>
15955
15956         * marshal.c (mono_marshal_get_stfld_remote_wrapper): Fix wrapper type.
15957
15958 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
15959
15960         * loader.c (mono_lookup_pinvoke_call): Allow for combination of
15961         stdcall and charset name mangling.  Reorganize the code and add
15962         some tracing stuff.
15963
15964 2005-02-05  Ben Maurer  <bmaurer@ximian.com>
15965
15966         * monodiet.c: More iters!
15967
15968         * marshal.c: Iter usage.
15969
15970         * icall.c: Iter usage.
15971
15972         * object.c: Use iters.
15973
15974         * debug-helpers.c: More iters
15975
15976 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
15977
15978         * loader.c (mono_lookup_pinvoke_call): Add brute-force checking for mangled function names
15979         under win32.
15980
15981 2005-02-05  Ben Maurer  <bmaurer@ximian.com>
15982
15983         * mono-debug-debugger.c: use iters
15984
15985         * class.c, class-internals.h: mono_class_setup_events is static
15986         now
15987
15988         * All callers: use iters
15989
15990 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
15991
15992         * class.c string-icalls.c marshal.c reflection.c: Applied patch from
15993         Robert Jordan (robertj@gmx.net). Fix compilation errors under gcc-2.95.
15994
15995 2005-02-04  Zoltan Varga  <vargaz@freemail.hu>
15996
15997         * object.c (mono_class_proxy_vtable): Add missing _setup () calls.
15998
15999         * marshal.h: Add prototypes for ldfld/stfld_remote.
16000
16001         * appdomain.c (mono_domain_fire_assembly_load): Handle the case when
16002         this is called during startup.
16003         
16004 Fri Feb 4 20:27:58 CET 2005 Paolo Molaro <lupus@ximian.com>
16005
16006         * appdomain.c, monitor.c, monitor.h, threads-types.h: made the
16007         MonoThreadsSync struct private in monitor.c. Changed the way
16008         MonoThreadsSync is allocated so it's faster and there is no
16009         need to keep track of it with a finalizer and it uses less memory.
16010         This also finally allows us to allocate mono objects as ptrfree when
16011         there are no reference fields.
16012
16013 Fri Feb 4 20:24:03 CET 2005 Paolo Molaro <lupus@ximian.com>
16014
16015         * gc.c, null-gc.c, boehm-gc.c, gc-internal.h: added functions to deal with
16016         disappearing link to the GC interface and use them to simplify
16017         the gchandles code.
16018
16019 2005-02-04  Zoltan Varga  <vargaz@freemail.hu>
16020
16021         * class-internals.h marshal.c: Add two new wrappers, ldfld_remote and
16022         stfld_remote which call mono_load/store_field_new. This allows methods
16023         calling ldfld/stfld wrappers to be AOTed.
16024
16025         * console-io.c: Include sys/filio.h under solaris.
16026         
16027         * console-io.c: Include curses.h if needed correctly.
16028
16029 2005-02-03  Zoltan Varga  <vargaz@freemail.hu>
16030         
16031         * icall.c (ves_icall_MonoMethod_get_base_definition): Initialize
16032         method->klass as well.
16033
16034         * class-internals.h (MonoCachedClassInfo): Add 'finalize_image' field.
16035
16036         * class.c (mono_class_init): Switch on lazy initialization of 
16037         methods.
16038
16039         * class.c (mono_class_get_finalizer): Handle the case when the 
16040         finalizer is inherited.
16041
16042 2005-02-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16043
16044         * console-io.c: <curses.h> is needed by term.h on solaris.
16045
16046 2005-02-03  Ben Maurer  <bmaurer@ximian.com>
16047
16048         * icall.c, class-internals.h, monodiet.c, class.c: Remove
16049         mono_class_setup_properties where possible. Remove this ftn from
16050         the header file, and make it static.
16051
16052 2005-02-03  Zoltan Varga  <vargaz@freemail.hu>
16053
16054         * loader.c: Add missing setup_... call.
16055
16056         * class.c: Add missing setup_... calls.
16057
16058         * class.c (mono_class_init): Switch on lazy initialization of 
16059         the generic vtable.
16060         
16061         * class.c (mono_class_init): Fix generics broken by the recent changes.
16062
16063         * monodiet.c (handle_type): Add missing setup_... calls.
16064
16065         * class.c: Back out garbage in previous patch.
16066         
16067         * class.c: Add missing setup_... calls.
16068
16069         * class.c (mono_class_get_method_from_name_flags): Avoid calling
16070         mono_class_setup_methods () if possible.
16071
16072         * class-internals.h (MonoClass): Add 'has_cctor' flag.
16073
16074         * class-internals.h (MonoCachedClassInfo): New structure.
16075
16076         * class.c: Initialize properties and events fields of MonoClass lazily.
16077
16078         * class.c: Add infrastructure for lazily initializing the methods and
16079         vtable fields of MonoClass. Not yet used.
16080
16081         * class.c (mono_class_get_finalizer): New helper function.
16082
16083         * class.c: Add infrastructure for loading some class related data from
16084         an AOT file.
16085
16086         * object.c: Add infrastructure for initializing the vtable from data
16087         in the AOT file.
16088
16089         * gc.c (run_finalize): Use mono_class_get_finalizer ().
16090
16091         * class.c loader.c object.c icall.c gc.c reflection.c: Call the
16092         appropriate initialization function before accessing parts of the
16093         MonoClass structure.
16094
16095         * marshal.c: Fix warnings.
16096         
16097         * marshal.c (emit_marshal_array): Add missing 'break'. Fixes #72169.
16098
16099         * mono-debug-debugger.c (get_exception_message): Use 
16100         mono_class_get_method_from_name_flags ().
16101
16102 2005-02-02  Ben Maurer  <bmaurer@ximian.com>
16103
16104         * reflection.c, appdomain.c: Replace a few manual searches that
16105         Zoltan missed. (Paolo approved this part of my initial patch).
16106
16107 Wed Feb 2 16:32:08 CET 2005 Paolo Molaro <lupus@ximian.com>
16108
16109         * profiler.c: disable recording statistical events at report time.
16110
16111 Wed Feb 2 14:14:00 CET 2005 Paolo Molaro <lupus@ximian.com>
16112
16113         * icall.c: patch from Geoff Norton <gnorton@customerdna.com>
16114         to byteswap arrays of enum values, too (bug #72080).
16115
16116 2005-02-02  Zoltan Varga  <vargaz@freemail.hu>
16117
16118         * appdomain.c (set_domain_search_path): Allow this to be called if
16119         domain->setup is not yet set.
16120
16121         * loader.c (mono_method_get_index): New helper function.
16122
16123         * loader.c reflection.c: Use mono_method_get_index ().
16124
16125         * class.c (mono_class_get_method_from_name_flags): New helper method.
16126
16127         * debug-helpers.h debug-helpers.c (mono_find_method_by_name): Remove
16128         this.
16129
16130         * class.c (mono_class_get_cctor): New helper method.
16131
16132         * string-icalls.c object.c class.c marshal.c reflection.c: Use
16133         mono_class_get_method () to look up methods.
16134
16135 2005-02-01  Miguel de Icaza  <miguel@novell.com>
16136
16137         * console-io.c: Fix the build, this should work on Windows.
16138
16139 2005-01-31  Ben Maurer  <bmaurer@ximian.com>
16140
16141         * marshal.c (mono_marshal_xdomain_copy_out_value): cached_str must
16142         be set to null to keep things valid
16143
16144 2005-01-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16145
16146         * icall.c: added Console 2.0 icalls.
16147         * Makefile.am: added console-io.[ch]
16148         * console-io.[ch]: internal calls for Console 2.0 API.
16149
16150 Mon Jan 31 19:01:29 CET 2005 Paolo Molaro <lupus@ximian.com>
16151
16152         * class.c: make sure we consider all the interfaces
16153         when calculating max_interface_id (bug found by
16154         Jeroen Frijters running ikvm).
16155
16156 2005-01-31  Zoltan Varga  <vargaz@freemail.hu>
16157
16158         * icall.c (ves_icall_FieldInfo_SetValueInternal): Handle setting of
16159         valuetype fields to null.
16160
16161         * object.c (set_value): Ditto. Fixes #71669.    
16162
16163 2005-01-31  Martin Baulig  <martin@ximian.com>
16164
16165         * metadata.c (mono_metadata_has_generic_params): New public
16166         function; checks whether something is a generic method.
16167
16168 Sun Jan 30 20:19:48 CET 2005 Paolo Molaro <lupus@ximian.com>
16169
16170         * appdomain.c: fix infinite recursion when adding assemblies.
16171
16172 2005-01-30  Sebastien Pouliot  <sebastien@ximian.com>
16173
16174         * object.c: Fix small typo to return all items for Environment.
16175         GetCommandLineArgs.
16176
16177 Sun Jan 30 16:49:01 CET 2005 Paolo Molaro <lupus@ximian.com>
16178
16179         * domain.c, appdomain.c, assembly.c, image.c, domain-internals.h,
16180         reflection.c: more domain and assembly-unload related fixes
16181         and memory leaks plugs.
16182
16183 2005-01-30  Zoltan Varga  <vargaz@freemail.hu>
16184
16185         * 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.
16186
16187 2005-01-29  Ben Maurer  <bmaurer@ximian.com>
16188
16189         * loader.c (mono_method_signature): Make this method lazy
16190         (mono_get_method_from_token): Don't computate the signature here.
16191
16192         Doing this saves quite a bit of memory. I got 90 kb on starting up
16193         monodoc. It should also save some disk reads on startup.
16194
16195         * *: MonoMethod->signature might be NULL now. You *MUST* use
16196         mono_method_signature.
16197
16198 2005-01-29  Zoltan Varga  <vargaz@freemail.hu>
16199
16200         * object.c (mono_runtime_get_main_args): Return an array from the
16201         current domain here. Fixes #71938.
16202
16203 Sat Jan 29 15:59:05 CET 2005 Paolo Molaro <lupus@ximian.com>
16204
16205         * monitor.c: formatting changes to comply with the
16206         mono coding style and remove #ifdefs from the code.
16207
16208 Sat Jan 29 15:18:54 CET 2005 Paolo Molaro <lupus@ximian.com>
16209
16210         * metadata.c, private.h: remove some unneeded data
16211         and use a more compact representation for table schemas.
16212
16213 Fri Jan 28 18:23:44 CET 2005 Paolo Molaro <lupus@ximian.com>
16214
16215         * metadata.c, metadata-internals.h: add mono_aligned_addr_hash()
16216         to get a better distribution in hash tables.
16217         * *.c: use mono_aligned_addr_hash() where appropriate.
16218         * assembly.c: make var static.
16219
16220 2005-01-28  Zoltan Varga  <vargaz@freemail.hu>
16221
16222         * domain-internals.h: Put MonoJitInfo on a diet.
16223
16224         * domain.c: Fix a warning.
16225
16226 Wed Jan 26 22:20:46 CET 2005 Paolo Molaro <lupus@ximian.com>
16227
16228         * gc.c: rework the gc handles code to reuse handles
16229         when freed.
16230
16231 Wed Jan 26 17:34:09 CET 2005 Paolo Molaro <lupus@ximian.com>
16232
16233         * domain.c: fixed long standing bug in mono_string_equal() which
16234         was brought to light with the ldstr changes.
16235
16236 2005-01-26  Sebastien Pouliot  <sebastien@ximian.com>
16237
16238         * reflection.c: Remove warning by adding missing include for marshal.h
16239
16240 Tue Jan 25 18:06:00 CET 2005 Paolo Molaro <lupus@ximian.com>
16241
16242         * domain.c, object.c: change the ldstr_table to hold
16243         MonoString* as keys: makes the runtime isinterned lookup
16244         faster and simplifies memory management.
16245
16246 2005-01-25  Sebastien Pouliot  <sebastien@ximian.com> 
16247  
16248         * icall.c: Renamed GetEnvironmentVariable so internal* so it was
16249         possible to add imperative security checks before calling the icall.
16250         * reflection.c: Return security attributes on the original MonoMethod
16251         (and not the wrapped one). This fix permissions on icalls.
16252
16253 2005-01-25  Dick Porter  <dick@ximian.com>
16254
16255         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Make
16256         the check for mktime() support actually test the mktime() return
16257         value.  "Fixes" bug 71682, though the output is still different to
16258         MS.
16259
16260 2005-01-25  Martin Baulig  <martin@ximian.com>
16261
16262         * class.c (mono_class_is_assignable_from): Make this work for
16263         generic instances.
16264
16265 2005-01-24  Ben Maurer  <bmaurer@ximian.com>
16266
16267         * marshal.c (mono_string_utf8_to_builder)
16268         (mono_string_builder_to_utf16): We might not have ownership of the
16269         string. In thise case, we need to create a new buffer.
16270
16271         * object-internals.h (mono_stringbuilder_capacity): sb->str might
16272         be null, in which case, use the default capacity.
16273
16274 Mon Jan 24 16:42:29 CET 2005 Paolo Molaro <lupus@ximian.com>
16275
16276         * gc-internal.h, null-gc.c, profiler.c, boehm-gc.c: hook the
16277         GC events to the profiler.
16278
16279 Mon Jan 24 15:59:54 CET 2005 Paolo Molaro <lupus@ximian.com>
16280
16281         * gc.c: remove valgrind detection nonsense. Set GC_DONT_GC
16282         if you don't want the GC to run.
16283
16284 Mon Jan 24 15:53:25 CET 2005 Paolo Molaro <lupus@ximian.com>
16285
16286         * Makefile.am, gc.c, mono-gc.h, boehm-gc.c, null-gc.c, gc-internal.h:
16287         start providing a GC API and keeping different implementations in
16288         their own file.
16289         * profiler.h, profiler.c, profiler-private.h: provide the GC events API.
16290
16291 2005-01-22  Ben Maurer  <bmaurer@ximian.com>
16292
16293         * debug-mono-symfile.c (mono_debug_open_mono_symbol_file): Use
16294         mmap rather than allocating a huge buffer.
16295         (mono_debug_close_mono_symbol_file): Free the buffer allocated
16296         above.
16297
16298 2005-01-22  Sebastien Pouliot  <sebastien@ximian.com>
16299
16300         * icall.c: Add new internal calls for SecurityManager.SecurityEnabled
16301         and CheckExecutionRights.
16302         * reflection.c|h: Keep the index of the declarative security to be 
16303         used, instead of the pointer, when AOT compiler is used. Also add 
16304         class initialization when requesting demands.
16305         * security-manager.c|h: Implement SecurityManager.SecurityEnabled and
16306         CheckExecutionRights. Both properties are now FALSE by default, and
16307         unmodifiable, unless the --security option is used.
16308
16309 Fri Jan 21 15:29:27 CET 2005 Paolo Molaro <lupus@ximian.com>
16310
16311         * domain.c, appdomain.c, assembly.c, image.c, metadata-internals.h,
16312         reflection.c: properly refcount images and assemblies, many leaks fixed.
16313
16314 2005-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16315
16316         * threadpool.c: increase the timeout for threads in the thread pool to
16317         10s.  Fixes bug #67159.
16318
16319 2005-01-20  Bernie Solomon  <bernard@ugsolutions.com>
16320
16321         * class-internals.h: Sun's compiler insists on explicit
16322         signed on bit fields to handle then correctly.
16323
16324 2005-01-19  Miguel de Icaza  <miguel@ximian.com>
16325
16326         * file-io.c (ves_icall_System_IO_MonoIO_get_InvalidPathChars):
16327         Make the size of the array fit only the number of invalid path
16328         chars that we have.
16329
16330         * class.c (_mono_class_get): Improve the error reporting when a
16331         class referenced is not found, to assist debugging. 
16332
16333 Wed Jan 19 19:57:43 CET 2005 Paolo Molaro <lupus@ximian.com>
16334
16335         * threads.c: fix off-by-one error.
16336         * domain.c: free data allocated in the domain.
16337
16338 2005-01-19  Zoltan Varga  <vargaz@freemail.hu>
16339
16340         * reflection.c (mono_method_body_get_object): Fill out exception info
16341         as well.
16342
16343         * object-internals.h: Add MonoReflectionExceptionHandlingClause 
16344         structure.
16345         
16346 2005-01-19  Martin Baulig  <martin@ximian.com>
16347
16348         * loader.c (mono_get_method_constrained): Make this work again.
16349
16350 2005-01-19  Zoltan Varga  <vargaz@freemail.hu>
16351
16352         * object-internals.h (_MonoReflectionMethodBody): Make local_index a 
16353         guint16 to match the managed side.
16354
16355         * reflection.c (mono_reflection_body_get_object): Fill out local
16356         variables array.
16357
16358         * reflection.c (mono_method_body_get_object): Fill out local_var_sig_token
16359         as well.
16360
16361         * object-internals.h (_MonoReflectionMethodBody): Rename 'sig_token' to
16362         'local_var_sig_token'.
16363
16364 2005-01-18  Zoltan Varga  <vargaz@freemail.hu>
16365
16366         * loader.c (mono_lookup_pinvoke_call): Revert the previous patch as it breaks 
16367         System.Drawing.
16368
16369         * reflection.c (mono_method_body_get_object): Handle abstract and
16370         runtime methods.
16371
16372 Mon Jan 17 19:22:39 CET 2005 Paolo Molaro <lupus@ximian.com>
16373
16374         * marshal.c, loader.c, class-internals.h, reflection.c:
16375         store the emthod data for a wrapper in an array instead of a list.
16376
16377 Mon Jan 17 18:48:53 CET 2005 Paolo Molaro <lupus@ximian.com>
16378
16379         * marshal.c: change the code to allocate memory more
16380         conservatively for method wrappers.
16381
16382 Mon Jan 17 18:03:30 CET 2005 Paolo Molaro <lupus@ximian.com>
16383
16384         * class-internals.h, marshal.c: move the str_to_ptr and ptr_to_str
16385         fields from MonoClass to the marshal info structure where they belong.
16386
16387 Mon Jan 17 16:14:46 CET 2005 Paolo Molaro <lupus@ximian.com>
16388
16389         * class.c, object.c, class-internals.h, marshal.c: rearrange
16390         some fields and tweak some types to lower memory usage.
16391
16392 2005-01-17  Zoltan Varga  <vargaz@freemail.hu>
16393
16394         * threads.c (signal_thread_state_change): Handle the case when the
16395         target thread is the current thread.
16396
16397         * marshal.c (mono_struct_delete_old): Do not free lpwstr fields.
16398
16399         * marshal.c: Rename emit_ptr_to_str_conv and its pair to 
16400         emit_ptr_to_object_conv. 
16401
16402         * marshal.c (emit_ptr_to_object_conv): Add support for lpwstr->str
16403         marshalling. Fixes #71352.
16404
16405 Mon Jan 17 10:59:20 CET 2005 Paolo Molaro <lupus@ximian.com>
16406
16407         * metadata.h, blob.h: move table enum to blob.h so it can be included
16408         in any header.
16409         * image.c, metadata.c, metadata-internals.h, pedump.c, reflection.c:
16410         cut the size of MonoImage/MonoDynamicImage.
16411
16412 2005-01-16  Zoltan Varga  <vargaz@freemail.hu>
16413
16414         * profiler.c (mono_profiler_install_simple): Fix default arguments.
16415
16416 Sun Jan 16 12:25:22 CET 2005 Paolo Molaro <lupus@ximian.com>
16417
16418         * reflection.c, reflection.h, icall.c: add a function to check
16419         if an attribute type is defined for a metadata object.
16420
16421 2005-01-14  Lluis Sanchez Gual  <lluis@novell.com>
16422
16423         * object-internals.h: Added some needed fields from StringBuilder class.
16424         * marshal.c: Set the maxCapacity when creating a StringBuilder.
16425
16426 2005-01-13  Zoltan Varga  <vargaz@freemail.hu>
16427
16428         * icall.c (ves_icall_System_Environment_Exit): Suspend all managed
16429         threads before shutting down the runtime.
16430
16431         * threads.c (mono_thread_suspend_all_other_threads): New helper function.
16432
16433 Thu Jan 13 18:16:35 CET 2005 Paolo Molaro <lupus@ximian.com>
16434
16435         * object-internal.h, threads.c: implement stacksize and 
16436         parameterized thread start functionality (requires
16437         matching corlib). Marked broken code for later removal.
16438
16439 2005-01-12  Martin Baulig  <martin@ximian.com>
16440
16441         * class-internals.h (MonoGenericClass): Moved the `initialized'
16442         flag to MonoDynamicGenericClass, removed `init_pending'.
16443         (MonoGenericInst): Added `is_reference' flag.
16444
16445 2005-01-12  Zoltan Varga  <vargaz@freemail.hu>
16446
16447         * reflection.c (mono_image_create_pefile): Only set the pe_offset
16448         inside the MSDOS header. Fixes #71201.
16449
16450         * gc.c (mono_gc_cleanup): Handle the case when this is called from the
16451         gc thread.
16452         (mono_domain_finalize): Ditto.
16453
16454 2005-01-12  Martin Baulig  <martin@ximian.com>
16455
16456         * class.c (mono_get_shared_generic_class): Use the cache for
16457         non-dynamic generic classes.
16458
16459         * class-internals.h (mono_class_create_generic_2): Removed
16460         function prototype, this function is now static inside class.c.
16461
16462         * class.c (mono_class_create_generic_2): Made this static, only
16463         call it from mono_class_init() and mono_class_setup_parent().
16464         (collect_implemented_interfaces_aux): Call mono_class_init() on
16465         the interfaces we collect.
16466         (mono_class_setup_vtable): Call mono_class_init (class->parent).
16467
16468 2005-01-11  Zoltan Varga  <vargaz@freemail.hu>
16469
16470         * threads.c (mono_thread_attach): Call DuplicateHandle on the thread handle on win32 to make
16471         it a real thread handle.
16472
16473         * domain-internals.h: Move exvar_offset from MonoJitInfo to 
16474         MonoJitExceptionInfo, since each catch clause needs its own variable.
16475         
16476 2005-01-11  Dick Porter  <dick@ximian.com>
16477
16478         * image.c (mono_pe_file_open): New variant on mono_image_open()
16479         that does not set up the CLI metadata; used for FileVersionInfo so
16480         it can get the data for windows binaries too.
16481         
16482         * process.c (process_read_string_block): Don't read off the end of
16483         the StringTable block.
16484
16485         These both fix bug 70766.
16486
16487 Tue Jan 11 15:26:00 CET 2005 Paolo Molaro <lupus@ximian.comt>
16488
16489         * gc.c: set some fields to NULL at GC cleanup time.
16490         * threads.c: if we quit the main thread, call exit ().
16491
16492 2005-01-11  Zoltan Varga  <vargaz@freemail.hu>
16493
16494         * threads.c (interruption_request_apc): Decore APC callbacks with CALLBACK under win32.
16495
16496 Mon Jan 10 18:47:28 CET 2005 Paolo Molaro <lupus@ximian.com>
16497
16498         * threads.h, threads.c, object.c: added accessor and settor for
16499         main_thread. Handle it specially when exiting from it: wait
16500         for other foreground threads to exit.
16501
16502 Mon Jan 10 12:06:18 CET 2005 Paolo Molaro <lupus@ximian.com>
16503
16504         * process.c, verify.c: remove some bloat.
16505
16506 2005-01-09  Zoltan Varga  <vargaz@freemail.hu>
16507
16508         * loader.c (mono_lookup_pinvoke_call): If we found the function without name mangling, change
16509         the calling convention to cdecl under win32.
16510
16511 2005-01-08  Ben Maurer  <bmaurer@ximian.com>
16512
16513         * object.c (mono_object_get_size): New function to get the size of
16514         an object instance.
16515
16516         * profiler.c (simple_allocation): Use above.
16517
16518 2005-01-08  Sebastien Pouliot  <sebastien@ximian.com>
16519
16520         * appdomain.c: Replaced ves_icall_System_AppDomain_getDomainByID by
16521         ves_icall_System_AppDomain_getRootDomain (as it's not required to
16522         get an appdomain by it's id and we can't assume the root's id is 0).
16523         * domain-internals.h: Change the function prototype to match.
16524         * icall.c: Change the icall table for AppDomain.
16525
16526 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
16527
16528         * locales.c (string_invariant_compare_char): Only compute
16529         GUnicodeTypes in the case where we need them.  Test for ordinality
16530         first and return if so.
16531
16532         From the commit:
16533
16534                 /*
16535                  * FIXME: here we must use the information from c1type and c2type
16536                  * to find out the proper collation, even on the InvariantCulture, the
16537                  * sorting is not done by computing the unicode values, but their
16538                  * actual sort order.
16539                  */
16540
16541 Sat Jan 8 19:03:26 CET 2005 Paolo Molaro <lupus@ximian.com>
16542
16543         * loader.c: for P/Invoke methods, allow the "Internal" shared
16544         library name to refer to the calling process symbol namespace.
16545
16546 2005-01-07  Sebastien Pouliot  <sebastien@ximian.com>
16547
16548         * Makefile.am: Add the security manager to the build.
16549         * security-manager.c|h: New. Initialization of the security manager.
16550
16551 2005-01-07  Dick Porter  <dick@ximian.com>
16552
16553         * threads.c: 
16554         * monitor.c: Update thread state during Monitor and WaitHandle
16555         waits.  Fixes bug 71031.
16556
16557 2005-01-07  Zoltan Varga  <vargaz@freemail.hu>
16558
16559         * reflection.c (property_encode_signature): Correctly handle when the
16560         property has no methods.
16561
16562 2005-01-06  Zoltan Varga  <vargaz@freemail.hu>
16563
16564         * reflection.c (reflection_methodbuilder_to_mono_method): Remove debug stuff.
16565         
16566         * reflection.c (reflection_methodbuilder_from_method_builder): Copy
16567         fields from mb, not rmb. Fixes #71017.
16568
16569         * marshal.c (emit_ptr_to_str_conv): Add support for 
16570         ByValTStr -> string conversion. Fixes #71015.
16571
16572         * appdomain.c (mono_domain_owns_vtable_slot): New helper function.
16573
16574         * mempool.c (mono_mempool_contains_addr): New helper function.
16575
16576 2005-01-05  Zoltan Varga  <vargaz@freemail.hu>
16577
16578         * metadata.c (mono_metadata_compute_size): Fix size calculation of
16579         HasSematics encoded fields.
16580         
16581         * metadata.c (mono_type_to_unmanaged): Improve error message for 
16582         invalid string marshalling.
16583
16584         * metadata.c: Fix warnings.
16585         
16586 Wed Jan 5 16:17:27 CET 2005 Paolo Molaro <lupus@ximian.com>
16587
16588         * profiler-private.h, profiler.c, profiler.h, gc.c: sample statistical
16589         profiler support.
16590
16591 2005-01-05  Zoltan Varga  <vargaz@freemail.hu>
16592
16593         * domain.c object.c domain-internals.h: Revert part of r38077 since the
16594         keys to proxy_vtable_hash are GCd objects. Fixes running the class lib
16595         tests.
16596
16597 2005-01-03  Zoltan Varga  <vargaz@freemail.hu>
16598
16599         * marshal.c: Use MONO_CLASSCONST instead of MONO_LDPTR in some places,
16600         so methods containing these can be AOTed.
16601
16602 2005-01-03  Martin Baulig  <martin@ximian.com>
16603
16604         * loader.c (find_method): Removed the hack for generic instances.
16605         (method_from_memberref): If our parent is a generic instance, pass
16606         its generic type definition to find_method() and then inflate the
16607         method.
16608         (mono_get_method_constrained): Pass the generic type definition to
16609         find_method() and inflate the method later.
16610
16611         * class-internals.h (MonoStats): Added `generic_class_count'.
16612
16613         * icall.c (ves_icall_MonoGenericMethod_get_reflected_type):
16614         Renamed to ves_icall_MonoGenericMethod_get_ReflectedType().
16615
16616         * reflection.c (mono_custom_attrs_from_params): Don't ignore
16617         generic type definitions.
16618
16619 2004-12-30  Zoltan Varga  <vargaz@freemail.hu>
16620
16621         * loader.c icall.c: Fix warnings.
16622
16623 2004-12-29  Zoltan Varga  <vargaz@freemail.hu>
16624
16625         * marshal.c (mono_marshal_get_managed_wrapper): Fix returning of
16626         blittable types. Fixes #70864.
16627
16628 2004-12-29  Martin Baulig  <martin@ximian.com>
16629
16630         * icall.c
16631         (ves_icall_MonoGenericMethod_get_reflected_type): New interncall.
16632
16633         * reflection.c (mono_method_get_object): Create a
16634         "System.Reflection.MonoGenericMethod" for inflated methods; don't
16635         call mono_get_inflated_method().
16636
16637         * class-internals.h (MonoStats): Added `inflated_method_count_2'.
16638
16639 2004-12-27  Martin Baulig  <martin@ximian.com>
16640
16641         * class-internals.h (MonoMethod): Added `is_inflated' flag.
16642         (MonoMethodInflated): Added `inflated' field.
16643
16644         * class.c (mono_class_inflate_generic_method): Don't really
16645         inflate the method here; just set the `is_inflated' flag in the
16646         MonoMethod.
16647         (mono_class_get_inflated_method): Actually inflate the method here
16648         if it's not already inflated; we use the MonoMethodInflated's new
16649         `inflated' field as a cache.
16650
16651 2004-12-26  Martin Baulig  <martin@ximian.com>
16652
16653         * class.c
16654         (inflate_generic_class): Moved some code out of inflate_generic_type().
16655         (mono_class_inflate_generic_method): If we're already inflated,
16656         inflate the context and use the declaring method; ie. make sure
16657         the declaring method of an inflated method is always the generic
16658         method definition.
16659         (mono_class_create_from_typedef): Create
16660         `class->generic_container->context->gclass'.
16661
16662 2004-12-24  Ben Maurer  <bmaurer@ximian.com>
16663
16664         * metadata-internals.h, marshal.c, reflection.c: More
16665         MonoGHashTable->GHashTable.
16666
16667         * domain-internals.h, class.c: Change MonoGHashTable's into
16668         GHashTables for some cases where no gc stuff is used
16669
16670         All users: update apis
16671
16672 2004-12-23  Ben Maurer  <bmaurer@ximian.com>
16673
16674         * metadata.c (builtin_types): Make this `const'. Makes this get
16675         put into the shareable section.
16676         (mono_metadata_init): Casts to make gcc happy.
16677
16678 2004-12-22  Zoltan Varga  <vargaz@freemail.hu>
16679
16680         * gc.c (mono_gc_init): Add a '\n' to the valgrind warning.
16681
16682 2004-12-21  Sebastien Pouliot  <sebastien@ximian.com> 
16683
16684         * icall.c: Added an internal call to retrieve the position and length
16685         of assembly-level declarative security attributes (RequestMinimum, 
16686         RequestOptional and RequestRefuse). This is used by the Assembly class
16687         to re-create the corresponding permission sets.
16688
16689 Tue Dec 21 14:50:31 CET 2004 Paolo Molaro <lupus@ximian.com>
16690
16691         * marshal.c: fix the stelemref wrapper to be type correct
16692         (and faster).
16693
16694 2004-12-20  Ben Maurer  <bmaurer@ximian.com>
16695
16696         * icall.c (ves_icall_System_Object_GetHashCode): There was no need
16697         to do key & 0x7fffffff. Hashtable already does this. It just
16698         results in longer code.
16699
16700 2004-12-20  Sebastien Pouliot  <sebastien@ximian.com>
16701
16702         * appdomain.c: Bump corlib version.
16703         * class-internals.h: Added RuntimeSecurityFrame to mono_defaults.
16704         * domain.c: Add RuntimeSecurityFrame to mono_defaults.
16705         * reflection.c|h: Add functions to get declarative security infos
16706         (blob position and length) for assemblies, classes and methods.
16707
16708 Mon Dec 20 15:28:54 CET 2004 Paolo Molaro <lupus@ximian.com>
16709
16710         * reflection.c: sort the constant table (bug #70693).
16711
16712 Mon Dec 20 12:19:37 CET 2004 Paolo Molaro <lupus@ximian.com>
16713
16714         * object-internals.h, threads.c, domain.c: add accessors for
16715         the MonoThread and MonoDomain tls keys.
16716
16717 2004-12-18  Martin Baulig  <martin@ximian.com>
16718
16719         * class.c (inflate_generic_type): If we're inflating a generic
16720         instance, set `ngclass->context->container = context->container';
16721         ie. the container we inflated into.
16722
16723         * metadata.c (mono_metadata_parse_generic_param): Reflect above
16724         inflate_generic_type() changes.
16725
16726 2004-12-17  Martin Baulig  <martin@ximian.com>
16727
16728         * class-internals.h
16729         (MonoGenericClass): Replaced `MonoType *generic_type' with
16730         `MonoClass *generic_class'.  Removed `dynamic_info'; if
16731         `is_dynamic' is true, we're a `MonoDynamicGenericClass'.
16732         (MonoDynamicGenericClass): Derive from `MonoGenericClass'.
16733
16734 2004-12-16  Zoltan Varga  <vargaz@freemail.hu>
16735
16736         * exception.c (mono_exception_from_token): New helper function.
16737
16738 2004-12-15  Zoltan Varga  <vargaz@freemail.hu>
16739
16740         * assembly.c (mono_assembly_load_with_partial_name): Call 
16741         mono_assembly_loaded before invoking the preload hooks. Fixes
16742         #70564.
16743
16744         * object-internals.h (MonoThread): Change culture_info and 
16745         ui_culture_info into an array.
16746
16747         * threads.c: Cache culture info objects from more than one appdomain.
16748
16749         * threads.c threads-types.h icall.c: Add icalls for manipulating the 
16750         current UI culture.
16751
16752 2004-12-14  Zoltan Varga  <vargaz@freemail.hu>
16753
16754         * threads.h threads.c appdomain.c: Clear the culture_info field of
16755         all threads during unloading if they point to an object in the dying
16756         appdomain.
16757
16758 2004-12-13  Ben Maurer  <bmaurer@ximian.com>
16759
16760         * culture-info.h (TextInfoEntry): New struct
16761         * object-internals.h: sync with managed
16762         * locales.c: fill the `text_info_data' field
16763         * culture-info-tables.h: update
16764
16765 Mon Dec 13 18:10:50 CET 2004 Paolo Molaro <lupus@ximian.com>
16766
16767         * Makefile.am, monodiet.c: add monodiet, an IL code garbage
16768         collector.
16769
16770 2004-12-12  Ben Maurer  <bmaurer@ximian.com>
16771
16772         * icall.c (ves_icall_ModuleBuilder_getToken): Check for null
16773         (ves_icall_ModuleBuilder_getMethodToken): Ditto
16774
16775 2004-12-12  Martin Baulig  <martin@ximian.com>
16776
16777         * mono-debug-debugger.c (write_type): If we're an enum and the
16778         builtin types have already been initialized, call mono_class_init().
16779
16780 2004-12-11  Martin Baulig  <martin@ximian.com>
16781
16782         * metadata.c (mono_metadata_load_generic_params): Added
16783         `MonoGenericContainer *parent_container' argument; automatically
16784         compute `container->is_method'; pass the correct owner to
16785         get_constraints().      
16786
16787         * reflection.c (compare_genericparam): Sort the GenericParam table
16788         according to increasing owners. 
16789
16790 Fri Dec 10 18:43:46 CET 2004 Paolo Molaro <lupus@ximian.com>
16791
16792         * profiler.c: allow disabling the default profiler.
16793
16794 Fri Dec 10 18:42:11 CET 2004 Paolo Molaro <lupus@ximian.com>
16795
16796         * decimal.c, icall.c: allow disabling System.Decimal support.
16797
16798 2004-12-09  Marek Safar <marek.safar@seznam.cz>
16799
16800         * reflection.c: Add support for null attribute arguments.
16801
16802 2004-12-09  Martin Baulig  <martin@ximian.com>
16803
16804         * metadata.h, loader.h: Use `idx' instead of `index' in parameter
16805         names to get rid of compiler warnings.
16806
16807 2004-12-08  Zoltan Varga  <vargaz@freemail.hu>
16808
16809         * marshal.c (mono_marshal_get_struct_to_ptr): Call 
16810         mono_marshal_load_type_info (). Fixes #69625.
16811         (mono_marshal_get_ptr_to_struct): Likewise.
16812
16813 2004-12-08  Martin Baulig  <martin@ximian.com>
16814
16815         * mono-debug.h: Bumped version number to 47.
16816
16817         * mono-debug-debugger.c
16818         (mono_debugger_event_handler, mono_debugger_event): Take two
16819         guint64 arguments insteed of a gpointer and a guint32.  
16820
16821 2004-12-08  Martin Baulig  <martin@ximian.com>
16822
16823         * debug-mono-symfile.h
16824         (MonoDebugLineNumberEntry): Renamed `offset' to `il_offset' and
16825         `address' to `native_offset'.
16826
16827 2004-12-08  Martin Baulig  <martin@ximian.com>
16828
16829         * class.c (mono_class_create_from_typespec): Only inflate if we
16830         either have `context->gclass' or `context->gmethod'.
16831
16832 2004-12-08  Zoltan Varga  <vargaz@freemail.hu>
16833
16834         * metadata-internals.h (MonoAssembly): Add 'corlib_internal' field.
16835
16836         * object-internals.h (MonoReflectionAssemblyBuilder): Move 'corlib_internal' field from Assembly to AssemblyBuilder.
16837
16838         * reflection.c (mono_image_basic_init): Initialize assembly->corlib_internal from the assembly builder.
16839
16840         * reflection.c (mono_assembly_get_object): Remove the workaround put
16841         in for the release.
16842         
16843         * appdomain.c: Use the corlib_internal field from MonoAssembly.
16844
16845         * appdomain.c: Bump corlib version.
16846
16847         * reflection.c (mono_assembly_get_object): Add a workaround so __MetadataTypes won't
16848         be visible in other appdomains.
16849
16850 2004-12-07  Ben Maurer  <bmaurer@ximian.com>
16851
16852         * threads.c: Interlocked inc and dec for longs were messed up,
16853         use a KISS based impl for this. Fixes 70234
16854
16855 2004-12-07  Zoltan Varga  <vargaz@freemail.hu>
16856
16857         * threads.c (ves_icall_System_Threading_Thread_GetCachedCurrentCulture): Make this lock-less.
16858
16859 Tue Dec 7 10:47:09 CET 2004 Paolo Molaro <lupus@ximian.com>
16860
16861         * icall.c: fix to follow policy not to allow struct
16862         arguments in icalls.
16863
16864 2004-12-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16865
16866         * process.c: make the patch that handles spaces in file paths work
16867         on mono/windows too.
16868
16869 2004-12-06  Martin Baulig  <martin@ximian.com>
16870
16871         * class.c (mono_class_create_generic): Call
16872         mono_class_setup_supertypes() if we're dynamic.
16873         (mono_class_is_subclass_of): `g_assert (klass->idepth > 0)'.
16874
16875 2004-12-06  Zoltan Varga  <vargaz@freemail.hu>
16876
16877         * object-internals.h: Add new fields to MonoThread.
16878
16879         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
16880
16881         * icall.c threads-types.h threads.c: Add new icalls.
16882
16883         * object-internals.h (MonoThread): Remove unused 'unmanaged' field.
16884
16885         * object-internals.h (MonoReflectionAssembly): Sync object layout with
16886         managed side.
16887
16888         * appdomain.c: Bump corlib version.
16889
16890         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Skip
16891         internal assemblies. Fixes #69181.
16892
16893 2004-12-05  Martin Baulig  <martin@ximian.com>
16894
16895         * class.c (mono_class_inflate_generic_signature): Make this a
16896         no-op if `context' is NULL or we don't have any type parameters;
16897         also copy `sentinelpos'.        
16898
16899 2004-12-04  Zoltan Varga  <vargaz@freemail.hu>
16900
16901         * image.c: Add unbox_wrapper_cache.
16902
16903         * class-internals.h debug-helpers.c: Add MONO_WRAPPER_UNBOX.
16904
16905         * marshal.h marshal.c (mono_marshal_get_unbox_wrapper): New wrapper
16906         function generator.
16907         
16908         * object.c (mono_delegate_ctor): Call unbox wrapper if neccesary.
16909         Fixes #70173.
16910
16911         * metadata-internals.h image.c: Add MonoImage->unbox_wrapper_cache.
16912         
16913 2004-12-04  Martin Baulig  <martin@ximian.com>
16914
16915         * loader.c (mono_method_get_signature_full): New public function;
16916         like mono_method_get_signature(), but with an additional
16917         `MonoGenericContext *' argument.
16918
16919         * class.c (mono_class_inflate_generic_signature): Formerly known
16920         as inflate_generic_signature(); make this public.
16921
16922 2004-12-04  Martin Baulig  <martin@ximian.com>
16923
16924         * metadata.c
16925         (mono_metadata_parse_type_full): Take a `MonoGenericContext *'
16926         instead of a `MonoGenericContainer *'.  
16927         (mono_metadata_parse_array_full): Likewise.
16928         (mono_metadata_parse_signature_full): Likewise.
16929         (mono_metadata_parse_method_signature_full): Likewise.
16930         (mono_metadata_parse_generic_inst): Likewise.
16931         (mono_metadata_parse_generic_param): Likewise.
16932         (mono_metadata_parse_mh_full): Likewise.
16933         (mono_type_create_from_typespec_full): Likewise.
16934
16935 2004-12-03  Martin Baulig  <martin@ximian.com>
16936
16937         * class-internals.h (MonoGenericContainer): Replaced the
16938         `MonoGenericContext * pointer with a `MonoGenericContext'
16939         structure and made it the first element.
16940
16941 2004-12-03  Martin Baulig  <martin@ximian.com>
16942
16943         * class.c
16944         (inflate_generic_type): Set the `context->container' when creating
16945         a new MonoGenericContext.
16946         (mono_class_inflate_generic_method): Likewise.
16947         (mono_class_create_from_typespec): Just use `context->container'
16948         to get the container.
16949
16950         * loader.c (method_from_methodspec): Set `context->parent' from
16951         `context->container' - and if that's a method container, use its
16952         parent.  Also set the `context->container' when creating a new
16953         MonoGenericContext.
16954         (mono_get_method_from_token): Use just `context->container' to get
16955         the container.
16956
16957         * metadata.c (do_mono_metadata_parse_generic_class): Also set
16958         `gclass->context->container'.
16959
16960         * reflection.c (do_mono_reflection_bind_generic_parameters): Set
16961         the `context->container' when creating a new MonoGenericContext.
16962
16963 2004-12-03  Zoltan Varga  <vargaz@freemail.hu>
16964
16965         * reflection.c (compare_genericparam): Sort params with identical
16966         owner by their number. Fixes gen-111 on sparc.
16967
16968 2004-12-02  Zoltan Varga  <vargaz@freemail.hu>
16969
16970         * threadpool.c (async_invoke_thread): Call push/pop_appdomain_ref
16971         around the domain changes.
16972
16973         * appdomain.c (mono_domain_unload): Handle the case when the thread
16974         calling Unload is itself being aborted during unloading. Fixes #70022.
16975
16976         * appdomain.h: Add prototype for mono_install_runtime_cleanup.
16977
16978         * marshal.c (emit_thread_interrupt_checkpoint_call): Call 
16979         checkpoint_func as an icall so it gets a wrapper.
16980         (mono_marshal_get_xappdomain_invoke): Call push/pop_appdomain_ref ()
16981         in the cross-appdomain wrappers too.
16982
16983         * threads.c (mono_thread_has_appdomain_ref): Make this public.
16984
16985         * assembly.c (mono_assembly_open_from_bundle): Fix warning.
16986
16987         * reflection.c: Fix some memory leaks.
16988         
16989 2004-12-02  Martin Baulig  <martin@ximian.com>
16990
16991         * metadata-internals.h (MonoImage): Removed `generic_class_cache'.
16992
16993         * metadata.c (generic_class_cache): New static hashtable.
16994         (mono_metadata_lookup_generic_class): New public method.
16995
16996 2004-12-02  Martin Baulig  <martin@ximian.com>
16997
16998         * class.c (mono_class_create_from_typedef): Call
16999         mono_class_setup_parent() and mono_class_create_mono_type() before
17000         parsing the interfaces.
17001
17002 2004-12-02  Martin Baulig  <martin@ximian.com>
17003
17004         * metadata.c (generic_inst_cache): New static hashtable.
17005         (mono_metadata_lookup_generic_inst): New public function.
17006         (mono_metadata_inflate_generic_inst): New public function.
17007         (mono_metadata_parse_generic_inst): New public function.
17008         (do_mono_metadata_parse_generic_class): Use the new
17009         mono_metadata_parse_generic_inst() for parsing the `gclass->inst'
17010         since this'll also use the cache.
17011
17012         * reflection.c (mono_reflection_bind_generic_method_parameters):
17013         Use mono_metadata_lookup_generic_inst() to use the new cache.
17014
17015         * class.c (inflate_mono_type): Use
17016         mono_metadata_inflate_generic_inst() to inflate a generic
17017         instance; this'll also use the new cache.
17018
17019         * loader.c (method_from_methodspec): Use
17020         mono_metadata_parse_generic_inst() and
17021         mono_metadata_inflate_generic_inst() rather than parsing it
17022         manually, so we can use the new cache.
17023
17024 2004-12-02  Zoltan Varga  <vargaz@freemail.hu>
17025
17026         * threads.c (wait_for_tids): Do not incorrectly free threads when 
17027         the wait times out.
17028
17029 2004-12-01  Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
17030
17031         * icall.c (mono_ArgIterator_Setup) : Conditionally compile calculation of
17032         iter->args based on whether parameters are passed in registers (i.e.
17033         MONO_ARCH_REGPARMS is defined)
17034
17035 2004-12-01  Zoltan Varga  <vargaz@freemail.hu>
17036
17037         * loader.c (mono_lookup_pinvoke_call): Use the remapped dll name in
17038         the exception message. Fixes #70070.
17039         (method_from_methodspec): Fix warnings.
17040
17041 2004-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17042
17043         * process.c: (complete_path) return the path quoted
17044
17045 2004-12-01  Martin Baulig  <martin@ximian.com>
17046
17047         * class-internals.h (MonoGenericInst): New structure.
17048         (MonoGenericClass): Replaced `type_argc', `type_argv' and
17049         `is_open' with `MonoGenericInst *inst'.
17050         (MonoGenericMethod): Replaced `mtype_argc', `mtype_argv' and
17051         `is_open' with `MonoGenericInst *inst'.
17052
17053 2004-11-30  Martin Baulig  <martin@ximian.com>
17054
17055         Generics API cleanup: renamed MonoGenericInst -> MonoGenericClass.
17056
17057         * metadata-internals.h (MonoImage): Renamed `generic_inst_cache'
17058         to `generic_class_cache'.
17059
17060         * metadata.c
17061         (mono_generic_inst_hash): Renamed to mono_generic_class_hash().
17062         (mono_generic_inst_equal): Renamed to mono_generic_class_equal().
17063         (mono_generic_inst_is_valuetype): Renamed to
17064         mono_generic_class_is_valuetype().
17065
17066         * class-internals.h
17067         (MonoGenericInst): Renamed to MonoGenericClass.
17068         (MonoDynamicGenericInst): Renamed to MonoDynamicGenericClass.
17069         (MonoClass): Renamed `generic_inst' to `generic_class'.
17070         (MonoGenericContext): Renamed `ginst' to `gclass'.
17071
17072         * object-internals.h
17073         (MonoReflectionGenericInst): Renamed to MonoReflectionGenericClass.
17074
17075         * reflection.c (mono_reflection_generic_inst_initialize): Renamed to
17076         mono_reflection_generic_class_initialize().
17077
17078         * icall.c (icall_entries): "System.Reflection.MonoGenericInst" is
17079         now known as "System.Reflection.MonoGenericClass".
17080         (monogenericinst_icalls): Renamed to monogenericclass_icalls.
17081
17082 2004-11-29  Sebastien Pouliot  <sebastien@ximian.com>
17083
17084         * class-internals.h: Added a flag field to MonoClass to cache the
17085         declarative security attributes actions associated with the class.
17086         * domain-internals.h: Added booleans to MonoJitInfo to cache the
17087         (class or method level) stack modifiers (Assert, Deny and PermitOnly)
17088         applicable to the JITted method.
17089         * reflection.c|h: Added functions to extract (as flags) which security
17090         actions are available (declaratively) for a method, class or assembly.
17091         * metadata.c|h: Added functions to search the declarative security
17092         table in the metadata.
17093         
17094 2004-11-29  Ben Maurer  <bmaurer@ximian.com>
17095
17096         * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces):
17097         EXPORTEDTYPES are already in the class name cache, so there is no
17098         need to add extra code here to look at them. Just removes a bit of
17099         cruft.
17100
17101         (ves_icall_System_Environment_get_TickCount): No need for #if
17102         WINDOWS. We already have the code in io-layer.
17103
17104 2004-11-28  Martin Baulig  <martin@ximian.com>
17105
17106         * loader.c
17107         (method_from_methodspec): Also inflate the `gmethod->mtype_argv'.
17108         Fixes gen-112.cs.
17109
17110 2004-11-27  Miguel de Icaza  <miguel@ximian.com>
17111
17112         * assembly.c (do_mono_assembly_open): Instead of having a
17113         conditional WITH_BUNDLE, incorporate support for bundles here, by
17114         having a global `bundles' variable holding a pointer to the actual
17115         bundles. 
17116
17117         (mono_register_bundled_assemblies): New API call used by the
17118         bundle code. 
17119
17120         See mkbundle.1 for details.
17121         
17122 2004-11-27  Martin Baulig  <martin@ximian.com>
17123
17124         * object.c (mono_class_vtable): Store the `MonoMethod *' itself in
17125         the vtable for generic methods.
17126
17127 2004-11-26  Martin Baulig  <martin@ximian.com>
17128
17129         * metadata.c
17130         (mono_metadata_generic_method_hash): New public function.
17131         (mono_metadata_generic_method_equal): Likewise.
17132
17133         * class-internals.h
17134         (MonoGenericContainer): Added `GHashTable *method_hash'.
17135
17136         * reflection.c (ReflectionMethodBuilder): Added
17137         `MonoGenericContainer *generic_container'.
17138         (reflection_methodbuilder_to_mono_method): Don't create a new
17139         MonoGenericContainer each time we're called.
17140         (mono_reflection_bind_generic_method_parameters): Use
17141         `container->method_hash' to cache the results so we don't create a
17142         different method if we're called several times with the same
17143         arguments.
17144
17145         * loader.c (method_from_methodspec): Use the new
17146         `container->method_hash' here, too.
17147
17148 2004-11-26  Martin Baulig  <martin@ximian.com>
17149
17150         * class.c (inflate_generic_signature): Correctly compute
17151         `res->has_type_parameters'.
17152         (mono_class_vtable): Use the `has_type_parameters' flag to
17153         determine whether we're a generic method.
17154
17155         * metadata.c (mono_metadata_parse_method_signature_full): Likewise.
17156
17157 2004-11-25  Zoltan Varga  <vargaz@freemail.hu>
17158
17159         * object.c (mono_runtime_run_main): Fix a small memory leak.
17160
17161 2004-11-25  Martin Baulig  <martin@ximian.com>
17162
17163         * class.c (set_generic_param_owner): Fixed the loop.
17164
17165 2004-11-25  Martin Baulig  <martin@ximian.com>
17166
17167         * object.c (mono_class_vtable): Don't create any JIT wrappers for
17168         generic methods.
17169
17170 2004-11-24  Zoltan Varga  <vargaz@freemail.hu>
17171
17172         * reflection.c: Allow all kinds of whitespace, not just ' ' in type
17173         names. Fixes #69787.
17174
17175 2004-11-24  Martin Baulig  <martin@ximian.com>
17176
17177         * class.c (mono_class_create_generic_2): If we don't have a
17178         `ginst->parent', inflate `gklass->parent' to get our parent.
17179
17180 2004-11-24  Martin Baulig  <martin@ximian.com>
17181
17182         * reflection.c (compare_genericparam): Correctly sort the
17183         GenericParam table; fixes #69779.
17184
17185 2004-11-23  Ben Maurer  <bmaurer@ximian.com>
17186
17187         * reflection.c: When writing a PE file, don't create a huge
17188         buffer in memory. Just write the arrays we have to the file.
17189         This reduces memory usage.
17190
17191         * metadata-internals.h: MonoDynamicStream pefile is no longer used
17192         globally.
17193
17194 2004-11-17  Martin Baulig  <martin@ximian.com>
17195
17196         * class.c (mono_class_init): Don't setup `class->parent' for
17197         dynamic instances; moved this to mono_class_generic_2().
17198         (mono_class_create_generic): Also set `klass->inited' for dynamic
17199         generic instances.
17200         (mono_class_create_generic_2): Don't do anything for dynamic
17201         generic instances.  Set `klass->parent' here and also call
17202         mono_class_setup_parent() here. 
17203
17204         * reflection.c (do_mono_reflection_bind_generic_parameters): Added
17205         `MonoType *parent' argument; set `ginst->parent' before calling
17206         mono_class_create_generic_2(), so we set the correct parent.
17207
17208 Thu Nov 18 17:10:32 CET 2004 Paolo Molaro <lupus@ximian.com>
17209
17210         * reflection.c: allow getting attributes from ModuleBuilder
17211         (used by ikvm).
17212
17213 2004-11-17  Martin Baulig  <martin@ximian.com>
17214
17215         * class.c (mono_class_create_from_typedef): If a type parameter is
17216         inherited from an outer class, set its owner to that class.
17217
17218 2004-11-17  Atsushi Enomoto  <atsushi@ximian.com>
17219
17220         * reflection.c: (mono_image_create_pefile): Don't use NULL argument
17221           for (int*) written size. This fixes bug #69592.
17222
17223 2004-11-15  Sebastien Pouliot  <sebastien@ximian.com>
17224
17225         * icall.c: Added IsAuthenticodePresnet internal call.
17226         * image.c|h: New function that check a MonoImage for an Authenticode
17227         signature in the certificate PE data directory.
17228         * security.c|h: New internal call to ask the runtime if an 
17229         Authenticode signature seems referenced in the PE header.
17230
17231 2004-11-15  Zoltan Varga  <vargaz@freemail.hu>
17232
17233         * icall.c (ves_icall_type_isprimitive): Native int is a primitive type.
17234
17235         * reflection.c (mono_image_create_pefile): Free the assembly streams
17236         after writing out the assembly file.
17237
17238         * object.c (mono_runtime_run_main): Fix small memory leak.
17239
17240         * icall.c (ves_icall_Type_GetPropertiesByName): Add support for
17241         property access modifiers. Fixes #69389.
17242
17243 Mon Nov 15 11:54:22 CET 2004 Paolo Molaro <lupus@ximian.com>
17244
17245         * domain.c, object.c, object-internals.h, domain-internals.h,
17246         object.h, marshal.c: keep dynamic code info per domain.
17247
17248 2004-11-15  Martin Baulig  <martin@ximian.com>
17249
17250         * class.c (mono_type_get_name_recurse): Put type arguments in
17251         `[',`]' instead of in `<','>'.  Thanks to Atsushi for the patch,
17252         see bug #68387.
17253
17254 2004-11-15  Martin Baulig  <martin@ximian.com>
17255
17256         * class.c (mono_type_get_name_recurse): Added `include_ns' flag.
17257         (mono_class_setup_vtable): When computing `the_cname' for a
17258         generic instance, don't include the namespace since we'd otherwise
17259         add it twice.
17260
17261 2004-11-15  Martin Baulig  <martin@ximian.com>
17262
17263         * class.c (mono_class_create_generic): Changed return type to void.
17264         (mono_class_create_generic_2): New public function; setup
17265         `class->method', `class->field' and `class->interfaces' here
17266         instead of in mono_class_init().
17267
17268         * class.h (mono_class_create_generic): Moved to class-internals.h.
17269
17270 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
17271
17272         * reflection.c (mono_image_create_pefile): take a file HANDLE.
17273         rather than writing to memory, write to this file. Right now,
17274         we are just writting into a buffer, and copying that. However
17275         we can avoid the buffer later.
17276
17277         (mono_dynamic_stream_reset): new function
17278
17279         * icall.c, object-internals.h: update for the above.
17280
17281 2004-11-13  Ben Maurer  <bmaurer@ximian.com>
17282
17283         * reflection.c: Remove *_ATOMIC macros. We really shouldn't
17284         have been using gc'd memory. First it is slower, unlikely
17285         the comment in the source code said, secondly, it increases
17286         our footprint to do it in the gc.
17287
17288         * icall.c (WriteToFile): rename of getDataChunk. Rewrite
17289         the method so that it does not have to copy to managed code.
17290
17291 2004-11-12  Zoltan Varga  <vargaz@freemail.hu>
17292
17293         * loader.c (mono_method_get_header): Fix build for older glibs which does not define G_LIKELY.
17294
17295 2004-11-12  Martin Baulig  <martin@localhost>
17296
17297         * reflection.c (mono_image_create_token): Allow generic method
17298         definitions here, since they may appear in an `.override'; see
17299         gen-98/gen-99 for an example.
17300
17301 2004-11-11  Zoltan Varga  <vargaz@freemail.hu>
17302
17303         * icall.c (ves_icall_Type_GetField): Support BFLAGS_IgnoreCase. Fixes
17304         #69365.
17305
17306         * marshal.c (mono_string_to_ansibstr): Make g_error messages more
17307         descriptive.
17308
17309 2004-11-11  Martin Baulig  <martin@ximian.com>
17310
17311         * class.c (mono_class_setup_vtable): In an explicit interface
17312         implementation, the method name now includes the arity.
17313
17314 2004-11-10  Zoltan Varga  <vargaz@freemail.hu>
17315
17316         * object.c (mono_array_full_copy): Fix warning.
17317
17318 2004-11-10  Lluis Sanchez Gual  <lluis@novell.com>
17319
17320         * appdomain.c: Removed look_for_method_by_name(). Use the new method
17321         mono_class_get_method_from_name() instead.
17322         
17323         * class-internals.h: Added two new types of wrappers. 
17324         Added MonoRemotingTarget enum. Added new trampoline function type, which
17325         takes an additional MonoRemotingTarget value as parameter, so it is
17326         possible to request a trampoline for a specific target.
17327         
17328         * class.c: Added new mono_class_get_method_from_name() method.
17329         
17330         * class.h: In MonoRemoteClass, we can have now to vtables, one for
17331         general remoting sinks and one specific for cross domain calls.
17332         
17333         * debug-helpers.c: Added new wrapper names.
17334         
17335         * icall.c: Use the new method mono_remote_class_vtable() to get the vtable
17336         of a remote class.
17337         
17338         * image.c: Porperly delete value objects form the remoting invoke hashtable.
17339         
17340         * marshal.c: Added mono_marshal_get_xappdomain_invoke(), which together
17341         with several other methods (mono_marshal_get_xappdomain_dispatch,
17342         mono_marshal_get_xappdomain_target, mono_marshal_get_serialize_exception,
17343         and others) can generate a fast remoting wrapper for cross domain calls.
17344         More information can be found in docs/remoting.
17345         Other changes: Removed mono_find_method_by_name, and used
17346         mono_class_get_method_from_name instead.
17347         Remoting wrappers are now stored in a MonoRemotingMethods struct, which
17348         is stored in the remoting invoke hashtable.
17349         
17350         * marshal.h: published the new method for getting the xdomain wrapper,
17351         and also added a method for getting the adequate wrapper for a given
17352         method and target.
17353         
17354         * object-internals.h, object.c: Added a couple of methods for capying and
17355         cloning arrays.
17356         Modified mono_install_remoting_trampoline, which takes the new remoting
17357         trampoline that has a remoting target as parameter.
17358         mono_class_proxy_vtable now also takes a remoting target as parameter, and
17359         will return the most suitable vtable for the target.
17360         Added mono_remote_class_vtable, which returns the vtable of a remote class
17361         (which can be the normal remoting vtable or the xdomain vtable).
17362         
17363         * threads.c: the xdomain invoke and dispatch wrappers must also be
17364         protected against interruptions.
17365
17366 2004-11-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17367
17368         * icall.c: use memmove in BlockCopyInternal when the source and
17369         destination arrays are the same.
17370
17371 2004-11-09  Martin Baulig  <martin@ximian.com>
17372
17373         * class-internals.h (MonoGenericContainer): Removed `method' and
17374         `signature', replaced them with `is_method' and `is_signature'
17375         flags.  Added `context'.
17376
17377         * loader.c (method_from_methodspec): Take a `MonoGenericContext *'
17378         instead of a `MonoGenericContainer *'.
17379
17380         * metadata.c (mono_metadata_generic_param_equal): Removed the hack
17381         for dynamic type parameters.
17382         (mono_metadata_load_generic_params): Setup `container->context'.
17383
17384         * reflection.c (mono_reflection_setup_generic_class): Setup
17385         `tb->generic_container->context'.
17386         (do_mono_reflection_bind_generic_parameters): Use
17387         mono_class_inflate_generic_type() to correctly inflate types,
17388         rather than using our own hack just for MONO_TYPE_VAR.
17389
17390 2004-11-09  Martin Baulig  <martin@ximian.com>
17391
17392         * class.c (mono_class_inflate_generic_method): Small fix; don't
17393         crash here.
17394
17395         * icall.c
17396         (ves_icall_MonoType_GetGenericArguments): Don't ignore `byref' types.
17397         (ves_icall_Type_get_IsGenericTypeDefinition): Likewise.
17398         (ves_icall_Type_GetGenericTypeDefinition_impl): Likewise.
17399         (ves_icall_Type_BindGenericParameters): Likewise.
17400         (ves_icall_Type_get_IsGenericInstance): Likewise.
17401         (ves_icall_Type_GetGenericParameterPosition): Likewise.
17402         (ves_icall_MonoType_get_HasGenericArguments): Likewise.
17403         (ves_icall_MonoType_get_IsGenericParameter): Likewise.
17404         (ves_icall_MonoType_get_DeclaringMethod): Likewise.
17405
17406 2004-11-09  Zoltan Varga  <vargaz@freemail.hu>
17407
17408         * assembly.c (mono_assembly_names_equal): Reenable the comparison of
17409         assembly versions and public key tokens. Fixes #69113.
17410
17411 Tue Nov 9 17:34:05 CET 2004 Paolo Molaro <lupus@ximian.com>
17412
17413         * metadata.c: fix bug introduced with the type cache changes
17414         on 2004-11-06.
17415
17416 Tue Nov 9 17:26:29 CET 2004 Paolo Molaro <lupus@ximian.com>
17417
17418         * metadata.h, metadata.c, domain-internals.h, marshal.c: include
17419         the MonoClass pointer instead of the token in exception clauses.
17420         * reflection.c: updates for the above and make the code not depend
17421         on the structure of MonoExceptionClause.
17422
17423 2004-11-08  Zoltan Varga  <vargaz@freemail.hu>
17424
17425         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
17426         Add support for dynamic assemblies. Fixes #69114.
17427
17428         * loader.c (mono_method_get_header): Handle icalls and pinvoke methods.
17429
17430 2004-11-07  Ben Maurer  <bmaurer@ximian.com>
17431
17432         * class-internals.h (MonoMethod): Move addr to MonoMethodPInvoke
17433         since most only those methods use it. the code member of
17434         MonoMethodPInvoke was dead, so that can be removed too. Also,
17435         remove inline_count (again, not used), and move slot so that it
17436         can share bits with some other flags. This saves 8 bytes in the
17437         structure and gives us about 50 kb back for mcs helloworld.cs
17438
17439         * *.[ch]: Do naming changes for the above.
17440
17441         * loader.c (mono_method_get_header): Lazily init the header
17442         on first access.
17443         (mono_get_method_from_token): don't init the header here
17444         (mono_free_method): the header may never be allocated
17445
17446         Overall, this saves 150 kb of unmanaged allocations
17447         for mcs helloworld.cs. That accounts for 10% of the unmanaged
17448         memory at runtime.
17449         
17450         * loader.c, loader.h (mono_method_get_header): new accessor.
17451
17452         * *.[ch]: use the above method. Prepares us to lazily load
17453         the header.
17454
17455         * *.[ch]: Clean up all the pesky warnings. gcc now only gives
17456         three warnings, which are actual bugs (see 69206).
17457
17458         * class-internals.h (MonoMethod): Remove remoting_tramp. It is
17459         unused. Saves a cool 4 bytes / method.
17460
17461 2004-11-06  Ben Maurer  <bmaurer@ximian.com>
17462
17463         * metadata.c (builtin_types): Add types for System.Object here.
17464         (mono_metadata_parse_type_full): Cache MonoType*'s that are
17465         for a class or valuetype from klass->this_arg or klass->byval_arg.
17466
17467         On mcs for a hello world, this gets us down from 21836 MonoType's
17468         to 14560.
17469
17470         (mono_metadata_free_type): Account for the above change.
17471
17472 2004-11-06  Zoltan Varga  <vargaz@freemail.hu>
17473
17474         * appdomain.c (ves_icall_System_AppDomain_GetData): Throw an 
17475         exception instead of asserting if name is null.
17476         (ves_icall_System_AppDomain_GetData): Ditto.
17477
17478 2004-11-05  Zoltan Varga  <vargaz@freemail.hu>
17479
17480         (ves_icall_get_enum_info): Avoid crash when called on a non-finished
17481         EnumBuilder.
17482
17483         * icall.c (ves_icall_System_Reflection_Assembly_GetEntryAssembly): 
17484         Return NULL when the domain does not have entry_assembly set.
17485
17486         * icall.c (ves_icall_System_Reflection_Assembly_GetFilesInternal): 
17487         Add a 'resource_modules' argument.
17488         (ves_icall_type_GetTypeCode): Fix typecode of byref types.
17489
17490         * reflection.c (mono_reflection_create_runtime_class): Move setting
17491         of wastypebuilder here, so mono_get_type_object () returns a MonoType
17492         for enums too.
17493
17494         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi): Return NULL here instead of an empty string to match MS behavior.
17495         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi_len):
17496         Throw an ArgumentNullException if 'ptr' is null.
17497
17498         * appdomain.c (mono_domain_assembly_search): Avoid matching dynamic
17499         assemblies here. Fixes #69020.
17500
17501 2004-11-05  Geoff Norton  <gnorton@customerdna.com>
17502
17503         * reflection.c (build_compressed_metadata): Fix the previous patch for
17504         big endian systems.  GUINT32_FROM_LE isn't needed on strlen and was overwriting
17505         the stack.
17506
17507 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
17508
17509         * assembly.c (mono_assembly_names_equal): Allow a match if one of
17510         the cultures is false. Fixes #69090.
17511
17512         * reflection.c (build_compressed_metadata): Fix invalid memory read 
17513         detected by valgrind.
17514         
17515         * reflection.c (mono_reflection_get_type): Avoid triggering a 
17516         TypeResolve multiple times for the same type. Fixes #65577.
17517
17518 2004-11-04  Ben Maurer  <bmaurer@ximian.com>
17519
17520         * marshal.c: Avoid using ldftn to call managed functions. It is
17521         much slower than just a call.
17522
17523         * reflection.c (mono_module_get_object): free the basename we
17524         allocate here from glib.
17525         
17526         * reflection.c (ensure_runtime_vtable): make sure to free
17527         overrides.  Also, we were allocating an array of MonoMethod not an
17528         array of MonoMethod*.
17529
17530         * marshal.c (mono_marshal_get_stelemref): do a mono_mb_free here.
17531
17532         * image.c (mono_image_close): free image->guid here.
17533
17534 2004-11-02  Zoltan Varga  <vargaz@freemail.hu>
17535
17536         * reflection.c: Fix some spec conformance issues with the PE file
17537         structures so mcs compiled apps run on the Net 2.0 beta.
17538
17539 2004-11-01  Zoltan Varga  <vargaz@freemail.hu>
17540
17541         * string-icalls.c (ves_icall_System_String_ctor_encoding): 
17542         Implement this. Fixes #67264.
17543
17544         * debug-helpers.h debug-helpers.c marshal.c: Move 
17545         mono_find_method_by_name to debug-helpers.c.
17546
17547 2004-10-31  Zoltan Varga  <vargaz@freemail.hu>
17548
17549         * object.c (mono_release_type_locks): type_initialization_hash is
17550         a GHashTable.
17551
17552         * reflection.c object.c object-internals.h: Fix warnings.
17553
17554         * icall.c (ves_icall_Type_GetPropertiesByName): Handle properties
17555         without accessors. Fixes #61561.
17556
17557         * appdomain.c (ves_icall_System_AppDomain_createDomain): Inherit
17558         application base from the root domain if not set. Fixes #65641.
17559         (mono_runtime_init): Fix warning.
17560
17561 2004-10-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17562
17563         * appdomain.c: call mono_thread_pool_init.
17564         * threadpool.[ch]: new mono_thread_pool_init that sets the max. number
17565         of worker threads based on the number of CPUs and the environment
17566         variable MONO_THREADS_PER_CPU if present. The defaults are 50 (25)
17567         for non-windows (windows) systems.
17568
17569 2004-10-27  Chris Toshok  <toshok@ximian.com>
17570
17571         * mono-debug-debugger.c (write_class): don't call mono_class_init
17572         here, as even with the check for (!klass->init_pending), we get
17573         into a situation where we're hitting cycles in class
17574         initialization.  Fixes #68816.
17575
17576 2004-10-25  Zoltan Varga  <vargaz@freemail.hu>
17577
17578         * image.c: Avoid overwriting values in the loaded_images_hash when an
17579         assembly is loaded multiple times. Fixes #61152.
17580
17581         * assembly.c (mono_assembly_names_equal): Compare the cultures as well,
17582         so multiple satellite assemblies for the same name can be loaded.
17583         Fixes #68259.
17584
17585         * mono_domain_assembly_preload: Actually return the loaded assembly, 
17586         not NULL.
17587
17588         * icall.c (ves_icall_type_is_subtype_of): Fix this for byref types.
17589         (ves_icall_type_is_assignable_from): Ditto. Fixes #68582.
17590
17591         * gc.c (finalize_domain_objects): Call GC_invoke_finalizers () so
17592         pending finalizers are not invoked after the appdomain has been 
17593         unloaded. Fixes #67862.
17594
17595 2004-10-22  Martin Baulig  <martin@ximian.com>
17596
17597         * mono-debug-debugger.c
17598         (mono_debugger_runtime_invoke): Don't box valuetypes.
17599
17600 2004-10-22  Chris Toshok  <toshok@ximian.com>
17601
17602         * mono-debug-debugger.c (do_write_class): handle .cctors too, and
17603         don't hide private methods.
17604
17605 2004-10-22  Sebastien Pouliot  <sebastien@ximian.com>
17606
17607         * icall.c: Allows the runtime to "share" (when known) the public key
17608         token of an assembly. This avoid the need to recalculate the token 
17609         (from the public key) in managed code.
17610
17611 2004-10-21  Chris Toshok  <toshok@ximian.com>
17612
17613         * debug-helpers.c (append_class_name): argh, revert last patch.
17614         
17615 2004-10-21  Chris Toshok  <toshok@ximian.com>
17616
17617         * debug-helpers.c (append_class_name): use '+' as the delimiter,
17618         not '/', so that it matches what the debugger uses to look up
17619         methods.
17620
17621 2004-10-21  Martin Baulig  <martin@ximian.com>
17622
17623         * mono-debug-debugger.c (mono_debugger_throw_exception): New
17624         public method; this is called each time an exception is thrown and
17625         allows the debugger to use exception catch points.
17626
17627 2004-10-21  Martin Baulig  <martin@ximian.com>
17628
17629         * mono-debug-debugger.c (mono_debugger_handle_exception): Write
17630         the stack pointer and the exception object in some struct and pass
17631         that to the debugger.
17632
17633 2004-10-21  Chris Toshok  <toshok@ximian.com>
17634
17635         * mono-debug-debugger.c (do_write_class): add instance/static
17636         event support.  We don't expose "raise" or "other" yet.
17637         (event_is_static): new method.
17638
17639 2004-10-20  Bernie Solomon  <bernard@ugsolutions.com>
17640
17641         * mono-debug-debugger.c
17642         (mono_debugger_handle_exception): Remove
17643         bogus return value for fussy compilers.
17644
17645 2004-10-20  Martin Baulig  <martin@ximian.com>
17646
17647         * mono-debug-debugger.c
17648         (mono_debugger_unhandled_exception): Added `gpointer stack' argument.
17649         (mono_debugger_handled_exception): Likewise.
17650
17651 2004-10-20  Martin Baulig  <martin@ximian.com>
17652
17653         * mono-debug-debugger.h (MonoDebuggerEvent): Added
17654         MONO_DEBUGGER_EVENT_EXCEPTION.
17655
17656         * mono-debug-debugger.c (mono_debugger_handle_exception): New
17657         public function to send the debugger a notification for an
17658         exception and inform it about a catch/finally clause.
17659
17660 2004-10-19  Zoltan Varga  <vargaz@freemail.hu>
17661
17662         * marshal.c, icall.c: Applied patch from Alexandre Rocha Lima e
17663         Marcondes (alexandremarcondes@psl-pr.softwarelivre.org). Really
17664         fix 2.95 build. 
17665
17666         * icall.c (ves_icall_InternalExecute): Fix build for gcc-2.95.
17667
17668 2004-10-18  Zoltan Varga  <vargaz@freemail.hu>
17669
17670         * marshal.c (emit_marshal_object): Fix freeing of memory when a reference type is
17671         marshalled as [In,Out]. Fixes #58325.
17672
17673 2004-10-14  Zoltan Varga  <vargaz@freemail.hu>
17674
17675         * reflection.c (mono_method_body_get_object): Implement some fields.
17676
17677 2004-10-12  Martin Baulig  <martin@ximian.com>
17678
17679         * reflection.c (mono_reflection_bind_generic_parameters): Small
17680         fix, correctly retrieve our parent from a generic instance.
17681
17682 2004-10-12  Martin Baulig  <martin@ximian.com>
17683
17684         * metadata.c (mono_metadata_generic_param_equal): We always have
17685         an owner.
17686
17687         * class.c
17688         (mono_class_from_generic_parameter): We need to have an owner.
17689         (my_mono_class_from_generic_parameter): Likewise.
17690
17691         * reflection.c (mono_reflection_setup_generic_class): Renamed to
17692         mono_reflection_create_generic_class() and added a new
17693         mono_reflection_setup_generic_class().  
17694         (mono_reflection_initialize_generic_param): If we're a nested
17695         generic type and inherited from the containing class, set our
17696         owner to the outer class.
17697
17698 2004-10-11  Zoltan Varga  <vargaz@freemail.hu>
17699
17700         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodBodyInternal): New icall.
17701
17702         * reflection.c (mono_method_body_get_object): New function to create
17703         a MethodBody object.
17704
17705         * object-internals.h object.h: Add MonoReflectionMethodBody structure.
17706
17707 2004-10-11  Martin Baulig  <martin@ximian.com>
17708
17709         * metadata.c (_mono_metadata_type_equal): Renamed to
17710         do_mono_metadata_type_equal() and made static.
17711
17712 2004-10-11  Martin Baulig  <martin@ximian.com>
17713
17714         * appdomain.c: Bump corlib version number to 28.
17715
17716 2004-10-10  Martin Baulig  <martin@ximian.com>
17717
17718         * class-internals.h
17719         (MonoGenericInst): Added `MonoGenericContainer *container'.
17720         (MonoGenericMethod): Likewise.
17721         (MonoGenericContext): Likewise.
17722         (MonoGenericParam): Added `MonoGenericContainer *owner'.
17723
17724         * metadata.c
17725         (do_mono_metadata_parse_type): Added a `MonoGenericContainer *' argument.
17726         (do_mono_metadata_parse_generic_inst): Likewise.
17727         (mono_metadata_parse_type_full): New public method.  This is the actual
17728         mono_metadata_parse_type() implementation - with an additional
17729         `MonoGenericContainer *' argument.
17730         (mono_metadata_parse_array_full): Likewise.
17731         (mono_metadata_parse_signature_full): Likewise.
17732         (mono_metadata_parse_method_signature_full): Likewise.
17733         (mono_metadata_parse_mh_full): Likewise.
17734         (mono_type_create_from_typespec): Likewise.
17735         (mono_metadata_interfaces_from_typedef_full): New public method;
17736         this is similar to the other _full() methods, but we take a
17737         `MonoGenericContext *' since we have to pass it to mono_class_get_full().
17738         (mono_metadata_parse_generic_param): Take an additional
17739         `MonoGenericContainer *' argument and lookup the MonoGenericParam
17740         from that container.
17741         (mono_metadata_generic_param_equal): New static method to compare
17742         two type parameters.
17743         (_mono_metadata_type_equal): New static method; takes an
17744         additional `gboolean signature_only' argument - if true, we don't
17745         compare the owners of generic parameters.
17746         (mono_metadata_signature_equal): Call _mono_metadata_type_equal()
17747         with a TRUE argument - do a signature-only comparision.
17748
17749         * loader.c: Use the new _full() methods and pass the
17750         MonoGenericContainer to them.
17751
17752         * object-internals.h (MonoReflectionTypeBuilder): Added
17753         `MonoGenericContainer *generic_container' field.
17754         (MonoReflectionMethodBuilder): Likewise.
17755
17756 2004-10-08  Zoltan Varga  <vargaz@freemail.hu>
17757
17758         * icall.c (ves_icall_System_Reflection_Module_GetGlobalType): Special
17759         case initial images of dynamic assemblies.
17760
17761         * reflection.c (mono_image_basic_init): Set 'initial_image' field.
17762
17763         * metadata-internals.h (MonoDynamicImage): Add 'initial_image' field.
17764
17765         * reflection.c (mono_reflection_event_builder_get_event_info): Fix
17766         length of event->other array.
17767         (typebuilder_setup_events): Ditto.
17768
17769         * domain-internals.h (MonoDomain): Rename 'assemblies' hash table to
17770         'assembly_by_name' and add an 'assemblies' list.
17771
17772         * assembly.h assembly.c: Add a new search hook for determining whenever
17773         an assembly is already loaded. Use this instead of searching in the
17774         loaded_assemblies list.
17775
17776         * domain.c appdomain.c: Implement the new search hook so loaded 
17777         assemblies are now scoped by appdomain. Fixes #67727.
17778
17779 2004-10-07  Zoltan Varga  <vargaz@freemail.hu>
17780
17781         * threads.c (mono_thread_attach): Initialize synch_lock field so
17782         mono_thread_detach works again.
17783
17784         * loader.c (mono_lookup_pinvoke_call): Try the dllname prefixed with
17785         'lib' too. Fixes #63130.
17786
17787 2004-10-06  Jackson Harper  <jackson@ximian.com>
17788
17789         * culture-info-tables.h: regenerated.
17790
17791 2004-10-06  Zoltan Varga  <vargaz@freemail.hu>
17792
17793         * icall.c (ves_icall_Type_GetInterfaces): Include interfaces 
17794         implemented by other interfaces in the result. Fixes #65764.
17795         
17796         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
17797         Handle unloadable modules without crashing.
17798
17799         * image.c (load_modules): Revert the previous patch since modules must
17800         have a fixed index inside the array.
17801         
17802         * image.c (load_modules): Don't include native modules in the modules
17803         array.
17804
17805 2004-10-05  Zoltan Varga  <vargaz@freemail.hu>
17806
17807         * reflection.h: Add param_defaults field.
17808
17809         * reflection.c: Add support for parameter defaults in dynamic methods.
17810         Fixes #64595.
17811
17812         * icall.c (ves_icall_MonoType_get_Namespace): Return NULL instead of
17813         an empty string when a type has no namespace. Fixes #64230.
17814
17815 2004-10-04  Sebastien Pouliot  <sebastien@ximian.com>
17816
17817         * tabledefs.h: Added "internal" security actions to support non-CAS
17818         permissions NonCasDemand, NonCasLinkDemand and NonCasInheritance. 
17819         Note: they do not seems to be used anymore in 2.0 (new metadata format)
17820
17821 2004-10-04  Zoltan Varga  <vargaz@freemail.hu>
17822
17823         * icall.c (ves_icall_InternalInvoke): Throw an exception when calling
17824         constructor of abstract class. Fixes #61689.
17825
17826 2004-10-04  Martin Baulig  <martin@ximian.com>
17827
17828         * class-internals.h (MonoGenericContainer): New type.
17829         (MonoMethodNormal): Replaced `MonoGenericParam *gen_params' with
17830         `MonoGenericContainer *generic_container'.
17831         (MonoClass): Replaced `gen_params' and `num_gen_params' with
17832         `MonoGenericContainer *generic_container'.
17833
17834         * metadata.c (mono_metadata_load_generic_params): Return a
17835         `MonoGenericContainer *' instead of a `MonoGenericParam *';
17836         removed the `num' argument.
17837
17838 2004-10-03  Zoltan Varga  <vargaz@freemail.hu>
17839
17840         * icall.c (ves_icall_System_Reflection_Module_GetPEKind): Add support
17841         for dynamic images.
17842
17843         * object-internals.h (MonoReflectionAssemblyBuilder): Add pe_kind and
17844         machine fields.
17845
17846         * metadata-internals.h (MonoDynamicImage): Add pe_kind and machine fields.
17847
17848         * reflection.c: Save pe_kind and machine values into the generated
17849         image file.
17850
17851         * appdomain.c: Bump corlib version number.
17852
17853         * object-internals.h: Reorganize layout of LocalBuilder.
17854
17855         * class-internals.h class.c (mono_class_get_implemented_interfaces): 
17856         New helper function.
17857
17858         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Return the
17859         created MonoType for dynamic types. Fixes #66180.
17860
17861 2004-10-02  Ben Maurer  <bmaurer@ximian.com>
17862
17863         * threadpool.c: the ares hashtable needs a critical section around it.
17864         this prevents some nasty segfaults
17865
17866 2004-10-02  Massimiliano Mantione  <massi@ximian.com>
17867
17868         * process.c: Fixed alignments to 32 bits as casting to unsigned is unsafe
17869         on 64 bits platforms, patch by will@exomi.com (Ville-Pertti Keinonen), see
17870         bug 67324).
17871         
17872 2004-09-30  Zoltan Varga  <vargaz@freemail.hu>
17873
17874         * object-internals.h (MonoReflectionTypeBuilder): Add 'created' field.
17875         
17876 2004-09-30  Lluis Sanchez Gual  <lluis@novell.com>
17877
17878         * image.c: Always canonicalize image file names, to avoid loading
17879         the same assembly twice when referenced using a relative path.
17880
17881 2004-09-30  Zoltan Varga  <vargaz@freemail.hu>
17882
17883         * marshal.h marshal.c icall.c: Fix bugs in previous patch.
17884
17885         * marshal.c marshal.h icall.c: Add GetDelegateForFunctionPointerInternal icall.
17886
17887         * marshal.c: Fix warnings.
17888
17889 2004-09-29  Geoff Norton  <gnorton@customerdna.com>
17890
17891         * marshal.c (mono_ftnptr_to_delegate): This method was improperly
17892         attempting to marshal the delegate_trampoline as the method_addr.
17893         This patch has a static hashtable of marshalled delegates so that 
17894         we can map delegate_trampoline addresses back to delegates.  This
17895         allows a delegate passed to managed code to be passed back into native
17896         code.  Fixes #67039
17897
17898 2004-09-28  Zoltan Varga  <vargaz@freemail.hu>
17899
17900         * icall.c: Add GetFunctionPointerForDelegateInternal icall.
17901
17902         * reflection.c (method_encode_code): Align method headers properly.
17903         Fixes #66025.
17904
17905 2004-09-28  Lluis Sanchez Gual  <lluis@novell.com>
17906
17907         * marshal.c: In the runtime invoke wrapper, reset the abort
17908         exception if it is cached. This avoids the automatic rethrowal of 
17909         the exception after the catch of the wrapper. Also check for pending
17910         interruptions before calling the managed method. This is done using
17911         the new method emit_thread_force_interrupt_checkpoint, since the
17912         normal checkpoint method is ignored when running the invoke wrapper.
17913         * object.c: If the abort exception is rethrown, set the abort_exc
17914         field of the thread, so it will be rethrown aftere every catch.
17915         * threadpool.c: Only run an interruption checkpoint if what has been
17916         requested is a stop of the thread (aborts will be ignored).
17917         * threads.c: By default, a thread will now never be interrumped while
17918         running the runtime invoke wrapper (this ensures that runtime_invoke
17919         will always return to the caller if an exception pointer is provided).
17920         There is a new special method mono_thread_force_interruption_checkpoint()
17921         to force an interruption checkpoint even if running a protected
17922         wrapper, which is used by the same runtime invoke wrapper to do a check
17923         at a safe point.
17924
17925 2004-09-28  Lluis Sanchez Gual  <lluis@novell.com>
17926
17927         * object.c, object-internals.h: Implemented mono_release_type_locks,
17928         which releases the cctor locks held by a thread.
17929         * threads.c, threads.h: In thread_cleanup, release cctor locks held
17930         by a thread. Added mono_thread_exit() method to be used to safely stop
17931         a thread.
17932
17933 2004-09-28  Raja R Harinath  <rharinath@novell.com>
17934
17935         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
17936         Move null check before dereference.  Avoid indexing beyond the end
17937         of the 'modules' array.
17938
17939 2004-09-28  Raja R Harinath  <rharinath@novell.com>
17940
17941         * metadata-internals.h (MonoImage): Add module_count field.
17942         * image.c (load_modules): Set image->module_count.
17943         (mono_image_load_file_for_image): Use image->module_count.
17944         * reflection.c (mono_image_load_module): Append to image->modules array 
17945         of dynamic assembly.
17946         (mono_module_get_object): Fix loop to actually increment index.
17947         Use image->module_count.
17948         * assembly.c (mono_assembly_load_references): Use image->module_count.
17949         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal):
17950         Likewise.
17951
17952 2004-09-28  Zoltan Varga  <vargaz@freemail.hu>
17953
17954         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): 
17955         Avoid assert on generic types.
17956
17957 2004-09-26  Zoltan Varga  <vargaz@freemail.hu>
17958
17959         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): New icall.
17960
17961         * reflection.c (mono_param_get_objects): Fill out MarshalAsImpl field.
17962
17963         * reflection.c (mono_reflection_marshal_from_marshal_spec): New 
17964         function to convert a MarshalSpec structure to its managed counterpart.
17965
17966         * reflection.c: Fix warnings.
17967         
17968         * object-internals.h (MonoReflectionParameter): Add MarshalAsImpl
17969         field.
17970
17971         * icall.c (mono_create_icall_signature): Fix build.
17972
17973 2004-09-25  Zoltan Varga  <vargaz@freemail.hu>
17974
17975         * icall.c: Add MakePointType icall.
17976
17977         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage): Fix
17978         warnings.
17979
17980 2004-09-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17981
17982         * threadpool.c: reuse allocated slots in the queue.
17983
17984 2004-09-24  Zoltan Varga  <vargaz@freemail.hu>
17985
17986         * object-internals.h (MonoReflectionDllImportAttribute): New structure.
17987
17988         * icall.c: Add new icalls for GetDllImportAttribute and GetFieldOffset.
17989
17990         * reflection.h reflection.c (mono_reflection_get_custom_attrs): Revert
17991         previous change.
17992
17993         * tabledefs.h: Add constants for pinvoke attributes BestFit and
17994         ThrowOnUnmappableChar.
17995
17996         * icall.c (ves_icall_Type_GetPacking): New icall.
17997
17998 2004-09-24  Martin Baulig  <martin@ximian.com>
17999
18000         * icall.c (ves_icall_Type_GetGenericParameterConstraints): New interncall.
18001
18002 2004-09-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18003
18004         * appdomain.c:
18005         (mono_domain_set): allow setting a domain that is being unloaded.
18006         (mono_domain_unload): invoke the DomainUnload callbacks in the domain
18007         being unloaded.
18008
18009 2004-09-23  Zoltan Varga  <vargaz@freemail.hu>
18010
18011         * icall.c reflection.h reflection.c: Add a 'pseudo_attrs' argument to
18012         the GetCustomAttributes icall.
18013
18014 2004-09-23  Martin Baulig  <martin@ximian.com>
18015
18016         * object-internals.h (MonoReflectionGenericParam): Replaced
18017         'has_ctor_constraint', `has_reference_type' and `has_value_type'
18018         with `guint32 attrs'.
18019
18020 2004-09-23  Martin Baulig  <martin@ximian.com>
18021
18022         * icall.c (ves_icall_Type_GetGenericParameterAttributes): New interncall.
18023
18024 2004-09-23  Martin Baulig  <martin@ximian.com>
18025
18026         * object-internals.h (GenericParameterAttributes): New enum.
18027
18028 2004-09-23  Zoltan Varga  <vargaz@freemail.hu>
18029
18030         * object-internals.h (MonoEventInfo): Add 'other_methods' field.
18031         
18032         * class.c (init_events): Fill out event->other field.
18033
18034         * class.c: Fix warnings.
18035
18036         * icall.c (ves_icall_get_event_info): Fill out 'other_methods' field.
18037
18038 Wed Sep 22 19:04:32 CEST 2004 Paolo Molaro <lupus@ximian.com>
18039
18040         * class-internals.h, icall.c, loader.c, loader.h: added a faster stack
18041         walk which doesn't supply the IL offset.
18042
18043 2004-09-22  Martin Baulig  <martin@ximian.com>
18044
18045         * reflection.c (mono_reflection_setup_internal_class): If we're
18046         System.ValueType, System.Object or System.Enum, set
18047         `klass->instance_size' and create the vtable.
18048         (mono_reflection_create_internal_class): If we're an enum type,
18049         get the base class from our current corlib.
18050
18051 2004-09-22  Zoltan Varga  <vargaz@freemail.hu>
18052
18053         * reflection.h (MonoResolveTokenError): New type.
18054
18055         * icall.c (ves_icall_System_Reflection_Module_ResolveMemberToken): New
18056         icall.
18057
18058         * icall.c: Add an 'error' argument to the ResolveToken icalls.
18059
18060 2004-09-22  Lluis Sanchez Gual  <lluis@novell.com>
18061
18062         * icall.c: Support ContextBoundObject proxies in ves_icall_InternalExecute.
18063         Support also calling constructors, but only for already allocated objects.
18064
18065 2004-09-17  Geoff Norton <gnorton@customerdna.com>
18066
18067         * reflection.c (type_get_qualified_name): If the klass is null
18068         return the typename to avoid a NullRefEx.
18069         (encode_cattr_value): Get the qualified name of the boxed type,
18070         not the underlying enumtype.  Fixes #62984.
18071
18072 2004-09-21  Zoltan Varga  <vargaz@freemail.hu>
18073
18074         * marshal.c: Fix problems with previous checkin.
18075
18076 2004-09-21    <vargaz@freemail.hu>
18077
18078         * marshal.h marshal.c icall.c: Add new icalls for Alloc/FreeHGlobal. Change the
18079         existing mono_marshal_alloc/free functions to use CoTaskMemAlloc/Free under windows.
18080
18081         * marshal.c: Allocate marshaller memory using mono_marshal_alloc/free.
18082
18083 2004-09-21  Geoff Norton <gnorton@customerdna.com>
18084
18085         * icall.c (ves_icall_MonoType_GetElementType): GetElementType
18086         should only return a type for pointers, arrays, and passbyref types.
18087         Fixes bug #63841.
18088
18089 2004-09-21  Martin Baulig  <martin@ximian.com>
18090
18091         * domain.c (mono_debugger_check_runtime_version): New public
18092         function.
18093
18094         * icall.c (ves_icall_MonoDebugger_check_runtime_version): New icall.    
18095
18096 2004-09-20  Sebastien Pouliot  <sebastien@ximian.com>
18097
18098         * reflection.c: Added missing sort to the declarative security 
18099         attributes table. MS implementation stops seeing the attributes if the
18100         token number regress in the table (as shown by ildasm and permview).
18101
18102 2004-09-20  Zoltan Varga  <vargaz@freemail.hu>
18103
18104         * object-internals.h (MonoReflectionModule): Add 'token' field.
18105         
18106         * reflection.c (mono_reflection_get_token): Add support for Module
18107         and Assembly.
18108         (mono_module_get_object): Set 'token' field.
18109         (mono_module_file_get_object): Set 'token' field.
18110
18111         * icall.c: Add new Assembly and Module icalls.
18112
18113         * appdomain.c: Bump corlib version.
18114
18115 2004-09-19  Zoltan Varga  <vargaz@freemail.hu>
18116
18117         * loader.h loader.c class.h class.c: Add helper functions for obtaining
18118         tokens of metadata objects.
18119
18120         * reflection.h reflection.c (mono_reflection_get_token): New function
18121         to obtain the token of a metadata object.
18122
18123         * icall.c: Add icalls for MetadataToken and ModuleHandle methods.
18124
18125 2004-09-17  Zoltan Varga  <vargaz@freemail.hu>
18126
18127         * loader.c (mono_lookup_pinvoke_call): Try the underscore prefixed name as well.
18128         
18129         * loader.c (mono_lookup_pinvoke_call): Add support for stdcall name mangling.
18130
18131 2004-09-16  Sebastien Pouliot  <sebastien@ximian.com>
18132
18133         * appdomain.c: Bumped MONO_CORLIB_VERSION to 25.
18134         * object-internals.h: Added 3 MonoArray* members to MonoReflection
18135         AssemblyBuilder to access the permissions set in the class lib.
18136         * reflection.c: Added security attributes encoding step in 
18137         mono_image_build_metadata.
18138         * tabledefs.h: Added new security actions defined in 2.0:
18139         LinkDemandChoice, InheritanceDemandChoice and DemandChoice.
18140
18141 2004-09-16  Lluis Sanchez Gual  <lluis@novell.com>
18142
18143         * threads.c: Fixed SET_CURRENT_OBJECT macros, they were ignoring the
18144         macro parameter.
18145
18146 2004-09-16  Lluis Sanchez Gual  <lluis@novell.com>
18147  
18148         * locales.c: nullify the ICU_collator member of CompareInfo when it is
18149           finalized. There where random SIGSEVs at program termination, when
18150           an object being finalized was trying to do a string comparison and
18151           the current culture was already finalized.
18152  
18153 2004-09-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18154
18155         * threads.c: call thread_cleanup before finishing the thread if we get
18156         there.
18157
18158 2004-09-16  Zoltan Varga  <vargaz@freemail.hu>
18159
18160         * appdomain.c (ves_icall_System_AppDomain_createDomain): Load all
18161         assemblies from the parent. Fixes #65665.
18162
18163 2004-09-15  Zoltan Varga  <vargaz@freemail.hu>
18164
18165         * metadata.c (mono_metadata_parse_type): Fix parsing of custom
18166         modifiers.
18167
18168 2004-09-14  Bernie Solomon  <bernard@ugsolutions.com>
18169
18170         * reflection.h: add prototype for mono_get_dbnull_object
18171         * reflection.c: add prototypes for get_default_param_value_blobs 
18172         and mono_get_object_from_blob for fussier compilers
18173
18174 2004-09-14  Lluis Sanchez Gual  <lluis@novell.com>
18175  
18176         * object.c: Added a "done" flag to TypeInitializationLock. This avoids
18177         false deadlock checks in class initialization.
18178  
18179 2004-09-13  Zoltan Varga  <vargaz@freemail.hu>
18180
18181         * image.c (mono_image_addref): Fix comment.
18182
18183         * metadata.c (mono_metadata_parse_type): Avoid memory allocations if
18184         possible.
18185
18186 2004-09-12  Jambunathan K  <kjambunathan@novell.com>
18187
18188         * reflection.c (mono_param_get_objects): Modified to return
18189         ParameterInfo.DefaultValue object.
18190
18191         (get_default_param_value_blobs):
18192         (mono_get_object_from_blob):
18193         (mono_get_dbnull_object): New helper routines. 
18194
18195         * object.c (mono_get_constant_value_from_blob): New helper routine
18196         carved out from get_default_field_value ()
18197
18198         * object-internals.h (mono_get_constant_value_from_blob): Added
18199         function declaration.
18200
18201 2004-09-11  Zoltan Varga  <vargaz@freemail.hu>
18202
18203         * assembly.c assembly.h icall.c class.c appdomain.c: Lazily load 
18204         referenced assemblies. Fixes #62135.
18205
18206         * exception.h exception.c (mono_get_exception_file_not_found2): New
18207         helper function.
18208
18209 2004-09-10  Zoltan Varga  <vargaz@freemail.hu>
18210
18211         * class.h class.c: Add mono_type_get_underlying_type ().
18212
18213 2004-09-09  Geoff Norton <gnorton@customerndna.com>
18214
18215         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes):
18216         Fix GetTypes() to support dynamically created assemblies.
18217
18218 2004-09-09  Zoltan Varga  <vargaz@freemail.hu>
18219
18220         * reflection.c (reflection_methodbuilder_to_mono_method): Remove TODO.
18221         
18222         * reflection.c (reflection_methodbuilder_to_mono_method): Fix bug in
18223         previous patch.
18224
18225         * reflection.h reflection.c loader.c: Allow dynamic construction of
18226         pinvoke methods. Fixes #65571.
18227         
18228         * reflection.c (mono_reflection_get_type): Revert previous change since
18229         it causes regressions.
18230
18231 2004-09-08  Martin Baulig  <martin@ximian.com>
18232
18233         * class.c (class_compute_field_layout): Don't call
18234         mono_class_layout_fields() for open generic instances.
18235
18236 2004-09-08 Bernie Solomon <bernard@ugsolutions.com>
18237         * threads.c appdomain.c: fix typo in GC macro
18238
18239 2004-09-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18240
18241         * threads.c: don't call mono_thread_detach() in start_wrapper(),
18242         avoiding a possible hang in GetCurrentThreadId(0). Fixes bug #65379.
18243
18244 2004-09-08  Zoltan Varga  <vargaz@freemail.hu>
18245
18246         * image.c (mono_image_close): Applied patch from 
18247         vasantha.paulraj@honeywell.com (Vasantha selvi). Fix crash when an
18248         assembly is loaded multiple times from data.
18249         
18250         * image.c (mono_image_open): Fix warning.
18251
18252 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
18253
18254         * reflection.h reflection.c icall.c: Only call TypeResolve handlers
18255         once. Fixes #58334.
18256         
18257         * reflection.c (mono_reflection_create_runtime_class): Initialize
18258         klass->nested_classes. Fixes #61224.
18259
18260 Tue Sep 7 14:35:26 CEST 2004 Paolo Molaro <lupus@ximian.com>
18261
18262         * threads.c: sched_yield() on exit, to allow threads to quit.
18263
18264 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
18265
18266         * object.c (mono_unhandled_exception): Remove leftover debug code.
18267
18268 2004-09-07  Atsushi Enomoto  <atsushi@ximian.com>
18269
18270         * appdomain.c, threads.c : don't use GC_CreateThread when with-gc=none
18271
18272 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
18273
18274         * marshal.c (emit_marshal_array): Really null terminate string arrays.
18275         
18276         * marshal.c (emit_marshal_string): Fix freeing of unicode strings.
18277
18278 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
18279
18280         * marshal.c (emit_marshal_array): Null terminate string arrays.
18281         
18282         * marshal.c (raise_auto_layout_exception): Fix warning.
18283
18284         * reflection.c (mono_param_get_objects): Initialize the default value
18285         with DBNull.Value, not null. Fixes #62123.
18286
18287 2004-09-01  Miguel de Icaza  <miguel@ximian.com>
18288
18289         * marshal.c (mono_marshal_get_managed_wrapper): Remove FIXME and
18290         throw an exception with a cute explanation.
18291
18292 2004-09-06  Dick Porter  <dick@ximian.com>
18293
18294         * process.c (ves_icall_System_Diagnostics_Process_Start_internal):
18295         Close the new process's thread handle, as we don't use it.  The
18296         handle stays around forever otherwise.
18297
18298 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
18299
18300         * object.c (arith_overflow): Fix warning.
18301
18302         * reflection.c (mono_image_get_methodref_token): Do not emit unmanaged
18303         calling conventions in method refs. Fixes #65352.
18304
18305         * reflection.c: Fix warnings.
18306
18307 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
18308
18309         * icall.c: Add a new icall for Array.Clear
18310
18311 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
18312
18313         * object.c: When allocating an array, we have to throw
18314         an overflow exception if any of the lengths are < 0.
18315
18316 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
18317
18318         * marshal.h marshal.c: Free unmanaged memory allocated by managed code
18319         properly. Also move implementation of string array marshalling to 
18320         managed code. Fixes #42316.
18321
18322 2004-09-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18323
18324         * assembly.c: provide more information when loading an assembly fails.
18325
18326 2004-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18327
18328         * filewatcher.c: don't expect the development fam package to be
18329         installed.
18330
18331 2004-09-03  Zoltan Varga  <vargaz@freemail.hu>
18332
18333         * marshal.c: Make a copy of the signature cookie since it will be
18334         freed by the caller.
18335         
18336         * marshal.c (mono_delegate_to_ftnptr): Fix bug in previous patch.
18337
18338         * marshal.c (mono_delegate_to_ftnptr): Fix memory leaks.
18339
18340         * metadata.c (mono_metadata_free_marshal_spec): New function to free
18341         marshal specs.
18342
18343         * marshal.c: More refactoring.
18344         
18345         * marshal.c: Refactor the mono_marshal_get_native_wrapper function into
18346         smaller functions.
18347
18348 2004-09-03  Lluis Sanchez Gual  <lluis@novell.com>
18349
18350         * object.c: In mono_message_invoke, fill the output parameter array after
18351           calling the managed method (it was done before the call). This fixes
18352           bug #59299.
18353
18354 2004-09-02  Zoltan Varga  <vargaz@freemail.hu>
18355
18356         * marshal.c (mono_marshal_alloc): Return a valid pointer on size 0
18357         as well.
18358
18359 2004-09-02  Martin Baulig  <martin@ximian.com>
18360
18361         * class.c (mono_class_instance_size): Don't allow generic type
18362         definitions or open generic instances.
18363         (mono_class_array_element_size): If we're a value type, call
18364         mono_class_instance_size() on the original class.
18365
18366         * metadata.c (mono_type_size, mono_type_stack_size): Correctly
18367         handle generic instances.
18368
18369         * mono-debug-debugger.c (write_type): Handle generic instances
18370         like classes.
18371
18372 2004-09-02  Zoltan Varga  <vargaz@freemail.hu>
18373
18374         * marshal.c (mono_marshal_alloc): Raise an OutOfMemory exception if
18375         the allocation request fails. Fixes #65089.
18376
18377         * object.c (mono_runtime_free_method): Do not call mono_free_method.
18378         
18379         * object.c (mono_runtime_free_method): New function to free a dynamic
18380         method.
18381
18382         * marshal.c (mono_delegate_free_ftnptr): New function to free the
18383         delegate trampoline.
18384
18385         * marshal.c (mono_marshal_get_managed_wrapper): Mark managed wrapper
18386         with hasthis as dynamic,
18387
18388         * icall.c (ves_icall_System_Delegate_FreeTrampoline): New icall.
18389
18390         * domain.c (mono_jit_info_table_remove): New function to remove an
18391         entry from the jit info table.
18392
18393         * class-internals.h (MonoMethod): Add 'dynamic' field.
18394
18395         * loader.c: Fix warnings.
18396
18397 2004-09-01  Martin Baulig  <martin@ximian.com>
18398
18399         * mono-debug.c, debug-mono-symfile.c: Use mono_loader_lock()
18400         instead of mono_debugger_lock() because the latter one is a no-op
18401         unless running in the debugger.
18402
18403 2004-09-01  Zoltan Varga  <vargaz@freemail.hu>
18404
18405         * class.c (class_compute_field_layout): Classes with auto-layout or
18406         reference fields are not blittable.
18407         
18408 2004-09-01  Dick Porter  <dick@ximian.com>
18409
18410         * icall.c (ves_icall_System_Reflection_Assembly_get_location): Use
18411         mono_image_get_filename() to get the assembly location.
18412
18413         * icall.c:
18414         * metadata.h: Fix compile warnings
18415
18416 2004-09-01  Zoltan Varga  <vargaz@freemail.hu>
18417
18418         * class.c (class_compute_field_layout): System.Object is blittable.
18419
18420         * marshal.c (mono_marshal_get_native_wrapper): Pass blittable classes
18421         as in/out. Fixes #59909.
18422
18423 2004-09-01  Martin Baulig  <martin@ximian.com>
18424
18425         * metadata.h (MONO_TYPE_ISREFERENCE): Call
18426         mono_metadata_generic_inst_is_valuetype() if we're a generic
18427         instance to check whether our underlying type is a reference type.
18428
18429 2004-09-01  Martin Baulig  <martin@ximian.com>
18430
18431         * metadata.c (mono_type_size): If we're a generic instance, call
18432         mono_class_value_size() for value types.
18433
18434 2004-08-31  Zoltan Varga  <vargaz@freemail.hu>
18435
18436         * marshal.c: Implement more custom marshalling functionality. Fixes
18437         #64915.
18438
18439 Tue Aug 31 17:55:15 CEST 2004 Paolo Molaro <lupus@ximian.com>
18440
18441         * mono-debug.c, debug-mono-symfile.c: add some locking love.
18442
18443 2004-08-30  Zoltan Varga  <vargaz@freemail.hu>
18444
18445         * domain-internals.h domain.c: Add a per-domain jump trampoline hash.
18446
18447         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandle): Rename to ...Internal.
18448
18449         * icall.c: Fix some warnings.
18450
18451         * threads.c (abort_appdomain_thread): Fix unref errors.
18452         (mono_thread_current): Fix THREAD_DEBUG define.
18453
18454 2004-08-29  Zoltan Varga  <vargaz@freemail.hu>
18455
18456         * metadata.h (MONO_TYPE_ISSTRUCT): Fix warning.
18457
18458         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandle): New icall.
18459
18460 2004-08-28  Zoltan Varga  <vargaz@freemail.hu>
18461
18462         * marshal.c (mono_marshal_get_native_wrapper): Add support for byref 
18463         string arrays.
18464
18465 2004-08-28  Martin Baulig  <martin@ximian.com>
18466
18467         * metadata.c
18468         (mono_metadata_generic_inst_is_valuetype): New public function.
18469
18470         * metadata.h (MONO_TYPE_ISSTRUCT): Call
18471         mono_metadata_generic_inst_is_valuetype() if we're a generic
18472         instance to check whether our underlying type is a valuetype.
18473
18474 2004-08-26  Zoltan Varga  <vargaz@freemail.hu>
18475
18476         * class.c (mono_ptr_class_get): Fix name of pointer classes. Fixes
18477         #63768.
18478
18479 2004-08-25  Martin Baulig  <martin@ximian.com>
18480
18481         * loader.c (mono_get_method_from_token): Abstract methods can also
18482         be generic and thus have type parameters.
18483
18484         * metadata-internals.h
18485         (MonoDynamicImage): Added `GPtrArray *gen_params'.
18486
18487         * reflection.c (mono_image_get_generic_param_info): Don't create a
18488         metadata row, just add an entry to the `gen_params' array.
18489         (build_compressed_metadata): Sort the `gen_params' array and then
18490         actually create the metadata.
18491
18492 2004-08-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18493
18494         * threadpool.c: remove unneeded 'if' around mono_monitor_enter.
18495
18496 2004-08-25  Zoltan Varga  <vargaz@freemail.hu>
18497
18498         * debug-helpers.c: Handle MONO_TYPE_GENERICINST.
18499
18500 2004-08-24  Martin Baulig  <martin@ximian.com>
18501
18502         * class.cs (mono_class_is_subclass_of): Like an interface, a
18503         generic instance also derives from System.Object.
18504
18505 2004-08-23  Zoltan Varga  <vargaz@freemail.hu>
18506
18507         * metadata.c (mono_metadata_parse_type): Alloc pinned, byref and
18508         custom modifiers to be in any order. Fixes #61990.
18509
18510 2004-08-20  Zoltan Varga  <vargaz@freemail.hu>
18511
18512         * object.c: Register mono_object_new_fast icall.
18513         
18514         * object.c (mono_class_get_allocation_ftn): Return to calling
18515         mono_object_new_fast, since it seems faster to compute the object 
18516         size in unmanaged code than passing it as a parameter.
18517
18518         * object.c (mono_class_get_allocation_ftn): Add marshalbyref case.
18519
18520         * gc-internal.h gc.c: Add mono_gc_out_of_memory () function. Register
18521         this function with Boehm as the oom handler, so we don't have to check
18522         the result of GC_malloc.
18523
18524         * object.c: Remove checks for oom.
18525
18526         * object.h object.c (mono_class_get_allocation_ftn): New function to
18527         return the icall which can be used to allocate an instance of a given
18528         class. 
18529
18530         * object.c: Handle common allocation requests using GC_gcj_fast_malloc.
18531
18532         * class-internals.h: Add 'enabled' field.
18533
18534 2004-08-19  Zoltan Varga  <vargaz@freemail.hu>
18535
18536         * domain.c (mono_init_internal): Call MONO_GC_PRE_INIT ().
18537
18538 2004-08-18  Jambunathan K  <kjambunathan@novell.com>
18539         * tabledefs.h: Corretced PARAM_ATTRIBUTE_OPTIONAL to the right
18540         value 0x0010.
18541
18542 2004-08-18 Ben Maurer  <bmaurer@users.sourceforge.net>
18543
18544         * appdomain.c: use the Tls function for appdomain too,
18545         at Zoltan's request. Actually return in mono_context_get
18546
18547         * appdomain.c, profiler.c, threads.c: use __thread
18548
18549 2004-08-18  Zoltan Varga  <vargaz@freemail.hu>
18550
18551         * appdomain.c threads.c: Call GC_CreateThread on windows.
18552
18553         * Makefile.am (libmetadata_la_LIBADD): Avoid linking libmonoos into
18554         multiple libraries since this don't work on windows.
18555
18556 2004-08-18  Martin Baulig  <martin@ximian.com>
18557
18558         * class-internals.h
18559         (MonoMethodNormal): Moved `MonoGenericParam *gen_params' here from
18560         MonoMethodHeader.
18561
18562         * metadata.h (MonoMethodHeader): Moved the `gen_params' field to
18563         MonoMethodNormal since we also need it for abstract and interface
18564         methods.
18565
18566         * reflection.c
18567         (build_compressed_metadata): Sort the GenericParam table.
18568         (mono_image_create_token): Added `gboolean create_methodspec'
18569         argument; this is false when generating a MethodImpl token.
18570         (reflection_methodbuilder_to_mono_method): Abstract and interface
18571         methods may also have generic parameters.
18572
18573 2004-08-17 Ben Maurer  <bmaurer@users.sourceforge.net>
18574
18575         * appdomain.c: thread local alloc
18576
18577 2004-08-17  Martin Baulig  <martin@ximian.com>
18578
18579         * appdomain.c: Bumped MONO_CORLIB_VERSION to 24.
18580
18581         * icall.c
18582         (ves_icall_System_MonoType_getFullName): Added `gboolean full_name'
18583         argument.
18584
18585         * class.c (mono_type_get_full_name): New public function.
18586         (mono_type_get_name): Don't include the type arguments.
18587
18588 2004-08-16  Zoltan Varga  <vargaz@freemail.hu>
18589
18590         * Makefile.am: Build static versions of libmetadata and libmonoruntime
18591         for inclusion into the mono executable.
18592
18593 2004-08-16  Martin Baulig  <martin@ximian.com>
18594
18595         * metadata.c (do_mono_metadata_parse_generic_inst): Store the
18596         MonoGenericInst, not the MonoType in the `generic_inst_cache'.
18597
18598 2004-08-14  Martin Baulig  <martin@ximian.com>
18599
18600         * class.c (dup_type): Also copy the `byref' field.
18601
18602 2004-08-15  Zoltan Varga  <vargaz@freemail.hu>
18603
18604         * reflection.c (create_dynamic_mono_image): Revert the last change 
18605         since it breaks bootstrap.
18606
18607 2004-08-14  Zoltan Varga  <vargaz@freemail.hu>
18608
18609         * reflection.c (create_dynamic_mono_image): Set ref_count to 1.
18610
18611         * image.c (mono_image_close): Dynamic images are GC_MALLOCed, so do
18612         not free them with g_free.
18613
18614 2004-08-11  Martin Baulig  <martin@ximian.com>
18615
18616         * reflection.c (mono_reflection_setup_internal_class): Also call
18617         mono_class_setup_mono_type() if we already have a `tb->type.type'.
18618
18619 2004-08-09  Sebastien Pouliot  <sebastien@ximian.com>
18620
18621         * appdomain.c: Fix ves_icall_System_AppDomain_getDomainByID when 
18622         called during default (first) AppDomain creation. Keep track of
18623         Evidence when loading assemblies.
18624
18625 Mon Aug 9 14:41:45 CEST 2004 Paolo Molaro <lupus@ximian.com>
18626
18627         * opcodes.c, opcodes.h: reduce runtime relocations.
18628
18629 Mon Aug 9 13:30:53 CEST 2004 Paolo Molaro <lupus@ximian.com>
18630
18631         * culture-info.h, locales.c: fixes and chages to sue the new
18632         optimized format of the locale data.
18633         * culture-info-tables.h: regenerated.
18634
18635 2004-08-06  Geoff Norton <gnorton@customerdna.com>
18636         
18637         * filewatcher.c: If HAVE_KQUEUE return mode 3 to use the new kqueue watcher
18638
18639 2004-08-05  Sebastien Pouliot  <sebastien@ximian.com>
18640
18641         * appdomain.c: Bumped MONO_CORLIB_VERSION to 23. Added new icall
18642         ves_icall_System_AppDomain_getDomainByID to get an AppDomain by Id.
18643         * domain-internals.h: icall declaration.
18644         * icall.c: icall registration.
18645         * object-internals.h: New fields in MonoAssembly for CAS.
18646
18647 2004-08-05  Duncan Mak  <duncan@ximian.com>
18648
18649         * verify.c: Renamed CEE_STELEM to CEE_STELEM_ANY and CEE_LDELEM to
18650         CEE_LDELEM_ANY.
18651
18652 Thu Aug 5 17:11:44 CEST 2004 Paolo Molaro <lupus@ximian.com>
18653
18654         * reflection.c: fix to deal with object[] arrays in custom ctors
18655         (bug #62550).
18656
18657 2004-08-05  Martin Baulig  <martin@ximian.com>
18658
18659         * class.c (mono_class_array_element_size): Added support for
18660         generic instances and correctly handle "recursive" types.
18661
18662 2004-08-05  Zoltan Varga  <vargaz@freemail.hu>
18663
18664         * assembly.c: Fix warnings.
18665
18666 2004-08-04  Martin Baulig  <martin@ximian.com>
18667
18668         * class.c
18669         (mono_type_get_name_recurse): Added `gboolean include_arity'
18670         argument specifying whether or not we should include the generic
18671         arity in the type name.
18672         (_mono_type_get_name): New static function.
18673         (mono_class_setup_vtable): If we're a generic instance, don't
18674         include the generic arity in the names of explicit method
18675         implementations.        
18676
18677 2004-08-03  Martin Baulig  <martin@ximian.com>
18678
18679         * class.c (mono_type_get_name_recurse): Enclose the generic type
18680         arguments in `<', '>'.
18681
18682 Tue Aug 3 17:54:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
18683
18684         * gc.c: make GC warning messages use the trace API, they are just
18685         noise to most of the users.
18686
18687 2004-08-03  Martin Baulig  <martin@ximian.com>
18688
18689         * debug-mono-symfile.c (read_string): Correctly read the string.
18690
18691 2004-07-30  Zoltan Varga  <vargaz@freemail.hu>
18692
18693         * marshal.c (signature_dup_add_this): Fix bug in previous patch.
18694         
18695         * marshal.c (mono_marshal_get_icall_wrapper): Add support for vararg
18696         icalls.
18697         (mono_marshal_get_runtime_invoke): Correctly handle valuetype methods.
18698
18699 2004-07-30  Martin Baulig  <martin@ximian.com>
18700
18701         * debug-mono-symfile.c, mono-debug.c, mono-debug-debugger.c:
18702         Reflect latest symbol writer changes.   
18703
18704 Fri Jul 30 16:49:05 CEST 2004 Paolo Molaro <lupus@ximian.com>
18705
18706         * object.c: always create an object if null is passed
18707         to Invoke() where a valuetype is expected.
18708
18709 2004-07-29  Bernie Solomon  <bernard@ugsolutions.com>
18710
18711         * marshal.c (mono_marshal_init): make managed
18712         signatures match native ones better for 64bits.
18713
18714 2004-07-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18715
18716         * appdomain.c: hack to build correctly the private bin path on windows.
18717         Fixes bug #61991.
18718
18719 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
18720
18721         * assembly.c: Load mscorlib from the correct framework directory
18722           (mono/<version>/mscorlib.dll).
18723         * appdomain.h: Added prototypes for new functions.
18724         * internals.h: Added some prototypes.
18725         * domain.c: When initializing the runtime, get from the executable and
18726           the configuration files the runtime version that the app supports.
18727           Added support methods for reading app.exe.config. Added list of versions
18728           supported by the JIT. Added two new methods: mono_init_from_assembly,
18729           which initializes the runtime and determines the required version from
18730           the provided exe file, and mono_init_version, which initializes
18731           the runtime using the provided version.
18732         * icall.c: Get machine.config from version-specific directory.
18733         * reflection.c: When generating an image, embed the version number
18734           of the current runtime.
18735
18736 2004-07-28  Dick Porter  <dick@ximian.com>
18737
18738         * socket-io.c
18739         (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal): Check
18740         returned sockaddr size before creating the remote address object.
18741         Patch by Nick Vaughan (dev@6wardlaw.freeserve.co.uk), fixes bug
18742         61608.
18743
18744 2004-07-28  Dick Porter  <dick@ximian.com>
18745
18746         * locales.c (string_invariant_compare_char): Fix invariant char
18747         compares between upper and lower cases.  Fixes bug 61458.
18748
18749 2004-07-27  Ben Maurer  <bmaurer@ximain.com>
18750         
18751         * marshal.c: actually cache stelem.ref wrappers.
18752         
18753 Tue Jul 27 16:56:55 CEST 2004 Paolo Molaro <lupus@ximian.com>
18754
18755         * class.c, image.c, loader.c, cil-coff.h: lazily mmap the image 
18756         sections and remove the mono_cli_rva_map () function.
18757
18758 Tue Jul 27 15:58:19 CEST 2004 Paolo Molaro <lupus@ximian.com>
18759
18760         * debug-mono-symfile.c: fix one more endianess issue, from a patch
18761         by Geoff Norton (<gnorton@customerdna.com>).
18762
18763 Tue Jul 27 15:47:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
18764
18765         * class.c: fix class loads for pointer types (typeof(int) !=
18766         typeof(int*)).
18767
18768 2004-07-27  Martin Baulig  <martin@ximian.com>
18769
18770         * debug-mono-symfile.c (mono_debug_open_mono_symbol_file): Support
18771         reading the debugging information from an external ".mdb" file.
18772
18773 2004-07-24  Martin Baulig  <martin@ximian.com>
18774
18775         * reflection.c (mono_image_get_type_info): Only write a class
18776         layout entry if we actually have a size or a packing size.
18777
18778 2004-07-21  Bernie Solomon  <bernard@ugsolutions.com>
18779
18780         * reflection.c (type_get_fully_qualified_name): 
18781         insert cast to get type checking of ?: with non-gcc compilers
18782
18783 2004-07-21  Bernie Solomon  <bernard@ugsolutions.com>
18784
18785         * rand.c: use g_getenv for both lookups of
18786         MONO_EGD_SOCKET
18787
18788 2004-07-17  Martin Baulig  <martin@ximian.com>
18789
18790         * reflection.c (mono_reflection_bind_generic_method_parameters):
18791         Set `gmethod->reflection_info'.
18792
18793 2004-07-17  Martin Baulig  <martin@ximian.com>
18794
18795         * class.c (mono_class_create_from_typedef): Insert the newly
18796         created class into the hash table before computing the interfaces
18797         since we could be called recursively.
18798
18799 2004-07-16  Ben Maurer  <bmaurer@ximain.com>
18800
18801         * marshal.[ch] (mono_marshal_get_stelemref): a new wrapper
18802         function to implement stelem.ref in managed code
18803         * class-internals.h, debug-helpers.c: a new wrapper type
18804         for the above.
18805
18806 Wed Jul 14 19:26:05 CEST 2004 Paolo Molaro <lupus@ximian.com>
18807
18808         * gc.c: allow GC handles to work even when no GC is compiled in.
18809         Fix part of bug #61134 (GetAddrOfPinnedObject).
18810
18811 2004-07-13  Peter Williams  <peter@newton.cx>
18812  
18813         * process.c (complete_path): Make sure we don't attempt to execute
18814         directories.
18815  
18816 2004-07-12  Geoff Norton <gnorton@customerdna.com>
18817
18818         * DateTime.cs: Patch for bug #61112.  Our DateTime wasn't roundtripping over timezone
18819           boundaries properly.  This patch checkes ToLocalTime() to see if we're tripping over a boundary
18820           and will add/subtract the hour if needed
18821
18822 2004-07-12  Martin Baulig  <martin@ximian.com>
18823
18824         * reflection.c (mono_field_get_object): If we have
18825         `field->generic_info', take the attributes from
18826         `field->generic_info->generic_type'.    
18827
18828 2004-07-12  Martin Baulig  <martin@ximian.com>
18829
18830         * mono-debug.c (mono_debug_init): Don't take a `MonoDomain *'.
18831         This function must be called before initializing the runtime.
18832         (mono_debug_init_1): New function; call this after initializing
18833         the runtime, but before loading the assembly.  It tells the
18834         debugger to load corlib and the builtin types.
18835
18836         * mono-debug-debugger.c: Did some larger changes in the debugging
18837         code; support recursive class declarations, make sure we actually
18838         add all classes.
18839
18840 2004-07-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18841
18842         * debug-helpers.c: undo my previous patch and fixed the real issue in
18843         ../mini/exceptions-x86.c
18844
18845 2004-07-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18846
18847         * debug-helpers.c: prevent SIGSEGV. It happened running xsp on monodoc
18848         when no HOME env. variable was set and a NullRef was thrown in a .cctor
18849         called from other .cctors.
18850
18851 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
18852
18853         * loader.c: Removed the mono_loader_wine_init hack now that we are
18854         doing a managed version of Windows.Forms.
18855
18856 2004-07-09  Ben Maurer  <bmaurer@ximian.com>
18857
18858         * domain.c, gc.c, marshal.c, mono-debug-debugger.c,
18859         threadpool.c, threads.c: remove static data from rootset.
18860
18861 2004-07-09  Dick Porter  <dick@ximian.com>
18862
18863         * locales.c (ves_icall_System_String_InternalReplace_Str_Comp):
18864         Don't do any more processing if the matched length was 0.  It was
18865         increasing the size of the string before.  Fixes bug 61167.
18866
18867 2004-07-09  Dick Porter  <dick@ximian.com>
18868
18869         * socket-io.h:
18870         * socket-io.c
18871         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
18872         Add support for SO_PEERCRED if its available.
18873
18874 2004-07-09  Peter Bartok <pbartok@novell.com>
18875         * loader.c: winelib.exe.so error message is now only displayed if
18876         MONO_DEBUG is set. To help us avoid questions when people are trying
18877         out the new Managed.Windows.Forms.
18878
18879 2004-07-08  Zoltan Varga  <vargaz@freemail.hu>
18880
18881         * class-internals.h debug-helpers.c marshal.c: Add new wrapper types 
18882         for isinst and castclass wrappers.
18883
18884         * class-internals.h icall.c: Move registration and lookup of JIT icalls
18885         to libmetadata from the JIT, so they could be used by the marshalling
18886         code and the interpreter.
18887
18888         * marshal.c: Register marshalling related JIT icalls here instead of
18889         in mini.c. Use CEE_MONO_ICALL instead of the family of 
18890         CEE_MONO_PROC<x> opcodes to call marshalling functions.
18891
18892         * metadata.h: Remove unneeded marshalling conversions.
18893
18894         * opcodes.c: Update for new opcodes.
18895         
18896 2004-07-08  Martin Baulig  <martin@ximian.com>
18897
18898         * mono-debug.c: Check for `handle->symfile' being non-NULL everywhere.
18899         (mono_debug_get_domain_data): Make this function static.
18900
18901 Wed Jul 7 12:32:29 CEST 2004 Paolo Molaro <lupus@ximian.com>
18902
18903         * gc.c, object.h: add nice GC handle API for embedders.
18904
18905 2004-07-06  Ben Maurer  <bmaurer@ximian.com>
18906
18907         * reflection.c: more changes for the new api
18908
18909         * object.c: When we reflect on a field w/ a constant value, it
18910         will not have a memory location, so we must access metadata. Also,
18911         allow easier reading of strings so that we can read them from
18912         the constant data.
18913
18914         * class.c (mono_class_layout_fields): no need for literal fields here.
18915
18916         * class-internals.h: api changes for const fields
18917
18918         * icall.c (ves_icall_get_enum_info): use new apis for const fields
18919
18920 2004-07-06  Martin Baulig  <martin@ximian.com>
18921
18922         * mono-debug.h: Increment version number to 44.
18923
18924         * mono-debug.c (mono_debug_add_wrapper): The second argument is
18925         now a gpointer, rewrote this whole method.
18926
18927         * mono-debug-debugger.c (mono_debugger_add_wrapper): New
18928         function.  Add information about the wrapper in a new "misc table".
18929
18930         * mono-debug-debugger.h (MonoDebuggerSymbolTable): Added fields
18931         for the new misc table.
18932
18933 2004-07-05  Zoltan Varga  <vargaz@freemail.hu>
18934
18935         * metadata-internals.h image.c: Add a cache for helper signatures.
18936
18937         * monosn.c: Applied patch from "grompf" (grompf@sublimeintervention.com). Fix compilation under OSX.
18938
18939 2004-07-03  Zoltan Varga  <vargaz@freemail.hu>
18940
18941         * marshal.c (mono_marshal_get_managed_wrapper): Handle returning
18942         delegates from a delegate. Fixes #61033.
18943         
18944         * marshal.c: Fix managed->native stringbuilder marshalling. Implement
18945         marshalling of stringbuilder arrays. Fixes #59900.
18946
18947 2004-07-02  Zoltan Varga  <vargaz@freemail.hu>
18948
18949         * icall.c: Add EnumBuilder:setup_enum_type icall.
18950
18951 2004-06-30  Ben Maurer  <bmaurer@ximian.com>
18952
18953         * icall.c: Added a new icall for the property version of
18954         OffsetOfStringData.
18955
18956 2004-06-30  Zoltan Varga  <vargaz@freemail.hu>
18957
18958         * class-internals.h (MonoVTable): Make max_interface_id a guint32 so
18959         it has a constant size across platforms.
18960
18961         * marshal.c (mono_delegate_end_invoke): Avoid crash when there is no
18962         stack trace.
18963
18964 2004-06-29  Martin Baulig  <martin@ximian.com>
18965
18966         * mono-debug.c (mono_debug_add_method): Protect the whole function
18967         in mono_debugger_lock(), not just parts of it.
18968
18969 Fri Jun 25 21:36:26 CEST 2004 Paolo Molaro <lupus@ximian.com>
18970
18971         * reflection.c: make sure padding bytes in heaps are zeroed.
18972
18973 2004-06-24  David Waite  <mass@akuma.org>
18974
18975         * appdomain.c, class.c, domain.c, file-io.c, gc.c, icall.c,
18976         image.c, loader.c, locales.c, marshal.c, metadata.c,
18977         mono-debug.[ch], object.c, reflection.c, security.c, socket-io.c,
18978         string-icalls.c, threads.c: change to C90-style comments from C99 /
18979         C++ -style
18980
18981 2004-06-24  Dick Porter  <dick@ximian.com>
18982
18983         * threads.c
18984         (ves_icall_System_Threading_Mutex_CreateMutex_internal): Correctly
18985         return createdNew.  Fixes bug 60412.
18986
18987         * threads-types.h: 
18988         * icall.c: Add createdNew parameter to CreateMutex icall
18989
18990 Thu Jun 24 16:06:41 CEST 2004 Paolo Molaro <lupus@ximian.com>
18991
18992         * reflection.c, object-internals.h: save default value in params.
18993
18994 2004-06-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18995
18996         * appdomain.c: for paths in PrivateBinPath that are absolute, there's
18997         no need to build a new path combining that with the application base.
18998         Fixes bug #60442.
18999
19000 Wed Jun 23 18:36:58 CEST 2004 Paolo Molaro <lupus@ximian.com>
19001
19002         * reflection.c: fixed minor standard compliance issues.
19003
19004 Wed Jun 23 17:59:29 CEST 2004 Paolo Molaro <lupus@ximian.com>
19005
19006         * reflection.c: fixed issue with encoding some custom attributes
19007         (arrays in properties and fields, bug #60411).
19008
19009 2004-06-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19010
19011         * reflection.c: fix start address when copying the public key token.
19012
19013 2004-06-23  Martin Baulig  <martin@ximian.com>
19014
19015         * mono-debug-debugger.c (mono_debugger_unhandled_exception): Store
19016         the `exc' object in a static object to put it into the GC's root set.
19017
19018 Wed Jun 23 15:37:31 CEST 2004 Paolo Molaro <lupus@ximian.com>
19019
19020         * reflection.c: make mono_reflection_setup_internal_class ()
19021         callable a second time to setup a new parent class.
19022
19023 2004-06-23  Dick Porter  <dick@ximian.com>
19024
19025         * threads.c: Check for WAIT_IO_COMPLETION return values.
19026
19027 2004-06-22  Sebastien Pouliot  <sebastien@ximian.com>
19028
19029         * appdomain.c: Removed the g_free on the public key token. Now copy 
19030         the pk token string into the MonoAssemblyName buffer using g_strlcpy.
19031         * assembly.c: Added public key token string value when loading 
19032         assemblies. Fix bug #60439.
19033         * icall.c: Added missing informations (like public key) in 
19034         GetReferencedAssemblies. Fix #60519.
19035         * image.h: Changed definition for public key token from const char*
19036         public_tok_value to guchar public_key_token [17];
19037         * reflection.c: Updated for changes to public key token.
19038
19039 2004-06-22  Lluis Sanchez Gual
19040
19041         * icall.c: In ves_icall_InternalExecute, when setting a filed, also look 
19042         for the field in base classes.
19043
19044 Tue Jun 22 16:48:02 CEST 2004 Paolo Molaro <lupus@ximian.com>
19045
19046         * mono-debug.h, mono-debug-debugger.h, debug-mono-symfile.h:
19047         mark headers as not supported, they are installed only for use by the
19048         debugger.
19049
19050 Tue Jun 22 16:32:03 CEST 2004 Paolo Molaro <lupus@ximian.com>
19051
19052         * *.c, *.h: avoid namespace pollution in public headers.
19053
19054 2004-06-21  Martin Baulig  <martin@ximian.com>
19055
19056         * exception.c (mono_get_exception_security): It's in
19057         "System.Security", not in "System".
19058
19059         * mono-debug-debugger.c (mono_debugger_add_builtin_types): Add all
19060         the exception classes.
19061
19062 2004-06-21  Martin Baulig  <martin@ximian.com>
19063
19064         * mono-debug-debugger.c (mono_debugger_unhandled_exception):
19065         Protect the exception object from being finalized.
19066
19067 2004-06-21  Martin Baulig  <martin@ximian.com>
19068
19069         * mono-debug-debugger.h (mono_debugger_unhandled_exception): New
19070         public function.
19071
19072 2004-06-21  Sebastien Pouliot  <sebastien@ximian.com>
19073
19074         * reflection.c: Load the assembly in mono_reflection_type_from_name,
19075         if it was not loaded before. Fix parts of #60439.
19076
19077 Mon Jun 21 16:04:43 CEST 2004 Paolo Molaro <lupus@ximian.com>
19078
19079         * marshal.c, icall.c, object.c, image.c: fix the runtime_invoke ()
19080         code that was broken since Ben's change: wrappers are now
19081         dependent on the method signature only again.
19082
19083 2004-06-21  Martin Baulig  <martin@ximian.com>
19084
19085         * mono-debug-debugger.c (write_class): Cleaned this up a bit and
19086         added interface support.
19087
19088 2004-06-21  Martin Baulig  <martin@ximian.com>
19089
19090         * class.c (mono_vtable_get_static_field_data): New public method.
19091
19092 2004-06-20  Atsushi Enomoto  <atsushi@ximian.com>
19093
19094         * filewatcher.c : Windows build fix to be compliant with API changes.
19095
19096 Sat Jun 19 19:04:50 CEST 2004 Paolo Molaro <lupus@ximian.com>
19097
19098         * class.h, class.c: more accessors.
19099         * metadata.h, metadata.c: prepare for hiding MonoType and
19100         MonoMethodSignature: people should use the accessors from now on
19101         outside of the tree.
19102
19103 Sat Jun 19 17:56:50 CEST 2004 Paolo Molaro <lupus@ximian.com>
19104
19105         * *.c, *.h: more API cleanups.
19106
19107 2004-06-18  Jackson Harper  <jackson@ximian.com>
19108
19109         * assembly.c: Trace loading assemblies.
19110         * loader.c: Trace loading native libraries.
19111         * mono-config.c: Trace loading config files.
19112         
19113 2004-06-18  Dick Porter  <dick@ximian.com>
19114
19115         * locales.c: Tell ICU the lengths of strings, it can cope with
19116         embedded \0 then.  Fixes bug 59274, and doesn't break bug 55822.
19117
19118 Fri Jun 18 11:59:57 CEST 2004 Paolo Molaro <lupus@ximian.com>
19119
19120         * image.c: swapped name/filename;
19121
19122 2004-06-18  Martin Baulig  <martin@ximian.com>
19123
19124         * mono-debug-debugger.c (write_class): Write the parent class at
19125         the end of the header.
19126
19127 Thu Jun 17 16:50:44 CEST 2004 Paolo Molaro <lupus@ximian.com>
19128
19129         * *.c, *.h, Makefile.am: more API cleanups and bugfixes.
19130
19131 2004-06-17  Raja R Harinath  <rharinath@novell.com>
19132
19133         * Makefile.am (PLATFORM_LIB): New.  Possibly refer to ../os/libmonoos.la.
19134         (bundle_obj): New conditional define.
19135         (BUILT_SOURCES): Remove.
19136         ($(bundle_srcs)): Make parallel-make safe.
19137         (libmonoruntime_la_LIBADD): Make unconditional.
19138         (libmetadata_la_LIBADD): Make unconditional.  Refer to $(bundle_obj).
19139         (libmetadata_la_SOURCES): Don't refer to $(bundle_srcs).
19140
19141 2004-06-17  Atsushi Enomoto  <atsushi@ximian.com>
19142
19143         * culture-info-tables.h: It was inconsistent with the latest
19144           supp info files.
19145
19146 2004-06-17  Zoltan Varga  <vargaz@freemail.hu>
19147
19148         * assembly.c (mono_assembly_open): Fix crash when the assembly can't
19149         be loaded.
19150
19151         * threads.c (ves_icall_System_Threading_Thread_Resume): Fix compilation
19152         with gcc 2.95.
19153
19154 Wed Jun 16 18:23:45 CEST 2004 Paolo Molaro <lupus@ximian.com>
19155
19156         * threads.h, icall.c, object.c, threadpool.c, threads-types.h:
19157         cleaned up public header threads.h.
19158
19159 Wed Jun 16 18:11:41 CEST 2004 Paolo Molaro <lupus@ximian.com>
19160
19161         * Makefile.am, *.c, *.h: more API cleanups.
19162
19163 Wed Jun 16 14:33:22 CEST 2004 Paolo Molaro <lupus@ximian.com>
19164
19165         * Makefile.am: removed monosn from compilation.
19166         * appdomain.c, assembly.c, assembly.h, blob.h, class.c,
19167         debug-helpers.c, debug-mono-symfile.c, domain.c, icall.c,
19168         image.c, image.h, loader.c, marshal.c, metadata-internals.h,
19169         metadata.c, metadata.h, mono-config.c, mono-debug-debugger.c,
19170         mono-debug.c, object.c, opcodes.c, opcodes.h, pedump.c, process.c,
19171         reflection.c, reflection.h, verify.c: more API cleanups and fixes.
19172
19173 2004-06-15  Jackson Harper  <jackson@ximian.com>
19174
19175         * assembly.c: Make locales lower case when searching the GAC for
19176         assemblies. gacutil will always make locales lowercase when
19177         installing so this effectively makes them case insensitive.
19178         
19179 2004-06-15  Lluis Sanchez Gual  <lluis@ximian.com>
19180
19181         * locales.c, threadpool.c: use mono_monitor_enter instead of mono_monitor_try_enter.
19182         * monitor.c: New method mono_monitor_try_enter_internal, which takes a new
19183           parameter which allows to choose whether the wait can be interrupted or 
19184           not. Also added the method mono_monitor_enter(), which locks the monitor
19185           using an infinite wait and without allowing interruption.
19186           In the Monitor.Enter and Wait icalls, retry the lock if the wait is
19187           interrupted.
19188         * object.h: Added new fields in MonoThread. suspend_event holds the event
19189           used to susped/resume the thread. synch_lock is the lock object to use for
19190           modifying the thread state.
19191         * threads.c: Use the new synch_lock object for locking, instead of "this",
19192           which can generate deadlocks.
19193           Moved thread state change in Thread.Sleep and Thread.Join from managed
19194           to unmanaged code. This avoids a deadlock when the thread was suspended
19195           just after acquiring the thread lock.
19196           In general, use mono_monitor_enter instead of mono_monitor_try_enter.
19197           Implemented Thread.Suspend using an event instead of ThreadSuspend,
19198           which is not fully implemented in the io-layer.
19199         * socket-io.c: Only try IPv6 DNS lookup if IPv4 fails.
19200
19201 Tue Jun 15 18:34:21 CEST 2004 Paolo Molaro <lupus@ximian.com>
19202
19203         * Makefile.am, monitor.h, object.h, threadpool.c, threadpool.h,
19204         threads-types.h: more API cleanups.
19205
19206 Tue Jun 15 16:40:19 CEST 2004 Paolo Molaro <lupus@ximian.com>
19207
19208         * domain-internals.h, Makefile.am, appdomain.c, appdomain.h,
19209         domain.c, gc.c, icall.c, mono-debug.c, object.c, reflection.c,
19210         threadpool.c, threads.c: first pass at the exported API cleanup.
19211
19212 Tue Jun 15 15:29:47 CEST 2004 Paolo Molaro <lupus@ximian.com>
19213
19214         * icall.c: fix signatures of some VolatileRead and VolatileWrite icalls.
19215
19216 2004-06-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19217
19218         * icall.c: added internalGetHome.
19219
19220 2004-06-14  Dick Porter  <dick@ximian.com>
19221
19222         * file-io.c (ves_icall_System_IO_MonoIO_FindFirstFile): It was
19223         possible to return successfully when '.' or '..' were the only
19224         entries in a directory, but were skipped.  The MonoIOStat was not
19225         filled in in that case.  Now return ERROR_NO_MORE_FILES instead.
19226         Fixes bug 59574.
19227
19228 Mon Jun 14 00:27:15 CEST 2004 Paolo Molaro <lupus@ximian.com>
19229
19230         * reflection.c: make binaries run on .Net 1.1 by default.
19231
19232 Sun Jun 13 18:22:40 CEST 2004 Paolo Molaro <lupus@ximian.com>
19233
19234         * threadpool.c, threadpool.h: use the correct return type in SetMinThreads ().
19235
19236 Sun Jun 13 16:44:39 CEST 2004 Paolo Molaro <lupus@ximian.com>
19237
19238         * marshal.c: keep track of struct size with explicit layout
19239         (bug #59979).
19240
19241 2004-06-12  Martin Baulig  <martin@ximian.com>
19242
19243         * mono-debug-debugger.c: Comment out a debugging g_message().
19244
19245 Sat Jun 12 14:15:02 CEST 2004 Paolo Molaro <lupus@ximian.com>
19246
19247         * reflection.c, reflection.h: do not free custom attrs that are cached.
19248         * icall.c: use braces to make code clearer.
19249
19250 2004-06-11  Martin Baulig  <martin@ximian.com>
19251
19252         * class.h (MonoInflatedField): New type.
19253         (MonoClassField): Replaced `MonoType *generic_type' with
19254         `MonoInflatedField *generic_info'.
19255
19256         * icall.c
19257         (ves_icall_MonoField_Mono_GetGenericFieldDefinition): New icall.
19258
19259 2004-06-11  Martin Baulig  <martin@ximian.com>
19260
19261         * reflection.c (mono_image_create_method_token): Correctly encode
19262         varargs methods.
19263
19264 2004-06-11  Martin Baulig  <martin@ximian.com>
19265
19266         * metadata.c (mono_metadata_parse_method_signature): When parsing
19267         a MethodDef which has VarArgs, also set sentinelpos if we don't
19268         have any parameters.
19269
19270 2004-06-11  Martin Baulig  <martin@ximian.com>
19271
19272         * verify.c (mono_method_verify): In CEE_CALL, use
19273         mono_method_get_signature() to get the method's signature, unless
19274         we're a PInvoke method.
19275
19276 2004-06-10  Jackson Harper  <jackson@ximian.com>
19277
19278         * assembly.c: Use <path>/lib/mono/gac for the extra paths
19279         lookup. Rename MONO_GAC_PATH to MONO_GAC_PREFIX, this is a more
19280         logical name as the supplied path is just a prefix to the gac not
19281         the direct path to it.
19282         
19283 Thu Jun 10 20:10:16 CEST 2004 Paolo Molaro <lupus@ximian.com>
19284
19285         * reflection.c: make the token for a created method match
19286         the token of the MethodBuilder it was created from
19287         (IKVM requires this behaviour now).
19288
19289 Thu Jun 10 16:02:27 CEST 2004 Paolo Molaro <lupus@ximian.com>
19290
19291         * image.c, image.h, appdomain.c, assembly.c, loader.c, metadata.c,
19292         reflection.c, socket-io.c: leak fixes.
19293
19294 Wed Jun 9 18:23:59 CEST 2004 Paolo Molaro <lupus@ximian.com>
19295
19296         * icall.c: handle sentinel pos in vararg methods in position different
19297         from 0.
19298
19299 2004-06-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19300
19301         * culture-info-tables.h: freshly generated.
19302
19303 2004-06-09  Martin Baulig  <martin@ximian.com>
19304
19305         * loader.c (mono_get_method_constrained): Call `mono_class_init
19306         (constrained_class)'.   
19307
19308 2004-06-08  Gert Driesen <drieseng@users.sourceforge.net>
19309
19310         * icall.c (ves_icall_MonoType_GetEvent): Handle events without
19311         any methods. Fixes #59629.
19312
19313 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
19314
19315         * culture-info-tables.h: reflecting locale-builder updates.
19316
19317 2004-06-08  Dick Porter  <dick@ximian.com>
19318
19319         * object.h:
19320         * locales.c: Fixed compile warnings, including a real bug in
19321         CompareInfo_internal_compare.
19322         
19323 2004-06-08  Dick Porter  <dick@ximian.com>
19324
19325         * locales.c
19326         (ves_icall_System_Globalization_CompareInfo_internal_index):
19327         (ves_icall_System_Globalization_CompareInfo_internal_index_char):
19328         Double-check the resuls of usearches, because ICU currently
19329         ignores most of the collator settings here.  Fixes bug 59720.
19330         
19331 2004-06-08  Dick Porter  <dick@ximian.com>
19332
19333         * locales.c
19334         (ves_icall_System_Globalization_CompareInfo_internal_index_char):
19335         Fix memory leak and segfault-causing typo.  No idea how this one
19336         lasted so long without being noticed.
19337
19338 2004-06-09  Zoltan Varga  <vargaz@freemail.hu>
19339
19340         * icall.c (ves_icall_Type_GetEvents_internal): Handle events without
19341         any methods. Fixes #59629.
19342
19343 2004-06-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19344
19345         * assembly.c:
19346         (mono_assembly_load): search_loaded -> mono_assembly_loaded (we didn't
19347         own the critical section before). Removed dead code (that's done
19348         in the preload hook).
19349
19350         (mono_assembly_load_with_partial_name): call the preload hook.
19351
19352 2004-06-08  Martin Baulig  <martin@ximian.com>
19353
19354         * metadata.c (mono_metadata_signature_alloc): Default
19355         `sentinelpos' to -1.
19356
19357         * reflection.c (mono_image_get_array_token): Likewise.
19358
19359 2004-06-08  Martin Baulig  <martin@ximian.com>
19360
19361         * icall.c (ves_icall_ModuleBuilder_getMethodToken): New icall.
19362
19363         * metadata.c (mono_metadata_parse_method_signature): When parsing
19364         a MethodDef which has VarArgs, set sentinelpos.
19365
19366         * metadata.h (MonoMethodSignature): Make `sentinalpos' a signed
19367         `gint16' since we're using -1 for non-varargs methods.
19368
19369         * reflection.c
19370         (ReflectionMethodBuilder): Added `MonoArray *opt_types'.
19371         (method_encode_signature): Added varargs support.
19372         (method_builder_encode_signature): Likewise.
19373         (mono_image_get_varargs_method_token): New static method.
19374         (mono_image_create_method_token): New public method; this is
19375         called via an icall instead of mono_image_create_token() when
19376         calling a varargs method.       
19377
19378 2004-06-08  Lluis Sanchez Gual  <lluis@ximian.com>
19379
19380         * locales.c: Fixed memory leak in Char.ToLower/ToUpper.
19381
19382 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
19383
19384         * culture-info-tables.h : Reflecting the latest locale-builder that
19385           fixed empty array representation ({} to {0}).
19386
19387 2004-06-07  Jackson Harper  <jackson@ximian.com>
19388
19389         * assembly.c: It should be <MONO_GAC_PATH>/lib/mono/gac when
19390         looking up extra gac paths. This allows MONO_GAC_PATH to act
19391         exactly like a prefix.
19392         
19393 2004-06-08  Zoltan Varga  <vargaz@freemail.hu>
19394
19395         * reflection.c (mono_reflection_type_from_name): Make a copy of the
19396         type name before modifying it. Fixes #59405.
19397
19398 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
19399
19400         * culture-info.h: added fields for "all datetime patterns".
19401         * locales.c: (  ves_icall_System_Globalization_CultureInfo
19402           _construct_datetime_format ()): fill xxx_patterns fields.
19403         * object.h: added fields for "all datetime patterns" to
19404           MonoDateTimeFormatInfo.
19405         * culture-info-tables.h: reflecting locale-builder updates.
19406
19407 2004-06-08  Zoltan Varga  <vargaz@freemail.hu>
19408
19409         * icall.c (ves_icall_Type_GetEvents_internal): Handle the case when
19410         the event has no add and remove methods. Fixes #59629.
19411
19412 2004-06-05  Sebastien Pouliot  <sebastien@ximian.com>
19413
19414         * object.c: Fixed possible integer overflow when allocating large
19415         strings.
19416
19417 2004-06-05  Atsushi Enomoto  <atsushi@ximian.com>
19418
19419         * culture-info-tables.h: reflecting locale-builder updates.
19420
19421 2004-06-05  Atsushi Enomoto  <atsushi@ximian.com>
19422
19423         * culture-info-tables.h: reflecting locale-builder updates.
19424
19425 2004-06-03  Atsushi Enomoto  <atsushi@ximian.com>
19426
19427         * culture-info-tables.h: reflecting locale-builder updates.
19428
19429 2004-06-03  Lluis Sanchez Gual  <lluis@ximian.com>
19430
19431         * threads.c: Made Thread.Sleep abortable.
19432
19433 2004-06-02  Martin Baulig  <martin@ximian.com>
19434
19435         * mono-debug.h (MONO_DEBUGGER_VERSION): Bumped version to 41.
19436
19437         * debug-mono-symfile.h: Bumped symbol file version number to 37.
19438
19439 2004-05-31  Zoltan Varga  <vargaz@freemail.hu>
19440
19441         * marshal.c (mono_marshal_get_runtime_invoke): Fix CR/LFs.
19442
19443 2004-05-30  Jackson Harper  <jackson@ximian.com>
19444
19445         * reflection.c: Do not hardcode assembly versions or public key
19446         tokens anymore. All of this except the corlib section was dead
19447         code anyways.
19448         
19449 2004-05-29  Zoltan Varga  <vargaz@freemail.hu>
19450
19451         * object.c (mono_runtime_invoke_array): Automatically create boxed
19452         objects for byref valuetypes if needed. Fixes #59300.
19453         
19454         * object.c (mono_method_return_message_restore): Handle 
19455         MONO_TYPE_OBJECT as well.
19456
19457 2004-05-28  Jackson Harper  <jackson@ximian.com>
19458
19459         * reflection.c: The modified type encoding was causing build
19460         problems. Reverted for now.
19461         
19462 2004-05-28  Jackson Harper  <jackson@ximian.com>
19463
19464         * reflection.c/h: Take an assembly ref so that we dont create
19465         fully qualified names when encoding types in the same assembly as
19466         the custom attribute being emitted.
19467         * appdomain.c: Increment version number.
19468         
19469 2004-05-26  Duncan Mak  <duncan@ximian.com>
19470
19471         * icall.c
19472         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
19473         Set the full version number (major, minor, build, revision).
19474
19475 2004-05-28  Vladimir Vukicevic  <vladimir@pobox.com>
19476
19477         * marshal.c (emit_struct_conv): increment src/dst after blit
19478         (mono_marshal_get_managed_wrapper,
19479         mono_marshal_get_native_wrapper): make sure we have marshalling
19480         info before marshalling params (info computation affects
19481         blittable)
19482
19483         * class.c (class_compute_field_layout): correctly deal with
19484         blittable
19485         (mono_class_layout_fields): Don't do gc_aware_layout for AUTO
19486         value types (as per what windows dows by default)
19487         (mono_class_setup_mono_type): System.ValueType is blittable
19488         (mono_ptr_class_get, mono_fnptr_class_get): Pointer classes are
19489         blittable
19490
19491         * marshal.c (mono_marshal_load_type_info): flag types  as
19492         non-blittable if the native layout doesn't match the managed
19493         layout
19494
19495 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19496
19497         * appdomain.c: don't add stuff in the private search path that is
19498         above the application base. If application base is not set, there's
19499         no private search path.
19500
19501 2004-05-28  Zoltan Varga  <vargaz@freemail.hu>
19502
19503         * marshal.c (mono_marshal_get_managed_wrapper): Add proper support for
19504         byref struct arguments in native->managed marshalling.
19505
19506 2004-05-28      Patrik Torstensson      <totte@hiddenpeaks.com>
19507
19508         * marshal.c (mono_marshal_get_runtime_invoke): correctly
19509         cache methods using signature (special case for methods
19510         that are value type or string class)
19511         
19512         * image.c (mono_image_close): clean up allocated GSList's
19513         in runtime_invoke_cache.
19514
19515 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19516
19517         * mono-config.c: set the correct path for mono_cfg_dir on windows when
19518         there's no MONO_CFG_DIR environment variable defined.
19519
19520 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19521
19522         * threads.c: windows version must be >= 0x0500 to include OpenThread.
19523
19524 2004-05-28  Lluis Sanchez Gual  <lluis@ximian.com>
19525
19526         * threadpool.c: Really wait for 500ms after the async call, even if the wait
19527           is interrumped.
19528         * threads.c: In mono_thread_manage, call OpenThread to ref each handle
19529           before waiting for it, and call CloseHandle after the wait to unref it.
19530           This will make sure that handles are not disposed too early.
19531
19532 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19533
19534         * appdomain.c:
19535         * appdomain.h:
19536         * icall.c: removed
19537         ves_icall_System_AppDomainSetup_InitAppDomainSetup as it's not
19538         needed now.
19539
19540         * object.c: se the application_base only for the domain that runs
19541         Main. Fixes bug #59216,
19542
19543 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19544
19545         * appdomain.c:
19546         * object.c: only the domain in which Main is run have
19547         SetupInformation.ConfigurationFile set, so moved a few lines from
19548         appdomain.c to object.c.
19549
19550 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19551
19552         * appdomain.c: we tried to load [name].(dll|exe), but according
19553         to bug #57710, we must also try [culture]/[name].(dll|exe) and
19554         [culture]/[name]/[name](dll|exe). This patch fixes the bug.
19555         There's a test case attached to bug #58922.
19556
19557 2004-05-27  Dick Porter  <dick@ximian.com>
19558
19559         * icall.c:
19560         * file-io.c: Implemented icalls for locking and unlocking regions
19561         in a file.
19562         (ves_icall_System_IO_MonoIO_FindNextFile): FindNextFile() returns
19563         FALSE on error (fixes both compiler warning and real bug.)
19564
19565 2004-05-27  Atsushi Enomoto  <atsushi@ximian.com>
19566
19567         * culture-info-tables.h: reflecting locale-builder updates.
19568
19569           (Added missing ChangeLog entry for 05/26)
19570
19571 2004-05-27  Jackson Harper  <jackson@ximian.com>
19572
19573         * locales.c: Fix some cut and paste errors.
19574         
19575 2004-05-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19576
19577         * mono-config.c: set the correct path for config. directory on windows.
19578
19579 2004-05-26  Atsushi Enomoto  <atsushi@ximian.com>
19580
19581         * icall.c : Fixed ves_icall_System_DateTime_GetNow() to return utc
19582           on win32.
19583
19584 2004-05-26  Zoltan Varga  <vargaz@freemail.hu>
19585
19586         * marshal.c (mono_marshal_get_native_wrapper): Free strings returned
19587         from pinvoke functions.
19588         
19589         * marshal.c (mono_ftnptr_to_delegate): Implement this.
19590
19591 2004-05-26  Atsushi Enomoto  <atsushi@ximian.com>
19592
19593         * culture-info-tables.h: reflecting locale-builder updates.
19594
19595 2004-05-26  Zoltan Varga  <vargaz@freemail.hu>
19596
19597         * profiler.c (simple_allocation): Skip icall wrapper methods. Fixes
19598         #59086.
19599
19600 2004-05-26  Sebastien Pouliot  <sebastien@ximian.com>
19601
19602         * appdomain.cs: Bumped MONO_CORLIB_VERSION to 20.
19603         * icall.c: Modified icalls for RNG.
19604         * rand.c|h: Changed RNG interface to allow thread-safe usage under 
19605         Windows (CryptoAPI).
19606
19607 2004-05-25  Zoltan Varga  <vargaz@freemail.hu>
19608
19609         * locales.c: Fix build.
19610
19611 2004-05-25  Atsushi Enomoto  <atsushi@ximian.com>
19612
19613         * culture-info-tables.h: reflecting locale-builder updates.
19614
19615 2004-05-25  Jackson Harper  <jackson@ximian.com>
19616
19617         * locales.c: When creating the current culture use the $LANGs
19618         specific culture. So DateTimeFormat and NumberFormat entries are created.
19619         
19620 2004-05-25  Zoltan Varga  <vargaz@freemail.hu>
19621
19622         * string-icalls.{h,c} icalls.c: Add new icalls for Strcpy which take
19623         a char array as parameter.
19624
19625 2004-05-24  Lluis Sanchez Gual  <lluis@ximian.com>
19626
19627         * image.c: In mono_image_open(), always use an absolute path name to
19628           look for already loaded images.
19629
19630 2004-05-24  Sebastien Pouliot  <sebastien@ximian.com>
19631
19632         * icall.c: Added define for CSIDL_FLAG_CREATE (0x8000) in case it is
19633         missing in the windows build (like older cygwin include files).
19634
19635 2004-05-23  Sebastien Pouliot  <sebastien@ximian.com>
19636
19637         * icall.c: Fixed check for possible integer overflow in Buffer_
19638         BlockCopy icall. Replaced comments style // by /* */.
19639
19640 2004-05-22  Zoltan Varga  <vargaz@freemail.hu>
19641
19642         * marshal.c (mono_ftnptr_to_delegate): Fix warning.
19643         
19644         * marshal.c (mono_marshal_get_proxy_cancast): Move thread interrupt
19645         check after MONO_VTADDR. Fixes pinvoke2.exe.
19646
19647         * marshal.h marshal.c metadata.h: Add beginnings of support for
19648         ftnptr -> delegate marshalling.
19649
19650 2004-05-21  Zoltan Varga  <vargaz@freemail.hu>
19651
19652         * threads.c (ves_icall_System_Threading_Thread_ResetAbort): Fix compilation on gcc-2.95.
19653         * threads.c: Fix warnings.
19654
19655 2004-05-20  Lluis Sanchez Gual  <lluis@ximian.com>
19656
19657         * appdomain.c, gc.c: Make use of the new WaitForSingleObjectEx.
19658         * icall.c: Registered icalls for Suspend and Resume.
19659         * locales.c: Beware, mono_monitor_try_enter can now be interrupted by
19660           Thread.Abort.
19661         * monitor.c: Use WaitForSingleObjectEx. Added some interruption checkpoints.
19662         * mono-debug-debugger.c: Use WaitForSingleObjectEx et al.
19663         * process.c: Use WaitForSingleObjectEx.
19664         * threadpool.c: Use WaitForSingleObjectEx. Added some interruption 
19665           checkpoints.
19666         * threads.c, threads.h: Make use of new Ex wait methods. Improved
19667           implementation of Thread.Abort and Thread.ResetAbort icalls. Added icalls
19668           for Suspend and Resume. Added new mono_thread_stop, used for stoping
19669           background threads. Added basic support for Abort in Windows.
19670           Start new threads using a managed delegate invoke wrapper. This wrapper
19671           has an interruption checkpoint that is needed since an interruption
19672           can be requested before the thread leaves the unmanaged code that starts 
19673           the thread.
19674         * marshal.c: Added interruption checkpoint after every native call, and
19675           also before managed calls for wrappers called from unmanaged code to
19676           go into managed code.
19677         * object.h: Added new field in MonoThread to keep track of interruption
19678           requests.
19679
19680 2004-05-20  Zoltan Varga  <vargaz@freemail.hu>
19681
19682         * marshal.c: Insert SAVE_LMF and RESTORE_LMF opcodes around native
19683         calls.
19684
19685 2004-05-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19686
19687         * appdomain.c:
19688         * assembly.c:
19689         * gc.c:
19690         * locales.c:
19691         * mono-config.c:
19692         * rand.c: getenv -> g_getenv (windows!)
19693
19694         * process.c: complete_path is also used on non-windows platforms.
19695
19696 2004-05-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19697
19698         * icall.c: new signature for Process_Start.
19699
19700         * process.[ch]: new signature for Process_Start. If we're on windows
19701         and UseShellExecute is false, we have to search for the program by
19702         ourselves if we don't get a full path.
19703
19704 2004-05-18  Zoltan Varga  <vargaz@freemail.hu>
19705
19706         * marshal.c (mono_marshal_get_native_wrapper): Fix up custom 
19707         marshalling and call CleanUpNativeData if needed. Fixes #58646.
19708
19709 2004-05-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19710
19711         * socket-io.c: field value changed for Int32 from 'value' to 'm_value'.
19712         Fixes bug #58373.
19713
19714 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19715
19716         * process.c: use double quotes to quote program name and arguments on
19717         windows. Fixes bug #58575.
19718
19719 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19720
19721         * file-io.c: don't return "." and ".." when using windows Find*File.
19722
19723 2003-05-17      Patrik Torstensson <totte@hiddenpeaks.com>
19724
19725         * marshal.c: Don't pass wrappers to message init because method 
19726         addressed used to lookup metadata. part of remoting[2|3] fix.
19727
19728 2004-05-15  Jackson Harper  <jackson@ximian.com>
19729
19730         * assembly.c: Remove user gac and implement MONO_GAC_PATH, this
19731         path is essentially the same as MONO_PATH except that it points to
19732         GACs instead of lib directories.
19733         * loader.h: The user gac is gone so we dont need function to
19734         enable/disable it.
19735         * mono-config.c: user gac option is now gone.
19736         
19737 2004-05-15  Jackson Harper  <jackson@ximian.com>
19738
19739         * culture-info.h: Make defines more consistent, add calendar data
19740         to the culture info table.
19741         * culture-info-tables.h: Add basic calendar data. Basically
19742         everyone gets default gregorian until all the data is
19743         updated.
19744         * locales.c: Use the new consistent defines. Set calendar data for
19745         culture info objects.
19746         * object.h: add a field for calendar data to CultureInfo
19747         
19748 2004-05-14 Ben Maurer  <bmaurer@users.sourceforge.net>
19749
19750         * image.c: image->runtime_invoke_cache is keyed on signatures now.
19751         * marshal.c (mono_mb_emit_calli): new helper to emit a CEE_CALLI with
19752         a signature.
19753         (mono_mb_emit_managed_call, mono_mb_emit_native_call): use the above.
19754         (mono_marshal_get_runtime_invoke): The runtime invoke method now takes
19755         an extra param that is the pointer of the method to invoke. The IL for
19756         the invoke method is no longer specific to the method, but to the
19757         signature of the method. Thus, we can share the same code for multiple
19758         methods. This reduces the number of methods that have to be compiled.
19759
19760 2004-05-14  Zoltan Varga  <vargaz@freemail.hu>
19761
19762         * icall.c (ves_icall_System_Reflection_Assembly_load_with_partial_name): Fix warning.
19763
19764         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
19765
19766         * icall.c: Optimize Buffer.BlockCopy.
19767
19768 2004-05-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19769
19770         * culture-info-tables.h: seems like Spanish and Portuguese cultures had
19771         DateTimeFormatInfo.YearMonthPattern like "MMMM' yyyy" (note the single
19772         quote). Changed them to "MMMM yyyy".
19773
19774 2004-05-12  Miguel de Icaza  <miguel@ximian.com>
19775
19776         * rand.c
19777         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_InternalGetBytes): Always close the file. 
19778
19779 2004-05-13  Zoltan Varga  <vargaz@freemail.hu>
19780
19781         * reflection.h: Updated after changes to managed structures.
19782
19783         * appdomain.c: Bump corlib version.
19784
19785 2004-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19786
19787         * Makefile.am: also add libmonoos to libmetadata. Fixes the build on
19788         windows.
19789
19790 2004-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19791
19792         * Makefile.am: link to ../os/libmonoos.la on windows.
19793
19794         * assembly.c:
19795                 -If MONO_DEBUG, warn about non-existing directories in
19796                 MONO_PATH.
19797                 -Added mono_assembly_getrootdir() that replaces MONO_ASSEMBLIES
19798                 compile time variable.
19799                 -Removed init_default_path and call mono_set_rootdir from
19800                 libmonoos.a instead (windows only).
19801
19802         * assembly.h: declare mono_assembly_getrootdir().
19803
19804         * domain.c:
19805         * icall.c: use mono_assembly_getrootdir() instead of MONO_ASSEMBLIES.
19806
19807         * loader.c: s/getenv/g_getenv/
19808
19809 2004-05-11  Zoltan Varga  <vargaz@freemail.hu>
19810
19811         * marshal.{h,c}: Add support for UnmanagedType.AsAny.
19812
19813         * marshal.c: Use mono_metadata_signature_{alloc,dup} where appropriate.
19814
19815         * metadata.h: Add new marshalling conversions.
19816
19817         * metadata.h metadata.c (mono_metadata_signature_dup): New helper
19818         function.
19819
19820         * reflection.c (mono_reflection_get_type): Lookup the type in all
19821         modules of a multi-module assembly. Fixes #58291.
19822
19823 2004-05-11  Lluis Sanchez Gual  <lluis@ximian.com>
19824
19825         * threads.c: Before aborting a background, set the StopRequested
19826         state.  This avoids throwing the Abort exception.
19827         In mono_thread_manage, don't continue with the shutdown until all
19828         aborted threads have actually stopped.
19829
19830 2004-05-10  Jackson Harper  <jackson@ximian.com>
19831
19832         * locales.c: Remove the modifier from culture names.
19833         
19834 2004-05-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19835
19836         * Makefile.am: monosn is not installed any more. It has been deprecated
19837         in favor of sn.
19838
19839 2004-05-07  Jackson Harper  <jackson@ximian.com>
19840
19841         * locales.c
19842         (ves_icall_System_Globalization_CultureInfo_internal_get_cultures):
19843         Fix array construction, add bailout if the length is 0.
19844
19845 2004-05-07  Dick Porter  <dick@ximian.com>
19846
19847         * socket-io.c (addrinfo_to_IPHostEntry): Don't crash if the
19848         machine doesn't have a DNS entry.  Patch by Urs Muff
19849         (umuff@quark.com), fixes bug 57928.
19850
19851 2004-05-06  Jackson Harper  <jackson@ximian.com>
19852
19853         * reflection.c: Handle null PublicTokens properly. alloc mem for
19854         assembly names culture so we dont crash when freeing it.
19855         
19856 2004-05-06  Jackson Harper  <jackson@ximian.com>
19857
19858         * assembly.c: Check the usergac when loading with partial names.
19859         
19860 2004-05-05  Sebastien Pouliot  <sebastien@ximian.com>
19861
19862         * rand.c|h: Added new icall for (optionally) seeding the PRNG. This 
19863         does nothing for now (not required for Linux/Windows) but the class
19864         library can call it (and a newer or modified runtime could need it).
19865         * icall.c: Registred icall.
19866
19867 2004-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19868
19869         * loader.c: prints a message on module loading error we set MONO_DEBUG
19870         environment variable.
19871
19872 2004-05-05  Jackson Harper  <jackson@ximian.com>
19873
19874         * appdomain.c: Handle PublicKeyToken=null properly.
19875         
19876 2004-05-05  Sebastien Pouliot  <sebastien@ximian.com>
19877
19878         * environment.c|h: Added icall ves_icall_System_Environment_
19879         GetOSVersionString to get the current OS version as a string.
19880         * icall.c: Registred icall.
19881
19882 2004-05-05  Lluis Sanchez Gual  <lluis@ximian.com>
19883
19884         * object.c: in mono_object_get_virtual_method(), take into account that
19885         non-virtual methods don't have a slot in the vtable. Check needed when
19886         the object is a proxy.
19887
19888 2004-05-05  Zoltan Varga  <vargaz@freemail.hu>
19889
19890         * marshal.h marshal.c icall.c: Applied patch from vladimir@pobox.com
19891         (Vladimir Vukicevic). Implement UnsafeAddrOfPinnedArrayElement.
19892
19893         * object.c (mono_class_compute_gc_descriptor): Fix warning.
19894
19895         * object.c (mono_runtime_invoke_array): Add an assert so null cannot be
19896         passed when a valuetype is expected.
19897
19898         * object.c (mono_unhandled_exception): Only set the exit code if the
19899         exception happens in the main thread. Fixes thread5.exe.
19900
19901         * appdomain.c (get_info_from_assembly_name): Fix infinite loop on
19902         invalid names. Fixes #58047.
19903
19904 2004-05-03  Jackson Harper  <jackson@ximian.com>
19905
19906         * assembly.c: This line was committed accidently and is unneeded.
19907         
19908 2004-05-03  Jackson Harper  <jackson@ximian.com>
19909
19910         * icall.c: Add new icall for Assembly::LoadWithPartialName
19911         * assembly.c/.h: new function that probes the GAC to load partial
19912         assembly names by Paolo Molaro.
19913         
19914 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19915
19916         * appdomain.c: use g_strncasecmp when looking for 'Culture=' et al.
19917         * reflection.c: use g_strncasecmp when looking for 'Culture=' et al.
19918         (type_get_fully_qualified_name): Added PublicKeyToken when building a
19919         full type name.
19920
19921 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19922
19923         * appdomain.c: fixed check for 'neutral' culture and removed warning.
19924         * reflection.c: fix bug when parsing a full type name and Version is not
19925         the last thing in the string.
19926
19927 2004-05-03  Zoltan Varga  <vargaz@freemail.hu>
19928
19929         * appdomain.c (get_info_from_assembly_name): Strdup "" to prevent
19930         crashes when it is freed.
19931
19932 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19933
19934         * assembly.c: print the compat warning to stderr.
19935
19936 2004-05-01  Miguel de Icaza  <miguel@ximian.com>
19937
19938         * assembly.c (mono_assembly_load_references): Add a compatibility
19939         hack to run old applications that might be still referencing the
19940         3300-based assemblies, only do this for System.xxx.
19941
19942 2004-05-01  Jackson Harper  <jackson@ximian.com>
19943
19944         * appdomain.c: If the culture is neutral we set it to "".
19945         
19946 2004-04-29  Jackson Harper  <jackson@ximian.com>
19947
19948         * locales.c: Add some missing MONO_ARCH_SAVE_REGS'.
19949
19950 2004-04-29  Andreas Nahr <ClassDevelopment@A-SoftTech.com>
19951  
19952         * string-icalls.c: added low overhead function for copying chars
19953         * icall.c: added needed icall for the above function
19954  
19955 2004-04-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19956
19957         * icall.c: fix return value of get_global_assembly_cache.  Implemented
19958         Environment.GetLogicalDrives.
19959
19960 2004-04-28  Bernie Solomon  <bernard@ugsolutions.com>
19961
19962         * rand.c: try and talk to egd or prngd
19963         for random bytes if opening devices fail.
19964
19965 2004-04-28  Zoltan Varga  <vargaz@freemail.hu>
19966
19967         * marshal.c (mono_marshal_load_type_info): Calculate the minimum
19968         alignment for the type using the native alignment of its members 
19969         instead of using klass->min_align.
19970
19971         * metadata.c (mono_type_stack_size): Fix size of TYPEDBYREF.
19972
19973 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19974
19975         * file-io.c:
19976         * socket-io.c: added check for sys/aio.h.
19977
19978 2004-04-28  Dick Porter  <dick@ximian.com>
19979
19980         * threads.c: Don't abort a thread thats already aborting, when
19981         terminating everything.
19982
19983 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19984
19985         * icall.c: added 2 new async calls for Socket.
19986
19987         * socket-io.[ch]: fixed some warnings. Added support for asynchronous
19988         IO on *nix systems.
19989
19990         * threadpool.c: removed unused variable.
19991
19992 2004-04-27  Zoltan Varga  <vargaz@freemail.hu>
19993
19994         * marshal.c: Handle null properly in PtrToString* icalls. Fixes #57706.
19995
19996 Tue Apr 27 15:55:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
19997
19998         * locales.c: put back string_invariant_tolower () and
19999         string_invariant_toupper ().
20000
20001 2004-04-26 David Waite <mass@akuma.org>
20002
20003         * file-io.h:
20004         * socket-io.h:
20005         * threads.h:
20006         * unicode.h: remove comma from end of enumeration declarations
20007
20008 2004-04-26 David Waite <mass@akuma.org>
20009
20010         * debug-mono-symfile.h:
20011         * decimal.c:
20012         * mono_debug.h:
20013         * sysmath.c: Define 64 bit constants as long long types (i.e. 10ULL)
20014
20015
20016 2004-04-26  Jackson Harper  <jackson@ximian.com>
20017
20018         * appdomain.c: Increment version number.
20019         
20020 2004-04-26  Jackson Harper  <jackson@ximian.com>
20021
20022         * appdomain.c: Set assembly references public token value when
20023         PublicKeyToken is specified, not the hash_value. Free public token
20024         values when free assembly name data. Previously the public key
20025         token was hex decoded, however we are using hex encoded public key
20026         tokens, so this is not neccasary.
20027         * assembly.c: Lookup assemblies in the gac if their public token
20028         value is set. Add function to allow enabling user gac
20029         lookups. Specify whether or not the assembly was loaded from the
20030         GAC. Compare full assembly names when checking the cache for
20031         assemblies (Temporarily disabled see comment in code). Remove
20032         mscorlib -> corlib mapping cruft. Add trace-loading. When a user
20033         specifies trace-loader they get extra info to stdout on the
20034         loading of assemblies.
20035         * image.h: Add a field for an assembly references public token
20036         value to MonoAssemblyname. Add a field to MonoAssembly to specifiy
20037         whether an assembly has been loaded from the GAC.
20038         * image.c: Remove a corlib -> mscorlib name mapping.
20039         * loader.h: Add function to enable/disable the user gac.
20040         * mono-config.c: Check if the usergac is enabled in the config
20041         file.
20042         * icall.c: New icall to determine whether or not an assembly has
20043         been loaded from the GAC. Remove some mscorlib -> corlib mappings.
20044         * tabldefs.h: Add constant for assemblyref flag that specifies a
20045         full public key is used instead of a public token.
20046         * reflection.c: Remove mscorlib -> corlib mappings. Set
20047         PublicTokenValue instead of hash value. This value is a hex
20048         string so it does not need to be expanded.
20049
20050 2004-04-26  Martin Baulig  <martin@ximian.com>
20051
20052         * mono-debug-debugger.c (mono_debugger_initialize): Set
20053         `mono_debugger_initialized' before calling mono_debug_lock().
20054
20055 2004-04-42  Robert Shade <rshade@dvsconsulting.com>
20056
20057         * icall.c: icalls for Char.ToUpper/ToLower are now hooked to
20058           InternalToUpper/InternalToLower.
20059         * locales.c: (ves_icall_System_{Char,String}_InternalTo{Upper,Lower}_Comp)
20060           removed invariant culture shortcut.  This is now done in managed code.
20061         * locales.c: (string_invariant_toupper/tolower) removed.
20062
20063 2004-04-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20064
20065         * icall.c: added GetSupportsAsync for Socket (same as MonoIO).
20066         Added Poll internal call.
20067
20068         * socket-io.[ch]: _wapi_socket == WSASocket. Added internal
20069         call for Poll. Select was too heavy for polling a single socket.
20070
20071         * threadpool.[ch]: added mono_threadpool_cleanup.
20072         * threads.c: use it. Don't use Thread_Abort on windows.
20073
20074 2004-04-23  Martin Baulig  <martin@ximian.com>
20075
20076         * mono-debug-debugger.c (mono_debugger_lookup_assembly): New function.
20077
20078 2004-04-23  Sebastien Pouliot  <sebastien@ximian.com>
20079
20080         * icall.c: Registred new icalls for key pair protection and added an
20081         icall for Environment.GetFolderPath on Windows.
20082         * security.c|h: Added new icalls for key pair protection.
20083
20084 2004-04-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20085
20086         * socket-io.c: don't display the non-supported family warning for known
20087         families. Now this is not displayed on windows when checking support
20088         for IPv4/IPv6.
20089
20090 2004-04-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20091
20092         * class.c: don't display the layout warning for static fields.
20093
20094 2004-04-21  Lluis Sanchez Gual <lluis@ximian.com>
20095
20096         * icall.cs: Registered new icalls for Char.ToLower and Char.ToUpper.
20097         * locales.c, locales.h: Added new icalls for culture-specific
20098         Char.ToLower and Char.ToUpper.
20099
20100 2004-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20101
20102         * threads.c: the 2nd argument when aborting a thread is NULL now. Patch
20103         by David Waite.
20104
20105 2004-04-20  Martin Baulig  <martin@ximian.com>
20106
20107         * mono-debug-debugger.c (mono_debugger_lookup_type): Make a copy
20108         of the type name before passing it to mono_reflection_type_from_name().
20109
20110 2004-04-19  Zoltan Varga  <vargaz@freemail.hu>
20111
20112         * marshal.c (mono_marshal_get_managed_wrapper): Handle different string
20113         encodings here. Fixes #56965.
20114
20115 2004-04-18  Bernie Solomon <bernard@ugsolutions.com>
20116
20117         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage):
20118         fix test on strstr result not that I can see anything that
20119         relies on the result.
20120
20121 2004-04-18  Zoltan Varga  <vargaz@freemail.hu>
20122
20123         * metadata.c (mono_type_to_unmanaged): Handle MONO_NATIVE_FUNC as well.
20124         Fixes #57081.
20125
20126         * marshal.c (mono_marshal_get_string_encoding): New helper function.
20127
20128         * marshal.c (mono_marshal_get_native_wrapper): Use the new helper
20129         function to determine which marshalling to use for strings. Fixes
20130         #56965.
20131
20132         * marshal.c (mono_marshal_string_array_to_unicode): Fix warning.
20133
20134         * reflection.c (encode_marshal_blob): Add support for LPARRAY.
20135
20136 2004-04-15  Bernie Solomon  <bernard@ugsolutions.com>
20137
20138         * icall.c: #include mono-config.h
20139
20140 2004-04-15  Jackson Harper  <jackson@ximian.com>
20141
20142         * culture-info-tables.h: Fix date formats for en-US culture.
20143         
20144 2004-04-15  Lluis Sanchez Gual  <lluis@ximian.com>
20145
20146         * icall.c: Registered icalls for ThreadPool.GetMinThreads and 
20147         ThreadPool.SetMinThreads.
20148         * threadpool.c: Implemented ThreadPool.GetMinThreads and
20149         ThreadPool.SetMinThreads.
20150
20151 Thu Apr 15 15:36:40 CEST 2004 Paolo Molaro <lupus@ximian.com>
20152
20153         * mono-config.c: also load the .config file in the directory
20154         where the assembly was found.
20155
20156 Thu Apr 15 14:24:49 CEST 2004 Paolo Molaro <lupus@ximian.com>
20157
20158         * assembly.c: load per-assembly config files.
20159         * icall.c: decrapified code to get the config dir and moved to
20160         mono-config.c.
20161         * image.h, loader.c, loader.h, mono-config.c, mono-config.h: allow
20162         per-assembly config files. When doing a dll map lookup give precedence
20163         to the per-assembly data.
20164
20165 2004-04-14  Martin Baulig  <martin@ximian.com>
20166
20167         * mono-debug-debugger.h (MonoDebuggerEvent): Removed
20168         MONO_DEBUGGER_EVENT_TYPE_ADDED and MONO_DEBUGGER_EVENT_METHOD_ADDED
20169         and added MONO_DEBUGGER_EVENT_RELOAD_SYMTABS.
20170
20171         * mono-debugger-debugger.c: While the debugger is locked, remember
20172         whether the symbol tables have changes and send one single
20173         MONO_DEBUGGER_EVENT_RELOAD_SYMTABS when releasing the lock.
20174
20175 2004-04-14  Zoltan Varga  <vargaz@freemail.hu>
20176
20177         * metadata.h: Add STRARRAY_STRWLPARRAY marshalling convention.
20178
20179         * marshal.h marshal.c (mono_marshal_string_array_to_unicode): New 
20180         function.
20181
20182         * marshal.c (mono_marshal_get_native_wrapper): Take CharSet into
20183         account when marshalling string arrays. Fixes #56965.
20184
20185 2004-04-13  Sebastien Pouliot  <sebastien@ximian.com>
20186
20187         * icall.c: Add new icalls mapping for security.
20188         * security.c|h: Add internal calls for WindowsIdentity,
20189         WindowsImpersonationContext and WindowsPrincipal.
20190
20191 2004-04-13  Gert Driesen (drieseng@users.sourceforge.net)
20192
20193         * class.c: Added comment to ensure the System.MonoDummy class
20194         is removed when no longer necessary
20195
20196 2004-04-13  Miguel de Icaza  <miguel@ximian.com>
20197
20198         * appdomain.c: Pass arguments to the bootstraping exceptions to
20199         minimize JITed methods at boot
20200
20201         * metadata.c (mono_exception_from_name_two_strings): Allow for the
20202         second string to be null.
20203
20204         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage):
20205         Change the protocol to minimize the JIT methods at startup.  Now
20206         it Returns the internal codepage, if the value of "int_code_page"
20207         is 1 at entry, and we can not compute a suitable code page
20208         number, returns the code page as a string.
20209
20210 2004-04-13  Jackson Harper  <jackson@ximian.com>
20211
20212         * culture-info-tables.h: Fix number of decimal digits for all
20213         english locales.
20214
20215 2004-04-13  Jackson Harper  <jackson@ximian.com>
20216
20217         * icall.c: Clairfy out of sync error message. It is not always
20218         your corlib that is out of sync.
20219
20220 2004-04-13  Zoltan Varga  <vargaz@freemail.hu>
20221
20222         * icall.c (ves_icall_Type_GetPropertiesByName): Avoid duplicate
20223         properties when only the set accessor is overriden. Fixes #55874.
20224
20225 2004-04-09  Zoltan Varga  <vargaz@freemail.hu>
20226
20227         * assembly.c (mono_assembly_load_references): Make this thread safe.
20228         Fixes #56327.
20229
20230 2004-04-08  Zoltan Varga  <vargaz@freemail.hu>
20231
20232         * monosn.c: Add missing initialization calls.
20233
20234 2004-04-08  Bernie Solomon  <bernard@ugsolutions.com>
20235
20236         * locales.c:
20237         ves_icall_System_Globalization_CultureInfo_construct_number_format
20238         Fix g_assert so it compiles on fussier compilers re int/ptr
20239         mismatch
20240
20241 2004-04-08  Dick Porter  <dick@ximian.com>
20242
20243         * socket-io.h:
20244         * socket-io.c: Don't set SO_REUSEADDR on windows.  Fixes bug
20245         53992.  Also rearrange the code so that the internal calls return
20246         an error value and exceptions are thrown from managed code.
20247
20248         * icall.c: Add type info to the socket icalls.
20249
20250 2004-04-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20251
20252         * object.h: synchronize MonoCompareInfo with CompareInfo class. Someone
20253         owes me a beer.
20254
20255 2004-04-07  Martin Baulig  <martin@ximian.com>
20256
20257         * class.c (mono_class_from_generic_parameter): Don't default
20258         `klass->parent' to `mono_defaults.object_type'.
20259
20260 2004-04-07  Martin Baulig  <martin@ximian.com>
20261
20262         * reflection.c (mono_reflection_initialize_generic_parameter): Set
20263         `param->pklass->reflection_info'.       
20264
20265 2004-04-07  Jackson Harper  <jackson@ximian.com>
20266
20267         * culture-info-tables.h: Fix date separator symbol.
20268         
20269 2004-04-07  Martin Baulig  <martin@ximian.com>
20270
20271         * icall.c (ves_icall_Type_GetGenericArguments): Moved this icall
20272         from System.Type to System.MonoType.
20273
20274 2004-04-07  Martin Baulig  <martin@ximian.com>
20275
20276         * reflection.h
20277         (MonoReflectionGenericParam): Added `has_reference_type' and
20278         `has_value_type' fields.
20279
20280         * reflection.c (mono_image_get_generic_param_info): Encode the
20281         correct flags if we have the `class' or `struct' constraint.
20282
20283 2004-04-07  Martin Baulig  <martin@ximian.com>
20284
20285         * reflection.h
20286         (MonoReflectionGenericParam): Added `MonoBoolean has_ctor_constraint'.
20287
20288 2004-04-07  Jackson Harper  <jackson@ximian.com>
20289
20290         * appdomain.c: Revert extra patches, just wanted to bump the
20291         version number.
20292         
20293 2004-04-07  Jackson Harper  <jackson@ximian.com>
20294
20295         * Makefile.am: Add culture-info private headers.
20296         * icall.c: Add new icalls for contructing locales.
20297         * locales.c: Construct CultureInfo objects from lookup tables instead of using ICU.
20298         * locales.h: Declare new culture info construction methods.
20299         * object.h: Add new fields used to avoid the CultureMap to
20300         MonoCultureInfo.
20301         * culture-info.h: Definition of structs used in the culture info
20302         tables.
20303         * culture-info-tables.h: Autogenerated tables that contain culture
20304         info data. This file was generated with the locale-builder tool.
20305         * appdomain.c: Incement corlib version number.
20306         
20307 2004-04-07  Bernie Solomon  <bernard@ugsolutions.com>
20308
20309         * appdomain.c: (mono_runtime_init) move mono_thread_init
20310         to before mono_object_new calls so critical sections
20311         are initialized before use.
20312
20313 2004-04-07  Martin Baulig  <martin@ximian.com>
20314
20315         * icall.c
20316         (ves_icall_TypeBuilder_define_generic_parameter): Removed.
20317         (ves_icall_MethodBuilder_define_generic_parameter): Removed.
20318         (ves_icall_MonoGenericParam_initialize): Removed.
20319         (monogenericparam_icalls): Removed.
20320         (generictypeparambuilder_icalls): Added new table for
20321         System.Reflection.Emit.GenericTypeParameterBuilder.
20322
20323         * reflection.c
20324         (mono_reflection_define_generic_parameter): Removed.
20325         (mono_reflection_initialize_generic_parameter): This is now called
20326         from GenericTypeParameterBuilder's .ctor.
20327
20328 2004-04-06  Martin Baulig  <martin@ximian.com>
20329
20330         * class.c (mono_class_init): Don't inflate nested classes in a
20331         generic instance.
20332         (mono_type_get_name_recurse): Include the generic arguments for
20333         generic instances and generic type declarations.
20334         (inflate_generic_type): Correctly inflate MONO_TYPE_SZARRAY.
20335         (_mono_class_get_instantiation_name): Removed.
20336         (mono_class_create_generic): Always use `gklass->name' as our name.
20337
20338         * class.h (MonoGenericInst): Removed `nested_in', and `nested'.
20339
20340         * icall.c (ves_icall_MonoGenericInst_GetDeclaringType): Removed.
20341         (ves_icall_MonoGenericInst_GetNestedTypes): Removed.
20342         (ves_icall_MonoMethod_GetGenericParameters): Renamed to
20343         ves_icall_MonoMethod_GetGenericArguments() and correctly handle
20344         closed generic methods here.
20345
20346         * reflection.c
20347         (mono_reflection_generic_inst_get_nested_types): Removed.
20348         (inflate_mono_method): Copy the generic parameters from the
20349         MonoMethodHeader into out MonoGenericMethod.
20350
20351 2004-04-06  Martin Baulig  <martin@ximian.com>
20352
20353         * row-indexes.h
20354         (MONO_GENERICPARAM_DEPRECATED_CONSTRAINT): Removed.
20355
20356         * metadata.c (GenericParamSchema): Removed "DeprecatedConstraint".
20357
20358         * reflection.c (build_compressed_metadata): If we have any entries
20359         in the GenericParam, MethodSpec or GenericParamConstraint tables,
20360         set the header version to 1.1.
20361
20362 2004-04-06  Martin Baulig  <martin@ximian.com>
20363
20364         * class.c (mono_class_init): If we're a generic instance,
20365         initialize our nested classes, too.
20366         (_mono_class_get_instantiation_name): Deal with the new `!%d'
20367         suffix. 
20368
20369 2004-04-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20370
20371         * process.c: quote the argument passed to the shell on windows.
20372
20373 2004-04-05  Zoltan Varga  <vargaz@freemail.hu>
20374
20375         * threads.c (mono_alloc_special_static_data): Allow this to be
20376         called during startup.
20377
20378 2004-04-02  Martin Baulig  <martin@ximian.com>
20379
20380         * icall.c
20381         (ves_icall_MonoGenericInst_GetDeclaringType): New icall.
20382
20383 2004-04-02  Zoltan Varga  <vargaz@freemail.hu>
20384
20385         * icall.c: Fix build.
20386
20387 2004-04-02  Sebastien Pouliot  <sebastien@ximian.com>
20388
20389         * Makefile.am: Added security.c|h.
20390         * icall.c: Added icall for get_UserName;
20391         * security.c: New file for security related icalls. Added function
20392         get_UserName for System.Environment (fix #56144).
20393         * security.h: New. Header file for security.c
20394
20395 2004-04-02  Dick Porter  <dick@ximian.com>
20396
20397         * icall.c: Deleted the icalls that were obsoleted some time ago
20398         by the ICU string code, and which were mixed into the icall
20399         rearranging.  Fixes bug 55969.
20400
20401         * string-icalls.h: 
20402         * string-icalls.c: Deleted the code that those icalls reference.
20403
20404 2004-04-01  Martin Baulig  <martin@ximian.com>
20405
20406         * metadata.h (MONO_CLASS_IS_INTERFACE): New macro.
20407
20408         * class.c (mono_class_from_generic_parameter): Don't set 
20409         TYPE_ATTRIBUTE_INTERFACE.
20410         (my_mono_class_from_generic_parameter): Likewise.
20411
20412 2004-04-01  Martin Baulig  <martin@ximian.com>
20413
20414         * loader.c (find_method): Added an optional `MonoClass *ic'
20415         argument to search in a specific interface.
20416         (mono_get_method_constrained): New public function.
20417
20418 2004-04-01  Martin Baulig  <martin@ximian.com>
20419
20420         * reflection.c (mono_image_get_generic_field_token): Use the
20421         `handleref' cache here.
20422
20423 2004-04-01  Martin Baulig  <martin@ximian.com>
20424
20425         * reflection.h (MonoDynamicImage): Added `GHashTable *typespec'.
20426
20427         * reflection.c (create_generic_typespec): Use the `typespec' hash
20428         here, not the `typeref' one.    
20429
20430 2004-04-01  Martin Baulig  <martin@ximian.com>
20431
20432         * class.c (mono_class_inflate_generic_type): Moved the
20433         functionality into a new static inflate_generic_type() which
20434         returns NULL if it didn't do anything.  Only increment the
20435         `mono_stats.inflated_type_count' if we actually inflated
20436         something.
20437         (mono_class_get_full): Check the classes type to see whether we
20438         need to inflate it; also inflate MONO_TYPE_(M)VAR.
20439
20440 2004-04-01  Jackson Harper  <jackson@ximian.com>
20441
20442         * reflection.c: Set culture for assembly references.
20443         
20444 2004-04-01 Ben Maurer  <bmaurer@users.sourceforge.net>
20445
20446         * reflection.[ch], icall.[ch], Fix support for pinning variables.
20447
20448 2004-04-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20449
20450         * assembly.c:
20451         (do_mono_assembly_open): the critical section also covers
20452         mono_image_open and mono_image_open_from_data. Fixes bug #56327.
20453
20454 2004-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20455
20456         * threads.c:
20457         (mono_manage_threads): abort the background threads when finishing.
20458         Fixes bug #47232.
20459
20460 2004-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20461
20462         * gc.c: only close the done_event handle if there was no timeout.
20463         C-ified comments.
20464
20465 2004-03-30  Martin Baulig  <martin@ximian.com>
20466
20467         * icall.c (icall_entries): It's called "System.Activator", not
20468         "System.Activation".    
20469
20470 2004-03-30  Martin Baulig  <martin@ximian.com>
20471
20472         * class.c (mono_ldtoken): Added `MonoGenericContext *' argument.
20473         (mono_class_create_from_typespec): Likewise.
20474
20475 2004-03-30  Martin Baulig  <martin@ximian.com>
20476
20477         * reflection.h (MonoReflectionGenericParam): Use MonoBoolean for
20478         `has_ctor_constraint' and `initialized'.
20479
20480 2004-03-30  Martin Baulig  <martin@ximian.com>
20481
20482         * reflection.c (encode_new_constraint): New static function to add
20483         the constructor constraint attribute to a type parameter.
20484         (encode_constraints): Call encode_new_constraint() if necessary.
20485
20486         * reflection.h
20487         (MonoReflectionGenericParam): Added `guint32 has_ctor_constraint'.
20488
20489         * row-indexes.h: Added CUSTOM_ATTR_GENERICPAR.
20490         
20491 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
20492
20493         * reflection.c, icall.c: add support for pinning variables. 
20494
20495 2004-03-29  Bernie Solomon  <bernard@ugsolutions.com>
20496
20497         * marshal.c (mono_marshal_get_managed_wrapper):
20498         init bool local with zero rather than null.
20499
20500 2004-03-29  Martin Baulig  <martin@ximian.com>
20501
20502         * icall.c (ves_icall_MonoMethod_get_HasGenericParameters): Show
20503         the "official" behavior here.
20504         (ves_icall_MonoMethod_get_Mono_IsInflatedMethod): New interncall.
20505
20506 2004-03-29  Martin Baulig  <martin@ximian.com>
20507
20508         * icall.c: Reflect latest API changes.
20509
20510 2004-03-29  Martin Baulig  <martin@ximian.com>
20511
20512         * loader.c (mono_get_method_from_token): Also call
20513         mono_metadata_load_generic_params () for abstract and interface
20514         methods; replace the type arguments in the method signature with
20515         the ones which are loaded from the metadata.
20516
20517 2004-03-29  Lluis Sanchez Gual  <lluis@ximian.com>
20518
20519         * monitor.c: In mono_monitor_exit(), don't throw an exception if the owner
20520         of the lock is not the current thread. MS.NET don't do it, in spite of
20521         what the documentation says. See bug #56157.
20522
20523 2004-03-28  Martin Baulig  <martin@ximian.com>
20524
20525         * class.c (mono_class_init): Don't call init_properties() and
20526         init_events() for generic instances; set `prop->parent' when
20527         inflating properties.
20528
20529         * reflection.c (mono_generic_inst_get_object): Call
20530         `mono_class_init (ginst->klass)'.
20531         (mono_type_get_object): Only create a MonoGenericInst if your
20532         generic type is a TypeBuilder.
20533         (do_mono_reflection_bind_generic_parameters): Only set
20534         `ginst->is_dynamic' if our generic type is a TypeBuilder.
20535
20536 2004-03-28  Zoltan Varga  <vargaz@freemail.hu>
20537
20538         * appdomain.c (unload_thread_main): Do not clear proxy_vtable_hash.
20539         Fixes #56091.
20540
20541 2004-03-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20542
20543         * icall.c: added Kill_internal icall.
20544         * process.[ch]: added Kill_internal icall.
20545
20546 2004-03-25  Martin Baulig  <martin@ximian.com>
20547
20548         * class.h (MonoStats): Added `generic_instance_count',
20549         `inflated_method_count', `inflated_type_count' and
20550         `generics_metadata_size'.       
20551
20552 2004-03-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20553
20554         * reflection.c: no warnings now.
20555
20556 2004-03-25  Martin Baulig  <martin@ximian.com>
20557
20558         * class.c (mono_class_get_full): New public function; does a
20559         mono_class_get(), but also takes a `MonoGenericContext *'.
20560
20561         * loader.c (mono_field_from_memberref): Renamed to
20562         `field_from_memberref', made static and added `MonoGenericContext *'
20563         argument.
20564         (mono_field_from_token): Added `MonoGenericInst *' argument.
20565         (method_from_memberef): Likewise.
20566         (mono_get_method_from_token): Likewise.
20567         (mono_get_method_full): New public function; does a
20568         mono_get_method(), but also takes a `MonoGenericContext *'.
20569
20570         * verify.c (mono_method_verify): Get the method's generic context
20571         and pass it to mono_field_from_token(), mono_get_method_full() and
20572         mono_class_get_full().
20573
20574 2004-03-25  Martin Baulig  <martin@ximian.com>
20575
20576         * class.c (mono_class_inflate_generic_type): Take a
20577         `MonoGenericContext *' instead of a `MonoGenericInst *' and a
20578         `MonoGenericMethod *'.
20579
20580 2004-03-25  Martin Baulig  <martin@ximian.com>
20581
20582         * loader.h (MonoMethodInflated): Store the MonoGenericContext
20583         instead of the MonoGenericMethod here.
20584
20585 2004-03-25  Martin Baulig  <martin@ximian.com>
20586
20587         * class.h (MonoGenericInst): Added `MonoGenericContext *context';
20588         each time we create a new MonoGenericInst, we also create a new
20589         context which points back to us.
20590
20591         * class.c (inflate_method): Use `ginst->context' instead of
20592         creating a new context.
20593
20594         * loader.c (method_from_memberref): Use
20595         `klass->generic_inst->context' instead of creating a new context.
20596
20597 2004-03-25  Martin Baulig  <martin@ximian.com>
20598
20599         * class.h (MonoGenericContext): New struct.
20600         (MonoGenericMethod): Removed `generic_inst'.
20601
20602         * class.c (mono_class_inflate_generic_method): Take a
20603         `MonoGenericContext *' instead of a `MonoGenericMethod *'.
20604
20605 2004-03-25  Martin Baulig  <martin@ximian.com>
20606
20607         * loader.h (MonoMethodInflated): New typedef.
20608
20609         * metadata.h (MonoMethodSignature): Removed `gen_method', make
20610         `generic_param_count' consume just 30 bits, added `is_inflated'
20611         and `has_type_parameters' flags (one bit each).
20612
20613         * class.c (mono_class_inflate_generic_method): Create a
20614         MonoMethodInflated instead of a MonoMethodNormal and set
20615         `is_inflated' in the method signature.
20616
20617         * class.h (MonoGenericMethod): Removed `generic_method'.
20618
20619 2004-03-25  Lluis Sanchez Gual  <lluis@ximian.com>
20620
20621         * image.c: Make sure the name of a MonoImage is always an absolute path.
20622           This fixes bug #54415.
20623
20624 2004-03-24  Martin Baulig  <martin@ximian.com>
20625
20626         * class.c (mono_class_setup_vtable): If we're a generic instance,
20627         use our generic type's vtable size.
20628
20629 2004-03-24  Zoltan Varga  <vargaz@freemail.hu>
20630
20631         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Add
20632         MONO_NO_UNLOAD env var as a temporary workaround for unloading 
20633         problems.
20634
20635 2004-03-23  Martin Baulig  <martin@ximian.com>
20636
20637         * class.h (MonoDynamicGenericInst): Added `int count_events' and
20638         `MonoEvent *events'.
20639
20640         * icall.c (ves_icall_MonoGenericInst_GetEvents): New interncall.
20641         (typebuilder_icalls): Added "get_event_info"; calls
20642         mono_reflection_event_builder_get_event_info(). 
20643
20644         * reflection.c (mono_reflection_generic_inst_initialize): Added
20645         `MonoArray *events'.
20646         (mono_reflection_event_builder_get_event_info): New function.
20647
20648 2004-03-23  Bernie Solomon  <bernard@ugsolutions.com>
20649
20650         * object.h: add mono_type_initialization_init
20651
20652         * object.c (mono_runtime_class_init): 
20653         implement class constructor synchronization rules
20654         to cope with threading issues.  
20655         add mono_type_initialization_init
20656
20657         * appdomain.c (mono_runtime_init): call 
20658         mono_type_initialization_init
20659
20660         * class.h: removing initializing field from MonoVTable
20661
20662 2004-03-23  Martin Baulig  <martin@ximian.com>
20663
20664         * class.c (my_mono_class_from_generic_parameter): Use
20665         `param->name' if it's not NULL. 
20666
20667 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
20668
20669         * class.c: do not insert non-virtual methods in the vtable.
20670         * icall.c, mono-debug-debugger.c, object.c: if method->slot == -1,
20671         that means the method is non-virtual. This never would have
20672         happened before.
20673
20674 2004-03-22  Lluis Sanchez Gual  <lluis@ximian.com>
20675
20676         * profiler.c: Added lock for accessing coverage_hash.
20677
20678 2004-03-22  Martin Baulig  <martin@ximian.com>
20679
20680         * icall.c (ves_icall_MethodInfo_get_IsGenericMethod): Use
20681         `method->method->signature->generic_param_count != 0' to make it
20682         work for interface methods.
20683
20684 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20685
20686         * process.c: quote the string passed to the shell using g_shell_quote.
20687
20688 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20689
20690         * threads.c:
20691         (mono_threads_manage): don't remove the finalizer thread and self
20692         from the threads hash table so that mono_thread_manage can be called
20693         more than once.
20694
20695 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20696
20697         * process.c: quote the arguments when UseShellExecute is true. Fixes
20698         bug #55790.
20699
20700 2004-03-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20701
20702         * threads.c: set mono_thread_detach as a cleanup routine for every
20703         thread. This way it's always executed upon thread termination, either
20704         aborted or finished normally. No more xsp hangs!
20705
20706 2004-03-17  Martin Baulig  <martin@ximian.com>
20707
20708         * class.h (MonoGenericInst): Replaced the `GList *nested' with an
20709         `int count_nested' and a `MonoType **nested'.
20710
20711         * reflection.c (mono_reflection_bind_generic_parameters): Moved
20712         most of the functionality into a new static
20713         do_mono_reflection_bind_generic_parameters() and don't take a
20714         `MonoType *nested_in' argument any more.  Don't compute nested
20715         types here.
20716         (mono_reflection_generic_inst_get_nested_types): New public method
20717         to get nested types.
20718
20719         * class.c (mono_class_create_generic): Set `klass->nested_in' if
20720         we're a nested class.
20721
20722         * icall.c (ves_icall_MonoGenericInst_GetNestedTypes): Call
20723         mono_reflection_generic_inst_get_nested_types() to compute the
20724         nested types.
20725
20726 2004-03-17  Zoltan Varga  <vargaz@freemail.hu>
20727
20728         * threads.c (ves_icall_System_Threading_Thread_Abort): Add a more
20729         descriptive error message under windows.
20730         
20731 2004-03-17  Martin Baulig  <martin@ximian.com>
20732
20733         * class.c (dup_type): Added `const MonoType *original' argument;
20734         copy the attrs from the original type.
20735
20736 2004-03-17  Martin Baulig  <martin@ximian.com>
20737
20738         * metadata.c (do_mono_metadata_parse_generic_inst): Use the
20739         `m->generic_inst_cache' here.
20740
20741 2004-03-17  Zoltan Varga  <vargaz@freemail.hu>
20742
20743         * exception.h exception.c: Add stack_overflow_exception.
20744
20745 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20746
20747         * threadpool.c:
20748         (overlapped_callback): call SetEvent *after* invoking the callback.
20749         No need to call CloseHandle.
20750
20751 2004-03-16  Martin Baulig  <martin@ximian.com>
20752
20753         * reflection.c (mono_image_get_fieldref_token): Take a
20754         `MonoReflectionField *' instead of a `MonoClassField *' and a
20755         `MonoClass *'; store the `MonoReflectionField *' in the hash.
20756
20757 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20758
20759         * appdomain.c: don't add the culture to the filename we're looking for
20760         if it's neutral or NULL. Fixes bug #53788. Removed redundant memset.
20761
20762 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20763
20764         * locales.c: don't ignore symbols when doing case insensitive compares.
20765         Thanks Dick! Fixes bug #54046.
20766
20767         * threads.c: surround 'threads' usage with enter/leave in
20768         mono_thread_manage.
20769
20770 2004-03-16  Zoltan Varga  <vargaz@freemail.hu>
20771
20772         * marshal.c (mono_marshal_get_native_wrapper): Char arrays are 
20773         implicitly marshalled as [Out]. Fixes #55450.
20774
20775         (mono_marshal_get_runtime_invoke): Zero out the result if there is
20776         an exception.
20777
20778 2004-03-16  Martin Baulig  <martin@ximian.com>
20779
20780         * class.c (mono_class_from_generic_parameter): Use the actual
20781         parameter name. 
20782
20783 2004-03-16  Martin Baulig  <martin@ximian.com>
20784
20785         * reflection.c (type_get_signature_size): New static function.
20786         Compues the size of the type in a method signature.
20787         (method_get_signature_size): New static function; calls
20788         type_get_signature_size() to compute the actual size of the
20789         method's signature.
20790         (method_encode_signature): Use method_get_signature_size() to get
20791         the signature's size rather than using `nparams * 10'.
20792
20793 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20794
20795         * file-io.h: define here WapiOverlapped on windows. I don't want the
20796         regular OVERLAPPED one.
20797
20798         * file-io.c:
20799         * threadpool.c: somehow, BindIoCompletionCallback is not found.
20800         Disabling AIO on windows.
20801
20802 2004-03-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20803
20804         * marshal.c: Marshal.SizeOf throws an exception for AutoLayout. Fixes
20805         bug #55385.
20806
20807 2004-03-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20808
20809         * appdomain.c: upgraded corlib version.
20810
20811         * file-io.c: implemented new icalls: GetSupportsAIO, BeginRead
20812         and BeginWrite. Allow opening files for asynchrnous operations.
20813
20814         * file-io.h: new struct that maps FileStreamAsyncResult.
20815         * icall.c: added new icalls.
20816         * process.[ch]: support setting child process environment variables
20817         and use the SHELL or COMSPEC when UseShellExecute is true.
20818
20819         * threadpool.[ch]: fixed warnings, moved ThreadPool icalls here. The
20820         callback for async. IO is here and also BindHandle.
20821
20822         * threads.[ch]: added mono_thread_detach and removed ThreadPool icalls
20823         from here.
20824
20825 2004-03-14  Zoltan Varga  <vargaz@freemail.hu>
20826
20827         * reflection.c (create_custom_attr): Allow len == 0.
20828
20829         * object.c (mono_class_compute_gc_descriptor): Fix descriptor
20830         computation on big-endian machines.
20831
20832 2004-03-13  Martin Baulig  <martin@ximian.com>
20833
20834         * class.h (MonoGenericInst): Added `int count_ifaces'.
20835
20836         * iclass.c (ves_icall_MonoGenericInst_GetInterfaces): Use
20837         `ginst->count_ifaces' instead `klass->interface_count' since we
20838         may get called before the vtable is created.
20839
20840         * loader.c (mono_method_get_param_names): If we're a generic
20841         instance, return and don't initialize the class.
20842
20843         * reflection.c (mono_reflection_setup_generic_class): Don't call
20844         ensure_runtime_vtable().
20845         (mono_reflection_bind_generic_parameters): Set
20846         `ginst->count_ifaces'.
20847
20848 2004-03-11  Jackson Harper <jackson@ximian.com>
20849
20850         * icall.c:
20851         * unicode.c:
20852         * unicode.h: Remove unused System.Char icalls.
20853         
20854 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
20855
20856         * loader.c (mono_lookup_pinvoke_call): Call the Windows.Forms init
20857         code when we P/Invoke the first library in Windows.Forms, instead
20858         of when we first open the assembly.
20859
20860         * assembly.c: Drop the lookup from here.
20861
20862 2004-03-10  Martin Baulig  <martin@ximian.com>
20863
20864         * reflection.c (mono_reflection_get_custom_attrs): Use the correct
20865         class for properties, fields and events.  Finally fixes #54945.
20866
20867 2004-03-10  Martin Baulig  <martin@ximian.com>
20868
20869         * metadata.c (mono_metadata_class_equal): New static function;
20870         checks whether two generic instances or two generic parameters are
20871         equal.
20872         (mono_metadata_type_equal): Use mono_metadata_class_equal() to
20873         compare classes.        
20874
20875 2004-03-10  Martin Baulig  <martin@ximian.com>
20876
20877         * class.h (MonoGenericMethod): Added `gpointer reflection_info'.
20878
20879         * reflection.c (inflate_mono_method): Added `MonoObject *obj'
20880         argument and write it into the `reflection_info' field.
20881
20882         * icall.c
20883         (ves_icall_MethodBase_GetGenericMethodDefinition): New interncall.
20884         (ves_icall_MethodBase_get_HasGenericParameters): New interncall.
20885
20886 2004-03-09  Jackson Harper  <jackson@ximian.com>
20887
20888         * char-conversions.h: use 8 bits for numeric data its all we need
20889         * icall.c: numeric data is only 8 bits now.
20890
20891 2004-03-09  Martin Baulig  <martin@ximian.com>
20892
20893         * class.h (MonoProperty, MonoEvent): Added `MonoClass *parent'.
20894
20895         * class.c (init_properties, init_events): Initialize the new
20896         `parent' field.
20897
20898         * reflection.c (typebuilder_setup_properties): Likewise.
20899         (typebuilder_setup_events): Likewise.
20900
20901         * reflection.h (MonoEventInfo): Replaced `parent with
20902         `declaring_type' and `reflected_type'.
20903
20904         * icall.c (ves_icall_get_property_info): Distinguish between
20905         declaring and reflected type.
20906         (ves_icall_get_event_info): Likewise.
20907
20908 2004-03-09  Martin Baulig  <martin@ximian.com>
20909
20910         * icall.c (ves_icall_Type_GetTypeCode): Added MONO_TYPE_GENERICINST.
20911         (ves_icall_Type_GetField): Correctly set field->klass.
20912
20913 2004-03-09  Zoltan Varga  <vargaz@freemail.hu>
20914
20915         * loader.h: Fix warning.
20916
20917 2004-03-08  Miguel de Icaza  <miguel@ximian.com>
20918
20919         *  loader.c, loader.h (mono_loader_wine_init): Loads the Wine/Lib
20920         library routine if present.  Notice that it will still continue
20921         executing even if its missing, for those working on the Gtk#
20922         edition of Windows.Forms.
20923
20924         * assembly.c (do_mono_assembly_open): If loading the
20925         System.Windows.Forms call mono_loader_wini_init.
20926
20927 2004-03-04  Lluis Sanchez Gual  <lluis@ximian.com>
20928
20929         * class.h: Added MonoRemoteClass struct.
20930         * domain.c: Changed hash function for proxy_vtable_hash. It now uses a
20931         function for MonoStrings.
20932         * icall.c: In GetTransparentProxy, assign a MonoRemoteClass to the proxy.
20933         Added internal call for getting the proxy type.
20934         * marshal.c: Get the type of transparent proxies from its remote_class.
20935         Added methods that generate the IL for type checks and casts:
20936         mono_marshal_get_isinst, mono_marshal_get_castclass, 
20937         mono_marshal_get_proxy_cancast.
20938         * marshal.h: Declaration of the previous new methods.
20939         * object.c: Added new moethods for creating and updating MonoRemoteClass
20940         instances: mono_remote_class, mono_upgrade_remote_class, 
20941         * object.h: Added MonoRemoteClass reference in MonoTransparentProxy.
20942         * verify.c: FIx transparent_proxy_fields layout.
20943         * appdomain.c: Bump corlib version.
20944
20945 2004-03-04  Jackson Harper  <jackson@ximian.com>
20946
20947         * icall.c: Add icall to access char conversion tables.
20948         * char-conversions.h: Character conversion tables.
20949         * Makefile.am: Add char-conversions.h private header file.
20950         
20951 2004-03-04  Zoltan Varga  <vargaz@freemail.hu>
20952
20953         * appdomain.c (unload_thread_main): Increase unloading timeout to
20954         10 sec as a temporary workaround for Nant problems.
20955
20956 2004-02-29  Zoltan Varga  <vargaz@freemail.hu>
20957
20958         * gc.c: Add checks for GC_enable and GC_disable.
20959
20960         * string-icalls.c locales.c: Applied patch from Jaroslaw Kowalski
20961         (jaak@zd.com.pl). Fix memory corruption in String.Replace 
20962         (bug #54988).
20963         
20964 2004-02-27  Martin Baulig  <martin@ximian.com>
20965
20966         * reflection.c (mono_reflection_bind_generic_parameters): Take a
20967         `MonoReflectionType *' instead of a `MonoType *'.
20968
20969 2004-02-26  Zoltan Varga  <vargaz@freemail.hu>
20970
20971         * gc.c (run_finalize): Avoid finalizing the object representing the
20972         finalizer thread.
20973         (finalizer_thread): Fix warning.
20974
20975 2004-02-25  Martin Baulig  <martin@ximian.com>
20976
20977         * class.c (_mono_class_get_instantiation_name): Added `int offset'
20978         argument for nested types.
20979         (mono_class_create_generic): Added support for nested generictypes.
20980
20981         * class.h (MonoGenericInst): Added `MonoType *nested_in' and
20982         `GList *nested'.
20983
20984         * icall.c (ves_icall_MonoGenericInst_GetNestedTypes): New icall.
20985
20986         * reflection.c (method_encode_signature): Increase the minimum
20987         value of `size' from 10 to 11.
20988         (mono_reflection_bind_generic_parameters): Take `int type_argc'
20989         and `MonoType **types' arguments instead of the `MonoArray
20990         *types'; added `MonoType *nested_in'.  Recursively instantiate
20991         nested classes. 
20992
20993 2004-02-23  Zoltan Varga  <vargaz@freemail.hu>
20994
20995         * appdomain.h (MonoDomain): Add preallocated null_reference_ex and 
20996         stack_overflow_ex members which are used by exception handling.
20997
20998         * appdomain.c (mono_runtime_init): Initialize the new members.
20999
21000         * gc.c (mono_gc_enable): New helper function.
21001         * gc.c (mono_gc_disable): New helper function.
21002
21003 2004-02-23  Martin Baulig  <martin@ximian.com>
21004
21005         * icall.c: I must have been really stupid - make it actually work
21006         this time ;-)
21007
21008 2004-02-23  Martin Baulig  <martin@ximian.com>
21009
21010         * loader.c (method_from_memberref): Only inflate the method if
21011         it's in another klass.
21012
21013 2004-02-23  Martin Baulig  <martin@ximian.com>
21014
21015         * class.c (mono_class_inflate_generic_type): Fixed two bugs.
21016         (mono_class_init): If we're a generic instance and an interface,
21017         compute `class->interface_id'; also create `class->interfaces'
21018         here and inflate them.
21019
21020         * metadata.c (do_mono_metadata_parse_generic_inst): Compute
21021         `ginst->is_open'.
21022         (mono_type_stack_size): Fix for MONO_TYPE_GENERICINST.
21023
21024         * reflection.c (mono_image_create_token): Allow "MonoGenericInst".
21025
21026 2004-02-15  Miguel de Icaza  <miguel@ximian.com>
21027
21028         * reflection.c (method_encode_code): Improved the error message
21029         generated by the exception.
21030
21031 2004-02-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21032
21033         * icall.c: Martin did not do what he said in the ChangeLog for
21034         2004-02-18, but put back the changes for properties and events.
21035         Commenting those changes out again and adding comment to bug #54518.
21036         
21037         * process.c: removed warning.
21038
21039 2004-02-20  Zoltan Varga  <vargaz@freemail.hu>
21040
21041         * marshal.c (emit_struct_conv): Print an error message instead of
21042         asserting when a type does not have the StructLayout attribute.
21043
21044 2004-02-20  Martin Baulig  <martin@ximian.com>
21045
21046         * reflection.c (mono_type_get_object): Also use the cache for
21047         generic instances.
21048         (mono_reflection_bind_generic_parameters): Always compute
21049         `ginst->ifaces'.        
21050
21051 2004-02-20  Martin Baulig  <martin@ximian.com>
21052
21053         * class.h (MonoGenericMethod): Removed `klass'.
21054
21055         * class.c (mono_class_inflate_generic_method): Added `MonoClass
21056         *klass' argument.
21057
21058 2004-02-20  Martin Baulig  <martin@ximian.com>
21059
21060         * reflection.c (method_encode_methodspec): Actually use the
21061         uninflated signature for the memberref.
21062
21063 2004-02-20  Martin Baulig  <martin@ximian.com>
21064
21065         * class.h (MonoGenericMethod): Removed `declaring'.
21066
21067         * class.c (mono_class_inflate_generic_method): If `gmethod->klass'
21068         is NULL, compute it here.
21069
21070 2004-02-20  Martin Baulig  <martin@ximian.com>
21071
21072         * image.h (MonoImage): Added `GHashTable *generic_inst_cache'.
21073
21074         * metadata.c (mono_metadata_generic_inst_hash): New method.
21075         (mono_metadata_generic_inst_equal): New method.
21076
21077         * reflection.c (mono_reflection_bind_generic_parameters): Use the
21078         `klass->image->generic_inst_cache' cache to avoid creating
21079         duplicate MonoGenericInst's.
21080
21081         * class.c (mono_class_inflate_generic_type): Use the cache.
21082
21083 Thu Feb 19 19:39:09 CET 2004 Paolo Molaro <lupus@ximian.com>
21084
21085         * object.c: fixed gc descriptor calculation for embedded valuetypes.
21086
21087 2004-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21088
21089         * icall.c: added Socket.WSAIoctl icall.
21090
21091         * socket-io.[ch]: implemented
21092         ves_icall_System_Net_Sockets_Socket_WSAIoctl.
21093
21094 2004-02-19  Atsushi Enomoto  <atsushi@ximian.com>
21095
21096         * icall.c: removed IsDigit, IsSeparator, IsWhiteSpace from char_icalls.
21097
21098 2004-02-18  Urs C Muff  <umuff@quark.com>
21099
21100         * debug-mono-symfile.c, mono-debug-debugger.c, mono-debug.c: Make
21101         this work on PPC and other big-endian architectures.
21102
21103         * debug-mono-symfile.h: Prepended the names of all the `guint32'
21104         fields with an underscore to make sure they're only accessed by
21105         the read32() macro.
21106
21107 2004-02-18  Martin Baulig  <martin@ximian.com>
21108
21109         * icall.c: Put the klass->refclass changes back for methods and
21110         fields, but not for properties and events.  We're currently not
21111         distinguishing between DeclaringType and ReflectedType for
21112         properties and events, that's what caused the regressions.
21113
21114 2004-02-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21115
21116         * object.c:
21117         (mono_async_result_new): the handle can be NULL.
21118
21119         * threadpool.c: Use an event instead of a semaphore, don't initialize
21120         it until needed. This saves quite a few semaphores from being created
21121         when using the threadpool.
21122
21123 2004-02-18  Zoltan Varga  <vargaz@freemail.hu>
21124
21125         * object.c (mono_string_is_interned_lookup): Fix interning of long
21126         strings. Fixes #54473.
21127
21128         * domain.c (ldstr_equal): Optimize if the two strings are equal.
21129
21130         * icall.c: Revert the klass->refclass changes since they introduce
21131         regressions (bug #54518).
21132
21133 2004-02-18  Martin Baulig  <martin@ximian.com>
21134
21135         * class.c (mono_class_init): If we're a generic instance and don't
21136         come from a TypeBuilder, inflate our members here.
21137         (mono_class_from_generic): Removed; just use `ginst->klass' instead.
21138         (mono_class_create_generic): New public method.
21139         (mono_class_initialize_generic): Removed.
21140         (get_instantiation_name): Renamed to
21141         _mono_class_get_instantiation_name() and made it public.
21142
21143 2004-02-18  Martin Baulig  <martin@ximian.com>
21144
21145         * class.c (mono_class_inflate_generic_type): Clear the new
21146         instance's `nginst->klass' when inflating a generic instance.
21147         (mono_class_is_subclass_of): Added (basic) support for generic
21148         instances.
21149
21150 Tue Feb 17 21:40:16 CET 2004 Paolo Molaro <lupus@ximian.com>
21151
21152         * appdomain.h, domain.c: use a MonoCodeManager instead of a
21153         MonoMempool to hold compiled native code.
21154
21155 2004-02-17  Martin Baulig  <martin@ximian.com>
21156
21157         * class.h (MonoDynamicGenericInst): Added `count_properties' and
21158         `properties'.
21159
21160         * reflection.c (mono_reflection_generic_inst_initialize): Added
21161         `MonoArray *properties' argument.
21162
21163         * icall.c (ves_icall_MonoGenericInst_GetProperties): New interncall.    
21164
21165 2004-02-17  Martin Baulig  <martin@ximian.com>
21166
21167         * icall.c (ves_icall_Type_GetFields): Renamed to
21168         ves_icall_Type_GetFields_internal() and added a
21169         `MonoReflectionType *rtype' argument; pass it to
21170         mono_field_get_object() to set the field's "reflected" type.
21171         (ves_icall_Type_GetConstructors): Likewise.
21172         (ves_icall_Type_GetEvents): Likewise.
21173         (ves_icall_Type_GetMethodsByName): Added `MonoReflectionType *rtype'
21174         argument; pass it to mono_method_get_object() to set the method's
21175         "reflected" type.       
21176
21177 2004-02-17  Martin Baulig  <martin@ximian.com>
21178
21179         * class.h (MonoDynamicGenericInst): New type.
21180         (MonoGenericInst): Added `dynamic_info' and `is_dynamic' fields.
21181
21182         * icall.c (ves_icall_MonoGenericInst_GetMethods): New interncall.
21183         (ves_icall_MonoGenericInst_GetConstructors): New interncall.
21184         (ves_icall_MonoGenericInst_GetFields): New interncall.
21185
21186         * class.c (mono_class_from_generic): Don't call
21187         mono_class_initialize_generic() if this is a dynamic instance;
21188         ie. it's being created from a TypeBuilder.
21189         Use MONO_TYPE_GENERICINST for `class->this_arg.type' and
21190         `class->byval_arg.type'.
21191
21192         * reflection.c (mono_reflection_inflate_method_or_ctor): Renamed
21193         to `inflate_method' and made static.
21194         (mono_reflection_inflate_field): Removed.
21195         (mono_reflection_generic_inst_initialize): New public method.
21196
21197         * reflection.h (MonoReflectionGenericInst): Removed `methods',
21198         `ctors' and `fields'; added `initialized'.
21199
21200 2004-02-14  Zoltan Varga  <vargaz@freemail.hu>
21201
21202         * debug-helpers.c (mono_method_full_name): Fix output for empty
21203         namespaces.
21204
21205 2004-02-12  Martin Baulig  <martin@ximian.com>
21206
21207         * class.h (MonoClassField): Added `MonoType *generic_type'.
21208
21209         * reflection.c (mono_image_get_fieldref_token): Added support for
21210         instantiated generic types.
21211         (field_encode_inflated_field): Removed.
21212         (mono_image_get_inflated_field_token): Removed.
21213         (mono_reflection_inflate_field): Return a `MonoReflectionField *'.
21214
21215         * reflection.h (MonoReflectionInflatedField): Removed.
21216
21217 2004-02-12  Martin Baulig  <martin@ximian.com>
21218
21219         * metadata.h (MonoMethodHeader, MonoMethodSignature): Moved the
21220         `gen_method' field from MonoMethodHeader to MonoMethodSignature.
21221
21222         * reflection.c (mono_image_get_methodspec_token): Take a
21223         `MonoMethod *' instead of a `MonoReflectionInflatedMethod *'.
21224         (mono_image_create_token): Check whether we have a
21225         `method->signature->gen_method' and call
21226         mono_image_get_methodspec_token() if appropriate.
21227         (inflated_method_get_object): Removed.
21228         (mono_reflection_bind_generic_method_parameters): Return a
21229         `MonoReflectionMethod *', not a `MonoReflectionInflatedMethod *'.
21230         (mono_reflection_inflate_method_or_ctor): Likewise.
21231
21232         * reflection.h (MonoReflectionInflatedMethod): Removed.
21233
21234 2004-02-12  Zoltan Varga  <vargaz@freemail.hu>
21235
21236         * marshal.c (mono_marshal_get_native_wrapper): Implement proper support
21237         for custom valuetype marshalling.
21238
21239         * icall.c (icall_entries): Diagnostic -> Diagnostics. Fixes #54261.
21240
21241 2004-02-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21242
21243         * icall.c: fixed WSAGetLastError_internal name.
21244
21245 2004-02-11  Zoltan Varga  <vargaz@freemail.hu>
21246
21247         * threads.c (mono_thread_attach): Allow this to be called multiple
21248         times for a thread.
21249         
21250         * threads.c (build_wait_tids): Do not wait for ourselves.
21251
21252         * threads.c (mono_thread_pop_appdomain_ref): Avoid crash if the 
21253         appdomain list is empty.
21254
21255         * marshal.c (mono_marshal_get_native_wrapper): Do not free the
21256         memory returned by mono_string_builder_to_utf16, since it points into
21257         managed memory. Thanks to Bernie Solomon for noticing this.
21258
21259         * icall.c: Add AppDomainSetup icalls.
21260
21261         * reflection.h (MonoReflectionMethodAux): Add 'param_cattr' field.
21262
21263         * reflection.c (mono_custom_attrs_from_param): Add support for dynamic
21264         types.
21265
21266         * reflection.c (reflection_methodbuilder_to_mono_method): Save
21267         custom attributes to the method_aux struct. Also fix array indexes etc.
21268
21269         * loader.c (mono_method_get_param_names): Make dynamic case work again.
21270         
21271 Tue Feb 10 17:03:04 CET 2004 Paolo Molaro <lupus@ximian.com>
21272
21273         * icall.c, loader.c: icall cleanup: we save quite a bit of memory
21274         (both static and runtime) and reduce startup time.
21275
21276 2004-02-10  Zoltan Varga  <vargaz@freemail.hu>
21277
21278         * marshal.c (mono_marshal_get_native_wrapper): Throw an exception on
21279         AsAny marshalling conversion instead of crashing.
21280
21281         * marshal.c: Fix warnings.
21282
21283 2004-02-09  Martin Baulig  <martin@ximian.com>
21284
21285         * class.h (MonoGenericMethod): Added `MonoMethod *declaring'.
21286
21287         * reflection.h (MonoReflectionInflatedMethod): Removed the
21288         `declaring' field, it's now in the unmanaged MonoGenericMethod.
21289
21290         * reflection.c (method_encode_methodspec): Removed the `method'
21291         argument; we get it from `gmethod->declaring'.
21292         (inflated_method_get_object): Removed the `declaring' argument.
21293
21294 2004-02-09  Martin Baulig  <martin@ximian.com>
21295
21296         * class.h (MonoGenericMethod): New type.
21297         (MonoGenericInst): Remove `mtype_argc', `mtype_argv' and
21298         `generic_method'.
21299
21300         * metadata.h (MonoMethodHeader): Replaced the `geninst' field with
21301         a `MonoGenericMethod *gen_method' one.
21302
21303         * class.c (mono_class_inflate_generic_type): Take an additional
21304         `MonoGenericMethod * argument.  This is only non-NULL if we're
21305         inflating types for a generic method.   
21306         (mono_class_inflate_generic_signature): Renamed to
21307         inflate_generic_signature() and made static; take a
21308         `MonoGenericMethod *' argument instead of a `MonoGenericInst *'.
21309         (inflate_generic_header): Take a `MonoGenericMethod *' argument
21310         instead of a `MonoGenericInst *' one.
21311         (mono_class_inflate_generic_method): Likewise.
21312
21313         * reflection.c (encode_generic_method_sig): Take a
21314         `MonoGenericMethod *' argument instead of a `MonoGenericInst *'.
21315         (method_encode_methodspec): Likewise.
21316         (inflated_method_get_object): Likewise. 
21317
21318         * reflection.h (MonoReflectionGenericInst): Replaced the `ginst'
21319         field with a `MonoGenericMethod *gmethod' one.  
21320
21321 2004-02-08  Bernie Solomon  <bernard@ugsolutions.com>
21322
21323         * class.h (mono_class_has_parent): add parens to expansion
21324         so you can ! this.
21325
21326 2004-02-08  Martin Baulig  <martin@ximian.com>
21327
21328         * image.h (MonoImage): Removed `generics_cache'.
21329
21330         * class.c (mono_class_from_generic): Take a `MonoGenericInst *'
21331         instead of a `MonoType *' argument; removed the `inflate_methods'
21332         argument.  Don't inflate methods here.
21333
21334         * loader.c (find_method): If it's a generic instance, call
21335         mono_class_init() on the `sclass->generic_inst->generic_type'.
21336
21337         * metadata.c (mono_type_size): Make this work on uninitialized
21338         generic instances; call it on the `ginst->generic_type's class.
21339
21340         * reflection.c (mono_reflection_bind_generic_parameters): Call
21341         mono_class_from_generic() to create the `ginst->klass'.
21342
21343 2004-02-08  Martin Baulig  <martin@ximian.com>
21344
21345         * class.h (MonoClass): Changed type of `generic_inst' from
21346         `MonoType *' to `MonoGenericInst *'.
21347
21348 2004-02-08  Martin Baulig  <martin@ximian.com>
21349
21350         * icall.c (ves_icall_Type_BindGenericParameters): Just call
21351         mono_type_get_object(), this is now creating a `MonoGenericInst'
21352         for MONO_TYPE_GENERICINST.
21353         (ves_icall_MonoGenericInst_GetParentType): Likewise.
21354         (ves_icall_MonoGenericInst_GetInterfaces): Likewise.
21355
21356         * reflection.c (mono_type_get_object): Return a `MonoGenericInst'
21357         instead instead of a `MonoType' for MONO_TYPE_GENERICINST.
21358         (inflated_method_get_object): Added `MonoClass *refclass' argument.
21359         (mono_reflection_inflate_method_or_ctor): Correctly set declaring
21360         and reflected type.
21361
21362         * reflection.h (MonoReflectionInflatedMethod): Removed
21363         `declaring_type' and `reflected_type'.
21364
21365 2004-02-08  Martin Baulig  <martin@ximian.com>
21366
21367         * class.h (MonoGenericInst): Added `MonoType *parent' and
21368         `MonoType **ifaces'.
21369
21370         * reflection.h (MonoReflectionGenericInst): Removed `klass',
21371         `parent' and `interfaces'.
21372
21373         * reflection.c (mono_reflection_bind_generic_parameters): Take a
21374         `MonoType *' argument and return a `MonoType *'.
21375
21376         * icall.c
21377         (ves_icall_MonoGenericInst_GetParentType): New interncall.
21378         (ves_icall_MonoGenericInst_GetInterfaces): Likewise.    
21379
21380 2004-02-06  Zoltan Varga  <vargaz@freemail.hu>
21381
21382         * marshal.c (mono_marshal_get_native_wrapper): Add support for custom
21383         valuetype marshalling.
21384
21385 2004-02-06  Martin Baulig  <martin@ximian.com>
21386
21387         * class.c
21388         (mono_class_from_generic_parameter): Added TYPE_ATTRIBUTE_PUBLIC.
21389         (my_mono_class_from_generic_parameter): Likewise.
21390
21391 2004-02-06  Zoltan Varga  <vargaz@freemail.hu>
21392
21393         * debug-mono-symfile.c debug-mono-symfile.h mono-debug.c: Read the
21394         contents of the symbol files lazily.
21395
21396         * object.h (MonoThread): Add 'name' and 'name_len' fields.
21397
21398         * threads.h threads.c icall.c: New icalls for getting and setting the
21399         threads name.
21400
21401 2004-02-05  Zoltan Varga  <vargaz@freemail.hu>
21402
21403         * appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRefByID): 
21404         Raise an exception when the domain is not found.
21405
21406 2004-02-03  Martin Baulig  <martin@ximian.com>
21407
21408         * reflection.c (mono_image_get_methodspec_token): Use the
21409         uninflated signature; fixes gen-33.
21410
21411 2004-02-02  Zoltan Varga  <vargaz@freemail.hu>
21412
21413         * gc.c threads.c: Make the finalizer thread a normal managed thread so
21414         the finalizer code can use thread functionality.
21415
21416         * gc.c (ves_icall_System_GC_WaitForPendingFinalizers): Fix check for 
21417         the finalizer thread.
21418
21419         * threads.c: Make some functions more robust.
21420
21421         * loader.c (mono_lookup_pinvoke_call): Another attempt at fixing #22532.
21422
21423         * metadata.h: Add new marshalling conventions.
21424
21425         * marshal.c (mono_marshal_get_native_wrapper): Add support for unicode
21426         stringbuilder marshalling. Fixes #53700.
21427
21428         * reflection.h (MonoReflectionTypeBuilder): Add 'permissions' field.
21429
21430         * reflection.c (mono_image_get_type_info): Save declarative security
21431         info.
21432
21433         * reflection.c (mono_image_get_field_info): Handle uninitialized 
21434         unmanaged fields as well.
21435
21436         * appdomain.c: Bump corlib version.
21437
21438 2004-02-01  Martin Baulig  <martin@ximian.com>
21439
21440         * loader.c (method_from_methodspec): Use `ginst->mtype_argc/v' for
21441         method type arguments.  
21442
21443 2004-01-30  Duncan Mak  <duncan@ximian.com>
21444
21445         * marshal.h: Add prototype for
21446         "ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem"
21447         and
21448         "ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem" to
21449         fix the build.
21450
21451 2004-01-30  Zoltan Varga  <vargaz@freemail.hu>
21452
21453         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem): New icall.
21454         (ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem): New icall.
21455
21456 2004-01-29  Zoltan Varga  <vargaz@freemail.hu>
21457
21458         * marshal.c (mono_marshal_get_native_wrapper): Add support for
21459         custom marshalling of valuetypes.
21460
21461         * marshal.c: Fix some warnings.
21462
21463 2004-01-29  Martin Baulig  <martin@ximian.com>
21464
21465         * class.h (MonoGenericInst): Added `mtype_argc' and `mtype_argv'
21466         for generic method parameters.
21467
21468         * reflection.c (method_encode_methodspec): Write the uninflated
21469         signature into the methodspec table.
21470         (mono_reflection_inflate_method_or_ctor): Ensure `res->declaring'
21471         is always the uninflated method.
21472         (reflection_methodbuilder_to_mono_method): Copy the generic
21473         parameters from the MethodBuilder into `header->gen_params'.
21474
21475 2004-01-29  Zoltan Varga  <vargaz@freemail.hu>
21476
21477         * class.c (mono_class_from_generic_parameter): Fix warning.
21478
21479 2004-01-27  Martin Baulig  <martin@ximian.com>
21480
21481         * class.c (mono_class_from_generic_parameter): Don't create
21482         `klass->methods' here.  
21483
21484 2004-01-26  Zoltan Varga  <vargaz@freemail.hu>
21485
21486         * loader.c (mono_lookup_pinvoke_call): Disable trimming of .dll
21487         extension since it does not work with libraries named lib<FOO>.dll.so.
21488
21489 2004-01-25  Martin Baulig  <martin@ximian.com>
21490
21491         * class.c (mono_class_inflate_generic_type): Added support for
21492         MONO_TYPE_GENERICINST.
21493
21494         * reflection.c (mono_reflection_inflate_method_or_ctor): Also
21495         inflate methods on open constructed types.      
21496
21497 2004-01-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21498
21499         * object.c: fire ProcessExit event in the root AppDomain after running
21500         Main. Fixes bug #53299.
21501
21502 Fri Jan 23 21:27:40 CET 2004 Paolo Molaro <lupus@ximian.com>
21503
21504         * socket-io.c: include the new socket-wrappers.h header.
21505         Use the wrappers instead of the unix socket functions to make the code
21506         more clear.
21507
21508 2004-01-23  Zoltan Varga  <vargaz@freemail.hu>
21509
21510         * profiler.c (merge_methods): Fix merging of profile info. Fixes #53010.
21511
21512         * loader.c (mono_lookup_pinvoke_call): Strip .dll from library names.
21513         Fixes #22532.
21514
21515 2004-01-22  Zoltan Varga  <vargaz@freemail.hu>
21516
21517         * reflection.c (mono_image_create_pefile): Handle the case when the
21518         entry point is not a MethodBuilder.
21519
21520         * reflection.h (MonoReflectionAssemblyBuilder): Change 'entry_point'
21521         field to ReflectionMethod since it is not allways a builder.
21522
21523         * reflection.c (type_get_fully_qualified_name): New helper function to
21524         return the fully qualified name of a type.
21525
21526         * reflection.c (encode_marshal_blob): Always emit the fully qualified
21527         type name for custom marshallers.
21528
21529         * reflection.c (mono_marshal_spec_from_builder): Ditto.
21530
21531         * class.c (mono_class_setup_vtable): If a parent class already 
21532         implements an interface, use the implementing methods from that class.
21533         Fixes #53148.
21534
21535 2004-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21536
21537         * threadpool.c: just return instead of ExitThread to allow for thread
21538         clean up earlier.
21539
21540 2004-01-21  Zoltan Varga  <vargaz@freemail.hu>
21541
21542         * icall.c (ves_icall_System_Reflection_Module_Close): Prevent assertion
21543         when closing resource modules.
21544
21545         * reflection.c (mono_image_create_pefile): Handle the case when the
21546         entry point is not a MethodBuilder.
21547
21548         * reflection.h (MonoReflectionAssemblyBuilder): Change 'entry_point'
21549         field to ReflectionMethod since it is not allways a builder.
21550
21551 2004-01-20  Bernie Solomon  <bernard@ugsolutions.com>
21552
21553         * marshal.c (mono_marshal_get_managed_wrapper): 
21554         mono_marshal_alloc takes native int so CONV_I
21555         the arg for 64bits.
21556
21557 2004-01-20  Zoltan Varga  <vargaz@freemail.hu>
21558
21559         * reflection.c (fixup_cattrs): New function to fixup the methoddef
21560         tokens in the cattr table. Fixes #53108.
21561
21562 2004-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21563
21564         * loader.c: don't trim ".dll" before looking up in the config file.
21565         Don't leak orig_scope. Reopened bug #22532 in the meanwhile.
21566
21567 2004-01-19  Zoltan Varga  <vargaz@freemail.hu>
21568
21569         * icall.c (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal): 
21570         Return the module which contains the resource as well.
21571         (ves_icall_System_Reflection_Module_Close): New icall.
21572
21573         * appdomain.c: Bump corlib version number.
21574
21575         * image.c (mono_image_addref): New public function.
21576
21577         * assembly.c: Call mono_image_addref.
21578
21579         * reflection.c (mono_module_get_object): Increase reference count of 
21580         the image.
21581
21582         * loader.c (mono_lookup_pinvoke_call): Strip .dll from library names.
21583         Fixes #22532.
21584
21585         * exception.h exception.c loader.h loader.c icall.c marshal.h marshal.c:
21586         Applied patch from Bernie Solomon  <bernard@ugsolutions.com>. Throw
21587         proper exceptions on DllImport problems.
21588
21589 Mon Jan 19 17:50:27 CET 2004 Paolo Molaro <lupus@ximian.com>
21590
21591         * class.c, metadata.c: eliminate CSIZE macro.
21592
21593 2004-01-19  Lluis Sanchez Gual  <lluis@ximian.com>
21594
21595         * icall.c: Added ves_icall_type_IsInstanceOf internal call.
21596         * object.h: Added async_callback field in MonoAsyncResult.
21597         * marshal.c: In mono_delegate_begin_invoke, set the value of async_callback.
21598         * verify.c: Added async_callback in MonoAsyncResult layout.
21599
21600 2004-01-17  Zoltan Varga  <vargaz@freemail.hu>
21601
21602         * reflection.c (mono_reflection_get_custom_attrs): Add support
21603         for Modules.
21604
21605 2004-01-16  Zoltan Varga  <vargaz@freemail.hu>
21606
21607         * marshal.c (mono_string_builder_to_utf8): Fix stringbuilder 
21608         marshalling.
21609         (mono_marshal_method_from_wrapper): Add null pointer check.
21610
21611 2004-01-16  Martin Baulig  <martin@ximian.com>
21612
21613         * debug-mono-symfile.h: Set version number to 36 and reflect
21614         latest symbol writer changes.
21615
21616 2004-01-16  Zoltan Varga  <vargaz@freemail.hu>
21617
21618         * class.c (mono_bounded_array_class_get): Set 'bounded' to FALSE for
21619         multi-dimensional arrays.
21620         (mono_class_is_assignable_from): Check vectors<->one dim. arrays.
21621         (mono_class_from_mono_type): Use bounded_array_class_get.
21622         
21623         * class.c (mono_bounded_array_class_get): New function which takes
21624         a 'bounded' bool argument to distinguish vectors from one dimensional
21625         arrays.
21626
21627         * icall.c (ves_icall_System_Array_CreateInstanceImpl): Call 
21628         bounded_array_class_get if the array has bounds.
21629
21630         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
21631         Search modules loaded using AssemblyBuilder:AddModule as well.
21632
21633 2004-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21634
21635         * appdomain.c: increased corlib version.
21636         * filewatcher.c: removed g_print.
21637         * icall.c:
21638         (get_property_info): only allocate what is actually requested.
21639         (ves_icall_Type_GetInterfaces): free the bitset in case of early error.
21640
21641 2004-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21642
21643         * Makefile.am: added filewatcher.[ch]
21644         * filewatcher.[ch]: FileSystemWatcher runtime support.
21645         * icall.c: added new FSW icalls.
21646
21647 Tue Jan 13 20:03:17 CET 2004 Paolo Molaro <lupus@ximian.com>
21648
21649         * string-icalls.c: fix stringbuilder regression as suggested by
21650         Iain McCoy <iain@mccoy.id.au>.
21651
21652 2004-01-13  Zoltan Varga  <vargaz@freemail.hu>
21653
21654         * process.c (process_read_stringtable_block): Recognize '007f' as
21655         a language neutral stringtable block.
21656
21657 2004-01-12  Patrik Torstensson
21658
21659         * object.h (MonoStringBuilder) : Changed layout to support our
21660         new stringbuilder class.
21661         * marshal.c: Change marshalling to support the new layout of 
21662         string builder.
21663         * appdomain.c: increased version number because new layout of
21664         string builder.
21665
21666 2004-01-12  Zoltan Varga  <vargaz@freemail.hu>
21667
21668         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Receive the
21669         assembly name as an string instead of an AssemblyName, since it is
21670         easier to extract info from it.
21671
21672         * appdomain.c (mono_domain_assembly_preload): Look for assemblies in
21673         the culture subdirectories too. Fixes #52231.
21674
21675 2004-01-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21676
21677         * icall.c: renamed ves_icall_Type_GetMethods to GetMethodsByName.
21678         It takes 2 new parameters with an optional name for the method to look
21679         for and case ignoring info.
21680
21681         * threadpool.c: removed unused variable.
21682
21683 2004-01-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21684
21685         * icall.c: renamed ves_icall_Type_GetProperties to GetPropertiesByName.
21686         It takes 2 new parameters with an optional name for the property to look
21687         for and case ignoring info.
21688         Fixes bug #52753.
21689
21690 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
21691
21692         * reflection.c: Applied patch from Benjamin Jemlich (pcgod@gmx.net).
21693         Fix #52451.
21694
21695 2004-01-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21696
21697         * appdomain.c:
21698         * assembly.c: escape the uri before passing it to g_filename_from_uri.
21699         Fixes bug #52630.
21700
21701 2004-01-07  Zoltan Varga  <vargaz@freemail.hu>
21702
21703         * reflection.c: Add support for more than one unmanaged resource.
21704
21705         * icall.c (ves_icall_get_enum_info): Store the value of the enum fields
21706         in field->def_value, as done in all other cases.
21707
21708         * reflection.c (mono_reflection_get_custom_attrs): Add support for
21709         TypeBuilders.
21710
21711         * reflection.c (mono_reflection_create_runtime_class): Remove 
21712         errorneous assignment to klass->element_class, since it is already
21713         done in mono_reflection_setup_internal_class.
21714
21715 2004-01-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21716
21717         * gc.c: added missing LeaveCriticalSection.
21718         * icall.c: indented a couple of lines.
21719         * threadpool.c: remove dangling LeaveCriticalSection. Don't wait forever
21720         if we call EndInvoke inside a callback. Fixes bug #52601.
21721
21722 2004-01-07  Martin Baulig  <martin@ximian.com>
21723
21724         * mono-debug-debugger.h
21725         (MonoDebuggerIOLayer): Added `GetCurrentThreadID'.
21726
21727 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
21728
21729         * appdomain.c: Use messages in NotImplementedException.
21730
21731         * exception.c (mono_get_exception_not_implemented): Now this takes
21732         a message argument.
21733
21734         * marshal.c (emit_str_to_ptr_conv): g_warning and throw an
21735         exception instead of g_asserting an aborting when something is not
21736         implemented.
21737
21738         Add some inline docs.
21739
21740 2004-01-05  Zoltan Varga  <vargaz@freemail.hu>
21741
21742         * reflection.h: Update after changes to object layout.
21743
21744         * reflection.c: Implement saving of unmanaged aka win32 resources.
21745
21746         * appdomain.c: Bump version number.
21747
21748         * appdomain.c (ves_icall_System_AppDomain_InternalSetDomainByID): 
21749         Handle missing domains gracefully.
21750
21751 2004-01-05  Atsushi Enomoto <atsushi@ximian.com>
21752
21753         * file-io.c : On Windows, there are much more invalid_path_chars.
21754
21755 Fri Jan 2 13:35:48 CET 2004 Paolo Molaro <lupus@ximian.com>
21756
21757         * class.h, object.c: prepare for GetType () speedup.
21758
21759 2003-12-24  Atsushi Enomoto <atsushi@ximian.com>
21760
21761         * profiler.c: workaround for --profile null reference exception on
21762           cygwin. Patch by Patrik Torstensson.
21763
21764 2003-12-22  Bernie Solomon  <bernard@ugsolutions.com>
21765
21766         * marshal.c: (ves_icall_System_Runtime_InteropServices_Marshal_Read/WriteXXX)
21767         make work for unaligned access.
21768
21769 Mon Dec 22 18:37:02 CET 2003 Paolo Molaro <lupus@ximian.com>
21770
21771         * class.c: small cleanup (class->fields [i] -> field).
21772         * image.c: check address of metadata is valid.
21773
21774 2003-12-22  Zoltan Varga  <vargaz@freemail.hu>
21775
21776         * assembly.h assembly.c (mono_assembly_loaded): New public function to
21777         search the list of loaded assemblies.
21778
21779         * reflection.c (mono_reflection_type_from_name): Use 
21780         mono_assembly_loaded instead of mono_image_loaded.
21781
21782         * reflection.c: Fix warnings.
21783
21784 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
21785
21786         * image.h (MonoImage): Add a new 'dynamic' field to denote that the image 
21787         is dynamic. This is needed since an assembly can contain both dynamic and
21788         non-dynamic images.
21789
21790         * class.c loader.c metadata.c object.c: Use image->dynamic instead of 
21791         assembly->dynamic.
21792
21793         * icall.c reflection.c: Add new AssemblyBuilder:AddModule icall.
21794
21795         * reflection.h (MonoReflectionAssemblyBuilder): Add 'loaded_modules' field
21796         to store modules loaded using AddModule.
21797
21798         * reflection.c (mono_image_fill_file_table): Generalize this so it works
21799         on Modules.
21800
21801         * reflection.c (mono_image_fill_export_table_from_class): New helper function.
21802
21803         * reflection.c (mono_image_fill_export_table_from_module): New function to
21804         fill out the EXPORTEDTYPES table from a module.
21805
21806         * reflection.c (mono_image_emit_manifest): Refactor manifest creation code
21807         into a separate function. Also handle loaded non-dynamic modules.
21808
21809         * reflection.c (mono_image_basic_init): Fix memory allocation.
21810
21811         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
21812
21813         * assembly.c (mono_assembly_load_references): Make this public.
21814
21815 2003-12-19  Martin Baulig  <martin@ximian.com>
21816
21817         * class.c (mono_class_initialize_generic): Made this static, take
21818         a `MonoGenericInst *' instead of a `MonoClass *'.
21819         (mono_class_from_generic): Call mono_class_initialize_generic()
21820         unless we're already initialized or being called from
21821         do_mono_metadata_parse_generic_inst().
21822
21823         * class.h (MonoGenericInst): Added `initialized' and
21824         `init_pending' flags.
21825
21826         * metadata.c (do_mono_metadata_parse_generic_inst): Don't call
21827         `mono_class_init (gklass)' or mono_class_initialize_generic()
21828         here; set `generic_inst->init_pending' while parsing the
21829         `type_argv'.
21830
21831 2003-12-19  Bernie Solomon  <bernard@ugsolutions.com>
21832
21833         * locales.c: include string.h for memxxx prototypes
21834
21835 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
21836
21837         * icall.c (ves_icall_MonoField_GetValueInternal): Do not run the class
21838         constructor when accessing literal fields.
21839
21840 2003-12-17  Zoltan Varga  <vargaz@freemail.hu>
21841
21842         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
21843
21844         * reflection.c (assembly_add_resource_manifest): New function to fill
21845         the MANIFESTRESOURCE table.
21846
21847         * reflection.c (mono_image_build_metadata): Emit MANIFESTRESOURCE table.
21848
21849         * reflection.h: Update to changes in class layout.
21850
21851         * icall.c (ves_icall_System_Environment_get_HasShutdownStarted): 
21852         Reenable call to mono_runtime_is_shutting_down ().
21853
21854         * appdomain.c (mono_runtime_is_shutting_down): New helper function to
21855         determine if the runtime is shutting down.
21856
21857 2003-12-16  Jackson Harper <jackson@ximian.com>
21858
21859         * icall.c: comment out call to mono_runtime_is_shutting_down to
21860         fix build.
21861         
21862 2003-12-16  Zoltan Varga  <vargaz@freemail.hu>
21863
21864         * icall.c (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal): Add support for loading resources from modules.
21865         (ves_icall_System_Environment_get_HasShutdownStarted): New icall.
21866
21867 2003-12-15  Bernie Solomon  <bernard@ugsolutions.com>
21868
21869         * reflection.c: move definition of swap_with_size
21870         to before its first call
21871
21872 2003-12-15  Zoltan Varga  <vargaz@freemail.hu>
21873
21874         * appdomain.c (mono_runtime_is_shutting_down): New public function.
21875
21876         * icall.c (ves_icall_System_Environment_get_HasShutdownStarted): New
21877         icall.
21878
21879         * object.c: Fix warnings.
21880
21881         * icall.c (ves_icall_Type_Get...): Only consider inherited static
21882         members if FlattenHierarchy is set.
21883
21884         * reflection.c (mono_image_add_decl_security): New function to emit
21885         declarative security.
21886
21887         * reflection.h reflection.c: Add support for declarative security.
21888
21889         * appdomain.c (MONO_CORLIB_VERSION): Bump version number.
21890         
21891 2003-12-13  Zoltan Varga  <vargaz@freemail.hu>
21892
21893         appdomain.c (MONO_CORLIB_VERSION): Bump version number.
21894         
21895         * appdomain.c verify.c: Moved corlib version checking into its own
21896         function in appdomain.c since it needs to create vtables etc.
21897
21898 2003-12-13  Patrik Torstensson <p@rxc.se>
21899
21900         * marshal.c (mono_remoting_wrapper): Fix bug 48015, using TP as this 
21901         instead of unwrapped server.
21902
21903 2003-12-12  Zoltan Varga  <vargaz@freemail.hu>
21904
21905         * verify.c (check_corlib): Fix field index.
21906
21907 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
21908
21909         * icall.c: Applied patch from Todd Berman (tbermann@gentoo.org). New
21910         GetGacPath icall.
21911
21912 2003-12-10  Bernie Solomon  <bernard@ugsolutions.com>
21913
21914         * process.c:  (ves_icall_System_Diagnostics_Process_GetWorkingSet_internal
21915         ves_icall_System_Diagnostics_Process_SetWorkingSet_internal):
21916         cope with sizeof(size_t) != sizeof(guint32).
21917
21918 2003-12-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21919
21920         * process.[ch]: the 'pid' field in MonoProcInfo stores GetLastError
21921         in case of failure.
21922
21923 2003-12-10  Mark Crichton <crichton@gimp.org>
21924
21925         * icall.c: removed the GetNonZeroBytes.  We now handle this case
21926         in managed code.
21927
21928         * rand.c, rand.h: Same here.  Also cleaned up the clode slightly.
21929
21930 Tue Dec 9 15:36:18 CET 2003 Paolo Molaro <lupus@ximian.com>
21931
21932         * class.h, class.c, icall.c, marshal.c, object.c: ignore fields
21933         marked as deleted.
21934
21935 2003-12-09  Zoltan Varga  <vargaz@freemail.hu>
21936
21937         * verify.c (check_corlib): Handle the case when the version field is 
21938         initialized by a static constructor.
21939
21940 2003-12-08  Patrik Torstensson  <p@rxc.se>
21941
21942     * rand.c (InternalGetBytes): Implemented win32 version with cryptapi
21943
21944 2003-12-08  Martin Baulig  <martin@ximian.com>
21945
21946         * icall.c (ves_icall_TypeBuilder_define_generic_parameter): Return
21947         a MonoReflectionGenericParameter, also take the parameter index
21948         and name as arguments.
21949         (ves_icall_MethodBuilder_define_generic_parameter): Likewise.
21950         (ves_icall_MonoGenericParam_initialize): New interncall.
21951         (ves_icall_Type_make_byref_type): New interncall.
21952
21953         * reflection.h (MonoReflectionGenericParam): Derive from
21954         MonoReflectionType, not just from MonoObject.  Added `refobj' and
21955         `index' fields.
21956
21957         * reflection.c (mono_reflection_define_generic_parameter): Create
21958         and return a new MonoReflectionGenericParam; don't initialize the
21959         constraints here.
21960         (mono_reflection_initialize_generic_parameter): New public method;
21961         initializes the constraints and creates the `param->pklass'.
21962
21963 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
21964
21965         * reflection.h reflection.c: Use the new fields 'num_types', 
21966         'num_fields' and 'num_methods' to track the number of types etc.
21967
21968         * verify.c (check_corlib): Check corlib version number.
21969
21970 2003-12-07  Zoltan Varga  <vargaz@freemail.hu>
21971
21972         * marshal.c (mono_marshal_method_from_wrapper): Remove assert so this
21973         function works on all methods.
21974
21975 2003-12-07  Lluis Sanchez Gual  <lluis@ximian.com>
21976
21977         * domain.c, loader.h: Added IRemotingTypeInfo interface in MonoDefaults.
21978         * icall.c: in, ves_icall_Remoting_RealProxy_GetTransparentProxy set
21979         the custom_type_info flag of the transparent proxy.
21980         * object.c: Added method mono_object_isinst_mbyref for casting mbyref
21981         objects that supports IRemotingTypeInfo.
21982         * object.h: Added custom_type_info field in transparent proxy.
21983
21984 2003-12-06  Martin Baulig  <martin@ximian.com>
21985
21986         * class.c (mono_class_create_from_generic): Removed.
21987         (mono_class_from_generic): Check `ginst->klass' before doing
21988         anything else.  This is important to fully support "recursive"
21989         generic types.
21990
21991         * metadata.c (do_mono_metadata_parse_generic_inst): Create an
21992         empty `generic_inst->klass' before doing anything else.
21993
21994 2003-12-06  Dick Porter  <dick@ximian.com>
21995
21996         * verify.c: 
21997         * object.h:
21998         * icall.c:
21999         * locales.c: Use C structs to access class fields.  Don't do a
22000         conversion between MonoString and UChar because both are
22001         platform-endian UTF-16.  Compare now takes startindex and count
22002         parameters.  Add a char overload for IndexOf.  Speed up the
22003         invariant string IndexOf.
22004
22005 2003-12-05  Zoltan Varga  <vargaz@freemail.hu>
22006
22007         * Makefile.am (monosn_LDADD): Fix parallel build.
22008
22009 2003-12-04  Martin Baulig  <martin@ximian.com>
22010
22011         * icall.c
22012         (ves_icall_type_GetTypeCode): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
22013         (ves_icall_Type_make_array_type): New interncall.       
22014
22015 2003-12-04  Martin Baulig  <martin@ximian.com>
22016
22017         * locales.c: also change it in the !HAVE_ICU case.
22018
22019 2003-12-04  Dick Porter  <dick@ximian.com>
22020
22021         * icall.c:
22022         * locales.c: construct_compareinfo is now in CompareInfo, not
22023         CultureInfo.
22024
22025 2003-12-04  Zoltan Varga  <vargaz@freemail.hu>
22026
22027         * image.c (mono_image_load_file_for_image): Cache loaded images in the
22028         image->files array.
22029
22030         * image.c (load_class_name): Load class names from the EXPORTEDTYPES
22031         table as well.
22032
22033         * assembly.c (mono_assembly_load_references): Only load references
22034         once.
22035
22036         * class.c (mono_class_from_name): Avoid linear search of the 
22037         EXPORTEDTYPE table.
22038
22039         * loader.c (mono_field_from_token): Cache lookups of fieldrefs as well.
22040
22041 2003-12-03  Zoltan Varga  <vargaz@freemail.hu>
22042
22043         * image.h (MonoImage): Add 'field_cache' field.
22044
22045         * loader.c (mono_field_from_token): Cache field lookups.
22046         
22047         * reflection.c (mono_module_get_object): Fix name property.
22048
22049         * icall.c (ves_icall_get_enum_info): Update after changes to 
22050         mono_metadata_get_constant_index ().
22051
22052         * icall.c: Get rid of get_type_info icall, use a separate icall for
22053         each type property to avoid needless memory allocations. Fixes #51514.
22054
22055         * metadata.c (mono_metadata_get_constant_index): Add a 'hint' parameter
22056         to avoid needless binary searches.
22057
22058         * class.c (class_compute_field_layout): Move the initialization of
22059         field->def_value to mono_class_vtable ().
22060
22061         * class.c (mono_class_layout_fields): Enable GC aware auto layout for
22062         non-corlib types.
22063
22064         * object.c (mono_object_allocate): Make it inline.
22065
22066         * object.c (mono_object_allocate_spec): Make it inline.
22067         
22068 2003-12-02  Dick Porter  <dick@ximian.com>
22069
22070         * locales.c (create_NumberFormat): NumberFormatInfo construction.
22071         Patch by Mohammad DAMT (mdamt@cdl2000.com).
22072
22073 2003-12-01  Dick Porter  <dick@ximian.com>
22074
22075         * threads.c: Fix signature and call in CreateMutex and
22076         CreateEvent.
22077
22078 2003-12-01  Dick Porter  <dick@ximian.com>
22079
22080         * icall.c: 
22081         * locales.c: Implement string compares and searching
22082
22083         * object.h: Add extra Thread field
22084
22085 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
22086
22087         * reflection.c (fixup_method): Add support for MonoCMethod.
22088
22089 2003-11-28  Zoltan Varga  <vargaz@freemail.hu>
22090
22091         * gc.c: Fix hangs and error messages when GC_DONT_GC is set.
22092
22093         * reflection.c (assembly_name_to_aname): Allow extra characters in
22094         assembly names. Fixes #51468.
22095
22096 2003-11-26  Zoltan Varga  <vargaz@freemail.hu>
22097
22098         * exception.c (mono_exception_from_name_domain): New helper function.
22099
22100         * appdomain.c (ves_icall_System_AppDomain_createDomain): Create the
22101         exception object in the correct domain.
22102
22103         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw): Fix 
22104         formatting + make a copy a the input data.
22105
22106         * loader.c (mono_get_method_from_token): Methods which contain
22107         native code do not have entries in the ImplMap.
22108
22109         (ves_icall_System_AppDomain_LoadAssemblyRaw): Fix exception throw.
22110         Thanks to Gonzalo for spotting this.
22111         
22112         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw): Applied
22113         patch from ztashev@openlinksw.co.uk (Zdravko Tashev). New icall.
22114
22115         * assembly.h (mono_assembly_load_from): Split the second part of 
22116         assembly loading into a new public function.
22117
22118         * exception.h (mono_get_exception_bad_image_format): New function.
22119
22120 2003-11-24  Zoltan Varga  <vargaz@freemail.hu>
22121
22122         icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
22123         Enumerate all modules inside a dynamic assembly. Fixes #51293.
22124         
22125         * icall.c: Add new icall for creating dynamic methods.
22126
22127         * loader.h debug-helpers.c: Add new wrapper type for dynamic methods.
22128
22129         * reflection.h (MonoReflectionDynamicMethod): Fix type of bool fields.
22130
22131         * reflection.c (mono_reflection_create_dynamic_method): New icall to
22132         create a dynamic method.
22133
22134         * reflection.c (resolve_object): New helper function.
22135
22136         * reflection.c: Generalize ReflectionMethodBuilder and the functions
22137         which manipulate it so they can also work on dynamic methods.
22138
22139         * reflection.c (reflection_method_builder_to_mono_method): Avoid 
22140         creating the MonoReflectionMethodAux structure if it is not needed.
22141         
22142         * reflection.h verify.c: Update after changes to object layout.
22143
22144         * reflection.c (method_builder_encode_signature): Fix compilation on
22145         gcc 2.95.x.
22146
22147 2003-11-21  Lluis Sanchez Gual  <lluis@ximian.com>
22148
22149         * appdomain.h: Added support for context static fields. Added static_data
22150           field to MonoAppContext and renamed thread_static_fields to a more
22151           generic special_static_fields in MonoAppDomain, since it can now contain
22152           context static fields.
22153         * domain.c: Updated hashtable name.
22154         * object.c: Replaced field_is_thread_static() for a more generic
22155           field_is_special_static() which also checks for context static attribute.
22156           In mono_class_vtable(), added support for static context fields.
22157         * threads.c: Changed methods that manage thread static fields to more
22158           generic methods so they can be reused both for thread and context static
22159           data.
22160         * threads.h: Declared some new methods.
22161
22162 2003-11-21  Zoltan Varga  <vargaz@freemail.hu>
22163
22164         * reflection.h: Update after changes to the managed types.
22165
22166         * reflection.c (encode_custom_modifiers): New helper function.
22167
22168         * reflection.c (method_encode_signature): Emit custom modifiers.
22169
22170         * reflection.c (field_encode_signature): Emit custom modifiers.
22171
22172 2003-11-18  Zoltan Varga  <vargaz@freemail.hu>
22173
22174         * reflection.h (MonoReflectionAssemblyName): Applied patch from Laurent Morichetti (l_m@pacbell.net). Fix type of 'flags' field.
22175
22176         * icall.c (ves_icall_System_ValueType_Equals): New optimized 
22177         implementation.
22178
22179         * icall.c (ves_icall_System_ValueType_InternalGetHashCode): New 
22180         icall.
22181
22182         * object.c (mono_field_get_value_object): New function.
22183
22184         * object.c appdomain.h appdomain.c: Make out_of_memory_ex domain
22185         specific.
22186
22187 2003-11-17  Zoltan Varga  <vargaz@freemail.hu>
22188
22189         * appdomain.c (mono_runtime_get_out_of_memory_ex): New function to
22190         return a preallocated out-of-memory exception instance.
22191
22192         * object.c (out_of_memory): Use the new function.
22193
22194         * metadata.c (mono_metadata_parse_type): Handle the case when the byref
22195         flag is before the custom modifiers. Fixes #49802.
22196
22197 2003-11-16  Martin Baulig  <martin@ximian.com>
22198
22199         * class.c (mono_class_is_open_constructed_type): Implemented the
22200         MONO_TYPE_GENERICINST case.
22201
22202 2003-11-16  Zoltan Varga  <vargaz@freemail.hu>
22203
22204         * assembly.c (mono_assembly_fill_assembly_name): New function to
22205         fill out the MonoAssemblyName structure.
22206         (mono_assembly_open): Use the new function.
22207
22208         * icall.c (fill_reflection_assembly_name): New helper function.
22209
22210         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Use the
22211         new function.
22212
22213         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): New icall.
22214
22215 2003-11-15  Martin Baulig  <martin@ximian.com>
22216
22217         * class.c (mono_class_is_open_constructed_type): New public
22218         function; checks whether a type is an open constructed type,
22219         ie. whether it still contains type parameters.
22220         (mono_class_inflate_generic_type): If we're a type parameter and
22221         the inflated type is also a MONO_TYPE_(M)VAR, return the original
22222         type.
22223
22224         * class.h (MonoGenericInst): Added `guint32 is_open'.
22225
22226         * loader.c (method_from_methodspec): Check whether we're an open
22227         or closed constructed type and set `ginst->is_open'.
22228
22229         * reflection.c (mono_reflection_bind_generic_parameters): Check
22230         whether we're an open or closed constructed type and set
22231         `ginst->is_open'.
22232         (mono_reflection_inflate_method_or_ctor): Don't inflate methods
22233         from open constructed types.
22234
22235 2003-11-15  Martin Baulig  <martin@ximian.com>
22236
22237         * reflection.c (mono_reflection_bind_generic_parameters): If we're
22238         a generic instance (instead of a generic type declaration) with
22239         unbound generic parameters, bind them to our actual types.
22240
22241 2003-11-14  Martin Baulig  <martin@ximian.com>
22242
22243         * reflection.h (MonoReflectionGenericInst): Added `MonoArray *interfaces'.
22244
22245         * reflection.c (mono_reflection_bind_generic_parameters): If we're
22246         an interface type, populate `res->interfaces' with instantiated
22247         versions of all the interfaces we inherit.
22248
22249 2003-11-13  Aleksey Demakov  <avd@openlinksw.com>
22250
22251         * assembly.c (mono_assembly_load): Fixed problem finding mscorlib.dll
22252         when MONO_PATH is set but doesn't contain the install dir.
22253
22254 2003-11-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22255
22256         * icall.c:
22257         (ves_icall_Type_GetInterfaces): don't return an interface twice when
22258         it's also implemented in base classes. Fixes bug #50927.
22259
22260 2003-11-13  Zoltan Varga  <vargaz@freemail.hu>
22261
22262         * gc.c (ves_icall_System_GC_WaitForPendingFinalizers): Avoid deadlocks
22263         if this method is called from a finalizer. Fixes #50913.
22264
22265 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
22266
22267         * threads.c: Implement VolatileRead/VolatileWrite
22268
22269         * icall.c: Add new icalls for VolatileRead/VolatileWrite
22270
22271 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
22272
22273         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Applied 
22274         patch from Danilo Sagan (dsegan@gmx.net). Fix compilation under gcc
22275         2.95.3.
22276
22277         * assembly.c (mono_assembly_open): Fix windows build. Applied patch 
22278         from Peter Ross (pro@missioncriticalit.com).
22279         
22280 2003-11-12  Lluis Sanchez Gual  <lluis@ximian.com>
22281
22282         * icall.c: Added internal call for System.Environment::GetMachineConfigPath
22283
22284 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
22285
22286         * assembly.c (mono_assembly_load_references): Disable check because it
22287         triggers on older corlibs which lots of people have.
22288
22289 2003-11-12  Jackson Harper  <jackson@ximian.com>
22290
22291         * assembly.c: Change corlib name to mscorlib. Add a temp. hack to
22292         load corlib.dll if mscorlib.dll is not found.
22293         * assembly.h: Remove corlib name define.
22294         * class.c:
22295         * domain.c:
22296         * image.c: Change corlib name to mscorlib.
22297         
22298 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
22299
22300         * debug-mono-symfile.c: Add patch from FreeBSD ports tree.
22301
22302 2003-11-11  Miguel de Icaza  <miguel@ximian.com>
22303
22304         * appdomain.h: Added loader_optimization here to sync with the C#
22305         code, and add disallow_binding_redirects field.
22306
22307 2003-11-11  Zoltan Varga  <vargaz@freemail.hu>
22308
22309         * mono-debug.c (mono_debug_add_method): Ignore unknown modules.
22310
22311         * reflection.c (mono_image_build_metadata): Fix crash on modules
22312         with no types.
22313
22314         * reflection.h (MonoMethodInfo): Track changes to the managed structure.
22315
22316         * icall.c (ves_icall_get_method_info): Return callingConvention as
22317         well.
22318
22319         * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces): Add 
22320         namespaces from the EXPORTEDTYPE table as well.
22321
22322         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Merge types
22323         from all modules inside the assembly.
22324         
22325 2003-11-11  Martin Baulig  <martin@ximian.com>
22326
22327         * reflection.c (mono_reflection_bind_generic_parameters): Make
22328         this work for interfaces.
22329
22330 2003-11-11  Martin Baulig  <martin@ximian.com>
22331
22332         * mono-debug.c (mono_debug_add_type): Ignore unknown modules.
22333
22334 2003-11-11  Martin Baulig  <martin@ximian.com>
22335
22336         * reflection.c (mono_reflection_inflate_method_or_ctor): Allow
22337         "MonoInflatedMethod" and "MonoInflatedCtor".
22338
22339 2003-11-11  Zoltan Varga  <vargaz@freemail.hu>
22340
22341         * reflection.c (resolution_scope_from_image): Use the assembly table
22342         from the manifest module, since other modules don't have it.
22343
22344         * debug-helpers.c (mono_type_full_name): New helper function.
22345
22346         * image.h (MonoAssembly): Change 'dynamic' to a boolean.
22347
22348         * image.c (mono_image_load_file_for_image): New public function which
22349         is a replacement for the load_file_for_image in class.c.
22350
22351         * assembly.c (mono_assembly_load_module): A wrapper for the function
22352         above which does assembly association and reference loading too.
22353
22354         * class.c (mono_class_from_name): Call mono_assembly_load_module.
22355
22356 2003-11-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22357
22358         * appdomain.c: not all of the attributes for the full assembly name
22359         are required and the order doesn't matter. Fixes bug #50787.
22360
22361 2003-11-10  Dick Porter  <dick@ximian.com>
22362
22363         * locales.c: Use platform-endian UTF16
22364
22365 2003-11-10  Zoltan Varga  <vargaz@freemail.hu>
22366
22367         * reflection.c: Emit FILE and EXPORTEDTYPE tables.
22368         
22369 2003-11-10  Martin Baulig  <martin@ximian.com>
22370
22371         * metadata.c
22372         (mono_metadata_load_generic_params): Make this actually work.
22373
22374         * reflection.c (mono_reflection_bind_generic_parameters): If our
22375         parent is a generic instance, pass all the `types' to it, no
22376         matter whether it has the same number of type parameters or not.
22377
22378 2003-11-10  Zoltan Varga  <vargaz@freemail.hu>
22379
22380         * reflection.c: Emit FILE and EXPORTEDTYPE tables.
22381
22382         * assembly.c (mono_assembly_load_references): Move the image<->assembly
22383         assignment code to this function so it gets called recursively for all
22384         modules.
22385
22386         * image.c (load_modules): Remove the assembly assignment since it is
22387         now done by mono_assembly_load_references.
22388         
22389         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
22390         Add 'module' argument.
22391         (mono_module_get_types): New helper function.
22392         (ves_icall_System_Reflection_Module_InternalGetTypes): New icall.
22393
22394 2003-11-08  Martin Baulig  <martin@ximian.com>
22395
22396         * class.c (mono_class_inflate_generic_method): Interface method
22397         don't have a header.
22398
22399         * reflection.c (mono_image_get_methodspec_token): Take an
22400         additional `MonoGenericInst *' argument instead of reading it from
22401         the header; this is necessary to support interfaces.
22402         (mono_image_create_token): Pass the `MonoGenericInst *' from the
22403         MonoReflectionInflatedMethod to mono_image_get_methodspec_token().
22404         (inflated_method_get_object): Take an additional `MonoGenericInst *'
22405         argument.
22406
22407         * reflection.h (MonoReflectionInflatedMethod): Added
22408         `MonoGenericInst *ginst'.
22409
22410 2003-11-07  Zoltan Varga  <vargaz@freemail.hu>
22411
22412         * gc.c (mono_domain_finalize): Fix compilation for no GC case.
22413
22414 2003-11-06  Zoltan Varga  <zovarga@ws-zovarga2>
22415
22416         * appdomain.c (mono_domain_unload): Add a workaround for bug #27663.
22417
22418 2003-11-06  Zoltan Varga  <vargaz@freemail.hu>
22419
22420         * reflection.c 
22421         (reflection_methodbuilder_from_method_builder):
22422         (reflection_methodbuilder_from_ctor_builder): New helper functions to 
22423         initialize a ReflectionMethodBuilder structure.
22424         (mono_image_get_methodbuilder_token):
22425         (mono_image_get_ctorbuilder_token): New functions to emit memberref
22426         tokens which point to types in another module inside the same assembly.
22427
22428         * reflection.c: Use the new helper functions.
22429         
22430         * reflection.c (mono_image_basic_init): Initialize basedir and culture.
22431
22432         * icall.c loader.c reflection.c: Use ModuleBuilder->dynamic_image 
22433         instead of AssemblyBuilder->dynamic_assembly in the appropriate places.
22434
22435         * reflection.c (resolution_scope_from_image): Emit a moduleref if
22436         neccesary.
22437
22438         * reflection.c (mono_image_build_metadata): Emit metadata only for the
22439         current module. Emit the manifest only for the main module.
22440
22441         * reflection.c (mono_image_create_token): Add assertion when a 
22442         memberref needs to be created.
22443
22444         * reflection.c reflection.h (MonoDynamicAssembly): Remove unused fields.
22445
22446         * reflection.c (mono_reflection_get_custom_attrs_blob): Allocate a 
22447         larger buffer for the custom attribute blob. Fixes #50637.
22448         
22449 2003-11-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22450
22451         * threadpool.c: notify listener on async processing handles after
22452         invoking the async callback. Thanks to Zoltan.
22453
22454 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
22455
22456         * reflection.c (create_dynamic_mono_image): Call mono_image_init to 
22457         avoid code duplication.
22458
22459         * reflection.h (MonoDynamicImage): New type which is currently unused,
22460         but will be used through the ref.emit code in place of 
22461         MonoDynamicAssembly.
22462
22463         * reflection.h (MonoReflectionAssemblyBuilder): Track changes to the
22464         object layout.
22465
22466         * reflection.c (create_dynamic_mono_image): Rewrote so it now creates
22467         a MonoDynamicImage instead of just a MonoImage.
22468         
22469         * reflection.h reflection.c icall.c: Move nearly all AssemblyBuilder
22470         icalls to ModuleBuilder but keep their semantics, so they will work
22471         with moduleb->assemblyb. This will change later.
22472         
22473 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
22474
22475         * reflection.h (MonoReflectionAssemblyBuilder): Track changes to the
22476         object layout.
22477
22478         * reflection.c (mono_image_build_metadata): Avoid creation of a default
22479         main module, since it is now done by the managed code.
22480
22481 2003-11-03  Martin Baulig  <martin@ximian.com>
22482
22483         * reflection.c (mono_reflection_inflate_method_or_ctor): Set
22484         `ginst->klass' here.
22485         (method_encode_methodspec): Don't use the `ginst->generic_method's
22486         klass if it's a generic instance, use `ginst->klass' in this case.
22487
22488 2003-11-03  Martin Baulig  <martin@ximian.com>
22489
22490         * reflection.c (mono_image_get_generic_method_param_info):
22491         Removed, use mono_image_get_generic_param_info() instead.
22492         (mono_image_get_type_info): Write the GenericParam table before
22493         the Method table.  This is neccessary because in the GenericParam
22494         table, type parameters of the class (ie. '!0' etc.) must come
22495         before the ones from its generic methods (ie. '!!0' etc).
22496
22497 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
22498
22499         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Fill out AssemblyName->codebase. Fixes #50469.
22500
22501 2003-11-02  Martin Baulig  <martin@ximian.com>
22502
22503         * reflection.c (create_generic_typespec): Take a
22504         `MonoReflectionTypeBuilder *' instead of a `MonoType *' and get
22505         the generic parameters from it.
22506
22507 2003-11-02  Martin Baulig  <martin@ximian.com>
22508
22509         * reflection.c (fieldref_encode_signature): Take a `MonoType *'
22510         instead of a `MonoClassField *' since we just need the type.
22511         (create_generic_typespec): New static function.  Creates a
22512         TypeSpec token for a generic type declaration.
22513         (mono_image_get_generic_field_token): New static function.
22514         (mono_image_create_token): If we're a FieldBuilder in a generic
22515         type declaration, call mono_image_get_generic_field_token() to get
22516         the token.
22517
22518 2003-11-02  Martin Baulig  <martin@ximian.com>
22519
22520         * reflection.h
22521         (MonoReflectionInflatedMethod, MonoReflectionInflatedField): Added
22522         `MonoReflectionGenericInst *declaring_type' and
22523         `MonoReflectionGenericInst *reflected_type' fields.
22524
22525         * reflection.c (mono_reflection_inflate_method_or_ctor): Take a
22526         `MonoReflectionGenericInst *declaring_type' and a
22527         `MonoReflectionGenericInst *reflected_type' argument instead of a
22528         single `MonoReflectionGenericInst *type' one.  Set
22529         `res->declaring_type' and `res->reflected_type' from them.
22530         (mono_reflection_inflate_field): Likewise.      
22531
22532 2003-11-02  Martin Baulig  <martin@ximian.com>
22533
22534         * class.c (mono_class_setup_vtable): Don't store generic methods
22535         in the vtable.  
22536
22537 2003-11-02  Martin Baulig  <martin@ximian.com>
22538
22539         * reflection.h (MonoReflectionGenericInst): Added
22540         `MonoReflectionType *declaring_type'.
22541
22542         * reflection.c (mono_reflection_bind_generic_parameters): Use
22543         `if (tb->parent)' instead of `klass->parent'.
22544
22545 2003-11-01  Zoltan Varga  <vargaz@freemail.hu>
22546
22547         * assembly.c (mono_assembly_open): Avoid crash if a module is loaded
22548         with an empty ASSEMBLY table.
22549
22550         * reflection.c (mono_image_build_metadata): Avoid using the same loop
22551         variable in the inner and outer loops.
22552
22553 2003-10-31  Zoltan Varga  <vargaz@freemail.hu>
22554
22555         * metadata.h (mono_metadata_make_token): Put parentheses around macro
22556         argument.
22557
22558         * appdomain.h appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRef): Fix signature.
22559         
22560         * appdomain.c appdomain.h icall.c: Get rid of the InvokeInDomain 
22561         icalls. Instead, do everything in managed code. This is needed since
22562         it is hard to restore the original domain etc. in unmanaged code in the
22563         presence of undeniable exceptions.
22564
22565         * appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRef): 
22566         New icalls to push and pop appdomain refs.
22567
22568 2003-10-31  Martin Baulig  <martin@ximian.com>
22569
22570         * class.c (inflate_generic_type): Renamed to
22571         mono_class_inflate_generic_type() and made it public.
22572
22573         * icall.c ("System.Reflection.MonoGenericInst::inflate_field"):
22574         New interncall.
22575
22576         * loader.c (mono_field_from_memberref): Also set the retklass for
22577         typespecs.
22578
22579         * fielder.c (mono_image_get_inflated_field_token): New static
22580         method; creates a metadata token for an inflated field.
22581         (mono_image_create_token, fixup_method): Added support for
22582         "MonoInflatedField".
22583         (fieldbuilder_to_mono_class_field): New static function.
22584         (mono_reflection_inflate_field): New public function.
22585
22586         * reflection.h
22587         (MonoReflectionGenericInst): Added `MonoArray *fields'.
22588         (MonoReflectionInflatedField): New typedef.     
22589
22590 2003-10-30  Bernie Solomon  <bernard@ugsolutions.com>
22591
22592         * socket-io.c (in6_addr ipaddress_to_struct_in6_addr): fix
22593         for Solaris and other platforms without s6_addr16
22594
22595 2003-10-30  Martin Baulig  <martin@ximian.com>
22596
22597         * class.c (inflate_generic_type): Take just one `MonoGenericInst *'
22598         argument instead of two.
22599         (mono_class_inflate_generic_signature): Likewise.
22600         (inflate_generic_header): Likewise.
22601         (mono_class_inflate_generic_method): Likewise.  In addition, if
22602         `ginst->klass' is set, it becomes the new `method->klass'.
22603
22604         * class.h (MonoGenericInst): Removed the `gpointer mbuilder'
22605         field.
22606
22607         * reflection.c (encode_generic_method_sig): Write a 0xa as the
22608         first byte. [FIXME]
22609         (method_encode_methodspec): If we have generic parameters, create
22610         a MethodSpec instead of a MethodRef.
22611         (fixup_method): Added support for "MonoInflatedMethod" and
22612         "MonoInflatedCtor".
22613         (mono_image_create_token): Added support for "MonoInflatedMethod"
22614         and "MonoInflatedCtor".
22615         (inflated_method_get_object): New static function; returns a
22616         managed "System.Reflection.MonoInflatedMethod" object.
22617         (mono_reflection_bind_generic_method_parameters): Return a
22618         `MonoReflectionInflatedMethod' instead of a `MonoReflectionMethod'.
22619         (mono_reflection_inflate_method_or_ctor): Likewise.
22620         (mono_image_get_generic_method_param_info): Initialize unused
22621         fields to zero.
22622         (mono_image_get_generic_param_info): Likewise.
22623
22624         * reflection.h (MonoReflectionInflatedMethod): New public
22625         typedef.  Corresponds to the managed "S.R.MonoInflatedMethod" and
22626         "S.R.MonoInflatedCtor" classes.
22627
22628         * loader.c (method_from_memberref): If we're a TypeSpec and it
22629         resolves to a generic instance, inflate the method.
22630
22631 2003-10-28  Dick Porter  <dick@ximian.com>
22632
22633         * object.c (mono_runtime_run_main): Convert command-line arguments
22634         into utf8, falling back to the user's locale encoding to do so.
22635
22636 2003-10-27  Zoltan Varga  <vargaz@freemail.hu>
22637
22638         * loader.c (mono_get_method_from_token): Avoid looking up the icalls
22639         at this time.
22640
22641         * marshal.c (mono_marshal_get_native_wrapper): Lookup icalls here.
22642
22643         * reflection.c (reflection_methodbuilder_to_mono_method): Avoid looking
22644         up icalls at method definition time. Partially fixes #33569.
22645
22646 2003-10-25  Zoltan Varga  <vargaz@freemail.hu>
22647
22648         * marshal.c (mono_marshal_get_native_wrapper): Add support for [Out]
22649         marshalling of arrays. Fixes #50116.
22650
22651         * appdomain.c (ves_icall_System_AppDomain_InternalIsFinalizingForUnload): New icall.
22652
22653         * appdomain.c (unload_thread_main): Clear class->cached_vtable if it
22654         points to a vtable in the dying appdomain.
22655
22656         * appdomain.c (mono_domain_unload): Move the notification of OnUnload
22657         listeners into unmanaged code inside the lock.
22658
22659         * object.c (mono_class_vtable): Turn off typed allocation in non-root
22660         domains and add some comments.
22661
22662 2003-10-25  Martin Baulig  <martin@ximian.com>
22663
22664         * class.h (MonoGenericInst): Added `MonoClass *klass' field.
22665
22666         * image.h (MonoImage): Added `GHashTable *typespec_cache'.
22667
22668         * metadata.c (mono_metadata_parse_generic_inst): Renamed to
22669         `do_mono_metadata_parse_generic_inst'; pass it the MonoType we're
22670         currently parsing.  Create the generic class and store it in
22671         `generic_inst->klass' before parsing the type arguments.  This is
22672         required to support "recursive" definitions; see mcs/tests/gen-23.cs
22673         for an example.
22674         (mono_type_create_from_typespec): Use a new `image->typespec_cache'
22675         to support recursive typespec entries.
22676
22677         * class.c (mono_class_setup_parent): If our parent is a generic
22678         instance, we may get called before it has its name set.
22679         (mono_class_from_generic): Splitted into
22680         mono_class_create_from_generic() and mono_class_initialize_generic().
22681
22682 2003-10-25  Martin Baulig  <martin@ximian.com>
22683
22684         * icall.c (ves_icall_Type_BindGenericParameters): Return a
22685         `MonoReflectionGenericInst *' instead of a `MonoReflectionType *'.
22686         ("System.Reflection.MonoGenericInst::inflate_method"): New interncall.
22687         ("System.Reflection.MonoGenericInst::inflate_ctor"): New interncall.
22688
22689         * reflection.c (my_mono_class_from_mono_type): Added MONO_TYPE_GENERICINST.
22690         (create_typespec): Likewise.
22691         (mono_reflection_bind_generic_parameters): Return a
22692         `MonoReflectionGenericInst *' instead of a `MonoClass *'.
22693         (mono_reflection_inflate_method_or_ctor): New public function.
22694
22695         * reflection.h (MonoReflectionGenericInst): New typedef.        
22696
22697 2003-10-24  Zoltan Varga  <vargaz@freemail.hu>
22698
22699         * object.c (mono_class_proxy_vtable): Run the whole vtable construction
22700         inside the domain lock. Fixes #49993.
22701         
22702         * object.c (mono_class_vtable): When typed allocation is used, 
22703         allocate vtables in the GC heap instead of in the mempool, since the
22704         vtables contain GC descriptors which are used by the collector even
22705         after the domain owning the mempool is unloaded.
22706
22707         * domain.c (mono_domain_set): Rename to mono_domain_set_internal.
22708
22709         * domain.c (mono_domain_unload): Rename to mono_domain_free to better
22710         reflect what it does. Also invalidate mempools instead of freeing
22711         them if a define is set.
22712
22713         * appdomain.h (MonoAppDomainState): New enumeration to hold the state
22714         of the appdomain.
22715         
22716         * appdomain.h (_MonoDomain): New field 'finalizable_object_hash' to
22717         hold the finalizable objects in this domain.
22718
22719         * appdomain.h (_MonoDomain): New field 'state' to hold the state of the
22720         appdomain.
22721
22722         * appdomain.c (mono_domain_set): New function to set the current
22723         appdomain, but only if it is not being unloaded.
22724
22725         * appdomain.c threads.c threadpool.c object.c: Avoid entering an
22726         appdomain which is being unloaded.
22727         
22728         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Prevent
22729         unloading of the root appdomain.
22730
22731         * appdomain.c (ves_icall_System_AppDomain_InternalInvokeInDomain): New
22732         icall to execute a method in another appdomain. Intended as a 
22733         replacement for InternalSetDomain, which can confuse the code 
22734         generation in the JIT.
22735
22736         * appdomain.c (mono_domain_is_unloading): New function to determine
22737         whenever an appdomain is unloading.
22738
22739         * appdomain.c (mono_domain_unload): New function to correctly unload
22740         an appdomain.
22741
22742         * assembly.c (mono_assembly_load_references): Check that an assembly
22743         does not references itself.
22744
22745         * gc.c (mono_domain_finalize): Rewrote so instead of finalizing a
22746         domain manually, it asks the finalizer thread to do it, then waits for
22747         the result. Also added a timeout.
22748
22749         * icall.c: Register the new icalls.
22750
22751         * threads.h threads.c: Export the mono_gc_stop_world and 
22752         mono_gc_start_world functions.
22753         
22754         * mempool.h mempool.c (mono_mempool_invalidate): New debugging 
22755         function to fill out the mempool with 0x2a.
22756
22757 2003-10-22  Zoltan Varga  <vargaz@freemail.hu>
22758
22759         * reflection.h (MonoReflectionMethodAux): New structure to store
22760         information which is rarely used, thus is not in the MonoMethod
22761         structure.
22762
22763         * reflection.h (MonoDynamicAssembly): New field 'method_aux_hash' to
22764         store the aux info.
22765
22766         * reflection.c (mono_methodbuilder_to_mono_method): Store param names
22767         and marshalling info into the aux structure.
22768
22769         * loader.c (mono_method_get_marshal_info): Retrieve the marshal info
22770         from the aux structure.
22771
22772         * loader.c (mono_method_get_param_names): Retrieve the param names from
22773         the aux structure.
22774         
22775 2003-10-21  Zoltan Varga  <vargaz@freemail.hu>
22776
22777         * exception.h exception.c: Add AppDomainUnloadedException && fix 
22778         warning.
22779
22780 2003-10-21  Dick Porter  <dick@ximian.com>
22781
22782         * socket-io.c
22783         (ves_icall_System_Net_Sockets_Socket_Select_internal): Applied
22784         patch from Laramie Leavitt moving divide out of loop. (Bug 45381).
22785
22786 2003-10-21  Martin Baulig  <martin@ximian.com>
22787
22788         * reflection.c (mono_reflection_bind_generic_parameters):
22789         `klass->parent' is NULL for interfaces.
22790
22791 2003-10-21  Martin Baulig  <martin@ximian.com>
22792
22793         * reflection.c (create_typespec): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
22794
22795 2003-10-20  Zoltan Varga  <vargaz@freemail.hu>
22796
22797         * exception.c (mono_exception_from_name_msg): New helper function for
22798         creating exceptions and initializing their message field.
22799
22800         * exception.c: Simplify functions using the new helper.
22801
22802         * exception.h exception.c (mono_get_exception_cannot_unload_appdomain):
22803         New function.
22804
22805         * object.h object.c: Remove G_GNUC_NORETURN from the signature of
22806         mono_raise_exception, since otherwise gcc doesn't generate the function
22807         epilog for raise_exception, confusing the stack unwinding in the JIT.
22808         Fixes #45043.
22809
22810         * rawbuffer.c (mono_raw_buffer_load_mmap): Map mmap-ed memory with
22811         PROT_EXEC. This seems to prevent segmentation faults on Fedora Linux.
22812         Fixes #49499.
22813
22814 2003-10-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22815
22816         * icall.c: OutputDebugStringW expects 16-bit unicode characters, not
22817         utf8.
22818
22819 2003-10-18  Lluis Sanchez Gual  <lluis@ximian.com>
22820
22821         * icall.c: Removed GetUninitializedObject method because
22822           AllocateUninitializedClassInstance does the same.
22823
22824 2003-10-18  Martin Baulig  <martin@ximian.com>
22825
22826         * class.c (inflate_generic_signature): Renamed to
22827         mono_class_inflate_generic_signature() and made it public.
22828         (my_mono_class_from_generic_parameter): New static function; if we
22829         don't already have the generic parameter's MonoClass, create a
22830         very simple one which is just used internally in the runtime and
22831         not passed back to managed code.
22832
22833         * class.h (MonoGenericInst): Added `gpointer mbuilder' field.
22834
22835         * metadata.h (MonoMethodSignature): Moved the
22836         `MonoGenericParam *gen_params' to the MonoMethodHeader.
22837         (MonoMethodHeader): Moved the `MonoGenericParam *gen_params' here.
22838
22839         * icall.c (ves_icall_MethodInfo_GetGenericArguments): Renamed to
22840         ves_icall_MonoMethod_GetGenericArguments(); this is now an
22841         interncall on the MonoMethod class, not on MethodInfo.
22842         (ves_icall_MethodInfo_BindGenericParameters): Removed, we're now
22843         calling mono_reflection_bind_generic_method_parameters() directly.
22844
22845         * loader.c (mono_method_get_signature): If this is a MethodSpec;
22846         return the already computed `method->signature'.
22847         (method_from_methodspec): New static function to load a method
22848         from a MethodSpec entry.
22849         (mono_get_method_from_token): Call the new method_from_methodspec()
22850         for MethodSpec tokens.  
22851         (mono_get_method_from_token): If we're a generic method, load the
22852         type parameters.
22853
22854         * reflection.c (mono_image_get_memberref_token): Allow
22855         MEMBERREF_PARENT_TYPEDEF here; this will be used in the MethodSpec
22856         table.
22857         (fixup_method): Added support for MONO_TABLE_METHODSPEC.
22858         (mono_image_create_token): First check whether it's a generic
22859         method (so we'd need to create a MethodSpec), then do the other
22860         two alternatives.
22861         (mono_reflection_bind_generic_method_parameters): Return a
22862         `MonoReflectionMethod *' instead of a `MonoMethod *'; we're now
22863         called directly from the interncall.
22864
22865 2003-10-17  Zoltan Varga  <vargaz@freemail.hu>
22866
22867         * reflection.c (load_public_key): Move loading of the public key
22868         into managed code.
22869
22870         * image.h (MonoAssemblyName): Add public_key and hash_alg fields.
22871
22872         * assembly.c (mono_assembly_open): Fill in public_key and hash_alg
22873         fields.
22874
22875         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Fill in
22876         culture, hash_alg and public_key. Fixes #49555.
22877
22878 2003-10-17  Martin Baulig  <martin@ximian.com>
22879
22880         * class.h (MonoGenericInst): Moved this declaration here and added
22881         `MonoMethod *generic_method'.
22882
22883         * icall.c
22884         (ves_icall_MethodInfo_GetGenericArguments): New interncall.
22885         (ves_icall_MethodInfo_BindGenericParameters): New interncall.
22886
22887         * metadata.c (mono_metadata_type_equal): Two types of
22888         MONO_TYPE_VAR or MONO_TYPE_MVAR equals if they have the same
22889         index; ie. don't compare the address of the `MonoGenericParam'
22890         structure.
22891         (mono_metadata_load_generic_params): Removed the `MonoMethod
22892         *method' argument.
22893
22894         * metadata.h (MonoGenericInst): Moved declaration to class.h.
22895         (MonoMethodHeader): Added `MonoGenericInst *geninst'.
22896
22897         * reflection.c (method_encode_signature): Encode the number of
22898         generic parameters.
22899         (encode_generic_method_sig): New static function.
22900         (method_encode_methodspec): New static function; creates an entry
22901         in the MethodSpec table for a generic method.
22902         (mono_image_get_methodspec_token): New static function.
22903         (mono_image_create_token): Call mono_image_get_methodspec_token()
22904         for generic methods.
22905         (mono_reflection_bind_generic_method_parameters): New public
22906         function.  Instantiates a generic method.
22907
22908 2003-10-16  Martin Baulig  <martin@ximian.com>
22909
22910         * metadata.h (MonoMethodSignature): Moved `MonoGenericParam
22911         *gen_params' here from MonoMethodHeader.
22912
22913         * metadata.c (mono_metadata_parse_method_signature): If we have
22914         generic parameters, initialize `method->gen_params' and then set
22915         the correct `type->data.generic_param' in all the parameters.
22916
22917 2003-10-16  Zoltan Varga  <vargaz@freemail.hu>
22918
22919         * threads.c (mono_threads_get_default_stacksize): New function to 
22920         return the default stacksize.
22921
22922         * gc.c (mono_gc_cleanup): Use a separate event for waiting for the
22923         termination of the finalizer thread, since the previous method had
22924         race conditions. Fixes #49628.
22925
22926         * gc.c (mono_gc_init): Use the same stacksize for the finalizer thread
22927         as for the other managed threads.
22928
22929 2003-10-16  Martin Baulig  <martin@ximian.com>
22930
22931         * class.c (inflate_generic_signature): Copy `generic_param_count'
22932         and `gen_params'.
22933
22934         * icall.c (ves_icall_MethodInfo_get_IsGenericMethodDefinition):
22935         New interncall.
22936
22937         * metadata.c (mono_metadata_parse_method_signature): Actually set
22938         the `method->generic_param_count' here.
22939         (mono_metadata_load_generic_params): Initialize `pklass' to NULL.
22940
22941 2003-10-15  Zoltan Varga  <vargaz@freemail.hu>
22942
22943         * object.h: Add a new field to TypedRef to simplify the implementation
22944         of the REFANY opcodes in the JIT.
22945
22946         * icall.c: Make use of the new field.
22947
22948         * metadata.c (mono_type_size): Compute the size of TYPEDBYREF types
22949         dynamically.
22950
22951 2003-10-15  Martin Baulig  <martin@ximian.com>
22952
22953         * class.c (mono_class_from_gen_param): Renamed to
22954         mono_class_from_generic_parameter() and moved most of the
22955         functionality from mono_reflection_define_generic_parameter()
22956         here; ie. we create a "real" class here.
22957         (mono_class_from_mono_type): Only allow MONO_TYPE_VAR and
22958         MONO_TYPE_MVAR if mono_class_from_generic_parameter() has
22959         previously been called.
22960
22961         * class.h (MonoGenericParam): Moved the declaration of this struct
22962         here from metadata.h and added `MonoMethod *method'.
22963
22964         * icall.c (ves_icall_MonoType_get_DeclaringMethod): New
22965         interncall.
22966
22967         * loader.c (mono_get_method_from_token): If we have any generic
22968         parameters, call mono_metadata_load_generic_params() to read them
22969         from the MONO_TABLE_GENERICPAR.
22970
22971         * metadata.c (mono_metadata_load_generic_params): Added
22972         `MonoMethod *method' argument which is used MONO_TYPE_MVAR.
22973
22974         * metadata.h (MonoMethodSignature): Replaced
22975         `MonoGenericInst *geninst' with `guint16 generic_param_count'.
22976         (MonoMethodHeader): Added `MonoGenericParam *gen_params'.
22977
22978         * reflection.c (mono_reflection_define_generic_parameter): Moved
22979         most of the functionality into the new
22980         mono_class_from_generic_parameter(); set the `method' field if
22981         we're a method parameter.       
22982
22983 2003-10-13 Bernie Solomon  <bernard@ugsolutions.com>
22984
22985         * marshal.c (emit_struct_conv): if native size is 0
22986         emit no code.
22987
22988 2003-10-14  Martin Baulig  <martin@ximian.com>
22989
22990         * icall.c: The generics API has changed in the spec since it was
22991         added to System.Type; these modifications make it match the spec
22992         again.
22993         (ves_icall_Type_GetGenericParameters): Renamed to
22994         `ves_icall_Type_GetGenericArguments'.
22995         (ves_icall_Type_get_IsGenericTypeDefinition): New interncall.
22996         (ves_icall_MonoType_get_HasGenericParameteres): Renamed to
22997         `ves_icall_MonoType_get_HasGenericArguments'.
22998         (ves_icall_MonoType_get_IsUnboundGenericParameter): Renamed to
22999         `ves_icall_MonoType_get_IsGenericParameter'.
23000         (ves_icall_MonoType_get_HasUnboundGenericParameters): Removed;
23001         this is no interncall anymore.
23002         (ves_icall_TypeBuilder_get_IsUnboundGenericParameter): Renamed to
23003         `ves_icall_TypeBuilder_get_IsGenericParameter'.
23004
23005 2003-10-14  Martin Baulig  <martin@ximian.com>
23006
23007         * reflection.c (mono_reflection_bind_generic_parameters): Also
23008         inflate generic methods if we're reading the class from IL.
23009
23010 2003-10-13  Martin Baulig  <martin@ximian.com>
23011
23012         * reflection.c (mono_reflection_define_generic_parameter): This
23013         method isn't called directly from the icall anymore; take a
23014         `MonoReflectionAssemblyBuilder *' so we can use this for type and
23015         method generic parameters.
23016         (ReflectionMethodBuilder): Added `MonoArray *generic_param'.
23017         (method_builder_encode_signature): Encode generic parameters.
23018         (mono_image_get_method_info): Write generic params to the
23019         MONO_TABLE_GENERICPARAM table.
23020
23021         * reflection.h (MonoReflectionMethodBuilder): Added
23022         `MonoArray *generic_params'.
23023
23024         * metadata.h (MonoMethodSignature): Added `MonoGenericInst *geninst'.
23025
23026         * icall.c (ves_icall_TypeBuilder_define_generic_parameter): Added
23027         wrapper for mono_reflection_define_generic_parameter().
23028         (ves_icall_MethodBuilder_define_generic_parameter): Likewise.   
23029
23030 2003-10-13  Zoltan Varga  <vargaz@freemail.hu>
23031
23032         * marshal.h: Add missing function to fix build.
23033
23034         * marshal.c (mono_marshal_get_native_wrapper): Add support for 
23035         the SetLastError pinvoke attribute.
23036
23037         * marshal.c (mono_marshal_set_last_error): New helper function called
23038         by the generated code.
23039         
23040         * marshal.c (mono_mb_emit_branch): New helper function.
23041
23042         * marshal.c (mono_mb_emit_exception): Added exception name parameter.
23043
23044         * marshal.c (mono_marshal_get_managed_wrapper): Added support for
23045         classes as parameters and return values of delegates. Fixes #29256. 
23046
23047 2003-10-12  Bernie Solomon  <bernard@ugsolutions.com>
23048
23049         * locales.c: use gint32 in non HAVE_ICU case
23050
23051 2003-10-11  Martin Baulig  <martin@ximian.com>
23052
23053         * mono-debug.c (mono_debug_add_method): Added a workaround for
23054         bug #48591.
23055
23056 2003-10-10  Zoltan Varga  <vargaz@freemail.hu>
23057
23058         * marshal.c (mono_marshal_get_managed_wrapper): Under windows,
23059         delegates passed to native code must use the STDCALL calling 
23060         convention. Fixes #35987.
23061
23062 2003-10-10  Martin Baulig  <martin@ximian.com>
23063
23064         * class.c (inflate_generic_type): If we're inflating for a generic
23065         type instance (and not for a generic method), return
23066         MONO_TYPE_MVAR unchanged.
23067
23068 2003-10-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23069
23070         * string-icalls.c: Join ignores null strings in the source array.
23071         * threadpool.[ch]: export busy_worker_threads, not mono_worker_threads.
23072         * threads.c: GetAvailableTheads is slightly more accurate.
23073
23074 2003-10-09  Bernie Solomon  <bernard@ugsolutions.com>
23075
23076         * threads.h threads.c : add mono_threads_set_default_stacksize
23077         and pass default to CreateThread calls.
23078
23079 2003-10-09  Dick Porter  <dick@ximian.com>
23080
23081         * icall.c:
23082         * locales.h:
23083         * locales.c: Internal calls for constructing CultureInfo and
23084         related objects from libicu (if its available.)
23085
23086 2003-10-09  Zoltan Varga  <vargaz@freemail.hu>
23087
23088         * debug-helpers.c (wrapper_type_names): Add 'unknown' wrapper type.
23089
23090 2003-10-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23091
23092         * threadpool.c: added an argument to async_invoke_thread that is the
23093         item to process, pass the MonoAsyncResult to the thread start function
23094         when creating a new thread. This way we don't need to acquire any lock
23095         when we're creating a new thread. Readded a semaphore for faster
23096         response times (instead of that Sleep i added).
23097
23098 2003-10-08  Bernie Solomon  <bernard@ugsolutions.com>
23099
23100         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData):
23101         get daylight change dates better on Windows, fix handling
23102         of platforms without tm_gmtoff.
23103
23104 2003-10-06  Martin Baulig  <martin@ximian.com>
23105
23106         * class.c (inflate_generic_method): Renamed to
23107         mono_class_inflate_generic_method() and made public.
23108         (mono_class_init): Don't inflate the generic methods here.
23109         (mono_class_from_generic): Added `gboolean inflate_methods'
23110         argument.  Inflate the methods here.
23111
23112         * loader.c (mono_method_get_param_names): Ignore instances of
23113         generic types for the moment.
23114
23115         * reflection.c (fixup_method): Added support for inflated methods.
23116         (mono_image_create_token): Use mono_image_get_methodref_token()
23117         for inflated methods.
23118         (mono_custom_attrs_from_param): Ignore instances of generic types
23119         for the moment.
23120         (mono_reflection_bind_generic_parameters): New public function.
23121         Moved all the functionality from
23122         ves_icall_Type_BindGenericParameters() here and added support for
23123         dynamic types.
23124         (mono_reflection_define_generic_parameter): Initialize
23125         `klass->methods' here.
23126
23127         * icall.c (ves_icall_Type_BindGenericParameters): Moved all the
23128         functionality into mono_reflection_define_generic_parameter().
23129         (ves_icall_Type_GetGenericTypeDefinition): If we're coming from a
23130         TypeBuilder, return that TypeBuilder.
23131
23132 2003-10-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23133
23134         * appdomain.c: removed mono_delegate_semaphore.
23135
23136         * threadpool.c:
23137         (mono_thread_pool_add): moved hash table creation inside and the thread 
23138         creation outside of the critical region.
23139         (mono_thread_pool_finish): removed obsolete code.
23140         (async_invoke_thread): don't use the semaphore. Use a plain Sleep and
23141         continue or exit the thread depending on the queue.
23142
23143 2003-10-07  Bernie Solomon  <bernard@ugsolutions.com>
23144
23145         * metadata.c (mono_type_to_unmanaged): allow bools to marshal as I1
23146         marshal.c (emit_ptr_to_str_conv & mono_marshal_get_native_wrapper):
23147         handle more bool marshalling options
23148
23149 2003-10-07  Zoltan Varga  <vargaz@freemail.hu>
23150
23151         * marshal.c (mono_marshal_get_native_wrapper): Fix marshalling of
23152         arrays of structs. Also add a more descriptive error message when
23153         a structure member is marshalled as LPArray.
23154
23155 2003-10-06  Zoltan Varga  <vargaz@freemail.hu>
23156
23157         * marshal.c (mono_marshal_get_native_wrapper): Add support for
23158         marshalling arrays of complex types. Fixes #29098. Also remove an
23159         usused and incomplete function.
23160
23161 Mon Oct 6 15:38:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
23162
23163         * gc.c: report heap_size - free_bytes as total memory allocated
23164         (bug#49362).
23165
23166 2003-10-05  Zoltan Varga  <vargaz@freemail.hu>
23167
23168         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Finally 
23169         fix timezone handling problems on Windows.
23170         
23171         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Avoid
23172         asserts when the year is outside the range handled by ms the functions.
23173
23174         * class.c (setup_interface_offsets): If the class is an interface,
23175         fill out its interface_offsets slot.
23176
23177 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23178
23179         * threadpool.c: mark threadpool threads as background.
23180
23181 2003-10-03  Bernie Solomon  <bernard@ugsolutions.com>
23182
23183         * decimal.c - define DECINLINE to nothing if not using GCC
23184
23185 2003-10-03  Zoltan Varga  <vargaz@freemail.hu>
23186
23187         * assembly.c: More refcount fixes.
23188
23189 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23190
23191         * string-icalls.c: if we're not trimming, return the same string.
23192         When not splitting, don't create a new string.
23193
23194 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23195
23196         * image.c:
23197         (mono_image_open): increment the ref_count inside the critical section.
23198
23199 2003-10-02  Zoltan Varga  <vargaz@freemail.hu>
23200
23201         * image.c (mono_image_open): Fix reference counting bug.
23202
23203 2003-09-30  Bernie Solomon  <bernard@ugsolutions.com>
23204
23205         * marshal.c (mono_marshal_type_size) struct alignment changed for 
23206         64bit machines.  (emit_ptr_to_str_conv) Fix bool conversions for 
23207         64bits. Avoid leak in mono_marshal_get_native_wrapper when
23208         mono_lookup_pinvoke_call throws.        
23209
23210 2003-09-30  Zoltan Varga  <vargaz@freemail.hu>
23211
23212         * reflection.c (mono_reflection_parse_type): Fix #49114.
23213
23214         * file-io.c (ves_icall_System_IO_MonoIO_GetFileAttributes): Add
23215         temporary workaround for cygwin header problem.
23216
23217         * object.c (mono_object_isinst): Synchronize this with the code
23218         generated by the JIT for casts.
23219
23220 2003-09-29  Zoltan Varga  <vargaz@freemail.hu>
23221
23222         * reflection.c (encode_type): Fix #38332.
23223
23224 2003-09-26  Zoltan Varga  <vargaz@freemail.hu>
23225
23226         * marshal.c (mono_marshal_method_from_wrapper): New function to return
23227         the original method from the wrapper method.
23228
23229 2003-09-25  Martin Baulig  <martin@ximian.com>
23230
23231         * icall.c (ves_icall_Type_IsGenericTypeDefinition): Removed this
23232         interncall since it was identical to `Type.GetGenericTypeDefinition()'.
23233         (ves_icall_Type_get_IsGenericInstance): New interncall.
23234
23235 2003-09-24 Bernie Solomon <bernard@ugsolutions.com>
23236
23237         * object.c: fix cast warning in big endian code.
23238
23239 2003-09-19 Jackson Harper <jackson@latitudegeo.com>
23240
23241         * icall.c: Timezone patch from Zoltan Varga (vargaz@freemail.hu)
23242         
23243 2003-09-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23244
23245         * assembly.c: don't call check_env from mono_assembly_load. It's
23246         already done once in mono_assemblies_init and may cause headaches when
23247         multiple threads are loading assemblies.
23248
23249 2003-09-19  Martin Baulig  <martin@ximian.com>
23250
23251         * reflection.c (mono_reflection_define_generic_parameter): Don't
23252         allocate `klass->methods', set `klass->flags' to
23253         TYPE_ATTRIBUTE_INTERFACE, not TYPE_ATTRIBUTE_ABSTRACT.
23254
23255 2003-09-18  Martin Baulig  <martin@ximian.com>
23256
23257         * class.c (mono_class_init): Don't create `class->methods' if it's
23258         already initialized.
23259
23260         * metadata.c (mono_metadata_load_generic_params): Make this
23261         actually work.
23262
23263         * reflection.c (mono_reflection_define_generic_parameter): Set
23264         parent class and interfaces from the constraints.
23265
23266         * reflection.h (MonoReflectionGenericParam): Added `guint32 flags'
23267         to keep this struct in sync with the declaration in TypeBuilder.cs.
23268
23269 2003-09-17  Martin Baulig  <martin@ximian.com>
23270
23271         * metadata.h (MonoType): Replaced the data's `int type_param'
23272         field with `MonoGenericParam *generic_param'.
23273         (MonoGenericParam): Added `MonoClass *klass'.
23274
23275         * class.c (mono_class_from_gen_param): Removed the
23276         `MonoImage *image' and `int type_num' arguments.
23277
23278         * metadata.c (mono_metadata_parse_generic_param): New static
23279         method; creates a MonoGenericParam which just contains the index.
23280         (do_mono_metadata_parse_type): Call
23281         mono_metadata_parse_generic_param() for MONO_TYPE_VAR and
23282         MONO_TYPE_MVAR.
23283
23284         * reflection.c (mono_image_typedef_or_ref): Generic type
23285         parameters may be in the same assembly, but never use a typedef
23286         for them.
23287         (mono_reflection_define_generic_parameter): We're now creating a
23288         "real" class for the type parameter; it's now safe to call
23289         mono_class_from_mono_type() on the class'es type, it'll do the
23290         right thing.
23291
23292 2003-09-16  Martin Baulig  <martin@ximian.com>
23293
23294         * mono-debug-debugger.c (allocate_symbol_file_entry): Initialize
23295         `symfile->range_entry_size' and `symfile->class_entry_size' here;
23296         the `symfile' data structure must be fully initialized before it
23297         gets added to the table.
23298
23299 2003-09-15  Zoltan Varga  <vargaz@freemail.hu>
23300
23301         * icall.c (ves_icall_Type_IsArrayImpl): Added MONO_ARCH_SAVE_REGS.
23302
23303         * appdomain.h domain.c (MonoDomain): Added new hashtable to store the
23304         class init trampolines.
23305
23306 2003-09-11  Zoltan Varga  <vargaz@freemail.hu>
23307
23308         * profiler.c (mono_profiler_load): Added '-time' and '-alloc' options
23309         to the built-in profiler to turn off time and allocation profiling
23310         respectively.
23311
23312 2003-09-10  Zoltan Varga  <vargaz@freemail.hu>
23313
23314         * profiler.c (mono_profiler_coverage_alloc): Use NULL instead of
23315         g_direct_equal.
23316
23317         * debug-helpers.c (mono_method_full_name): Print the wrapper type
23318         in human readable form.
23319
23320 2003-09-08  Zoltan Varga  <vargaz@freemail.hu>
23321
23322         * reflection.c icall.c: Fixed warnings.
23323
23324         * image.c (load_class_names): Use a temporary hash table to hold the
23325         namespaces in order to avoid doing many string comparisons.
23326
23327         * image.h: Fix typo.
23328
23329         * image.c class.c rawbuffer.c reflection.c threads.c verify.c domain.c:
23330         Pass NULL instead of g_direct_equal to the GHashTable constructor 
23331         since the NULL case is short-circuited inside g_hash_table_lookup, 
23332         leading to better performance.  
23333
23334         * metadata.c (mono_metadata_custom_attrs_from_index): New function to
23335         obtain the first custom attribute for a given index. Depends on the
23336         CustomAttribute table being sorted by the parent field.
23337
23338         * reflection.c (mono_custom_attrs_from_index): Use the new function 
23339         for better performance.
23340
23341 2003-09-07  Martin Baulig  <martin@ximian.com>
23342
23343         * class.c (mono_class_init): If we're a generic instance, inflate
23344         all our methods instead of loading them from the image.
23345         (mono_class_from_generic): Set `class->methods = gklass->methods'.
23346
23347 2003-09-07  Martin Baulig  <martin@ximian.com>
23348
23349         * mono-debug-debugger.c: Added support for constructors.
23350
23351 2003-09-06  Martin Baulig  <martin@ximian.com>
23352
23353         * icall.c (ves_icall_TypeBuilder_get_IsUnboundGenericParameter):
23354         New interncall.
23355
23356         * reflection.c (mono_reflection_setup_generic_class): Call
23357         ensure_runtime_vtable() to create the vtable.
23358
23359 2003-09-05  Martin Baulig  <martin@ximian.com>
23360
23361         * class.c (mono_class_array_element_size): Added MONO_TYPE_VAR and
23362         MONO_TYPE_MVAR.
23363
23364 2003-09-04  Martin Baulig  <martin@ximian.com>
23365
23366         * reflection.c (mono_reflection_define_generic_parameter): Generic
23367         parameters start with zero.
23368
23369 2003-09-04  Martin Baulig  <martin@ximian.com>
23370
23371         * metadata.c (mono_type_size): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
23372
23373         * reflection.h (MonoReflectionGenericParam): New typedef.
23374         (MonoReflectionTypeBuilder): Added `generic_params' fields to get
23375         the generic parameters from the managed TypeBuilder.
23376
23377         * reflection.c (mono_reflection_define_generic_parameter): New function.
23378         (mono_reflection_create_runtime_class): Encode generic parameters.
23379         (mono_reflection_setup_generic_class): New function; this is
23380         called after adding adding all generic params to the TypeBuilder.
23381         (encode_type): Added MONO_TYPE_VAR.
23382
23383 2003-09-04  Zoltan Varga  <vargaz@freemail.hu>
23384
23385         * class.h class.c (mono_class_needs_cctor_run): Moved this method
23386         here from the JIT.
23387
23388         * assembly.h assembly.c: Moved the AOT loading code into an assembly
23389         load hook.
23390
23391 2003-09-03  Zoltan Varga  <vargaz@freemail.hu>
23392
23393         * reflection.h reflection.c class.h class.c: Delete duplicate 
23394         definition of mono_type_get_name () from reflection.c and export the
23395         one in class.c.
23396
23397         * class.c: Class loading fixes from Bernie Solomon 
23398         (bernard@ugsolutions.com).
23399
23400         * reflection.c: Endianness fixes from Bernie Solomon 
23401         (bernard@ugsolutions.com).
23402         
23403 2003-09-01  Zoltan Varga  <vargaz@freemail.hu>
23404
23405         * assembly.h assembly.c: Define a file format version for AOT
23406         libraries.
23407         
23408         * assembly.c (mono_assembly_open): Fix leaking of MonoImage-s.
23409
23410         * appdomain.h (MonoJitInfo): New field to determine whenever the
23411         code is domain neutral.
23412         
23413 2003-08-31  Miguel de Icaza  <miguel@ximian.com>
23414
23415         * marshal.c (emit_struct_conv): Add MONO_TYPE_CHAR
23416
23417 2003-08-30  Zoltan Varga  <vargaz@freemail.hu>
23418
23419         * icall.c (ves_icall_System_Web_Util_ICalls_get_machine_install_dir): 
23420         (ves_icall_System_Configuration_DefaultConfig_get_machine_config_path):
23421         Avoid caching the result since strings must be domain specific. Fixes
23422         #48050.
23423
23424 2003-08-29  Zoltan Varga  <vargaz@freemail.hu>
23425
23426         * marshal.c (mono_marshal_init): Make this callable multiple times
23427         since it is hard to find a correct place to call it.
23428
23429         * object.c (mono_runtime_class_init): Execute static constructors in
23430         the correct appdomain.
23431
23432         * image.c (build_guid_table): Handle the case when multiple images have
23433         the same GUID.
23434
23435 2003-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23436
23437         * icall.c: added a couple of icalls for System.Web.
23438
23439 2003-08-28  Martin Baulig  <martin@ximian.com>
23440
23441         * icall.c (ves_icall_Type_BindGenericParameters): Use
23442         `klass->generic_inst' instead of `&klass->byval_arg' in the
23443         mono_type_get_object() call.  The returned type must be
23444         MONO_TYPE_GENERICINST and not MONO_TYPE_CLASS.
23445
23446 2003-08-27  Zoltan Varga  <vargaz@freemail.hu>
23447
23448         * NOTES: New file.
23449
23450         * object.c (mono_class_proxy_vtable): Make it thread safe.
23451
23452         * pedump.c: Fix warning.
23453
23454         * object.c appdomain.h: Get rid of metadata_section. 
23455         It is no longer needed and it was causing deadlocks with domain->lock.
23456
23457         * appdomain.c (add_assemblies_to_domain): Make it thread safe.
23458
23459 2003-08-26  Martin Baulig  <martin@ximian.com>
23460
23461         * pedump.c (main): Don't call mono_image_close() if `verify_pe'.
23462
23463 2003-08-26  Martin Baulig  <martin@ximian.com>
23464
23465         * pedump.c (main): Call mono_metadata_init(),
23466         mono_raw_buffer_init(), mono_images_init(), mono_assemblies_init()
23467         and mono_loader_init().
23468
23469 2003-08-26  Zoltan Varga  <vargaz@freemail.hu>
23470
23471         * loader.h: Add missing include to fix build.
23472
23473         * image.h: mono_image_load_references is no more.
23474
23475         * assembly.c: Reworked assembly loading to make it really thread safe.
23476         After these changes, the assembly returned by mono_assembly_open is
23477         fully initialized, i.e. all its references assemblies are loaded.
23478
23479         * assembly.c (mono_image_load_references): Renamed to 
23480         mono_assembly_load_references, and made private, since clients no
23481         longer need to call it.
23482
23483         * class.c: Removed calls to mono_assembly_load_references, since it was
23484         a source of deadlocks.
23485
23486         * loader.h loader.c class.h class.c: Protect data structures using a 
23487         new lock, the loader lock.
23488
23489         * class.c (mono_class_setup_vtable): Create temporary hash tables and
23490         GPtrArrays only when needed.
23491
23492         * class.c (mono_class_layout_fields): Ignore the dummy field inserted 
23493         into empty structures by mcs. Fixes pinvoke7.cs.
23494         
23495         * domain.c (mono_init): Call a new initialization function.
23496
23497         * appdomain.c (mono_runtime_init): Call the new initializer function
23498         of the marshal module.
23499
23500         * marshal.c (mono_marshal_load_type_info): Ignore the dummy field
23501         inserted into empty structures by mcs. Fixes pinvoke7.cs.
23502
23503         * marshal.h marshal.c: Added locks around the wrapper caches to make
23504         this module thread safe.
23505
23506         * icall.c (ves_icall_InternalInvoke): Method wrappers doesn't require a
23507         this argument. Fixes pinvoke1.exe.
23508
23509 2003-08-25  Lluis Sanchez <lluis@ximian.com>
23510
23511         * object.h: Added call_type field to MonoMethodMessage and the corresponding
23512         enumeration of values. Removed fields to store remote call output values in
23513         MonoAsyncResult. Not needed any more.
23514         * object.c: Initialize call_type and async_result fields in mono_message_init.
23515         * marshal.c: mono_delegate_begin_invoke(): for proxies, set call_type before
23516         dispatching the message.
23517         mono_delegate_end_invoke (): delegate to the proxy the work of waiting for the
23518         async call to finish. To do it use a message with EndInvoke call type.
23519
23520 2003-08-25  Zoltan Varga  <vargaz@freemail.hu>
23521
23522         * loader.h loader.c (mono_method_hash_marhal_info): New function which
23523         determines whenever a method has marshalling info.
23524
23525 2003-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23526
23527         * assembly.c: fix the build on windows.
23528
23529 2003-08-22 Lluis Sanchez <lluis@ximian.com>
23530
23531         * object.cs: Fixed bug #47785.
23532
23533 2003-08-22 Jackson Harper <jackson@latitudegeo.com>
23534
23535         * string-icalls.c (StringReplace): If their are no occurances of
23536         the old string found return a reference to the supplied
23537         string. This saves some memory and matches MS behavoir.
23538         
23539 2003-08-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23540
23541         * socket-io.c: fixed compilation for systems that define AF_INET6
23542         and don't define SOL_IP/SOL_IPV6.
23543
23544 2003-08-21  Zoltan Varga  <vargaz@freemail.hu>
23545
23546         * object.c (mono_object_isinst): Fix casts to TransparentProxy in
23547         the interpreter. Patch by Bernie Solomon (bernard@ugsolutions.com).
23548
23549         * rawbuffer.c rawbuffer.h: Make this module thread safe.
23550
23551         * domain.c: Make this module thread safe.
23552
23553         * domain.c (mono_init): Call new initialization function.
23554
23555         * icall.c (ves_icall_System_Array_SetValueImpl): Check types for
23556         reference types too. Fixes #38812.
23557
23558         * image.c (mono_image_init): Fixed warnings.
23559
23560         * class.c (mono_class_from_typeref): Handle assembly load failure
23561         correctly.
23562
23563         * appdomain.c (add_assemblies_to_domain): Handle the case when
23564         the references of an assembly are not yet loaded.
23565
23566         * metadata.c image.c assembly.c: Moved initialization of global
23567         variables to a separate function called at startup since lazy 
23568         initialization of these variables is not thread safe.
23569         
23570         * image.c assembly.c: Made this module thread safe by adding locks in 
23571         the appropriate places.
23572
23573         * domain.c (mono_init): Call the new initialization functions of the
23574         three modules.
23575
23576 2003-08-20  Lluis Sanchez Gual  <lluis@ximian.com>
23577
23578         * marshal.c: mono_delegate_begin_invoke(): If the target is a proxy,
23579           make a direct call. It is proxy's work to make the call asynchronous.
23580           mono_delegate_end_invoke(): If the targe is a proxy, just collect
23581           the return values.
23582         * object.cs: mono_method_call_message_new(): read AsyncResult and
23583           state object from parameters list, if this info is requested.
23584         * object.h: Added fields to store remote call output values in
23585           MonoAsyncResult. Added AsyncResult field in MonoMethodMessage.
23586
23587 Wed Aug 20 12:57:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
23588
23589         * object.h: add needed fields to MonoThread.
23590         * threads.c, threads.h: allow registering a function to cleanup data
23591         allocated per thread by the JIT.
23592
23593 Tue Aug 19 18:22:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
23594
23595         * loader.h: portability fix by Bernie Solomon
23596         * <bernard@ugsolutions.com>.
23597
23598 2003-08-16  Zoltan Varga  <vargaz@freemail.hu>
23599
23600         * reflection.h reflection.c (mono_param_get_objects): Changed this to 
23601         return a MonoArray. This simplifies the code and also ensures that
23602         the cache allways contains an object reference as a value.
23603
23604         * icall.c (ves_icall_get_parameter_info): Simplified using the new
23605         function.
23606
23607 2003-08-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23608
23609         * socket-io.c: patch by Bernie Solomon <bernard@ugsolutions.com> that
23610         fixes a problem with byte ordering when getting the address family for
23611         a socket.
23612
23613 2003-08-15  Zoltan Varga  <vargaz@freemail.hu>
23614
23615         * .cvsignore: Added monosn.
23616
23617         * reflection.h reflection.c loader.c: Added support for parameter
23618         marshalling to dynamically created types. Fixes #47295.
23619
23620 Fri Aug 15 11:42:46 CEST 2003 Paolo Molaro <lupus@ximian.com>
23621
23622         * rand.c: remove useless warnings.
23623
23624 Wed Aug 13 15:49:57 CEST 2003 Paolo Molaro <lupus@ximian.com>
23625
23626         * class.c: implemented ldtoken for methods and fieldrefs.
23627
23628 2003-08-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23629
23630         * threadpool.c: when mono_async_invoke was called, no one took care of
23631         monitoring the queue. So if the method invoked took some time and we
23632         got new async invoke requests after 500 ms (the thread created waited
23633         that long in WaitForSingleObject), the new async invoke was not called
23634         until the previous one finished.
23635
23636         This is fixed now. Thanks to Totte for helping with it.
23637
23638 2003-08-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23639
23640         * threadpool.c: set threadpool_thread to TRUE. Patch by totte.
23641
23642 2003-08-11  Martin Baulig  <martin@ximian.com>
23643
23644         * mono-debug-debugger.c (mono_debugger_lookup_type): New function.
23645
23646 2003-08-06  Martin Baulig  <martin@ximian.com>
23647
23648         * mono-debug-debugger.c: Added support for static fields,
23649         properties and methods.
23650
23651 2003-08-06  Martin Baulig  <martin@ximian.com>
23652
23653         * mono-debug-debugger.c: Don't store the MonoString's vtable to
23654         make this work for applications with multiple application domains.
23655
23656 2003-08-04  Martin Baulig  <martin@ximian.com>
23657
23658         * mono-debug-debugger.c: Completely reworked the type support; the
23659         most important thing is that we're now just using one single
23660         `MonoType' instance per type.
23661
23662 Sat Aug  2 13:05:27 BST 2003 Malte Hildingson <malte@amy.udd.htu.se>
23663
23664         * mono-endian.h, mono-endian.c, icall.c: Added icall
23665         ves_icall_System_Double_AssertEndianity to assert double word endianity
23666         on ARM (FPA). The icall uses a macro defined in mono-endian.h.
23667
23668 Fri Aug 1 16:51:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
23669
23670         * class.c, class.h, reflection.c, metadata.c, icall.c: more generics
23671         support, icalls and fixes.
23672
23673 2003-07-31  Miguel de Icaza  <miguel@ximian.com>
23674
23675         * unicode.c (ves_icall_System_Char_IsPunctuation): The set of
23676         classes that are a punctuation character in .NET is not the same a
23677         g_unichar_ispunct.
23678
23679 Tue Jul 29 18:07:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
23680
23681         * socket-io.c: ipv6 portability fixes from Felix Ortga (guile@lared.es).
23682
23683 2003-07-29  Miguel de Icaza  <miguel@ximian.com>
23684
23685         * icall.c: Add new MemCopy internalcall.
23686         (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal):
23687         Simplified code; It is not necessary to handle all the cases here,
23688         as the C# code takes care of it.  Only handle the case of the name
23689         resource embedded into the assembly.
23690
23691         Changed signature to return the data pointer and the size of the
23692         data. 
23693
23694 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
23695
23696         * reflection.c (mono_image_get_method_info): Allow for 0x40 to be
23697         encoded.        (Partition II.22.1.7: PInvokeAttribute:SupportsLastErr).
23698
23699 2003-07-29  Lluis Sanchez Gual  <lluis@ximian.com>
23700
23701         * socket-io.c: ignore EINTR error in select.
23702
23703 Tue Jul 29 15:25:01 CEST 2003 Paolo Molaro <lupus@ximian.com>
23704
23705         * class.h, class.c: removed unused subclasses field in MonoClass.
23706
23707 2003-07-29  Lluis Sanchez Gual  <lluis@ximian.com>
23708
23709         * icall.c: improve fix of get_base_definition(). If the parent class
23710           doesn't have the mehod, look at the parent of the parent.
23711         * object.c: mono_message_init(): use the attribute PARAM_ATTRIBUTE_OUT
23712           to check if a parameter is an in or out parameter
23713           (PARAM_ATTRIBUTE_IN is not set by default).
23714           mono_method_return_message_restore(): Use mono_class_value_size to
23715           get the size of a value type. mono_type_stack_size (parameterType)
23716           does not return the correct value if parameterType is byRef.
23717           mono_load_remote_field(), mono_load_remote_field_new(),
23718           mono_store_remote_field(), mono_store_remote_field_new():
23719           raise exception if the remote call returns an exception.
23720
23721 2003-07-28  Martin Baulig  <martin@ximian.com>
23722
23723         * mono-debug-debugger.c (mono_debugger_runtime_invoke): New
23724         method.  This is a wrapper around mono_runtime_invoke() which
23725         boxes the instance object if neccessary.
23726
23727 Fri Jul 25 19:14:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
23728
23729         * class.c, class.h, image.c, image.h, loader.c, metadata.c,
23730         metadata.h, row-indexes.h, verify.c: first cut of generics support.
23731
23732 Thu Jul 24 11:34:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
23733
23734         * icall.c: disable mcs bug workaround.
23735
23736 2003-07-21  Miguel de Icaza  <miguel@ximian.com>
23737
23738         * object.c (mono_runtime_class_init): Take the metadata_section
23739         mutex before obtaining the domain mutex.
23740
23741         * appdomain.h: Added definition of metadata_section mutex here. 
23742
23743         * object.c: define metadata_mutex here.
23744
23745 2003-07-24  Ravi Pratap  <ravi@ximian.com>
23746
23747         * icall.c: Remove the FIXED_MCS_45127 workarounds - this has been
23748         fixed.
23749
23750 2003-07-24  Lluis Sanchez Gual  <lluis@ximian.com>
23751
23752         * reflection.c: Fix bug #46669
23753
23754 2003-07-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23755
23756         * exception.c:
23757         * exception.h:
23758         * icall.c:
23759         * object.h: fill in the type name for TypeLoadException.
23760
23761 2003-07-23  Ravi Pratap  <ravi@ximian.com>
23762
23763         * class.c: Fixes from Paolo in response to bug #45415 (Subclass
23764         relationship between TypeBuilders while compiling corlib) and bug
23765         45993 (Array types returned from the runtime while compiling
23766         corlib were from the loaded corlib).
23767
23768 2003-07-22  Martin Baulig  <martin@ximian.com>
23769
23770         * mono-debug-debugger.c: Reworked the type support a bit more;
23771         distinguish between types and classes.
23772
23773 Tue Jul 22 15:48:50 CEST 2003 Paolo Molaro <lupus@ximian.com>
23774
23775         * icall.c: add IsArrayImpl icall.
23776
23777 2003-07-22  Zoltan Varga  <vargaz@freemail.hu>
23778
23779         * class.c (mono_class_layout_fields): Fix gc aware auto layout by
23780         initializing real_size only once. Also fix bug #46602.
23781
23782 2003-07-21  Jerome Laban <jlaban@wanadoo.fr>
23783
23784         * object.c: Renamed mono_metadata_section to metadata_section.
23785
23786 2003-07-21  Lluis Sanchez Gual  <lluis@ximian.com>
23787
23788         * icall.c: in MS.NET ves_icall_Type_GetInterfaces returns an
23789           empty array if the type is an array. Fixed.
23790           ves_icall_MonoMethod_get_base_definition: if the base method
23791           is abstract, get the MethodInfo from the list of methods of
23792           the class.
23793         * reflection.c: ParameterInfo.PositionImpl should be zero-based
23794           and it was 1-based. Fixed in mono_param_get_objects.
23795
23796 2003-07-20  Martin Baulig  <martin@ximian.com>
23797
23798         * mono-debug.h: Set version number to 31.
23799         (mono_debug_init): Added `MonoDomain *' argument.
23800
23801         * mono-debug-debugger.c: Reworked the type support; explicitly
23802         tell the debugger about builtin types; pass the `klass' address to
23803         the debugger.
23804
23805 2003-07-20 Jackson Harper <jackson@latitudegeo.com>
23806
23807         * image.c: Allow new metadata tables to be loaded without a
23808         warning. Also update the warning message to give the new constant value.
23809                 
23810 Fri Jul 18 13:12:21 CEST 2003 Paolo Molaro <lupus@ximian.com>
23811
23812         * class.c, class.h, debug-helpers.c, icall.c, image.c, marshal.c,
23813         metadata.c, metadata.h, mono-debug-debugger.c, object.c, reflection.c: 
23814         array type representation changes.
23815
23816 Fri Jul 18 11:26:58 CEST 2003 Paolo Molaro <lupus@ximian.com>
23817
23818         * icall.c, appdomain.h, appdomain.c: support full runtime shutdown
23819         on Environment.Exit () call.
23820
23821 Thu Jul 17 17:21:57 CEST 2003 Paolo Molaro <lupus@ximian.com>
23822
23823         * icall.c, reflection.h, reflection.c, verify.c: cleanups,
23824         requires a matching corlib.
23825
23826 2003-07-17  Lluis Sanchez Gual  <lluis@ximian.com>
23827
23828         * Changelog: My editor decided to add a CR to each line. Sorry about that.
23829           Committed again without the CRs.
23830         
23831 2003-07-17  Lluis Sanchez Gual  <lluis@ximian.com>
23832
23833         * socket-io.c: Get system_assembly using mono_image_loaded(), instead
23834           getting it from the "this" socket instance. Did not work
23835           if the socket is a subclass of Socket.
23836           Also fixed bug #35371.
23837
23838 Thu Jul 17 13:39:32 CEST 2003 Paolo Molaro <lupus@ximian.com>
23839
23840         * metadata.c: fixed size for TypedByRef.
23841         * loader.c: when searching for a method, consider the vararg amrker.
23842         * unicode.c, decimal.c: constify some arrays.
23843
23844 2003-07-15  Dick Porter  <dick@ximian.com>
23845
23846         * socket-io.c: Fixed compilation for gcc < 3.2.
23847
23848         Fixed compilation for machines that don't have AF_INET6 (thanks to
23849         Bernie Solomon <bernard@ugsolutions.com> for that part.)
23850
23851         Fixed compile warnings.
23852         
23853         Fixed formatting and line endings.
23854
23855 2003-07-14  Jerome Laban <jlaban@wanadoo.fr>
23856
23857         * socket-io.h:
23858         * socket-io.c: Added IPv6 support.
23859
23860 2003-07-13  Zoltan Varga  <vargaz@freemail.hu>
23861
23862         * class.c (mono_class_is_assignable_from): New function to implement
23863         the is_assignable_from logic. Used by mono_object_isinst, 
23864         Type::IsAssignableFrom () and the interpreter.
23865
23866         * class.c (mono_class_is_subclass_of): Make all classes a subclass of
23867         Object, even interfaces.
23868         
23869         * object.c (mono_object_isinst): Implement in terms of 
23870         is_assignable_from.
23871
23872         * icall.c (ves_icall_type_is_assignable_from): New icall.
23873
23874 2003-07-11  Zoltan Varga  <vargaz@freemail.hu>
23875
23876         * domain.c (foreach_domain): fix compiler warning.
23877
23878 2003-07-11  Dietmar Maurer  <dietmar@ximian.com>
23879
23880         * image.c (load_metadata_ptrs): use g_strndup because strndup is
23881         not available on all plattforms
23882
23883 2003-07-10  Zoltan Varga  <vargaz@freemail.hu>
23884
23885         * image.h image.c: Store the metadata version string in MonoImage.
23886         * icall.c: New icall to retrieve the image version.
23887         * reflection.c (create_dynamic_image): Fill in the image version field
23888         * reflection.c (build_compressed_metadata): Use the image version
23889         from the image structure.
23890
23891 2003-07-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23892
23893         * appdomain.c: modified comment.
23894         * gc.c: finalizer_thread can call finalizers even when finished == TRUE.
23895         That will be its last iteration when mono_gc_cleanup is called from
23896         mono_runtime_cleanup and before the domain is unloaded.
23897
23898         Fixes bug #45962.
23899
23900 2003-07-04  Dietmar Maurer  <dietmar@ximian.com>
23901
23902         * marshal.c (mono_marshal_get_native_wrapper): fixes for [out]
23903         attributes.
23904
23905 Thu Jul 3 17:22:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
23906
23907         * object.c, file-io.c, metadata.c, mono-endian.h, reflection.c,
23908         rawbuffer.c: more 64 bit and picky (or old) compiler fixes from
23909         Bernie Solomon <bernard@ugsolutions.com>.
23910
23911 Thu Jul 3 17:17:39 CEST 2003 Paolo Molaro <lupus@ximian.com>
23912
23913         * object.c, object.h: provide mono_object_new_fast() for faster
23914         allocation in some special cases.
23915
23916 Wed Jul 2 13:21:26 CEST 2003 Paolo Molaro <lupus@ximian.com>
23917
23918         * object.h, reflection.h, verify.c: fixes for some 64bit issues,
23919         mostly from a patch by Laramie Leavitt <lar@leavitt.us>.
23920
23921 Tue Jul 1 21:24:14 CEST 2003 Paolo Molaro <lupus@ximian.com>
23922
23923         * threadpool.c: fix leaks.
23924
23925 2003-07-01  Dick Porter  <dick@ximian.com>
23926
23927         * threadpool.c (mono_async_invoke): Use mono_g_hash_table_remove when
23928         using MonoGHashTables.  Fixes threadpool bug posted to list.
23929
23930 Tue Jul 1 11:45:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
23931
23932         * image.h, image.c: added support to load an assembly from a byte array.
23933         * Makefile.am, assembly.c, make-bundle.pl, sample-bundle: added 
23934         assembly bundle support.
23935
23936 2003-06-27  Dietmar Maurer  <dietmar@ximian.com>
23937
23938         * threadpool.c (mono_thread_pool_add): keep a reference to the
23939         AsyncResult to prevent GC
23940
23941 Thu Jun 26 12:13:25 CEST 2003 Paolo Molaro <lupus@ximian.com>
23942
23943         * class.c: leak fix.
23944
23945 2003-06-25  Dick Porter  <dick@ximian.com>
23946
23947         * threadpool.c (mono_thread_pool_add): Don't set up a finaliser
23948         for the async object, the WaitHandle object will close the handle.
23949         Fixes bug 45321.
23950
23951 Wed Jun 25 18:12:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
23952
23953         * class.c: in mono_array_class_get (), lookup from the hash with the
23954         same type we insert: this works around a bug in
23955         mono_metadata_type_hash() with SZARRAY and fixes a leak reported by
23956         lluis. The real fix will have to wait for after the release.
23957
23958 Wed Jun 25 13:14:41 CEST 2003 Paolo Molaro <lupus@ximian.com>
23959
23960         * icall.c: fix memory leak when getting type members.
23961
23962 Mon Jun 23 16:12:48 CEST 2003 Paolo Molaro <lupus@ximian.com>
23963
23964         * reflection.c: added more pubtoken special cases.
23965
23966 Mon Jun 23 15:29:06 CEST 2003 Paolo Molaro <lupus@ximian.com>
23967
23968         * class.c: handle field offset correctly when class size
23969         is set (bug# 45182, partially from a patch by jlaban@wanadoo.Fr (Jerome Laban)).
23970
23971 2003-06-20  Martin Baulig  <martin@ximian.com>
23972
23973         * mono-debug-debugger.h (MonoDebuggerSymbolFile): Added `MonoImage
23974         *image' field.
23975
23976 2003-06-20  Martin Baulig  <martin@ximian.com>
23977
23978         * image.h, mono-debug-debugger.h: Fixed compiler warnings.
23979
23980 2003-06-20  Martin Baulig  <martin@ximian.com>
23981
23982         * mono-debug.h (MONO_DEBUG_VAR_ADDRESS_MODE_STACK): Removed.  We
23983         just distinguish between variables in registers and variables at
23984         an offset relative to a register.
23985
23986 2003-06-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23987
23988         * icall.c: #ifdef out latest changes until mcs is fixed.
23989
23990 Thu Jun 19 11:03:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
23991
23992         * icall.c: return members in metadata order.
23993
23994 Wed Jun 18 15:26:58 CEST 2003 Paolo Molaro <lupus@ximian.com>
23995
23996         * icall.c: avoid infinite loop in GetTimeZoneData.
23997
23998 Wed Jun 18 12:47:43 CEST 2003 Paolo Molaro <lupus@ximian.com>
23999
24000         * icall.c: added Marshal.Prelink/All icalls.
24001
24002 Wed Jun 18 12:17:48 CEST 2003 Paolo Molaro <lupus@ximian.com>
24003
24004         * object.c, object.h: fix warnings and do some overflow checking
24005         when creating arrays.
24006
24007 2003-06-17  Dick Porter  <dick@ximian.com>
24008
24009         * file-io.h:
24010         * file-io.c: File attributes need to be tweaked slightly when
24011         passed from the managed to the w32 world.
24012
24013 2003-06-17  Zoltan Varga  <vargaz@freemail.hu>
24014         * profiler.h profiler-private.h profiler.c: Rework last patch
24015         based on suggestion by Paolo.
24016         
24017 2003-06-17  Zoltan Varga  <vargaz@freemail.hu>
24018
24019         * profiler.h profiler-private.h profiler.c: Added infrastructure for 
24020         instruction level coverage data collection.
24021         * profiler.h profiler.c (: Added new callback function which can be
24022         used by the profiler to limit which functions should have coverage
24023         instrumentation.
24024         * profiler.c (mono_profiler_load): Call g_module_build_path to
24025         generate the file name of the profiler library.
24026
24027 Mon Jun 16 18:11:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
24028
24029         * profiler.c, profiler.h, profiler-private.h: added basic block 
24030         coverage profiling API.
24031
24032 2003-06-15  Zoltan Varga  <vargaz@freemail.hu>
24033
24034         * reflection.c (mono_reflection_create_runtime_class): Add support
24035         for events in dynamically generated code.
24036
24037         * gc.c: Start GCHandle indexes from 1, since 0 means the handle is
24038         not allocated.
24039
24040 Sat Jun 14 19:01:32 CEST 2003 Paolo Molaro <lupus@ximian.com>
24041
24042         * icall.c: when getting timezone info, return reasonable values if we
24043         can't get the actual data.
24044
24045 2003-06-14  Dick Porter  <dick@ximian.com>
24046
24047         * threads.c (start_wrapper): Remove the reference to the thread
24048         object in the TLS data, so the thread object can be finalized.
24049         This won't be reached if the thread threw an uncaught exception,
24050         so those thread handles will stay referenced :-( (This is due to
24051         missing support for scanning thread-specific data in the Boehm GC
24052         - the io-layer keeps a GC-visible hash of pointers to TLS data.)
24053
24054 Sat Jun 14 13:16:17 CEST 2003 Paolo Molaro <lupus@ximian.com>
24055
24056         * reflection.c: ensure streams and tables are first allocated with
24057         ALLOC_ATOMIC (GC_realloc uses plain GC_malloc otherwise).
24058
24059 Sat Jun 14 13:13:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
24060
24061         * icall.c: fixed GetElementType for byrefs (bug# 44792).
24062
24063 2003-06-13  Zoltan Varga  <vargaz@freemail.hu>
24064
24065         * reflection.c (mono_reflection_create_runtime_class): Add support for
24066         properties to dynamically created classes.
24067         * reflection.c: Fix a few places where non-MonoObjects were inserted
24068         into the tokens hashtable.
24069
24070 Fri Jun 13 19:10:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
24071
24072         * object.c: some support to handle out of memory exceptions.
24073
24074 2003-06-12  Dietmar Maurer  <dietmar@ximian.com>
24075
24076         * marshal.c (mono_marshal_get_native_wrapper): support reference
24077         return types
24078
24079 Wed Jun 11 18:32:51 CEST 2003 Paolo Molaro <lupus@ximian.com>
24080
24081         * object.h, object.c: more portability stuff from Bernie Solomon.
24082         Unexport mono_object_allocate(). Added mono_object_unbox ().
24083         Set exitcode when an unhandled exception is thrown.
24084
24085 2003-06-11  Dietmar Maurer  <dietmar@ximian.com>
24086
24087         * marshal.c (mono_marshal_get_native_wrapper): use custom
24088         marshaler for return types.
24089
24090 2003-06-10  Dick Porter  <dick@ximian.com>
24091
24092         * socket-io.c: Don't assume that one of struct ip_mreqn or struct
24093         ip_mreq is available
24094
24095 Tue Jun 10 17:35:03 CEST 2003 Paolo Molaro <lupus@ximian.com>
24096
24097         * debug-mono-symfile.c, marshal.c, metadata.c, monitor.c,
24098         mono-debug-debugger.c, mono-debug.c, process.c: portability fixes
24099         by Bernie Solomon <bernard@ugsolutions.com>.
24100
24101 2003-06-10  Zoltan Varga  <vargaz@freemail.hu>
24102
24103         * gc.c (mono_gc_init): Avoid error message on shutdown when
24104         GC_DONT_GC=1 is used.
24105
24106         * icall.c (ves_icall_System_Reflection_Module_GetGuidInternal): 
24107         New icall to return the GUID of a module.
24108
24109 Mon Jun 9 19:33:51 CEST 2003 Paolo Molaro <lupus@ximian.com>
24110
24111         * class.c: ensure instance size always includes the parent's size
24112         even whem class size is set explicitly (fixes bug#44294).
24113
24114 Thu Jun 5 19:51:49 CEST 2003 Paolo Molaro <lupus@ximian.com>
24115
24116         * profiler.h, profiler.c: made the simple profiler thread-safe,
24117         get more accurate timing info. Allow the loading of an
24118         externally-developed profiler module.
24119
24120 2003-06-05  Dietmar Maurer  <dietmar@ximian.com>
24121
24122         * marshal.c (mono_marshal_get_native_wrapper): improved
24123         class/byref arguments.
24124         (mono_marshal_get_native_wrapper): better string marshaling support.
24125
24126 Wed Jun 4 18:01:22 CEST 2003 Paolo Molaro <lupus@ximian.com>
24127
24128         * class.c: ensure .pack and .size are handled correctly and
24129         simplified layout of static fields.
24130
24131 2003-06-04  Dietmar Maurer  <dietmar@ximian.com>
24132
24133         * appdomain.c
24134         (ves_icall_System_AppDomainSetup_InitAppDomainSetup): fix for bug 42934
24135
24136         * loader.c (mono_lookup_pinvoke_call): look for modules in the
24137         current directory (fix bug 44008)
24138
24139 2003-06-03  Dietmar Maurer  <dietmar@ximian.com>
24140
24141         * marshal.c (mono_marshal_get_native_wrapper): started support for
24142         custom marshalers.
24143         (mono_delegate_to_ftnptr): consider marshalling specifications
24144
24145 Tue Jun 3 11:17:02 CEST 2003 Paolo Molaro <lupus@ximian.com>
24146
24147         * reflection.c, reflection.h: emit custom marshal info.
24148
24149 2003-06-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24150
24151         * object.c: free the GError.
24152         * icall.c: added CloseEvent_internal.
24153         * threads.[ch]:
24154         (ves_icall_System_Threading_Events_CloseEvent_internal): new internal
24155         call.
24156
24157 2003-06-01  Zoltan Varga  <vargaz@freemail.hu>
24158
24159         * loader.c (mono_method_get_signature): Add support for dynamic
24160         assemblies.
24161
24162 Sat May 31 15:22:07 CEST 2003 Paolo Molaro <lupus@ximian.com>
24163
24164         * reflection.c: fixed bug #43905.
24165
24166 Fri May 30 12:56:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
24167
24168         * class.c, domain.c, icall.c, metadata.h, object.h: support for
24169         handling TypedReference and ArgIterator.
24170         * loader.c, loader.h: added function to get signature at call site.
24171
24172 Thu May 29 11:34:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
24173
24174         * metadata.c, metadata.h, private.h, tokentype.h, loader.c: make more 
24175         data readonly. Buglets and warning fixes. Some MethodSpec support.
24176
24177 Tue May 27 16:34:39 CEST 2003 Paolo Molaro <lupus@ximian.com>
24178
24179         * class.h, class.c, object.c: remove relative numbering support.
24180
24181 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
24182
24183         * marshal.c (mono_marshal_get_native_wrapper): For now, do not
24184         free the string, until we get a chance to fix Gtk#
24185
24186 2003-05-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24187
24188         * marshal.c: revert last patch.
24189
24190 Mon May 26 20:21:52 CEST 2003 Paolo Molaro <lupus@ximian.com>
24191
24192         * icall.c: updates for new mono_class_vtable() not calling
24193         the type constructor anymore.
24194
24195 Mon May 26 12:10:35 CEST 2003 Paolo Molaro <lupus@ximian.com>
24196
24197         * object.h, object.c: separate vtable creation from type
24198         initialization. Make running the .cctor thread safe.
24199
24200 2003-05-26  Dietmar Maurer  <dietmar@ximian.com>
24201
24202         * marshal.c (mono_marshal_get_native_wrapper): free string return values.
24203
24204 2003-05-21  Dietmar Maurer  <dietmar@ximian.com>
24205
24206         * loader.c (mono_get_method): consider calling convention
24207
24208 2003-05-21  Zoltan Varga  <vargaz@freemail.hu>
24209
24210         * icall.c (ves_icall_System_Reflection_Module_GetGlobalType): New icall
24211         to return the invisible global type for a module.
24212
24213         * reflection.c (mono_image_build_metadata): Emit global fields too.
24214
24215 2003-05-20  Peter Williams  <peterw@ximian.com>
24216
24217         * loader.c (mono_lookup_internal_call): Add a few newlines.
24218
24219 2003-05-20  Zoltan Varga  <vargaz@freemail.hu>
24220
24221         * reflection.c (mono_reflection_lookup_dynamic_token): Intern dynamic
24222         literal strings.
24223
24224         * appdomain.c (set_domain_search_path): Recalculate search path when
24225         AppDomainSetup.PrivateBinPath changes.
24226
24227         * object.c (mono_class_compute_gc_descriptor): It turns out some
24228         parts of the class libs (like System.Thread) holds pointers to
24229         GC_MALLOC()-d memory in IntPtrs, which is wrong. The workaround is
24230         to treat native int a pointer type here.
24231         
24232 Tue May 20 17:18:16 CEST 2003 Paolo Molaro <lupus@ximian.com>
24233
24234         * appdomain.h, domain.c: add hashtable for jump target resolution.
24235
24236 2003-05-19  Zoltan Varga  <vargaz@freemail.hu>
24237
24238         * reflection.h reflection.c icall.c: Added new icalls 
24239         GetManifestResourceInfoInternal, GetModulesInternal and support
24240         infrastructure.
24241
24242 2003-05-16  Dick Porter  <dick@ximian.com>
24243
24244         * icall.c:
24245         * file-io.h:
24246         * file-io.c: Implement System.IO.MonoIO::GetTempPath
24247
24248 2003-05-14  Lluis Sanchez Gual  <lluis@ideary.com>
24249
24250         * object.c: mono_store_remote_field: little fix to previous patch.
24251
24252 Wed May 14 18:10:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
24253
24254         * class.c: add constructors to array classes.
24255         * icall.c: special case array construction for InternalInvoke (),
24256
24257 2003-05-14  Zoltan Varga  <vargaz@freemail.hu>
24258
24259         * class.h class.c reflection.c object.c: Added support for field
24260         defaults in dynamically generated classes.
24261
24262 Wed May 14 13:35:27 CEST 2003 Paolo Molaro <lupus@ximian.com>
24263
24264         * reflection.c: properly encode charset for ddlimport.
24265
24266 Wed May 14 11:14:54 CEST 2003 Paolo Molaro <lupus@ximian.com>
24267
24268         * threads.c: allow compiling without GC.
24269
24270 Tue May 13 16:41:49 CEST 2003 Paolo Molaro <lupus@ximian.com>
24271
24272         * appdomain.h, object.c, object.h, threads.c, threads.h: added
24273         handling of thread static data.
24274
24275 Tue May 13 16:36:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
24276
24277         * reflection.h, reflection.c: added mono_custom_attrs_free ().
24278
24279 2003-05-13  Dietmar Maurer  <dietmar@ximian.com>
24280
24281         * class.c (mono_array_class_get): always set the serializable flags
24282         (mono_array_class_get): always set the SEALED attribute for array types
24283
24284 2003-05-12  Dietmar Maurer  <dietmar@ximian.com>
24285
24286         * loader.c (mono_lookup_pinvoke_call): consider Ansi/Unicode
24287         attributes (fix for bug 42021).
24288
24289 2003-05-12  Dick Porter  <dick@ximian.com>
24290
24291         * gc.c: Don't run finalizers when the finalizer thread is
24292         finishing up, because the default domain has already been
24293         destroyed.
24294
24295 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
24296
24297         * string-icalls.c (ves_icall_System_String_ctor_chara_int_int): if
24298         value is null, we should throw an exception.   This is slightly
24299         different than the other conventions used for the constructor.
24300
24301 2003-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24302
24303         * socket-io.c: fixed windows build.
24304
24305 2003-05-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24306
24307         * socket-io.c: patch by Jerome Laban that fixes bug #42393.
24308
24309 2003-05-10  Zoltan Varga  <vargaz@freemail.hu>
24310
24311         * object.c (mono_string_new_wrapper): Compatibility fix for MS
24312         compilers.
24313
24314 2003-05-09  Zoltan Varga  <vargaz@freemail.hu>
24315
24316         * class.c (mono_class_layout_fields): Add experimental GC aware
24317         auto layout facility. Requires class library changes to work correctly.
24318
24319         (mono_class_setup_vtable): Avoid overriding explicit interface
24320         method implementations. Fixes iface3.exe test.
24321
24322         * object.c (mono_class_compute_gc_descriptor): Type I can't hold an
24323         object reference.
24324         (mono_array_new_specific): Add MONO_ARCH_SAVE_REGS.
24325         (mono_string_new_wrapper): Add MONO_ARCH_SAVE_REGS.
24326
24327         * metadata.h: Add new type classification macro which determines
24328         whenever the type holds an object reference.
24329
24330 2003-05-08  Dietmar Maurer  <dietmar@ximian.com>
24331
24332         * marshal.c (mono_marshal_get_native_wrapper): cleanups
24333
24334 2003-05-07  Zoltan Varga  <vargaz@freemail.hu>
24335
24336         * gc.c (finalizer_thread): Work around a GC bug.
24337
24338 2003-05-07  Dietmar Maurer  <dietmar@ximian.com>
24339
24340         * marshal.c (emit_struct_conv): allow unions
24341
24342         * class.c (class_compute_field_layout): added patches from Jerome Laban <jlaban@wanadoo.fr>
24343
24344 2003-05-06  Dietmar Maurer  <dietmar@ximian.com>
24345
24346         * marshal.c (mono_marshal_get_native_wrapper): free strings after pinvoke
24347
24348 2003-05-06  Martin Baulig  <martin@ximian.com>
24349
24350         * mono-debug-debugger.h: #include <mono/io-layer/io-layer.h>.
24351
24352 2003-05-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24353
24354         * socket-io.c:
24355         (Select_internal): allow NULLs, don't create arrays if not needed.
24356         Coupled with Socket.cs changes.
24357
24358         * threadpool.c:
24359         (mono_thread_pool_add): use GC_MALLOC to allocate the ASyncCall and
24360         register a finalizer for it that will close the semaphore handle. This
24361         fixes the leak and make Lupus' test run with > 4080 loops.
24362
24363 2003-05-05  Dietmar Maurer  <dietmar@ximian.com>
24364
24365         * marshal.c (mono_marshal_get_struct_to_ptr): added fixes from
24366         Jerome Laban (bug #42287)
24367
24368 2003-05-02  Martin Baulig  <martin@ximian.com>
24369
24370         * debug-mono-symfile.h
24371         (MonoSymbolFile): Moved declaration into mono-debug.h.
24372         (MonoDebugMethodJitInfo): Likewise.
24373         (mono_debug_open_mono_symbol_file): Take the MonoDebugHandle as
24374         argument.
24375         (_mono_debug_address_from_il_offset): Take a
24376         MonoDebugMethodJitInfo instead of a MonoDebugMethodInfo.
24377
24378         * mono-debug.h
24379         (MonoDebugDomainData): New struct.
24380         (mono_debug_get_domain_data): New function.
24381         (mono_debug_add_method): Take an additional `MonoDomain *'
24382         argument.
24383         (mono_debug_source_location_from_address): Likewise.
24384         (mono_debug_il_offset_from_address): Likewise.
24385         (mono_debug_address_from_il_offset): Likewise.
24386
24387 Thu May 1 19:40:37 CEST 2003 Paolo Molaro <lupus@ximian.com>
24388
24389         * reflection.c: one more check for null type in custom attrs.
24390
24391 2003-05-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24392
24393         * reflection.c: avoid warning (comparison is always false due to limited
24394         range of data type).
24395
24396 2003-05-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24397
24398         * icall.c: throw an exception in Type.GetField if the argument 'name'
24399         is NULL.
24400
24401 Wed Apr 30 10:53:09 CEST 2003 Paolo Molaro <lupus@ximian.com>
24402
24403         * reflection.c: fixed handling of enums in named arguments to custom
24404         attributes (bug #42123).
24405
24406 Tue Apr 29 19:15:10 CEST 2003 Paolo Molaro <lupus@ximian.com>
24407
24408         * reflection.c: use the right array element type and handle
24409         a null for a Type argument, too.
24410
24411 Tue Apr 29 15:46:00 CEST 2003 Paolo Molaro <lupus@ximian.com>
24412
24413         * reflection.c: handle arrays as arguments to custom attributes.
24414
24415 Tue Apr 29 11:43:01 CEST 2003 Paolo Molaro <lupus@ximian.com>
24416
24417         * reflection.c: handle a string value in a custom attr
24418         ctor that takes an object.
24419
24420 2003-04-29  Dietmar Maurer  <dietmar@ximian.com>
24421
24422         * marshal.c (mono_mb_emit_restore_result): support MONO_TYPE_PTR
24423         (fix bug #42063)
24424
24425 2003-04-28  Zoltan Varga  <vargaz@freemail.hu>
24426
24427         * icall.c (ves_icall_Type_GetNestedType): Fixed warnings.
24428
24429 2003-04-27  Martin Baulig  <martin@ximian.com>
24430
24431         * mono-debug-debugger.h (MonoDebuggerEvent): Renamed
24432         MONO_DEBUGGER_EVENT_BREAKPOINT_TRAMPOLINE to
24433         MONO_DEBUGGER_EVENT_BREAKPOINT.
24434         (mono_breakpoint_trampoline_code): Removed.
24435         (mono_debugger_event_handler): The last argument is now a
24436         `guint32'.
24437         (mono_debugger_insert_breakpoint_full): Removed the
24438         `use_trampoline' argument.
24439         (mono_debugger_method_has_breakpoint): Likewise.
24440         (mono_debugger_trampoline_breakpoint_callback): Renamed to
24441         mono_debugger_breakpoint_callback(); take the method and
24442         breakpoint number as arguments.
24443
24444 Sat Apr 26 19:25:31 CEST 2003 Paolo Molaro <lupus@ximian.com>
24445
24446         * metadata.c: fix off by one when loading parameters attributes.
24447
24448 2003-04-24  Martin Baulig  <martin@ximian.com>
24449
24450         * mono-debug-debugger.c (mono_debugger_io_layer): Put this back.
24451
24452 2003-04-24  Martin Baulig  <martin@ximian.com>
24453
24454         * mono-debug-debugger.c: Moved all code which interacts with the
24455         Mono Debugger here.
24456
24457         * debug-mono-symfile.c: This code now just deals with the symbol
24458         file itself, the debugger code is now in mono-debug-debugger.c.
24459
24460 2003-04-23  Martin Baulig  <martin@ximian.com>
24461
24462         * mono-debug.c (mono_debug_source_location_from_il_offset):
24463         New method; like mono_debug_source_location_from_address(), but
24464         takes an IL offset instead of a machine address.
24465
24466 2003-04-23  Martin Baulig  <martin@ximian.com>
24467
24468         * debug-mono-symfile.h (MonoDebugLineNumberEntry): Removed the
24469         `line' field; this is now computed by the debugger.
24470
24471 2003-04-23  Martin Baulig  <martin@ximian.com>
24472
24473         * mono-debug.[ch]: New files.  This is the new debugging interface.
24474
24475         * mono-debug-debugger.[ch]: New files.  Moved all code which
24476         interacts with the Mono Debugger here.
24477
24478 2003-04-22  Dietmar Maurer  <dietmar@ximian.com>
24479
24480         * domain.c (mono_init): initialize mono_defaults.monitor_class
24481
24482 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
24483
24484         * reflection.c (method_encode_code): Add a spicy exception to help
24485         future compiler authors.
24486
24487 2003-04-21  Martin Baulig  <martin@ximian.com>
24488
24489         * icall.c
24490         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
24491         Make this work with relative pathnames; g_filename_to_uri() needs
24492         an absolute filename.
24493
24494 2003-04-18  Zoltan Varga  <vargaz@freemail.hu>
24495
24496         * icall.c: Track name changes in Object and ValueType.
24497
24498 2003-04-18  Dietmar Maurer  <dietmar@ximian.com>
24499
24500         * metadata.c (mono_type_stack_size): size should be a multiple of
24501         sizeof (gpointer)
24502
24503 2003-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24504
24505         * gc.c:
24506         (internal_domain_finalize): moved into mono_domain_finalize. No need
24507         to create another thread because the finalizers will be run in the
24508         finalizer thread.
24509         
24510         (ves_icall_System_GC_WaitForPendingFinalizers): implemented.
24511         (finalizer_notify): if shutting down, wait 2 seconds for the finalizers
24512         to be run (MS does this too).
24513
24514 2003-04-17  Zoltan Varga  <vargaz@freemail.hu>
24515
24516         * object.c (mono_class_compute_gc_descriptor): Update comment.
24517
24518         * loader.h marshal.h marshal.c: Added synchronized method wrappers.
24519
24520         * image.h: Add synchronized wrapper cache.
24521
24522         * image.c (do_mono_image_open): Initialize cache.
24523
24524         * reflection.c (create_dynamic_mono_image): Initialize cache.
24525
24526 2003-04-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24527
24528         * icall.c: patch by Jerome Laban <jlaban@wanadoo.fr> that fixes
24529         ves_icall_System_Buffer_ByteLengthInternal.
24530
24531 Tue Apr 15 13:56:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
24532
24533         * reflection.c: setup klass->nested_in earlier. Allow
24534         a dash in the assembly name.
24535
24536 2003-04-15  Dietmar Maurer  <dietmar@ximian.com>
24537
24538         * metadata.c (mono_type_to_unmanaged): dont access
24539         type->data.klass for MONO_TYPE_OBJECT
24540         (mono_type_to_unmanaged): consider System.Delegate class
24541
24542 Tue Apr 15 11:16:05 CEST 2003 Paolo Molaro <lupus@ximian.com>
24543
24544         * class.c: just setup supertypes in the proper place instead of
24545         initializing the full element class for arrays.
24546
24547 Tue Apr 15 11:03:25 CEST 2003 Paolo Molaro <lupus@ximian.com>
24548
24549         * class.c: ensure the element class of arrays is initialized.
24550         Setup the supertype info for array classes, too.
24551
24552 2003-04-14  Miguel de Icaza  <miguel@ximian.com>
24553
24554         * icall.c (ves_icall_Type_GetNestedType): Add new internal call.
24555
24556 2003-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24557
24558         * Makefile.am: re-added -m option when running cygpath. This way,
24559         MONO_ASSEMBLIES and MONO_CFG_DIR will contain '/' as directory
24560         separator.
24561         * mono-config.c: same codepath for locating mono config file for WIN32
24562         and the rest.
24563         * assembly.c: if mono_assembly_setrootdir is called, don't override
24564         the value set.
24565
24566 2003-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24567
24568         * Makefile.am: patch by Urs Muff <umuff@quark.com> that fixes
24569         MONO_ASSEMBLIES variable.
24570
24571 Fri Apr 11 12:44:15 CEST 2003 Paolo Molaro <lupus@ximian.com>
24572
24573         * icall.c: added Assembly::GetNamespaces() icall.
24574
24575 2003-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24576
24577         * reflection.c: fix from Jaak <jaak@zd.com.pl>.
24578
24579 2003-04-10  Lluis Sanchez Gual  <lluis@ideary.com>
24580
24581         * appdomain.c,appdomain.h,icall.c: Added internal method that returns the process guid
24582         * object.c: fixed bug in the construction of vtable for proxies
24583
24584 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
24585
24586         * object.c (mono_array_new): Mark mono_array_new as an icall.
24587
24588 2003-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24589
24590         * class.c: fixed test for public method when overriding interfaces.
24591         Closes bug #40970.
24592
24593 Wed Apr 9 15:19:41 CEST 2003 Paolo Molaro <lupus@ximian.com>
24594
24595         * appdomain.h, domain.c: added mono_domain_foreach() to
24596         be able to access the currently loaded appdomains.
24597         * object.c: make string interning work across sppdomains.
24598         Mark some functions for use as icalls.
24599
24600 2003-04-09  Zoltan Varga  <vargaz@freemail.hu>
24601
24602         * class.c reflection.c: Fix memory leaks reported by ccmalloc.
24603
24604         * reflection.h reflection.c: Allocate long living data using 
24605         GC_MALLOC_ATOMIC so the collector does not need to scan it.
24606
24607         * reflection.c: Double the allocation size in streams instead of
24608         increasing it, to prevent unneccesary copying on large assemblies.
24609         
24610         * reflection.c (mono_reflection_create_runtime_class): Avoid vtable
24611         creation if the assembly does not have the Run flag set.
24612
24613 Tue Apr 8 11:19:53 CEST 2003 Paolo Molaro <lupus@ximian.com>
24614
24615         * class.h: avoid the C++ keywords in header files (Jerome Laban
24616         spotted and fixed this).
24617
24618 2003-04-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24619
24620         * object.c:
24621         (mono_unhandled_exception): fill in the arguments for the
24622         UnhandledException event. Only trigger that event for the default
24623         domain (as MS does).
24624
24625 2003-04-04  Zoltan Varga  <vargaz@freemail.hu>
24626
24627         * object.c: Improve typed allocation stuff based on suggestions from
24628         Paolo. Also turn it on if the GC library supports it.
24629
24630 2003-04-03  Zoltan Varga  <vargaz@freemail.hu>
24631
24632         * object.c object.h class.h: Added experimental typed allocation
24633         facility using the interfaces in gc_gcj.h.
24634
24635         * os/gc_wrapper.h: Added new include files.
24636         
24637 2003-04-03  Martin Baulig  <martin@ximian.com>
24638
24639         All the following changes are conditional to `WITH_INCLUDED_LIBGC'
24640         which is not yet enabled by default.
24641
24642         * gc.c (mono_gc_init): Set the gc_thread_vtable to our thread
24643         functions.
24644         (mono_gc_lock, mono_gc_unlock): New static functions.
24645
24646         * threads.c (mono_gc_stop_world, mono_gc_start_world): New public
24647         functions; stop/start the world for the garbage collector.  This
24648         is using the windows API; we need to complete the SuspendThread()/
24649         ResumeThread() implementation in the io-layer to make this work on Unix.
24650         (mono_gc_push_all_stacks): New public function; tells the garbage
24651         collector about the stack pointers from all managed threads.
24652
24653 2003-04-03  Martin Baulig  <martin@ximian.com>
24654
24655         * object.h (MonoThread): Added `gpointer stack_ptr'.
24656
24657         * threads.c (start_wrapper): Save the stack pointer in `stack_ptr'.
24658
24659 2003-04-03  Martin Baulig  <martin@ximian.com>
24660
24661         * Makefile.am: It's called `cygpath -w', not `cygpath -m'.
24662
24663 2003-04-03  Zoltan Varga  <vargaz@freemail.hu>
24664
24665         * reflection.c (typebuilder_setup_fields): Initialize field.first and
24666         field.last.
24667
24668 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
24669
24670         * loader.c (mono_lookup_internal_call): Report the corlib that is
24671         out of sync.
24672
24673 2003-03-05  Aleksey Demakov <avd@openlinksw.com>
24674
24675         * icall.c (ves_icall_type_GetTypeCode): fixed check for
24676         System.DBNull (it's class not valuetype).
24677
24678 Wed Apr 2 18:37:35 CEST 2003 Paolo Molaro <lupus@ximian.com>
24679
24680         * reflection.c: set table_idx in MonoReflectionArrayMethod object even 
24681         if the array method was already assigned a token (fixes bug#40646).
24682
24683 2003-04-02  Zoltan Varga  <vargaz@freemail.hu>
24684
24685         * reflection.c (mono_reflection_get_type): Attempt type resolve even
24686         if no assembly is given.
24687
24688 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
24689
24690         * metadata.h: Added the new tables.
24691
24692         * row-indexes.h: Added definitions for new tables.
24693
24694         * metadata.c: Add schemas for new tables, and add support for
24695         computing the sizes of them.
24696
24697         * class.c: Update for handling the new type cases.
24698
24699 2003-04-01  Dietmar Maurer  <dietmar@ximian.com>
24700
24701         * metadata.h (MONO_TYPE_IS_VOID): new macro
24702
24703 2003-03-31  Martin Baulig  <martin@ximian.com>
24704
24705         * threads.h (MonoThreadCallbacks): Added `thread_created'.
24706
24707         * threads.c (mono_thread_new_init): Call `thread_created' in the
24708         mono_thread_callbacks.
24709
24710 2003-03-31  Lluis Sanchez Gual <lluis@ideary.com>
24711
24712         * loader.h: added marshalbyrefobject_class to mono_defaults
24713         * domain.c: added initialization of mono_defaults.marshalbyrefobject_class 
24714         * icall.c: ves_icall_InternalExecute: fixed bug in field setter and in the
24715           generation of output parameters.
24716           ves_icall_Remoting_RealProxy_GetTransparentProxy: added support for interfaces.
24717         * marshal.c: mono_remoting_wrapper(): avoided call through proxy when the type is
24718           contextbound and the target object belongs to the context of the caller.
24719         * object.h: added context and unwrapped_server variables in MonoRealProxy.
24720         * object.c: Implemented support for interfaces and abstract classes
24721           in mono_class_proxy_vtable. Fixed several methods to avoid unneeded calls through
24722           proxy. Fixed problem when dealing with output parameters in mono_runtime_invoke_array.
24723
24724 2003-03-30  Zoltan Varga  <vargaz@freemail.hu>
24725
24726         * class.h class.c (mono_class_is_subclass_of): New function.
24727         
24728         * icall.c (ves_icall_System_Array_FastCopy): Added optimized copy
24729         routines for most common case (calls from ArrayList::ToArray).
24730
24731         * icall.c (ves_icall_System_Environment_Exit): Call profiler shutdown 
24732         routine so programs which call Environment::Exit() can be profiled.
24733
24734         * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle): 
24735         Added MONO_ARCH_SAVE_REGS.
24736
24737         * icall.c (ves_icall_type_is_subtype_of): Use new function.
24738
24739 2003-03-29  Miguel de Icaza  <miguel@ximian.com>
24740
24741         * blob.h: Add a couple of new MonoType types definitions.
24742
24743         * tabledefs.h: Add a couple of new call convs.
24744
24745 2003-03-27  Zoltan Varga  <vargaz@freemail.h>
24746
24747         * reflection.h (MonoReflectionDynamicAssembly): track changes in
24748         the layout of the class.
24749
24750         * reflection.c (alloc_table): double the size on overflow to avoid
24751         unnecessary copying.
24752
24753         * reflection.h reflection.c: If AssemblyBuilderAccess is Run, then
24754         avoid filling out metadata tables and blobs. Also set mb->ilgen to
24755         null so it can be garbage collected.
24756         
24757 2003-03-27  Zoltan Varga  <vargaz@freemail.hu>
24758
24759         * reflection.c (mono_reflection_get_type): Return the resolved type
24760         only if it is in the assembly we searched.
24761
24762         * reflection.c (ensure_runtime_vtable): Initialize method slots.
24763
24764         * class.c (mono_class_setup_vtable): Set the slot of the overriding
24765         method.
24766
24767 2003-03-26  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24768
24769         * appdomain.c:
24770         (set_domain_search_path): allow 'file://blah'. It's an invalid URI,
24771         the right one is 'file:///blah', but MS allows it.
24772         * assembly.c:
24773         (mono_assembly_open): allow 'file://blah'
24774
24775         Fixes bug #40306. Thanks to Mitko Iliev (imitko@openlinksw.co.uk).
24776
24777 2003-03-26  Aleksey Demakov <avd@openlinksw.com>
24778
24779         * socket-io.c: fixes bug #40310.
24780
24781 2003-03-25  Zoltan Varga  <vargaz@freemail.hu>
24782
24783         * reflection.c (mono_reflection_parse_type): handle deeply nested
24784         types correctly.
24785
24786         * reflection.c (mono_image_create_token): Use unique token values
24787         since they will be put into a hash table.
24788
24789         * class.c (mono_class_setup_vtable): If a method occurs in more than
24790         one place in the vtable, and it gets overriden, then change the
24791         other occurances too.
24792
24793         * marshal.c (mono_marshal_get_managed_wrapper): Added support for
24794         object as return type.
24795
24796 2003-03-22  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
24797
24798         * icall.c: Deleted "ToString" implementation for double and float
24799         because they are full implemented in managed code.
24800
24801 Wed Mar 19 18:05:57 CET 2003 Paolo Molaro <lupus@ximian.com>
24802
24803         * reflection.c, reflection.h: implemented and exported functions
24804         to retrieve info about custom attributes.
24805
24806 2003-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24807
24808         * appdomain.c: moved Uri handling to assembly.c
24809         * assembly.c: use g_filename_from_uri (). This makes assembly.LoadFrom
24810         work when using a file Uri in *nix and windows.
24811
24812         * icall.c: fixed Assembly.CodeBase to return a valid Uri. The same for
24813         GetReferencedAssemblies.
24814
24815 2003-03-18  Dick Porter  <dick@ximian.com>
24816
24817         * icall.c: Rename a couple of internal calls
24818
24819         * threads.c: Set the thread state to Stopped when a thread exits.
24820         Fixes bug 39377.
24821
24822 2003-03-17  Zoltan Varga  <vargaz@freemail.hu>
24823
24824         * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle):
24825         New icall.
24826
24827         * object.c (mono_class_vtable): fix warning.
24828
24829 2003-03-17  Zoltan Varga  <vargaz@freemail.hu>  
24830
24831         * icall.c (ves_icall_type_is_subtype_of): Avoid vtable creation.
24832
24833         * reflection.c (mono_blob_entry_hash): Avoid reading uninitialized
24834         memory.
24835         (method_encode_clauses): Create exception info structures in the right
24836         order.
24837         (mono_reflection_setup_internal_class): Initialize supertypes field.
24838
24839         * class.c object.c: Handle interfaces which implement other interfaces 
24840         correctly.
24841
24842         * class.h class.c: Move the supertypes array initialization code into 
24843         a separate function so it can be used for dynamic types too. Also call
24844         it earlier, in mono_class_init(), since it can be used before the
24845         type is initialized.
24846
24847 2003-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24848
24849         * Makefile.am:
24850         * assembly.c:
24851         * icall.c: make MONO_ASSEMBLIES and MONO_CFG_DIR work on windows.
24852
24853         * appdomain.c:
24854         * appdomain.h:
24855         * marshal.c:
24856         * object.c: remove warnings.
24857
24858 2003-03-13  Martin Baulig  <martin@ximian.com>
24859
24860         * debug-mono-symfile.h (MonoSymbolFileLexicalBlockEntry): New type.
24861         (MonoDebugLexicalBlockEntry): New types.
24862
24863         * debug-mono-symfile.c
24864         (_mono_debug_address_from_il_offset): Moved here from ../jit/debug.c.
24865
24866 2003-03-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24867
24868         * process.c: ret can be any non-zero value accroding to MS doc.
24869
24870 2003-03-07  Miguel de Icaza  <miguel@ximian.com>
24871
24872         * class.c (mono_marshal_load_type_info): Fix buglet:  Noticed when
24873         fixing a warning for a miss-used prototype, would have cause
24874         random memory corruption.
24875
24876 2003-03-07  Martin Baulig  <martin@ximian.com>
24877
24878         * marshal.c (mono_marshal_free_array): That "TESTFREE %p" was
24879         getting really annoying ....
24880
24881 2003-03-07  Zoltan Varga  <vargaz@freemail.hu>
24882
24883         * reflection.c (fixup_method): added support for array methods.
24884
24885 Tue Mar 4 18:03:27 CET 2003 Paolo Molaro <lupus@ximian.com>
24886
24887         * socket-io.c:  handle case when AF_INET6 and AF_IPX are not defined
24888         (pointed out by Michael Adams).
24889
24890 2003-03-04  Dick Porter  <dick@ximian.com>
24891
24892         * icall.c: Temporarily reverted the Double and Single ToString()
24893         change, because it broke nunit.
24894
24895 Tue Mar 4 12:40:58 CET 2003 Paolo Molaro <lupus@ximian.com>
24896
24897         * object.h, threads.h: make include files compatible with C++
24898         (patch by Jerome Laban <jlaban@wanadoo.fr>).
24899
24900 2003-03-04  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
24901
24902         * icall.c: Erased ToString helper functions for Double and Single.
24903         Now, that implementations ar all in managed code (Double and Single
24904         Formatters).
24905
24906 2003-03-03  Lluis Sanchez Gual  <lluis@ideary.com>
24907
24908         * appdomain.c: Added method for initializing the default context of
24909         a domain. Added internal call for getting the default context.
24910         * appdomain.h: Added context variable in MonoDomain struct.
24911         * domain.c: mono_domain_set also sets the default context of the domain
24912         * icall.c: Mapped internal method InternalGetDefaultContext.
24913         * object.c: mono_object_get_virtual_method returns always a remoting
24914         wrapper if the object is a transparent proxy.
24915         mono_runtime_invoke_array: when creating an object by calling the
24916         constructor, if the created object is a proxy, then the constructor should
24917         be called using the a remoting wrapper.
24918
24919 2003-03-03  Dick Porter  <dick@ximian.com>
24920
24921         * socket-io.c (create_sockaddr_from_object): Rename sockaddr_un
24922         variable so it compiles on solaris.  Problem spotted by
24923         Christopher Taylor <ct@cs.clemson.edu>
24924
24925 2003-03-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24926
24927         * appdomain.c:
24928         (get_info_from_assembly_name): don't leak value.
24929
24930         * icall.c:
24931         (ves_icall_System_Reflection_Assembly_GetFilesInternal): initialize
24932         result.
24933
24934 Sat Mar 1 15:32:56 CET 2003 Paolo Molaro <lupus@ximian.com>
24935
24936         * assembly.c: export mono_image_load_references ().
24937         * class.c: handle function pointers. mono_class_from_name() now
24938         supports nested type names directly.
24939
24940 2003-02-28  Zoltan Varga  <vargaz@freemail.hu>
24941
24942         * reflection.h reflection.c: Encode already created dynamic methods 
24943         and fields correctly as a DEF instead of a REF.
24944
24945         * reflection.c: Get rid of the force_ref argument to 
24946         mono_image_typedef_or_ref since it was wrong in the first place.
24947
24948         * string-icalls.c: add error checking to string constructors according
24949         to the MSDN docs.
24950
24951         * reflection.c: Emit types in the order their TypeBuilders were 
24952         created. Previously, a new table index was assigned to each type before
24953         the tables were emitted. This was wrong because the signature blob
24954         might already refer to a type by its original table index.
24955
24956 2003-02-27  Zoltan Varga  <vargaz@freemail.hu>
24957
24958         * metadata.c (mono_metadata_nesting_typedef): fix bug in previous
24959         change.
24960         
24961 2003-02-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24962
24963         * Makefile.am: make assemblies dir have \ instead of / on windows.
24964
24965 2003-02-27  Zoltan Varga  <vargaz@freemail.hu>  
24966
24967         * metadata.c metadata.h (mono_metadata_nesting_typedef): changed to
24968         iterate over the NESTEDCLASS table using a linear search since the
24969         table is not guaranteed to be sorted by the secondary key.
24970
24971         * class.c (mono_class_create_from_typedef): fixed up call to
24972         mono_metadata_nesting_typedef.
24973         
24974 2003-02-27  Dietmar Maurer  <dietmar@ximian.com>
24975
24976         * marshal.c (mono_string_to_byvalstr): clear the memory as
24977         suggested by Jerome Laban <jlaban@wanadoo.fr>
24978
24979 2003-02-26  Dick Porter  <dick@ximian.com>
24980
24981         * process.c: Cope with padding in .rsrc blocks
24982
24983 2003-02-26  Dietmar Maurer  <dietmar@ximian.com>
24984
24985         * metadata.h: reverted the filter_len change, it breaks reflection
24986         
24987 2003-02-26  Dietmar Maurer  <dietmar@ximian.com>
24988
24989         * metadata.h: added a new field to store the filter_len
24990         
24991
24992 Tue Feb 25 10:56:16 CET 2003 Paolo Molaro <lupus@ximian.com>
24993
24994         * reflection.c: handle custom attributes for types and members
24995         created with Reflection.Emit (bug#38422).
24996
24997 2003-02-22  Zoltan Varga  <vargaz@freemail.hu>
24998
24999         * reflection.c: define RTSpecialName automatically for constructors for
25000         compatibility with MS.NET.
25001
25002         * reflection.c (mono_reflection_create_runtime_class): initialize
25003         nested_in field of dynamically created classes.
25004
25005 2003-02-22  Martin Baulig  <martin@ximian.com>
25006
25007         * debug-mono-symfile.h: Incremented version number.
25008
25009 2003-02-21  Zoltan Varga  <vargaz@freemail.hu>
25010
25011         * object.h icall.c process.c: fix warnings.
25012
25013 2003-02-21  Zoltan Varga  <vargaz@freemail.hu>
25014
25015         * appdomain.h appdomain.c:
25016         (mono_domain_try_type_resolve): split the 
25017         name_or_tb argument into a name and a tb argument.
25018         (mono_domain_has_type_resolve): new function to check whenever the
25019         application has registered a TypeResolve event handler.
25020         
25021         * icall.c reflection.h reflection.c: move the type resolve logic into
25022         mono_reflection_get_type () so it will be invoked when 
25023         Assembly::GetType () is called.
25024
25025         * reflection.c:
25026         (mono_reflection_get_type): renamed to get_type_internal.
25027         (mono_reflection_get_type): fixed type name generation so it works 
25028         for nested types too.
25029         (mono_reflection_get_type): call has_type_resolve () to avoid the 
25030         costly type name generation if there is no resolve event handler.
25031
25032 Fri Feb 21 11:36:57 CET 2003 Paolo Molaro <lupus@ximian.com>
25033
25034         * class.c, image.c: load exported types from file references.
25035
25036 2003-02-19  Lluis Sanchez Gual  <lluis@ideary.com>
25037
25038         * appdomain.h: Added in MonoDomain a couple of MonoMethod* variables
25039           used to cache the managed methods used to create proxies and make 
25040           remote invocation of methods.
25041         * class.h: Added in MonoVTable a flag to indicate that a class needs 
25042           to be remotely created.
25043         * object.c: Modified the method mono_class_vtable(). It now initializes 
25044           the remote flag of the vtable. Modified mono_object_new_specific(), 
25045           so now it checks the remote flag.
25046         * icall.c: Added a couple of internal methods, one for enabling instance 
25047           creation interception for a type, and one for creating objects bypassing
25048           the remote check.
25049
25050 2003-02-18  Martin Baulig  <martin@ximian.com>
25051
25052         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetMethodToken):
25053         New interncall to get a method's metadata token.
25054
25055         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetMethodToken"):
25056         New interncall for the debugger.
25057
25058 2003-02-18  Dietmar Maurer  <dietmar@ximian.com>
25059
25060         * class.c (mono_class_setup_vtable): allocate supertype array
25061
25062 2003-02-18  Martin Baulig  <martin@ximian.com>
25063
25064         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Added `has_this'.
25065
25066 2003-02-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25067
25068         * reflection.c:
25069         (assembly_name_to_aname): jump over unknown properties (i've found
25070         something like: 'type, assembly, version=xxx, custom=null, public...',
25071         so now will ignore custom=null and still get the rest of the values).
25072
25073 2003-02-17  Dick Porter  <dick@ximian.com>
25074
25075         * threads.c: Have Thread.Start() wait for a semaphore to signal
25076         that the thread has set up all its local data.  This fixes bug
25077         34323, where Abort() raced the new thread's TLS data.
25078
25079         Also removes the handle_store() call from start_wrapper, because
25080         threads are now always created suspended and there is no longer a
25081         race between the parent and child threads to store the info.
25082
25083 Mon Feb 17 13:13:31 CET 2003 Paolo Molaro <lupus@ximian.com>
25084
25085         * image.c: explain the #- heap issue in a message, hopefully
25086         avoiding FAQs on mono-list.
25087
25088 2003-02-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25089
25090         * icall.c:
25091         (GetEntryAssembly): if the domain has not invoked
25092         AppDomain.ExecuteAssembly yet, return the assembly of the default
25093         AppDomain.
25094
25095 2003-02-16  Zoltan Varga  <vargaz@freemail.hu>
25096
25097         * class.c (mono_ldtoken): make it work in dynamic assemblies.
25098
25099 Sun Feb 16 13:10:06 CET 2003 Paolo Molaro <lupus@ximian.com>
25100
25101         * metadata.c, reflection.c: simple speedup to type hash
25102         and equals code.
25103
25104 Sat Feb 15 15:15:03 CET 2003 Paolo Molaro <lupus@ximian.com>
25105
25106         * image.c, image.h, class.c, assembly.c: move module loading
25107         to MonoImage. When loading metadata, consider alignemnet from
25108         the start of metadata, not from the metadata address in memory.
25109
25110 2003-02-13  Zoltan Varga  <vargaz@freemail.hu>
25111
25112         * reflection.c (mono_reflection_get_custom_attrs): Added support for 
25113         AssemblyBuilder objects. Factored out custom attribute creation into
25114         a separate function.
25115         (create_custom_attr): new function to create custom attributes.
25116
25117 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
25118
25119         * Makefile.am: Got tired of typing the full pathname to pedump.
25120         Until there is another option, am installing this.
25121
25122 2003-02-12  Dietmar Maurer  <dietmar@ximian.com>
25123
25124         * class.c (class_compute_field_layout): always set field->parent 
25125         (mono_ldtoken): use mono_defaults.fieldhandle_class;
25126
25127 2003-02-11  Dick Porter  <dick@ximian.com>
25128
25129         * threads-types.h:
25130         * monitor.c: Rewrote Monitor, making lock much faster and
25131         Pulse/Wait work as specified.  Also uses much fewer handles, and only
25132         creates them as needed.
25133
25134         * exception.c: Added SynchronizationLockException
25135
25136         * threads.c: Deleted old Monitor implementation.  The new one is
25137         in a new file.
25138
25139 Mon Feb 10 17:54:10 CET 2003 Paolo Molaro <lupus@ximian.com>
25140
25141         * class.c: handled TypedReference type code. Set the correct size for
25142         class data. Setup interface_offsets for interface classes, too.
25143
25144 2003-02-09  Martin Baulig  <martin@ximian.com>
25145
25146         * debug-mono-symfile.h: Reflect latest symbol writer changes.
25147
25148 Sun Feb 9 18:37:01 CET 2003 Paolo Molaro <lupus@ximian.com>
25149
25150         * loader.c: implemented MEMBERREF_PARENT_TYPEDEF.
25151         * metadata.c, reflection.c: missing MONO_TYPE_TYPEDBYREF handling.
25152         * object.c: fixed mono_object_get_virtual_method () for interfaces.
25153         * verify.c: check for code that runs after the end of the method.
25154
25155 2003-02-08  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
25156
25157         * icall.c: Added "System.Math::Floor", "System.Math::Round" and
25158         "System.Math::Round2".
25159         * sysmath.h: Added Floor, Round and Round2 definitions.
25160         * sysmath.c: Modified certain functions that were not 100% compliant
25161         with MS.NET (math precision) and added the implementation of Floor,
25162         Round and Round2.
25163
25164 2003-02-07  Martin Baulig  <martin@ximian.com>
25165
25166         * debug-mono-symfile.c (mono_debug_symfile_add_method): Ignore interncalls.
25167
25168 2003-02-07  Martin Baulig  <martin@ximian.com>
25169
25170         * debug-mono-symfile.c: Reflected latest symwriter changes.
25171         (mono_debug_create_mono_symbol_file): Removed.
25172         (mono_debug_open_mono_symbol_file): Take an argument which
25173         specifies whether to create a dynamic symbol file.
25174
25175 2003-02-07  Dietmar Maurer  <dietmar@ximian.com>
25176
25177         * class.c (mono_class_from_mono_type): added MONO_TYPE_TYPEDBYREF
25178
25179 2003-02-05  Martin Baulig  <martin@ximian.com>
25180
25181         * reflection.c (mono_image_build_metadata): Make this public,
25182         protect it against being called multiple times, don't create
25183         resources and don't build the compressed metadata here.
25184         (mono_image_create_pefile): Do this here.
25185
25186         * icall.c
25187         ("System.Reflection.Emit.AssemblyBuilder::build_metadata"): Added.
25188
25189 2003-02-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25190
25191         * socket-io.c: fixed bug #36322.
25192
25193 2003-02-06  Piers Haken <piersh@friskit.com>
25194
25195         * appdomain.[ch]:
25196         * class.h:
25197         * debug-mono-symfile.c:
25198         * icall.c:
25199         * loader.c:
25200         * mono-config.c:
25201         * monosn.c:
25202         * reflection.c:
25203         * socket-io.c: warning cleanups
25204
25205 2003-02-06  Dietmar Maurer  <dietmar@ximian.com>
25206
25207         * marshal.c (mono_marshal_get_remoting_invoke_with_check): new
25208         function. works like remoting invoke, but does a check for the Proxy first.
25209
25210 2003-02-05  Miguel de Icaza  <miguel@ximian.com>
25211
25212         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Make it compiler.
25213
25214 2003-02-05  Dietmar Maurer  <dietmar@ximian.com>
25215
25216         * marshal.c (mono_marshal_get_native_wrapper): only allocate an
25217         array of pointers.
25218         (mono_marshal_get_ldfld_wrapper): only generate necessary ldfld wrappers.
25219         (mono_marshal_get_stfld_wrapper): only generate necessary stfld wrappers.
25220
25221         * object.c (mono_store_remote_field_new): used by the new jit
25222         instead of mono_store_remote_field
25223         (mono_load_remote_field_new): used by the new jit
25224         instead of mono_load_remote_field
25225
25226 2003-02-05  Patrik Torstensson
25227
25228         * appdomain.c: changed unload to take the domain id instead
25229         of domain
25230         
25231         * icall.c: changed icall for AppDomain.Unload to AppDomain.InternalUnload
25232
25233
25234 2003-02-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25235
25236         * appdomain.c: don't look for assemblies in ApplicationBase if
25237         PrivateBinPathProbe is set.
25238
25239 2003-02-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25240
25241         * object.c: make the first argument in main_args contain the absolute
25242         path to the assembly. Fixes bug #37511.
25243
25244 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25245
25246         * icall.c: get correct UTC offset for countries not using daylight
25247         time saving. Fixes bug #30030.
25248
25249 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25250
25251         * socket-io.c: support AF_UNIX and use the same layout as MS (bytes 0
25252         and 1 are the family).
25253
25254 2003-02-04  Dietmar Maurer  <dietmar@ximian.com>
25255
25256         * icall.c (ves_icall_InternalExecute): removed wrong assertion
25257
25258         * marshal.c (mono_marshal_get_remoting_invoke): generate valid IL
25259
25260 2003-02-04  Zoltan Varga  <vargaz@freemail.hu>
25261
25262         * reflection.c: added support for SignatureHelper tokens, which is
25263         needed by the Calli opcode.
25264
25265         * reflection.h: track changes to SignatureHelper class.
25266
25267         * metadata.c (mono_metadata_parse_signature): handle dynamic tokens.
25268
25269 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25270
25271         * appdomain.c: fixed loading assemblies from PrivateBinPath.
25272
25273 2003-02-03  Patrik Torstensson
25274         * appdomain.[c|h], domain.c : 
25275          - Added support for getting a domain via domain id
25276          - Support for setting and getting domain from System.AppDomain 
25277            (used in cross appdomain channel)
25278          - Added support for get/set for a MonoAppContext on a thread 
25279            (Context class in System.Runtime.Remoting.Contexts),
25280          - Removed hack in Get/SetData and ExecuteAssembly.
25281         
25282         * icall.c : renamed GetTransparantProxy to InternalGetTransparantProxy to allow
25283         the managed world to get control when a proxy is created.
25284
25285         * icall.c (ves_icall_InternalExecute) : bug fix, must return empty array
25286         
25287 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
25288
25289         * icall.c
25290         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
25291         Populate the codebase field as well.
25292
25293 2003-02-02  Martin Baulig  <martin@ximian.com>
25294
25295         * debug-mono-symfile.c
25296         (MonoSymbolFileMethodAddress): Added `wrapper_address' field.
25297         (mono_debug_symfile_add_method): Allow interncalls.
25298
25299 2003-01-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25300
25301         * icall.c: throw parse exception if strtod fails or the string is empty.
25302
25303 Fri Jan 31 16:09:48 CET 2003 Paolo Molaro <lupus@ximian.com>
25304
25305         * marshal.c: handle object type separately from defined
25306         class types.
25307
25308 Fri Jan 31 16:01:20 CET 2003 Paolo Molaro <lupus@ximian.com>
25309
25310         * marshal.c: handle NATIVE_LPSTR for strings when it's
25311         explicitly specified.
25312
25313 Fri Jan 31 11:51:43 CET 2003 Paolo Molaro <lupus@ximian.com>
25314
25315         * reflection.c, reflection.h, icall.c: setup the reflection
25316         handle cache for ModuleBuilders and AssemblyBuilders.
25317
25318 2003-01-30  Dietmar Maurer  <dietmar@ximian.com>
25319
25320         * reflection.c (reflection_methodbuilder_to_mono_method): set
25321         pinvoke flag
25322
25323 2003-01-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25324
25325         * icall.c: implemented ves_icall_MonoMethod_get_base_definition.
25326
25327 2003-01-29  Dick Porter  <dick@ximian.com>
25328
25329         * threads.c: No need for the fake_thread kludge now that Thread
25330         doesn't run a class constructor
25331         
25332 2003-01-29  Dick Porter  <dick@ximian.com>
25333
25334         * threads.c: Use g_direct_hash instead of the rather bogus
25335         g_int_hash
25336
25337 2003-01-29  Dietmar Maurer  <dietmar@ximian.com>
25338
25339         * marshal.c (mono_marshal_get_native_wrapper): add check for null
25340         (fix pinvoke12.exe)
25341         (mono_marshal_get_struct_to_ptr): generate valid IL code
25342         (mono_marshal_get_ptr_to_struct): generate valid IL code
25343         (*): correctly set sig->pinvoke, we need to memdup the signature
25344         to do that
25345
25346 Tue Jan 28 22:57:57 CET 2003 Paolo Molaro <lupus@ximian.com>
25347
25348         * marshal.c, marshal.h: use larger integers in mono_mb_emit_add_to_local()
25349         to avoid overflows (bug spotted and fixed by Jerome Laban <jlaban@wanadoo.fr>).
25350
25351 Tue Jan 28 18:55:19 CET 2003 Paolo Molaro <lupus@ximian.com>
25352
25353         * profiler.c: provide more callers information.
25354
25355 2003-01-28  Dietmar Maurer  <dietmar@ximian.com>
25356
25357         * marshal.c (mono_marshal_get_managed_wrapper): generate valid IL code
25358
25359         * appdomain.h:added fix from Patrik: _MonoAppDomain is a MBR object
25360
25361         * marshal.c (mono_marshal_get_native_wrapper): generate valid IL code
25362
25363 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
25364
25365         * icall.c: (ves_icall_System_CurrentTimeZone_GetTimeZoneData): raise an
25366         exception instead of going into an infinite loop on dates which it 
25367         can't yet handle.
25368
25369         * string-icalls.c (ves_icall_System_String_get_Chars): raise 
25370         out-of-range exception if needed.
25371
25372         * class.c (mono_class_setup_vtable): allow a virtual method to provide
25373         an implementation for an interface method and to override an inherited
25374         method at the same time. 
25375         Imagine a scenario when a virtual method is used to override a
25376         virtual abstract method in a parent class, and this same method 
25377         provides an implementation for an method inherited from an interface. 
25378         In this case, the interface resolution code will set im->slot, which 
25379         means that the virtual method override pass will skip this method 
25380         which means a pointer to the abstract method inherited from the parent
25381         will remain in the vtable of this non-abstract class.
25382
25383         * class.c: (mono_class_setup_vtable): continue search for a real 
25384         method if only an abstract method is found.     
25385
25386 Mon Jan 27 17:12:19 CET 2003 Paolo Molaro <lupus@ximian.com>
25387
25388         * reflection.c: add size to encoding for ByValStr and ByValArray
25389         marshal blob (from "Jerome Laban" <jlaban@wanadoo.fr>).
25390
25391 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
25392
25393         * class.c (mono_class_setup_vtable): pass the override info as an
25394         argument.
25395
25396         * class.c (mono_class_setup_vtable): set the slot of overriding methods
25397         correctly.
25398         
25399         * reflection.c (ensure_runtime_vtable); add support for method 
25400         overrides.
25401         
25402 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
25403
25404         * reflection.c (resolution_scope_from_image): Hack to work to work with
25405         dynamic assemblies.
25406
25407         * reflection.c (mono_image_typedef_or_ref): renamed to ..._aux and 
25408         added a 'force_ref' argument to force this function to allways return 
25409         a TypeRef. This is needed by mono_image_get_memberref_token ().
25410         
25411 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
25412
25413         * reflection.c (mono_image_get_type_info): interfaces really don't have
25414         a parent.
25415
25416         * reflection.c (mono_image_basic_init): fill out missing fields of
25417         image structure.
25418
25419         * reflection.c (mono_image_basic_init): Invoke assembly load hooks for 
25420         dynamic assemblies. This is required so dynamic assemblies show up in
25421         AppDomain.GetAssemblies (), emit an AssembyLoadEvent, gets searched by
25422         Type::GetType() etc. This is consistent with MS behaviour.
25423
25424         * image.c image.h reflection.c: add newly created classes to the name 
25425         cache so mono_class_get () will find them.      
25426
25427 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
25428
25429         First part of changes to get IKVM.NET running under mono.
25430         
25431         * appdomain.h, appdomain.c: added new function 
25432         mono_domain_try_type_resolve() which will emit TypeResolve events. 
25433         This function will call AppDomain::DoTypeResolve to do the actual work.
25434
25435         * class.h, class.c, loader.c, object.c, reflection.h, reflection.c: 
25436         moved existing code dealing with dynamic tokens to a new function 
25437         called mono_reflection_lookup_dynamic_token (). This function will 
25438         raise TypeResolve events when appropriate. Since reflection.c is not 
25439         part of libmetadata, a new hook function called 
25440         mono_lookup_dynamic_token() is added to class.c which will call this.
25441
25442         * assembly.h assembly.c: make the invoke_load_hook function public,
25443         so it can be called for dynamic assemblies.
25444
25445         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): skip interfaces since they do not have initializers.
25446
25447         * icall.c (ves_icall_type_from_name): emit a TypeResolve event if the 
25448         type isn't found.
25449
25450         * reflection.c reflection.h: change MonoDynamicAssembly.tokens to a 
25451         MonoGHashTable, since it contains pointers to objects which the GC 
25452         needs to track.
25453
25454         * assembly.c (search_loaded): remove unused variable.
25455         
25456 Mon Jan 27 12:18:45 CET 2003 Paolo Molaro <lupus@ximian.com>
25457
25458         * object.c: fixed issue exposed by gcc-generated IL programs
25459         that use RVA data for pointers.
25460
25461 2003-01-25  Martin Baulig  <martin@ximian.com>
25462
25463         * threads.c (start_wrapper): Moved the initialization of
25464         `start_func' above the mono_new_thread_init() call to which we
25465         pass it as argument.
25466
25467 2003-01-24  Martin Baulig  <martin@ximian.com>
25468
25469         * threads.h (MonoThreadCallbacks): Pass the thread ID instead of
25470         the MonoThread pointer.
25471
25472 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
25473
25474         * icall.c: Rename `PowImpl' to Pow.
25475
25476 2003-01-23  Dick Porter  <dick@ximian.com>
25477
25478         * threads.c (start_wrapper): Create a Thread object if needed, so
25479         the Main() thread can do the class initialisation in a subthread
25480         that has been set up to allow managed code execution.
25481
25482         Pass the thread ID instead of the MonoThread pointer to the thread
25483         start and attach callbacks.  This change is required, because the
25484         jit thread start callback must be called _before_ the Thread
25485         object can be created.
25486         
25487         (mono_thread_init): Removed much object creation code that is no
25488         longer needed.  No managed code is called from here now.
25489
25490         * object.c (mono_runtime_exec_managed_code): Create a subthread
25491         for Main, and call back to the runtime to use it.
25492         Set the exit code when Main exits.
25493
25494         * gc.c: Make sure domain finalisation happens in a subthread.
25495         Re-enable threaded GC, fixing bug 31333 (again).
25496
25497         * environment.c: System.Environment internall calls (so far just
25498         ExitCode is here, the others are still in icall.c)
25499
25500         * appdomain.c (mono_runtime_cleanup): All threads running managed
25501         code should have finished before mono_runtime_cleanup() is
25502         reached, so no need to clean up threads.
25503
25504 2003-01-22  Martin Baulig  <martin@ximian.com>
25505
25506         * appdomain.h (MonoThreadStartCB): Added `MonoThread *thread' and
25507         `gpointer func' arguments.      
25508         (MonoThreadAttachCB): New typedef; like the old MonoThreadStartCB,
25509         but added `MonoThread *thread' argument.
25510         (mono_runtime_init): The last argument is now a MonoThreadAttachCB.
25511
25512         * threads.c (mono_new_thread_init): Added `gpointer func' argument
25513         and pass it to the mono_thread_start_cb callback.
25514         (mono_install_thread_callbacks): New public function to install a
25515         set of callbacks which are set by the debugger.
25516         (mono_thread_init): The last argument is now a MonoThreadAttachCB.
25517
25518 2003-01-22  Martin Baulig  <martin@ximian.com>
25519
25520         * Makefile.am: Install debug-mono-symfile.h.
25521
25522 2003-01-21  Aleksey Demakov <avd@openlinksw.com>
25523
25524         * marshal.c: fixed copy_from_managed and copy_to_unmanaged for 0 length.
25525
25526 2003-01-21  Dietmar Maurer  <dietmar@ximian.com>
25527
25528         * added the following fix from Jackson Harper <jackson@latitudegeo.com>
25529         * class.c (mono_ptr_class_get): correctly set access levels of pointers
25530         (mono_array_class_get): correctly set access levels of arrays
25531
25532 2003-01-20      Patrik Torstensson
25533         * image.h (MonoAssemblyName): changed major, minor, build, revision
25534         from signed to unsigned.
25535
25536 2003-01-20  sean kasun <skasun@azstarnet.com>
25537
25538         * reflection.c (load_cattr_value): Now this handles
25539         MONO_TYPE_SZARRAY.  Fixes bug #35629
25540
25541 2003-01-20  Miguel de Icaza  <miguel@ximian.com>
25542
25543         * marshal.c (emit_struct_conv): Handle MONO_TYPE_PTR as an
25544         integer value
25545
25546 2003-01-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25547
25548         * decimal.c: fixed bug #26056.
25549
25550 2003-01-17  Martin Baulig  <martin@ximian.com>
25551
25552         * gc.c: Raise an ExecutionEngineException instead of using g_error().
25553
25554 2003-01-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25555
25556         * exception.[ch]:
25557         (mono_get_exception_type_initialization): new function.
25558
25559         * object.c: throw a TypeInitializationException when an exception is
25560         thrown invoking the class constructor.
25561
25562 2003-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25563
25564         * reflection.c: fixed attribute reading.
25565
25566 2003-01-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25567
25568         * icall.c:
25569         (ves_icall_type_from_name): make it work as MS. Ie, if no assembly name
25570         provided, look for the type in the calling assembly and then in
25571         mscorlib; if the assembly name is provided, only try that one.
25572
25573 Tue Jan 14 14:52:52 CET 2003 Paolo Molaro <lupus@ximian.com>
25574
25575         * object.c: register the vtable before there is a chance it's
25576         queried again recursively.
25577
25578 2003-01-13  Duncan Mak  <duncan@ximian.com>
25579
25580         * Makefile.am (libmonoruntime_la_SOURCES): Change gc.h to
25581         gc-internal.h. 
25582         
25583 2003-01-12  Patrik Torstensson <totte@race-x-change.com>
25584
25585         * string-icall.[c|h], icall.c: Added support for CompareOrdinal mode
25586
25587 2003-01-11  Martin Baulig  <martin@ximian.com>
25588
25589         * debug-mono-symfile.h (MONO_SYMBOL_FILE_DYNAMIC_VERSION): Incremented
25590         this to 20 for the release.
25591
25592 2003-01-10  Dietmar Maurer  <dietmar@ximian.com>
25593
25594         * marshal.c (emit_struct_conv): added support for EXPLICIT_LAYOUT
25595
25596         * loader.c (mono_method_get_marshal_info): bug fix
25597
25598         * marshal.c (mono_marshal_get_ptr_to_struct): don't convert
25599         structures with explicit layout
25600
25601 Fri Jan 10 15:58:09 CET 2003 Paolo Molaro <lupus@ximian.com>
25602
25603         * profiler.c: made the output more readable (and sorted). 
25604         Added caller information for the allocation profiler.
25605
25606 2003-01-09  Sebastien Pouliot  <spouliot@videotron.ca>
25607
25608         * icall.c, rand.c, rand.h: Prepended RNG functions with Internal.
25609
25610 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25611
25612         * icall.c: added ves_icall_System_Activator_CreateInstanceInternal. Used
25613         to get value types.
25614         
25615 Thu Jan 9 19:43:11 CET 2003 Paolo Molaro <lupus@ximian.com>
25616
25617         * object.c, profiler.h, profiler.c, profiler-private.h:
25618         Added object allocation profiler.
25619
25620 Thu Jan 9 16:17:00 CET 2003 Paolo Molaro <lupus@ximian.com>
25621
25622         * reflection.h, reflection.c: handle global methods.
25623         Compress blob entries.
25624
25625 Thu Jan 9 15:54:53 CET 2003 Paolo Molaro <lupus@ximian.com>
25626
25627         * marshal.c: fix compilation.
25628
25629 2003-01-09  Dietmar Maurer  <dietmar@ximian.com>
25630
25631         * loader.c (mono_method_get_marshal_info): impl.
25632
25633         * metadata.c (mono_metadata_field_info): use mono_metadata_get_marshal_info
25634
25635 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25636
25637         * icall.c: applied fix from Zoltan Varga that fixes Type.IsPrimitive
25638         for reference types.
25639
25640 Wed Jan 8 20:11:46 CET 2003 Paolo Molaro <lupus@ximian.com>
25641
25642         * loader.c: fixed off by one error in loaded parameter names.
25643
25644 2003-01-08  Dietmar Maurer  <dietmar@ximian.com>
25645
25646         * marshal.c (mono_marshal_get_icall_wrapper): like
25647         mono_marshal_get_native_wrapper, but simpler and use a MonoMethodSignature
25648         instead of a MonoMethod.
25649
25650 2003-01-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25651
25652         * decimal.c: fixed bug #36537.
25653
25654 Mon Jan 6 19:37:59 CET 2003 Paolo Molaro <lupus@ximian.com>
25655
25656         * marshal.c: throw a missing method exception if a
25657         P/Invoke method is not found.
25658
25659 Sun Jan 5 11:57:09 CET 2003 Paolo Molaro <lupus@ximian.com>
25660
25661         * icall.c: allow a null this for constructors.
25662
25663 Sat Jan 4 18:28:42 CET 2003 Paolo Molaro <lupus@ximian.com>
25664
25665         * icall.c: raise the proper exceptions if the arguments to the
25666         internal Invoke are incorrect.
25667
25668 2003-01-03  Dietmar Maurer  <dietmar@ximian.com>
25669
25670         * marshal.c (mono_marshal_get_ptr_to_struct): code cleanups
25671
25672 2003-01-03  Martin Baulig  <martin@ximian.com>
25673
25674         * debug-mono-symfile.h: Increment MONO_SYMBOL_FILE_DYNAMIC_VERSION.
25675
25676 2002-12-31  Martin Baulig  <martin@ximian.com>
25677
25678         * debug-mono-symfile.c: Completely rewrote the type section.
25679         Instead of using individual malloc()ed fields, we use one big
25680         continuous memory area and offsets into this area.
25681         See the comments in the source code for details.
25682
25683 2002-12-30  Martin Baulig  <martin@ximian.com>
25684
25685         * debug-mono-symfile.h (MonoDebugTypeInfo): Renamed to MonoDebugClassInfo.
25686
25687 2002-12-30  Martin Baulig  <martin@ximian.com>
25688
25689         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Include the
25690         line number table in this data blob instead of using an external
25691         pointer.
25692
25693 2002-12-28  Martin Baulig  <martin@ximian.com>
25694
25695         * debug-mono-symfile.h: Increment MONO_SYMBOL_FILE_DYNAMIC_VERSION.
25696
25697 2002-12-22  Rachel Hestilow  <hestilow@ximian.com>
25698
25699         * marshal.c (mono_marshal_get_runtime_invoke): Support MONO_TYPE_CHAR
25700         as a boxed return type.
25701
25702 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
25703
25704         * appdomain.c
25705         (ves_icall_System_AppDomainSetup_InitAppDomainSetup): Use
25706         g_build_filename to properly get separators on the filename created.
25707
25708         * object.h: Small change, introduce MonoMarshalByRefObject to
25709         track the layout of that structure in the C# universe as we make
25710         changes there.
25711
25712 Thu Dec 19 16:23:19 CET 2002 Paolo Molaro <lupus@ximian.com>
25713
25714         * object.c: removed assert to allow static fields on interfaces.
25715         * loader.c: a TypeSpec may be used for any type, not just arrays.
25716
25717 Thu Dec 19 14:19:42 CET 2002 Paolo Molaro <lupus@ximian.com>
25718
25719         * class.c, class.h: added mono_class_array_element_size ().
25720         Ignore static methods in interfaces.
25721
25722 2002-12-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25723
25724         * threads.c: fixed the build under cygwin.
25725
25726 Wed Dec 18 18:43:47 CET 2002 Paolo Molaro <lupus@ximian.com>
25727
25728         * reflection.c: handle nullref constants. Allocate keys for
25729         reflection handles with the GC.
25730
25731 Wed Dec 18 11:34:18 CET 2002 Paolo Molaro <lupus@ximian.com>
25732
25733         * threads.c, threads.h: added mono_thread_get_abort_signal()
25734         to get a suitable signal for thread abort.
25735
25736 Wed Dec 18 11:26:18 CET 2002 Paolo Molaro <lupus@ximian.com>
25737
25738         * metadata.c: fix handling of ExportedType table.
25739
25740 2002-12-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25741
25742         * icall.c: added WriteWindowsDebugString internal call.
25743
25744 2002-12-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25745
25746         * reflection.h: added fields to match C# implementation.
25747
25748 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25749
25750         * icall.c: patch from Jaroslaw Kowalski to fix Environment.MachineName.
25751
25752 2002-12-12  Juli Mallett  <jmallett@FreeBSD.org>
25753
25754         * gc.h, gc-internal.h: Rename header for GC internal calls to
25755         gc-internal.h from gc.h as to not clash with Boehm GC having its
25756         header installed as <gc.h> in outside include paths.
25757         * appdomain.c, gc.c, icall.c, object.c: Account for aforementioned.
25758         * threads.c: If SIGRTMIN is not defined, fall back to SIGUSR1.
25759
25760 2002-12-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25761
25762         * icall.c: assign minor, build and revision in FillName.
25763
25764 2002-12-11  Zoltan Varga  <vargaz@freemail.hu>
25765
25766         * image.h reflection.h reflection.c class.h class.c loader.c object.c:
25767         Added support for running code generated by Reflection.Emit.
25768
25769 2002-12-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25770
25771         * appdomain.c: check for NULL argument in LoadFrom.
25772
25773 2002-12-10  Dick Porter  <dick@ximian.com>
25774
25775         * threads.c: WaitHandle fixes from Tum <tum@veridicus.com>
25776
25777 2002-12-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25778
25779         * appdomain.c: fix buglet when building exe file name.  Handle full
25780         assembly name (needed after latest changes to AssemblyName).
25781         * image.c:
25782         (mono_image_close): free some hashtables.
25783
25784 2002-12-05  Dietmar Maurer  <dietmar@ximian.com>
25785
25786         * threads.c (ves_icall_System_Threading_Thread_Abort): we use SIGRTMIN 
25787         instead of SIGUSR1, because SIGUSR1 is used by the pthread implementation 
25788         on some systems (redhat 7.3) 
25789
25790 Thu Dec 5 16:13:40 CET 2002 Paolo Molaro <lupus@ximian.com>
25791
25792         * threads.c: delete the critical section of a sync block,
25793         spotted and fixed by tum@veridicus.com (Thong (Tum) Nguyen).
25794
25795 Thu Dec 5 12:52:52 CET 2002 Paolo Molaro <lupus@ximian.com>
25796
25797         * pedump.c, cil-coff.h, monosn.c: add strong name cli header flag.
25798
25799 2002-12-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25800
25801         * appdomain.[ch]: handle the assembly preload event to try loading the
25802         assemblies using the paths we have in the current domain.
25803
25804         * assembly.[ch]: created an assembly preload hook that is called to try
25805         loading the assembly by other means that the ones provided here.
25806
25807         * domain.c: initialize the domain search path.
25808
25809         From now on, assemblies (TODO: except corlib and System) are loaded
25810         according to these rules when using mono_assembly_load ():
25811
25812                 1. It tries to load the assembly from the ApplicationBase
25813                 of the current domain appending .dll and .exe (TODO: have to
25814                 try loading from name/name.dll and name/name.exe).
25815
25816                 2. It tries the search path specified in PrivateBinPath for the
25817                 current domain (if any).
25818
25819                 3. Previous behavior.
25820
25821 Wed Dec 4 16:02:25 CET 2002 Paolo Molaro <lupus@ximian.com>
25822
25823         * icall.c: implemented GetInterfaceMap() related icall.
25824         * domain.c, loader.h: load MethodInfo in mono_defaults.
25825
25826 Wed Dec 4 11:02:30 CET 2002 Paolo Molaro <lupus@ximian.com>
25827
25828         * gc.c: disable the finalizer thread for now, untill all the issues
25829         with it are resolved.
25830
25831 Wed Dec 4 10:44:01 CET 2002 Paolo Molaro <lupus@ximian.com>
25832
25833         * string-icalls.c: handle embedded nulls in string ctor when the
25834         length is specified.
25835
25836 Tue Dec 3 19:29:20 CET 2002 Paolo Molaro <lupus@ximian.com>
25837
25838         * class.c: look for explicit interface implementation in parent
25839         classes, too.
25840
25841 2002-12-03  Dietmar Maurer  <dietmar@ximian.com>
25842
25843         * gc.c (run_finalize): dont run the finalizer (strange behaviour on rh7.3) 
25844
25845 Tue Dec 3 12:40:06 CET 2002 Paolo Molaro <lupus@ximian.com>
25846
25847         * gc.c: protect handles with a critical section.
25848
25849 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25850
25851         * icall.c:
25852         (ves_icall_type_from_name): it now has throwOnError and ignoreCase
25853         parameters. If no assembly specified, try getting the type from all
25854         the assemblies in the current domain, else, load the assembly and get
25855         the type from it.
25856
25857 2002-11-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25858
25859         * marshal.c: applied patch from Aleksey Demakov that fixes
25860         ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringUni.
25861
25862 2002-11-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25863
25864         * icall.c: fixed get_location.
25865
25866 2002-11-28  Dietmar Maurer  <dietmar@ximian.com>
25867
25868         * icall.c: moved MONO_ARCH_SAVE_REGS to the end of the
25869         declarations to make it work with older gcc. 
25870
25871         * loader.c (mono_get_method): set signature->pinvoke for native calls
25872
25873 2002-11-20  Dick Porter  <dick@ximian.com>
25874
25875         * threads.c (mono_thread_init): Set the main thread's handle
25876
25877 Tue Nov 19 14:15:34 CET 2002 Paolo Molaro <lupus@ximian.com>
25878
25879         * gc.c: allow compilation without GC support. Changed to match the
25880         mono coding style.
25881
25882 Mon Nov 18 18:41:51 CET 2002 Paolo Molaro <lupus@ximian.com>
25883
25884         * gc.c: don't start the finalizer thread if the env var GC_DONT_GC is set.
25885
25886 Mon Nov 18 16:35:22 CET 2002 Paolo Molaro <lupus@ximian.com>
25887
25888         * reflection.c: set a public key token on the core assemblies.
25889
25890 2002-11-18  Dick Porter  <dick@ximian.com>
25891
25892         * threads.c: Split out some thread initialisation so that other
25893         files can set the start callback function.
25894
25895         * gc.c: Run finalisers in a separate thread, to avoid stack
25896         overflow.  Fixes bug 31333.
25897
25898         * appdomain.c: Set up GC finalisation thread.
25899
25900         * reflection.c: 
25901         * object.c: 
25902         * domain.c: Use gc.h macros for GC_malloc
25903         
25904 2002-11-15  Dick Porter  <dick@ximian.com>
25905
25906         * threadpool.c: 
25907         * threads.c:
25908         * appdomain.c: Removed mono_runtime_init_with_attach(),
25909         mono_thread_create_arg(), and mono_thread_init_with_attach(), by
25910         merging the extra parameter with the existing function.  Removed
25911         unneeded code in mono_thread_attach().
25912
25913 2002-11-14  Dietmar Maurer  <dietmar@ximian.com>
25914
25915         * image.c (mono_image_loaded_by_guid): a method to get loaded
25916         images by guid. 
25917         (load_metadata_ptrs): we store the guid as string.
25918
25919 2002-11-11  Dietmar Maurer  <dietmar@ximian.com>
25920
25921         * assembly.c (mono_assembly_open): check the guid of aot compiled lib.
25922
25923         * metadata.c (mono_guid_to_string): imported method form Zoltan
25924         Varga (slightly modified)
25925
25926         * assembly.c (mono_assembly_open): load precompiled code
25927
25928         * loader.h (MonoMethod): we store the method token for use in the
25929         aot compiler. 
25930
25931 2002-11-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25932
25933         * appdomain.c: insert the loaded assemblies in the domain->assemblies in
25934         the hook function called when an assembly is loaded.
25935         
25936         * domain.c: Modified file.
25937         (mono_domain_assembly_load): removed hash table insertion of assemblies.
25938
25939         Fixes bug #33196.
25940
25941 2002-11-07  Miguel de Icaza  <miguel@ximian.com>
25942
25943         * reflection.c: Map PEFileKind to the value expected by the WinNT
25944         image loader. 
25945
25946 2002-11-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25947
25948         * rand.c: use /dev/urandom. If it fails to open, use the previous one.
25949         Read until the buffer is filled completely.
25950
25951 2002-11-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25952
25953         * icall.c: implemented MonoType.InternalGetEvent ().
25954
25955 2002-11-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25956
25957         * appdomain.c: implemented InitAppDomainSetup. Delayed
25958         AppDomain.SetupInformation until mono_runtime_exec_main, where we get
25959         the entry_assembly.
25960
25961         * assembly.c: base_dir is now an absolute path ending with
25962         G_DIR_SEPARATOR.
25963
25964         * icall.c: modified get_location according to the above changes.
25965
25966         * object.c: init AppDomain.SetupInformation for the default domain after
25967         we have the entry assembly.
25968
25969         * domain.c: when unloading a domain, setup = NULL.
25970
25971 2002-11-04  Dietmar Maurer  <dietmar@ximian.com>
25972
25973         * marshal.c (emit_ptr_to_str_conv): try to fix bug 29548
25974
25975 Sun Nov 3 15:39:28 CET 2002 Paolo Molaro <lupus@ximian.com>
25976
25977         * object.h, object.c: introduced mono_object_get_virtual_method ()
25978         to lookup the method invoked on an object when a callvirt is done on
25979         a method.
25980         * icall.c: make MethodInfo::Invoke() always do a virtual call.
25981
25982 2002-11-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25983
25984         * appdomain.c: invoke AssemblyLoad and AsemblyResolve events in the
25985         current domain when loaded an assembly and failed to load it.
25986
25987         * icall.c: changed ...Assembly_GetType to Assembly_InternalGetType.
25988
25989 2002-10-31  Dick Porter  <dick@ximian.com>
25990
25991         * icall.c: 
25992         * file-io.h: 
25993         * file-io.c: Return the error status in a parameter, as the
25994         GetLastError() value has long since been blown away if we try and
25995         look it up in a subsequent internal call invocation.  Delete the
25996         GetLastError() internal call, because it's useless.
25997
25998 2002-10-31  Dietmar Maurer  <dietmar@ximian.com>
25999
26000         * class.[ch]: added cast_class to fix bug 29517
26001
26002 Wed Oct 30 19:37:32 CET 2002 Paolo Molaro <lupus@ximian.com>
26003
26004         * marshal.c: create valid IL code in the filter clause:
26005         the new JIT is less forgiving:-)
26006
26007 2002-10-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26008
26009         * icall.c: removed get_property internal call.
26010
26011 2002-10-25  Zoltan Varga  <vargaz@freemail.hu>
26012
26013         * appdomain.h domain.c: Added an ID to appdomains.
26014         
26015         * threads.c threads.h icall.c: Implement icall
26016         Thread:GetDomainID(), and remove unused icall 
26017         CurrentThreadDomain_internal.
26018
26019 2002-10-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26020
26021         * icall.c: Don't recurse through the base types in GetConstructor.
26022         Fixes bug #32063. 
26023
26024 Thu Oct 24 16:56:00 CEST 2002 Paolo Molaro <lupus@ximian.com>
26025
26026         * mempool.h, mempool.c: added mono_mempool_empty() and
26027         mono_mempool_stats().
26028
26029 2002-10-23  Dick Porter  <dick@ximian.com>
26030
26031         * file-io.c: 
26032         * file-io.h: 
26033         * icall.c: Added MonoIO.GetFileType internal call
26034
26035 2002-10-17  Dick Porter  <dick@ximian.com>
26036
26037         * appdomain.c (mono_runtime_cleanup): Don't signal the async
26038         delegate semaphore before waiting for all threads to finish,
26039         because new threads can also call async delegates.  Fixes bug
26040         32004.
26041
26042         * threadpool.c (async_invoke_thread): Only wait for 500ms instead
26043         of 3 seconds, in case another async job is queued.  (This part is
26044         needed because the bug fix reintroduced the 3s exit lag.)  This
26045         makes the mono_runtime_shutdown flag superfluous.
26046
26047 Thu Oct 17 13:11:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
26048
26049         * reflection.c: include ehader size in method section headers.
26050         Really check for suplicated modules entries.
26051
26052 2002-10-17  Martin Baulig  <martin@gnome.org>
26053
26054         * debug-mono-symfile.c: Added back support for locals.
26055
26056 2002-10-14  Martin Baulig  <martin@gnome.org>
26057
26058         * debug-mono-symfile.c: Added MONO_TYPE_I, MONO_TYPE_U and
26059         MONO_TYPE_VOID.
26060
26061 2002-10-14  Martin Baulig  <martin@gnome.org>
26062
26063         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetType): Use
26064         mono_class_get() instead of looking in the class cache. 
26065
26066 2002-10-13  Martin Baulig  <martin@gnome.org>
26067
26068         * debug-mono-symfile.c: Set version number to 28, include the
26069         signature in method names.
26070
26071 2002-10-13  Martin Baulig  <martin@gnome.org>
26072
26073         * debug-mono-symfile.h: Set version number to 27.
26074
26075 2002-10-11  Martin Baulig  <martin@gnome.org>
26076
26077         * gc.c: Don't register/unregister NULL pointers as disappearing links.
26078
26079 Thu Oct 10 14:56:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
26080
26081         * metadata.c, metadata.h: added helper function to allocate signatures.
26082
26083 2002-10-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26084
26085         * icall.c: added internal call to get the location of machine.config.
26086
26087 2002-10-08  Martin Baulig  <martin@gnome.org>
26088
26089         * debug-mono-symfile.c: Ignore classes with a pending init for the
26090         moment.
26091
26092 2002-10-03  Dick Porter  <dick@ximian.com>
26093
26094         * threads.c: Freebsd pthread_t is a pointer
26095
26096 2002-10-03  Dick Porter  <dick@ximian.com>
26097
26098         * socket-io.c: Implemented GetHostName_internal
26099
26100 2002-10-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26101
26102         * mono-config.c:
26103         (mono_config_parse_file): don't leak the text.
26104
26105 2002-10-02  Martin Baulig  <martin@gnome.org>
26106
26107         * debug-mono-symfile.c: Added support for methods.
26108
26109 2002-10-01  Martin Baulig  <martin@gnome.org>
26110
26111         * debug-mono-symfile.c: Don't emit methods and line numbers for
26112         the dynamic symbol file, just write the type table.  We can easily
26113         have an external helper program which creates a symbol file for an
26114         IL file.        
26115
26116 2002-10-01  Dick Porter  <dick@ximian.com>
26117
26118         * threads.c (ves_icall_System_Threading_Thread_Start_internal):
26119         Only add the handle to the cleanup array when we're about to
26120         launch the thread.  Bug 31425 deadlocked when the test was run on
26121         mono under w32.
26122
26123 2002-10-01  Martin Baulig  <martin@gnome.org>
26124
26125         * debug-mono-symfile.c: Added support for properties.
26126
26127 Fri Sep 27 18:55:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
26128
26129         * reflection.c: unaligned store fix from Mark Crichton
26130         <crichton@gimp.org>.
26131
26132 2002-09-27  Martin Baulig  <martin@gnome.org>
26133
26134         * icall.c ("System.Reflection.Assembly::GetReferencedAssemblies"):
26135         New interncall.
26136
26137 Fri Sep 27 15:38:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
26138
26139         * assembly.h, assembly.c: use a sane API to hook into the assembly
26140         loading process instead of a useless special-purpouse hack
26141         (ngen needs a hook, too, for example).
26142
26143 2002-09-27  Dick Porter  <dick@ximian.com>
26144
26145         * threads.c (mono_thread_init): Call GetCurrentProcess() so
26146         io-layer can set up some process handle info.  Not needed on w32,
26147         but doesn't hurt either.
26148
26149         * process.c: Pass the program name in the second parameter to
26150         CreateProcess, so the path is searched.  Include the working
26151         directory. Implemented process name, process enumeration, and some
26152         process detail internal calls.
26153         
26154         * icall.c: Added internal calls for process lookup, and some
26155         process details
26156
26157 2002-09-26  Martin Baulig  <martin@gnome.org>
26158
26159         * assembly.c (mono_install_open_assembly_hook): New global
26160         function to install a function to be invoked each time a new
26161         assembly is loaded.
26162         (mono_assembly_open): Run this callback function if set.
26163
26164         * debug-mono-symfile.c: Put back line numbers for the dynamic
26165         symbol file and also record the .il file as source file.  This
26166         allows us to install the temporary symbol file as `file.dbg' just
26167         like a compiler-generated one.
26168
26169 2002-09-26  Nick Zigarovich <nick@chemlab.org>
26170
26171         * Corrected typo in gc.c (BOHEM vs BOEHM).
26172
26173 2002-09-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26174
26175         * icall.c: fixed bug #31235 by copying a few lines from GetMethods to
26176         GetProperties. Also avoid calling g_slist_length in GetProperties and
26177         GetMethods.
26178
26179 Wed Sep 25 22:18:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
26180
26181         * reflection.c: avoid unaligned stores (bug spotted by
26182         Mark Crichton  <crichton@gimp.org>).
26183
26184 2002-09-25  Martin Baulig  <martin@gnome.org>
26185
26186         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Use pointers
26187         instead of guint64 for addresses and added prologue/epilogue info.
26188
26189 2002-09-25  Martin Baulig  <martin@gnome.org>
26190
26191         * debug-mono-symfile.h (MonoDebugLineNumberEntry): New type to
26192         store line number info.  For the dynamic symbol file, we only need
26193         to provide the JIT generated dynamic line number info for the dynamic
26194         symbol file.
26195
26196 2002-09-25  Martin Baulig  <martin@gnome.org>
26197
26198         * debug-mono-symfile.h: Incremented version number.
26199
26200 2002-09-24  Martin Baulig  <martin@gnome.org>
26201
26202         * class.c (mono_debugger_class_init_func): New global function
26203         pointer variable.
26204         (mono_class_init): If mono_debugger_class_init_func is non-NULL,
26205         call it.
26206
26207         * debug-mono-symfile.c (mono_debug_symfile_add_type): New
26208         function.  This is called via the mono_debugger_class_init_func
26209         hook to add all types to the dynamic type table.
26210         (ves_icall_MonoDebugger_GetType): New interncall to get a class
26211         from its metadata token.
26212
26213         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetType"):
26214         New interncall for the debugger.
26215
26216 2002-09-24  Nick Drochak <ndrochak@gol.com>
26217
26218         * icall.c (ves_icall_System_Enum_ToObject): validate the type parameter
26219         before using it in case it is null.
26220         
26221 Tue Sep 24 13:24:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
26222
26223         * metadata.c: allow custom modifiers in local var signatures
26224         (bug spotted by Zoltan Varga).
26225
26226 Tue Sep 24 12:12:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
26227
26228         * class.c: deal with the <Module> class that may have a NULL vtable.
26229         Eliminate warnings.
26230
26231 Tue Sep 24 11:28:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
26232
26233         * image.c, image.h: more strong name helpers.
26234         * monosn.c: more work: convert pem keys to cryptoapi format.
26235
26236 Tue Sep 24 11:27:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
26237
26238         * string-icalls.c: speedup IndexOf.
26239
26240 Tue Sep 24 11:17:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
26241
26242         * icall.c: updates from Zoltan.2.Varga@nokia.com.
26243
26244 Tue Sep 24 11:09:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
26245
26246         * icall.c: cleanup: use mono_object_domain ().
26247
26248 2002-09-23  Martin Baulig  <martin@gnome.org>
26249
26250         * debug-mono-symfile.c: Improved type support.
26251
26252 2002-09-22  Martin Baulig  <martin@gnome.org>
26253
26254         * debug-mono-symfile.c: Added support for reference types and strings.
26255
26256 2002-09-22  Martin Baulig  <martin@gnome.org>
26257
26258         * debug-mono-symfile.c: Started to work on the type table.
26259
26260 2002-09-21  Martin Baulig  <martin@gnome.org>
26261
26262         * debug-mono-symfile.c: Largely reworked the symbol table format.
26263         The symbol table is now incrementally updated each time a new
26264         method is added.  We're now also using our own magic and version
26265         so that you don't need to recompile all your classes if the
26266         dynamic table changes.
26267         (mono_debug_update_mono_symbol_file): Removed.
26268         (mono_debug_symfile_add_method): New function to add a method.
26269
26270 2002-09-21  Martin Baulig  <martin@gnome.org>
26271
26272         * icall.c
26273         ("System.Reflection.Assembly::MonoDebugger_GetLocalTypeFromSignature"):
26274         New interncall.
26275
26276         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetLocalTypeFromSignature):
26277         New interncall to get a method from its metadata token.
26278
26279 2002-09-21  Martin Baulig  <martin@gnome.org>
26280
26281         * debug-mono-symfile.c: Create type table.
26282
26283 2002-09-20  Martin Baulig  <martin@gnome.org>
26284
26285         * debug-mono-symfile.c: Reflect latest Mono.CSharp.Debugger changes.
26286
26287 2002-09-20  Martin Baulig  <martin@gnome.org>
26288
26289         * debug-mono-symfile.c: Provide information about params and locals.
26290
26291 2002-09-20  Martin Baulig  <martin@gnome.org>
26292
26293         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetMethod"):
26294         New interncall.
26295
26296         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetMethod): New
26297         interncall to get a method from its metadata token.
26298
26299 2002-09-20  Martin Baulig  <martin@gnome.org>
26300
26301         * debug-mono-symfile.c: Added a few checks for method->header
26302         being non-NULL.  This should never happen, but for the moment
26303         let's use a g_warning() rather than a g_assert().
26304
26305 2002-09-19  Mark Crichton  <crichton@gimp.org>
26306
26307         * gc.c: ves_icall_System_GCHandle_FreeHandle made a call to libgc
26308         even if support for it isn't present.  Added an #ifdef to fix this.
26309
26310         * socket-io.c: Added checks back for Solaris support.
26311
26312 2002-09-19  Martin Baulig  <martin@gnome.org>
26313
26314         * debug-mono-symfile.c (read_string, write_string): Reflect latest
26315         changes in the symbol file format.
26316
26317 2002-09-18  Martin Baulig  <martin@gnome.org>
26318
26319         * debug-mono-symfile.c: Set version number to 21.
26320
26321 2002-09-18  Dick Porter  <dick@ximian.com>
26322
26323         * threads.c (mon_new): Use the GC_MALLOC macro to hide differences
26324         on netbsd.  Fixes bug 30051.
26325
26326 2002-09-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26327
26328         * reflection.c:
26329         (set_version_from_string): little fix.
26330
26331 Mon Sep 16 18:57:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
26332
26333         * monosn.c, Makefile.am: added strong name utility.
26334         * reflection.h, reflection.c: implemented delayed signing,
26335         locale, version and hash id assembly attributes.
26336
26337 Mon Sep 16 18:51:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
26338
26339         * loader.c, metadata.c: load param attributes in signatures.
26340
26341 2002-09-16  Martin Baulig  <martin@gnome.org>
26342
26343         * debug-mono-symfile.c: Added string table with all method names.
26344
26345 2002-09-14  Martin Baulig  <martin@gnome.org>
26346
26347         * debug-mono-symfile.h (MonoSymbolFile): Added method range table for
26348         fast method lookup.
26349
26350 Fri Sep 13 16:04:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
26351
26352         * reflection.c: record the public key token of referenced assemblies.
26353
26354 Fri Sep 13 15:41:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
26355
26356         * image.c, image.h: added functions to get the strong name and the
26357         public key of an assembly.
26358         * pedump.c: use them.
26359
26360 2002-09-12  Dietmar Maurer  <dietmar@ximian.com>
26361
26362         * marshal.c (emit_str_to_ptr_conv): support marshalling of delegates.
26363
26364 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
26365
26366         * marshal.c (mono_marshal_get_managed_wrapper): Added
26367         MONO_TYPE_BOOLEAN 
26368
26369 2002-09-11  Martin Baulig  <martin@gnome.org>
26370
26371         * gc.c: Call GC_unregister_disappearing_link() on all links when
26372         finalizing them, this is necessary to aviod a crash in boehm's
26373         finalize handler.
26374
26375 Wed Sep 11 17:06:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
26376
26377         * gc.c: handle GetTarget for finalized objects spotted and fixed by
26378         nick@chemlab.org.
26379
26380 Wed Sep 11 15:27:20 CEST 2002 Paolo Molaro <lupus@ximian.com>
26381
26382         * icall.c: implemented MonoType::Module.
26383         * reflection.c, reflection.h: mono_module_get_object () from
26384         Tomi Pakarinen <tomi.pakarinen@welho.com>.
26385
26386 Wed Sep 11 12:53:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
26387
26388         * icall.c: ignore overridden methods in GetMethods ().
26389         Fix for FieldInfo::SetValue().
26390         * object.c: handle float/double in runtime invoke.
26391
26392 Tue Sep 10 15:51:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
26393
26394         * object.c: allow a constructor to be called again on an object.
26395
26396 Tue Sep 10 11:58:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
26397
26398         * class.h, class.c: move field layout code to it's own function and
26399         export it. Get an interface id earlier. Move fields in MonoClass
26400         so they are more cache friendly and align the bitfields.
26401         * loader.c: temporary handle get_param_names() for a runtime method.
26402         * reflection.c, reflection.h: more code to handle runtime creation of
26403         types.
26404
26405 2002-09-09  Martin Baulig  <martin@gnome.org>
26406
26407         * marshal.c (mono_marshal_get_native_wrapper): We need to use a special
26408         signature with the pinvoke field being set for the actual call.
26409
26410 Sat Sep 7 10:12:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
26411
26412         * icall.c: removed some unused icalls. Start of map of glib charsets
26413         to corlib names. Implemented RuntimeMethod::GetFunctionPointer ().
26414
26415 Fri Sep 6 16:08:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
26416
26417         * debug-helpers.c: break infinite loop (found and fixed by
26418         Holger Arnold <harnold@gmx.de>).
26419
26420 Thu Sep 5 18:50:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
26421
26422         * icall.c: target may be null in create_delegate.
26423
26424 Thu Sep 5 17:42:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
26425
26426         * marshal.c: handle a boolean return type.
26427
26428 Thu Sep 5 13:09:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
26429
26430         * gc.c: put HIDE_POINTER/REVEAL_POINTER only here.
26431
26432 Wed Sep 4 19:23:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
26433
26434         * gc.c: fix weakreferences.
26435
26436 Wed Sep 4 13:59:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
26437
26438         * icall.c: added icall to get default codepage.
26439
26440 2002-09-03  Dick Porter  <dick@ximian.com>
26441
26442         * threads.h: 
26443         * threads.c: Use MonoThread instead of MonoObject where
26444         apropriate.
26445
26446         Store running thread objects in a hash table, so that we have all
26447         the info to hand when waiting for them to finish
26448         (means we don't need OpenThread() any more, so mingw builds should
26449         be fully functional again.)
26450
26451         * verify.c:
26452         * object.h: Added thread ID to MonoThread
26453
26454 2002-09-03  Martin Baulig  <martin@gnome.org>
26455
26456         * icall.c (System.Reflection.Assembly::get_location): New interncall.
26457
26458 2002-09-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26459
26460         * icall.c: fixed leak in get_temp_path. Thanks lupus.
26461
26462 2002-09-03  Martin Baulig  <martin@gnome.org>
26463
26464         * debug-helpers.c (mono_disasm_code_one): Added `const guchar **endp'
26465         argument to store the end address of the disassembled instruction.
26466
26467         * debug-mono-symfile.h (MonoDebugMethodInfo, MonoDebugVarInfo): Moved
26468         here from debug-symfile.h.
26469         (MonoDebugMethodJitInfo): Moved all fields which are filled out by the
26470         JIT into this struct.
26471         (MonoSymbolFile): Added `char *image_file' field.
26472         (MonoDebugGetMethodFunc): Removed.
26473         (mono_debug_update_mono_symbol_file): Removed the hash table argument.
26474         (mono_debug_create_mono_symbol_file): Removed the `source_file' argument.
26475         (mono_debug_find_method): New method.
26476
26477         * debug-mono-symfile.c (mono_debug_create_mono_symbol_file): Always
26478         create a full symbol file.
26479         (mono_debug_update_mono_symbol_file): Don't distinguish between dynamic
26480         and static symbol files.
26481         (mono_debug_find_method): The symbol file keeps an internal method hash,
26482         call this to get a MonoDebugMethodInfo from a MonoMethod.
26483
26484         * debug-symfile.[ch]: Removed.
26485
26486 2002-08-29  Miguel de Icaza  <miguel@ximian.com>
26487
26488         * image.c (do_mono_image_open): Remove linker version check.
26489
26490 2002-08-29  Dietmar Maurer  <dietmar@ximian.com>
26491
26492         * marshal.c (mono_marshal_get_managed_wrapper): don't cache
26493         wrappers for instance methods.
26494         
26495 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26496
26497         * icall.c: added ves_icall_System_IO_Path_get_temp_path.
26498
26499 2002-08-28  Dick Porter  <dick@ximian.com>
26500
26501         * Makefile.am: Export HOST_CC for w32 builds
26502
26503 Tue Aug 27 18:34:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
26504
26505         * file-io.c process.c: MonoString are null terminated, no
26506         need for mono_string_to_utf16() anymore.
26507
26508 Tue Aug 27 17:51:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
26509
26510         * icall.c, unicode.h, unicode.c: removed unused iconv stuff.
26511
26512 Tue Aug 27 16:38:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
26513
26514         * icall.c, reflection.h: speedup System.MonoType.
26515
26516 Tue Aug 27 16:37:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
26517
26518         * reflection.c: allow null as the value of a string argument in
26519         custom attributes constructors.
26520
26521 2002-08-27  Martin Baulig  <martin@gnome.org>
26522
26523         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Removed the
26524         `trampoline_address' field.
26525
26526 2002-08-27  Dietmar Maurer  <dietmar@ximian.com>
26527
26528         * marshal.c (mono_marshal_get_native_wrapper): removed wrong null
26529         check (fixes bug #29486) 
26530
26531 2002-08-27  Martin Baulig  <martin@gnome.org>
26532
26533         * debug-mono-symfile.c: Changed the file format in a way that allows us
26534         open it read-only and to use a specially malloced area for all the
26535         dynamic data.  We can now also generate a symbol file on-the-fly if we're
26536         debugging IL code and there is no MCS generated symbol file for it.
26537
26538 Mon Aug 26 16:47:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
26539
26540         * object.c: added a define for a good string and array
26541         creation speedup (not enabled by default because we need to deal with
26542         the synch stuff).
26543
26544 2002-08-26  Martin Baulig  <martin@gnome.org>
26545
26546         * debug-mono-symfile.c (mono_debug_create_mono_symbol_file): New
26547         function to create a dynamic symbol file.  This is used by the
26548         debugger to create a symbol file for IL code on-the-fly.
26549
26550 2002-08-26  Martin Baulig  <martin@gnome.org>
26551
26552         * loader.c (mono_lookup_pinvoke_call): Include the error message
26553         from g_module_error() in the error message.
26554
26555 2002-08-24  Martin Baulig  <martin@gnome.org>
26556
26557         * debug-mono-symfile.c (mono_debug_update_mono_symbol_file): New
26558         function to update the symbol file.  The symbol file is mmap()ed
26559         writable, but private.  This allows us to install the symbol file
26560         together with the assembly.
26561
26562 2002-08-24  Martin Baulig  <martin@gnome.org>
26563
26564         * debug-mono-symfile.[ch]: New files.  Similar to debug-symfile.[ch]
26565         but they can read the new symbol file format which mcs is now creating.
26566
26567         * debug-symfile.c (mono_debug_find_source_location): Moved to
26568         debug-mono-symfile.c; this is now operating on the new symbol file.
26569
26570 2002-08-23  Martin Baulig  <martin@gnome.org>
26571
26572         * debug-helpers.c (mono_method_desc_from_method): New function to get
26573         a MonoMethodDesc from a MonoMethod.
26574
26575 Fri Aug 23 15:54:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
26576
26577         * object.c: fixes assertion failure caused by multiple ExecuteAssembly
26578         calls for same domain (patch by Tomi Pakarinen <Tomi.Pakarinen@iki.fi>).
26579
26580 Fri Aug 23 12:14:45 CEST 2002 Paolo Molaro <lupus@ximian.com>
26581
26582         * string-icalls.[ch]: make helper methods static.
26583
26584 2002-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26585
26586         * icall.c: re-applied patch to GetValueInternal. Also added R4 and R8
26587         types to it and to SetValueInternal.
26588
26589         * object.c: Moved handle_enum label to its proper place. This was the
26590         f... bug! ;-)
26591
26592         This time i compiled mcs and gtk-sharp and they both work.
26593
26594 2002-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26595
26596         * icall.c: reverted partially my previous patch until 
26597         object.c:set_value handles enums correcly.
26598
26599 2002-08-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26600
26601         * icall.c:
26602         (ves_icall_MonoField_GetValue): changed to use mono_field_get_value.
26603         (ves_icall_System_Environment_get_MachineName): removed warning when
26604         compiling under cygwin.
26605
26606 Thu Aug 22 18:49:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
26607
26608         * object.c: fixed field_get_value() for reference types.
26609
26610 2002-08-22  Dick Porter  <dick@ximian.com>
26611
26612         * socket-io.c (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal):
26613         Don't free a buffer while it's still needed.  Patch from Jonathan
26614         Liger <Jonathan.liger@wanadoo.fr>
26615
26616 2002-08-21  Miguel de Icaza  <miguel@ximian.com>
26617
26618         * icall.c (ves_icall_System_Environment_get_Platform): Add new
26619         internal call.
26620
26621 2002-08-21  Dietmar Maurer  <dietmar@ximian.com>
26622
26623         * icall.c (ves_icall_get_method_info): s/MonoMethod/MonoReflectionMethod/
26624         (ves_icall_get_parameter_info): s/MonoMethod/MonoReflectionMethod/
26625
26626         * marshal.c (mono_marshal_get_remoting_invoke): save lmf, because
26627         we call unmanaged code which throws exceptions.
26628
26629 Wed Aug 21 12:56:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
26630
26631         * appdomain.h: added per-domain entry_assembly.
26632         * appdomain.c: ensure mono_runtime_exec_main () gets non-null
26633         arguments.
26634         * icall.c: Assembly::GetEntryAssembly icall.
26635         * object.c: set domain->entry_assembly in mono_runtime_exec_main().
26636         Changes above from a patch by Tomi Pakarinen <tomi.pakarinen@welho.com>.
26637
26638 Tue Aug 20 15:42:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
26639
26640         * appdomain.h, gc.c: added mono_domain_finalize ().
26641
26642 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26643
26644         * object.c:
26645         (mono_print_unhandled_exception): changed g_warning by g_printerr
26646         because g_log has a 1024 characters limit (yeah, i got a big stack
26647         trace). Don't print exception name, that should be in ToString 
26648         returned string.
26649
26650 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26651
26652         * icall.c: added ves_icall_FieldInfo_SetValueInternal.
26653         * object.c: added missing MONO_TYPE_ARRAY in mono_runtime_invoke_array.
26654
26655 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26656
26657         * object.c:
26658         (mono_print_unhandled_exception): after previous commit, i realized
26659         that MS calls ToString on the exception. I changed this function to
26660         do that. This way we get stack_trace for free.
26661
26662 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26663
26664         * object.c:
26665         (mono_print_unhandled_exception): invoke Message property instead of
26666         getting 'message' field from Exception. Don't allocate memory for
26667         'trace' and 'message' if not needed.
26668
26669 2002-08-18  Dick Porter  <dick@ximian.com>
26670
26671         * unicode.c: Fix asserts to match Encoder.cs checks
26672
26673 Fri Aug 16 21:42:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
26674
26675         * marshal.c: fix unaligned store issue and a few wrong
26676         opcode argument types.
26677
26678 2002-08-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26679
26680         * icall.c: added GetUninitializedObjectInternal internal call.
26681
26682 2002-08-16  Dietmar Maurer  <dietmar@ximian.com>
26683
26684         * appdomain.c (mono_runtime_invoke_in_domain): transfer Exception
26685         to the right domain.
26686
26687 2002-08-14  Dietmar Maurer  <dietmar@ximian.com>
26688
26689         * marshal.c (mono_marshal_get_runtime_invoke): unbox value types
26690
26691         * class.c (class_compute_field_layout): set blittable to false for Strings
26692
26693         * appdomain.c (mono_domain_transfer_object): added support for ISerializable
26694
26695 Wed Aug 14 17:26:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
26696
26697         * appdomain.h, reflection.c, icall.c, object.c, reflection.h:
26698         first chunk of code to create types at runtime. Code to
26699         handle ReflectedType/DeclaringType. Make reflection handles
26700         domain specific.
26701
26702 Wed Aug 14 17:24:21 CEST 2002 Paolo Molaro <lupus@ximian.com>
26703
26704         * class.c: set correct name in arrays.
26705
26706 2002-08-13  Dietmar Maurer  <dietmar@ximian.com>
26707
26708         * appdomain.c (mono_domain_transfer_object): make it work with
26709         valuetypes. bug fixes.
26710
26711 2002-08-12  Dick Porter  <dick@ximian.com>
26712
26713         * object.h: Rename some parameters to avoid c++ keywords (Patch
26714         from Joseph Wenninger <kde@jowenn.at>)
26715
26716 Thu Aug 8 13:04:18 CEST 2002 Paolo Molaro <lupus@ximian.com>
26717
26718         * icall.c: added icall to implement Assembly.GetFile*.
26719
26720 Thu Aug 8 10:18:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
26721
26722         * reflection.h, reflection.c: code to embed managed resources.
26723
26724 Tue Aug 6 17:59:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
26725
26726         * class.c: move all the type size stuff into
26727         class_compute_field_layout().
26728
26729 Tue Aug 6 11:20:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
26730
26731         * class.c: ensure enums have always the correct instance size.
26732         * unicode.c: remove wrong assert.
26733
26734 Mon Aug 5 19:30:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
26735
26736         * assembly.c: fix mem corruption issue.
26737         * image.h, image.c: added mono_image_get_resource () to access
26738         managed resources.
26739         * icall.c: implemented Assembly.EntryPoint property and some
26740         Managed Resources related internalcalls.
26741
26742
26743 Mon Aug 5 18:18:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
26744
26745         * image.c, image.h: impemented mono_image_get_entry_point ().
26746         * appdomain.c: use mono_image_get_entry_point.
26747
26748 Mon Aug 5 13:08:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
26749
26750         * reflection.c: support the object type argument when loading
26751         custom attributes.
26752
26753 2002-08-05  Dietmar Maurer  <dietmar@ximian.com>
26754
26755         * marshal.c (mono_marshal_get_managed_wrapper): add suppport for
26756         String as return type.
26757
26758 Fri Aug 2 21:15:42 CEST 2002 Paolo Molaro <lupus@ximian.com>
26759
26760         * reflection.c: fix encoding of named args for custom attrs to match
26761         the ms implementation. Read them back when instantiating custom
26762         attributes.
26763
26764 2002-08-02  Radek Doulik  <rodo@ximian.com>
26765
26766         * marshal.c (mono_mb_add_data): convert ret value to LE, suggested
26767         by Dietmar as quick fix
26768         (mono_marshal_get_delegate_begin_invoke): use sig->param_count +
26769         16 as stack size, used on more places as quick fix before Dietmar
26770         will fix it properly
26771
26772 Fri Aug 2 17:48:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
26773
26774         * object.h, object.c: added accessors for fields and properties.
26775
26776 Fri Aug 2 17:45:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
26777
26778         * class.c, class.h: made mono_class_get_field_from_name ()
26779         loop on parent types.
26780         Added mono_class_get_property_from_name ().
26781
26782 Fri Aug 2 11:40:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
26783
26784         * class.c, class.h: move the code to setup the type vtable in its own
26785         function so that it can be reused also for types created at runtime.
26786         Eliminate the "class" identifier from the header file.
26787         * reflection.c: setup the vtable for enums so that we can create
26788         objects for use in SetConstant ().
26789
26790 2002-08-02  Dietmar Maurer  <dietmar@ximian.com>
26791
26792         * marshal.c (mono_delegate_to_ftnptr): pass delegate->target
26793         instead of the delegate itself as this pointer (bug #28383)
26794
26795 2002-08-01  Dietmar Maurer  <dietmar@ximian.com>
26796
26797         * marshal.c (mono_marshal_get_managed_wrapper): added return type
26798         conversions.
26799
26800 Wed Jul 31 16:49:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
26801
26802         * loader.c: don't set the pinvoke bit on icalls.
26803
26804 2002-07-31  Dietmar Maurer  <dietmar@ximian.com>
26805
26806         * debug-helpers.c (mono_method_full_name): only print a number to
26807         indicate wrapper type (so that the output is more readable in traces).
26808
26809 2002-07-30  Dietmar Maurer  <dietmar@ximian.com>
26810
26811         * class.c (mono_class_init): include method override patch from Paolo
26812
26813 Tue Jul 30 15:20:08 CEST 2002 Paolo Molaro <lupus@ximian.com>
26814
26815         * icall.c: fixed GetTypeCode().
26816
26817 2002-07-29  Dietmar Maurer  <dietmar@ximian.com>
26818
26819         * threads.c (ves_icall_System_Threading_Thread_Thread_internal):
26820         use real delegate invoke function to make it work with multicast
26821         delegates (fix bug# 28291).
26822
26823 Fri Jul 26 11:58:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
26824
26825         * object.c: load constant strings.
26826
26827 Fri Jul 26 11:36:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
26828
26829         * reflection.c: no magic numbers.
26830         * tabledefs.h: security action enum.
26831
26832 Fri Jul 26 11:22:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
26833
26834         * assembly.c: fix possible memory corruption.
26835
26836 Thu Jul 25 13:58:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
26837
26838         * reflection.h, reflection.c: added support for linking resources.
26839         * verify.c: check we have an updated corlib.
26840
26841 2002-07-25  Dietmar Maurer  <dietmar@ximian.com>
26842
26843         * marshal.c (mono_marshal_get_native_wrapper): correctly marshal
26844         string arrays.
26845         (mono_marshal_string_array): null terminate unmanaged string arrays.
26846         (mono_marshal_get_managed_wrapper): print warning for arrays (not implemented)
26847
26848 Wed Jul 24 13:32:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
26849
26850         * icall.c: Type.GetType () can now return also types from the
26851         calling assembly.
26852
26853 Wed Jul 24 13:04:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
26854
26855         * loader.h, loader.c: stack walking support.
26856         * icall.c: implemented GetCurrentMethod, GetExecutingAssembly,
26857         GetCallingAssembly.
26858
26859 2002-07-24  Dietmar Maurer  <dietmar@ximian.com>
26860
26861         * marshal.c: added optimisations for blittable types 
26862
26863         * class.c (mono_array_class_get): do not set blittable attribute on arrays
26864         (mono_class_setup_mono_type): set blittable attribute for single
26865         and double.
26866
26867         * marshal.c (mono_string_utf8_to_builder): impl.
26868         (mono_string_builder_to_utf8): impl.
26869         (mono_marshal_get_native_wrapper): impl. StringBuilder marshaling
26870
26871 2002-07-23  Dietmar Maurer  <dietmar@ximian.com>
26872
26873         * marshal.c (mono_marshal_get_native_wrapper): impl. byref types
26874         (mono_marshal_get_managed_wrapper): impl. byref types
26875
26876 2002-07-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26877
26878         * icall.c:
26879         (search_method): don't display debug message. 
26880
26881 2002-07-22  Dietmar Maurer  <dietmar@ximian.com>
26882
26883         * metadata.c (mono_type_stack_size): removed temporary fix for new gcc
26884
26885 Mon Jul 22 18:17:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
26886
26887         * appdomain.c: set the missing filename when throwing exception.
26888
26889 2002-07-22  Dietmar Maurer  <dietmar@ximian.com>
26890
26891         * metadata.c (mono_type_size): code cleanup
26892         (mono_type_stack_size): removed some test code
26893
26894 2002-07-21  Miguel de Icaza  <miguel@ximian.com>
26895
26896         * appdomain.c (ves_icall_System_Reflection_Assembly_LoadFrom): Use
26897         mono_get_exception_file_not_found now.
26898
26899         * exception.c (mono_exception_from_name_two_strings): New version
26900         that will call a constructor with two string arguments. 
26901         (mono_get_exception_file_not_found): New helper routine, used to
26902         report file-not-found errors.
26903
26904 2002-07-20  Dick Porter  <dick@ximian.com>
26905
26906         * process.h:
26907         * process.c: Pass file handles to CreateProcess
26908         
26909         * icall.c:
26910         * file-io.h:
26911         * file-io.c: Implemented CreatePipe
26912
26913 2002-07-19  Dietmar Maurer  <dietmar@ximian.com>
26914
26915         * metadata.c (mono_get_param_info): set alignment for value types
26916
26917 Fri Jul 19 18:58:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
26918
26919         * appdomain.h, domain.c, threads-types.h: don't include config.h in headers.
26920         Constify mono_domain_assembly_open().
26921         * loader.c: handle null namespace in icalls.
26922
26923 2002-07-19  Dietmar Maurer  <dietmar@ximian.com>
26924
26925         * marshal.c (emit_ptr_to_str_conv): marshal object as structs
26926         (emit_str_to_ptr_conv): marshal object as structs
26927
26928         * metadata.c (mono_type_to_unmanaged): marshal object as structs
26929
26930         * marshal.c (mono_marshal_get_runtime_invoke): support value types
26931
26932 2002-07-18  Dietmar Maurer  <dietmar@ximian.com>
26933
26934         * marshal.c (mono_marshal_get_runtime_invoke): use exception filters
26935         (mono_marshal_get_native_wrapper): we an now return value types
26936
26937 Wed Jul 17 18:21:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
26938
26939         * verify.c: more checks implemented.
26940
26941 2002-07-17  Dietmar Maurer  <dietmar@ximian.com>
26942
26943         * marshal.c (mono_delegate_to_ftnptr): invoke the right method
26944         (fix bug #27695)
26945         (mono_marshal_get_native_wrapper): allow byref arguments
26946         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringXXX):
26947         impl. PtrToStringXXX methods
26948         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure_type): impl.
26949         (ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf): impl.
26950         (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi): impl.
26951         (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): impl.
26952         (ves_icall_System_Runtime_InteropServices_Marshal_DestroyStructure): impl.
26953
26954 Tue Jul 16 19:00:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
26955
26956         * reflection.c: fix buglet in parsing an assembly name.
26957
26958 2002-07-16  Dietmar Maurer  <dietmar@ximian.com>
26959
26960         * marshal.c (emit_ptr_to_str_conv): first impl.
26961
26962 Tue Jul 16 12:39:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
26963
26964         * object.c, class.h: cache the vtable in the class as suggested by
26965         vargaz@freemail.hu (Zoltan Varga).
26966
26967 Tue Jul 16 11:27:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
26968
26969         * class.h, loader.c: added mono_field_from_token().
26970         * verify.c: first cut of type checking code.
26971
26972 2002-07-16  Dietmar Maurer  <dietmar@ximian.com>
26973
26974         * marshal.c (mono_marshal_get_native_wrapper): support valuetypes
26975
26976 2002-07-15  Dietmar Maurer  <dietmar@ximian.com>
26977
26978         * marshal.c (mono_marshal_get_native_wrapper): handle enum types
26979         (fix bug #27782)
26980         (mono_marshal_get_remoting_invoke): impl.
26981         (mono_delegate_begin_invoke): impl.
26982         (mono_mb_emit_save_args): impl.
26983         (mono_delegate_end_invoke): impl.
26984         (mono_marshal_get_delegate_begin_invoke):
26985         (mono_marshal_get_delegate_end_invoke):
26986         (mono_marshal_get_delegate_invoke): generate a special name for
26987         those methods (including the signature) and associate them whith
26988         the delegate class. 
26989
26990 2002-07-13  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
26991
26992         * reflection.[ch]: 
26993         (mono_reflection_type_from_name): now it has a MonoImage parameter
26994         which is used as the default image to search the type in. If the image
26995         is NULL or getting the type from it fails, it defaults to corlib.
26996
26997         * icall.c: changed 1 call to mono_reflection_type_from_name to match
26998         new parameter.
26999
27000 Sat Jul 13 19:32:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
27001
27002         * reflection.c: update the parameter table index.
27003
27004 Sat Jul 13 17:34:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
27005
27006         * domain.c: don't include the mark byte in the string hash.
27007
27008 Sat Jul 13 15:06:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
27009
27010         * icall.cs: icall for Type.GetTypeCode ().
27011         * verify: a couple of fixes and disabled local initialization checks.
27012
27013 2002-07-12  Dietmar Maurer  <dietmar@ximian.com>
27014
27015         * marshal.c: better debugging support (DEBUG_RUNTIME_CODE)
27016
27017         * debug-helpers.c (mono_method_full_name): print the type of the
27018         runtime wrapper
27019
27020         * metadata.c (mono_signature_hash): a hash function for signatures
27021         (mono_signature_hash): better hash algorithm
27022
27023         * marshal.c (mono_marshal_get_delegate_invoke): cache methods by signature
27024
27025         * debug-helpers.c (mono_method_full_name): this can now generate
27026         method names with signatures
27027
27028         * marshal.c (mono_marshal_get_managed_wrapper): bug fix: unmanaged
27029         method dont have this pointers.
27030
27031 Fri Jul 12 11:35:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
27032
27033         * reflection.c: fixup typebuilder tokens.
27034         * image.c: fix buglet.
27035         * marshal.h: remove whitespace.
27036         * metadata.h, metadata.c: reinstate code that was removed.
27037         * verify.c: handle catch directives and fix another couple of bugs.
27038
27039 2002-07-11  Dietmar Maurer  <dietmar@ximian.com>
27040
27041         * marshal.c (mono_marshal_get_native_wrapper): support BOOLEAN
27042         (mono_marshal_get_native_wrapper): make it comp. with the old code
27043         (mono_marshal_get_native_wrapper): support boolean
27044         (mono_marshal_get_managed_wrapper): support more types
27045
27046 2002-06-25  Dietmar Maurer  <dietmar@ximian.com>
27047
27048         * class.c (class_compute_field_layout): compute class->blittable attribute.
27049
27050 2002-07-09  Dick Porter  <dick@ximian.com>
27051
27052         * threads.c: Make the thread cleaning up cope with threads that
27053         call ExitThread()
27054
27055 2002-07-08  Radek Doulik  <rodo@ximian.com>
27056
27057         * reflection.c (method_encode_code): use non-translated values to
27058         compute finally_start, this fixes exception handling on ppc, yay!
27059
27060         * decimal.h (struct signscale): fix endianess
27061
27062 2002-07-07  Radek Doulik  <rodo@ximian.com>
27063
27064         * reflection.c: swap box_val and not val
27065
27066 Mon Jul 8 15:18:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
27067
27068         * reflection.c, reflection.h: handle full assembly info in type name.
27069         Handle Type arguments when loading custom attributes.
27070         * icall.c: updated to use new mono_reflection_type_from_name () method.
27071
27072 2002-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27073
27074         * loader.c:
27075         (method_from_memberref): also print assembly name when method not found.
27076
27077 2002-07-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27078
27079         * icall.c:
27080         (ves_icall_TypeGetProperties): fixed bug #27473. 
27081
27082 2002-07-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27083
27084         * reflection.c: display image name and token when cannot find the
27085         .ctor for an attribute.
27086
27087 2002-07-05  Martin Baulig  <martin@gnome.org>
27088
27089         * debug-symfile.c: Reflect latest MonoDwarfFileWriter changes.
27090
27091 2002-07-04  Dick Porter  <dick@ximian.com>
27092
27093         * threads.c (mono_thread_cleanup): Nasty kludge to get this to
27094         compile on mingw.  This will cause mingw builds to not wait for
27095         subthreads to terminate after the main thread does.  I've lodged a
27096         bug with the mingw developers for them to wrap OpenThread().
27097
27098 2002-07-03  Dick Porter  <dick@ximian.com>
27099
27100         * threads.c: Store thread IDs instead of handles, because
27101         GetCurrentThread() returns a pseudohandle and therefore stores
27102         useless values.  mono_thread_cleanup() continues checking the
27103         array of threads until it is empty, to cope with subthreads
27104         spawning new threads after the main thread has finished.
27105
27106         * profiler.h:
27107         * profiler.c:
27108         * profiler-private.h: Pass the thread ID to thread profiler
27109         functions, instead of a handle
27110
27111 Wed Jul 3 17:43:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
27112
27113         * verify.c: fixes to make it more usable.
27114         * pedump.c: added --verify code to verify IL code in an assembly.
27115
27116 Tue Jul 2 20:40:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
27117
27118         * reflection.c: turn errors into warnings to allow compiling corlib.
27119
27120 Tue Jul 2 19:33:20 CEST 2002 Paolo Molaro <lupus@ximian.com>
27121
27122         * reflection.c: add special cases to compile corlib.
27123
27124 Mon Jul 1 18:00:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
27125
27126         * reflection.c: handle properties with only a set method.
27127
27128 Mon Jul 1 17:11:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
27129
27130         * opcodes.h: add enum with opcodes in opval order.
27131
27132 2002-07-01  Dick Porter  <dick@ximian.com>
27133         
27134         * object.h:
27135         * object.c (mono_runtime_run_main): Removed unneeded argument
27136
27137 2002-06-28  Martin Baulig  <martin@gnome.org>
27138
27139         * debug-symfile.c: Reflect latest MonoDwarfFileWriter changes.
27140
27141 2002-06-27  Dick Porter  <dick@ximian.com>
27142
27143         * threads.c: Store the handle in both the parent thread and in the
27144         subthread, to minimise the time between starting a new thread and
27145         storing its ID.
27146
27147 2002-06-26  Dick Porter  <dick@ximian.com>
27148
27149         * appdomain.c (mono_runtime_cleanup): Close the socket library
27150         after all the threads have finished, not before
27151
27152 2002-06-26  Martin Baulig  <martin@gnome.org>
27153
27154         * debug-symfile.c (mono_debug_find_source_location): Added
27155         `guint32 *line_number' argument.  If it's not NULL, store the line number
27156         there and return the file name without the line number.
27157
27158 2002-06-25  Dick Porter  <dick@ximian.com>
27159
27160         * icall.c:
27161         * process.h:
27162         * process.c: Process forking and other support functions
27163
27164 2002-06-25  Dick Porter  <dick@ximian.com>
27165
27166         * image.c (do_mono_image_open): Set ref_count to 1, so that bad
27167         things dont happen when the image is closed.
27168         (mono_image_lookup_resource): Walk the resource section looking
27169         for a particular entry
27170
27171         * cil-coff.h: PE resource section decoding
27172
27173 2002-06-25  Dick Porter  <dick@ximian.com>
27174         
27175         * assembly.h:
27176         * assembly.c: 
27177         (mono_assembly_foreach): Accessor functions to walk the list of
27178         loaded assemblies
27179         (mono_assembly_set_main):
27180         (mono_assembly_get_main): Process methods need to know which
27181         assembly is the "main" one
27182
27183         * object.c (mono_runtime_run_main): Record the main assembly
27184
27185         * debug-helpers.c: Fix typo
27186
27187 2002-06-24  Dietmar Maurer  <dietmar@ximian.com>
27188
27189         * icall.c (ves_icall_System_Runtime_InteropServices_Marshal_copy_to_unmanaged): impl.
27190         (ves_icall_System_Runtime_InteropServices_Marshal_copy_from_unmanaged): impl.
27191
27192 Sat Jun 22 11:37:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
27193
27194         * icall.c: fix off-by-one in Assembly.GetTypes() reported by bob@karr.ath.cx.
27195
27196 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
27197
27198         * image.c (do_mono_image_open): Initialize reference count,
27199         otherwise we leak the MonoImage.
27200
27201 Fri Jun 21 19:16:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
27202
27203         * reflection.c: small tweak to handle self-hosting.
27204
27205 Thu Jun 20 23:28:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
27206
27207         * reflection.c: fix type name parse code.
27208
27209 Thu Jun 20 19:24:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
27210
27211         * reflection.c: break out of the loop.
27212         * image.c: special case corlib.
27213
27214 Thu Jun 20 16:43:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
27215
27216         * reflection.c: add all the custom attrs at the end to ensure the
27217         ctors have been properly initialized when the attributes are defined
27218         in the current assembly.
27219
27220 Thu Jun 20 13:46:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
27221
27222         * reflection.c: handle correctly multiple-nested types.
27223
27224 Thu Jun 20 11:49:00 CEST 2002 Paolo Molaro <lupus@ximian.com>
27225
27226         * row-indexes.h: fix typos.
27227         * reflection.c: adjust for typos and fix method_def_or_ref
27228         encoding in MethodImpl table.
27229
27230 Wed Jun 19 21:57:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
27231
27232         * reflection.c: fix entry point patching (thanks Serge!).
27233
27234 2002-06-18  Dietmar Maurer  <dietmar@ximian.com>
27235
27236         * verify.c: add check for System.Exception
27237
27238 Mon Jun 17 20:23:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
27239
27240         * image.c, class.c: minifix for code just c&p'ed.
27241         * reflection.c: warning fix.
27242         * object.h, loader.h, domain.c: load also StringBuilder.
27243
27244 Mon Jun 17 17:29:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
27245
27246         * marshal.h, marshal.c: some support code to handle complex marshaling.
27247
27248 Mon Jun 17 16:32:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
27249
27250         * class.h, class.c, reflection.c: handle ignorecase in GetType ().
27251         Better signatures with vtable error dump.
27252
27253 Mon Jun 17 16:13:35 CEST 2002 Paolo Molaro <lupus@ximian.com>
27254
27255         * reflection.c, reflection.h, icall.c: fixes for multiple-nested types.
27256
27257 2002-06-17  Dietmar Maurer  <dietmar@ximian.com>
27258
27259         * icall.c (ves_icall_Type_GetField): impl.
27260
27261 Mon Jun 17 16:08:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
27262
27263         * metadata.h, metadata.c: added mono_metadata_get_marshal_info()
27264         to retrieve a marshal description blob for a field or param.
27265
27266 Mon Jun 17 14:57:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
27267
27268         * reflection.h, reflection.c: change order of nested type emission
27269         to avoid table corruption. The NestedTypes table is sorted.
27270         * icall.c: change order of GetConstructor results to workaround mcs bug.
27271
27272 Fri Jun 14 16:24:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
27273
27274         * reflection.h, reflection.c: handle field and param marshal
27275         information.
27276
27277 Wed Jun 12 16:30:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
27278
27279         * icall.c, marshal.c marshal.h: more Marshal class implementation.
27280
27281 Tue Jun 11 17:29:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
27282
27283         * reflection.c: fix call convention.
27284
27285 Tue Jun 11 16:52:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
27286
27287         * reflection.h, reflection.c: mono_image_get_memberref_token()
27288         takes a type instead of a class, now. Added
27289         mono_image_get_array_token() to create tokens for the special
27290         multi-dim array methods.
27291
27292 Tue Jun 11 13:21:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
27293
27294         * assembly.c: handle modules (no assembly table). Split
27295         loading references in its own function.
27296         * class.c: handle moduleref resolution scope.
27297         * image.c, image.h: cache module name in image.
27298
27299 2002-06-07  Martin Baulig  <martin@gnome.org>
27300
27301         * reflection.c (mono_image_get_type_info): Only add a class layout entry
27302         if we actually have a `tb->class_size' (ie. it's not UnspecifiedTypeSize).
27303
27304 Fri Jun 7 22:07:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
27305
27306         * icall.c: more signature fixes that used uint instead of int.
27307
27308 Fri Jun 7 20:41:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
27309
27310         * reflection.c: fixed signature of field refs.
27311
27312 Fri Jun 7 19:41:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
27313
27314         * class.c, reflection.c: handle typerefs of nested types
27315         (both on read and when writing files).
27316
27317 Fri Jun 7 17:46:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
27318
27319         * icall.c: fix method signatures that tried to workaround the previous
27320         typo, d'oh!
27321
27322 Fri Jun 7 17:36:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
27323
27324         * debug-helpers.c: fix typo.
27325
27326 Fri Jun 7 17:00:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
27327
27328         * cil-coff.h, icall.c, image.c, reflection.c, reflection.h:
27329         rewrote the PE/COFF writing code (our programs are understood by the
27330         ms runtime, now).
27331
27332 Tue Jun 4 18:10:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
27333
27334         * gc.c, gc.h, icall.c: weakreference support.
27335
27336 Tue Jun 4 16:06:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
27337
27338         * Makefile.am, mono-config.c: use $(sysconfdir).
27339
27340 Mon Jun 3 13:13:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
27341
27342         * icall.c: changed default precision of Double.ToString() to 15.
27343         Fixed memory leak. Unified with Single.ToString.
27344
27345 Sat Jun 1 14:26:45 CEST 2002 Paolo Molaro <lupus@ximian.com>
27346
27347         * sysmath.c: workaround systems missing NAN and/or HUGE_VAL.
27348
27349 Sat Jun 1 13:46:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
27350
27351         * pedump.c, appdomain.c, appdomain.h, assembly.c, domain.c,
27352         gc.c, icall.c, image.c, mono-config.c, reflection.c: killed
27353         warnings and compilation fixes from Dennis Haney (davh@davh.dk)
27354         and myself.
27355
27356 Fri May 31 16:58:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
27357
27358         * debug-symfile.c, sysmath.c: yet more compilation fixes.
27359
27360 Fri May 31 16:35:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
27361
27362         * reflection.c, socket-io.c: more compilation fixes.
27363
27364 Fri May 31 15:58:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
27365
27366         * appdomain.c, class.c, class.h, debug-symfile.c, decimal.c,
27367         domain.c, loader.c, object.c, object.h, reflection.c, string-icalls.h,
27368         unicode.c: warning and compiler compatibility fixes.
27369
27370 Fri May 31 15:36:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
27371
27372         * class.h, metadata.c: fixed warnings/compilation errors.
27373
27374 Fri May 31 13:08:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
27375
27376         * Makefile.am, mono-config.c, mono-config.h: configuration file
27377         support routines.
27378         * loader.c, loader.h: make Dll mapping configurable at runtime in the
27379         config file. Export methods to insert and lookup mappings.
27380
27381 Fri May 31 12:45:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
27382
27383         * reflection.c: handle types and boxed objects in custom attr
27384         constructors.
27385
27386 2002-05-30  Martin Baulig  <martin@gnome.org>
27387
27388         * debug-symfile.c
27389         (ves_icall_Debugger_MonoSymbolWriter_method_builder_from_token): Removed.
27390
27391 Thu May 30 14:15:02 CEST 2002 Paolo Molaro <lupus@ximian.com>
27392
27393         * metadata.c, metadata.h: added mono_metadata_implmap_from_method()
27394         to lookup the implmap row for a P/Invoke method.
27395         * loader.c: added mono_lookup_pinvoke_call(): we only lookup a
27396         P/Invoke method from the runtime on an as needed basis.
27397
27398 2002-05-28  Dietmar Maurer  <dietmar@ximian.com>
27399
27400         * metadata.c (mono_metadata_parse_signature): impl.
27401
27402 Tue May 28 16:02:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
27403
27404         * class.c: handle .pack directive.
27405
27406 Tue May 28 11:04:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
27407
27408         * object.c: initialize static fields with RVA data.
27409
27410 2002-05-25  Martin Baulig  <martin@gnome.org>
27411
27412         * debug-symfile.c
27413         (ves_icall_Debugger_DwarfFileWriter_get_type_token): Removed.
27414
27415 2002-05-24  Martin Baulig  <martin@gnome.org>
27416
27417         * debug-symfile.c
27418         (ves_icall_Debugger_MonoSymbolWriter_get_local_type_from_sig): Removed.
27419         (ves_icall_Debugger_MonoSymbolWriter_method_from_token): Renamed to
27420         `ves_icall_Debugger_MonoSymbolWriter_method_builder_from_token'.
27421
27422 Thu May 23 18:44:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
27423
27424         * object.c: special case string ctros in invoke.
27425         * gc.c: silly whitespace changes.
27426
27427 2002-05-23  Dietmar Maurer  <dietmar@ximian.com>
27428
27429         * threadpool.[ch]: impl. a threadpool that can
27430         be used by mint and mono.
27431
27432 2002-05-22  Martin Baulig  <martin@gnome.org>
27433
27434         * debug-symfile.c (ves_icall_Debugger_MonoSymbolWriter_method_from_token):
27435         The first argument is now a `MonoReflectionModuleBuilder *', the return
27436         value is a `MonoReflectionModuleBuilder *'.  Use the AssemblyBuilder's
27437         `methods' field to get the method builder.  The `token' argument is the
27438         unfixed token.
27439
27440         * unicode.c (iconv_get_length, iconv_convert): Silently ignore all
27441         invalid characters instead of g_assert_not_reached()ing.  This seems
27442         to be the behaviour of mscorlib.
27443
27444 2002-05-22  Dietmar Maurer  <dietmar@ximian.com>
27445
27446         * object.c (mono_runtime_invoke_array): applied patch from Rachel
27447         Hestilow to fix bug #25104
27448
27449 2002-05-21  Martin Baulig  <martin@gnome.org>
27450
27451         * debug-symfile.c (mono_debug_find_source_location): New function.
27452         Looks up an IL offset in the line number table and returns the source
27453         location as a string.
27454
27455 2002-05-21  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27456
27457         * icall.c:
27458         (mono_double_ToStringImpl): changed %f by %g until we have something
27459         better.
27460
27461 2002-05-21  Nick Drochak  <ndrochak@gol.com>
27462
27463         * icall.c : Use different name for Math.Pow's icall.  Needed to check
27464         parameters first in C#.
27465
27466 Mon May 20 17:36:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
27467
27468         * icall.c, reflection.h: added icall to get info about an event.
27469
27470 2002-05-20  Radek Doulik  <rodo@ximian.com>
27471
27472         * object.c (mono_value_box): don't use memcpy for boxing on BIG
27473         endian
27474         (mono_value_box): don't use memcpy for small sizes on
27475         architectures with unaligned access
27476
27477 2002-05-20  Martin Baulig  <martin@gnome.org>
27478
27479         * reflection.c (mono_reflection_setup_internal_class): Don't crash
27480         if `tb->parent == NULL'.
27481         (mono_reflection_create_internal_class): New function.  This is
27482         called from TypeBuilder.CreateType() and sets `klass->enum_basetype'
27483         for enum types.
27484
27485         * icall.c ("System.Reflection.Emit.TypeBuilder::create_internal_class"):
27486         New interncall.
27487
27488 2002-05-19  Martin Baulig  <martin@gnome.org>
27489
27490         * unicode.c (ves_icall_iconv_get_bytes): Actually use the `charCount'
27491         argument to get the length, don't default to the array length.
27492
27493 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
27494
27495         * assembly.c (mono_assembly_setrootdir): New function used to
27496         override the MONO_ASSEMBLIES directory.
27497
27498 Fri May 17 20:39:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
27499
27500         * icall.c: ValueType_GetHashCode() initialize local var.
27501
27502 Thu May 16 17:20:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
27503
27504         * reflection.c: sort custom attributes table.
27505
27506 Thu May 16 16:08:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
27507
27508         * reflection.c: support named args in custom attributes (write support).
27509
27510 Thu May 16 13:04:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
27511
27512         * reflection.c: fix finally position calculation.
27513
27514 2002-05-15  Radek Doulik  <rodo@ximian.com>
27515
27516         * reflection.c: fixed endianess at many places
27517
27518         * icall.c (ves_icall_InitializeArray): comment out debug msg
27519
27520 2002-05-15  Dietmar Maurer  <dietmar@ximian.com>
27521
27522         * object.c (mono_unhandled_exception): new function to handle
27523         unhandled exceptions.
27524         (mono_unhandled_exception): call the UnhandledException event.
27525         (mono_runtime_delegate_invoke): impl.
27526
27527 Wed May 15 15:59:55 CEST 2002 Paolo Molaro <lupus@ximian.com>
27528
27529         * metadata.h, metadata.c, class.c: mono_metadata_field_info ()
27530         returns the RVA, not the direct pointer to the data. Handle the case
27531         when the class size is fixed.
27532
27533 Tue May 14 16:59:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
27534
27535         * reflection.c: fix some endianess issues.
27536
27537 2002-05-14  Dietmar Maurer  <dietmar@ximian.com>
27538
27539         * object.c (mono_runtime_invoke): is now able to catch exceptions.
27540
27541         * threads.c (mono_thread_init): added a callback which is invoked
27542         at thread start.
27543
27544 2002-05-14  Dan Lewis  <dihlewis@yahoo.co.uk>
27545         
27546         * icall.c: make GetHashCode return non-negative values.
27547
27548 2002-05-14  Dan Lewis  <dihlewis@yahoo.co.uk>
27549
27550         * object.c, icall.c, gc.c: revert to address-based hashcode.
27551
27552 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
27553
27554         * icall.c (mono_double_ParseImpl): Added ParseImpl method.
27555
27556 Mon May 13 16:40:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
27557
27558         * icall.c, class.c: special case <Module>.
27559
27560 2002-05-13  Dan Lewis  <dihlewis@yahoo.co.uk>
27561
27562         * icall.c: fix bug in GetNow().
27563
27564 2002-05-11  Dietmar Maurer  <dietmar@ximian.com>
27565
27566         * object.c (mono_runtime_class_init): make sure that we call all
27567         static class constructors.
27568
27569 Fri May 10 18:14:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
27570
27571         * reflection.c: sort methodsemantics table.
27572
27573 Fri May 10 16:31:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
27574
27575         * reflection.h, reflection.c: honour init locals setting.
27576
27577 Thu May 9 18:50:00 EDT 2002 Daniel Morgan <danmorg@sc.rr.com>
27578
27579         * icall.c: copied Double ToStringImpl for Single ToStringImpl
27580
27581 Wed May 8 12:28:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
27582
27583         * reflection.c: support ContructorBuilders in attribute blob creation.
27584
27585 Wed May 8 12:06:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
27586
27587         * reflection.c: some changes to build a binary that can be run
27588         directly in windows.
27589
27590 Mon May 6 13:10:34 CEST 2002 Paolo Molaro <lupus@ximian.com>
27591
27592         * loader.c: print a big message when an icall can't be found.
27593
27594 2002-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27595
27596         * string-icalls.c: fix bug 24248.
27597
27598 Sat May 4 14:03:21 CEST 2002 Paolo Molaro <lupus@ximian.com>
27599
27600         * appdomain.c, appdomain.h, assembly.c, assembly.h, image.h,
27601         icall.c, reflection.h: separate assembly loading by pathname and by
27602         assembly name. Use the MONO_PATH env var to search for assemblies.
27603
27604 Thu May 2 17:56:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
27605
27606         * assembly.c, image.h: add some support for assemblies
27607         with multiple modules.
27608         * class.c, class.h: export mono_class_from_typeref().
27609         * loader.c: remove duplicated code and use mono_class_from_typeref(),
27610         instead.
27611
27612 Thu May 2 15:51:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
27613
27614         * unicode.c: Char.IsNumber doesn't include hex digits as the ms
27615         documentation says (the ECMA one is correct).
27616
27617 2002-05-02  Dick Porter  <dick@ximian.com>
27618
27619         * threads.c: Use GC_debug_register_finalizer with GC_debug_malloc.
27620         Don't name the synchronisation mutex.
27621
27622 2002-04-30  Jeffrey Stedfast  <fejj@ximian.com>
27623
27624         * rand.c
27625         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_GetBytes):
27626         Make the prototypes match.
27627         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_GetNonZeroBytes):
27628         Same.
27629
27630         * icall.c
27631         (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Fixed for
27632         systems that use 'timezone' rather than tm.tm_gmtoff. Also, not
27633         all systems have tm.tm_zone, so use strftime() with %Z to print
27634         the timezone abreviation into a temp string.
27635
27636         * object.c (mono_ldstr): Fixed to use mono_string_chars() macro
27637         rather than mono_array_addr() on a MonoString on Big Endian
27638         machines.
27639
27640 2002-04-30  Dietmar Maurer  <dietmar@ximian.com>
27641
27642         * string-icalls.c (ves_icall_System_String_InternalReplace_Str):
27643         fix bug 24041
27644
27645 2002-04-30  Dick Porter  <dick@ximian.com>
27646
27647         * socket-io.c: Cope with SOCKET being an integer rather than a
27648         pointer now.
27649
27650         * threads.c: Added Thread_free_internal, to deal with thread
27651         handle cleanup.  Moved calls to handle_store() and handle_remove()
27652         to start_wrapper(), so each can only be called once.  Allocate
27653         synchronisation blocks with GC_malloc(), and use GC finalisation
27654         to close the handles.
27655
27656         * icall.c: added System.Threading.Thread::Thread_free_internal
27657
27658 Mon Apr 29 15:33:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
27659
27660         * icall.c: support Environment.Exit, CommandLineArgs().
27661
27662 Mon Apr 29 15:15:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
27663
27664         * object.c, object.h: added mono_runtime_run_main () and
27665         mono_runtime_get_main_args () for use in System.Environment.
27666
27667 Mon Apr 29 13:45:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
27668
27669         * gc.c: fix thinko, enable actual finalization since the jit is now
27670         fixed.
27671
27672 Mon Apr 29 12:47:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
27673
27674         * gc.c, object.c: take into account that an object may be offset wrt the address
27675         returned by GC_malloc().
27676
27677 Mon Apr 29 12:14:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
27678
27679         * image.c: handle files without entries in the assembly table (modules).
27680
27681 2002-04-28 Patrik Torstensson <patrik.torstensson@intel.com>
27682
27683         * reflection.c (mono_reflection_setup_internal_class): remove g_assert_not_reached() to allow 
27684         mcs selfhosting again (build breaker) and did move the check to class instead. parent is
27685         allowed to be null when it's System.Object class setup.
27686
27687 2002-04-27  Martin Baulig  <martin@gnome.org>
27688
27689         * reflection.c (mono_reflection_setup_internal_class): g_assert_not_reached()
27690         if `tb->parent == NULL' rather than crashing.
27691
27692 2002-04-28  Nick Drochak  <ndrochak@gol.com>
27693
27694         * sysmath.c (ves_icall_System_Math_Asin): Fix copy-paste error.  Was
27695         calling acos() where asin() should have been called.
27696
27697 2002-04-26  Martin Baulig  <martin@gnome.org>
27698
27699         * assembly.c (default_assembly_name_resolver): Use G_FILE_TEST_IS_REGULAR
27700         instead of G_FILE_TEST_EXISTS - if you're in mcs/class/corlib/System/Test,
27701         there's a subdirectory called `System', but we don't want to read that
27702         subdirectory as an assembly.
27703
27704 2002-04-25  Martin Baulig  <martin@gnome.org>
27705
27706         * debug-symfile.c: Reflect latest MonoString changes.
27707
27708 Thu Apr 25 16:38:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
27709
27710         * rand.c, rand.h: instance method icalls need to have an explicit
27711         this pointer as first argument in the C implementation.
27712
27713 2002-04-25  Nick Drochak <ndrochak@gol.com>
27714
27715         * icall.c: Fix typo in map for GetNonZeroBytes
27716
27717 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
27718
27719         * string-icalls.c : String does now passes unit tests without any 
27720         errors, the following changes has been made:
27721         
27722         Implemented replace methods.
27723         Renaming of methods to (try) follow the standard.
27724         Fixed compare ordinal
27725         Made all memory allocated directly to function instead of via icall function.
27726         Small performance fix in is_in_array function
27727                         
27728  (2002-04-23) Changes from Duncan Mak <duncan@ximian.com>
27729
27730         c (mono_string_Internal_ctor_charp_int_int):
27731         (mono_string_Internal_ctor_sbytep_int_int):  Removed check for
27732         sindex < 0, throw ArgumentOutOfRangeException instead of
27733         ArgumentNullException.
27734
27735         Added new check for length == 0, however
27736         I need to make it return String.Empty from the C code.
27737         
27738         (mono_string_Internal_ctor_sbytep): Use mono_string_new, and let
27739         that calculate the length for us here.
27740         
27741         (mono_string_Internal_ctor_sbytep_int_int): Replaced
27742         mono_string_new_utf16 with mono_string_new, since value is utf8.
27743
27744 Wed Apr 24 18:43:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
27745
27746         * object.c: register the object for finalization if needed.
27747         Allocate one more char in the string for the terminating 0 char.
27748
27749 Wed Apr 24 18:22:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
27750
27751         * class.c, class.h, image.c: check if a type implemenst a destructor.
27752         Use the proper key for array class lookups.
27753         * icall.c: register the icalls in the System.GC class.
27754         * gc.c, gc.h: GC-related functions and icalls.
27755
27756 2002-04-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27757
27758         * icall.c:
27759         * socket-io.c:
27760         * unicode.c: free some strings gotten from mono_string_to_utf8 and
27761         changed a couple of free () by g_free ().
27762
27763         * decimal.c: one-liner in the comments for decimal2string ().
27764
27765 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
27766
27767         * object.c (mono_runtime_invoke_array) : Bug because of my incompetence.
27768
27769 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
27770
27771         * reflection.c (mono_reflection_get_custom_attrs) : fixed image bug (crash)
27772         * object.c (mono_runtime_invoke_array) : handle null in params
27773
27774 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
27775
27776         * string-icalls.c: fixed bug in split (one off bug)
27777
27778 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
27779
27780         * string-icalls.c: fixed bug in remove and lastindexofany, add equals icall.
27781         * icalls.c: added String::Equals as internal method
27782
27783 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
27784
27785         * threads.c: fixed bug in the double interlocked functions
27786
27787 2002-04-22      Patrik Torstensson <patrik.torstensson@labs2.com>
27788
27789         * threads.c: implemented all of the new interlocked icalls.
27790         * string-icalls.c: fix a bug in insert.
27791         * icalls.c: added the icalls for interlocked, removed old string functions.
27792         
27793 Mon Apr 22 19:44:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
27794
27795         * loader.c: fix off-by-one error when reading argument names.
27796
27797 Mon Apr 22 19:28:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
27798
27799         * profiler.c: win32 counter implementation (untested).
27800         * icall.cs: win32 GetNow() and GetTimeZoneData() implementations
27801         (the latter needs testing and more complete impl. from win32 folks).
27802
27803 2002-04-21  Dan Lewis  <dihlewis@yahoo.co.uk>
27804
27805         * object.c: mono_array_new_full workaround mono_array_class_get
27806         problem.
27807
27808 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
27809
27810         * string-icalls.c (mono_string_InternalRemove): Fixed overwrite bug.
27811         * object.h (mono_string_chars): Changed casting type.
27812
27813 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
27814
27815         * string-icalls.c: Fixed trim method, added the constructors done by Duncan, fixed
27816                            method signatures to use gunichar2 instead of gint16.
27817
27818 2002-04-20  Dan Lewis  <dihlewis@yahoo.co.uk>
27819
27820         * object.h, object.c: domain-specific versions of mono_object_new and
27821         mono_array_new.
27822
27823 2002-04-20  Dietmar Maurer  <dietmar@ximian.com>
27824
27825         * object.c: changed String layout
27826
27827         * string-icalls.c (mono_string_Internal_ctor_chara): added
27828         internal string constructors.
27829
27830 Sat Apr 20 13:33:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
27831
27832         * threads.c: pass 'this' to the thread start routine.
27833
27834 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27835
27836         * string-icalls.c: fix IndexOf and LastIndexOf. Now
27837         InternalCompareStr don't call twice mono_string_cmp_char for the last
27838         character. Improved performance in mono_string_cmp_char.
27839
27840 Fri Apr 19 19:26:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
27841
27842         * Makefile.am, appdomain.c, class.c, object.c: split runtime-depended
27843         code into its own library: libmonoruntime.
27844
27845 2002-04-19  Dan Lewis  <dihlewis@yahoo.co.uk>
27846
27847         * object.h, object.c: changed array format so that szarrays do not
27848         require a bounds structure.
27849         * icall.c, appdomain.c: support for new szarray format.
27850
27851 Fri Apr 19 18:04:34 CEST 2002 Paolo Molaro <lupus@ximian.com>
27852
27853         * metadata.c: compare also the retuns type when comparing signatures:
27854         we didn't do this as an optimization since really overloaded methods
27855         must differ also in the arguments, but this doesn't work with
27856         low-level IL code (or when using explicit conversion operators: see
27857         bug#23498 for an example).
27858
27859 Fri Apr 19 16:14:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
27860
27861         * loader.c: SZARRAY types can be saved as TYPESPEC, too.
27862
27863 Thu Apr 18 17:15:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
27864
27865         * icall.c: make MonoType::GetElementType its own icall.
27866
27867 Thu Apr 18 16:41:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
27868
27869         * icall.c: remove MonoMethod_get_Name().
27870         * reflection.c, reflection.h, verify: cache the method name in the MonoMethod
27871         object.
27872
27873 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
27874
27875         * string-icalls.c: optimized a few methods.
27876
27877 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
27878
27879         * icall.c: added all new string internal calls
27880         * string-icalls.c: added, new string internal call implementation.
27881         * object.c: added mono_string_new_size for allocating a string a size
27882
27883 2002-04-17  Dietmar Maurer  <dietmar@ximian.com>
27884
27885         * object.c (mono_object_isinst): use the same code as in the
27886         optimized x86 version.
27887
27888 Wed Apr 17 14:14:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
27889
27890         * profiler.c: TSC-based timer code (faster and more accurate).
27891         Not hooked up in configure, yet (set USE_X86TSC to 1).
27892
27893 Wed Apr 17 12:33:10 CEST 2002 Paolo Molaro <lupus@ximian.com>
27894
27895         * profiler.c, profiler.h: track time spent compiling methods.
27896         * threads.c: track thread creation/destruction.
27897
27898 Tue Apr 16 20:08:43 CEST 2002 Paolo Molaro <lupus@ximian.com>
27899
27900         * profiler.c, profiler.h, profiler-private.h: profiling interface
27901         and sample implementation. Moved here so that it can be used also by
27902         the jit.
27903
27904 Tue Apr 16 12:58:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
27905
27906         * reflection.c, reflection.h: keep types and other handles separate in
27907         the hash tables for referred tokens. Add guid for modules.
27908
27909 Mon Apr 15 11:37:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
27910
27911         * assembly.c: fix bugs found with valgrind.
27912         * metadata.h, metadata.c: added mono_metadata_guid_heap().
27913
27914 2002-04-14      Patrik Torstensson <patrik.torstensson@labs2.com>
27915
27916         * threads: added icall support for getting current domain for
27917                    the thread.
27918  
27919 2002-04-13  Martin Baulig  <martin@gnome.org>
27920
27921         * debug-symfile.h (MonoDebugLocalInfo): Renamed to MonoDebugVarInfo.
27922         (MonoDebugVarInfo): Added `index' field for register based addresses.
27923         (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 9.
27924         (MonoDebugMethodInfo): Replaced `guint32 *param_offsets' with
27925         `MonoDebugVarInfo *params' and `guint32 this_offset' with
27926         `MonoDebugVarInfo *this_var'.
27927
27928         * debug-symfile.c (relocate_variable): New static function to write
27929         a location description for a local variable or method parameter.
27930
27931 2002-04-12  Martin Baulig  <martin@gnome.org>
27932
27933         * debug-symfile.h (MonoDebugLocalInfo): New type. This contains the
27934         stack offset and begin/end scope address of a local variable.
27935         (MonoDebugMethodInfo): Replaced `guint32 *local_offsets' with
27936         'MonoDebugLocalInfo *locals', added `prologue_end' and `epilogue_begin'.
27937         (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 8.
27938
27939         * debug-symfile.c (MRT_variable_start_scope, MRT_variable_end_scope):
27940         Added new relocation types for start/end scope of a local variable.
27941
27942 Fri Apr 12 18:30:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
27943
27944         * object.h: add mono_object_domain() macro.
27945         * reflection.c: handle typespecs.
27946         * icall.c: MonoMethod::get_Name() implementation.
27947
27948 Thu Apr 11 12:29Ni:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
27949
27950         * icall.c: String::GetHashCode() icall implementation.
27951
27952 Wed Apr 10 21:16:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
27953
27954         * icall.c: String::IndexOfAny icall.
27955         * object.c, object.h: make array->max_length more useful.
27956         Intrduced mono_object_class() and mono_string_length() macros.
27957
27958 2002-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27959
27960         * unicode.c (ves_icall_System_Char_IsNumber): use g_unichar_isxdigit
27961         instead of g_unichar_isdigit.
27962
27963 2002-04-11  Nick Drochak  <ndrochak@gol.com>
27964
27965         * icall.c: Implement a simple Double.ToString().
27966
27967 Tue Apr 9 21:31:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
27968
27969         * appdomain.h: only io-layer.h is supposed to be included.
27970         * icall.c: explicitly import environ. Fix warning.
27971
27972 2002-04-10  Nick Drochak  <ndrochak@gol.com>
27973
27974         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData) :
27975                 return true even if it's not Daylight Savings time.
27976                 Only return false for the case where the function isn't
27977                 implemented for a plaform (read Windows).
27978
27979 Tue Apr 9 13:05:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
27980
27981         * appdomain.h, appdomain.c, class.c, object.c: protect MonoDomain
27982         data with a mutex.
27983
27984 2002-04-09  Dietmar Maurer  <dietmar@ximian.com>
27985
27986         * mempool.c (mono_mempool_alloc): only use g_malloc when
27987         absolutely necessary.
27988
27989 2002-04-08  Dietmar Maurer  <dietmar@ximian.com>
27990
27991         * mempool.c (MEM_ALIGN): hardcode MEM_ALIGN to 8
27992
27993         * class.c (mono_class_vtable): use domain mempool to allocate vtable
27994         (mono_class_proxy_vtable): use domain mempool
27995
27996 Mon Apr 8 17:17:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
27997
27998         * appdomain.h, appdomain.c: split initialization that requires the
27999         execution engine support into mono_runtime_init().
28000
28001 2002-04-08  Dietmar Maurer  <dietmar@ximian.com>
28002
28003         * class.c (mono_class_init): don't include vtable inside MonoClass
28004         to save some memory, gather some statistics.
28005         (mono_class_vtable): use g_malloc instead of GC_malloc when possible
28006
28007 Sat Apr 6 20:07:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
28008
28009         * icall.c: internalcall implementation for ValueType.Equals().
28010
28011 2002-04-06  Dietmar Maurer  <dietmar@ximian.com>
28012
28013         * object.c (mono_message_init): moved 
28014         (mono_runtime_exec_main): new arch. independent impl.
28015         (mono_runtime_invoke_array): new method - like
28016         mono_runtime_invoke, but you can pass an array of objects.
28017         (mono_remoting_invoke): new arch. independent impl.
28018         (mono_message_invoke): new arch. independent impl.
28019         (mono_runtime_class_init): new arch. independent impl.
28020         (mono_runtime_object_init): new arch. independent impl.
28021
28022 Fri Apr 5 18:29:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
28023
28024         * metadata.c, object.c, reflection.c: documented the exported
28025         functions.
28026
28027 Fri Apr 5 15:42:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
28028
28029         * icall.c: simpler code to pass the assembly builder data to corlib.
28030         Implement GetNestedTypes() internalcall.
28031
28032 Thu Apr 4 21:46:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
28033
28034         * class.c: warn if a type can't be loaded.
28035
28036 2002-04-04  Dietmar Maurer  <dietmar@ximian.com>
28037
28038         * image.h: typedef MonoImageOpenStatus
28039         * types.h: removed unused file
28040         
28041 2002-04-04  Dan Lewis  <dihlewis@yahoo.co.uk>
28042
28043         * icall.c: Enum_ToObject accepts enum value arguments.
28044
28045 Thu Apr 4 11:35:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
28046
28047         * class.c: move initialization of properties, events and nested
28048         classes, so that they happen for interfaces, too.
28049
28050 Wed Apr 3 20:03:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
28051
28052         * icall.c: cleanup some ugly casts in Array_SetValue*.
28053
28054 Wed Apr 3 19:49:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
28055
28056         * icall.c: the values array fro enums is of the correct type, now.
28057         Implement (correctly) getFullName instead of assQualifiedName for
28058         MonoType.
28059         * reflection.h, reflection.c: added mono_type_get_name ().
28060
28061 Wed Apr 3 17:56:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
28062
28063         * assembly.c, image.h: for each MonoImage, record from wich assembly
28064         it was loaded.
28065         * reflection.h, icall.c: added System_Reflection_Assembly_GetTypes().
28066         Make Type.Assembly work.
28067
28068 2002-04-03  Dietmar Maurer  <dietmar@ximian.com>
28069
28070         * debug-symfile.h: use char* instead of gpointer to avoid
28071         unnecessary casts.
28072
28073         * appdomain.c (mono_jit_info_table_find): use char* instead of gpointer
28074
28075         * icall.c (ves_icall_InternalExecute): impl. FielSetter
28076         (ves_icall_System_Array_SetValueImpl): removed strange MonoArray cast
28077
28078 2002-03-30  Dietmar Maurer  <dietmar@ximian.com>
28079
28080         * icall.c (mono_message_init): impl. (code cleanup)
28081         (ves_icall_InternalExecute): impl. FieldGetter
28082
28083         * class.c (mono_class_init): added exerimental EXT_VTABLE_HACK, if
28084         defined we call all (non-static)methods through the vtable. 
28085
28086 Fri Mar 29 18:09:08 CET 2002 Paolo Molaro <lupus@ximian.com>
28087
28088         * class.c: it seems GC_debug_malloc() makes the Boehm GC call the
28089         finalizer even though the memory is still referenced (and the chunk of
28090         memory is not freed).
28091
28092 Fri Mar 29 17:43:04 CET 2002 Paolo Molaro <lupus@ximian.com>
28093
28094         * assembly.c: fix brokeness.
28095
28096 Fri Mar 29 16:09:54 CET 2002 Paolo Molaro <lupus@ximian.com>
28097
28098         * class.c: kill some warnings. Check explicit interface method
28099         implementation also without considering the namespace.
28100         Load also literal strings in static class data.
28101
28102 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
28103
28104         * assembly.c (default_assembly_name_resolver): Kill memory leak. 
28105         (default_assembly_name_resolver): Make the resolver take the
28106         "base" directory where the assembly was originally defined, so we
28107         can load DLLs that are in the same directory as the assembly that
28108         is being referenced.
28109
28110 2002-03-28  Dick Porter  <dick@ximian.com>
28111
28112         * file-io.h: 
28113         * file-io.c:
28114         * socket-io.c: 
28115         * unicode.h: 
28116         * unicode.c: Warning cleanups
28117
28118 Thu Mar 28 18:06:14 CET 2002 Paolo Molaro <lupus@ximian.com>
28119
28120         * object.h, reflection.h: use the correct type instead of MonoObject.
28121
28122 2002-03-28  Martin Baulig  <martin@gnome.org>
28123
28124         * debug-symfile.c (mono_debug_class_get): Don't look in referenced assemblies.
28125         (mono_debug_update_symbol_file): Initialize classes if necessary.
28126
28127 Thu Mar 28 15:58:43 CET 2002 Paolo Molaro <lupus@ximian.com>
28128
28129         * assembly.c, debug-helpers.c, image.c, image.h, metadata.c, pedump.c,
28130         rawbuffer.c, reflection.c, verify.c: mare warning cleanups.
28131
28132 Thu Mar 28 15:20:39 CET 2002 Paolo Molaro <lupus@ximian.com>
28133
28134         * assembly.h: fix function prototype.
28135         * metadata.h, metadata.c, object.h, private.h: get rid of warnings.
28136         * mono-endian.h: use const cast.
28137
28138 2002-03-28  Dietmar Maurer  <dietmar@ximian.com>
28139
28140         * icall.c (ves_icall_MonoMethodMessage_InitMessage): moved from message.c
28141
28142 Thu Mar 28 12:32:00 CET 2002 Paolo Molaro <lupus@ximian.com>
28143
28144         * loader.c: don't assert when a typeref can't be loaded, give
28145         a chance to the runtime to trow an exception instead.
28146         * loader.h: fix warning.
28147
28148 2002-03-28  Dietmar Maurer  <dietmar@ximian.com>
28149
28150         * class.c (mono_class_proxy_vtable): added proxy support
28151
28152 2002-03-27  Dan Lewis <dihlewis@yahoo.co.uk>
28153
28154         * icall.c: removed last of PAL calls, added System.Environment
28155         * file-io.h, file-io.c: MonoIO implementation
28156         * object.h, object.c: mono_string_to_utf16() now returns gunichar2*
28157
28158 Tue Mar 26 19:56:10 CET 2002 Paolo Molaro <lupus@ximian.com>
28159
28160         * appdomain.c: do not use the byte marker in ldstr table lookup.
28161         * debug-helpers.c: allow two ':' to separate class and method name.
28162         * object.c: allocate arrays bounds with the GC, too.
28163         * verify: add a few more checks.
28164
28165 Tue Mar 26 18:45:46 CET 2002 Paolo Molaro <lupus@ximian.com>
28166
28167         * reflection.c: output also literal strings. Allocate parameter data
28168         with GC_malloc() (thanks, Martin, for catching this!).
28169
28170 2002-03-26  Martin Baulig  <martin@gnome.org>
28171
28172         * debug-symfile.h (MonoDebugMethodInfo): Added `this_offset', don't
28173         include the `this' offset in the `param_offsets'.
28174
28175 2002-03-25  Martin Baulig  <martin@gnome.org>
28176
28177         * debug-symfile.c (mono_debug_update_symbol_file): Use a new
28178         mono_debug_get_class() function to get the classes. Added new
28179         relocation types for arrays and strings.
28180         (mono_debug_get_class): New static function to search in all
28181         referenced assemblies for a metadata token.
28182
28183         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 7.
28184
28185 Mon Mar 25 13:08:18 CET 2002 Paolo Molaro <lupus@ximian.com>
28186
28187         * reflection.h, reflection.c: use a gc-safe hash for hash tables that
28188         hold gc-allocated objects. Make the string heap a stream like the
28189         others. Removed duplicated code when writing stream info.
28190         Added asserts to catch possible buffer overflows. Set the sorted map
28191         for tables that need sorting. Added some documentation.
28192
28193 Mon Mar 25 13:04:56 CET 2002 Paolo Molaro <lupus@ximian.com>
28194
28195         * appdomain.h, appdomain.c, class.c, object.c: use a GC-safe hash table 
28196         for interned strings and vtables.
28197
28198 2002-03-24  Martin Baulig  <martin@gnome.org>
28199
28200         * icall.c (ves_icall_Type_GetFields): Reverse the list before storing
28201         it in the array since it was created with g_slist_prepend().
28202
28203 2002-03-24  Martin Baulig  <martin@gnome.org>
28204
28205         * debug-symfile.c (mono_debug_local_type_from_signature): Renamed
28206         to ves_icall_Debugger_MonoSymbolWriter_get_local_type_from_sig().
28207         (mono_debug_method_from_token): Renamed to
28208         ves_icall_Debugger_MonoSymbolWriter_method_from_token().
28209         (ves_icall_Debugger_DwarfFileWriter_get_type_token): New interncall.
28210
28211         * debug-symfile.c (MRT_type_sizeof, MRT_type_field_offset): New
28212         relocation types.
28213
28214         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 6.
28215
28216 2002-03-24  Martin Baulig  <martin@gnome.org>
28217
28218         * debug-symfile.c (mono_debug_local_type_from_signature): New func.
28219         (mono_debug_method_from_token): New func.
28220
28221         * icall.c (Mono.CSharp.Debugger.MonoSymbolWriter::get_local_type_from_sig):
28222         New interncall, calls mono_debug_local_type_from_signature().
28223         (Mono.CSharp.Debugger.MonoSymbolWriter::get_method): New interncall,
28224         calls mono_debug_method_from_token().
28225
28226 2002-03-23  Martin Baulig  <martin@gnome.org>
28227
28228         * unicode.c (ves_icall_iconv_get_char_count): The `count' argument
28229         specifies the number of bytes to be converted, not the array size.
28230         Return the number of chars, not the number of bytes.
28231         (ves_icall_iconv_get_chars): The `byteCount' argument
28232         specifies the number of bytes to be converted, not the array size.
28233
28234 2002-03-23  Martin Baulig  <martin@gnome.org>
28235
28236         * reflection.h (MonoReflectionSigHelper): New type.
28237
28238         * reflection.c (mono_reflection_sighelper_get_signature_local),
28239         (mono_reflection_sighelper_get_signature_local): New functions.
28240
28241         * icall.c (System.Reflection.Emit.SignatureHelper::get_signature_local),
28242         (System.Reflection.Emit.SignatureHelper::get_signature_field): New
28243         interncalls.
28244
28245 2002-03-23  Martin Baulig  <martin@gnome.org>
28246
28247         * rawbuffer.c (mono_raw_buffer_load_mmap): Use MAP_SHARED when
28248         is_writeable is set.
28249         (mono_raw_buffer_update): New function to write the modified map
28250         back to disk.
28251
28252         * debug-symfile.h (MonoDebugSymbolFile): Added `raw_contents_size'.
28253
28254         * debug-symfile.c (mono_debug_update_symbol_file): Call
28255         mono_raw_buffer_update() when done writing.
28256
28257 2002-03-23  Martin Baulig  <martin@gnome.org>
28258
28259         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 5.
28260
28261         * debug-symfile.c: Added support for arguments and local variables.
28262
28263 2002-03-23  Dick Porter  <dick@ximian.com>
28264
28265         * debug-symfile.c: Remove extraneous 'include <elf.h>' that wasn't
28266         protected by ifdefs, hence breaking the w32 build.
28267
28268 Thu Mar 21 17:35:01 CET 2002 Paolo Molaro <lupus@ximian.com>
28269
28270         * object.c: implement is_interned() the right way.
28271
28272 2002-03-21  Martin Baulig  <martin@gnome.org>
28273
28274         * debug-symfile.[ch]: New files to handle debugging information
28275         files. There's also support to dynamically update these symbol
28276         files to include machine dependent information.
28277
28278 2002-03-20  Dietmar Maurer  <dietmar@ximian.com>
28279
28280         * threads.c (mono_thread_create): new function to create thread
28281         from C
28282
28283 2002-03-20  Martin Baulig  <martin@gnome.org>
28284
28285         * icall.c (ves_icall_InternalInvoke): Create a new object if the
28286         method is a constructor.
28287         (icall_map): Added "System.Reflection.MonoCMethod::InternalInvoke",
28288         points to ves_icall_InternalInvoke().
28289
28290 2002-03-20  Dan Lewis <dihlewis@yahoo.co.uk>
28291
28292         * file-io.c: Flush shouldn't throw exceptions.
28293
28294 2002-03-19  Dan Lewis <dihlewis@yahoo.co.uk>
28295
28296         * file-io.c: FileStream flush support; FileSetLength now
28297         restores file pointer.
28298
28299 Tue Mar 19 18:17:21 CET 2002 Paolo Molaro <lupus@ximian.com>
28300
28301         * class.c: set image for pointer classes.
28302
28303 2002/03/19  Nick Drochak <ndrochak@gol.com>
28304
28305         * sysmath.c: Forgot one.
28306
28307 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
28308
28309         * sysmath.c: Avoid redefining existing names.
28310
28311 2002-03-18  Dan Lewis <dihlewis@yahoo.co.uk>
28312
28313         * sysmath.c, sysmath.h, icall.c, Makefile.am: math routines now
28314         handled by runtime as icall rather than dllimport from libm.so
28315         * file-io.c, file-io.h: fixed handle argument type.
28316
28317 2002-03-18  Dick Porter  <dick@ximian.com>
28318
28319         * reflection.c (mono_image_get_type_info): rename interface to
28320         iface, because of "#define interface struct" on windows.
28321
28322 Sat Mar 16 19:18:38 CET 2002 Paolo Molaro <lupus@ximian.com>
28323
28324         * class.c, class.h: rename and export mono_ptr_class_get().
28325         * metadata.c: support MONO_TYPE_ARRAY in MonoType compare.
28326         * reflection.c, reflection.h, icall.c: better/saner type name
28327         parsing and MonoType creation. Handle MONO_TYPE_ARRAY in
28328         method signatures.
28329
28330 2002-03-14  Dietmar Maurer  <dietmar@ximian.com>
28331
28332         * class.c (mono_class_init): removed hardcoded GHC_SLOT
28333
28334         * icall.c (ves_icall_InternalInvoke): impl.
28335
28336 Wed Mar 13 00:27:30 CET 2002 Paolo Molaro <lupus@ximian.com>
28337
28338         * reflection.c: output the interface map table, too.
28339
28340 2002-03-12  Dietmar Maurer  <dietmar@ximian.com>
28341
28342         * class.c (class_compute_field_layout): separate computation of 
28343         static field layout
28344
28345 2002-03-12  Dan Lewis <dihlewis@yahoo.co.uk>
28346
28347         * icall.c: added System.Buffer support.
28348         * file-io.c: moved file icalls from PAL to FileStream.
28349
28350 2002-03-12  Dietmar Maurer  <dietmar@ximian.com>
28351
28352         * icall.c (ves_icall_System_Object_GetHashCode): impl.
28353
28354 2002-03-11  Dietmar Maurer  <dietmar@ximian.com>
28355
28356         * icall.c (ves_icall_System_ValueType_GetHashCode): impl.
28357
28358 Mon Mar 11 14:45:42 CET 2002 Paolo Molaro <lupus@ximian.com>
28359
28360         * verify.c, verify.h: moved here the corlib/runtime consistency checks.
28361
28362 Mon Mar 11 11:12:23 CET 2002 Paolo Molaro <lupus@ximian.com>
28363
28364         * debug-helpers.{c,h}: moved here from monograph some useful functions
28365         to locate a method by name/signature in a class or image. Included
28366         also a small and flexible IL disassembler.
28367
28368 Fri Mar 8 16:29:29 CET 2002 Paolo Molaro <lupus@ximian.com>
28369
28370         * reflection.c: fixup tokens in methods with small header size, too.
28371
28372 2002-03-08  Dietmar Maurer  <dietmar@ximian.com>
28373
28374         * object.c (mono_string_to_utf8): remove assert(!error), instead
28375         print a warning. 
28376
28377 Thu Mar 7 18:55:15 CET 2002 Paolo Molaro <lupus@ximian.com>
28378
28379         * icall.c: update to the new mono_Array_class_get interface.
28380
28381 Thu Mar 7 17:23:26 CET 2002 Paolo Molaro <lupus@ximian.com>
28382
28383         * appdomain.c, object.c: Boehm-GC enable.
28384         * icall.c: make get_data_chunk() support split data requests.
28385         Ensure a class is initialized in more cases. Return only the first
28386         property found in GetProperties() or the compiler gets confused. 
28387         Implemented GetEvents(). Temporary fix to GetType(), needs rewriting.
28388         * reflection.h, reflection.c: add fixup mechanism for field and method
28389         tokens. Initialize assembly->typeref in a single place. Output
28390         properties after events. Support custom attributes for events, too.
28391         Typo fix for paramter custom attrs.
28392
28393 2002-03-07  Martin Baulig  <martin@gnome.org>
28394
28395         * icall.c (ves_icall_System_Array_FastCopy): Small fix.
28396
28397 2002-03-07  Dietmar Maurer  <dietmar@ximian.com>
28398
28399         * class.c (mono_array_class_get): fix. for multi. dim. arrays
28400
28401 2002-03-06  Martin Baulig  <martin@gnome.org>
28402
28403         * icall.c (ves_icall_System_Array_CreateInstanceImpl): Make this work with
28404         non-zero lower bounds. See testcases #F10-#F13.
28405
28406 2002-03-05  Martin Baulig  <martin@gnome.org>
28407
28408         * exception.c (mono_get_exception_argument_out_of_range): New exception.
28409
28410         * icall.c (ves_icall_System_Array_GetValue): Moved actual implementation to
28411         ves_icall_System_Array_GetValue(), only calculate the absolute array position
28412         here.
28413         (ves_icall_System_Array_SetValue): Likewise.
28414         (ves_icall_System_Array_GetValueImpl): New interncall. Takes an array position
28415         as argument and does the actual work. This function is used when copying a
28416         multi-dimensional array.
28417         (ves_icall_System_Array_SetValueImpl): Almost completely rewrote this. It can
28418         now do all the widening conversions of value types.
28419         (ves_icall_System_Array_CreateInstanceImpl): Implemented.
28420
28421 Tue Mar 5 18:14:01 CET 2002 Paolo Molaro <lupus@ximian.com>
28422
28423         * class.c: remove some magic numbers and use the smbolic names,
28424         instead. Added init_events() to load event info at class init time.
28425         * metadata.h, metadata.c: added mono_metadata_events_from_typedef()
28426         and mono_metadata_methods_from_event().
28427         * reflection.h, reflection.c: added support for writing out the evnets
28428         related information.
28429
28430 Mon Mar 4 20:32:43 CET 2002 Paolo Molaro <lupus@ximian.com>
28431
28432         * reflection.h, icall.c: use a different method (GetInterfaces)
28433         to gather interface info and add isbyref, isprimitive and
28434         ispointer to the ves_icall_get_type_info() return value.
28435
28436 Mon Mar 4 11:22:26 CET 2002 Paolo Molaro <lupus@ximian.com>
28437
28438         * class.h: stared adding support for events.
28439         * icall.c: split find_members implementation. Added debug icall to get
28440         the address of an object.
28441         * reflection.c: handle TypeBuilders in mono_type_get_object().
28442
28443 2002-03-01  Martin Baulig  <martin@gnome.org>
28444
28445         * icall.c (ves_icall_System_Array_GetLength): This must throw an
28446         ArgumentOutOfRangeException(), not an ArgumentException().
28447         (ves_icall_System_Array_GetLowerBound): Likewise.
28448         (ves_icall_System_Array_GetValue): Improved argument checking.
28449         (ves_icall_System_Array_SetValue): Improved argument checking.
28450
28451 2002-03-01  Martin Baulig  <martin@gnome.org>
28452
28453         * icall.c (ves_icall_System_Array_GetValue): Raise an exception when
28454         called with invalid arguments rather than just dying with g_assert().
28455         (ves_icall_System_Array_SetValue): Likewise.
28456         (ves_icall_System_Array_CreateInstanceImpl): Don't g_assert_not_reached(),
28457         raise a NotImplementedException instead.
28458         (ves_icall_System_Array_GetLength): Added argument checking.
28459         (ves_icall_System_Array_GetLowerBound): Added argument checking.
28460
28461 2002-03-01  Dietmar Maurer  <dietmar@ximian.com>
28462
28463         * object.h (mono_assert): new macros mono_assert and
28464         mono_assert_not_reached
28465
28466 2002-02-28  Martin Baulig  <martin@gnome.org>
28467
28468         * icall.c: Rename "System::String::Intern" to "System::String::_Intern"
28469         and "System::String::IsInterned" to "System::String::_IsInterned".
28470
28471 Thu Feb 28 19:19:35 CET 2002 Paolo Molaro <lupus@ximian.com>
28472
28473         * icall.c: remove hacks for typebuilder. Added icall to create a
28474         modified type from a tybebuilder.
28475         * reflection.c: removed hacks for TypeBuilder. Create also a MonoImage
28476         in mono_image_basic_init (). Added mono_reflection_setup_internal_class ()
28477         to create a backing MonoClass for a TypeBuilder.
28478
28479 Thu Feb 28 15:35:51 CET 2002 Paolo Molaro <lupus@ximian.com>
28480
28481         * class.c, class.h: more refactoring of class init.
28482         Export mono_class_setup_mono_type() and mono_class_setup_parent().
28483
28484 Thu Feb 28 12:33:41 CET 2002 Paolo Molaro <lupus@ximian.com>
28485
28486         * marshal.c, marshal.h: start of marshaling interface.
28487
28488 Wed Feb 27 22:15:17 CET 2002 Paolo Molaro <lupus@ximian.com>
28489
28490         * icall.c: fix order in assembly qualified name icall.
28491
28492 Wed Feb 27 18:45:03 CET 2002 Paolo Molaro <lupus@ximian.com>
28493
28494         * class.c: do not free str, since we store it in the hash table.
28495         * reflection.h: add label field to MonoILExceptionInfo.
28496         * reflection.c: handle references to more than one assembly. Handle
28497         case when there isn't a module created in the assembly.
28498
28499 Wed Feb 27 12:35:10 CET 2002 Paolo Molaro <lupus@ximian.com>
28500
28501         * class.c: Fix typo. Start refactoring of class init code.
28502
28503 Wed Feb 27 12:23:00 CET 2002 Paolo Molaro <lupus@ximian.com>
28504
28505         * appdomain.c: exit with 1 on error.
28506         * class.c: we already have the name in MonoClassField.
28507         * image.c, image.h, metadata.c, pedump.c: use directly a pointer in
28508         MonoStreamHeader instead of an offset of image->raw_metadata.
28509
28510 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
28511
28512         * appdomain.c (mono_init): Be even more descriptive about the error.
28513
28514 Tue Feb 26 16:18:07 CET 2002 Paolo Molaro <lupus@ximian.com>
28515
28516         * appdomain.c: give the user an informative message when corlib can't
28517         be loaded.
28518
28519 2002-02-26  Martin Baulig  <martin@gnome.org>
28520
28521         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData):
28522         New icall to get the time zone data.
28523
28524 Mon Feb 25 15:51:51 CET 2002 Paolo Molaro <lupus@ximian.com>
28525
28526         * reflection.c: set virtual and raw size of section correctly.
28527         * threads.c: transfer domain information to newly created threads.
28528
28529 Fri Feb 22 18:55:57 CET 2002 Paolo Molaro <lupus@ximian.com>
28530
28531         * class.c: when instancing a class in a domain, load the default
28532         vaules for static fields from the constant table. Fix System.Enum to
28533         not be an enum.
28534         * icall.c: implement Object::GetType() internalcall. Implemented
28535         MonoField::GetValue() internalcall. Avoid SEGV in search_method().
28536         Fixed checking of binding flags in find_members().
28537         * metadata.c, metadata.h: introduce mono_metadata_type_hash().
28538         * reflection.c: handle enumerations when writing to the constant
28539         table. Use a different object cache for types.
28540
28541
28542 2002-02-22  Dietmar Maurer  <dietmar@ximian.com>
28543
28544         * object.c (mono_object_isinst): fix for arrays
28545
28546         * icall.c (ves_icall_type_is_subtype_of): fix for 2 interfaces
28547
28548 Thu Feb 21 21:00:13 CET 2002 Paolo Molaro <lupus@ximian.com>
28549
28550         * object.c: don't use mprotect ()  and fix intern pool hash table
28551         lookup for big endian systems.
28552
28553 Thu Feb 21 19:30:29 CET 2002 Paolo Molaro <lupus@ximian.com>
28554
28555         * icall.c: change type_is_subtype_of () signature.
28556
28557 2002-02-21  Mark Crichton  <crichton@gimp.org>
28558
28559         * rand.c, rand.h: Added random number generator for
28560         System.Security.Cryptography classes.
28561
28562         * exception.c, exception.h: Added mono_get_exception_not_implemeted.
28563
28564         * icall.c: Added System.Security.Cryptography calls.
28565
28566 Thu Feb 21 16:45:34 CET 2002 Paolo Molaro <lupus@ximian.com>
28567
28568         * class.c, icall.c, metadata.c: better support for pointer types.
28569         Create a class for them as suggested by dietmar. Fix TYPE_ARRAY class.
28570         * reflection.c: Add support for getting custom attrs for properties
28571         and simplify some code.
28572
28573 Wed Feb 20 22:20:29 CET 2002 Paolo Molaro <lupus@ximian.com>
28574
28575         * icall.c: change getToken () and add custom attribute GetBlob()helper
28576         method.
28577         * reflection.h: add custom attrs array to the reflection builder structures.
28578         * reflection.c: encode and emit custom attributes for all the relevant
28579         reflection objects. Cache fieldref and methodref tokens. Change
28580         mono_image_create_token() interface to take a MonoDynamicAssembly.
28581         More complete custom attributes decoder. Load custom attributes for
28582         Assembly, Field, Method and Constructor objects, too. Make the
28583         returned array an Attribute[] one, not object[]. Added
28584         mono_reflection_get_custom_attrs_blob() to encode the arguments of a
28585         custom attribute constructor.
28586
28587 2002-02-20  Dick Porter  <dick@ximian.com>
28588
28589         * icall.c:
28590         * rawbuffer.c:
28591         * socket-io.c: Windows portability fixes (sometimes just ifdeffing
28592         problem code out for now).
28593
28594 2002-02-19  Radek Doulik  <rodo@ximian.com>
28595
28596         * object.c (mono_ldstr): use hash table to avoid multiple swapping
28597
28598 Tue Feb 19 20:23:11 CET 2002 Paolo Molaro <lupus@ximian.com>
28599
28600         * icall.c: register the GetCustomAttributes method.
28601         * object.c, object.h: add mono_string_new_len ().
28602         * reflection.h, reflection.c: added mono_runtime_invoke(),
28603         mono_install_runtime_invoke(). Added
28604         mono_reflection_get_custom_attrs () to load custom attributes and
28605         create the attribute objects.
28606
28607 2002-02-19  Dick Porter  <dick@ximian.com>
28608         * threads-dummy-types.c:
28609         * threads-dummy-types.h:
28610         * threads-dummy.c:
28611         * threads-dummy.h:
28612         * threads-pthread-types.c:
28613         * threads-pthread-types.h:
28614         * threads-pthread.c:
28615         * threads-pthread.h:  Deleted obsolete files
28616
28617 2002-02-19  Dietmar Maurer  <dietmar@ximian.com>
28618
28619         * class.c (mono_class_vtable): runtime init the class when we
28620         allocate static class data.
28621
28622         * icall.c (ves_icall_System_Array_SetValue): check for null values.
28623
28624         * appdomain.c (mono_domain_transfer_object): impl. hack for Arrays
28625         and String - but we will need generic marshalling support in the
28626         future. 
28627         (mono_init): set the domain name in a ms compatible way
28628
28629         * object.c (mono_string_new_utf16): bug fix: use char[] instead of
28630         String[].
28631
28632 2002-02-18  Dietmar Maurer  <dietmar@ximian.com>
28633
28634         * object.c (mono_array_clone): use alloca() instead of g_malloc  
28635         for sizes
28636
28637         * appdomain.c (mono_domain_unload): impl.
28638
28639 Mon Feb 18 15:52:20 CET 2002 Paolo Molaro <lupus@ximian.com>
28640
28641         * appdomain.c, object.c: fix intern pool implementation.
28642         * class.c: fix alignment code.
28643
28644 2002-02-16  Radek Doulik  <rodo@ximian.com>
28645
28646         * icall.c (ves_icall_System_Enum_ToObject): in case of big endian
28647         and s2 > s1, just copy lower bytes to be compatible with little
28648         endian (i.e. 64bit value & 0xffffffff --> 32bit value)
28649         (ves_icall_System_Enum_ToObject): and likewise for s1 > s2
28650
28651         * unicode.c (ves_icall_iconv_new_encoder): decide on big_endian,
28652         force big_endian to be 1 for big endian machines 
28653         (ves_icall_iconv_new_decoder): ditto
28654
28655 2002-02-16  Jeffrey Stedfast  <fejj@ximian.com>
28656
28657         * socket-io.c (convert_sockopt_level_and_name): If the system
28658         doesn't define SOL_IP or SOL_TCP, get them by hand using
28659         getprotobyname() and caching the values (because this could be a
28660         slow operation).
28661         (ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal):
28662         Use the appropriate struct when the system does support it. Ie,
28663         not all systems have struct ip_mreqn so use struct ip_mreq when
28664         appropriate.
28665
28666 Fri Feb 15 18:15:44 CET 2002 Paolo Molaro <lupus@ximian.com>
28667
28668         * reflection.c: handle finally clauses.
28669
28670 Fri Feb 15 15:06:33 CET 2002 Paolo Molaro <lupus@ximian.com>
28671
28672         * socket-io.c: use g_snprintf() instead of snprintf.
28673
28674 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
28675
28676         * reflection.c (mono_param_get_objects): Cast second argument to
28677         mono_method_get_param_names to a const char** to silence the
28678         compiler warning.
28679
28680         * appdomain.c (mono_domain_assembly_open): Put parens around the
28681         truth statement in the for-loop.
28682
28683         * unicode.c (iconv_convert): Got rid of a compiler warning about
28684         int i being unused when the system has a new iconv.
28685         (iconv_get_length): Same.
28686
28687         * image.c (load_class_names): Cast the second argument to
28688         g_hash_table_insert() to char* to hush compiler warnings about the
28689         arg being a const.
28690         (mono_image_open): Same here.
28691
28692         * socket-io.c: Don't conditionally include sys/filio.h or
28693         sys/sockio.h here anymore since we now get them from
28694         io-layer/io-layer.h
28695         (inet_pton): If the system doesn't support inet_aton, implement
28696         using inet_addr and also #define INADDR_NONE if it isn't defined
28697         by the system.
28698
28699 Thu Feb 14 19:01:06 CET 2002 Paolo Molaro <lupus@ximian.com>
28700
28701         * metadata.c, metadata.h: added function to get packing and size info
28702         of a typedef.
28703         * reflection.h, reflection.c: handle field RVA data. Save info about
28704         the table layout if needed. Assign typedef indexes to all the types
28705         before dumping the info about them to avoid forward reference problems.
28706
28707 2002-02-14  Dietmar Maurer  <dietmar@ximian.com>
28708
28709         * socket-io.c (convert_sockopt_level_and_name): ifdef
28710         SO_ACCEPTCONN because it is not defined on my system (old debian)
28711
28712 Thu Feb 14 11:49:30 CET 2002 Paolo Molaro <lupus@ximian.com>
28713
28714         * opcode.c: use stddef.h to get NULL.
28715
28716 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
28717
28718         * socket-io.c: conditionally include sys/filio.h and sys/sockio.h
28719         for FIONBIO, FIONREAD and SIOCATMARK.
28720         (ves_icall_System_Net_Dns_GetHostByAddr_internal): SunOS doesn't
28721         define INADDR_NONE and besides, inet_addr() is deprecated and
28722         should not be used. Use inet_pton() instead - it also has the
28723         added bonus that it can easily handle IPv6 addresses as well.
28724         (inet_pton): Implement using inet_aton() ifndef HAVE_INET_PTON.
28725
28726 Wed Feb 13 23:00:21 CET 2002 Paolo Molaro <lupus@ximian.com>
28727
28728         * decimal.c: remove _MSC_VER conditional.
28729
28730 2002-02-13  Dick Porter  <dick@ximian.com>
28731
28732         * socket-io.c: 
28733         * icall.c: Internal calls for Blocking, Select, Shutdown,
28734         GetSocketOption and SetSocketOption
28735
28736 Wed Feb 13 19:20:01 CET 2002 Paolo Molaro <lupus@ximian.com>
28737
28738         * assembly.cs: better resolver: use it instead of some kludgy
28739         code.
28740
28741 Wed Feb 13 18:25:55 CET 2002 Paolo Molaro <lupus@ximian.com>
28742
28743         * reflection.c: the best way to speed-up the compiler is to avoid
28744         infinite loops.
28745
28746 2002-02-13  Dietmar Maurer  <dietmar@ximian.com>
28747
28748         * class.c (mono_class_vtable): changed the object layout
28749         (obj->vtable->class). 
28750         (mono_class_create_from_typespec): consider MONO_TYPE_PTR
28751
28752 Tue Feb 12 20:06:01 CET 2002 Paolo Molaro <lupus@ximian.com>
28753
28754         * assembly.c: look for assemblies in the assembly dir, too.
28755
28756 Tue Feb 12 14:03:42 CET 2002 Paolo Molaro <lupus@ximian.com>
28757
28758         * class.c: fix thinko in mono_class_from_type().
28759
28760 Mon Feb 11 19:43:51 CET 2002 Paolo Molaro <lupus@ximian.com>
28761
28762         * exception.h, exception.c: added TypeLoadException.
28763         * object.h, object.c: added mono_array_clone ().
28764         * icall.c: handle throwOnError in AssemblyGetType().
28765         Added Array.Clone().
28766         * opcode.h, opcode.c: use a single value for the opcode val.
28767         Compile fix for non-gcc compilers.
28768
28769 Fri Feb 8 12:26:37 CET 2002 Paolo Molaro <lupus@ximian.com>
28770
28771         * opcodes.c, opcodes.h: export interesting info about opcodes.
28772
28773 2002-02-05  Dietmar Maurer  <dietmar@ximian.com>
28774
28775         * object.h (MONO_CHECK_ARG, MONO_CHECK_ARG_NULL): new macro for
28776         icalls. 
28777
28778         * class.c (class_compute_field_layout): set element_class for enums
28779         (mono_class_create_from_typedef): set element_class for normal classes
28780
28781         * icall.c (ves_icall_System_Enum_get_value): impl.
28782
28783         * class.c (mono_class_create_from_typedef): do not set valuetype
28784         flag for System.ValueType and System.Enum
28785
28786 2002-02-04  Dietmar Maurer  <dietmar@ximian.com>
28787
28788         * unicode.c (iconv_convert): fix big endian problem.
28789
28790 Fri Feb 1 16:13:20 CET 2002 Paolo Molaro <lupus@ximian.com>
28791
28792         * class.c: add asserts if we are ever going to scribble over memory.
28793         * socket-io.c: not all systems have AF_IRDA defined.
28794
28795 2002-01-31  Dietmar Maurer  <dietmar@ximian.com>
28796
28797         * class.c (class_compute_field_layout): do not consider static
28798         fields to compute alignment
28799
28800 2002-01-25  Dietmar Maurer  <dietmar@ximian.com>
28801
28802         * appdomain.c (mono_appdomain_get): impl.
28803         (ves_icall_System_AppDomain_ExecuteAssembly): impl.
28804
28805 Thu Jan 24 12:59:23 CET 2002 Paolo Molaro <lupus@ximian.com>
28806
28807         * icall.c: ignore "file://" prefix when loading an assembly.
28808
28809 2002-01-23  Dick Porter  <dick@ximian.com>
28810
28811         * socket-io.c:
28812         * icall.c:
28813         * Makefile.am: Added socket support
28814
28815 2002-01-23  Miguel de Icaza  <miguel@ximian.com>
28816
28817         * icall.c (ves_icall_appdomain_get_default_assemblies): put this
28818         code back.  This should return the assemblies that are loaded by
28819         the runtime on behalf of an application domain. 
28820
28821         The current implementation is still broken, it just returns every
28822         assembly loaded, but until we get real applications domain this
28823         will do.
28824
28825 2002-01-23  Dietmar Maurer  <dietmar@ximian.com>
28826
28827         * icall.c (ves_icall_appdomain_get_cur_domain): runtime_init the
28828         AppDomain object.
28829
28830 2002-01-23  Miguel de Icaza  <miguel@ximian.com>
28831
28832         * icall.c (ves_icall_appdomain_get_cur_domain): Cache the value of
28833         the mono_class_from_name lookup.
28834         (ves_icall_get_parameter_info): ditto.
28835         (ves_icall_appdomain_get_assemblies, add_assembly): Implement new internal
28836         method.
28837         (ves_icall_System_Reflection_Assembly_get_code_base): Another new call.
28838
28839 Tue Jan 22 22:43:47 CET 2002 Paolo Molaro <lupus@ximian.com>
28840
28841         * class.c: load also nested classes on class init.
28842         System.ValueType instance methods gets passed boxed
28843         values, unless methods in derived classed that get a pointer to the
28844         data.
28845         * icall.c: use better name parsing code in GetType().
28846         * image.c, image.h: add mono_image_loaded ().
28847         * metadata.c, metadata.h: add mono_metadata_nesting_typedef ().
28848         * reflection.c, reflection.h: added mono_reflection_parse_type().
28849
28850 2002-01-22  Veronica De Santis <veron78@interfree.it>
28851
28852         * icall.c : Added mapping of internal calls for Manual and Auto reset events
28853         * threads.c : Added the implementation of internal calls for events
28854         * threads.h : Added prototypes of internal calls for events
28855         
28856 2002-01-21  Radek Doulik  <rodo@ximian.com>
28857
28858         * icall.c (ves_icall_InitializeArray): swap bytes on big endians
28859
28860 2002-01-21  Dietmar Maurer  <dietmar@ximian.com>
28861
28862         * class.c (mono_class_init): set min_align to 1 (instead of 0)
28863         (mono_class_value_size): use min_align
28864
28865 2002-01-20  Dick Porter  <dick@ximian.com>
28866
28867         * threads.h:
28868         * threads.c: Replaced all instances of WapiHandle * with HANDLE,
28869         so it compiles on w32.
28870
28871 2002-01-17  Dietmar Maurer  <dietmar@ximian.com>
28872
28873         * metadata.c (mono_type_stack_size): impl.
28874
28875         * class.c (mono_class_get_field): impl. memberref token
28876
28877 2002-01-16 Veronica De Santis <veron78@@interfree.it>
28878
28879         * icall.h : Added the internal calls mapping for CreateMutex_internal
28880                     and ReleaseMutex_internal.
28881         * threads.h : Added the prototype of mutexes internal calls.
28882         * threads.c : Added the implementations of mutexes internal calls.
28883
28884 Tue Jan 15 22:47:57 CET 2002 Paolo Molaro <lupus@ximian.com>
28885
28886         * metaparse.h: removed unused file.
28887         * reflection.c, reflection.h: added stream_data_align () function 
28888         to align data in streams and keep stream aligned. Add support for
28889         exception support in method headers.
28890
28891 Tue Jan 15 19:42:50 CET 2002 Paolo Molaro <lupus@ximian.com>
28892
28893         * unicode.c: make iconv_convert () return the number of bytess written
28894         in the output buffer.
28895
28896 2002-01-15  Dick Porter  <dick@ximian.com>
28897         * threads.c: Make the runtime's idea of infinite timeouts coincide
28898         with the class library's
28899
28900         Fix a particularly egregious bug in mono_thread_cleanup(). That
28901         code was so utterly bogus it must have been written on a Monday.
28902
28903 Mon Jan 14 17:01:03 CET 2002 Paolo Molaro <lupus@ximian.com>
28904
28905         * reflection.h: add subtypes field to TypeBuilder.
28906         * reflection.c: encode constants for literal fields.
28907         Handle subtypes. Fix user string token (and add a zero byte)
28908         at the end.
28909         
28910 2002-01-14  Dietmar Maurer  <dietmar@ximian.com>
28911
28912         * class.c (mono_class_init): bug fix: assign slot numbers for
28913         abstract methods.
28914
28915 Fri Jan 11 18:54:42 CET 2002 Paolo Molaro <lupus@ximian.com>
28916
28917         * reflection.c: don't try to output a code RVA for abstract methods.
28918         Small fixes for method header format. Output parameter info to the
28919         ParamDef table. Save method overriding info to MethodImpl table.
28920         Fix property support. Allow typedef.extends to be a type in the
28921         building assembly.
28922         * verify.c: fix off-by-one error.
28923
28924 Thu Jan 10 19:36:27 CET 2002 Paolo Molaro <lupus@ximian.com>
28925
28926         * class.c: fix mono_class_from_mono_type () for szarray types.
28927         Remove unused cache check in mono_class_from_type_spec().
28928         * icall.c: *type_from_name () functions handle simple arrays and byref.
28929         * reflection.c: handle byref and szarray types. Handle methods without
28930         body (gets P/Invoke compilation working). Handle types and fields in
28931         get_token ().
28932         * reflection.h: add rank to MonoTypeInfo.
28933
28934 2002-01-10  Dick Porter  <dick@ximian.com>
28935
28936         * threads.c: Implemented WaitAll(), WaitAny() and WaitOne()
28937         internal calls
28938
28939 Wed Jan 9 19:27:13 CET 2002 Paolo Molaro <lupus@ximian.com>
28940
28941         * icall.c: initialize class in type_from_handle ().
28942         Loop also in parent classes for get_method ().
28943         * reflection.c: properly encode class and valuetype types.
28944         Start on encoding TypeBuilder types. Handle fieldrefs.
28945         Use correct length when registering a user string.
28946         Handle ConstructorBuilder and MonoMethod in get_token ().
28947         Make mono_type_get_object () aware of cached types.
28948         * object.c: back out change to mono_string_new ().
28949
28950 Tue Jan 8 22:47:44 EST 2002 Matt Kimball <matt@kimball.net>
28951         * object.c: mono_string_new should return a NULL when the string 
28952         passed in is NULL -- not try to deference it.
28953         
28954 Sat Jan 5 15:48:04 CET 2002 Paolo Molaro <lupus@ximian.com>
28955
28956         * icall.c: hack to make IsSubType work for TypeBuilders.
28957         * reflection.c: emit constructors before methods.
28958         Retrieve param names in mono_param_get_objects().
28959
28960 2002/01/05  Nick Drochak  <ndrochak@gol.com>
28961
28962         * Makefile.am: fix list of headers and sources so automake 1.5
28963         doesn't complain. Removed \# at end of list.
28964
28965 Thu Jan 3 23:17:17 CET 2002 Paolo Molaro <lupus@ximian.com>
28966
28967         * reflection.c: get token for a method ref. Set return type of
28968         constructor to void.
28969         * loader.c: debug message.
28970         * class.c: typo fix.
28971
28972 Mon Dec 24 17:18:10 CET 2001 Paolo Molaro <lupus@ximian.com>
28973
28974         * icall.c: fix array init with rank > 1. FindMembers
28975         loops in parent class as well.
28976         * image.c: do not insert nested types in name cache.
28977         * reflection.c: warning fix.
28978         * reflection.h: add override method (for interface impl).
28979
28980 Mon Dec 24 16:16:56 CET 2001 Paolo Molaro <lupus@ximian.com>
28981
28982         * metadata.c: fix customattr decoding.
28983
28984 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
28985
28986         * rawbuffer.cs: Added native Win32 implementation, avoids using
28987         mmap on Cygwin.  This patch is from Dan Lewis (dihlewis@yahoo.co.uk)
28988
28989 Thu Dec 20 20:11:26 CET 2001 Paolo Molaro <lupus@ximian.com>
28990
28991         * class.c: make the low-level routines handle the cache.
28992
28993 Thu Dec 20 15:20:35 CET 2001 Paolo Molaro <lupus@ximian.com>
28994
28995         * image.c: fopen (file, "rb") ("David Dawkins" <david@dawkins.st>).
28996
28997 Tue Dec 18 18:50:00 CET 2001 Paolo Molaro <lupus@ximian.com>
28998
28999         * class.c: fix mono_array_element_size() for objects.
29000         * class.h, class.c: add properties to MonoClass and load them
29001         at init time.
29002         * icall.c: check with isinst() when assigning a value to an array
29003         instead of requiring the classes to match exactly.
29004         Implemented icall for System.Type::GetType().
29005         Implemented icalls to get ParameterInfo, ProprtyInfo and info about
29006         enums. Handle bindingflags when looking for methods and fields.
29007         * metadata.h, metadata.c: implemented mono_metadata_properties_from_typedef()
29008         and mono_metadata_methods_from_property().
29009         * reflection.h, reflection.c: added structures for propreties,
29010         parameters and enums. Implemented mono_property_get_object() and
29011         mono_param_get_objects().
29012
29013 2001-12-18  Dick Porter  <dick@ximian.com>
29014
29015         * file-io.c: Use mono_string_to_utf16() instead of
29016         mono_string_chars()
29017
29018         * object.c: Added mono_string_to_utf16(), which copies the non
29019         NULL-terminated MonoString into a new double-null-terminated
29020         buffer.
29021
29022 2001-12-17  Dietmar Maurer  <dietmar@ximian.com>
29023
29024         * icall.c (ves_icall_System_DateTime_GetNow): added EPOCH adjustment
29025
29026 2001-12-16  Dietmar Maurer  <dietmar@ximian.com>
29027
29028         * file-io.c: raise exceptions if handle is invalid.
29029
29030 Thu Dec 13 20:27:08 CET 2001 Paolo Molaro <lupus@ximian.com>
29031
29032         * assembly.c: yet another check for mscorlib.
29033         * class.c, class.h: load nesting info for classes.
29034         * icall.c: many new functions to support the Reflection classes.
29035         * metadata.c, metadata.h: mono_metadata_nested_in_typedef() added.
29036         * reflection.h, reflection.c: mono_image_create_token(),
29037         mono_assembly_get_object(), mono_type_get_object(),
29038         mono_method_get_object(), mono_field_get_object(): methods to return
29039         objects that parallel the C representation of assemblies, types,
29040         methods, fields.
29041
29042 2001-12-11  Dick Porter  <dick@ximian.com>
29043
29044         * icall.c:
29045         * file-io.c: Internal calls for file IO.
29046
29047 Thu Dec 6 16:21:30 CET 2001 Paolo Molaro <lupus@ximian.com>
29048
29049         * tabledefs.h: missing FileAttributes.
29050         * verify.h, verify.c: use is_valid_string () to simplify and check for
29051         valid strings more correctly. Fix warnings and speeling.
29052         Check more tables: Filed, File, ModuleRef, StandAloneSig.
29053         Check code: branches, maxstack, method calls.
29054
29055 2001-12-04  Dietmar Maurer  <dietmar@ximian.com>
29056
29057         * object.c (mono_object_allocate): removed static, so that the jit
29058         can allocate value types.
29059
29060         * icall.c (ves_icall_System_DateTime_GetNow): impl.
29061
29062 Mon Dec 3 17:02:01 CET 2001 Paolo Molaro <lupus@ximian.com>
29063
29064         * class.c: init enum types right away and register the
29065         token->MonoClass map in mono_class_create_from_typedef ().
29066         * verify.h, verify.c: first cut of the verifier.
29067         * pedump.c: add --verify switch to verify metadata tables.
29068         * tabledefs.h: add some missing enums.
29069
29070 2001-11-30  Dietmar Maurer  <dietmar@ximian.com>
29071
29072         * class.c (mono_install_runtime_class_init): impl.
29073         (mono_class_init): renamed mono_class_metadata_init to
29074         mono_class_init, also removed the metadata_inited flag
29075
29076         * object.c (mono_object_isinst): use faster algorithm
29077
29078 2001-11-30  Radek Doulik  <rodo@ximian.com>
29079
29080         * mono-endian.h: reverted last change
29081         added function prototypes
29082
29083         * Makefile.am (libmetadata_a_SOURCES): reverted my last change and
29084         add mono-endian.c back
29085
29086         * mono-endian.c: returned back, as Paolo pointed out, it's needed
29087         for unaligned access, I've mistaked it with endianess. I am
29088         sorry.
29089         (mono_read16): fix reverted endianess
29090         (mono_read64): ditto
29091         (mono_read32): ditto
29092
29093 2001-11-30  Dick Porter  <dick@ximian.com>
29094
29095         * exception.c: Implement mono_exception_from_name()
29096
29097 Fri Nov 30 12:01:02 CET 2001 Paolo Molaro <lupus@ximian.com>
29098
29099         * metadata.h, metadata.c: remove params_size and locals_size and their
29100         calculation from the metadata code: they are only usefult to the
29101         interp.
29102
29103 2001-11-29  Radek Doulik  <rodo@ximian.com>
29104
29105         * object.c (mono_ldstr): swap bytes here, it's probably not the
29106         best place, but works for me now, I'll redo it once I know mono
29107         better, also note that I add PROT_WRITE and don't reset back, also
29108         note that it's only affects big endians, so x86 should be OK
29109
29110         * mono-endian.h (read16): use just glib macros for both endians
29111
29112         * mono-endian.c: removed as glib macros are used in in
29113         mono-endian.h so we don't need to care about endianess for read
29114         macros as glib does that for us already
29115
29116 Thu Nov 29 18:20:58 CET 2001 Paolo Molaro <lupus@ximian.com>
29117
29118         * class.h, class.h: take minimum alignment into consideration so
29119         that the fields of a class remain aligned also when in an array.
29120
29121 Tue Nov 27 16:39:01 CET 2001 Paolo Molaro <lupus@ximian.com>
29122
29123         * loader.h, loader.c: add mono_method_get_param_names().
29124         * class.c: 0-init class fields.
29125
29126 2001-11-26  Dick Porter  <dick@ximian.com>
29127
29128         * icall.c:
29129         * threads-types.h:
29130         * threads.c: New file that handles System.Threading on all platforms
29131
29132         * object.c: 
29133         * object.h: Remove the synchronisation struct from MonoObject,
29134         replace it with a pointer that gets initialised on demand
29135
29136         * Makefile.am: Replace all the system-specific threading code with
29137         a single file that uses the new wrapper library
29138
29139 Mon Nov 19 11:37:14 CET 2001 Paolo Molaro <lupus@ximian.com>
29140
29141         * class.c, class.h: add mono_install_trampoline() so that the runtime
29142         can register a function to create a trampoline: removes the ugly
29143         requirement that a runtime needed to export arch_create_jit_trampoline.
29144         * object.h, object.c: added mono_install_handler() so that the runtime
29145         can install an handler for exceptions generated in C code (with
29146         mono_raise_exception()). Added C struct for System.Delegate.
29147         * pedump.c: removed arch_create_jit_trampoline.
29148         * reflection.c: some cleanups to allow registering user strings and
29149         later getting a token for methodrefs and fieldrefs before the assembly
29150         is built.
29151         * row-indexes.h: updates and fixes from the new ECMA specs.
29152
29153 Thu Nov 15 17:44:49 CET 2001 Paolo Molaro <lupus@ximian.com>
29154
29155         * class.h, class.c: add enum_basetype field to MonoClass.
29156         * metadata.h, metadata.c: add mono_metadata_get_constant_index()
29157         to get index in the constant table reated to a field, param or
29158         property.
29159         * reflection.h, reflection.c: handle constructors. Set public-key and
29160         version number of the built assembly to 0.
29161         * row-indexes.h: update from new ECMA spec.
29162
29163 Wed Nov 14 19:26:06 CET 2001 Paolo Molaro <lupus@ximian.com>
29164
29165         * class.h, class.c: add a max_interface_id to MonoClass.
29166         * icall.c: rename my_mono_new_object() to my_mono_new_mono_type()
29167         since it's used to do that. Added mono_type_type_from_obj().
29168         Make GetType() return NULL instead of segfaulting if the type was not
29169         found. Handle simple arrays in assQualifiedName.
29170         * object.h: add a struct to represent an Exception.
29171         * reflection.c: output call convention in method signature.
29172         Add code to support P/Invoke methods and fixed offsets for fields.
29173
29174 Mon Nov 12 12:41:32 CET 2001 Paolo Molaro <lupus@ximian.com>
29175
29176         * decimal.c, decimal.h: mono_double2decimal() get the sign bit from
29177         the value.
29178         * icall.c: use mono_array_addr instead of array->vector: fixes the
29179         reflection image writing.
29180         * reflection.c: init call convention byte to 0 in method signature.
29181         Encode the property signature. Don't output property-related methods
29182         twice. Really process the properties for a type (don't cast a field to
29183         a property, my mom always told me that).
29184         Fix 64 bit issues in pointer alignment in a different and more
29185         readable way.
29186
29187 2001-11-10  Sean MacIsaac  <macisaac@ximian.com>
29188
29189         * loader.h: Removed type class from MonoDefaults, added monotype
29190
29191         * loader.c: Loaded MonoType, removed loading of Type
29192
29193         * icall.c (my_mono_new_object): Now returns a System.MonoType,
29194         and fills in System.Type._impl with a RuntimeTypeHandle rather
29195         than the actual MonoClass *
29196
29197         (ves_icall_type_from_handle): change from type_class to
29198         monotype_class
29199
29200         (ves_icall_System_Runtime_InteropServices_Marshal_ReadIntPtr):
29201         implemented
29202
29203         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAuto):
29204         implemented
29205
29206         (ves_icall_System_Reflection_Assembly_LoadFrom): implemented
29207
29208         (ves_icall_System_Reflection_Assembly_GetType): implemented
29209
29210         (ves_icall_System_MonoType_assQualifiedName): implemented
29211
29212         (ves_icall_System_PAL_OpSys_GetCurrentDirecotry): implemented
29213
29214 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
29215
29216         * assembly.c (mono_assembly_open): Implement a cache for the
29217         assemblies. 
29218
29219         (mono_assembly_close): only destroy the assembly when the last
29220         reference is gone.
29221         
29222 2001-11-09  Dick Porter  <dick@ximian.com>
29223
29224         * Makefile.am (pedump_LDADD): Don't need THREAD_LIBS any more
29225
29226 2001-11-09  Dietmar Maurer  <dietmar@ximian.com>
29227
29228         * class.c (mono_class_metadata_init): bug fix: compute the right slot
29229
29230 Fri Nov 9 15:48:02 CET 2001 Paolo Molaro <lupus@ximian.com>
29231
29232         * icall.c, decimal.h, decimal.c: integrated decimal internalcalls
29233         from Martin Weindel.
29234         * object.h: add mono_string_chars ().
29235
29236 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
29237
29238         * reflection.c (build_compressed_metadata): Eliminates warnings
29239         and uses 64-bit clean code.
29240
29241         * metadata.c (mono_type_hash): Change signature to eliminate warnings.
29242         (mono_type_equal): Change signature to eliminate warnings.
29243
29244 Wed Nov 7 15:40:01 CET 2001 Paolo Molaro <lupus@ximian.com>
29245
29246         * icall.c, loader.c: remove the internalcall array constructors.
29247         Changes to match the new MonoArray structure.
29248         * object.h, object.c: an array object doesn't allocate an extra
29249         vector. Add mono_array_new_full () to create jagged arrays easily.
29250
29251 Mon Nov 5 19:51:06 CET 2001 Paolo Molaro <lupus@ximian.com>
29252
29253         * metadata.h, metadata.c: add mono_metadata_field_info () to
29254         retreive all the info about a field from vairous tables.
29255         * icall.c: implement S.Runtime.CServices::InitializeArray () icall.
29256         * class.h, class.c: augment MonoClassField with more info.
29257         Implemented mono_ldtoken for fields. Implemented ExplicitLayout
29258         policy and load a field's RVA if needed.
29259
29260 2001-11-05  Dietmar Maurer  <dietmar@ximian.com>
29261
29262         * class.c (mono_class_metadata_init): create a trampoline for all
29263         virtual functions instead of actually compiling them.
29264
29265 Fri Nov 2 19:37:51 CET 2001 Paolo Molaro <lupus@ximian.com>
29266
29267         * class.h, class.c: include name in MonoClassField.
29268         * class.c: fix fundamental type of System.Object and System.String.
29269         Set the right fundamental type for SZARRAY, too. Handle TypeSpec
29270         tokens in ldtoken.
29271         * icall.c: remove internalcalls for the Reflection stuff that is now
29272         done in C# code.
29273         * loader.c: mono_field_from_memberref () implementation.
29274         * mono-endian.c: thinko (s/struct/union/g).
29275         * object.c, object.h: make the mono_string_* prototypes actually use
29276         MonoString instead of MonoObject.
29277         * reflection.c, reflection.h: updates for changes in the reflection
29278         code in corlib: we use C structures that map to the actual C# classes.
29279         Handle SZARRAYs when encoding types. Handle locals in methods. Use a
29280         fat method header if needed and use the info from the ILGenerator for
29281         methods. Handle fields in types. Misc fixes.
29282
29283 2001-10-17  Dietmar Maurer  <dietmar@ximian.com>
29284
29285         * class.c (mono_class_metadata_init): bug fix: always allocate
29286         space for static class data
29287
29288 2001-10-25  Dietmar Maurer  <dietmar@ximian.com>
29289
29290         * class.c (mono_compute_relative_numbering): use relative
29291         numbering to support fast runtime type checks.
29292
29293 2001-10-17  Sean MacIsaac  <macisaac@ximian.com>
29294
29295         * class.c (mono_class_create_from_typeref): added debugging output
29296         to print class name when MonoDummy is returned instead of real class
29297
29298 2001-10-15  Dietmar Maurer  <dietmar@ximian.com>
29299
29300         * class.c (mono_class_metadata_init): interface offset table now
29301         contains pointers into the vtable - this is more efficient for the jit
29302
29303 2001-10-12  Dietmar Maurer  <dietmar@ximian.com>
29304
29305         * class.c (mono_class_metadata_init): use a temporary vtable (the
29306         old algorithm only worked for the interpreter, but not for the jit)
29307
29308 2001-10-11  Dietmar Maurer  <dietmar@ximian.com>
29309
29310         * loader.c (method_from_memberref): use mono_class_get to get the
29311         class of an array instead of using System.Array directly.
29312         (mono_get_method): also add MEMBERREF methods to the method cache
29313         which usefull for arrays.
29314
29315 2001-10-10  Dietmar Maurer  <dietmar@ximian.com>
29316
29317         * pedump.c (arch_compile_method): added to compute vtable entry
29318
29319         * metadata.c (mono_metadata_interfaces_from_typedef): also return the
29320         number of interfaces.
29321         
29322         * class.h: merged MonoArrayClass into MonoClass
29323
29324         * class.c (mono_class_create_from_typedef): compute the vtable size and
29325         allocate space to include the vtable inside MonoClass
29326         (mono_class_metadata_init): initialize the vtable
29327
29328 Mon Oct 8 16:12:38 CEST 2001 Paolo Molaro <lupus@ximian.com>
29329
29330         * metadata.c, metadata.h: use MonoArrayType to describe the shape of an array.
29331         Guard against calling bsearch with a NULL pointer (pointed out by Laurent Rioux, smoux).
29332         * image.c: endian fixes by Laurent Rioux.
29333         * object.h, object.c: rename MonoStringObject to MonoString and
29334         MonoArrayObject to MonoArray. Change some function names to conform to
29335         the style mono_<object>_<action>. mono_string_new_utf16 () takes a
29336         guint16* as first argument, so don't use char*.
29337         Provide macros to do the interesting things on arrays in a portable way.
29338         * threads-pthread.c: updates for the API changes and #include <sched.h>
29339         (required for sched_yield()).
29340         * icall.c: updates for the API changes above.
29341         * Makefile.am, mono-endian.c. mono-endian.h: include unaligned read routines for
29342         platforms that need them.
29343
29344 Mon Oct 8 10:43:23 CEST 2001 Paolo Molaro <lupus@ximian.com>
29345
29346         * class.c: set the correct type for all the fundamental
29347         type when loading the class.
29348
29349 2001-10-05  Dick Porter  <dick@ximian.com>
29350
29351         * threads-pthread.c (pthread_mutex_timedlock): Simple
29352         compatibility version for C libraries that lack this call.
29353
29354 Thu Oct 4 19:10:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
29355
29356         * class.c: MonoTypes stored in MonoClass are stored as
29357         fundamental MonoTypes when the class represents a
29358         fundamental type (System.Int32, ...).
29359         The TypeHandle return by ldtoken is a MonoType*.
29360         * icall.c: ves_icall_get_data_chunk () write out all the
29361         PE/COFF stuff. Implement ves_icall_define_method (),
29362         ves_icall_set_method_body (), ves_icall_type_from_handle ().
29363         * image.c: properly skip unknown streams.
29364         * loader.h, loader.c: add type_class to mono_defaults.
29365         * metadata.c, metadata.h: export compute_size () as
29366         mono_metadata_compute_size () with a better interface.
29367         Typo and C&P fixes.
29368         * pedump.c: don't try to print the entry point RVA if there is no entry point.
29369         * reflection.c, reflection.h: many cleanups, fixes, output method
29370         signatures and headers, typedef and typeref info, compress the metadata
29371         tables, output all the heap streams, cli header etc.
29372         * row-indexes.h: typo fixes.
29373
29374 2001-10-04  Dick Porter  <dick@ximian.com>
29375
29376         * object.h: Add a synchronisation mutex struct to MonoObject
29377
29378         * object.c (mono_new_object): Initialise the object
29379         synchronisation mutexes
29380
29381         * icall.c: System.Threading.Monitor internal calls
29382         
29383         * threads-pthread.h:
29384         * threads-pthread.c: System.Threading.Monitor internal calls
29385
29386         * threads-types.h: New file, includes the system-specific thread
29387         structures
29388         
29389         * threads-pthread-types.h:
29390         * threads-pthread-types.c: New files, handle pthread-specific
29391         synchronisation types
29392
29393         * threads-dummy-types.h: 
29394         * threads-dummy-types.c: New files of dummy support for
29395         thread-specific types
29396
29397         * metadata.c:
29398         * image.c:
29399         * pedump.c: include mono-endian.h not endian.h
29400         
29401         * Makefile.am: More threads files.
29402         Name mono-endian.h not endian.h
29403
29404 Tue Oct 2 20:33:48 CEST 2001 Paolo Molaro <lupus@ximian.com>
29405
29406         * Makefile.am, reflection.h, reflection.c: move here the reflection related 
29407         stuff and implement a few more bits.
29408         * icall.c: a field needs to be dereferenced twice. Do not use the same
29409         name for two variables in the same scope.
29410         * image.c, image.h: cleanups.
29411
29412 2001-10-02  Dietmar Maurer  <dietmar@ximian.com>
29413
29414         * class.c (mono_class_metadata_init): bug fix: compute the right size
29415
29416 Mon Oct 1 20:43:57 CEST 2001 Paolo Molaro <lupus@ximian.com>
29417
29418         * icall.c: implemented some of the Reflection internalcalls.
29419         * image.c, image.h: start writing out the PE/COFF image.
29420         * metadata.h, metadata.c: implement mono_metadata_encode_value ()
29421         that does the reverse than decode_blob_size ().
29422         * object.c: use mono_metadata_encode_value (). Move here
29423         temporary implementation of mono_string_to_utf8 ().
29424         * rawbuffer.c: make malloc_map static.
29425
29426 Fri Sep 28 19:26:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
29427
29428         * metadata.c: fix type comparison for arrays.
29429         * loader.h, loader.c: half-assed fix to get more tests work in cygwin.
29430         Added a couple of new classes to monodefaults.
29431         * icall.c: added a couple of Reflection-related internalcalls.
29432         * class.h, class.c: implemented mono_ldtoken () for RuntimeTypeHandles.
29433         Added a byval_arg MonoType to MonoClass.
29434
29435 2001-09-28  Dick Porter  <dick@ximian.com>
29436
29437         * icall.c:
29438         * threads-pthread.h: 
29439         * threads-pthread.c: Implemented internal calls for
29440         LocalDataStoreSlot operations.  Applied mutexes around all shared
29441         data.  Reworked the thread creation and Start() operations to
29442         avoid a race condition.
29443         
29444         * threads-dummy.h:
29445         * threads-dummy.c: Dummy calls for the LocalDataStoreSlot operations
29446
29447 Thu Sep 27 21:45:55 CEST 2001 Paolo Molaro <lupus@ximian.com>
29448
29449         * rawbuffer.c: disable mmap on cygwin since it seems to be broken there.
29450
29451 Thu Sep 27 19:52:11 CEST 2001 Paolo Molaro <lupus@ximian.com>
29452
29453         * class.c, loader.c: warn and return NULL instead of erroring out.
29454         * icall.c: added System.AppDomain::getCurDomain().
29455         * loader.c: we don't need to lookup the typedef again for p/invoke calls.
29456
29457 2001-09-25  Dick Porter  <dick@ximian.com>
29458
29459         * threads-pthread.h:
29460         * threads-pthread.c: Implemented timed thread joining and added
29461         System.Threading.Thread::Join_internal internal call
29462
29463         * icall.c: Added System.Threading.Thread::Join_internal internal call
29464
29465         * threads-dummy.h:
29466         * threads-dummy.c: Dummy calls for System.Thread.Thread::Join_internal
29467
29468 Mon Sep 24 18:56:59 CEST 2001 Paolo Molaro <lupus@ximian.com>
29469
29470         * object.c, object.h: added mono_ldstr (), mono_string_is_interned () and
29471         mono_string_intern () to implement the semantics of the ldstr opcode
29472         and the interning of System.Strings.
29473         * icall.c: provide hooks to make String::IsIntern and String::Intern
29474         internalcalls.
29475
29476 2001-09-23  Dick Porter  <dick@ximian.com>
29477
29478         * threads-dummy.c: 
29479         * threads-dummy.h: New files of dummy threading routines
29480
29481         * Makefile.am (THREAD_SOURCE): Arrange to compile different thread
29482         support code based on system specifics
29483
29484         Rename PTHREAD_LIBS to THREAD_LIBS
29485         
29486 2001-09-23  Dick Porter  <dick@ximian.com>
29487
29488         * threads-pthread.c: Implement the System.Threading.Thread::Sleep,
29489         Schedule (called when asked to Sleep for 0 ms) and CurrentThread
29490         internal calls.
29491         (mono_thread_init): Set up a Thread object instance to return when
29492         the main thread calls Thread.CurrentThread
29493         (mono_thread_cleanup): Wait for all subthreads to exit
29494
29495         * icall.c: New internal calls for System.Threading.Thread::Sleep
29496         (including Schedule) and CurrentThread
29497
29498         * threads.h: New file, to insulate thread-specific stuff from the
29499         rest of the code
29500
29501 2001-09-21  Dick Porter  <dick@ximian.com>
29502
29503         * threads-pthread.h: 
29504         * threads-pthread.c: New file, for handling pthreads-style
29505         threading support.  Start() now starts a new thread and executes
29506         the ThreadStart delegate instance.
29507
29508         * icall.c: Added the internalcall for
29509         System.Threading.Thread::Start_internal
29510
29511         * Makefile.am: Added new files, and PTHREADS_LIBS to the link line
29512
29513 Thu Sep 20 19:37:39 CEST 2001 Paolo Molaro <lupus@ximian.com>
29514
29515         * loader.c: work around the different signatures for delegates
29516         constructors csc generates in compiled code vs the ones compiled in mscorlib.
29517
29518 Tue Sep 18 13:16:32 CEST 2001 Paolo Molaro <lupus@ximian.com>
29519
29520         * class.h, class.c: add mono_class_get_field_from_name ().
29521         * *: Fix C comments and other ANSI C issues.
29522
29523 Mon Sep 10 20:21:34 CEST 2001 Paolo Molaro <lupus@ximian.com>
29524
29525         * endian.h, assembly.c: fix some endianness issues.
29526
29527 Fri Sep 7 18:40:40 CEST 2001 Paolo Molaro <lupus@ximian.com>
29528
29529         * loader.h, load.c: add delegate_class to mono_defaults.
29530         Handle runtime provided methods in mono_get_method ().
29531
29532 2001-08-29  Dietmar Maurer  <dietmar@ximian.com>
29533
29534         * loader.c (mono_get_method): use pinvoke for internal call
29535
29536         * icall.c: use pinvoke for internal call
29537
29538         * loader.c (method_from_memberref): set the method name
29539
29540 Wed Aug 29 12:43:41 CEST 2001 Paolo Molaro <lupus@ximian.com>
29541
29542         * metadata.c: help the compiler generate better code for
29543         mono_class_from_mono_type ().
29544
29545 2001-08-28  Dietmar Maurer  <dietmar@ximian.com>
29546
29547         * class.c (mono_class_metadata_init): delayed computing of the
29548         class size to mono_class_metadata_init ()
29549
29550 Tue Aug 28 15:47:15 CEST 2001 Paolo Molaro <lupus@ximian.com>
29551
29552         * class.c, class.h: add an interfaces member to MonoClass.
29553         * image.c, image.h: add assembly_name field to MonoImage
29554         from the assembly table.
29555         * metadata.c, metadata.h: add mono_metadata_interfaces_from_typedef ().
29556
29557 Mon Aug 27 20:12:01 CEST 2001 Paolo Molaro <lupus@ximian.com>
29558
29559         * class.c: Handle Array in mono_class_from_mono_type ().
29560         * metadata.c, pedump.c: some endian fixes.
29561
29562 Mon Aug 27 15:23:23 CEST 2001 Paolo Molaro <lupus@ximian.com>
29563
29564         * class.c, loader.c, loader.h: More types handled in mono_class_from_mono_type ().
29565         * metadata.c: fix small problem introduced with the latest commit.
29566
29567 Mon Aug 27 12:17:17 CEST 2001 Paolo Molaro <lupus@ximian.com>
29568
29569         * loader.c, metadata.c, metadata.h: Export mono_metadata_type_equal().
29570         We don't need a MonoMetadata pointer anymore to compare signatures in
29571         mono_metadata_signature_equal (), update callers.
29572         Reduced memory usage an number of allocations for MonoMethodHeader and
29573         MonoMethodSignature.
29574
29575 Sun Aug 26 23:03:09 CEST 2001 Paolo Molaro <lupus@ximian.com>
29576
29577         * metadata.c: added compare for szarray.
29578
29579 Sun Aug 26 11:34:24 CEST 2001 Paolo Molaro <lupus@ximian.com>
29580
29581         * class.h, class.c, loader.h, loader.c: export mono_class_from_mono_type ()
29582         and add a couple more types to it and mono_defaults. Give an hint on
29583         classes that need implementing in our corlib and are referenced
29584         in mscorlib.
29585
29586 Sat Aug 25 12:52:54 CEST 2001 Paolo Molaro <lupus@ximian.com>
29587
29588         * class.h, class.c: keep track if a class is also an Enum.
29589         * loader.c: Implement a couple more types for use in libffi
29590         marshalling. Gives better diagnostics when failing to dlopen
29591         a library. Set method->klass for P/Invoke methods, too.
29592
29593 Fri Aug 24 19:30:25 CEST 2001 Paolo Molaro <lupus@ximian.com>
29594
29595         * class.c, class.h: add a MonoType this_arg to MonoClass that
29596         represents a pointer to an object of the class' type that
29597         can be used by the interpreter and later the type cache.
29598         Add best guess alignment info for valuetype objects.
29599
29600 Fri Aug 24 15:50:31 CEST 2001 Paolo Molaro <lupus@ximian.com>
29601
29602         * metadata.h, metadata.c, class.h, class.c: squeezed MonoParam
29603         into MonoType: one less level of indirection and allocation and
29604         simplifies quite a bit of code. Added cache for MonoTypes that are
29605         used frequently, so that we don't need to allocate them all the time.
29606
29607 2001-08-24  Dietmar Maurer  <dietmar@ximian.com>
29608
29609         * class.c (mono_class_create_from_typedef): System.Enum is also a
29610         value type, although it does not derive from System.ValueType
29611         (maybe a bug in the ms compiler?)
29612
29613         * metadata.c (mono_type_size): return the right size for value types
29614
29615         * loader.c (mono_get_method): only initialize method header if not abstract
29616
29617         * class.c (mono_class_from_mono_type): use mono_default values. 
29618
29619 2001-08-23  Dietmar Maurer  <dietmar@ximian.com>
29620
29621         * *: use MonoClass pointers instead of <type_tokens>
29622         
29623         * class.h: new flag: metadata_inited.
29624
29625         * class.c (mono_class_metadata_init): impl.
29626         (mono_class_instance_size): impl.
29627         (mono_class_data_size): impl.
29628
29629 Wed Aug 22 16:27:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
29630
29631         * metadata.c, loader.h, loader.c, image.h, image.c, class.h, class.c:
29632         MonoClass now has the name and name_space fields. 
29633         MonoMethod has a pointer to its MonoClass, instead of MonoImage.
29634         mono_get_method () takes and optional MonoClass as argument.
29635         Removed mono_typedef_from_name() and added mono_class_token_from_name()
29636         instead that takes advantage of a map from class names to typedef
29637         tokens in MonoImage.
29638
29639 Tue Aug 21 18:54:58 CEST 2001 Paolo Molaro <lupus@ximian.com>
29640
29641         * metadata.c: zero is not a valid alignment boundary.
29642         Merge MONO_TYPE_VOID in default decoding code.
29643
29644 2001-08-21  Dietmar Maurer  <dietmar@ximian.com>
29645
29646         * image.h: merged MonoMetadata into MonoImage
29647
29648         * class.h: cleanup of MonoArrayClass, use a MonoClass pointer to
29649         identify the type of elements.
29650
29651 Mon Aug 20 19:39:00 CEST 2001 Paolo Molaro <lupus@ximian.com>
29652
29653         * blob.h: fix MONO_TYPE_TYPEDBYREF value.
29654         * cil-coff.h: split MonoMSDOSHeader and add size info.
29655         * image.c: add some consistency checks.
29656         * metadata.c: fix row size computation: one programmer
29657         error and one LAMESPEC. Handle MONO_TYPE_TYPEDBYREF.
29658         add explanation for the locator routine.
29659         Fix decoding of size in method header.
29660         
29661 2001-08-20  Miguel de Icaza  <miguel@ximian.com>
29662
29663         * assembly.c    (g_concat_dir_and_file): Use _S for string concat.
29664         (g_concat_dir_and_file): Bring g_concat_dir_and_file
29665         function from gnome-libs.  This uses the right path separator
29666         based on the OS, and also works around a bug in some systems where
29667         a double slash is not allowed. 
29668         (default_assembly_name_resolver): Use g_concat_dir_and_file
29669         (mono_assembly_open): ditto.
29670
29671 2001-08-20  Dietmar Maurer  <dietmar@ximian.com>
29672
29673         * metadata.c (mono_metadata_signature_equal): impl.
29674
29675         * *: void is now a realy MonoType (instead of using NULL)
29676         
29677         * metadata.c (do_mono_metadata_parse_type): use
29678         mono_metadata_parse_type to parse void value.
29679
29680 Sat Aug 18 12:51:28 CEST 2001 Paolo Molaro <lupus@ximian.com>
29681
29682         * metadata.c, metadata.h: in the signature and method header store
29683         only the space required for holding the loca vars and incoming arguments.
29684
29685 2001-08-15  Dietmar Maurer  <dietmar@ximian.com>
29686
29687         * metadata.c (do_mono_metadata_parse_type): treat void like any
29688         other type (instead of assigning NULL);
29689
29690 2001-08-14  Dietmar Maurer  <dietmar@ximian.com>
29691
29692         * metadata.c (mono_metadata_parse_mh): fixxed pinned/byref value
29693
29694 2001-08-09  Dietmar Maurer  <dietmar@ximian.com>
29695
29696         * image.c (do_mono_image_open): added a cache for arrays.
29697
29698 Sat Aug 4 12:46:02 CEST 2001 Paolo Molaro <lupus@ximian.com>
29699
29700         * metadata.h, metadata.c: add mono_metadata_decode_row_col () to
29701         decode a single column from a row in a metadata table and changes
29702         to take advantage of it in the typedef locator (gives a nice speed up).
29703         Store offset info for function params.
29704
29705 2001-08-02  Dietmar Maurer  <dietmar@ximian.com>
29706
29707         * image.h (MONO_IMAGE_IS_CORLIB): removed 
29708
29709 Wed Aug 1 22:54:08 CEST 2001 Paolo Molaro <lupus@ximian.com>
29710
29711         * assembly.c: how could mono_assembly_close () had ever worked?
29712         * metadata.c, metadata.h: provide offset info for local vars.
29713         Implement mono_type_size () to take care of alignment as well
29714         as size (it was mono_field_type_size in cli/class.c before).
29715
29716 2001-08-01  Dietmar Maurer  <dietmar@ximian.com>
29717
29718         * image.h (MONO_IMAGE_IS_CORLIB): new macro to check root image
29719
29720         * assembly.h (CORLIB_NAME): set to corlib.dll
29721
29722         * assembly.c (mono_assembly_open): replaced strcmp() with !strcmp()
29723
29724 Tue Jul 31 17:54:02 CEST 2001 Paolo Molaro <lupus@ximian.com>
29725
29726         * metadata.h, metadata.c, Makefile.am, private.h, assembly.c, blob.h,
29727         cil-coff.h, image.c, image.h, pedump.c, rawbuffer.c, rawbuffer.h, row-indexes.h,
29728         tokentype.h: massive namespace cleanup.
29729
29730 Mon Jul 30 20:11:01 CEST 2001 Paolo Molaro <lupus@ximian.com>
29731
29732         * metadata.h, metadata.c: decode exception clauses when parsing method header.
29733
29734 2001-07-27  Dietmar Maurer  <dietmar@ximian.com>
29735
29736         * metadata.c (mono_metadata_free_type): added check for type !=
29737         NULL (void) before calling mono_metadata_free_type()
29738
29739 Thu Jul 26 19:11:19 CEST 2001 Paolo Molaro <lupus@ximian.com>
29740
29741         * metadata.h, row_indexes.h: added header with enumerations to use
29742         to index in the columns from tables in metadata and to decode coded
29743         tokens: we should start using this instead of embedding magic numbers
29744         all over the code.
29745
29746 Thu Jul 26 13:03:27 CEST 2001 Paolo Molaro <lupus@ximian.com>
29747
29748         * assembly.c, cil-coff.h, image.c, image.h, pedump.c, typedef.c:
29749         Move metadata_t info from cli_image_info_t to MonoImage, where
29750         it's easily accessible. Changed all the uses accordingly.
29751         Added the method and class caches to MonoImage.
29752         * metadata.c, metadata.h: Changed mono_metadata_decode_blob_size ()
29753         and mono_metadata_decode_value () signature to be more consistent
29754         with the other parse functions (and simplify code). Taken advantage
29755         of zero-length array allocation with GCC. Removed reduntant (and
29756         wrong) MonoFieldType struct and use MonoParam instead. Changed
29757         mono_metadata_parse_field_type () to use common code for parsing.
29758         Added mono_metadata_typedef_from_field () and
29759         mono_metadata_typedef_from_method () to lookup a typedef index from a
29760         field or method token.
29761         Pack the MonoRetType structure more tightly (fits in 8 bytes now).
29762
29763 2001-07-23  Miguel de Icaza  <miguel@ximian.com>
29764
29765         * metadata.c (mono_metadata_parse_field_type): Implement. 
29766         (do_mono_metadata_parse_type): Split engine from
29767         mono_metadata_parse_type, so that we can create smaller structures
29768         for things that just have one pointer to the MonoType (look at
29769         the MonoFieldType)
29770
29771 2001-07-20  Miguel de Icaza  <miguel@ximian.com>
29772
29773         * metadata.c (mono_metadata_parse_mh): Correct the implementation,
29774         as Jan Gray found out, it is incorrect. 
29775
29776 2001-07-18  Miguel de Icaza  <miguel@ximian.com>
29777
29778         * assembly.c: Implement asssembly loading.  This loads an image
29779         and loads all the referenced assemblies.  Come to think of it, we
29780         could always do lazy loading of the assemblies. 
29781
29782         * image.c (mono_image_open): Keep loaded images in a hashtable.
29783
29784         * image.h (MonoImage): Add reference count.
29785
29786 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
29787
29788         * assembly.c (mono_assembly_open): Keep track of the file name in
29789         case the assembly has no ASSEMBLY table.
29790
29791         * metadata.h: Fixed Paolo's quick hack.  Put the documnentation
29792         from get.c here.
29793
29794 Sun Jul 15 19:39:06 CEST 2001 Paolo Molaro <lupus@ximian.com>
29795
29796         * metadata.c, metadata.h: decode local vars in method header
29797         parse function. Change callers accordingly.
29798
29799 Sun Jul 15 17:40:47 CEST 2001 Paolo Molaro <lupus@ximian.com>
29800
29801         * metadata.h, cil-coff.h: protect against multiple inclusion.
29802         Added some new structures to hold information decoded from metadata:
29803         MonoType, MonoParam, MonoArray, MonoMethod, MonoMethodSignature
29804         and relevant decoding/free functions.
29805         * metadata.c: implement decoding functions. Add warning for out of bounds
29806         index in mono_metadata_locate(). Implement mono_get_method () to retreive
29807         all the info about a method signature and invocation. Remove check on
29808         uninitialized local var in parse_mh() and fix memory leak.
29809
29810 2001-07-12  Miguel de Icaza  <miguel@ximian.com>
29811
29812         * metadata.h: More macros.
29813
29814         * tokentype.h: New file.
29815
29816 Fri Jul  6 11:30:53 CEST 2001 Paolo Molaro <lupus@ximian.com>
29817
29818         * assembly.c: added a consistency check and initialize
29819         some structures with g_new0().
29820         * metadata.c: fixed a couple more bugs in table size computation
29821         and add other checks for out-of bound access to metadata.
29822
29823 Thu Jul  5 22:34:21 CEST 2001 Paolo Molaro <lupus@ximian.com>
29824
29825         * metatada.c: fix bugs computing table sizes. Spew a
29826         warning when index in string heap is out of bounds.
29827
29828 2001-07-04  Miguel de Icaza  <miguel@ximian.com>
29829
29830         * metadata.h: Add a couple of macros to manipulate tokens. 
29831
29832 Tue Jul  3 18:33:32 CEST 2001 Paolo Molaro <lupus@ximian.com>
29833
29834         * assembly.c: g_free(ii->cli_sections) (and avoid double free of
29835         cli_section_tables).
29836
29837 2001-07-01  Miguel de Icaza  <miguel@ximian.com>
29838
29839         * metadata.c (mono_metadata_user_string): New function, provides
29840         access to the UserString heap. 
29841
29842 2001-06-27  Miguel de Icaza  <miguel@ximian.com>
29843
29844         * metadata.c: Add inline documentation.
29845
29846 2001-06-26  Miguel de Icaza  <miguel@ximian.com>
29847
29848         * propertyattr.h, paramattr.h, methodsem.h, methodattr.h: New
29849         files. 
29850
29851 2001-06-22  Miguel de Icaza  <miguel@ximian.com>
29852
29853         * typeattr.h: New file, TypeAttribute flags. 
29854
29855 2001-06-21  Miguel de Icaza  <miguel@ximian.com>
29856
29857         * mono/metadata/assembly.c (mono_assembly_ensure_section_idx,
29858         mono_assembly_ensure_section): Section loading code.
29859         (load_section_tables): Load the sections.
29860
29861         * mono/metadata/metadata.c (mono_metadata_locate_token,
29862         mono_metadata_locate): Functions to locate the information
29863         definition given a token or a table and an index.
29864         (mono_metadata_compute_table_bases): New.
29865         (compute_size): New function to compute the sizes of the various
29866         tables.
29867
29868         * mono/metadata/metadata.h: Finish listing the different index
29869         types. 
29870
29871         * mono/metadata/pedump.c: Improve to dump new information.
29872
29873 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
29874
29875         * mono/metadata/metadata.c: Entered all the tables matching
29876         Beta2. 
29877
29878         * mono/metadata/assembly.c (load_metadata_ptrs): Fix for Beta2
29879
29880
29881
29882