2009-04-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
[mono.git] / mono / metadata / ChangeLog
1 2009-04-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
2
3         * assembly.c: assemblies in the GAC should never be shadow-copied.
4
5 2009-04-26  Mark Probst  <mark.probst@gmail.com>
6
7         * domain.c, domain-internals.h: Disable
8         track_resurrection_{objects,handles}_hash in MonoDomain if using
9         SGen.
10
11 2009-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
12
13         * metadata-verify.c: Verify the param table.
14
15 2009-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
16
17         * metadata-verify.c (verify_typedef_table): Range check FieldList and
18         MethodList.
19
20         * metadata-verify.c (verify_method_table): Proper check the ParamList
21         field.
22
23 2009-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
24
25         * metadata-verify.c (verify_method_table): Check for runtime
26         implemented functions such as delegate .ctors. Remove spurious
27         printf.
28         
29 2009-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
30
31         * pedump.c: Proper initialize the runtime forcing the 2.0 profile.
32
33 2009-04-24  Raja R Harinath  <harinath@hurrynot.org>
34
35         Don't allocate MonoGenericInfo for ownerless generic params.
36         * class-internals.h (MonoGenericParam::info): Move field to ...
37         (MonoGenericParamFull): ... this.  New struct.
38         (MonoGenericContainer::type_params): Change type to
39         MonoGenericParamFull.
40         (MonoGenericParam, MonoGenericContainer): Update accessors.
41         * metadata.c (mono_metadata_parse_generic_param): Don't initialize
42         'info' field for ownerless generic param.
43         (mono_metadata_load_generic_params): Update to changes.
44         * reflection.c (mono_reflection_create_generic_class): Likewise.
45         (reflection_methodbuilder_to_mono_method): Likewise.
46         (mono_reflection_initialize_generic_parameter): Likewise.
47
48 2009-04-24  Raja R Harinath  <harinath@hurrynot.org>
49
50         Don't use MonoGenericParamInfo for ownerless generic params.
51         * class.c (get_anon_gparam_class, set_anon_gparam_class): New.  Don't
52         use ParamInfo class at all.
53         (mono_class_from_generic_parameter): Use them.
54         (make_generic_param_class): Fix a couple of instances where 'pinfo
55         == NULL' wasn't handle.
56
57 2009-04-24  Raja R Harinath  <harinath@hurrynot.org>
58
59         * class.c (make_generic_param_class): Carve out of ...
60         (mono_class_from_generic_parameter): ... here.
61
62 2009-04-24  Raja R Harinath  <harinath@hurrynot.org>
63
64         Simplify mono_class_from_generic_parameter
65         * class-internals.h (MonoGenericParamInfo::token): New field.
66         * metadata.c (mono_metadata_load_generic_params): Initialize it
67         from metadata.
68         * class.c (mono_class_from_generic_parameter): Use it instead of
69         searching through metadata.
70
71 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
72
73         * metadata-verify.c: Add verification of the method table.
74
75 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
76
77         * icall.c (ves_icall_Type_GetMethodsByName): Fix memleak for the
78         Delegate::Invoke optimization.
79
80 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
81
82         * appdomain.c (mono_domain_create_appdomain_internal): Free the
83         string returned by get_shadow_assembly_location_base.
84
85         * appdomain.c (get_shadow_assembly_location_base): Add a comment
86         about caller's ownership.
87
88 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
89
90         * reflection.c: Add mono_reflection_cleanup_domain to cleanup
91         reflection memory on domain unload.
92
93         * domain.c (mono_domain_free): Don't free refobject_hash, let the
94         reflection cleanup code do it.
95
96         * domain-internals.h: Add mono_reflection_cleanup_domain.
97
98         This fixes a memory leak for managed mirrors of reflection objects
99         on domain unload. 
100
101 2009-04-22 Rodrigo Kumpera  <rkumpera@novell.com>
102
103         * metadata-verify.c: Implement more verification of the field table.
104
105 2009-04-22 Rodrigo Kumpera  <rkumpera@novell.com>
106
107         * pedump.c (main): Init mono with mscorlib so it defaults to 2.0 and
108         doesn't try to parse the input assembly, which can be broken.
109
110 2009-04-23  Mark Probst  <mark.probst@gmail.com>
111
112         * boehm-gc.c, gc-internal.h, gc.c, monitor.c, null-gc.c,
113         sgen-gc.c: Implement track resurrection in weak GC handles in SGen
114         by using the lowest bit in the link to store whether the link is
115         tracked.  Move the track_resurrection hashes into boehm-gc.c.
116
117 2009-04-22  Miguel de Icaza  <miguel@novell.com>
118
119         * Makefile.am: Split the console support in platform specific code
120         and put together a framework for making this easy in the future so
121         that we can start splitting code instead of having a mess of PLATFORM_WIN32
122
123 2009-04-21 Rodrigo Kumpera  <rkumpera@novell.com>
124
125         * pedump.c: Fix a warning.
126
127 2009-04-21 Rodrigo Kumpera  <rkumpera@novell.com>
128
129         * verify.c (mono_delegate_type_equal): Compare valuetypes using
130         mono_class_from_mono_type to avoid bad interactions with the dual representation
131         of the generic type definition.
132
133 2009-04-21 Rodrigo Kumpera  <rkumpera@novell.com>
134
135         * verify.c (do_invoke_method): Use mono_class_from_mono_type to
136         get the MonoClass for the call context type as it might be a generic
137         instance.
138
139         Fixes #491483.
140
141 2009-04-21  Mark Probst  <mark.probst@gmail.com>
142
143         * object-internals.h: The Thread object has no execution_context
144         member anymore.
145
146         * threads.c, threadpool.c, threads-types.h: Accessor functions for
147         the execution context.
148
149         * appdomain.c: Bump corlib version.
150
151 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
152
153         * verify.c (do_newobj): Improve error message.
154
155 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
156
157         * verify.c (verify_clause_relationship): Only mask as an error if the exception clause
158         is nested in the filter block.
159
160         * verify.c (verify_clause_relationship): The disjoint check must verify if the exception
161         block is not fully nested.
162
163         Fixes #495656.
164
165 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
166
167         * verify.c (verify_type_compatibility_full): Compare MonoClass and
168         not MonoType to check for equality of valuetypes as the generic type
169         definition allows for two different encodings: the generic type definition
170         class or a generic instance over the GTD arguments.
171
172         Fixes #496175.
173
174 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
175
176         * verify.c (dump_stack_value): Fix compilation with extra debug turned on.
177
178         * verify.c (do_initobj): Improve error message.
179
180 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
181
182         * metadata-verify.c: Enable pe verification as the issue with #496453
183         is that the authenticode data directory have a different unspecified
184         format. Ignore it for now.
185
186         * pedump.c: Run the metadata verifier together with the IL verifier.
187
188         Fixes ##496453.
189
190 2009-04-20  Rolf Bjarne Kvinge  <RKvinge@novell.com>
191
192         * metadata-verify.c: Temporarily disable pe verification due to #496453.
193
194 2009-04-17 Rodrigo Kumpera  <rkumpera@novell.com>
195
196         * class.c (can_access_type): Check visibility against
197         the element type for pointers and arrays.
198
199         Fixes #496150.
200
201 2009-04-17 Rodrigo Kumpera  <rkumpera@novell.com>
202
203         * metadata-verify.c: Fix cli and table verification to use information
204         from the MonoImage. A lot of duplicated code got killed.
205
206 2009-04-17 Rodrigo Kumpera  <rkumpera@novell.com>
207
208
209         This patch starts to integrate the metadata verifier with the runtime code.
210
211         This patch causes major regression in functionality for the metadata verifier
212         as cli and table verification are disabled since they require to be ported to
213         use MonoImage information.
214
215         * image.c (do_mono_image_load): Split the code in this function
216         into mono_image_load_pe_data and mono_image_load_cli_data.
217         Add     care_about_pecoff parameter to not load pecoff data.
218         Call into the metadata verifier for pecoff and cli verification.
219
220         * image.c (mono_image_open_raw): New function that doesn't perform
221         any parsing of the image contents.
222         
223         The reason for the 3 new functions is to give pedump better control
224         into the interaction with the verifier.
225
226         * metadata-internals.h: Add new functions from image.c as part of the
227         internal mono API.
228
229         * metadata-verify.c: Split mono_image_verify into mono_verifier_verify_pe_data,
230         mono_verifier_verify_cli_data and mono_verifier_verify_table_data. Prepare
231         to make those functions work together with the runtime.
232
233         * verify.c: Add mono_verifier_is_enabled_for_image function that returns
234         true if the image needs to be verified.
235
236         * verify-internals.h: Export new functions from metadata-verify.c and verify.c.
237
238         * pedump.c: Use new metadata verifier API.
239
240 2009-04-19  Zoltan Varga  <vargaz@gmail.com>
241
242         * object.c (mono_install_vtable_trampoline): Make this receive a
243         trampoline creation function instead of trampoline, allowing the JIT
244         to use a different trampoline for each vtable.
245
246 2009-04-18  Mark Probst  <mark.probst@gmail.com>
247
248         * object.c (mono_raise_exception): Don't reset the thread abort
249         exception state here.
250
251 2009-04-18  Mark Probst  <mark.probst@gmail.com>
252
253         * icall-def.h: New icall for getting the thread abort exception
254         state for a thread.
255
256         * object.c, thread.c, object-internals.h: A thread's abort
257         exception state is now a GC handle.  To get the object it stands
258         for, we must move it into the current app domain, if it's
259         different than the one where it originated from.
260
261         * appdomain.c: Bump corlib version.
262
263         * domain.c, domain-internals.h: New function for setting the
264         domain and migrate the thread abort exception or not.
265
266 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
267
268         * metadata-verify.c: Add initial verification of the
269         field table.
270
271 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
272
273         * metadata-verify.c: Add a macro to conditionally enable
274         dumping of verification information. Add  make_coded_token
275         and search_sorted_table to enable search sorted tables
276         by a given coded token.
277
278 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
279
280         * metadata-verify.c: Add array mapping from table index
281         to description offset. Add get_col_offset and get_col_size
282         functions.
283
284 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
285
286         * metadata-verify.c: Add remaining table descriptions offsets.
287         Add remaining coded index descriptions.
288
289 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
290
291         * metadata-verify.c: Fixed constant table description.
292         Fixed calculation of HasCustomAttribute coded index size.
293         Fixed calculation of size for many table indexes. 
294
295 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
296
297         * pedump.c (dump_metadata): Dump table offset instead
298         of useless pointer in memory.
299
300 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
301
302         * metadata-verify.c (verify_typedef_table): Add tests for MethodList.
303
304 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
305
306         * metadata-verify.c (verify_typedef_table): Add tests for FieldList and
307         a missing of for interface types.
308
309 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
310
311         * metadata-verify.c (verify_pe_optional_header): Add comment of why
312         the code is commented.
313
314         * metadata-verify.c (verify_resources_table): Remove spurious printf
315         and don't fail if there are unmanaged resources. Gmcs generates a useless
316         one     for all assemblies - I bet it's some MS compatibility junk.
317
318 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
319
320         * metadata-verify.c (verify_typedef_table): Verify the extends field.
321
322         * metadata-verify.c (mono_image_verify): Add a is_corlib.
323
324         * verify-internals.h: Same.
325
326         * pedump.c: Fix for mono_image_verify new signature.
327
328 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
329
330         * metadata-verify.c (verify_typedef_table): Verify for some invalid
331         flags combinations.
332
333 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
334
335         * metadata-verify.c (verify_module_table): Ignore the generation field.
336
337 2009-04-15  Martin Baulig  <martin@ximian.com>
338
339         * debug-mono-symfile.c
340         (mono_debug_symfile_lookup_location): Don't print a warning for
341         unknown extended opcodes if they're within 0x40 and 0x7f.
342
343 2009-04-15  Zoltan Varga  <vargaz@gmail.com>
344
345         * marshal.c (mono_marshal_get_runtime_invoke_sig): Don't share runtime
346         invoke signatures returning an enum. Fixes #494847.
347
348 2009-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
349
350         * metadata-verify.c: Initial code to verify the typedef table.
351
352 2009-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
353
354         * verify.c (mono_method_verify): Don't fail if an unconditional branch
355         with non empty stack happens before the beginning of a try block.
356
357         Fixes #494812.
358
359 2009-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
360
361         * metadata-verify.c: Verify typename and typenamespace fields of
362         the typeref table.
363
364 2009-04-13 Rodrigo Kumpera  <rkumpera@novell.com>
365
366         * metadata-verify.c: Initial code to verify the typeref table.
367
368 2009-04-13 Rodrigo Kumpera  <rkumpera@novell.com>
369
370         * verify.c (verify_delegate_compatibility): Fix error message.
371
372 2009-04-14  Sebastien Pouliot  <sebastien@ximian.com>
373
374         * security-core-clr.c: Fix typo
375
376 2009-04-14  Zoltan Varga  <vargaz@gmail.com>
377
378         * marshal.c (delegate_hash_table_add): Make delegate_target_locations 
379         a MonoGHashTable to keep its values alive.
380         (emit_marshal_boolean): Fix a warning.
381
382 2009-04-13 Gonzalo Paniagua Javier <gonzalo@novell.com>
383
384         * socket-io.c: don't return IPv4/IPv6 addresses if the machine does
385         not have any interface configured for IPv4/IPv6.
386
387 2009-04-13 Gonzalo Paniagua Javier <gonzalo@novell.com>
388
389         * assembly.c: fix typo in error message.
390
391 2009-04-14  Zoltan Varga  <vargaz@gmail.com>
392
393         * marshal.c (mono_delegate_to_ftnptr): Use mono_gc_alloc_fixed () for
394         allocating the location holding the this argument to prevent
395         'too many root sets' errors.
396
397         * object.c (mono_class_create_runtime_vtable): Set field->offset to -1
398         to mark fields as special static.
399         (mono_field_static_get_value): Handle special static fields.
400         (mono_field_static_set_value): Ditto.
401
402         * class-internals.h (struct _MonoClassField): Document this.
403
404 2009-04-13  Bill Holmes  <billholmes54@gmail.com>
405
406         * cominterop.c (mono_cominterop_emit_marshal_com_interface): Assigning
407           the argument a value of null for the MARSHAL_ACTION_MANAGED_CONV_OUT
408           case.  This will handle when managed code returns null to native code.
409
410         Code is contributed under MIT/X11 license.
411
412 2009-04-13  Bill Holmes  <billholmes54@gmail.com>
413
414         * object.c (build_imt_slots): Changing a free to a g_free to match
415           the g_malloc0 in add_imt_builder_entry that allocated this memory.
416
417         Code is contributed under MIT/X11 license.
418
419 2009-04-13  Bill Holmes  <billholmes54@gmail.com>
420
421         * marshal.c (emit_marshal_boolean): Adding code to ensure that
422           the correct TRUE value is passed through the marshaling layer.
423
424         Code is contributed under MIT/X11 license.
425
426 2009-04-13  Zoltan Varga  <vargaz@gmail.com>
427
428         * marshal.c (mono_marshal_emit_managed_wrapper): Handle closed delegates
429         correctly. Fixes #492330.
430         
431         * marshal.c: Fix the embedding of object pointers into JITted code in
432         the native-to-managed wrappers by allocating some GC tracked memory, and
433         embedding the address of that.
434
435 2009-04-11  Zoltan Varga  <vargaz@gmail.com>
436
437         * object.c (mono_class_create_runtime_vtable): Avoid putting MonoMethod
438         pointers into the vtable.
439
440 2009-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
441
442         * verify.c (mono_delegate_type_equal): Proper check MONO_TYPE_CLASS.
443
444         * verify.c (verify_ldftn_delegate): Improve error message.
445
446 2009-04-09  Raja R Harinath  <harinath@hurrynot.org>
447
448         * reflection.c (my_mono_class_from_mono_type): Remove.
449
450 2009-04-09  Raja R Harinath  <harinath@hurrynot.org>
451
452         Prepare to reduce memory usage of owner-less generic parameters (1/n)
453         * class-internals.h (MonoGenericParam): Carve out pklass, name, flags
454         and constraints fields into ...
455         (MonoGenericParamInfo): ... this.
456         (mono_generic_param_info, mono_generic_container_get_param_info):
457         New accessors.
458         * class.c, debug-helpers.c, icall.c: Update to changes.
459         * metadata.c, reflection.c, verify.c: Likewise.
460
461 2009-04-09  Zoltan Varga  <vargaz@gmail.com>
462
463         * debug-helpers.c (dis_one): Fix decoding of strings in dynamic images.
464
465         * marshal.c (get_runtime_invoke_type): Share enums with their base types.
466         
467         * marshal.c (get_runtime_invoke_type): Share pointers with ints and
468         booleans with sbytes.
469
470 2009-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
471
472         * class.c (can_access_instantiation): Verify accesibility of element types
473         for arrays and pointers.
474
475         * class.c (can_access_type): Return true if the target class is VAR or MVAR.
476
477         * class.c (mono_method_can_access_method_full): Fix typos in the documentation.
478
479         Fixes #493068.
480
481 2009-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
482
483         * verify.c (do_invoke_method): Improve error messages.
484
485 2009-04-08  Bill Holmes  <billholmes54@gmail.com>
486
487         * verify.c:  Fixing the MSVC build.
488
489         Code is contributed under MIT/X11 license.
490
491 2009-04-08  Sebastien Pouliot  <sebastien@ximian.com>
492
493         * security-core-clr.c: Simplify get_reflection_caller not to call
494         mono_method_get_last_managed (another stack walk) and adjust the
495         callers to handle a (should not happen) NULL return value.
496
497 2009-04-08  Raja R Harinath  <harinath@hurrynot.org>
498
499         Add accessors to some MonoGenericParam fields
500         * class-internals.h (mono_generic_param_owner): New accessor.
501         (mono_generic_param_num): Likewise.
502         (mono_type_get_generic_param_owner): New helper.
503         (mono_type_get_generic_param_num): New helper.
504         * class.c, icall.c, metadata.c, reflection.c, verify.c: Use them.
505
506 2009-04-08  Raja R Harinath  <harinath@hurrynot.org>
507
508         * class-internals.h (mono_generic_container_get_param): New wrapper.
509         * class.c, icall.c, metadata.c, verify.c: Use it.
510
511 2009-04-08  Raja R Harinath  <harinath@hurrynot.org>
512
513         Fix gtest-252.cs
514         * verify.c (mono_type_is_valid_type_in_context): Rewrite to use
515         the standard case/loop.  In particular, don't complain about
516         references to generic type definitions.
517
518 2009-04-07  Zoltan Varga  <vargaz@gmail.com>
519
520         * debug-helpers.c (dis_one): Decode string arguments.
521
522 2009-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
523
524         * pedump.c (dump_verify_info): Dump type name correctly.
525
526 2009-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
527
528         * verify.c (mono_method_verify): Don't init code slots for exception boundaries if they
529         are larger than code size.
530
531         This can happen in valid code if the try/catch block is not followed by any instruction
532         and do a backward branch on the leave instruction.
533
534         Fixes #492494.
535
536 2009-04-06  Sebastien Pouliot  <sebastien@ximian.com>
537
538         * security-core-clr.c: Fix typo while comparing second method names
539         in can_avoid_corlib_reflection_delegate_optimization
540
541 2009-04-06 Rodrigo Kumpera  <rkumpera@novell.com>
542
543         * verify.c (do_throw): Don't allow an unboxed generic param ar argument.
544
545         Fixes #487738.
546
547 2009-04-06 Rodrigo Kumpera  <rkumpera@novell.com>
548
549         * metadata.c (do_mono_metadata_parse_type): Fail if we are decoding
550         a MVAR using a class context.
551
552         Fixes #490335.
553
554 2009-04-06  Zoltan Varga  <vargaz@gmail.com>
555
556         * object.c (mono_class_compute_gc_descriptor): Make this non-static.
557
558         * domain-internals.h (struct _MonoJitInfo): Add a 'gc_info' field.
559
560         * gc-internal.h (MonoGCCallbacks): New stucture containing the callback
561         functions supplied by the JIT for the SGEN GC.
562
563         * sgen-gc.c: Call the callbacks supplied by the JIT to do stack marking.
564         
565 2009-04-06  Massimiliano Mantione  <massi@ximian.com>
566
567         monitor.c (mono_monitor_try_enter_internal):
568         Added calls to profile monitor contentions.
569         Also duplicated a small piece of code (the "get the monitor" logic)
570         from the fast path to the slow path, and changed the relevant goto
571         statements, so that monitor acquisition events can be emitted from the
572         slow path (this is by Paolo Molaro).
573
574 2009-04-06  Massimiliano Mantione  <massi@ximian.com>
575
576         * profiler.c, profiler.h, profiler-private.h:
577         Added support for profiling monitor contentions.
578
579 2009-04-03 Rodrigo Kumpera  <rkumpera@novell.com>
580
581         * metadata-verify.c: Verify the modules table.
582
583 2009-04-02 Rodrigo Kumpera  <rkumpera@novell.com>
584
585         * verify.c (mono_generic_param_is_constraint_compatible): Inflate the candidate
586         using the context of the method been verifier and not of the method been called.
587
588         * verify.c: Add verifier_inflate_type and mono_type_is_valid_type_in_context to
589         safely inflate generic types. 
590
591 2009-04-02  Sebastien Pouliot  <sebastien@ximian.com>
592
593         * security-core-clr.c: Change the strategy for checking the 
594         "reflection using delegates optimization" to avoid unneeded 
595         attributes in multiple class libraries.
596
597 2009-04-02  Mark Probst  <mark.probst@gmail.com>
598
599         * sgen-gc.c: Remove object element in the disappearing link struct
600         by storing the object pointer in the link.
601
602 2009-03-31 Rodrigo Kumpera  <rkumpera@novell.com>
603
604         * pedump.c (dump_verify_info): Don't crash if signature decoding fails.
605
606 2009-03-31 Rodrigo Kumpera  <rkumpera@novell.com>
607
608         * verify.c (verifier_load_field): Fail if the field parent could not be loaded.
609
610         * verify.c (mono_method_verify): Do proper bounds checking of exception
611         clause ranges.
612
613 2009-03-31 Rodrigo Kumpera  <rkumpera@novell.com>
614
615         * loader.c (mono_field_from_token): Don't crash if the field parent could
616         not be decoded.
617
618 2009-03-31  Mark Probst  <mark.probst@gmail.com>
619
620         * sgen-gc.c: Execute critical finalizers after ordinary
621         finalizers.
622
623         * class-internals.h, domain.c: Add CriticalFinalizerObject to
624         mono_defaults.
625
626 2009-03-31 Jb Evain <jbevain@novell.com>
627
628         * verify.c (do_ldstr): don't check if a string is in the user strings
629         heap if the current image is dynamic.
630
631 2009-03-31  Mark Probst  <mark.probst@gmail.com>
632
633         * sgen-gc.c: Wait until the last finalizer has executed when
634         returning from WaitForPendingFinalizers.
635
636 2009-03-31  Martin Baulig  <martin@ximian.com>
637
638         * mono-debug.h (MONO_DEBUGGER_MINOR_VERSION): Bump to 2.
639
640 2009-03-31  Martin Baulig  <martin@ximian.com>
641
642         * mono-debug-debugger.h (MonoDebuggerEvent): Add
643         `MONO_DEBUGGER_EVENT_CREATE_APPDOMAIN' and
644         `MONO_DEBUGGER_EVENT_UNLOAD_APPDOMAIN'.
645         (mono_debugger_event_create_appdomain): New function.
646         (mono_debugger_event_unload_appdomain): New function.
647
648         * appdomain.c (mono_domain_create_appdomain_internal): Call
649         mono_debugger_event_create_appdomain().
650
651 2009-03-31  Martin Baulig  <martin@ximian.com>
652
653         * mono-debug-debugger.c
654         (mono_debugger_register_class_init_callback): Also register the
655         class init callback if the class is already initialized to make
656         things work with shadow copied assemblies.
657
658 2009-03-31  Sebastien Pouliot  <sebastien@ximian.com>
659
660         * security-core-clr.c
661         (mono_security_core_clr_ensure_reflection_access_field): Let 
662         critical code access the field (just like we do for methods). Use
663         check_field_access helper.
664         (mono_security_core_clr_ensure_reflection_access_method): Use 
665         check_field_access helper.
666
667 2009-03-31  Mark Probst  <mark.probst@gmail.com>
668
669         * sgen-gc.c: Remove data (callback) element from FinalizeEntry and
670         call the run-finalize function directly.
671
672         * gc.c, gc-internal.h: Make run_finalize() non-static.
673
674 2009-03-31  Mark Probst  <mark.probst@gmail.com>
675
676         * sgen-gc.c: Use a separate struct for disappearing links.
677
678 2009-03-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
679
680         * socket-io.c: don't fail if the SocketOptionsFlag has Partial or
681         * MaxIOVectorLength enabled, just ignore them.
682         Fixes bug #349688.
683
684 2009-03-30 Rodrigo Kumpera  <rkumpera@novell.com>
685
686         * metadata-verify.c: Fix eglib build.
687
688 2009-03-30  Zoltan Varga  <vargaz@gmail.com>
689
690         * threads-types.h: Fix the win32 build.
691
692 2009-03-28  Sebastien Pouliot  <sebastien@ximian.com>
693
694         * class.c: move coreclr inheritance/override checks to 
695         security-core.clr.c
696         * security-core.clr.c|h: add code from class.c with additional
697         documentation. Fix override check when the method is not critical.
698
699 2009-03-28  Zoltan Varga  <vargaz@gmail.com>
700
701         * debug-helpers.c (mono_method_desc_match): Make '*' match anything.
702         (match_class): Ditto.
703
704 2009-03-27 Rodrigo Kumpera  <rkumpera@novell.com>
705
706         * metadata-verify.c: Rename bounds_check_offset to bounds_check_datadir.
707
708         * metadata-verify.c: Implement table layout row size calculation. Verify
709         the total size of the tables.
710
711 2009-03-27 Rodrigo Kumpera  <rkumpera@novell.com>
712
713         * metadata-verify.c: Verify heap sizes and size to decode row counts. 
714
715 2009-03-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
716
717         * appdomain.c:
718         * console-io.[ch]: added new mono_console_init() to make sure that
719         file descriptors 0, 1 and 2 are opened.
720         Bug #489019 fixed.
721
722 2009-03-27  Sebastien Pouliot  <sebastien@ximian.com> 
723
724         * appdomain.h: Export a new callback type and a new function to
725         set this callback. This allow a mono host to provide it's own
726         definition for "platform code".
727         * metadata-internals.h: Add a core_clr_platform_code flag on 
728         _MonoImage to (cache and) know if it is representing platform 
729         code.
730         * image.c (do_mono_image_open): Set core_clr_platform_code flag 
731         on platform code images.
732         * security-core-clr.c|h 
733         (mono_security_set_core_clr_platform_callback): Allow the host
734         to provide it's own platform check definition.
735         (mono_security_core_clr_determine_platform_image): Detect if an 
736         image is platform code (using the specified callback).
737         (mono_security_core_clr_is_platform_image): Return cached value 
738         for platform code.
739
740 2009-03-27  Zoltan Varga  <vargaz@gmail.com>
741
742         * threads.c (mono_create_thread): New helper function to wrap CreateThread
743         which has different parameter types for the 'tid' argument in windows and
744         the io-layer.
745
746         * appdomain.c attach.c threads.c: Use the new helper.
747
748 2009-03-26 Rodrigo Kumpera  <rkumpera@novell.com>
749
750         * metadata-verify.c: Verify valid table bits.
751
752 2009-03-26 Rodrigo Kumpera  <rkumpera@novell.com>
753
754         * metadata-verify.c (verify_metadata_header): Store size in the size field.
755
756         * metadata-verify.c: Add initial table schema verification.
757
758 2009-03-26  Zoltan Varga  <vargaz@gmail.com>
759
760         * icall.c (ves_icall_get_parameter_info): Add a 'member' argument, used to
761         obtain the refclass argument needed by mono_param_get_objects (). Fixes
762         #488383.
763
764         * reflection.c (mono_param_get_objects_internal): Add a 'refclass' argument.
765
766         * appdomain.c (MONO_CORLIB_VERSION): Bump this.
767
768 2009-03-26  Sebastien Pouliot  <sebastien@ximian.com>
769
770         * security-core-clr.c: Add/update documentation
771
772 2009-03-26  Zoltan Varga  <vargaz@gmail.com>
773
774         * marshal.c (emit_marshal_object): Generate code to throw an exception
775         instead of throwing it. Fixes #488670.
776
777 2009-03-25  Sebastien Pouliot  <sebastien@ximian.com>
778
779         * appdomain.c: Bump MONO_CORLIB_VERSION to 73.
780         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Add
781         an extra 'throwOnBindFailure' parameter to the icall. Remove FIXME
782         and add a call to mono_security_core_clr_ensure_delegate_creation
783         to do the extra checks required by CoreCLR.
784         * security-core-clr.c|h: Add function to check delegate creation,
785         both in the binding and accessibility, under CoreCLR.
786
787 2009-03-25  Sebastien Pouliot  <sebastien@ximian.com> 
788
789         * reflection.c (mono_reflection_create_dynamic_method): when 
790         coreclr is enabled make sure that every resolved object are
791         checked (e.g. field and method access).
792         * security-core-clr.c|h: Add function to check objects resolved
793         when a dynamic method is created.
794
795 2009-03-24 Rodrigo Kumpera  <rkumpera@novell.com>
796
797         * metadata-verify.c: Cache directory rva translations.
798
799         * metadata-verify.c: Add cli-header and streams verification.
800
801 2009-03-24 Rodrigo Kumpera  <rkumpera@novell.com>
802
803         * image.c (load_metadata_ptrs): We decode MonoImage::md_version_minor at
804         the wrong offset (8 instead of 6).
805
806 2009-03-23  Zoltan Varga  <vargaz@gmail.com>
807
808         * marshal.c (mono_delegate_to_ftnptr): For delegates wrapping pinvoke
809         methods, return the native function address itself. Fixes
810         #487758.
811
812 2009-03-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
813
814         * console-io.c: some of the values for control characters might not be
815         present.
816
817 2009-03-21  Sebastien Pouliot  <sebastien@ximian.com>
818
819         * exception.c|h: Add helpers to create [Field|Method]AccessException
820         * icall.c: Add required coreclr check calls for field reflection.
821         Move the existing (method) check logic into security-core-clr.c
822         * security-core-clr.c: Add functions to check if the access of a
823         field or method is allowed when reflecting under coreclr. This is
824         mostly done using a stack walk to find the "real" caller: i.e. the
825         code that is calling the reflection
826
827 2009-03-20  Zoltan Varga  <vargaz@gmail.com>
828
829         * gc-internal.h: Change location of gc_wrapper.h
830
831 2009-03-20  Sebastien Pouliot  <sebastien@ximian.com> 
832
833         * class.c: Simplification to coreclr checks for overrides that
834         makes it easier to set breakpoints.
835
836 2009-03-20  Sebastien Pouliot  <sebastien@ximian.com>
837
838         * security-core-clr.c|h: (mono_security_core_clr_class_level, 
839         mono_security_core_clr_method_level): Avoid potential 
840         MonoCustomAttrInfo allocation for transparent assemblies (e.g. 
841         user/application code) and make it easier to set breakpoints
842
843 2009-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
844
845         * metadata-verify.c: Reject cli header tables that mono don't handle.
846
847 2009-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
848
849         * pedump.c: Fix CLI header dumping.
850
851 2009-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
852
853         * metadata-verify.c: More CLI header verification.
854
855 2009-03-19  Zoltan Varga  <vargaz@gmail.com>
856
857         * locales.c (get_current_locale_name): Use g_malloc instead of malloc.
858
859 2009-03-18 Rodrigo Kumpera  <rkumpera@novell.com>
860
861         * metadata-verify.c: Initial verification of the CLI header.
862
863 2009-03-18 Rodrigo Kumpera  <rkumpera@novell.com>
864
865         * metadata-verify.c (verify_resources_table): Fix verification of zero
866         sized resource section and id entries count.
867
868 2009-03-18  Zoltan Varga  <vargaz@gmail.com>
869
870         * icall.c: Handle user types in many Type icalls. Fixes #486303.
871
872 2009-03-17  Jb Evain  <jbevain@novell.com>
873
874         * profiler.c: call mono_gc_base_init from mono_profiler_load.
875
876 2009-03-17  Zoltan Varga  <vargaz@gmail.com>
877
878         * sgen-gc.c (mono_gc_make_descr_for_object): Fix 64 bit support.
879         (mono_gc_make_descr_for_array): Ditto.
880
881 2009-03-17  Sebastien Pouliot  <sebastien@ximian.com>
882
883         * verify.c (mono_verifier_is_class_full_trust): Add support for
884         CoreCLR security mode where trusted assemblies are defined as
885         "platform code".
886
887 2009-03-16 Rodrigo Kumpera  <rkumpera@novell.com>
888
889         * metadata-verify.c: Add minimal PECOFF resource verification.
890
891 2009-03-16 Rodrigo Kumpera  <rkumpera@novell.com>
892
893         * metadata-verify.c: Be less restrictive with some coff fields.
894
895 2009-03-16 Rodrigo Kumpera  <rkumpera@novell.com>
896
897         * verify.c (init_stack_with_value_at_exception_boundary): Init generic
898         params as boxed values on stack. Fixes #485706.
899
900 2009-03-16 Gonzalo Paniagua Javier <gonzalo@novell.com>
901
902         * console-io.c: the termios values may vary in different flavors of unix.
903
904 2009-03-16 Gonzalo Paniagua Javier <gonzalo@novell.com>
905
906         * console-io.[ch]: return the entire set of control characters when
907         initializing the terminal.
908         * appdomain.c: bump corlib version.
909
910 Mon Mar 16 11:11:26 CET 2009 Paolo Molaro <lupus@ximian.com>
911
912         * mono-perfcounters.c: added support for in-process custom
913         performance counters.
914
915 2009-03-13 Rodrigo Kumpera  <rkumpera@novell.com>
916
917         * metadata-verify.c: Small cleanup and add comment for IAT directory entry. 
918
919 2009-03-13 Rodrigo Kumpera  <rkumpera@novell.com>
920
921         * metadata-verify.c: Verify the data pointed by the import table. 
922
923 2009-03-13 Rodrigo Kumpera  <rkumpera@novell.com>
924
925         * metadata-verify.c (load_data_directories): Store data
926         directory contents.
927
928         * metadata-verify.c: Verify the import table. 
929
930 2009-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
931
932         * metadata-verify.c: Verify data directories.
933
934 2009-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
935
936         * metadata-verify.c: Check section header flags.
937
938 2009-03-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
939
940         * appdomain.c: if the assembly name is a shadow-copied file, return
941         TRUE from mono_is_shadow_copy_enabled but don't actually do anything
942         in mono_make_shadow_copy.
943         * icall.c: if the assembly name is a shadow-copied file, replace it
944         with the original assembly path.
945
946         Bug #484244 fixed. NUnit tests for corlib can be run without
947         --noshadow now.
948
949 2009-03-12  Zoltan Varga  <vargaz@gmail.com>
950
951         * sgen-gc.c (add_to_global_remset): Fix the handling of root global remset
952         entries when the table is reallocated.
953
954         * icall.c: Allocate the memory used by the mono_ptr_array macros using
955         mono_gc_alloc_fixed () since it contains GC refs.
956
957 2009-03-10  Zoltan Varga  <vargaz@gmail.com>
958
959         * reflection.c (ensure_complete_type): New helper function to call
960         type resolve handlers for unfinished dynamic types.
961         (resolve_object): Call it for MonoClassFields. Fixes #483852.
962
963 2009-03-09  Zoltan Varga  <vargaz@gmail.com>
964
965         * reflection.c (mono_custom_attrs_has_attr): Handle interfaces. Fixes
966         #483247.
967
968 2009-03-08 Rodrigo Kumpera  <rkumpera@novell.com>
969
970         * appdomain.c (get_shadow_assembly_location): Fix memleak.
971
972 2009-03-08  Zoltan Varga  <vargaz@gmail.com>
973
974         * domain-internals.h (struct _MonoDomain): Add new hash tables mapping
975         between GCHandles of type WeakTrackResurrection and the objects they
976         point to.
977
978         * gc.c: Partly implement the sematics of GCHandles of type 
979         WeakTrackResurrection: these handles should only be cleared after the
980         finalizer of the object they are pointing to has ran.
981
982 2009-03-06  Mark Probst  <mark.probst@gmail.com>
983
984         * icall.c: Partially revert r126631 because using the jump
985         trampolines for generic shared methods makes it superfluous.
986
987 2009-03-06  Zoltan Varga  <vargaz@gmail.com>
988
989         * threads.c (handle_store): Create the 'threads' hash table with the proper
990         MONO_HASH_VALUE_GC type.
991
992 2009-03-05  Zoltan Varga  <vargaz@gmail.com>
993
994         * domain-internals.h (struct _MonoDomain): Move 'typeof_void' before
995         FIRST_GC_TRACKED.
996
997         * domain.c (mono_domain_create): Register the fields between FIRST_GC_TRACKED
998         and LAST_GC_TRACKED as a GC root.
999
1000         * gc-internal.h: Fix the comment of mono_gc_alloc_fixed.
1001
1002         * object.c (mono_class_create_runtime_vtable): Create a GC descriptor for
1003         the static data even if it consists of 1 reference.
1004
1005         * boehm-gc.c (mono_gc_alloc_fixed): Allocate using GC_MALLOC_EXPLICITLY_TYPED
1006         if there is a GC descriptor.
1007
1008         * reflection.c (ALLOC_REFENTRY): Allocate ReflectedEntry-es using malloc
1009         instead of through the GC since they contain no object references.
1010
1011 2009-03-05  Mark Probst  <mark.probst@gmail.com>
1012
1013         * generic-sharing.c (instantiate_other_info): Always return a jump
1014         trampoline for method code.
1015
1016 2009-03-05  Marek Habersack  <mhabersack@novell.com>
1017
1018         * culture-info-tables.h: generated to include the en-tt culture.
1019
1020 2009-03-04 Rodrigo Kumpera  <rkumpera@novell.com>
1021
1022         * domain-internals.h (MonoDomain): Add two fields to cache invoke wrappers to
1023         capture the thread context.
1024
1025         * object.c (mono_async_result_new): Cache the invoke wrappers to
1026         ExecutionContext::Capture.
1027
1028 2009-03-04 Rodrigo Kumpera  <rkumpera@novell.com>
1029
1030         * marshal.h: Add a prototype for what mono_compile_method returns
1031         for invoke wrappers.
1032
1033         * gc.c: Use the new prototype declaration.
1034
1035 2009-03-04  Geoff Norton  <gnorton@novell.com>
1036
1037         * boehm-gc.c: Add some MONO_LOG tracing for the GC
1038         * gc-internal.h:
1039         * mono-gc.h: Expose mono_gc_invoke_finalizers in the embedding api.
1040
1041 2009-03-04  Martin Baulig  <martin@ximian.com>
1042
1043         * mono-debug.h
1044         (mono_debugger_runtime_invoke): Removed.
1045
1046         * mono-debug-debugger.c
1047         (mono_runtime_invoke): Moved into ../mini/debug-mini.c.
1048
1049 2009-03-02  Martin Baulig  <martin@ximian.com>
1050
1051         * mono-debug.h
1052         (mono_debugger_unhandled_exception): Removed.
1053         (mono_debugger_handle_exception): Removed.
1054         (mono_debugger_throw_exception): Removed.
1055
1056         * mono-debug.c
1057         (mono_debug_debugger_version): Bump to 5.
1058
1059         * mono-debug-debugger.c: Moved the exception handling code to
1060         ../mini/debug-mini.c
1061
1062 2009-03-03  Zoltan Varga  <vargaz@gmail.com>
1063
1064         * domain-internals.h (struct _MonoDomain): Add a separate lock for the
1065         finalize_objects_hash.
1066
1067         * gc.c: Use the separate lock to access the finalize_objects_hash field.
1068         
1069         * domain-internals.h (struct _MonoDomain): Add finalize_runtime_invoke
1070         field.
1071
1072         * metadata-internals.h (struct _MonoImage): Add runtime_invoke_vcall_cache
1073         cache.
1074
1075         * image.c (mono_image_close): Free it.
1076         
1077         * marshal.c (mono_marshal_get_runtime_invoke): Add a 'virtual' argument
1078         allowing a creation of a wrapper which invokes its method using a CALLVIRT
1079         on the this argument.
1080
1081         * gc.c (run_finalize): Optimize the calling of the finalizers.
1082
1083 2009-03-03  Martin Baulig  <martin@ximian.com>
1084
1085         * mono-debug.h (MONO_DEBUGGER_MAJOR_VERSION): Bump to 81 because
1086         of the `MonoGenericInst' changes.
1087
1088 2009-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
1089
1090         * icall.c (ves_icall_MonoType_GetGenericArguments): Use
1091         mono_array_class_get_cached to reduce locking contention. Extract
1092         a domain var.
1093
1094         * icall.c (ves_icall_Type_GetFields_internal): Avoid allocating
1095         intermediary managed arrays. Use caching version of mono_array_new
1096         to allocate the result array.
1097
1098         * icall.c (ves_icall_Type_GetEvents_internal): Same.    
1099
1100         * icall.c (ves_icall_Type_GetNestedTypes): Same.        
1101
1102         * locales.c (create_names_array_idx):  Use mono_array_new_cached
1103         to reduce locking contention.
1104
1105 2009-03-03  Zoltan Varga  <vargaz@gmail.com>
1106                 
1107         * object.c (mono_method_add_generic_virtual_invocation): Put back the
1108         thunk builder code for the non-interface case.
1109
1110 2009-03-02  Zoltan Varga  <vargaz@gmail.com>
1111
1112         * object.c (get_generic_virtual_entries): New helper function to collect
1113         the virtual generic method instances which need to be added to an IMT
1114         thunk.
1115         (mono_method_add_generic_virtual_invocation): Add a 'vtable' argument.
1116         Instead of creating a new IMT thunk, reset the vtable slot to the
1117         trampoline, the thunk will be created the next time the trampoline is called.
1118         (build_imt_slots): Add support for virtual generic methods in interfaces by
1119         adding to the IMT thunk all the methods registered using 
1120         mono_method_add_generic_virtual_invocation ().
1121
1122         * object-internals.h (_MonoImtBuilderEntry): Add a 'has_target_code' field.
1123         (struct _MonoIMTCheckItem): Ditto.
1124
1125         * object.c (mono_method_add_generic_virtual_invocation): Take a
1126         MonoMethod argument instead of a MonoGenericInst. Fix the construction of
1127         the IMT thunk to include all items.
1128         
1129         * object.c (mono_class_create_runtime_vtable): Add a missing
1130         mono_loader_unlock ().
1131
1132 2009-03-02 Rodrigo Kumpera  <rkumpera@novell.com>
1133
1134         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
1135
1136         * object-internals.h (MonoReflectionEvent): Add cached_add_event.
1137
1138 2009-03-02 Rodrigo Kumpera  <rkumpera@novell.com>
1139
1140         * object-internals.h: Rename _MonoReflectionEvent to
1141         MonoReflectionMonoEvent so it reflects the right managed type.
1142         Add a MonoReflectionEvent that correctly represents System.EventInfo.
1143
1144         * icall.c:
1145         * reflection.c: Adjust code to use the new MonoReflectionMonoEvent
1146         type.
1147
1148 2009-03-02 Rodrigo Kumpera  <rkumpera@novell.com>
1149
1150         * icall.c (ves_icall_Type_GetMethodsByName): Avoid allocating
1151         intermediary managed arrays. Use caching version of mono_array_new
1152         to allocate the result array.
1153
1154 2009-03-01 Rodrigo Kumpera  <rkumpera@novell.com>
1155
1156         * reflection.c: Use cached version of mono_array_new alongside
1157         the mono_reflection_get_custom_attrs_by_type call path.
1158
1159 2009-03-01 Rodrigo Kumpera  <rkumpera@novell.com>
1160
1161         * icall.c (ves_icall_Type_GetInterfaces): Avoid allocating
1162         intermediary managed arrays. Use caching version of mono_array_new
1163         to allocate the result array.
1164
1165         * icall.c (ves_icall_Type_GetConstructors_internal): Same.
1166
1167 2009-03-01 Rodrigo Kumpera  <rkumpera@novell.com>
1168
1169         * icall.c: Add small implementation of a growable stack bound array.
1170
1171         * icall.c (ves_icall_System_Enum_get_hashcode): Fix warning.
1172
1173         * icall.c (ves_icall_Type_GetPropertiesByName): Avoid allocating
1174         intermediary managed arrays. Use caching version of mono_array_new
1175         to allocate the result array.
1176
1177 2009-02-27 Rodrigo Kumpera  <rkumpera@novell.com>
1178
1179         * icall.c: New icall ves_icall_System_Enum_compare_value_to that
1180         helps Enum::CompareTo to be implemented without reboxing all enums
1181         to their underlying type.
1182 2009-02-27  Zoltan Varga  <vargaz@gmail.com>
1183
1184         * domain.c (SET_APPDOMAIN): Avoid calling TlsSetValue () on some platforms,
1185         since it acquires a global lock leading to scalability problems.
1186
1187         * profiler.c: Make the stat profiler work with multiple appdomains, this
1188         currently only works when no appdomains are unloaded.
1189
1190 2009-02-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
1191
1192         * appdomain.c: make the check to avoid copying when the assembly is
1193         already shadow copied actually work.
1194
1195 2009-02-26  Zoltan Varga  <vargaz@gmail.com>
1196
1197         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
1198
1199         * object-internals.h (struct _MonoReflectionGenericClass): Sync with
1200         changes to the managed side.
1201
1202 2009-02-25  Zoltan Varga  <vargaz@gmail.com>
1203
1204         * metadata-internals.h (struct _MonoImage): Add a new cache for szarray
1205         classes + a separate lock for it, as it is used frequently at runtime, not
1206         just during metadata loading/JIT compilation.
1207
1208         * class.c (mono_bounded_array_class_get): Use the separate cache + lock
1209         for szarrays.
1210         
1211         * object-internals.h (mono_class_from_name_cached): New macro to cache
1212         the results of the lookup locally without having to declare a static
1213         variable to hold it.
1214         (mono_class_get_field_from_name_cached): Ditto.
1215         (mono_array_class_get_cached): Ditto.
1216
1217         * threadpool.c threads.c locales.c icall.c reflection.c socket-io.c: Use
1218         the new macros.
1219         
1220         * object.c (mono_get_delegate_invoke): Call setup_methods () to avoid the
1221         slower search in metadata.
1222
1223         * pedump.c: Fix a warning.
1224
1225 2009-02-23  Zoltan Varga  <vargaz@gmail.com>
1226
1227         * reflection.c (encode_locals): Add checks for user types.
1228         (method_encode_clauses): Ditto.
1229         (method_encode_code): Ditto.
1230         (mono_image_create_token): Ditto.
1231
1232         * object-internals.h: Change the type of more fields from MonoReflectionType*
1233         to MonoObject*.
1234
1235 2009-02-22  Zoltan Varga  <vargaz@gmail.com>
1236
1237         * threads.c (mono_thread_suspend_all_other_threads): Handle the case when
1238         the a thread does not suspend within 100ms.
1239
1240         * monitor.c (mono_monitor_try_enter_internal): Handle SuspendRequested
1241         in addition to StopRequested as well.
1242
1243         * mono-debug.c: Call _mono_debug_get_image () while holding the debug lock.
1244
1245         * debug-mono-symfile.c (mono_debug_symfile_lookup_method): Actually
1246         search the method_hash before inserting a new entry, to avoid crashes when
1247         the same method is inserted multiple times, causing the old 
1248         MonoDebugMethodInfo structure to be freed by the value dtor function.
1249
1250 2009-02-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
1251
1252         * socket-io.c: support SO_MAXCONN, SO_USELOOPBACK and
1253         SO_EXLUSIVEADDRUSE where available.
1254
1255 2009-02-21  Zoltan Varga  <vargaz@gmail.com>
1256
1257         * marshal.c (mono_marshal_get_runtime_invoke): Fix _another_ bug sharing
1258         runtime invoke wrappers, this time it is string ctor wrappers, which
1259         pass a dummy string as 'this' instead of their obj argument. Fixes
1260         #478473.
1261
1262 2009-02-21  Jb Evain  <jbevain@novell.com>
1263
1264         * icall.c (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
1265         only get create_culture once.
1266
1267 2009-02-20  Zoltan Varga  <vargaz@gmail.com>
1268
1269         * reflection.c (mono_reflection_setup_internal_class): Move the user type
1270         check before the locking.
1271         
1272         * reflection.c (mono_reflection_setup_internal_class): Check for user types.
1273         (mono_reflection_create_runtime_class): Ditto.
1274         (mono_reflection_sighelper_get_signature_local): Ditto.
1275         (mono_reflection_sighelper_get_signature_field): Ditto.
1276
1277         * object-internals.h (CHECK_MONOTYPE): New macro to check that a Type object
1278         is a System.MonoType object or similar.
1279         (monotype_cast): New helper function to cast a MonoObject to a 
1280         MonoReflectionType object.
1281
1282         * object-internals.h: Change MonoReflectionType* members in structures to
1283         MonoObject* members to force the usage of the monotype_cast () function.
1284
1285         * reflection.c icall.c: Use monotype_cast () for accessing Type members of
1286         structures/arrays. This causes us to assert instead of crashing when 
1287         instances of user defined subclasses of System.Type are encountered.
1288
1289 2009-02-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
1290
1291         * cil-coff.h:
1292         * icall-def.h:
1293         * icall.c: add new GetUnmanagedResourcePtr that returns a pointer to a
1294         win32 resource loaded from a PE file.
1295
1296         * image.c: fix mono_image_lookup_resource.
1297
1298 2009-02-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
1299
1300         * icall-def.h:
1301         * threads-types.h:
1302         * threads.c: added internal call for WaitHandle.SignalAndWait.
1303
1304 2009-02-19  Bill Holmes  <billholmes54@gmail.com>
1305
1306         * cominterop.c : Adding cominterop_type_from_handle and 
1307           registering it as an icall.  Replacing all references
1308           to type_from_handle.
1309
1310         Code is contributed under MIT/X11 license.
1311
1312 2009-02-19 Rodrigo Kumpera  <rkumpera@novell.com>
1313
1314         * Makefile.am: Add lock-tracer.h and lock-trace.c.
1315
1316         * appdomain.c: Call the tracer init function.
1317
1318         * domain-internals.h: Enable the tracer for the domain locks.
1319
1320         * image.c: Enable the tracer for image locks.
1321
1322         * loader.c: Enable the trace for the loader lock.
1323
1324         * lock-tracer.h:
1325         * lock-tracer.c: Initial implementation of the lock trace utility.
1326         The tracer requires a compile time define to be enabled and a env var
1327         to be enabled at runtime.
1328
1329 2009-02-19 Rodrigo Kumpera  <rkumpera@novell.com>
1330
1331         * domain.c (mono_domain_code_foreach): Improve documentation.
1332
1333 2009-02-19 Rodrigo Kumpera  <rkumpera@novell.com>
1334
1335         * appdomain.c:
1336         * generic-sharing.c:
1337         * object.c:
1338         * reflection.c:  Adjust locking order to the new semantics where the loader lock
1339         comes first.
1340
1341 2009-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
1342
1343         * domain.c: Add mono_domain_code_* functions that perform locking
1344         around the domain codeman.
1345
1346         * domain-internals.h: Export those functions.
1347
1348         * object.c: Use new functions instead of acquiring the domain lock.
1349
1350 2009-02-19  Zoltan Varga  <vargaz@gmail.com>
1351
1352         * marshal.c (mono_ftnptr_to_delegate): Convert a NULL ftnptr to a null
1353         delegate. Fixes #477396.
1354
1355 2009-02-18  Zoltan Varga  <vargaz@gmail.com>
1356
1357         * reflection.c (create_custom_attr): Get rid of alloca.
1358
1359 2009-02-18  Bill Holmes  <billholmes54@gmail.com>
1360
1361         * cominterop.c (cominterop_get_managed_wrapper_adjusted) :
1362           Adding exception handling for all CCW calls.
1363
1364         Code is contributed under MIT/X11 license.
1365
1366 2009-02-18  Zoltan Varga  <vargaz@gmail.com>
1367
1368         * reflection.c (mono_reflection_init): Remove the unused reflection mutex.
1369
1370         * marshal.c (emit_marshal_boolean): Add null checks to the new 
1371         native->managed marshalling code. Fixes #476247.
1372
1373 2009-02-17  Zoltan Varga  <vargaz@gmail.com>
1374
1375         * class.c (mono_class_get_vtable_entry): Move the addition of
1376         static rgctx invoke wrappers for vtable methods here, this simplifies
1377         a lot of code and causes fewer rgctx wrappers to be created.
1378
1379         * marshal.c (mono_marshal_get_static_rgctx_invoke): Change the
1380         name of the statistics to begin with an uppercase.
1381
1382 2009-02-17 Rodrigo Kumpera  <rkumpera@novell.com>
1383
1384         * reflection.c: Revert previous change as it breaks the build.
1385         
1386 2009-02-17 Rodrigo Kumpera  <rkumpera@novell.com>
1387
1388         * verify.c: Properly handle SZARRAY element type.
1389
1390         Fixes #474271.
1391
1392 2009-02-17 Rodrigo Kumpera  <rkumpera@novell.com>
1393
1394         * reflection.c (mono_image_create_method_token): Correctly encode
1395         MethodDef MemberRefParent token.
1396
1397         Fixes #472845.
1398
1399 2009-02-17  Zoltan Varga  <vargaz@gmail.com>
1400
1401         * image.c (mono_image_close): Delete the critical section before
1402         freeing the memory holding it.
1403
1404 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
1405
1406         * verify.c (mono_method_verify): rethrow opcode doesn not fall through.
1407         Fixes #476257.
1408
1409 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
1410
1411         * pedump.c (main): Call mono_marshal_init so pedump
1412         doesn't crash.
1413
1414 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
1415
1416         * loader.c (method_from_memberref): Properly fix #474271 and
1417         don't break the runtime bad.
1418
1419 2009-02-16  Zoltan Varga  <vargaz@gmail.com>
1420
1421         * domain.c (mono_domain_alloc): Add locking so the caller doesn't have to.
1422         (mono_domain_alloc0): Ditto.
1423
1424 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
1425
1426         * loader.c (method_from_memberref): Don't abort if the array
1427         method is not found. A regular loader failure is more informative
1428         and correct.
1429
1430         Fixes #474271.
1431
1432 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
1433
1434         *loader.c: Guard MonoImage::method_cache/methodref_cache
1435         using the image lock instead of the loader lock.
1436
1437         * metadata.h: Add comments about which fields are protected by
1438         the image lock.
1439
1440 2009-02-16  Zoltan Varga  <vargaz@gmail.com>
1441
1442         * appdomain.c (mono_set_private_bin_path_from_config): Fix a warning.
1443
1444         * generic-sharing.c (mono_method_construct_object_context): Remove the
1445         wrapper_type == NONE assert, it is not needed.
1446
1447 2009-02-15  Zoltan Varga  <vargaz@gmail.com>
1448
1449         * reflection.c (clear_cached_object): New helper function.
1450         (mono_method_clear_object): New function to clear the cached reflection
1451         objects for a dynamic method.
1452
1453         * object.c (mono_runtime_free_method): Call mono_method_clear_object ().
1454         Partly fixes # 463323.
1455         
1456 2009-02-14 Rodrigo Kumpera  <rkumpera@novell.com>
1457
1458         * class.c:
1459         * loader.c:
1460         * reflection.c: Remove all explicit uses of MonoImage::property_hash.
1461
1462 2009-02-14 Rodrigo Kumpera  <rkumpera@novell.com>
1463
1464         * image.c: Add mono_image_property_(lookup,insert,remove) functions that
1465         take the image lock instead of the loader lock.
1466
1467         * metadata-internals.h: Export new functions.
1468
1469 2009-02-12  Miguel de Icaza  <miguel@novell.com>
1470
1471         * domain.c (app_config_parse): Remove another use of stat that is
1472         not necessary as g_file_get_contents already does the presence
1473         check. 
1474
1475 2009-02-13  Zoltan Varga  <vargaz@gmail.com>
1476
1477         * cominterop.c icall-def.h: Fix the DISABLE_COM build.
1478
1479         * marshal.c: Move the bstr handling code to cominterop.c.
1480
1481         * marshal.c: Remove some COM interop code missed previously.
1482
1483 2009-02-12  Miguel de Icaza  <miguel@novell.com>
1484
1485         More Paolo patches from the Wii port:
1486         
1487         * security.c: Remove ves_icall_System_Environment_get_UserName
1488         from here.
1489
1490         * icall.c: And put ves_icall_System_Environment_get_UserName
1491         here. 
1492
1493         * appdomain.c (mono_set_private_bin_path_from_config): Remove
1494         redundant call to stat that was only used to test for the file
1495         existence.   Patch from Paolo.
1496
1497         * gc.c (run_finalize): If COM is disabled, do not link in
1498         mono_marshal_free_ccw.
1499
1500         * generic-sharing.c: Use alloca.h here as well.
1501
1502 2009-02-13 Rodrigo Kumpera  <rkumpera@novell.com>
1503
1504         * reflection.c (mono_reflection_lookup_dynamic_token): Do the locking properly.
1505
1506 2009-02-13  Zoltan Varga  <vargaz@gmail.com>
1507
1508         * cominterop.c cominterop.h: New files.
1509
1510         * marshal.c: Move the COM interop related code to cominterop.c. Make a few
1511         function/typedefs which are needed by cominterop.c global.
1512
1513 2009-02-12  Mark Probst  <mark.probst@gmail.com>
1514
1515         * generic-sharing.c: Don't take the loader lock to guard image
1516         mempool allocs.
1517
1518 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
1519
1520         * reflection.c (mono_reflection_lookup_dynamic_token): This function might be
1521         called without the loader lock which is required to guard MonoImage:tokens.
1522
1523 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
1524
1525         * class.c:
1526         * metadata.c:
1527         * method-builder.c:
1528         * marshal.c:
1529         * reflection.c: Don't take the loader lock to alloc memory from the image mempool.
1530
1531 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
1532
1533         * metadata.c: Remove mono_image_alloc_lock and mono_image_alloc0_lock.
1534         Rework the code to use regular mono_image_alloc/0.
1535
1536         * loader.c: Rework the code to use regular mono_image_alloc/0.
1537
1538         * metadata-internals.h: Remove mono_image_alloc_lock and mono_image_alloc0_lock.
1539
1540 2009-02-12  Bill Holmes  <billholmes54@gmail.com>
1541
1542         * object-internals.h : Fixing a typo in the 
1543           MonoReflectionComVisibleAttribute struct.
1544
1545         * marshal.c (cominterop_com_visible): Check the implemented 
1546           interfaces for ComImport.
1547
1548         * marshal.c (cominterop_get_native_wrapper_adjusted): For COM calls 
1549           assume that bools should be treated as VARIANTBOOLs.
1550
1551         * marshal.c (emit_marshal_boolean): Adding cases for 
1552           MARSHAL_ACTION_MANAGED_CONV_IN and MARSHAL_ACTION_MANAGED_CONV_OUT.
1553
1554         * marshal.c (mono_marshal_emit_managed_wrapper): Adding calls to 
1555           emit_marshal MARSHAL_ACTION_MANAGED_CONV_IN and OUT for bools.
1556
1557         * marshal.c (cominterop_get_ccw): For COM calls assume that bools
1558           should be treated as VARIANTBOOLs.    
1559
1560         Code is contributed under MIT/X11 license.
1561
1562 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
1563
1564         * image.c (mono_image_alloc, mono_image_alloc0, mono_image_strdup): Guard mempool
1565         allocation with the image lock.
1566
1567 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
1568
1569         This patch is the last of a series to remove explicit reference of MonoImage::mempool
1570         and use mono_image_alloc set of functions instead. This time we finish with reflection.c
1571
1572         * object.c: Add mono_string_to_utf8_image.
1573
1574         * object-internals.h: Export mono_string_to_utf8_image.
1575
1576         * reflection.c: Rework all explicit references to the the image mempool to go thought
1577         the mono_image_alloc set of functions.
1578
1579 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
1580
1581         This patch is the third of a series to remove explicit reference of MonoImage::mempool
1582         and use mono_image_alloc set of functions instead. This time we finish with marshal.c
1583         and generics-sharing.c.
1584
1585         * generics-sharing.c (set_other_info_templates): Take a MonoImage instead of a MonoMemPool
1586         as first argument. Note that this function remains broken as it doesn't perform locking around the
1587         mempool allocation.
1588
1589         * generics-sharing.c (rgctx_template_set_other_slot): Pass the image and not the mempool.
1590
1591         * image.c: Add g_slist_append_image.
1592
1593         * metadata.c (mono_metadata_field_info_with_mempool): Remove the mempool argument and use
1594         the supplied image for allocation. Move code into mono_metadata_field_info_full.
1595
1596         * metadata.c (mono_metadata_parse_marshal_spec_full): Take a MonoImage instead of a MonoMemPool.
1597         Fix all related code to do the same.
1598
1599         * marshal.c (mono_marshal_load_type_info): Pass the image instead of the mempool.
1600
1601         * metadata-internals.h: Fix the signatures.
1602
1603 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
1604
1605         This patch is the second of a series to remove explicit reference of MonoImage::mempool
1606         and use mono_image_alloc set of functions instead. This time we rework mono_metadata_type_dup
1607         and similar to work using MonoImage.
1608
1609         * class.c (mono_mempool_dup): Rename to mono_image_memdup and take a MonoImage instead of a
1610         MonoMemPool.
1611
1612         * class.c (mono_dup_array_type): Take a MonoImage instead of a MonoMemPool as first argument.
1613
1614         * class.c (mono_metadata_signature_deep_dup): Same.
1615
1616         * class.c (inflate_generic_type): Same.
1617
1618         * class.c (mono_class_inflate_generic_type_with_mempool): Same.
1619
1620         * metadata.c (mono_metadata_signature_dup_full): Same.
1621
1622         * metadata.c: Add mono_metadata_signature_dup_mempool and extract common functionality from 
1623         mono_metadata_signature_dup_full.
1624
1625         * metadata.c (mono_metadata_type_dup): Same.
1626
1627         * marshal.c: Pass the image to calls to mono_metadata_type_dup.
1628
1629         * reflection.c: Same.
1630
1631         * generic-sharing.c: Pass the image to calls to mono_class_inflate_generic_type_with_mempool.
1632
1633         * metadata-internals.h: Fix the signatures.
1634
1635         * class-internals.h: Same.
1636
1637 2009-02-11 Rodrigo Kumpera  <rkumpera@novell.com>
1638
1639         This patch is the first of a series to remove explicit reference of MonoImage::mempool
1640         and use mono_image_alloc set of functions instead. 
1641
1642         * class.c (mono_class_inflate_generic_type_with_mempool_no_copy):
1643         Rename to mono_class_inflate_generic_type_no_copy and take a MonoImage instead
1644         of a MonoMemPool.
1645
1646         * class.c (mono_class_setup_fields): Adapt to mono_class_inflate_generic_type_no_copy.
1647
1648         * class.c (g_list_prepend_mempool): Removed.
1649
1650         * class.c (mono_class_get_nested_types): Use g_list_prepend_image instead of g_list_prepend_mempool.
1651
1652         * image.c: Add g_list_prepend_image.
1653
1654         * metadata-internals.h (struct MonoImage): Fix comment. Export g_list_prepend_image as internal.
1655
1656         * reflection.c (mono_reflection_create_runtime_class): Use g_list_prepend_image instead of g_list_prepend_mempool.
1657
1658
1659 2009-02-11 Rodrigo Kumpera  <rkumpera@novell.com>
1660
1661         * metadata-internals.h (struct MonoImage): Add lock field. Export mono_image_lock and
1662         mono_image_unlock.
1663
1664         * image.c (mono_image_init): Init the lock field.
1665  
1666         * image.c (mono_image_init): Cleanup the lock field.
1667
1668         * image.c: Add mono_image_(un)lock functions.
1669
1670 2009-02-11  Mark Probst  <mark.probst@gmail.com>
1671
1672         * class.c, class-internals.h: mono_method_get_context_general()
1673         combines the functionality of mono_method_get_context() and
1674         mini_method_get_context().
1675
1676         * generic-sharing.c, domain-internals.h:
1677         mono_method_construct_object_context() and
1678         mono_domain_lookup_shared_generic() moved from mini.
1679
1680         * icall.c (ves_icall_InternalInvoke): Handle the case where the
1681         method doesn't have the correct instantiation because it's shared
1682         generic code.  Fixes #473999.
1683
1684 2009-02-11  Zoltan Varga  <vargaz@gmail.com>
1685
1686         * loader.c (mono_method_get_wrapper_data): Handle inflated methods as well.
1687
1688         * loader.c (mono_loader_lock): Add a comment pointing to the locking document.
1689         
1690 2009-02-11 Rodrigo Kumpera  <rkumpera@novell.com>
1691
1692         * metadata.c: Make mono_image_alloc_lock and mono_image_alloc0_lock non static.
1693
1694         * metadata-internals.h: Export mono_image_alloc_lock and mono_image_alloc0_lock.
1695
1696         * loader.c (mono_get_method_full): Drop the loader lock while constructing the method
1697         and recheck the cache for dups after it.
1698
1699         * loader.c (mono_get_method_from_token): Use _lock version of mono_image_alloc0.
1700
1701         Fixes one of the deadlocks found in #473150.
1702
1703 2009-02-11  Bill Holmes  <billholmes54@gmail.com>
1704
1705         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Accept_internal):
1706           For Win32, add additional break conditions for accept.
1707
1708         Code is contributed under MIT/X11 license.
1709
1710 2009-02-10  Zoltan Varga  <vargaz@gmail.com>
1711
1712         * marshal.c (mono_marshal_get_native_func_wrapper): Use get_cache to
1713         lazily initialize the native wrapper cache.
1714         (mono_marshal_get_native_wrapper): Put aot-ed native wrappers into a separate
1715         cache, since they are different from the normal wrappers.
1716
1717         * image.c (mono_image_init): Initialize native_wrapper_cache lazily as well.
1718
1719         * metadata-internals.h (struct _MonoImage): Add a new wrapper for
1720         AOT compiled native wrappers.
1721
1722 2009-02-09  Geoff Norton  <gnorton@novell.com>
1723
1724         * appdomain.h:
1725         * security-core-clr.c: Allow enabling core-clr from the embedding
1726         API.
1727
1728 2009-02-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
1729
1730         * socket-io.c: when requesting all the local ips, if there are no
1731         interfaces up and running, MS returns 127.0.0.1.
1732
1733 2009-02-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
1734
1735         * mono-perfcounters-def.h: processor time is an inverse time.
1736         Fixes bug #468625.
1737
1738 2009-02-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
1739
1740         * socket-io.c: an empty host name returns the list of local IPs.
1741         Fixes bug #386637 part 1/2.
1742
1743 2009-02-07  Zoltan Varga  <vargaz@gmail.com>
1744
1745         * verify.c (mono_class_interface_implements_interface): Call
1746         mono_class_setup_interfaces ().
1747         (merge_stacks): Ditto.
1748
1749 2009-02-06  Zoltan Varga  <vargaz@gmail.com>
1750
1751         * class.c (mono_class_setup_interfaces): New function to lazily initalize
1752         klass->interfaces.
1753         (mono_generic_class_get_class): Don't initalize klass->interfaces.
1754         (mono_generic_class_get_class): Ditto.
1755
1756 2009-02-06  U-QUACK\miguel  <miguel@quack>
1757
1758         * icall-defs.h: Include also the Encrypt/Decrypt string methods as
1759         they live in security.c
1760
1761         * debug-mono-symfile.c (mono_debug_open_mono_symbols): Integrated
1762         another bit from Paolo's code.
1763
1764 2009-02-06  Zoltan Varga  <vargaz@gmail.com>
1765
1766         * object.c (build_imt_slots): Add a small optimization to avoid inflating
1767         methods which will be discarded by add_imt_builder_entry ().
1768
1769         * marshal.c (get_runtime_invoke_type): Avoid sharing enum types since they
1770         need to be boxed.
1771
1772         * loader.c: Add a statistics for the size of the memberref signature cache.
1773         
1774         * loader.c (find_cached_memberref_sig): New helper function.
1775         (cache_memberref_sig): Ditto.
1776
1777         * loader.c: Cache the result of parsing memberref signatures, since otherwise
1778         they will be parsed again for every generic instantiation, leading to unbounded
1779         memory growth.
1780
1781 2009-02-05  Zoltan Varga  <vargaz@gmail.com>
1782
1783         * loader.c (mono_get_method_from_token): Avoid creating class for the generic
1784         parameters of generic methods.
1785
1786         * class.c (mono_class_inflate_generic_method_full): Set is_mb_open again
1787         after the original method is copied to the inflated method.
1788         (mono_class_get_vtable_entry): Handle rgctx invoke wrappers more efficiently.
1789
1790         * class-internals.h (struct _MonoMethodInflated): Move the is_mb_open
1791         field to MonoMethod since it only consumes 1 bit there, and 4/8 bytes here.
1792
1793         * class.c metadata.c: Update after the changes above.
1794
1795 2009-02-05 Rodrigo Kumpera  <rkumpera@novell.com>
1796
1797         * metadata-verify.c: Simplified error handling and added
1798         section table validation.
1799
1800 2009-02-05  Zoltan Varga  <vargaz@gmail.com>
1801
1802         * class-internals.h (MonoClassExt): New structure containing rarely used
1803         fields of MonoClass.
1804         (struct _MonoClass): Move rarely used fields to MonoClassExt, accessed
1805         through a new 'ext' field.
1806
1807         * class.c (mono_class_alloc_ext): New helper function to allocate 
1808         class->ext.
1809
1810         * class.c metadata.c reflection.c: Update after MonoClass structure changes.
1811
1812 2009-02-05  Mark Probst  <mark.probst@gmail.com>
1813
1814         * object.c (mono_object_get_virtual_method): Properly inflate
1815         generic methods.  Fixes #472692.
1816
1817 2009-02-05 Rodrigo Kumpera  <rkumpera@novell.com>
1818
1819         * class.c (mono_class_create_from_typedef): The CLR supports SystemF
1820         recursive types such as List<T>:Cons<T,List<T>> so when doing the lookup
1821         for the parent type, the created type must be ready to be used on a generic
1822         instantiation.
1823         We fill this_arg/byval_arg if the parent is a generic instance to make sure
1824         we won't have duplicated entries in generic_inst_cache.
1825
1826         Fixes #469553.
1827
1828 2009-02-05  Miguel De Icaza  <miguel@novell.com>
1829
1830         * threadpool.c (socket_io_add_poll): Remove the BSD6 define and
1831         replace with plain BSD per the comments on the bug MONO77637.
1832
1833 2009-02-05  Zoltan Varga  <vargaz@gmail.com>
1834
1835         * class.c (mono_class_get_generic_class): New accessor function.
1836         (mono_class_get_generic_container): Ditto.
1837
1838         * class-internals.h (struct _MonoClass): Add 'is_generic' and 'is_inflated'
1839         fields, similar to the ones in MonoMethod.
1840
1841         * class.c (mono_generic_class_get_class): Set klass->is_inflated.
1842         (mono_class_create_from_typedef): Set klass->is_generic if needed.
1843
1844         * reflection.c (mono_reflection_create_generic_class): Set klass->is_generic.
1845         
1846         * class-internals.h (struct _MonoClass): Remove enum_basetype, it contains
1847         the same information as element_class->byval_arg.
1848
1849         * class.c reflection.c: Remove references to class->byval_arg.
1850
1851         * class.c marshal.c: Use mono_class_enum_basetype () instead of accessing 
1852         klass->enum_basetype directly.
1853
1854         * verify.c metadata.c object.c icall.c reflection.c: Use 
1855         mono_class_enum_basetype () instead of accessing klass->enum_basetype 
1856         directly.
1857
1858 2009-02-04  Miguel de Icaza  <miguel@novell.com>
1859
1860         * icall-def.h: Remove internal calls for sockets when
1861         DISABLE_SOCKET is defined, file system writing features when the
1862         OS only support reading and not writing data and Policy support if
1863         the Policy is disabled.
1864         
1865         * image.c (do_mono_image_open): Apply Paolo's patches for using
1866         mono_file_map_ APIs here.
1867
1868         * assembly.c: Add support for platforms to avoid prefix
1869         auto-detection. 
1870
1871 2009-02-04  Zoltan Varga  <vargaz@gmail.com>
1872
1873         * generic-sharing.c (mono_method_fill_runtime_generic_context): Fix a
1874         warning.
1875
1876         * class.c (mono_class_inflate_generic_class): New helper function.
1877
1878         * class.c: Use mono_class_inflate_generic_class in a few places. Add
1879         statistics for inflated methods/classes.
1880
1881         * loader.c (inflate_generic_header): Use mono_class_inflate_generic_class.
1882
1883         * icall.c (ves_icall_Type_GetMethodsByName): Optimize the case when
1884         the call is made from Delegate.CreateDelegate () for the invoke method of
1885         a delegate.
1886
1887         * loader.c: Add a statistics for the memory occupied by inflated signatures.
1888
1889         * metadata.c (mono_metadata_signature_size): New helper function.
1890
1891         * class.c (mono_class_get_method_from_name_flags): Add an optimization for
1892         generic instances.
1893
1894         * metadata.c (inflated_method_in_image): Avoid calling 
1895         mono_method_signature () if the method does not already have a signature.
1896
1897 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
1898
1899         * verify.c (is_compatible_boxed_valuetype): When checking if the boxed 
1900         valuetype is compatible with target type, check by inheritance as a
1901         VT is not really compatible with System.ValueType, for example.
1902
1903         * verify.c (do_invoke_method): Improve error message.
1904
1905         * verify.c (do_box_value): If boxing a nullable, use the type argument
1906         on stack instead.
1907
1908         * verify.c (do_newobj): Improve error message.  
1909
1910         Fixes #469549.
1911
1912 2009-02-03  Miguel de Icaza  <miguel@novell.com>
1913
1914         * appdomain.c: Add support for DISABLE_SOCKETS and DISABLE_SHADOW_COPY
1915
1916 2009-02-03  Mark Probst  <mark.probst@gmail.com>
1917
1918         * generic-sharing.c: Don't hold domain lock when calling
1919         instantiate_other_info().  Fixes #471958.
1920
1921         * domain-internals.h, loader.c: Describe locking policy of domain
1922         lock vs loader lock.
1923
1924 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
1925
1926         * verify.c (mono_delegate_signature_equal): Make it possible to check
1927         first-arg-bound delegates to static method.
1928
1929         * verify.c (verify_delegate_compatibility): Correctly verify delegates to
1930         static methods with the first arg bound.
1931
1932         Fixes #469529.
1933
1934 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
1935
1936         * verify.c: Added stack_slot_full_name to provide decent and more meanfull
1937         errors.
1938
1939         * verify.c (is_compatible_boxed_valuetype): Be less restrictive when not
1940         under strict mode. Any type, when boxed can be seen as a reference type.
1941
1942         Fixes #469528.
1943
1944 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
1945
1946         * object.h: The lower bound of an array is a signed integer value.
1947         Introduce mono_array_lower_bound_t typedef. It should be used instead of
1948         gint32 as under MONO_BIG_ARRAYS it will be a gint64.
1949
1950         * icall.c: Cast MonoArrayBounds::length to a signed value so correctly
1951         calculate the upper bound.
1952         
1953         Fixes #471252.
1954
1955 2009-02-02  Miguel de Icaza  <miguel@novell.com>
1956
1957         From Paolo's work, refactored, cleared up:
1958         
1959         * threadpool.c, icall.c: ifdef code that requires a working socket
1960         stack.
1961
1962         * metadata.c (mono_metadata_field_info): Do not attempt to return
1963         a value from a function declared as void.
1964
1965         * console-io.c: Use MONO_NULL_TTYDRIVER to remove the tty driver
1966         from the console stack.
1967
1968         * assembly.c: use strrchr instead of rindex.
1969
1970         * class.c, object.c, marshal.c, icall.c, reflection.c: include
1971         alloca.h on systems that have it.
1972
1973         * environment.c: Avoid code that uses stuff from
1974         HAVE_SYS_UTSNAME_H
1975         
1976         * appdomain.c: Include sys/time.h.
1977
1978         * console-io.c: include sys/ioctl.h if it is available.
1979
1980 2009-02-03  Zoltan Varga  <vargaz@gmail.com>
1981
1982         * method-builder.h (_MonoMethodBuilder): Add a 'skip_visibility' flag.
1983
1984         * method-builder.c (mono_mb_create_method): Set method->skip_visibility from
1985         the method builder.
1986
1987         * marshal.c: Set mb->skip_visibility instead of setting it on the method
1988         after it was created and cached, as the later is not thread safe.
1989         
1990 2009-02-02  Zoltan Varga  <vargaz@gmail.com>
1991
1992         * mono-debug.c (mono_debug_print_stack_frame): Avoid crashes when this is
1993         called while the debugging module is not initialized. Fixes #471669.
1994
1995 2009-02-02 Rodrigo Kumpera  <rkumpera@novell.com>
1996
1997         * icall.c (type_from_name): Ignore reflection frames to find out the real caller.
1998
1999         Fixes #471255.
2000
2001 2009-02-02  Mark Probst  <mark.probst@gmail.com>
2002
2003         * generic-sharing.c (lookup_or_register_other_info): Make sure the
2004         loader lock is not taken while the templates lock is held.  Fixes
2005         #471089.
2006
2007 2009-02-02  Mark Probst  <mark.probst@gmail.com>
2008
2009         * metadata.c (type_in_image): Added a check to fix a monodis
2010         crash.
2011
2012 2009-02-02  Zoltan Varga  <vargaz@gmail.com>
2013
2014         * marshal.c (mono_marshal_get_runtime_invoke): Add support for byref
2015         nullable arguments.
2016
2017         * object.c (mono_runtime_invoke_array): Ditto.
2018         
2019         * marshal.c (mono_marshal_free_dynamic_wrappers): New function for
2020         freeing wrappers of dynamic methods.
2021
2022         * loader.c (mono_free_method): Call it. Fixes #463323.
2023         
2024         * marshal.c (mono_marshal_get_runtime_invoke): Disable sharing for
2025         methods taking vtype/byref arguments, to fix yet another bug caused by
2026         the sharing of runtime invoke wrappers. Partly fixes #471259.
2027
2028 2009-02-01  Zoltan Varga  <vargaz@gmail.com>
2029
2030         * debug-mono-symfile.c (check_line): Return NULL instead of returning
2031         <first file in file table>:1 when the IL offset does not have an associated
2032         line number.
2033
2034 2009-01-31  Zoltan Varga  <vargaz@gmail.com>
2035
2036         * mono-debug.c (mono_debug_lookup_locals): New function to return local
2037         variable info for a method.
2038
2039         * debug-mono-symfile.c (mono_debug_symfile_lookup_locals): Ditto.
2040         
2041 2009-01-30  Jb Evain  <jbevain@novell.com>
2042
2043         * pedump.c: reuse code from monodis to make sure pedump honors
2044         MONO_PATH, which is needed to verify net_2_1 assemblies.
2045
2046 2009-01-29  Zoltan Varga  <vargaz@gmail.com>
2047
2048         * mono-debug.c (mono_debug_print_stack_frame): Print the IL offset even when
2049         there is no line number info.
2050
2051 2009-01-29  Raja R Harinath  <harinath@hurrynot.org>
2052
2053         Avoid some MonoType allocations
2054         * reflection.c (mono_reflection_initialize_generic_parameter):
2055         Reuse MonoType from param->pklass rather than allocating one.
2056         (mono_dynamic_image_free): Update to changes.
2057
2058 2009-01-28  Raja R Harinath  <harinath@hurrynot.org>
2059
2060         Rearrange some code to improve consistency
2061         * reflection.c (mono_reflection_setup_generic_class): Move body ...
2062         (mono_reflection_initialize_generic_parameter): ... here.
2063
2064 2009-01-28  Zoltan Varga  <vargaz@gmail.com>
2065
2066         * generic-sharing.c (has_constraints): Enable gshared for methods/classes
2067         with type constraints as an experiment.
2068
2069         * boehm-gc.c (on_gc_notification): Update mono_stats.
2070
2071 2009-01-28  Raja R Harinath  <harinath@hurrynot.org>
2072
2073         Avoid some allocations
2074         * class-internals.h (_MonoGenericInst::type_argv): Convert from
2075         pointer to tail array to avoid extra allocation.
2076         * metadata.c (free_generic_inst): Update to changes.
2077         (mono_metadata_get_generic_inst): Likewise.  Use alloca instead of
2078         on-stack struct.
2079
2080 2009-01-27  Zoltan Varga  <vargaz@gmail.com>
2081
2082         * icall.c (ves_icall_System_Type_EqualsInternal): For user-defined types,
2083         return TRUE if the two type objects are the same.
2084
2085 2009-01-26  Zoltan Varga  <vargaz@gmail.com>
2086
2087         * marshal.c (mono_marshal_load_type_info): Fill out info->min_align.
2088         (mono_class_native_size): Use klass->marshal_info->min_align instead of
2089         klass->min_align, since klass->min_align contains the managed alignment,
2090         while the native alignment can be different, like for longs on x86.
2091         Fixes #469135.
2092
2093         * class-internals.h (MonoMarshalType): Add a min_align field.
2094
2095 2009-01-26 Rodrigo Kumpera  <rkumpera@novell.com>
2096
2097         * assembly.c (mono_assembly_try_decode_skip_verification): Add a hack to check
2098         the 1.0 format.
2099
2100 2009-01-26  Zoltan Varga  <vargaz@gmail.com>
2101
2102         * domain-internals.h (struct _MonoJitInfo): Add a 'from_aot' field plus
2103         some comments about the usage of the used_regs field.
2104
2105         * marshal.c (emit_marshal_ptr): Allow pointers to blittable structures.
2106         Fixes #469217.
2107
2108 2009-01-24 Gonzalo Paniagua Javier <gonzalo@novell.com>
2109
2110         * appdomain.c: return NULL instead of throwing FileNotFoundException
2111         when LoadAssembly() fails.
2112
2113 2009-01-23  Mark Probst  <mark.probst@gmail.com>
2114
2115         * metadata.c (mono_metadata_generic_param_equal): Only compare the
2116         image if the owner is NULL.  Fixes the AOT failures.
2117
2118 2009-01-23  Zoltan Varga  <vargaz@gmail.com>
2119
2120         * metadata.c (mono_metadata_load_generic_params): Initialize the 
2121         MonoGenericParam structure using memset so the image field is initialized
2122         as well.
2123
2124 2009-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
2125
2126         * appdomain.c (mono_domain_unload): Change the InterlockedIncrement to
2127         a plain store.
2128
2129 2009-01-21  Zoltan Varga  <vargaz@gmail.com>
2130
2131         * class.c (mono_class_setup_vtable_general): In the generic instance
2132         optimization, set method->slot for abstract virtual methods. Fixes part of
2133         #467834.
2134
2135 2009-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
2136
2137         * domain-internals.h: Add new appdomain state MONO_APPDOMAIN_UNLOADING_START
2138         which signals that the unloading has started but all appdomain services must
2139         remain operational.
2140
2141         * appdomain.c (mono_domain_unload): The initial state for unloading now
2142         is unloading_start and we switch to unloading after the managed call to
2143         AppDomain::DomainUnload has finished.
2144
2145         The new unloading state has to be created because managed code in the
2146         DomainUnload event can depend on things like the threadpool still working.
2147         The domain must remain fully functional while the event executes.
2148
2149         This shown as an issue due to Process::WaitForExit, which waits for
2150         async reads of stdout and stderr to complete. Since those are processed
2151         in the threadpool the code deadlocks because the DomainUnload callback 
2152         waits for the async read finished event, which should have been set by a
2153         threadpool job but has been discarded due to the domain been in unload
2154         state.
2155
2156 2009-01-21  Mark Probst  <mark.probst@gmail.com>
2157
2158         * metadata.c (mono_metadata_generic_param_equal): Owner as well as
2159         image must match.
2160
2161 2009-01-21  Mark Probst  <mark.probst@gmail.com>
2162
2163         * reflection.c (resolve_object): For fields, inflate the class and
2164         then get the field in the inflated class.
2165
2166 2009-01-20  Mark Probst  <mark.probst@gmail.com>
2167
2168         * object-internals.h (struct _MonoException): Added a comment
2169         explaining the new use of trace_ips.
2170
2171 2009-01-20  Mark Probst  <mark.probst@gmail.com>
2172
2173         * generic-sharing.c (inflate_other_data): Inflate array methods
2174         correctly.
2175
2176         * loader.c, class-internals.h: Rename search_in_array_class() to
2177         mono_method_search_in_array_class() and make it non-static.
2178
2179 2009-01-19  Zoltan Varga  <vargaz@gmail.com>
2180
2181         * metadata.c (inflated_signature_in_image): Call signature_in_image as well.
2182         Hopefully fixes #458168.
2183
2184 2009-01-19  Christian Hergert  <christian.hergert@gmail.com>
2185
2186         * object.c (mono_raise_exception): Remove call to InterlockedIncrement
2187         as it is performed elsewhere.
2188
2189         Code is contributed under MIT/X11 license
2190
2191 2009-01-19  Christian Hergert  <christian.hergert@gmail.com>
2192
2193         * mono-perfcounters-def.h: Add counters for asp.net requests total and
2194         requests queued.
2195         * object.c (mono_raise_exception): Increment the exceptions total
2196         counter when an exception is thrown.
2197         * class-internals.h: Add a location for storing the total number of
2198         asp.net requests served.
2199         * mono-perfcounters.c: Implement update support for asp.net counters
2200         from the class libraries. Implement read support for asp.net counters
2201         and exceptions total counter.
2202
2203 2009-01-19  Zoltan Varga  <vargaz@gmail.com>
2204
2205         * loader.c (search_in_array_class): Call mono_class_setup_methods () before
2206         accessing klass->methods. Fixes #467385.
2207
2208 2009-01-18  Zoltan Varga  <vargaz@gmail.com>
2209
2210         * marshal.c (emit_marshal_custom): Avoid calling MarshalNativeToManaged
2211         for byval arguments without an [Out] attribute. Fixes #467212.
2212
2213         * attach.c: Applied patch from Koushik Dutta (koush@koushikdutta.com). 
2214         Fix compilation under android.
2215         
2216         * sgen-gc.c: Instead of scanning gray objects after all roots have been 
2217         processed, scan them directly after they are copied, to achieve better locality
2218         and cache usage.
2219
2220         * socket-io.c: Applied patch from Koushik Dutta
2221         (koush@koushikdutta.com). Disable IPV6 when running under android.
2222
2223 2009-01-18  Zoltan Varga  <vargaz@gmail.com>
2224
2225         * icall.c (ves_icall_InternalExecute): Add write barriers.
2226
2227         * marshal.c (mono_marshal_get_write_barrier): Remove, this is now done in
2228         the GC code.
2229
2230         * sgen-gc.c: Implement write barriers in IL code.
2231
2232 2009-01-17  Geoff Norton  <gnorton@novell.com>
2233
2234         * image.c: Avoid trying to walk the reference table of dynamic assemblies.
2235
2236 2009-01-17  Geoff Norton  <gnorton@novell.com>
2237
2238         * image.c: When unloading the image->references table, there can be gaps
2239         in it.  Ensure that we iterate every entry to avoid leaking assembly references
2240         when unloading an appdomain.
2241
2242 2009-01-16  Zoltan Varga  <vargaz@gmail.com>
2243
2244         * sgen-gc.c: Add support for allocating a nursery at an aligned address, to
2245         speed up ptr-in-nursery checks.
2246
2247         * threads.c (mono_threads_abort_appdomain_threads): Abort threads outside the
2248         threads_lock () to prevent deadlocks.
2249
2250         * sgen-gc.c gc-internal.h: Add a new root type root-with-wbarrier, which
2251         does not need to be scanned during minor collections, since writes to it
2252         must use write barriers.
2253
2254 2009-01-15 Rodrigo Kumpera  <rkumpera@novell.com>
2255
2256         * metadata-verify.c: Add pe nt header verification.
2257         
2258 2009-01-15  Zoltan Varga  <vargaz@gmail.com>
2259
2260         * gc.c: Fix a few warnings when using SGEN.
2261
2262 2009-01-14 Rodrigo Kumpera  <rkumpera@novell.com>
2263
2264         * metadata-verify.c: Add pe optional header verification.
2265
2266 2009-01-15  Zoltan Varga  <vargaz@gmail.com>
2267
2268         * sgen-gc.c: Add support for user defined marker functions, used by
2269         MonoGHashTable to avoid registering a GC root for every hash node.
2270
2271 2009-01-14  Zoltan Varga  <vargaz@gmail.com>
2272
2273         * sgen-gc.c: Fix warnings. Optimize copy_object () a bit. Split pinned/
2274         non-pinned roots into separate hashes to avoid having to traverse them
2275         in functions which are only interested in one kind.
2276
2277 2009-01-13 Rodrigo Kumpera  <rkumpera@novell.com>
2278
2279         * metadata-verify.c: Add pe header machine field verification.
2280         
2281 2009-01-13 Rodrigo Kumpera  <rkumpera@novell.com>
2282
2283         * metadata-verify.c: Add pe header size verification.
2284
2285 2009-01-14  Zoltan Varga  <vargaz@gmail.com>
2286
2287         * reflection.c (ALLOC_REFENTRY): Don't allocate the ReflectionEntry structures
2288         using the GC, they don't contain references.
2289
2290         * domain.c (mono_domain_create): Create ldstr_table using MONO_HASH_KEY_VALUE_GC.
2291
2292 2009-01-13  Geoff Norton  <gnorton@novell.com>
2293
2294         * appdomain.c|h: Expose mono_domain_unload to the embedding api so that 
2295         AppDomains created on the native side can be cleaned up on the native side.
2296
2297 2009-01-13  Geoff Norton  <gnorton@novell.com>
2298
2299         * appdomain.c: Ensure that we call mono_context_init for the embedding api
2300         as well as the managed api.
2301
2302 2009-01-13  Geoff Norton  <gnorton@novell.com>
2303
2304         * appdomain.h|c: New API for creating a MonoDomain in the embedding api
2305         with a MonoAppDomain initialized against it.
2306
2307 2009-01-13  Zoltan Varga  <vargaz@gmail.com>
2308
2309         * reflection.c (MOVING_GC_REGISTER): Fix a warning.
2310         
2311         * reflection.c (mono_image_get_generic_param_info): Use MOVING_GC_REGISTER.
2312
2313         * marshal.c: Avoid setting the exception clauses after a method has been entered 
2314         into the wrapper caches. Fixes #465700.
2315
2316         * method-builder.c (mono_mb_set_clauses): New function to set the clauses of the
2317         method builder.
2318         (mono_mb_create_method): Set the clauses from the method builder.
2319
2320 2009-01-13 Gonzalo Paniagua Javier <gonzalo@novell.com>
2321
2322         * threadpool.c: include sys/socket.h. Fixes compilation on FreeBSD.
2323         Patch from Makoto Kishimoto.
2324
2325 2009-01-13  Zoltan Varga  <vargaz@gmail.com>
2326
2327         * sgen-gc.c (mono_gc_make_descr_from_bitmap): Handle large bitmaps by 
2328         encoding them as ROOT_DESC_COMPLEX.
2329         (precisely_scan_objects_from): Implement support for ROOT_DESC_COMPLEX.
2330
2331 2009-01-12  Zoltan Varga  <vargaz@gmail.com>
2332
2333         * sgen-gc.c (scan_from_remsets): Clear the global remset of pointers which
2334         no longer point to the nursery.
2335
2336         * sgen-gc.c: Add a few comments/FIXMEs.
2337         
2338         * sgen-gc.c: Implement scanning of the alloc_pinned objects.
2339
2340         * marshal.c (mono_marshal_get_synchronized_wrapper): Make the 
2341         initialization of the various _method variables thread safe. Fixes
2342         #465377.
2343
2344 2009-01-12  Mark Probst  <mark.probst@gmail.com>
2345
2346         * domain.c, domain-internals.h: Remove the shared_generics_hash
2347         and its lookup functions.
2348
2349 2009-01-12  Bill Holmes  <billholmes54@gmail.com>
2350
2351         * socket-io.c:  Fixing the MSVC build. 
2352
2353         Code is contributed under MIT/X11 license.
2354
2355 2009-01-12 Rodrigo Kumpera  <rkumpera@novell.com>
2356
2357         * metadata-verify.c: Add pe header watermark verification.
2358
2359 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
2360
2361         * metadata-verify.c: Add lfanew verification.
2362
2363 2009-01-12  Jb Evain  <jbevain@novell.com>
2364
2365         * tabldefs.h: rename METHOD_ATTRIBUTE_CHECK_ACCESS_ON_OVERRIDE to
2366         METHOD_ATTRIBUTE_STRICT to match the ECMA terminology.
2367
2368 2009-01-10  Zoltan Varga  <vargaz@gmail.com>
2369
2370         * socket-io.c: Fix the build.
2371
2372         * environment.c: Fix an #ifdef.
2373
2374 2009-01-09  Zoltan Varga  <vargaz@gmail.com>
2375
2376         * threadpool.c (async_invoke_thread): Handle the wait function returning
2377         WAIT_IO_COMPLETION as well.
2378         (async_invoke_io_thread): Ditto.
2379
2380 2009-01-09  Bill Holmes  <billholmes54@gmail.com>
2381
2382         * threads.c: Fixing the Windows build.
2383
2384         Code is contributed under MIT/X11 license.
2385
2386 2009-01-09  Zoltan Varga  <vargaz@gmail.com>
2387  
2388         * threads.c (signal_thread_state_change): Call wapi_interrupt_thread () to
2389         interrupt a wait.
2390         (mono_thread_execute_interruption): Call wapi_clear_interruption () to enable
2391         the thread to wait again.
2392
2393 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
2394
2395         * metadata-verify.c: Initial skeleton of the metadata verifier.
2396
2397         * pedump.c: Add support for the metadata verifier.
2398
2399         * verify-internal.h: Export the whole assembly metadata verifier function.
2400
2401 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
2402
2403         * gc.c (mono_gc_init): Fix the comments about deadlock on windows.
2404
2405 2009-01-09  Zoltan Varga  <vargaz@gmail.com>
2406
2407         * Makefile.am: Upgrade dtrace-prelink.sh location.
2408
2409 2009-01-08 Rodrigo Kumpera  <rkumpera@novell.com>
2410
2411         * gc.c (mono_gc_init): Wait for finalizer thread to init on windows as
2412         well. Otherwise the shutdown deadlock that happens on unix will can happen
2413         as well.
2414         If the main thread code finishes too fast it's possible that the finalizer
2415         thread won't have executed yet, won't record itself as the finalizer thread
2416         and the shutdown sequence will wait on it forever.
2417
2418 2009-01-08 Rodrigo Kumpera  <rkumpera@novell.com>
2419
2420         * threads.c (mono_thread_current): Make THREAD_DEBUG work on windows
2421         with MSVC.
2422
2423 2009-01-08  Miguel de Icaza  <miguel@novell.com>
2424
2425         * appdomain.c: Initialize the mono_strtod_mutex here, thanks to
2426         Robert Jordan for pointing this out.
2427
2428 2009-01-08  Christian Prochnow  <cproch@seculogix.de>
2429
2430         * icall.c
2431         * icall-def.h: added internal calls ves_icall_System_IO_DriveInfo_GetDiskFreeSpace,
2432         ves_icall_System_IO_DriveInfo_GetDriveType.
2433
2434 2009-01-07  Miguel de Icaza  <miguel@novell.com>
2435
2436         * icall.c: Wrap calls to mono_strtod in CriticalSection
2437         invocations when using eglib, to work around #464316.
2438
2439 2009-01-07 Rodrigo Kumpera  <rkumpera@novell.com>
2440
2441         * file-io.c (ves_icall_System_IO_MonoIO_GetCurrentDirectory): Double check the
2442         return value of GetCurrentDirectory to never access unitialized memory.
2443
2444 2009-01-07 Rodrigo Kumpera  <rkumpera@novell.com>
2445
2446         * file-io.c (ves_icall_System_IO_MonoIO_GetCurrentDirectory): Properly check the
2447         return value of GetCurrentDirectory and expand the buffer if needed.
2448
2449         Fixes #459094.
2450
2451 2009-10-07 Tom Hindle  <tom_hindle@sil.org>
2452
2453         * marshal.c (GetIUnknownForObjectInternal, GetIUnknownForObjectInternal) : 
2454           Adding a call to mono_init_com_types.
2455
2456         Code is contributed under MIT/X11 license.
2457
2458 2009-01-07  Geoff Norton  <gnorton@novell.com>
2459
2460         * socket-io.c: ioctlsocket(FIONREAD) returns the size of the UDP header as well on 
2461         darwin.  Use getsockopt SO_NREAD instead to get the right values for TCP and UDP.
2462         ai_canonname can be null in some cases on darwin, where the runtime assumes it will 
2463         be the value of the ip buffer.
2464
2465 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
2466
2467         * verify.c (mono_class_interface_implements_interface): Verify parents as we can't rely on
2468         interfaces_packed here.
2469
2470         Fixes part of #463294.
2471
2472 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
2473
2474         * verify.c (is_array_type_compatible): Ignore bounds and sizes when checking array compatibility.
2475
2476         Fixes part of #463294.
2477
2478 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
2479
2480         * verify.c (stack_slot_is_complex_type_not_reference_type): Check if the type
2481         is a boxed complex as well.
2482
2483         Fixes part of #463294.
2484
2485 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
2486
2487         * reflection.c (mono_image_get_methodref_token): Add an extra create_typespec parameter to
2488         control if a methodspec should be created for the generic method definition from external assemblies.
2489         Caching of methodspec is done using the handleref hash table.
2490
2491         Fixes #462592.
2492
2493 2009-01-05 Rodrigo Kumpera  <rkumpera@novell.com>
2494
2495         * loader.c (find_method): When searching the interfaces of a class
2496         check the transitive closure of implemented interfaces.
2497
2498         Fixes #463303.
2499
2500 2009-01-03 Rodrigo Kumpera  <rkumpera@novell.com>
2501
2502         * class.c (get_implicit_generic_array_interfaces): Improve debugging code.
2503         
2504 2009-01-03 Rodrigo Kumpera  <rkumpera@novell.com>
2505
2506         * class.c (get_implicit_generic_array_interfaces): Extract valuetype
2507         interfaces calculation to fill_valuetype_array_derived_types.
2508
2509         * class.c (get_implicit_generic_array_interfaces): Valuetypes need IList /
2510         ICollection / IEnumerator interfaces for their extra twin type - sbyte for byte
2511         for example.
2512
2513         * class.c (get_implicit_generic_array_interfaces): InternalEnumerator gets
2514         interfaces for valuetypes if needed.    
2515
2516         * class.c (fill_valuetype_array_derived_types): Enums should have interfaces
2517         for their basetype as well. Types are array expanded if rank is > 0.
2518
2519         Fixes #400716.
2520
2521 2008-12-30  Bill Holmes  <billholmes54@gmail.com>
2522
2523         * socket-io.h : Changing the signature of
2524           ves_icall_System_Net_Sockets_Socket_Accept_internal to pass
2525           the blocking state.
2526
2527         * icall-def.h :  Changing the signature of
2528           System.Net.Sockets.Socket.Accept_internal to pass the blocking state.
2529
2530         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Accept_internal) :
2531           For Windows only.  Avoid blocking when calling accept by
2532           querying for a connection via select.  The loop also queries
2533           the thread state every 1000 micro seconds for the thread
2534           stop state.  This will avoid the process hanging on shutdown
2535           when using a TcpChannel that is never connected to.
2536
2537         Code is contributed under MIT/X11 license.
2538
2539 2008-12-30  Marek Safar  <marek.safar@gmail.com>
2540
2541         * tabledefs.h: Add METHOD_ATTRIBUTE_CHECK_ACCESS_ON_OVERRIDE.
2542
2543 2008-12-26 Rodrigo Kumpera  <rkumpera@novell.com>
2544
2545         * class.c (get_implicit_generic_array_interfaces): Extract common
2546         code to a helper function making it a lot easier on the eyes.
2547
2548 2008-12-26 Rodrigo Kumpera  <rkumpera@novell.com>
2549
2550         * class.c (get_implicit_generic_array_interfaces): If the internal
2551         enumerator is an interface inflate System.Object instead of itself.
2552
2553         Fixes #461261.
2554
2555 2008-12-24 Rodrigo Kumpera  <rkumpera@novell.com>
2556
2557         * object.c (mono_runtime_invoke_array): Don't assert with
2558         byref nullable types.
2559
2560         * marshal.c (mono_marshal_get_runtime_invoke): To handle
2561         byref nullables we unbox the object and store it on the
2562         stack. 
2563         We can't use the boxed object since it is the T of Nullable<T>
2564         and the boxed representation of a nullable it's underlying type
2565         or null.
2566         We could cheat and create a boxed nullable and use the same
2567         machinery of other byref VTs but this feels like a hack and
2568         using the stack has the bonus of reducing heap pressure.
2569
2570         Fixes #461941.
2571
2572 2008-12-23 Rodrigo Kumpera  <rkumpera@novell.com>
2573
2574         * marshal.c (mono_marshal_emit_managed_wrapper): Handle char
2575         return value.
2576
2577         Fixes #461867.
2578
2579 2008-12-19  Bill Holmes  <billholmes54@gmail.com>
2580
2581         * icall-def.h : Adding an internal call definition for 
2582           System.Environment.internalBroadcastSettingChange.
2583
2584         * icall.c : Adding a Windows only implementation to broadcast a 
2585           WM_SETTINGCHANGE when an environment variable has changed.
2586
2587         Code is contributed under MIT/X11 license.
2588
2589 2008-12-19  Mark Probst  <mark.probst@gmail.com>
2590
2591         * class.c, class-internals.h: Made
2592         mono_class_has_parent_and_ignore_generics() non-static.
2593
2594 Thu Dec 18 16:35:22 CET 2008 Paolo Molaro <lupus@ximian.com>
2595
2596         * image.c: deal with the mmap failing when loading an image.
2597
2598 2008-12-17  Geoff Norton  <gnorton@novell.com>
2599
2600         * threadpool.c: Ensure that the io_queue_lock is initialized
2601         in all circumstances, as we always attempt to cleanup against it.
2602
2603 2008-12-17  Miguel de Icaza  <miguel@novell.com>
2604
2605         * icall.c (ves_icall_System_Environment_get_Platform): For
2606         compatibility reasons for existing client code we will keep
2607         returning 4 for a while.   
2608
2609         For how long will depend on the documentation being updated, and
2610         for us to give client code a chance to be updated.
2611
2612         This reverts the original decison on #433108 since we did not
2613         catch roughly 33 instances of the broken code in our own source
2614         code base, we did not catch failures on the buildbots, and QA did
2615         not bring this as a problem.
2616
2617         Only today I found some customer's code breaking due to our own
2618         class libraries not being fully updated and tracked it down to
2619         this change.  I am reverting it because if we could not even get
2620         our story straight in our own code base, how can we hope that our
2621         end user code be fixed?
2622
2623         As of this morning, our Wiki page that documents how to detect
2624         Unix had not been fixed.    
2625
2626 2008-12-16  Zoltan Varga  <vargaz@gmail.com>
2627
2628         * metadata.c (inflated_method_in_image): Add a workaround for #458168.
2629
2630         * class.c (mono_class_get_fields): Handle loading errors.
2631
2632 2008-12-12 Mark Mason <mmason@upwardaccess.com>
2633
2634         * 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.
2635         
2636 2008-12-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
2637
2638         * mono-perfcounters.c: avoid warning.
2639
2640 2008-12-12 Rodrigo Kumpera  <rkumpera@novell.com>
2641
2642         * reflection.c (ensure_runtime_vtable): Work on generic instances and
2643         make sure all interfaces have MonoClass::interface_id set.
2644
2645         * reflection.c (ensure_generic_class_runtime_vtable): Ensure the
2646         method table is property set.
2647
2648 2008-12-12 Rodrigo Kumpera  <rkumpera@novell.com>
2649
2650         * class.c: New function mono_class_setup_interface_id that setup
2651         MonoClass::interface_id if needed.
2652
2653         * class-internals.h: Export new function.
2654
2655 2008-12-12 Rodrigo Kumpera  <rkumpera@novell.com>
2656
2657         * class.c: Add code to sanity check the vtable after setup_vtable_general
2658         has done it's work.
2659
2660 2008-12-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
2661
2662         * icall.c: make Assembly.GetExecutingAssembly work properly when
2663         reflection is used to invoke the method.
2664         Bug #321781 fixed.
2665
2666 2008-12-11  Mark Probst  <mark.probst@gmail.com>
2667
2668         * metadata/generic-sharing.c: Look for constraints in all type
2669         arguments, not just the first one.
2670
2671 2008-12-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
2672
2673         * appdomain.c: return the correct CodeBase for an Assembly instance
2674         that was loaded from the shadow-copy directories.
2675         Bug #458190 fixed.
2676
2677 2008-12-10  Zoltan Varga  <vargaz@gmail.com>
2678
2679         * sgen-gc.c (build_nursery_fragments): Clear nursery_next/nursery_frag_real_end.
2680
2681         * sgen-gc.c (check_object): New debugging helper function.
2682
2683         * object.c: Fix calls to mono_value_copy_array ().
2684
2685 2008-12-10 Rodrigo Kumpera  <rkumpera@novell.com>
2686
2687         * class.c (mono_class_setup_fields): If working on an inflated class
2688         first check if the generic definition did init with success.
2689
2690         Fixes #445361.
2691
2692 2008-12-10 Rodrigo Kumpera  <rkumpera@novell.com>
2693
2694         pedump.c (main): Fix a warning.
2695
2696 2008-12-10  Bill Holmes  <billholmes54@gmail.com>
2697
2698         * object-internals.h : Adding a definition for 
2699           MonoReflectionComVisibleAttribute.
2700
2701         * marshal.c (cominterop_com_visible) :  Method added to check the 
2702           ComVisible attribute of a class.
2703
2704         * marshal.c (cominterop_raise_hr_exception, cominterop_get_interface) :  
2705           cominterop_raise_hr_exception added to consolidate common code 
2706           to raise hr exceptions.
2707
2708         * marshal.c (cominterop_can_support_dispatch) :  Method added to determine 
2709           if a managed class should support IDispatch.
2710
2711         * marshal.c 
2712           (cominterop_get_idispatch_for_objec, cominterop_ccw_queryinterfacet) :  
2713           Added additional checks for managed object when getting 
2714           an IDispatch interface.
2715
2716         Code is contributed under MIT/X11 license.
2717
2718 2008-12-10 Rodrigo Kumpera  <rkumpera@novell.com>
2719
2720         pedump.c (main): Handle mono_get_method () returning NULL. 
2721
2722 2008-12-09  Zoltan Varga  <vargaz@gmail.com>
2723
2724         * marshal.h: Fix a warning.
2725
2726 2008-12-09  Bill Holmes  <billholmes54@gmail.com>
2727
2728         * marshal.c : Adding cominterop_release_all_rcws to release all
2729           runtime callable wrappers held by the runtime.
2730
2731         * marshal.h : Adding declaration for cominterop_release_all_rcws.
2732           
2733         Code is contributed under MIT/X11 license.
2734
2735 2008-12-09  Zoltan Varga  <vargaz@gmail.com>
2736
2737         * metadata.c (mono_image_alloc_lock): New helper function.
2738         (mono_image_alloc0_lock): Ditto.
2739
2740         * metadata.c: Use the alloc_lock () helper functions for allocating
2741         memory from the image mempool.
2742
2743 2008-12-08 Rodrigo Kumpera  <rkumpera@novell.com>
2744
2745         * class.c (mono_class_from_generic_parameter): Document it's
2746         locking behavior. Fix double checked locking here, we stored in
2747         param->pklass a partially initialized MonoClass and no membar was used.
2748
2749 2008-12-05  Marek Habersack  <mhabersack@novell.com>
2750
2751         * sysmath.c (ves_icall_System_Math_Round2): if round (3) and rint
2752         (3) functions are present in the C library use them to do the
2753         job. If they are absent, make sure that the sum of int_part and
2754         dec_part is rounded before returning. This is necessary due to the
2755         division of dec_part by the power of 10 before the final addition
2756         is performed - if the result is not rounded in some cases it will
2757         yield invalid results.
2758
2759 2008-12-04  Zoltan Varga  <vargaz@gmail.com>
2760
2761         * marshal.c (mono_marshal_emit_native_wrapper): Add AOT support for pinvoke
2762         wrappers by emitting the function address using a CEE_MONO_ICALL_ADDR 
2763         instruction instead of a pointer constant.
2764
2765 2008-12-03  Zoltan Varga  <vargaz@gmail.com>
2766
2767         * loader.c (mono_method_get_header): Do most of the work outside the
2768         loader lock, to avoid assembly load hook deadlocks.
2769
2770         * metadata.c (mono_metadata_parse_mh_full): Use finer-grained locking.
2771         (mono_metadata_parse_type_full): Ditto.
2772
2773 2008-12-02 Rodrigo Kumpera  <rkumpera@novell.com>
2774
2775         * mempool.c (mono_backtrace): Take the number of allocated bytes as argument.
2776         Make the stack depth fixed. Ensure proper argument passing to the backtrace
2777         funtions. Finally, use a lock to produce well ordered output.
2778
2779         The lock looks silly, as all calls to the corlib mempool should be guarded
2780         with the loader lock, but for some reason this fact doesn't help. 
2781
2782         * mempool.c (mono_mempool_alloc0): Add support for TRACE_ALLOCATIONS.
2783
2784 2008-12-02  Mark Probst  <mark.probst@gmail.com>
2785
2786         * socket-io.c: 64 bit big-endian fixes.
2787
2788 2008-12-01 Rodrigo Kumpera  <rkumpera@novell.com>
2789
2790         * verify.c (is_compatible_boxed_valuetype): Rewrite function to work properly with
2791         targets that require strict compatibility between the types.
2792
2793         * verify.c (verify_stack_type_compatibility_full): Boxed values are not compatible
2794         to unboxed types. All cases that this is true are checked by is_compatible_boxed_valuetype.
2795         Kill the strict argument and create a new one valuetype_must_be_boxed.
2796
2797         * verify.c (verify_delegate_compatibility): Use verify_stack_type_compatibility_full to
2798         state that all valuetypes must be boxed.
2799
2800         Fixes #448560.
2801
2802 2008-11-29  Kornél Pál  <kornelpal@gmail.com>
2803
2804         * coree.c (MonoFixupExe): Use sizeof(IMAGE_BASE_RELOCATION) instead of
2805         IMAGE_SIZEOF_BASE_RELOCATION as newer Vista SDKs no longer define the latter.
2806
2807         Contributed under MIT/X11 license.
2808
2809 2008-11-28 Rodrigo Kumpera  <rkumpera@novell.com>
2810
2811         * class.c (mono_class_setup_fields): Don't copy MonoType::attrs as
2812         the inflate_generic_type machinery should handle it.
2813
2814         This avoids a crash when the field's flags is zero and it's type is
2815         a primitive.
2816         What happens is that mono_metadata_parse_type_full will see that opt_attrs
2817         is zero and will return one of the cached built-in primitive types. Since
2818         those types live in read-only memory, the code that copies it crashes.  
2819
2820 2008-11-28  Mark Probst  <mark.probst@gmail.com>
2821
2822         * object.c: Don't put function descriptors into generalized IMT
2823         thunks.
2824
2825 2008-11-28  Mark Probst  <mark.probst@gmail.com>
2826
2827         * class.c: Enable generic code sharing on PPC64.
2828
2829 2008-11-27  Mark Probst  <mark.probst@gmail.com>
2830
2831         * mempool.c, mempool-internals.h: Added g_slist_append_mempool()
2832         from mini/mini.c.
2833
2834         * generic-sharing.c: Allocate the method template slists from the
2835         image mempool so it doesn't leak.
2836
2837 2008-11-27 Rodrigo Kumpera  <rkumpera@novell.com>
2838
2839         * class.c (generic_array_methods): Release the linked list.
2840
2841 2008-11-27  Mark Probst  <mark.probst@gmail.com>
2842
2843         * marshal.c (mono_string_builder_to_utf8): Fixed a wrong
2844         invocation to g_utf16_to_utf8().
2845
2846 2008-11-26  Mark Probst  <mark.probst@gmail.com>
2847
2848         * icall.c (mono_ArgIterator_IntGetNextArg): Handle sub-word sized
2849         arguments on big endian archs.
2850
2851 2008-11-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
2852
2853         * reflection.c: (_mono_reflection_parse_type) skip leading spaces in
2854         the type name (test added in corlib).
2855
2856 2008-11-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
2857
2858         * pedump.c: initialize perf. counters. Fixes a segv.
2859
2860 2008-11-25  Martin Baulig  <martin@ximian.com>
2861
2862         * mono-debug-debugger.c
2863         (mono_debugger_runtime_invoke): Return the exception object if an
2864         exception was thrown.  Visual Studio displays the exception object
2865         in the locals window.
2866
2867 2008-11-24  Mark Probst  <mark.probst@gmail.com>
2868
2869         * mini-trampolines.c (mono_delegate_trampoline): Don't return a
2870         ftnptr.
2871
2872 2008-11-24  Mark Probst  <mark.probst@gmail.com>
2873
2874         * marshal.c (mono_type_native_stack_size): MONO_TYPE_I and
2875         MONO_TYPE_U are sizeof (gpointer), too.
2876
2877 2008-11-24  Mark Probst  <mark.probst@gmail.com>
2878
2879         * marshal.c (mono_type_native_stack_size): Fixed size and
2880         alignment for reference types.
2881
2882 2008-11-23  Mark Probst  <mark.probst@gmail.com>
2883
2884         * class.c (mono_class_generic_sharing_enabled): Disable generic
2885         code sharing for PPC64.
2886
2887 2008-11-21 Rodrigo Kumpera  <rkumpera@novell.com>
2888
2889         * icall.c (mono_method_get_equivalent_method): Make sure
2890         method->klass->methods is inited before looping over it.
2891
2892 2008-11-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
2893
2894         * object.c: when calling ExecuteAssembly in a newly created domain,
2895         the configuration file and application base are already set up.
2896         Bug #446353 take 2 fixed.
2897
2898 2008-11-20  Zoltan Varga  <vargaz@gmail.com>
2899
2900         * marshal.c: Add support for MONO_TYPE_GENERICINST to some functions.
2901         Fixes #444715. Fix a warning.
2902
2903 2008-11-18 Gonzalo Paniagua Javier <gonzalo@novell.com>
2904
2905         * appdomain.c: write the full path of the assembly to the .ini file
2906         created when "shadow-copying"
2907         Bug #446353 fixed.
2908
2909 2008-11-18  Zoltan Varga  <vargaz@gmail.com>
2910
2911         * debug-helpers.c (mono_method_full_name): Stringify wrapper types even
2912         if signature==FALSE.
2913
2914 2008-11-17  Bill Holmes  <billholmes54@gmail.com>
2915
2916         * marshal.h : Fix the cygwin build.
2917            marshal.c:12442: undefined reference to `_IID_IMarshal'
2918           
2919         Code is contributed under MIT/X11 license.
2920
2921 2008-11-17  Bill Holmes  <billholmes54@gmail.com>
2922
2923         * marshal.h : cominterop_ccw_getfreethreadedmarshaler added to return the
2924           free threaded marshaler when QueryInterface is called on a COM callable
2925           wrapper requesting the IMarshal interface.
2926           
2927         Code is contributed under MIT/X11 license.
2928
2929 2008-11-14  Zoltan Varga  <vargaz@gmail.com>
2930
2931         * domain-internals.h (MonoDomain): Update MONO_DOMAIN_LAST_GC_TRACKED.
2932
2933         * reflection.c (mono_type_get_object): Special case the very common
2934         void type.
2935
2936         * domain-internals.h (struct _MonoDomain): Add 'typeof_void' field to
2937         hold typeof(void).
2938
2939 2008-11-13  Bill Holmes  <billholmes54@gmail.com>
2940
2941         * process.h : Adding method declaration for
2942           ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
2943           
2944         * process.c : Adding implementation for
2945           ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
2946           
2947         * icall-def.h : Registering ICALL Processs.WaitForInputIdle_internal
2948           to ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
2949
2950         Code is contributed under MIT/X11 license.
2951
2952 2008-11-10  Rodrigo Kumpera  <rkumpera@novell.com>
2953
2954         * appdomain.c (unload_thread_main): Clean up threadpool by
2955         calling mono_thread_pool_remove_domain_jobs.
2956
2957         * domain-internals.h (struct _MonoDomain): Add new fields to
2958         help coordinate the cleanup of the threadpool.
2959
2960         * threadpool.c (mono_thread_pool_remove_domain_jobs): New fuction
2961         that cleans up the threadpool of all jobs associated with an appdomain.
2962         It does that by cleaning up the queues and making sure all active
2963         threads are accounted.
2964
2965         * threadpool.c (async_invoke_io_thread): Ignore job if its domain is
2966         unloaded or in the process of. Take this is such way that there is
2967         no race condition between another thread starting the unload and the
2968         current thread acknowledging it.
2969
2970         * threadpool.c (async_invoke_thread): Same.
2971
2972         * threadpool.c (start_io_thread_or_queue): Increment threadpool_jobs before
2973         firing the new thread.
2974
2975         * threadpool.c (start_tpthread): Same.
2976
2977         * theadpool.c (append_job): Increment threadpool_jobs before queueing.
2978
2979         * threadpool.h: Add mono_thread_pool_remove_domain_jobs.
2980
2981 2008-11-06  Jonathan Chambers  <joncham@gmail.com>
2982
2983         * file-io.c (ves_icall_System_IO_MonoIO_DuplicateHandle): 
2984         Add support for DuplicateHandle.
2985         
2986         * file-io.h (ves_icall_System_IO_MonoIO_DuplicateHandle): 
2987         Add support for DuplicateHandle.
2988         
2989         * icall-def.h (ves_icall_System_IO_MonoIO_DuplicateHandle): 
2990         Add support for DuplicateHandle.
2991
2992         Code is contributed under MIT/X11 license.
2993
2994 2008-11-06  Mark Probst  <mark.probst@gmail.com>
2995
2996         * class-internals.h: Make min_align into a whole byte.
2997
2998         * class.c: Set min_align for SIMD types to 16.
2999
3000 2008-11-05  Geoff Norton  <gnorton@novell.com>
3001
3002         * attach.c: Default the attacher to enabled for all cases including
3003         embedded.
3004
3005 Wed Nov 5 16:33:41 CET 2008 Paolo Molaro <lupus@ximian.com>
3006
3007         * monitor.c, class-internals.h, wrapper-types.h: revert incorrect
3008         change r117650.
3009
3010 2008-11-04  Mark Probst  <mark.probst@gmail.com>
3011
3012         * monitor.c, monitor.h: New function for querying offsets of
3013         members of MonoThreadsSync.
3014
3015 2008-11-04  Zoltan Varga  <vargaz@gmail.com>
3016
3017         * marshal.c (mono_marshal_get_runtime_invoke): Use runtime_invoke_direct_cache
3018         to speed up this function and to avoid the boundless memory growth caused by
3019         the signature_dup () calls.
3020
3021 2008-11-02  Zoltan Varga  <vargaz@gmail.com>
3022
3023         * monitor.c (mono_monitor_get_fast_enter_method): Add a proper type for the
3024         wrapper.
3025
3026         * class-internals.h (struct _MonoMethod): Increase the size of 'wrapper_type'
3027         by 1 bit.
3028
3029         * wrapper-types.h: Add MONO_WRAPPER_MONITOR_FAST_ENTER/EXIT.
3030
3031 2008-10-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
3032
3033         * appdomain.c:
3034         * domain-internals.h: made mono_set_private_bin_path_from_config()
3035         "internal".
3036         * object.c: call the above function after setting the configuration
3037         file path for the root domain.
3038         Fixes bug #314478.
3039
3040 2008-10-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
3041
3042         * assembly.c: when the assembly is loaded from an absolute path, end
3043         basedir with a directory separator.
3044         Bug #440781 fixed.
3045
3046 2008-10-30  Mark Probst  <mark.probst@gmail.com>
3047
3048         * monitor.c (mono_monitor_get_fast_enter_method): If
3049         CompareExchange is not available, don't create the fastpath
3050         instead of asserting.  (The method is missing in the 1.1 profile.)
3051
3052 2008-10-30  Mark Probst  <mark.probst@gmail.com>
3053
3054         * marshal.c, marshal.h: Rename signature_no_pinvoke() and make it non-static.
3055
3056         * monitor.c, monitor.h: Code for generating Monitor.Enter and
3057         Monitor.Exit IL fastpaths.
3058
3059 2008-10-28  Rodrigo Kumpera  <rkumpera@novell.com>
3060
3061         * class.c (mono_class_create_from_typedef): Added Vector2ul.
3062
3063 2008-10-28  Rodrigo Kumpera  <rkumpera@novell.com>
3064
3065         * class.c (mono_class_create_from_typedef): Added Vector2l.
3066
3067 2008-10-27  Rodrigo Kumpera  <rkumpera@novell.com>
3068
3069         * class.c (mono_class_create_from_typedef): Added Vector2d.
3070
3071 2008-10-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
3072
3073         * appdomain.c: translate \ into / for cache_path.
3074         * domain-internals.h: new mono_is_shadow_copy_enabled().
3075         * icall.c: (fill_reflection_assembly_name) do the same path
3076         manipulations that get_code_base does.
3077         (get_code_base) use mono_is_shadow_copy_enabled.
3078
3079 2008-10-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
3080
3081         * appdomain.c: shadow-copied assemblies go to CachePath +
3082         ApplicationName when both are set. DynamicBase has nothing to do with
3083         shadow copies.
3084         Bug #406877 fixed.
3085
3086 2008-10-26  Zoltan Varga  <vargaz@gmail.com>
3087
3088         * reflection.c (encode_locals): Use a cache to avoid duplicate entries in the
3089         STANDALONESIG table.
3090
3091         * metadata-internals.h (struct _MonoDynamicImage): Add cache for
3092         standalone signatures.
3093
3094         * marshal.c (mono_marshal_get_runtime_invoke): Rewrite the signature 
3095         comparison code: instead of comparing the signatures using a custom
3096         equals function, transform them to a common signature and compare that. This
3097         works better with AOT.
3098
3099 2008-10-25  Zoltan Varga  <vargaz@gmail.com>
3100
3101         * Reapply r116521 with (!mono_debug_using_mono_debugger ()) checks.
3102
3103         * class.c (mono_class_init): Remove unneccesary mono_class_setup_properties ()
3104         call for generic instances.
3105         (mono_class_setup_properties): Call setup_properties () before accessing
3106         gklass->properties.
3107
3108         * class.c (mono_class_get_virtual_methods): New helper function to iterate
3109         over the virtual methods of a class using metadata if possible, avoiding the
3110         creation of MonoMethod's for non-virtual methods.
3111         
3112         * class.c (mono_class_setup_vtable_general): Rewrite this to use 
3113         get_virtual_methods () to iterate over the virtual methods of classes.
3114
3115 2008-10-25  Martin Baulig  <martin@ximian.com>
3116
3117         * mono-debug.h (MONO_DEBUG_VAR_ADDRESS_MODE_DEAD): New #define.
3118
3119 2008-10-24  Rodrigo Kumpera  <rkumpera@novell.com>
3120
3121         * class.c (mono_class_create_from_typedef): Added Vector4i.
3122
3123 2008-10-24  Mark Probst  <mark.probst@gmail.com>
3124
3125         * marshal.c (mono_marshal_get_synchronized_wrapper): Emit
3126         ldtoken+GetTypeFromHandle instead of i4+icall so that the JIT
3127         special-casing applies to eliminate the call completely.
3128
3129 2008-10-24  Rodrigo Kumpera  <rkumpera@novell.com>
3130
3131         * class.c (mono_class_create_from_typedef): Added Vector8s.
3132
3133 2008-10-23  Rodrigo Kumpera  <rkumpera@novell.com>
3134
3135         * class.c (mono_class_create_from_typedef): Added Vector16sb.
3136
3137 2008-10-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
3138
3139         * icall.c: get rid of annoying warning.
3140
3141 2008-10-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
3142
3143         * threadpool.c: in 1.x, if you change the background status of the
3144         threadpool thread, it's not reset.
3145         Remove unnecessary calls to SetState.
3146
3147 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
3148
3149         * threadpool.c: asynchronously create a set of idle threads upon first
3150         use of the threadpool. SetMinThreads will now start the appropriate
3151         number of idle threads if they are not already running. The default is
3152         1 threadpool thread per CPU. Increased the maximum number of threads
3153         per CPU to 10.
3154
3155 2008-10-22  Martin Baulig  <martin@ximian.com>
3156
3157         Revert r116521 from Zoltan, it breaks the debugger:
3158
3159         * class.c (mono_class_get_virtual_methods): New helper function to iterate
3160         over the virtual methods of a class using metadata if possible, avoiding the
3161         creation of MonoMethod's for non-virtual methods.
3162         
3163         * class.c (mono_class_setup_vtable_general): Rewrite this to use 
3164         get_virtual_methods () to iterate over the virtual methods of classes.
3165
3166 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
3167
3168         * threads.c: when creating a threadpool thread, set its state to
3169         'background'.
3170         * threadpool.c: reset the background state of a threadpool thread
3171         after finishing each work item
3172         Bug #437888 fixed.
3173
3174 2008-10-22  Zoltan Varga  <vargaz@gmail.com>
3175
3176         * class.c (mono_class_get_vtable_entry): Add an optimization for szarrays.
3177         
3178         * class.c (mono_class_setup_vtable_general): Add an optimized version for
3179         generic instances which works by inflating the methods in the container
3180         class's vtable.
3181
3182         * class.c (mono_class_inflate_generic_type_with_mempool_no_copy): New
3183         variant which doesn't make a copy if no inflation was done.
3184         (mono_class_setup_fields): Use it.
3185
3186         * metadata.c (mono_metadata_get_shared_type): New helper function to
3187         return a shared instance of a given MonoType.
3188
3189         * class.c (mono_class_inflate_generic_type_with_mempool): Avoid making
3190         a copy of most non-generic types.
3191
3192 Wed Oct 22 18:00:46 CEST 2008 Paolo Molaro <lupus@ximian.com>
3193
3194         * threadpool.c: remove one more GetSystemInfo () call.
3195
3196 Wed Oct 22 17:45:48 CEST 2008 Paolo Molaro <lupus@ximian.com>
3197
3198         * mono-perfcounters.c, icall-def.h, environment.c, environment.h:
3199         use the code in mono-proclib.h to get processor information.
3200
3201 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
3202
3203         * appdomain.c: fixed the logic that determines whether assemblies in a
3204         directory are "shadow-copied" or not. Bug #433483 fixed.
3205
3206 2008-10-22  Zoltan Varga  <vargaz@gmail.com>
3207
3208         * process.c (ves_icall_System_Diagnostics_Process_GetProcessData): Fix a
3209         warning.
3210
3211 2008-10-21  Zoltan Varga  <vargaz@gmail.com>
3212
3213         * marshal.c (runtime_invoke_signature_equal): Don't shared wrappers
3214         returning a vtype.
3215
3216         * class.c debug-helpers.c object.c class-internals.h marshal.c icall.c
3217         reflection.c: Use mono_field_get_name () for accessing a field's name.
3218
3219         * class-internals.h (MONO_CLASS_HAS_STATIC_METADATA): Move this here from
3220         class.c
3221
3222         * class.c (mono_field_get_rva): Fix crash if this is called on a dynamic
3223         field.
3224
3225         * loader.c (find_method_in_class): Reenable the metadata optimization by
3226         not using it for generic instances.
3227
3228         * class-internals.h (MonoFieldDefaultValue): Extract the rarely used 
3229         data/def_type fields from MonoClassField into a separate structure.
3230         (struct MonoClassField): Remove data/def_type fields.
3231         (struct _MonoClass): Add a 'field_def_values' array to store the default
3232         values/RVA for fields.
3233
3234         * class.c reflection.c: Update after the changes.
3235         
3236         * object.c (mono_class_create_runtime_vtable): Use mono_field_get_data ()
3237         for accessing field->data.
3238
3239         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_InitializeArray): Ditto.
3240
3241         * loader.c (find_method_in_class): Revert the last change for now as
3242         it breaks Mono.C5 unit tests.
3243
3244         * class-internals.h (struct _MonoDynamicGenericClass): Add fields
3245         'field_generic_types' and 'field_objects' which contain the information
3246         previously stored in MonoInflatedField.
3247         (MonoInflatedField): Delete.
3248         (struct _MonoClassField): Delete 'generic_info' field.
3249
3250         * reflection.c: Store the information which was previously in 
3251         field->generic_info in MonoDynamicGenericClass instead.
3252
3253         * metadata.c (free_generic_class): Update after MonoDynamicGenericClass/
3254         MonoClassField changes.
3255
3256 Tue Oct 21 17:07:55 CEST 2008 Paolo Molaro <lupus@ximian.com>
3257
3258         * marshal.c, method-builder.c: get rid of wrapper_hash and instead
3259         store the value inside the data array of the MonoMethodWrapper.
3260         This saves memory, is faster and fixes the lifetime issues (methods
3261         were never removed from the hash previously). May also fix bug#436996.
3262
3263 2008-10-21  Zoltan Varga  <vargaz@gmail.com>
3264
3265         * reflection.c (mono_image_get_fieldref_token): For fields of non-dynamic 
3266         generic instances, compute the type from the generic definition instead of
3267         looking in field->generic_info.
3268
3269         * class.c (mono_class_setup_fields): Don't create a MonoInflatedField
3270         for inflated fields, the only user was get_fieldref_token () which no
3271         longer needs it.
3272
3273         * class.c (mono_class_init): Revert the last change as it seems to cause
3274         crashes.
3275
3276         * class-internals.h (struct _MonoClassField): Reorder fields to save 4
3277         bytes on 64 bit platforms.
3278
3279         * object.c (mono_class_create_runtime_vtable): Fix a warning.
3280         
3281         * object.c (mono_class_create_runtime_vtable): Don't initalize
3282         field->data/field->def_type here, it is done lazily by 
3283         mono_class_get_field_default_value ().
3284
3285         * icall.c (ves_icall_get_enum_info): Call 
3286         mono_class_get_field_default_value () instead of directly accessing
3287         field->data and field->def_type.
3288
3289         * object.c (get_default_field_value): Ditto.
3290
3291         * class.c (mono_field_get_data): Ditto.
3292         
3293         * class.c (mono_class_init): Remove unneccesary mono_class_setup_methods ()
3294         call for generic instances.
3295
3296         * loader.c (find_method_in_class): If klass != from_class, then inflate
3297         the method with the context of from_class, since the caller assumes this.
3298
3299 2008-10-20  Zoltan Varga  <vargaz@gmail.com>
3300
3301         * class.c (mono_method_get_vtable_index): Use mono_method_get_vtable_slot ()
3302         for accessing method->slot.
3303
3304 2008-10-20  Cedric Vivier  <cedricv@neonux.com>
3305
3306         * icall-def.h, icall.c: Add icall for Debugger.IsAttached.
3307
3308 2008-10-19  Zoltan Varga  <vargaz@gmail.com>
3309
3310         * class.c (mono_method_get_vtable_index): Use
3311         mono_method_get_vtable_slot () for accessing method->slot.
3312
3313         * object.c (build_imt_slots): Use mono_class_get_method_by_index () for
3314         accessing klass->methods.
3315
3316         * class.c (mono_method_get_vtable_slot): New helper function.
3317         (mono_class_get_vtable_entry): Ditto.
3318         (mono_class_setup_vtable_general): Use mono_method_get_vtable_slot () for
3319         accessing method->slot.
3320
3321         * generic-sharing.c (mono_class_get_method_generic): Pass the declaring
3322         method to get_inflated_method ().
3323
3324         * class.c (mono_class_get_inflated_method): New helper method to obtain
3325         a method of an inflated class without calling setup_methods ().
3326         (mono_class_get_cctor): Use get_inflated_method.
3327
3328         * generic-sharing.c (mono_class_get_method_generic): Ditto.
3329         
3330         * marshal.c image.c: Lazily create all the marshal caches.
3331
3332         * image.c (mono_image_init): Move initialization of runtime_invoke
3333         caches to marshal.c.
3334
3335         * marshal.c (get_cache): New helper function to lazily initialize a 
3336         wrapper cache.
3337         (mono_marshal_get_runtime_invoke): Share more runtime invoke wrappers.
3338
3339         * debug-helpers.c (mono_method_full_name): Include generic arguments.
3340
3341 Fri Oct 17 10:51:32 CEST 2008 Paolo Molaro <lupus@ximian.com>
3342
3343         * loader.c: fixed check for interface type.
3344
3345 Thu Oct 16 20:59:11 CEST 2008 Paolo Molaro <lupus@ximian.com>
3346
3347         * appdomain.c: check for NULL setup before it's referenced.
3348
3349 p
3350 Thu Oct 16 16:12:23 CEST 2008 Paolo Molaro <lupus@ximian.com>
3351
3352         * class.c: remove the unused old vtable setup code.
3353
3354 Thu Oct 16 12:53:29 CEST 2008 Paolo Molaro <lupus@ximian.com>
3355
3356         * class.c: don't depend on interface order in
3357         setup_interface_offsets (bug #435777).
3358         * reflection.c: sort the InterfaceImpl table (patch from
3359         Jb Evain  <jbevain@novell.com>).
3360
3361 2008-10-13  Zoltan Varga  <vargaz@gmail.com>
3362
3363         * assembly.c (mono_assembly_open_full): Avoid loading images while holding
3364         the low level assemblies lock.
3365
3366 Mon Oct 13 16:35:26 CEST 2008 Paolo Molaro <lupus@ximian.com>
3367
3368         * domain-internals.h, domain.c, icall.c, image.c, marshal.c,
3369         object.c, reflection.c, socket-io.c, threads.c: introduced
3370         mono_framework_version () to return the major framewrok version,
3371         changed the code that was using more complex patterns to use it.
3372         Return the correct value for PlatformID for OSX.
3373
3374 Mon Oct 13 14:38:01 CEST 2008 Paolo Molaro <lupus@ximian.com>
3375
3376         * icall-def.h, process.h, process.c: added an icall to get info about
3377         processes using mono-proclib.
3378
3379 Mon Oct 13 11:14:44 CEST 2008 Paolo Molaro <lupus@ximian.com>
3380
3381         * mono-perfcounters.c: use the mono-proclib functions to
3382         access process information.
3383
3384 Mon Oct 13 11:00:49 CEST 2008 Paolo Molaro <lupus@ximian.com>
3385
3386         * domain.c, assembly.c, debug-mono-symfile.c, debug-mono-symfile.h,
3387         monosn.c, Makefile.am, pedump.c, image.c, metadata-internals.h,
3388         reflection.c: remove rawbuffer usage: mmap support is more sanely
3389         provided by utils/mono-mmap.
3390
3391 Sat Oct 11 19:46:19 CEST 2008 Paolo Molaro <lupus@ximian.com>
3392
3393         * gc.c: use posix semaphores when possible so that
3394         mono_gc_finalize_notify() is signal safe.
3395
3396 2008-10-11  Zoltan Varga  <vargaz@gmail.com>
3397
3398         * reflection.c: Implement DISABLE_REFLECTION_EMIT, remove some
3399         #ifdef DISABLE_REFLECTION_SAVE stuff, only the exported functions need to
3400         be #ifdef-ed out, the linker will remove the rest.
3401
3402         * marshal.c: Implement DISABLE_COM.
3403
3404         * reflection.c: Implement DISABLE_REFLECTION_EMIT_SAVE.
3405
3406 2008-10-11  Miguel de Icaza  <miguel@novell.com>
3407
3408         * locales.c (string_invariant_compare_char): Optimization: do not
3409         call g_unichar_type unless we actually need the information.
3410
3411 2008-10-10  Mark Probst  <mark.probst@gmail.com>
3412
3413         * object.c, class-internals.h: Also create remoting trampolines
3414         for generic methods.  Pass the domain to the remoting trampoline
3415         creation function, too.
3416
3417 2008-10-10  Zoltan Varga  <vargaz@gmail.com>
3418
3419         * class.c (mono_class_init): Fix+re-enable the finalize optimization.
3420
3421 2008-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
3422
3423         * class.c (mono_class_create_from_typedef): Vector4u was renamed to
3424         Vector4ui.
3425
3426 2008-10-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
3427
3428         * assembly.c:
3429         * locales.c: remove the use of g_strdown. Fixes bug #322313.
3430
3431 Fri Oct 10 17:01:42 CEST 2008 Paolo Molaro <lupus@ximian.com>
3432
3433         * assembly.c: in mono_assembly_load_friends() take the assemblies lock
3434         for the least possible amount of time (extending the fix in r113458).
3435
3436 2008-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
3437
3438         * class.c (mono_class_create_from_typedef): Retrofit to new type names.
3439
3440 2008-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
3441
3442         * class.c (mono_class_create_from_typedef): Added Vector8u and Vector16u
3443         as possible simd intrinsic types.
3444         Optimized the test to check for the common prefix first.
3445
3446 Thu Oct 9 17:38:24 CEST 2008 Paolo Molaro <lupus@ximian.com>
3447
3448         * class.c: back out part of a broken optimization committed on
3449         May 23th (bug #433908).
3450
3451 2008-10-09  Mark Probst  <mark.probst@gmail.com>
3452
3453         * profiler.c (simple_shutdown): Don't call mono_thread_attach() on
3454         Win32.  Should fix #432388 for most cases until we have the new
3455         profiler on Win32.
3456
3457 2008-10-08  Zoltan Varga  <vargaz@gmail.com>
3458
3459         * metadata.c (mono_metadata_generic_context_hash): Call generic_inst_hash
3460         instead of using inst->id so the hash is stable for AOT.
3461
3462 2008-10-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
3463
3464         * appdomain.c:
3465         * icall.c: create a .ini file for shadow-copied assemblies that
3466         contains the location of the original assembly. Use this to return the
3467         proper CodeBase for shadow-copied assemblies. Fixes bug #323606.
3468         Also fix the number of '/' for windows when returning the CodeBase.
3469         Fixes bug #430920.
3470
3471 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
3472
3473         * marshal.c (cominterop_get_ccw) : Fixing a copy paste error from r115126.
3474
3475         Code is contributed under MIT/X11 license.
3476
3477 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
3478
3479         * marshal.c (cominterop_get_native_wrapper) : Adding a call to mono_class_setup_vtable
3480           if if the class vtable needs initialized.
3481
3482         Code is contributed under MIT/X11 license.
3483
3484 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
3485
3486         * marshal.c (cominterop_get_native_wrapper_adjusted, cominterop_get_ccw) : 
3487           Adding default MonoMarshalSpecs for COM methods.  OBJECT->STRUCT,
3488           STRING->BSTR, and CLASS->INTERFACE.
3489
3490         Code is contributed under MIT/X11 license.
3491
3492 2008-10-07  Marek Habersack  <mhabersack@novell.com>
3493
3494         * sysmath.h: changed the declaration of the
3495         ves_icall_System_Math_Round2 icall by adding an extra
3496         away_from_zero parameter.
3497
3498         * sysmath.c (ves_icall_System_Math_Round2): added support for
3499         away from zero rounding. The icall now takes an extra boolean
3500         parameter to signal that away from zero operation is requested.
3501
3502 2008-10-06  Zoltan Varga  <vargaz@gmail.com>
3503
3504         * marshal.c (mono_marshal_get_delegate_begin_invoke): Put the wrapper in
3505         the delegate klass so it can work with full-aot.
3506         (mono_marshal_get_delegate_end_invoke): Ditto.
3507         (mono_marshal_get_delegate_invoke): Ditto.
3508
3509 Mon Oct 6 16:10:02 CEST 2008 Paolo Molaro <lupus@ximian.com>
3510
3511         * gc.c, attach.h, attach.c: remove a bad pattern:
3512         add_finalizer_callback () is not implemented correctly, it can't
3513         without adding more overhead to the finalizer loop and it's not
3514         even needed, since we know exactly what we need to call, so there is
3515         no need to do so through an expensive function pointer.
3516
3517 2008-10-04  Zoltan Varga  <vargaz@gmail.com>
3518
3519         * gc.c: Define a dummy version of mono_gc_add_finalizer_thread_callback ()
3520         for the no-gc case.
3521         * attach.c (mono_attach_init): Remove the #ifdef.
3522
3523 2008-10-04  Andreas Färber  <andreas.faerber@web.de>
3524
3525         * attach.c (mono_attach_init): Don't use
3526         mono_gc_add_finalizer_thread_callback when compiling without GC.
3527         Fixes #432306.
3528         
3529         Code is contributed under MIT/X11 license.
3530
3531 2008-10-03  Zoltan Varga  <vargaz@gmail.com>
3532
3533         * class.c (mono_class_create_from_typedef): Remove the 
3534         #ifndef DISABLE_SIMD stuff.
3535
3536 2008-10-03  Rodrigo Kumpera  <rkumpera@novell.com>
3537
3538         * class-internals.h (MonoClass): Added simd_type bit field.
3539
3540         * class.c (mono_class_create_from_typedef): Check if type is a simd
3541         intrinsic.
3542
3543 2008-10-03  Mark Probst  <mark.probst@gmail.com>
3544
3545         * object.c (mono_method_add_generic_virtual_invocation): Only add
3546         instantiations to the thunk whose count is at least as large as
3547         the threshold.
3548
3549 2008-10-02 Gonzalo Paniagua Javier <gonzalo@novell.com>
3550
3551         * icall.c: changed the Type of the exception thrown when trying to
3552         invoke a constructor on an abstract class. Part of the fix for bug
3553         #324185.
3554
3555 2008-10-02  Mark Probst  <mark.probst@gmail.com>
3556
3557         * class.c, class-internals.h (mono_method_get_vtable_index): New
3558         function which returns the index into the vtable and properly
3559         handles inflated virtual generic methods.
3560
3561 2008-10-01  Mark Probst  <mark.probst@gmail.com>
3562
3563         * object.c, domain.c, object-internals.h, domain-internals.h:
3564         Generalize IMT thunk machinery to also handle thunks for virtual
3565         generic method invokes.  When a virtual generic method is invoked
3566         more than a number of times we insert it into the thunk so that it
3567         can be called without lookup in unmanaged code.
3568
3569         * generic-sharing.c, class-internals.h: Fetching a
3570         MonoGenericInst* for a method from an (M)RGCTX.
3571
3572 2008-10-01  Zoltan Varga  <vargaz@gmail.com>
3573
3574         * marshal.c (emit_marshal_string): Applied a variant of a patch by
3575         tom hindle <tom_hindle@sil.org>. Fix byref native-to-managed string
3576         marshalling. Fixes #431304.
3577
3578 2008-10-01  Bill Holmes  <billholmes54@gmail.com>
3579
3580         * marshal.c (emit_marshal_variant) : Change the attribute checks to 
3581           handle when ref is specified without In or Out.
3582
3583         Code is contributed under MIT/X11 license.
3584
3585 2008-09-30  Mark Probst  <mark.probst@gmail.com>
3586
3587         * loader.c (mono_get_method_constrained): Don't expand method with
3588         the class's context, because it's already a method of that class.
3589
3590 2008-09-30  Atsushi Enomoto  <atsushi@ximian.com>
3591
3592         * attach.c : should be correct build fix.
3593
3594 2008-09-29  Zoltan Varga  <vargaz@gmail.com>
3595
3596         * attach.c: Fix the previous change.
3597
3598 2008-09-29  Atsushi Enomoto  <atsushi@ximian.com>
3599
3600         * attach.c : quick w32 build fix.
3601
3602 2008-09-27  Miguel de Icaza  <miguel@novell.com>
3603
3604         * Turn off MONO_GENERIC_SHARING=all and go back to corlib as it
3605         crashes MonoDevelop: #430455.
3606
3607 2008-09-27  Zoltan Varga  <vargaz@gmail.com>
3608
3609         * domain-internals.h (struct _MonoDomain): Move most fields used only by
3610         the JIT do MonoJitDomainInfo in ../mini/mini.h.
3611
3612         * domain.c: Remove initialization/cleanup of the removed fields.
3613
3614 2008-09-27  Mark Probst  <mark.probst@gmail.com>
3615
3616         * class.c (mono_class_generic_sharing_enabled): Enable generic
3617         code sharing for PPC.
3618
3619 2008-09-26  Bill Holmes  <billholmes54@gmail.com>
3620
3621         * attach.c : Fixing the Windows builds.
3622
3623         Code is contributed under MIT/X11 license.
3624
3625 2008-09-25  Zoltan Varga  <vargaz@gmail.com>
3626
3627         * class.c (mono_class_generic_sharing_enabled): Experimentally change 
3628         the default generic sharing mode to 'all'.
3629
3630 2008-09-25  Mark Probst  <mark.probst@gmail.com>
3631
3632         * generic-sharing.c, class-internals.h: New function for checking
3633         whether a method needs a static RGCTX invoke wrapper.  A few
3634         funtions moved from mini/generic-sharing.c.
3635
3636         * icall.c: New function used.
3637
3638 2008-09-25  Mark Probst  <mark.probst@gmail.com>
3639
3640         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal):
3641         Static RGCTX invoke wrapping applies to value type methods, too.
3642
3643         * class.c (mono_class_setup_vtable_general): In generic-shared
3644         value types, wrap methods with a static RGCTX invoke wrapper.
3645
3646 2008-09-25  Zoltan Varga  <vargaz@gmail.com>
3647
3648         * attach.c (ipc_connect): Use AF_UNIX instead of AF_FILE to fix the
3649         osx build.
3650
3651 2008-09-24  Zoltan Varga  <vargaz@gmail.com>
3652
3653         * gc.c (mono_gc_add_finalizer_thread_callback): New function to
3654         register a callback which is called when the finalizer thread is woken
3655         up.
3656         (finalizer_thread): Call the callback if it exists.
3657
3658         * attach.h attach.c: New files, implementing the attach mechanism.
3659
3660         * appdomain.c: Init/cleanup the attach mechanism on startup/shutdown.
3661         
3662         * object.c (mono_object_get_virtual_method): Fix an assertion introduced
3663         by the previous change.
3664
3665 Tue Sep 23 15:24:03 CEST 2008 Paolo Molaro <lupus@ximian.com>
3666
3667         * class.c, domain-internals.h, domain.c, generic-sharing.c, image.c,
3668         loader.c, marshal.c, metadata-internals.h, metadata.c,
3669         method-builder.c, object.c, reflection.c: introduced specific functions
3670         to allocate from the domain and image mempools and cleaned up most of
3671         the code to use them (still missing a few in reflection.c).
3672         Keep the loader bytes counter updated.
3673
3674 Mon Sep 22 17:33:12 CEST 2008 Paolo Molaro <lupus@ximian.com>
3675
3676         * domain.c, monitor.c, boehm-gc.c, gc.c: update some of the GC and
3677         loader-related counters.
3678
3679 Mon Sep 22 17:29:54 CEST 2008 Paolo Molaro <lupus@ximian.com>
3680
3681         * mono-perfcounters-def.h, mono-perfcounters.c, class-internals.h:
3682         added more MS-compatible counters.
3683
3684 2008-09-22  Zoltan Varga  <vargaz@gmail.com>
3685
3686         * class.c (mono_class_setup_fields): Call setup_fields before accessing
3687         class->blittable. Fixes #428217.
3688
3689 2008-09-21  Zoltan Varga  <vargaz@gmail.com>
3690
3691         * reflection.c (mono_image_get_field_on_inst_token): Call 
3692         field_encode_signature () since that handles custom modifiers too.
3693         Fixes #424663.
3694
3695 2008-09-20  Zoltan Varga  <vargaz@gmail.com>
3696
3697         * reflection.c (add_custom_modifiers): New helper function to merge custom
3698         modifiers stored in objects to a MonoType.
3699         (fieldref_encode_signature): Encode custom modifiers.
3700         (mono_image_get_generic_field_token): Call add_custom_modifiers ().
3701         (fieldbuilder_to_mono_class_field): Ditto. Fixes #424663.
3702
3703 2008-09-19  Kornél Pál  <kornelpal@gmail.com>
3704
3705         * coree.c (_CorValidateImage): Some 64-bit IL only images have entry point
3706         calling _CorDllMain imported from mscoree.dll. Set entry point RVA to 0 for
3707         64-bit IL only images because imports are not resolved for IL only images.
3708         Special thanks to Bill Holmes for finding this bug and testing the patch.
3709         Also fail for 64-bit images marked as CLI_FLAGS_32BITREQUIRED.
3710
3711         Contributed under MIT/X11 license.
3712
3713 2008-09-19  Miguel de Icaza  <miguel@novell.com>
3714
3715         * mono-config.c (dllmap_start): Add support for the bits keyword
3716         on dllentry and dllmap to easily detect 32 vs 64 bit systems.
3717
3718 2008-09-19  Mark Probst  <mark.probst@gmail.com>
3719
3720         * reflection.c (inflate_mono_method): When the class the method is
3721         to be inflated for is itself not inflated, just return the method.
3722
3723 Fri Sep 19 11:51:36 CEST 2008 Paolo Molaro <lupus@ximian.com>
3724
3725         * mono-perfcounters.c: use more user friendly process instance names.
3726
3727 2008-09-18  Bill Holmes  <billholmes54@gmail.com>
3728
3729         * marshal.c (emit_marshal_variant) : Change the attribute checks to 
3730           handle "[in] ref" and "[in][out] ref" cases.
3731
3732         * marshal.c (cominterop_get_ccw) : The wrong signature was being passed
3733           to mono_mb_create_method.  This was causing problems calling native to
3734           managed passing Variants by value.
3735
3736         Code is contributed under MIT/X11 license.
3737
3738 2008-09-18  Zoltan Varga  <vargaz@gmail.com>
3739
3740         * class.c (can_access_internals): Call mono_assembly_load_friends ()
3741         before accessing the friend_assembly_names field.
3742
3743         * assembly.c (mono_assembly_load_friends): Make this callable multiple
3744         times.
3745         (mono_assembly_load_from_full): Avoid calling load_friends (), it is
3746         called lazily when it is needed.
3747
3748         * metadata-internals.h (struct _MonoAssembly): Add 
3749         'friend_assembly_names_inited' flag.
3750
3751 Thu Sep 18 18:18:47 CEST 2008 Paolo Molaro <lupus@ximian.com>
3752
3753         * mono-perfcounters-def.h: fix the types of a few counters.
3754         * mono-perfcounters.c: implemented the instance names getter
3755         and a few bugfixes.
3756
3757 2008-09-18  Atsushi Enomoot  <atsushi@ximian.com>
3758
3759         * culture-info-table.h : regenerated.
3760
3761 2008-09-17  Robert Jordan  <robertj@gmx.net>
3762
3763         * marshal.c (mono_marshal_get_ldflda_wrapper): Add support for
3764         context bound objects. Fixes #415577.
3765
3766         Code is contributed under MIT/X11 license.
3767
3768 Tue Sep 16 21:03:58 CEST 2008 Paolo Molaro <lupus@ximian.com>
3769
3770         * icall-def.h, threads-types.h, threads.c: fixed SpinWait()
3771         implementation (bug #423582).
3772
3773 2008-09-16  Zoltan Varga  <vargaz@gmail.com>
3774
3775         * object.c (mono_object_get_virtual_method): Handle the case method->slot
3776         is not set. Fixes #426309.
3777
3778 2008-09-16  Jb Evain  <jbevain@novell.com>
3779
3780         * class.c (mono_class_from_name): fix the exported type look up
3781         when the type is defined in a referenced assembly.
3782
3783 2008-09-16  Jb Evain  <jbevain@novell.com>
3784
3785         * reflection.c (mono_image_fill_export_table_from_type_forwarders):
3786         increment the next index counter on each iteration to make that work
3787         for more than one type forwarder. Unmanaged part to fix #422929.
3788
3789 2008-09-15  Mark Probst  <mark.probst@gmail.com>
3790
3791         * object-internals.h: enum ComInterfaceType in
3792         MonoInterfaceTypeAttribute is guint32, not guint16.
3793
3794 2008-09-12  Mark Probst  <mark.probst@gmail.com>
3795
3796         * cil-coff.h, image.c, reflection.c: Endianness fixes in image
3797         writing code.
3798
3799 2008-09-11  Mark Probst  <mark.probst@gmail.com>
3800
3801         * icall.c: Boolean arguments to a runtime invoke are MonoBoolean,
3802         not gboolean.
3803
3804 2008-09-11  Mark Probst  <mark.probst@gmail.com>
3805
3806         * debug-mono-symfile.c (mono_debug_symfile_lookup_location):
3807         Endianness fixes for MonoSymbolFileOffsetTable.
3808
3809 2008-09-10  Bill Holmes  <billholmes54@gmail.com>
3810
3811         * process.c (complete_path) : Removing quotes from the 
3812           input path.  The glib file routines do not handle file paths
3813           that have quotes around them.
3814
3815         Code is contributed under MIT/X11 license.
3816
3817 2008-09-10  Bill Holmes  <billholmes54@gmail.com>
3818
3819         * socket-io.h : Adding a comment to provide locations where 
3820           changes to MonoSocketAsyncResult need to be synced.
3821
3822         Code is contributed under MIT/X11 license.
3823
3824 2008-09-10  Zoltan Varga  <vargaz@gmail.com>
3825
3826         * marshal.c (emit_marshal_custom): Call NativeToManaged for non-out 
3827         parameters as well. Fixes #425001.
3828
3829 2008-09-08  Miguel de Icaza  <miguel@novell.com>
3830
3831         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup): Fix
3832         windows build.
3833
3834 2008-09-07  Miguel de Icaza  <miguel@novell.com>
3835
3836         * console-io.c: Add support for tracking the window size if it
3837         changes.
3838
3839         The setup is very simple: the TtySetup function will now return a
3840         pointer to a location in memory that tracks the current console
3841         size.  The managed code checks its current value every time its
3842         queried against the last value set, and updates accordingly.
3843
3844         With this setup we can work with multiple consoles, and we do not
3845         require to poke into managed code from a signal handler.
3846
3847         Additionally, the environment for COLUMNS and LINES is now handled
3848         in unmanaged code.
3849
3850         (ves_icall_System_ConsoleDriver_GetTtySize): This is now gone.
3851
3852 2008-09-07  Mark Probst  <mark.probst@gmail.com>
3853
3854         * marshal.c (mono_type_native_stack_size): Treat
3855         MONO_TYPE_TYPEDBYREF like MONO_TYPE_VALUETYPE.
3856
3857 2008-09-04  Jb Evain  <jbevain@novell.com>
3858
3859         * class.c (mono_class_is_assignable_from): fix assignability of nullables
3860         to nullables.
3861
3862 2008-09-03 Rodrigo Kumpera  <rkumpera@novell.com>
3863
3864         * verify.c (verify_type_compatibility_full): Revert change
3865         to allow converting a native int to unmanaged pointer be verifiable
3866         under non-strict mode.
3867         It turns out that "(IntPtr)null" is indeed unverifiable, go figure.
3868
3869         * verify.c: Added some TODOs.
3870
3871 2008-09-02  Bill Holmes  <billholmes54@gmail.com>
3872
3873         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi,
3874           ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni) :
3875           Changed to use GlobalAlloc for the memory returned on Windows platforms.
3876
3877         Code is contributed under MIT/X11 license.
3878
3879 2008-09-02  Jb Evain  <jbevain@novell.com>
3880
3881         * object.c (mono_ldstr_metdata_sig): renamed to mono_ldstr_metadata_sig.
3882
3883 2008-09-02 Rodrigo Kumpera  <rkumpera@novell.com>
3884
3885         reflection.c (typebuilder_setup_fields): Handle classes with
3886         explicit size.
3887
3888 2008-09-01 Rodrigo Kumpera  <rkumpera@novell.com>
3889
3890         class.c (mono_class_setup_events): Add memory barrier due to
3891         double checked locking.
3892         
3893         class.c (mono_class_setup_properties): Same.
3894
3895 2008-08-31  Zoltan Varga  <vargaz@gmail.com>
3896
3897         * class.c (mono_class_is_assignable_from): Fix the build.
3898         
3899         * class.c (mono_class_is_assignable_from): Call mono_class_setup_vtable ()
3900         before accessing klass->interface_bitmap. Fixes #421744.
3901
3902 2008-08-28  Zoltan Varga  <vargaz@gmail.com>
3903
3904         * appdomain.c (mono_runtime_set_no_exec): New internal function setting
3905         the runtime into no-exec mode, useful when running the AOT compiler.
3906
3907         * appdomain.c gc.c object.c: Avoid executing managed code when running
3908         in no-exec mode.
3909         
3910         * rawbuffer.c (mono_raw_buffer_load_mmap): Disable this on the iphone.
3911
3912         * reflection.c (_mono_reflection_get_type_from_info): Handle the 
3913         special case when the mono_assembly_loaded () returns NULL because the 
3914         search hook is not installed.
3915
3916 2008-08-25  Zoltan Varga  <vargaz@gmail.com>
3917
3918         * marshal.c: Applied patch from tom hindle (tom_hindle@sil.org) to fix
3919         crashes in bstr marshalling on linux.
3920
3921 2008-08-24  Zoltan Varga  <vargaz@gmail.com>
3922
3923         * debug-helpers.c (mono_type_get_desc): Fix printing of generic instances
3924         with more than one parameter.
3925
3926 2008-08-24  Miguel de Icaza  <miguel@novell.com>
3927
3928         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup): Disable
3929         start/stop flow control as well when turning off ICANON (allows
3930         C-s and C-q to be read by Console.ReadKey).
3931
3932 2008-08-24  Zoltan Varga  <vargaz@gmail.com>
3933
3934         * class.c (mono_class_init): Move the initialization of nested classes
3935         into mono_class_get_nested_types (). Fixes #418433.
3936
3937         * class-internals.h (struct _MonoClass): Add a new 'nested_classes_inited'
3938         flag.
3939
3940         * class.c reflection.c icall.c: Use mono_class_get_nested_types () for 
3941         iterating tough the nested classes of a class.
3942
3943 2008-08-23  Zoltan Varga  <vargaz@gmail.com>
3944
3945         * class.c (mono_class_generic_sharing_enabled): Enable generic sharing
3946         on arm.
3947
3948 2008-08-22  Miguel de Icaza  <miguel@novell.com>
3949
3950         * console-io.c (sigcont_handler): Support signal chaining for
3951         SIGCONT.
3952
3953         (console_set_signal_handlers): Use best practices with sigaction,
3954         clear the structure before using it. 
3955
3956 2008-08-22  Robert Jordan  <robertj@gmx.net>
3957
3958         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup):
3959         Fix the Windows build.
3960
3961 2008-08-22  Zoltan Varga  <vargaz@gmail.com>
3962
3963         * class.c (mono_class_generic_sharing_enabled): Make the default
3964         sharing mode 'corlib'.
3965
3966 2008-08-21  Zoltan Varga  <vargaz@gmail.com>
3967
3968         * console-io.c (console_set_signal_handlers): Fix a warning.
3969
3970         * marshal.c (mono_marshal_get_synchronized_wrapper): Call the wrapper
3971         method normally, the JIT will take care of avoiding recursion.
3972
3973 2008-08-20  Bill Holmes  <billholmes54@gmail.com>
3974
3975         * console-io.c : Fixing builds for platforms that do not have <termios.h>.
3976
3977         Code is contributed under MIT/X11 license.
3978
3979 2008-08-20  Miguel de Icaza  <miguel@novell.com>
3980
3981         * console-io.c (sigcont_handler): We need to restore the entire
3982         termios state, not only the original settings, as things like echo
3983         can be controlled after this (Booish exposes this issue with its
3984         own ReadLine implementation).
3985
3986         Additionally, we need to set the terminal back into keypad_xmit
3987         mode.
3988         
3989         (ves_icall_System_ConsoleDriver_TtySetup): Take the keypad xmit
3990         string as a paramter as well.   Otherwise we get different
3991         keyboard sequences.
3992
3993 2008-08-20  Zoltan Varga  <vargaz@gmail.com>
3994
3995         * marshal.c (emit_marshal_object): Avoid managed-to-native marshalling of
3996         delegates with byref out parameter passing. Fixes #351520.
3997
3998         * debug-helpers.c (mono_context_get_desc): New helper function to stringify
3999         a generic context.
4000         (mono_type_get_desc): Add the type arguments for GENERICINST.
4001         (mono_method_full_name): Stringify the class name using mono_type_full_name
4002         so it picks up generic arguments.
4003
4004 2008-08-19  Gert Driesen  <drieseng@users.sourceforge.net>
4005
4006         * console-io.c: Removed debug output.
4007
4008 2008-08-19 Rodrigo Kumpera  <rkumpera@novell.com>
4009
4010         reflection.c (mono_reflection_create_runtime_class): Alloc
4011         the nested classes linked list using the dynamic image mempool.
4012         Fixes leak in corlib compilation.
4013
4014 2008-08-19  Miguel de Icaza  <miguel@novell.com>
4015
4016         * console-io.c: Fix incredibly annoying behavior on the console
4017         after resuming execution after control-z.   This affected every
4018         console application.
4019
4020 2008-08-18 Rodrigo Kumpera  <rkumpera@novell.com>
4021
4022         * mempool-internals.h: Header for mono private mempool functions. The first
4023         two function are for allocating glib linked lists using pools.
4024
4025         * mempool.c: Added g_list_prepend_mempool and g_slist_prepend_mempool.
4026
4027         * Makefile.am: Added mempool-internals.h.
4028
4029 2008-08-16  Zoltan Varga  <vargaz@gmail.com>
4030
4031         * domain.c (mono_domain_create): Call the JIT domain hook if installed.
4032         (mono_domain_free): Ditto.
4033
4034         * domain-internals.h (struct _MonoDomain): Add 'runtime_info' field, this could
4035         be used by the JIT to store its domain-specific information, instead of putting
4036         it directly into MonoDomain.
4037
4038         * domain.c (mono_install_create_domain_hook): New helper function to install
4039         a hook which initializes domain->runtime_info.
4040
4041         * domain.c (mono_install_free_domain_hook): Ditto.
4042         
4043 2008-08-15  Zoltan Varga  <vargaz@gmail.com>
4044
4045         * marshal.c (mono_delegate_end_invoke): Raise an exception instead of
4046         asserting if the ares parameter is null.
4047
4048         * mono-perfcounters.c: Fix warnings.
4049
4050         * marshal.c (mono_marshal_get_delegate_begin_invoke): Don't set save_lmf, it
4051         is not needed, don't check for interruptions either.
4052         (mono_marshal_get_delegate_end_invoke): Ditto.
4053
4054 2008-08-15  Marek Habersack  <mhabersack@novell.com>
4055
4056         * mono-perfcounters.c (predef_readonly_counter): added support for
4057         reading the ASP.NET Requests Queued counter from another process.
4058
4059 2008-08-12  Zoltan Varga  <vargaz@gmail.com>
4060
4061         * metadata-internals.h: Move the 'aot_module' field from MonoAssembly to
4062         MonoImage to simplify the AOT code.
4063
4064 2008-08-10  Zoltan Varga  <vargaz@gmail.com>
4065
4066         * marshal.c (emit_marshal_object): Implement native-to-managed StringBuilder
4067         marshalling. Fixes #416078.
4068
4069 2008-08-08  Zoltan Varga  <vargaz@gmail.com>
4070         
4071         * marshal.c (mono_marshal_get_native_wrapper): Add an 'aot' argument, when
4072         it is set, looking up the icall address is deferred to the JIT, since 
4073         in embedded scenarios, the icall might not be registered in the runtime
4074         doing the AOT compilation. Backported from the 2.0 branch.
4075
4076 2008-08-08  Zoltan Varga  <vargaz@gmail.com>
4077
4078         * marshal.c (mono_remoting_wrapper): Handle nullable types correctly.
4079         Fixes #415621.
4080
4081 2008-08-05  Marek Habersack  <mhabersack@novell.com>
4082
4083         * Makefile.am: added support for cross-compilation.
4084
4085 2008-08-04  Zoltan Varga  <vargaz@gmail.com>
4086
4087         * socket-io.c (get_socket_assembly): Make 'moonlight' variable static.
4088
4089 Fri Aug 1 18:47:48 CEST 2008 Paolo Molaro <lupus@ximian.com>
4090
4091         * mono-perfcounters.c: jitted methods and jitted bytes counters.
4092
4093 Fri Aug 1 16:07:09 CEST 2008 Paolo Molaro <lupus@ximian.com>
4094
4095         * class-internals.h, icall-def.h, mono-perfcounters-def.h,
4096         mono-perfcounters.c: performance counters implementation.
4097
4098 2008-07-31  Zoltan Varga  <vargaz@gmail.com>
4099
4100         * metadata-internals.h (struct _MonoAssembly): Change the type of 'aot_module'
4101         to gpointer, letting the AOT code decide what to store in it.
4102
4103 2008-07-31  Bill Holmes  <billholmes54@gmail.com>
4104
4105         * marshal.c (cominterop_get_native_wrapper) : Adding a call to 
4106           mono_class_setup_methods if the methods are not initialized.
4107
4108         Code is contributed under MIT/X11 license.
4109
4110 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
4111
4112         * verify.c: Remove some debug code I commited by accident.
4113
4114         * verify.c (mono_method_is_valid_in_context): Change the return value
4115         to make possible to distinguish between invalid and unverifiable.
4116
4117         * verify.c (verifier_load_method): Don't return NULL for unverifiable
4118         methods.
4119
4120 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
4121
4122         * verify.c (mono_generic_param_is_constraint_compatible): Inflate type
4123         constraints. Fixes regression in gtest-253.
4124
4125 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
4126
4127         * verify.c (mono_verifier_verify_class): Don't allow generic types
4128         with explicit layout.
4129
4130         * verify.c (mono_method_verify): Check locals and argument types.
4131
4132 2008-07-29  Zoltan Varga  <vargaz@gmail.com>
4133
4134         * monitor.c (mono_monitor_try_enter_internal): Allow nterruption of the
4135         wait if the thread is in StopRequested state.
4136
4137         * class.c (mono_class_from_name): Refactor the module searching code into
4138         a separate function so it can be reused in the AOT case too.
4139
4140 2008-07-28 Rodrigo Kumpera  <rkumpera@novell.com>
4141
4142         * verify.c (mono_type_is_valid_in_context): Improve the error message.
4143         Check both the type and it's generic type definition for loader errors.
4144         
4145         * verify.c (mono_method_is_valid_in_context): Don't generate another
4146         error when a type errors occur, this leads to the wrong exception been
4147         thrown.
4148
4149 2008-07-28  Dick Porter  <dick@ximian.com>
4150
4151         * icall-def.h
4152         * process.c
4153         (ves_icall_System_Diagnostics_Process_ProcessHandle_duplicate):
4154         New internal calls to duplicate and close a process handle.
4155
4156 2008-07-27  Andreas Färber  <andreas.faerber@web.de>
4157
4158         * object.c (CHECK_ADD_OVERFLOW_UN): Add missing bracket. Fixes #412499.
4159
4160 2008-07-27  Zoltan Varga  <vargaz@gmail.com>
4161
4162         * appdomain.c (unload_thread_main): Attach the unload thread to the runtime.
4163
4164 2008-07-27  Robert Jordan  <robertj@gmx.net>
4165
4166         * class.c (mono_class_init): Don't compute class.has_finalize for
4167         valuetypes. Fixes #412477.
4168
4169 2008-07-25 Rodrigo Kumpera  <rkumpera@novell.com>
4170
4171         * verify.c: Implement constraint equivalence checking.
4172         This is required when a generic parameter is used as
4173         argument to a constrained one.
4174
4175         Fixes #410637.
4176
4177 2008-07-24  Zoltan Varga  <vargaz@gmail.com>
4178
4179         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
4180
4181         * domain-internals.h (struct _MonoDomain): Add 'method_code_hash' field.
4182
4183         * object-internals.h (struct _MonoDelegate): Add 'method_code' field,
4184         synch with managed object layout.
4185
4186 2008-07-24 Rodrigo Kumpera  <rkumpera@novell.com>
4187
4188         * verify.c (do_branch_op): Handle valuetypes and generic
4189         arguments properly.
4190
4191         * verify.c (do_cmp_op): Same.
4192
4193         Fixes #410383.
4194
4195 2008-07-24  Mark Probst  <mark.probst@gmail.com>
4196
4197         * generic-sharing.c: Fix memory leaks.
4198
4199         * class.c, class-internals.h: Make
4200         mono_class_inflate_generic_type_with_mempool() non-static.
4201
4202 2008-07-24 Rodrigo Kumpera  <rkumpera@novell.com>
4203
4204         * pedump.c (dump_verify_info): Dump full class name.
4205
4206 2008-07-24  Mark Probst  <mark.probst@gmail.com>
4207
4208         * generic-sharing.c: Removed some old code that didn't do anything.
4209
4210 2008-07-24  Massimiliano Mantione  <massi@ximian.com>
4211         * profiler.c: Added runtime_initialized_event,
4212         mono_profiler_install_runtime_initialized and
4213         mono_profiler_runtime_initialized. This new hook tells the profiler
4214         when the runtime is sufficiently initialized to be able to call
4215         mono_thread_attach on the root appdomain.
4216         * profiler.h, profiler-private.h: Likewise.
4217
4218 2008-07-23 Rodrigo Kumpera  <rkumpera@novell.com>
4219
4220         * verify.c (do_cast): Do boxing for generic arguments as well.
4221
4222         * class.c (is_nesting_type): Drop generic instantiations before
4223         checking for nesting.
4224
4225         * class.c (can_access_instantiation): Allow access to generic
4226         arguments.
4227
4228 2008-07-23 Rodrigo Kumpera  <rkumpera@novell.com>
4229
4230         * verify.c (verify_class_for_overlapping_reference_fields):
4231         On some cases, the field size might be zero, guard against that.
4232         Fix the explicit layout check to work as expected.
4233
4234 2008-07-23  Zoltan Varga  <vargaz@gmail.com>
4235
4236         * threads.c (ves_icall_System_Threading_Thread_Abort): Avoid calling 
4237         mono_thread_resume () during shutdown, since the thread we want to abort
4238         might be suspended.
4239
4240 2008-07-22  Zoltan Varga  <vargaz@gmail.com>
4241
4242         * mono-debug-debugger.c (mono_debugger_check_breakpoints): Fix a 
4243         warning.
4244
4245         * debug-mono-symfile.c: Fix a warning.
4246
4247         * mono-perfcounters.c (get_cpu_times): Fix a warning.
4248
4249         * object.c (mono_class_vtable): Check if exception_type is set, and return
4250         NULL as defined by the function comments.
4251
4252 2008-07-22  Mark Probst  <mark.probst@gmail.com>
4253
4254         * mempool.c: Use malloc for every single mempool allocation if the
4255         configure option is set.  This makes it easier to track mempool
4256         allocations with tools like Valgrind.
4257
4258 2008-07-22  Jb Evain  <jbevain@novell.com>
4259
4260         * reflection.c (create_dynamic_mono_image): emit the same
4261         metadata version that SL2 does when creating a SL2 image.
4262
4263 2008-07-21 Rodrigo Kumpera  <rkumpera@novell.com>
4264
4265         * icall-def.h:
4266         * icall.c: New icall System.Enum:get_hashcode. This function
4267         avoids the overhead of boxing the enum to the underlying type.
4268
4269 2008-07-21  Mark Probst  <mark.probst@gmail.com>
4270
4271         * reflection.c (mono_method_get_object): Don't let static RGCTX
4272         invoke wrappers get into MonoReflectionMethods.
4273
4274 2008-07-17 Rodrigo Kumpera  <rkumpera@novell.com>
4275
4276         * object-internals.h:
4277         * object.c: New mono_runtime_class_init_full function
4278         that makes throwing the exception optinal.
4279
4280         * class-internals.h: New exception type MONO_EXCEPTION_OBJECT_SUPPLIED
4281         for the case where the exception object is supplied.
4282
4283 2008-07-16  Kornél Pál  <kornelpal@gmail.com>
4284
4285         * coree.h: Define __ImageBase as _image_base__ on cygwin that fixes build with
4286         old ld versions.
4287
4288         Contributed under MIT/X11 license.
4289
4290 2008-07-16 Rodrigo Kumpera  <rkumpera@novell.com>
4291
4292         * string-icalls.c (ves_icall_System_String_InternalSplit):
4293         Optimize array allocation by caching the MonoClass of the
4294         array type.
4295
4296         * icall.c (ves_icall_Type_GetMethodsByName): Same.
4297
4298         * reflection.c (mono_param_get_objects): Same.
4299
4300 2008-07-16 Rodrigo Kumpera  <rkumpera@novell.com>
4301
4302         * icall-def.h:
4303         * icall.c: New ves_icall_MonoGenericClass_InflateType icall.
4304         It inflates the given type using the class context.
4305
4306 2008-07-15 Rodrigo Kumpera  <rkumpera@novell.com>
4307
4308         * object.c (mono_class_try_get_vtable): New function. Tries to fetch
4309         the vtable if it already exists.
4310
4311         * object-internals.h: Add mono_class_try_get_vtable as part of the
4312         internal API.
4313
4314         * reflection.c (mono_type_get_object): Use the MonoObject from the
4315         vtable when possible. Reduces locking contention on reflection heavy
4316         code.
4317
4318 2008-07-15  Zoltan Varga  <vargaz@gmail.com>
4319
4320         * decimal.c (my_g_bit_nth_msf): Implement this directly without calling
4321         g_bit_nth_msf () since that macro is not implemented in eglib.
4322
4323 2008-07-13  Zoltan Varga  <vargaz@gmail.com>
4324
4325         * class.c (mono_class_generic_sharing_enabled): Always disable generic sharing
4326         on platforms which do not support it.
4327
4328 2008-07-12  Zoltan Varga  <vargaz@gmail.com>
4329
4330         * marshal.c (mono_signature_to_name): Encode sig->hasthis as well.
4331
4332 2008-07-11  Martin Baulig  <martin@ximian.com>
4333
4334         * mono-debug-debugger.h
4335         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_INTERRUPTION_REQUEST'.
4336
4337         * mono-debug-debugger.c
4338         (_mono_debugger_interruption_request): New global volatile variable.
4339         (mono_debugger_check_interruption): New public function.
4340
4341         * threads.c
4342         (mono_thread_current_check_pending_interrupt): Call
4343         mono_debugger_check_interruption().
4344         (mono_thread_interruption_checkpoint_request): Likewise.
4345
4346 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
4347
4348         * verify.c: Add more type checks for loaded types. Verify the result
4349         handle from ldtoken.
4350
4351 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
4352
4353         * loader.c (field_from_memberref): Don't crash if the field
4354         wasn't found.
4355
4356 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
4357
4358         * verify.c: Verify if type and method instantiations
4359         don't have invalid VAR or MVAR arguments.
4360
4361 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
4362
4363         * verify.c: Fix double free of function pointer list.
4364
4365 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
4366
4367         * object.c (mono_string_to_utf8): Comment the new code as it
4368         breaks under eglib.
4369
4370 2008-07-08 Rodrigo Kumpera  <rkumpera@novell.com>
4371
4372         * object.c (mono_string_to_utf8): Avoid allocating a temp array.
4373
4374 2008-07-07  Bill Holmes  <billholmes54@gmail.com>
4375
4376         * threads.c : Thread.Interrupt changes to ensure that ThreadInterruptedException
4377           is not throw too many times.
4378
4379         Code is contributed under MIT/X11 license.
4380
4381 2008-07-07  Zoltan Varga  <vargaz@gmail.com>
4382
4383         * mono-debug.c (mono_debug_find_method): Allow this to be called even when
4384         debugging is turned off.
4385
4386 2008-07-06  Zoltan Varga  <vargaz@gmail.com>
4387
4388         * generic-sharing.c (mono_method_lookup_rgctx): Fix a warning.
4389
4390 2008-07-04  Mark Probst  <mark.probst@gmail.com>
4391
4392         * class-internals.h, class.c: Added new generic sharing option:
4393         Share only stuff in System.Collections.Generic, which is now the
4394         default.
4395
4396 2008-07-04  Mark Probst  <mark.probst@gmail.com>
4397
4398         * generic-sharing.c, class-internals.h: New function for getting a
4399         generic method in a generic class given the corresponding method
4400         for a different instantiation of the class.  Partly refactored
4401         from mini-trampolines.c.
4402
4403         * class.c: Make sure generic methods have a class_inst if they are
4404         part of a generic class.
4405
4406         * metadata.c (mono_type_stack_size_internal): Handle type
4407         variables.
4408
4409 2008-07-04  Mark Probst  <mark.probst@gmail.com>
4410
4411         * domain-internals.h: New field (has_this) in MonoGenericJitInfo.
4412         Signifies whether information on the this/vtable/mrgctx variable
4413         is available.
4414
4415 2008-07-04  Mark Probst  <mark.probst@gmail.com>
4416
4417         * object.c, object-internals.h, icall.c: New function
4418         mono_delegate_ctor_with_method(), which does the same as
4419         mono_delegate_ctor(), but takes an explicit method argument
4420         instead of taking the method from the jit info.
4421
4422         * marshal.c: When creating a delegate with an inflated method take
4423         the "this" argument as the target class for the castclass.
4424
4425 2008-07-03  Mark Probst  <mark.probst@gmail.com>
4426
4427         * domain.c (mono_jit_info_table_find): Fixed a bug that caused
4428         mono_jit_info_table_find() to perform very badly in some cases.
4429
4430 2008-07-02  Zoltan Varga  <vargaz@gmail.com>
4431
4432         * icall.c (type_from_typename): Handle 'string'.
4433
4434         * marshal.c (mono_marshal_get_runtime_invoke): Don't insert runtime invoke
4435         wrappers into the wrapper_hash, since the key is not a MonoMethod.
4436
4437 2008-07-01  Zoltan Varga  <vargaz@gmail.com>
4438
4439         * icall.c (mono_get_jit_icall_info): New function to return the jit icall hash table.
4440
4441         * *-gc.c (mono_gc_get_managed_allocator_types): New function to return the
4442         number of available managed allocator types.
4443
4444         * marshal.c (mono_marshal_init): Register Thread:ResetAbort as an icall ().
4445         (mono_marshal_get_runtime_invoke): Call ResetAbort as an icall.
4446
4447 2008-06-30  Zoltan Varga  <vargaz@gmail.com>
4448
4449         * domain-internals.h (struct _MonoDomain): Add 'jit_code_hash_lock' field,
4450         which is a low level lock protecting just the 'jit_code_hash' hash table.
4451
4452         * domain.c: Initialize+cleanup jit_code_hash_lock.
4453         
4454 2008-06-30  Kornél Pál  <kornelpal@gmail.com>
4455
4456         * coree.c (mono_load_coree): Set coree_module_handle global variable only
4457         after initialization.
4458
4459         * coree.h: Make MonoFixupExe internal.
4460
4461         Contributed under MIT/X11 license.
4462
4463 2008-06-30  Kornél Pál  <kornelpal@gmail.com>
4464
4465         * coree.c (_CorValidateImage): Retain IMAGE_DIRECTORY_ENTRY_SECURITY
4466         because that is platform independent. Check NumberOfRvaAndSizes in PE32
4467         as well.
4468         (MonoLoadImage): New wrapper function around LoadLibrary to ensure that the
4469         image being loaded is a CLI image and _CorValidateImage gets called.
4470
4471         * coree.h: Add MonoLoadImage.
4472
4473         * image.c (mono_image_open_full): Load CLI images using MonoLoadImage
4474         instead of LoadLibrary.
4475
4476         Contributed under MIT/X11 license.
4477
4478 2008-06-29 Rodrigo Kumpera  <rkumpera@novell.com>
4479
4480         * icall.c (ves_icall_System_ValueType_Equals): Avoid allocating objects
4481         for any primitive type.
4482
4483 2008-06-29  Zoltan Varga  <vargaz@gmail.com>
4484
4485         * object.c (mono_array_new_specific): Optimize this and the other allocation
4486         functions a bit.
4487         
4488         * object.c (mono_class_create_runtime_vtable): Use typed allocation in other
4489         domains too if mono_dont_free_domains is set.
4490
4491         * domain-internals.h (mono_dont_free_domains): New internal option controlling
4492         whenever to free appdomain data after it has been unloaded.
4493
4494         * domain.c (mono_domain_free): Don't free appdomain data if the option is set.
4495         
4496 2008-06-28  Zoltan Varga  <vargaz@gmail.com>
4497
4498         * icall.c (ves_icall_System_Enum_get_underlying_type): New icall.
4499         (mono_method_get_equivalent_method): Fix a warning.
4500
4501         * object.c (mono_message_init): Avoid looking up array types for each call.
4502
4503 2008-06-27  Zoltan Varga  <vargaz@gmail.com>
4504
4505         * object.c (mono_message_invoke): Avoid looking up the object[] type for each
4506         call.
4507
4508         * icall.c (ves_icall_System_ValueType_Equals): Optimize the comparison of enums
4509         even more.
4510
4511         * class.c (mono_class_get_fields): Avoid calling setup_fields_locking () for
4512         each iteration.
4513
4514         * icall.c (ves_icall_System_ValueType_Equals): Avoid traversing all the static
4515         fields of an enum.
4516
4517 2008-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
4518
4519         * object.c (mono_value_box): Fix boxing of nullables.
4520
4521 2008-06-26  Kornél Pál  <kornelpal@gmail.com>
4522
4523         * assembly.c (mono_set_rootdir): Use __ImageBase instead of
4524         mono_module_handle that is defined by the linker; no initialization required.
4525         * coree.h: Remove mono_module_handle, add __ImageBase, update
4526         mono_image_open_from_module_handle.
4527         * coree.c (_CorValidateImage): Convert platform independent PE32 images to
4528         PE32+ on 64-bit Windows that makes the OS able to load CIL images as modules.
4529         (MonoFixupCorEE): Export Address Table RVAs are 32-bit unsigned integers so
4530         memory has to be allocated for trampolines (x64) or procedure labels (IA64) up
4531         to 4 GB away from image base address. IA64 version is not tested but was very
4532         easy to implement and should work if we ever need it.
4533         * domain.c (mono_init_internal): Avoid system error message boxes.
4534         * image.c (mono_image_open_from_module_handle): Replace ref_count argument
4535         with has_entry_point. Handle do_mono_image_load fauilre correctly.
4536         (mono_image_open_full, mono_image_close): Use has_entry_point instead of
4537         coff_attributes that is a more reliable way to detect if _CorDllMain was called.
4538         * metadata-internals.h: Add has_entry_point to _MonoImage on Windows.
4539
4540         Contributed under MIT/X11 license.
4541
4542 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
4543
4544         * class.c, class-internals.h: Export mono_class_get_generic_type_definition
4545         as part of the private mono API.
4546         
4547         * loader.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandleInternalType):
4548         Do proper argument checking for methods that belong to generic classes.
4549         Do proper type resolution for GMFH/2.
4550         Fixes #377324.
4551         
4552 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
4553
4554         * verify.c (do_switch): Fix a memory corruption bug with
4555         the jump index is out of bound.
4556
4557 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
4558
4559         * verify.c: Disable debug code.
4560
4561 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
4562
4563         * reflection.c (mono_image_get_methodbuilder_token): Use
4564         mono_image_get_methodspec_token_for_generic_method_definition
4565         instead of mono_image_get_memberref_token. We cache more memberef
4566         entries now.
4567
4568 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
4569
4570         * verify.c: Inflate exception clause types.
4571         Fixes #402606.
4572         
4573 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
4574
4575         * reflection.c (mono_image_get_methodbuilder_token): Don't leak
4576         name.
4577
4578         * reflection.c (mono_image_get_ctorbuilder_token): Same.
4579
4580         * reflection.c (mono_image_create_method_token): Same.
4581
4582 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
4583
4584         * reflection.c: Added mono_image_get_methodref_token_for_methodbuilder.
4585         It does the same as mono_image_get_methodref_token but works on
4586         MethodBuilder.
4587
4588         * reflection.c: Use mono_image_get_methodspec_token_for_generic_method_definition
4589         and always generate a methodspec. This follows the old behavior and fixes
4590         the regressions in System.Core. 
4591
4592 2008-06-24  Zoltan Varga  <vargaz@gmail.com>
4593
4594         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Collect exceptions for classes where 
4595         don't event mono_class_get () succeeds. Fixes #402182.
4596
4597 2008-06-20 Rodrigo Kumpera  <rkumpera@novell.com>
4598
4599         * metadata-internals.h: Added MonoDynamicImage::methodspec
4600         hashtable to store methodspec tokens created for MethodBuilders.
4601
4602         * reflection.c (mono_image_get_methodbuilder_token): Encode generic
4603         MethodBuilders as open instantiations if a methodspec was requested.
4604
4605         * reflection.c (fixup_method): Skip MethodBuilder with methodspec tokens.
4606
4607         * reflection.c (create_dynamic_mono_image): Create the methodspec hashtable.
4608
4609         * reflection.c (mono_dynamic_image_free): Release the methodspec hashtable.
4610
4611         Fixes bug #349190.
4612
4613 2008-06-20 Rodrigo Kumpera  <rkumpera@novell.com>
4614
4615         * loader.c (method_from_methodspec): Avoid crashing if the
4616         method lookup fails.
4617
4618 2008-06-20  Dick Porter  <dick@ximian.com>
4619
4620         * socket-io.c (get_socket_assembly): Cope with Moonlight network
4621         classes being in a different assembly.  Fixes bug 399184.
4622
4623 2008-06-20  Zoltan Varga  <vargaz@gmail.com>
4624
4625         * loader.c (mono_loader_init): Make this callable multiple times.
4626         (mono_dllmap_insert): Call mono_loader_init () so this works even before
4627         the runtime is initialized. Fixes #401755.
4628
4629 2008-06-19  Dick Porter  <dick@ximian.com>
4630
4631         * socket-io.c (convert_socketflags): Ignore SocketFlags.Partial.
4632         Fixes bug 349688.
4633
4634 2008-06-19  Dick Porter  <dick@ximian.com>
4635
4636         * socket-io.c:
4637         * icall-def.h: Implement Socket generic Send() and Receive()
4638         methods.  Fixes bug 395168.
4639
4640 2008-06-19  Kornél Pál  <kornelpal@gmail.com>
4641
4642         * icall-def.h, icall.c: Add ves_icall_System_Reflection_Module_GetHINSTANCE.
4643
4644         Contributed under MIT/X11 license.
4645
4646 2008-06-18  Martin Baulig  <martin@ximian.com>
4647
4648         * mono-debug.h (MONO_DEBUGGER_VERSION): Split into
4649         `MONO_DEBUGGER_MAJOR_VERSION' and `MONO_DEBUGGER_MINOR_VERSION';
4650         set to 80.0.  The debugger <-> runtime interface is now frozen as
4651         well.   
4652
4653         * mono-debug.c
4654         (mono_debug_debugger_version): Bump to 4.
4655
4656 2008-06-18  Martin Baulig  <martin@ximian.com>
4657
4658         * debug-mono-symfile.c
4659         (load_symfile): Don't check the minor version.
4660
4661         * debug-mono-symfile.h: Bump the version number to 50.0.
4662
4663 2008-06-18  Martin Baulig  <martin@ximian.com>
4664
4665         * debug-mono-symfile.c
4666         (load_symfile): Treat `MONO_SYMBOL_FILE_MINOR_VERSION' as a
4667         minimum required version.
4668
4669 2008-06-17 Rodrigo Kumpera  <rkumpera@novell.com>
4670
4671         * reflection.c (mono_custom_attrs_from_property): Fix support for
4672         retriveving cattrs of dynamic inflated generic types.
4673
4674         * reflection.c (mono_custom_attrs_from_event): Same.
4675
4676         * reflection.c (mono_custom_attrs_from_field): Same;
4677
4678         * reflection.c (typebuilder_setup_events): Same cattrs of events.
4679
4680         * loader.c (-mono_metadata_get_corresponding_field_from_generic_type_definition):
4681         Moved to metadata.c.
4682
4683         * metadata.c: New functions to retrive the equivalent field, event
4684         of property from the generic type definition.
4685
4686         * metadata-internals.h: Added new functions from metadata.c.
4687
4688 2008-06-17 Rodrigo Kumpera  <rkumpera@novell.com>
4689
4690         * reflection.c (mono_custom_attrs_from_builders): Mark MonoCustomAttrInfo
4691         to cached in a mempool is used.
4692
4693         * metadata.c (free_generic_class): In some situations field generic_info type
4694         is not properly dup'ed and leads to double free'ing.
4695
4696         Fixes #400643.
4697
4698 2008-06-17  Mark Probst  <mark.probst@gmail.com>
4699
4700         * marshal.c (mono_marshal_get_static_rgctx_invoke): Also handle
4701         this arguments (will be needed later for generic methods).
4702         Collect stats.
4703
4704 2008-06-17  Mark Probst  <mark.probst@gmail.com>
4705
4706         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal):
4707         Create a static RGCTX invoke wrapper for methods which require it.
4708
4709 2008-06-17  Mark Probst  <mark.probst@gmail.com>
4710
4711         * object.c, class-internals.h: New function for checking whether
4712         an individual field is special static.
4713
4714 2008-06-15  Zoltan Varga  <vargaz@gmail.com>
4715
4716         * metadata.c (mono_metadata_get_generic_param_row): Use bsearch instead of
4717         linear search since the table is sorted.
4718
4719         * gc.c (mono_gc_cleanup): Abort the finalizer thread more gracefully.
4720         Fixes #324180.
4721
4722 2008-06-14  Zoltan Varga  <vargaz@gmail.com>
4723
4724         * appdomain.c (unload_thread_main): Applied patch from Tim Howard 
4725         (timh@ict.om.org). Remove the timeouts when waiting for appdomains to unload.
4726
4727         * gc.c (mono_domain_finalize): Allow an infinite timeout.
4728
4729         * threads.c (mono_threads_abort_appdomain_threads): Ditto.
4730         
4731         * threads.c (mono_thread_request_interruption): Get rid of locking, use
4732         InterlockedCompareExchange to query and modify 
4733         thread->interruption_requested.
4734
4735         * object-internals.h (struct _MonoThread): Change interruption_requested
4736         to a gint32 so it can be modified by atomic operations. Add 
4737         'critical_region_level' from the managed side, change small_id to a guint32,
4738         add new set of 'unused' fields.
4739
4740         * appdomain.c: Bump corlib version.
4741
4742 2008-06-13  Zoltan Varga  <vargaz@gmail.com>
4743
4744         * class.c (mono_class_from_name): Search modules as well. Fixes
4745         #322332.
4746
4747 2008-06-13  Mark Probst  <mark.probst@gmail.com>
4748
4749         * generic-sharing.c: Code for maintaining the MRGCTX and MRGCTX
4750         templates.  Templates are generalized with an additional type_argc
4751         argument.  RGCTX templates have type_argc==0, MRGCTX templates
4752         have type_argc>0.
4753
4754         * domain-internals.h, domain.c: New hash table for looking up
4755         MRGCTXs.
4756
4757         * metadata.c, metadata-internals.h: Rename hash and equal
4758         functions for MonoGenericInst's and make them public.
4759
4760         * class-internals.h: New data structures for the MRGCTX.  Macros
4761         for distinguishing slots in the RGCTX and the MRGCTX.
4762
4763 2008-06-13  Mark Probst  <mark.probst@gmail.com>
4764
4765         * object.c (mono_method_get_imt_slot): Put the same methods of
4766         different instantiations of the same generic interface in the same
4767         IMT slots, to make generic sharing simpler.
4768
4769 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
4770
4771         * metadata-internals.h: Added mono_metadata_field_info_with_mempool.
4772
4773         * metadata.c (mono_metadata_field_info_with_mempool): Added.
4774         This function works just like mono_metadata_field_info, but
4775         accept a mempool as argument to be used allocating memory.
4776
4777         * marshal.c (mono_marshal_load_type_info): Use new function
4778         to load marshal data into image mempool.
4779
4780 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
4781
4782         * class.c (mono_class_inflate_generic_type_with_mempool):
4783         This function allows to inflate a generic type using
4784         a mempool.
4785
4786         * class.c (inflate_generic_type): Take a mempool as argument
4787         and use it to do type dup'ing.
4788
4789         * class.c (mono_class_setup_fields): Field type for generic
4790         generic classes are allocated from the image mempool.
4791
4792         * metadata.c (free_generic_class): Inflated field type is
4793         now allocated in the image mempool.
4794
4795 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
4796
4797         * threads.c (thread_cleanup): Free MonoThread::name.
4798
4799 2008-06-12  Marek Habersack  <mhabersack@novell.com>
4800
4801         * appdomain.c (ensure_directory_exists): avoid unnecessary
4802         mkdir(2) calls when the shadow directory already exists.
4803         (mono_make_shadow_copy): copy also satellite assemblies from the
4804         private bin directories.
4805
4806 2008-06-11  Zoltan Varga  <vargaz@gmail.com>
4807
4808         * threads.c (mono_thread_get_stack_bounds): Align the stack in all cases.
4809         
4810         * threads.c (mono_thread_get_stack_bounds): Align the stack address to
4811         a page boundary. Fixes #396219.
4812
4813 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
4814
4815         * marshal.c (mono_marshal_load_type_info): Add a memory barrier
4816         due to double-checked locking.
4817
4818 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
4819
4820         * assembly.c (build_assembly_name): Release memory on failure.
4821
4822         * assembly.c (mono_assembly_name_parse_full): Release memory on failure.
4823
4824 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
4825
4826         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Release
4827         memory on failure.
4828
4829 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
4830
4831         * icall.c (ves_icall_System_Reflection_AssemblyName_ParseName): Release
4832         memory on failure.
4833
4834 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
4835
4836         * loader.c (field_from_memberref): Check if field signature type is equal
4837         to the non-inflated type of the field. Fixes #398980.
4838
4839 2008-06-11  Zoltan Varga  <vargaz@gmail.com>
4840
4841         * assembly.c (mono_assembly_load_from_full): Call 
4842         mono_assembly_load_friends () outside the assemblies lock, since it can
4843         acquire the loader lock. Fixes #323696.
4844
4845         * reflection.c (resolve_object): Inflate the inst with the context for
4846         FieldOnTypeBuilderInst. Fixes #399010.
4847
4848 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
4849
4850         * reflection.c (mono_image_get_field_on_inst_token): Don't
4851         inflate the field to encode it's signature. If it's a
4852         VAR or MVAR it should stay that way in the signature.
4853         Fixes #399047.
4854
4855 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
4856
4857         * reflection.c (resolve_object): Release memory of inflated types.
4858
4859 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
4860
4861         * loader.c (mono_method_get_signature_full): Remove assert about
4862         loading a methodspec to a generic method. We have such methods, such as
4863         System.Threading.Interlocked::CompareExchange<T>.
4864         This assert was removed since it crashes the verifier when it checks
4865         methods calling CompareExchange<T>.
4866
4867 2008-06-10  Marek Safar  <marek.safar@gmail.com>
4868
4869         * icall.c (ves_icall_MonoMethod_GetGenericArguments): Creates an instance
4870         of Type array and not MonoType.
4871
4872 2008-06-10  Marek Habersack  <mhabersack@novell.com>
4873
4874         * profiler.c: fix a segfault on shutdown. Patch from Paolo Molaro
4875         <lupus@ximian.com>
4876
4877 2008-06-10  Martin Baulig  <martin@ximian.com>
4878
4879         * debug-mono-symfile.h
4880         (MONO_SYMBOL_FILE_MINOR_VERSION): Bump to 6.  There were no
4881         changes to the file format, but we were generating incorrect
4882         source file indices in the line number table due to a bug, which
4883         made backtraces report an incorrect source file.
4884
4885 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
4886
4887         * mono-debug.c: Moved mono_debug_free_method_jit_info from
4888         mini/debug-mini.c to here.
4889
4890         * mono-debug.c (il_offset_from_address): Free memory from find_method.
4891
4892         * mono-debug.h: Export mono_debug_free_method_jit_info, users should
4893         use it to release structs returned by mono_debug_find_method.
4894
4895 2008-06-10  Zoltan Varga  <vargaz@gmail.com>
4896
4897         * class.c (mono_class_setup_vtable): Call setup_methods even for interfaces
4898         since it needs to set method->slot for all interface methods.
4899
4900 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
4901
4902         * class-internals.h: Forgot to add.
4903
4904 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
4905
4906         * class-internals.h: Added MONO_PROP_DYNAMIC_CATTR.
4907
4908         * reflection.c (lookup_custom_attr): Added a MonoImage argument.
4909         Lookup the custom attributes from property_hash.
4910
4911         * reflection.c (mono_save_custom_attrs): Save the custom attributes
4912         in property_hash. Allocate all data using the image mempool.
4913
4914         * reflection.c: Removed dynamic_custom_attrs. Changed all checks
4915         for dynamic_custom_attrs to checks if the image is dynamic.
4916
4917 2008-06-09  Zoltan Varga  <vargaz@gmail.com>
4918
4919         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Free the
4920         assemblies array.
4921         
4922         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Avoid calling
4923         runtime functions while holding the domain assemblies lock.
4924
4925 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
4926
4927         * verify.c: Reapplied the last bit of the reverted changes.
4928
4929 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
4930
4931         * verify.c: Reapplied more of the reverted changes.
4932
4933 2008-06-09  Martin Baulig  <martin@ximian.com>
4934
4935         * debug-mono-symfile.c (load_symfile): Check the major version
4936         first; if it's wrong, don't print the minor version in the error message.
4937
4938 2008-06-09  Zoltan Varga  <vargaz@gmail.com>
4939
4940         * appdomain.c (set_domain_search_path): Make this use the domain assemblies
4941         lock instead of the domain lock to avoid deadlocks, since the thread might
4942         already hold the loader lock.
4943
4944         * threads.c (start_wrapper): Call mono_monitor_init_tls ().
4945         (mono_thread_attach): Ditto.
4946
4947         * monitor.c: Use a TLS variable for holding the current thread id instead
4948         of calling pthread_self ().
4949         (mono_monitor_init_tls): New internal function to initialize the TLS
4950         variable.
4951         (mono_monitor_try_enter_internal): Put the owner == id check after the
4952         owner == 0 check.
4953
4954         * object-internals.h (_G_BOOLEAN_EXPR): Redefine this glib macro to avoid
4955         missed optimizations when using gcc-4.3.
4956
4957 2008-06-08 Rodrigo Kumpera  <rkumpera@novell.com>
4958
4959         * reflection.c (mono_dynamic_image_free): Free the memory
4960         used by MonoGenericParam in MonoDynamicImage::gen_param.
4961
4962         * reflection.c (mono_reflection_setup_generic_class): Allocate
4963         container from mempool.
4964
4965         * reflection.c (mono_reflection_initialize_generic_parameter): Allocate
4966         container from mempool.
4967
4968 2008-06-07  Zoltan Varga  <vargaz@gmail.com>
4969
4970         * threads.c (mono_set_pending_exception): New internal function to set the
4971         pending exception of the current thread.
4972         (mono_thread_get_and_clear_pending_exception): Check for 
4973         thread->pending_exception as well.
4974
4975         * object-internals.h (struct _MonoThread): Add 'pending_exception' field.
4976
4977         * boehm-gc.c (mono_gc_base_init): Set GC_no_dls before calling GC_init () since
4978         it can trigger a collection.
4979
4980 2008-06-06  Martin Baulig  <martin@ximian.com>
4981
4982         Merged the `debugger-kahalo' branch.
4983
4984         * mono-debug.h
4985         (MONO_DEBUGGER_VERSION): Bumped to 72.
4986
4987         * debug-mono-symfile.h
4988         (MonoSymbolFileMethodIndexEntry): Removed.
4989         (MonoSymbolFileMethodEntry): New public typedef.
4990         (MonoSymbolFileOffsetTable): Added `_is_aspx_source'.
4991         (MonoSymbolFileSourceEntry): Remove everything except `index' and
4992         `data_offset'.
4993         (MonoSymbolFileMethodEntry): Removed.
4994         (MonoSymbolFileLexicalBlockEntry): Removed.
4995         (MonoSymbolFileLineNumberEntry): Removed.
4996         (MonoDebugLexicalBlockEntry): Removed.
4997         (MonoDebugMethodInfo): Replaced `entry' by `guint32 entry_offset';
4998         removed `num_il_offsets' and `il_offsets'.
4999         (MonoSymbolFile): Replace `version' with `major_version' and
5000         `minor_version'.
5001         (MONO_SYMBOL_FILE_VERSION): Replace with
5002         `MONO_SYMBOL_FILE_MAJOR_VERSION' and
5003         `MONO_SYMBOL_FILE_MINOR_VERSION'.
5004
5005         * debug-mono-symfile.c
5006         (mono_debug_symfile_lookup_location): Add support for the new line
5007         number table format.
5008
5009 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
5010
5011         * metadata.c (free_generic_class): Release the inflated
5012         MonoClass of dynamic generic classes if it's not a generic
5013         type definition.
5014
5015 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
5016
5017         * verify.c: Reapplied more of the reverted changes.
5018
5019 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
5020
5021         * reflection.c (lookup_custom_attr): Clean the cached flag or
5022         nobody will free it. Fixes a memleak in MonoCustomAttrs::IsDefinedInternal
5023         for SRE types.
5024
5025 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
5026
5027         * verify.c: Reapplied a small part of the reverted changes.
5028
5029 2008-06-07  Zoltan Varga  <vargaz@gmail.com>
5030
5031         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
5032
5033         * monitor.c (mono_monitor_try_enter_internal): Add NULL check which was 
5034         previously in managed code.
5035         (mono_monitor_exit): Ditto.
5036         (ves_icall_System_Threading_Monitor_Monitor_exit): Removed, not needed anymore.
5037
5038         * icall-def.h: Rename the Enter/Exit icalls to simply Enter/Exit to match
5039         the managed definition.
5040
5041 2008-06-06 Rodrigo Kumpera  <rkumpera@novell.com>
5042
5043         * verify.c: Revert changes to see if it helps with weird buildbot crashes.
5044
5045 2008-06-06  Zoltan Varga  <vargaz@gmail.com>
5046
5047         * monitor.c: Redefine GetCurrentThreadId () with a macro on !win32.
5048         
5049         * monitor.c: Add some micro optimizations.
5050
5051         * icall.c (type_from_typename): Handle 'bool'.
5052
5053 2008-06-06 Rodrigo Kumpera  <rkumpera@novell.com>
5054
5055         * verify.c: Implement constructor verification per P III 1.8.1.4.
5056         Fixes #396716.
5057
5058 2008-06-06  Zoltan Varga  <vargaz@gmail.com>
5059
5060         * assembly.c (mono_assembly_loaded_full): Avoid calling the search hooks while
5061         holding the assemblies lock here too.
5062
5063 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
5064
5065         * verify.c: Kill stack_top function.
5066
5067 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
5068
5069         * verify.c: Kill stack_get function.
5070
5071 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
5072
5073         * verify.c (mono_method_verify): Last change broke the build. Fixed.
5074
5075 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
5076
5077         * verify.c (verify_type_compatibility_full): Make SZARRAY checks
5078         more reliable.
5079
5080         * verify.c (mono_method_verify): Inflate params and locals to avoid
5081         mismatch when checking for compatibility.
5082
5083 2008-06-05  Jonathan Chambers  <joncham@gmail.com>
5084
5085         * metadata.c (mono_string_from_bstr): Fix BSTR marshalling.
5086         Length prefix should be size in bytes. Fix bug #339530.
5087         
5088         * metadata.c (mono_string_to_bstr): Fix BSTR marshalling.
5089         Length prefix should be size in bytes. Fix bug #339530.
5090
5091         Code is contributed under MIT/X11 license.
5092
5093 2008-06-05  Bill Holmes <billholmes54@gmail.com>
5094
5095         * decimal.c:  Adding MSVC implementation to my_g_bit_nth_msf.
5096
5097         Contributed under MIT/X11 license.
5098
5099 2008-06-05  Martin Baulig  <martin@ximian.com>
5100
5101         * mono-debug-debugger.c
5102         (mono_debugger_check_breakpoints): Reflect latest runtime changes.
5103
5104 2008-06-05  Zoltan Varga  <vargaz@gmail.com>
5105
5106         * assembly.c (mono_assembly_load_from_full): Avoid calling the search hooks
5107         while holding the assemblies lock to prevent deadlocks. Handle the case
5108         where the search hook returns NULL but the assembly was still loaded.
5109         Fixes #323696.
5110
5111         * appdomain.c (set_domain_search_path): Acquire the domain lock since we
5112         modify domain state.
5113
5114 2008-06-05  Andreas Färber  <andreas.faerber@web.de>
5115
5116         * boehm-gc.c: Add DTrace probes gc-{begin,end}.
5117         * Makefile.am (pedump_LDADD): Post-process object files and
5118         add dtrace-generated object file, if necessary.
5119
5120         Code is contributed under MIT/X11 license.
5121
5122 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
5123
5124         * reflection.c (mono_dynamic_image_free): Free MonoDynamicImage::public_key.
5125
5126 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
5127
5128         * class.c (mono_type_get_full): Add a work-around for generic type definitions.
5129
5130 2008-06-04  Mark Probst  <mark.probst@gmail.com>
5131
5132         * threads.c: Try to free everything from the delayed free table
5133         when shutting down threads, and set the variable to NULL after the
5134         table is freed so that calling
5135         mono_thread_hazardous_try_free_all() when shutting down the root
5136         domain doesn't crash.
5137
5138 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
5139
5140         * class.c (mono_type_retrieve_from_typespec): Add an argument to inform
5141         the caller if resulting type was inflated.
5142
5143         * class.c (mono_class_create_from_typespec): Free the MonoType if it
5144         was inflated.
5145
5146         * class.c (mono_type_get_full): Free the MonoType if it was inflated.
5147
5148
5149 2008-06-04  Zoltan Varga  <vargaz@gmail.com>
5150
5151         * decimal.c (rescale128): Rework the code a bit so it no longer crashes the
5152         class library tests.
5153
5154         * icall.c (ves_icall_InternalInvoke): Applied patch from Andy Hume 
5155         (andyhume32@yahoo.co.uk). Add more useful exception messages. Fixes
5156         #396989.
5157
5158 2008-06-04  Mark Probst  <mark.probst@gmail.com>
5159
5160         * domain.c, domain-internals.h: The JIT infos are now freed by the
5161         JIT info table code.  They are freed immediately if there only a
5162         single JIT info table in circulation.  If there is more, the free
5163         is delayed via a queue.
5164
5165         * threads.c, threads-types.h: New hazard pointer function for
5166         freeing all freeable delayed items in one sitting.
5167
5168 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
5169
5170         * reflection.c (typebuilder_setup_fields): Use mempool for allocations.
5171
5172         * reflection.c (typebuilder_setup_properties): Same.
5173
5174         * reflection.c (typebuilder_setup_events): Same.
5175
5176 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
5177
5178         * reflection.c (mono_custom_attrs_from_builders): Receive a MonoMemPool
5179         and use it for allocating memory.
5180
5181         * reflection.c (mono_marshal_spec_from_builder): Same.
5182
5183         * reflection.c: Change code to use new signatures.
5184
5185         * metadata.c (mono_metadata_type_dup): Add a FIXME note.
5186
5187 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
5188
5189         * decimal.c (rescale128): Put back one line which was accidently commented
5190         out.
5191         
5192         * decimal.c (rescale128): Disable the code added by the last patch, as it seems
5193         to cause crashes.
5194
5195 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
5196
5197         * reflection.c (mono_reflection_generic_class_initialize): Name must
5198         be always malloc'ed so we can free it later on. Do this for field, property
5199         and event.
5200
5201         * metadata.c (free_generic_class): Free field, property and event names.
5202
5203 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
5204
5205         * reflection.c (fieldbuilder_to_mono_class_field): Use mono_metadata_type_dup
5206         instead of g_memdup.
5207
5208         * reflection.c (typebuilder_setup_fields): Same.
5209
5210 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
5211
5212         * decimal.c (rescale128): Optimize this function a bit more.
5213
5214 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
5215
5216         * metadata.c (free_generic_class): Release some memory from
5217         SRE generic classes.
5218
5219 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
5220
5221         * reflection.c (mono_image_get_generic_field_token): No reference
5222         to name is kept, free it.
5223
5224         * reflection.c (mono_reflection_generic_class_initialize): Free
5225         more memory of the inflated field.
5226
5227 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
5228
5229         * decimal.c (mono_decimalDiv): Moved equality checks here from managed
5230         code.
5231
5232 2008-06-02 Rodrigo Kumpera  <rkumpera@novell.com>
5233
5234         * reflection.c (mono_dynamic_image_free): Release memory used by
5235         MonoDynamicImage::array_methods elements.
5236
5237         * reflection.c (assembly_add_win32_resources): Release memory after
5238         encoding.
5239
5240 2008-06-02  Zoltan Varga  <vargaz@gmail.com>
5241
5242         * decimal.c (log2_32): Use an optimized version for this function too.
5243         
5244         * decimal.c (log2_64): Fix this on 32 bit machines.
5245
5246 2008-06-02 Rodrigo Kumpera  <rkumpera@novell.com>
5247
5248         * class.c (mono_dup_array_type): Implement allocation using a mempool.
5249
5250         * class.c (mono_metadata_signature_deep_dup): Same.
5251
5252         * metadata.c (mono_metadata_signature_dup_full): Added, allow dup'ng with
5253         a mempool.
5254
5255         * metadata.c (mono_metadata_signature_dup): Delegate to the _full version.
5256
5257         * metadata.c (mono_metadata_type_dup): Remove asserts and FIXME.
5258
5259         * metadata-internals.h: Added mono_metadata_signature_dup_full.
5260
5261         * class-internals.h: Update signatures to take a MonoMemPool.
5262
5263 2008-06-02  Dick Porter  <dick@ximian.com>
5264
5265         * icall.c (ves_icall_System_ComponentModel_Win32Exception_W32ErrorMessage): 
5266         * icall-def.h: Add
5267         System.ComponentModel.Win32Exception.W32ErrorMessage, using the
5268         FormatMessage API to get the error text.  Fixes bug 321827.
5269
5270 2008-06-02  Zoltan Varga  <vargaz@gmail.com>
5271
5272         * decimal.c: Add some micro optimizations to make decimal operations faster.
5273
5274 2008-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
5275
5276         * reflection.c (method_encode_clauses): Take a mempool
5277         as parameter and use it to allocate the clause array.
5278
5279         * reflection.c (mono_image_get_field_on_inst_token): Free
5280         the inflated type after encoding it.
5281
5282         * reflection.c (mono_dynamic_image_free): Free each element
5283         of MonoDynamicImage::gen_params.
5284
5285         * reflection.c (reflection_methodbuilder_to_mono_method):
5286         Allocate the generic param array from the mempool.
5287         Allocate signature params from the mempool.
5288
5289         * reflection.c (mono_reflection_generic_class_initialize):
5290         Free inflated fields after been used.
5291
5292 2008-05-30 Rodrigo Kumpera  <rkumpera@novell.com>
5293
5294         * icall.c: Reapply the memory leak fixes as they no
5295         longer make mono crash.
5296
5297 2008-05-30 Rodrigo Kumpera  <rkumpera@novell.com>
5298
5299         * reflection.c (mono_type_get_object): Don't store the suplied
5300         MonoType with type_hash. A caller which pass a type that
5301         was mono_metadata_type_dup'ed cannot free it reliably, as type_hash
5302         might end with a pointer to freed memory.
5303         The solution is to use byval_arg or this_arg from the associated
5304         MonoClass of the supplied type.
5305
5306 2008-05-29  Zoltan Varga  <vargaz@gmail.com>
5307
5308         * icall.c: Revert the rest of the last change as it breaks the build too.
5309
5310 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
5311
5312         * icall.c: Revert a leak fix as it's breaking the build.
5313
5314 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
5315
5316         * appdomain.c (mono_make_shadow_copy): Fix another leak of dir_name.
5317
5318 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
5319
5320         * appdomain.c (mono_make_shadow_copy): We leaked dir_name.
5321
5322 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
5323
5324         * icall.c: Fix some memory leaks.
5325
5326 2008-05-29  Dick Porter  <dick@ximian.com>
5327
5328         * threadpool.c (mono_thread_pool_remove_socket): Always remove the
5329         async socket operations from the pending list when a socket
5330         closes.  Leaving it until the threadpool services the event
5331         exposes a race condition when a socket descriptor is reused.
5332         Fixes bug 377589.
5333
5334 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
5335
5336         * object.c: Fix negative index check for array alocation.
5337
5338 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
5339
5340         * icall.c, marshal.c: Delegate wrappers should skip visibility.
5341         This check is performed by the verifier for IL created delegates
5342         and by Delegate::CreateDelegate for programatically created ones.
5343         Fixes #372406.
5344
5345 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
5346
5347         * sockey-io.c (ves_icall_System_Net_Sockets_Socket_Select_internal):
5348         Fix code to use mono_array_size_t instead of int.
5349
5350         Based on patch by Luis F. Ortiz.
5351         Contributed under X11 license.
5352         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
5353
5354 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
5355
5356         * icall.c: Added ves_icall_System_Array_GetLongLength and
5357         ves_icall_System_Array_CreateInstanceImpl64. Both allow handling big
5358         arrays.
5359
5360         * icall.h: Export both new functions.
5361
5362         Based on patch by Luis F. Ortiz.
5363         Contributed under X11 license.
5364         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
5365
5366 2008-05-28  Martin Baulig  <martin@ximian.com>
5367
5368         The debugger now requires exactly r103463.
5369
5370         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 71.
5371         This version is not supported by the debugger, wait for 72.
5372
5373 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
5374
5375         * object.h: Changed array related functions to use
5376         mono_array_size_t instead of guint32. Forgot to commit this file.
5377
5378         Patch by Luis F. Ortiz.
5379         Contributed under X11 license.
5380         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
5381
5382
5383 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
5384
5385         * object.h: Don't use G_MAXINT32 or G_MAXUINT32 as old glibs
5386         don't define it. Use the number literal instead.
5387
5388 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
5389
5390         * icall.c: Changed array related functions to use
5391         mono_array_size_t instead of guint32.
5392
5393         * icall.c (ves_icall_System_Array_GetLength): Check for length
5394         overflow under MONO_BIG_ARRAYS.
5395
5396         Based on patch by Luis F. Ortiz.
5397         Contributed under X11 license.
5398         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
5399
5400 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
5401
5402         * object.c: Add 64bits bounds check for arrays under MONO_BIG_ARRAYS.
5403
5404         Based on patch by Luis F. Ortiz.
5405         Contributed under X11 license.
5406         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
5407
5408 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
5409
5410         * object.c, object.h: Changed array related functions to use
5411         mono_array_size_t instead of guint32.
5412
5413         Patch by Luis F. Ortiz.
5414         Contributed under X11 license.
5415         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
5416
5417 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
5418
5419         * object.h: Introduced mono_array_size_t typedef. This must be used
5420         in all places an array length is expected. This is 64bits wide if
5421         MONO_BIG_ARRAYS is enabled.
5422
5423         Patch by Luis F. Ortiz.
5424         Contributed under X11 license.
5425         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
5426
5427 2008-05-27  Zoltan Varga  <vargaz@gmail.com>
5428
5429         * security-manager.c class.c: Set the class exception info by calling
5430         mono_class_set_failure ().
5431
5432         * class.c (mono_class_get_exception_data): New accessor function.
5433         (mono_class_set_failure): Store exception_data in the property hash.
5434
5435         * class-internals.h (struct _MonoClass): Store 'exception_data' outside
5436         the struct as a property.
5437
5438         * loader.c (mono_get_method_full): Store the lookup result for method
5439         tokens in method_cache, the others in methodref_cache to decrease the memory
5440         usage of hash tables.
5441
5442         * image.c (mono_image_close): Destroy method_cache and methodref_cache.
5443         (mono_image_init): method_cache is lazy inited now.
5444
5445         * metadata-internals.h (struct _MonoImage): Change method_cache to
5446         a MonoValueHashTable, add a separate methodref_cache.
5447
5448 2008-05-27  Eyal Alaluf <eyala@mainsoft.com>
5449
5450         * number-formatter.h: Fix tables to avoid arithemtic overflow in
5451           Double.ToString as exposed by Bug #383531.
5452
5453 2008-05-26  Zoltan Varga  <vargaz@gmail.com>
5454
5455         * number-formatter.h: Make some tables static.
5456
5457         * class.c (mono_method_set_generic_container): New accessor function.
5458         (mono_method_get_generic_container): Ditto.
5459
5460         * class-internals.h (struct _MonoMethod): Remove rarely used 
5461         'generic_container' field, store it in the property hash instead. Add 
5462         'is_generic' boolean field instead.
5463
5464         * image.c (mono_image_init): Initialize property_hash.
5465         (mono_image_close): Destroy property_hash.
5466
5467         * metadata-internals.h (struct _MonoImage): Add 'property_hash' hash table to
5468         hold rarely used fields of runtime structures belonging to this image.
5469
5470         * class.c loader.c verify.c icall.c reflection.c: Use the new accessor functions
5471         to get/set method->generic_container.
5472
5473         * loader.c (mono_get_method_from_token): Avoid loading the method header for
5474         generic methods.
5475
5476 2008-05-25  Zoltan Varga  <vargaz@gmail.com>
5477
5478         * class.c (mono_class_inflate_generic_method_full): Don't increase
5479         mono_stats.inflated_method_count for methods found in the cache.
5480
5481         * threads.c (mono_thread_request_interruption): Add a comment about 
5482         QueueUserAPC ().
5483
5484 2008-05-24  Zoltan Varga  <vargaz@gmail.com>
5485
5486         * class.c (setup_interface_offsets): Use sizeof (guint16) when allocating the
5487         interface_offsets_packed table.
5488         
5489         * class.c (mono_class_init): Remove some dead code.
5490
5491         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Call
5492         mono_class_setup_vtable () when CAS is active to detect security problems.
5493
5494 2008-05-23 Rodrigo Kumpera  <rkumpera@novell.com>
5495
5496         * verify.c (mono_delegate_type_equal): Handle VAR, MVAR and GENERICINST.
5497
5498         * verify.c (mono_delegate_signature_equal): Don't compar number of generic
5499         parameters as it's irrelevant for delegate checking.
5500
5501 2008-05-23  Zoltan Varga  <vargaz@gmail.com>
5502
5503         * class-internals.h class.c: Correct the name of the 'mono_no_setup_vtable_in_class_init' variable.
5504
5505         * class.c (mono_class_init): Control the creation of a generic vtable using
5506         a global which is true by default, but set to false by the runtime startup code.
5507         
5508         * class.c (mono_class_init): Avoid constructing a generic vtable in most cases.
5509         Disabled for now since it breaks the embedding API.
5510         Move the setup of class->methods for arrays to mono_class_setup_methods ().
5511         (mono_class_setup_methods): Add a memory barrier.
5512
5513         * object.c (mono_class_create_runtime_vtable): Add code to handle the case
5514         when mono_class_init () doesn't compute the generic vtable.
5515         
5516 2008-05-23  Massimiliano Mantione  <massi@ximian.com>
5517         * profiler.c: Added mono_profiler_install_statistical_call_chain,
5518         mono_profiler_stat_get_call_chain_depth and mono_profiler_stat_call_chain
5519         to support call chains (backtrace) in the stat profiler.
5520         * profiler.c, profiler-private.h: Likewise.
5521
5522 2008-05-22  Mark Probst  <mark.probst@gmail.com>
5523
5524         * generic-sharing.c: Init generic class when a method of it is
5525         requested via a runtime generic context.
5526
5527 2008-05-22  Zoltan Varga  <vargaz@gmail.com>
5528
5529         * class.c (mono_class_init): Add a comment about trying to avoid calling this.
5530
5531         * reflection.c (mono_type_get_object): Add a FIXME.
5532
5533         * loader.c (find_method_in_class): Use mono_class_get_method_by_index ().
5534
5535         * class.c (mono_class_get_method_by_index): New helper function, returning an
5536         entry in the class->methods array.
5537
5538 2008-05-21  Zoltan Varga  <vargaz@gmail.com>
5539
5540         * class.c (mono_class_init): Only do the array optimization for szarrays. 
5541         Avoid creating a generic vtable for generic instances as well.
5542         (mono_class_get_method_from_name_flags): Don't search in the metadata for
5543         generic instances.
5544
5545 2008-05-21 Rodrigo Kumpera  <rkumpera@novell.com>
5546
5547         * loader.c (mono_get_method_constrained): Inflate the signature
5548         with class context. Fix #325283.
5549
5550 2008-05-21  Zoltan Varga  <vargaz@gmail.com>
5551
5552         * object.c (mono_class_create_runtime_vtable): Add a comment.
5553
5554         * class.c (get_implicit_generic_array_interfaces): Call mono_class_init ()
5555         where needed.
5556         (setup_interface_offsets): Handle the case when this is called twice for arrays.
5557         (mono_class_setup_vtable_general): Add an assert.
5558         (mono_class_init): Avoid creating a generic vtable for arrays.
5559
5560         * class.c (mono_generic_class_get_class): Don't call setup_interface_offsets ()
5561         here, let mono_class_init () do that.
5562
5563         * class.c (mono_class_init): Avoid calling mono_class_setup_methods () for
5564         interfaces in mscorlib.
5565
5566         * class.c (mono_class_setup_vtable): Avoid calling setup_methods () for
5567         interfaces. Add some comments.
5568         (mono_class_init): Call mono_class_setup_methods () here since it is no
5569         longer called by mono_class_setup_vtable ().
5570
5571         * object.c (mono_class_proxy_vtable): Null out entries in pvt->vtable which are
5572         not set in class->vtable.
5573         (mono_class_create_runtime_vtable): Reenable the disabled code.
5574
5575         * object.c (mono_class_create_runtime_vtable): Disable the last change for
5576         now as it causes some test failures.
5577
5578         * object.c (mono_class_create_runtime_vtable): Avoid creating a generic vtable
5579         if using the vtable trampoline. Also remove some strange code which put the
5580         generic methods themselves into the vtable slots. Remove the AOT init_vtable
5581         stuff as it is no longer needed.
5582
5583 2008-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
5584
5585         * pedump.c: Give make --verify all option check code as well.
5586         Using --verify code won't check for metadata now.
5587
5588 2008-05-19  Martin Baulig  <martin@ximian.com>
5589
5590         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 70.
5591
5592         * mono-debug.c
5593         (_mono_debug_using_mono_debugger): New global variable; it's set
5594         directly by the debugger, so mono_debug_using_mono_debugger() also
5595         works after attaching.
5596
5597 2008-05-18 Rodrigo Kumpera  <rkumpera@novell.com>
5598
5599         * object.c (mono_class_create_runtime_vtable): Use memory barriers
5600         as we do double checked locking on MonoClass::runtime_info and
5601         MonoClassRuntimeInfo::domain_vtables.
5602
5603 2008-05-18  Zoltan Varga  <vargaz@gmail.com>
5604
5605         * debug-helpers.c (print_field_value): Fix a warning.
5606
5607 2008-05-16  Zoltan Varga  <vargaz@gmail.com>
5608
5609         * object.c (mono_object_get_virtual_method): Fix a crash if method->slot is not
5610         set in the AOT case.
5611
5612 2008-05-16 Rodrigo Kumpera  <rkumpera@novell.com>
5613
5614         * class.c (mono_class_setup_vtable_general): Use memory barriers
5615         as we do double checked locking on MonoClass::vtable.
5616
5617 2008-05-16 Rodrigo Kumpera  <rkumpera@novell.com>
5618
5619         * reflection.c (resolve_object): Inflate only if the generic context
5620         is not null. Fixes #389886.
5621
5622 2008-05-15  Jonathan Chambers  <joncham@gmail.com>
5623
5624         * metadata.c (emit_marshal_string): Free return strings using mono_marshal_free
5625         instead of g_free.
5626
5627         Code is contributed under MIT/X11 license.
5628
5629 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
5630
5631         * class.c: Revert unrelated change.
5632
5633 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
5634
5635         * verify.c (check_is_valid_type_for_field_ops): Type on stack can be
5636         a generic instantiation, use mono_class_from_mono_type instead of playing
5637         with MonoType directly.
5638
5639 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
5640
5641         * class.c: Added mono_class_has_parent_and_ignore_generics. Visibility
5642         checks must ignore generic instantiations, so mono_class_has_parent is not
5643         suitable. Fixes #390128.
5644
5645 2008-05-14  Zoltan Varga  <vargaz@gmail.com>
5646
5647         * reflection.c (mono_image_create_token): Add a 'register_token' argument, and use
5648         it to avoid registering tokens during metadata generation. Fixes #390023.
5649
5650 2008-05-14  Kornél Pál  <kornelpal@gmail.com>
5651
5652         * coree.c: Rename dwOldProtect to OldProtect that makes naming convention
5653         consistent.
5654
5655         Contributed under MIT/X11 license.
5656
5657 2008-05-14  Kornél Pál  <kornelpal@gmail.com>
5658
5659         * domain.c (mono_init_internal): Enable LoadLibrary support. Load EXE image
5660         even when get_runtimes_from_exe didn't load it that allows mono_fixup_exe_image
5661         to fixup the EXE image.
5662         (mono_cleanup): Use mono_close_exe_image.
5663         (mono_close_exe_image): New function.
5664         * image.c: Include "marshal.h".
5665         (mono_image_open_from_module_handle): Add ref_count argument. Return the image.
5666         (mono_image_open_full, mono_image_close): Fix LoadLibrary/FreeLibrary reference
5667         counting when the image is loaded outside of mono_image_open_full. Set status
5668         based on GetLastError.
5669         * coree.c: Include required headers. Add init_from_coree.
5670         (_CorDllMain): Support fix in mono_image_open_full, mono_image_close. Call
5671         mono_assembly_open only when the image has vtfixups. Set init_from_coree.
5672         (_CorExeMain): Set init_from_coree.
5673         (CorExitProcess): Only call ExitProcess for now.
5674         (CorBindToRuntimeEx): New stub implementation.
5675         (CorBindToRuntime): New function.
5676         (MonoFixupCorEE): Fixup CorBindToRuntime and CorBindToRuntimeEx.
5677         (MonoFixupExe): ILONLY executables require no fixups.
5678         (mono_set_act_ctx): New function to set activation context.
5679         (mono_load_coree): Use init_from_coree. Call mono_set_act_ctx.  
5680         * coree.h: Move STATUS_SUCCESS and STATUS_INVALID_IMAGE_FORMAT to header.
5681         Declare mono_module_handle, coree_module_handle, mono_get_module_file_name,
5682         mono_load_coree, mono_fixup_exe_image and mono_image_open_from_module_handle
5683         as MONO_INTERNAL.
5684         * domain-internals.h: Add mono_close_exe_image.
5685
5686         Contributed under MIT/X11 license.
5687
5688 2008-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
5689
5690         * metadata.c (mono_metadata_compute_size): Correctly calculate field
5691         size for generic param and event tables. Fixes #388977.
5692
5693 2008-05-13  Zoltan Varga  <vargaz@gmail.com>
5694
5695         * loader.c (mono_method_signature): Use memory barriers because of the double
5696         checked locking pattern.
5697
5698         * threads.c (remove_and_abort_threads): Stop and wait for threads which are
5699         aborting or aborted as well. Fixes #376391.
5700         
5701         * threads.c (mono_thread_execute_interruption): Avoid depending on no longer
5702         existing runtime state in the Suspend handler during shutdown.
5703
5704 2008-05-12  Zoltan Varga  <vargaz@gmail.com>
5705
5706         * threads.c (mono_thread_request_interruption): Add some FIXMEs.
5707
5708         * threads.c (mono_thread_suspend_all_other_threads): Add support for threads 
5709         which are starting up or shutting down.
5710
5711         * threads.c (mono_threads_set_shutting_down): Don't return a value since
5712         this function never returns if the runtime is already shutting down.
5713
5714         * icall.c (ves_icall_System_Environment_Exit): Update after 
5715         mono_threads_set_shutting_down () signature change.
5716         
5717 2008-05-09 Rodrigo Kumpera  <rkumpera@novell.com>
5718
5719         * class.c: Added can_access_instantiation to verify if the instantiation
5720         is visible. Fix access check for nested types as they returned TRUE
5721         before doing type and generic instantiation visibility checks.
5722
5723 2008-05-08 Rodrigo Kumpera  <rkumpera@novell.com>
5724
5725         * reflection.c (mono_reflection_create_generic_class): The created type
5726         must have a different container from its TypeBuilder. Otherwise they
5727         will end sharing generic arguments, which is wrong.
5728
5729         Due to the sharing, making a generic instance of the created type using
5730         the TypeBuider generic arguments resulted in the generic type definition
5731         been returned, which is wrong as well.
5732
5733         As a bonus the code was leaking the type_params array. This memory should
5734         be allocated from the image mempool.
5735
5736         This fixes bug #354047.
5737
5738 2008-05-08 Rodrigo Kumpera  <rkumpera@novell.com>
5739
5740         * metadata-internals.h: Move MONO_SECMAN_FLAG macros from mini/declsec.h
5741         to here         as they are now used in assembly.c new code.
5742         Added a skipverification flag to MonoAssembly.
5743         New internal function mono_assembly_has_skip_verification.
5744
5745         * assembly.c: New function mono_assembly_has_skip_verification. It checks
5746         if an assembly has a version 2.0 SkipVerification security attribute. Fixes
5747         part of #387274.
5748
5749 2008-05-07  Zoltan Varga  <vargaz@gmail.com>
5750
5751         * object.c (mono_object_get_virtual_method): Inflate the resulting method if
5752         needed. Fixes #387034.
5753
5754         * class.c (mono_class_inflate_generic_type): Avoid a crash if context is NULL.
5755
5756 2008-05-06  Miguel de Icaza  <miguel@novell.com>
5757
5758         * assembly.c (mono_assembly_load_reference): Prevent crash while
5759         disassembling Silverlight 2.0 executables while we still do not
5760         have GACed libraries.
5761
5762 2008-05-07  Zoltan Varga  <vargaz@gmail.com>
5763
5764         * reflection.c: Special case generic type definitions as well. Fixes #383444.
5765
5766 2008-05-06  Zoltan Varga  <vargaz@gmail.com>
5767
5768         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Fix handling
5769         of the dynamic case. Fixes #387404.
5770
5771 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
5772
5773         *verify.c (mono_verifier_is_class_full_trust): If under
5774         verify_all and the verifier mode was not set, only
5775         gac and corlib types are fulltrust. This makes --verify-all
5776         usable to detect unverifiable code, which is the expected
5777         use case.
5778
5779 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
5780
5781         * verify.h: Ops, commited the header with debug
5782         enabled.
5783
5784 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
5785
5786         * verify.c (merge_stack): Use the new value on unverifiable
5787         stack merges.
5788
5789         * verify.c (verify_type_compatibility_full): Comparison
5790         of nullable types can't use mono_class_is_assignable_from.
5791
5792         * verify.c, verify.h: Added MONO_VERIFY_REPORT_ALL_ERRORS
5793         that makes all verification errors be reported.
5794
5795         * pedump.c: Pass MONO_VERIFY_REPORT_ALL_ERRORS to
5796         mono_method_verify.
5797
5798 2008-05-05  Robert Jordan  <robertj@gmx.net>
5799
5800         * marshal.c (mono_marshal_get_thunk_invoke_wrapper):
5801         support for value types. See #386415.
5802
5803         * object.c: comments.
5804
5805         Code is contributed under MIT/X11 license.
5806
5807 2008-05-05  Martin Baulig  <martin@ximian.com>
5808
5809         * debug-mono-symfile.h
5810         (MONO_SYMBOL_FILE_COMPATIBILITY_VERSION): Removed; dropped support
5811         for old pre-terrania symbol files.
5812
5813 2008-05-05  Andreas Färber  <andreas.faerber@web.de>
5814
5815         * mono-config.c: Add ppc64 architecture.
5816
5817         Code is contributed under MIT/X11 license.
5818
5819 2008-05-05  Andreas Färber  <andreas.faerber@web.de>
5820
5821         * object.c (mono_create_ftnptr, mono_get_addr_from_ftnptr):
5822           PPC64 uses function descriptors as well.
5823
5824         Code is contributed under MIT/X11 license.
5825
5826 2008-05-04  Zoltan Varga  <vargaz@gmail.com>
5827
5828         * object.c (compute_class_bitmap): Ignore literal static fields.
5829
5830         * sgen-gc.c (mono_gc_base_init): Print some help when the MONO_GC_DEBUG env
5831         var has an invalid format.
5832         (describe_ptr): Add some sanity checks for the vtable.
5833         (add_nursery_frag): Clear unused nursery fragments.
5834         (major_collection): Clear all remaining nursery fragments.
5835
5836 2008-05-03  Robert Jordan  <robertj@gmx.net>
5837
5838         * image.c, metadata-internals.h: add thunk_invoke_cache.
5839
5840         * marshal.c, marshal.h: implement
5841         mono_marshal_get_thunk_invoke_wrapper ().
5842
5843         * object.c, object.h: implement mono_method_get_unmanaged_thunk ().
5844
5845         Code is contributed under MIT/X11 license.
5846
5847 2008-05-02 Rodrigo Kumpera  <rkumpera@novell.com>
5848
5849         * verify.c (do_leave): Empty the stack.
5850
5851 2008-05-02 Rodrigo Kumpera  <rkumpera@novell.com>
5852
5853         * class.c (mono_class_is_assignable_from): Variance
5854         doesn't work between reference and value types. For example,
5855         given type C<T+>, C<int32> is not assignable to C<object>.
5856         Break the argument checking loop on first error. 
5857
5858 2008-05-02  Atsushi Enomoto  <atsushi@ximian.com>
5859
5860         * icall.c : base64_to_byte_array() needs some more strict
5861           check for sequence of '=' characters. Patch by Santa
5862           Marta (http://deee.g.hatena.ne.jp/santamarta).
5863
5864           Contributed under MIT/X11 license.
5865           (see http://www.lingr.com/room/mono-jp/archives/2008/04/20)
5866
5867 2008-05-02  Jonathan Chambers  <joncham@gmail.com>
5868
5869         * domain.c: Disable LoadLibrary support to fix Win32 build.
5870
5871         Code is contributed under MIT/X11 license.
5872
5873 2008-05-02  Zoltan Varga  <vargaz@gmail.com>
5874
5875         * sgen-gc.c: Add support for clearing nursery memory when a tlab is allocated,
5876         to help with cache behaviour.
5877
5878 2008-05-01  Miguel de Icaza  <miguel@novell.com>
5879
5880         * appdomain.c (mono_domain_from_appdomain): Add new accessor
5881         method. 
5882
5883 2008-05-01  Zoltan Varga  <vargaz@gmail.com>
5884
5885         * sgen-gc.c: Implement thread-local allocation and a managed allocation routine.
5886
5887 2008-05-01  Dick Porter  <dick@ximian.com>
5888
5889         * process.c (process_get_fileversion): Only pass 16 bits of
5890         language ID to VerLanguageName.  Fixes bug 381204.
5891
5892 2008-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
5893
5894         * verify.c (mono_method_verify): Fix the comparison
5895         operator for code bounds check.
5896
5897 2008-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
5898
5899         * verify.c (mono_method_verify): Check the bounds of
5900         all access of the code array.
5901
5902 2008-04-29  Kornél Pál  <kornelpal@gmail.com>
5903
5904         * appdomain.c: Use HAVE_SYS_UTIME_H that fixes MSVC build.
5905
5906 2008-04-28  Zoltan Varga  <vargaz@gmail.com>
5907
5908         * image.c (mono_image_strong_name_position): Fix return value when the rva is
5909         not valid.
5910
5911 2008-04-28  Kornél Pál  <kornelpal@gmail.com>
5912
5913         * loader.c (mono_get_method_from_token, mono_method_signature): Add
5914         support for METHOD_IMPL_ATTRIBUTE_NATIVE.
5915         * domain.c (mono_init_internal): Load and fixup mscoree.dll on startup and
5916         fixup main EXE images when using mono.exe for mixed-mode assembly support.
5917         * domain-internals.h: Add MonoLoadFunc, mono_install_runtime_load and
5918         mono_runtime_load.
5919         * appdomain.c: Add mono_install_runtime_load, mono_runtime_load to support
5920         runtime initialization from metadata.
5921         * assembly.c: Remove obsolete ceGetModuleFileNameA.
5922         (mono_set_rootdir): Use mono_get_module_file_name.
5923         (mono_assembly_load_from_full): Call mono_image_fixup_vtable for module
5924         handles.
5925         * cil-coff.h: Add MonoVTableFixup. Update mono_cli_rva_image_map signature.
5926         * metadata-internals.h: Add is_module_handle to _MonoImage on Windows.
5927         * image.c (mono_cli_rva_image_map): Use MonoImage instead of
5928         MonoCLIImageInfo. Add support for module handles.
5929         (load_cli_header): Update mono_cli_rva_image_map signature.
5930         (load_metadata_ptrs): Update mono_cli_rva_image_map signature.
5931         (mono_image_strong_name_position): Use mono_cli_rva_image_map.
5932         (mono_image_rva_map): Add support for module handles.
5933         (mono_image_ensure_section_idx): Add support for module handles.
5934         (mono_image_close): Add support for module handles.
5935         (do_load_header): Add support for module handles.
5936         (mono_image_open_from_module_handle): New function for internal use.
5937         (mono_image_open_full): Load normal images using LoadLibrary on Windows.
5938         (mono_image_load_module): Call mono_image_fixup_vtable for module handles.
5939         (mono_image_load_file_for_image): Call mono_image_fixup_vtable for module
5940         handles.
5941         (mono_image_fixup_vtable): New function for mixed-mode assembly support.
5942         * image.h: Add mono_image_fixup_vtable.
5943         * coree.c: New file for mscoree.dll functions and mixed-mode assembly
5944         support.
5945         * coree.h: New file.
5946         * marshal.c (mono_marshal_get_native_wrapper): Throw exception for
5947         unsupported native code.
5948         (mono_marshal_set_callconv_from_modopt): New function splitted from
5949         mono_marshal_get_managed_wrapper.
5950         (mono_marshal_get_managed_wrapper): Use
5951         mono_marshal_set_callconv_from_modopt.
5952         (mono_marshal_get_vtfixup_ftnptr): New function for mixed-mode assembly support.
5953         * marshal.h: Add mono_marshal_get_vtfixup_ftnptr.
5954         * gc.c (mono_gc_init): Don't wait for the finalizer thread on Windows because
5955         that results in a deadlock when the runtime is loaded in _CorDllMain.
5956         * Makefile.am: Add coree.c and coree.h.
5957
5958         Contributed under MIT/X11 license.
5959
5960 2008-04-28  Mark Probst  <mark.probst@gmail.com>
5961
5962         * generic-sharing.c: Search for type arguments in array element
5963         types as well.
5964
5965 2008-04-28  Mark Probst  <mark.probst@gmail.com>
5966
5967         * class-internals.h, generic-sharing.c: New, small runtime generic context.
5968
5969         * metadata-internals.h, domain.c, image.c: Less bookkeeping is required for the new RGCTX.
5970
5971         * object.c: Don't setup the RGCTX when the vtable is created,
5972         because we're setting it up lazily now.
5973
5974 2008-04-26  Zoltan Varga  <vargaz@gmail.com>
5975
5976         * sgen-gc.c: Make the 'desc' variables an mword instead of a guint32 to fix 
5977         64 bit support.
5978
5979 2008-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
5980
5981         * verify.c (verify_class_for_overlapping_reference_fields): 
5982         If class is under fulltrust allow reference types to overllap
5983         if they have the same RVA.
5984
5985 2008-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
5986
5987         * pedump.c: Added new flag valid-only, that makes the verifier
5988         behaves just like --security=validil. It won't fail type load
5989         due to unverifiable restrictions.
5990
5991 2008-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
5992
5993         * class-internals.h (struct MonoMethod): Added a verification_success
5994         field to cache verifier executions. Reduced MonoMethod:slot size by
5995         one bit.
5996
5997 2008-04-23  Zoltan Varga  <vargaz@gmail.com>
5998
5999         * sgen-gc.c (OBJ_RUN_LEN_SIZE): Make this and other macros take a 'desc' argument
6000         instead of a 'vt' argument to save an indirection and to allow these to be used
6001         for valuetypes.
6002         (scan_vtype): New helper function to scan an area using a gc descriptor.
6003         (mono_gc_wbarrier_value_copy): Implement this.
6004         (handle_remset): Add support for REMSET_VTYPE.
6005         (find_in_remset_loc): Ditto.
6006         (mono_gc_base_init): Allow some debugging options to be controlled through the
6007         use of the MONO_GC_DEBUG env variable.
6008         (mono_gc_alloc_obj): Add support the 'collect-before-allocs' debug option.
6009         (collect_nursery): Add support for the 'check-at-minor-collection' debug option.
6010
6011 2008-04-23  Martin Baulig  <martin@ximian.com>
6012
6013         * domain.c (mono_domain_create): Move the call to
6014         mono_debug_domain_create() down, after allocating the domain id.
6015
6016 2008-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
6017
6018         verify.c (verify_class_for_overlapping_reference_fields): Skip
6019         static fields while verifying for overlapping fields as they
6020         don't matter at all.
6021
6022 2008-04-23  Marek Habersack  <mhabersack@novell.com>
6023
6024         * domain-internals.h: added a declaration of
6025         mono_make_shadow_copy.
6026
6027         * assembly.c (mono_assembly_open_full): shadow copying of
6028         assemblies moved to here, so that all the assemblies within the
6029         application domain's private binary directories can be
6030         processed. Fixes bug #380546
6031
6032         * appdomain.c (mono_make_shadow_copy): make_shadow_copy renamed to
6033         mono_make_shadow_copy and made non-static. The decision whether
6034         to shadow-copy an assembly is made based on its location - it's
6035         copied if it's in one of the private application domain binary
6036         directories and its different to the target file in the shadow
6037         directory. Fixes bug #380546
6038
6039 2008-04-22  Zoltan Varga  <vargaz@gmail.com>
6040
6041         * reflection.c (fixup_method): Handle {Method|Constructor}OnTypeBuilderInst.
6042
6043         * object-internals.h: Add MonoReflection{Method|Constructor}OnTypeBuilderInst
6044         types.
6045
6046         * reflection.c (mono_image_create_token): Handle 
6047         Method/ConstructorOnTypeBuilderInst.
6048         (resolve_object): Ditto.
6049         (inflate_mono_method): Receive the inflated class instead of a MonoGenericClass
6050         so it can be called from resolve_object. Also handle the case when the inflated
6051         class already has its methods setup.
6052
6053 2008-04-21  Martin Baulig  <martin@ximian.com>
6054
6055         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 69.
6056
6057 2008-04-20  Geoff Norton  <gnorton@novell.com>
6058
6059         * icall.c: Fix the _NSGetEnviron define to prevent an impropoer
6060         pointer dereference.
6061
6062 2008-04-15  Marek Habersack  <mhabersack@novell.com>
6063
6064         * appdomain.c (try_load_from): if IOMAP is in effect, call the
6065         portability API to look up the assembly file. Fixes behavior in
6066         situations when the application has a bin/ directory, but the
6067         assembly search patch refers to Bin/ (and thus the requested file
6068         name is Bin/SomeLibrary.dll). Fixes bug #379888
6069
6070 2008-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
6071
6072         verify.c (mono_type_is_generic_argument): Extracted this check
6073         from a dozen places to here.
6074
6075         verify.c: Fixed all issues related to boxing generic arguments
6076         and their constraints.
6077
6078 2008-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
6079
6080         verify.c (mono_class_interface_implements_interface): Fix win32 build.
6081
6082 2008-04-14  Zoltan Varga  <vargaz@gmail.com>
6083
6084         * reflection.c (mono_custom_attrs_construct): Fix crash when the cattr type
6085         isn't finished yet. Fixes #363447.
6086
6087 2008-04-13  Zoltan Varga  <vargaz@gmail.com>
6088
6089         * class.c (mono_bounded_array_class_get): Fix the name of bounded array types.
6090         Fixes #346419.
6091
6092 2008-04-13  Jb Evain  <jbevain@novell.com>
6093
6094         * domain.c: update the 2.1 profile versions.
6095         Merged from the Moonlight 2 branch.
6096
6097 2008-04-12  Zoltan Varga  <vargaz@gmail.com>
6098
6099         * assembly.c (mono_assembly_load_from_full): Do the check for loading other
6100         mscorlibs for the non-refonly case as well.
6101
6102         * image.c (do_mono_image_load): Remove the mscorlib check, it is already done
6103         in mono_assembly_load_from_full (). Fixes #378924.
6104
6105 2008-04-11  Geoff Norton  <gnorton@novell.com>
6106
6107         * icall.c: The global extern environ doesn't exist on Mac.  We
6108         need to call NSGetEnviron instead.
6109
6110 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
6111
6112         verify.c: Add generic method constraint verification.
6113
6114 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
6115
6116         class.c (mono_class_inflate_generic_method_full): Add a long
6117         explanation to the is_mb_open hack. Remove the FIXME.
6118
6119 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
6120
6121         * verify.c (mono_method_verify): Mark all unknown opcodes
6122         as invalid. Mark jmp as unverifiable.
6123
6124 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
6125
6126         * verify.c: Add code to do type constraint verification on class instances.
6127
6128         * verify.c (mono_verifier_verify_class): Use the type constraint 
6129         verification code.
6130
6131 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
6132
6133         * class.c (mono_class_get_field_default_value): Don't pass cindex
6134         as hint to mono_metadata_get_constant_index. The local is not initialized
6135         and should contain garbage most of the time. This could only work
6136         with a lot of luck.
6137
6138 2008-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
6139
6140         * tokentype.h: Add MONO_TOKEN_GENERIC_PARAM.
6141
6142 2008-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
6143
6144         * class-internals.h: Add generic_param_token to MonoClass::sizes union.
6145
6146         * class.c (mono_class_from_generic_parameter): Save the token of the
6147         generic param in MonoClass::sizes.generic_param_token.
6148
6149         * reflection.c (mono_custom_attrs_from_class): If the class type is
6150         VAR or MVAR retrieve the attributes of the generic param.
6151
6152 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
6153
6154         * class.c (mono_class_init): Do class verification if the verifier
6155         is enabled.
6156
6157 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
6158
6159         * verify-internal.h: Added mono_verifier_verify_class.
6160
6161         * verify.c: Added mono_verifier_verify_class. It checks for
6162         classes with explicit layout that have overlapping reference fields.
6163
6164         * pedump.c: Init the verifier state prior to verification. Fixed
6165         command line arguments.
6166
6167 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
6168
6169         * Makefile.am: Added verify-internals.h, hopefully fix the build.
6170
6171 2008-04-08  Zoltan Varga  <vargaz@gmail.com>
6172
6173         * verify-internals.h: Fix a warning.
6174
6175 2008-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
6176
6177         * verify-internals.h: New header with the verifier configuration
6178         extracted from mini.c.
6179
6180         * verify.c: Implemented the new functions exported by verify-internals.h.
6181
6182 2008-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
6183
6184         * verify.c: Add proper verification of ckfinite.
6185
6186 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
6187
6188         * verify.c (do_conversion): Improved error message to something
6189         more meanfull.
6190
6191         * verify.c (check_is_valid_type_for_field_ops): Fix to work
6192         with primitive types.
6193
6194 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
6195
6196         * verify.c: Added tail prefix checking. Marked icall
6197         as unverifible.
6198
6199 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
6200
6201         * verify.c: Fix the detection of branches to the middle
6202         of an instruction.
6203
6204 2008-04-03 Rodrigo Kumpera  <rkumpera@novell.com>
6205
6206         * verify.c: Implemented verification of volatile. and
6207         unaligned. prefix. Check if a type is valid after retrieving it.
6208
6209 2008-04-01  Dick Porter  <dick@ximian.com>
6210
6211         * process.c (process_get_fileversion): If there's no string block,
6212         set the file language to en_US.  Fixes the other new part of bug
6213         374600.
6214
6215 2008-03-29 Rodrigo Kumpera  <rkumpera@novell.com>
6216
6217         * class.c: New functions mono_method_can_access_field_full and
6218         mono_method_can_access_method_full. They perform type visibility
6219         and type site check.
6220
6221         * class-internal.h: Added exported functions.
6222
6223         * verify.c: Use new functions to implement proper visibility checks.
6224
6225 2008-03-29  Zoltan Varga  <vargaz@gmail.com>
6226
6227         * mono-config.h: Add missing G_BEGIN_DECLS/G_END_DECLS. Fixes #375188.
6228
6229 2008-03-28  Dick Porter  <dick@ximian.com>
6230
6231         * process.c (process_get_fileversion): Use the first language ID
6232         we see, rather than insisting on an invariant language.  Fixes bug
6233         374600.
6234
6235 2008-03-28  Zoltan Varga  <vargaz@gmail.com>
6236
6237         * reflection.c (calc_section_size): Use add_stream_zero to align the size of
6238         the streams to fix reading of invalid memory later.
6239
6240         * metadata.h (MonoType): Use 'MonoTypeEnum' instead of int for the 'type' field
6241         to ease debugging.
6242
6243 2008-03-26  Zoltan Varga  <vargaz@gmail.com>
6244
6245         * marshal.c (signature_dup): Use mono_metadata_signature_alloc ().
6246         (cominterop_method_signature): Ditto. Fix the size passed to memcpy.
6247
6248 2008-03-26  Massimiliano Mantione  <massi@ximian.com>
6249         * threads.h: Added MonoThreadManageCallback type and
6250         mono_thread_set_manage_callback prototype
6251         * object-internals.h: In _MonoThread, renamed unused6 to manage_callback
6252         (used to store the mono_thread_manage callback).
6253         * threads.c: Added mono_thread_set_manage_callback, and handle
6254         "MonoThread->manage_callback" in build_wait_tids.
6255
6256 2008-03-26  Dick Porter  <dick@ximian.com>
6257
6258         * process.c (process_get_fileversion): Set FileVersionInfo strings
6259         to Empty when the resource doesn't have the particular info.
6260         Fixes bug 355717.
6261
6262 2008-03-25 Rodrigo Kumpera  <rkumpera@novell.com>
6263
6264         * verify.c (mono_method_verify): Proper prefix validation.
6265
6266 2008-03-25  Zoltan Varga  <vargaz@gmail.com>
6267
6268         * icall.c (ves_icall_InternalInvoke): Return exceptions thrown by the icall
6269         itself in a separate argument instead of throwing them. Fixes #373448.
6270
6271         * appdomain.c: Bump corlib version.
6272
6273 2008-03-24 Rodrigo Kumpera  <rkumpera@novell.com>
6274
6275         * verify.c: Implemented readonly prefix and verify controled mutability pointers.
6276
6277 2008-03-20  Kornél Pál  <kornelpal@gmail.com>
6278
6279         * file-io.c, filewatcher.c, threadpool.c, threads.c: Removed Windows
6280         version macros.
6281
6282 2008-03-20  Mark Probst  <mark.probst@gmail.com>
6283
6284         * generic-sharing.c, class-internals.h: Code for putting
6285         reflection types into the runtime generic context.
6286
6287 2008-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
6288
6289         * icall.c (ves_icall_get_method_info): Return correct values for the call convention.
6290         Fixes #340662. 
6291
6292
6293 2008-03-17 Rodrigo Kumpera  <rkumpera@novell.com>
6294
6295         * verify.c (VerifyContext): Added instruction prefix data to the struct.
6296
6297         * verify.c (is_compatible_boxed_valuetype): Don't check if the type is a valuetype, been boxed is enough.
6298
6299         * verify.c (do_invoke): Support constrained callvirt form. Grouped similar checks together.
6300
6301         * verify.c (do_cast): Let the result value keep the boxed status.
6302
6303         * verify.c (mono_method_verify): Add proper support for prefixed and implement contrained.
6304
6305 2008-03-17  Jb Evain  <jbevain@novell.com>
6306
6307         * reflection.c: when running on a 2.0 runtime, emit
6308         unconditionally the #~ header version as 2.0, and the
6309         CLI header version as 2.5, for symmetry's sake with csc.
6310
6311 2008-03-16  Zoltan Varga  <vargaz@gmail.com>
6312
6313         * class.c: Remove the unused cache_interface_offsets stuff.
6314
6315         * class.c loader.c domain.c verify.c metadata.c debug-helpers.c threadpool.c
6316         profiler.c: Fix warnings.
6317
6318 2008-03-16  Mark Probst  <mark.probst@gmail.com>
6319
6320         * generic-sharing.c, class-internals.h: Support for putting
6321         methods into the runtime generic context.
6322
6323 2008-03-16  Zoltan Varga  <vargaz@gmail.com>
6324
6325         * class.c (mono_class_setup_fields): Ignore calls made to this function for
6326         classes which are generic instances of not-yet finished typebuilders. Fixes
6327         #351172.
6328
6329         * reflection.c (fixup_method): Add support for FieldOnTypeBuilderInst.
6330
6331 2008-03-15  Zoltan Varga  <vargaz@gmail.com>
6332
6333         * metadata-internals.h (MonoDynamicImage): Add 'generic_def_objects' hash table.
6334
6335         * class-internals.h (MonoMethodInflated): Remove the rarely used reflection_info
6336         field, replace it with a hash table in MonoDynamicImage.
6337
6338         * reflection.c (inflate_mono_method): Access the generic definition object from
6339         image->generic_def_objects instead of imethod->reflection_info.
6340
6341         * reflection.c (mono_reflection_bind_generic_method_parameters): Ditto. 
6342
6343         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition): Ditto.
6344         
6345         * image.c (mono_image_close): Move the dynamic image freeing code to a separate
6346         function in reflection.c so it is easier to keep in sync with the dynamic image
6347         creation code.
6348
6349         * reflection.c (mono_dynamic_image_free): New internal function, extracted from
6350         mono_image_close ().
6351
6352 2008-03-15  Mark Probst  <mark.probst@gmail.com>
6353
6354         * class.c (mono_class_generic_sharing_enabled): Disable generic
6355         sharing for all architectures except AMD64 and x86 to fix build.
6356
6357 2008-03-14 Rodrigo Kumpera  <rkumpera@novell.com>
6358
6359         * verify.c: Use the generic definition MonoGenericContext when available.
6360         Remove code for checking generics instance compatibility in favor of
6361         mono_class_is_assignable_from.
6362
6363 2008-03-14  Mark Probst  <mark.probst@gmail.com>
6364
6365         * marshal.c, marshal.h, metadata-internals.h, image.c,
6366         wrapper-types.h: New wrapper for invoking a shared static method
6367         without having to pass the runtime generic context argument.
6368
6369 2008-03-14 Rodrigo Kumpera  <rkumpera@novell.com>
6370
6371         * icall-def.h: Add missing function PerformanceCounterCategory::GetInstanceNames.
6372
6373 2008-03-14  Zoltan Varga  <vargaz@gmail.com>
6374
6375         * reflection.c (mono_image_get_field_on_inst_token): Add caching.
6376         
6377         * reflection.c (mono_image_get_field_on_inst_token): New helper function to
6378         create a token from a FieldOnTypeBuilderInst.
6379         (mono_image_create_token): Handle FieldOnTypeBuilderInst.
6380         (resolve_object): Ditto.
6381
6382         * object-internals.h (MonoReflectionFieldOnTypeBuilderInst): New structure
6383         mirroring System.Reflection.Emit.FieldOnTypeBuilderInst.
6384
6385 2008-03-14  Martin Baulig  <martin@ximian.com>
6386
6387         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 68.
6388
6389         * debug-mono-symfile.h
6390         (MONO_SYMBOL_FILE_VERSION): Bump to 41.
6391         (MONO_SYMBOL_FILE_COMPATIBILITY_VERSION): New #define.
6392
6393 2008-03-10  Martin Baulig  <martin@ximian.com>
6394
6395         * debug-mono-symfile.h
6396         (MonoSymbolFileMethodAddress): Removed `num_lexical_blocks' and
6397         `lexical_block_table_offset'.
6398         (MonoDebugMethodInfo): Removed `num_lexical_blocks' and
6399         `lexical_blocks'.
6400         (MonoSymbolFile): Added `version'.
6401
6402         * mono-debug.h
6403         (MonoDebugLexicalBlockEntry): Removed.
6404         (MonoDebugMethodJitInfo): Removed `num_lexical_blocks' and
6405         `lexical_blocks'.
6406
6407         * mono-debug.c (mono_debug_add_method): Don't compute lexical
6408         blocks here; the debugger now does this internally.
6409
6410 2008-02-27  Martin Baulig  <martin@ximian.com>
6411
6412         * object.c (mono_runtime_exec_main): Call
6413         `mono_debugger_event (MONO_DEBUGGER_EVENT_REACHED_MAIN)' and
6414         `mono_debugger_event (MONO_DEBUGGER_EVENT_MAIN_EXITED)' here.
6415
6416 2008-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
6417
6418         * verify.c (verify_type_compatibility_full): Allow native int to be converted
6419         to native pointer in non-strict mode. Required to "(IntPtr)null" work.
6420
6421 2008-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
6422
6423         * verify.c (verify_ldftn_delegate): Accept a sealed type when using
6424         ldftn with a virtual method.
6425
6426 2008-03-13  Geoff Norton  <gnorton@novell.com>
6427
6428         * decimal.c:  Only include memory.h if the platform has it.
6429
6430 Wed Mar 12 12:11:06 CET 2008 Paolo Molaro <lupus@ximian.com>
6431
6432         * assembly.c, class.c, metadata-internals.h: make sure public key
6433         tokesns are compared in a case-insensitive way. Also, all
6434         the lookups in the GAC use a lowercase public key token
6435         (gaacutil already does the lowercasing on install). Fixes
6436         bug #369541.
6437
6438 2008-03-11 Rodrigo Kumpera  <rkumpera@novell.com>
6439
6440         * verify.c (mono_delegate_signature_equal): Do proper variance check on arguments
6441         and return value.
6442
6443 Tue Mar 11 17:41:38 CET 2008 Paolo Molaro <lupus@ximian.com>
6444
6445         * image.c: when someone loads a mscorlib from a file, return the
6446         currently loaded mscorlib (fixes bug #369253).
6447
6448 Tue Mar 11 16:47:32 CET 2008 Paolo Molaro <lupus@ximian.com>
6449
6450         * class.c: handle types with no parents by forcing them to have
6451         System.Object as a parent and marking them as broken (this currently
6452         allows the first part of bug #369173 to work as well, likely because
6453         we don't check for typeload exceptions everywhere yet).
6454
6455 Tue Mar 11 15:23:54 CET 2008 Paolo Molaro <lupus@ximian.com>
6456
6457         * class.c: more complete check that types belong to corlib
6458         (fixes second part of bug #369173).
6459
6460 2007-03-10  Bill Holmes  <billholmes54@gmail.com>
6461
6462         * generic-sharing.c:  Including glib.h for the MSVC builds to define
6463           "inline" to "__inline" before including mono-membar.h.
6464           
6465         * mono-perfcounters.c:  Adding HAVE_SYS_TIME_H check for MSVC builds.
6466           Rename "Unknown" to "CatTypeUnknown" to avoid name collisions for 
6467           MSVC builds.
6468
6469         Contributed under MIT/X11 license.
6470
6471 2008-03-10 Rodrigo Kumpera  <rkumpera@novell.com>
6472
6473         * verify.c (do_invoke_method): Remove return type validation.
6474
6475         * verify.c (do_ret): Do return type validation at return site instead of
6476         call site.
6477
6478 2008-03-10 Rodrigo Kumpera  <rkumpera@novell.com>
6479
6480         * verify.c (do_invoke_method): Mark callvirt to static methods unverifiable.
6481
6482         * verify.c: Some todos cleaned and improved a few error messages.
6483
6484 2008-03-08  Zoltan Varga  <vargaz@gmail.com>
6485
6486         * class.c (mono_class_setup_mono_type): Improve the test for corlib.
6487
6488 2008-03-07  Zoltan Varga  <vargaz@gmail.com>
6489
6490         * class.c (mono_class_setup_mono_type): Handle types whose name clashes with
6491         system types correctly.
6492
6493         * exception.h exception.c (mono_exception_from_token_two_strings): New helper
6494         function.
6495
6496 2008-03-06  Zoltan Varga  <vargaz@gmail.com>
6497
6498         * assembly.c (build_assembly_name): Fix a warning.
6499
6500 Thu Mar 6 19:43:41 CET 2008 Paolo Molaro <lupus@ximian.com>
6501
6502         * marshal.c: ldfld_remote and stfld_remote needs just one wrapper as
6503         the called function takes an object type argument. Fixes storing or
6504         valuetypes across remoting as well as reducing memory usage.
6505         * image.c, metadata-internals.h: remove now unused ldfld_remote and
6506         stfld_remote wrapper caches.
6507
6508 2008-03-06  Zoltan Varga  <vargaz@gmail.com>
6509
6510         * icall.c (mono_lookup_internal_call): Update the exception message when an icall
6511         is not found.
6512
6513         * reflection.c (mono_image_register_token): New helper function to save
6514         a token->object mapping.        
6515
6516         * icall.c (ves_icall_ModuleBuilder_RegisterToken): New icall to access it from
6517         managed code.
6518
6519         * reflection.c (_mono_reflection_parse_type): Distinguish between vectors and
6520         one dimension arrays. Fixes #367670.
6521         (mono_reflection_get_type_internal): Ditto.
6522
6523 Tue Mar 4 19:04:02 CET 2008 Paolo Molaro <lupus@ximian.com>
6524
6525         * marshal.c: mono_load_remote_field_new() always returns object.
6526         so use the proper signature (fixes bug #366445).
6527
6528 2008-03-04  Zoltan Varga  <vargaz@gmail.com>
6529         
6530         * class-internals.h (MonoMethod): Remove unused uses_this flag, 
6531         add an 'inline_failure' flag instead.
6532
6533 2008-03-04  Mark Probst  <mark.probst@gmail.com>
6534
6535         * domain-internals.h, domain.c: Replaced MonoGenericSharingContext
6536         with a new structure, MonoGenericJitInfo, in the MonoJitInfo.  It
6537         contains the location of "this", used for exception handling.
6538
6539 2008-03-04  Zoltan Varga  <vargaz@gmail.com>
6540
6541         * class.c (mono_class_layout_fields): Set the min alignment of small structs to
6542         their size on all platforms for perf reasons.
6543
6544 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
6545
6546         * reflection.h: Move mono_reflection_is_valid_dynamic_token to
6547         object-internal.h
6548
6549         * object-internal.h: Same.
6550
6551 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
6552
6553         * reflection.h: Fix the build I just broke.
6554
6555 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
6556
6557         * reflection.c (mono_reflection_is_valid_dynamic_token): New function,
6558         Test if a token is valid, this remove explicit usage of 
6559         MonoDynamicImage::tokens from the verifier code.
6560
6561         * reflection.h: Added mono_reflection_is_valid_dynamic_token.
6562
6563         * verify.c (token_bounds_check): Use mono_reflection_is_valid_dynamic_token
6564         instead of direct access to MonoDynamicImage::tokens.
6565
6566 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
6567
6568         * verify.c (token_bounds_check): Fix the build I just broke.
6569
6570 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
6571
6572         * verify.c (token_bounds_check): Fix bounds check for dynamic images.
6573
6574         * verify.c (verifier_load_method): Fixed the errors message.
6575
6576         * verify.c (mono_method_verify): Fixed a debug message.
6577
6578 Thu Feb 28 19:49:45 CET 2008 Paolo Molaro <lupus@ximian.com>
6579
6580         * icall-def.h, domain.c, mono-perfcounters-def.h, mono-perfcounters.c,
6581         mono-perfcounters.h, class-internals.h: support for predefined
6582         writable counters, query of categories and counters, bugfixes.
6583
6584 2008-02-28 Rodrigo Kumpera  <rkumpera@novell.com>
6585
6586         * verify.c (do_refanytype): Verify the refanytype opcode.
6587
6588         * verify.c (mono_method_verify): Use do_refanytype.
6589
6590 2008-02-28 Rodrigo Kumpera  <rkumpera@novell.com>
6591
6592         * verify.c (do_mkrefany): Verify the mkrefany opcode.
6593
6594         * verify.c (mono_method_verify): Use do_mkrefany.
6595
6596 Wed Feb 27 19:49:16 CET 2008 Paolo Molaro <lupus@ximian.com>
6597
6598         * Makefile.am, icall-def.h, icall.c, mono-perfcounters-def.h,
6599         mono-perfcounters.c, mono-perfcounters.h: basic performance counter
6600         implementation.
6601
6602 2008-02-27  Zoltan Varga  <vargaz@gmail.com>
6603
6604         * marshal.c (mono_marshal_get_synchronized_wrapper): Fix the code which throws
6605         the type load exception.
6606
6607 2008-02-27 Rodrigo Kumpera  <rkumpera@novell.com>
6608
6609         * verify.c: Added a few FIXME for method signatures
6610
6611         * verify.c (do_invoke_method): Use mono_method_get_signature_full instead
6612         of mono_method_get_signature and get vararg call working. Removed unused
6613         checks for return value.
6614
6615         * verify.c (do_refanyval): Verify the refanyval opcode.
6616
6617         * verify.c (mono_method_verify): Implemented verification of arglist and
6618         use do_refanyval.
6619
6620 2008-02-27  Zoltan Varga  <vargaz@gmail.com>
6621
6622         * class.c (mono_class_setup_methods): Move the check for synchronized methods on
6623         vtypes to marshal.c.
6624
6625         * marshal.c (mono_marshal_get_synchronized_wrapper): Do the vtype check here so
6626         it works for AOT as well.
6627
6628 Tue Feb 26 17:46:32 CET 2008 Paolo Molaro <lupus@ximian.com>
6629
6630         * monitor.c, threads.c, threadpool.c: replace the use of GetTickCount ()
6631         with mono_msec_ticks () which is monotonic and doesn't cause bugs when
6632         the system time is adjusted.
6633
6634 Tue Feb 26 17:40:10 CET 2008 Paolo Molaro <lupus@ximian.com>
6635
6636         * icall.c, icall-def.h: use the new time functions (fixes the
6637         non-monotonic behaviour of TickCount).
6638
6639 2008-02-26  Zoltan Varga  <vargaz@gmail.com>
6640
6641         * reflection.c (mono_custom_attrs_from_builders): Revert the last change as
6642         it breaks the build.
6643         
6644         * reflection.c (mono_custom_attrs_from_builders): Assert instead of a crash if the
6645         cattr is not finished yet.
6646
6647 2008-02-25 Rodrigo Kumpera  <rkumpera@novell.com>
6648
6649         * verify.c: Proper token validation for field, method and type.
6650
6651 2008-02-25 Rodrigo Kumpera  <rkumpera@novell.com>
6652
6653         * loader.c (field_from_memberref): Generate a loader error if the type is not found.
6654
6655         * loader.c (method_from_memberref): Generate type load error instead of method missing
6656         if the type is not found.
6657
6658 2008-02-23  Zoltan Varga  <vargaz@gmail.com>
6659
6660         * marshal.c (mono_marshal_emit_managed_wrapper): Avoid generating invalid IL if
6661         some of the conversions caused the generation of a marshal directive exception.
6662
6663 2008-02-21 Rodrigo Kumpera  <rkumpera@novell.com>
6664
6665         verify.c: Report which exception should be thrown by the JIT.
6666         Added a lot of FIXME notes.
6667
6668 2008-02-22  Mark Probst  <mark.probst@gmail.com>
6669
6670         * generic-sharing.c: Runtime generic context slots are not
6671         instantiated on init anymore.  Instead, provide function to do the
6672         instantiating on demand.
6673
6674         * class-internals.h: Added vtable to runtime generic context.
6675         Macros for encoding direct and indirect slot offsets in one
6676         guint32.
6677
6678 2008-02-21  Mark Probst  <mark.probst@gmail.com>
6679
6680         * object.c, generic-sharing.c: Moved some generic sharing code
6681         from object.c to generic-sharing.c.
6682
6683         * generic-sharing.c: Added support for extensible runtime generic
6684         context.
6685
6686         * metadata-internals.h: Two new hash tables in MonoImage for
6687         extensible runtime generic context support.
6688
6689         * domain.c: Unregister generic vtables upon domain unloading.
6690
6691         * image.c: Destroy new hash tables upon image unloading.
6692
6693         * metadata.c: Unregister generic subclasses upon image unloading.
6694
6695         * class-internals.h: New data structure for runtime generic
6696         context template.  New fields in the runtime generic context for
6697         extensible part.
6698
6699         * Makefile.am: Added generic-sharing.c.
6700
6701 2008-02-21 Rodrigo Kumpera  <rkumpera@novell.com>
6702
6703         icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): If
6704         there is a pending loader exception, raise it.
6705
6706         icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): 
6707         same.
6708
6709         icall.c (ves_icall_System_Reflection_Module_ResolveFieldToken): 
6710         same.
6711
6712         Fixes #363450.
6713
6714 2008-02-20  Zoltan Varga  <vargaz@gmail.com>
6715
6716         * icall.c (ves_icall_Type_GetPacking): Handle dynamic types.
6717
6718         * assembly.c (mono_assembly_load_from_full): Fix a leak in the previous patch.
6719         
6720         * assembly.c (mono_assembly_load_from_full): Return the non-refonly corlib for
6721         ref-only requests for compatibility with MS.
6722
6723 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
6724
6725         * reflection.c (mono_custom_attrs_from_method): Don't silently
6726         return an empty list for generic method instances.
6727         (mono_custom_attrs_from_param): Likewise.
6728
6729 2008-02-20  Rodrigo Kumpera  <rkumpera@novell.com>
6730             Raja R Harinath  <harinath@hurrynot.org>
6731
6732         Fix #354757
6733         * class-internals.h (struct _MonoMethodInflated.is_mb_open): Add.
6734         * class.c (mono_class_inflate_generic_method_full): Initialize it
6735         when a fully-open method is instantiated.
6736         * metadata.c (inflated_method_equal, inflated_method_hash): Update
6737         to new field.
6738         * reflection.c (inflate_mono_method): Don't create a temporary context.
6739
6740 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
6741
6742         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition):
6743         Compute correct value, to prepare for imethod->reflection_info going away.
6744
6745 2008-02-19  Zoltan Varga  <vargaz@gmail.com>
6746
6747         * class.c (mono_class_setup_vtable_general): Ignore static methods in interfaces.
6748
6749 2008-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
6750
6751         * verify.c: Implement skip visibility flag.
6752
6753 2008-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
6754
6755         * verify.h: Added MONO_VERIFY_SKIP_VISIBILITY and struct MonoVerifyInfoExtended
6756         which contains an extra field to tell the kind of exception that should be thrown.
6757
6758         * verify.c: Use MonoVerifyInfoExtended instead of MonoVerifyInfo.
6759
6760 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
6761
6762         * loader.c (mono_method_get_param_names): Initialize 'klass' after
6763         'method' is updated.
6764
6765 2008-02-11  Zoltan Varga  <vargaz@gmail.com>
6766
6767         * class.c (mono_class_layout_fields): Set class->min_align for classes using
6768         explicit layout as well. Fixes #360375.
6769
6770 2008-02-11  Geoff Norton  <gnorton@novell.com>
6771
6772         * loader.c: Guard and dereference against inflated generic methods
6773
6774 2008-02-10  Gert Driesen  <drieseng@users.sourceforge.net>
6775
6776         * class.c: Include Retargetable spec in assembly name.
6777         * assembly.c: Always include PublicKeyToken spec in assembly name
6778         (with value "null" if assembly is not signed), and include
6779         Retargetable spec.
6780         * icall-def.h: Added icall for Assembly.get_fullname.
6781         * icall.c: Added icall returning the fullname of an assembly.
6782
6783 2008-02-09  Zoltan Varga  <vargaz@gmail.com>
6784
6785         * class.c (mono_class_setup_vtable_general): Add a missing call to
6786         mono_class_setup_methods () which is needed in the AOT case.
6787
6788 2008-02-08 Rodrigo Kumpera  <rkumpera@novell.com>
6789
6790         * verify.c (mono_type_get_stack_name): Added. Return the name for the
6791         stack type of the given MonoType.
6792
6793         * verify.c (verify_type_compatibility_full): Handle the void type.
6794
6795         * verify.c (is_compatible_boxed_valuetype): Changed to fit the
6796         way stack merging works.
6797
6798         * verify.c (store_local): Improved verification message.
6799
6800         * verify.c (do_branch_op): If the merging is invalid, the method
6801         is unverifiable and not invalid. Improved error message.
6802
6803         * verify.c (merge_stacks): Properly merge a boxed valuetype and
6804         a reference type diferent than System.Object. Improved error
6805         message.
6806
6807 2008-02-07 Rodrigo Kumpera  <rkumpera@novell.com>
6808
6809         * verify.c (mono_type_is_enum_type): Added. Test if a type is an enum.
6810
6811         * verify.c (mono_type_get_underlying_type_any): Added. Return the underlying
6812         type of an enum even if the argument is byref.
6813
6814         * verify.c: Replace all explicit uses of enumtype and enum_basetype
6815         to calls to mono_type_is_enum_type and mono_type_get_underlying_type_any.
6816
6817         * verify.c: Check for an enum in all cases of MONO_TYPE_GENERICINST.
6818
6819         *verify.c (verify_type_compatibility_full): Make enum types
6820         compatible with their base types.
6821
6822         * verify.c (is_compatible_boxed_valuetype): Added. Check if both
6823         types are compatible for the special case of a boxed valuetype and
6824         System.Object.
6825
6826         * verify.c (verify_stack_type_compatibility): The function
6827         is_compatible_boxed_valuetype was extracted from here.
6828
6829         * verify.c (push_arg): Only set ctx->has_this_store if the method
6830         is not static.
6831
6832         * verify.c (do_ldelem): Fixed a typo in an error message and added
6833         strict check for mixing int32 and native int as the array type
6834         and ldelem type.
6835
6836         * verify.c (merge_stacks): Consider boxed valuetypes in the
6837         compatibility checks.
6838
6839 2008-02-07  Massimiliano Mantione  <massi@ximian.com>
6840         * profiler.h: (MonoGCEvent): Added start-stop the world events.
6841
6842 2008-02-06  Massimiliano Mantione  <massi@ximian.com>
6843         *class.c: use_new_interface_vtable_code: renamed the env var to have
6844         a "MONO_" prefix, and fix the logic to enable it by default.
6845
6846 2008-02-06  Massimiliano Mantione  <massi@ximian.com>
6847         *class.c:
6848         mono_class_setup_vtable_general: rewrote the way in which interface
6849         methods are added to vtables. Makes bug-77127.exe pass, and hopefully
6850         makes the code more maintainable.
6851         For now the old code is still there, and can be activated setting
6852         the env var "USE_NEW_INTERFACE_VTABLE_CODE".
6853
6854 2008-02-06 Rodrigo Kumpera  <rkumpera@novell.com>
6855
6856         * verify.c: guarded some debug functions around and #ifdef.
6857
6858         * verify.c (merge_stacks): implement proper PIII 1.8.1.3 stack state merging.
6859
6860 2008-02-06  Zoltan Varga  <vargaz@gmail.com>
6861
6862         * marshal.c (mono_marshal_get_runtime_invoke): Revert the direct_wrapper
6863         changes for now since they seem to break too many things.
6864
6865 2008-02-05  Mark Probst  <mark.probst@gmail.com>
6866
6867         * marshal.c, marshal.h (mono_marshal_find_bitfield_offset,
6868         mono_marshal_find_nonzero_bit_offset): Added macro and function
6869         for finding the byte- and bit-offset of a bitfield within a
6870         struct.
6871
6872 2008-02-05  Zoltan Varga  <vargaz@gmail.com>
6873
6874         * marshal.c (mono_marshal_get_ptr_to_struct): Make the signature non-pinvoke.
6875         (mono_marshal_get_struct_to_ptr): Ditto.
6876
6877         * marshal.c (mono_marshal_get_runtime_invoke): Fix the signature of 
6878         cctor_signature.
6879
6880 2008-02-03  Zoltan Varga  <vargaz@gmail.com>
6881
6882         * marshal.c (mono_marshal_get_runtime_invoke): Fix sharing of runtime wrappers
6883         between methods for non-corlib types.
6884
6885 2008-02-02  Geoff Norton  <gnorton@novell.com>
6886
6887         * loader.c (mono_method_get_param_names): Populate the parameter name for 
6888         generic parameters as well. (Fixes #342536)
6889
6890 2008-01-31 Rodrigo Kumpera  <rkumpera@novell.com>
6891
6892         * verify.c (is_valid_bool_arg): Allow boxed values and null literals as well.
6893
6894         * verify.c (do_invoke_method): Fix for calling with byref structs.
6895
6896         * verify.c (do_cast): push a boxed value type based on the type token and not
6897         the type of stack.
6898
6899 2008-01-31  William Holmes  <billholmes54@gmail.com>
6900
6901         * process.c (process_module_string_read): Check the size returned form 
6902           VerQueryValue to avoid out of memory exception. 
6903
6904 2008-01-30  Zoltan Varga  <vargaz@gmail.com>
6905
6906         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
6907         Handle properly modules which are not in the moduleref table. Fixes
6908         #356938.
6909
6910 2008-01-29  Zoltan Varga  <vargaz@gmail.com>
6911
6912         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): Remove
6913         the dynamic case which is now in managed code.
6914         (ves_icall_System_Reflection_Assembly_GetTypes): Ditto.
6915
6916         * marshal.c (mono_string_to_bstr): Fix a warning.
6917         (init_com_provider_ms): Ditto.
6918
6919         * appdomain.c (ves_icall_System_AppDomain_createDomain): Add some FIXMEs.
6920
6921         * exception.c (mono_get_exception_out_of_memory): New helper function.
6922
6923 2008-01-28  Jonathan Chambers  <joncham@gmail.com>
6924
6925         * marshal.c: Add support for BSTR marshalling
6926         using other COM systems.
6927
6928         Code is contributed under MIT/X11 license.
6929
6930 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
6931
6932         * object.c (mono_runtime_invoke_array): reverted previous
6933         commit as it breaks the build.
6934
6935 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
6936
6937         * object.c (mono_runtime_invoke_array): Verify arguments for
6938         invalid types. Fixes #348522.
6939
6940 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
6941
6942         * verify.c: added IL_CODE_CALL_NONFINAL_VIRTUAL to track calls to
6943         non-final virtual calls using call. 
6944
6945         * verify.c (do_invoke): fixed some TODOs.
6946
6947         * verify.c (push_arg): set has_this_store for "ldarga 0".
6948
6949 2008-01-27  Zoltan Varga  <vargaz@gmail.com>
6950
6951         * reflection.c (reflection_methodbuilder_to_mono_method): Allow DynamicMethods
6952         which belong to an inflated class. Fixes #356531.
6953
6954 2008-01-26  Robert Jordan  <robertj@gmx.net>
6955
6956         * file-io.c: Implement and use wrappers for GetFileAttribute|Ex ()
6957         which resort to FindFirstFile when a certain error condition
6958         (ERROR_SHARING_VIOLATION) occured. Fixes bug #325212.
6959         Code is contributed under MIT/X11 license.
6960
6961 2008-01-24  Jonathan Chambers  <joncham@gmail.com>
6962
6963         * marshal.c (emit_marshal_string): Fix out string marshalling
6964         to use specified encoding. Fixes #323900.
6965
6966         Code is contributed under MIT/X11 license.
6967
6968 2008-01-24  Raja R Harinath  <harinath@hurrynot.org>
6969
6970         * class.c (mono_class_inflate_generic_method_full): Don't modify
6971         iresult->context after cache check.
6972
6973 2008-01-23  Zoltan Varga  <vargaz@gmail.com>
6974
6975         * class.c (mono_class_inflate_generic_method_full): Change the
6976         struct assignments to memcpy for better visibility and add some comments.
6977
6978 2008-01-23  Dick Porter  <dick@ximian.com>
6979
6980         * threads.c (mono_threads_set_shutting_down): Simplify shutdown
6981         procedure, and make it work on windows.
6982
6983 2008-01-22  Zoltan Varga  <vargaz@gmail.com>
6984
6985         * object-internals.h (MonoReflectionGenericClass): Make the 'generic_type' field
6986         a MonoReflectionTypeBuilder since it is always of that type.
6987
6988         * reflection.c (mono_type_get_object): Remove an unneccesary check.     
6989
6990         * reflection.c (mono_generic_class_get_object): Simplify this a bit.
6991
6992         * reflection.c (mono_reflection_bind_generic_parameters): Ditto.
6993         
6994         * icall.c (ves_icall_MonoGenericClass_GetParentType): Ditto.
6995
6996         * icall.c (ves_icall_MonoGenericClass_GetInterfaces): Ditto.
6997
6998         * reflection.c (mono_reflection_create_runtime_class): Remove already created
6999         instantiations from the type cache.
7000
7001 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
7002
7003         * verify.c (do_ldstr): fixed token verification. previous code was 100% broken.
7004
7005         * verify.c (do_unbox_value): push a controled mutability managed pointer.
7006
7007 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
7008
7009         * verify.c (do_ldstr): added, verifies if the #US token is valid.
7010
7011         * verify.c (mono_method_verify): removed old TODO
7012
7013 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
7014
7015         * verify.c (do_newobj): add visibility check.
7016
7017 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
7018
7019         * verify.c (do_load_function_ptr): add visibility check.
7020
7021 2008-01-21  Massimiliano Mantione  <massi@ximian.com>
7022         *class.c:
7023         mono_generic_class_get_class: hook profiler events.
7024         mono_field_get_offset: added to support heap-shot in the new profiler.
7025         *class.h: exported mono_field_get_offset.
7026         * reflection.c:
7027         mono_reflection_setup_internal_class: hook profiler events.
7028
7029 2008-01-20  Zoltan Varga  <vargaz@gmail.com>
7030
7031         * marshal.c (mono_marshal_emit_native_wrapper): Add a 'check_exceptions' 
7032         argument here too and use it to avoid checking for pending exceptions if 
7033         possible.
7034
7035 2008-01-20  Gert Driesen  <drieseng@users.sourceforge.net>
7036
7037         * assembly.c (build_assembly_name): add arg for passing the assembly
7038         flags. Do not consider a PublicKey with value "null" valid.
7039         (mono_assembly_name_parse_full): added boolean argument that will be
7040         set if the assembly name contains a PublicKeyToken spec. Added support
7041         for the Retargetable spec for which only Yes or No are allowed as valid
7042         value. Consider assembly name invalid if Retargetable spec is set, but
7043         either version, culture or public key (token) are not specified.
7044         * metadata-internals.h: sync signature of mono_assembly_name_parse_full
7045         with implementation in assembly.c.
7046         * icall.c (fill_reflection_assembly_name): also copy assembly flags
7047         from MonoAssemblyName.
7048         (ves_icall_System_Reflection_AssemblyName_ParseName): use newly
7049         introduced argument for mono_assembly_name_parse_full to know if the
7050         assembly name has a PublicKeyToken spec, and if it has instruct
7051         fill_reflection_assembly_name to use default value for keyToken (if
7052         PublicKeyToken is null).
7053
7054 2008-01-18  Rodrigo Kumpera  <rkumpera@novell.com>
7055
7056         * verify.c (mono_method_verify): fixed ovf ops with
7057         float values. They are unverifiable now.
7058
7059 2008-01-18  Rodrigo Kumpera  <rkumpera@novell.com>
7060
7061         * class.c (set_failure_from_loader_error): add BadImageException to the
7062         list of exceptions that can cause a type to fail to load.
7063
7064         * class.c (mono_class_get_exception_for_failure): same.
7065
7066 2008-01-17  Rodrigo Kumpera  <rkumpera@novell.com>
7067
7068         * verify.c (in_any_exception_block): added, check if offset
7069         is part of any exception handling clause.
7070
7071         * verify.c (get_stack_type): added VAR and MVAR types.
7072
7073         * verify.c (do_stobj): better error messages.
7074
7075         * verify.c (do_cpobj): added, check cpobj.
7076
7077         * verify.c (do_initobj): added, check initobj.
7078
7079         * verify.c (do_sizeof): added, check sizeof.
7080
7081         * verify.c (do_localloc): added, check localloc.
7082
7083         * verify.c: adde proper verification for cpobj, initobj, sizeof and localloc.
7084
7085 2008-01-17  Zoltan Varga  <vargaz@gmail.com>
7086
7087         * method-builder.c (mono_mb_emit_native_call): Get rid of the unused
7088         save_lmf/restore_lmf opcodes.
7089
7090         * threads.c (mono_threads_install_notify_pending_exc): New function to
7091         install a callback notifying the JIT there is a pending exception on a thread.
7092         (mono_thread_request_interruption): Call the new callback.
7093         (mono_thread_get_and_clear_pending_exception): New function to return the
7094         exception pending on a thread.
7095
7096         * marshal.c (mono_marshal_get_icall_wrapper): Add a check_exceptions argument
7097         to turn off checking for pending exceptions.
7098         (mono_marshal_get_native_wrapper): Ditto.
7099
7100 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
7101
7102         * threads-types.h: Get rid of the unnecessary extern declarations.
7103
7104 2008-01-16  Gert Driesen  <drieseng@users.sourceforge.net>
7105
7106         * icall.c (ves_icall_Type_GetField): if NonPublic flag is set, only
7107         return field from parent class if not private.
7108         (ves_icall_Type_GetFields_internal): if NonPublic flag is set, only
7109         returns fields from parent class if they are not private.
7110         (method_nonpublic): added function to determine if a given method
7111         should be considered non-public. Returns false for private methods
7112         on parent class, and internal methods from parent on the 1.0 profile.
7113         (ves_icall_Type_GetMethodsByName): if NonPublic flag is set, then
7114         use method_nonpublic function to determine whether method should be
7115         returned.
7116         (property_accessor_public): use newly introduced method_nonpublic
7117         function to determine whether accessor is non-public. 
7118         (ves_icall_MonoType_GetEvent): If NonPublic flag is set, only return
7119         event from parent class if not private. Only return static event if
7120         Static flag is set, and only return static event from parent class if
7121         FlattenHierarchy flag is set.
7122         (ves_icall_Type_GetEvents_internal): If NonPublic flag is set, only
7123         include non-private events from parent class.
7124
7125 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
7126
7127         * icall.c (ves_icall_System_NumberFormatter_GetFormatterTables): Fix a
7128         warning.
7129
7130 2008-01-16  Wade Berrier <wberrier@novell.com>
7131
7132         * security.c: Add assembly.h header to appease some warnings
7133
7134 2008-01-16  Dick Porter  <dick@ximian.com>
7135
7136         * process.c (process_module_string_read): Remove trailing null
7137         when saving string.
7138
7139 2008-01-16  Mark Probst  <mark.probst@gmail.com>
7140
7141         * class-internals.h: A new data structure describing the layout of
7142         a runtime generic context (MonoRuntimeGenericContextTemplate).
7143
7144         * metadata-internals.h: Added a hash table to MonoDomain that maps
7145         from open generic classes to their runtime generic context
7146         templates.
7147
7148         * object.c: Building of the runtime generic context, including
7149         proper handling of generic type arguments of superclasses.
7150         Building of the runtime generic context according to the template.
7151
7152 2008-01-15  Zoltan Varga  <vargaz@gmail.com>
7153
7154         * class.c (mono_class_setup_fields): Set field.count for generic instances.
7155         Fixes #350856.
7156
7157         * image.c (do_mono_image_open): Pass TRUE as last_exists to 
7158         mono_portability_find_file (). Fixes #325466.
7159         (mono_image_get_public_key): Fix a warning.
7160
7161 2008-01-14  Zoltan Varga  <vargaz@gmail.com>
7162
7163         * class.c (mono_class_from_name): Fix comments for NULL-ness of image parameter.
7164         Fixes #353550.
7165         (mono_class_from_name_case): Ditto.
7166
7167 2008-01-13  Eyal Alaluf <eyala@mainsoft.com>
7168
7169         * icall-def.h number-formatter.h icall.c: Implemented a cross app-domain
7170           common storage for the tables used in the System/NumberFormatter class.
7171
7172 2008-01-13  Zoltan Varga  <vargaz@gmail.com>
7173
7174         * marshal.c (mono_marshal_get_runtime_invoke): Fix a typo.
7175
7176 2008-01-11  Rodrigo Kumpera  <rkumpera@novell.com>
7177
7178         * verify.c (get_boxable_mono_type): check if the token is valid.
7179
7180         * verify.c (set_stack_value): changed to add an error if an
7181         invalid type is set on stack. Changed all callers due to signature change.
7182
7183         * verify.c (do_stobj): implement stobj validation.
7184
7185 2008-01-11  Zoltan Varga  <vargaz@gmail.com>
7186
7187         * reflection.c (reflection_methodbuilder_to_mono_method): No need to
7188         set container->is_method, it was set earlier.
7189
7190         * metadata.c (type_in_image): Handle MVARs which belong to not finished
7191         generic methods.
7192
7193         * reflection.c (mono_reflection_initialize_generic_parameter): Set
7194         is_method of the generic container to TRUE for methods.
7195
7196 2008-01-10  Zoltan Varga  <vargaz@gmail.com>
7197
7198         * metadata.c (type_in_image): Handle type parameters properly.
7199
7200         * class-internals.h (MonoGenericParam): Add an 'image' argument to track
7201         memory ownership of this structure.
7202
7203 2008-01-10  Rodrigo Kumpera  <rkumpera@novell.com>
7204
7205         * verify.c (get_boxable_mono_type): make typedref types been just
7206         unverifiable. check for void type.
7207
7208         * verify.c (do_unbox_any): added, verify opcode unbox.any.
7209
7210         * verify.c (do_load_function_ptr): accept method spec tokens.
7211
7212 2008-01-10  Zoltan Varga  <vargaz@gmail.com>
7213
7214         * marshal.c (mono_class_native_size): Always set *align even if this is called
7215         recursively.
7216
7217 2008-01-09  Zoltan Varga  <vargaz@gmail.com>
7218
7219         * verify.c (mono_verify_corlib): Remove this as it was not used and was 
7220         out-of-date.
7221
7222 2008-01-09  Rodrigo Kumpera  <rkumpera@novell.com>
7223
7224         * verify.c: removed some old unused tables. A huge bunch of small fixes
7225         to things found while testing the verifier with mono basic.
7226
7227         * verify.c (dump_stack_value): dump null literal flag to.
7228
7229         * verify.c (verify_type_compatibility_full): fix comparison
7230         for types that have a generic super type.
7231
7232         * verify.c (verify_stack_type_compatibility): fix compatibility
7233         between null literals and reference types. fix compatibility between
7234         boxed valuetypes and object. fix corner case test for enums.
7235
7236         * verify.c (do_cmp_op): proper verification of cgt.un in case
7237         of reference types.
7238
7239         * verify.c (do_invoke_method): fix error message.
7240
7241         * verify.c (do_store_indirect
7242
7243         * verify.c (check_is_valid_type_for_field_ops): proper verification
7244         of managed pointers to valuetypes and boxed valuetypes. proper verification
7245         of null literals.
7246
7247         * verify.c (do_unbox_value): expect valuetypes to be always boxed. don't
7248         allow token to be a reference type.
7249
7250         * verify.c (do_cast): proper handling of boxes valuetypes.
7251
7252         * verify.c (do_stelem): proper handling of storing a boxed valuetype
7253         in object[].
7254
7255         * verify.c (mono_method_verify): pass the opcode to do_cmp_op
7256         to handle cgt.un properly. Implement add/mul/sub ovf opcodes.
7257         fixed the decoding of unbox_any
7258
7259 2008-01-08  Zoltan Varga  <vargaz@gmail.com>
7260
7261         * boehm-gc.c (mono_gc_deregister_root): Fix the size passed to libgc.
7262
7263 2008-01-08  Rodrigo Kumpera  <rkumpera@novell.com>
7264
7265         * verify.c (do_newobj): do delegate verification.
7266
7267         * verify.c (verify_delegate_compatibility): perform delegate
7268         verification.
7269
7270         * verify.c (verify_ldftn_delegate): perform tests related to
7271         ldftn delegates.
7272
7273         * verify.c (mono_delegate_signature_equal): perform the
7274         slightly diferent signature comparison required by delegates.
7275
7276         * metadata.c (mono_metadata_type_equal_full): added and exported
7277         as MONO_INTERNAL. This is a version of mono_metadata_type_equal that
7278         allows signature only comparison.
7279
7280         * metadata-internal.h (mono_metadata_type_equal_full): added and exported
7281         as MONO_INTERNAL.
7282
7283 2008-01-07  Rodrigo Kumpera  <rkumpera@novell.com>
7284
7285         * verify.c: added a bunch of stack_slot_* functions to
7286         make access to stack slot type easier. This is required to
7287         allow optional flags, like null literal, boxed value and
7288         this pointer.
7289         All access paths to IlStackDesc::stype have been changed 
7290         to use these new funcions.
7291         Removed a bunch of unused functions and cleared all warnings.
7292         This patch introduces the usage of the this pointer and 
7293         boxed value flags.
7294
7295 2008-01-07  Zoltan Varga  <vargaz@gmail.com>
7296
7297         * boehm-gc.c (mono_gc_deregister_root): Fix win32 build.
7298
7299 2008-01-06  Zoltan Varga  <vargaz@gmail.com>
7300
7301         * appdomain.c (ves_icall_System_AppDomain_ExecuteAssembly): Change signature to
7302         match managed version.
7303
7304         * appdomain.c: Bump corlib version.
7305         
7306         * appdomain.c (ves_icall_System_AppDomain_ExecuteAssembly): Check for a null
7307         argument.
7308
7309 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
7310
7311         * icall.c (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies)
7312         Set public key token to zero-length byte array if assembly is not
7313         strongnamed.
7314
7315 2008-01-05  Zoltan Varga  <vargaz@gmail.com>
7316
7317         * icall.c (ves_icall_System_Array_SetValueImpl): Use a write barrier when
7318         writing a vtype array elem.
7319
7320 2007-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
7321
7322         * assembly.c (build_assembly_name): return FALSE if length of token is
7323         not 16 (if not "null").
7324         (mono_assembly_name_parse_full): return FALSE if value of version,
7325         culture, token or key is 0.
7326         * icall.c (fill_reflection_assembly_name): add boolean arguments to
7327         specify whether public key and public key token must be set to default
7328         value (zero-length byte array) if not available. Set versioncompat to
7329         SameMachine. If public key is available or the default is set, then
7330         set PublicKey flag.
7331         (ves_icall_System_Reflection_Assembly_FillName): if no public key
7332         is available, use empty byte array as default value. On the 2.0
7333         profile, use default value for public key token if not set.
7334         (ves_icall_System_Reflection_InternalGetAssemblyName): on the 1.0
7335         profile, use default value for public key if not set. On the 2.0
7336         profile, use default value for public key token if not set.
7337         (ves_icall_System_Reflection_AssemblyName_ParseName): do not set
7338         default values for public key and public key token.
7339
7340 2008-01-05  Zoltan Varga  <vargaz@gmail.com>
7341
7342         * object-internals.h (MonoReflectionAssemblyName): Add 'processor_architecture'
7343         field to keep it in synch with the managed object.
7344
7345         * marshal.c (emit_marshal_object): Add support for byref marshalling of
7346         delegates. Fixes #351520.
7347
7348         * sgen-gc.c (conservatively_pin_objects_from): Tell valgrind that the pin queue
7349         contains defined memory.
7350         
7351         * sgen-gc.c: Fix 64 bit warnings. Fix some typos. Update GC stats in mono_stats.
7352
7353         * sgen-gc.c (build_nursery_fragments): Handle half-constructed objects correctly.
7354         
7355         * sgen-gc.c (check_consistency): New helper function to do a consistency check
7356         of the GC data structures.
7357
7358         * gc-internal.h: Moved the REGISTER/UNREGISTER macros here from os/gc_wrapper.h.
7359
7360         * *.c: Include metadata/gc-internal.h instead of os/gc_wrapper.h.
7361         
7362         * object.c (mono_array_full_copy): Fix detection of whenever to use a write
7363         barrier.
7364         (mono_array_clone_in_domain): Ditto.
7365         (mono_array_clone_in_domain): Ditto.
7366
7367         * threads.c (start_wrapper): Register the thread start argument as a GC root.
7368         (cache_culture): Use a write barrier.
7369
7370         * icall.c (ves_icall_System_Array_SetValueImpl): Call a write barrier.
7371         (ves_icall_get_property_info): Ditto.
7372
7373         * object.h (MONO_STRUCT_SETREF): New macro.
7374
7375         * class-internals.h (MonoStats): Add some GC statistics.
7376
7377         * boehm-gc.c null-gc.c: Define mono_gc_deregister_root ().
7378
7379 2008-01-04  Andreas Faerber  <andreas.faerber@web.de>
7380
7381         * exception.c (mono_exception_from_name_two_strings):
7382         Break from loop after method is found.
7383
7384 2008-01-04  Dick Porter  <dick@ximian.com>
7385
7386         * process.c (process_module_string_read): Rename variable to
7387         reflect correct usage, after fixing bug 345972.
7388
7389 2008-01-03  Rodrigo Kumpera  <rkumpera@novell.com>
7390
7391         * verify.c (mono_type_create_fnptr_from_mono_method): 
7392         created a MonoType function pointer instance to be used during
7393         verification. The verifier releases this memory at end.
7394
7395         * verify.c (mono_method_is_constructor): extracted repeated
7396         checks for constructor into a single class.
7397
7398         * verify.c (do_push_field): use new extracted method
7399         for constructor check.
7400
7401         * verify.c (do_newobj): same.
7402
7403         * verify.c (do_ldftn): renamed to do_load_function_ptr
7404         and make it verify ldvirtftn too.
7405
7406         * verify.c (mono_method_verify: proper verification
7407         of ldvirtftn. release created MonoMethod instances.
7408
7409 2007-12-31  Rodrigo Kumpera  <rkumpera@novell.com>
7410
7411         * verify.c (token_bounds_check): added.
7412
7413         * verify.c (do_ldftn): added.
7414
7415         * verify.c (mono_method_verify): proper verificartion of ldftn.
7416
7417 2007-12-31  Rodrigo Kumpera  <rkumpera@novell.com>
7418
7419         * metadata.c (mono_metadata_decode_row): Assert if index is bigger
7420         than the table row count. It's the resposibility of the caller to
7421         make the bounds check and raise the correct error.
7422
7423         * metadata.c (mono_metadata_decode_row_col): Same.
7424
7425         * loader.c (mono_get_method_from_token): perform bounds check
7426         on token for methoddef table.
7427
7428 2007-12-29  Miguel de Icaza  <miguel@novell.com>
7429
7430         * icall.c
7431         (ves_icall_System_CurrentSystemTimeZone_GetTimeZoneData): Turn the
7432         assert into a negative result, the managed code already coped with
7433         that.
7434
7435         Some folks on Windows reported this error. 
7436
7437 2007-12-28  Gert Driesen  <drieseng@users.sourceforge.net>
7438
7439         * appdomain.c: Bump corlib version.
7440         * icall.c:
7441         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies): Use
7442         CultureInfo.CreateCulture to create CultureInfo for name.
7443         (fill_reflection_assembly_name): Use CultureInfo.CreateCulture to
7444         create CultureInfo for name. Fixes bug #347174.
7445
7446 2007-12-27  Rodrigo Kumpera  <rkumpera@novell.com>
7447
7448         * verify.c: added IL_CODE_FLAG_STACK_INITED and IL_CODE_STACK_MERGED
7449         flags.
7450
7451         * verify.c (is_valid_branch_instruction): allow branching to the
7452         first instruction of the protected block.
7453
7454         * verify.c (is_valid_cmp_branch_instruction): same.
7455
7456         * verify.c (stack_init): use IL_CODE_FLAG_STACK_INITED flag to
7457         avoid double initialization.
7458
7459         * verify.c (merge_stacks): use IL_CODE_STACK_MERGED to
7460         detect which cases the eval stack should just be copied.
7461
7462         * verify.c (mono_method_verify): check if the eval stack
7463         is empty when entering a protected block.
7464
7465 2007-12-27  Rodrigo Kumpera  <rkumpera@novell.com>
7466
7467         * verify.c: added is_clause_in_range, is_clause_inside_range,
7468         is_clause_nested and verify_clause_relationship. They perform
7469         the verifications stated in P1 12.4.2.7.
7470
7471         * verify.c (mono_method_verify): remove some unused variables,
7472         add the new exception clause checks, add instruction border
7473         checks for protected block start/end, improved some error 
7474         messages and fixed a bug in the way invalid instruction access
7475         is detected.
7476
7477 2007-12-26  Zoltan Varga  <vargaz@gmail.com>
7478
7479         * boehm-gc.c (mono_gc_register_thread): Use the new GC_register_my_thread () routine
7480         from GC 7.0 if available.
7481
7482         * object.c: Remove an unused define.
7483         
7484         * object.c (mono_class_compute_gc_descriptor): Fix a warning.
7485
7486         * boehm-gc.c (mono_gc_make_descr_for_array): Implement.
7487
7488         * null-gc.c (mono_gc_make_descr_for_array): Implement.
7489
7490         * object.c (mono_class_compute_gc_descriptor): Remove an #ifdef SGEN_GC.
7491
7492         * gc-internal.h: Change the signature of mono_gc_make_descr_for_string ()
7493         to take the same arguments as the other make_descr functions.
7494
7495         * boehm-gc.c null-gc.c: Add implementation for make_descr functions.
7496
7497         * objects.c: Get rid of the MAKE_DESCRIPTOR macros, call make_descr functions
7498         directly.
7499
7500         * boehm-gc.c (mono_gc_base_init): Moved the setting of GC_stackbottom here from
7501         mini.c.
7502
7503         * object.c (mono_class_compute_gc_descriptor): Move the GC_init_gcj_malloc () 
7504         call to boehm-gc.c.
7505
7506         * boehm-gc.c (mono_gc_register_root): Fix a warning.
7507
7508         * null-gc.c (mono_gc_register_root): Fix a warning.
7509
7510         * reflection.c (ALLOC_REFENTRY): Use mono_gc_alloc_fixed for boehm as well.
7511
7512         * boehm-gc.c (mono_gc_register_root): Moved definition here from gc_wrapper.h.
7513         (mono_gc_base_init): Call GC_init ().
7514
7515         * null-gc.c: Define mono_gc_register_root () as a no-op.
7516
7517         * domain.c appdomain.c: Call mono_gc_base_init () instead of MONO_GC_PRE_INIT ().
7518
7519 2007-12-24  Rodrigo Kumpera  <rkumpera@novell.com>
7520
7521         * verify.c: add prototype for merge_stacks at top
7522
7523         * verify.c (do_switch): added.
7524
7525         * verify.c (merge_stacks): on some cases the stack merging
7526         was not happening properly. Unequal stack sizes at merge
7527         points should be invalid.
7528
7529         * verify.c (mono_method_verify): added more debug info on stack state.
7530         verify switch properly.
7531
7532 2007-12-24  Zoltan Varga  <vargaz@gmail.com>
7533
7534         * method-builder.h: New file, moved the mono_mb_ declarations here from 
7535         marshal.h.
7536
7537         * boehm-gc.c marshal.c: Include method-builder.h.
7538
7539         * marshal.c: Use mono_mb_emit_branch_label () in a few places.
7540
7541         * marshal.c: Remove some code which is now in method-builder.c.
7542
7543 2007-12-23  Zoltan Varga  <vargaz@gmail.com>
7544
7545         * method-builder.c: New file, extraction of the method builder functionality 
7546         from marshal.c.
7547
7548         * marshal.c: Move the mb functions into method-builder.c.
7549
7550         * marshal.h marshal.c: Export some mono_mb_... functions.
7551
7552         * marshal.c: Use mono_mb_get_label () and mono_mb_patch_branch () in all places.
7553
7554         * loader.c (field_from_memberref): Remove the dynamic case, it is handled in
7555         the caller.
7556
7557         * class.c (mono_class_get_full): Check the token type in the dynamic case.
7558
7559         * loader.c (mono_field_from_token): Ditto.      
7560
7561         * loader.c (mono_get_method_from_token): Change the check so it checks memberref
7562         type as well.
7563         
7564         * loader.c (mono_get_method_from_token): Check the token type in the dynamic case.
7565         Fixes #342565.
7566
7567         * class-internals.h: Add new loader error type MONO_EXCEPTION_BAD_IMAGE plus
7568         a helper function for setting it.
7569
7570         * loader.c (mono_loader_error_prepare_exception): Handle MONO_EXCEPTION_BAD_IMAGE.
7571
7572         
7573         * assembly.c: Significally simplify code now that referenced assemblies are 
7574         loaded lazily. Get rid of the 'loading' hashtables. Hopefully fixes #347629.
7575
7576         * threads.h: Don't include  the internal threads-types.h header file. Fixes
7577         #349952.
7578
7579 2007-12-21  Rodrigo Kumpera  <rkumpera@novell.com>
7580
7581         * verify.c: added enum value IL_CODE_FLAG_WAS_TARGET, to represent
7582         instructions that were target of branches or are at protected block boundaries.
7583
7584         * verify.c (in_same_block): handle filter clauses.
7585
7586         * verify.c (is_valid_branch_instruction): added. checks the target of
7587         instructions br or brtrue/false.
7588
7589         * verify.c (is_valid_cmp_branch_instruction): added. checks the target of
7590         binary branch instructions such as beq and bge.
7591
7592         * verify.c (init_stack_with_value): renamed to init_stack_with_value_at_exception_boundary
7593         and made it pin the instruction as been part of the exception block.
7594
7595         * verify.c (do_boolean_branch_op): use is_valid_branch_instruction instead
7596         of in_same_block.
7597
7598         * verify.c (do_branch_op): use is_valid_cmp_branch_instruction instead
7599         of in_same_block.
7600
7601         * verify.c (do_ret): ret from a protected block is unverifiable and
7602         not invalid.
7603
7604         * verify.c (do_static_branch): verify br and br.s instructions.
7605
7606         * verify.c (merge_stacks): add extra param to support detection
7607         of branches in the middle of instructions.
7608         
7609         * verify.c (mono_method_verify): verify branches and exception blocks
7610         that target the middle of instructions. Proper verification of br and br.s.
7611
7612 2007-12-21  Zoltan Varga  <vargaz@gmail.com>
7613
7614         * reflection.c (reflection_methodbuilder_from_ctor_builder): Initialize
7615         skip_visibility field.
7616         (reflection_methodbuilder_from_dynamic_method): Ditto.
7617
7618         * object.c (mono_class_compute_gc_descriptor): Remove more unused icall
7619         registrations. Fixes #348193.
7620
7621         * threads.h: Move the internal mono_thread_get_pending_exception () to
7622         threads-types.h and rename it to mono_thread_get_undeniable_exception ().
7623
7624 2007-12-20  Zoltan Varga  <vargaz@gmail.com>
7625
7626         * object.c (mono_class_compute_gc_descriptor): Remove unused GC_gcj_fast_malloc
7627         icall registration. Fixes #348193.
7628
7629         * marshal.c (mono_marshal_get_runtime_invoke): Put all runtime invoke wrappers
7630         for corlib classes into object. Fixes #349621.
7631
7632 2007-12-20  Gert Driesen  <drieseng@users.sourceforge.net>
7633
7634         * icall.c (property_accessor_nonpublic): new function to determine
7635         whether an accessor allows a property to be considered non-public.
7636         Returns false for private accessor(s) from parent class, and internal
7637         accessor(s) from parent on 2.0 profile (and higher).
7638         (ves_icall_Type_GetPropertiesByName): Use newly introduced function
7639         to determine whether property should be included if NonPublic flag
7640         is set. Fixes bug #349078.
7641
7642 2007-12-20  Rodrigo Kumpera  <rkumpera@novell.com>
7643
7644         * verify.c (init_stack_with_value): added.
7645
7646         * verify.c (mono_method_verify): extracted common
7647         code for exception initialization into init_stack_with_value.
7648
7649         * verify.c (mono_method_verify): initialize the exception
7650         for handler clauses as well.
7651
7652         * verify.c (mono_method_verify): fix the exception clause
7653         ordering rules, it should use handler end offset and not
7654         start offset.
7655
7656 Thu Dec 20 12:27:24 CET 2007 Paolo Molaro <lupus@ximian.com>
7657
7658         * rawbuffer.c: remove useless warning.
7659
7660 Thu Dec 20 12:10:38 CET 2007 Paolo Molaro <lupus@ximian.com>
7661
7662         * threads.h, threads-types.h: move functions to the correct header
7663         (fixes bug#349952).
7664
7665 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
7666
7667         * verify.c (mono_method_verify): proper verification
7668         of exception handling clauses ranges and fallthru in
7669         and out of protected blocks.
7670
7671 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
7672
7673         * verify.c (mono_method_verify): fixed compilation issue.
7674
7675 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
7676
7677         * verify.c (mono_method_verify): a printf slipped in, changed
7678         to use verifier debug macro.
7679
7680 2007-12-18  Rodrigo Kumpera  <rkumpera@novell.com>
7681
7682         * verify.c (is_correct_leave): check for filter clauses.
7683
7684         * verify.c (do_filter): added.
7685
7686         * verify.c (mono_method_verify): property verification of leave.
7687
7688
7689 2007-12-18  Mark Probst  <mark.probst@gmail.com>
7690
7691         * threads.c: Disable calls to _wapi_thread_signal_self() to fix
7692         Win32 build, until we figure out how to do the proper thing on
7693         Win32.
7694
7695 2007-12-17  Zoltan Varga  <vargaz@gmail.com>
7696
7697         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Fix a crash introduced
7698         by the previous patch.
7699         
7700         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Avoid calling
7701         the assembly resolve handler for refonly assemblies.
7702
7703 2007-12-17  Mark Probst  <mark.probst@gmail.com>
7704
7705         * threads.c, thread-types.h, icall.c: New shutdown safeguards.
7706         Make sure only one thread is allowed to commence shutdown, and
7707         don't allow new threads to be started once shutdown is in
7708         progress.
7709
7710 2007-12-14  Rodrigo Kumpera  <rkumpera@novell.com>
7711
7712         * verify.c (is_correct_endfilter): added.
7713
7714         * verify.c (is_unverifiable_endfilter): added.
7715
7716         * verify.c (do_endfilter): added.
7717
7718         * verify.c (mono_method_verify): property verification of endfilter
7719         and fixed a corner case or endfinally.
7720
7721 2007-12-13  Rodrigo Kumpera  <rkumpera@novell.com>
7722
7723         * verify.h: new flags to support fail fast of unverifiable code and
7724         do non-strict verification. Non-strict verification is required to
7725         have MS runtime compatibility. There are a huge amount of unverifiable
7726         code that it accepts as verifiable. The strict mode verifies the code
7727         as the specs says.
7728         Non-strict mode will be required in cases where code needs to be
7729         accepted as verifiable but fails under strict mode.
7730
7731         * pedump.c: added support to fail fast and non-strict verification.
7732
7733         * verify.c: added support for both fail fast and non-strict verification.
7734
7735 2007-12-12  Rodrigo Kumpera  <rkumpera@novell.com>
7736
7737         * verify.c (is_correct_endfinally): added.
7738
7739         * verify.c (mono_method_verify): property verification of endfinally.
7740
7741 2007-12-11  Rodrigo Kumpera  <rkumpera@novell.com>
7742
7743         * verify.c (in_any_block): check for filter clauses.
7744
7745         * verify.c (is_correct_rethrow): added.
7746
7747         * verify.c (mono_method_verify): property verification of rethrow.
7748
7749         * metadata.h: added MONO_OFFSET_IN_FILTER macro.
7750
7751 2007-12-11  Rodrigo Kumpera  <rkumpera@novell.com>
7752
7753         * verify.c (do_throw): added.
7754
7755         * verify.c (mono_method_verify): property verification of throw
7756
7757 2007-12-11  Zoltan Varga  <vargaz@gmail.com>
7758
7759         * assembly.c (mono_assembly_load_reference): Try an assembly resolve for ref-only
7760         assemblies. Fixes #346425.
7761
7762 2007-12-10  Zoltan Varga  <vargaz@gmail.com>
7763
7764         * reflection.c (mono_reflection_get_token): Call mono_image_create_token () for
7765         FieldBuilders.
7766
7767         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): Fix a warning.
7768
7769         * class.c (mono_lookup_dynamic_token_class): Add a 'valid token' argument to
7770         prevent asserts when this is called with a token which might not be valid.
7771
7772         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Call
7773         lookup_dynamic_token_class with valid_token == FALSE.
7774
7775         * icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): Ditto.       
7776
7777         * icall.c (ves_icall_System_Reflection_Module_ResolveStringToken): Ditto.
7778
7779         * icall.c (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
7780         
7781 2007-12-10  Mark Probst  <mark.probst@gmail.com>
7782
7783         * gc.c: Don't delay threadpool thread finalization unless Mono is
7784         shutting down.
7785
7786 Mon Dec 10 11:06:23 CET 2007 Paolo Molaro <lupus@ximian.com>
7787
7788         * threads.c: turn an assert into a non-fatal warning.
7789
7790 2007-12-09  Robert Jordan  <robertj@gmx.net>
7791
7792         * icall.c (GetVirtualMethod): Add missing argument validation.
7793
7794 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
7795
7796         * verify.c (do_cast): added.
7797
7798         * verify.c (mono_method_verify): property verification of castclass and isinst.
7799
7800
7801 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
7802
7803         * verify.c (mono_type_from_opcode): added opcodes for stelem.X.
7804
7805         * verify.c (do_stelem): added.
7806
7807         * verify.c (mono_method_verify): property verification of stelem.X.
7808
7809 2007-12-07  Mark Probst  <mark.probst@gmail.com>
7810
7811         * class.c, class-internals.h: Introduce an environment variable
7812         (MONO_GENERIC_SHARING) through which the extent of generic code
7813         sharing can be controlled (share all classes, share only corlib
7814         classes, or share nothing).
7815
7816         * object.c: Only create runtime generic context for classes for
7817         which sharing is enabled.
7818
7819 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
7820
7821         * verify.c (do_ldelem): refactor it to work with ldelem.any.
7822
7823         * verify.c (mono_method_verify): property verification of ldelem.any.
7824
7825 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
7826
7827         * verify.c (get_indirect_op_mono_type): renamed to mono_type_from_opcode,
7828         added ldelem.X opcodes.
7829
7830         * verify.c (do_ldelema): fixed possible invalid usage of MonoType.
7831
7832         * verify.c: proper verification of ldelem.X 
7833
7834 2007-12-06  Zoltan Varga  <vargaz@gmail.com>
7835
7836         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): Allow interface cctors to be called too.
7837
7838 2007-12-05  Rodrigo Kumpera  <rkumpera@novell.com>
7839
7840         * verify.c (mono_method_verify): null literal requires special handling,
7841         the value pushed on stack need to be flagged as so.
7842
7843         * verify.c (do_ldelema): Verify ldelema properly.
7844
7845 2007-12-05  Rodrigo Kumpera  <rkumpera@novell.com>
7846
7847         * verify.c: Verify ldlen properly.
7848
7849 2007-12-05  Zoltan Varga  <vargaz@gmail.com>
7850
7851         * icall.c (ves_icall_MonoField_GetValueInternal): Check that the field belongs
7852         to the target object's type. Fixes #346160.
7853
7854 2007-12-05  Dick Porter  <dick@ximian.com>
7855
7856         * threadpool.c (socket_io_add_poll): Asynchronous connect() on
7857         Solaris needs the same workaround as BSD-derived systems.  Fixes
7858         bug 323524, patch by Burkhard Linke
7859         <burkhard.linke@CeBiTec.Uni-Bielefeld.DE>
7860
7861 2007-12-04  Gert Driesen  <drieseng@users.sourceforge.net>
7862
7863         * process.c: When ProcessStartInfo.ErrorDialog is true, pass window
7864         handle to use when error dialog is shown; otherwise, update mask
7865         to show no error dialog when an error occurs.
7866
7867 2007-12-03  Zoltan Varga  <vargaz@gmail.com>
7868
7869         * icall.c (ves_icall_MonoField_GetRawConstantValue): New icall.
7870
7871         * class.c (mono_class_get_field_default_value): New helper function to initialize
7872         field->def_type and field->data.
7873
7874 2007-11-30  Zoltan Varga  <vargaz@gmail.com>
7875
7876         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Use the delegate trampoline instead of
7877         the general one.
7878
7879         * object.c (mono_runtime_create_delegate_trampoline): New helper function.
7880
7881         * marshal.c: Avoid depending on delegate->method_info being set.
7882
7883         * object.c (mono_delegate_ctor): Avoid initializing delegate->method_info.
7884         
7885         * object.c (mono_delegate_ctor): Set delegate->method.
7886
7887         * object-internals.h (struct _MonoDelegate): Add 'method' field.
7888
7889         * appdomain.c: Bump corlib version.
7890
7891 2007-11-27  Raja R Harinath  <harinath@gmail.com>
7892
7893         * metadata.c (mono_generic_inst_equal_full): Short-circuit
7894         equality check if we're comparing canonicalized MonoGenericInsts.
7895
7896 2007-11-23  Zoltan Varga  <vargaz@gmail.com>
7897
7898         * class.c (generic_array_methods): Call mono_class_setup_methods () before
7899         accessing class->methods.
7900
7901 2007-11-22  Dick Porter  <dick@ximian.com>
7902
7903         * threads.c: Ensure that the synch_cs is set before trying to use
7904         it.
7905
7906 Thu Nov 22 12:34:04 CET 2007 Paolo Molaro <lupus@ximian.com>
7907
7908         * profiler.c: r89126 broke the statistial profiler, unbreak.
7909
7910 2007-11-22  Martin Baulig  <martin@ximian.com>
7911
7912         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 66.
7913
7914         * mono-debug.c
7915         (mono_debug_debugger_version): Bump to 3.
7916         (mono_debug_init): Hook `mono_debugger_class_loaded_methods_func'
7917         -> mono_debugger_class_initialized().
7918
7919         * mono-debug-debugger.c
7920         (mono_debugger_add_type): Renamed into mono_debugger_class_initialized().
7921
7922         * class.c
7923         (mono_debugger_start_class_init_func): Removed.
7924         (mono_debugger_class_loaded_methods_func): Added.
7925         (mono_class_setup_methods): Call it here.
7926
7927 2007-11-22  Martin Baulig  <martin@ximian.com>
7928
7929         * mono-debug.c
7930         (mono_debug_add_delegate_trampoline): New public method.
7931         (MonoDebugDataItemType): Added `MONO_DEBUG_DATA_ITEM_DELEGATE_TRAMPOLINE'.
7932
7933         * mono-debug.h
7934         (MonoSymbolTable): Added `global_data_table'.
7935         (MonoDebuggerTypeKind): Removed.
7936
7937 2007-11-21  Zoltan Varga  <vargaz@gmail.com>
7938
7939         * marshal.c (mono_marshal_get_generic_array_helper): Skip visibility checks for
7940         these methods.
7941
7942         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
7943         
7944 Tue Nov 20 23:10:41 CET 2007 Paolo Molaro <lupus@ximian.com>
7945
7946         * object.c: some fields don't have a valid rva: ignore them (bug #343083).
7947
7948 2007-11-20  Martin Baulig  <martin@ximian.com>
7949
7950         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 65.
7951
7952         * mono-debug-debugger.c
7953         (mono_debugger_insert_method_breakpoint): Moved here from debug-mini.c
7954         (mono_debugger_remove_breakpoint): Likewise.
7955         (mono_debugger_check_breakpoints): Likewise.
7956         (mono_debugger_register_class_init_callback): New public method.
7957         (mono_debugger_remove_class_init_callback): Likewise.
7958         (mono_debugger_add_type): Likewise.
7959
7960         * mono-debug-debugger.h
7961         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_CLASS_INITIALIZED'.
7962
7963 Tue Nov 20 20:54:12 CET 2007 Paolo Molaro <lupus@ximian.com>
7964
7965         * class.c: more interface implementations needed for the
7966         array enumerator (fixes bug #341112).
7967
7968 2007-11-18  Gert Driesen  <drieseng@users.sourceforge.net>
7969
7970         * icall.c: Renamed arguments for ves_icall_System_Enum_ToObject to
7971         fix ParamName of ArgumentNullExceptions.
7972
7973 2007-11-17  Miguel de Icaza  <miguel@novell.com>
7974
7975         * reflection.c (mono_reflection_encode_sighelper): Generate the
7976         modopts and modreqs.   I have a useless test that crashes monodis,
7977         but that shows the code working.
7978
7979 2007-11-17  Zoltan Varga  <vargaz@gmail.com>
7980
7981         * boehm-gc.c (create_allocator): Fix size calculation for the string allocator.
7982         (mono_gc_get_managed_allocator): Enable the string allocator on amd64.
7983
7984 2007-11-15  Dick Porter  <dick@ximian.com>
7985
7986         * threads.c (ves_icall_System_Threading_Thread_Join_internal):
7987         When joining a thread, it's the thread that's calling Join that
7988         gets WaitSleepJoin state not the target.  Fixes the standalone
7989         test case in bug 334740, and hopefully the whole bug too.
7990
7991 2007-11-15  Dick Porter  <dick@ximian.com>
7992
7993         * process.c: Read file version info from the files pointed at by
7994         process modules, not the current process.  Fixes bug 315969.
7995
7996         Use windows typedef names in some places to fix warnings on the
7997         windows build.
7998
7999 2007-11-15  Mark Probst  <mark.probst@gmail.com>
8000
8001         * image.c, metadata-internals.h: Added a generic_class_cache hash
8002         to MonoImage for looking up generic classes when sharing generics.
8003
8004 Thu Nov 15 16:11:30 CET 2007 Paolo Molaro <lupus@ximian.com>
8005
8006         * sgen-gc.c: warning cleanups.
8007
8008 2007-11-15  Zoltan Varga  <vargaz@gmail.com>
8009
8010         * icall.c (ves_icall_Type_GetPropertiesByName): Implement proper hiding of
8011         inherited properties.
8012
8013 2007-11-14  Mark Probst  <mark.probst@gmail.com>
8014
8015         * object.c, class-internals.h: Added more information to the
8016         runtime generic context.
8017
8018 2007-11-13  Zoltan Varga  <vargaz@gmail.com>
8019
8020         * marshal.c (mono_marshal_get_delegate_invoke): Take a delegate as argument
8021         instead of just the target method. Generalize the abstract method handling to
8022         handle any non-static method.
8023
8024         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Update after
8025         mono_marshal_get_delegate_invoke () signature change.
8026
8027 2007-11-13  Mark Probst  <mark.probst@gmail.com>
8028
8029         * class.c, class-internals.h: Made
8030         mono_type_get_basic_type_from_generic () public.  Fixed member
8031         access check for shared generics.
8032
8033         * loader.c: Don't insert field into field cache if it's part of a
8034         non-inflated generic class.
8035
8036         * domain.c, domain-internals.h: The generic sharing context is now
8037         part of the jit info data structure.  Added two accessor
8038         functions.
8039
8040 2007-11-12  Zoltan Varga  <vargaz@gmail.com>
8041
8042         * marshal.c (mono_marshal_get_runtime_invoke): Create a non-shared wrapper for
8043         the array Get/Set/Address methods, since the JIT inlines them.
8044
8045         * metadata-internals.h (MonoImage): Add 'runtime_invoke_direct_cache'.
8046
8047         * image.c (mono_image_close): Free runtime_invoke_direct_cache.
8048         (mono_image_init): Initialize runtime_invoke_direct_cache.      
8049
8050         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Update after
8051         mono_marshal_get_delegate_invoke signature change.
8052
8053         * marshal.c (mono_marshal_get_delegate_invoke): Receive the target_method as
8054         an additional argument. Add support for invoking abstract methods.
8055
8056         * metadata-internals.h (MonoImage): Add 'delegate_abstract_invoke_cache'.
8057
8058         * image.c (mono_image_close): Free delegate_abstract_invoke_cache.      
8059
8060 2007-11-09  Mark Probst  <mark.probst@gmail.com>
8061
8062         * class.c: Do field layout for open generic classes as well.
8063
8064 2007-11-09  Mark Probst  <mark.probst@gmail.com>
8065
8066         * gc.c, gc-internal.h: Don't finalize threadpool threads with
8067         other objects, because the threadpool is still around.  Put them
8068         in a list instead and after finalizing all other objects in the
8069         root domain shut down the thread pool and then finalize the
8070         threads.  Fixes bug #337383.
8071
8072         * threads.c, thread-types.h: New mono_thread_create_internal()
8073         function for marking a thread with the threadpool flag before it
8074         started.  Set synch_cs to NULL after freeing it.
8075
8076         * threadpool.c: Mark threadpool threads before they start.
8077
8078 Thu Nov 8 15:31:21 CET 2007 Paolo Molaro <lupus@ximian.com>
8079
8080         * reflection.h, reflection.c: don't export random functions
8081         and lazy load dbnull and missing objects.
8082
8083 2007-11-07  Jonathan Chambers <joncham@gmail.com>
8084
8085         * class.c: Initialize COM types if COM interfaces
8086         are present (not just COM classes).
8087         
8088         Code is contributed under MIT/X11 license.
8089
8090 2007-11-07  Massimiliano Mantione  <massi@ximian.com>
8091         * reflection.c:
8092         create_dynamic_mono_image: hook module profiler events (dynamic case).
8093         mono_image_basic_init: hook assembly profiler events (dynamic case).
8094
8095 2007-11-07  Massimiliano Mantione  <massi@ximian.com>
8096         * profiler.c:
8097         simple_appdomain_unload: completely terminate the profiler
8098         instead of only processing the statistical samples.
8099         simple_shutdown: make sure this is really called exactly once,
8100         even in multithreaded applications, and always listen to
8101         appdomain events.
8102         * gc.c (mono_domain_finalize): don't call mono_profiler_appdomain_event
8103         here, the "[un]load" functions will do it.
8104         Fixes bugs #333791 and #325261.
8105
8106 2007-11-07  Geoff Norton  <gnorton@novell.com>
8107
8108         * socket-io.c:  Use the configure defines for HAVE_SOCKADDR_IN(6)_SIN_LEN
8109         rather than depend on __APPLE__.
8110
8111 2007-11-07  Mark Probst  <mark.probst@gmail.com>
8112
8113         * icall.c: Safety checks in InitializeArray.  Fixes bug #324535.
8114
8115 2007-11-06  Sebastien Pouliot  <sebastien@ximian.com> 
8116
8117         * object.c: Fix mono_string_to_utf8 to handle NULL values inside the
8118         UTF16 MonoString. Fix the crash from bug #335488
8119
8120 2007-11-06  Sebastien Pouliot  <sebastien@ximian.com>
8121
8122         * marshal.c: Correct (for non-Win32 OS) length != size in 
8123         mono_string_from_bstr. Fix #339530.
8124
8125 2007-11-06  Geoff Norton  <gnorton@novell.com>
8126
8127         * socket-io.c: Apple requires sin(6)_len to be set for getnameinfo
8128         to succeed
8129
8130 2007-11-05  Kornél Pál  <kornelpal@gmail.com>
8131
8132         * process.c: Added run-time GetProcessId API detection for Windows.
8133
8134 2007-11-04  Miguel de Icaza  <miguel@novell.com>
8135
8136         * reflection.c  (mono_param_get_objects): If a parameter has the
8137         attribute [System.Runtime.InteropServices.Optional] we should
8138         set the DefaultValue of the ParameterInfo to be
8139         System.Reflection.Missing instead of DBNull.
8140
8141         See bug #339013.
8142
8143         (mono_get_reflection_missing_object): New method,
8144         returns the System.Reflection.Missing.Value singleton instance.
8145
8146 2007-11-03  Atsushi Enomoto  <atsushi@ximian.com>
8147
8148         * culture-info-table.h : regenerated.
8149
8150 2007-11-02  Jonathan Chambers <joncham@gmail.com>
8151
8152         * icall.c: Use GetEnvironmentStrings on windows
8153         so we are using the same environment block as 
8154         GetEnvironmentVariable/SetEnvironmentVariable. Fixes
8155         #333740.
8156         
8157         Code is contributed under MIT/X11 license.
8158
8159 2007-10-31  Martin Baulig  <martin@ximian.com>
8160
8161         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 64.
8162
8163         * mono-debug-debugger.h
8164         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_TRAMPOLINE'.
8165
8166 2007-10-30  Zoltan Varga  <vargaz@gmail.com>
8167
8168         * reflection.c (mono_custom_attrs_from_class): Add support for dynamic inflated 
8169         classes.
8170
8171 2007-10-30  Atsushi Enomoto  <atsushi@ximian.com>
8172
8173         * culture-info-table.h : regenerated.
8174
8175 2007-10-30  Robert Jordan  <robertj@gmx.net>
8176
8177         * icall-def.h, icall.c:
8178         Add ves_icall_Remoting_RemotingServices_GetVirtualMethod ().
8179
8180         Code is contributed under MIT/X11 license.
8181
8182 2007-10-29  Zoltan Varga  <vargaz@gmail.com>
8183
8184         * class.c (mono_class_setup_vtable): Find the inflated methods in the
8185         inflated class instead of inflating them again.
8186         
8187         * class.c (mono_class_setup_vtable): Inflate the override methods in the 
8188         dynamic case.
8189
8190         * class.c (mono_generic_class_get_class): Set klass->property.count as well.
8191         Call setup_supertypes () after klass->parent is set.
8192         (mono_class_setup_properties): Enable this to work on dynamic generic classes.
8193
8194         * reflection.c (mono_type_get_object): Only return a MonoGenericClass object
8195         for inflated instances of not yet created dynamic generic classes.
8196         (ctorbuilder_to_mono_method): Handle the case when this is called multiple
8197         times from inflated_method.
8198         (methodbuilder_to_mono_method): Ditto.
8199
8200 Mon Oct 29 21:02:53 CET 2007 Paolo Molaro <lupus@ximian.com>
8201
8202         * gc.c: code cleanup and removed old untested option of not creating the
8203         finalizer thread.
8204
8205 2007-10-29  Zoltan Varga  <vargaz@gmail.com>
8206
8207         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Avoid
8208         creating a jump trampoline for dynamic methods.
8209
8210 2007-10-29 Rodrigo Kumpera <rkumpera@novell.com>
8211
8212         * reflection.c (mono_image_create_token): Correctly encode methods and constructors of
8213         generic TypeBuilders when called from another method of the same type (bug #335131).
8214
8215
8216 2007-10-27  Zoltan Varga  <vargaz@gmail.com>
8217
8218         * reflection.c (methodbuilder_to_mono_method): Revert the last change as it
8219         doesn't seem to work perfectly.
8220         
8221         * reflection.c (ctorbuilder_to_mono_method): Handle the case when this is
8222         called multiple times.
8223         (methodbuilder_to_mono_method): Ditto.
8224         (resolve_object): Inflate FieldBuilder's.
8225
8226 Fri Oct 26 19:38:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
8227
8228         * string-icalls.c, string-icalls.h, appdomain.c: patch from
8229         Tyler Larson <mono-devel@tlarson.com> to fix the handling of
8230         RemoveEmptyEntries in the string.Split implementation (bug #322375).
8231
8232 2007-10-26  Dick Porter  <dick@ximian.com>
8233
8234         * appdomain.c (MONO_CORLIB_VERSION): Bump version because of
8235         Thread initialisation changes
8236
8237 2007-10-26 Rodrigo Kumpera <rkumpera@novell.com>
8238
8239         * verify.c: fix compatibility check between arrays and System.Array
8240
8241 2007-10-26  Zoltan Varga  <vargaz@gmail.com>
8242
8243         * reflection.c (mono_reflection_get_custom_attrs_info): Handle MonoGenericClass
8244         too. Fixes #336999.
8245
8246 2007-10-25  Zoltan Varga  <vargaz@gmail.com>
8247
8248         * object.c (mono_value_box): Use typed allocation here.
8249
8250 2007-10-23  Zoltan Varga  <vargaz@gmail.com>
8251
8252         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Create a jump
8253         trampoline instead of compiling the method right away.
8254
8255         * class-internals.h object.c: Add a JIT callback to create a jump trampoline.
8256
8257 2007-10-21  Zoltan Varga  <vargaz@gmail.com>
8258
8259         * class.c (mono_generic_class_get_class): Avoid setting klass->size_inited and
8260         related fields for dynamic classes. Fixes #334493.
8261
8262 2007-10-20  Zoltan Varga  <vargaz@gmail.com>
8263
8264         * class.c (mono_generic_class_get_class): Set klass->field.count as well.
8265         
8266         * class.c (mono_class_layout_fields): Use 1 instead of TRUE for consistency.
8267
8268         * class.c (mono_class_layout_fields): Set size_inited for generic classes as well.
8269         (mono_class_setup_vtable): Obtain overrides for dynamic generic classes correctly.
8270
8271         * class.c (mono_class_setup_methods): Handle dynamic inflated classes correctly.
8272
8273         * reflection.c (create_generic_typespec): Initialize klass->generic_container
8274         if needed.
8275         (reflection_methodbuilder_to_mono_method): Set container->is_method to TRUE.
8276
8277 2007-10-18  Jonathan Chambers <joncham@gmail.com>
8278
8279         * marshal.c: Use correct key when removing item
8280         from ccw_hash.
8281         
8282         Code is contributed under MIT/X11 license.
8283
8284 2007-10-17  William Holmes  <billholmes54@gmail.com>
8285
8286         *marshal.c: Adding a case to marshal booleans to U1
8287
8288         Code is contributed under MIT/X11 license.
8289
8290 2007-10-18  Zoltan Varga  <vargaz@gmail.com>
8291
8292         * class.c (mono_class_from_name): Search the modules compromising dynamic
8293         assemblies. Fixes #331601.
8294
8295 2007-10-16  Zoltan Varga  <vargaz@gmail.com>
8296
8297         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Throw an
8298         exception if the type name contains an assembly component. Fixes #334203.
8299
8300         * reflection.c (mono_reflection_get_type_with_rootimage): Search all the
8301         modules inside dynamic assemblies. Fixes #334200.
8302         
8303         * reflection.c: Set image->public_key and image->public_key_length;
8304
8305         * metadata-internals.h (MonoDynamicImage): Add public_key and public_key_len
8306         fields.
8307
8308         * image.c (mono_image_get_public_key): Handle dynamic assemblies. Fixes #334173.        
8309         
8310 2007-10-16  Mark Probst  <mark.probst@gmail.com>
8311
8312         * metadata.c: Implemented correct comparing of generic classes.
8313         An inflated generic class can be equal to a non-inflated one if it
8314         is inflated with generic type variables as type arguments.  Fixes
8315         bug #333798.
8316
8317 2007-10-15  Dick Porter  <dick@ximian.com>
8318
8319         * monitor.c (mono_monitor_try_enter_internal): Set thread state to
8320         WaitSleepJoin while it is waiting to acquire a lock.  Fixes bug
8321         81646.
8322
8323         * threads.c: Turn the thread synch_lock into a CRITICAL_SECTION,
8324         instead of a monitor lock.  This means that monitor_try_enter and
8325         co can set the thread state safely.
8326         (ves_icall_System_Threading_Thread_Interrupt_internal): Always set
8327         thread_interrupt_requested, so interrupt actually works.
8328
8329         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal,
8330         ves_icall_System_Net_Sockets_Socket_Select_internal): Use thread
8331         state accessor function
8332
8333 2007-10-15  Martin Baulig  <martin@ximian.com>
8334
8335         * mono-debug.h
8336         (MONO_DEBUGGER_VERSION): Bump to 63 to make it impossible to use
8337         the debugger with the current runtime.
8338
8339 Mon Oct 15 10:20:56 CEST 2007 Paolo Molaro <lupus@ximian.com>
8340
8341         * object.c, object-internals.h: added the ability to set a single
8342         trampoline for all the slots in a vtable.
8343
8344 Fri Oct 12 17:50:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
8345
8346         * marshal.c: deal with a possible race condition during multicast
8347         delegate invocation.
8348
8349 Fri Oct 12 13:31:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
8350
8351         * class.c: ensure value type methods don't have the synchronized
8352         flag set.
8353
8354 Fri Oct 12 08:10:59 CEST 2007 Paolo Molaro <lupus@ximian.com>
8355
8356         * string-icalls.c, string-icalls.h: reverted unapproved patch that
8357         breaks the build.
8358
8359 2007-10-11  Joel Reed  <joelwreed@comcast.com>
8360
8361         * string-icalls.c, string-icalls.h: modify System_String_InternalSplit
8362         to take an options parameter so that empty entries can be removed during
8363         the split procedure. Patch from: Tyler Larson <mono-devel@tlarson.com>
8364
8365 Thu Oct 11 20:16:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
8366
8367         * marshal.c: make sure we don't store the signature from a dynamic
8368         method into the runtime invoke cache (bug #327189).
8369
8370 Thu Oct 11 18:22:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
8371
8372         * marshal.c: make sure the wrapper methods are properly initialized.
8373
8374 2007-10-11  Mark Probst  <mark.probst@gmail.com>
8375
8376         * metadata.c, metadata-internals.h: Generalized
8377         mono_type_stack_size() to mono_type_stack_size_internal() which
8378         takes an additional argument specifying whether it allows open
8379         types.
8380
8381 2007-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
8382
8383         * verify.c (do_invoke_method): handle typedbyref params
8384         correctly and check for unverifiable return values.
8385
8386         * verify.c (do_newobj): fix a warning.
8387
8388 2007-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
8389
8390         * verify.c: don't tread typedbyref as allways unverifable,
8391         so uses, like (ld/st)loc.0 are valid. verify for the cases
8392         that it matters, like boxing related operations.
8393
8394 2007-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
8395
8396         * verify.c: add verification of the newobj opcode. verification
8397         of delegate instantation still missing due ldftn and virldftn not
8398         pushing the function type on stack
8399
8400 2007-10-08  Mark Probst  <mark.probst@gmail.com>
8401
8402         * class-internals.h: Runtime generic context data structure
8403         definition.
8404
8405         * object.c: Initialization of runtime generic context at runtime
8406         vtable creation time.
8407
8408 2007-10-08  Massimiliano Mantione  <massi@ximian.com>
8409         * class.c (mono_class_create_from_typedef,
8410         mono_class_from_generic_parameter, mono_ptr_class_get,
8411         mono_fnptr_class_get, mono_bounded_array_class_get)
8412         * domain.c (mono_domain_create, mono_domain_free)
8413         * assembly.c (mono_assembly_load_from_full, mono_assembly_close)
8414         * image.c (do_mono_image_load, mono_image_close):
8415         Hooked up load-unload profiler events.
8416
8417 Mon Oct 8 11:38:04 CEST 2007 Paolo Molaro <lupus@ximian.com>
8418
8419         * domain.c: track statistics about the actual amount of native code
8420         allocated.
8421
8422 Sat Oct 6 10:01:42 CEST 2007 Paolo Molaro <lupus@ximian.com>
8423
8424         * class.c: the valuetype enumerators don't have the additional
8425         supertypes interfaces.
8426
8427 Fri Oct 5 20:33:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
8428
8429         * class.c: need more interfaces setup for the IEnumerator<T>
8430         object created for arrays (tests/ienumerator-interfaces.2.cs).
8431
8432 2007-10-05  Zoltan Varga  <vargaz@gmail.com>
8433
8434         * class.c (mono_ldtoken): Handle methodspec tokens as well. Fixes #331097.
8435
8436 2007-10-05  Alp Toker  <alp@atoker.com>
8437
8438         * icall.c (ves_icall_MonoType_GetElementType): For enums, return null
8439         rather than the underlying type. Based on a patch by Ben Maurer. Fixes
8440         #315863.
8441
8442 2007-10-04  Rodrigo Kumpera  <rkumpera@novell.com>
8443
8444         * verify.c (verify_type_compatibility_full): verification of
8445         compatibility improved, validates correctly non-strict checks between
8446         native int and I4 types different than (unsigned)int32.
8447
8448         * verify.c (do_store_indirect): added, do all verification of
8449         ldind.X opcodes. 
8450
8451         * verify.c (get_load_indirect_mono_type): renamed to
8452         get_indirect_op_mono_type, as it now returns the MonoType for 
8453         ldind.X and stind.X opcodes.
8454
8455 2007-10-04  Rodrigo Kumpera  <rkumpera@novell.com>
8456
8457         * reflection.c: Fix the encoding of generic type definition for
8458         TypeBuilders.
8459
8460         * reflection.c (mono_image_typedef_or_ref_full: do the same thing as
8461         mono_image_typedef_or_ref but allows to specify if typespec lookups should
8462         be made. Typespec check is done prior to typeref cache lookup.
8463
8464         * reflection.c (mono_image_typedef_or_ref): now just delegate to
8465         mono_image_typedef_or_ref_full.
8466
8467         * reflection.c (encode_generic_class): encode the generic class
8468         directly instead of calling encode_type.
8469
8470         * reflection.c (encode_type): encode the generic type definition
8471         MonoClass as a generic instantiation.
8472
8473         * reflection.c (create_typespec): cache typespec tokens in
8474         the assembly->typespec cache. Don't create typespec for a generic
8475         instance MonoClass. Create typespec for the generic type defintion.
8476
8477         * reflection.c (create_generic_typespec): encode the generic
8478         class directly instead of calling encode_type.
8479
8480         * reflection.c (mono_image_create_token): encode the generic
8481         type definition not using a typespec for MonoType instances.
8482
8483
8484 2007-10-04  Raja R Harinath  <rharinath@novell.com>
8485
8486         Fix #328812
8487         * class.c (mono_image_init_name_cache): Don't return nested
8488         'protected internal' classes.
8489         (mono_class_from_name_case): Likewise.
8490
8491 2007-10-04  Atsushi Enomoto  <atsushi@ximian.com>
8492
8493         * icall-def.h, icall.c : get_bundled_machine_config() is now the
8494           common function used by both DefaultConfig in System.dll and
8495           InternalConfigurationHost in System.Configuration.dll.
8496
8497 Wed Oct 3 17:26:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
8498
8499         * class.c: automatically add to vectors only a few essential explicit
8500         generic interfaces. The rest of the interfaces that arrays should
8501         provide are currently implicitly added (but still not lazily, see the
8502         design in the discussion of bug#325495 for the details of what is
8503         needed for that). Additionally, implicit interfaces are assigned the
8504         same vtable slot as the explicit interfaces (as they are compatible):
8505         this enables huge memory savings since we don't need to instantiate
8506         as many memthods and as large vtables anymore. Also, Since
8507         GetEnumerator<T> returns an instance of a type that is required to
8508         support a similarly large set of interfaces as arrays, we add
8509         implicit interfaces and interface offset sharing support to those
8510         types, too. This change adds all the required interfaces so that
8511         the anonarray.cs test case in the bug report works (we don't add
8512         all the interfaces to arrays of arrays 3-level deep and more because
8513         of the memory requirements explained in the bug and since they are much
8514         less common: the lazy-loading support will enabled them to work, too).
8515
8516 2007-10-02  Rodrigo Kumpera  <rkumpera@novell.com>
8517
8518         * verify.c (merge_stacks): major clean up, all type compatibility
8519         checks are done by verify_type_compatibility. This fix my earlier lack
8520         of understanding of the CLR type system and merge_stacks no longer looks
8521         scary.
8522
8523         * verify.c: fixed some bad spelling.
8524
8525 2007-10-02  Rodrigo Kumpera  <rkumpera@novell.com>
8526
8527         * verify.c (mono_type_from_stack_slot): added. returns the MonoType for
8528         a given stack slock.
8529         
8530         * verify.c: killed verify_type_compat in favor of verify_type_compatibility and
8531         verify_type_compatibility_full. This removed a near indentical function and fixed
8532         handling of Int32 and IntPtr across all opcodes.
8533
8534 Tue Oct 2 15:24:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
8535
8536         * class.c: only vectors have the additional generic interfaces.
8537
8538 2007-10-01  Jonathan Chambers <joncham@gmail.com>
8539
8540         * mono-config.c: Use g_strcasecmp instead of
8541         strcasecmp like everywhere else to fix
8542         compilation with MSVC.
8543         
8544         Code is contributed under MIT/X11 license.
8545
8546 Mon Oct 1 14:39:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
8547
8548         * object.c, object-internals.h: refactored the IMT code to enable
8549         building a single slot at a time and lazily creating the IMT trampolines
8550         and thunks.
8551
8552 2007-09-29  Zoltan Varga  <vargaz@gmail.com>
8553
8554         * loader.c (inflate_generic_signature): Allocate inflated signatures from the heap.
8555
8556         * metadata.c (mono_metadata_free_inflated_signature): Free the signature itself too.
8557         Fixes #328501.
8558         
8559 2007-09-29  Raja R Harinath  <harinath@gmail.com>
8560
8561         * loader.c (method_from_methodspec): Rearrange to avoid
8562         un-necessary exposition.  Don't assert out if the method's
8563         declaring type is a generic type definition.
8564
8565 2007-09-28  Martin Baulig  <martin@ximian.com>
8566
8567         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 61.
8568
8569 Fri Sep 28 20:15:47 CEST 2007 Paolo Molaro <lupus@ximian.com>
8570
8571         * class-internals.h: optimize field layout of MonoClass to
8572         requires less cachelines at runtime and save a few bytes on 64 bit
8573         systems.
8574
8575 2007-09-28  Jb Evain  <jbevain@novell.com>
8576
8577         * reflection.c: when encoding type names in custom attributes,
8578         if the type is a closed generic type, its generic arguments
8579         have to be serialized as AssemblyQualifiedName, so that when
8580         they are deserialized, it's possible to re-create them properly.
8581         Fixes #329450.
8582
8583
8584 Fri Sep 28 19:19:49 CEST 2007 Paolo Molaro <lupus@ximian.com>
8585
8586         * object.c, class-internals.h: added delegate-creation counter.
8587
8588 Fri Sep 28 18:07:53 CEST 2007 Paolo Molaro <lupus@ximian.com>
8589
8590         * class.c: cleanup of the code that synthetizes interfaces for
8591         arrays in 2.0: saves quit a bit of corlib mempool memory.
8592         Code to fix bug #325495 ifdeffed out for now until the issues
8593         with memory usage and O(n^2) behaviour are fixed.
8594
8595 Fri Sep 28 17:19:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
8596
8597         * marshal.c: when possible, do not duplicate the name of the methods
8598         in the method builder and in the generated MonoMethod.
8599
8600 2007-09-27  Rodrigo Kumpera  <rkumpera@novell.com>
8601         * verify.c: added support for type checking ldind_* opcodes.
8602
8603 2007-09-27  Rodrigo Kumpera  <rkumpera@novell.com>
8604
8605         * class-internals.h (struct _MonoGenericClass): new field is_tb_open
8606         which is used to distinguish the fully open instantiation of a TypeBuilder
8607         with the rest. This temporary hack is required to restore the property that
8608         the fully open instantiation is the same type of the generic type definition.
8609
8610         * class-internals.h (mono_generic_class_is_generic_type_definition):
8611         new function as part of the internal API.
8612
8613         * class.c (inflate_generic_type): return NULL when the generic inst is
8614         fully open. The fully open generic type is now the same as the generic type
8615         definition for non TypeBuilder types.
8616
8617         * class.c (mono_generic_class_get_class): removed assert since it is
8618         no longer valid, gklass->cached_class can point to the generic type definition.
8619
8620         * class.c (mono_generic_class_is_generic_type_definition): new.
8621
8622         * metadata.c (mono_generic_class_hash): added is_tb_open field
8623         to the hash calculation.
8624
8625         * metadata.c (free_generic_class): if the generic class is associated
8626         with the generic type definition, its field will come from the mempool and
8627         must not be freed.
8628
8629         * metadata.c (mono_metadata_is_type_builder_generic_type_definition):
8630         new, this function identifies the corner case of a TypeBuilder fully open
8631         instantiation.
8632
8633         * metadata.c (mono_metadata_lookup_generic_class): use is_tb_open
8634         for lookup. Set gclass->cached_class to be the container class in case of
8635         the fully open instantiation of non TypeBuilder types.
8636
8637         * metadata.c (_mono_metadata_generic_class_equal): use is_tb_open
8638         to compare generic classes.
8639
8640         * reflection.c (method_encode_methodspec): remove assert that
8641         no longer is valid.
8642
8643         * reflection.c (mono_reflection_generic_class_initialize): add
8644         an aditional assert to ensure the proper type is used.
8645
8646 2007-09-26  Rodrigo Kumpera  <rkumpera@novell.com>
8647
8648         * verify.c: disabled all debug spew by default, define MONO_VERIFIER_DEBUG
8649         to enjoy it.
8650
8651 2007-09-25  Rodrigo Kumpera  <rkumpera@novell.com>
8652
8653         * verify.c (push_arg): Fixed support for ldarga
8654         * verify.c (set_stack_value): Removed superfluous parameter, fixed the
8655         MonoType used as first arg in case of instance calls.
8656
8657 2007-09-25  Rodrigo Kumpera  <rkumpera@novell.com>
8658
8659         * verify.c: Support for verifying VAR and MVAR types, 
8660
8661 2007-09-25  Zoltan Varga  <vargaz@gmail.com>
8662
8663         * icall.c (ves_icall_get_property_info): Set the reflected type of the
8664         accessors correctly.
8665
8666 Tue Sep 25 14:56:03 CEST 2007 Paolo Molaro <lupus@ximian.com>
8667
8668         * threads.c: support OSX and other systems in
8669         mono_thread_get_stack_bounds (bug #328026).
8670
8671 2007-09-25  Martin Baulig  <martin@ximian.com>
8672
8673         * mono-debug.h
8674         (MonoDebugVarInfo): Replace `MonoClass *klass' with `MonoType *type'.
8675
8676 2007-09-24  Martin Baulig  <martin@ximian.com>
8677
8678         * mono-debug.h
8679         (MonoDebugClassEntry): Moved the definition of this struct into
8680         mono-debug.c to make it private.
8681
8682         * mono-debug.c
8683         (MonoDebugClassEntry): Removed `symfile_id'; since we now use one
8684         type table per symbol file, we don't need to store the symfile id
8685         any longer.
8686
8687 2007-09-24  Martin Baulig  <martin@ximian.com>
8688
8689         Create one type table per symbol file, since a `MonoClass *' gets
8690         invalid when its image is unloaded.
8691
8692         * mono-debug.h (MonoSymbolTable): Removed `type_table'.
8693         (MonoDebugHandle): Added `type_table'.
8694
8695 Mon Sep 24 17:25:43 CEST 2007 Paolo Molaro <lupus@ximian.com>
8696
8697         * mempool.c, mempool.h: added mono_mempool_new_size () API
8698         to be able to specify a smaller initial size for the pool.
8699         Adjusted the code to slowly increase pool size before using
8700         the previous default size.
8701         * image.c: use a small initial size for image mempools.
8702
8703 2007-09-23  Zoltan Varga  <vargaz@gmail.com>
8704
8705         * marshal.c (emit_marshal_array): Generate valid IL for byref array case.
8706         Fixes ##320990.
8707
8708         * icall.c (ves_icall_System_Reflection_Assembly_get_ManifestModuleInternal): 
8709         Rename this to ves_icall_System_Reflection_Assembly_GetManifestModuleInternal.
8710
8711 2007-09-22  Zoltan Varga  <vargaz@gmail.com>
8712
8713         * metadata.c (mono_type_create_from_typespec): Remove an invalid
8714         free. Fixes #327438.
8715
8716 2007-09-21  Raja R Harinath  <harinath@gmail.com>
8717
8718         * metadata.c (type_in_image) <MONO_TYPE_SZARRAY>: Handle arrays of
8719         generic instantiations, etc.
8720         <MONO_TYPE_ARRAY>: Likewise.
8721
8722 2007-09-21  Martin Baulig  <martin@ximian.com>
8723
8724         * mono-debug.h (MonoSymbolFilePriv, MonoDebugHandlePriv): Removed;
8725         these structs were never defined.
8726         (MonoDebugHandle): Removed the `_priv' field, it was never used.
8727
8728 2007-09-21  Martin Baulig  <martin@ximian.com>
8729
8730         * mono-debug.h (MonoDebugVarInfo): Add `MonoClass *klass'.
8731
8732 Fri Sep 21 14:39:45 CEST 2007 Paolo Molaro <lupus@ximian.com>
8733
8734         * image.c: removed the guid hash tables: we can get the same info
8735         without the additional memory usage hit (partially fixes also bug #327052).
8736
8737 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
8738
8739         * profiler.h, profiler-private.h, profiler.c: add a new profiler
8740         event to handle unloading methods. After the event is called, the
8741         corresponding MonoMethod* must be considered invalid.
8742         * loader.c (mono_free_method): call the new mono_profiler_method_free
8743         event.
8744
8745 2007-09-20  Mark Probst  <mark.probst@gmail.com>
8746
8747         * domain-internals.h: New flag in MonoJitInfo which marks shared
8748         generic methods.  New hash table (shared_generics_hash) in
8749         MonoDomain to keep track of shared generic methods.  Prototypes
8750         for functions to register and lookup shared generic methods.
8751
8752         * domain.c: Support for registering and looking up shared generic
8753         methods via a hash table (shared_generics_hash) in MonoDomain.
8754
8755         * class-internals.h: New exception to signal failure of shared
8756         compilation of a generic method.  New counters for generics
8757         sharing in MonoStats.
8758
8759 Thu Sep 20 16:59:36 CEST 2007 Paolo Molaro <lupus@ximian.com>
8760
8761         * image.c, metadata-internals.h: don't keep a file descriptor open
8762         for loaded assemblies (bug#325988).
8763
8764 2007-09-19  Raja R Harinath  <rharinath@novell.com>
8765
8766         * metadata.c (signature_in_image): New.  Carve out of type_in_image.
8767         (ginst_in_image, gclass_in_image): Simplify.  Change signature to
8768         use the corresponding datatypes.
8769         (type_in_image): Update to changes.
8770         (CleanForImageUserData): Simplify.
8771         (steal_gclass_in_image): Carved out of old 'gclass_in_image'.
8772         Avoid quadratic behaviour in handling the "stolen" list by
8773         separating the filter predicate out, and by prepending the stolen
8774         items rather than appending them.
8775         (steal_ginst_in_image): Likewise.
8776         (mono_metadata_clean_for_image): Update to changes.
8777
8778 2007-09-19  Martin Baulig  <martin@ximian.com>
8779
8780         * domain.c (mono_cleanup): Call mono_debug_cleanup() here.
8781
8782 2007-09-19  Martin Baulig  <martin@ximian.com>
8783
8784         * mono-debug.c (mono_debug_cleanup): Don't call
8785         mono_debugger_cleanup(); this is now called earlier from mini_cleanup().
8786
8787 2007-09-19  Raja R Harinath  <harinath@gmail.com>
8788
8789         Fix crash on 'make run-test' in mcs/errors
8790         * metadata.c (type_in_image): New.  Carve out of ginst_in_image.
8791         Avoid more potential allocations in mono_class_from_mono_type.
8792         (ginst_in_image): Update to changes.
8793         (gclass_in_image): Rearrange slightly.
8794
8795 2007-09-18  Zoltan Varga  <vargaz@gmail.com>
8796
8797         * class.c (mono_class_init): Move the code that sets up class->methods to 
8798         mono_class_setup_methods () for inflated generic classes too. Ditto for properties.
8799
8800         * metadata.c (mono_metadata_get_inflated_signature): New function to return a
8801         canonical instance of an inflated generic signature.
8802         (mono_type_create_from_typespec): Remove an invalid free.
8803
8804         * loader.c (mono_method_get_signature_full): Use mono_metadata_get_inflated_signature.  
8805
8806 2007-09-18  Marek Habersack  <mhabersack@novell.com>
8807
8808         * domain-internals.h: added a declaration of the
8809         mono_assembly_load_full_nosearch internal function.
8810
8811         * assembly.c (mono_assembly_load_with_partial_name): use
8812         mono_try_assembly_resolve return value properly.
8813         (mono_assembly_load_full_nosearch): copied the function body from
8814         mono_assembly_load_full, without the code to invoke assembly
8815         search hooks.
8816         (mono_assembly_load_full): calls the above new function and if the
8817         assembly is not resolved, invokes the search hooks.
8818
8819         * appdomain.c (mono_runtime_init): restore the global postload
8820         assembly search handlers.
8821
8822 2007-09-18  Zoltan Varga  <vargaz@gmail.com>
8823
8824         * class.c (mono_class_init): Make sure class->methods and class->properties
8825         are never NULL in the generics case.
8826
8827         * metadata.c (free_generic_class): Enable this again, skip the dynamic case.
8828
8829 2007-09-17  Zoltan Varga  <vargaz@gmail.com>
8830
8831         * metadata.c (free_generic_class): Disable some code to fix the build.
8832
8833         * domain.c (mono_cleanup): Fix a crash introduced by a previous patch.
8834
8835         * marshal.c (mono_marshal_get_xappdomain_dispatch): Allocate a piece of data
8836         from the image mempool.
8837
8838         * metadata.c (free_generic_class): Free more data from the inflated class.
8839
8840         * class.c (mono_class_from_generic_parameter): Allocate memory from the mempool.
8841
8842         * metadata.c (mono_metadata_parse_generic_param): Allocate memory from the image
8843         mempool.
8844         (mono_type_create_from_typespec): Ditto.
8845
8846         * domain.c (get_runtimes_from_exe): Add an out parameter to return the opened
8847         MonoImage to the caller.
8848         (mono_init_internal): Save the opened image in a global variable.
8849         (mono_cleanup): Close the image opened in get_runtimes_from_exe.
8850
8851         * reflection.c (resolve_object): Fix a leak.
8852
8853         * metadata.c: Fix the freeing of data in the generics caches.
8854         
8855         * metadata.c (free_generic_inst): Comment this out to fix the build.
8856         (free_generic_class): Ditto.
8857
8858         * metadata.c: Free cached generic methods, instantinations and classes when
8859         they are removed from the caches.
8860         (mono_metadata_free_type): Free the type itself.
8861
8862         * class.c: Free the result of mono_class_inflate_generic_type () in a few
8863         places.
8864
8865 Mon Sep 17 16:14:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
8866
8867         * boehm-gc.c: restrict managed allocs to __thread supporting
8868         architectures.
8869
8870 2007-09-16  Zoltan Varga  <vargaz@gmail.com>
8871
8872         * class.c (mono_class_inflate_generic_type): Add a comment describing memory ownership.
8873         (mono_generic_class_get_class): Fix a leak.
8874
8875         * metadata.c (do_mono_metadata_parse_type): Remove an unneccesary call to
8876         mono_metadata_free_type ().
8877         (mono_metadata_inflate_generic_inst): Fix a leak.
8878
8879 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
8880
8881         * mono-debug.c (free_header_data): Fix a leak missed earlier.
8882
8883         * metadata.c (mono_metadata_parse_array_full): Allocate memory from the image
8884         mempool.
8885
8886         * mono-debug.c (mono_debug_close_image): Fix call to 
8887         g_hash_table_remove ().
8888
8889 Fri Sep 14 19:36:37 CEST 2007 Paolo Molaro <lupus@ximian.com>
8890
8891         * icall-def.h: redirect all the string ctor to the managed
8892         CreateString () methods.
8893         * string-icalls.c, string-icalls.h: removed dead code for string
8894         ctors and icalls.
8895
8896 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
8897
8898         * mono-debug.c: Fix memory leaks.
8899
8900 2007-09-14  Jonathan Chambers <joncham@gmail.com>
8901
8902         * threads-types.h: Implement mono_hazard_pointer_set and 
8903         mono_hazard_pointer_clear macros using do/while(0) to fix
8904         compilation with MSVC.
8905         
8906         Code is contributed under MIT/X11 license.
8907
8908 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
8909
8910         * gc.c (ves_icall_System_GCHandle_GetAddrOfPinnedObject): Use a return value of
8911         -2 to communicate to managed code that the handle is not pinned. Fixes #82848.
8912
8913 Fri Sep 14 14:04:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
8914
8915         * icall-def.h, string-icalls.c: get rid of old, no longer used, string
8916         icalls.
8917
8918 Fri Sep 14 11:41:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
8919
8920         * boehm-gc.c, gc-internal.h, object.c: allow strings to be
8921         managed-code allocated as well.
8922
8923 2007-09-13  Zoltan Varga  <vargaz@gmail.com>
8924
8925         * class.c (mono_class_is_assignable_from): Add support for generic variance.
8926
8927 Thu Sep 13 11:55:55 CEST 2007 Paolo Molaro <lupus@ximian.com>
8928
8929         * boehm-gc.c: fixed the build after the AOT changes.
8930
8931 2007-09-13  Zoltan Varga  <vargaz@gmail.com>
8932
8933         * wrapper-types.h: Add an ALLOC wrapper type.
8934
8935         * gc-internals.h boehm-gc.c null-gc.c sgen-gc.c: Add functions needed by AOT to
8936         reference managed allocator methods.
8937
8938 2007-09-12  Marek Safar  <marek.safar@gmail.com>
8939
8940         * icall.c (ves_icall_MonoType_GetGenericArguments): Create an instance
8941         of Type array and not MonoType, a fix suggested by Hari.
8942         
8943 2007-09-12  Jonathan Chambers <joncham@gmail.com>
8944
8945         * domain-internals.h, domain.c : Remove delegate_invoke_impl_with_target_hash
8946         and delegate_invoke_impl_no_target_hash from _MonoDomain struct.
8947         
8948         Code is contributed under MIT/X11 license.
8949
8950 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
8951
8952         * domain.c, object.c, mono-config.c, object-internals.h: Fixed  #82416.
8953
8954 2007-09-12  Marek Habersack  <mhabersack@novell.com>
8955
8956         * image.c (do_mono_image_open): if assembly file fails to open and
8957         MONO_IOMAP is in effect, try to find the path in a
8958         case-insensitive way.
8959
8960         * appdomain.c (mono_runtime_init): do not install postload hooks -
8961         tests show that MS.NET doesn't use anything of that sort to
8962         trigger the AppDomain.AssemblyResolve event.
8963         (mono_try_assembly_resolve): renamed from try_assembly_resolve and
8964         made non-static.
8965         (mono_runtime_init): init portability helpers here.
8966
8967         * assembly.c (mono_assembly_load_with_partial_name): if other   
8968         attempts fail, trigger the AppDomain.AssemblyResolve event handler
8969         to resolve the assembly.
8970
8971         * domain-internals.h: added mono_try_assembly_resolve and marked
8972         it as internal.
8973
8974 2007-09-11  Jb Evain  <jbevain@novell.com>
8975
8976         * object-internals.h (MonoReflectionDynamicMethod): add
8977         a `MonoReflectionType *owner` field. The owner is used
8978         * reflection.c:
8979         (mono_reflection_create_dynamic_method): use the owner of the dynamic
8980         method as the class declaring the dynamic method.
8981         (reflection_methodbuilder_from_dynamic_method): copy the owner of the
8982         dynamic method to the declaring type of the methodbuilder.
8983
8984 2007-09-11  Mark Probst  <mark.probst@gmail.com>
8985
8986         * icall.c (ves_icall_InternalInvoke): Enforce CoreCLR security
8987         rules for calling methods via reflection.
8988
8989 2007-09-11  Zoltan Varga  <vargaz@gmail.com>
8990
8991         * reflection.c (resolve_object): Add support for MonoGenericClass. 
8992         Inflate MonoType's.
8993
8994 Tue Sep 11 16:08:08 CEST 2007 Paolo Molaro <lupus@ximian.com>
8995
8996         * gc-internal.h, boehm-gc.c, null-gc.c, sgen-gc.c: allow the GC to
8997         provide a managed method that does fast allocations without needing
8998         a managed->unmanaged transition. Boehm GC implementation currently
8999         enabled for ptrfree objects on sane architectures.
9000
9001 Tue Sep 11 16:00:35 CEST 2007 Paolo Molaro <lupus@ximian.com>
9002
9003         * marshal.c, marshal.h: exported a couple of useful functions and
9004         added mono_mb_get_label () to easily handle backward branches.
9005
9006 2007-09-10  Zoltan Varga  <vargaz@gmail.com>
9007
9008         * reflection.c (resolve_object): Inflate generic methods. Fixes #82782.
9009
9010 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
9011
9012         * loader.c (find_method): Fixed the regression introduced while
9013         fixing bug #81466.
9014
9015 2007-09-09  Zoltan Varga  <vargaz@gmail.com>
9016
9017         * class.c (mono_lookup_dynamic_token_class): Pass along the context here as
9018         well.
9019         
9020         * class.c loader.c metadata.c object.c class-internals.h object-internals.h
9021         icall.c reflection.c: Pass a MonoGenericContext argument to 
9022         mono_lookup_dynamic_token ().
9023
9024         * reflection.c (resolve_object): Handle GenericTypeParameterBuilder. Fixes
9025         #82744.
9026         
9027 2007-09-09  Robert Jordan  <robertj@gmx.net>
9028
9029         * object.c (mono_class_proxy_vtable): Don't create remoting trampolines
9030         for generic methods.
9031
9032         * object.c (mono_object_get_virtual_method): Handle generic methods.
9033         Fixes bug #78882.
9034
9035         Code is contributed under MIT/X11 license.
9036
9037 Sat Sep 8 18:16:01 CEST 2007 Paolo Molaro <lupus@ximian.com>
9038
9039         * image.c: fix locking in mono_image_load_file_for_image ().
9040
9041 Thu Sep 6 19:48:00 CEST 2007 Paolo Molaro <lupus@ximian.com>
9042
9043         * reflection.c, icall.c, icall-def.h: the methodinfos name field is
9044         used only as a cache: added an icall to fill it.
9045
9046 2007-09-16  Rodrigo Kumpera  <rkumpera@novell.com>
9047
9048         * reflection.h: exposed mono_reflection_free_type_info
9049         * reflection.c (mono_reflection_get_type_internal): type_args is always freed
9050         since mono_reflection_bind_generic_parameters makes a copy of it.
9051         * reflection.c (free_type_info): subinfos should be freed.
9052         * reflection.c (free_type_info): renamed to mono_reflection_free_type_info and 
9053         made non static.
9054         * icall.c (type_from_name and ves_icall_System_Reflection_Assembly_InternalGetType):
9055         replaced explicit cleanup of MonoTypeNameParse struct with a call to mono_reflection_free_type_info,
9056         this fixes #82695 and #81726.
9057    
9058
9059 2007-09-03  Atsushi Enomoto  <atsushi@ximian.com>
9060
9061         * process.h, process.c:  added support for user profile/info in
9062           ProcessStartInfo. For now only Windows works.
9063
9064 Fri Aug 31 17:30:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
9065
9066         * metadata.c: consider the generic arguments when comparing
9067         signatures (bug #82614).
9068
9069 Thu Aug 30 18:34:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
9070
9071         * cil-coff.h, image.c: updated assembly loader to cope with the
9072         PE32+ 64 bit file format.
9073
9074 Thu Aug 30 16:47:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
9075
9076         * assembly.c, class.c, domain.c, loader.c: remove useless
9077         inclusion of cil-coff.h.
9078
9079 2007-08-29  Jonathan Chambers  <joncham@gmail.com>
9080
9081         * marshal.c (cominterop_get_ccw): Walk up interface hierarchy
9082         if interface is marked with CoClassAttribute. 
9083    
9084         Code is contributed under MIT/X11 license.
9085
9086 Wed Aug 29 19:27:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
9087
9088         * sgen-gc.c: ensure no object from the to space is copied again or finalized
9089         if it's seen twice in major collections.
9090
9091 Wed Aug 29 18:46:49 CEST 2007 Paolo Molaro <lupus@ximian.com>
9092
9093         * sgen-gc.c: big objects are not copied to the gray area, but they
9094         need to be considered for scanning, too, if they are brought alive
9095         by an object ready for finalizations or a survived one.
9096
9097 Wed Aug 29 18:43:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
9098
9099         * sgen-gc.c: properly account the number of disappearing links when
9100         they are nullified.
9101
9102 Wed Aug 29 18:37:37 CEST 2007 Paolo Molaro <lupus@ximian.com>
9103
9104         * sgen-gc.c: share the code to scan the registered roots between the
9105         different types of collections.
9106
9107 2007-08-28  Zoltan Varga  <vargaz@gmail.com>
9108
9109         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunModuleConstructor): New icall.
9110
9111 2007-08-28  Zoltan Varga  <vargaz@gmail.com>
9112
9113         * object.c (mono_class_proxy_vtable): Use max_interface_id instead of
9114         class->max_interface_id in a one place. Fixes transparentproxy.exe test on ia64.
9115
9116 2007-08-28  Mark Probst  <mark.probst@gmail.com>
9117
9118         * security-manager.c (mono_security_manager_get_methods):
9119         LinkDemandSecurityException now has 2 arguments instead of 3.
9120
9121 2007-08-27  Zoltan Varga  <vargaz@gmail.com>
9122
9123         * class.c (mono_class_layout_fields): Only do the struct alignment hack on
9124         platforms which need it.
9125
9126 Mon Aug 27 18:29:12 CEST 2007 Paolo Molaro <lupus@ximian.com>
9127
9128         * sgen-gc.c: unregister thread data structures with a pthread_key_t
9129         dtor.
9130
9131 Mon Aug 27 18:27:35 CEST 2007 Paolo Molaro <lupus@ximian.com>
9132
9133         * threads.c: free the thread static data on thread exit.
9134
9135 Mon Aug 27 10:55:54 CEST 2007 Paolo Molaro <lupus@ximian.com>
9136
9137         * class.c: walk the hierarchy to find the generic definition for
9138         a class (fixes runtime part of bug #82498).
9139
9140 2007-08-24  Zoltan Varga  <vargaz@gmail.com>
9141
9142         * assembly.c (mono_assembly_close): Move the closing of the referenced assemblies to
9143         ...
9144
9145         * image.c (mono_image_close): Here. Hopefully fixes #82510.
9146
9147 2007-08-24  Mark Probst  <mark.probst@gmail.com>
9148
9149         * monodiet.c (handle_cattrs): Fixed a custom attr leak.
9150
9151 2007-08-24  Robert Jordan  <robertj@gmx.net>
9152
9153         * appdomain.c: don't perform the ':'->';' substitution on Win32.
9154
9155 2007-08-24  Jb Evain  <jbevain@novell.com>
9156
9157         * class.c (mono_type_get_name_recurse): fix AssemblyQualifiedName
9158         for byref types.
9159
9160 2007-08-24  Mark Probst  <mark.probst@gmail.com>
9161
9162         * threads.c: Make sure a thread gets cleaned up only once.  Fixes
9163         #82286.
9164
9165 2007-08-24  Zoltan Varga  <vargaz@gmail.com>
9166
9167         * assembly.c: Fix a warning.
9168         
9169 2007-08-23  Marek Habersack  <mhabersack@novell.com>
9170
9171         * appdomain.c: parse the <runtime> section looking for the probing
9172         element with the 'privatePath' attribute, which sets additional
9173         directories in which the runtime should look for assemblies.
9174
9175 2007-08-23  Robert Jordan  <robertj@gmx.net>
9176
9177         * marshal.c (Marshal_ReAllocHGlobal) : Fix GlobalReAlloc's flags.
9178         Fixes #82499.
9179
9180 2007-08-23  Martin Baulig  <martin@ximian.com>
9181
9182         * mono-debug.[ch]: Rename mono_debug_init_corlib() into
9183         _mono_debug_init_corlib() and remove it from the header file.
9184
9185 2007-08-23  Martin Baulig  <martin@ximian.com>
9186
9187         * mono-debug-debugger.c
9188         (mono_debugger_unhandled_exception): Ignore `ThreadAbortException';
9189         don't notify the debugger about it.
9190
9191         * mono-debug-debugger.h
9192         (MonoDebuggerEvent): Removed `THREAD_ABORT'.
9193
9194 2007-08-23  Robert Jordan  <robertj@gmx.net>
9195
9196         * icall-def.h, process.*: implemented Get|SetPriorityClass icalls.
9197         Code is contributed under MIT/X11 license.
9198
9199 Wed Aug 22 18:35:12 CEST 2007 Paolo Molaro <lupus@ximian.com>
9200
9201         * sgen-gc.h, sgen-gc.c: abstracted most of the OS-specific code.
9202
9203 2007-08-22  Martin Baulig  <martin@ximian.com>
9204
9205         * mono-debug.c: Store debugging info on a per-domain basis and
9206         free it on domain unload.  Add support for unloading symbol files.
9207
9208         * mono-debug.h
9209         (MonoDebugList): New typedef.
9210         (MonoSymbolTable):
9211         - add `data_tables and `type_table'.
9212         - replace 'symbol_files' and `num_symbol_files' with a
9213           `MonoDebugList *'.
9214         (mono_debug_data_table): Removed.
9215         (mono_debug_list_add): New public function.
9216         (mono_debug_list_remove): New public function.
9217         (mono_debug_init_1): Renamed into mono_debug_init_corlib().
9218         (mono_debug_init_2_memory): Renamed into
9219         mono_debug_open_image_from_memory().
9220         (mono_debug_close_image): New public function.
9221         (mono_debug_domain_create): Likewise.
9222         (mono_debug_domain_unload): Likewise.
9223         (MONO_DEBUGGER_VERSION): Bump to 60.
9224
9225         * mono-debug-debugger.h
9226         (MonoDebuggerEvent):
9227         - remove `RELOAD_SYMTABS' and `METHOD_COMPILED'.
9228         - rename `ADD_MODULE' into `LOAD_MODULE'; add `UNLOAD_MODULE'.
9229         - add `DOMAIN_CREATE' and `DOMAIN_UNLOAD'.
9230         - rename `THREAD_CREATED' and `THREAD_EXITED' into
9231           `GC_THREAD_CREATED' and `GC_THREAD_EXITED'.
9232         - re-add `THREAD_CREATED' and `THREAD_EXITED'; with different
9233           meaning.
9234         (mono_debugger_add_symbol_file): Removed.
9235         (mono_debugger_add_type): Removed.
9236         (mono_debugger_lookup_type): Removed.
9237         (mono_debugger_lookup_assembly): Removed.
9238
9239         * domain.c
9240         (mono_domain_create): Call mono_debug_domain_create().
9241         (mono_init_internal): Call mono_debug_init_corlib().
9242
9243         * assembly.c
9244         (mono_assembly_close): Call mono_debug_close_image().
9245
9246 Wed Aug 22 17:26:02 CEST 2007 Paolo Molaro <lupus@ximian.com>
9247
9248         * sgen-gc.c: use the mono-mmap facilitites instead of hard-coding the
9249         mmap call.
9250
9251 Wed Aug 22 17:17:09 CEST 2007 Paolo Molaro <lupus@ximian.com>
9252
9253         * sgen-gc.c: ensure section->pin_queue_end is initialized
9254         correctly when non pinning objects in the section have been found.
9255
9256 2007-08-22  Marek Habersack  <mhabersack@novell.com>
9257
9258         * appdomain.c (set_domain_search_path): cope with PrivateBinPath
9259         containing a list of directories separated by ':'. MSDN docs say
9260         the directories should be separated with ';'. Part of a bugfix for
9261         bug #81446
9262
9263 2007-08-21  Rodrigo Kumpera  <rkumpera@novell.com>
9264
9265         * class.c (mono_type_retrieve_from_typespec) : fixed the return type
9266         it should MonoType and not MonoClass.
9267
9268 2007-08-21  Atsushi Enomoto  <atsushi@ximian.com>
9269
9270         * culture-info-table.h : regenerated.
9271
9272 2007-08-20  William Holmes  <billholmes54@gmail.com>
9273
9274         *file-io.c: Added ves_icall_System_IO_MonoIO_ReplaceFile
9275          to call ReplaceFile Kernel32 on windows or in io-layer.
9276         *file-io.h: Added deceleration for ves_icall_System_IO_MonoIO_ReplaceFile
9277         *icall-def.h: Register ves_icall_System_IO_MonoIO_ReplaceFile
9278          as an internal call.
9279
9280         Code is contributed under MIT/X11 license.
9281
9282 2007-08-20  Jb Evain  <jbevain@novell.com>
9283
9284         * class-internals: add definitions for MONO_EXCEPTION_METHOD_ACCESS
9285         and MONO_EXCEPTION_FIELD_ACCESS.
9286
9287         * debug-helpers.[c|h]: new mono_field_full_name function.
9288
9289 2007-08-20  Mark Probst  <mark.probst@gmail.com>
9290
9291         * class.c: Removed class_security_level() and moved it to
9292         security-core-clr.c.
9293
9294         * security-core-clr.c, security-core-clr.h: class_security_level()
9295         is now public and renamed to mono_security_core_clr_class_level().
9296         It also looks for security attributes in the classes a class is
9297         nested in.
9298
9299 2007-08-20  Mark Probst  <mark.probst@gmail.com>
9300
9301         * security-core-clr.c, security-core-clr.h: CoreCLR security
9302         utility functions.
9303
9304         * Makefile.am: Added security-core-clr.[ch].
9305
9306         * security-manager.c, security-manager.h: Functions and enum for
9307         setting and getting the security mode.
9308
9309         * class.c: CoreCLR security checks.
9310
9311 Mon Aug 20 12:38:42 CEST 2007 Paolo Molaro <lupus@ximian.com>
9312
9313         * icall-def.h, process.c, process.h: implemented icall to get
9314         user/system processor times.
9315
9316 2007-08-17  Mark Probst  <mark.probst@gmail.com>
9317
9318         * domain.c, threads.c, class-internals.h, domain-internals.h: New
9319         reader-lock-free jit_info_table.
9320
9321 2007-08-17  Zoltan Varga  <vargaz@gmail.com>
9322
9323         * metadata.c (mono_type_to_unmanaged): Handle MONO_NATIVE_CUSTOM.
9324
9325         * marshal.c (mono_marshal_type_size): Ditto. Fixes #82465 and #82466.   
9326
9327         * object-internals.h (MonoException): Add missing _data member.
9328
9329 2007-08-08  Massimiliano Mantione  <massi@ximian.com>
9330
9331         * loader.c (find_method, find_method_in_class): Fixed bug #81466,
9332         checking that only methods with matching qname or fqname are picked
9333         from implemented interfaces.
9334
9335 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
9336
9337         * verify.c (do_newarr):added, do type verification of
9338         newarr ops, push the right value on the eval stack.
9339         * verify.c (mono_method_verify): use do_newarr
9340
9341
9342 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
9343
9344         * verify.c (do_ldobj_value, do_unbox_value and do_box_value):
9345         factored the common code into get_boxable_mono_type, which
9346         is now using mono_type_get_full, this fixed byref related tests.
9347
9348 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
9349
9350         * class.c: added mono_type_get_full, this function has the same
9351         behavior of mono_class_get_full but the returned MonoType has
9352         all metadata of the associated token in case of a typespec token.
9353         * class.c: added mono_type_retrieve_from_typespec, used by 
9354         mono_type_get_full to retrieve the token type.
9355         * class.c (mono_class_create_from_typespec): changed to use
9356         mono_type_retrieve_from_typespec.
9357         * class.c (mono_ldtoken): changed to use mono_type_get_full
9358         for MONO_TOKEN_TYPE_(DEF|REF|SPEC).
9359         * class-internals.h: exported mono_type_get_full for internal use.
9360
9361 2007-08-16  Jb Evain  <jbevain@novell.com>
9362
9363         * domain.c (supported_runtimes): add entry for
9364         the 'moonlight' runtime version.
9365
9366 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
9367
9368         * verify.c (mono_method_verify): small typo sliped in.  
9369
9370 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
9371
9372         * verify.c (do_unbox_value): added, do type verification of
9373         unboxing ops
9374         * verify.c (mono_method_verify): use do_unbox_value
9375
9376
9377 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
9378
9379         * verify.c (dump_stack_value): fixed typo, was printing string
9380         instead of object on stack.
9381         * verify.c (do_box_value): moved the byref check up as it leads
9382         to invalid code and should be done earlier.
9383         * verify.c: improved error messages for and ldobj
9384
9385 2007-08-15  William Holmes  <billholmes54@gmail.com>
9386
9387         * marshal.c (emit_marshal_custom): Omit the call to 
9388           marshal_native_to_managed when calling native to managed 
9389           and the argument is specified as an out argument.
9390
9391         Code is contributed under MIT/X11 license.
9392
9393 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
9394
9395         * verify.c: fixed the type checks for generics, function pointers and vectors.
9396         Added type verification for ldobj and ldtoken. The verifier
9397         would segfault if header or signature of a method contained references
9398         to non-existant types.
9399
9400 2007-08-15  Jonathan Chambers  <joncham@gmail.com>
9401
9402         * marshal.c (cominterop_get_ccw): Patch from
9403         Bill Holmes to no walk up interface hierarchy. 
9404         All parent methods should be present in the interface for COM.
9405    
9406         Code is contributed under MIT/X11 license.
9407
9408 2007-08-15  Jonathan Chambers  <joncham@gmail.com>
9409
9410         * marshal.c (emit_marshal_com_interface): Patch from
9411         Bill Holmes to handle COM Interfaces as return values
9412         for native->managed calls.
9413    
9414         Code is contributed under MIT/X11 license.
9415
9416 2007-08-14  Jonathan Chambers  <joncham@gmail.com>
9417
9418         * marshal.c (cominterop_get_idispatch_for_object): Implement
9419         for runtime callable wrappers.
9420    
9421         Code is contributed under MIT/X11 license.
9422
9423 2007-08-13  Rodrigo Kumpera  <rkumpera@novell.com>
9424
9425         * pedump.c (main): changed from mono_init to mono_init_from_assembly
9426         so 2.0 types are accessible
9427
9428
9429 2007-08-13  Miguel de Icaza  <miguel@novell.com>
9430
9431         * domain.c (mono_init_internal): Call mono_assembly_load_friends
9432         once we load mscorlib.   Due to the order in which we initialize,
9433         the mono_assembly_load_full routine that loads mscorlib did not
9434         load friends.   We now load it once we load the
9435         mono_defaults.internals_visible_class class. 
9436
9437         * assembly.c: Expose the mono_load_friend_assemblies method.
9438
9439 2007-08-11  Rodrigo Kumpera  <rkumpera@novell.com>
9440
9441         * verify.c: improved the handling of boxing, better
9442         type checking for unary ops and conversion. Fix bug
9443         regarding managed pointer compatibility checking
9444
9445 2007-08-11  Zoltan Varga  <vargaz@gmail.com>
9446
9447         * icall.c (ves_icall_System_Array_SetGenericValueImpl): New icall.
9448
9449         * threads.c threads-types.h: Export mono_thread_get_stack_bounds.
9450
9451 2007-08-09  Raja R Harinath  <rharinath@novell.com>
9452
9453         * reflection.c (dup_type): Remove.
9454         * class.c (dup_type): Remove.
9455         (mono_metadata_signature_deep_dup): Use 'mono_metadata_type_dup'
9456         instead of the dodgy 'dup_type'.
9457         (inflate_generic_type): Likewise.  Fix the VAR/MVAR cases to
9458         handle the case where 'dup_type' needed the second argument.
9459
9460 2007-08-08  Zoltan Varga  <vargaz@gmail.com>
9461
9462         * domain.c: Fix a warning.
9463
9464 2007-08-08  Massimiliano Mantione  <massi@ximian.com>
9465
9466         * class.c (mono_class_setup_vtable_general): Fixed bug #77127,
9467         checking that methods with the same fqname are not overridden
9468         with a method from an ancestor.
9469
9470 2007-08-07  Zoltan Varga  <vargaz@gmail.com>
9471
9472         * threads.c (free_thread_static_data_helper): Avoid a crash if
9473         thread->static_data is not yet set.
9474
9475 2007-08-07  Jonathan Chambers  <joncham@gmail.com>
9476
9477         * marshal.c: Use correct image when emitting
9478         native wrapper for COM calls.
9479    
9480         Code is contributed under MIT/X11 license.
9481
9482 2007-08-07  Atsushi Enomoto  <atsushi@ximian.com>
9483
9484         * icall-def.h, security.c, security.h :
9485           added icall wrapper to ProtectedMemory.[Unprotect|Protect]Data().
9486
9487 2007-08-07  Martin Baulig  <martin@ximian.com>
9488
9489         * mono-debug-debugger.h
9490         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_DOMAIN_UNLOAD'.
9491
9492         * domain.c (mono_domain_free): Call
9493         `mono_debugger_event (MONO_DEBUGGER_EVENT_DOMAIN_UNLOAD)'.
9494
9495 2007-08-06  Rodrigo Kumpera  <rkumpera@novell.com>
9496
9497         * verify.c (check_underflow, check_overflow): error message now returns IL offset
9498         * verify.c (in_same_block): code should test if either offset is inside the clauses
9499         * verify.c (mono_method_verify): push the exception into the eval stack of exception
9500         and filter blocks
9501
9502 2007-08-03  Zoltan Varga  <vargaz@gmail.com>
9503
9504         * image.c (mono_image_close): Fix a leak.
9505
9506         * object.c (mono_runtime_invoke_array): Avoid using alloca.
9507
9508         * icall.c (ves_icall_FieldInfo_SetValueInternal): Ditto.        
9509
9510 Fri Aug 3 19:54:23 CEST 2007 Paolo Molaro <lupus@ximian.com>
9511
9512         * domain.c, threads.c, threads-types.h: fix memory retention issue
9513         with thread static variables not being cleared on domain unload.
9514         Reuse thread static slots after domain unload.
9515
9516 2007-08-03  Zoltan Varga  <vargaz@gmail.com>
9517
9518         * object.c (mono_runtime_invoke_array): Handle the case when the receiver is a
9519         nullable type.
9520
9521         * marshal.c (mono_marshal_get_runtime_invoke): Revert the previous change, it is
9522         now done in mono_runtime_invoke_array.
9523
9524         * marshal.c (mono_marshal_get_runtime_invoke): Handle the case when the 
9525         receiver is a nullable type.
9526
9527         * class.c (mono_class_is_assignable_from): Handle the case when klass is a 
9528         generic parameter.
9529
9530 2007-08-03  Jonathan Chambers  <joncham@gmail.com>
9531
9532         * marshal.c: Implement COM Objects as return type for 
9533         managed->unmanaged calls. Added Release calls for COM Object
9534         out/return values in managed->unmanaged calls.
9535
9536         Code is contributed under MIT/X11 license.
9537
9538 Fri Aug 3 17:00:51 CEST 2007 Paolo Molaro <lupus@ximian.com>
9539
9540         * threads.h, threads-type.h: move the hazard pointer declarations
9541         to the private header.
9542
9543 Fri Aug 3 13:13:39 CEST 2007 Paolo Molaro <lupus@ximian.com>
9544
9545         * file-io.c, appdomain.c: memory leak fixes.
9546
9547 2007-08-02  Dick Porter  <dick@ximian.com>
9548
9549         * socket-io.c
9550         (ves_icall_System_Net_Sockets_Socket_Socket_internal): Move the
9551         SO_REUSEADDR setting into io-layer/sockets.c.
9552
9553 2007-08-01  Zoltan Varga  <vargaz@gmail.com>
9554
9555         * icall.c (ves_icall_Type_GetMethodsByName): Return the members inherited
9556         from Object when called on a generic parameter. Fixes #82211.
9557
9558 2007-08-01  Dick Porter  <dick@ximian.com>
9559
9560         * file-io.c (convert_share): Test FileShare values bit-by-bit.
9561         Fixes bug 79250 yet again.
9562
9563 2007-07-30  Martin Baulig  <martin@ximian.com>
9564
9565         Merged the `debugger-dublin' branch.
9566
9567         * mono-debug.h
9568         (MonoDebugDataTable): New typedef.
9569         (MonoDebugMethodAddressList): New typedef.
9570         (MonoDebugWrapperData): Removed.
9571         (MonoDebugSymbolTable): Removed `current_data_table',
9572         `current_data_table_size', `current_data_table_offset'.
9573         (MonoDebugDataItemType): Moved into mono-debug.c.
9574         (MonoDebugMethodJitInfo): Remove `address'.
9575         (mono_debug_data_table): New global variable.
9576         (mono_debug_lookup_method_addresses): New public function.
9577         (mono_debug_find_method): Take a `MonoMethod *', not a
9578         `MonoDebugMethodInfo *'.
9579
9580         * mono-debug.c: Drop support for the old symbol tables.
9581
9582 2007-06-28  Martin Baulig  <martin@ximian.com>
9583
9584         * mono-debug.c (mono_debug_debugger_version): New public variable.
9585
9586 2007-07-31  William Holmes  <billholmes54@gmail.com>
9587
9588         * metadata.c Changed mono_type_create_from_typespec to not insert
9589           the type into the hash map until after
9590           do_mono_metadata_parse_type has completed.
9591         Fixes Bug #82194
9592         Code is contributed under MIT/X11 license.
9593
9594 2007-07-31  Zoltan Varga  <vargaz@gmail.com>
9595
9596         * icall.c (ves_icall_Type_GetMethodsByName): Avoid a crash when called on a
9597         generic parameter. Fixes #82211.
9598
9599 2007-07-27  Jb Evain  <jbevain@novell.com>
9600
9601         * pedump.c (dump_metadata, dump_metadata_header): dump
9602         versions contained in the metadata header.
9603
9604 Fri Jul 27 17:07:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
9605
9606         * threads.c: register small_id_table with the GC.
9607
9608 2007-07-27  Mark Probst  <mark.probst@gmail.com>
9609
9610         * threads.c, threads.h, class-internals.h, object-internals.h:
9611         Hazard pointers, to be used by lock-free parallel algorithms.
9612
9613 2007-07-26  Dick Porter  <dick@ximian.com>
9614
9615         * appdomain.c (mono_runtime_cleanup): Invoke io-layer cleanup
9616         routine on non-windows platforms, as I've not managed to think of
9617         a non-kludgy way of doing this.  Finishes off bug 78739.
9618
9619 Wed Jul 25 18:06:33 CEST 2007 Paolo Molaro <lupus@ximian.com>
9620
9621         * object.c: properly setup interface_bitmap in proxy vtables.
9622
9623 2007-07-25  Marek Habersack  <mhabersack@novell.com>
9624
9625         * appdomain.c (get_shadow_assembly_location): do not use TickCount
9626         to create unique shadow copy target directories, use the domain's
9627         serial number instead. Each domain gets a unique target directory
9628         that way.
9629
9630         * domain.c (mono_domain_create): added code to increment domain
9631         shadow copy serial number and cache the value in the current
9632         domain structure.
9633
9634         * domain-internals.h (struct _MonoDomain): added a new field -
9635         shadow_serial to hold the serial number used in generation of
9636         shadow-copy directories. This is to make sure that the directory
9637         name is unique for each and every domain created. We avoid a race
9638         condition with overriding assemblies already in use by other app
9639         domains.
9640
9641 2007-07-24  Rodrigo Kumpera  <rkumpera@novell.com>
9642
9643         * class.c (mono_bounded_array_class_get): fixed memory leak when 
9644         binding generic parameters.
9645
9646 2007-07-24  Raja R Harinath  <rharinath@novell.com>
9647
9648         * metadata.c (do_mono_metadata_parse_generic_class): Use
9649         mono_metadata_lookup_generic_class.  Don't g_assert on a metadata
9650         error.
9651
9652 Tue Jul 24 15:15:19 CEST 2007 Paolo Molaro <lupus@ximian.com>
9653
9654         * loader.c, class-internals.h, reflection.c: removed the per-method
9655         generics hashtable: we use the global one through the call of
9656         mono_class_inflate_generic_method ().
9657
9658 Mon Jul 23 19:43:14 CEST 2007 Paolo Molaro <lupus@ximian.com>
9659
9660         * class.c, metadata.c, class-internals.h: introduce yet another
9661         generics global cache for inflated methods (fixes 98% of the perf
9662         issue in bug #81806).
9663
9664 2007-07-23  Raja R Harinath  <rharinath@novell.com>
9665
9666         Fix #81035 -- avoid allocating MonoGenericInsts willy-nilly
9667         * metadata.c (mono_metadata_lookup_generic_inst): Kill.
9668         (mono_metadata_get_generic_inst): New.  Given a list of MonoType*,
9669         return a MonoGenericInst containing (a copy) of those types.
9670         (mono_metadata_inflate_generic_inst): Update to changes.
9671         (mono_metadata_parse_generic_inst): Likewise.
9672         (mono_get_shared_generic_inst): Likewise.
9673         * reflection.c (mono_class_bind_generic_parameters): Likewise.
9674         (mono_reflection_bind_generic_method_parameters): Likewise.
9675         * metadata-internals.h: Likewise.
9676         * icall.c (free_generic_context): Kill.
9677         (init_generic_context_from_args): Use mono_metadata_get_generic_inst.
9678
9679         * reflection.c (reflection_methodbuilder_to_mono_method): Use
9680         mono_metadata_type_dup.
9681         * marshal.c (mono_mb_create_method): Likewise.
9682
9683         * metadata.c (mono_metadata_type_dup): Rename from
9684         mono_metadata_type_dup_mp.  Take an optional mempool instead of a
9685         MonoImage.  Handle a few more cases, esp. when no mempool is given.
9686         * marshal.c, metadata-internals.h: Update to changes.
9687
9688 Mon Jul 23 11:43:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
9689
9690         * class.c: fixed a small leak for array classes and removed warning.
9691
9692 2007-07-22  Zoltan Varga  <vargaz@gmail.com>
9693
9694         * loader.c (mono_method_get_param_token): Make this work on generic methods.
9695         Return 0x8000000 for return parameters. Fixes #82161.
9696
9697 2007-07-21  Marek Habersack  <grendello@gmail.com>
9698
9699         * appdomain.c (get_shadow_assembly_location): append the current
9700         ticks value to the path. Avoids overwriting the same assemblies by
9701         several threads at the same time.
9702
9703 2007-07-20  Atsushi Enomoto  <atsushi@ximian.com>
9704         and Raja R Harinath  <rharinath@novell.com>
9705
9706         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition):
9707         Simplify slightly.
9708         (ves_icall_MonoMethod_GetGenericMethodDefinition): Update
9709         property for testing if a method is a generic method definition.
9710
9711 2007-07-20  Atsushi Enomoto  <atsushi@ximian.com>
9712
9713         * domain-internals.h : added 2.0 member fields to MonoAppDomainSetup.
9714
9715 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
9716
9717         * verify.c: used function from private branch, reverted to the one in class.h 
9718
9719 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
9720
9721         * verify.c: a typo slipped in and the code wont compile
9722
9723 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
9724
9725         * verify.c: now all code use IS_MANAGED_POINTER and UNMASK_TYPE macros.
9726         disabled box instruction as it is doing the wrong thing
9727         improved stack dump messages, now it is easier to debug type related issues
9728
9729
9730 2007-07-19  Juraj Skripsky  <js@hotfeet.ch>
9731
9732         * icall.c (ves_icall_System_MonoType_getFullName): Fix a leak. 
9733
9734 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
9735
9736         * verify.c: changed MONO_TYPE_TYPEDBYREF stack type from 
9737         TYPE_COMPLEX to TYPE_PTR, it did not make any sense to be
9738         grouped with class and valuetype. This change will simply 
9739         the code as it should be handled just like unmanaged pointers.
9740
9741 2007-07-19  Mark Probst  <mark.probst@gmail.com>
9742
9743         * class.c (concat_two_strings_with_zero): Fixed a silly bug.
9744
9745 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
9746
9747         * verify.c: several stack merge issues fixed, reference comparisons now
9748         check the type size. strict type check now works correctly.
9749         added more uses of IS_MANAGED_POINTER macro.
9750         fixed issues pointed by running the test suite against .net.
9751         
9752
9753 2007-07-19  Mark Probst  <mark.probst@gmail.com>
9754
9755         * class.c, loader.c, class-internals.h: Removed the
9756         MonoLoaderErrorKind enum and replaced it with the MONO_EXCEPTION_
9757         defines.
9758
9759         * icall.c: Better error checking in some internal reflection
9760         methods.
9761
9762 2007-07-18  William Holmes  <billholmes54@gmail.com>
9763
9764         * filewatcher.c : removed unused variable 'filename' in 
9765           ves_icall_System_IO_FSW_SupportsFSW
9766
9767 Mon Jul 16 19:36:16 CEST 2007 Paolo Molaro <lupus@ximian.com>
9768
9769         * reflection.c, class.c, icall.c, loader.c: mono_get_inflated_method () is
9770         obsolete, removed.
9771
9772 2007-07-15  Zoltan Varga  <vargaz@gmail.com>
9773
9774         * icall.c (ves_icall_System_Reflection_FieldInfo_GetTypeModifiers): New icall.
9775         
9776         * icall.c (ves_icall_System_Reflection_Module_ResolveSignature): New icall.
9777
9778 2007-07-14  Zoltan Varga  <vargaz@gmail.com>
9779
9780         * icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): 
9781         Implement generics support.
9782         (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
9783
9784         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Add new
9785         type_args and method_args arguments.
9786         (ves_icall_System_Reflection_Module_ResolveMethodToken): Ditto.
9787         (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
9788         (ves_icall_System_Reflection_Module_ResolveMemberToken): Ditto.
9789
9790 2007-07-13  Rodrigo Kumpera  <rkumpera@novell.com>
9791
9792         * reflection.c: patch from Thong Nguyen to fix atribute resolution.
9793           It adds a rootimage parameter to mono_reflection_get_type_internal,
9794           adds new function mono_reflection_get_type_with_rootimage and use
9795           the rootimage to resolve the types instead of the current image
9796
9797 2007-07-13  Rolf Bjarne Kvinge  <RKvinge@novell.com>
9798
9799         * culture-info-table.h: Forgot to update after r78304.
9800
9801 2007-07-13  Raja R Harinath  <rharinath@novell.com>
9802
9803         * class.c (mono_class_is_open_constructed_type)
9804         <MONO_TYPE_GENERICINST>: Don't recompute a computed field.
9805
9806 2007-07-12  Rodrigo Kumpera  <rkumpera@novell.com>
9807
9808         * class.c (mono_bounded_array_class_get):  method fails if used with
9809         an incomplete TypeBuilder enum (no basetype field), fixed it by 
9810         avoiding calculating the size for such array as it cannot be instantiated.
9811         Fix bug #82015
9812
9813 2007-07-12  Raja R Harinath  <rharinath@novell.com>
9814
9815         * class-internals.h (_MonoGenericInst::is_reference): Remove bogus
9816         field.
9817         * metadata.c, reflection.c: Update to changes.
9818
9819 2007-07-11  Rodrigo Kumpera  <rkumpera@novell.com>
9820
9821         * class.c, class-internal.h: added mono_type_is_valid_enum_basetype and
9822         mono_class_is_valid_enum, they are used to valide a enum when loading.
9823         * reflection.c: used new functions to throw TypeLoadException when and
9824         invalid enum is build with TypeBuilder. Fixes #82018
9825   
9826 Wed Jul 11 14:47:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
9827
9828         * object.c: forgot commit of mono_class_setup_methods () to access
9829         iface->methods.
9830         * object-internals.h: added a few more handy fields to
9831         MonoIMTCheckItem.
9832
9833 2007-07-11  Zoltan Varga  <vargaz@gmail.com>
9834
9835         * object.c (build_imt): Call mono_class_setup_methods () before accessing 
9836         iface->methods.
9837
9838 Tue Jul 10 16:49:01 CEST 2007 Paolo Molaro <lupus@ximian.com>
9839
9840         * class-internals.h, object-internals.h, object.c: IMT-based
9841         interface invocation core from Massimiliano Mantione
9842         (massi@ximian.com) with a reworked arch-specific interface,
9843         bsearch implementation and a few bugfixes and memory savings by me.
9844
9845 2007-07-10  Rodrigo Kumpera  <rkumpera@novell.com>
9846
9847         * class.c (mono_class_create_from_typedef): mono would segfault if 
9848         an enum did not have a __value field. It now throws a TypeLoadException
9849         for such cases. Fix bug #82022
9850
9851 2007-07-10  Zoltan Varga  <vargaz@gmail.com>
9852
9853         * marshal.c (mono_marshal_string_to_utf16_copy): Fix allocation size.
9854
9855 2007-07-09  Mark Probst  <mark.probst@gmail.com>
9856
9857         * class.c (mono_class_init): If a class is already inited but has
9858         an exception_type set, return FALSE, not TRUE.  Fixes: 82050.
9859
9860 2007-07-09  Mark Probst  <mark.probst@gmail.com>
9861
9862         * class.c: Properly handle the case of an unimplemented interface
9863         method.  Fixes: 81673.
9864
9865 Mon Jul 9 16:21:43 CEST 2007 Paolo Molaro <lupus@ximian.com>
9866
9867         * class-internals.h, object.c: cleanup patch from massi: use
9868         MonoVTable->interface_bitmap since the vtable interfaces offset array
9869         is going away.
9870
9871 2007-07-10  Zoltan Varga  <vargaz@gmail.com>
9872
9873         * icall-def.h icall.c: Remove Module:get_MDStreamVersion icall and add a new
9874         GetMDStreamVersion icall instead.
9875
9876 Mon Jul 9 11:34:17 CEST 2007 Paolo Molaro <lupus@ximian.com>
9877
9878         * filewatcher.c: patch from Thong Nguyen <tum@veridicus.com> to
9879         not use mono_dl_build_path() with a full library name: makes
9880         fallbacks to libgaim and libfam work.
9881
9882 2007-07-06  William Holmes  <billholmes54@gmail.com>
9883
9884         * assembly.c: Added a continue statement in probe_for_partial_name when
9885          parse_assembly_directory_name fails.  Fixes : 82002
9886
9887 2007-07-06  Rodrigo Kumpera  <rkumpera@novell.com>
9888
9889         * verify.c (check_unmanaged_pointer_type): renamed to check_unverifiable_type
9890         and added a verification  for TYPEDBYREF.
9891         * verify.c (verify_stack_type_compatibility): fix handling of byref types,
9892         make native int interchangeable with int32 and some small cleanup and formating.
9893         * verify.c (push_arg): only ldarg on invalid argument is valid (but not verifiable) and
9894         handle byref of byref.
9895         * verify.c (push_local): handle byref of byref.
9896         * verify.c (do_binop): invalid mix of values is unverifiable
9897         * verify.c (do_invoke_method): fixed the handling of bad params on stack and
9898         added visibility checks
9899         * verify.c (field related method): added visibility checks
9900         * verify.c (do_push_field): cannot take the address of a temporary valuetype field
9901
9902 2007-07-06  Zoltan Varga  <vargaz@gmail.com>
9903
9904         * marshal.c (mono_marshal_string_to_utf16_copy): Null terminate the
9905         string.
9906
9907 2007-07-05  Zoltan Varga  <vargaz@gmail.com>
9908
9909         * profiler.c (mono_profiler_load): Fix an off-by-one error.
9910
9911         * marshal.c (emit_marshal_string): When returning a string from managed code,
9912         allways make a copy even for unicode strings. Fixes #81990.
9913
9914 Wed Jul 4 11:53:57 CEST 2007 Paolo Molaro <lupus@ximian.com>
9915
9916         * object.c: cleaned up mono_runtime_invoke_array () and fixed handling
9917         of byref generic inst types (bug #81997).
9918
9919 2007-07-03  Rodrigo Kumpera  <rkumpera@novell.com>
9920
9921         * class.c: moved methods mono_method_can_access_field and mono_method_can_access_method from mini/mini.c
9922         * class.h: added declarations of mono_method_can_access_field() and mono_method_can_access_method()
9923
9924 2007-07-02  Zoltan Varga  <vargaz@gmail.com>
9925
9926         * marshal.c (emit_marshal_string): Add support for unicode strings in
9927         MARSHAL_ACTION_MANAGED_CONV_RESULT. Fixes #81990.
9928
9929 2007-07-02 Rodrigo Kumpera  <rkumpera@novell.com>
9930
9931         * verify.c: field load/store are now verified, missing only access checks now
9932
9933 2007-06-28  Martin Baulig  <martin@ximian.com>
9934
9935         * mono-debug.c (mono_debug_debugger_version): New public variable.
9936
9937 2007-06-24  Gert Driesen  <drieseng@users.sourceforge.net>
9938
9939         * locales.c: When constructing DateTimeFormat or NumberFormat for
9940         MonoCultureInfo, inherit readonly bit from MonoCultureInfo. The
9941         MonoCultureInfo contructed from the current locale is always
9942         read-only and has UseUserOverride set to true. All MonoCultureInfo
9943         instances returned for GetCultures have both IsReadOnly and
9944         UseUserOverride set to true. Fixes part of bug #81930.
9945
9946 2007-06-22  Jonathan Chambers  <joncham@gmail.com>
9947
9948        * icall-def.h: Update System.__ComObject icalls
9949        * marshal.c: Avoid managed transition (and object creation)
9950        when looking up COM interface in RCW.
9951        * marshal.h: Ditto.
9952        
9953        Code is contributed under MIT/X11 license.
9954
9955 2007-06-22  Zoltan Varga  <vargaz@gmail.com>
9956
9957         * marshal.c (mono_marshal_get_runtime_invoke): Cache in the method image for now
9958         to avoid crashes during assembly unloading.
9959
9960 2007-06-22  Raja R Harinath  <rharinath@novell.com>
9961
9962         Fix MethodInfo.IsGenericMethodDefinition
9963         * reflection.c (mono_reflection_bind_generic_method_parameters):
9964         Rearrange code to ensure we always uses a generic method definition.
9965         * class.c (mono_class_inflate_generic_method_full): Set
9966         'generic_container' field only for generic method definitions.
9967         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition):
9968         Use presense of 'generic_container' field as indication of being a
9969         generic method definition.
9970
9971 2007-06-21  Zoltan Varga  <vargaz@gmail.com>
9972
9973         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
9974
9975         * object-internals.h: Reflect changes in the layout of the managed Delegate
9976         class.
9977         
9978         * object-internals.h reflection.c icall-def.h: Applied patch from Robert
9979         Jordan (robertj@gmx.net). Add a dtor to dynamic methods which frees up the
9980         runtime memory used by the dynamic method. Fixes #77146.
9981
9982 2007-06-21  Dick Porter  <dick@ximian.com>
9983
9984         * file-io.h: 
9985         * file-io.c (convert_share): Cope with FileShare.Delete.  Patch
9986         from Wojtek Krawczyk <krawczyk.wojciech@gazeta.pl>, fixes bug
9987         81767.
9988
9989 2007-06-21  Raja R Harinath  <rharinath@novell.com>
9990
9991         * reflection.c (method_encode_methodspec): Add a tripwire.
9992         * class.c (inflate_generic_type): The fully open generic type is
9993         not the same as the generic type definition.
9994
9995 2007-06-21  Martin Baulig  <martin@ximian.com>
9996
9997         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 59.
9998
9999         * mono-debug-debugger.h
10000         (MonoDebuggerBreakpointInfo): Removed.
10001         (mono_debugger_insert_breakpoint_full): Moved to ../mini/debug-mini.h.
10002         (mono_debugger_remove_breakpoint): Likewise.
10003         (mono_debugger_breakpoint_callback): Likewise.
10004         (mono_debugger_start_add_type): Renamed into mono_debugger_add_type().
10005
10006 2007-06-21  Raja R Harinath  <rharinath@novell.com>
10007
10008         * metadata.c (mono_metadata_lookup_generic_class): The fully open
10009         generic type is not the same as the generic type definition.
10010         * class.c (mono_generic_class_get_class): Likewise.
10011
10012 2007-06-20  Geoff Norton  <gnorton@customerdna.com>
10013
10014         * icall.c: The second argument to 
10015         System.Reflection.MethodBase.GetMethodFromHandleInternalType
10016         is a MonoType not a MonoClass.
10017
10018 2007-06-20  Rodrigo Kumpera  <kumpera@gmail.com>
10019
10020         * verify.c: support for function pointers in the verifier
10021
10022 2007-06-20  Rodrigo Kumpera  <kumpera@gmail.com>
10023
10024         * verify.c: unmanaged pointer verification checks (loading unmanaged pointers is unverifiable)
10025
10026 Wed Jun 20 10:22:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
10027
10028         * assembly.c: removed Mono.Data.SqliteClient from the list of
10029         forward-compatible assemblies as it breaks the ABI (bug #81899).
10030
10031 2007-06-19  Raja R Harinath  <rharinath@novell.com>
10032
10033         * metadata.c (mono_metadata_lookup_generic_class): Protect cache
10034         lookup/update with the loader lock.
10035         * reflection.c (mono_class_bind_generic_parameters): No need to
10036         protect mono_metadata_lookup_* with the loader lock.
10037         * class.c (inflate_generic_type): Likewise.
10038         
10039         * metadata.c (ginst_in_image): Avoid mono_class_from_mono_type
10040         on a generic instantiated type.
10041
10042 2007-06-18  Rodrigo Kumpera <kumpera@gmail.com>
10043
10044         *verify.c: produce meanfull error messages on verification error
10045         *verify.c: fixed some cases of verification errors reported as validation errors
10046         *pedump.c: fixed the error name array, now it shows validation errors properly
10047         *verify.h: fixed the contant that should be used for verification errors
10048
10049 Mon Jun 18 17:07:22 CEST 2007 Paolo Molaro <lupus@ximian.com>
10050
10051         * metadata.c, image.c, metadata-internals.h: part of the fixes needed
10052         for bug #77596, 81858 and 80743 (generics data structures on domain
10053         unload).
10054
10055 2007-06-15  Raja R Harinath  <rharinath@novell.com>
10056
10057         Avoid allocating 'MonoGenericContext' on the heap.
10058         * class-internals (_MonoMethodInflated::context): Make field
10059         inline, not a pointer.
10060         * loader.c (method_from_methodspec): Allocate 'new_context' on the
10061         stack.  Use the context embedded within the inflated method as the
10062         hash key, rather than 'new_context'.
10063         * class.c (inflate_generic_context): Simplify.  Return a struct
10064         rather than allocating on the heap.
10065         (mono_class_inflate_generic_method_full): Update to changes.  Now,
10066         doesn't salt away a copy of the context -- simplifying the
10067         lifetime rules of a 'MonoGenericContext *'.
10068         (mono_method_get_context): Return pointer to embedded context.
10069         (setup_generic_array_ifaces): Allocate temporary context on stack.
10070         * reflection.c (inflate_mono_method): Likewise.
10071         (mono_reflection_bind_generic_method_parameters): Likewise.
10072         Use the context embedded within the inflated method as the hash key.
10073
10074         Avoid a source of allocation of 'MonoGenericContext'.
10075         * class-internals.h (_MonoGenericClass::context): Combine 'inst'
10076         and 'cached_context' fields into embedded 'MonoGenericContext' field.
10077         * class.c: Update to changes.
10078         (mono_generic_class_get_context): Simplify drastically.  Now just
10079         returns a pointer to the field.
10080         * metadata-internals.h (mono_metadata_generic_context_hash): Mark
10081         argument as a const pointer.
10082         (mono_metadata_generic_context_equal): Likewise.
10083         * metadata.c, loader.c, icall.c, reflection.c, verify.c:
10084         Update to changes.
10085
10086 2007-06-14  Rodrigo Kumpera  <kumpera@gmail.com>
10087
10088         * verify.c improved the handling of brtrue/brfalse, factored out common code
10089
10090 2007-06-14  Raja R Harinath  <rharinath@novell.com>
10091
10092         Kill MonoGenericMethod.
10093         * class-internals.h (MonoGenericContext::method_inst): Rename from
10094         'gmethod' and convert to a MonoGenericInst.
10095         (MonoGenericMethod): Remove.
10096         * metadata.h (MonoGenericMethod): Note that the name is obsolete.
10097         * loader.c (method_from_methodspec): Update to changes.  Use a
10098         MonoGenericContext as the key to the hashtable.
10099         * metadata.c (mono_metadata_generic_context_equal): Rename from 
10100         'mono_metadata_generic_method_equal' and take MonoGenericContext.
10101         (mono_metadata_generic_context_hash): Likewise from
10102         'mono_metadata_generic_method_hash'.  Change hash function.
10103         (mono_metadata_load_generic_params): Update to changes.
10104         (mono_get_shared_generic_method): Remove.
10105         * metadata-internals.h (mono_get_shared_generic_method): Remove.
10106         * class.c (inflate_generic_type) [MONO_TYPE_MVAR]: Update to changes.
10107         (inflate_generic_context): Likewise.
10108         (mono_class_inflate_generic_method_full): Likewise.
10109         (setup_generic_array_ifaces): Likewise.
10110         (mono_class_create_from_typespec): Likewise.
10111         * reflection.c (encode_generic_method_sig): Take a MonoGenericContext.
10112         (method_encode_methodspec): Update callsite.
10113         (reflection_methodbuilder_to_mono_method): Update to changes.
10114         (mono_reflection_bind_generic_method_parameters): Likewise.  Use a
10115         MonoGenericContext as the key to the hashtable.
10116         (inflate_mono_method): Update to changes.
10117
10118         * class-internals.h (MonoGenericMethod::container): Remove.
10119         * class.c, loader.c, metadata.c, reflection.c: Update to changes.
10120
10121 Thu Jun 14 12:40:05 CEST 2007 Paolo Molaro <lupus@ximian.com>
10122
10123         * profiler-private.h, profiler.c, profiler.h: added API to profile
10124         exception events.
10125
10126 2007-06-13  Rodrigo Kumpera  <kumpera@gmail.com>
10127
10128         * verify.c: Fixed pointer type handling, some code and message formating and two invalid assigments 
10129
10130 2007-06-13  Rodrigo Kumpera  <kumpera@gmail.com>
10131
10132         * verify.c: method invocation is now validated, now we verify parameter types on stack.
10133         Fixed overflow and underflow not aborting the verification process.
10134
10135 2007-06-13  Mark Probst  <mark.probst@gmail.com>
10136
10137         * class-internals.h (MonoStats): Added stats entries for dynamic
10138         code allocations.
10139
10140 2007-06-12  Zoltan Varga  <vargaz@gmail.com>
10141
10142         * loader.c (mono_free_method): Free header->locals and header->clauses.
10143
10144         * marshal.c (mono_mb_create_method): Make a copy of the locals as well in the
10145         dynamic case.
10146
10147         * threads.c (mono_thread_get_stack_bounds): Fix memory leak.
10148
10149         * class.c (setup_interface_offsets): Allocate memory from the image mempool.
10150
10151 2007-06-12  Raja R Harinath  <rharinath@novell.com>
10152
10153         * verify.c (TYPE_MAX): Set it to 8 to match the dimensions of all
10154         the tables.
10155
10156 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
10157
10158         *pedump.c (main): return error code 4 if assembly cannot be loaded instead of segfaulting
10159
10160 2007-06-11  Raja R Harinath  <harinath@gmail.com>
10161
10162         MonoGenericMethod on a diet
10163         * class-internals.h (_MonoMethodInflated::reflection_info): Move
10164         here ...
10165         (_MonoGenericMethod::reflection_info): ... from here.
10166         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition):
10167         Update to changes.
10168         * reflection.c (inflate_mono_method): Likewise.
10169         (mono_reflection_bind_generic_method_parameters): Likewise.
10170
10171 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
10172
10173         *verify.c: all debu printf statements are now guarded by VERIFY_DEBUG
10174         *verify.c: factored long ldarg forms to share code with short forms
10175
10176 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
10177
10178         *verify.c: fixed code formating factored some duplicate code
10179         into a new function
10180
10181         *verify.h: fixed binary incompatibility introduced earlier
10182
10183         *pedump.c: fixed formating
10184
10185 2007-06-11  Raja R Harinath  <harinath@gmail.com>
10186
10187         Fix assertion when disassembling Mono.C5.dll
10188         * loader.c (method_from_methodspec): Avoid inflating a method
10189         twice with the same context.  If the methodref is inflated, use
10190         the declaring method instead.
10191
10192         * class.c (mono_class_from_generic_parameter): Fix case similar to
10193         bug #81830 handled below, but for method containers.
10194
10195 2007-06-10  Raja R Harinath  <harinath@gmail.com>
10196
10197         * class.c (inflate_generic_type) [MONO_TYPE_CLASS]: Don't call
10198         get_shared_generic_class.  Directly inflate the instance.
10199         [MONO_TYPE_GENERICINST]: Inline inflate_generic_class.
10200         (inflate_generic_class): Delete.
10201         (get_shared_generic_class): Delete.  Move setting of
10202         'cached_class' and 'cached_context' ...
10203         * metadata.c (mono_metadata_lookup_generic_class): ... here.
10204
10205         * metadata.c (mono_metadata_lookup_generic_class): Change
10206         signature to take the components of a MonoGenericClass rather than
10207         an allocated MonoGenericClass.  Change semantics to be intern-like.
10208         * reflection.c (mono_class_bind_generic_parameters): Update to
10209         changes.  Make locking region tighter.
10210         * class.c (inflate_generic_class): Update to changes.
10211         (get_shared_generic_class): Likewise.
10212         * metadata-internals.h: Likewise.
10213
10214         * reflection.c (mono_class_bind_generic_parameters): Take and
10215         return a MonoClass*, not a MonoType*.  Add 'is_dynamic' parameter.
10216         (mono_reflection_bind_generic_parameters): Use
10217         'mono_class_bind_generic_parameters' rather than duplicate the code.
10218         * class.c (mono_bounded_array_class_get): Update to changes.
10219         * object-internals.h: Likewise.
10220
10221         * reflection.c (mono_class_bind_generic_parameters): Only support
10222         parameterizing generic type definitions.  Remove support for other
10223         open types.
10224
10225 2007-06-08  Zoltan Varga  <vargaz@gmail.com>
10226
10227         * loader.c (mono_free_method): Free method->signature as well. Fixes #81832.
10228
10229         * marshal.c (mono_marshal_get_managed_wrapper): Allocate the signature using malloc
10230         in the dynamic case.
10231
10232 2007-06-08  Gert Driesen  <drieseng@users.sourceforge.net>
10233
10234         * threads.c: When cleaning up thread, reset the Background bit.
10235         Fixes bug #81720.
10236
10237 2007-06-08  Jonathan Chambers  <joncham@gmail.com>
10238
10239        * metadata.c: Move variable declarations to top of scope.
10240        * verify.c: Move variable declarations to top of scope.
10241
10242        Code is contributed under MIT/X11 license.
10243
10244 2007-06-08  Raja R Harinath  <rharinath@novell.com>
10245
10246         * reflection.c (mono_class_bind_generic_parameters): Replace
10247         open-coded loop with mono_metadata_inflate_generic_inst.
10248
10249         * class.c (get_shared_generic_class): Don't call
10250         mono_get_shared_generic_inst.  Use the container's own
10251         'class_inst'.
10252
10253         * metadata.c (mono_metadata_load_generic_params): Move
10254         initialization of 'context' field here from ...
10255         * class.c (mono_class_create_from_typedef): ... here, and ...
10256         * loader.c (mono_get_method_from_token): ... here.
10257
10258         * class.c (get_shared_generic_class): Rename from
10259         mono_get_shared_generic_class and make static.
10260         (mono_get_shared_generic_inst): Move to metadata.c.
10261         * loader.c (mono_get_shared_generic_method): Likewise.
10262         * class-internals.h, metadata-internals.h: Update to changes.
10263
10264         Fix #81830
10265         * class.c (mono_class_from_generic_parameter): Don't assume a
10266         generic container owner exists.  Generic containers from monodis
10267         don't have any.
10268
10269 2007-06-06  Rodrigo Kumpera  <kumpera@gmail.com>
10270
10271         * pedump.c: pedump exists with 2 if assembly is not verifiable and 3 if invalid
10272         * verify.h: new typedefs to returns the non-verifiable status
10273         * verify.c: initial implementation of generics, stack merging and object compatibility check
10274
10275 2007-06-06  Mark Probst  <mark.probst@gmail.com>
10276
10277         * class.c, image.c, class-internals.h (MonoImage): class_cache is
10278         a MonoInternalHashTable again (fixed bug in internal hash table
10279         code).
10280
10281 2007-06-06  Mark Probst  <mark.probst@gmail.com>
10282
10283         * domain.c, domain-internals.h (MonoDomain): jit_code_hash is a
10284         MonoInternalHashTable again (fixed bug in internal hash table
10285         code).
10286
10287 2007-06-06  Mark Probst  <mark.probst@gmail.com>
10288
10289         * class.c, image.c, class-internals.h, domain.c,
10290         domain-internals.h (MonoImage): Reverting MonoInternalHashTable
10291         changes.  Have to figure out what makes them break the SWF
10292         regression.
10293
10294 2007-06-04  Mark Probst  <mark.probst@gmail.com>
10295
10296         * class.c, image.c, class-internals.h (MonoImage): class_cache is
10297         a MonoInternalHashTable now.
10298
10299 2007-06-04  Mark Probst  <mark.probst@gmail.com>
10300
10301         * domain.c, domain-internals.h (MonoDomain): jit_code_hash is a
10302         MonoInternalHashTable now.
10303
10304 2007-05-31  Zoltan Varga  <vargaz@gmail.com>
10305
10306         * domain-internals.h (MonoDomain): Add two new hash tables to store delegate
10307         invoke_impl code.
10308
10309         * object-internals.h (_MonoDelegate): Reflect changes to managed object layout.
10310
10311         * object.c (mono_delegate_ctor): Initialize invoke_impl field with an arch
10312         dependent trampoline.
10313
10314         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
10315
10316         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): New icall.
10317
10318 2007-05-29  Robert Jordan  <robertj@gmx.net>
10319
10320         * marshal.[c|h]: add mono_win32_compat_* wrappers. Fixes #81754.
10321
10322 2007-05-28  Zoltan Varga  <vargaz@gmail.com>
10323
10324         * icall.c (ves_icall_get_method_info): Handle loader errors. Fixes #81724.
10325
10326 2007-05-25  Jonathan Chambers  <joncham@gmail.com>
10327
10328        * marshal.c: Fix interface lookup loops for
10329        cominterop_get_com_slot_for_method and 
10330        cominterop_get_method_interface. Only need to lookup
10331        if type is a class, else use interface type method is on.
10332
10333        Code is contributed under MIT/X11 license.
10334
10335 2007-05-25  Sebastien Pouliot  <sebastien@ximian.com>
10336
10337         * reflection.c: HasSecurity can be present even if no specially 
10338         encoded (CAS) attributes are available (e.g. SuppressUnmanagedCode
10339         SecurityAttribute). Fix CAS regression tests on buildbot.
10340
10341 2007-05-24  Jonathan Chambers  <joncham@gmail.com>
10342
10343        * appdomain.c: Add configure checks for header files.
10344        * image.c: Add configure checks for header files.
10345        * file-io.c: Add configure checks for header files.
10346        * debug-mono-symfile.c: Add configure checks for header files.
10347        * threadpool.c: Add configure checks for header files.
10348        * console-io.c: Add configure checks for header files.
10349        * profiler.c: Add configure checks for header files.
10350        * rawbuffer.c: Add configure checks for header files.
10351        * icall.c: Add configure checks for header files.
10352        * rand.c: Add configure checks for header files.
10353        * socket-io.c: Add configure checks for header files.
10354
10355        Code is contributed under MIT/X11 license.
10356
10357 2007-05-24  Zoltan Varga  <vargaz@gmail.com>
10358
10359         * reflection.c (mono_custom_attrs_from_builders): Remove the 
10360         assertion as it breaks the build.
10361         
10362         * reflection.c (mono_custom_attrs_from_builders): Add an assertion.
10363
10364         * reflection.c (lookup_custom_attr): Make a copy here too.
10365
10366         * image.c (mono_image_check_for_module_cctor): Avoid accessing metadata in
10367         dynamic images.
10368
10369         * class.c (mono_class_init): Avoid accessing the metadata in dynamic
10370         images.
10371
10372         * reflection.c (mono_custom_attrs_from_param): Make a copy of the dynamic attr
10373         info.
10374
10375 2007-05-22  Zoltan Varga  <vargaz@gmail.com>
10376
10377         * reflection.c (encode_cattr_value): Fix yet another object cattr encoding issue.
10378         (load_cattr_value): Ditto.
10379
10380 2007-05-20  Zoltan Varga  <vargaz@gmail.com>
10381
10382         * marshal.c (mono_marshal_get_delegate_invoke): Improve the generated IL a little.
10383
10384 2007-05-19  Gert Driesen  <drieseng@users.sourceforge.net>
10385
10386         * threads.c: In "start_wrapper", set apartment_state to MTA if
10387         apartment_state is Unknown and we're running on 2.0 profile or
10388         higher.
10389         * object.c: In "mono_runtime_exec_main", if STAThread is not applied
10390         to main method, then set apartment_state to Unknown on 1.0 profile,
10391         and MTA on 2.0 profile.
10392
10393 2007-05-16  Jb Evain  <jb@nurv.fr>
10394
10395         * class-internals.h (MonoDefaults): Add an attribute_class and
10396           customattribute_data_class.
10397         * domain.c (mono_init_internal): Populate them.
10398         * reflection.c: Use them to remove duplicates. Make a vew
10399         MonoClass variables `static'.
10400
10401 2007-05-15  Massimiliano Mantione  <massi@ximian.com>
10402
10403         * class-internals.h: Added "MonoVTable.interface_bitmap" as a next
10404         step in implementing IMT, so that all isinst checks now can go
10405         through the bitmap.
10406         This was needed because vtables for TransparentProxy need to look
10407         like the vtable of the "target" class, so they need to point to
10408         its interface bitmap directly.
10409
10410         * object.c: inside "mono_class_create_runtime_vtable" and
10411         "mono_class_proxy_vtable", initialize "MonoVTable.interface_bitmap".
10412
10413 2007-05-15  Atsushi Enomoto  <atsushi@ximian.com>
10414
10415         * object-internals.h
10416           culture-info.h : added territory field in MonoCulture and
10417           CultureInfoEntry foreach. Added lcid field in RegionInfoEntry.
10418         * locales.c : fill territory field above too.
10419         * culture-info-table.h : regenerated.
10420
10421 2007-05-12  Zoltan Varga  <vargaz@gmail.com>
10422
10423         * class-internals.h (_MonoGenericContainer): Widen type_argc filed to 31 bits.
10424         Fixes #81599.
10425
10426 2007-05-11  Jonathan Chambers  <joncham@gmail.com>
10427
10428         * object.c: Always initialize apartment, even if 
10429         there is no custom attributes on entry point.
10430         
10431         Code is contributed under MIT/X11 license.
10432
10433 2007-05-10  Jonathan Chambers  <joncham@gmail.com>
10434
10435         * marshal.c: LPTSTR == LPWSTR on Win32. Fixes #81370.
10436         * metadata.c: If no encoding is set, check for unicode
10437         on class.
10438         
10439         Code is contributed under MIT/X11 license.
10440
10441 2007-05-09  Jonathan Chambers  <joncham@gmail.com>
10442
10443         * threads.c: Handle if mono_thread_current returns NULL 
10444         
10445         Code is contributed under MIT/X11 license.
10446
10447 2007-05-09  Jonathan Chambers  <joncham@gmail.com>
10448
10449         * threads.c: Initialize Thread.AprtmentState and set on Thread.Start
10450         in start_wrapper. Added mono_thread_init_apartment_state and
10451         mono_thread_cleanup_apartment_state.
10452         * object.c: Initialize thread apartment state on main thread
10453         by checking for STAThreadAttribute on entry point.
10454         * object-internals.h: Add apartment_state field to MonoThread.
10455         * threads-types.h: Add unmanaged definition of 
10456         System.Threading.ApartmentState, MonoThreadApartmentState.
10457         
10458         Code is contributed under MIT/X11 license.
10459         
10460 2007-05-08  Jonathan Chambers  <joncham@gmail.com>
10461
10462         * class.c: Fix windows build.
10463         * class-internals.h: Fix windows build.
10464         
10465         Code is contributed under MIT/X11 license.
10466
10467 2007-05-08  Robert Jordan  <robertj@gmx.net>
10468
10469         * process.c (CreateProcess_internal):
10470         Pass CREATE_NO_WINDOW to CreateProcess when ProcessStartupInfo
10471         .CreateNoWindow was specified. Fixes #81496.
10472
10473 2007-05-08  Massimiliano Mantione  <massi@ximian.com>
10474
10475         * class-internals.h: Removed "MonoClass.interface_offsets" as a first
10476         step in implementing IMT, replaced it with two compact arrays
10477         (interfaces_packed and interface_offsets_packed) and a bitmap that
10478         is used for isinst checks (interface_bitmap).
10479
10480         * class.c: (compare_interface_ids): compare function to pass to
10481         bsearch when looking for an interface with a given id.
10482         (mono_class_interface_offset): reimplemented using bsearch on
10483         interfaces_packed, getting the offset from interface_offsets_packed.
10484         (print_implemented_interfaces): utility debugging function.
10485         (setup_interface_offsets): reworked to initialize interfaces_packed,
10486         interface_offsets_packed and interface_bitmap.
10487
10488         * object.c: replaced all accesses to "MonoClass.interface_offsets"
10489         with uses of interfaces_packed and interface_offsets_packed.
10490
10491 2007-05-08  Massimiliano Mantione  <massi@ximian.com>
10492
10493         * class-internals.h: Added MONO_CLASS_IMPLEMENTS_INTERFACE macro and
10494         mono_class_interface_offset prototype to wrap all accesses to
10495         "MonoClass.interface_offsets".
10496
10497         * class.c: Implemented mono_class_interface_offset, and wrapped all
10498         accesses to "MonoClass.interface_offsets".
10499
10500         * monodiet.c, object.c, marshal.c, icall.c: wrapped all accesses to
10501         "MonoClass.interface_offsets".
10502
10503 Tue May 8 13:02:09 CEST 2007 Paolo Molaro <lupus@ximian.com>
10504
10505         * icall.c, icall-def.h: implemented new GetFieldFromHandle and
10506         GetMethodFromHandle overloads (bug #78637).
10507
10508 Tue May 8 12:22:14 CEST 2007 Paolo Molaro <lupus@ximian.com>
10509
10510         * assembly.c: parse ProcessorArchitecture in assembly name and ignore
10511         it for now (see mono-devel, from Marek Sieradzki <marek.sieradzki@gmail.com>).
10512
10513 2007-05-01  Zoltan Varga  <vargaz@gmail.com>
10514
10515         * icall.c (custom_attrs_get_by_type): Handle loading errors gracefully. Fixes
10516         #81498.
10517
10518         * reflection.c (mono_reflection_get_custom_attrs_by_type): Handle loading errors
10519         gracefully.
10520         (mono_custom_attrs_from_index): Ditto.
10521
10522         * icall.c (ves_icall_InternalInvoke): Allow calling ctors of abstract classes. 
10523         Fixes #81501.
10524
10525 2007-04-30  Zoltan Varga  <vargaz@gmail.com>
10526
10527         * metadata.c (mono_metadata_parse_type_full): Avoid an invalid free since the type
10528         is now allocated from a mempool.
10529
10530 2007-04-28  Zoltan Varga  <vargaz@gmail.com>
10531
10532         * threads.c (build_wait_tids): Do not call mono_monitor_enter () here since the
10533         caller holds threads_lock, leading to deadlocks. Fixes #81476.
10534
10535 2007-04-26  Zoltan Varga  <vargaz@gmail.com>
10536
10537         * loader.c (mono_loader_error_prepare_exception): Fix crash caused by calling
10538         mono_loader_clear_error () too late. Fixes #81463.
10539
10540 2007-04-26  Atsushi Enomoto  <atsushi@ximian.com>
10541
10542         * culture-info-table.h : regenerated.
10543
10544 2007-04-25  Zoltan Varga  <vargaz@gmail.com>
10545
10546         * appdomain.c (add_assemblies_to_domain): Fix crash when an assembly reference
10547         is missing.
10548
10549 2007-04-25  Dick Porter  <dick@ximian.com>
10550
10551         * Makefile.am: Put the mingw enforced-optimisation back into the
10552         PLATFORM_WIN32 section.
10553
10554 2007-04-24  Zoltan Varga  <vargaz@gmail.com>
10555
10556         * reflection.c (mono_image_load_module_dynamic): Fix crash introduced by previous
10557         patch.
10558
10559         * image.c (mono_image_load_module): New API function to load a module reference.
10560
10561         * image.c (load_modules): Load modules lazily. Fixes #80812.
10562
10563         * class.c (mono_class_from_typeref): Use mono_image_load_module.
10564         
10565         * reflection.c (mono_image_load_module_dynamic): Copy image->modules_loaded too.
10566
10567         * object-internals.h reflection.c icall-def.h (mono_image_load_module): Rename this 
10568         to mono_image_load_module_dynamic.
10569
10570 2007-04-23  Jonathan Chambers  <joncham@gmail.com>
10571
10572         * marshal.c: Fix calling convention for CCW on non-windows
10573         platforms. STDCALL on windows, CDECL everywhere else to work 
10574         with XPCOM and MainWin COM.
10575         
10576         Code is contributed under MIT/X11 license.
10577
10578 2007-04-23  Martin Baulig  <martin@ximian.com>
10579
10580         Fix #80969.
10581
10582         * loader.c
10583         (method_from_memberref): Added `gboolean *used_context' argument.
10584         (mono_get_method_from_token): Likewise.
10585         (mono_get_method_full): Don't insert the method in the cache when
10586         `used_context' is true.
10587
10588 2007-04-23  Raja R Harinath  <rharinath@novell.com>
10589
10590         * monodiet.c (add_types_from_method): Fix "wrong type" warning.
10591
10592         * reflection.c (mono_reflection_bind_generic_parameters): Don't
10593         create new MonoTypes for returned types.
10594         * class.c (mono_generic_class_get_class): Export mono-internal.
10595         * class-internals.h: Update to changes.
10596
10597 Thu Apr 19 16:45:55 CEST 2007 Paolo Molaro <lupus@ximian.com>
10598
10599         * threadpool.c, threadpool.h, icall-def.h: patch from
10600         Robert Jordan to implemnt ThreadPool.SetMaxThreads.
10601
10602 2007-04-18  Zoltan Varga  <vargaz@gmail.com>
10603
10604         * threads.c (mono_thread_get_stack_bounds): Fix windows build.
10605         
10606         * threads.c (mono_thread_get_stack_bounds): Remove an assert which can be triggered.
10607
10608         * threads.c (mono_thread_get_stack_bounds): New helper function.
10609
10610         * threads.c (mono_thread_attach): Applied patch from horst.reiterer@fabasoft.com.
10611         Correctly compute stack bounds when attaching. Fixes #81394.
10612
10613 Wed Apr 18 18:28:41 BST 2007 Paolo Molaro <lupus@ximian.com>
10614
10615         * reflection.c: fix handling of doubles in custom attributes
10616         for the arm-fpa format (bug #81368).
10617
10618 2007-04-18  Raja R Harinath  <rharinath@novell.com>
10619
10620         * reflection.c (assembly_add_win32_resources): Mildly relax an
10621         bounds check to let the end pointer point just past the end of the
10622         allocated buffer.  (may fix #81384)
10623
10624 2007-04-17  Atsushi Enomoto  <atsushi@ximian.com>
10625
10626         * culture-info-table.h : regenerated.
10627
10628 2007-04-07  Zoltan Varga  <vargaz@gmail.com>
10629
10630         * threads.c (start_wrapper): Call push_appdomain_ref () earlier to fix races where
10631         the thread is aborted early.
10632
10633 2007-04-05  Dick Porter  <dick@ximian.com>
10634
10635         * file-io.c (ves_icall_System_IO_MonoIO_GetFileSystemEntries): use
10636         FindFirstFile()/FindNextFile() to find entries.  This lets the
10637         io-layer versions use MONO_IOMAP compatibility helpers.  Fixes bug
10638         81038.
10639
10640         * appdomain.c (MONO_CORLIB_VERSION): Increment, as the usage of
10641         the parameters of
10642         ves_icall_System_IO_MonoIO_GetFileSystemEntries() has changed.
10643
10644 2007-04-04  Martin Baulig  <martin@ximian.com>
10645
10646         * debug-helpers.c
10647         (mono_method_desc_full_match): Add support for nested classes.
10648
10649 2007-04-02  Zoltan Varga  <vargaz@gmail.com>
10650
10651         * marshal.c (cominterop_get_managed_wrapper_adjusted): Fix warnings.
10652
10653 2007-04-01  Zoltan Varga  <vargaz@gmail.com>
10654
10655         * threads.c (abort_appdomain_thread): Avoid handle leakage if we are
10656         waiting for too many threads.
10657
10658 2007-03-28  Sebastien Pouliot  <sebastien@ximian.com>
10659
10660         * environment.c: Fix return value check on uname so we can get the 
10661         executing version on Solaris operating systems.
10662
10663 2007-03-28  Jb Evain  <jbevain@gmail.com>
10664
10665         * class.c (mono_type_get_name_recurse): Complete the
10666         fix for the creation of assembly qualified names for
10667         pointer types. Fixes #81208.
10668
10669 2007-03-27  Dick Porter  <dick@ximian.com>
10670
10671         * appdomain.c (MONO_CORLIB_VERSION): Increment, as the signature
10672         of ves_icall_System_Threading_Mutex_ReleaseMutex_internal() has
10673         changed.
10674
10675         * threads.c
10676         (ves_icall_System_Threading_Mutex_ReleaseMutex_internal): Return
10677         the value of ReleaseMutex().
10678
10679 2007-03-27  Dick Porter  <dick@ximian.com>
10680
10681         * socket-io.c (ipaddress_to_struct_in_addr): IPAddress is stored
10682         in little-endian order, not network endian, so must be converted
10683         to host endian here.  Fixes bug 80593.
10684
10685 2007-03-22  Jb Evain  <jbevain@gmail.com>
10686
10687         * class.c (mono_type_get_name_recurse): Fix the creation of assembly
10688         qualified names for pointer types. Fixes #81208.
10689
10690 2007-03-21  Jonathan Chambers  <joncham@gmail.com>
10691
10692         * marshal.c: Add support for PreserveSigAttribute. 
10693         
10694         Code is contributed under MIT/X11 license.
10695
10696 2007-03-14  Zoltan Varga  <vargaz@gmail.com>
10697
10698         * process.c: Fix endianness issues. Fixes #81126.
10699
10700         * reflection.c (mono_reflection_create_dynamic_method): Fix the last change so
10701         multiple circular calls made from the same DynamicMethod work. Fixes #81141.
10702
10703         * image.c (mono_image_lookup_resource): Make this work on big-endian
10704         machines.Change API contract so the caller needs to free the return value.
10705         
10706         * process.c (process_get_fileversion): Adapt to mono_image_lookup_resource ()
10707         API change.
10708         
10709 2007-03-14  Martin Baulig  <martin@ximian.com>
10710
10711         * debug-helpers.c (mono_type_get_desc): In `MONO_TYPE_ARRAY', use
10712         mono_type_get_desc() as well.
10713
10714 2007-03-13  Jonathan Chambers  <joncham@gmail.com>
10715
10716         * icall.c:  Fix environ access in VS.  
10717         
10718 2007-03-13  Alp Toker  <alp@atoker.com>
10719
10720         * icall.c (ves_icall_MonoType_GetElementType): For enums, return null
10721         rather than the underlying type. Based on a patch by Ben Maurer. Fixes
10722         #63841.
10723
10724 2007-03-12  Zoltan Varga  <vargaz@gmail.com>
10725
10726         * reflection.c (mono_reflection_create_dynamic_method): Add support for 
10727         circular references among dynamic methods. Fixes #81091.
10728
10729         * object-internals.h (MonoReflectionDynamicMethod): Add 'referenced_by' field.
10730
10731 2007-03-09  Martin Baulig  <martin@ximian.com>
10732
10733         * reflection.c (encode_constant): Add support for MONO_TYPE_GENERICINST.
10734
10735 2007-03-09  Jonathan Chambers  <joncham@gmail.com>
10736
10737         * appdomain.c:  Fix shadow copy on Windows. Use g_snprintf instead
10738         of snprintf as it doesn't exist on Win32 (VS build); also for uniformity.  
10739         
10740         Code is contributed under MIT/X11 license.
10741         
10742 2007-03-09  Gert Driesen  <drieseng@users.souceforge.net>
10743
10744         * loader.c: Reapply patch for bug #79424.
10745
10746 2007-03-06  Zoltan Varga  <vargaz@gmail.com>
10747
10748         * metadata.c (mono_type_to_unmanaged): Only convert object to
10749         MARSHAL_CONV_SAFEHANDLE on the 2.0 profile.
10750
10751 Tue Mar 6 15:39:48 CET 2007 Paolo Molaro <lupus@ximian.com>
10752
10753         * class-internals.h, class.c, metadata.c, reflection.c: removed unused
10754         (and incorrectly set) is_reference field from MonoGenericInst.
10755
10756 2007-03-06  Zoltan Varga  <vargaz@gmail.com>
10757
10758         * assembly.c (mono_assembly_load_from_full): Call mono_assemblies_unlock ()
10759         a little earlier.
10760
10761         * icall.c (ves_icall_type_Equals): Rename this to ves_icall_System_Type_EqualsInternal.
10762
10763         * icall-def.h: Rename Type:Equals to Type:EqualsInternal.
10764
10765 2007-03-05  Miguel de Icaza  <miguel@novell.com>
10766
10767         * file-io.c (ves_icall_System_IO_MonoIO_Open): Use the new
10768         FileOptions.1 value to mean "temporary", map that to
10769         FILE_ATTRIBUTE_TEMPORARY and use that to signal 600 permissions.
10770
10771         Fixes 80688
10772
10773 2007-03-03  Marek Habersack  <mhabersack@novell.com>
10774
10775         * appdomain.c: implement MS .Net style shadow copying. Copies of
10776         the assemblies are made in a subdirectory of the dynamic base
10777         directory, the assembly names are preserved.
10778         Copy .mdb and .config files along with the assemblies being shadowed.
10779
10780 2007-02-28  Zoltan Varga  <vargaz@gmail.com>
10781
10782         * marshal.c (emit_object_to_ptr_conv): Emit valid IL for handling HandleRefs.
10783         (emit_marshal_handleref): Ditto.
10784
10785         * profiler.c: Applied patch from Tor Lillqvist (tml@novell.com) to fix output
10786         on Visual C++. Fixes #80671.
10787
10788 Wed Feb 28 16:53:40 CET 2007 Paolo Molaro <lupus@ximian.com>
10789
10790         * boehm-gc.c, null-gc.c, object.h, object.c: sgen gc fixes
10791         for clone operations.
10792
10793 2007-02-28  Zoltan Varga  <vargaz@gmail.com>
10794
10795         * marshal.c: Fix warnings.
10796
10797 Fri Feb 23 15:06:57 CET 2007 Paolo Molaro <lupus@ximian.com>
10798
10799         * loader.c: allow case-insensitive matching of the dll name
10800         in dllmap handling when prefixed with "i:".
10801
10802 2007-02-20  Jonathan Chambers  <joncham@gmail.com>
10803
10804         * threads.c: Fix #ifdef for dummy_apc function for VS.
10805
10806 Tue Feb 20 11:59:42 CET 2007 Paolo Molaro <lupus@ximian.com>
10807
10808         * threads.c: don't throw in MemoryBarrier (), use lock/unlock.
10809
10810 2007-02-19  Massimiliano Mantione  <massi@ximian.com>
10811         * class.c (mono_class_setup_vtable_general): Fix bug 75903,
10812         giving precedence to the methods with a fully qualified name
10813         (InterfaceName.MethodName) when building the interface sections
10814         of the vtable.
10815
10816 2007-02-16  Dick Porter  <dick@ximian.com>
10817
10818         * threadpool.c (append_job): Fix fast-path array handling, so it's
10819         less likely the array will grow exponentially when the load is
10820         heavy.
10821
10822 Fri Feb 16 19:17:30 CET 2007 Paolo Molaro <lupus@ximian.com>
10823
10824         * metadata-internals.h, loader.c: fix dllmap lookup order
10825         for non-function maps, too, and prepare for fallback code.
10826
10827 2007-02-12  Robert Jordan  <robertj@gmx.net>
10828
10829         * marshal.c, marshal.h, icall-def.h: rename mono_marshal_realloc
10830         to ves_icall_System_Runtime_InteropServices_Marshal_ReAllocHGlobal
10831         and use GlobalReAlloc on WIN32 to be in sync with GlobalAlloc,
10832         GlobalFree. Fixes a part of bug #77075.
10833
10834 Mon Feb 12 21:10:07 CET 2007 Paolo Molaro <lupus@ximian.com>
10835
10836         * loader.c: implemented typedef parent in field memberref.
10837
10838 2007-02-11  Jonathan Chambers  <joncham@gmail.com>
10839
10840         * marshal.c: Fix warnings and remember to call Release on
10841         IUnknown of RCW.
10842         
10843         Code is contributed under MIT/X11 license.
10844
10845 2007-02-10  Miguel de Icaza  <miguel@novell.com>
10846
10847         * class-internals.h: Add MonoHandleRef definition, and
10848         handleref_class to mono_defaults. 
10849
10850         * metadata.c (mono_type_to_unmanaged): If we find HandleRefs in a
10851         structure, use new conversion MONO_MARSHAL_CONV_HANDLEREF.
10852
10853         * marshal.c (emit_ptr_to_object_conv): Add support for HandleRefs
10854         (do nothing on this stage)
10855         (emit_object_to_ptr_conv): Extract the handle from the HandleRef.  
10856         (emit_marshal_handleref): New method, used for argument handling
10857         of HandleRefs. 
10858
10859 2007-02-08  Jonathan Chambers  <joncham@gmail.com>
10860
10861         * class.c (mono_class_setup_parent): Lazily init com types.
10862         * domain.c (mono_init_internal, mono_init_com_types): Lazily 
10863         init com types.
10864         * object.c (mono_remote_class_vtable): Lazily init com types.
10865         * class-internals.h: Add iunknown and idispatch to MonoDefaults.
10866         * object-internals.h: Add MonoComInteropProxy and MonoReflectionGuidAttribute.
10867         * domain-internals.h: Expose mono_init_com_types.
10868         * icall-def.h: Add icalls for ComInteropProxy, __ComObject, and Marshal.
10869         * marshal.c: Add mutex for cominterop use. Init locals for wrapper methods.
10870         Add support for COM Callable Wrapper marshalling.
10871         * marshal.h: Add icall definitions.
10872         * gc.c: Handle freeing of CCWs in finalizer code.
10873         
10874         Code is contributed under MIT/X11 license.
10875
10876 Thu Feb 8 12:46:18 CET 2007 Paolo Molaro <lupus@ximian.com>
10877
10878         * reflection.c: changed all the signature encoding code to use
10879         a variable-sized buffer.
10880
10881 Wed Feb 7 20:37:23 CET 2007 Paolo Molaro <lupus@ximian.com>
10882
10883         * marshal.c: locking fixes: never take the loader lock
10884         or other runtime locks when holding the marshal lock
10885         (fixes bug#80664).
10886
10887 Wed Feb 7 18:49:10 CET 2007 Paolo Molaro <lupus@ximian.com>
10888
10889         * marshal.c: make the delegate function pointer mapping
10890         work for the moving GC.
10891
10892 Mon Jan 29 11:30:46 CET 2007 Paolo Molaro <lupus@ximian.com>
10893
10894         * marshal.c: fix from Robert Jordan (robertj@gmx.net)
10895         for bug #80618.
10896
10897 Fri Jan 26 12:49:23 CET 2007 Paolo Molaro <lupus@ximian.com>
10898
10899         * image.h, loader.c, metadata-internals.h: use mono-dl instead of
10900         gmodule.
10901
10902 Fri Jan 26 12:00:45 CET 2007 Paolo Molaro <lupus@ximian.com>
10903
10904         * threadpool.c: made the code moving-GC safe.
10905
10906 Thu Jan 25 20:31:41 CET 2007 Paolo Molaro <lupus@ximian.com>
10907
10908         * assembly.c, boehm-gc.c, class-internals.h, class.c,
10909         debug-mono-symfile.c, domain.c, locales.c, marshal.c, metadata.c,
10910         monitor.c, mono-debug.c, mono-debug.h, object.c, profiler.c:
10911         warning cleanup.
10912         * reflection.c: warning cleanup, some threading and moving GC fixes.
10913
10914 Thu Jan 25 16:22:36 CET 2007 Paolo Molaro <lupus@ximian.com>
10915
10916         * class.c, loader.c: create the needed Set/Get/Address array methods
10917         as well as the .ctors in mono_class_init (), fixes bug #80567.
10918
10919 2007-01-24  Zoltan Varga  <vargaz@gmail.com>
10920
10921         * class.c (mono_class_layout_fields): When force-aligning a field, make sure
10922         we doesn't decrease its alignment. Should fix the sparc build.
10923
10924 2007-01-24  Dick Porter  <dick@ximian.com>
10925
10926         * socket-io.c
10927         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
10928         Create the returned object if we need to ignore an unsupported
10929         socket option.  Fixes a segfault reported by Atsushi.
10930
10931 Tue Jan 23 18:09:21 CET 2007 Paolo Molaro <lupus@ximian.com>
10932
10933         * class.c, object.c: restrict GC-tracked fields to
10934         UIntPtr fields used inside corlib, so we provide better
10935         type info to the GC and also allow broken packing as in
10936         bug #80580.
10937
10938 Mon Jan 22 11:24:27 CET 2007 Paolo Molaro <lupus@ximian.com>
10939
10940         * sgen-gc.c: removed duplicated function.
10941
10942 2007-01-19  Miguel de Icaza  <miguel@novell.com>
10943
10944         *  socket-io.c (convert_sockopt_level_and_name): return -2 as a
10945         value that means that the value is not supported, but that we
10946         should not return a failure, but instead report this as a
10947         successful operation.
10948
10949 2007-01-19  Raja R Harinath  <rharinath@novell.com>
10950
10951         Fix tests/bug79956.2.il
10952         * class.c (mono_type_get_underlying_type): Handle genericinst enums.
10953         (mono_generic_class_get_class): If the generic definition in an
10954         enum, copy over other fields related to it.
10955
10956 Thu Jan 18 18:37:28 CET 2007 Paolo Molaro <lupus@ximian.com>
10957
10958         * metadata.h: fix MONO_TYPE_ISSTRUCT() to not consider
10959         genericinst enums (bug #79215).
10960
10961 2007-01-17  Massimiliano Mantione  <massi@ximian.com>
10962         * class.c: Fix bug 80307.
10963
10964 Wed Jan 17 17:09:20 CET 2007 Paolo Molaro <lupus@ximian.com>
10965
10966         * image.c: if the file table is not present, try to load
10967         all the modules, since we don't have info about them
10968         having or not metadata (bug #80517).
10969         * assembly.c: allow mono_assembly_load_references () to
10970         work for netmodules.
10971
10972 Wed Jan 17 14:28:30 CET 2007 Paolo Molaro <lupus@ximian.com>
10973
10974         * image.c, metadata-internals.h, object.c: execute module
10975         cctors when running on the 2 runtime if present (bug #80487).
10976
10977 Tue Jan 16 15:32:53 CET 2007 Paolo Molaro <lupus@ximian.com>
10978
10979         * icall.c: optimized InitializeArray() on bigendian.
10980
10981 Tue Jan 16 13:18:51 CET 2007 Paolo Molaro <lupus@ximian.com>
10982
10983         * icall.c: fix for the broken ARM FPA double format.
10984
10985 Tue Jan 16 12:51:16 CET 2007 Paolo Molaro <lupus@ximian.com>
10986
10987         * icall.c: handle endian issues for r4 and r8 types, too, in
10988         the InitializeArray() icall.
10989
10990 2007-01-15  Miguel de Icaza  <miguel@novell.com>
10991
10992         * loader.c (mono_loader_error_prepare_exception): Clear the error
10993         once we have extracted the information from it, do this before we
10994         call into the JIT's class loading mechanisms.
10995
10996         * object.c (mono_class_create_runtime_vtable): Do not clear the
10997         loader error before calling mono_class_get_exception_for_failure
10998         as the loader error is needed inside
10999         mono_class_get_exception_for_failure to throw the error (thinko).
11000
11001         Fixes #80521
11002         
11003 Mon Jan 15 10:27:31 CET 2007 Paolo Molaro <lupus@ximian.com>
11004
11005         * reflection.c: align fields rva data so it's faster to load at
11006         runtime.
11007
11008 2007-01-12  Raja R Harinath  <rharinath@novell.com>
11009
11010         Prepare to simplify GenericMethod handling.
11011         * class-internals.h (mono_method_get_context): New accessor function.
11012         * class.c, icall.c, loader.c, reflection.c, verify.c: Use accessor
11013         rather than directly accessing '->context' field.
11014
11015         * class-internals.h (_MonoGenericParam.method): Move ...
11016         (_MonoGenericContainer): ... here.  Add into union with klass field.
11017         * class.c, icall.c, loader.c, metadata.c, reflection.c:
11018         Update to changes.
11019
11020 Fri Jan 12 11:58:52 CET 2007 Paolo Molaro <lupus@ximian.com>
11021
11022         * Makefile.am, class-internals.h, debug-helpers.c: consolidate
11023         the wrapper type enum and reduce relocations.
11024
11025 2007-01-12  Raja R Harinath  <rharinath@novell.com>
11026
11027         * reflection.c (inflate_mono_method): Reuse method instantiation
11028         from the generic method, if available.
11029
11030 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
11031
11032         * marshal.c (emit_marshal_variant): Fix conv_arg
11033         type in last commit, based on whether parameter is byref.
11034         
11035 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
11036
11037         * marshal.c (emit_marshal_variant): Handle unmanaged->managed
11038         marshalling.
11039         (mono_marshal_emit_managed_wrapper): Convert byref arguments of type
11040         MONO_TYPE_OBJECT back for VARIANT support.
11041
11042 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
11043
11044         * marshal.c, marshal.h, icall-def.h: Implement 
11045         Marshal.ReAllocCoTaskMem.
11046
11047 Thu Jan 11 19:00:03 CET 2007 Paolo Molaro <lupus@ximian.com>
11048
11049         * marshal.c: memory retention fixes: use the proper
11050         image cache for runtime_invoke method lookups.
11051
11052 Thu Jan 11 18:53:19 CET 2007 Paolo Molaro <lupus@ximian.com>
11053
11054         * mempool.c: added code to help debug mempool allocations.
11055
11056 2007-01-11  Dick Porter  <dick@ximian.com>
11057
11058         * socket-io.c (convert_sockopt_level_and_name): Add DontFragment
11059         support (experimenting with faking it with IP_MTU_DISCOVER for
11060         systems that don't have IP_DONTFRAGMENT.)
11061         (ves_icall_System_Net_Sockets_Socket_Disconnect_internal): New
11062         icall.
11063
11064         * icall-def.h: new System.Net.Sockets.Disconnect icall.
11065
11066         * socket-io.h: Add new fields to MonoSocketAsyncResult
11067         corresponding to the new ones in Socket.cs.
11068
11069 2007-01-11  Raja R Harinath  <rharinath@novell.com>
11070
11071         Fix IronPython regression mentioned in #80249
11072         * metadata.c (do_mono_metadata_parse_generic_class): Clear
11073         'cached_context' field, since it may have been initialized as a
11074         side-effect of metadata parsing.
11075
11076         * class-internals.h (_MonoGenericClass.is_inflated): Remove.
11077         (_MonoGenericClass.cached_class): Move here and rename from lone
11078         remaining field of ...
11079         (_MonoInflatedGenericClass): ... this.  Remove.
11080         * metadata.h, class.c, reflection.c, metadata.c, icall.c: Update
11081         to changes.
11082
11083         Fix mcs/tests/test-128.cs regression.
11084         * reflection.c (encode_cattr_value) [MONO_TYPE_SZARRAY]: Revert
11085         2007-01-10 change below.
11086         [MONO_TYPE_OBJECT]: Recurse into array case.
11087
11088 2007-01-11  Raja R Harinath  <harinath@gmail.com>
11089
11090         * class-internals.h (mono_get_inflated_generic_class): Remove.
11091         * class.c (mono_get_inflated_generic_class): Remove.
11092         (mono_generic_class_get_class): Rename from
11093         mono_class_create_generic.
11094         (mono_class_from_mono_type) [GENERICINST]: Use it.
11095         * reflection.c, metadata.c: Update to changes.  Use
11096         'mono_class_from_mono_type'.
11097
11098 Wed Jan 10 16:19:54 CET 2007 Paolo Molaro <lupus@ximian.com>
11099
11100         * reflection.c: use passed type when encoding an array element
11101         in custom attributes (patch from David Mitchell, dmitchell@logos.com).
11102
11103 2007-01-09  Robert Jordan  <robertj@gmx.net>
11104
11105         * marshal.c (mono_delegate_end_invoke): Add check for unpaired asyc
11106         result arguments (someDelegate.EndInvoke (unrelatedAres)).
11107         Fixes bug #80392.
11108
11109 2007-01-09  Raja R Harinath  <rharinath@novell.com>
11110
11111         * class-internals.h (_MonoInflatedGenericClass.is_initialized): Remove.
11112
11113         * object.c (set_value): Avoid aliasing between type->data.klass
11114         and type->data.generic_class.
11115
11116         * class.c (mono_class_create_generic): Don't use 'is_initialized' field.
11117
11118 2007-01-08  Raja R Harinath  <rharinath@novell.com>
11119
11120         * marshal.c (mono_marshal_get_runtime_invoke): Avoid aliasing
11121         between type->data.klass and type->data.generic_class.
11122
11123 2007-01-08  Lluis Sanchez  <lluis@ximian.com>
11124
11125         * marshal.c: In MS.NET, StringBuilder objects are not copied by
11126         value in out parameters.
11127
11128 2007-01-08  Raja R Harinath  <rharinath@novell.com>
11129
11130         Simplify invariant for MonoGenericClass::klass field.
11131         * class.c (mono_class_create_generic): Verify 'klass' is null.
11132         * metadata.c (do_mono_metadata_parse_generic_class): Don't
11133         initialize 'klass' field.
11134
11135 2007-01-05  Raja R Harinath  <rharinath@novell.com>
11136
11137         Ongoing work to avoid redundant data and simplify invariants.
11138         * class-internals.h (_MonoGenericMethod.class_inst): Rename from
11139         'generic_class', and change type to a GenericInst.
11140         (_MonoGenericContext.class_inst): Likewise, rename from 'gclass'.
11141         * class.c, loader.c, metadata.c, reflection.c: Update to changes.
11142
11143 2007-01-05  Atsushi Enomoto  <atsushi@ximian.com>
11144
11145         * class.c : skip io-layer under PLATFORM_WIN32.
11146
11147 2007-01-03  Tor Lillqvist  <tml@novell.com>
11148
11149         Fix #80305: In a bundled executable, look in the bundled exe
11150         assembly to determine the runtime version. Add the possibility to
11151         bundle also the machine.config file.
11152         
11153         * assembly.c (mono_assembly_open_from_bundle): Make
11154         non-static. Allow being called even if we have no bundled
11155         assemblies, and return NULL right away in that case.
11156
11157         * domain-internals.h: Declare mono_assembly_open_from_bundle()
11158         here.
11159
11160         * domain.c (app_config_parse): Take an assembly exe file name as
11161         parameter instead of a config file name. Check for a bundled
11162         config file for that assembly by calling
11163         mono_config_string_for_assembly_file() (see below) before looking
11164         for one in the file system.
11165         (get_runtimes_from_exe): Corrsponding change to call of
11166         app_config_parse().
11167         (get_runtimes_from_exe): Check for bundled assembly exe file first
11168         by calling mono_assembly_open_from_bundle(). If no bundled
11169         assembly exe file is found, call mono_image_open() as before to
11170         look it up in the file system.
11171
11172         * mono-config.c: Add variable bundled_machinec_onfig.
11173         (mono_config_string_for_assembly_file): New function.
11174         (mono_config_for_assembly): Move code snippet that looks for a
11175         bundled assembly .config file into the above new function. Call
11176         it.
11177         (mono_register_machine_config, mono_get_machine_config): New
11178         functions to set and retrieve
11179
11180         * assembly.h: Declare mono_register_machine_config().
11181
11182         * mono-config.h: Declare mono_get_machine_config() and
11183         mono_config_string_for_assembly_file().
11184
11185         * icall.c: No declaration of environ necessary on Win32. It is
11186         declared (as a macro expanding to a function call) in stdlib.h.
11187         (ves_icall_System_Configuration_DefaultConfig_get_bundled_machine_config):
11188         New internal mono function. Returns the value of
11189         mono_get_machine_config() as a Mono string.
11190
11191         * icall-def.h: Add get_bundled_machine_config().
11192
11193 2007-01-04  Raja R Harinath  <rharinath@novell.com>
11194
11195         Remove redundant field
11196         * class-internals.h (_MonoGenericContext.container): Remove field.
11197         * loader.c (mono_method_get_signature_full): Don't parse a
11198         "container" for a signature parse when the signature is inflated
11199         immediately.
11200         (method_from_methodspec): Likewise, for a generic_inst.
11201         * class.c, metadata.c, reflection.c: Update to changes.
11202
11203 2006-01-04  Raja R Harinath  <rharinath@novell.com>
11204
11205         * class-internals.h (_MonoGenericClass): Rename 'context' field to
11206         'cached_context', and change semantics -- it starts off NULL, and
11207         is initialized on demand.
11208         * class.c (mono_generic_class_get_context): New accessor to
11209         replace 'context' field accesses.
11210         (mono_class_get_context): New helper.
11211         (*): Update to changes.
11212         * icall.c, loader.c, metadata.c, reflection.c: Update to changes.
11213
11214 2007-01-03  Miguel de Icaza  <miguel@novell.com>
11215
11216         * marshal.c (mono_string_to_byvalstr): Fix thinko, shorten len
11217         before the memcpy.   Fixes Marshal2 regression.
11218
11219 2007-01-02  Jb Evain  <jbevain@gmail.com>
11220
11221         * blob.h: add a MONO_TYPE_ENUM definition
11222         * reflection.c (load_cattr_value, create_custom_attr, create_custom_attr_data):
11223         fix the encoding of arrays of enums in custom attributes.
11224
11225         Fixes #79666.
11226
11227 2007-01-01  Miguel de Icaza  <miguel@novell.com>
11228
11229         * marshal.c (mono_string_to_byvalwstr): Fix this routine.   The
11230         string is null terminated, but only cut the string short if it
11231         overflows the buffer.   
11232         
11233         (mono_string_to_byvalstr): Also fix this routine.   The code here
11234         was not properly terminating a string (it was only terminated
11235         because of the previous catch-all memset). 
11236
11237         I left the memset, because I do not know if applications expect
11238         the runtime to clear this region. 
11239
11240         Fixes #79944.
11241
11242         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType):
11243         Clear the error before returning to unmanaged code to prevent the
11244         runtime from being confused later on (fixes  80420).
11245         (ves_icall_type_from_name): Always call mono_loader_clear_error
11246         after parsing a type that could have failed.
11247         (ves_icall_System_Reflection_Assembly_GetTypes): ditto.
11248
11249         * loader.c (mono_loader_clear_error): Fix indentation.
11250
11251 2006-12-28  Martin Baulig  <martin@ximian.com>
11252
11253         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 58.
11254
11255 Fri Dec 22 20:04:57 CET 2006 Paolo Molaro <lupus@ximian.com>
11256
11257         * reflection.c: patch from Rolf Bjarne Kvinge to fix
11258         getting a token for an EnumBuilder.
11259
11260 Fri Dec 22 19:49:07 CET 2006 Paolo Molaro <lupus@ximian.com>
11261
11262         * reflection.c: be more careful in case resource generation
11263         fails to create the data array.
11264
11265 Fri Dec 22 18:17:40 CET 2006 Paolo Molaro <lupus@ximian.com>
11266
11267         * sgen-gc.c: write barrier for clone and fix unregister handles.
11268
11269 Fri Dec 22 18:15:33 CET 2006 Paolo Molaro <lupus@ximian.com>
11270
11271         * reflection.c: some fixes needed in the generics code for the moving GC.
11272
11273 2006-12-22  Robert Jordan  <robertj@gmx.net>
11274
11275         * icall.c (ves_icall_System_Array_SetValueImpl): Take enums into
11276         account. Fixes bug #80299.
11277
11278 2006-12-21  Raja R Harinath  <rharinath@novell.com>
11279
11280         Fix WaitHandle usage in delegates.
11281         * object-internals.h (mono_wait_handle_get_HANDLE): Declare.
11282         * object.c (mono_wait_handle_new): Use the property set method to
11283         initialize the handle.
11284         (mono_wait_handle_get_handle): New.
11285         * threadpool.c (mono_async_invoke): Use it.
11286         * threads.c (ves_icall_System_Threading_WaitHandle_WaitAll_internal):
11287         Likewise.
11288         (ves_icall_System_Threading_WaitHandle_WaitAny_internal): Likewise.
11289
11290 2006-12-21  Jonathan Chambers  <joncham@gmail.com>
11291
11292         * marshal.c (emit_marshal): Call emit_marshal_variant and
11293         emit_marshal_com_interface when applicable.
11294         (emit_marshal_variant, emit_marshal_com_interface): Add
11295         methods for this case and remove if's from emit_marshal_object.
11296         
11297 Wed Dec 20 11:03:56 CET 2006 Paolo Molaro <lupus@ximian.com>
11298
11299         * filewatcher.c: updated to use the mono-dl API instead of gmodule.
11300
11301 2006-12-19  Jonathan Chambers  <joncham@gmail.com>
11302
11303         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_AllocHGlobal,
11304         ves_icall_System_Runtime_InteropServices_Marshal_FreeHGlobal): Use GlobalAlloc
11305         and GlobalFree on Windows. Remove FIXME.
11306
11307 Tue Dec 19 16:18:16 CET 2006 Paolo Molaro <lupus@ximian.com>
11308
11309         * mono-mlist.h, mono-mlist.c, Makefile.am: linked list
11310         implementation for managed objects.
11311
11312 Tue Dec 19 14:28:03 CET 2006 Paolo Molaro <lupus@ximian.com>
11313
11314         * object.c: implemented code to be used for checking
11315         that no reference field overlaps with non-references.
11316
11317 Tue Dec 19 14:10:37 CET 2006 Paolo Molaro <lupus@ximian.com>
11318
11319         * threadpool.c: fix queue code to be compatible with the
11320         moving GC.
11321
11322 2006-12-18  Miguel de Icaza  <miguel@novell.com>
11323
11324         * marshal.c (emit_object_to_ptr_conv): Handle null safehandles
11325         in structures by throwing ArgumentNullException.
11326
11327         (emit_marshal_safehandle): Also when they are null parameters.
11328
11329         (emit_marshal_safehandle): Add support for ref
11330         SafeHandles parameters
11331
11332 Mon Dec 18 19:14:44 CET 2006 Paolo Molaro <lupus@ximian.com>
11333
11334         * profiler.c: updated to use the mono-dl API instead of
11335         gmodule.
11336
11337 Mon Dec 18 19:02:37 CET 2006 Paolo Molaro <lupus@ximian.com>
11338
11339         * profiler.c: updated to use the mono-dl dynamic loading
11340         API instead of gmodule.
11341
11342 Mon Dec 18 18:16:22 CET 2006 Paolo Molaro <lupus@ximian.com>
11343
11344         * profiler.c: use readlink, older versions of glib don't have
11345         g_file_read_link ().
11346
11347 Mon Dec 18 16:40:34 CET 2006 Paolo Molaro <lupus@ximian.com>
11348
11349         * profiler.c: try to detect the path to mono if libc fails to provide
11350         a useful name (bug #80286).
11351
11352 2006-12-16  Raja R Harinath  <rharinath@novell.com>
11353
11354         Fix #80242
11355         * icall.c (ves_icall_Type_GetNestedType): If the type is a generic
11356         instance, use the generic type definition instead.
11357         (ves_icall_Type_GetNestedTypes): Likewise.
11358         * class.c (mono_class_create_generic): Always set the
11359         nested_classes of a generic instance to NULL, even if the generic
11360         type definition has nested types.
11361
11362 2006-12-15  Jonathan Chambers  <joncham@gmail.com>
11363
11364         * marshal.c (mono_string_from_bstr): Revert previous Windows change
11365         and fix on Linux.
11366         
11367 2006-12-15  Miguel de Icaza  <miguel@novell.com>
11368
11369         * marshal.c (mono_string_from_bstr): Jon Chambers pointed out that
11370         my arguments were in the wrong order.   I also fixed the Windows
11371         version which seems to have had the same issue.
11372
11373         (mono_free_bstr): On Unix, this is g_free.
11374         (mono_string_from_bstr, mono_string_to_bstr): Implement bstr
11375         conversions (for the tests in corlib to pass).
11376
11377 2006-12-14  Miguel de Icaza  <miguel@novell.com>
11378
11379         * marshal.c (emit_ptr_to_object_conv): For now, ignore
11380         MONO_MARSHAL_CONV_SAFEHANDLE on return values (we need to throw an
11381         exception if a ref SafeHandle in a struct has changed).
11382         
11383         (emit_struct_conv): Do not perform layout checks for classes
11384         derived from SafeHandle, as those are specially handled. 
11385
11386         (emit_object_to_ptr_conv): Add support for
11387         MONO_MARSHAL_CONV_SAFEHANDLE conversion. 
11388
11389         (emit_marshal_safehandle): Implement conversion of return values
11390         of safehandles (MARSHAL_ACTION_CONV_RESULT).
11391         
11392         * threads.c: WaitHandle now is compiled with two different handles
11393         "IntPtr os_handle" for 1.x and "SafeWaitHandle safe_wait_handle"
11394         for 2.0.
11395         
11396         (ves_icall_System_Threading_WaitHandle_WaitAll_internal) 
11397         (ves_icall_System_Threading_WaitHandle_WaitAny_internal): Adjust
11398         these routines to cope with both kinds of fields.
11399
11400 2006-12-12  Miguel de Icaza  <miguel@novell.com>
11401
11402         * metadata.c (mono_type_to_unmanaged): Handle the case where
11403         type->data.klass is a SafeHandle, and in that case, return the
11404         size of a pointer (MONO_NATIVE_INT) and set the conversion to be
11405         MONO_MARSHAL_CONV_SAFEHANDLE. 
11406
11407 2006-12-11  Miguel de Icaza  <miguel@novell.com>
11408
11409         * marshal.c (emit_marshal): Hook up to the MONO_TYPE_CLASS and
11410         MONO_TYPE_OBJECT cases and check for a SafeHandle here before
11411         calling emit_marshal_object.
11412
11413         (emit_marshal_safehandle): Implement marshalling of
11414         SafeHandle parameters (no ref support yet).
11415
11416         (MarshalAction): Document the defines as I implement
11417         them for SafeHandle.
11418
11419         (emit_marshal_object): indentation police.
11420
11421         * class-internals.h: Define MonoSafeHandle.
11422         Add safehandle_class to MonoDefaults type.
11423
11424         * verify.c: Add System.Runtime.InteropServices.SafeHandle to the
11425         list of classes to check for fields. 
11426
11427         * domain.c (mono_init_internal): Add SafeHandle to the list of
11428         mono_defaults loaded.
11429
11430 2006-12-15  Raja R Harinath  <rharinath@novell.com>
11431
11432         Fix #80253
11433         * reflection.c (mono_reflection_bind_generic_parameters): If the
11434         generic type definition is a type builder, ensure that it is fully
11435         initialized before instantiating it.  Kill some dead code.
11436
11437 Thu Dec 14 17:02:59 CET 2006 Paolo Molaro <lupus@ximian.com>
11438
11439         * object.c: clear the loader_error () before loading
11440         more metadata stuff (bug #80258).
11441
11442 Thu Dec 14 12:49:47 CET 2006 Paolo Molaro <lupus@ximian.com>
11443
11444         * icall.c, icall-defs.h: type modifiers icalls for
11445         parameters and properties.
11446
11447 Wed Dec 13 19:29:50 CET 2006 Paolo Molaro <lupus@ximian.com>
11448
11449         * object.c, icall.c: fixed warnings.
11450
11451 Mon Dec 11 11:03:10 CET 2006 Paolo Molaro <lupus@ximian.com>
11452
11453         * marshal.c: fixed a couple of leaks and coding style in a few places.
11454
11455 2006-12-08  Dick Porter  <dick@ximian.com>
11456
11457         * process.c: Cope with NULL ProcessStartInfo arguments on windows
11458         too.  Patch from Jonathan Chambers <joncham@gmail.com>, fixes bug
11459         80173.
11460
11461 Thu Dec 7 15:20:31 CET 2006 Paolo Molaro <lupus@ximian.com>
11462
11463         * process.c: ProcessStartInfo may have only filename set and
11464         arguments can be NULL.
11465
11466 Tue Dec 5 19:19:34 CET 2006 Paolo Molaro <lupus@ximian.com>
11467
11468         * icall.c: fix leak found by Robert Jordan.
11469
11470 Tue Dec 5 17:53:10 CET 2006 Paolo Molaro <lupus@ximian.com>
11471
11472         * marshal.c, marshal.h: generate managed method to access an element
11473         of a multi-dimensional array.
11474
11475 2006-11-30  Paolo Molaro (lupus@ximian.com)
11476
11477         * metadata.c, marshal.c: locking fixes when writing to image->mempool.
11478
11479 Thu Nov 30 11:11:37 CET 2006 Paolo Molaro <lupus@ximian.com>
11480
11481         * icall.c: back out GetFields () fix until the serialization code is
11482         fixed to not depend on the incorrect behaviour.
11483
11484 Wed Nov 29 22:01:46 CET 2006 Paolo Molaro <lupus@ximian.com>
11485
11486         * profiler.c: provide defaults if none are set.
11487
11488 Tue Nov 28 12:54:51 CET 2006 Paolo Molaro <lupus@ximian.com>
11489
11490         * Makefile.am, attrdefs.h: new public header file with
11491         constants for attributes for use by embedders.
11492
11493 Tue Nov 28 11:44:52 CET 2006 Paolo Molaro <lupus@ximian.com>
11494
11495         * icall.c: GetFields () fix for bug #80064.
11496
11497 Tue Nov 28 10:56:01 CET 2006 Paolo Molaro <lupus@ximian.com>
11498
11499         * filewatcher.c, filewatcher.h, icall-def.h, icall.c, locales.c:
11500         removed long unused icalls.
11501
11502 2006-11-27  Jonathan Chambers  <joncham@gmail.com>
11503   
11504         * marshal.c: 
11505                 (mono_marshal_emit_managed_wrapper): Level of indirection for 
11506                 mono_marshal_get_managed_wrapper so that a wrapper for a managed method
11507                 can be generated without a delegate class.
11508                 (mono_marshal_get_managed_wrapper): Move wrapper logic to mono_marshal_emit_managed_wrapper.
11509         
11510         Signed-off-by: Jonathan Chambers <joncham@gmail.com>
11511
11512 2006-11-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11513
11514         * console-io.c: add the 'signal' call removed by mistake. Fixes bug
11515         #80069.
11516
11517 Mon Nov 27 19:29:13 CET 2006 Paolo Molaro <lupus@ximian.com>
11518
11519         * boehm-gc.c, null-gc.c, sgen-gc.c, mono-gc.h, icall.c,
11520         icall-def.h: added icalls needed by System.GC.
11521
11522 Thu Nov 23 20:01:12 CET 2006 Paolo Molaro <lupus@ximian.com>
11523
11524         * loader.c: ensure the class in catch clauses is handled
11525         correctly for generics methods (fixes bug#79980).
11526
11527 Thu Nov 23 17:31:58 CET 2006 Paolo Molaro <lupus@ximian.com>
11528
11529         * monitor.h, monitor.c: added mono_locks_dump () function
11530         to help debug deadlocks involving managed locks.
11531
11532 2006-11-13  Dick Porter  <dick@ximian.com>
11533
11534         * file-io.c (get_file_attributes): If the file is a symlink try
11535         and get the stat data for the target, but also add the
11536         FILE_ATTRIBUTE_REPARSE_POINT flag.  This is an attempt to follow
11537         the specs for the windows symlink support, but will probably have
11538         to be reworked when I have test data from a vista machine.  Fixes
11539         bug 79887.
11540
11541 2006-11-13  Dick Porter  <dick@ximian.com>
11542
11543         * gc.c (mono_domain_finalize): 
11544         * marshal.c (mono_delegate_begin_invoke): 
11545         * threadpool.c (socket_io_init, mono_thread_pool_init)
11546         (mono_thread_pool_finish): 
11547         * monitor.c (mono_monitor_try_enter_internal): 
11548         * threads.c (mono_thread_resume, mono_thread_init)
11549         (mono_thread_suspend_all_other_threads)
11550         (mono_thread_execute_interruption): 
11551         * appdomain.c (mono_domain_unload): Check for NULL error returns
11552         from CreateThread(), CreateEvent() and CreateSemaphore().  See bug
11553         75733.
11554
11555 2006-11-11  Miguel de Icaza  <miguel@novell.com>
11556
11557         * process.c
11558         (ves_icall_System_Diagnostics_Process_CreateProcess_internal):
11559         Only close the handle if the value of the handle is not
11560         INVALID_HANDLE_VALUE.  This just makes the process a bit more
11561         robust.
11562
11563         Improvement for #75733, so that we do not run into this problem. 
11564
11565         
11566         * assembly.c (check_path_env, check_extra_gac_path_env): Do not
11567         include empty directories from MONO_PATH or MONO_GAC_PREFIX in our
11568         internal variables.  Fixes #79462 
11569         
11570
11571 2006-11-09  Dick Porter  <dick@ximian.com>
11572
11573         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal):
11574         Use poll() not select().  Fixes bug 79397.
11575
11576 2006-11-09  Raja R Harinath  <rharinath@novell.com>
11577
11578         Fix #79872
11579         * assembly.c (mono_assembly_load_from_full): Check that the given
11580         image has an assembly manifest.
11581
11582 2006-11-09  Ankit Jain  <jankit@novell.com>
11583
11584         * tabledefs.h (ASSEMBLYREF_RETARGETABLE_FLAG):
11585         (ASSEMBLYREF_ENABLEJITCOMPILE_TRACKING_FLAG):
11586         (ASSEMBLYREF_DISABLEJITCOMPILE_OPTIMIZER_FLAG): Add AssemblyRef flags.
11587
11588 2006-11-07  Dick Porter  <dick@ximian.com>
11589
11590         * socket-io.c (ves_icall_System_Net_Dns_GetHostByAddr_internal):
11591         Put the old resolver behaviour back for pre-2.0 profiles.
11592
11593 Tue Nov 7 16:56:24 CET 2006 Paolo Molaro <lupus@ximian.com>
11594
11595         * threadpool.c: precise GC and locking fixes.
11596
11597 Tue Nov 7 11:02:42 CET 2006 Paolo Molaro <lupus@ximian.com>
11598
11599         * class.c: don't load types that have an explicit unaligned
11600         managed reference. Provide better info in the TypeLoad exception.
11601         Part of the fix for bug #79744.
11602         * object.c: use the correct check for class type load issues.
11603
11604 Mon Nov 6 17:07:43 CET 2006 Paolo Molaro <lupus@ximian.com>
11605
11606         * class.c: enforce alignment of fields with managed references
11607         even when Pack=1 is forced by the user (bug #77788).
11608
11609 2006-11-03  Dick Porter  <dick@ximian.com>
11610
11611         * socket-io.c (ves_icall_System_Net_Dns_GetHostByAddr_internal):
11612         If the address reverse lookup fails, return it as the hostname
11613         anyway.  Fixes bug 79721.
11614
11615 2006-11-03  Dick Porter  <dick@ximian.com>
11616
11617         * threads.c (ves_icall_System_Threading_Thread_SpinWait_internal):
11618         Fix build on Windows.
11619
11620 2006-11-02  Dick Porter  <dick@ximian.com>
11621
11622         * icall-def.h: 
11623         * object-internals.h: 
11624         * exception.c (mono_get_exception_thread_interrupted): 
11625         * threads.c: Implement Thread.Interrupt and Thread.SpinWait.
11626         Fixes bug 74525.
11627
11628         * monitor.c (ves_icall_System_Threading_Monitor_Monitor_wait):
11629         Check for pending Thread.Interrupt.
11630
11631 2006-10-27  Massimiliano Mantione  <massi@ximian.com>
11632         * loader.c: Fixed bug 79684.
11633
11634 2006-10-27  Dick Porter  <dick@ximian.com>
11635
11636         * file-io.c (get_file_attributes): Force symlinks to directories
11637         to be returned as a regular file.  Fixes bug 79733.
11638 2006-10-26  Dick Porter  <dick@ximian.com>
11639
11640         * file-io.c (ves_icall_System_IO_MonoIO_Open): If we're calling
11641         CreateFile to open a directory then we need to set the
11642         FILE_FLAG_BACKUP_SEMANTICS flag.  Fixes bug 75285.
11643
11644 2006-10-23  Zoltan Varga  <vargaz@gmail.com>
11645
11646         * reflection.c (mono_method_get_object): Cache the MonoMethod class and its
11647         friends.
11648
11649 Mon Oct 23 03:06:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
11650
11651         * sgengc.c: small cleanup of timer code.
11652
11653 Mon Oct 23 02:49:08 CEST 2006 Paolo Molaro <lupus@ximian.com>
11654
11655         * sgen-gc.c: fix some warnings and start adding support for
11656         complete object removal on domain unload.
11657
11658 2006-10-22  Gert Driesen  <drieseng@users.sourceforge.net>
11659
11660         * assembly.c: build_assembly_name should not consider a version
11661         number without build or revision number invalid. Fixes bug #79715.
11662
11663 2006-10-18  Jonathan Chambers  <joncham@gmail.com>
11664
11665         * icall.c: Have ves_icall_System_Diagnostics_DefaultTraceListener_WriteWindowsDebugString
11666         call kernel32 function OutputDebugString directly.
11667         
11668         Signed-off-by: Jonathan Chambers <joncham@gmail.com>
11669         
11670 Tue Oct 17 16:59:59 CEST 2006 Paolo Molaro <lupus@ximian.com>
11671
11672         * reflection.c: small cleanup, using a function to insert a MonoString
11673         in the string heap.
11674
11675 Tue Oct 17 16:45:27 CEST 2006 Paolo Molaro <lupus@ximian.com>
11676
11677         * reflection.c: moving GC fixes.
11678
11679 Mon Oct 16 16:53:12 CEST 2006 Paolo Molaro <lupus@ximian.com>
11680
11681         * sgen-gc.c, gc-internal.h, gc.c: added API to collect and remove
11682         all the objects with finalizers belonging to an unloading appdomain.
11683
11684 Mon Oct 16 15:08:41 CEST 2006 Paolo Molaro <lupus@ximian.com>
11685
11686         * sgen-gc.c: added ability to allocate even when the nursery is fully
11687         pinned and fixed a couple of bugs.
11688
11689 2006-10-15  Zoltan Varga  <vargaz@gmail.com>
11690
11691         * threads.h: Revert the last change for now.
11692
11693         * threads.h (mono_thread_get_pending_exception): Rename this to
11694         mono_thread_get_undeniable_exception ().
11695
11696 2006-10-15  Gert Driesen  <drieseng@users.sourceforge.net>
11697
11698         * appdomain.c: Use mono_get_exception_bad_image_format2 to construct
11699         BadImageFormatException in ves_icall_System_Reflection_Assembly_LoadFrom
11700         when fname does not refer to valid assembly. This result in a more
11701         meaningful error message.
11702         * exception.c: added mono_get_exception_bad_image_format2 which 
11703         constructs a BadImageFormatException using the ctor taking a custom
11704         message and the file name. Passing in a NULL msg results in a default
11705         message.
11706         * exception.h: define mono_get_exception_bad_image_format2 function.
11707         * icall.c: in InternalGetAssemblyName, throw BadImageFormatException 
11708         when file name pointed to an invalid IL image. Use 
11709         mono_get_exception_file_not_found2 to construct FileNotFoundException,
11710         as this results in a more meaningful error message.
11711
11712 2006-10-15  Zoltan Varga  <vargaz@gmail.com>
11713
11714         * reflection.c (encode_named_val): Implement proper encoding of arrays. Fixes
11715         #79465.
11716
11717 2006-10-12  Zoltan Varga  <vargaz@gmail.com>
11718
11719         * metadata.c (mono_type_size): Change the align parameter to guint32 for
11720         consistency with the other _size functions.
11721         (mono_type_stack_size): Ditto.
11722
11723         * class.c object.c icall.c: Fix warnings caused by the above change.
11724
11725         * class.c (mono_class_get_method_from_name_flags): Fix a typo.
11726
11727         * image.c (load_metadata_ptrs): Reenable loading of modules with uncompressed metadata.
11728
11729         * metadata.c class.c loader.c: Add proper support for uncompressed metadata.
11730
11731 Wed Oct 11 17:27:05 CEST 2006 Paolo Molaro <lupus@ximian.com>
11732
11733         * console-io.h, filewatcher.h, locales.h, marshal.h, monitor.h,
11734         process.h, rand.h, rawbuffer.h, security-manager.h, security.h,
11735         socket-io.h, string-icalls.h, sysmath.h, threadpool-internals.h,
11736         threadpool.h, threads-types.h: mark more internal functions.
11737
11738 2006-10-11  Dick Porter  <dick@ximian.com>
11739
11740         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal):
11741         Fix typo spotted by Robert Jordan in bug 79352 (though I can't
11742         reproduce the bug even before applying the fix.)
11743
11744 Tue Oct 10 15:39:39 CEST 2006 Paolo Molaro <lupus@ximian.com>
11745
11746         * reflection.c: allow retrieving attributes for arguments in generic
11747         methods (bug #79241).
11748
11749 Tue Oct 10 11:45:50 CEST 2006 Paolo Molaro <lupus@ximian.com>
11750
11751         * debug-mono-symfile.c: properly check fopen () result (found by
11752         coverity).
11753
11754 Tue Oct 10 11:30:52 CEST 2006 Paolo Molaro <lupus@ximian.com>
11755
11756         * reflection.c: make error message clearer and fixed two
11757         issuelets found by Coverity.
11758
11759 2006-10-10  Zoltan Varga  <vargaz@gmail.com>
11760
11761         * object-internals.h: Remove duplicate definition of mono_method_get_signature_full ().
11762
11763 Mon Oct 9 19:41:44 CEST 2006 Paolo Molaro <lupus@ximian.com>
11764
11765         * object-internals.h, gc-internal.h, profiler-private.h:
11766         mark internal functions.
11767
11768 Mon Oct 9 19:28:56 CEST 2006 Paolo Molaro <lupus@ximian.com>
11769
11770         * reflection.c: put data in the text section.
11771         * icall.c: recognize more types in type_from_typename ().
11772         * process.c, marshal.c: added some GC FIXMEs.
11773
11774 Mon Oct 9 19:27:26 CEST 2006 Paolo Molaro <lupus@ximian.com>
11775
11776         * loader.c: check for NULL before initializing.
11777
11778 2006-10-09  Zoltan Varga  <vargaz@gmail.com>
11779
11780         * gc.c (finalizer_thread): Use a non-alertable wait here.
11781
11782         * class.c loader.c metadata.c: Revert the mono_metadata_decode_table_... changes,
11783         until the correct solution is found.
11784
11785 2006-10-06  Zoltan Varga  <vargaz@gmail.com>
11786
11787         * reflection.c (mono_module_get_object): Avoid an assert when operating on
11788         modules with no metadata. Fixes #79596.
11789
11790         * image.c (load_metadata_ptrs): Put back the error message when
11791         the #- heap is encountered since the support is not complete yet.
11792
11793 Fri Oct 6 16:57:26 CEST 2006 Paolo Molaro <lupus@ximian.com>
11794
11795         * gc.c: do not allow the user to SuppressFinalize () a
11796         delegate because it would leak the trampoline if present.
11797
11798 2006-10-06  Zoltan Varga  <vargaz@gmail.com>
11799
11800         * class.c metadata.c row-indexes.h blob.h: Applied patch from Jb. Add support for the
11801         PropertyPtr table.
11802
11803 2006-10-05  Zoltan Varga  <vargaz@gmail.com>
11804
11805         * loader.c (mono_method_signature): Fix a use of MONO_TABLE_METHOD missed earlier.
11806
11807         * metadata.c (mono_metadata_get_param_attrs): Ditto.
11808
11809         * row-indexes.h: Add definitions for *Ptr tables.
11810
11811         * metadata-internals.h (MonoImage): Add an 'uncompressed_metadata' flag.
11812
11813         * metadata.c (mono_metadata_translate_token_index): New helper function to
11814         translate table indexes used in uncompressed metadata.
11815         (mono_metadata_decode_table_row): Ditto.
11816         (mono_metadata_decode_table_row_col): Ditto.
11817
11818         * metadata.c: Add table schema for *Ptr tables.
11819
11820         * class.c loader.c: Use the new helper function to access the affected metadata
11821         tables.
11822         
11823         * image.c (load_metadata_ptrs): Allow assemblies with uncompressed metadata. Fixes
11824         #38532.
11825         
11826 2006-10-04  Zoltan Varga  <vargaz@gmail.com>
11827
11828         * marshal.c (emit_object_to_ptr_conv): Avoid using short branches around IL
11829         sequences which can be unbounded in size. Fixes #79583.
11830
11831 2006-10-02  Zoltan Varga  <vargaz@gmail.com>
11832
11833         * object.c (mono_runtime_class_init): Handle a corner case in handling failure of
11834         static initialization.
11835
11836         * domain-internals.h (MonoDomain): Add a 'type_init_exception_hash' field.
11837
11838         * class-internals.h (MonoVTable): Add an 'init_failed' flag.
11839
11840         * domain.c (mono_domain_free): Free up type_init_exception_hash.
11841
11842         * object.c (mono_runtime_class_init): Implement correct semantics when a static
11843         ctor fails, i.e. throw the same exception on subsequent accesses.
11844         
11845 2006-09-0  Jonathan Chambers  <joncham@gmail.com>
11846
11847         * domain.c, class-internals.h: Added ComInteropProxy class to MonoDefaults.
11848         * marshal.c: Return correct unmanaged size for object when MarshalAs.Struct.
11849         Emit exception rather than crash in case of COM Callable Wrapper (not yet implemented).
11850         Handle marshalling of interfaces and VARIANTs contained in structs.
11851         
11852         Code is contributed under MIT/X11 license.
11853         
11854 2006-09-30  Zoltan Varga  <vargaz@gmail.com>
11855
11856         * marshal.c (emit_marshal_custom): Fix some corner cases. Fixes #79471.
11857         
11858         * marshal.c (mono_marshal_load_type_info): Allocate memory from the image
11859         mempool.
11860
11861 2006-09-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11862
11863         * console-io.c: ignore previous SIGINT handler.
11864
11865 2006-09-27  Zoltan Varga  <vargaz@gmail.com>
11866
11867         * metadata.c class.c: Applied patch from Ricardo Fernandez Pascual 
11868         (ricardo.fernandez@st.com). Add some new MonoClass and MonoType accessors. Fixes
11869         #79460, #79461, #79485.
11870
11871         * class.c (mono_class_from_name_case): Fix incorrect comments. Fixes #79504.
11872
11873         * marshal.c (mono_marshal_load_type_info): Fix a typo which caused an assert. Fixes
11874         #79217.
11875
11876 2006-09-26  Zoltan Varga  <vargaz@gmail.com>
11877
11878         * marshal.c (mono_marshal_get_delegate_invoke): Tweak the IL a little so better code
11879         could be generated from it.
11880
11881 Mon Sep 25 13:29:53 CEST 2006 Paolo Molaro <lupus@ximian.com>
11882
11883         * rand.c: fix read loop to correctly handle EINTR.
11884
11885 Mon Sep 25 11:33:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
11886
11887         * Makefile.am, icall-def.h, icall.c, verify.c: changed the way
11888         internal calls are defined to keep methods closer to the declaring
11889         type and allow a significant reduction in runtime relocations and
11890         memory usage.
11891
11892 2006-09-21 Gert Driesen  <drieseng@users.sourceforge.net>
11893
11894         * appdomain.c: Pass NULL to mono_get_exception_file_not_found2 as
11895         exception message to have FileNotFoundException use the default
11896         assembly load error message. Fixes bug #79426.
11897         * exception.c: Support NULL msg in mono_get_exception_file_not_found2.
11898
11899 2006-09-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11900
11901         * threadpool.c: (start_thread_or_queue) use the root domain when
11902         creating the thread instead of the async object one.
11903
11904 Thu Sep 21 19:30:04 CEST 2006 Paolo Molaro <lupus@ximian.com>
11905
11906         * class.c, object.c, class-internals.h, reflection.c:
11907         for arrays, store element_size inside MonoClass (speedup
11908         for array object creation).
11909
11910 Thu Sep 21 17:06:43 CEST 2006 Paolo Molaro <lupus@ximian.com>
11911
11912         * icall.c: fixed CodeBase to use the file name and not the module
11913         name (bug #79365).
11914
11915 Thu Sep 21 12:09:34 CEST 2006 Paolo Molaro <lupus@ximian.com>
11916
11917         * mono-debug.c, mono-debug.h: export find_method as
11918         mono_debug_find_method ().
11919
11920 Wed Sep 20 19:59:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
11921
11922         * debug-helpers.c, class-internals.h: added a few functions useful
11923         when debugging under gdb.
11924
11925 2006-09-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11926
11927         * console-io.[ch]: trigger the ConsoleCancelEvent and retrieve
11928         characters that need special handling.
11929
11930 Tue Sep 19 18:57:38 CEST 2006 Paolo Molaro <lupus@ximian.com>
11931
11932         * mono-config.c: make the os/cpu specification more flexible,
11933         allowing lists and negation.
11934
11935 2006-09-18  Jonathan Chambers  <joncham@gmail.com>
11936
11937         * marshal.c: COM Interop fixes. Handle case where method->klass.
11938         is interface. Handle BSTR/MonoString when null. Use CDECL as 
11939         calling convention on non-windows platforms. This is for
11940         compatibility with XPCOM and MainWin COM.
11941         
11942         Code is contributed under MIT/X11 license.
11943         
11944
11945 2006-09-18  Zoltan Varga  <vargaz@gmail.com>
11946
11947         * marshal.c (mono_marshal_load_type_info): Handle concurrent and recursive calls
11948         correctly. Fixes #79217.
11949
11950         * class-internals.h (MonoClass): Remove unused marshal_info_init_pending field.
11951
11952 Mon Sep 18 16:59:54 CEST 2006 Paolo Molaro <lupus@ximian.com>
11953
11954         * mono-config.c: allow both an os and cpu attribute for dllmap
11955         and dllentry elemnets to enable a single config file to be used
11956         for multiple architectures.
11957
11958 2006-09-18  Gert Driesen  <drieseng@users.sourceforge.net>
11959
11960         * loader.c: MonoLoaderError was cleared too soon on load failure.
11961         Fixes bug #79424.
11962
11963 Mon Sep 18 15:37:13 CEST 2006 Paolo Molaro <lupus@ximian.com>
11964
11965         * icall.c: use the defining class vtable when accessing a
11966         static field, not a pobblibly derived class.
11967
11968 2006-09-17  Zoltan Varga  <vargaz@gmail.com>
11969
11970         * icall.c string-icalls.c: Remove references to unicode.h.
11971
11972         * unicode.h unicode.c Makefile.am: Remove these unused source files.
11973
11974         * NOTES: Moved to ../../docs and renamed to thread-safety.txt.
11975
11976         * marshal.c (mono_marshal_emit_native_wrapper): Add an 'image' argument, 
11977         indicating the image where custom marshaller types should be looked up.
11978         (mono_ftnptr_to_delegate): Use the image of the delegate type to look up
11979         custom marshallers, instead of corlib. Fixes #79425.
11980
11981 2006-09-14  Zoltan Varga  <vargaz@gmail.com>
11982
11983         * marshal.c (emit_marshal_object): Fix marshalling of blittable classes and null.
11984
11985 2006-09-14  Jonathan Chambers  <joncham@gmail.com>
11986
11987         * environment.c (ves_icall_System_Environment_get_ProcessorCount): 
11988         Implement Environment.ProcessorCount.
11989         
11990         * environment.h (ves_icall_System_Environment_get_ProcessorCount): 
11991         Implement Environment.ProcessorCount.
11992         
11993         * icall.c: 
11994         Add Environment.ProcessorCount icall.
11995         
11996         Patch by Jason McFall.
11997
11998 2006-09-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11999
12000         * assembly.c: don't append .exe/.dll when the filename already contains
12001         one of those extensions.
12002
12003 2006-09-12  Martin Baulig  <martin@ximian.com>
12004
12005         * class.c (mono_bounded_array_class_get): Also add `IList<object>'
12006         to array interfaces.
12007
12008 2006-09-11  Martin Baulig  <martin@ximian.com>
12009
12010         * reflection.c (mono_image_build_metadata): Create the
12011         MethodImpl's after emitting all types and methods, so we don't
12012         need another fixup pass for them.
12013
12014 2006-09-11  Zoltan Varga  <vargaz@gmail.com>
12015
12016         * class.c (mono_class_from_name_case): Fix regression introduced by the last
12017         change.
12018
12019 Mon Sep 11 12:57:15 CEST 2006 Paolo Molaro <lupus@ximian.com>
12020
12021         * gc-internal.h, appdomain.c, gc.c: force-destroy GC handles on domain
12022         unload.
12023
12024 2006-09-10  Zoltan Varga  <vargaz@gmail.com>
12025
12026         * object.c (mono_method_return_message_restore): Avoid a crash if one of the out
12027         args is not set. Fixes #78926.
12028
12029 2006-09-08  Zoltan Varga  <vargaz@gmail.com>
12030
12031         * class.c (mono_class_init): Init class->no_special_static_fields from the cached info.
12032
12033         * image.c (load_class_names): Move this to class.c, and rename it to 
12034         'mono_image_init_name_cache'.
12035         (load_modules): Fix a warning.
12036
12037         * class.c icall.c image.c: Initialize image->name_cache lazily.
12038
12039         * class-internals.h (MonoGetClassFromName): New hook function to find a class based
12040         on its name using information in the AOT file.
12041
12042         * class.c (mono_class_from_name): Use the new hook function.
12043
12044 2006-09-06  Zoltan Varga  <vargaz@gmail.com>
12045
12046         * reflection.c (mono_param_get_objects): Handle enum default parameter values
12047         correctly.
12048
12049         * marshal.c (emit_marshal_object): Implement [In, Out] byval marshalling of classes.
12050         Fixes #79289.
12051         
12052 2006-09-06  Martin Baulig  <martin@ximian.com>
12053
12054         * icall.c (mono_lookup_internal_call): Small fix.
12055
12056 2006-09-05  Raja R Harinath  <rharinath@novell.com>
12057
12058         * debug-mono-symfile.c (mono_debug_open_mono_symbols): Remove
12059         double g_free.
12060
12061 2006-09-04  Sebastien Pouliot  <sebastien@ximian.com>
12062
12063         * debug-mono-symfile.c: Fix *some* memory leaks that happens only 
12064         when --debug is specified.
12065
12066 2006-09-04  Zoltan Varga  <vargaz@gmail.com>
12067
12068         * class.c (setup_generic_array_ifaces): Fix a warning.
12069
12070 2006-09-04  Miguel de Icaza  <miguel@novell.com>
12071
12072         * Temporarily remove the patch to assemly.c that checks the
12073         assembly versions as it breaks our gacutil.
12074
12075 2006-09-03  Zoltan Varga  <vargaz@gmail.com>
12076
12077         * metadata.c (mono_metadata_parse_mh_full): Fix an invalid free.
12078
12079         * assembly.c (mono_assembly_load_from_full): Avoid loading net 2.0 assemblies into
12080         a net 1.0 runtime.
12081
12082         * marshal.c (mono_string_builder_to_utf8): Fix marshalling of StringBuilders
12083         created using the default ctor. Fixes #79152.
12084         (mono_string_builder_to_utf16): Ditto.
12085
12086 2006-09-01  Martin Baulig  <martin@ximian.com>
12087
12088         Fix handling of the generic array interfaces.
12089
12090         * class-internals.h
12091         (MonoDefaults): Removed `generic_array_class' and added
12092         `generic_ilist' class.
12093
12094         * class.c
12095         (mono_bounded_array_class_get): Add the new generic array interfaces.
12096         (setup_generic_array_ifaces): New static method; create vtable
12097         entries for each method in the generic array interfaces.
12098
12099         * metadata.c
12100         (select_container): Allow "parent-less" generic methods.
12101
12102         * marshal.c
12103         (mono_marshal_get_generic_array_helper): New public method.
12104
12105         * icall.c
12106         (ves_icall_System_Array_InternalArray_GetGenericValueImpl):
12107         Renamed into ves_icall_System_Array_GetGenericValueImpl() and
12108         moved the interncall into System.Array.
12109
12110 2006-09-01  Raja R Harinath  <rharinath@novell.com>
12111
12112         A few more cases of avoiding work on types with ->byref set.
12113         Has the real fix for #79238
12114         * icall.c (is_generic_parameter): New helper.
12115         (ves_icall_Type_GetGenericParameterPosition): Use it.
12116         (ves_icall_Type_GetGenericParameterAttributes): Likewise.
12117         (ves_icall_MonoType_get_IsGenericParameter): Likewise.
12118         (ves_icall_TypeBuilder_get_IsGenericParameter): Likewise.
12119         (ves_icall_Type_GetGenericTypeDefinition_impl): Return NULL on
12120         reference types.
12121         (ves_icall_Type_get_IsGenericTypeDefinition): Return FALSE on
12122         reference types.
12123         (ves_icall_Type_get_IsGenericInstance): Likewise.
12124         (ves_icall_Type_get_IsGenericType): Likewise.
12125
12126 2006-09-01  Zoltan Varga  <vargaz@gmail.com>
12127
12128         * class.c (mono_class_setup_vtable_general): Share identical vtables with the parent
12129         class if possible.
12130
12131         * mempool.h (mono_mempool_get_allocated): New helper function.
12132
12133         * object.c (mono_class_create_runtime_vtable): Fix problem introduced by last
12134         change.
12135
12136         * mempool.c: Fix warnings and the calculation of stats.
12137
12138         * object.c (mono_class_create_runtime_vtable): Fix the AOT optimization.
12139
12140         * class.c (mono_class_setup_vtable): Update generic_vtable_count stat.
12141
12142         * loader.c (mono_get_method_from_token): Update method_count stat.
12143
12144         * class-internals.h (MonoStats): Add some stats.
12145
12146 2006-08-31 Robert Jordan  <robertj@gmx.net>
12147
12148         * icall.c: Replace the PtrToStringAuto, StringToHGlobalAuto icalls
12149         with managed variants.
12150         All code is contributed under the MIT/X11 license.
12151         
12152 2006-08-31  Zoltan Varga  <vargaz@gmail.com>
12153
12154         * reflection.c (reflection_methodbuilder_to_mono_method): Set 
12155         method->skip_visibility based up the skipVisibility parameter of DynamicMethods.
12156
12157         * class-internals.h (MonoMethod): Add a 'skip_visibility' field.
12158
12159         * marshal.c (mono_marshal_load_type_info): Revert the last change as it can't cope
12160         with cycles in classes.
12161
12162         * icall.c (ves_icall_MonoType_get_Name): Add a '&' for byref types. Fixes #79110.
12163
12164         * marshal.c (emit_marshal_array): Avoid crash when a parameter with type array is 
12165         missing a [MarshalAs] directive. Fixes #79203.
12166
12167         * marshal.c (mono_marshal_load_type_info): Fix a race in initializing 
12168         klass->marshal_info. Fixes #79217.
12169
12170 2006-08-30  Martin Baulig  <martin@ximian.com>
12171
12172         Committing a patch from Joachim Ante <joe@otee.dk>:
12173         Add support for binary data symbol stores.
12174
12175         * debug-mono-symfile.c
12176         (mono_debug_open_mono_symbol_file): Renamed into
12177         mono_debug_open_mono_symbols() and added `raw_contents' and `size'
12178         arguments.
12179
12180         * mono-debug.c
12181         (mono_debug_open_image): Added `raw_contents' and `size' args.
12182         (mono_debug_init_2_memory): New public function.
12183
12184 Fri Aug 25 18:25:23 CEST 2006 Paolo Molaro <lupus@ximian.com>
12185
12186         * icall.c: handle TypedReference in GetTypeCode (bug #79150).
12187
12188 2006-08-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12189
12190         * appdomain.c: implement support for ShadowCopyFiles.
12191
12192 2006-08-22  Sebastien Pouliot  <sebastien@ximian.com>
12193
12194         * string-icalls.c: Add shortcut in ves_icall_System_String_ctor_charp
12195         when value is NULL (and should remove CID #51).
12196
12197 2006-08-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12198
12199         * image.c: moved 2 functions to ../utils.
12200
12201 Tue Aug 22 15:53:29 CEST 2006 Paolo Molaro <lupus@ximian.com>
12202
12203         * gc.c: cope with the target object of a GC handle being NULL
12204         (bug #78877).
12205
12206 Tue Aug 22 11:10:33 CEST 2006 Paolo Molaro <lupus@ximian.com>
12207
12208         * class.c: recursively check parent's explicit implementations
12209         of interface methods (fixes bug #79125).
12210
12211 2006-08-19  Miguel de Icaza  <miguel@novell.com>
12212
12213         * filewatcher.c: Avoid warnings when building, do not redefine
12214         constants that are defined.
12215
12216         Remove warnings.
12217
12218 2006-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12219
12220         * image.c: don't fail when the link points to an absolute path.
12221
12222 2006-08-18  Sebastien Pouliot  <sebastien@ximian.com>
12223
12224         * decimal.c: Remove dead code (unrequired check) in mono_decimalIncr.
12225         Fix CID #3.
12226
12227 2006-08-17  Miguel de Icaza  <miguel@novell.com>
12228
12229         * image.c (full_path): A new method used to obtain the actual path
12230         of an assembly even in the presence of symbolic links.  
12231
12232         This is necessary for the case where we are running a binary that
12233         has been GACed, but we are using the "published" path name
12234         ($prefix/mono/1.0/blah.exe) which happens to point to the real
12235         file in the GAC.
12236
12237         This was the source of the failure for the `xsp' command with the
12238         recent AppDomain changes, as far as the runtime was concerned,
12239         there were two different assemblies: $prefix/mono/1.0/blah.exe and
12240         $prefix/mono/gac/blah/version/blah.exe.
12241
12242         (do_mono_image_open): use full path
12243
12244 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
12245
12246         * object.c (mono_class_create_runtime_vtable): Add a FIXME.
12247
12248 2006-08-17  Sebastien Pouliot  <sebastien@ximian.com>
12249
12250         * marshal.c: Fix mono_marshal_check_domain_image if an invalid 
12251         domain_id is supplied. Fix CID #241 and corlib's unit tests.
12252
12253 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
12254
12255         * class.c (mono_class_layout_fields): Set min_align to a bigger value for
12256         small structures. Fixes #78990.
12257
12258 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
12259
12260         * marshal.c (mono_marshal_get_xappdomain_invoke): Use the new helper functions here.
12261
12262         * appdomain.c (ves_icall_System_AppDomain_createDomain): Fix a warning.
12263
12264 2006-08-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12265
12266         * appdomain.c:
12267         * marshal.c: don't load all the assemblies from a domain into newly
12268         created ones. The new domains might have different rules and load
12269         assemblies from different locations. Fixes bug #76757.
12270
12271         Patch by Lluis. Conflicts resolved by Brian Crowell.
12272
12273 2006-08-16  Alp Toker  <alp@atoker.com>
12274
12275         * socket-io.c: First half of the fix for #79084.
12276         Set sa_size to the length of the content, not that of the struct.
12277         Don't add NULL suffix to the content, this should be done in
12278         managed code if needed.
12279
12280 2006-08-14  Raja R Harinath  <rharinath@novell.com>
12281
12282         Fix part of #79012
12283         * metadata.c (do_mono_metadata_parse_generic_class): Don't SEGV if
12284         mono_metadata_parse_type returns NULL.
12285
12286 2006-08-13  Atsushi Enomoto  <atsushi@ximian.com>
12287
12288         * normalization-tables.h : new file for string normalization data.
12289         * locales.c, locales.h, icall.c :
12290           added load_normalization_resource() for string normalization,
12291           and icall as well.
12292         * Makefile.am : added normalization-tables.h to the sources.
12293
12294 2006-08-13  Zoltan Varga  <vargaz@gmail.com>
12295
12296         * marshal.c: Add more helper functions to reduce code duplication and use them
12297         everywhere.
12298
12299 2006-08-12  Zoltan Varga  <vargaz@gmail.com>
12300
12301         * marshal.c: Fix non-x86 stdcall warnings.
12302         
12303         * marshal.c marshal.h: Add some helper functions to emit/patch branches, and use 
12304         them everywhere.
12305
12306 2006-08-11  Jonathan Chambers  <joncham@gmail.com>
12307
12308         * class.c (mono_bounded_array_class_get): Fix if statement that caused incorrect
12309         type check on multi-dimensional arrays. Fixes #79000.
12310
12311 2006-08-10  Jonathan Chambers  <joncham@gmail.com>
12312
12313         * class.c (mono_class_setup_parent): setup is_com_object during class initialization.
12314         * object.c (mono_remote_class_vtable/mono_object_new_specific): Changed checks
12315         to use is_com_object instead of MONO_CLASS_IS_IMPORT() macro.
12316         * class-internals.h: add is_com_object to class structure.
12317         * marshal.c: Fixed marshalling for IDispatch and IUnknown, added
12318         null checks to COM object marshalling. Fix .ctor call on RCW.
12319         * icall.c: Added icall implementation for MonoType.IsCOMObjectImpl.
12320         
12321         All code is contributed under the MIT/X11 license.
12322
12323 2006-08-09  Dick Porter  <dick@ximian.com>
12324
12325         * monitor.c (mono_monitor_cleanup): mono_monitor_cleanup() is
12326         racing mono_monitor_allocator_lock() somewhere, so don't delete
12327         the critical section for now.  Found by running and exiting
12328         monodevelop.
12329
12330 2006-08-10  Zoltan Varga  <vargaz@gmail.com>
12331
12332         * marshal.c (cominterop_get_native_wrapper): Fix a warning.
12333         (ves_icall_System_ComObject_FindInterface): Ditto.
12334         (ves_icall_System_ComObject_CacheInterface): Ditto.
12335
12336         * metadata.c (do_mono_metadata_type_equal): Applied patch from Roberto Costa
12337         (roberto.costa@st.com). Add support for MONO_TYPE_FNPTR.
12338
12339 2006-08-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12340
12341         * threadpool.c: treat pipes from process asynchronous reads as sockets
12342         when reading from them, so we get select/poll or epoll to wait for
12343         data.
12344
12345 2006-08-07  Sebastien Pouliot  <sebatien@ximian.com>
12346
12347         * loader.c: Fix a typo (CID #233) in the null check.
12348
12349 2006-08-07  Zoltan Varga  <vargaz@gmail.com>
12350
12351         * appdomain.c (mono_domain_unload): Close the thread handle of the unload thread.
12352         Hopefully fixes #78949.
12353         
12354         * metadata.c (mono_metadata_parse_method_signature_full): Applied patch from 
12355         Roberto Costa (roberto.costa@st.com). Handle vararg signatures without SENTINEL
12356         bytes. Fixes #78972.
12357
12358 2006-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12359
12360         * filewatcher.c: we need to set errno here.
12361
12362 2006-08-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12363
12364         * filewatcher.c: let Win32Exception get the error value.
12365
12366 2006-08-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12367
12368         * filewatcher.c: translate errno into win32 errors for Win32Exception
12369         to know what happened.
12370
12371 2006-08-01  Zoltan Varga  <vargaz@gmail.com>
12372
12373         * threadpool.c: Fix more warnings.
12374
12375         * assembly.c (search_loaded): Fix warnings.
12376
12377         * threadpool.c (mono_thread_pool_finish): Fix warnings.
12378         (mono_async_invoke): Ditto.
12379
12380 2006-07-28  Jonathan Chambers  <joncham@gmail.com>
12381
12382         * object.c (mono_remote_class_vtable): Need to create proxy vtable
12383         entries for __ComObject type in addition to ComImport types.
12384         * marshal.c: Added support for marshalling COM RCWs. Fixed warning
12385         about hash table.
12386         
12387         All code is contributed under the MIT/X11 license.
12388
12389 Fri Jul 28 19:04:34 CEST 2006 Paolo Molaro <lupus@ximian.com>
12390
12391         * image.c: avoid tentative loading of modulerefs that contain
12392         no metadata (P/Invoke library names).
12393
12394 2006-07-28  Dick Porter  <dick@ximian.com>
12395
12396         * loader.c (mono_loader_cleanup): mono_loader_cleanup() is racing
12397         mono_loader_lock() somewhere, so don't delete the critical section
12398         for now.  Found by running and exiting monodevelop.
12399
12400 2006-07-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12401
12402         * filewatcher.c: define the inotify syscalls when we're building on
12403         linux and have sys/syscall.h. The build system might not have support
12404         for inotify but the target system might have it.
12405
12406 2006-07-26  Miguel de Icaza  <miguel@novell.com>
12407
12408         * domain.c: Documentation updates.
12409
12410         * loader.c (mono_free_method): Do not release the method
12411         information if we are being profiled, as profilers will use this
12412         information at shut down to present some data to the user.
12413
12414         This is needed so that the profiler does not crash, as the
12415         profiler tends to keep MonoMethods around, and they might become
12416         invalid if we free these.
12417
12418         (mono_get_method_constrained): Return the original CIL stream
12419         method as well, so verification can be performed against it.
12420
12421 2006-07-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12422
12423         * filewatcher.[ch]: support for inotify file system watcher.
12424         * icall.c: add new internal calls for the inotify file system watcher.
12425
12426 2006-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12427
12428         * threadpool.c: Windows also misbehaves on async. connects. Fixes bug
12429         #78888.
12430
12431 2006-07-20  Dick Porter  <dick@ximian.com>
12432
12433         * file-io.c (ves_icall_System_IO_MonoIO_Seek): Fix signed/unsigned
12434         warning.
12435
12436 2006-07-20  Dick Porter  <dick@ximian.com>
12437
12438         * threads.c (start_wrapper): Do the thread cleanup while we still
12439         hold a reference to its object.  Fixes bug 78123.
12440
12441 2006-07-18  Kornél Pál  <kornelpal@gmail.com>
12442
12443         * class-internals.h: Added MONO_WRAPPER_MANAGED_TO_MANAGED wrapper type.
12444         * debug-helpers.c: Map MONO_WRAPPER_MANAGED_TO_MANAGED to
12445           "managed-to-managed".
12446         * icall.c: Redirect string constructors that take sbyte* to
12447           ves_icall_System_String_ctor_RedirectToCreateString.
12448         * marshal.c: Redirect ves_icall_System_String_ctor_RedirectToCreateString
12449           to CreateString () methods with matching signature.
12450         * reflection.c: Use original security informations for
12451           MONO_WRAPPER_MANAGED_TO_MANAGED.
12452         * security-manager.c: Use original security informations for
12453           MONO_WRAPPER_MANAGED_TO_MANAGED.
12454         * string-icalls.c: Added ves_icall_System_String_ctor_RedirectToCreateString
12455           that is a placeholder and only its address should be used.
12456         * string-icalls.h: Added ves_icall_System_String_ctor_RedirectToCreateString
12457           that is a placeholder and only its address should be used.
12458
12459 2006-07-15  Jonathan Chambers  <joncham@gmail.com>
12460
12461         Begin implementing COM Interop.
12462         * appdomain.c: Increment corlib version.
12463         * class.c: Set ComImport classes' parent to __ComObject.
12464         * loader.c: Mark cominterop methods as such.
12465         * domain.c: Add __ComObject class to MonoDefaults structure.
12466         * image.c: Add 2 hashtables to the image for COM Interop related methods
12467         * metadata.c: Added mono_metadata_type_dup_mp to duplicate a type
12468         using the mempool allocator
12469         
12470         * metadata-internals.h: Add 2 hashtables to the image for COM Interop related methods
12471         * metadata.h: Added cominterop field to _MonoMethodSignature struct and
12472         declaration for mono_metadata_type_dup_mp.
12473         
12474         * debug-helpers.c: Added strings for two additional wrapper types
12475         * object.c: Create proxy objects for ComImport classes
12476         * class-internals.h: Define 2 new method wrapper types, COM Interop remoting target,
12477         and added __ComObject class to MonoDefaults structure.
12478         
12479         * object-internals.h: Finish MonoRealProxy definition, and add definition of
12480         MonoComInteropProxy and MonoComObject.
12481         
12482         * marshal.c: Added support for COM Interop
12483         (signature_cominterop): Converts managed signature to corresponding
12484         unmanaged COM signature.
12485         (cominterop_get_function_pointer): gets unmanaged function pointer via
12486         COM object vtable
12487         (cominterop_get_com_slot_for_method): returns vtable slot in COM interface of method
12488         (cominterop_get_method_interface): returns interface type that method is defined on
12489         (mono_mb_emit_cominterop_call): emits native call to function pointer
12490         gotten from vtable
12491         (cominterop_get_native_wrapper_adjusted): actual wrapper around unmanaged COM call
12492         that matches signature of unmanaged function.
12493         (cominterop_get_native_wrapper): wrapper around adjusted method call.
12494         (cominterop_get_invoke): forwards call from proxy to __ComObject
12495         (ves_icall_System_Runtime_InteropServices_Marshal_AddRef): Implements Marshal.AddRef 
12496         (ves_icall_System_Runtime_InteropServices_Marshal_QueryInterface): Implements Marshal.QueryInterface 
12497         (ves_icall_System_Runtime_InteropServices_Marshal_Release): Implements Marshal.Release 
12498         
12499         * marshal.h: Added Marshal icall declarations.
12500         * icall.c: Added __ComObject icalls. Need to store interfaces in unmanaged code
12501         so we can access them in finalizer
12502         
12503 2006-07-14  Dick Porter  <dick@ximian.com>
12504
12505         * object.c (mono_type_initialization_cleanup): Fix a race
12506         condition by temporarily commenting out the critical section
12507         deletion.
12508
12509 2006-07-14  Zoltan Varga  <vargaz@gmail.com>
12510
12511         * reflection.c (create_custom_attr): Fix some warnings.
12512         (create_custom_attr_data): Ditto.
12513         (typebuilder_setup_properties): Save custom attrs for properties in dynamic
12514         types. Fixes #78855.
12515
12516 2006-07-11  Zoltan Varga  <vargaz@gmail.com>
12517
12518         * class.c (mono_type_get_name_recurse): Fix the name of 1 dimensional non-szarrays.
12519
12520         * reflection.c (mono_custom_attrs_free): Fix freeing of dynamic cattr info.
12521
12522 2006-07-08  Zoltan Varga  <vargaz@gmail.com>
12523
12524         * reflection.c (resolve_object): Add support for DynamicMethod.
12525
12526         * domain.c appdomain.c threads.c monitor.c object.c gc.c: Applied patch from
12527         Joachim Ante (joe@otee.dk). Fix some shutdown leaks.
12528
12529 2006-07-06  Sebastien Pouliot  <sebastien@ximian.com>
12530
12531         * process.c: In ves_icall_System_Diagnostics_Process_GetModules_internal 
12532         don't leak GPtrArray's pdata has we have no use (nor free) for it.
12533
12534 2006-07-01  Zoltan Varga  <vargaz@gmail.com>
12535
12536         * marshal.c (mono_marshal_get_runtime_invoke): Fix passing of generic valuetypes.
12537         Fixes #77888.
12538
12539 2006-06-30  Raja R Harinath  <rharinath@novell.com>
12540
12541         * icall.c (ves_icall_MonoMethod_get_base_definition): Simplify
12542         slightly: remove a shadow local variable.
12543
12544 2006-06-29  Raja R Harinath  <rharinath@novell.com>
12545
12546         * icall.c (ves_icall_MonoMethod_get_base_definition): Return the
12547         definition that introduces the virtual function slot.
12548         Also fix Coverity #105.
12549
12550 2006-06-29  Zoltan Varga  <vargaz@gmail.com>
12551
12552         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Fix support
12553         for dynamic assemblies. Fixes #78724.
12554
12555 2006-06-28  Zoltan Varga  <vargaz@gmail.com>
12556
12557         * marshal.c (mono_string_to_byvalwstr): Fix this completely broken function.
12558         Fixes #78722.
12559
12560 2006-06-21  Martin Baulig  <martin@ximian.com>
12561
12562         * reflection.c
12563         (method_encode_clauses): Don't assert on `ex_info->handlers' here;
12564         fixes #76484.
12565
12566 2006-06-21  Zoltan Varga  <vargaz@gmail.com>
12567
12568         * object.h (mono_array_setref): Cast value to (MonoObject*) to fix warnings.
12569
12570 2006-06-20  Raja R Harinath  <rharinath@novell.com>
12571
12572         Make 'mono_class_get_full' only inflate TYPESPECs, not TYPEDEFs
12573         nor TYPEREFs.
12574         * class.c (mono_class_create_from_typespec): Add 'context' argument.
12575         Inflate result if necessary.
12576         (mono_class_get_full): Remove old version.  Rename from
12577         'mono_class_get' and add 'context' argument.  Pass it to
12578         ..._create_from_typespec.
12579         (mono_class_get): New.  Simple wrapper to mono_class_get_full.
12580         (mono_ldtoken): Revert change below.
12581
12582 2006-06-20  Martin Baulig  <martin@ximian.com>
12583
12584         * class.c (mono_ldtoken): Don't pass the generic context to
12585         mono_class_get_full() for MONO_TOKEN_TYPE_DEF/REF.  Fixes #78053.
12586
12587 2006-06-15  Zoltan Varga  <vargaz@gmail.com>
12588
12589         * marshal.c (mono_ftnptr_to_delegate): Avoid allocating signature from mempool
12590         and later freeing it. Fixes #78638.
12591
12592 2006-06-15  Miguel de Icaza  <miguel@novell.com>
12593
12594         * icall.c (mono_class_get_throw): Revert over-zealous error
12595         throwing, the caller for mono_class_get_throw will cope with
12596         errors when classes are not properly initialized already.
12597
12598         The code still copes with loader exceptions though.
12599
12600         Fixes the regression in reftype1 and reftype3 from the CAS tests.
12601         
12602 2006-06-14  Miguel de Icaza  <miguel@novell.com>
12603
12604         Fixes the `make run1' version of RuntimeAbort (to be commited,
12605         source is in Bugzilla).
12606         
12607         * metadata.c (mono_metadata_interfaces_from_typedef_full): Return
12608         FALSE on class loading failure instead of returning true.
12609
12610         * class.c (mono_class_create_from_typedef): It is possible for
12611         mono_metadata_interfaces_from_typedef_full to fail if a class is
12612         not found, cope with this.
12613         
12614
12615 2006-06-14  Dick Porter  <dick@ximian.com>
12616
12617         * socket-io.c: 
12618         * process.c: Fix a bunch of signed/unsigned warnings from gcc
12619         4.1.1
12620
12621 2006-06-12  Atsushi Enomoto  <atsushi@ximian.com>
12622
12623         * culture-info-table.h : oops, forgot to make it nsync with r61548.
12624
12625 2006-06-09  Jonathan Chambers  <jonathan.chambers@ansys.com>
12626
12627         * icall.c: Another fix for building mono in Visual Studio.
12628
12629 2006-06-09  Jonathan Chambers  <jonathan.chambers@ansys.com>
12630
12631         * marshal.c icall.c: Minor fixes for building mono in Visual Studio.
12632         
12633 2006-06-09  Martin Baulig  <martin@ximian.com>
12634
12635         * debug-mono-symfile.c: Put this back and really fix it this
12636         time. Sorry for all the trouble.
12637
12638 2006-06-08  Zoltan Varga  <vargaz@gmail.com>
12639
12640         * icall.c (mono_class_get_throw): Fix a warning.
12641         (ves_icall_System_Reflection_Assembly_GetTypes): Allways throw 
12642         ReflectionTypeLoadException if needed. Fixes #78606.
12643
12644         * class.c (mono_class_setup_vtable_general): Handle loader errors a bit better.
12645         (mono_class_init): Ditto.
12646
12647         * loader.c (mono_loader_set_error_assembly_load): Display a separate warning for
12648         ref_only exceptions.
12649         (mono_loader_clear_error): Make this work even if there is no error.
12650
12651 2006-06-08  Jonathan Chambers  <jonathan.chambers@ansys.com>
12652
12653         * object-internals.h marshal.c marshal.h icall.c: Implement method 
12654         Marshal.GetComSlotForMethodInfo using internal call.
12655
12656 2006-06-07  Zoltan Varga  <vargaz@gmail.com>
12657
12658         * class-internals.h: Add a new kind of loader error LOADER_ERROR_ASSEMBLY plus
12659         a function for signalling it.
12660
12661         * class.c (mono_class_from_typeref): Use the new kind of loader error when
12662         a referenced assembly is not found.
12663
12664         * loader.c (mono_loader_error_prepare_exception): Add support for 
12665         LOADER_ERROR_ASSEMBLY. Fix formatting.
12666
12667 2006-06-05  Jonathan Chambers  <jonathan.chambers@ansys.com>
12668
12669         * domain.c appdomain.c class-internals.h marshal.c: Add support 
12670         for VARIANT marshalling on windows and increment corlib version
12671         since Variant struct was added.
12672
12673 2006-06-03  Miguel de Icaza  <miguel@novell.com>
12674
12675         * debug-mono-symfile.c: Revert Martin's previous patch which broke
12676         stack trace line information:
12677
12678         (Martin) (mono_debug_symfile_lookup_location): Fix the algorithm:
12679         (Martin) when looking up B which is between A and C, return A not C.
12680
12681         Bug is #78573.
12682
12683         Thanks to Alexander Olk for tracking this down.
12684
12685 2006-06-02  Zoltan Varga  <vargaz@gmail.com>
12686
12687         * marshal.c (mono_marshal_set_last_error_windows): Fix build.
12688         
12689         * marshal.c (mono_marshal_emit_native_wrapper): Call GetLastError () early and without a wrapper to
12690         avoid clobbering its value.
12691         (mono_string_to_lpstr): Fix a warning on windows.
12692
12693 2006-05-31  Zoltan Varga  <vargaz@gmail.com>
12694
12695         * class-internals.h (MonoClass): Removed obsolete 'dummy' flag.
12696
12697         * reflection.c loader.c: Removed references to 'dummy' flag.
12698
12699         * loader.c (mono_loader_error_prepare_exception): Fix a warning.
12700
12701         * threadpool.c: Make ASyncCall a copy of the managed MonoAsyncCall class so
12702         it gets GC tracking.
12703
12704         * object-internals.h (MonoAsyncResult): Add an 'object_data' field which has
12705         GC tracking.
12706         
12707         * object.c (mono_async_result_new): Add an additional parameter 'object_data'.
12708
12709         * marshal.c threadpool.c: Update callers of mono_async_result_new.
12710
12711         * appdomain.c: Bump corlib version.
12712
12713 2006-05-30  Zoltan Varga  <vargaz@gmail.com>
12714
12715         * marshal.c: Use mono_mb_emit_stloc in more places. Use CEE_LDIND_REF and
12716         CEE_STIND_REF when working with object references.
12717
12718 2006-05-31  Zoltan Varga  <vargaz@gmail.com>
12719
12720         * class.c (mono_class_setup_fields): Call mono_class_init () for class->parent.
12721         Fixes #78539.
12722
12723 2006-05-30  Miguel de Icaza  <miguel@novell.com>
12724
12725         * loader.c (method_from_memberref): Fix argument value for
12726         mono_loader_set_error_method_load (I was passing the MonoClass
12727         instead of the class name char *).
12728
12729 2006-05-30  Zoltan Varga  <vargaz@gmail.com>
12730
12731         * marshal.c: Use mono_mb_emit_stloc in more places. Use CEE_LDIND_REF and
12732         CEE_STIND_REF when working with object references.
12733
12734 2006-05-30  Martin Baulig  <martin@ximian.com>
12735
12736         * mono-debug.c (mono_debug_print_stack_frame): Reverted the
12737         mono_method_full_name() change and replace the ':' with a '.'
12738         here.
12739
12740 2006-05-30  Martin Baulig  <martin@ximian.com>
12741
12742         * debug-mono-symfile.c
12743         (mono_debug_symfile_lookup_location): Fix the algorithm:
12744         when looking up B which is between A and C, return A not C.
12745
12746 2006-05-29  Martin Baulig  <martin@ximian.com>
12747
12748         * mono-debug.h
12749         (MonoDebugMethodInfo): Make the typedef public.
12750         (MonoDebugSourceLocation): New public struct.
12751
12752         * mono-debug.c
12753         (mono_debug_source_location_from_address): Removed.
12754         (mono_debug_source_location_from_il_offset): Removed.
12755         (mono_debug_il_offset_from_address): Removed.
12756         (mono_debug_address_from_il_offset): Removed.
12757         (mono_debug_lookup_method): New public function.
12758         (mono_debug_lookup_source_location): New public function; replaces
12759         the old mono_debug_source_location_from_*() functions; see the
12760         inline documentation.
12761         (mono_debug_free_source_location): New public function.
12762         (mono_debug_print_stack_frame): New public function; see the
12763         inline documentation.
12764
12765         * debug-mono-symfile.c
12766         (mono_debug_find_source_location): Renamed into
12767         mono_debug_symfile_lookup_location(); only take a
12768         `MonoDebugMethodInfo *' and an `offset' argument; added inline
12769         documentation.
12770         (mono_debug_find_method): Renamed into
12771         mono_debug_symfile_lookup_method().
12772
12773 2006-05-27  Zoltan Varga  <vargaz@gmail.com>
12774
12775         * assembly.c (mono_assembly_open_full): Dont overwrite the status
12776         returned by mono_image_open_full ().
12777
12778         * appdomain.c (ves_icall_System_Reflection_Assembly_LoadFrom): Convert
12779         MONO_IMAGE_IMAGE_INVALID into a BadImageFormatException. Fixes
12780         #78517.
12781
12782         * object.c (compute_class_bitmap): Use class->class_size for static fields. Fixes
12783         #78518.
12784
12785 2006-05-27  Miguel de Icaza  <miguel@novell.com>
12786
12787         * class.c (mono_class_from_typeref): handle missing images
12788         earlier, deals with bug #78418.   Refactor code; 
12789
12790         Fix a warning introduced in my previous commit (some stale code
12791         from before I revisited my patch).
12792
12793         * class.c (mono_class_create_from_typedef): On failure, remove the
12794         class from the MonoImage->class_cache as the class is not
12795         initialized;   Fixes the leak pointed out by Paolo.
12796
12797 2006-05-25  Dick Porter  <dick@ximian.com>
12798
12799         * threads.c (mono_thread_cleanup): Build fix.  Comment out the
12800         DeleteCriticalSections until I figure out which one may still be
12801         sometimes locked when mono_thread_cleanup is called.
12802
12803 2006-05-24  Dick Porter  <dick@ximian.com>
12804
12805         * threads.c (mono_thread_cleanup): Move the threading cleanup out
12806         of mono_thread_manage and back into its own function, so it can be
12807         called after the finalizer thread has finished.
12808
12809         * appdomain.c (mono_runtime_cleanup): Call mono_thread_cleanup
12810
12811 2006-05-24  Zoltan Varga  <vargaz@gmail.com>
12812
12813         * assembly.c (mono_assembly_open_full): Fix typo introduced by a previous change.
12814         Fixes #78495.
12815
12816         * marshal.c (emit_ptr_to_object_conv): Implement marshalling of byval arrays
12817         with non-blittable elements.
12818         (emit_object_to_ptr_conv): Ditto. Fixes #78492.
12819
12820 2006-05-24  Martin Baulig  <martin@ximian.com>
12821
12822         * mono-debug-debugger.h (MonoDebuggerEvent): Added
12823         `MONO_DEBUGGER_EVENT_FINALIZE_MANAGED_CODE'.    
12824
12825         * mono-debug-debugger.c (mono_debugger_cleanup): Send a
12826         `MONO_DEBUGGER_EVENT_FINALIZE_MANAGED_CODE' and then set
12827         `mono_debugger_event_handler' to NULL.
12828
12829 2006-05-24  Martin Baulig  <martin@ximian.com>
12830
12831         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 57.
12832
12833 2006-05-24  Martin Baulig  <martin@ximian.com>
12834
12835         * mono-debug-debugger.h
12836         (mono_debugger_create_notification_function): Added
12837         `MonoCodeManager *' argument.
12838
12839 Tue May 23 16:05:47 CEST 2006 Paolo Molaro <lupus@ximian.com>
12840
12841         * boehm-gc.c, null-gc.c: fix compilation on 64 bit systems.
12842
12843 Tue May 23 13:44:11 CEST 2006 Paolo Molaro <lupus@ximian.com>
12844
12845         * Makefile.am, gc-internal.h, reflection.c: updates for the new GC.
12846         * sgen.-gc.c, sgen-gc.h: simple generational compacting GC
12847         implementation.
12848
12849 Tue May 23 13:40:30 CEST 2006 Paolo Molaro <lupus@ximian.com>
12850
12851         * icall.c: precise GC support: objects can't be stored in unmanaged
12852         memory anymore, even if they are kept alive by other references: since
12853         they can move the GC needs to be able to always find them.
12854
12855 Tue May 23 12:57:08 CEST 2006 Paolo Molaro <lupus@ximian.com>
12856
12857         * object.c: precise GC support for static fields. Support
12858         for moving GCs: write barriers and pinned allocation for interned
12859         strings.
12860
12861 Tue May 23 12:41:44 CEST 2006 Paolo Molaro <lupus@ximian.com>
12862
12863         * domain.c, domain-internals.h: precise GC support for the MonoDomain
12864         structure.
12865
12866 Tue May 23 12:38:56 CEST 2006 Paolo Molaro <lupus@ximian.com>
12867
12868         * class.c, gc.c: sgen and precise GC updates.
12869
12870 Tue May 23 12:33:24 CEST 2006 Paolo Molaro <lupus@ximian.com>
12871
12872         * marshal.h, marshal.c: added write barrier wrapper and precise type
12873         fixes.
12874
12875 Tue May 23 12:31:22 CEST 2006 Paolo Molaro <lupus@ximian.com>
12876
12877         * object.h, null-gc.c, boehm-gc.c: more write barrier functions and
12878         support.
12879
12880 Tue May 23 12:27:14 CEST 2006 Paolo Molaro <lupus@ximian.com>
12881
12882         * reflection.c: precise and sgen GC updates.
12883
12884 Tue May 23 12:21:46 CEST 2006 Paolo Molaro <lupus@ximian.com>
12885
12886         * debug-helpers.c, class-internals.h: added write barrier wrapper type.
12887
12888 2006-05-22  Zoltan Varga  <vargaz@gmail.com>
12889
12890         * threads.c (start_wrapper): Fix a missed guint32 tid declaration.
12891
12892 2006-05-20  Zoltan Varga  <vargaz@gmail.com>
12893
12894         * reflection.c (encode_cattr_value): Fix yet another bug in the encoding of
12895         MONO_TYPE_OBJECT. Fixes #78462.
12896
12897 2006-05-18  Zoltan Varga  <vargaz@gmail.com>
12898
12899         * marshal.c (emit_marshal_vtype): Add support for UnmanagedType.LPStruct 
12900         and blittable types.
12901
12902 2006-05-17  Miguel de Icaza  <miguel@novell.com>
12903
12904         * class.c (mono_class_get_exception_for_failure): Implement parts
12905         of a TODO: if the loader error is set (instead of the class
12906         error), we return a Loader exception that can be properly thrown
12907         elsewhere.
12908
12909         This was exposed by some Winforms 2.0 code that I tried to run
12910         (Atsushi pointed me to it).
12911
12912 2006-05-17  Zoltan Varga  <vargaz@gmail.com>
12913
12914         * marshal.c (mono_marshal_emit_native_wrapper): Make the marshalling code more
12915         uniform by moving stuff from this function to the proper emit_marshal_XXX functions.
12916         
12917         * marshal.c (emit_marshal_vtype): Add limited support for 
12918         UnmanagedType.LPStruct. Fixes #78427.
12919
12920         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure): 
12921         Applied a patch from kangaroo to fix #77523.
12922
12923 2006-05-17  Martin Baulig  <martin@ximian.com>
12924
12925         * threads.c
12926         (debugger_thread_vtable): Moved into ../mini/debug-debugger.c.
12927         (debugger_thread_created): Removed.
12928         (debugger_thread_exited): Removed.
12929
12930 2006-05-15  Zoltan Varga  <vargaz@gmail.com>
12931
12932         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
12933
12934         * object-internals.h (MonoReflectionResource): Sync with managed version.
12935
12936 2006-05-12  Wade Berrier <wberrier@novell.com>
12937
12938         * threads.c: Define G_GSIZE_FORMAT for systems with glib < 2.6
12939
12940 2006-05-12  Zoltan Varga  <vargaz@gmail.com>
12941
12942         * class.c (mono_fnptr_class_get): Set class->image to corlib for now, since other
12943         functions try to allocate from the image mempool.
12944
12945 2006-05-12  Dick Porter  <dick@ximian.com>
12946
12947         * threads.c (mono_thread_attach): Fix usage of GetCurrentThread().
12948
12949 2006-05-12  Lluis Sanchez  <lluis@ximian.com>
12950
12951         * object.c: The FieldGetter and FieldSetter methods require the full
12952         name of the class, not only the name. Fixes bug #78277.
12953
12954 2006-05-11  Miguel de Icaza  <miguel@novell.com>
12955
12956         * loader.c (method_from_memberref): Do not pass the NULL klass to
12957         mono_loader_set_error_() methods.  Pass the non-NULL value
12958         (class). 
12959
12960 2006-05-11  Zoltan Varga  <vargaz@gmail.com>
12961
12962         * assembly.c (mono_assembly_load_from_full): Fix a bunch of warnings.
12963         (mono_assembly_close): Null out assembly->image->references after freeing it.
12964
12965         * image.c (mono_image_close): Free image->references.
12966         
12967         * reflection.c (mono_image_basic_init): Fix a small memory leak.
12968
12969 2006-05-10  Sebastien Pouliot  <sebastien@ximian.com>
12970
12971         * marshal.c: In function mono_mb_add_local don't use the mb pointer 
12972         before checking if it's NULL (g_assert).
12973
12974 2006-05-10  Martin Baulig  <martin@ximian.com>
12975
12976         * metadata.c (mono_type_size): Kill the g_assert() in MONO_TYPE_GENERICINST;
12977         I thought I already killed that two months ago, but now it somehow reappeared.
12978
12979 2006-05-10  Martin Baulig  <martin@ximian.com>
12980
12981         * mono-debug.c (mono_debug_add_method): Allow instantiated generic methods.
12982
12983 2006-05-10  Zoltan Varga  <vargaz@gmail.com>
12984
12985         * reflection.c: Allocate memory for dynamically created methods in the image
12986         mempools.
12987
12988 2006-05-10  Sebastien Pouliot  <sebastien@ximian.com>
12989
12990         * appdomain.c: In ves_icall_System_AppDomain_[Get|Set]Data functions, 
12991         don't use the ad pointer before checking if it's NULL (g_assert).
12992
12993 2006-05-09  Zoltan Varga  <vargaz@gmail.com>
12994
12995         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): Remove
12996         a redundant (and incorrect) addref. Hopefully fixes sn.exe on windows.
12997
12998         * marshal.c: Allocate all signatures from mempools.
12999
13000         * marshal.c: Allocate some more signatures from mempools.
13001
13002 2006-05-09  Miguel de Icaza  <miguel@novell.com>
13003
13004         * object.c (mono_load_remote_field): The code used to provide a
13005         temporary variable for returning results if the user did not
13006         provide a result pointer.  But our temporary variable was allocted
13007         on the satck.
13008
13009         Fix calling code to always pass a result area.   Coverity ID 103.
13010
13011 2006-05-06  Zoltan Varga  <vargaz@gmail.com>
13012
13013         * threads.c (ves_icall_System_Threading_Interlocked_Add_Int): Return the new
13014         value, not the old. Fixes #78312.
13015         (ves_icall_System_Threading_Interlocked_Add_Long): Ditto.
13016
13017         * class.c (mono_bounded_array_class_get): Allocate data from the image mempool.
13018         (mono_ptr_class_get): Ditto. Also change the cache from a global one to a 
13019         per-image cache.
13020
13021         * assembly.c (mono_assembly_close): Free image->references.
13022
13023         * assembly.c (mono_assembly_names_equal): Fix a warning.
13024         (mono_assemblies_cleanup): Cleanup more global data.
13025
13026         * metadata-internals.h (MonoImage): Add 'ptr_cache'.
13027
13028         * image.c (mono_image_close): Free up the contents of 'array_cache', free up
13029         ptr_cache and image->modules.
13030
13031         * image.c (mono_image_init): Allocate array_cache lazily.
13032         
13033 2006-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13034
13035         * assembly.c: use GetCurrentThreadId for the hash, as GetCurrentThread
13036         behavior was changed recently and has bad side effects.
13037
13038 2006-05-05  Zoltan Varga  <vargaz@gmail.com>
13039
13040         * assembly.c (mono_assembly_open_full): Add a missing mono_image_close ().
13041         
13042         * assembly.c (mono_assembly_close): Remove a debug printf.
13043
13044         * profiler.c (create_profiler): Use mono_aligned_addr_hash.
13045
13046         * metadata-internals.h image.c assembly.c: Change the reference counting scheme
13047         to also allow for temporary references between mono_image_open ()/close ().
13048
13049         * domain.c (get_runtimes_from_exe): Add a FIXME.        
13050
13051 2006-05-04  Zoltan Varga  <vargaz@gmail.com>
13052
13053         * marshal.c: Fix support for dynamic methods.
13054
13055         * appdomain.c (mono_runtime_cleanup): Call mono_marshal_cleanup ().
13056
13057         * marshal.c (mono_marshal_cleanup): New cleanup function.
13058
13059         * marshal.c: Rewrite the wrapper code to allocate most of its memory from the 
13060         image mempools.
13061
13062         * class.c (mono_class_init): Fix leaking class->nested_classes.
13063
13064         * metadata-internals.h (MonoImage): Add a couple of new wrapper caches.
13065
13066         * image.c (mono_image_init): Initialize the new cashes.
13067
13068         * image.c (mono_image_close): Destroy the new cashes.
13069
13070         * marshal.c: Get rid of most of the static caches in favor of per-image caches.
13071
13072         * mempool.c (mono_mempool_strdup): New helper function.
13073
13074         * class-internals.h: Add prototype for mono_loader_unlock ().
13075
13076         * domain.c (mono_jit_info_table_find): Fix a warning.
13077         (mono_debugger_check_runtime_version): Ditto.
13078
13079         * rawbuffer.h rawbuffer.c metadata-internals.h metadata.c class-internals.h 
13080         class.c loader.c image.h image.c assembly.h assembly.c: Add init () and cleanup ()
13081         functions to these modules.
13082
13083         * domain-internals.h domain (mono_cleanup): New internal method to cleanup most
13084         metadata modules.
13085         
13086         * marshal.c (mono_free_bstr): Fix a warning.
13087
13088         * assembly.c (mono_assembly_open_full): Fix another small leak.
13089
13090         * object.c: Fix some unload leaks in the remoting code.
13091
13092         * object-internals.h object-internal.c (mono_string_to_utf8_mp): New helper
13093         function.
13094
13095         * assembly.c (mono_assembly_close): Fix a leak when unloading dynamic assemblies.
13096
13097         * reflection.c: Fix some unload leaks in dynamic assemblies.
13098
13099 2006-05-02  Jonathan Chambers  <jonathan.chambers@ansys.com>
13100
13101         * marshal.c: Add BSTR support on Win32 (all changes under MIT X11)
13102         * marshal.h: Add BSTR support on Win32
13103         * icall.c: Add BSTR icalls
13104         * metadata.h: Add BSTR enums
13105
13106 2006-04-28  Miguel de Icaza  <miguel@novell.com>
13107
13108         Work to catch the crash from #76795 and turn it into an
13109         exception.   As I stubbed out pieces of the VisualBasic support,
13110         I found a number of places where the code was failing and I added
13111         checks to those places. 
13112         
13113         * metadata.c (do_mono_metadata_parse_generic_class): Make this
13114         function return a status code.  If we fail to parse the signature
13115         from mono_metadata_parse_generic_inst, return FALSE.
13116
13117         * loader.c (mono_get_method_from_token): If we fail to load the
13118         method (mono_class_get) return NULL.   
13119
13120         * (method_from_memberref): Return NULL if we are unable to parse
13121         the method signature
13122
13123         (mono_loader_error_prepare_exception): Since we now use the
13124         loader_error flag internally to stop processing, and obtaining
13125         exceptions that might be thrown will walk this code path the
13126         proper way of going from a MonoLoaderError into a
13127         MonoException was convoluted.   This new routine encapsulates the
13128         process of turning the error into an exception and *clearing* the
13129         error afterwards.
13130         
13131 2006-04-27  Miguel de Icaza  <miguel@novell.com>
13132
13133         Work to catch the crashes from 75075 (cope in Assembly.GetTypes
13134         with missing assemblies), and to cope with:
13135
13136                 * Missing fieldref from a non-existing assembly.
13137                 * Missing methodref from a non-existing assembly.
13138
13139         The first batch of work to address *some* of the issues from 76661.
13140         
13141         * object.c (mono_class_create_runtime_vtable): If we fail to
13142         initialize the class raise the exception here. 
13143
13144         * metadata.c (mono_class_get_overrides_full): If any methods fail
13145         to load return the failure to the caller.
13146
13147         * assembly.c: Use REFERENCE_MISSING instead of (gpointer) -1 for
13148         flagging assemblies that failed to load.   
13149
13150         Do not crash if we are unable to load the assembly.
13151
13152         (mono_assembly_close): Do nothing with REFERENCE_MISSING
13153         assemblies. 
13154
13155         * loader.c (mono_loader_set_error_type_load): Change the
13156         convention to always pass unallocated strings, so we make our own
13157         copies (I know our own code had duplicated strings before, but
13158         this keeps the normal conventions).
13159         (method_from_memberref): Call mono_loader_set_error_method_load
13160         for all possible failures of loading the class. 
13161         Remove assert, turn into a loader error.
13162
13163         (mono_loader_error_to_exception): Move this routine from mini
13164         (mini_loader_error_to_exception) there was no need to have that in
13165         mini. 
13166
13167         * class.c (mono_class_from_typeref): If we were not able to load
13168         the assembly with mono_assembly_load_reference, call the
13169         mono_loader_set_error_type_load to register the problem.
13170
13171         (mono_class_setup_fields): If we fail to load the type from
13172         mono_metadata_parse_type_full, call mono_class_set_failure and
13173         break from the loop.
13174
13175         If class->exception_type is set, we do not layout the fields as
13176         that might crash the runtime, and instead return (from breaking
13177         from the previous loop).
13178
13179         (mono_class_setup_vtable): This now returns a boolean indicating
13180         whether the table was properly setup.   The decision is driven by
13181         mono_class_get_overrides_full which might run into non-existing
13182         methods. 
13183         
13184         (mono_class_init): Returns TRUE on success or FALSE if there was a
13185         problem in loading the type (incorrect assemblies, missing
13186         assemblies, methods, etc).
13187
13188         When we call mono_class_setup_fields we also check for a potential
13189         error inside this call (either a class exception or a general
13190         loader exception).
13191
13192         (mono_class_create_from_typedef): If the parent fails to load
13193         (calling mono_class_get_full) return NULL.
13194         
13195         ** Important **
13196
13197         calls to mono_metadata_parse_type_full should be checked
13198         everywhere and set the mono_class_set_failure
13199         (MONO_EXCEPTION_TYPE_LOAD) if we are not able to get the type.
13200
13201         The current patch checks the places where my manually constructed
13202         tests show the errors are showing up, but we should do it
13203         everywhere. 
13204
13205         ** Important2 **
13206
13207         mono_class_init return values should be tested everywhere, like
13208         the previous case this is something that we should audit
13209         everywhere and not only on the cases exposed by the tests I
13210         created. 
13211
13212 2006-04-26  Miguel de Icaza  <miguel@novell.com>
13213
13214         * file-io.c (ves_icall_System_IO_MonoIO_Open): Remove `async'
13215         boolean parameter and instead pass the information on `options'
13216         parameter (FileOptions).
13217
13218         * icall.c: Register the new signature for MonoIO.Open.
13219
13220         * debug-helpers.c (dis_one): Trying to understand how coverity
13221         works.  Fix Run 5, item 78.
13222
13223 2006-04-26  Dick Porter  <dick@ximian.com>
13224
13225         * socket-io.c (hostent_to_IPHostEntry2): Explicitly check for NULL
13226         dereference.
13227
13228 2006-04-25  Martin Baulig  <martin@ximian.com>
13229
13230         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 56.
13231
13232         * threads.c (mono_thread_attach): Set `thread->stack_ptr' and call
13233         debugger_thread_created().
13234         (debugger_gc_push_all_stacks): Don't handle the main thread in any
13235         special way.
13236         (mono_debugger_init_threads): Removed the `main_thread_stack' arg.
13237         (mono_debugger_finalize_threads): New function; undo the effects
13238         of mono_debugger_init_threads().
13239         (mono_debugger_create_all_threads): Removed.
13240
13241 2006-04-24  Zoltan Varga  <vargaz@gmail.com>
13242
13243         * image.c (mono_image_close): Tidy up trace messages.
13244
13245         * assembly.c (mono_assembly_close): Ditto.
13246
13247         * assembly.c (mono_assembly_close): Clear out image->assembly so the image
13248         no longer references an already freed assembly. Fixes #78168.
13249
13250 2006-04-21  Dick Porter  <dick@ximian.com>
13251
13252         * threads.c (mono_thread_detach): Fix reference counting when
13253         detaching threads.
13254
13255 2006-04-21  Zoltan Varga  <vargaz@gmail.com>
13256
13257         * icall.c (ves_icall_System_Enum_ToObject): Improve exception messages. Fixes
13258         #78155.
13259
13260 2006-04-19  Zoltan Varga  <vargaz@gmail.com>
13261
13262         * marshal.c (mono_type_to_ldind): New helper function moved here from mini.c
13263         (mono_type_to_stind): Ditto.
13264
13265         * marshal.c: Use the new helper functions to simplify code.
13266
13267         * image.c (mono_image_close): Add some code for help debug assembly unloading
13268         problems.
13269
13270         * metadata.c (mono_metadata_parse_type_full): Allocate MonoType's from the
13271         image mempool.
13272
13273         * assembly.c (mono_assembly_open_full): Invoke the load hook when the
13274         assembly was already loaded in another appdomain. Fixes #78083.
13275
13276 2006-04-13  Zoltan Varga  <vargaz@gmail.com>
13277
13278         * assembly.c (mono_assembly_load_reference): Increase the refcount of the
13279         referenced assemblies.
13280         (mono_assembly_close): Decrease the refcount of the referenced assemblies.
13281
13282         * domain.c (mono_domain_free): Add a trace message.
13283
13284         * appdomain.c (add_assemblies_to_domain): Ditto.        
13285
13286         * metadata-internals.h: (_MonoAssembly): Modify the meaning of the ref_count
13287         field.  
13288
13289 2006-04-12  Zoltan Varga  <vargaz@gmail.com>
13290
13291         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): Fix image reference counting.
13292
13293 2006-04-12  Martin Baulig  <martin@ximian.com>
13294
13295         * threads.c: Use `MONO_DEBUGGER_SUPPORTED' as the conditional, not
13296         `USE_INCLUDED_LIBGC'.   
13297
13298 2006-04-12  Zoltan Varga  <vargaz@gmail.com>
13299
13300         * image.c (canonicalize_path): Avoid calling strncpy on overlapping strings if
13301         the patch contains ../ and a small directory name later. Hopefully fixes
13302         #78035.
13303
13304 2006-04-10  Martin Baulig  <martin@ximian.com>
13305
13306         Clean up the debugger's thread-handling code.
13307
13308         The debugger's thread-handling code has been moved from
13309         ../mini/debug-debugger.c to threads.c.  We now iterate directly
13310         over the `threads' hash, keep track of exiting threads and also
13311         use proper locking.
13312
13313         We can now debug XSP and XSP based applications with the debugger.
13314
13315         * object-internals.h (MonoThread): Added `gpointer end_stack'.
13316
13317         * threads.h
13318         (MonoThreadCallbacks): Removed; this was only used by the debugger.
13319         (mono_install_thread_callbacks): Likewise.      
13320
13321         * threads.c (mono_thread_callbacks): Removed.
13322         (debugger_thread_created, debugger_thread_exited): New static functions.
13323         (start_wrapper): Call debugger_thread_created().
13324         (thread_cleanup): Call debugger_thread_exited().
13325         (mono_gc_stop_world, mono_gc_start_world): Removed; this was never used.
13326         (mono_debugger_init_threads): New public function.
13327         (debugger_thread_vtable): Moved here from debug-debugger.c; we now
13328         iterate directly over the `threads' hash and also use proper locking.
13329
13330         * mono-debug.h (MONO_DEBUGGER_VERSION): Bumped to 55.
13331
13332         * mono-debug-debugger.h
13333         (MonoDebuggerEvent): Added MONO_DEBUGGER_EVENT_THREAD_EXITED.
13334
13335 2006-04-10  Zoltan Varga  <vargaz@gmail.com>
13336
13337         * reflection.c (encode_cattr_value): Fix handling of parameter type=object, 
13338         argument type=array. Fixes #78057.
13339
13340 2006-04-10  Atsushi Enomoto  <atsushi@ximian.com>
13341
13342         * culture-info-table.h : regenerated. Fixed bug #69652.
13343
13344 2006-04-07  Zoltan Varga  <vargaz@gmail.com>
13345
13346         * loader.c metadata.c: Reapply a variant r59116.
13347         
13348         * loader.c metadata.c: Revert r59116 to see if it fixes the breakage.
13349
13350         * class.c (mono_class_setup_interface_offsets): New internal function.
13351
13352         * reflection.c (ensure_runtime_vtable): Setup interface offsets for dynamic
13353         interfaces too. Fixes #77398.
13354
13355         * reflection.c (encode_cattr_value): Add support for 
13356         parameter type=object, argument type=array.
13357         (load_cattr_value): Ditto. Fixes #77916.
13358
13359         * marshal.c (emit_object_to_ptr_conv): Add support for ARRAY_BYVALCHARARRAY.
13360         (emit_ptr_to_object_conv): Ditto. Fixes #77960.
13361
13362         * metadata.c (mono_type_to_unmanaged): Use ARRAY_BYVALCHARARRAY when converting
13363         a byval char array and CharSet is Ansi.
13364
13365         * metadata.h: Add new marshalling conversion ARRAY_BYVALCHARARRAY.
13366
13367 2006-04-06  Zoltan Varga  <vargaz@gmail.com>
13368
13369         * metadata.c: Add some locking comments.
13370         
13371         * metadata.c (mono_metadata_signature_alloc): Allocate signatures in the image
13372         mempool.
13373         (mono_metadata_free_method_signature): Don't free the signature itself.
13374
13375         * loader.c (mono_free_method): Don't free the signature in non-dynamic methods. 
13376
13377         * assembly.c (mono_assembly_open_full): Avoid the situation where two assemblies
13378         reference the same MonoImage.
13379         (mono_assembly_load_from_full): Add an assert.
13380
13381 2006-04-05  Zoltan Varga  <vargaz@gmail.com>
13382
13383         * image.c (mono_image_close): Don't put the image we are about to free into the
13384         loaded_images_guid_hash.
13385
13386         * marshal.c (mono_mb_emit_ptr): Refactor a common code sequence into this function
13387         to reduce code duplication.
13388
13389         * marshal.c: Register the native functions called by this module as icalls, to
13390         somewhat centralize the creation of MonoMethodSignature's.
13391
13392         * loader.c (mono_method_signature): Add a cache for method signatures.
13393
13394         * metadata.c (mono_metadata_get_param_attrs): New helper function to return
13395         the parameter attributes of a method.
13396         (mono_metadata_parse_method_signature_full): Refactored the computation of
13397         parameter attributes into a separate function. Also avoid one allocation in
13398         most cases.
13399
13400         * assembly.c (mono_assembly_close): Ditto.
13401
13402         * image.c (mono_image_close): Log trace messages with INFO level.
13403
13404         * metadata-internals.h (MonoImage): Add a new 'method_signature' cache.
13405
13406         * image.c reflection.c: Correct reference counting of image modules.
13407         
13408         * metadata.c (mono_metadata_interfaces_from_typedef_full): Allocate the result
13409         of this function from the image mempool.
13410         
13411         (mono_metadata_parse_type_full): Remove the mode != MONO_PARSE_PARAM restriction
13412         to allow more cached types to be used.
13413
13414         * mono-debug.c (mono_debug_add_method): Appled patch from
13415         David S. Miller  <davem@sunset.davemloft.net>: Access 
13416         minfo->lexical_blocks[] entry elements using read32().
13417
13418 2006-04-04  Zoltan Varga  <vargaz@gmail.com>
13419
13420         * loader.c (mono_free_method): No longer free the method header for non-dynamic
13421         methods as it is allocated from the mempool.
13422
13423         * metadata.c (mono_metadata_parse_mh_full): Allocate method headers from the
13424         image mempool.
13425
13426         * metadata-internals.h: Add comments describing the reference counting scheme
13427         used for MonoImage and MonoAssembly.
13428
13429         * image.c assembly.c reflection.c: Rework reference counting of images and 
13430         assemblies so they are freed when the runtime is shut down. Free some 
13431         additional memory structures when an image is unloaded.
13432         
13433 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
13434
13435         * class.c loader.c reflection.c: Allocate more data structures in
13436         the image mempool.
13437
13438 2006-03-31  Miguel de Icaza  <miguel@novell.com>
13439
13440         * icall.c
13441         (ves_icall_System_Environment_InternalSetEnvironmentVariable): Fix
13442         build on pre glib 2.4 systems.
13443
13444 2006-03-31  Zoltan Varga  <vargaz@gmail.com>
13445
13446         * icall.c (ves_icall_System_Environment_InternalSetEnvironmentVariable): New icall.
13447
13448         * icall.c: Fix some warnings.
13449
13450 2006-03-29  Atsushi Enomoto  <atsushi@ximian.com>
13451
13452         * culture-info-table.h : regenerated.
13453
13454 Wed Mar 29 18:24:42 CEST 2006 Paolo Molaro <lupus@ximian.com>
13455
13456         * threads.c, object-internals.h, verify.c: changed the culture caching
13457         code to use a normal MonoArray for storage so the GC can keep track of
13458         them easily. Fixed bits of the cache logic, too and simplified the
13459         code.
13460
13461 Wed Mar 29 17:18:16 CEST 2006 Paolo Molaro <lupus@ximian.com>
13462
13463         * gc-internal.h, null-gc.c, boehm-gc.c, gc.c: enable the finalizer
13464         thread for non-Boehm GCs.
13465
13466 Wed Mar 29 17:10:05 CEST 2006 Paolo Molaro <lupus@ximian.com>
13467
13468         * domain.c, object.c, domain-internals.h: reduce the amount of memory
13469         needed to keep track of the data for static fields.
13470
13471 2006-03-29  Raja R Harinath  <rharinath@novell.com>
13472
13473         Fix #75172
13474         * icall.c (ves_icall_Type_GetMethodsByName): Don't use vtable_size
13475         for interface classes.  Use 'num_methods' instead.
13476         (ves_icall_Type_GetPropertiesByName): Likewise.  Setup vtable
13477         before using '->vtable_size' field.
13478
13479 Wed Mar 29 12:53:28 CEST 2006 Paolo Molaro <lupus@ximian.com>
13480
13481         * domain.c, object.c, domain-internals.h: proxy_vtable_hash
13482         doesn't contain managed pointers, so use a normal hashtable.
13483
13484 Mon Mar 27 11:15:00 CEST 2006 Paolo Molaro <lupus@ximian.com>
13485
13486         * reflection.c, class-internals.h, domain.c: fixed handling of types
13487         used as values for objects in custom attributes (bug #77915):
13488
13489 2006-03-24  Martin Baulig  <martin@ximian.com>
13490
13491         * class.c (mono_class_setup_fields): Added support for generic
13492         instances; fixes #77580.
13493
13494 2006-03-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13495
13496         * assembly.c: publickeytoken is case insensitive. Fixes bug #77898.
13497
13498 2006-03-24  Dick Porter  <dick@ximian.com>
13499
13500         * file-io.c (get_file_attributes): More stat macro breakage.
13501         Fixes bug 77759.
13502
13503 Fri Mar 24 15:26:00 CET 2006 Paolo Molaro <lupus@ximian.com>
13504
13505         * profiler.c: added the file=filename option in the default profiler
13506         to output the profile data to filename.
13507
13508 2006-03-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13509
13510         * icall.c: CodeBase returns '/' instead of '\\' on windows. Fixes
13511         bug #77877.
13512
13513 2006-03-22  Martin Baulig  <martin@ximian.com>
13514
13515         * reflection.c (fieldbuilder_to_mono_class_field): Don't store the
13516         allocated `MonoClassField *' in `fb->handle'.
13517
13518 Tue Mar 21 17:19:37 CET 2006 Paolo Molaro <lupus@ximian.com>
13519
13520         * class.c, image.c, metadata-internals.h: implemented new mechanism to
13521         allocate interface ID to save memory and allow better ID reuse on
13522         appdomain unload. setup_generic_vtable () removal from Martin.
13523
13524 Tue Mar 21 15:54:30 CET 2006 Paolo Molaro <lupus@ximian.com>
13525
13526         * object.h, appdomain.c, domain.c, exception.c, icall.c,
13527         locales.c, marshal.c, object.c, reflection.c, threadpool.c,
13528         threads.c: introduced MONO_OBJECT_SETREF() macro to be able to insert
13529         write barriers for reference stores with managed objects accessed with
13530         C structures in the runtime and in embedding programs.
13531
13532 2006-03-20  Raja R Harinath  <rharinath@novell.com>
13533
13534         * icall.c (ves_icall_Type_GetInterfaces): Avoid using
13535         'interface_id' and 'max_interface_id' fields of MonoClasses
13536         representing open generic types.
13537
13538 Fri Mar 17 18:06:06 CET 2006 Paolo Molaro <lupus@ximian.com>
13539
13540         * object.h, object.c, icall.c: added functions to deal with
13541         storing valuetypes that contain references in managed objects.
13542         * reflection.c, string-icalls.c, threads.c, marshal.c: small
13543         fixes and comments around uses of mono_array_addr ().
13544
13545 Thu Mar 16 17:16:45 CET 2006 Paolo Molaro <lupus@ximian.com>
13546
13547         * object.h, icall.c, monitor.c: object.GetHashCode ()
13548         implementation that supports the moving garbage collector.
13549
13550 Wed Mar 15 16:31:38 CET 2006 Paolo Molaro <lupus@ximian.com>
13551
13552         * icall.c, threads-types.h, threads.c: implemented finalizer for
13553         LocalDataStoreSlot.
13554
13555 2006-03-15  Zoltan Varga  <vargaz@gmail.com>
13556
13557         * metadata.c (mono_type_size): Add a fixme.
13558         (mono_type_stack_size): Ditto.
13559
13560         * object-internals.h (MonoReflectionAssemblyBuilder): Added 
13561         'type_forwarders' field.
13562
13563         * tabledefs.h (TYPE_ATTRIBUTE_FORWARDER): Added new (undocumented) type
13564         attribute from net 2.0.
13565
13566         * object.c (mono_vtable_get_static_field_data): Moved this to object.c
13567         from class.c.
13568
13569         * class.c (mono_class_setup_fields): Fix a warning.
13570         
13571         * class.c (mono_class_from_name): Add support for assemblyref entries
13572         in the EXPORTEDTYPE table.
13573
13574         * reflection.c: Add support for handling type forwarders under net 2.0.
13575
13576         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.       
13577         
13578 2006-03-14  Zoltan Varga  <vargaz@gmail.com>
13579
13580         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Avoid
13581         overwriting entries in ModuleBuild->types, also clean up the code
13582         a little. Fixes #77774.
13583
13584 Tue Mar 14 20:21:18 CET 2006 Paolo Molaro <lupus@ximian.com>
13585
13586         * domain.c, assembly.c, metadata-internals.h, class-internals.h:
13587         load friend assembly info when present.
13588
13589 2006-03-14  Raja R Harinath  <rharinath@novell.com>
13590
13591         Fix crasher on gtest-158.cs.
13592         * metadata.c (mono_metadata_parse_type_full): Avoid canonicalizing
13593         the return value if the MonoClass we want is yet in an
13594         inconsistent state.
13595         * class.c (mono_class_create_from_typedef): Add an comment
13596         explaining an order dependency between mono_class_setup_parent and
13597         mono_class_setup_mono_type.
13598
13599 Mon Mar 13 21:13:27 CET 2006 Paolo Molaro <lupus@ximian.com>
13600
13601         * class.c: documentation updates and events bug fix.
13602
13603 Mon Mar 13 17:28:07 CET 2006 Paolo Molaro <lupus@ximian.com>
13604
13605         * class.c: some cleanup, locking fixes.
13606
13607 Mon Mar 13 10:46:17 CET 2006 Paolo Molaro <lupus@ximian.com>
13608
13609         * class.c: fix the generics code to setup nested
13610         type info to the instantiated type (bug #77770).
13611
13612 Sun Mar 12 16:21:31 CET 2006 Paolo Molaro <lupus@ximian.com>
13613
13614         * marshal.c: fixed a few type correctness issues.
13615
13616 Sat Mar 11 20:14:44 CET 2006 Paolo Molaro <lupus@ximian.com>
13617
13618         * loader.c: the Set/Get/Addrtess array methods should be public.
13619
13620 2006-03-11  Zoltan Varga  <vargaz@gmail.com>
13621
13622         * icall.c (mono_register_jit_icall_wrapper): Fix a warning.
13623         
13624         * icall.c (mono_register_jit_icall_wrapper): Register the argument, not
13625         info->wrapper.
13626
13627 2006-03-10  Zoltan Varga  <vargaz@gmail.com>
13628
13629         * icall.c (mono_register_jit_icall): Allocate the structure using g_new0.
13630
13631         * class-internals.h (MonoJitICallInfo): Add 'trampoline' field used by the JIT.
13632
13633         * mempool.c (mono_mempool_alloc): Speed this up a bit.
13634         (mono_mempool_alloc0): Ditto.
13635
13636 2006-03-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13637
13638         * socket-io.c:
13639         (create_object_from_sockaddr): it was allocating 4 extra bytes
13640         for the AF_UNIX data. Fixes bug #77747.
13641
13642 2006-03-09  Zoltan Varga  <vargaz@gmail.com>
13643
13644         * icall.c (ves_icall_System_MonoMethodInfo_get_retval_marshal): New icall.
13645
13646 2006-03-09  Dick Porter  <dick@ximian.com>
13647
13648         * file-io.c (get_file_attributes): Use S_ISLNK not "& S_IFLNK".
13649         Fixes bug 76966 again.
13650
13651 2006-03-07  Peter Dennis Bartok  <pbartok@novell.com>
13652
13653         * verify.c (dtfinfo_fields): Updated to match new (serializable) field
13654         names from r57532
13655         * appdomain.c: Bumped corlib version to 48 (due to r57532)
13656
13657 2006-03-07  Martin Baulig  <martin@ximian.com>
13658
13659         * object.c
13660         (mono_field_get_value_object): Add support for MONO_TYPE_GENERICINST.
13661
13662 2006-03-07  Martin Baulig  <martin@ximian.com>
13663
13664         * class.c
13665         (mono_class_get_full): Don't inflate TYPEDEF entries; fixes the
13666         regression introduced in r56970; see gtest-252.cs.
13667
13668         * loader.c (mono_get_method_constrained): Correctly handle generic
13669         methods; see gtest-253.cs.
13670
13671 2006-03-04  Zoltan Varga  <vargaz@gmail.com>
13672
13673         * icall.c (ves_icall_type_Equals): Handle NULLs. Fixes #77700.
13674
13675 2006-03-04  Martin Baulig  <martin@ximian.com>
13676
13677         * icall.c (ves_icall_MonoGenericClass_GetParentType): Dynamically
13678         compute the parent type at runtime, just like we're already doing
13679         it for interfaces.
13680
13681         * reflection.c
13682         (mono_reflection_bind_generic_parameters): Don't compute the
13683         parent type anymore.
13684
13685         * class-internals.h (MonoDynamicGenericClass): Removed `parent'.
13686
13687 2006-03-04  Martin Baulig  <martin@ximian.com>
13688
13689         * mono-debug-debugger.h
13690         (mono_debugger_create_notification_function): Allocate memory at
13691         runtime and return a pointer to it.
13692
13693 2006-03-03  Zoltan Varga  <vargaz@gmail.com>
13694
13695         * assembly.c: Fix windows build.
13696         
13697         * assembly.c: Fix build.
13698
13699         * assembly.c: Move the contents of os/{unix,win32}/util.c to this file. 
13700
13701         * gc_wrapper.h: Move the contents of os/gc_wrapper.h to this file.
13702         
13703 2006-03-03  Dick Porter  <dick@ximian.com>
13704
13705         * process.c
13706         (ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal):
13707         Check parameters before dereferencing them.  Fixes Aaron's part of
13708         bug 77393.
13709
13710 2006-03-03  Raja R Harinath  <rharinath@novell.com>
13711
13712         Fix performance regression.
13713         * loader.c (find_method_in_class): Add 'from_class' argument.
13714         Rename 'klass' argument to 'in_class'.  The signature is compared
13715         against the method in 'in_class', and the corresponding method is
13716         returned from 'from_class'.
13717         (find_method): Walk both 'in_class' and 'from_class' in parallel.
13718         (method_from_memberref) [PARENT_TYPESPEC]: Use it to walk the
13719         type definition and generic instantiation in parallel.
13720         (mono_get_method_constrained): Update to changes.
13721
13722 Thu Mar 2 12:27:41 CET 2006 Paolo Molaro <lupus@ximian.com>
13723
13724         * threads.c: make sure the domain is correct, too when doing
13725         mono_thread_attach ().
13726
13727 2006-03-01  Zoltan Varga  <vargaz@gmail.com>
13728
13729         * class.c (mono_class_create_from_typedef): Mark classes using CharSet.Auto as unicode on
13730         windows. Fixes #77683.
13731
13732 Wed Mar 1 20:09:25 CET 2006 Paolo Molaro <lupus@ximian.com>
13733
13734         * object.h, *: introduced specific way to set elements of an array
13735         of references to be used as write barrier. Still need to audit the
13736         uses of mono_array_addr.
13737
13738 2006-03-01  Miguel de Icaza  <miguel@novell.com>
13739
13740         * object-internals.h: New field to cache the assmebly name, patch
13741         from Tambet Ingo (tambet@ximian.com)
13742
13743 Wed Mar 1 19:13:30 CET 2006 Paolo Molaro <lupus@ximian.com>
13744
13745         * decimal.h, class-internals.h, metadata-internals.h,
13746         file-io.h: mark a few function declarations as internal, to
13747         reduce the number of PLT entries.
13748
13749 2006-02-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13750
13751         * file-io.c: fix typo in warning message.
13752
13753 Tue Feb 28 17:43:20 CET 2006 Paolo Molaro <lupus@ximian.com>
13754
13755         * loader.c: on unix, lookup the "*A" version of a function
13756         if charset is auto as a second option before failing.
13757
13758 2006-02-28  Raja R Harinath  <rharinath@novell.com>
13759
13760         * class.h (mono_class_inflate_generic_method): Revert to two
13761         argument version.
13762         * class-internals.h (MonoMethodInflated): Remove 'inflated' field.
13763         (mono_class_inflate_generic_method_full): Add.
13764         * class.c (mono_class_inflate_generic_method_full): Rename from
13765         'mono_class_inflate_generic_method'.  Don't set 'inflated' field.
13766         (mono_class_inflate_generic_method): New.  Wrapper around ..._full.
13767         * loader.c, reflection.c: Update to changes.
13768
13769 Sat Feb 25 17:57:21 CET 2006 Paolo Molaro <lupus@ximian.com>
13770
13771         * icall.c: const fixes and small improvements.
13772
13773 2006-02-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13774
13775         * threadpool.c: for asynchronous connect(), enable the same workaround
13776         for BSD 6 as for the Mac. Fixes bug #77637.
13777
13778 2006-02-24  Zoltan Varga  <vargaz@gmail.com>
13779
13780         * marshal.c (mono_marshal_free_asany): Fix handling of blittable
13781         formatted classes. Fixes #77524.
13782
13783 2006-02-24  Raja R Harinath  <rharinath@novell.com>
13784
13785         * class.c (inflate_generic_type): Add a couple more
13786         micro-optimizations.
13787         (inflate_generic_context): Don't use the 'gmethod' from
13788         'inflate_with'.
13789         (mono_class_inflate_generic_method): If the method has generic
13790         parameters, but the passed-in context doesn't have a 'gmethod',
13791         create one.  Use the possibly simplified generic instantiation
13792         from the declaring class instead of the one passed in.
13793
13794 2006-02-24  Raja R Harinath  <harinath@gmail.com>
13795
13796         Make generic method signature and method header handling lazy.
13797         * class.c (mono_class_inflate_generic_signature): Move to loader.c.
13798         (inflate_generic_header): Likewise.
13799         (mono_class_inflate_generic_method): Rewrite.  Add a 'klass_hint'
13800         parameter to avoid inflating types.
13801         (mono_get_inflated_method): Empty out.
13802         * class.h (mono_class_inflate_generic_method): Update to changes.
13803         * loader.c (mono_get_method_from_token): Don't parse signature for
13804         generic methods, nor methods of generic classes.
13805         (mono_method_signature): Rename from 'mono_method_signature'.
13806         Inflate signature on demand.
13807         (mono_method_get_header): Inflate method header on demand.
13808         * reflection.c: Update to changes.
13809
13810 2006-02-23  Raja R Harinath  <rharinath@novell.com>
13811
13812         * metadata.c (mono_metadata_inflate_generic_inst): If the
13813         instantiation is closed, don't bother expanding it in the new
13814         context.
13815         * class.c (inflate_generic_class): If the generic instantiation
13816         doesn't change after inflation, return the argument itself.
13817         (inflate_generic_type) [MONO_TYPE_MVAR, MONO_TYPE_VAR]:
13818         Add bounds checks.
13819         (inflate_generic_context): If neither the generic class nor the
13820         generic method instantiations change, return the original context.
13821         * reflection.c (mono_method_get_object): Do
13822         'mono_get_inflated_method' before accessing the ->klass field.
13823         (inflate_mono_method): Don't create a MonoGenericMethod unless
13824         necessary.
13825         (inflate_method): Don't pass a constructed type as the declaring
13826         type of a methodbuilder.
13827
13828 Thu Feb 23 11:57:54 CET 2006 Paolo Molaro <lupus@ximian.com>
13829
13830         * object.c: fix memory overwrite.
13831
13832 2006-02-22  Dick Porter  <dick@ximian.com>
13833
13834         * threads.c: Don't use G_GNUC_PRETTY_FUNCTION in debug messages,
13835         it doesn't work any more.
13836         (mono_threads_request_thread_dump): Fix unused variable warnings.
13837
13838 Wed Feb 22 15:08:44 CET 2006 Paolo Molaro <lupus@ximian.com>
13839
13840         * metadata.h, metadata-internals.h, monodiet.c, debug-helpers.c,
13841         mono-debug.c, profiler.c: cleanup: move MonoMethodHeader out of
13842         the public header file.
13843
13844 2006-02-21  Zoltan Varga  <vargaz@gmail.com>
13845
13846         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): Fix writing past memory. Fixes #77613.
13847
13848 Tue Feb 21 19:55:11 CET 2006 Paolo Molaro <lupus@ximian.com>
13849
13850         * class-internals.h, object.c: reduce the size of MonoVTable
13851         and store the interface_offsets array at negative offsets.
13852
13853 Tue Feb 21 19:53:26 CET 2006 Paolo Molaro <lupus@ximian.com>
13854
13855         * metadata.c: tweak table descriptors data structures to reduce
13856         size and runtime relocations.
13857
13858 Tue Feb 21 14:52:13 CET 2006 Paolo Molaro <lupus@ximian.com>
13859
13860         * marshal.c: fix some types and opcodes to be type-safe
13861         in marshaling wrappers.
13862
13863 2006-02-21  Ankit Jain  <jankit@novell.com>
13864
13865         * metadata.h (mono_metadata_decode_signed_value): Add declaration.
13866
13867 2006-02-21  Raja R Harinath  <rharinath@novell.com>
13868
13869         * metadata.c (get_constraints): Relax debugging checks for monodis.
13870
13871 2006-02-21  Ankit Jain  <jankit@novell.com>
13872
13873         * metadata.c (mono_metadata_load_generic_params): Move the code
13874         checking for ambiguous generic params from here to mono/dis/get.c
13875         * metadata-internals.h (mono_generic_params_with_ambiguous_names): Remove.
13876
13877 2006-02-21  Raja R Harinath  <harinath@gmail.com>
13878
13879         Fix assertion triggered when compiling nemerle.
13880         * class.c (mono_get_shared_generic_inst): Rename from
13881         get_shared_inst and make non-static.
13882         * loader.c (mono_get_shared_generic_method): New.  Used to create
13883         the MonoGenericContext-equivalent of a MonoGenericContainer.
13884         (mono_get_method_from_token): Initialize the 'context' field of
13885         the created MonoGenericContainer.
13886         * reflection.c (reflection_methodbuilder_to_mono_method): Likewise.
13887         * metadata.c (get_constraints): Add sanity check.
13888         * class-internals.h: Add new internal methods.
13889
13890         * reflection.c (verify_safe_for_managed_space): New sanity check.
13891         Currently checks that owner-less generic parameters aren't allowed
13892         in managed space.
13893         (mono_type_get_object): Use it.
13894         * icall.c (ves_icall_MonoType_GetGenericArguments): Remove checks
13895         that are now in mono_type_get_object.
13896         (ves_icall_MonoMethod_GetGenericArguments): Likewise.
13897
13898 2006-02-19  Raja R Harinath  <harinath@gmail.com>
13899
13900         * metadata.c (mono_type_create_from_typespec): Rename from
13901         mono_type_create_from_typespec_full.  Remove MonoGenericContainer*
13902         argument and caching of types in the generic container.
13903         (unwrap_arrays, find_generic_param): Remove.
13904         * metadata-internals.h: Update.
13905         * class-internals.h (_MonoGenericContainer): Remove 'types' field.
13906
13907 2006-02-18  Zoltan Varga  <vargaz@gmail.com>
13908
13909         * class.c (mono_class_get_exception_for_failure): Fix a warning.
13910
13911         * marshal.c (mono_marshal_emit_native_wrapper): Handle FNPTR args and
13912         return values. Fixes #77581.
13913
13914         * class.c (mono_fnptr_class_get): Switch name and name_space.
13915
13916         * marshal.c (mono_marshal_asany): Fix marshalling of blittable formatted
13917         classes and add support for [In, Out] attributes.
13918         (mono_marshal_free_asany): Ditto. Fixes #77524.
13919
13920 2006-02-18  Raja R Harinath  <harinath@gmail.com>
13921
13922         * class.c (mono_class_from_generic_parameter): Make more robust to
13923         incomplete MonoGenericContainers from monodis.
13924
13925 Fri Feb 17 16:10:34 CET 2006 Paolo Molaro <lupus@ximian.com>
13926
13927         * class-internals.h: added some more exception types.
13928         * class.c, metadata.c: added a few checks to handle missing
13929         types.
13930
13931 2006-02-17  Raja R Harinath  <rharinath@novell.com>
13932
13933         Use owner-less generic-params some more.
13934         * class.c (my_mono_class_from_generic_parameter): Remove.
13935         (mono_class_from_generic_parameter): Handle null image,
13936         param->name and param->owner.
13937         (mono_class_from_mono_type): Update.
13938         (mono_class_create_from_typespec): Remove 'container' parameter.
13939         If that parameter is non-null, the result is always inflated by
13940         'mono_class_get_full' anyway.
13941         (mono_class_get): Rename from _mono_class_get.  Remove 'container'
13942         parameter.
13943         (mono_class_get_full): Update.
13944
13945         * class.c (inflate_generic_type) [GENERICINST]: If the generic
13946         instance is not open, don't bother inflating.
13947         (mono_class_setup_fields): Hoist some loop-invariants.  Don't
13948         parse metadata for inflated classes.
13949         (_mono_class_get): Change GenericContext* parameter to
13950         GenericContainer*.
13951         (mono_class_create_from_typespec): Likewise.  Simplify, and
13952         implement trivially.  All the cases are handled in
13953         mono_class_from_mono_type.  Don't inflate returned class.
13954         (mono_class_get_full): Delegate GENERICINST optimization to
13955         inflate_generic_type.
13956         (mono_ldtoken) [TOKEN_TYPE_SPEC]: Use mono_class_get_full() here too.
13957
13958 2006-02-16  Dick Porter  <dick@ximian.com>
13959
13960         * socket-io.c (create_object_from_sockaddr): Fix typo.
13961         (create_sockaddr_from_object): Check array lengths before
13962         potentially accessing items off the end.
13963         (ves_icall_System_Net_Sockets_Socket_Receive_internal)
13964         (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal)
13965         (ves_icall_System_Net_Sockets_Socket_Send_internal)
13966         (ves_icall_System_Net_Sockets_Socket_SendTo_internal): Fix buffer
13967         length checks to avoid wraparound overflows.
13968         (ves_icall_System_Net_Sockets_Socket_Select_internal): Check the
13969         contents of the array of sockets
13970         (hostent_to_IPHostEntry2)
13971         (addrinfo_to_IPHostEntry): IPv6 printed addresses can be 48 bytes.
13972         Check return value of inet_ntop ().
13973         (addrinfo_to_IPHostEntry): Fix typo
13974
13975 2006-02-16  Raja R Harinath  <rharinath@novell.com>
13976
13977         Type metadata parsing doesn't use generic-instantiation information.
13978         * metadata.c (mono_metadata_parse_array_full): Change
13979         MonoGenericContext* parameter to MonoGenericContainer*.
13980         (mono_metadata_parse_type_full): Likewise.
13981         (mono_type_create_from_typespec_full): Likewise.
13982         (mono_metadata_parse_mh_full): Likewise.
13983         (mono_metadata_parse_generic_inst): Likewise.
13984         (do_mono_metadata_parse_generic_class): Likewise.
13985         (do_mono_metadata_parse_type): Likewise.
13986         * metadata-internals.h: Update to changes.
13987         * class.c (mono_class_find_enum_basetype): Likewise.
13988         (mono_class_setup_fields): Likewise.
13989         (mono_class_create_from_typespec): Likewise.
13990         * loader.c (method_from_methodspec): Likewise.
13991         (mono_get_method_from_token): Likewise.
13992         (mono_method_get_header): Likewise.
13993
13994 Thu Feb 16 15:42:13 CET 2006 Paolo Molaro <lupus@ximian.com>
13995
13996         * marshal.c: handle additional GENERICINST case (patch from
13997         Thong Nguyen <tum@veridicus.com>).
13998         Fix a few cases where LDIND_I/STIND_I was used for references.
13999
14000 2006-02-16  Raja R Harinath  <rharinath@novell.com>
14001
14002         * reflection.c (mono_reflection_get_token): Remove unused variable.
14003
14004 2006-02-16  Martin Baulig  <martin@ximian.com>
14005
14006         * reflection.c (mono_reflection_get_token): Add support for fields
14007         in instantiated generic types.
14008
14009         * icall.c
14010         (ves_icall_MonoField_Mono_GetGenericFieldDefinition): Removed.
14011
14012 2006-02-15  Martin Baulig  <martin@ximian.com>
14013
14014         * icall.c
14015         (ves_icall_MonoMethod_get_HasGenericParameters): Removed.
14016         (ves_icall_MonoMethod_get_Mono_IsInflatedMethod): Removed.
14017         (ves_icall_MonoMethod_get_IsGenericMethod): New icall.
14018         (ves_icall_MonoMethod_get_IsGenericMethodDefinition): New icall.
14019
14020 Wed Feb 15 16:19:24 CET 2006 Paolo Molaro <lupus@ximian.com>
14021
14022         * class.c, metadata.c, metadata.h, object.c, icall.c,
14023         marshal.c: changed mono_type_get_underlying_type () to do
14024         the sensible thing and introduced mono_type_generic_inst_is_valuetype().
14025         Fixed handling of instantiated generic valuetypes (bug #75479).
14026
14027 2006-02-15  Raja R Harinath  <rharinath@novell.com>
14028
14029         * metadata.c (mono_metadata_decode_signed_value): Simplify.
14030         Delegate to mono_metadata_decode_value, and work on the returned value.
14031
14032         * icall.c (ves_icall_MonoType_GetGenericArguments):
14033         Add consistency check here too.
14034         
14035 2006-02-15  Ankit Jain  <jankit@novell.com>
14036
14037         * metadata.c (mono_metadata_decode_signed_value): Use gint* instead of
14038         char/short etc.
14039
14040 2006-02-15  Ankit Jain  <jankit@novell.com>
14041
14042         * metadata.c (mono_metadata_decode_signed_value): New function to decode
14043         signed values, used only for representing lower bounds of arrays.
14044         (mono_metadata_parse_array_full): Use new
14045         mono_metadata_decode_signed_value to decode lower bounds.
14046
14047 2006-02-14  Martin Baulig  <martin@ximian.com>
14048
14049         * reflection.c
14050         (mono_reflection_get_token): Support "MonoGenericMethod" and
14051         "MonoGenericCMethod" and allow generic instances / methods.
14052
14053 2006-02-11  Zoltan Varga  <vargaz@gmail.com>
14054
14055         * console-io.c (ves_icall_System_ConsoleDriver_GetTtySize): New icall
14056         to obtain the terminal size using an ioctl.
14057
14058         * object.c (mono_nullable_init): Revert this as nullable reference
14059         types are not valid.
14060         (mono_nullable_box): Ditto.
14061
14062 2006-02-09  Dick Porter  <dick@ximian.com>
14063
14064         * threads.c (mono_thread_detach): Drop a reference to the thread
14065         we're detaching.
14066
14067 2006-02-09  Zoltan Varga  <vargaz@gmail.com>
14068
14069         * object.c (mono_nullable_init): Handle nullable reference types.
14070         (mono_nullable_box): Ditto. Fixes #77446.
14071
14072 2006-02-07  Martin Baulig  <martin@ximian.com>
14073
14074         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition): Removed.
14075
14076 2006-02-07  Ankit Jain  <jankit@novell.com>
14077
14078         * socket-io.h (MonoSocketFlags): New. Copy of System.Net.Sockets.SocketFlags
14079         * socket-io.c (convert_socketflags): New. Convert SocketFlags to native ones.
14080         (ves_icall_System_Net_Sockets_Socket_Receive_internal): Convert flags using convert_socketflags.
14081         (ves_icall_System_Net_Sockets_Socket_ReceiveFrom_internal): Likewise.
14082         (ves_icall_System_Net_Sockets_Socket_Send_internal): Likewise.
14083         (ves_icall_System_Net_Sockets_Socket_SendTo_internal): Likewise.
14084
14085 2006-02-02  Zoltan Varga  <vargaz@gmail.com>
14086
14087         * class.c (mono_class_create_generic): Set type_token as well.
14088
14089         * object.c (mono_runtime_invoke_array): Fix handling of byref vtypes to be
14090         compatible with MS.
14091
14092 2006-02-02  Martin Baulig  <martin@ximian.com>
14093
14094         * threads.c, gc.c: Removed the `WITH_INCLUDED_LIBGC' section; it
14095         has never been used so far.
14096
14097 2006-02-02  Martin Baulig  <martin@ximian.com>
14098
14099         * mono-debug-debugger.h: Changed comment at the top of this file;
14100         the header is not installed, but it's safe to #include it from
14101         within the JIT.
14102
14103         * mono-debug.c: Don't #define _IN_THE_MONO_DEBUGGER.
14104         * mono-debug-debugger.c, debug-mono-symfile.c: Likewise.
14105
14106 2006-02-02  Martin Baulig  <martin@ximian.com>
14107
14108         * mono-debug.h
14109         (MonoSymbolTable): Removed the `metadata_info' field.
14110
14111         * mono-debug.c
14112         (mono_debug_init_1): Always set `mono_symbol_table->corlib'.
14113
14114         * mono-debug-debugger.h (MonoDebuggerIOLayer): Removed.
14115         (mono_debugger_add_builtin_types): Removed.
14116         (MonoDebuggerInfo): Moved into ../mini/debug-debugger.h.
14117         (mono_debugger_create_notification_function): We now operate on a
14118         pre-allocated area; take a `gpointer' and return `void'.
14119
14120         * mono-debug-debugger.c
14121         (MonoDebuggerMetadataInfo): Moved into ../mini/debug-debugger.h.
14122         (mono_debugger_add_builtin_types): Removed.
14123
14124 2006-02-02  Martin Baulig  <martin@ximian.com>
14125
14126         * threads.c (mono_debugger_create_all_threads): New public method.
14127
14128 Wed Feb 1 18:22:34 CET 2006 Paolo Molaro <lupus@ximian.com>
14129
14130         * gc-internal.h, boehm-gc.c, null-gc.c: back out the patch, since it
14131         breaks on several platforms.
14132
14133 2006-02-01  Sebastien Pouliot  <sebastien@ximian.com>
14134
14135         * assembly.c: the VS.NET build doesn't supply default values for
14136         MONO_ASSEMBLIES and MONO_CFG_DIR.
14137
14138 2006-02-01  Zoltan Varga  <vargaz@gmail.com>
14139
14140         * gc-internal.h boehm-gc.c null-gc.c (mono_gc_unregister_thread): New
14141         helper function.
14142
14143         * threads.c (mono_thread_detach): Call mono_gc_unregister_thread ().
14144
14145         * loader.c (method_from_memberref): Fix a warning.
14146
14147         * metadata.c (mono_metadata_load_generic_params): Fix a warning.
14148
14149         * marshal.c (emit_struct_conv): Fix marshalling of embedded structs
14150         with explicit layout. Fixes #77433.
14151
14152 2006-01-31  Zoltan Varga  <vargaz@gmail.com>
14153
14154         * icall.c (ves_icall_Type_GetInterfaceMapData): Make sure 
14155         max_interface_id is initialized before using it. Fixes #77398.
14156         (ves_icall_Type_GetInterfaces): Ditto.
14157
14158 2006-01-30  Raja R Harinath  <rharinath@novell.com>
14159
14160         * metadata.c (mono_metadata_parse_method_signature_full): Don't
14161         allocate memory for parameter attributes when parsing memberref
14162         signatures.
14163         * loader.c (mono_loader_set_error_method_load): Don't warn.
14164         (method_from_memberref): Ensure MissingMethodException gets thrown
14165         if method is not found.  Make warning more informative.
14166
14167 2006-01-29  Raja R Harinath  <harinath@gmail.com>
14168
14169         Fix #77397
14170         * icall.c (ves_icall_MonoType_get_IsGenericParameter): Don't
14171         return true if is byref.
14172         (ves_icall_TypeBuilder_get_IsGenericParameter): Likewise.
14173         (ves_icall_MonoType_get_DeclaringType): Return NULL on byref classes.
14174         (ves_icall_MonoType_get_DeclaringMethod): Likewise.
14175
14176 2006-01-27  Raja R Harinath  <rharinath@novell.com>
14177
14178         Fix tests/find-method.2.il
14179         * loader.c (find_method, find_method_in_class): Remove is_inflated
14180         argument.  Revert 2006-01-18 change.
14181         (method_from_memberref) [MONO_MEMBERREF_PARENT_TYPESPEC]: If type
14182         is generic, search for method in its generic definition.
14183         * class.c (mono_class_setup_vtable_general): Print generic
14184         arguments of generic types in debugging printf.
14185
14186 2006-01-26  Zoltan Varga  <vargaz@gmail.com>
14187
14188         * object-internals.h (MonoThread): Add 'thread_dump_requested' field.
14189
14190         * threads.c (mono_threads_request_thread_dump): New helper function.
14191
14192 2006-01-25  Raja R Harinath  <rharinath@novell.com>
14193
14194         * metadata.c (mono_type_create_from_typespec_full): Fix caching of types.
14195
14196 2006-01-25  Ankit Jain  <jankit@novell.com>
14197
14198         * metadata-internals.h (mono_generic_params_with_ambiguous_names): Add declaration and
14199         move definition to ..
14200         * metadata.c (mono_generic_params_with_ambiguous_names): .. here.
14201         
14202 2006-01-25  Ankit Jain  <jankit@novell.com>
14203             Raja R Harinath  <rharinath@novell.com>
14204
14205         * metadata-internals.h (mono_generic_params_with_ambiguous_names): New.
14206         * metadata.c (mono_metadata_load_generic_params): Fill mono_generic_params_with_ambiguous_names
14207         as necessary.
14208
14209 2006-01-25  Martin Baulig  <martin@ximian.com>
14210
14211         * mono-debug-debugger.h: Moved `MonoDebuggerManager' and
14212         `MonoDebuggerThread' into debug-debugger.c.
14213
14214 Tue Jan 24 18:53:35 CET 2006 Paolo Molaro <lupus@ximian.com>
14215
14216         * profiler.c: fix printing of data.
14217
14218 2006-01-24  Atsushi Enomoto  <atsushi@ximian.com>
14219
14220         * object.c, marshal.c : Fixed runtime part of bug #77315. Reject
14221           invalid surrogate in UTF7/UTF8 bytes and don't return NULL.
14222
14223 Tue Jan 24 09:56:16 CET 2006 Paolo Molaro <lupus@ximian.com>
14224
14225         * object.c: fix deadlock related to string interning.
14226
14227 2006-01-23  Martin Baulig  <martin@ximian.com>
14228
14229         * mono-debug-debugger.h (MonoDebuggerIOLayer): Removed.
14230
14231         * mono-debug-debugger.c (mono_debugger_io_layer): Removed.
14232
14233 2006-01-23  Martin Baulig  <martin@ximian.com>
14234
14235         * mono-debug.h: Moved the prototypes of some functions which are
14236         used by the JIT here from mono-debug-debugger.h.
14237
14238 2006-01-21  Martin Baulig  <martin@ximian.com>
14239
14240         * Makefile.am: Don't install mono-debug-debugger.h.
14241
14242 2006-01-21  Martin Baulig  <martin@ximian.com>
14243
14244         * mono-debug-debugger.h: Enforce the private status of this header
14245         file and removed unneccessary #include's in metadata/*.c and mini/*.c.
14246         Moved some stuff from mono-debugger-jit-wrapper.h here.
14247
14248 2006-01-20  Raja R Harinath  <rharinath@novell.com>
14249
14250         * class.c (mono_class_from_typeref): Add a sanity test to help
14251         catch lack of assembly load/search hooks.
14252
14253 2006-01-19  Zoltan Varga  <vargaz@gmail.com>
14254
14255         * marshal.c (emit_struct_conv): Relax the fields with same offset
14256         check even more. Fixes #77230.
14257
14258 2006-01-18  Martin Baulig  <martin@ximian.com>
14259
14260         * loader.c (find_method_in_class): Added `gboolean is_inflated'
14261         argument; if false, we compare the uninstantiated signatures.
14262         (method_from_memberref): Compare the uninstantiated signatures;
14263         fixes #76417.
14264
14265 2006-01-18  Robert Jordan  <robertj@gmx.net>
14266
14267         * boehm-gc.c, null-gc.c (mono_gc_weak_link_remove):
14268         Clear the weak link. Fixes bug #77170.
14269
14270         * gc.c (mono_gchandle_free):
14271         Reflect *-gc.c changes (tiny optimization).
14272
14273 2006-01-18  Zoltan Varga  <vargaz@gmail.com>
14274
14275         * metadata.c (mono_metadata_signature_dup): Applied patch from
14276         Aras Pranckevicius (aras@otee.dk). Fix crash when compiled with MSVC.
14277         Fixes #77288.
14278
14279 2006-01-17  Zoltan Varga  <vargaz@gmail.com>
14280
14281         * marshal.c (emit_struct_conv): Allow fields with the same offset when
14282         marshalling from native to managed code. Fixes #77230.
14283
14284 2006-01-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14285
14286         * threadpool.c: fix problem (Mac only) when more than one asynchronous
14287         connect. Fixes bug #77020.
14288
14289 Mon Jan 16 19:20:43 CET 2006 Paolo Molaro <lupus@ximian.com>
14290
14291         * class.c: fixed id assignement for nested interfaces (bug #77275).
14292         Added also better info for --print-vtable debugging.
14293
14294 2006-01-12  Martin Baulig  <martin@ximian.com>
14295
14296         * icall.c (ves_icall_MonoGenericClass_GetInterfaces): Inflate the
14297         interfaces on-the-fly; fixes #76625.
14298
14299         * class-internals.h
14300         (MonoDynamicGenericClass): Removed `ifaces' and `count_ifaces'; we
14301         don't need that anymore.
14302
14303 2006-01-12  Miguel de Icaza  <miguel@novell.com>
14304
14305         * socket-io.c
14306         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
14307         To avoid initing the nested_classes when not needed I turned the
14308         PeerCredData as a toplevel internal class, as it has to be shared
14309         anyways. 
14310
14311         Fixes the CASA issue.
14312
14313 2006-01-11  Ben Maurer  <bmaurer@andrew.cmu.edu>
14314
14315         * domain.c: Accessors for MonoJitInfo
14316
14317         * profiler-private.h: Add jitinfo to the end jit hook
14318
14319         * profiler.[ch]: Define new hooks, called after jitting which give
14320         the MonoJitInfo that was compiled
14321
14322 2006-01-10  Martin Baulig  <martin@ximian.com>
14323
14324         * class.c (mono_class_setup_events): Add support for generic
14325         classes; fixes #76440.
14326
14327 2006-01-06  Raja R Harinath  <rharinath@novell.com>
14328
14329         Fix #77160.
14330         * icall.c (ves_icall_InternalInvoke): Use mono_get_inflated_method
14331         on passed-in method.
14332
14333 2006-01-03  Zoltan Varga  <vargaz@gmail.com>
14334
14335         * object.c (mono_runtime_invoke_array): Add Nullable support.
14336
14337         * icall.c (ves_icall_System_Activator_CreateInstanceInternal): Ditto.
14338
14339 2006-01-03  Sebastien Pouliot  <sebastien@ximian.com>
14340
14341         * file-io.c: Don't consider sockets as directory and avoid an endless
14342         loop. Fix bug #76966.
14343
14344 2006-01-03  Zoltan Varga  <vargaz@gmail.com>
14345
14346         * object.c (mono_nullable_init): New helper function.
14347         (mono_nullable_box): Ditto.
14348
14349         * marshal.c (mono_marshal_get_runtime_invoke): Handle Nullables.
14350
14351         * icall.c (ves_icall_FieldInfo_SetValueInternal): Handle Nullables.
14352
14353         * icall.c (ves_icall_MonoField_GetValueInternal): Handle Nullables.
14354         
14355 2006-01-02  Zoltan Varga  <vargaz@gmail.com>
14356
14357         * class.c (mono_class_is_assignable_from): Make T assignable to 
14358         Nullable<T>.
14359
14360 2005-12-23  Sebastien Pouliot  <sebastien@ximian.com>
14361
14362         * appdomain.c: Bump corlib version to 46.
14363         * icalls.c: Renamed CurrentTimeZone to CurrentSystemTimeZone (for
14364         serialization purpose) and changed ves_icall_System_Reflection_
14365         Assembly_get_code_base signature to accept a boolean (to escape, or 
14366         not, the assembly code base).
14367
14368 2005-12-23  Dick Porter  <dick@ximian.com>
14369
14370         * icall.c: 
14371         * threads-types.h: 
14372         * threads.c: Added OpenMutex, OpenSemaphore and OpenEvent icalls.
14373         CreateEvent icall now returns "created" boolean parameter.
14374
14375 2005-12-22  Zoltan Varga  <vargaz@gmail.com>
14376
14377         * marshal.c (mono_mb_emit_restore_result): Add generics support. Fixes
14378         #76967.
14379
14380         * reflection.c (mono_custom_attrs_construct_by_type): Handle the case 
14381         when attr_klass is an interface. Fixes #77045.
14382
14383 2005-12-20  Zoltan Varga  <vargaz@gmail.com>
14384
14385         * marshal.c (emit_struct_conv): Fix previous patch.
14386         
14387         * marshal.c (emit_struct_conv): Add a check for fields with the same
14388         offset.
14389
14390 2005-12-20  Raja R Harinath  <rharinath@novell.com>
14391
14392         Fix regression in Mono.C5.
14393         * class.c (mono_class_create_generic): If 'klass' is an interface
14394         set up the interface offsets.
14395         (mono_class_is_assignable_from): Don't throw away generic arguments.
14396
14397 2005-12-19  Raja R Harinath  <rharinath@novell.com>
14398
14399         * icall.c (ves_icall_System_MonoType_getFullName): Return NULL for
14400         type parameters.
14401
14402 2005-12-15  Raja R Harinath  <rharinath@novell.com>
14403
14404         * metadata.c (mono_metadata_parse_method_signature_full): Remove a
14405         dead store.
14406         (do_mono_metadata_parse_generic_class): Don't pass the current
14407         generic context when parsing the type being instantiated: it
14408         cannot use it, anyway.
14409
14410         * loader.c (method_from_memberref): Don't inflate a signature if
14411         it doesn't contain any type parameters.
14412
14413 2005-12-15  Zoltan Varga  <vargaz@gmail.com>
14414
14415         * class.c (mono_class_setup_vtable): Call mono_reflection_get_dynamic_overrides () to get the overrides in dynamic assemblies.
14416
14417 2005-12-14  Martin Baulig  <martin@ximian.com>
14418
14419         * class.c
14420         (mono_type_get_name_recurse): Don't return null for type
14421         parameters and open generic classes.
14422         (mono_class_setup_methods): Don't exclude generic instances.
14423         (mono_get_unique_iid): Use different IDs for different
14424         instantiations of the same generic type.
14425         (mono_class_setup_vtable): Only use setup_generic_vtable() for
14426         open generic instances; create a normal vtable for closed generic
14427         instances.
14428         (mono_class_setup_vtable_general): We're now also called for
14429         closed generic instances.
14430
14431         * reflection.c
14432         (mono_reflection_bind_generic_parameters): Correctly use
14433         mono_metadata_lookup_generic_inst() everywhere.
14434
14435 2005-12-14  Zoltan Varga  <vargaz@gmail.com>
14436
14437         * object.c (mono_class_create_runtime_vtable): Call 
14438         mono_class_setup_vtable ().
14439
14440         * reflection.c (mono_reflection_get_dynamic_overrides): New helper
14441         function.
14442         (ensure_runtime_vtable): Initialize the generic vtable lazily. Fixes
14443         #76959.
14444
14445         * loader.c (mono_loader_set_error_type_load): Print the type load
14446         warnings to the console so they are more visible to the user.
14447         (mono_loader_set_error_method_load): Ditto.
14448
14449         * reflection.c (ensure_runtime_vtable): Revert the last change as it
14450         is still broken.
14451         
14452         * reflection.c (ensure_runtime_vtable): Fix build.
14453
14454         * reflection.c (ensure_runtime_vtable): Disable an optimization which
14455         doesn't work in all cases.
14456
14457 2005-12-13  Zoltan Varga  <vargaz@gmail.com>
14458
14459         * object.c (mono_array_new_full): Treat a single dimensional array
14460         with 0 lower bounds as an szarray. Fixes #76973.
14461
14462         * reflection.c (custom_attr_visible): Really fix this.
14463
14464 2005-12-12  Zoltan Varga  <vargaz@gmail.com>
14465
14466         * reflection.c (custom_attr_visible): Allow nested public attributes
14467         as well.
14468
14469         * class.c (mono_class_setup_vtable_general): Add missing != -1 to an
14470         interface check.
14471
14472 2005-12-12  Raja R Harinath  <harinath@gmail.com>
14473
14474         * class.c (set_generic_param_owner): Delete.
14475         (mono_class_create_from_typedef): Don't set ->owner field of
14476         generic parameters to "param containers" of enclosing classes.
14477         * reflection.c (mono_reflection_initialize_generic_parameter):
14478         Likewise.
14479
14480 2005-12-11  Zoltan Varga  <vargaz@gmail.com>
14481
14482         * reflection.c (custom_attr_visible): Fix build.
14483
14484 2005-12-10  Zoltan Varga  <vargaz@gmail.com>
14485
14486         * reflection.c (mono_custom_attrs_from_builders): Avoid returning
14487         private attributes.
14488         
14489         * reflection.c (reflection_methodbuilder_to_mono_method): Fix
14490         handling of null parameter defaults.
14491
14492 2005-12-09  Raja R Harinath  <rharinath@novell.com>
14493
14494         * class.c (mono_class_from_generic_parameter): Don't set
14495         klass->generic_container.
14496         (my_mono_class_from_generic_parameter): Likewise.
14497
14498 2005-12-07  Zoltan Varga  <vargaz@gmail.com>
14499
14500         * reflection.c (load_public_key): Fix a warning.
14501         (method_encode_code): Fix unaligned accesses.
14502
14503 2005-12-07  Martin Baulig  <martin@ximian.com>
14504
14505         * object-internals.h (MonoReflectionGenericParam): Added `cattrs'.
14506
14507         * reflection.c
14508         (write_generic_param_entry): Encode our custom attrs.
14509
14510         * appdomain.c (MONO_CORLIB_VERSION): Bump to 45.
14511
14512 2005-12-07  Martin Baulig  <martin@ximian.com>
14513
14514         * reflection.c (encode_new_constraint): Removed; we don't use the
14515         `NewConstraintAttribute' anymore.
14516
14517 2005-12-06  Zoltan Varga  <vargaz@gmail.com>
14518
14519         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Do
14520         not fire a TypeResolve event when Assembly.GetType () is called.
14521
14522 2005-12-05  Ben Maurer  <bmaurer@ximian.com>
14523
14524         Beginning of support for nullable types in the runtime. Parts of
14525         this patch are from Martin.
14526
14527         * appdomain.c (MONO_CORLIB_VERSION): Bump
14528
14529         * domain.c (mono_init_internal): get the nullable type
14530
14531         * class.c (mono_class_is_nullable): New method
14532         (mono_class_get_nullable_param): New mehod
14533         (mono_class_create_generic): In types T? set cast_class to T
14534
14535         * class-internals.h (MonoDefaults): new nullable default class
14536         (mono_class_get_nullable_param, mono_class_get_nullable_param):
14537         new methods.
14538
14539 2005-12-05  Raja R Harinath  <rharinath@novell.com>
14540
14541         * metadata.c (select_container): New.  Refactor code to select the
14542         appropriate GenericContainer given the type of generic parameter
14543         we are looking for.
14544         (mono_metadata_parse_generic_param): Take a MonoGenericContainer,
14545         not a MonoGenericContext.  Use select_container.  Update parameters.
14546         (do_mono_metadata_parse_type): Combine the code for MONO_TYPE_VAR
14547         and MONO_TYPE_MVAR.
14548         (unwrap_arrays): Remove duplicate tests.
14549         (find_generic_param): Rename from 'has_same_context'.  Now walks a
14550         generic instantiated class to find any arguments that are generic
14551         parameters.
14552         (mono_type_create_from_typespec_full): Use find_generic_param to
14553         avoid evicting some generic instantiations from the typespec
14554         cache.
14555
14556 Mon Dec 5 15:07:42 GMT 2005 Paolo Molaro <lupus@ximian.com>
14557
14558         * reflection.c: fixed writing of doubles on ARM FPA.
14559
14560 2005-12-02  Robert Jordan  <robertj@gmx.net>
14561
14562         * icall.c: Fixed EventInfo.ReflectedType (#76829).
14563
14564 2005-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14565
14566         * filewatcher.c: try loading libgamin-1.so.0 before libfam, since at
14567         least on SUSE 10 they are not the same (on debian, they are just the
14568         same thing).
14569
14570 2005-12-01  Raja R Harinath  <rharinath@novell.com>
14571
14572         * icall.c (ves_icall_MonoType_get_DeclaringType): Implement
14573         DeclaringType for VARs and MVARs.
14574         * class.c (set_generic_param_owner): Fix initialization of owner
14575         fields.
14576
14577 Wed Nov 30 15:48:22 CET 2005 Paolo Molaro <lupus@ximian.com>
14578
14579         * icall.c: fixed Enum.ToObject() to correctly convert the values.
14580
14581 2005-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14582
14583         * threadpool.c: workaround for a bug that shows up on the Mac:
14584         select()+connect() on a blocking socket is not like it should
14585         be, so we proceed to connect() in that case, wasting the I/O
14586         threadpool thread until connect succeedes. Fixes bug #75436.
14587
14588 2005-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14589
14590         * threadpool.c: fix typo when setting file descriptor states.
14591
14592 2005-11-28  Raja R Harinath  <rharinath@novell.com>
14593
14594         * class-internals.h (MonoGenericContainer.is_signature): Remove.        
14595         * metadata.c (mono_metadata_parse_method_signature_full): Don't
14596         create a temporary signature container.
14597         (mono_metadata_parse_generic_param): Update to changes.
14598         (mono_type_create_from_typespec_full): Update to changes.
14599         * loader.c (method_from_memberref): Don't use a
14600         MonoGenericContainer while parsing a memberref signature.
14601         (method_from_methodspec): Remove dead-store of the 'container'
14602         variable.  It's overwritten before use.
14603
14604         * metadata.c (mono_type_create_from_typespec_full): Make debugging
14605         checks tighter.
14606         (mono_metadata_parse_generic_param): Likewise.
14607         * loader.c (find_method_in_class): Does not need a
14608         MonoGenericContainer.  Use 'mono_method_signature' rather than
14609         'mono_method_signature_full'.
14610         (find_method, mono_get_method_constrained, method_from_memberref):
14611         Update to changes.
14612
14613         * metadata.c (mono_type_create_from_typespec_full): Ensure that
14614         owner-less generic-parameters are never evicted from the typespec
14615         cache.
14616
14617         * loader.c (method_from_memberref): Don't use the current context
14618         when parsing signatures.
14619         (method_from_methodspec, mono_get_method_from_token): Update to changes.
14620
14621         * metadata.c (do_mono_metadata_parse_generic_class): Avoid
14622         side-effects in g_assert.
14623         * loader.c (mono_get_method_from_token): Resolve klass earlier so
14624         that we don't potentially lose information.
14625
14626 2005-11-26  Dick Porter  <dick@ximian.com>
14627
14628         * icall.c:
14629         * threads.c: icalls to implement basic (ie, not named)
14630         System.Threading.Semaphore.
14631
14632 2005-11-24  Dick Porter  <dick@ximian.com>
14633
14634         * process.c
14635         (ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal):
14636         Use GetProcessId() if it's available.
14637
14638 2005-11-23  Zoltan Varga  <vargaz@gmail.com>
14639
14640         * icall.c threads-types.h threads.c: Add Exchange<T> icall.
14641
14642 2005-11-23  Raja R Harinath  <rharinath@novell.com>
14643             Ankit Jain  <jankit@novell.com>
14644
14645         * loader.c (mono_get_method_from_token): Initialize 'method' field
14646         of all generic parameters before parsing the signature.  Remove
14647         code that "fixed"-up MVAR references.
14648
14649 2005-11-23  Ankit Jain  <jankit@novell.com>
14650
14651         * metadata.c (mono_metadata_has_generic_params):
14652         (mono_metadata_load_generic_param_constraints):
14653         (mono_metadata_load_generic_params): Move duplicate code ...
14654         (mono_metadata_get_generic_param_row): ... here. Returns the
14655         first row-id in GenericParam table for a given owner (token).
14656         * metadata-internals.h (mono_metadata_get_generic_param_row): Add
14657         prototype.
14658
14659 2005-11-23  Raja R Harinath  <rharinath@novell.com>
14660             Ankit Jain  <jankit@novell.com>
14661
14662         * metadata.c (mono_metadata_class_equal): Pass signature_only when
14663         comparing VARs too.
14664         * icall.c (ves_icall_MonoType_get_DeclaringMethod): Look at 
14665         type->data.generic_param only if the type is an MVAR.
14666         (ves_icall_MonoMethod_GetGenericArguments): Ensure that we don't
14667         leak owner-less VARs and MVARs into managed space.
14668
14669 2005-11-21  Martin Baulig  <martin@ximian.com>
14670
14671         * class-internals.h
14672         (MonoMethod): Moved the `generic_container' here from
14673         `MonoMethodNormal' since we now also need it for
14674         `MonoMethodPInvoke';
14675         (MonoMethodNormal): Moved the `generic_container' to `MonoMethod'.
14676         (MonoMethodInflated): Replaced the `MonoMethodNormal nmethod' with
14677         an union containing both `MonoMethodNormal' and
14678         `MonoMethodPInvoke'.
14679
14680         * loader.c
14681         (mono_get_method_from_token): Allow implementing generic methods
14682         as interncalls.
14683
14684         * threads.c
14685         (ves_icall_System_Threading_Interlocked_CompareExchange_T): New
14686         icall.
14687
14688 2005-11-17  Dick Porter  <dick@ximian.com>
14689
14690         * icall.c: 
14691         * process.h: 
14692         * process.c: Split the Process Start_internal icall into
14693         ShellExecuteEx_internal and CreateProcess_internal, which are
14694         called depending on whether UseShellExecute is true.  Fixes bug
14695         76670.
14696
14697         * appdomain.c (MONO_CORLIB_VERSION): Incremented
14698
14699 2005-11-17  Zoltan Varga  <vargaz@gmail.com>
14700
14701         * marshal.c (emit_ptr_to_object_conv): Get rid of the 'usize' and
14702         'msize' parameters, use the information in 'mspec' instead.
14703         (emit_object_to_ptr_conv): Ditto.
14704
14705         * marshal.c (emit_struct_conv): Handle explicit layout structs with
14706         fields out of order. Fixes #76733.
14707
14708 2005-11-17  Ankit Jain  <jankit@novell.com>
14709
14710         * metadata.c (mono_type_create_from_typespec_full): Remove unnecessary g_assert.
14711
14712 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
14713
14714         * icall.c : renamed MakeGenericMethod -> MakeGenericMethod_impl for
14715           bug #76575.
14716
14717 2005-11-16  Zoltan Varga  <vargaz@gmail.com>
14718
14719         * object.c (mono_class_compute_gc_descriptor): Disable typed allocation
14720         for types with non-auto layout. Fixes #76717.
14721
14722 2005-11-16  Ankit Jain  <jankit@novell.com>
14723
14724         * class.c (my_mono_class_from_generic_parameter): param->owner can be null.
14725         * metadata.c (mono_metadata_parse_generic_param): Create a dummy MonoGenericParam 
14726         if generic_context is null.
14727           (mono_metadata_generic_param_equal): param->owner can be null.
14728           (mono_type_create_from_typespec_full): Don't cache the MonoType if param->owner is
14729         null.
14730
14731 2005-11-16  Zoltan Varga  <vargaz@gmail.com>
14732
14733         * reflection.c (create_dynamic_mono_image): Set md_version_minor to
14734         the correct value.
14735
14736 2005-11-15  Martin Baulig  <martin@ximian.com>
14737
14738         * object.c (set_value): Use mono_class_from_mono_type() instead of
14739         the hack for generic instances; fixes #76136.
14740
14741 2005-11-15  Zoltan Varga  <vargaz@gmail.com>
14742
14743         * metadata-internals.h (_MonoImage): Add 'md_version_major/minor'
14744         fields.
14745
14746         * image.c (load_metadata_ptrs): Initialize the new fields.
14747
14748         * reflection.c (create_dynamic_mono_image): Ditto.
14749
14750         * reflection.c (build_compressed_metadata): Use the new fields.
14751
14752         * icall.c (ves_icall_System_Reflection_Module_get_MDStreamVersion): New
14753         icall.
14754
14755         * icall.c (mono_assembly_icalls): Remove obsolete get_MetadataToken
14756         icall.
14757         
14758 2005-11-15  Ankit Jain  <jankit@novell.com>
14759             Raja R Harinath  <harinath@gmail.com>
14760
14761         * class-internals.h (_MonoGenericContainer.types): New. Cache for MonoTypes.
14762         * metadata.c (mono_type_create_from_typespec_full): Use MonoType from the
14763         new per-generic_container cache if the cached MonoType's context matches
14764         the current context.
14765           (has_same_context): New. Check if the VARs or MVARs in a GENERIC_INST refer
14766         to the expected context.
14767           (unwrap_arrays): New. Get the element MonoType for an ARRAY/SZARRAY.
14768
14769 2005-11-14  Carlos Alberto Cortez <calberto.cortez@gmail.com>
14770
14771         * appdomain.c: Update MONO_CORLIB_VERSION to 42, since
14772         we changed the signature of an icall.
14773         * icall.c: Modify to mono_double_ParseImpl return true/false 
14774         depending on the success, instead of throwing the exception. This will
14775         help us in Double.TryParse methods.
14776         
14777 2005-11-14  Zoltan Varga  <vargaz@gmail.com>
14778
14779         * marshal.c (emit_marshal_object): Throw an exception when
14780         marshalling 'object' instead of crashing. Fixes #76696.
14781
14782 2005-11-11  Zoltan Varga  <vargaz@gmail.com>
14783
14784         * class-internals.h: Add prototype for mono_type_get_full_name ().
14785
14786 2005-11-11  Dick Porter  <dick@ximian.com>
14787
14788         * threads.c (mono_thread_manage): Make sure the main thread has
14789         abandoned all its mutexes when cleaning up.  Fixes bug 74680.
14790
14791 2005-11-11  Zoltan Varga  <vargaz@gmail.com>
14792
14793         * loader.c (mono_loader_set_error_type_load): Log a warning to the
14794         console about the missing type.
14795         (mono_loader_set_error_method_load): Ditto.
14796
14797 2005-11-09  Miguel de Icaza  <miguel@novell.com>
14798
14799         * mono-config.c (mono_get_config_dir): Set the system defaults if
14800         none is specified.
14801
14802         * assembly.c (mono_set_dirs): New API entry point to set the
14803         assembly and the config directory in one call
14804
14805 2005-11-09  Zoltan Varga  <vargaz@gmail.com>
14806
14807         * marshal.c (mono_ftnptr_to_delegate): Throw a NotSupportedException if
14808         the ftnptr was created from a delegate in a domain other than the
14809         current domain. Fixes #75377.
14810
14811         * exception.h exception.c: Add mono_get_exception_not_supported ().
14812
14813 2005-11-08  Martin Baulig  <martin@ximian.com>
14814
14815         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 53.
14816
14817 2005-11-07  Sebastien Pouliot  <sebastien@ximian.com>
14818
14819         * security-manager.h: Added definitions to deal with strongname key 
14820         pairs bigger (and smaller) than 1024 bits.
14821         * reflection.c: Remove hardcoded strongname size (128 bytes) and 
14822         adjust wrt the public key length being used.
14823
14824 2005-11-03  Atsushi Enomoto  <atsushi@ximian.com>
14825
14826         * marshal.c, icall.c : reverted sig->pinvoke changes which broke
14827           Windows build (r51396-51397).
14828
14829 2005-11-03  Martin Baulig  <martin@ximian.com>
14830
14831         * class.c (mono_class_setup_vtable_general): Also add generic
14832         methods to the vtable; fixes #76581.
14833
14834 2005-11-01  Miguel de Icaza  <miguel@novell.com>
14835
14836         * string-icalls.c (ves_icall_System_String_ctor_encoding): Make
14837         sure that we lookup GetString method from the System.Text.Encoding
14838         class, not the derived class or we get an empty method.
14839
14840         Fixed class #76612.
14841
14842 2005-10-25  Miguel de Icaza  <miguel@novell.com>
14843
14844         * assembly.c (mono_assemblies_init): Do not set the Mono root dir
14845         if it has been previously set (embedders). 
14846
14847         Make mono_set_rootdir available also on Unix.
14848
14849 005-10-24  Robert Jordan  <robertj@gmx.net>
14850
14851         * assembly.c: fixed MONO_ASSEMBLIES to be NULL on cygwin as well.
14852
14853 2005-10-30  Zoltan Varga  <vargaz@freemail.hu>
14854
14855         * marshal.c icall.c: Clean up the usage of sig->pinvoke flag. Now
14856         only calls which are made to native code use this flag.
14857
14858         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): Remove the check for FieldBuilders as it is now done in managed code.
14859
14860 2005-10-29  Zoltan Varga  <vargaz@freemail.hu>
14861
14862         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal):
14863         Add support for FieldBuilders.
14864
14865 2005-10-29  Martin Baulig  <martin@ximian.com>
14866
14867         * mono-debug.c
14868         (mono_debug_using_mono_debugger): New public method; returns
14869         whether we're running inside the debugger.
14870
14871 2005-10-27  Zoltan Varga  <vargaz@gmail.com>
14872
14873         * reflection.c (mono_reflection_get_custom_attrs_info): Add support
14874         for Method/Constructor/FieldBuilders.
14875
14876 2005-10-26  Zoltan Varga  <vargaz@gmail.com>
14877
14878         * reflection.c (module_add_cattrs): Save custom attributes for global methods
14879         and fields as well.
14880
14881 2005-10-26  Martin Baulig  <martin@ximian.com>
14882
14883         * mono-debug-debugger.c
14884         (MonoDebuggerMetadataInfo): Added `klass_parent_offset'.
14885
14886 2005-10-24  Raja R Harinath  <harinath@gmail.com>
14887
14888         * icall.c (base64_to_byte_array): Don't pass an out-of-range
14889         integer to isspace.
14890
14891 2005-10-21  Zoltan Varga  <vargaz@gmail.com>
14892
14893         * marshal.c (emit_marshal_vtype): Correctly handle [In,Out] modifiers
14894         when passing valuetypes byref. Fixes #76502.
14895
14896 2005-10-19  Jackson Harper  <jackson@ximian.com>
14897
14898         * profiler.c: Don't put a . in front of types that are not in a
14899         namespace.
14900
14901 2005-10-18  Zoltan Varga  <vargaz@gmail.com>
14902
14903         * icall.c (ves_icall_Type_GetField): Applied patch from Robert Jordan (robertj@gmx.net). Fixes #75515.
14904
14905 2005-10-15  Zoltan Varga  <vargaz@freemail.hu>
14906
14907         * marshal.c: Add generics support to the ldfld/stfld wrappers. Fixes
14908         #76436.
14909         (mono_marshal_get_ldflda_wrapper): Fix a warning.
14910
14911 2005-10-13  Carlos Alberto Cortez <calberto.cortez@gmail.com>
14912
14913         * assembly.c metadata-internals.h icall.c: Define an additional
14914         parameter for mono_assembly_name_parse_full, so we can avoid creating
14915         S.R.AssemblyName.Version when no version info wasn't passed.
14916         
14917 2005-10-09  Miguel de Icaza  <miguel@novell.com>
14918
14919         * class.c (mono_type_get_full_name): Reimplement method that was
14920         removed. 
14921
14922         * image.c: Some docs
14923
14924 2005-10-10  Zoltan Varga  <vargaz@gmail.com>
14925
14926         * profiler.c (output_newobj_profile): Fix printing of Total memory
14927         on x86.
14928
14929 2005-10-08  Zoltan Varga  <vargaz@freemail.hu>
14930
14931         * profiler.c: Add support for allocations > 2GB. Fixes #74886.
14932
14933 2005-10-08  Gert Driesen  <drieseng@users.sourceforge.net>
14934
14935         * threads.c: remove debug output.
14936
14937 2005-10-08  Zoltan Varga  <vargaz@freemail.hu>
14938
14939         * threads.c (mono_thread_manage): Fix crashes if more than 64
14940         threads need to be aborted. Hopefully fixes #75899.
14941
14942         * assembly.c (mono_stringify_assembly_name): New helper function.
14943
14944         * class.c: Use mono_stringify_assembly_name instead of the similar
14945         static function.
14946
14947         * assembly.h assembly.c: Add support for calling a postload search 
14948         hook if an assembly cannot be loaded.
14949
14950         * appdomain.c: Register new search hooks which call the AssemblyResolve
14951         events in AppDomain. Fixes #75231
14952
14953 2005-10-07  Martin Baulig  <martin@ximian.com>
14954
14955         * mono-debug.c (mono_debug_add_method): Create a wrapper entry for
14956         methods without debug info.
14957
14958 2005-10-07  Zoltan Varga  <vargaz@gmail.com>
14959
14960         * class-internals.h debug-helpers.c marshal.h marshal.c: Add ldflda
14961         wrappers.
14962
14963 2005-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14964
14965         * file-io.c: now that we return symlinks, use lstat and, when the file
14966         is a symbolic link, stat, to get the file attributes. Also avoid the
14967         conversion to/from utf16/external.
14968
14969 2005-10-06  Zoltan Varga  <vargaz@gmail.com>
14970
14971         * class.c (mono_class_layout_fields): Compute klass->has_references
14972         correctly if an embedded valuetype is not yet initialized. Fixes
14973         #76331.
14974
14975 2005-10-04  Martin Baulig  <martin@ximian.com>
14976
14977         * metadata.c
14978         (mono_metadata_load_generic_param_constraints): New public
14979         function; splitted the constraints loading out from
14980         mono_metadata_load_generic_params().
14981
14982         * class.c (mono_class_create_from_typedef): Call
14983         mono_metadata_load_generic_param_constraints() after setting up
14984         the type and creating our parent; fixes #75329.
14985
14986 2005-10-04  Martin Baulig  <martin@ximian.com>
14987
14988         * icall.c (ves_icall_MonoGenericClass_GetParentType): Allow
14989         non-dynamic parent classes.
14990
14991 2005-10-04  Atsushi Enomoto  <atsushi@ximian.com>
14992
14993         * file-io.c : win32 build fix (ETXTBSY seems not found).
14994
14995 2005-10-04  Martin Baulig  <martin@ximian.com>
14996
14997         * reflection.c
14998         (mono_image_get_methodspec_token): Make the cache actually work;
14999         fixes #75974.
15000
15001 2005-10-04  Martin Baulig  <martin@ximian.com>
15002
15003         * class.c (mono_class_name_from_token): Removed the unneccessary
15004         `MonoGenericContext *' argument.
15005
15006 2005-10-04  Martin Baulig  <martin@ximian.com>
15007
15008         * loader.c
15009         (method_from_methodspec): Make the caching work again; fixes the
15010         performance regression from #76262.
15011
15012 2005-10-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15013
15014         * file-io.c:
15015         * file-io.h:
15016         * icall.c: replace FindFirst/FindNext/FindClose calls with a new
15017         GetFileSystemEntries that performs the same work but without going
15018         into io-layer, locking, etc.
15019
15020 2005-09-30  Zoltan Varga  <vargaz@gmail.com>
15021
15022         * threads.c (ves_icall_System_Threading_Thread_Abort): Handle 
15023         ThreadState_Stopped as well. Fixes #76047.
15024
15025 2005-09-29  Martin Baulig  <martin@ximian.com>
15026
15027         * class.c
15028         (inflate_generic_context): If the new context has a `gmethod', set
15029         its `container' that that gmethod's `container'.
15030
15031         * metadata.c
15032         (mono_metadata_parse_generic_param): Simplify things;
15033         `generic_container = generic_context->container;' is just fine.
15034
15035         * loader.c (method_from_methodspec): Code cleanups.
15036
15037 Wed Sep 28 17:06:01 CEST 2005 Paolo Molaro <lupus@ximian.com>
15038
15039         * decimal.c: fix warning (and let gcc generate correct
15040         code on ARM with optimizations).
15041
15042 2005-09-28  Martin Baulig  <martin@ximian.com>
15043
15044         * loader.c
15045         (method_from_memberref): Added `MonoGenericContext *class_context'
15046         argument; this is used when parsing a MONO_MEMBERREF_PARENT_TYPESPEC.
15047         (method_from_methodspec): If we're a memberref, use the enclosing
15048         context when parsing its parent.  Fixes #76262; see gtest-206.cs.
15049
15050 2005-09-28  Martin Baulig  <martin@ximian.com>
15051
15052         * object.c (mono_runtime_invoke_array): Added support for
15053         MONO_TYPE_GENERICINST; fixes #75917.
15054
15055 2005-09-27  Martin Baulig  <martin@ximian.com>
15056
15057         * reflection.c (encode_type): For `MONO_TYPE_CLASS/VALUETYPE', use
15058         `k->byval_arg.type' to determine the actual type.
15059
15060         * loader.c (method_from_methodspec): Removed some hacks.
15061
15062 2005-09-27  Ben Maurer  <bmaurer@ximian.com>
15063
15064         * class-internals.h (mono_field_is_deleted): Do the test for
15065         rtspecialname before we check the actual name of the field. This
15066         prevents us from dereferencing a pointer into the string table,
15067         saving us from accessing a few pages
15068
15069         * *.c: Replace the use of {Enter,Leave}CriticalSection with
15070         macros. This will allow a deadlock debugger to easily be plugged
15071         in.
15072
15073 2005-09-27  Martin Baulig  <martin@ximian.com>
15074
15075         * loader.c (method_from_methodspec): Create a "signature"
15076         MonoGenericContainer and use mono_get_method_full().  Fixes #75584.
15077
15078 2005-09-27  Martin Baulig  <martin@ximian.com>
15079
15080         * class.c
15081         (inflate_generic_class): Correctly set the new context's
15082         container.
15083
15084         * loader.c
15085         (find_method, find_method_in_class): Take a `MonoGenericContainer *'
15086         instead of a `MonoGenericContext *'.
15087         (mono_method_signature_full): Take a `MonoGenericContainer *'
15088         instead of a `MonoGenericContext *'.
15089
15090         * metadata.c
15091         (mono_metadata_parse_signature_full): Take a `MonoGenericContainer *'
15092         instead of a `MonoGenericContext *'.
15093         (mono_metadata_parse_method_signature_full): Likewise.
15094
15095 2005-09-26  Martin Baulig  <martin@ximian.com>
15096
15097         * class.c
15098         (mono_class_from_generic_parameter): Set `klass->generic_container'
15099         (mono_class_from_generic_parameter): Likewise.
15100         (mono_bounded_array_class_get): We inherit the generic container
15101         from the element class.
15102
15103         * loader.c
15104         (find_method, find_method_in_class): Take a `MonoGenericContext *'
15105         argument rather than computing it here.
15106         (method_from_memberref): Correctly set the generic context before
15107         parsing the signature.  Fixes #75681.
15108
15109 2005-09-26  Zoltan Varga  <vargaz@gmail.com>
15110
15111         * object.c (mono_class_has_special_static_fields): Fix warnings.
15112
15113 2005-09-26  Carlos Alberto Cortez <calberto.cortez@gmail.com>
15114
15115         * assembly.c: Add parse_public_key function, to
15116         par the public keys. Also added mono_assembly_name_parse_full,
15117         to define it the parsed key should be freed or not.
15118         * icall.c: Added ves_icall_System_Reflection_AssemblyName_ParseName,
15119         to parse a long format assembly name.
15120         * metadata-internals.h: Keep mono_assembly_name_parse_full as
15121         private, since calling it to preserve the key requires
15122         freeing it manually.
15123         
15124 2005-09-26  Atsushi Enomoto  <atsushi@ximian.com>
15125
15126         * locales.c : removed HAVE_ICU part.
15127
15128 2005-09-24  Zoltan Varga  <vargaz@freemail.hu>
15129
15130         * object.c (mono_class_create_runtime_vtable): Avoid calling 
15131         field_is_special_static if the klass has no special static fields.
15132
15133         * class-internals.h (MonoClass): Add 'no_special_static_fields' flag.
15134         (MonoCachedClassInfo): Likewise.
15135
15136         * object.c (mono_class_has_special_static_fields): New helper function.
15137
15138 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
15139
15140         * class.c (mono_class_create_from_typedef): Don't call 
15141         interfaces_from_typedef_full for enums.
15142         (mono_class_create_from_typedef): Compute the base types of enums directly
15143         without calling mono_class_setup_fields ().
15144         (mono_class_find_enum_basetype): New helper function.
15145
15146         * reflection.c (mono_image_build_metadata): Emit type names+namespaces at
15147         one place inside the string heap.
15148         
15149 Fri Sep 23 19:37:46 CEST 2005 Paolo Molaro <lupus@ximian.com>
15150
15151         * class.c: locking fixes, code cleanups, some docs added.
15152         Allocate some data structures in the image mempool.
15153
15154 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
15155
15156         * rawbuffer.c: Remove unneccessary set_n_pagefaults () routine and update
15157         the example code.
15158         
15159 Fri Sep 23 18:27:02 CEST 2005 Paolo Molaro <lupus@ximian.com>
15160
15161         * class-internals.h, class.c, reflection.c: reduce memory taken by
15162         MonoClass.
15163
15164 Fri Sep 23 17:56:21 CEST 2005 Paolo Molaro <lupus@ximian.com>
15165
15166         * metadata.c, metadata.h, loader.h: documentation updates, code and
15167         API cleanups.
15168
15169 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
15170
15171         * rawbuffer.c: Remove unneccessary set_n_pagefaults () routine and update
15172         the example code.
15173
15174         * rawbuffer.h rawbuffer.c: Add code and APIs to help determine the number of
15175         page faults caused by the runtime while reading metadata.
15176
15177 2005-09-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15178
15179         * socket-io.c: the field names were changed 3 months ago and no one
15180         realized until bug #76077 got filed!
15181
15182 2005-09-20  Martin Baulig  <martin@ximian.com>
15183
15184         * icall.c (assembly_icalls): Removed some unused debugger icalls.
15185
15186 2005-09-20  Martin Baulig  <martin@ximian.com>
15187
15188         * mono-debug.c (mono_debug_add_type): Ignore array types and don't
15189         write the rank into the class entry.
15190
15191 2005-09-20  Martin Baulig  <martin@ximian.com>
15192
15193         * mono-debug-debugger.c (MonoDebuggerMetadataInfo): Added some stuff.
15194
15195 2005-09-19  Zoltan Varga  <vargaz@gmail.com>
15196
15197         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
15198
15199         * icall.c (custom_attrs_defined_internal): New icall.
15200
15201         * reflection.c (mono_reflection_get_custom_attrs_by_type): New helper
15202         function.
15203         (mono_custom_attrs_construct_by_type): New helper function.
15204
15205 2005-09-17  Zoltan Varga  <vargaz@freemail.hu>
15206
15207         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): Null
15208         terminate the resulting string. Fixes #76123.
15209
15210 2005-09-16  Martin Baulig  <martin@ximian.com>
15211
15212         * mono-debug.c
15213         (mono_debug_add_method): Ignore inflated methods for the moment.
15214
15215 2005-09-14  Martin Baulig  <martin@ximian.com>
15216
15217         * debug-mono-symfile.h (MONO_SYMBOL_FILE_VERSION): Bump version to 39.
15218
15219 2005-09-13  Zoltan Varga  <vargaz@gmail.com>
15220
15221         * metadata.c (mono_class_get_overrides_full): Modify signature to explicitly
15222         return a success/failure indication.
15223         (mono_metadata_interfaces_from_typedef_full): Ditto.
15224         (get_constraints): Ditto.
15225
15226 2005-09-12  Zoltan Varga  <vargaz@gmail.com>
15227
15228         * marshal.c (emit_marshal_array): Fix handling of null arrays.
15229         
15230         * marshal.c (emit_marshal_array): Add support for returning string
15231         arrays from delegates. Fixes #76063.
15232
15233         * marshal.c: Use the emit_ldloc/stloc macros where possible.
15234
15235 2005-09-11  Zoltan Varga  <vargaz@gmail.com>
15236
15237         * threads.c (ves_icall_System_Threading_Thread_MemoryBarrier): New
15238         icall.
15239
15240 2005-09-09  Zoltan Varga  <vargaz@gmail.com>
15241
15242         * reflection.c icall.c: Fix after mono_get_exception_type_load
15243         signature change.
15244
15245         * assembly.c (mono_assembly_get_assemblyref): New helper function.
15246         (mono_assembly_load_reference): Use the new helper.
15247
15248         * class-internals.h (MonoLoaderError): New structure containing 
15249         information about type loading errors.
15250
15251         * class-internals.h loader.c: Add APIs to store per-thread loader
15252         error information.
15253
15254         * loader.c class.c: Set the loader error if needed.
15255
15256         * exception.h exception.c: Add functions to throw MissingMethod/MissingFieldExceptions.
15257
15258 Thu Sep 8 18:54:07 BST 2005 Paolo Molaro <lupus@ximian.com>
15259
15260         * decimal.c: fixed to handle the broken ARM fp format.
15261
15262 Wed Sep 7 22:17:58 BST 2005 Paolo Molaro <lupus@ximian.com>
15263
15264         * icall.c: on ARM use the libc strtod(), since bsd_strtod() seems
15265         broken.
15266
15267 2005-09-06  Martin Baulig  <martin@ximian.com>
15268
15269         * domain.c (supported_runtimes): Added v2.0.50727.
15270
15271 Tue Sep 6 11:40:24 CEST 2005 Paolo Molaro <lupus@ximian.com>
15272
15273         * culture-info.h: reduce the size of some structures.
15274
15275 2005-09-05  Martin Baulig  <martin@ximian.com>
15276
15277         Reflect latest API changes in the August CTP.
15278
15279         * icall.c
15280         ("Type.BindGenericParameters"): Renamed to "MakeGenericType".
15281         ("MonoType.HasGenericArguments"): Removed.
15282         ("MonoMethod.BindGenericParameters"): Renamed to
15283         "MakeGenericMethod".
15284         ("MethodBuilder.BindGenericParameters"): Renamed to
15285         "MakeGenericMethod".    
15286
15287 2005-09-05  Martin Baulig  <martin@ximian.com>
15288
15289         * mono-debug-debugger.c: Moved the debugger icalls into icall.c.
15290
15291 2005-09-05  Martin Baulig  <martin@ximian.com>
15292
15293         Applying a patch from Michal Moskal <malekith@nemerle.org>.
15294
15295         * icall.c (ves_icall_Type_get_IsGenericType): Return true also if
15296         generic_container is non-NULL.
15297
15298 2005-09-05  Martin Baulig  <martin@ximian.com>
15299
15300         Applying a patch from Michal Moskal <malekith@nemerle.org>.
15301
15302         * object.c (set_value): In MONO_TYPE_VALUETYPE, add generics support.
15303
15304 2005-08-29  Michal Moskal  <malekith@nemerle.org>
15305
15306         * reflection.c (encode_locals,
15307         mono_reflection_sighelper_get_signature_local): Increase buffer sizes
15308         for large generic types.
15309
15310 2005-09-05  Martin Baulig  <martin@ximian.com>
15311
15312         Applying a patch from Michal Moskal <malekith@nemerle.org>.
15313
15314         * class.c (mono_dup_array_type): New public method.
15315         (mono_metadata_signature_deep_dup): New public method.
15316         (dup_type): Correctly duplicate array and function types.
15317
15318 2005-09-05  Martin Baulig  <martin@ximian.com>
15319
15320         Applying a patch from Michal Moskal <malekith@nemerle.org>.
15321
15322         * reflection.c (get_default_param_value_blobs): Handle generic types
15323         and generic methods.
15324
15325 2005-09-02  Sebastien Pouliot  <sebastien@ximian.com>
15326
15327         * class.c: Fixed error reporting (method/class were inversed) for 
15328         inheritance demands.
15329         * security-manager.c|h: Added the AppDomain when calling the managed
15330         System.Security.SecurityManager.InheritanceDemand method.
15331
15332 2005-09-01  Raja R Harinath  <rharinath@novell.com>
15333
15334         * reflection.c (encode_marshal_blob): 'marshaltype' and
15335         'marshaltyperef' are alternate sources for the custom marshaler
15336         name.
15337
15338 Wed Aug 31 17:39:54 CEST 2005 Paolo Molaro <lupus@ximian.com>
15339
15340         * class.c: fix creation of array classes with rank == 1
15341         (patch by Ankit Jain <jankit@novell.com>).
15342
15343 Wed Aug 31 17:35:19 CEST 2005 Paolo Molaro <lupus@ximian.com>
15344
15345         * object.c: fix check for creating the bound data for arrays vs
15346         szarrays.
15347
15348 2005-08-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15349
15350         * object.c: configuration file name is now based on the executable name,
15351         not the image name. Fixes bug #75931.
15352
15353 2005-08-29  Zoltan Varga  <vargaz@gmail.com>
15354
15355         * marshal.c (emit_thread_interrupt_checkpoint_call): Load the
15356         flag using LDIND_U4 since it leads to smaller and faster code on ia64.
15357
15358 2005-08-25  Zoltan Varga  <vargaz@gmail.com>
15359
15360         * rand.c: Use wincrypt.h instead of WinCrypt.h.
15361
15362 2005-08-24  Ankit Jain  <jankit@novell.com>
15363             Raja R Harinath  <rharinath@novell.com>
15364
15365         * class.c (mono_class_from_typeref): Don't call mono_class_init as we might've been
15366           called by it recursively.
15367           (mono_class_init): Remove special case in pending_init handling, since it's
15368           superseded by the fix to mono_class_from_typeref.
15369
15370 2005-08-22  Zoltan Varga  <vargaz@freemail.hu>
15371
15372         * threads.c (ves_icall_System_Threading_Thread_Thread_internal): Remove the 
15373         BROKEN_THREAD_START stuff.
15374
15375 2005-08-21  Zoltan Varga  <vargaz@freemail.hu>
15376
15377         * class-internals.h object.c: Add a new kind of trampoline called a delegate 
15378         trampoline.
15379
15380         * domain-internals.h domain.c: Add a has for delegate trampolines to MonoDomain.
15381         
15382         * object.c (mono_delegate_ctor): Replace the original function address with
15383         a delegate trampoline.
15384
15385 2005-08-21 Gert Driesen <drieseng@users.sourceforge.net>
15386
15387         * icall.c: add boolean argument to base64_to_byte_array and 
15388         InternalFromBase64String to control whether a whitespace-only string
15389         is allowed (or should casue a FormatException to be thrown). We need
15390         this as the behavior has changed between MS.NET 1.x and 2.0, and we
15391         to match the MS behaviour in both profiles.
15392         * appdomain.c: Bump corlib version.
15393
15394 2005-08-20  Carlos Alberto Cortez <calberto.cortez@gmail.com>
15395
15396         This patch implements a big portion of publisher policy
15397         support, used to bind assembly versions and redirect
15398         one assembly from version A to version B.
15399
15400         * assembly.c:
15401         New GSList loaded_assembly_bindings, for storing the cached
15402         assembly bindings.
15403         (assembly_binding_maps_name): New static function for checking if a 
15404         assembly binding information maps an assembly name.
15405         (mono_assembly_binding_info_free): New function for freeing
15406         assembly binding information resources.
15407         (get_publisher_policy_info): New static function for retrieving 
15408         assembly binding information from a MonoImage.
15409         (compare_versions): New static function for comparing an assembly
15410         binding information data and the version of an assembly name.
15411         (check_policy_versions): New static function for checking if an
15412         assembly binding info mapping an assembly name is valid for it.
15413         (mono_assembly_load_publisher_policy): New static function for
15414         loading the 'policy.major.minor.MyAssembly' image for an assembly
15415         with an assembly name 'aname'.
15416         (mono_assembly_bind_version): New static function for updating
15417         assembly redirection.
15418         (mono_assembly_apply_binding): New static function for applying
15419         assembly binding.
15420         (search_binding_loaded): New static function for searching 
15421         loaded assembly binding infos in the cache domain.
15422         (mono_assembly_load_full): Don't apply assembly binding for
15423         reflection only assemblies.
15424
15425         * metadata-internals.h: Add MonoAssemblyBindingInfo,
15426         which contains information about assembly binding. Also
15427         declare signature for mono_config_parse_publisher_policy ()
15428         function, used to retrieve pub policy info.
15429         
15430         * mono-config.c:
15431         (publisher_policy_start): New static function used to parse publisher 
15432         policy config files.
15433         (publisher_policy_parser): New static MonoParseHandler containing 
15434         the functions used when parsing config files.
15435         (mono_config_parse_publisher_policy): New function for parsing
15436         publisher policy files.
15437         
15438 2005-08-20  Zoltan Varga  <vargaz@freemail.hu>
15439
15440         * object.c (mono_delegate_ctor): Add support for IA64 function descriptors.
15441
15442         * marshal.c (mono_delegate_free_ftnptr): Ditto.
15443
15444         * object.c (mono_get_addr_from_ftnptr): New helper function.
15445
15446         * object.h (mono_array_addr): Fix unaligned access warnings on IA64.
15447
15448         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
15449
15450 2005-08-19  Dick Porter  <dick@ximian.com>
15451
15452         * threads.c, threads.h, appdomain.c, appdomain.h,
15453         profiler-private.h, monitor.c, object.c, object-internals.h,
15454         profiler.c, mono-debug-debugger.h, profiler.h: Use a gsize to
15455         store the thread ID, so it can hold a 64 bit value if needed.
15456
15457 2005-08-19  Zoltan Varga  <vargaz@freemail.hu>
15458
15459         * reflection.c (mono_reflection_create_dynamic_method): Store the
15460         handle class into the method references as well so ldtoken works in
15461         dynamic methods.
15462
15463         * icall.c (ves_icall_MonoField_GetValueInternal): Add support for generic
15464         types.
15465
15466 2005-08-19  Ankit Jain <jankit@novell.com>
15467
15468         Fix #75847.
15469         * marshal.c (mono_marshal_get_ptr_to_struct): Build method signature 
15470           here rather than using the method signature of a arbitrary function
15471           named 'System.Runtime.InteropServices.Marshal::PtrToStructure' with 
15472           two arguments.
15473           Hack done with Harinath.
15474
15475 2005-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15476
15477         * threadpool.c: disable printing stack traces when we get a exception
15478         in a threadpool thread. I need to do more testing to figure out which
15479         cases actually print this. Fixes bug #75828.
15480
15481 2005-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15482
15483         * icall.c: there might be ignored whitespace after the last '='. This
15484         fixes length computation and bug #75840.
15485
15486 2005-08-18  Zoltan Varga  <vargaz@freemail.hu>
15487
15488         * assembly.c (mono_assembly_load_full): Consider .exe extension as
15489         well. Fixes #75809.
15490
15491         * reflection.c (create_custom_attr): Fix unmanaged memory leak. Fixes
15492         #75784.
15493         
15494         * reflection.c (create_custom_attr_data): Ditto.
15495
15496 2005-08-17  Atsushi Enomoto  <atsushi@ximian.com>
15497
15498         * locales.c, culture-info.h : removed RegionLCIDMap.
15499         * culture-info-tables.h : regenerated.
15500
15501 2005-08-16  Martin Baulig  <martin@ximian.com>
15502
15503         * class.c (mono_type_get_name_recurse): Small fix.
15504
15505 2005-08-16  Atsushi Enomoto  <atsushi@ximian.com>
15506
15507         * locales.c : indentation fixie.
15508
15509 2005-08-15  Atsushi Enomoto  <atsushi@ximian.com>
15510
15511         * object-internals.h,
15512           locales.h,
15513           locales.c,
15514           culture-info.h,
15515           icall.c : added RegionInfo table support.
15516         * culture-info-table.h : regenerated for region support.
15517
15518 2005-08-14  Kamil Skalski  <nazgul@nemerle.org>
15519
15520         * reflection.c (resolve_object): handle all kinds of MonoMethod
15521         including generic ones
15522
15523 2005-08-12  Ankit Jain <jankit@novell.com>
15524
15525         * get.c (dis_stringify_variant_type): New. Stringify MonoMarshalVariant.
15526           (dis_stringify_marshal_spec): Add new case for MONO_NATIVE_SAFEARRAY. 
15527
15528 2005-09-12  Lluis Sanchez  <lluis@ximian.com>
15529
15530         * process.c: Don't close a thread handle when it's NULL. This is a
15531         workaround for bug #75733.
15532
15533 2005-08-11  Zoltan Varga  <vargaz@freemail.hu>
15534
15535         * marshal.c (mono_marshal_get_string_encoding): Fix handling of CharSet.Auto. Fixes #75769.
15536
15537 2005-08-10  Zoltan Varga  <vargaz@freemail.hu>
15538
15539         * icall.c (ves_icall_Type_get_IsGenericType): New icall.
15540
15541 2005-08-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15542
15543         * threadpool.c: if a work item in the thread pool has a callback that
15544         catches a exception, don't propagate it after invoking the callback.
15545         Fixes bug #75336.
15546
15547 2005-08-08  Zoltan Varga  <vargaz@freemail.hu>
15548
15549         * class.c (class_compute_field_layout): Rename this to mono_class_setup_fields.
15550
15551         * class-internals.h (MonoCachedClassInfo): Add some new fields.
15552
15553         * class.c (mono_class_init): Load field info lazily in the AOT case.    
15554
15555         * reflection.c (mono_image_load_module): Fix error checking. Fixes #75660.
15556
15557 2005-08-03  Ankit Jain  <jankit@novell.com>
15558
15559         Fix #75683.
15560         * loader.c (mono_method_signature_full): Use MONO_CALL_DEFAULT if
15561           PInvoke calling convention is 0.
15562
15563 2005-08-02  Zoltan Varga  <vargaz@freemail.hu>
15564
15565         * socket-io.c (convert_sockopt_level_and_name): Applied patch from 
15566         Julien Puydt (julien.puydt@laposte.net). Add check for IPV6_PKTINFO.
15567
15568 Mon Aug 1 16:52:12 CEST 2005 Paolo Molaro <lupus@ximian.com>
15569
15570         * gc-internal.h, threads.c, null-gc.c, boehm-gc.c: added interface
15571         to handle threads not started by the GC (patch by Michael Meeks
15572         <michael.meeks@novell.com>).
15573
15574 2005-07-31  Kamil Skalski  <nazgul@omega.pl>
15575
15576         * reflection.c: Make buffer used in emitting types larger for some
15577         big generic types (patch by Michal Moskal).
15578
15579 2005-07-30  Zoltan Varga  <vargaz@freemail.hu>
15580
15581         * mono-debug.c: Fix some (not all) alignment problems.
15582
15583 2005-07-29  Carlos Alberto Cortez <calberto.cortez@gmail.com>
15584
15585         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw):
15586         Invoke mono_image_load_from_data_full passing the refonly
15587         parameter.
15588
15589         * assembly.c
15590         (mono_assembly_open_from_bundle): Add the refonly argument, 
15591         in order to pass it to other methods it calls to.
15592         (do_mono_assembly_open): Add the refonly argument, in order 
15593         to pass it to other methods it calls to.
15594         (mono_assembly_open_full): Invoke do_mono_assembly_open passing
15595         the refonly parameter to it.
15596
15597         * image.c: Add loaded_images_refonly_hash and
15598         loaded_images_refonly_guid_hash to cache the reflection
15599         only loaded images.
15600         (mono_images_init): Initialize the hash tables used for
15601         caching the reflection only images.
15602         (load_modules): Invoke mono_image_open_full passing the refonly
15603         parameter to load the modules the correct way.
15604         (build_guid_table): Add the refonly argument, to re-build the 
15605         correct hash table.
15606         (do_mono_image_open): Added the refonly argument, in order to
15607         define it for the loaded image.
15608         (mono_image_loaded_full): New function, which receives an
15609         additional parameter to look for the image in the refonly or
15610         non-refonly section.
15611         (mono_image_loaded): Updated, using mono_image_loaded_full.
15612         (mono_image_loaded_by_guid_full): The same case that happens
15613         with mono_image_loaded_full.
15614         (mono_image_loaded_by_guid): Likewise.
15615         (register_image): Use the ref_only variable inside MonoImage
15616         to decide in which hash table store the current image.
15617         (mono_image_open_from_data_full): Rename
15618         mono_image_open_from_data to mono_image_open_from_data_full,
15619         adding the refonly argument, to define the ref_only variable 
15620         inside MonoImage.
15621         (mono_image_open_from_data): Return 
15622         mono_image_open_from_data_full.
15623         (mono_image_open_full): Rename mono_image_open to
15624         mono_image_open_full, receiving the new refonly argument,
15625         to pass it to inner methods.
15626         (mono_pe_file_open): Update this function, to open
15627         a MonoImage as a non-refonly image.
15628         (mono_image_close): Use the refonly variable inside
15629         MonoImage to remove the image from the correct caches.
15630
15631         * image.h: Add the signatures of mono_image_open_full,
15632         mono_image_open_from_data_full, mono_image_loaded_full,
15633         mono_image_loaded_by_guid_full.
15634
15635         * metadata-internals.h: Add the ref_only field to 
15636         MonoImage.
15637         
15638 2005-07-29  Carlos Alberto Cortez <calberto.cortez@gmail.com>
15639
15640         * icall.c (ves_icall_System_Reflection_GetReferencedAssemblies):
15641         Fix the last behavior, which used to load the assemblies and
15642         extract MonoReflectionAssemblyName information, instead of
15643         extract it from the metadata tables. Needed for Reflection
15644         Only assemblies.
15645         
15646 2005-07-29  Martin Baulig  <martin@ximian.com>
15647
15648         * mono-debug-debugger.c
15649         (mono_debugger_lock, mono_debugger_unlock): g_assert() if we're
15650         not initialized.
15651
15652         * mono-debug.c
15653         (mono_debug_address_from_il_offset): Check whether we have
15654         debugging support before attempting to take the lock.
15655         (mono_debug_source_location_from_address): Likewise.
15656         (mono_debug_source_location_from_il_offset): Likewise.
15657         (mono_debug_il_offset_from_address): Likewise.
15658         (mono_debug_address_from_il_offset): Likewise.
15659
15660 2005-07-29  Zoltan Varga  <vargaz@freemail.hu>
15661
15662         * class.c (mono_class_from_name_case): Add support for dynamic images.
15663         Fixes #75650.
15664
15665         * object.c (mono_class_compute_gc_descriptor): Add a workaround
15666         for #75479.
15667
15668 2005-07-28  Zoltan Varga  <vargaz@freemail.hu>
15669         
15670         * reflection.c (mono_method_get_object): Fix warning.
15671
15672 2005-07-28  Martin Baulig  <martin@ximian.com>
15673
15674         * mono-debug.c
15675         (mono_debug_add_wrapper): Also write the wrapper type.
15676
15677 2005-07-28  Zoltan Varga  <vargaz@freemail.hu>
15678
15679         * class-internals.h (MonoCachedClassInfo): Add has_nested_classes field.
15680         
15681         * class.c (mono_class_init): Avoid reading nested classes if the AOT
15682         data indicates the class has none.
15683
15684 2005-07-26  Ben Maurer  <bmaurer@ximian.com>
15685
15686         * mono-debug.c, debug-mono-symfile.c: Replace the use of the
15687         loader lock with the debugger lock. Prevents deadlocks for beagle.
15688
15689         Beagle can now run on an smp box for a weekend without any
15690         issues. Woohoo!
15691
15692 2005-07-26  Zoltan Varga  <vargaz@freemail.hu>
15693
15694         * class.c (mono_bounded_array_class_get): Avoid crash if eclass is
15695         in a module. Fixes #75629.
15696
15697 2005-07-26  Martin Baulig  <martin@ximian.com>
15698
15699         * mono-debug.c (mono_debug_add_wrapper): New static method.
15700         (mono_debug_add_method): Call mono_debug_add_wrapper() if we're an
15701         interncall or a wrapper.
15702
15703         * mono-debug.h (MonoDebugWrapperData): New public typedef.
15704         (MonoDebugDataItemType): Added `MONO_DEBUG_DATA_ITEM_WRAPPER'.
15705         (MONO_DEBUGGER_VERSION): Bump to 51.
15706
15707         * mono-debug-debugger.c
15708         (mono_debugger_add_type): Removed this empty function.
15709         (mono_debugger_add_method): Likewise.
15710
15711 2005-07-22  Zoltan Varga  <vargaz@freemail.hu>
15712
15713         * icall.c (ves_icall_Type_GetMethodsByName): Call setup_vtable () 
15714         before accessing method->slot.
15715
15716 2005-07-21  Jb Evain  <jbevain@gmail.com>
15717
15718         * reflection.c (method_encode_clauses/class): Handle filters clauses.
15719         Fixes #75010.
15720
15721 2005-07-21  Zoltan Varga  <vargaz@freemail.hu>
15722
15723         * marshal.c (emit_marshal_custom): Implement byref marshalling. Fixes
15724         #75587.
15725
15726 2005-07-20  Zoltan Varga  <vargaz@freemail.hu>
15727
15728         * image.h image.c: Add mono_image_get_guid () API function.
15729
15730 2005-07-19  Ben Maurer  <bmaurer@ximian.com>
15731
15732         There were issues when multiple threads tried to load
15733         assemblies. A deadlock was created between assemblies_mutex and
15734         mono_domain_assemblies_lock. This fixes the issue by making the
15735         assembly ref counting be lock free. See bug 75586.
15736         
15737         * image.c (mono_image_close): The add ref function here was using
15738         Interlocked operations while the unref was using a mutex and a
15739         --. I don't think this was ever a bug that would be exposed in a
15740         non-pendantic way (ie, by an embedder doing a ref on one thread
15741         and an unref on another), but for the sake of correctness, this is
15742         now Interlocked.
15743
15744         * assembly.c (mono_assembly_addref): Use InterlockedIncrement
15745         (mono_assembly_load_reference): Call mono_assembly_addref rather
15746         than touching the refcount ourselves.
15747         (mono_assembly_close): Use InterlockedDecrement to unref the
15748         assembly. Don't acquire the lock unless it is actually needed.
15749
15750 2005-07-12  Zoltan Varga  <vargaz@freemail.hu>
15751
15752         * class.c (mono_class_layout_fields): Fix calculation of has_references
15753         for generic types.
15754
15755 2005-07-12  Martin Baulig  <martin@ximian.com>
15756
15757         Applying a patch from Michal Moskal <malekith@nemerle.org>.
15758
15759         * metadata.c
15760         (mono_type_hash): Provide better hashing for generic instances.
15761         (mono_generic_inst_hash): Improve hashing.
15762         (mono_generic_class_hash): Likewise.
15763
15764         * reflection.c (mymono_metadata_type_hash): Improve hashing for
15765         generic instances.
15766
15767 2005-07-12  Martin Baulig  <martin@ximian.com>
15768
15769         * reflection.c (mono_reflection_create_runtime_class): Remove the
15770         hack for generic type definitions and non-`Run' assemblies.
15771         (mono_reflection_bind_generic_parameters): Also use
15772         `klass->wastypebuilder' to check for TypeBuilders.
15773
15774 2005-07-12  Zoltan Varga  <vargaz@freemail.hu>
15775
15776         * class.c (mono_class_layout_fields): Fix calculation of has_references
15777         for generic types.
15778
15779         * class.c (inflate_generic_class): Fix a leak.
15780         (mono_class_init): Fix calculation of gchimpl and has_finalize fields
15781         for generic types.
15782
15783 2005-07-11  Martin Baulig  <martin@ximian.com>
15784
15785         * icall.c (ves_icall_Type_BindGenericParameters): Don't crash here
15786         on error.
15787
15788 2005-07-11  Martin Baulig  <martin@ximian.com>
15789
15790         * loader.c (find_method): Also lookup in
15791         `mono_defaults.object_class' if we're an interfaces; fixes #75460.
15792
15793 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
15794
15795         * appdomain.c (mono_domain_unload): Don't free the error message
15796         before passing it to mono_get_exception_...
15797
15798         * reflection.c (CACHE_OBJECT): Fix the race introduced by the previous patch.
15799         
15800 Thu Jul 7 19:59:31 CEST 2005 Paolo Molaro <lupus@ximian.com>
15801
15802         * threads.c: try to better guess an available RT signal (bug #75387).
15803
15804 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
15805
15806         * reflection.c (CACHE_OBJECT): Don't hold the domain lock between CHECK_OBJECT
15807         and CACHE_OBJECT.
15808
15809 2005-07-07  Martin Baulig  <martin@ximian.com>
15810
15811         * class.c (mono_type_get_name_full): Return NULL for
15812         MONO_TYPE_NAME_FORMAT_FULL_NAME if we have any generic parameters;
15813         fixes #75408.
15814
15815 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
15816
15817         * threads.c (mono_threads_abort_appdomain_threads): Wait for threads to
15818         exit the appdomain as well being aborted.
15819
15820         * threadpool.c: Create all threadpool threads inside the root appdomain, and
15821         change back to the root domain after calling managed code. This enables
15822         appdomains using threadpools to be unloaded.
15823
15824 2005-07-07  Martin Baulig  <martin@ximian.com>
15825
15826         * class-internals.h
15827         (MonoInflatedGenericClass): Moved the `MonoType *parent' field
15828         into `MonoDynamicGenericClass' since we only need it for dynamic
15829         types.
15830
15831         * reflection.c (mono_class_bind_generic_parameters): We don't need
15832         to compute the `parent' here.
15833
15834 2005-07-07  Atsushi Enomoto  <atsushi@ximian.com>
15835
15836         * culture-info-table.h : regenerated.
15837
15838 2005-07-06  Martin Baulig  <martin@ximian.com>
15839
15840         * icall.c
15841         (ves_icall_FieldInfo_SetValueInternal): Add MONO_TYPE_GENERICINST.
15842
15843         * object.c (set_value): Add MONO_TYPE_GENERICINST; fixes #75299.
15844
15845 2005-07-06  Martin Baulig  <martin@ximian.com>
15846
15847         * metadata.c (mono_metadata_class_equal): Add MONO_TYPE_SZARRAY if
15848         we're doing a signature-only comparision; fixes #74945.
15849
15850 2005-07-06  Martin Baulig  <martin@ximian.com>
15851
15852         * class-internals.h (MonoGenericClass): Moved some things out into
15853         a new `MonoInflatedGenericClass' type.  
15854         (MonoInflatedGenericClass): New type; the `klass' of a
15855         `MonoGenericClass' is now computed lazyly in
15856         mono_get_inflated_generic_class().      
15857
15858         * class.c (mono_get_inflated_generic_class): New public function.
15859         (mono_class_inflate_generic_method): Removed the unused
15860         `MonoClass *' argument.
15861         (setup_generic_vtable): Don't call mono_get_inflated_method() on
15862         all the methods.
15863         (mono_class_create_generic): Make this static and merge it with
15864         mono_class_create_generic_2(); we're now called automatically from
15865         mono_get_inflated_generic_class().
15866
15867         * loader.c (mono_method_signature): Call
15868         mono_get_inflated_method() here.
15869
15870 2005-07-06  Zoltan Varga  <vargaz@freemail.hu>
15871
15872         * object.c (mono_class_create_runtime_vtable): Allow MONO_TYPE_FNPTR as
15873         type of fields with RVA.
15874
15875         * class.c (mono_class_from_generic_parameter): Avoid calling mono_class_init ()
15876         for this pseudo class.
15877         (my_mono_class_from_generic_parameter): Likewise.
15878         (mono_class_init): Allow interfaces to have cctors.
15879
15880 2005-07-05  Zoltan Varga  <vargaz@freemail.hu>
15881
15882         * domain-internals.h domain.c: Add functionality to create MonoJitInfo structures
15883         lazily for AOT methods.
15884
15885 2005-07-05  Martin Baulig  <martin@ximian.com>
15886
15887         * loader.c (mono_lookup_pinvoke_call): g_ascii_strcasecmp()
15888         returns FALSE for a successful match, not TRUE.
15889
15890 2005-07-05  Zoltan Varga  <vargaz@freemail.hu>
15891
15892         * loader.c (mono_method_get_index): Optimize this a bit.
15893
15894 2005-07-04  Martin Baulig  <martin@ximian.com>
15895
15896         * class.c
15897         (class_compute_field_layout): Move the check for generic type
15898         definitions into mono_class_layout_fields().  Fixes #74684.
15899         (mono_class_from_generic_parameter): Correctly compute
15900         `klass->parent'; fixes #75457.
15901
15902         * reflection.c (register_assembly, register_module): Make sure
15903         `domain->rejobject_hash' is already created.
15904
15905 2005-07-02  Martin Baulig  <martin@ximian.com>
15906
15907         * class-internals.h
15908         (MonoGenericClass): Move `count_ifaces' and `ifaces' into
15909         `MonoDynamicGenericClass'.      
15910
15911 2005-07-01  Lluis Sanchez  <lluis@ximian.com>
15912
15913         * icall.c: In ves_icall_InternalExecute() dont't assert if the value
15914         returned by a field getter is null, since null is a valid value.
15915
15916 2005-07-01  Martin Baulig  <martin@ximian.com>
15917
15918         * reflection.c (mono_reflection_generic_class_initialize): Update
15919         the `dgclass->fields [i].parent' to the correct class.
15920         (mono_image_get_fieldref_token): Use the declaring type, not the
15921         reflected type.
15922
15923 2005-07-01  Martin Baulig  <martin@ximian.com>
15924
15925         * loader.c (find_method): Also look in the interfaces; fixes #75429.
15926
15927 2005-06-30  Ben Maurer  <bmaurer@ximian.com>
15928
15929         * threads.c (thread_cleanup): assert that thread != NULL
15930         (wait_for_tids_or_state_change): We were using the wrong variable
15931         when accessing wait->threads. `i' was always out of the bounds of
15932         the array.
15933
15934 2005-06-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15935
15936         * loader.c: map user32 and kernel32 to libMonoSupportW
15937
15938 2005-06-28  Zoltan Varga  <vargaz@freemail.hu>
15939
15940         * appdomain.c (unload_thread_main): Mark this as WINAPI.
15941
15942 2005-06-28  Martin Baulig  <martin@ximian.com>
15943
15944         * loader.c (method_from_methodspec): Fix #75334.
15945
15946 2005-06-28  Martin Baulig  <martin@ximian.com>
15947
15948         Fix #74953 - Arrays now implement the generic IList<T> interface
15949         on the 2.0 platform.
15950
15951         * class-internals.h (MonoDefaults): Added `generic_array_class'.
15952
15953         * reflection.c (mono_class_bind_generic_parameters): New public
15954         function; similar to mono_reflection_bind_generic_parameters(),
15955         but operates on a `MonoType *' and not on a `MonoReflectionType *'.
15956
15957         * domain.c (mono_init_internal): Try to initialize.
15958         `mono_defaults.generic_array_class' here; this'll only succeed if
15959         we're using the 2.0 corlib.
15960
15961         * icall.c
15962         (ves_icall_System_Array_InternalArray_GetGenericValueImpl): Added
15963         interncall for "System.Array/InternalArray`1:GetGenericValueImpl".
15964         (mono_lookup_internal_call): Added support for nested classes.
15965
15966         * loader.c
15967         (mono_get_method_from_token): Set `result->signature->pinvoke' if
15968         we're an interncall and have generic arguments.
15969
15970         * class.c
15971         (mono_class_inflate_generic_methods): Allow interncalls and PInvoke.
15972         (mono_bounded_array_class_get): If we're on the 2.0 corlib, use an
15973         instance of System.Array.InternalArray<T> for arrays, so they
15974         implement the generic IList<T> interface.
15975
15976 2005-06-27  Zoltan Varga  <vargaz@freemail.hu>
15977
15978         * marshal.c (emit_marshal_string): Applied patch from Itamar Rogel
15979         (chastamar@yahoo.com). Fixes #75374.    
15980
15981 2005-06-27  Atsushi Enomoto <atsushi@ximian.com>
15982
15983         * culture-info-table.h: regenerated.
15984
15985 2005-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15986
15987         * icall.c: handle spaces correctly for base64 strings.
15988
15989 2005-06-26  Ben Maurer  <bmaurer@ximian.com>
15990
15991         * *.c: Kill some warnings.
15992
15993 2005-06-23  Duncan Mak  <duncan@novell.com>
15994
15995         * socket-io.c (is_loopback): Cast 'ptr' to 'struct in6_addr *' so
15996         that this builds on Solaris 10 (x86).
15997
15998 2005-06-23  Martin Baulig  <martin@ximian.com>
15999
16000         * class.c
16001         (mono_type_get_name_recurse): Don't use a duplicate '[', ']' for
16002         generic type definitions.
16003
16004 2005-06-23  Martin Baulig  <martin@ximian.com>
16005
16006         Fix #75331.
16007
16008         * metadata.c (mono_class_get_overrides): Renamed to
16009         mono_class_get_overrides_full() and added a `MonoGenericContext *'.
16010         (method_from_method_def_or_ref): Added `MonoGenericContext *' and
16011         pass it to mono_get_method_full().
16012
16013 2005-06-22  Ben Maurer  <bmaurer@ximian.com>
16014
16015         * reflection.c (mono_reflection_create_runtime_class): take the
16016         mono_domain_lock in this method. Prevents deadlocks
16017
16018 2005-06-22  Martin Baulig  <martin@ximian.com>
16019
16020         * loader.c (method_from_methodspec): Fix #75330.
16021
16022 2005-06-22  Martin Baulig  <martin@ximian.com>
16023
16024         * reflection.c (type_get_qualified_name): Use
16025         mono_type_get_name_full() with MONO_TYPE_NAME_FORMAT_REFLECTION.
16026         (_mono_reflection_get_type_from_info): Added `MonoImage *image'
16027         argument; use it if we don't have an assembly name.
16028
16029 2005-06-22  Lluis Sanchez Gual  <lluis@novell.com>
16030
16031         * object.c: In mono_message_init, set "copy out" flag for in
16032         parameters with the [Out] flag.
16033
16034 2005-06-21  Martin Baulig  <martin@ximian.com>
16035
16036         * class.c
16037         (mono_type_get_name_recurse): Correctly handle MONO_TYPE_SZARRAY
16038         and MONO_TYPE_PTR.
16039
16040 2005-06-21  Martin Baulig  <martin@ximian.com>
16041
16042         * class.c (mono_class_init): Don't initialize `class->fields' for
16043         generic instances since they're initialized again in
16044         compute_field_layout(). 
16045         (compute_field_layout): Set the field's `generic_info' here; fix
16046         #75320. 
16047
16048 2005-06-21  Martin Baulig  <martin@ximian.com>
16049
16050         * class-internals.h
16051         (MonoGenericMethod): Added `MonoGenericClass *generic_class'.
16052
16053         * metadata.c (mono_metadata_generic_method_equal): Also
16054         distinguish the `generic_class'; fixes #75334.
16055
16056 2005-06-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16057
16058         * domain.c:
16059         * appdomain.c:
16060         * domain-internals.h:
16061         * reflection.c: 'domain_assemblies' field is now protected by its own
16062         lock. Don't call into managed code to run the AssemblyLoad event if we
16063         now there are no registered delegates for it.
16064
16065 2005-06-20  Martin Baulig  <martin@ximian.com>
16066
16067         * class.c (mono_class_is_assignable_from): Use a custom version of
16068         mono_class_has_parent() to make things work for generic instances;
16069         fix #75300.
16070
16071 2005-06-20  Martin Baulig  <martin@ximian.com>
16072
16073         * loader.c (method_from_methodspec): Apply a patch from
16074         Kamil Skalski <nazgul@nemerle.org> to fix #75296.
16075
16076 2005-06-20  Martin Baulig  <martin@ximian.com>
16077
16078         * class.c (mono_class_init): Reverted Zoltan's last change; it
16079         breaks generics.
16080
16081 2005-06-19  Zoltan Varga  <vargaz@freemail.hu>
16082
16083         * threads.c (wait_for_tids_or_state_change): Add missing locking.
16084
16085 2005-06-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16086
16087         * socket-io.c: fix the index in the socket array for writable/error
16088         sockets. Fixes bug #75306.
16089
16090 2005-06-17  Zoltan Varga  <vargaz@freemail.hu>
16091
16092         * class.c (mono_class_init): Allow interfaces to have static ctors.
16093
16094 2005-06-17  Martin Baulig  <martin@ximian.com>
16095
16096         * loader.c (method_from_methodspec): Use `context->container' when
16097         parsing the `gmethod->inst'.
16098
16099 2005-06-17  Martin Baulig  <martin@ximian.com>
16100
16101         * class.c (mono_type_get_name_recurse): Don't add the assembly
16102         name for type arguments.
16103
16104 2005-06-15  Martin Baulig  <martin@ximian.com>
16105
16106         * reflection.c (mono_image_get_inflated_method_token): Encode
16107         correct klass; fixes #75260.
16108
16109 2005-06-13 Michal Moskal <malekith@nemerle.org>
16110
16111         * icall.c: Make GetCorrespondingMethod/Constructor take
16112         MonoReflectionMethod method not MonoMethod. Removed
16113         MonoType.GetCorrespondingField, and make
16114         MonoGenericType.GetCorrespondingField take name not
16115         MonoClassField.
16116
16117 2005-06-13  Michal Moskal <malekith@nemerle.org>
16118
16119         * reflection.c (field_encode_signature, encode_locals):
16120          Make sizes of buffers for types larger (for big generic types).
16121          (create_generic_typespec,
16122          mono_reflection_sighelper_get_signature_local,
16123          mono_reflection_sighelper_get_signature_field):
16124          Add asserts for too small buffers.
16125
16126 2005-06-15  Martin Baulig  <martin@ximian.com>
16127
16128         * icall.c (ves_icall_MonoGenericClass_GetParentType): Return NULL
16129         if our parent is not a dynamic type.
16130
16131 2005-06-15  Martin Baulig  <martin@ximian.com>
16132
16133         * class-internals.h (MonoTypeNameFormat): New enum.
16134
16135         * class.c
16136         (mono_class_get_name_full): Renamed to mono_type_get_name_full().
16137         (mono_type_get_full_name): Removed.
16138         (mono_type_get_name_full): Take a `MonoTypeNameFormat format'
16139         argument instead of the boolean's.
16140
16141         * icall.c (ves_icall_System_MonoType_getFullName):
16142         Added `gboolean assembly_qualified'.    
16143
16144         * reflection.h
16145         (MonoTypeNameParse): Added `GPtrArray *type_arguments'.
16146
16147         * reflection.c (mono_reflection_parse_type): Parse the new type
16148         name format.
16149
16150 2005-06-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16151
16152         * icall.c: no need to convert from utf16 to utf8 and then back again
16153         after the call to GetLogicalDrives.
16154
16155 2005-06-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16156
16157         * icall.c: frombase64. Fix problems exposed by new tests.
16158
16159 2005-06-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16160
16161         * icall.c: added internal calls for converting char [] and strings in
16162         base64 into byte [].
16163
16164 2005-06-10  Martin Baulig  <martin@ximian.com>
16165
16166         * class.c (mono_class_create_generic_2): Read the nested classes
16167         from the metadata rather than from `gklass->nested_classes' since
16168         `gklass' might not be initialized yet.
16169
16170 2005-06-09  Duncan Mak  <duncan@novell.com>
16171
16172         * *.h: Added G_BEGIN_DECLS and G_END_DECLS where appropriate to
16173         all public headers. Fixes #74919.
16174
16175 2005-06-09  Lluis Sanchez Gual  <lluis@novell.com>
16176
16177         * domain.c: The key for proxy_vtable_hash is now a pointer
16178         array. Added new GHashFunc and GCompareFunc functions for this.
16179
16180         * class.h: The list of interfaces in MonoRemoteClass is known in
16181         advance and can't grow (we create a new MonoRemoteClass if needed),
16182         so now the interface array can be allocated together with
16183         MonoRemoteClass.
16184         
16185         * object.c: Added a new method create_remote_class_key.
16186         Fixed mono_remote_class so it does not depend on
16187         mono_upgrade_remote_class.
16188         Removed extend_interface_array.
16189         Added new method clone_remote_class(), which makes a copy of a remote
16190         class and adds a new interface or class to it.
16191         mono_upgrade_remote_class() now creates a new remote class (or gets
16192         it from the cache) if an vtable upgrade is needed. In this way
16193         we make sure that other objects sharing the same remote class
16194         don't get the new vtable with unwanted interfaces.
16195         
16196         * object-internals.h:
16197         * object.h: Moved mono_upgrade_remote_class to object-internals.h.
16198         
16199         * marshal.c: Track changes in mono_upgrade_remote_class().
16200
16201 2005-06-08  Kamil Skalski <nazgul@nemerle.org>
16202         * icall.c: Add runtime methods for obtaining members of inflated
16203         class, which were created from supplied non-inflated members. It
16204         is used in internal Get{Method,Constructor,Field} methods in
16205         System.Type
16206
16207 2005-06-09  Martin Baulig  <martin@ximian.com>
16208
16209         * reflection.c
16210         (mono_reflection_bind_generic_method_parameters): Fix #75169.
16211
16212 2005-06-08  Carlos Alberto Cortez <calberto.cortez@gmail.com>
16213         * reflection.c (mono_image_basic_init): Define
16214         Version in MonoDynamicAssembly. 
16215         
16216 2005-06-08  Martin Baulig  <martin@ximian.com>
16217
16218         Fix #75136.
16219
16220         * loader.c
16221         (mono_method_signature_full): New public method; takes a
16222         `MonoGenericContext *'.
16223         (find_method): Use mono_method_signature_full() and pass the
16224         klass'es context to it.
16225
16226         * class.c (mono_class_is_inflated_method): Use
16227         mono_method_signature_full() and pass the context to it.
16228
16229 Wed Jun 8 19:26:38 CEST 2005 Paolo Molaro <lupus@ximian.com>
16230
16231         * object.c: add proper locking in mono_remote_class_vtable(),
16232         fixes possible memory corruption.
16233
16234 2005-06-08  Michael Meeks  <michael.meeks@novell.com>
16235
16236         * marshal.c (mono_remoting_marshal_init): set
16237         initialized after initialization.
16238
16239 2005-06-08  Atsushi Enomoto  <atsushi@ximian.com>
16240
16241         * locales.c : hush.
16242
16243 2005-06-06  Michael Meeks  <michael.meeks@novell.com>
16244
16245         * object.c (extend_interface_array): fix really silly
16246         memory corrupting / comparison bug.
16247
16248 2005-06-07  Carlos Alberto Cortez <calberto.cortez@gmail.com>
16249
16250         * reflection.c: Functions added to support the creation
16251         of CustomAttributeData, which includes Attribute data
16252         used by ReflectionOnly methods.
16253
16254         * reflection.h:  mono_reflection_get_custom_attrs_data and
16255          mono_custom_attrs_data_construct added (functions exposed).
16256
16257          * icall.c: Added mono_reflection_get_custom_attrs_data
16258          as icall.
16259         
16260 2005-06-07  Zoltan Varga  <vargaz@freemail.hu>
16261
16262         * Makefile.am (libmonoruntime_la_SOURCES): Revert last change at
16263         lupus's request.
16264
16265 2005-06-06  Zoltan Varga  <vargaz@freemail.hu>
16266
16267         * icall.c (ves_icall_Mono_Runtime_GetDisplayName): Fix warning.
16268
16269         * reflection.c (reflection_methodbuilder_to_mono_method): Fix encoding of
16270         dynamic DllImportAttribute.
16271
16272         * icall.c (ves_icall_MonoMethod_GetDllImportAttribute): Fix decoding of 
16273         dynamic DllImportAttribute.
16274
16275         * Makefile.am (libmonoruntimeinclude_HEADERS): Export tabledefs.h too.
16276         Fixes #75162.
16277
16278 2005-06-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16279
16280         * threads.c: avoid segfault when an unstarted thread is aborted.
16281
16282 2005-06-05  Kornél Pál <kornelpal@hotmail.com>
16283
16284         * icall.c: Added ves_icall_Mono_Runtime_GetDisplayName:
16285         Returns the name and version of the runtime for reporting.
16286
16287 2005-06-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16288
16289         * appdomain.c: bump corlib version.
16290         * object-internals.h: new field in MonoReflectionAssembly.
16291
16292 2005-06-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16293
16294         * object-internals.h: Carlos forgot to add this field.
16295
16296 2005-06-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
16297
16298         * icall.c: Added create_version to create instances
16299         of Version of MonoReflectionAssemblyName. This change helps
16300         the AssemblyName tests to keep running fine.
16301         
16302 2005-06-03  Lluis Sanchez Gual  <lluis@novell.com>
16303   
16304         * object.c (mono_method_return_message_restore): A somehow less
16305         intrusive fix for #75138.
16306
16307 2005-06-03  Raja R Harinath  <rharinath@novell.com>
16308
16309         * object.c (mono_method_return_message_restore): Fix computation
16310         of expected number of out args.
16311
16312 2005-06-02  Zoltan Varga  <vargaz@freemail.hu>
16313
16314         * reflection.c (mono_image_get_method_info): Fix the case when the
16315         charset is empty.
16316
16317 2005-06-02  Lluis Sanchez Gual  <lluis@novell.com> 
16318
16319         * object.c: Added missing null check in
16320           mono_method_return_message_restore.
16321
16322 2005-06-02  Zoltan Varga  <vargaz@freemail.hu>
16323
16324         * reflection.c (mono_image_get_method_info): Handle the case when
16325         dllentry is empty.
16326
16327 2005-06-02  Lluis Sanchez Gual  <lluis@novell.com>
16328
16329         * object.c: When creating the vtable for a proxy, take into account
16330         all inherited interfaces, not only the ones registered in
16331         iclass->interfaces. This fixs bug #74996.
16332         Also, in mono_method_return_message_restore, verify that the array
16333         of out args has the expected lengh.
16334
16335 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16336
16337         * socket-io.c: update the timeout in Poll when the call is interrupte.
16338
16339 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16340
16341         * socket-io.c: support abort/suspend in Select_internal after last
16342         change.
16343
16344 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16345
16346         * threadpool.c: remove warning.
16347
16348 2005-06-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16349
16350         * icall.c:
16351         * socket-io.[ch]: Select_internal uses poll() now when available, thus
16352         removing the 1024 limit from select(). Runtime part of the fix for
16353         bug #71203.
16354
16355 2005-05-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16356
16357         * socket-io.c: when resolving the addresses for the same
16358         host returned by gethostname(), get the local IPs from the interface
16359         list. Loopback addresses are discarded if the are interfaces up with
16360         non-loopback ones. Fixes bug #63265.
16361
16362 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
16363
16364         * appdomain.c, verify.c, object-internals.h, reflection.c:
16365         bumped corlib number to 36, and added new extra_flags field
16366         to ReflectionMethodBuilder and friends.  Fixes #75060.
16367
16368 Fri May 27 14:45:56 CEST 2005 Paolo Molaro <lupus@ximian.com>
16369
16370         * gc.c: register a new weak link only if the object is non-null
16371         (fixes bug#75047).
16372
16373 2005-05-26  Atsushi Enomoto  <atsushi@ximian.com>
16374
16375         * culture-info.h : short time pattern too.
16376
16377 2005-05-26  Atsushi Enomoto  <atsushi@ximian.com>
16378
16379         * culture-info.h : expand long time pattern string length.
16380
16381 2005-05-25  Atsushi Enomoto  <atsushi@ximian.com>
16382
16383         * culture-info-table.h : update (more French date format; #72788).
16384
16385 2005-05-25  Zoltan Varga  <vargaz@freemail.hu>
16386
16387         * icall.c (ves_icall_InternalInvoke): Avoid type checks on this if
16388         the method is static. Fixes #75029.
16389
16390 2005-05-25  Lluis Sanchez Gual  <lluis@novell.com>
16391
16392         * reflection.c: Update the table_idx field of method builders after
16393         saving the module, since it can change. This is a workaround for
16394         bug #74914. 
16395
16396 2005-05-25  Atsushi Enomoto  <atsushi@ximian.com>
16397
16398         * culture-info-table.h : update (additional French date format).
16399
16400 2005-05-20  Zoltan Varga  <vargaz@freemail.hu>
16401
16402         * icall.c (ves_icall_type_Equals): Revert last change.
16403         
16404         * icall.c (ves_icall_type_Equals): Turn the g_print into an assert.
16405
16406         * icall.c (ves_icall_type_GetTypeCode): Rename the icall to GetTypeCodeInternal.
16407
16408 2005-05-20  Sebastien Pouliot  <sebastien@ximian.com>
16409
16410         * class-internals.h: Added executioncontext_class field to 
16411         MonoDefaults structure.
16412         * domain.c: Cache System.Threading.ExecutionContext class in 
16413         mono_defaults.
16414         * object.c: Capture the ExecutionContext for asynchroneous calls in
16415          mono_async_result_new.
16416         * object-internals.h: Added execution_context and original_context 
16417         fields to MonoAsyncResult. Added execution_context to MonoThread.
16418         * security-manager.c|.h: Added mono_get_context_capture_method to 
16419         return the capture method (if required by the security manager or by
16420         the framework version used).
16421         * threadpool.c: Apply capture (if present) ExecutionContext in 
16422         mono_async_invoke and revert to original context after it completes.
16423
16424 2005-05-19  Atsushi Enomoto  <atsushi@ximian.com>
16425
16426         * culture-info-table.h : updated (real hacky solution for zh-CHT).
16427
16428 2005-05-18  Atsushi Enomoto  <atsushi@ximian.com>
16429
16430         * culture-info-table.h : zh-CHT related workaround.
16431
16432 2005-05-12  Zoltan Varga  <vargaz@freemail.hu>
16433
16434         * marshal.c (emit_marshal_custom): Add some error checking and call the
16435         methods in the ICustomMarshaler interface. Fixes #74875.
16436         
16437         * marshal.c (emit_marshal_array): Implement [Out] marshalling in
16438         native->managed wrappers.
16439
16440 2005-05-12  Martin Baulig  <martin@ximian.com>
16441
16442         * mono-debug-debugger.cs (mono_debugger_lock/unlock): Always lock
16443         here and use the loader lock.
16444
16445         * mono-debug.c: Properly lock when the debugger is not attached.
16446         (mono_debug_init): Release the initial lock if we're not running
16447         in the debugger.
16448
16449 2005-05-12  Zoltan Varga  <vargaz@freemail.hu>
16450
16451         * marshal.c (emit_marshal_custom): Pass through NULL values without
16452         calling the custom marshalling routines.
16453
16454         * marshal.c (emit_ptr_to_object_conv): Implement ftnptr->delegate
16455         conversion in structures. Fixes #74882.
16456
16457 2005-05-12  Atsushi Enomoto  <atsushi@ximian.com>
16458
16459         * culture-info-table.h : zh-* cultures were missing.
16460
16461 2005-05-12  Lluis Sanchez Gual  <lluis@novell.com>
16462
16463         * threads.c: Added a new event background_change_event which is signaled
16464         when a thread changes its background mode.
16465         Moved here several checks previously done in managed code. The checks
16466         require the thread lock, and using the thread lock in managed code
16467         can result in deadlocks.
16468         Merged Start_internal and Thread_internal into a single method. Now 
16469         Thread_internal does all work of creating and starting a thread.
16470         Added icalls for setting and getting the state of the object. Moved from
16471         managed code to avoid locking there.
16472         Added wait_for_tids_or_state_change() which is called instad of
16473         wait_for_tids when waiting for non-backround threads to end. This method
16474         will return if one of the threads ends or the background_change_event
16475         is signaled.
16476         * threadpool.c: use ves_icall_System_Threading_Thread_SetState() to set
16477         the background mode. This method signals the background_change_event
16478         event.
16479         * icall.c:
16480         * threads-types.h: Added icalls for ClrState, SetState and GetState, and
16481         removed Start_internal.
16482         
16483 2005-05-11  Martin Baulig  <martin@ximian.com>
16484
16485         * mono-debug.h (MonoSymbolTable, MonoDebugMethodAddress): Changed
16486         to order of some fields to get proper alignment on 64-bit machines.
16487
16488 2005-05-11  Martin Baulig  <martin@ximian.com>
16489
16490         * mono-debug.c, mono-debug-debugger.c: Revert Paolo's locking
16491         changes as they're broken and completely fuck up the debugger.
16492
16493         * mono-debug.c (mono_debug_add_method): Properly unlock on error.
16494
16495 2005-05-10  Martin Baulig  <martin@ximian.com>
16496
16497         * reflection.c (mono_reflection_generic_class_initialize): Don't
16498         call mono_class_setup_parent() here.
16499
16500 2005-05-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16501
16502         * metadata/socket-io.c: on windows, getsockopt/setsockopt for
16503         send/receive timeout use an integer in milliseconds. We were using a
16504         struct timeval.
16505
16506 2005-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16507
16508         * locales.c:
16509         (internal_get_cultures): reserve the first slot of the array for the
16510         InvariantCulture, which will be filled in managed code.
16511
16512 2005-05-06  Zoltan Varga  <vargaz@freemail.hu>
16513
16514         * reflection.c (mono_image_fill_module_table): Initialize the
16515         GENERATION field as well.
16516
16517 2005-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16518
16519         * monitor.c: ignore calls to Monitor.Exit even if no one ever called
16520         Monitor.Enter on the object.
16521
16522 2005-05-05  Lluis Sanchez Gual  <lluis@novell.com>
16523
16524         * threads.c: Enable the wait for running threads when exiting.
16525         * icall.c: Suspend all threads before exiting.
16526
16527 2005-05-05  Zoltan Varga  <vargaz@freemail.hu>
16528
16529         * assembly.c (mono_assembly_load_reference): Fix warning.
16530
16531 2005-05-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16532
16533         * threadpool.c: changed the default number of threads per cpu. From now
16534         on, the default will be 20 + (5 * number of cpus) instead of 50.
16535
16536 2005-05-04  Zoltan Varga  <vargaz@freemail.hu>
16537
16538         * loader.c (mono_method_get_signature_full): Add locking here.
16539
16540 2005-05-03  Lluis Sanchez Gual <lluis@novell.com>
16541
16542         * appdomain.c: Moved methods for parsing and freeing assembly
16543         names to assembly.c.
16544         * assembly.c, domain-internals.h: Created public methods for parsing
16545         assembly names. Fixed mono_assembly_load_with_partial_name:
16546         it now finds the best match, taking into account the version,
16547         token and culture specified in the partial name. Also return
16548         the latest version if no version information is specified.
16549
16550 Mon May 2 15:47:57 CEST 2005 Paolo Molaro <lupus@ximian.com>
16551
16552         * threadpool.c: replace check for SocketAsyncCall class.
16553
16554 2005-05-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16555
16556         * threadpool-internals.h:
16557         * Makefile.am: added threadpool-internals.h
16558
16559         * threadpool.c: call mono_unhandled_exception on exceptions not handled
16560         that happen in threadpool threads (tested on MS).
16561         (mono_thread_pool_remove_socket): new function that dispatch any pending
16562         AIO call on a socket that is closing. By now only epoll really needs it,
16563         as select/poll wake up when the socket closes.
16564
16565
16566         * socket-io.c: call mono_thread_pool_remove_socket in Close_internal.
16567
16568 2005-05-01  Zoltan Varga  <vargaz@freemail.hu>
16569
16570         * marshal.c (mono_marshal_get_managed_wrapper): Handle changing the calling convention.
16571
16572 2005-05-01  Lluis Sanchez Gual  <lluis@novell.com>
16573
16574         * gc.c: In mono_gc_cleanup(), wait for 2 seconds, not 2000 seconds.
16575
16576 2005-04-30  Lluis Sanchez Gual  <lluis@novell.com>
16577
16578         * threads.c: In mono_thread_suspend_all_other_threads, if a thread
16579         has an abort request, convert it into a suspend request.
16580
16581 2005-04-30  Ben Maurer  <bmaurer@ximian.com>
16582
16583         * marshal.c (mono_marshal_get_managed_wrapper): give a friendly
16584         warning for the usage of `UnmanagedFunctionPointerAttribute' which
16585         is not supported yet.
16586
16587 2005-04-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16588
16589         * image.c: register assemblies loaded from data (bundles) in the loaded
16590         assemblies hash. Fixes bug #74772.
16591
16592 2005-04-29  Martin Baulig  <martin@ximian.com>
16593
16594         * class.c (mono_type_get_name_recurse): Update to the new naming
16595         schema from the latest .NET 2.x beta2.
16596         (mono_class_setup_vtable_general): If we're a generic instance,
16597         copy the vtable from our generic type definition and inflate all
16598         the methods in it.
16599
16600         * loader.c (find_method): Update to the new naming schema from the
16601         latest .NET 2.x beta2.
16602
16603 2005-04-29  Raja R Harinath  <harinath@gmail.com>
16604
16605         * class.c (mono_class_init): Add a mono_loader_unlock to the
16606         #74734 fix.
16607
16608 2005-04-28  Zoltan Varga  <vargaz@freemail.hu>
16609
16610         * icall.c (ves_icall_System_Environment_Exit): Remove the 
16611         suspend_all_other_threads () call for the time being, since it can hang.
16612
16613         * threads.c (mono_thread_manage): Similarly, disable the waiting for
16614         the background threads to exit, since it can also hang.
16615
16616         * class.c (mono_class_init): Applied patch from Ankit Jain 
16617         (radical@gmail.com). Avoid pending init errors when a field refers
16618         to a nested class using a typeref. Fixes #74734.
16619
16620         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): Fix
16621         this for dynamic modules.
16622
16623 2005-04-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16624
16625         * threads.c: don't wait for threads that are in the process of aborting
16626         or aborted. Set the 'shutting_down' flag before cleaning the threadpool
16627         and waiting for background threads to finish. This makes xsp and
16628         mod-mono-server exit without random length delays and/or hangs.
16629
16630 2005-04-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16631
16632         * icall.c: remove duplicate assignment from GetReferencedAssemblies.
16633
16634 2005-04-25  Zoltan Varga  <vargaz@freemail.hu>
16635
16636         * class.c (mono_class_is_assignable_from): Call is_assignable_to for
16637         dynamic types to prevent infinite loops. Fixes #74727.
16638
16639         * reflection.c (mono_reflection_call_is_assignable_from): Rename to
16640         ..._is_assignable_to.
16641
16642 2005-04-25  Sebastien Pouliot  <sebastien@ximian.com>
16643
16644         * security.c: Fixed #74698 where sysconf returned -1 on FreeBSD.
16645
16646 2005-04-25  Martin Baulig  <martin@ximian.com>
16647
16648         Upgrade to the latest .NET 2.x beta (Visual Studio 2005 Beta 2).
16649
16650         * domain.c
16651         (supported_runtimes): Change "v2.0.40607" -> "v2.0.50215".
16652
16653         * row-indexes.h (MONO_GENERICPARAM_KIND): Removed.
16654
16655         * reflection.c (build_compressed_metadata): Set metadata header
16656         version to 2.0.
16657
16658 2005-04-23  Zoltan Varga  <vargaz@freemail.hu>
16659
16660         * sysmath.c (ves_icall_System_Math_Round2): Use modf to decompose the
16661         number into an integral and a decimal part. Fixes #70473.
16662
16663         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf): Ignore static fields. Fixes #74703.
16664
16665 2005-04-23  Atsushi Enomoto  <atsushi@ximian.com>
16666
16667         * culture-info-table.h : reflected the latest locale-builder output.
16668
16669 2005-04-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16670
16671         * threadpool.c: check for SuspendRequested too when deciding if
16672         mono_thread_interruption_checkpoint should be called.
16673
16674 2005-04-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16675
16676         * appdomain.[ch]: added function to set the shutting_down flag to TRUE.
16677         * threads.c: remove interruption_mutex and use Interlocked instead. When
16678         suspending all the threads, wait for all the suspended events at once.
16679         If we're shutting down and get an APC that is going to be queued,
16680         call mono_thread_execute_interruption immediately, as the thread might
16681         be sleeping on a pthread condition or mutex.
16682
16683         * icall.c: call mono_runtime_set_shutting_down before suspending the
16684         threads.
16685
16686         Fixes bug #74693. And now xsp is happier when exiting.
16687
16688 2005-04-22  Zoltan Varga  <vargaz@freemail.hu>
16689
16690         * loader.c (mono_stack_walk): Fix #74690.
16691
16692 2005-04-22  Martin Baulig  <martin@ximian.com>
16693
16694         * mono-debug.h (MonoDebugMethodJitInfo): Added
16695         `MonoDebugMethodJitInfo *jit'.
16696
16697         * mono-debug.c (mono_debug_read_method): Cache the
16698         MonoDebugMethodJitInfo in `address->jit'.
16699         (mono_debug_free_method_jit_info): New public method.
16700
16701 2005-04-22  Martin Baulig  <martin@ximian.com>
16702
16703         * class.c (mono_class_is_assignable_from): Disallow
16704         type parameter -> interface.
16705
16706 2005-04-21  Dick Porter  <dick@ximian.com>
16707
16708         * threads.c (mono_thread_create): Turn an assertion into an error.
16709
16710 2005-04-20  Zoltan Varga  <vargaz@freemail.hu>
16711
16712         * threads.c object.c icall.c: Fix some gcc 4.0 warnings.
16713         
16714         * threads.c marshal.h marshal.c exceptions.h exceptions.c appdomain.c: 
16715         Fix some gcc 4.0 warnings.
16716
16717 Wed Apr 20 16:09:06 CEST 2005 Paolo Molaro <lupus@ximian.com>
16718
16719         * file-io.c: fix alt dir separator char on unix systems
16720         and cleanup (fixes bug #71214).
16721
16722 2005-04-19  Lluis Sanchez Gual  <lluis@novell.com>
16723
16724         * marshal.c: Use CALLVIRT instead of CALL when dispatching
16725         a call to a remote domain, since the method may be an
16726         interface method in the client domain. This fixes bug #74192.
16727
16728 2005-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16729
16730         * threadpool.c: recv/send are now performed before going back to managed
16731         code to save one transition.
16732
16733 2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16734
16735         * metadata/socket-io.c: fixed semantics in Socket.Blocking icall.
16736
16737         * metadata/threadpool.c: removed hack to workaround the bug above.
16738
16739         Fixes bug #74618.
16740
16741 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
16742
16743         * reflection.c reflection.h: Fix handling of parameter defaults in
16744         dynamic methods. Also fixes handling of parameter attributes.
16745         Fixes #74609.
16746
16747         * mono-debug.c (mono_debug_close_image): Fix warning.
16748
16749 2005-04-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16750
16751         * socket-io.h: replaced old unused field with new 'blocking'.
16752         * threadpool.c: restore socket blocking state on windows(tm).
16753
16754 2005-04-14  Sebastien Pouliot  <sebastien@ximian.com>
16755
16756         * icall.c: don't return the codebase in the AssemblyName[] returned by
16757         ves_icall_System_Reflection_Assembly_GetReferencedAssemblies.
16758         * object-internals.h: Removed FIXME (fields were presents) and fixed
16759         versioncompat declaration.
16760
16761 2005-04-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16762
16763         * threadpool.c: sometimes we get EBADF from epoll but the epollfd is
16764         not closed, so don't cleanup when it happens.
16765
16766 2005-04-13  Chris Toshok  <toshok@ximian.com>
16767
16768         * mono-debug-debugger.h: change prototype for
16769         mono_debugger_lookup_type.
16770
16771         * mono-debug-debugger.c (mono_debugger_lookup_type): reinstate
16772         this function, although it should probably be named
16773         mono_debugger_init_type.
16774
16775 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16776
16777         * threadpool.c: fix non-AIO case.
16778
16779 2005-04-13  Zoltan Varga  <vargaz@freemail.hu>
16780
16781         * profiler.c (mono_profiler_install_simple): Add a 'jit' option to
16782         the built-in profiler to measure just JIT compilation times.
16783
16784 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16785
16786         * threadpool.c: the epollfd might be closed by another thread at
16787         any time, so ignore EBADF at treat it as a "we're closing" sign.
16788
16789 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16790
16791         * threadpool.c: release the semaphores with a count equals to the number
16792         of working threads in both IO and regular pools. Fixed typo that messed
16793         up the count of IO pool threads. Don't initialize the pipe handles if
16794         we're using epoll.
16795
16796 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16797
16798         * threadpool.c: some systems don't like a NULL when deleting the socket
16799         from epoll.
16800
16801 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16802
16803         * threadpool.c: fix semaphore allocation.
16804
16805 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16806
16807         * threadpool.c: added epoll() based implementation for asynchronous IO
16808         that is used instead of the default poll() when available.
16809         It can be disabled by setting MONO_DISABLE_AIO.
16810
16811 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16812
16813         * threadpool.c: windows needs 'closesocket' and instead of returning
16814         0 when the stream is closed while in select, it returns -1. Fixes bug
16815         #74573.
16816
16817 2005-04-12  Zoltan Varga  <vargaz@freemail.hu>
16818
16819         * class.c (class_compute_field_layout): Fix the regression caused by
16820         the previous try.
16821
16822 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16823
16824         * threadpool.c: separate pool for socket async. IO.
16825         * threadpool.h: mono_max_worker_threads is not a global any more.
16826
16827 2005-04-10  Zoltan Varga  <vargaz@freemail.hu>
16828
16829         * class.c (class_compute_field_layout): Fix #74549.
16830
16831 2005-04-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16832
16833         * threadpool.c: select() on windows doesn't allow pipe handles, soooo
16834         use 2 connected sockets instead.
16835
16836 2005-04-08  Miguel de Icaza  <miguel@novell.com>
16837
16838         * mono-config.c: Add new entry point for mkbundle
16839         mono_config_parse_memory. 
16840
16841 2005-04-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16842
16843         * threadpool.c: removed another unused function.
16844
16845 2005-04-08  Ankit Jain  <radical@corewars.org>
16846
16847         * reflection.c (get_default_param_value_blobs): Add 'types'
16848         parameter to get the types encoded in the constant table.
16849         (mono_param_get_objects): Use the type from the constant table,
16850         not the type of the parameter, when creating default values.
16851         Handle null default values correctly.
16852
16853 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16854
16855         * file-io.c:
16856         * file-io.h:
16857         * threadpool.c:
16858         * threadpool.h:
16859         * icall.c:
16860         * socket-io.c: removed dead code for async IO.
16861
16862 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16863
16864         * socket-io.h: 2 more fields in MonoSocketAsyncResult.
16865
16866         * threadpool.c: intercept socket async. calls and pass them to a thread
16867         that is polling and dispatching the job items to the threadpool as
16868         socket become ready. Fixes bugs #71217, #71933.
16869
16870         * icall.c: Removed AsyncReceive and AsyncSend. Speed up for copies
16871         between char and short/ushort arrays.
16872
16873         * socket-io.c: remove dead code.
16874
16875 2005-04-06  Atsushi Enomoto  <atsushi@ximian.com>
16876
16877         * locales.c,
16878           icall.c : removed InternalToUpper_Comp() and
16879           InternalToLower_Comp().
16880
16881 2005-04-06  Atsushi Enomoto  <atsushi@ximian.com>
16882
16883         * char-conversions.h : The tables were incorrectly generated. Should
16884           be generated against invariant culture.
16885
16886 2005-04-04  Zoltan Varga  <vargaz@freemail.hu>
16887
16888         * object.c (mono_runtime_invoke_array): Fix return value when 
16889         passing pre-created valuetype objects to ctors.
16890
16891         * gc.c (mono_gchandle_is_in_domain): Applied patch from Jon Larimer 
16892         (jlarimer@gmail.com). Avoid crashes when the wrapper object is null.
16893         Fixes #74338.
16894
16895 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
16896
16897         * domain.c: removed g_assert for runtimesecurityframe_class. This is 
16898         only used with --security and hides the wrong corlib version error.
16899
16900 2005-03-30  Joshua Tauberer  <tauberer@for.net>
16901
16902         * class.c: Changed mono_class_name_from_token so that types
16903         outside of a namespace don't have an initial period.  Improved
16904         the g_warning message used in _mono_class_get when loading
16905         fails.
16906         * assembly.c: In mono_assembly_load_reference, when an assembly
16907         can't be found, "No such file or directory" is misleading and
16908         unhelpful because a few paths were checked for the presence of
16909         the assembly.  When that happens (ENOENT), display a nicer
16910         message indicating the directories that were searched.  In all
16911         cases, the warning is made easier to read for non-hackers.
16912
16913 2005-03-29  Sebastien Pouliot  <sebastien@ximian.com>
16914
16915         * assembly.c: Set MONO_ASSEMBLIES to NULL when compiling from a VS.NET
16916         project/solution.
16917         * appdomain.h|domain.c: Removed inline from functions.
16918         * appdomain.c: Reduced warnings when compiling on windows.
16919         * icall.c: Fixed output_debug declaration to gunichar2*.
16920         * mono-config.c: Reduced warnings when compiling on windows.
16921         * rand.c: Added missing "windows.h". Added missing return value.
16922         * rawbuffer.c: Added missing winsock2.h for windows.
16923         * sysmath.h: Added mono-compiler.h header to allow/ease 
16924         compilation with non-GCC compilers.
16925         * threads.c: Fixed declarations to compile with VS.NET C compiler.
16926         Removed cast warnings.
16927
16928         Adapted from the work of J Lothian (for VC6).
16929
16930 2005-03-29  Zoltan Varga  <vargaz@freemail.hu>
16931
16932         * assembly.c (mono_assembly_load_corlib): Do not try loading corlib
16933         from default_path.
16934
16935 2005-03-27  Zoltan Varga  <vargaz@freemail.hu>
16936
16937         * marshal.c (mono_marshal_get_managed_wrapper): Fix bogus assert on
16938         the 2.0 profile.
16939
16940 2005-03-27  Raja R Harinath  <harinath@gmail.com>
16941
16942         * Makefile.am (assembliesdir): Fix.  If it is arch-dependent it
16943         has to be in $(exec_prefix).  $(prefix) is for arch-independent
16944         stuff, and it would probably use $(prefix)/share rather than
16945         $(prefix)/lib.
16946
16947 2005-03-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16948
16949         * console-io.c: added 2 includes that might be missing.
16950
16951 2005-03-24  Zoltan Varga  <vargaz@freemail.hu>
16952
16953         * marshal.c (mono_marshal_get_managed_wrapper): Fix crashes in 2.0
16954         profile.
16955
16956         * reflection.c (create_custom_attr): Allocate the params array using
16957         alloca so it gets GC tracking.
16958
16959 2005-03-23  Chris Toshok  <toshok@ximian.com>
16960
16961         * mono-debug-debugger.c (mono_debugger_runtime_invoke): comment
16962         out some spew.
16963
16964 2005-03-24  Raja R Harinath  <rharinath@novell.com>
16965
16966         * Makefile.am (assembly.lo, mono-config.lo): Rebuild when Makefile
16967         changes to pick up any changes in prefix, etc.
16968
16969 2005-03-23  Zoltan Varga  <vargaz@freemail.hu>
16970
16971         * marshal.c (mono_marshal_get_managed_wrapper): Remove fixme.
16972         
16973         * marshal.c (mono_marshal_get_managed_wrapper): Remove debugging output.
16974         * marshal.c (mono_marshal_get_managed_wrapper): Add support for the modopt(CallConvCdecl).
16975
16976 2005-03-23  Zoltan Varga  <vargaz@freemail.hu>
16977
16978         * class-internals.h object-internals.h class.c reflection.c: Extend the
16979         mono_lookup_dynamic_token () function to return the class of the
16980         token as well. 
16981
16982         * class.c (mono_ldtoken): Handle MEMBERREFS in the dynamic case as
16983         well. Fixes #73848.
16984
16985 2005-03-23  Sebastien Pouliot  <sebastien@ximian.com>
16986
16987         * security-manager.c: Skip inheritance checks for intra-corlib
16988         class inheritance and method overrides. This skips a lot of checks
16989         and (anyway) permissions cannot work until corlib is loaded.
16990
16991 2005-03-23  Martin Baulig  <martin@ximian.com>
16992
16993         * marshal.c (mono_marshal_get_stfld_wrapper): Add support for
16994         MONO_TYPE_GENERICINST.  
16995
16996 2005-03-23  Martin Baulig  <martin@ximian.com>
16997
16998         * metadata.c (mono_type_to_unmanaged): Add MONO_TYPE_GENERICINST.
16999
17000 Tue Mar 22 16:57:01 CET 2005 Paolo Molaro <lupus@ximian.com>
17001
17002         * class.c: added locking comments to some functions.
17003         Cache the interface offsets arrays (saves about 20 KB
17004         of runtime memory in a typical app).
17005         Reduce the time overhead in mono_class_setup_supertypes ().
17006
17007 Tue Mar 22 16:35:57 CET 2005 Paolo Molaro <lupus@ximian.com>
17008
17009         * icall.c: speedup and fix leaks in GetMethodsByName and
17010         GetPropertiesByName.
17011
17012 Tue Mar 22 16:34:29 CET 2005 Paolo Molaro <lupus@ximian.com>
17013
17014         * reflection.c: some locking fixes.
17015
17016 Tue Mar 22 15:13:54 CET 2005 Paolo Molaro <lupus@ximian.com>
17017
17018         * metadata.c: added missing break in case statement.
17019
17020 2005-03-22  Zoltan Varga  <vargaz@freemail.hu>
17021
17022         * marshal.c (mono_marshal_get_runtime_invoke): Add support for
17023         typedbyref return values. Fixes #73941.
17024
17025 2005-03-17  Sebastien Pouliot  <sebastien@ximian.com>
17026
17027         * security-manager.c|h: Added demandunmanaged method and 
17028         suppressunmanagedcodesecurity class to MonoSecurityManager.
17029         Renamed aptc class to allowpartiallytrustedcallers.
17030
17031 2005-03-17  Martin Baulig  <martin@ximian.com>
17032
17033         * class.c (inflate_generic_type): Add MONO_TYPE_ARRAY.
17034
17035 2005-03-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17036
17037         * file-io.c: disabled file async. IO using aio_*. It uses the
17038         threadpool now. Workaround for bug #73718.
17039
17040 Wed Mar 16 18:08:00 CET 2005 Paolo Molaro <lupus@ximian.com>
17041
17042         * assembly.h, mono-config.c: added code to deal with bundled configs
17043         for bundled assemblies.
17044
17045 Wed Mar 16 16:34:38 CET 2005 Paolo Molaro <lupus@ximian.com>
17046
17047         * *.c, private.h: cleanup, removing old private.h header file.
17048
17049 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
17050
17051         * reflection.c (mono_image_get_method_info): Encode best_fit_mapping
17052         and throw_on_unmappable_char attributes.
17053
17054 2005-03-13  Sebastien Pouliot  <sebastien@ximian.com>
17055
17056         * process.c: Fix buffer length in ves_icall_System_Diagnostics_Process
17057         _ProcessName_internal.
17058
17059 2005-03-13  Zoltan Varga  <vargaz@freemail.hu>
17060
17061         * object.c (mono_array_new_full): Fix aligning of array size. Fixes
17062         #73631.
17063
17064         * icall.c threads.c threads-types.h: Remove slothash icalls as they
17065         are no longer used.
17066
17067 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
17068
17069         * object.c (compute_class_bitmap): Add support for generics. Fixes
17070         #73527.
17071
17072 2005-03-10  Zoltan Varga  <vargaz@freemail.hu>
17073
17074         * reflection.c (mono_reflection_create_runtime_class): Fix 2.0 build.
17075
17076 2005-03-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17077
17078         * filewatcher.c: commented out the code for windows watcher, as we don't
17079         use it (we use the managed implementation instead).
17080
17081 2005-03-10  Zoltan Varga  <vargaz@freemail.hu>
17082
17083         * object-internals.h (MonoThread): Remove 'unused1' field.
17084
17085         * appdomain.c: Bump corlib version.
17086
17087         * marshal.c: Remove calls to Reset/RestoreDataStoreStatus ().
17088
17089         * reflection.c (mono_reflection_create_runtime_class): Remove the
17090         AssemblyBuilder.Save optimization since it causes too many problems.
17091
17092 2005-03-10  Sebastien Pouliot  <sebastien@ximian.com>
17093
17094         * exception.c|h: Added mono_get_exception_reflection_type_load to
17095         create a ReflectionTypeLoadException object.
17096         * icall.c: Updated ves_icall_System_Reflection_Assembly_InternalGetType
17097         to return NULL is a InheritanceDemand fails during reflection. Updated
17098         ves_icall_System_Reflection_Assembly_GetTypes to throw a 
17099         ReflectionTypeLoadException if an InheritanceDemand fails during 
17100         reflection. Added icall mapping for GetLinkDemandSecurity.
17101         * security-manager.c|h: Added ves_icall_System_Security_
17102         SecurityManager_GetLinkDemandSecurity internal call to return the
17103         class and methods permissions set for a LinkDemand. Removed unused
17104         fields in MonoSecurityManager.
17105
17106 2005-03-10  Martin Baulig  <martin@ximian.com>
17107
17108         * class.c (mono_bounded_array_class_get): Initialize `eclass' if
17109         it's a generic instance.
17110
17111 2005-03-09  Zoltan Varga  <vargaz@freemail.hu>
17112
17113         * reflection.c (mono_get_object_from_blob): Applied patch from
17114         Ankit Jain (radical@gmail.com). Fix enum default values. Fixes #73457.
17115
17116         * class.c (mono_class_is_assignable_from): Another try at fixing 
17117         #73469 without breaking anything.
17118
17119 2005-03-08  Zoltan Varga  <vargaz@freemail.hu>
17120
17121         * class.c: (mono_class_is_assignable_from): Revert the last changes
17122         since they don't work with generics.
17123         
17124         * class.c (mono_class_is_assignable_from): Fix build bustage.
17125
17126         * class.c (mono_class_is_assignable_from): If oklass is dynamic, call
17127         the managed IsAssignableFrom method. Fixes #73469.
17128
17129         * reflection.c (mono_reflection_call_is_assignable_from): New helper
17130         function.
17131
17132 2005-03-04  Zoltan Varga  <vargaz@freemail.hu>
17133
17134         * object.c (mono_load_remote_field_new): Fix returning uninitialized
17135         memory when the remoting callback does not sets the out arguments.
17136         Fixes #73007.
17137
17138         * marshal.c (mono_delegate_free_ftnptr): Remove debug array checked in
17139         by mistake.
17140
17141         * string-icalls.c: Return String.Empty where needed. Fixes #73310.
17142
17143         * object-internals.h (MonoStackFrame): Sync with managed object layout.
17144
17145         * appdomain.c: Bump corlib version.
17146
17147 2005-03-03  Zoltan Varga  <vargaz@freemail.hu>
17148
17149         * gc-internal.h boehm-gc.c null-gc.c: Add mono_gc_is_gc_thread () API
17150         function.
17151
17152         * threads.c (mono_thread_attach): Detect threads which are not started
17153         by the GC pthread wrappers.
17154
17155 2005-03-03  Sebastien Pouliot  <sebastien@ximian.com>
17156
17157         * icall.c: Added new icall for RNG.
17158         * rand.c|h: Added new icall to open the RNG. This allows to share a 
17159         single handle on Linux to access /dev/urandom and fix #73183.
17160
17161 Thu Mar 3 17:53:17 CET 2005 Paolo Molaro <lupus@ximian.com>
17162
17163         * object.c: setting the new vtable in a transparent proxy object must
17164         not change the GC descriptor.
17165
17166 Thu Mar 3 12:11:46 CET 2005 Paolo Molaro <lupus@ximian.com>
17167
17168         * object.c: fixed compilation without GCJ support.
17169         * reflection.c: for runtime-created types ensure klass->has_references
17170         is correct (bug #73215).
17171
17172 2005-03-02  Martin Baulig  <martin@ximian.com>
17173
17174         * class.c (mono_class_is_assignable_from): Make this work if
17175         `oklass' is a generic instance; fixes #72831.
17176
17177 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
17178
17179         * marshal.c (mono_marshal_get_managed_wrapper): Fix handling of methods
17180         with hasthis set.
17181         
17182         * marshal.c (emit_marshal_array): Emit native->managed marshalling of blittable arrays.
17183
17184         * marshal.c: Reorganize native->managed marshalling code to also use
17185         the emit_marshal_... functions.
17186
17187 Tue Mar 1 16:16:42 CET 2005 Paolo Molaro <lupus@ximian.com>
17188
17189         * object.c: typed allocs have issues with bitmap sizes > 30,
17190         so check for max_set >= 30.
17191
17192 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
17193
17194         * marshal.c (emit_marshal_array): Implement marshalling of arrays to
17195         managed code. Fixes #73012.
17196
17197         * metadata.h (MonoMarshalSpec): Add elem_mult field.
17198
17199         * metadata.c reflection.c: Load/Emit elem_mult as well.
17200         
17201         * metadata.h (MonoMarshalSpec): Add comment.
17202
17203         * metadata.h: Add MONO_MARSHAL_CONV_LPTSTR_STR.
17204
17205         * metadata.c (mono_metadata_parse_marshal_spec): Set param_num and
17206         num_elem to -1 if not given.
17207
17208         * object-internals.h (MonoReflectionMarshal): Add has_size field.
17209
17210         * reflection.c (encode_marshal_blob): Differentiate between 0 and not
17211         given values.
17212
17213 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
17214
17215         * null-gc.c (mono_gc_free_fixed): Was not compilable.
17216
17217 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
17218
17219         * reflection.c (encode_marshal_blob): Encode param_num field as well.
17220
17221         * object-internals.h (MonoReflectionMarshal): Add param_num field.
17222
17223 Mon Feb 28 11:59:42 CET 2005 Paolo Molaro <lupus@ximian.com>
17224
17225         * object.c: generalized the reference bitmap creation
17226         and added hooks for the new GC.
17227         * class-internals.c: removed the gc_bitmap field from MonoClass.
17228
17229 Sat Feb 26 16:06:59 CET 2005 Paolo Molaro <lupus@ximian.com>
17230
17231         * domain.c: help the compiler to produce better code
17232         in mono_jit_info_table_find ().
17233
17234 Fri Feb 25 16:50:14 CET 2005 Paolo Molaro <lupus@ximian.com>
17235
17236         * object.c: make all allocations look typed.
17237
17238 Fri Feb 25 16:18:59 CET 2005 Paolo Molaro <lupus@ximian.com>
17239
17240         * socket-io.c: load Mono.Posix if it's not loaded already
17241         (fixes bug#73033).
17242
17243 2005-02-24  Martin Baulig  <martin@ximian.com>
17244
17245         * class.c (dup_type): Correctly duplicate MONO_TYPE_PTR.
17246         * reflection.c (dup_type): Likewise.
17247
17248 2005-02-24  Zoltan Varga  <vargaz@freemail.hu>
17249
17250         * gc.c (run_finalize): Set the domain for finalizing delegates as well.
17251         Thanks to Willibald Krenn and Scott Mohekey for tracking this down.
17252
17253 Thu Feb 24 15:19:35 CET 2005 Paolo Molaro <lupus@ximian.com>
17254
17255         * domain.c, threads.c, object-internals.h: make the critical thread
17256         local vars use the fast access mode (even when we're compiled in
17257         a lib). Provide accessors to be used by the jit during codegen.
17258
17259 2005-02-24  Carlos Alberto Cortez <calberto.cortez@gmail.com>
17260
17261         * appdomain.c: Changed hook functios behavior to include
17262         support for the reflection only assemblies. Some icalls were changed
17263         to support the mentioned assemblies too. Signatures of static methods
17264         try_assembly_resolve and real_load now have an additional parameter:
17265         refonly.
17266
17267         * assembly.c: General changes to mono_assembly_ methods to support
17268         reflection only api. Functions mono_assembly_open, mono_assembly_load,
17269         mono_assembly_load_from and mono_assembly_loaded have got a '_full'
17270         suffix, to support an additional gbool parameter to specify whether
17271         the assembli is reflection only or not. Created some new hook functions 
17272         to add support for reflection only assemblies. Signatures of static 
17273         methods load_in_path, search_loaded, and mono_assembly_load_from_gac 
17274         have now an additional parameter: refonly.
17275
17276         * metadata-internals.h: MonoAssembly now has a gbool ref_only flag,
17277         indicating whether the assembly is reflection only or not.
17278
17279         * exception.c: Add mono_get_exception_invalid_operation.
17280
17281         * icall.c: Throw an InvalidOperationException when trying to invoke
17282         a property/method/event, or trying to set/get the value of a field.
17283         Also add an icall to retrieve the ref_only flag to the
17284         MonoReflectionAssembly.
17285
17286 2005-02-23  Chris Toshok  <toshok@ximian.com>
17287
17288         Part of fix for #72827.
17289         * mono-debug.c (mono_debug_add_method): add lexical block data to
17290         the info we write.  Kind of a hack at the moment - we copy the
17291         lexical block info from the MonoDebugMethodInfo to the
17292         MonoDebugMethodJitInfo here, before writing it.
17293         (mono_debug_read_method): read the lexical block info.
17294
17295         * mono-debug.h (_MonoDebugMethodJitInfo): add lexical block slots.
17296
17297         * debug-mono-symfile.h: add lexical block support.
17298
17299         * debug-mono-symfile.c (mono_debug_find_method): add lexical block
17300         support.
17301
17302 2005-02-23  Zoltan Varga  <vargaz@freemail.hu>
17303
17304         * loader.c (mono_lookup_pinvoke_call): Fix warning.
17305
17306         * object.c (mono_runtime_free_method): Call mono_free_method () and
17307         put the TODOs there.
17308
17309         * loader.c (mono_free_method): Free up most memory allocated for 
17310         dynamic methods.
17311
17312 Wed Feb 23 18:54:26 CET 2005 Paolo Molaro <lupus@ximian.com>
17313
17314         * reflection.c: properly flag a Type argument to a
17315         named custom attr value (bug #72248).
17316
17317 Wed Feb 23 18:32:35 CET 2005 Paolo Molaro <lupus@ximian.com>
17318
17319         * reflection.c: reduce code duplication in named custom
17320         attribute encoding.
17321
17322 Wed Feb 23 17:23:52 CET 2005 Paolo Molaro <lupus@ximian.com>
17323
17324         * reflection.c: properly encode custom attrs of type object
17325         (bug #72649).
17326
17327 2005-02-23  Zoltan Varga  <vargaz@freemail.hu>
17328
17329         * marshal.c (mono_delegate_free_ftnptr): Make this thread safe.
17330
17331 Tue Feb 22 21:54:47 CET 2005 Paolo Molaro <lupus@ximian.com>
17332
17333         * socket-io.c: load System.dll if it's not loaded already
17334         (bug #72850 and #70477).
17335
17336 2005-02-21  Martin Baulig  <martin@ximian.com>
17337
17338         * marshal.c (mono_marshal_get_runtime_invoke): Add support for
17339         generic instances.
17340
17341 2005-02-21  Martin Baulig  <martin@ximian.com>
17342
17343         * reflection.c (mono_image_build_metadata): We also need to
17344         "fixup" the MethodImpl table after we computed the final method
17345         indices.  Call fixup_methodimpl() to do that.
17346         (fixup_methodimpl): New private method.
17347
17348 Mon Feb 21 16:17:14 CET 2005 Paolo Molaro <lupus@ximian.com>
17349
17350         * assembly.c: special case mscorlib.dll (bug#72536),
17351         patch from Carlos Alberto Cortez.
17352
17353 2005-02-20  Zoltan Varga  <vargaz@freemail.hu>
17354
17355         * threads-types.h threads.c: Fix build bustage.
17356
17357         * threads.c: Use a union for long<->double conversions.
17358
17359         * threads-types.h threads.c icall.c: Implement the net 2.0 interlocked
17360         functions based on a patch by Luca Barbieri (luca.barbieri@gmail.com).
17361
17362         * marshal.c (emit_thread_interrupt_checkpoint_call): Mark the bblock 
17363         containing the checkpoint call with NOT_TAKEN.
17364         
17365         * marshal.c (mono_marshal_get_managed_wrapper): Emit interrupt 
17366         checkpoint before pushing the arguments, so they won't have to be
17367         spilled to stack.
17368
17369 Sat Feb 19 15:19:46 CET 2005 Paolo Molaro <lupus@ximian.com>
17370
17371         * domain.c, assembly.c, domain-internals.h: make some data
17372         const and relocation-free.
17373
17374 Sat Feb 19 11:12:34 CET 2005 Paolo Molaro <lupus@ximian.com>
17375
17376         * object.c, appdomain.c, class-internals.h: introduce the
17377         MonoClassRuntimeInfo structure to hold the info needed to
17378         use a class at runtime. Made mono_class_vtable() lock-free
17379         for all the appdomains.
17380
17381 Sat Feb 19 11:11:12 CET 2005 Paolo Molaro <lupus@ximian.com>
17382
17383         * metadata-internals.h, image.c: introduce a per-image mempool to
17384         be used for memory that has the same lifetime as the image.
17385
17386 2005-02-18  Lluis Sanchez Gual  <lluis@novell.com>
17387
17388         * domain.c: In mono_init_internal(), instead of selecting the first
17389         runtime version supported by an executable, get a list of all
17390         supported versions and select the one for which an mscorlib exists
17391         (since even if the runtime supports a given version, it doesn't mean
17392         that the framework for that version is installed).
17393         Modified get_runtimes_from_exe to support this behavior.
17394         In supported_runtimes, added information about additional system
17395         assembly versions.
17396         
17397         * assembly.c: Added support for more than one system assembly version
17398         per runtime version. Updated the assembly list.
17399         In mono_assembly_remap_version, removed the initial version check,
17400         since we don't know to which version we need to compare until we
17401         get the version set on which the assembly is based.
17402         Moved the code for loading corlib into the new method
17403         mono_assembly_load_corlib(), so it can be used by the initialization
17404         code.
17405         
17406         * domain-internals.h: Updated data structures and added declaration
17407         for mono_assembly_load_corlib.
17408
17409 2005-02-17  Zoltan Varga  <vargaz@freemail.hu>
17410
17411         * reflection.c (resolve_object): Fix the creation of the signature in 
17412         the SignatureHelper case.
17413
17414         * assembly.c (mono_assembly_remap_version): Fix binary search.
17415         
17416 2005-02-17  Sebastien Pouliot  <sebastien@ximian.com>
17417  
17418         * class.c: Added inheritance check when a method is overloaded (from a
17419         virtual method or when implementing an interface) and when a class is
17420         inherited. Added functions to set a failure for a class and to 
17421         retreive the exception from a failure.
17422         * class-internals.h: Added fields to MonoClass to keep the exception
17423         information status for inheritance (or other exceptions) to be thrown
17424         later (i.e. not at load time).
17425         * object.c: Throw the inheritance SecurityException when a type is to 
17426         be created with either class or method inheritance violations.
17427         * reflection.c|h: Fix when getting declsec from a class. Removed 
17428         unrequired code for class. Improved sanity in parameter naming.
17429         * security-manager.c|h: Added functions to check for class and method
17430         inheritance.
17431
17432 2005-02-17  Zoltan Varga  <vargaz@freemail.hu>
17433
17434         * reflection.c (mono_reflection_create_runtime_class): Set has_cctor
17435         and has_finalize in dynamic types as well.
17436
17437 2005-02-17  Atsushi Enomoto  <atsushi@ximian.com>
17438
17439         * culture-info-table.h : fixed currency format for en-GB (and so on).
17440
17441 Wed Feb 16 16:28:15 CET 2005 Paolo Molaro <lupus@ximian.com>
17442
17443         * gc.c: ensure the GC handles never have 0 as a value.
17444
17445 2005-02-16  Zoltan Varga  <vargaz@freemail.hu>
17446
17447         * marshal.c (emit_marshal_ptr): Raise an exception if trying to pass
17448         a pointer to a struct to unmanaged code. Fixes #72625.
17449
17450 2005-02-16  Martin Baulig  <martin@ximian.com>
17451
17452         * mono-debug.c (mono_debug_open_image): Ignore dynamic images.
17453
17454 2005-02-16  Zoltan Varga  <vargaz@freemail.hu>
17455
17456         * marshal.c (emit_marshal_array): Only marshal unicode char arrays as [Out].
17457
17458 2005-02-15  Zoltan Varga  <vargaz@freemail.hu>
17459
17460         * loader.c (mono_lookup_pinvoke_call): Fix stdcall name mangling.
17461
17462         * marshal.c (mono_ftnptr_to_delegate): If the delegate has the 
17463         UnmanagedFunctionPointerAttribute, use it for determining calling convention
17464         etc. Fixes #71471.
17465
17466         * reflection.c (mono_custom_attrs_get_attr): New helper function.
17467
17468         * object-internals.h: Add MonoReflectionUnmanagedFunctionPointerAttribute.
17469
17470 Tue Feb 15 18:03:41 CET 2005 Paolo Molaro <lupus@ximian.com>
17471
17472         * domain.c, appdomain.c, appdomain.h, object-internals.h, object.h:
17473         changes to make the current context a field in MonoThread.
17474
17475 2005-02-15  Zoltan Varga  <vargaz@freemail.hu>
17476
17477         * marshal.c (mono_marshal_get_native_wrapper): Fix a crash caused by
17478         the last change.
17479         
17480         * marshal.c (mono_marshal_emit_native_wrapper): New helper function
17481         extracted from mono_marshal_get_native_wrapper.
17482
17483         * marshal.c (mono_marshal_get_native_func_wrapper): New helper function
17484         to create wrappers around native functions.
17485
17486         * marshal.c (mono_ftnptr_to_delegate): Add support for creating 
17487         delegates for arbitrary function pointers. Fixes #71472.
17488
17489 Tue Feb 15 11:01:09 CET 2005 Paolo Molaro <lupus@ximian.com>
17490
17491         * threads.c: cleaned up the code a little.
17492
17493 2005-02-15  Martin Baulig  <martin@ximian.com>
17494
17495         * mono-debug.h (MonoSymbolTable): Allow variable-length chunks in
17496         the data table.
17497
17498         * mono-debug.c (DATA_TABLE_CHUNK_SIZE): Set to 32768; we may now
17499         allocate larger chunks if needed.
17500
17501 2005-02-14  Zoltan Varga  <vargaz@freemail.hu>
17502
17503         * threads.c (start_wrapper): Remove #ifdef PLATFORM_WIN32 probably left
17504         in by mistake.
17505
17506 Mon Feb 14 16:48:24 CET 2005 Paolo Molaro <lupus@ximian.com>
17507
17508         * domain.c: keep the domains in an array and ensure the domain ids
17509         are kept small, so they can be used as indexes to domain-specific data
17510         with a small memory overhead.
17511
17512 2005-02-14  Zoltan Varga  <vargaz@freemail.hu>
17513
17514         * icall.c: Handle byref types in Type icalls. Fixes #72544.
17515
17516 Mon Feb 14 15:39:56 CET 2005 Paolo Molaro <lupus@ximian.com>
17517
17518         * Makefile.am: remove libmetadata: we build just libmonoruntime now.
17519
17520 2005-02-13  Zoltan Varga  <vargaz@freemail.hu>
17521
17522         * tabledefs.h (MANIFEST_RESOURCE_VISIBILITY_MASK): Add flags for ManifestResource.
17523
17524         * loader.c (mono_lookup_pinvoke_call): Correct the search order used for different CharSet
17525         values.
17526
17527         * marshal.c (mono_marshal_get_string_encoding): CHAR_SET_AUTO means Unicode on windows.
17528         
17529 2005-02-12  Ben Maurer  <bmaurer@ximian.com>
17530
17531         * domain-internals.h: add the hashtable here.
17532
17533         * class-internals.h: Remove `info' from MonoMethod
17534
17535         * domain.c: Add a new hashtable, jit_trampoline_hash
17536
17537 Fri Feb 11 17:11:20 CET 2005 Paolo Molaro <lupus@ximian.com>
17538
17539         * object.c: don't set the value of static fields
17540         (fixes bug#72494).
17541
17542 2005-02-11  Martin Baulig  <martin@ximian.com>
17543
17544         * mono-debug.c (DATA_TABLE_CHUNK_SIZE): Increase to 131072.
17545         (mono_debug_add_method): Silently ignore the method if it's too big.
17546         (mono_debug_add_type): Likewise.
17547
17548 Fri Feb 11 16:22:10 CET 2005 Paolo Molaro <lupus@ximian.com>
17549
17550         * threads.c, appdomain.c: remove #ifdefs from the code.
17551
17552 2005-02-10  Sebastien Pouliot  <sebastien@ximian.com>
17553
17554         * metadata-internals.h: Added flags to MonoAssembly to cache the most
17555         common security informations. This allows us to stay in unmanaged code
17556         when doing LinkDemand and it's special cases (except for the first 
17557         time for initialization). The flags a very much used with --security.
17558         * reflection.c|h: Added code to get declarative security attributes 
17559         for LinkDemand and InheritanceDemand. This required to refactor the
17560         existing code for Demand.
17561         * security-manager.c|h: Added new method fields for the special cases
17562         of LinkDemand.
17563
17564 2005-02-10  Martin Baulig  <martin@ximian.com>
17565
17566         * icall.c (ves_icall_MonoDebugger_MakeArrayType): New interncall.
17567         (ves_icall_MonoDebugger_GetTypeToken): New interncall.
17568
17569 2005-02-10  Martin Baulig  <martin@ximian.com>
17570
17571         * mono-debug.c, mono-debug-debugger.c: Completely reworked the
17572         debugging code; this is almost a complete rewrite.
17573
17574         * icall.c (ves_icall_MonoDebugger_GetMethodIndex): New interncall.
17575
17576 Thu Feb 10 15:19:01 CET 2005 Paolo Molaro <lupus@ximian.com>
17577
17578         * domain.c, object.h: expose mono_string_equal () and 
17579         mono_string_hash ().
17580         * icall.c, string-icalls.c: remove the string.GetHashCode () icall,
17581         it's implemented in managed code.
17582
17583 Thu Feb 10 15:03:46 CET 2005 Paolo Molaro <lupus@ximian.com>
17584
17585         * icall.c, gc.c, gc-internal.h: make sure gchandles can't be used
17586         lo leak objects between appdomains.
17587
17588 Thu Feb 10 14:25:00 CET 2005 Paolo Molaro <lupus@ximian.com>
17589
17590         * assembly.c: old compilers compilation fix from 
17591         robertj@gmx.net (Robert Jordan).
17592
17593 2005-02-09  Ben Maurer  <bmaurer@ximian.com>
17594
17595         * class-internals.h: Little reminder for the future.
17596
17597         * debug-helpers.c: Fix up wrapper_type_names
17598
17599 Wed Feb 9 19:34:29 CET 2005 Paolo Molaro <lupus@ximian.com>
17600
17601         * image.c, metadata-internals.h: when loading an image from a file,
17602         mmap all of it and use the same codepaths as when using a
17603         in-memory image: the code is simpler and we use less memory
17604         (both writable and readonly).
17605
17606 Wed Feb 9 18:32:51 CET 2005 Paolo Molaro <lupus@ximian.com>
17607
17608         * gc-internal.h, null-gc.c, boehm-gc.c: added functions to the GC
17609         API to alloc runtime data structures that need to be tracked by the
17610         GC and contain pointers.
17611         * appdomain.c, threads.c, object.c, gc.c: use the above changes to
17612         make the code more readable and eventually use a different GC.
17613
17614 2005-02-09  Zoltan Varga  <vargaz@freemail.hu>
17615
17616         * marshal.c (emit_marshal_vtype): Don't do managed->native conversion
17617         for out arguments.
17618         
17619 2005-02-09  Lluis Sanchez Gual  <lluis@novell.com>
17620
17621         * object.c: In release_type_locks(), don't release the cctor lock
17622         if it has already been released. This fixes a crash in the
17623         thread5 test.
17624
17625 Tue Feb 8 19:02:59 CET 2005 Paolo Molaro <lupus@ximian.com>
17626
17627         * gc.c, marshal.c, icall.c: register a delegate for finalization
17628         only when the native function pointer has been allocated for it.
17629
17630 Tue Feb 8 18:12:27 CET 2005 Paolo Molaro <lupus@ximian.com>
17631
17632         * object.c: cleaned up some code, allocate objects that are
17633         pointer free with the atomic malloc variant. Allocate memory
17634         for static data from the mempool if it's pointer-free.
17635         Allocate the bounds array at the end of the array data, when needed.
17636         * object-internals.h, object.h: move a private function in a private
17637         header.
17638         * class.c: handle missing case in tracking references in fields.
17639
17640 Tue Feb 8 18:04:51 CET 2005 Paolo Molaro <lupus@ximian.com>
17641
17642         * class.c, class-internals.h: keep track if a type has
17643         reference fields in either the instance or static fields.
17644
17645 2005-02-07  Lluis Sanchez Gual  <lluis@novell.com>
17646
17647         * domain.c, domain-internals.h: Moved RuntimeInfo to domain-internals.h,
17648         and renamed to MonoRuntimeInfo. Added fields to store the expected
17649         framework assembly version. Changed mono_get_framework_version and
17650         mono_get_runtime_version for a single mono_get_runtime_info method.
17651         
17652         * assembly.c: Added method to remap system assembly versions to the
17653         current executing runtime version. Removed old mapping code.
17654         Remap assembly versions in mono_assembly_load and mono_assembly_loaded.
17655         
17656         * icall.c, reflection.c: Track api changes.
17657
17658 2005-02-06  Miguel de Icaza  <miguel@novell.com>
17659
17660         * loader.c (method_from_memberref): Improve error reporting,
17661         produce the class name instead of the typeref/typedef index. 
17662
17663 2005-02-07  Zoltan Varga  <vargaz@freemail.hu>
17664
17665         * marshal.c (mono_marshal_get_stfld_remote_wrapper): Fix wrapper type.
17666
17667 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
17668
17669         * loader.c (mono_lookup_pinvoke_call): Allow for combination of
17670         stdcall and charset name mangling.  Reorganize the code and add
17671         some tracing stuff.
17672
17673 2005-02-05  Ben Maurer  <bmaurer@ximian.com>
17674
17675         * monodiet.c: More iters!
17676
17677         * marshal.c: Iter usage.
17678
17679         * icall.c: Iter usage.
17680
17681         * object.c: Use iters.
17682
17683         * debug-helpers.c: More iters
17684
17685 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
17686
17687         * loader.c (mono_lookup_pinvoke_call): Add brute-force checking for mangled function names
17688         under win32.
17689
17690 2005-02-05  Ben Maurer  <bmaurer@ximian.com>
17691
17692         * mono-debug-debugger.c: use iters
17693
17694         * class.c, class-internals.h: mono_class_setup_events is static
17695         now
17696
17697         * All callers: use iters
17698
17699 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
17700
17701         * class.c string-icalls.c marshal.c reflection.c: Applied patch from
17702         Robert Jordan (robertj@gmx.net). Fix compilation errors under gcc-2.95.
17703
17704 2005-02-04  Zoltan Varga  <vargaz@freemail.hu>
17705
17706         * object.c (mono_class_proxy_vtable): Add missing _setup () calls.
17707
17708         * marshal.h: Add prototypes for ldfld/stfld_remote.
17709
17710         * appdomain.c (mono_domain_fire_assembly_load): Handle the case when
17711         this is called during startup.
17712         
17713 Fri Feb 4 20:27:58 CET 2005 Paolo Molaro <lupus@ximian.com>
17714
17715         * appdomain.c, monitor.c, monitor.h, threads-types.h: made the
17716         MonoThreadsSync struct private in monitor.c. Changed the way
17717         MonoThreadsSync is allocated so it's faster and there is no
17718         need to keep track of it with a finalizer and it uses less memory.
17719         This also finally allows us to allocate mono objects as ptrfree when
17720         there are no reference fields.
17721
17722 Fri Feb 4 20:24:03 CET 2005 Paolo Molaro <lupus@ximian.com>
17723
17724         * gc.c, null-gc.c, boehm-gc.c, gc-internal.h: added functions to deal with
17725         disappearing link to the GC interface and use them to simplify
17726         the gchandles code.
17727
17728 2005-02-04  Zoltan Varga  <vargaz@freemail.hu>
17729
17730         * class-internals.h marshal.c: Add two new wrappers, ldfld_remote and
17731         stfld_remote which call mono_load/store_field_new. This allows methods
17732         calling ldfld/stfld wrappers to be AOTed.
17733
17734         * console-io.c: Include sys/filio.h under solaris.
17735         
17736         * console-io.c: Include curses.h if needed correctly.
17737
17738 2005-02-03  Zoltan Varga  <vargaz@freemail.hu>
17739         
17740         * icall.c (ves_icall_MonoMethod_get_base_definition): Initialize
17741         method->klass as well.
17742
17743         * class-internals.h (MonoCachedClassInfo): Add 'finalize_image' field.
17744
17745         * class.c (mono_class_init): Switch on lazy initialization of 
17746         methods.
17747
17748         * class.c (mono_class_get_finalizer): Handle the case when the 
17749         finalizer is inherited.
17750
17751 2005-02-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17752
17753         * console-io.c: <curses.h> is needed by term.h on solaris.
17754
17755 2005-02-03  Ben Maurer  <bmaurer@ximian.com>
17756
17757         * icall.c, class-internals.h, monodiet.c, class.c: Remove
17758         mono_class_setup_properties where possible. Remove this ftn from
17759         the header file, and make it static.
17760
17761 2005-02-03  Zoltan Varga  <vargaz@freemail.hu>
17762
17763         * loader.c: Add missing setup_... call.
17764
17765         * class.c: Add missing setup_... calls.
17766
17767         * class.c (mono_class_init): Switch on lazy initialization of 
17768         the generic vtable.
17769         
17770         * class.c (mono_class_init): Fix generics broken by the recent changes.
17771
17772         * monodiet.c (handle_type): Add missing setup_... calls.
17773
17774         * class.c: Back out garbage in previous patch.
17775         
17776         * class.c: Add missing setup_... calls.
17777
17778         * class.c (mono_class_get_method_from_name_flags): Avoid calling
17779         mono_class_setup_methods () if possible.
17780
17781         * class-internals.h (MonoClass): Add 'has_cctor' flag.
17782
17783         * class-internals.h (MonoCachedClassInfo): New structure.
17784
17785         * class.c: Initialize properties and events fields of MonoClass lazily.
17786
17787         * class.c: Add infrastructure for lazily initializing the methods and
17788         vtable fields of MonoClass. Not yet used.
17789
17790         * class.c (mono_class_get_finalizer): New helper function.
17791
17792         * class.c: Add infrastructure for loading some class related data from
17793         an AOT file.
17794
17795         * object.c: Add infrastructure for initializing the vtable from data
17796         in the AOT file.
17797
17798         * gc.c (run_finalize): Use mono_class_get_finalizer ().
17799
17800         * class.c loader.c object.c icall.c gc.c reflection.c: Call the
17801         appropriate initialization function before accessing parts of the
17802         MonoClass structure.
17803
17804         * marshal.c: Fix warnings.
17805         
17806         * marshal.c (emit_marshal_array): Add missing 'break'. Fixes #72169.
17807
17808         * mono-debug-debugger.c (get_exception_message): Use 
17809         mono_class_get_method_from_name_flags ().
17810
17811 2005-02-02  Ben Maurer  <bmaurer@ximian.com>
17812
17813         * reflection.c, appdomain.c: Replace a few manual searches that
17814         Zoltan missed. (Paolo approved this part of my initial patch).
17815
17816 Wed Feb 2 16:32:08 CET 2005 Paolo Molaro <lupus@ximian.com>
17817
17818         * profiler.c: disable recording statistical events at report time.
17819
17820 Wed Feb 2 14:14:00 CET 2005 Paolo Molaro <lupus@ximian.com>
17821
17822         * icall.c: patch from Geoff Norton <gnorton@customerdna.com>
17823         to byteswap arrays of enum values, too (bug #72080).
17824
17825 2005-02-02  Zoltan Varga  <vargaz@freemail.hu>
17826
17827         * appdomain.c (set_domain_search_path): Allow this to be called if
17828         domain->setup is not yet set.
17829
17830         * loader.c (mono_method_get_index): New helper function.
17831
17832         * loader.c reflection.c: Use mono_method_get_index ().
17833
17834         * class.c (mono_class_get_method_from_name_flags): New helper method.
17835
17836         * debug-helpers.h debug-helpers.c (mono_find_method_by_name): Remove
17837         this.
17838
17839         * class.c (mono_class_get_cctor): New helper method.
17840
17841         * string-icalls.c object.c class.c marshal.c reflection.c: Use
17842         mono_class_get_method () to look up methods.
17843
17844 2005-02-01  Miguel de Icaza  <miguel@novell.com>
17845
17846         * console-io.c: Fix the build, this should work on Windows.
17847
17848 2005-01-31  Ben Maurer  <bmaurer@ximian.com>
17849
17850         * marshal.c (mono_marshal_xdomain_copy_out_value): cached_str must
17851         be set to null to keep things valid
17852
17853 2005-01-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17854
17855         * icall.c: added Console 2.0 icalls.
17856         * Makefile.am: added console-io.[ch]
17857         * console-io.[ch]: internal calls for Console 2.0 API.
17858
17859 Mon Jan 31 19:01:29 CET 2005 Paolo Molaro <lupus@ximian.com>
17860
17861         * class.c: make sure we consider all the interfaces
17862         when calculating max_interface_id (bug found by
17863         Jeroen Frijters running ikvm).
17864
17865 2005-01-31  Zoltan Varga  <vargaz@freemail.hu>
17866
17867         * icall.c (ves_icall_FieldInfo_SetValueInternal): Handle setting of
17868         valuetype fields to null.
17869
17870         * object.c (set_value): Ditto. Fixes #71669.    
17871
17872 2005-01-31  Martin Baulig  <martin@ximian.com>
17873
17874         * metadata.c (mono_metadata_has_generic_params): New public
17875         function; checks whether something is a generic method.
17876
17877 Sun Jan 30 20:19:48 CET 2005 Paolo Molaro <lupus@ximian.com>
17878
17879         * appdomain.c: fix infinite recursion when adding assemblies.
17880
17881 2005-01-30  Sebastien Pouliot  <sebastien@ximian.com>
17882
17883         * object.c: Fix small typo to return all items for Environment.
17884         GetCommandLineArgs.
17885
17886 Sun Jan 30 16:49:01 CET 2005 Paolo Molaro <lupus@ximian.com>
17887
17888         * domain.c, appdomain.c, assembly.c, image.c, domain-internals.h,
17889         reflection.c: more domain and assembly-unload related fixes
17890         and memory leaks plugs.
17891
17892 2005-01-30  Zoltan Varga  <vargaz@freemail.hu>
17893
17894         * 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.
17895
17896 2005-01-29  Ben Maurer  <bmaurer@ximian.com>
17897
17898         * loader.c (mono_method_signature): Make this method lazy
17899         (mono_get_method_from_token): Don't computate the signature here.
17900
17901         Doing this saves quite a bit of memory. I got 90 kb on starting up
17902         monodoc. It should also save some disk reads on startup.
17903
17904         * *: MonoMethod->signature might be NULL now. You *MUST* use
17905         mono_method_signature.
17906
17907 2005-01-29  Zoltan Varga  <vargaz@freemail.hu>
17908
17909         * object.c (mono_runtime_get_main_args): Return an array from the
17910         current domain here. Fixes #71938.
17911
17912 Sat Jan 29 15:59:05 CET 2005 Paolo Molaro <lupus@ximian.com>
17913
17914         * monitor.c: formatting changes to comply with the
17915         mono coding style and remove #ifdefs from the code.
17916
17917 Sat Jan 29 15:18:54 CET 2005 Paolo Molaro <lupus@ximian.com>
17918
17919         * metadata.c, private.h: remove some unneeded data
17920         and use a more compact representation for table schemas.
17921
17922 Fri Jan 28 18:23:44 CET 2005 Paolo Molaro <lupus@ximian.com>
17923
17924         * metadata.c, metadata-internals.h: add mono_aligned_addr_hash()
17925         to get a better distribution in hash tables.
17926         * *.c: use mono_aligned_addr_hash() where appropriate.
17927         * assembly.c: make var static.
17928
17929 2005-01-28  Zoltan Varga  <vargaz@freemail.hu>
17930
17931         * domain-internals.h: Put MonoJitInfo on a diet.
17932
17933         * domain.c: Fix a warning.
17934
17935 Wed Jan 26 22:20:46 CET 2005 Paolo Molaro <lupus@ximian.com>
17936
17937         * gc.c: rework the gc handles code to reuse handles
17938         when freed.
17939
17940 Wed Jan 26 17:34:09 CET 2005 Paolo Molaro <lupus@ximian.com>
17941
17942         * domain.c: fixed long standing bug in mono_string_equal() which
17943         was brought to light with the ldstr changes.
17944
17945 2005-01-26  Sebastien Pouliot  <sebastien@ximian.com>
17946
17947         * reflection.c: Remove warning by adding missing include for marshal.h
17948
17949 Tue Jan 25 18:06:00 CET 2005 Paolo Molaro <lupus@ximian.com>
17950
17951         * domain.c, object.c: change the ldstr_table to hold
17952         MonoString* as keys: makes the runtime isinterned lookup
17953         faster and simplifies memory management.
17954
17955 2005-01-25  Sebastien Pouliot  <sebastien@ximian.com> 
17956  
17957         * icall.c: Renamed GetEnvironmentVariable so internal* so it was
17958         possible to add imperative security checks before calling the icall.
17959         * reflection.c: Return security attributes on the original MonoMethod
17960         (and not the wrapped one). This fix permissions on icalls.
17961
17962 2005-01-25  Dick Porter  <dick@ximian.com>
17963
17964         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Make
17965         the check for mktime() support actually test the mktime() return
17966         value.  "Fixes" bug 71682, though the output is still different to
17967         MS.
17968
17969 2005-01-25  Martin Baulig  <martin@ximian.com>
17970
17971         * class.c (mono_class_is_assignable_from): Make this work for
17972         generic instances.
17973
17974 2005-01-24  Ben Maurer  <bmaurer@ximian.com>
17975
17976         * marshal.c (mono_string_utf8_to_builder)
17977         (mono_string_builder_to_utf16): We might not have ownership of the
17978         string. In thise case, we need to create a new buffer.
17979
17980         * object-internals.h (mono_stringbuilder_capacity): sb->str might
17981         be null, in which case, use the default capacity.
17982
17983 Mon Jan 24 16:42:29 CET 2005 Paolo Molaro <lupus@ximian.com>
17984
17985         * gc-internal.h, null-gc.c, profiler.c, boehm-gc.c: hook the
17986         GC events to the profiler.
17987
17988 Mon Jan 24 15:59:54 CET 2005 Paolo Molaro <lupus@ximian.com>
17989
17990         * gc.c: remove valgrind detection nonsense. Set GC_DONT_GC
17991         if you don't want the GC to run.
17992
17993 Mon Jan 24 15:53:25 CET 2005 Paolo Molaro <lupus@ximian.com>
17994
17995         * Makefile.am, gc.c, mono-gc.h, boehm-gc.c, null-gc.c, gc-internal.h:
17996         start providing a GC API and keeping different implementations in
17997         their own file.
17998         * profiler.h, profiler.c, profiler-private.h: provide the GC events API.
17999
18000 2005-01-22  Ben Maurer  <bmaurer@ximian.com>
18001
18002         * debug-mono-symfile.c (mono_debug_open_mono_symbol_file): Use
18003         mmap rather than allocating a huge buffer.
18004         (mono_debug_close_mono_symbol_file): Free the buffer allocated
18005         above.
18006
18007 2005-01-22  Sebastien Pouliot  <sebastien@ximian.com>
18008
18009         * icall.c: Add new internal calls for SecurityManager.SecurityEnabled
18010         and CheckExecutionRights.
18011         * reflection.c|h: Keep the index of the declarative security to be 
18012         used, instead of the pointer, when AOT compiler is used. Also add 
18013         class initialization when requesting demands.
18014         * security-manager.c|h: Implement SecurityManager.SecurityEnabled and
18015         CheckExecutionRights. Both properties are now FALSE by default, and
18016         unmodifiable, unless the --security option is used.
18017
18018 Fri Jan 21 15:29:27 CET 2005 Paolo Molaro <lupus@ximian.com>
18019
18020         * domain.c, appdomain.c, assembly.c, image.c, metadata-internals.h,
18021         reflection.c: properly refcount images and assemblies, many leaks fixed.
18022
18023 2005-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18024
18025         * threadpool.c: increase the timeout for threads in the thread pool to
18026         10s.  Fixes bug #67159.
18027
18028 2005-01-20  Bernie Solomon  <bernard@ugsolutions.com>
18029
18030         * class-internals.h: Sun's compiler insists on explicit
18031         signed on bit fields to handle then correctly.
18032
18033 2005-01-19  Miguel de Icaza  <miguel@ximian.com>
18034
18035         * file-io.c (ves_icall_System_IO_MonoIO_get_InvalidPathChars):
18036         Make the size of the array fit only the number of invalid path
18037         chars that we have.
18038
18039         * class.c (_mono_class_get): Improve the error reporting when a
18040         class referenced is not found, to assist debugging. 
18041
18042 Wed Jan 19 19:57:43 CET 2005 Paolo Molaro <lupus@ximian.com>
18043
18044         * threads.c: fix off-by-one error.
18045         * domain.c: free data allocated in the domain.
18046
18047 2005-01-19  Zoltan Varga  <vargaz@freemail.hu>
18048
18049         * reflection.c (mono_method_body_get_object): Fill out exception info
18050         as well.
18051
18052         * object-internals.h: Add MonoReflectionExceptionHandlingClause 
18053         structure.
18054         
18055 2005-01-19  Martin Baulig  <martin@ximian.com>
18056
18057         * loader.c (mono_get_method_constrained): Make this work again.
18058
18059 2005-01-19  Zoltan Varga  <vargaz@freemail.hu>
18060
18061         * object-internals.h (_MonoReflectionMethodBody): Make local_index a 
18062         guint16 to match the managed side.
18063
18064         * reflection.c (mono_reflection_body_get_object): Fill out local
18065         variables array.
18066
18067         * reflection.c (mono_method_body_get_object): Fill out local_var_sig_token
18068         as well.
18069
18070         * object-internals.h (_MonoReflectionMethodBody): Rename 'sig_token' to
18071         'local_var_sig_token'.
18072
18073 2005-01-18  Zoltan Varga  <vargaz@freemail.hu>
18074
18075         * loader.c (mono_lookup_pinvoke_call): Revert the previous patch as it breaks 
18076         System.Drawing.
18077
18078         * reflection.c (mono_method_body_get_object): Handle abstract and
18079         runtime methods.
18080
18081 Mon Jan 17 19:22:39 CET 2005 Paolo Molaro <lupus@ximian.com>
18082
18083         * marshal.c, loader.c, class-internals.h, reflection.c:
18084         store the emthod data for a wrapper in an array instead of a list.
18085
18086 Mon Jan 17 18:48:53 CET 2005 Paolo Molaro <lupus@ximian.com>
18087
18088         * marshal.c: change the code to allocate memory more
18089         conservatively for method wrappers.
18090
18091 Mon Jan 17 18:03:30 CET 2005 Paolo Molaro <lupus@ximian.com>
18092
18093         * class-internals.h, marshal.c: move the str_to_ptr and ptr_to_str
18094         fields from MonoClass to the marshal info structure where they belong.
18095
18096 Mon Jan 17 16:14:46 CET 2005 Paolo Molaro <lupus@ximian.com>
18097
18098         * class.c, object.c, class-internals.h, marshal.c: rearrange
18099         some fields and tweak some types to lower memory usage.
18100
18101 2005-01-17  Zoltan Varga  <vargaz@freemail.hu>
18102
18103         * threads.c (signal_thread_state_change): Handle the case when the
18104         target thread is the current thread.
18105
18106         * marshal.c (mono_struct_delete_old): Do not free lpwstr fields.
18107
18108         * marshal.c: Rename emit_ptr_to_str_conv and its pair to 
18109         emit_ptr_to_object_conv. 
18110
18111         * marshal.c (emit_ptr_to_object_conv): Add support for lpwstr->str
18112         marshalling. Fixes #71352.
18113
18114 Mon Jan 17 10:59:20 CET 2005 Paolo Molaro <lupus@ximian.com>
18115
18116         * metadata.h, blob.h: move table enum to blob.h so it can be included
18117         in any header.
18118         * image.c, metadata.c, metadata-internals.h, pedump.c, reflection.c:
18119         cut the size of MonoImage/MonoDynamicImage.
18120
18121 2005-01-16  Zoltan Varga  <vargaz@freemail.hu>
18122
18123         * profiler.c (mono_profiler_install_simple): Fix default arguments.
18124
18125 Sun Jan 16 12:25:22 CET 2005 Paolo Molaro <lupus@ximian.com>
18126
18127         * reflection.c, reflection.h, icall.c: add a function to check
18128         if an attribute type is defined for a metadata object.
18129
18130 2005-01-14  Lluis Sanchez Gual  <lluis@novell.com>
18131
18132         * object-internals.h: Added some needed fields from StringBuilder class.
18133         * marshal.c: Set the maxCapacity when creating a StringBuilder.
18134
18135 2005-01-13  Zoltan Varga  <vargaz@freemail.hu>
18136
18137         * icall.c (ves_icall_System_Environment_Exit): Suspend all managed
18138         threads before shutting down the runtime.
18139
18140         * threads.c (mono_thread_suspend_all_other_threads): New helper function.
18141
18142 Thu Jan 13 18:16:35 CET 2005 Paolo Molaro <lupus@ximian.com>
18143
18144         * object-internal.h, threads.c: implement stacksize and 
18145         parameterized thread start functionality (requires
18146         matching corlib). Marked broken code for later removal.
18147
18148 2005-01-12  Martin Baulig  <martin@ximian.com>
18149
18150         * class-internals.h (MonoGenericClass): Moved the `initialized'
18151         flag to MonoDynamicGenericClass, removed `init_pending'.
18152         (MonoGenericInst): Added `is_reference' flag.
18153
18154 2005-01-12  Zoltan Varga  <vargaz@freemail.hu>
18155
18156         * reflection.c (mono_image_create_pefile): Only set the pe_offset
18157         inside the MSDOS header. Fixes #71201.
18158
18159         * gc.c (mono_gc_cleanup): Handle the case when this is called from the
18160         gc thread.
18161         (mono_domain_finalize): Ditto.
18162
18163 2005-01-12  Martin Baulig  <martin@ximian.com>
18164
18165         * class.c (mono_get_shared_generic_class): Use the cache for
18166         non-dynamic generic classes.
18167
18168         * class-internals.h (mono_class_create_generic_2): Removed
18169         function prototype, this function is now static inside class.c.
18170
18171         * class.c (mono_class_create_generic_2): Made this static, only
18172         call it from mono_class_init() and mono_class_setup_parent().
18173         (collect_implemented_interfaces_aux): Call mono_class_init() on
18174         the interfaces we collect.
18175         (mono_class_setup_vtable): Call mono_class_init (class->parent).
18176
18177 2005-01-11  Zoltan Varga  <vargaz@freemail.hu>
18178
18179         * threads.c (mono_thread_attach): Call DuplicateHandle on the thread handle on win32 to make
18180         it a real thread handle.
18181
18182         * domain-internals.h: Move exvar_offset from MonoJitInfo to 
18183         MonoJitExceptionInfo, since each catch clause needs its own variable.
18184         
18185 2005-01-11  Dick Porter  <dick@ximian.com>
18186
18187         * image.c (mono_pe_file_open): New variant on mono_image_open()
18188         that does not set up the CLI metadata; used for FileVersionInfo so
18189         it can get the data for windows binaries too.
18190         
18191         * process.c (process_read_string_block): Don't read off the end of
18192         the StringTable block.
18193
18194         These both fix bug 70766.
18195
18196 Tue Jan 11 15:26:00 CET 2005 Paolo Molaro <lupus@ximian.comt>
18197
18198         * gc.c: set some fields to NULL at GC cleanup time.
18199         * threads.c: if we quit the main thread, call exit ().
18200
18201 2005-01-11  Zoltan Varga  <vargaz@freemail.hu>
18202
18203         * threads.c (interruption_request_apc): Decore APC callbacks with CALLBACK under win32.
18204
18205 Mon Jan 10 18:47:28 CET 2005 Paolo Molaro <lupus@ximian.com>
18206
18207         * threads.h, threads.c, object.c: added accessor and settor for
18208         main_thread. Handle it specially when exiting from it: wait
18209         for other foreground threads to exit.
18210
18211 Mon Jan 10 12:06:18 CET 2005 Paolo Molaro <lupus@ximian.com>
18212
18213         * process.c, verify.c: remove some bloat.
18214
18215 2005-01-09  Zoltan Varga  <vargaz@freemail.hu>
18216
18217         * loader.c (mono_lookup_pinvoke_call): If we found the function without name mangling, change
18218         the calling convention to cdecl under win32.
18219
18220 2005-01-08  Ben Maurer  <bmaurer@ximian.com>
18221
18222         * object.c (mono_object_get_size): New function to get the size of
18223         an object instance.
18224
18225         * profiler.c (simple_allocation): Use above.
18226
18227 2005-01-08  Sebastien Pouliot  <sebastien@ximian.com>
18228
18229         * appdomain.c: Replaced ves_icall_System_AppDomain_getDomainByID by
18230         ves_icall_System_AppDomain_getRootDomain (as it's not required to
18231         get an appdomain by it's id and we can't assume the root's id is 0).
18232         * domain-internals.h: Change the function prototype to match.
18233         * icall.c: Change the icall table for AppDomain.
18234
18235 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
18236
18237         * locales.c (string_invariant_compare_char): Only compute
18238         GUnicodeTypes in the case where we need them.  Test for ordinality
18239         first and return if so.
18240
18241         From the commit:
18242
18243                 /*
18244                  * FIXME: here we must use the information from c1type and c2type
18245                  * to find out the proper collation, even on the InvariantCulture, the
18246                  * sorting is not done by computing the unicode values, but their
18247                  * actual sort order.
18248                  */
18249
18250 Sat Jan 8 19:03:26 CET 2005 Paolo Molaro <lupus@ximian.com>
18251
18252         * loader.c: for P/Invoke methods, allow the "Internal" shared
18253         library name to refer to the calling process symbol namespace.
18254
18255 2005-01-07  Sebastien Pouliot  <sebastien@ximian.com>
18256
18257         * Makefile.am: Add the security manager to the build.
18258         * security-manager.c|h: New. Initialization of the security manager.
18259
18260 2005-01-07  Dick Porter  <dick@ximian.com>
18261
18262         * threads.c: 
18263         * monitor.c: Update thread state during Monitor and WaitHandle
18264         waits.  Fixes bug 71031.
18265
18266 2005-01-07  Zoltan Varga  <vargaz@freemail.hu>
18267
18268         * reflection.c (property_encode_signature): Correctly handle when the
18269         property has no methods.
18270
18271 2005-01-06  Zoltan Varga  <vargaz@freemail.hu>
18272
18273         * reflection.c (reflection_methodbuilder_to_mono_method): Remove debug stuff.
18274         
18275         * reflection.c (reflection_methodbuilder_from_method_builder): Copy
18276         fields from mb, not rmb. Fixes #71017.
18277
18278         * marshal.c (emit_ptr_to_str_conv): Add support for 
18279         ByValTStr -> string conversion. Fixes #71015.
18280
18281         * appdomain.c (mono_domain_owns_vtable_slot): New helper function.
18282
18283         * mempool.c (mono_mempool_contains_addr): New helper function.
18284
18285 2005-01-05  Zoltan Varga  <vargaz@freemail.hu>
18286
18287         * metadata.c (mono_metadata_compute_size): Fix size calculation of
18288         HasSematics encoded fields.
18289         
18290         * metadata.c (mono_type_to_unmanaged): Improve error message for 
18291         invalid string marshalling.
18292
18293         * metadata.c: Fix warnings.
18294         
18295 Wed Jan 5 16:17:27 CET 2005 Paolo Molaro <lupus@ximian.com>
18296
18297         * profiler-private.h, profiler.c, profiler.h, gc.c: sample statistical
18298         profiler support.
18299
18300 2005-01-05  Zoltan Varga  <vargaz@freemail.hu>
18301
18302         * domain.c object.c domain-internals.h: Revert part of r38077 since the
18303         keys to proxy_vtable_hash are GCd objects. Fixes running the class lib
18304         tests.
18305
18306 2005-01-03  Zoltan Varga  <vargaz@freemail.hu>
18307
18308         * marshal.c: Use MONO_CLASSCONST instead of MONO_LDPTR in some places,
18309         so methods containing these can be AOTed.
18310
18311 2005-01-03  Martin Baulig  <martin@ximian.com>
18312
18313         * loader.c (find_method): Removed the hack for generic instances.
18314         (method_from_memberref): If our parent is a generic instance, pass
18315         its generic type definition to find_method() and then inflate the
18316         method.
18317         (mono_get_method_constrained): Pass the generic type definition to
18318         find_method() and inflate the method later.
18319
18320         * class-internals.h (MonoStats): Added `generic_class_count'.
18321
18322         * icall.c (ves_icall_MonoGenericMethod_get_reflected_type):
18323         Renamed to ves_icall_MonoGenericMethod_get_ReflectedType().
18324
18325         * reflection.c (mono_custom_attrs_from_params): Don't ignore
18326         generic type definitions.
18327
18328 2004-12-30  Zoltan Varga  <vargaz@freemail.hu>
18329
18330         * loader.c icall.c: Fix warnings.
18331
18332 2004-12-29  Zoltan Varga  <vargaz@freemail.hu>
18333
18334         * marshal.c (mono_marshal_get_managed_wrapper): Fix returning of
18335         blittable types. Fixes #70864.
18336
18337 2004-12-29  Martin Baulig  <martin@ximian.com>
18338
18339         * icall.c
18340         (ves_icall_MonoGenericMethod_get_reflected_type): New interncall.
18341
18342         * reflection.c (mono_method_get_object): Create a
18343         "System.Reflection.MonoGenericMethod" for inflated methods; don't
18344         call mono_get_inflated_method().
18345
18346         * class-internals.h (MonoStats): Added `inflated_method_count_2'.
18347
18348 2004-12-27  Martin Baulig  <martin@ximian.com>
18349
18350         * class-internals.h (MonoMethod): Added `is_inflated' flag.
18351         (MonoMethodInflated): Added `inflated' field.
18352
18353         * class.c (mono_class_inflate_generic_method): Don't really
18354         inflate the method here; just set the `is_inflated' flag in the
18355         MonoMethod.
18356         (mono_class_get_inflated_method): Actually inflate the method here
18357         if it's not already inflated; we use the MonoMethodInflated's new
18358         `inflated' field as a cache.
18359
18360 2004-12-26  Martin Baulig  <martin@ximian.com>
18361
18362         * class.c
18363         (inflate_generic_class): Moved some code out of inflate_generic_type().
18364         (mono_class_inflate_generic_method): If we're already inflated,
18365         inflate the context and use the declaring method; ie. make sure
18366         the declaring method of an inflated method is always the generic
18367         method definition.
18368         (mono_class_create_from_typedef): Create
18369         `class->generic_container->context->gclass'.
18370
18371 2004-12-24  Ben Maurer  <bmaurer@ximian.com>
18372
18373         * metadata-internals.h, marshal.c, reflection.c: More
18374         MonoGHashTable->GHashTable.
18375
18376         * domain-internals.h, class.c: Change MonoGHashTable's into
18377         GHashTables for some cases where no gc stuff is used
18378
18379         All users: update apis
18380
18381 2004-12-23  Ben Maurer  <bmaurer@ximian.com>
18382
18383         * metadata.c (builtin_types): Make this `const'. Makes this get
18384         put into the shareable section.
18385         (mono_metadata_init): Casts to make gcc happy.
18386
18387 2004-12-22  Zoltan Varga  <vargaz@freemail.hu>
18388
18389         * gc.c (mono_gc_init): Add a '\n' to the valgrind warning.
18390
18391 2004-12-21  Sebastien Pouliot  <sebastien@ximian.com> 
18392
18393         * icall.c: Added an internal call to retrieve the position and length
18394         of assembly-level declarative security attributes (RequestMinimum, 
18395         RequestOptional and RequestRefuse). This is used by the Assembly class
18396         to re-create the corresponding permission sets.
18397
18398 Tue Dec 21 14:50:31 CET 2004 Paolo Molaro <lupus@ximian.com>
18399
18400         * marshal.c: fix the stelemref wrapper to be type correct
18401         (and faster).
18402
18403 2004-12-20  Ben Maurer  <bmaurer@ximian.com>
18404
18405         * icall.c (ves_icall_System_Object_GetHashCode): There was no need
18406         to do key & 0x7fffffff. Hashtable already does this. It just
18407         results in longer code.
18408
18409 2004-12-20  Sebastien Pouliot  <sebastien@ximian.com>
18410
18411         * appdomain.c: Bump corlib version.
18412         * class-internals.h: Added RuntimeSecurityFrame to mono_defaults.
18413         * domain.c: Add RuntimeSecurityFrame to mono_defaults.
18414         * reflection.c|h: Add functions to get declarative security infos
18415         (blob position and length) for assemblies, classes and methods.
18416
18417 Mon Dec 20 15:28:54 CET 2004 Paolo Molaro <lupus@ximian.com>
18418
18419         * reflection.c: sort the constant table (bug #70693).
18420
18421 Mon Dec 20 12:19:37 CET 2004 Paolo Molaro <lupus@ximian.com>
18422
18423         * object-internals.h, threads.c, domain.c: add accessors for
18424         the MonoThread and MonoDomain tls keys.
18425
18426 2004-12-18  Martin Baulig  <martin@ximian.com>
18427
18428         * class.c (inflate_generic_type): If we're inflating a generic
18429         instance, set `ngclass->context->container = context->container';
18430         ie. the container we inflated into.
18431
18432         * metadata.c (mono_metadata_parse_generic_param): Reflect above
18433         inflate_generic_type() changes.
18434
18435 2004-12-17  Martin Baulig  <martin@ximian.com>
18436
18437         * class-internals.h
18438         (MonoGenericClass): Replaced `MonoType *generic_type' with
18439         `MonoClass *generic_class'.  Removed `dynamic_info'; if
18440         `is_dynamic' is true, we're a `MonoDynamicGenericClass'.
18441         (MonoDynamicGenericClass): Derive from `MonoGenericClass'.
18442
18443 2004-12-16  Zoltan Varga  <vargaz@freemail.hu>
18444
18445         * exception.c (mono_exception_from_token): New helper function.
18446
18447 2004-12-15  Zoltan Varga  <vargaz@freemail.hu>
18448
18449         * assembly.c (mono_assembly_load_with_partial_name): Call 
18450         mono_assembly_loaded before invoking the preload hooks. Fixes
18451         #70564.
18452
18453         * object-internals.h (MonoThread): Change culture_info and 
18454         ui_culture_info into an array.
18455
18456         * threads.c: Cache culture info objects from more than one appdomain.
18457
18458         * threads.c threads-types.h icall.c: Add icalls for manipulating the 
18459         current UI culture.
18460
18461 2004-12-14  Zoltan Varga  <vargaz@freemail.hu>
18462
18463         * threads.h threads.c appdomain.c: Clear the culture_info field of
18464         all threads during unloading if they point to an object in the dying
18465         appdomain.
18466
18467 2004-12-13  Ben Maurer  <bmaurer@ximian.com>
18468
18469         * culture-info.h (TextInfoEntry): New struct
18470         * object-internals.h: sync with managed
18471         * locales.c: fill the `text_info_data' field
18472         * culture-info-tables.h: update
18473
18474 Mon Dec 13 18:10:50 CET 2004 Paolo Molaro <lupus@ximian.com>
18475
18476         * Makefile.am, monodiet.c: add monodiet, an IL code garbage
18477         collector.
18478
18479 2004-12-12  Ben Maurer  <bmaurer@ximian.com>
18480
18481         * icall.c (ves_icall_ModuleBuilder_getToken): Check for null
18482         (ves_icall_ModuleBuilder_getMethodToken): Ditto
18483
18484 2004-12-12  Martin Baulig  <martin@ximian.com>
18485
18486         * mono-debug-debugger.c (write_type): If we're an enum and the
18487         builtin types have already been initialized, call mono_class_init().
18488
18489 2004-12-11  Martin Baulig  <martin@ximian.com>
18490
18491         * metadata.c (mono_metadata_load_generic_params): Added
18492         `MonoGenericContainer *parent_container' argument; automatically
18493         compute `container->is_method'; pass the correct owner to
18494         get_constraints().      
18495
18496         * reflection.c (compare_genericparam): Sort the GenericParam table
18497         according to increasing owners. 
18498
18499 Fri Dec 10 18:43:46 CET 2004 Paolo Molaro <lupus@ximian.com>
18500
18501         * profiler.c: allow disabling the default profiler.
18502
18503 Fri Dec 10 18:42:11 CET 2004 Paolo Molaro <lupus@ximian.com>
18504
18505         * decimal.c, icall.c: allow disabling System.Decimal support.
18506
18507 2004-12-09  Marek Safar <marek.safar@seznam.cz>
18508
18509         * reflection.c: Add support for null attribute arguments.
18510
18511 2004-12-09  Martin Baulig  <martin@ximian.com>
18512
18513         * metadata.h, loader.h: Use `idx' instead of `index' in parameter
18514         names to get rid of compiler warnings.
18515
18516 2004-12-08  Zoltan Varga  <vargaz@freemail.hu>
18517
18518         * marshal.c (mono_marshal_get_struct_to_ptr): Call 
18519         mono_marshal_load_type_info (). Fixes #69625.
18520         (mono_marshal_get_ptr_to_struct): Likewise.
18521
18522 2004-12-08  Martin Baulig  <martin@ximian.com>
18523
18524         * mono-debug.h: Bumped version number to 47.
18525
18526         * mono-debug-debugger.c
18527         (mono_debugger_event_handler, mono_debugger_event): Take two
18528         guint64 arguments insteed of a gpointer and a guint32.  
18529
18530 2004-12-08  Martin Baulig  <martin@ximian.com>
18531
18532         * debug-mono-symfile.h
18533         (MonoDebugLineNumberEntry): Renamed `offset' to `il_offset' and
18534         `address' to `native_offset'.
18535
18536 2004-12-08  Martin Baulig  <martin@ximian.com>
18537
18538         * class.c (mono_class_create_from_typespec): Only inflate if we
18539         either have `context->gclass' or `context->gmethod'.
18540
18541 2004-12-08  Zoltan Varga  <vargaz@freemail.hu>
18542
18543         * metadata-internals.h (MonoAssembly): Add 'corlib_internal' field.
18544
18545         * object-internals.h (MonoReflectionAssemblyBuilder): Move 'corlib_internal' field from Assembly to AssemblyBuilder.
18546
18547         * reflection.c (mono_image_basic_init): Initialize assembly->corlib_internal from the assembly builder.
18548
18549         * reflection.c (mono_assembly_get_object): Remove the workaround put
18550         in for the release.
18551         
18552         * appdomain.c: Use the corlib_internal field from MonoAssembly.
18553
18554         * appdomain.c: Bump corlib version.
18555
18556         * reflection.c (mono_assembly_get_object): Add a workaround so __MetadataTypes won't
18557         be visible in other appdomains.
18558
18559 2004-12-07  Ben Maurer  <bmaurer@ximian.com>
18560
18561         * threads.c: Interlocked inc and dec for longs were messed up,
18562         use a KISS based impl for this. Fixes 70234
18563
18564 2004-12-07  Zoltan Varga  <vargaz@freemail.hu>
18565
18566         * threads.c (ves_icall_System_Threading_Thread_GetCachedCurrentCulture): Make this lock-less.
18567
18568 Tue Dec 7 10:47:09 CET 2004 Paolo Molaro <lupus@ximian.com>
18569
18570         * icall.c: fix to follow policy not to allow struct
18571         arguments in icalls.
18572
18573 2004-12-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18574
18575         * process.c: make the patch that handles spaces in file paths work
18576         on mono/windows too.
18577
18578 2004-12-06  Martin Baulig  <martin@ximian.com>
18579
18580         * class.c (mono_class_create_generic): Call
18581         mono_class_setup_supertypes() if we're dynamic.
18582         (mono_class_is_subclass_of): `g_assert (klass->idepth > 0)'.
18583
18584 2004-12-06  Zoltan Varga  <vargaz@freemail.hu>
18585
18586         * object-internals.h: Add new fields to MonoThread.
18587
18588         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
18589
18590         * icall.c threads-types.h threads.c: Add new icalls.
18591
18592         * object-internals.h (MonoThread): Remove unused 'unmanaged' field.
18593
18594         * object-internals.h (MonoReflectionAssembly): Sync object layout with
18595         managed side.
18596
18597         * appdomain.c: Bump corlib version.
18598
18599         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Skip
18600         internal assemblies. Fixes #69181.
18601
18602 2004-12-05  Martin Baulig  <martin@ximian.com>
18603
18604         * class.c (mono_class_inflate_generic_signature): Make this a
18605         no-op if `context' is NULL or we don't have any type parameters;
18606         also copy `sentinelpos'.        
18607
18608 2004-12-04  Zoltan Varga  <vargaz@freemail.hu>
18609
18610         * image.c: Add unbox_wrapper_cache.
18611
18612         * class-internals.h debug-helpers.c: Add MONO_WRAPPER_UNBOX.
18613
18614         * marshal.h marshal.c (mono_marshal_get_unbox_wrapper): New wrapper
18615         function generator.
18616         
18617         * object.c (mono_delegate_ctor): Call unbox wrapper if neccesary.
18618         Fixes #70173.
18619
18620         * metadata-internals.h image.c: Add MonoImage->unbox_wrapper_cache.
18621         
18622 2004-12-04  Martin Baulig  <martin@ximian.com>
18623
18624         * loader.c (mono_method_get_signature_full): New public function;
18625         like mono_method_get_signature(), but with an additional
18626         `MonoGenericContext *' argument.
18627
18628         * class.c (mono_class_inflate_generic_signature): Formerly known
18629         as inflate_generic_signature(); make this public.
18630
18631 2004-12-04  Martin Baulig  <martin@ximian.com>
18632
18633         * metadata.c
18634         (mono_metadata_parse_type_full): Take a `MonoGenericContext *'
18635         instead of a `MonoGenericContainer *'.  
18636         (mono_metadata_parse_array_full): Likewise.
18637         (mono_metadata_parse_signature_full): Likewise.
18638         (mono_metadata_parse_method_signature_full): Likewise.
18639         (mono_metadata_parse_generic_inst): Likewise.
18640         (mono_metadata_parse_generic_param): Likewise.
18641         (mono_metadata_parse_mh_full): Likewise.
18642         (mono_type_create_from_typespec_full): Likewise.
18643
18644 2004-12-03  Martin Baulig  <martin@ximian.com>
18645
18646         * class-internals.h (MonoGenericContainer): Replaced the
18647         `MonoGenericContext * pointer with a `MonoGenericContext'
18648         structure and made it the first element.
18649
18650 2004-12-03  Martin Baulig  <martin@ximian.com>
18651
18652         * class.c
18653         (inflate_generic_type): Set the `context->container' when creating
18654         a new MonoGenericContext.
18655         (mono_class_inflate_generic_method): Likewise.
18656         (mono_class_create_from_typespec): Just use `context->container'
18657         to get the container.
18658
18659         * loader.c (method_from_methodspec): Set `context->parent' from
18660         `context->container' - and if that's a method container, use its
18661         parent.  Also set the `context->container' when creating a new
18662         MonoGenericContext.
18663         (mono_get_method_from_token): Use just `context->container' to get
18664         the container.
18665
18666         * metadata.c (do_mono_metadata_parse_generic_class): Also set
18667         `gclass->context->container'.
18668
18669         * reflection.c (do_mono_reflection_bind_generic_parameters): Set
18670         the `context->container' when creating a new MonoGenericContext.
18671
18672 2004-12-03  Zoltan Varga  <vargaz@freemail.hu>
18673
18674         * reflection.c (compare_genericparam): Sort params with identical
18675         owner by their number. Fixes gen-111 on sparc.
18676
18677 2004-12-02  Zoltan Varga  <vargaz@freemail.hu>
18678
18679         * threadpool.c (async_invoke_thread): Call push/pop_appdomain_ref
18680         around the domain changes.
18681
18682         * appdomain.c (mono_domain_unload): Handle the case when the thread
18683         calling Unload is itself being aborted during unloading. Fixes #70022.
18684
18685         * appdomain.h: Add prototype for mono_install_runtime_cleanup.
18686
18687         * marshal.c (emit_thread_interrupt_checkpoint_call): Call 
18688         checkpoint_func as an icall so it gets a wrapper.
18689         (mono_marshal_get_xappdomain_invoke): Call push/pop_appdomain_ref ()
18690         in the cross-appdomain wrappers too.
18691
18692         * threads.c (mono_thread_has_appdomain_ref): Make this public.
18693
18694         * assembly.c (mono_assembly_open_from_bundle): Fix warning.
18695
18696         * reflection.c: Fix some memory leaks.
18697         
18698 2004-12-02  Martin Baulig  <martin@ximian.com>
18699
18700         * metadata-internals.h (MonoImage): Removed `generic_class_cache'.
18701
18702         * metadata.c (generic_class_cache): New static hashtable.
18703         (mono_metadata_lookup_generic_class): New public method.
18704
18705 2004-12-02  Martin Baulig  <martin@ximian.com>
18706
18707         * class.c (mono_class_create_from_typedef): Call
18708         mono_class_setup_parent() and mono_class_create_mono_type() before
18709         parsing the interfaces.
18710
18711 2004-12-02  Martin Baulig  <martin@ximian.com>
18712
18713         * metadata.c (generic_inst_cache): New static hashtable.
18714         (mono_metadata_lookup_generic_inst): New public function.
18715         (mono_metadata_inflate_generic_inst): New public function.
18716         (mono_metadata_parse_generic_inst): New public function.
18717         (do_mono_metadata_parse_generic_class): Use the new
18718         mono_metadata_parse_generic_inst() for parsing the `gclass->inst'
18719         since this'll also use the cache.
18720
18721         * reflection.c (mono_reflection_bind_generic_method_parameters):
18722         Use mono_metadata_lookup_generic_inst() to use the new cache.
18723
18724         * class.c (inflate_mono_type): Use
18725         mono_metadata_inflate_generic_inst() to inflate a generic
18726         instance; this'll also use the new cache.
18727
18728         * loader.c (method_from_methodspec): Use
18729         mono_metadata_parse_generic_inst() and
18730         mono_metadata_inflate_generic_inst() rather than parsing it
18731         manually, so we can use the new cache.
18732
18733 2004-12-02  Zoltan Varga  <vargaz@freemail.hu>
18734
18735         * threads.c (wait_for_tids): Do not incorrectly free threads when 
18736         the wait times out.
18737
18738 2004-12-01  Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
18739
18740         * icall.c (mono_ArgIterator_Setup) : Conditionally compile calculation of
18741         iter->args based on whether parameters are passed in registers (i.e.
18742         MONO_ARCH_REGPARMS is defined)
18743
18744 2004-12-01  Zoltan Varga  <vargaz@freemail.hu>
18745
18746         * loader.c (mono_lookup_pinvoke_call): Use the remapped dll name in
18747         the exception message. Fixes #70070.
18748         (method_from_methodspec): Fix warnings.
18749
18750 2004-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18751
18752         * process.c: (complete_path) return the path quoted
18753
18754 2004-12-01  Martin Baulig  <martin@ximian.com>
18755
18756         * class-internals.h (MonoGenericInst): New structure.
18757         (MonoGenericClass): Replaced `type_argc', `type_argv' and
18758         `is_open' with `MonoGenericInst *inst'.
18759         (MonoGenericMethod): Replaced `mtype_argc', `mtype_argv' and
18760         `is_open' with `MonoGenericInst *inst'.
18761
18762 2004-11-30  Martin Baulig  <martin@ximian.com>
18763
18764         Generics API cleanup: renamed MonoGenericInst -> MonoGenericClass.
18765
18766         * metadata-internals.h (MonoImage): Renamed `generic_inst_cache'
18767         to `generic_class_cache'.
18768
18769         * metadata.c
18770         (mono_generic_inst_hash): Renamed to mono_generic_class_hash().
18771         (mono_generic_inst_equal): Renamed to mono_generic_class_equal().
18772         (mono_generic_inst_is_valuetype): Renamed to
18773         mono_generic_class_is_valuetype().
18774
18775         * class-internals.h
18776         (MonoGenericInst): Renamed to MonoGenericClass.
18777         (MonoDynamicGenericInst): Renamed to MonoDynamicGenericClass.
18778         (MonoClass): Renamed `generic_inst' to `generic_class'.
18779         (MonoGenericContext): Renamed `ginst' to `gclass'.
18780
18781         * object-internals.h
18782         (MonoReflectionGenericInst): Renamed to MonoReflectionGenericClass.
18783
18784         * reflection.c (mono_reflection_generic_inst_initialize): Renamed to
18785         mono_reflection_generic_class_initialize().
18786
18787         * icall.c (icall_entries): "System.Reflection.MonoGenericInst" is
18788         now known as "System.Reflection.MonoGenericClass".
18789         (monogenericinst_icalls): Renamed to monogenericclass_icalls.
18790
18791 2004-11-29  Sebastien Pouliot  <sebastien@ximian.com>
18792
18793         * class-internals.h: Added a flag field to MonoClass to cache the
18794         declarative security attributes actions associated with the class.
18795         * domain-internals.h: Added booleans to MonoJitInfo to cache the
18796         (class or method level) stack modifiers (Assert, Deny and PermitOnly)
18797         applicable to the JITted method.
18798         * reflection.c|h: Added functions to extract (as flags) which security
18799         actions are available (declaratively) for a method, class or assembly.
18800         * metadata.c|h: Added functions to search the declarative security
18801         table in the metadata.
18802         
18803 2004-11-29  Ben Maurer  <bmaurer@ximian.com>
18804
18805         * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces):
18806         EXPORTEDTYPES are already in the class name cache, so there is no
18807         need to add extra code here to look at them. Just removes a bit of
18808         cruft.
18809
18810         (ves_icall_System_Environment_get_TickCount): No need for #if
18811         WINDOWS. We already have the code in io-layer.
18812
18813 2004-11-28  Martin Baulig  <martin@ximian.com>
18814
18815         * loader.c
18816         (method_from_methodspec): Also inflate the `gmethod->mtype_argv'.
18817         Fixes gen-112.cs.
18818
18819 2004-11-27  Miguel de Icaza  <miguel@ximian.com>
18820
18821         * assembly.c (do_mono_assembly_open): Instead of having a
18822         conditional WITH_BUNDLE, incorporate support for bundles here, by
18823         having a global `bundles' variable holding a pointer to the actual
18824         bundles. 
18825
18826         (mono_register_bundled_assemblies): New API call used by the
18827         bundle code. 
18828
18829         See mkbundle.1 for details.
18830         
18831 2004-11-27  Martin Baulig  <martin@ximian.com>
18832
18833         * object.c (mono_class_vtable): Store the `MonoMethod *' itself in
18834         the vtable for generic methods.
18835
18836 2004-11-26  Martin Baulig  <martin@ximian.com>
18837
18838         * metadata.c
18839         (mono_metadata_generic_method_hash): New public function.
18840         (mono_metadata_generic_method_equal): Likewise.
18841
18842         * class-internals.h
18843         (MonoGenericContainer): Added `GHashTable *method_hash'.
18844
18845         * reflection.c (ReflectionMethodBuilder): Added
18846         `MonoGenericContainer *generic_container'.
18847         (reflection_methodbuilder_to_mono_method): Don't create a new
18848         MonoGenericContainer each time we're called.
18849         (mono_reflection_bind_generic_method_parameters): Use
18850         `container->method_hash' to cache the results so we don't create a
18851         different method if we're called several times with the same
18852         arguments.
18853
18854         * loader.c (method_from_methodspec): Use the new
18855         `container->method_hash' here, too.
18856
18857 2004-11-26  Martin Baulig  <martin@ximian.com>
18858
18859         * class.c (inflate_generic_signature): Correctly compute
18860         `res->has_type_parameters'.
18861         (mono_class_vtable): Use the `has_type_parameters' flag to
18862         determine whether we're a generic method.
18863
18864         * metadata.c (mono_metadata_parse_method_signature_full): Likewise.
18865
18866 2004-11-25  Zoltan Varga  <vargaz@freemail.hu>
18867
18868         * object.c (mono_runtime_run_main): Fix a small memory leak.
18869
18870 2004-11-25  Martin Baulig  <martin@ximian.com>
18871
18872         * class.c (set_generic_param_owner): Fixed the loop.
18873
18874 2004-11-25  Martin Baulig  <martin@ximian.com>
18875
18876         * object.c (mono_class_vtable): Don't create any JIT wrappers for
18877         generic methods.
18878
18879 2004-11-24  Zoltan Varga  <vargaz@freemail.hu>
18880
18881         * reflection.c: Allow all kinds of whitespace, not just ' ' in type
18882         names. Fixes #69787.
18883
18884 2004-11-24  Martin Baulig  <martin@ximian.com>
18885
18886         * class.c (mono_class_create_generic_2): If we don't have a
18887         `ginst->parent', inflate `gklass->parent' to get our parent.
18888
18889 2004-11-24  Martin Baulig  <martin@ximian.com>
18890
18891         * reflection.c (compare_genericparam): Correctly sort the
18892         GenericParam table; fixes #69779.
18893
18894 2004-11-23  Ben Maurer  <bmaurer@ximian.com>
18895
18896         * reflection.c: When writing a PE file, don't create a huge
18897         buffer in memory. Just write the arrays we have to the file.
18898         This reduces memory usage.
18899
18900         * metadata-internals.h: MonoDynamicStream pefile is no longer used
18901         globally.
18902
18903 2004-11-17  Martin Baulig  <martin@ximian.com>
18904
18905         * class.c (mono_class_init): Don't setup `class->parent' for
18906         dynamic instances; moved this to mono_class_generic_2().
18907         (mono_class_create_generic): Also set `klass->inited' for dynamic
18908         generic instances.
18909         (mono_class_create_generic_2): Don't do anything for dynamic
18910         generic instances.  Set `klass->parent' here and also call
18911         mono_class_setup_parent() here. 
18912
18913         * reflection.c (do_mono_reflection_bind_generic_parameters): Added
18914         `MonoType *parent' argument; set `ginst->parent' before calling
18915         mono_class_create_generic_2(), so we set the correct parent.
18916
18917 Thu Nov 18 17:10:32 CET 2004 Paolo Molaro <lupus@ximian.com>
18918
18919         * reflection.c: allow getting attributes from ModuleBuilder
18920         (used by ikvm).
18921
18922 2004-11-17  Martin Baulig  <martin@ximian.com>
18923
18924         * class.c (mono_class_create_from_typedef): If a type parameter is
18925         inherited from an outer class, set its owner to that class.
18926
18927 2004-11-17  Atsushi Enomoto  <atsushi@ximian.com>
18928
18929         * reflection.c: (mono_image_create_pefile): Don't use NULL argument
18930           for (int*) written size. This fixes bug #69592.
18931
18932 2004-11-15  Sebastien Pouliot  <sebastien@ximian.com>
18933
18934         * icall.c: Added IsAuthenticodePresnet internal call.
18935         * image.c|h: New function that check a MonoImage for an Authenticode
18936         signature in the certificate PE data directory.
18937         * security.c|h: New internal call to ask the runtime if an 
18938         Authenticode signature seems referenced in the PE header.
18939
18940 2004-11-15  Zoltan Varga  <vargaz@freemail.hu>
18941
18942         * icall.c (ves_icall_type_isprimitive): Native int is a primitive type.
18943
18944         * reflection.c (mono_image_create_pefile): Free the assembly streams
18945         after writing out the assembly file.
18946
18947         * object.c (mono_runtime_run_main): Fix small memory leak.
18948
18949         * icall.c (ves_icall_Type_GetPropertiesByName): Add support for
18950         property access modifiers. Fixes #69389.
18951
18952 Mon Nov 15 11:54:22 CET 2004 Paolo Molaro <lupus@ximian.com>
18953
18954         * domain.c, object.c, object-internals.h, domain-internals.h,
18955         object.h, marshal.c: keep dynamic code info per domain.
18956
18957 2004-11-15  Martin Baulig  <martin@ximian.com>
18958
18959         * class.c (mono_type_get_name_recurse): Put type arguments in
18960         `[',`]' instead of in `<','>'.  Thanks to Atsushi for the patch,
18961         see bug #68387.
18962
18963 2004-11-15  Martin Baulig  <martin@ximian.com>
18964
18965         * class.c (mono_type_get_name_recurse): Added `include_ns' flag.
18966         (mono_class_setup_vtable): When computing `the_cname' for a
18967         generic instance, don't include the namespace since we'd otherwise
18968         add it twice.
18969
18970 2004-11-15  Martin Baulig  <martin@ximian.com>
18971
18972         * class.c (mono_class_create_generic): Changed return type to void.
18973         (mono_class_create_generic_2): New public function; setup
18974         `class->method', `class->field' and `class->interfaces' here
18975         instead of in mono_class_init().
18976
18977         * class.h (mono_class_create_generic): Moved to class-internals.h.
18978
18979 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
18980
18981         * reflection.c (mono_image_create_pefile): take a file HANDLE.
18982         rather than writing to memory, write to this file. Right now,
18983         we are just writting into a buffer, and copying that. However
18984         we can avoid the buffer later.
18985
18986         (mono_dynamic_stream_reset): new function
18987
18988         * icall.c, object-internals.h: update for the above.
18989
18990 2004-11-13  Ben Maurer  <bmaurer@ximian.com>
18991
18992         * reflection.c: Remove *_ATOMIC macros. We really shouldn't
18993         have been using gc'd memory. First it is slower, unlikely
18994         the comment in the source code said, secondly, it increases
18995         our footprint to do it in the gc.
18996
18997         * icall.c (WriteToFile): rename of getDataChunk. Rewrite
18998         the method so that it does not have to copy to managed code.
18999
19000 2004-11-12  Zoltan Varga  <vargaz@freemail.hu>
19001
19002         * loader.c (mono_method_get_header): Fix build for older glibs which does not define G_LIKELY.
19003
19004 2004-11-12  Martin Baulig  <martin@localhost>
19005
19006         * reflection.c (mono_image_create_token): Allow generic method
19007         definitions here, since they may appear in an `.override'; see
19008         gen-98/gen-99 for an example.
19009
19010 2004-11-11  Zoltan Varga  <vargaz@freemail.hu>
19011
19012         * icall.c (ves_icall_Type_GetField): Support BFLAGS_IgnoreCase. Fixes
19013         #69365.
19014
19015         * marshal.c (mono_string_to_ansibstr): Make g_error messages more
19016         descriptive.
19017
19018 2004-11-11  Martin Baulig  <martin@ximian.com>
19019
19020         * class.c (mono_class_setup_vtable): In an explicit interface
19021         implementation, the method name now includes the arity.
19022
19023 2004-11-10  Zoltan Varga  <vargaz@freemail.hu>
19024
19025         * object.c (mono_array_full_copy): Fix warning.
19026
19027 2004-11-10  Lluis Sanchez Gual  <lluis@novell.com>
19028
19029         * appdomain.c: Removed look_for_method_by_name(). Use the new method
19030         mono_class_get_method_from_name() instead.
19031         
19032         * class-internals.h: Added two new types of wrappers. 
19033         Added MonoRemotingTarget enum. Added new trampoline function type, which
19034         takes an additional MonoRemotingTarget value as parameter, so it is
19035         possible to request a trampoline for a specific target.
19036         
19037         * class.c: Added new mono_class_get_method_from_name() method.
19038         
19039         * class.h: In MonoRemoteClass, we can have now to vtables, one for
19040         general remoting sinks and one specific for cross domain calls.
19041         
19042         * debug-helpers.c: Added new wrapper names.
19043         
19044         * icall.c: Use the new method mono_remote_class_vtable() to get the vtable
19045         of a remote class.
19046         
19047         * image.c: Porperly delete value objects form the remoting invoke hashtable.
19048         
19049         * marshal.c: Added mono_marshal_get_xappdomain_invoke(), which together
19050         with several other methods (mono_marshal_get_xappdomain_dispatch,
19051         mono_marshal_get_xappdomain_target, mono_marshal_get_serialize_exception,
19052         and others) can generate a fast remoting wrapper for cross domain calls.
19053         More information can be found in docs/remoting.
19054         Other changes: Removed mono_find_method_by_name, and used
19055         mono_class_get_method_from_name instead.
19056         Remoting wrappers are now stored in a MonoRemotingMethods struct, which
19057         is stored in the remoting invoke hashtable.
19058         
19059         * marshal.h: published the new method for getting the xdomain wrapper,
19060         and also added a method for getting the adequate wrapper for a given
19061         method and target.
19062         
19063         * object-internals.h, object.c: Added a couple of methods for capying and
19064         cloning arrays.
19065         Modified mono_install_remoting_trampoline, which takes the new remoting
19066         trampoline that has a remoting target as parameter.
19067         mono_class_proxy_vtable now also takes a remoting target as parameter, and
19068         will return the most suitable vtable for the target.
19069         Added mono_remote_class_vtable, which returns the vtable of a remote class
19070         (which can be the normal remoting vtable or the xdomain vtable).
19071         
19072         * threads.c: the xdomain invoke and dispatch wrappers must also be
19073         protected against interruptions.
19074
19075 2004-11-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19076
19077         * icall.c: use memmove in BlockCopyInternal when the source and
19078         destination arrays are the same.
19079
19080 2004-11-09  Martin Baulig  <martin@ximian.com>
19081
19082         * class-internals.h (MonoGenericContainer): Removed `method' and
19083         `signature', replaced them with `is_method' and `is_signature'
19084         flags.  Added `context'.
19085
19086         * loader.c (method_from_methodspec): Take a `MonoGenericContext *'
19087         instead of a `MonoGenericContainer *'.
19088
19089         * metadata.c (mono_metadata_generic_param_equal): Removed the hack
19090         for dynamic type parameters.
19091         (mono_metadata_load_generic_params): Setup `container->context'.
19092
19093         * reflection.c (mono_reflection_setup_generic_class): Setup
19094         `tb->generic_container->context'.
19095         (do_mono_reflection_bind_generic_parameters): Use
19096         mono_class_inflate_generic_type() to correctly inflate types,
19097         rather than using our own hack just for MONO_TYPE_VAR.
19098
19099 2004-11-09  Martin Baulig  <martin@ximian.com>
19100
19101         * class.c (mono_class_inflate_generic_method): Small fix; don't
19102         crash here.
19103
19104         * icall.c
19105         (ves_icall_MonoType_GetGenericArguments): Don't ignore `byref' types.
19106         (ves_icall_Type_get_IsGenericTypeDefinition): Likewise.
19107         (ves_icall_Type_GetGenericTypeDefinition_impl): Likewise.
19108         (ves_icall_Type_BindGenericParameters): Likewise.
19109         (ves_icall_Type_get_IsGenericInstance): Likewise.
19110         (ves_icall_Type_GetGenericParameterPosition): Likewise.
19111         (ves_icall_MonoType_get_HasGenericArguments): Likewise.
19112         (ves_icall_MonoType_get_IsGenericParameter): Likewise.
19113         (ves_icall_MonoType_get_DeclaringMethod): Likewise.
19114
19115 2004-11-09  Zoltan Varga  <vargaz@freemail.hu>
19116
19117         * assembly.c (mono_assembly_names_equal): Reenable the comparison of
19118         assembly versions and public key tokens. Fixes #69113.
19119
19120 Tue Nov 9 17:34:05 CET 2004 Paolo Molaro <lupus@ximian.com>
19121
19122         * metadata.c: fix bug introduced with the type cache changes
19123         on 2004-11-06.
19124
19125 Tue Nov 9 17:26:29 CET 2004 Paolo Molaro <lupus@ximian.com>
19126
19127         * metadata.h, metadata.c, domain-internals.h, marshal.c: include
19128         the MonoClass pointer instead of the token in exception clauses.
19129         * reflection.c: updates for the above and make the code not depend
19130         on the structure of MonoExceptionClause.
19131
19132 2004-11-08  Zoltan Varga  <vargaz@freemail.hu>
19133
19134         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
19135         Add support for dynamic assemblies. Fixes #69114.
19136
19137         * loader.c (mono_method_get_header): Handle icalls and pinvoke methods.
19138
19139 2004-11-07  Ben Maurer  <bmaurer@ximian.com>
19140
19141         * class-internals.h (MonoMethod): Move addr to MonoMethodPInvoke
19142         since most only those methods use it. the code member of
19143         MonoMethodPInvoke was dead, so that can be removed too. Also,
19144         remove inline_count (again, not used), and move slot so that it
19145         can share bits with some other flags. This saves 8 bytes in the
19146         structure and gives us about 50 kb back for mcs helloworld.cs
19147
19148         * *.[ch]: Do naming changes for the above.
19149
19150         * loader.c (mono_method_get_header): Lazily init the header
19151         on first access.
19152         (mono_get_method_from_token): don't init the header here
19153         (mono_free_method): the header may never be allocated
19154
19155         Overall, this saves 150 kb of unmanaged allocations
19156         for mcs helloworld.cs. That accounts for 10% of the unmanaged
19157         memory at runtime.
19158         
19159         * loader.c, loader.h (mono_method_get_header): new accessor.
19160
19161         * *.[ch]: use the above method. Prepares us to lazily load
19162         the header.
19163
19164         * *.[ch]: Clean up all the pesky warnings. gcc now only gives
19165         three warnings, which are actual bugs (see 69206).
19166
19167         * class-internals.h (MonoMethod): Remove remoting_tramp. It is
19168         unused. Saves a cool 4 bytes / method.
19169
19170 2004-11-06  Ben Maurer  <bmaurer@ximian.com>
19171
19172         * metadata.c (builtin_types): Add types for System.Object here.
19173         (mono_metadata_parse_type_full): Cache MonoType*'s that are
19174         for a class or valuetype from klass->this_arg or klass->byval_arg.
19175
19176         On mcs for a hello world, this gets us down from 21836 MonoType's
19177         to 14560.
19178
19179         (mono_metadata_free_type): Account for the above change.
19180
19181 2004-11-06  Zoltan Varga  <vargaz@freemail.hu>
19182
19183         * appdomain.c (ves_icall_System_AppDomain_GetData): Throw an 
19184         exception instead of asserting if name is null.
19185         (ves_icall_System_AppDomain_GetData): Ditto.
19186
19187 2004-11-05  Zoltan Varga  <vargaz@freemail.hu>
19188
19189         (ves_icall_get_enum_info): Avoid crash when called on a non-finished
19190         EnumBuilder.
19191
19192         * icall.c (ves_icall_System_Reflection_Assembly_GetEntryAssembly): 
19193         Return NULL when the domain does not have entry_assembly set.
19194
19195         * icall.c (ves_icall_System_Reflection_Assembly_GetFilesInternal): 
19196         Add a 'resource_modules' argument.
19197         (ves_icall_type_GetTypeCode): Fix typecode of byref types.
19198
19199         * reflection.c (mono_reflection_create_runtime_class): Move setting
19200         of wastypebuilder here, so mono_get_type_object () returns a MonoType
19201         for enums too.
19202
19203         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi): Return NULL here instead of an empty string to match MS behavior.
19204         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi_len):
19205         Throw an ArgumentNullException if 'ptr' is null.
19206
19207         * appdomain.c (mono_domain_assembly_search): Avoid matching dynamic
19208         assemblies here. Fixes #69020.
19209
19210 2004-11-05  Geoff Norton  <gnorton@customerdna.com>
19211
19212         * reflection.c (build_compressed_metadata): Fix the previous patch for
19213         big endian systems.  GUINT32_FROM_LE isn't needed on strlen and was overwriting
19214         the stack.
19215
19216 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
19217
19218         * assembly.c (mono_assembly_names_equal): Allow a match if one of
19219         the cultures is false. Fixes #69090.
19220
19221         * reflection.c (build_compressed_metadata): Fix invalid memory read 
19222         detected by valgrind.
19223         
19224         * reflection.c (mono_reflection_get_type): Avoid triggering a 
19225         TypeResolve multiple times for the same type. Fixes #65577.
19226
19227 2004-11-04  Ben Maurer  <bmaurer@ximian.com>
19228
19229         * marshal.c: Avoid using ldftn to call managed functions. It is
19230         much slower than just a call.
19231
19232         * reflection.c (mono_module_get_object): free the basename we
19233         allocate here from glib.
19234         
19235         * reflection.c (ensure_runtime_vtable): make sure to free
19236         overrides.  Also, we were allocating an array of MonoMethod not an
19237         array of MonoMethod*.
19238
19239         * marshal.c (mono_marshal_get_stelemref): do a mono_mb_free here.
19240
19241         * image.c (mono_image_close): free image->guid here.
19242
19243 2004-11-02  Zoltan Varga  <vargaz@freemail.hu>
19244
19245         * reflection.c: Fix some spec conformance issues with the PE file
19246         structures so mcs compiled apps run on the Net 2.0 beta.
19247
19248 2004-11-01  Zoltan Varga  <vargaz@freemail.hu>
19249
19250         * string-icalls.c (ves_icall_System_String_ctor_encoding): 
19251         Implement this. Fixes #67264.
19252
19253         * debug-helpers.h debug-helpers.c marshal.c: Move 
19254         mono_find_method_by_name to debug-helpers.c.
19255
19256 2004-10-31  Zoltan Varga  <vargaz@freemail.hu>
19257
19258         * object.c (mono_release_type_locks): type_initialization_hash is
19259         a GHashTable.
19260
19261         * reflection.c object.c object-internals.h: Fix warnings.
19262
19263         * icall.c (ves_icall_Type_GetPropertiesByName): Handle properties
19264         without accessors. Fixes #61561.
19265
19266         * appdomain.c (ves_icall_System_AppDomain_createDomain): Inherit
19267         application base from the root domain if not set. Fixes #65641.
19268         (mono_runtime_init): Fix warning.
19269
19270 2004-10-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19271
19272         * appdomain.c: call mono_thread_pool_init.
19273         * threadpool.[ch]: new mono_thread_pool_init that sets the max. number
19274         of worker threads based on the number of CPUs and the environment
19275         variable MONO_THREADS_PER_CPU if present. The defaults are 50 (25)
19276         for non-windows (windows) systems.
19277
19278 2004-10-27  Chris Toshok  <toshok@ximian.com>
19279
19280         * mono-debug-debugger.c (write_class): don't call mono_class_init
19281         here, as even with the check for (!klass->init_pending), we get
19282         into a situation where we're hitting cycles in class
19283         initialization.  Fixes #68816.
19284
19285 2004-10-25  Zoltan Varga  <vargaz@freemail.hu>
19286
19287         * image.c: Avoid overwriting values in the loaded_images_hash when an
19288         assembly is loaded multiple times. Fixes #61152.
19289
19290         * assembly.c (mono_assembly_names_equal): Compare the cultures as well,
19291         so multiple satellite assemblies for the same name can be loaded.
19292         Fixes #68259.
19293
19294         * mono_domain_assembly_preload: Actually return the loaded assembly, 
19295         not NULL.
19296
19297         * icall.c (ves_icall_type_is_subtype_of): Fix this for byref types.
19298         (ves_icall_type_is_assignable_from): Ditto. Fixes #68582.
19299
19300         * gc.c (finalize_domain_objects): Call GC_invoke_finalizers () so
19301         pending finalizers are not invoked after the appdomain has been 
19302         unloaded. Fixes #67862.
19303
19304 2004-10-22  Martin Baulig  <martin@ximian.com>
19305
19306         * mono-debug-debugger.c
19307         (mono_debugger_runtime_invoke): Don't box valuetypes.
19308
19309 2004-10-22  Chris Toshok  <toshok@ximian.com>
19310
19311         * mono-debug-debugger.c (do_write_class): handle .cctors too, and
19312         don't hide private methods.
19313
19314 2004-10-22  Sebastien Pouliot  <sebastien@ximian.com>
19315
19316         * icall.c: Allows the runtime to "share" (when known) the public key
19317         token of an assembly. This avoid the need to recalculate the token 
19318         (from the public key) in managed code.
19319
19320 2004-10-21  Chris Toshok  <toshok@ximian.com>
19321
19322         * debug-helpers.c (append_class_name): argh, revert last patch.
19323         
19324 2004-10-21  Chris Toshok  <toshok@ximian.com>
19325
19326         * debug-helpers.c (append_class_name): use '+' as the delimiter,
19327         not '/', so that it matches what the debugger uses to look up
19328         methods.
19329
19330 2004-10-21  Martin Baulig  <martin@ximian.com>
19331
19332         * mono-debug-debugger.c (mono_debugger_throw_exception): New
19333         public method; this is called each time an exception is thrown and
19334         allows the debugger to use exception catch points.
19335
19336 2004-10-21  Martin Baulig  <martin@ximian.com>
19337
19338         * mono-debug-debugger.c (mono_debugger_handle_exception): Write
19339         the stack pointer and the exception object in some struct and pass
19340         that to the debugger.
19341
19342 2004-10-21  Chris Toshok  <toshok@ximian.com>
19343
19344         * mono-debug-debugger.c (do_write_class): add instance/static
19345         event support.  We don't expose "raise" or "other" yet.
19346         (event_is_static): new method.
19347
19348 2004-10-20  Bernie Solomon  <bernard@ugsolutions.com>
19349
19350         * mono-debug-debugger.c
19351         (mono_debugger_handle_exception): Remove
19352         bogus return value for fussy compilers.
19353
19354 2004-10-20  Martin Baulig  <martin@ximian.com>
19355
19356         * mono-debug-debugger.c
19357         (mono_debugger_unhandled_exception): Added `gpointer stack' argument.
19358         (mono_debugger_handled_exception): Likewise.
19359
19360 2004-10-20  Martin Baulig  <martin@ximian.com>
19361
19362         * mono-debug-debugger.h (MonoDebuggerEvent): Added
19363         MONO_DEBUGGER_EVENT_EXCEPTION.
19364
19365         * mono-debug-debugger.c (mono_debugger_handle_exception): New
19366         public function to send the debugger a notification for an
19367         exception and inform it about a catch/finally clause.
19368
19369 2004-10-19  Zoltan Varga  <vargaz@freemail.hu>
19370
19371         * marshal.c, icall.c: Applied patch from Alexandre Rocha Lima e
19372         Marcondes (alexandremarcondes@psl-pr.softwarelivre.org). Really
19373         fix 2.95 build. 
19374
19375         * icall.c (ves_icall_InternalExecute): Fix build for gcc-2.95.
19376
19377 2004-10-18  Zoltan Varga  <vargaz@freemail.hu>
19378
19379         * marshal.c (emit_marshal_object): Fix freeing of memory when a reference type is
19380         marshalled as [In,Out]. Fixes #58325.
19381
19382 2004-10-14  Zoltan Varga  <vargaz@freemail.hu>
19383
19384         * reflection.c (mono_method_body_get_object): Implement some fields.
19385
19386 2004-10-12  Martin Baulig  <martin@ximian.com>
19387
19388         * reflection.c (mono_reflection_bind_generic_parameters): Small
19389         fix, correctly retrieve our parent from a generic instance.
19390
19391 2004-10-12  Martin Baulig  <martin@ximian.com>
19392
19393         * metadata.c (mono_metadata_generic_param_equal): We always have
19394         an owner.
19395
19396         * class.c
19397         (mono_class_from_generic_parameter): We need to have an owner.
19398         (my_mono_class_from_generic_parameter): Likewise.
19399
19400         * reflection.c (mono_reflection_setup_generic_class): Renamed to
19401         mono_reflection_create_generic_class() and added a new
19402         mono_reflection_setup_generic_class().  
19403         (mono_reflection_initialize_generic_param): If we're a nested
19404         generic type and inherited from the containing class, set our
19405         owner to the outer class.
19406
19407 2004-10-11  Zoltan Varga  <vargaz@freemail.hu>
19408
19409         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodBodyInternal): New icall.
19410
19411         * reflection.c (mono_method_body_get_object): New function to create
19412         a MethodBody object.
19413
19414         * object-internals.h object.h: Add MonoReflectionMethodBody structure.
19415
19416 2004-10-11  Martin Baulig  <martin@ximian.com>
19417
19418         * metadata.c (_mono_metadata_type_equal): Renamed to
19419         do_mono_metadata_type_equal() and made static.
19420
19421 2004-10-11  Martin Baulig  <martin@ximian.com>
19422
19423         * appdomain.c: Bump corlib version number to 28.
19424
19425 2004-10-10  Martin Baulig  <martin@ximian.com>
19426
19427         * class-internals.h
19428         (MonoGenericInst): Added `MonoGenericContainer *container'.
19429         (MonoGenericMethod): Likewise.
19430         (MonoGenericContext): Likewise.
19431         (MonoGenericParam): Added `MonoGenericContainer *owner'.
19432
19433         * metadata.c
19434         (do_mono_metadata_parse_type): Added a `MonoGenericContainer *' argument.
19435         (do_mono_metadata_parse_generic_inst): Likewise.
19436         (mono_metadata_parse_type_full): New public method.  This is the actual
19437         mono_metadata_parse_type() implementation - with an additional
19438         `MonoGenericContainer *' argument.
19439         (mono_metadata_parse_array_full): Likewise.
19440         (mono_metadata_parse_signature_full): Likewise.
19441         (mono_metadata_parse_method_signature_full): Likewise.
19442         (mono_metadata_parse_mh_full): Likewise.
19443         (mono_type_create_from_typespec): Likewise.
19444         (mono_metadata_interfaces_from_typedef_full): New public method;
19445         this is similar to the other _full() methods, but we take a
19446         `MonoGenericContext *' since we have to pass it to mono_class_get_full().
19447         (mono_metadata_parse_generic_param): Take an additional
19448         `MonoGenericContainer *' argument and lookup the MonoGenericParam
19449         from that container.
19450         (mono_metadata_generic_param_equal): New static method to compare
19451         two type parameters.
19452         (_mono_metadata_type_equal): New static method; takes an
19453         additional `gboolean signature_only' argument - if true, we don't
19454         compare the owners of generic parameters.
19455         (mono_metadata_signature_equal): Call _mono_metadata_type_equal()
19456         with a TRUE argument - do a signature-only comparision.
19457
19458         * loader.c: Use the new _full() methods and pass the
19459         MonoGenericContainer to them.
19460
19461         * object-internals.h (MonoReflectionTypeBuilder): Added
19462         `MonoGenericContainer *generic_container' field.
19463         (MonoReflectionMethodBuilder): Likewise.
19464
19465 2004-10-08  Zoltan Varga  <vargaz@freemail.hu>
19466
19467         * icall.c (ves_icall_System_Reflection_Module_GetGlobalType): Special
19468         case initial images of dynamic assemblies.
19469
19470         * reflection.c (mono_image_basic_init): Set 'initial_image' field.
19471
19472         * metadata-internals.h (MonoDynamicImage): Add 'initial_image' field.
19473
19474         * reflection.c (mono_reflection_event_builder_get_event_info): Fix
19475         length of event->other array.
19476         (typebuilder_setup_events): Ditto.
19477
19478         * domain-internals.h (MonoDomain): Rename 'assemblies' hash table to
19479         'assembly_by_name' and add an 'assemblies' list.
19480
19481         * assembly.h assembly.c: Add a new search hook for determining whenever
19482         an assembly is already loaded. Use this instead of searching in the
19483         loaded_assemblies list.
19484
19485         * domain.c appdomain.c: Implement the new search hook so loaded 
19486         assemblies are now scoped by appdomain. Fixes #67727.
19487
19488 2004-10-07  Zoltan Varga  <vargaz@freemail.hu>
19489
19490         * threads.c (mono_thread_attach): Initialize synch_lock field so
19491         mono_thread_detach works again.
19492
19493         * loader.c (mono_lookup_pinvoke_call): Try the dllname prefixed with
19494         'lib' too. Fixes #63130.
19495
19496 2004-10-06  Jackson Harper  <jackson@ximian.com>
19497
19498         * culture-info-tables.h: regenerated.
19499
19500 2004-10-06  Zoltan Varga  <vargaz@freemail.hu>
19501
19502         * icall.c (ves_icall_Type_GetInterfaces): Include interfaces 
19503         implemented by other interfaces in the result. Fixes #65764.
19504         
19505         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
19506         Handle unloadable modules without crashing.
19507
19508         * image.c (load_modules): Revert the previous patch since modules must
19509         have a fixed index inside the array.
19510         
19511         * image.c (load_modules): Don't include native modules in the modules
19512         array.
19513
19514 2004-10-05  Zoltan Varga  <vargaz@freemail.hu>
19515
19516         * reflection.h: Add param_defaults field.
19517
19518         * reflection.c: Add support for parameter defaults in dynamic methods.
19519         Fixes #64595.
19520
19521         * icall.c (ves_icall_MonoType_get_Namespace): Return NULL instead of
19522         an empty string when a type has no namespace. Fixes #64230.
19523
19524 2004-10-04  Sebastien Pouliot  <sebastien@ximian.com>
19525
19526         * tabledefs.h: Added "internal" security actions to support non-CAS
19527         permissions NonCasDemand, NonCasLinkDemand and NonCasInheritance. 
19528         Note: they do not seems to be used anymore in 2.0 (new metadata format)
19529
19530 2004-10-04  Zoltan Varga  <vargaz@freemail.hu>
19531
19532         * icall.c (ves_icall_InternalInvoke): Throw an exception when calling
19533         constructor of abstract class. Fixes #61689.
19534
19535 2004-10-04  Martin Baulig  <martin@ximian.com>
19536
19537         * class-internals.h (MonoGenericContainer): New type.
19538         (MonoMethodNormal): Replaced `MonoGenericParam *gen_params' with
19539         `MonoGenericContainer *generic_container'.
19540         (MonoClass): Replaced `gen_params' and `num_gen_params' with
19541         `MonoGenericContainer *generic_container'.
19542
19543         * metadata.c (mono_metadata_load_generic_params): Return a
19544         `MonoGenericContainer *' instead of a `MonoGenericParam *';
19545         removed the `num' argument.
19546
19547 2004-10-03  Zoltan Varga  <vargaz@freemail.hu>
19548
19549         * icall.c (ves_icall_System_Reflection_Module_GetPEKind): Add support
19550         for dynamic images.
19551
19552         * object-internals.h (MonoReflectionAssemblyBuilder): Add pe_kind and
19553         machine fields.
19554
19555         * metadata-internals.h (MonoDynamicImage): Add pe_kind and machine fields.
19556
19557         * reflection.c: Save pe_kind and machine values into the generated
19558         image file.
19559
19560         * appdomain.c: Bump corlib version number.
19561
19562         * object-internals.h: Reorganize layout of LocalBuilder.
19563
19564         * class-internals.h class.c (mono_class_get_implemented_interfaces): 
19565         New helper function.
19566
19567         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Return the
19568         created MonoType for dynamic types. Fixes #66180.
19569
19570 2004-10-02  Ben Maurer  <bmaurer@ximian.com>
19571
19572         * threadpool.c: the ares hashtable needs a critical section around it.
19573         this prevents some nasty segfaults
19574
19575 2004-10-02  Massimiliano Mantione  <massi@ximian.com>
19576
19577         * process.c: Fixed alignments to 32 bits as casting to unsigned is unsafe
19578         on 64 bits platforms, patch by will@exomi.com (Ville-Pertti Keinonen), see
19579         bug 67324).
19580         
19581 2004-09-30  Zoltan Varga  <vargaz@freemail.hu>
19582
19583         * object-internals.h (MonoReflectionTypeBuilder): Add 'created' field.
19584         
19585 2004-09-30  Lluis Sanchez Gual  <lluis@novell.com>
19586
19587         * image.c: Always canonicalize image file names, to avoid loading
19588         the same assembly twice when referenced using a relative path.
19589
19590 2004-09-30  Zoltan Varga  <vargaz@freemail.hu>
19591
19592         * marshal.h marshal.c icall.c: Fix bugs in previous patch.
19593
19594         * marshal.c marshal.h icall.c: Add GetDelegateForFunctionPointerInternal icall.
19595
19596         * marshal.c: Fix warnings.
19597
19598 2004-09-29  Geoff Norton  <gnorton@customerdna.com>
19599
19600         * marshal.c (mono_ftnptr_to_delegate): This method was improperly
19601         attempting to marshal the delegate_trampoline as the method_addr.
19602         This patch has a static hashtable of marshalled delegates so that 
19603         we can map delegate_trampoline addresses back to delegates.  This
19604         allows a delegate passed to managed code to be passed back into native
19605         code.  Fixes #67039
19606
19607 2004-09-28  Zoltan Varga  <vargaz@freemail.hu>
19608
19609         * icall.c: Add GetFunctionPointerForDelegateInternal icall.
19610
19611         * reflection.c (method_encode_code): Align method headers properly.
19612         Fixes #66025.
19613
19614 2004-09-28  Lluis Sanchez Gual  <lluis@novell.com>
19615
19616         * marshal.c: In the runtime invoke wrapper, reset the abort
19617         exception if it is cached. This avoids the automatic rethrowal of 
19618         the exception after the catch of the wrapper. Also check for pending
19619         interruptions before calling the managed method. This is done using
19620         the new method emit_thread_force_interrupt_checkpoint, since the
19621         normal checkpoint method is ignored when running the invoke wrapper.
19622         * object.c: If the abort exception is rethrown, set the abort_exc
19623         field of the thread, so it will be rethrown aftere every catch.
19624         * threadpool.c: Only run an interruption checkpoint if what has been
19625         requested is a stop of the thread (aborts will be ignored).
19626         * threads.c: By default, a thread will now never be interrumped while
19627         running the runtime invoke wrapper (this ensures that runtime_invoke
19628         will always return to the caller if an exception pointer is provided).
19629         There is a new special method mono_thread_force_interruption_checkpoint()
19630         to force an interruption checkpoint even if running a protected
19631         wrapper, which is used by the same runtime invoke wrapper to do a check
19632         at a safe point.
19633
19634 2004-09-28  Lluis Sanchez Gual  <lluis@novell.com>
19635
19636         * object.c, object-internals.h: Implemented mono_release_type_locks,
19637         which releases the cctor locks held by a thread.
19638         * threads.c, threads.h: In thread_cleanup, release cctor locks held
19639         by a thread. Added mono_thread_exit() method to be used to safely stop
19640         a thread.
19641
19642 2004-09-28  Raja R Harinath  <rharinath@novell.com>
19643
19644         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
19645         Move null check before dereference.  Avoid indexing beyond the end
19646         of the 'modules' array.
19647
19648 2004-09-28  Raja R Harinath  <rharinath@novell.com>
19649
19650         * metadata-internals.h (MonoImage): Add module_count field.
19651         * image.c (load_modules): Set image->module_count.
19652         (mono_image_load_file_for_image): Use image->module_count.
19653         * reflection.c (mono_image_load_module): Append to image->modules array 
19654         of dynamic assembly.
19655         (mono_module_get_object): Fix loop to actually increment index.
19656         Use image->module_count.
19657         * assembly.c (mono_assembly_load_references): Use image->module_count.
19658         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal):
19659         Likewise.
19660
19661 2004-09-28  Zoltan Varga  <vargaz@freemail.hu>
19662
19663         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): 
19664         Avoid assert on generic types.
19665
19666 2004-09-26  Zoltan Varga  <vargaz@freemail.hu>
19667
19668         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): New icall.
19669
19670         * reflection.c (mono_param_get_objects): Fill out MarshalAsImpl field.
19671
19672         * reflection.c (mono_reflection_marshal_from_marshal_spec): New 
19673         function to convert a MarshalSpec structure to its managed counterpart.
19674
19675         * reflection.c: Fix warnings.
19676         
19677         * object-internals.h (MonoReflectionParameter): Add MarshalAsImpl
19678         field.
19679
19680         * icall.c (mono_create_icall_signature): Fix build.
19681
19682 2004-09-25  Zoltan Varga  <vargaz@freemail.hu>
19683
19684         * icall.c: Add MakePointType icall.
19685
19686         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage): Fix
19687         warnings.
19688
19689 2004-09-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19690
19691         * threadpool.c: reuse allocated slots in the queue.
19692
19693 2004-09-24  Zoltan Varga  <vargaz@freemail.hu>
19694
19695         * object-internals.h (MonoReflectionDllImportAttribute): New structure.
19696
19697         * icall.c: Add new icalls for GetDllImportAttribute and GetFieldOffset.
19698
19699         * reflection.h reflection.c (mono_reflection_get_custom_attrs): Revert
19700         previous change.
19701
19702         * tabledefs.h: Add constants for pinvoke attributes BestFit and
19703         ThrowOnUnmappableChar.
19704
19705         * icall.c (ves_icall_Type_GetPacking): New icall.
19706
19707 2004-09-24  Martin Baulig  <martin@ximian.com>
19708
19709         * icall.c (ves_icall_Type_GetGenericParameterConstraints): New interncall.
19710
19711 2004-09-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19712
19713         * appdomain.c:
19714         (mono_domain_set): allow setting a domain that is being unloaded.
19715         (mono_domain_unload): invoke the DomainUnload callbacks in the domain
19716         being unloaded.
19717
19718 2004-09-23  Zoltan Varga  <vargaz@freemail.hu>
19719
19720         * icall.c reflection.h reflection.c: Add a 'pseudo_attrs' argument to
19721         the GetCustomAttributes icall.
19722
19723 2004-09-23  Martin Baulig  <martin@ximian.com>
19724
19725         * object-internals.h (MonoReflectionGenericParam): Replaced
19726         'has_ctor_constraint', `has_reference_type' and `has_value_type'
19727         with `guint32 attrs'.
19728
19729 2004-09-23  Martin Baulig  <martin@ximian.com>
19730
19731         * icall.c (ves_icall_Type_GetGenericParameterAttributes): New interncall.
19732
19733 2004-09-23  Martin Baulig  <martin@ximian.com>
19734
19735         * object-internals.h (GenericParameterAttributes): New enum.
19736
19737 2004-09-23  Zoltan Varga  <vargaz@freemail.hu>
19738
19739         * object-internals.h (MonoEventInfo): Add 'other_methods' field.
19740         
19741         * class.c (init_events): Fill out event->other field.
19742
19743         * class.c: Fix warnings.
19744
19745         * icall.c (ves_icall_get_event_info): Fill out 'other_methods' field.
19746
19747 Wed Sep 22 19:04:32 CEST 2004 Paolo Molaro <lupus@ximian.com>
19748
19749         * class-internals.h, icall.c, loader.c, loader.h: added a faster stack
19750         walk which doesn't supply the IL offset.
19751
19752 2004-09-22  Martin Baulig  <martin@ximian.com>
19753
19754         * reflection.c (mono_reflection_setup_internal_class): If we're
19755         System.ValueType, System.Object or System.Enum, set
19756         `klass->instance_size' and create the vtable.
19757         (mono_reflection_create_internal_class): If we're an enum type,
19758         get the base class from our current corlib.
19759
19760 2004-09-22  Zoltan Varga  <vargaz@freemail.hu>
19761
19762         * reflection.h (MonoResolveTokenError): New type.
19763
19764         * icall.c (ves_icall_System_Reflection_Module_ResolveMemberToken): New
19765         icall.
19766
19767         * icall.c: Add an 'error' argument to the ResolveToken icalls.
19768
19769 2004-09-22  Lluis Sanchez Gual  <lluis@novell.com>
19770
19771         * icall.c: Support ContextBoundObject proxies in ves_icall_InternalExecute.
19772         Support also calling constructors, but only for already allocated objects.
19773
19774 2004-09-17  Geoff Norton <gnorton@customerdna.com>
19775
19776         * reflection.c (type_get_qualified_name): If the klass is null
19777         return the typename to avoid a NullRefEx.
19778         (encode_cattr_value): Get the qualified name of the boxed type,
19779         not the underlying enumtype.  Fixes #62984.
19780
19781 2004-09-21  Zoltan Varga  <vargaz@freemail.hu>
19782
19783         * marshal.c: Fix problems with previous checkin.
19784
19785 2004-09-21    <vargaz@freemail.hu>
19786
19787         * marshal.h marshal.c icall.c: Add new icalls for Alloc/FreeHGlobal. Change the
19788         existing mono_marshal_alloc/free functions to use CoTaskMemAlloc/Free under windows.
19789
19790         * marshal.c: Allocate marshaller memory using mono_marshal_alloc/free.
19791
19792 2004-09-21  Geoff Norton <gnorton@customerdna.com>
19793
19794         * icall.c (ves_icall_MonoType_GetElementType): GetElementType
19795         should only return a type for pointers, arrays, and passbyref types.
19796         Fixes bug #63841.
19797
19798 2004-09-21  Martin Baulig  <martin@ximian.com>
19799
19800         * domain.c (mono_debugger_check_runtime_version): New public
19801         function.
19802
19803         * icall.c (ves_icall_MonoDebugger_check_runtime_version): New icall.    
19804
19805 2004-09-20  Sebastien Pouliot  <sebastien@ximian.com>
19806
19807         * reflection.c: Added missing sort to the declarative security 
19808         attributes table. MS implementation stops seeing the attributes if the
19809         token number regress in the table (as shown by ildasm and permview).
19810
19811 2004-09-20  Zoltan Varga  <vargaz@freemail.hu>
19812
19813         * object-internals.h (MonoReflectionModule): Add 'token' field.
19814         
19815         * reflection.c (mono_reflection_get_token): Add support for Module
19816         and Assembly.
19817         (mono_module_get_object): Set 'token' field.
19818         (mono_module_file_get_object): Set 'token' field.
19819
19820         * icall.c: Add new Assembly and Module icalls.
19821
19822         * appdomain.c: Bump corlib version.
19823
19824 2004-09-19  Zoltan Varga  <vargaz@freemail.hu>
19825
19826         * loader.h loader.c class.h class.c: Add helper functions for obtaining
19827         tokens of metadata objects.
19828
19829         * reflection.h reflection.c (mono_reflection_get_token): New function
19830         to obtain the token of a metadata object.
19831
19832         * icall.c: Add icalls for MetadataToken and ModuleHandle methods.
19833
19834 2004-09-17  Zoltan Varga  <vargaz@freemail.hu>
19835
19836         * loader.c (mono_lookup_pinvoke_call): Try the underscore prefixed name as well.
19837         
19838         * loader.c (mono_lookup_pinvoke_call): Add support for stdcall name mangling.
19839
19840 2004-09-16  Sebastien Pouliot  <sebastien@ximian.com>
19841
19842         * appdomain.c: Bumped MONO_CORLIB_VERSION to 25.
19843         * object-internals.h: Added 3 MonoArray* members to MonoReflection
19844         AssemblyBuilder to access the permissions set in the class lib.
19845         * reflection.c: Added security attributes encoding step in 
19846         mono_image_build_metadata.
19847         * tabledefs.h: Added new security actions defined in 2.0:
19848         LinkDemandChoice, InheritanceDemandChoice and DemandChoice.
19849
19850 2004-09-16  Lluis Sanchez Gual  <lluis@novell.com>
19851
19852         * threads.c: Fixed SET_CURRENT_OBJECT macros, they were ignoring the
19853         macro parameter.
19854
19855 2004-09-16  Lluis Sanchez Gual  <lluis@novell.com>
19856  
19857         * locales.c: nullify the ICU_collator member of CompareInfo when it is
19858           finalized. There where random SIGSEVs at program termination, when
19859           an object being finalized was trying to do a string comparison and
19860           the current culture was already finalized.
19861  
19862 2004-09-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19863
19864         * threads.c: call thread_cleanup before finishing the thread if we get
19865         there.
19866
19867 2004-09-16  Zoltan Varga  <vargaz@freemail.hu>
19868
19869         * appdomain.c (ves_icall_System_AppDomain_createDomain): Load all
19870         assemblies from the parent. Fixes #65665.
19871
19872 2004-09-15  Zoltan Varga  <vargaz@freemail.hu>
19873
19874         * metadata.c (mono_metadata_parse_type): Fix parsing of custom
19875         modifiers.
19876
19877 2004-09-14  Bernie Solomon  <bernard@ugsolutions.com>
19878
19879         * reflection.h: add prototype for mono_get_dbnull_object
19880         * reflection.c: add prototypes for get_default_param_value_blobs 
19881         and mono_get_object_from_blob for fussier compilers
19882
19883 2004-09-14  Lluis Sanchez Gual  <lluis@novell.com>
19884  
19885         * object.c: Added a "done" flag to TypeInitializationLock. This avoids
19886         false deadlock checks in class initialization.
19887  
19888 2004-09-13  Zoltan Varga  <vargaz@freemail.hu>
19889
19890         * image.c (mono_image_addref): Fix comment.
19891
19892         * metadata.c (mono_metadata_parse_type): Avoid memory allocations if
19893         possible.
19894
19895 2004-09-12  Jambunathan K  <kjambunathan@novell.com>
19896
19897         * reflection.c (mono_param_get_objects): Modified to return
19898         ParameterInfo.DefaultValue object.
19899
19900         (get_default_param_value_blobs):
19901         (mono_get_object_from_blob):
19902         (mono_get_dbnull_object): New helper routines. 
19903
19904         * object.c (mono_get_constant_value_from_blob): New helper routine
19905         carved out from get_default_field_value ()
19906
19907         * object-internals.h (mono_get_constant_value_from_blob): Added
19908         function declaration.
19909
19910 2004-09-11  Zoltan Varga  <vargaz@freemail.hu>
19911
19912         * assembly.c assembly.h icall.c class.c appdomain.c: Lazily load 
19913         referenced assemblies. Fixes #62135.
19914
19915         * exception.h exception.c (mono_get_exception_file_not_found2): New
19916         helper function.
19917
19918 2004-09-10  Zoltan Varga  <vargaz@freemail.hu>
19919
19920         * class.h class.c: Add mono_type_get_underlying_type ().
19921
19922 2004-09-09  Geoff Norton <gnorton@customerndna.com>
19923
19924         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes):
19925         Fix GetTypes() to support dynamically created assemblies.
19926
19927 2004-09-09  Zoltan Varga  <vargaz@freemail.hu>
19928
19929         * reflection.c (reflection_methodbuilder_to_mono_method): Remove TODO.
19930         
19931         * reflection.c (reflection_methodbuilder_to_mono_method): Fix bug in
19932         previous patch.
19933
19934         * reflection.h reflection.c loader.c: Allow dynamic construction of
19935         pinvoke methods. Fixes #65571.
19936         
19937         * reflection.c (mono_reflection_get_type): Revert previous change since
19938         it causes regressions.
19939
19940 2004-09-08  Martin Baulig  <martin@ximian.com>
19941
19942         * class.c (class_compute_field_layout): Don't call
19943         mono_class_layout_fields() for open generic instances.
19944
19945 2004-09-08 Bernie Solomon <bernard@ugsolutions.com>
19946         * threads.c appdomain.c: fix typo in GC macro
19947
19948 2004-09-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19949
19950         * threads.c: don't call mono_thread_detach() in start_wrapper(),
19951         avoiding a possible hang in GetCurrentThreadId(0). Fixes bug #65379.
19952
19953 2004-09-08  Zoltan Varga  <vargaz@freemail.hu>
19954
19955         * image.c (mono_image_close): Applied patch from 
19956         vasantha.paulraj@honeywell.com (Vasantha selvi). Fix crash when an
19957         assembly is loaded multiple times from data.
19958         
19959         * image.c (mono_image_open): Fix warning.
19960
19961 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
19962
19963         * reflection.h reflection.c icall.c: Only call TypeResolve handlers
19964         once. Fixes #58334.
19965         
19966         * reflection.c (mono_reflection_create_runtime_class): Initialize
19967         klass->nested_classes. Fixes #61224.
19968
19969 Tue Sep 7 14:35:26 CEST 2004 Paolo Molaro <lupus@ximian.com>
19970
19971         * threads.c: sched_yield() on exit, to allow threads to quit.
19972
19973 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
19974
19975         * object.c (mono_unhandled_exception): Remove leftover debug code.
19976
19977 2004-09-07  Atsushi Enomoto  <atsushi@ximian.com>
19978
19979         * appdomain.c, threads.c : don't use GC_CreateThread when with-gc=none
19980
19981 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
19982
19983         * marshal.c (emit_marshal_array): Really null terminate string arrays.
19984         
19985         * marshal.c (emit_marshal_string): Fix freeing of unicode strings.
19986
19987 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
19988
19989         * marshal.c (emit_marshal_array): Null terminate string arrays.
19990         
19991         * marshal.c (raise_auto_layout_exception): Fix warning.
19992
19993         * reflection.c (mono_param_get_objects): Initialize the default value
19994         with DBNull.Value, not null. Fixes #62123.
19995
19996 2004-09-01  Miguel de Icaza  <miguel@ximian.com>
19997
19998         * marshal.c (mono_marshal_get_managed_wrapper): Remove FIXME and
19999         throw an exception with a cute explanation.
20000
20001 2004-09-06  Dick Porter  <dick@ximian.com>
20002
20003         * process.c (ves_icall_System_Diagnostics_Process_Start_internal):
20004         Close the new process's thread handle, as we don't use it.  The
20005         handle stays around forever otherwise.
20006
20007 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
20008
20009         * object.c (arith_overflow): Fix warning.
20010
20011         * reflection.c (mono_image_get_methodref_token): Do not emit unmanaged
20012         calling conventions in method refs. Fixes #65352.
20013
20014         * reflection.c: Fix warnings.
20015
20016 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
20017
20018         * icall.c: Add a new icall for Array.Clear
20019
20020 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
20021
20022         * object.c: When allocating an array, we have to throw
20023         an overflow exception if any of the lengths are < 0.
20024
20025 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
20026
20027         * marshal.h marshal.c: Free unmanaged memory allocated by managed code
20028         properly. Also move implementation of string array marshalling to 
20029         managed code. Fixes #42316.
20030
20031 2004-09-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20032
20033         * assembly.c: provide more information when loading an assembly fails.
20034
20035 2004-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20036
20037         * filewatcher.c: don't expect the development fam package to be
20038         installed.
20039
20040 2004-09-03  Zoltan Varga  <vargaz@freemail.hu>
20041
20042         * marshal.c: Make a copy of the signature cookie since it will be
20043         freed by the caller.
20044         
20045         * marshal.c (mono_delegate_to_ftnptr): Fix bug in previous patch.
20046
20047         * marshal.c (mono_delegate_to_ftnptr): Fix memory leaks.
20048
20049         * metadata.c (mono_metadata_free_marshal_spec): New function to free
20050         marshal specs.
20051
20052         * marshal.c: More refactoring.
20053         
20054         * marshal.c: Refactor the mono_marshal_get_native_wrapper function into
20055         smaller functions.
20056
20057 2004-09-03  Lluis Sanchez Gual  <lluis@novell.com>
20058
20059         * object.c: In mono_message_invoke, fill the output parameter array after
20060           calling the managed method (it was done before the call). This fixes
20061           bug #59299.
20062
20063 2004-09-02  Zoltan Varga  <vargaz@freemail.hu>
20064
20065         * marshal.c (mono_marshal_alloc): Return a valid pointer on size 0
20066         as well.
20067
20068 2004-09-02  Martin Baulig  <martin@ximian.com>
20069
20070         * class.c (mono_class_instance_size): Don't allow generic type
20071         definitions or open generic instances.
20072         (mono_class_array_element_size): If we're a value type, call
20073         mono_class_instance_size() on the original class.
20074
20075         * metadata.c (mono_type_size, mono_type_stack_size): Correctly
20076         handle generic instances.
20077
20078         * mono-debug-debugger.c (write_type): Handle generic instances
20079         like classes.
20080
20081 2004-09-02  Zoltan Varga  <vargaz@freemail.hu>
20082
20083         * marshal.c (mono_marshal_alloc): Raise an OutOfMemory exception if
20084         the allocation request fails. Fixes #65089.
20085
20086         * object.c (mono_runtime_free_method): Do not call mono_free_method.
20087         
20088         * object.c (mono_runtime_free_method): New function to free a dynamic
20089         method.
20090
20091         * marshal.c (mono_delegate_free_ftnptr): New function to free the
20092         delegate trampoline.
20093
20094         * marshal.c (mono_marshal_get_managed_wrapper): Mark managed wrapper
20095         with hasthis as dynamic,
20096
20097         * icall.c (ves_icall_System_Delegate_FreeTrampoline): New icall.
20098
20099         * domain.c (mono_jit_info_table_remove): New function to remove an
20100         entry from the jit info table.
20101
20102         * class-internals.h (MonoMethod): Add 'dynamic' field.
20103
20104         * loader.c: Fix warnings.
20105
20106 2004-09-01  Martin Baulig  <martin@ximian.com>
20107
20108         * mono-debug.c, debug-mono-symfile.c: Use mono_loader_lock()
20109         instead of mono_debugger_lock() because the latter one is a no-op
20110         unless running in the debugger.
20111
20112 2004-09-01  Zoltan Varga  <vargaz@freemail.hu>
20113
20114         * class.c (class_compute_field_layout): Classes with auto-layout or
20115         reference fields are not blittable.
20116         
20117 2004-09-01  Dick Porter  <dick@ximian.com>
20118
20119         * icall.c (ves_icall_System_Reflection_Assembly_get_location): Use
20120         mono_image_get_filename() to get the assembly location.
20121
20122         * icall.c:
20123         * metadata.h: Fix compile warnings
20124
20125 2004-09-01  Zoltan Varga  <vargaz@freemail.hu>
20126
20127         * class.c (class_compute_field_layout): System.Object is blittable.
20128
20129         * marshal.c (mono_marshal_get_native_wrapper): Pass blittable classes
20130         as in/out. Fixes #59909.
20131
20132 2004-09-01  Martin Baulig  <martin@ximian.com>
20133
20134         * metadata.h (MONO_TYPE_ISREFERENCE): Call
20135         mono_metadata_generic_inst_is_valuetype() if we're a generic
20136         instance to check whether our underlying type is a reference type.
20137
20138 2004-09-01  Martin Baulig  <martin@ximian.com>
20139
20140         * metadata.c (mono_type_size): If we're a generic instance, call
20141         mono_class_value_size() for value types.
20142
20143 2004-08-31  Zoltan Varga  <vargaz@freemail.hu>
20144
20145         * marshal.c: Implement more custom marshalling functionality. Fixes
20146         #64915.
20147
20148 Tue Aug 31 17:55:15 CEST 2004 Paolo Molaro <lupus@ximian.com>
20149
20150         * mono-debug.c, debug-mono-symfile.c: add some locking love.
20151
20152 2004-08-30  Zoltan Varga  <vargaz@freemail.hu>
20153
20154         * domain-internals.h domain.c: Add a per-domain jump trampoline hash.
20155
20156         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandle): Rename to ...Internal.
20157
20158         * icall.c: Fix some warnings.
20159
20160         * threads.c (abort_appdomain_thread): Fix unref errors.
20161         (mono_thread_current): Fix THREAD_DEBUG define.
20162
20163 2004-08-29  Zoltan Varga  <vargaz@freemail.hu>
20164
20165         * metadata.h (MONO_TYPE_ISSTRUCT): Fix warning.
20166
20167         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandle): New icall.
20168
20169 2004-08-28  Zoltan Varga  <vargaz@freemail.hu>
20170
20171         * marshal.c (mono_marshal_get_native_wrapper): Add support for byref 
20172         string arrays.
20173
20174 2004-08-28  Martin Baulig  <martin@ximian.com>
20175
20176         * metadata.c
20177         (mono_metadata_generic_inst_is_valuetype): New public function.
20178
20179         * metadata.h (MONO_TYPE_ISSTRUCT): Call
20180         mono_metadata_generic_inst_is_valuetype() if we're a generic
20181         instance to check whether our underlying type is a valuetype.
20182
20183 2004-08-26  Zoltan Varga  <vargaz@freemail.hu>
20184
20185         * class.c (mono_ptr_class_get): Fix name of pointer classes. Fixes
20186         #63768.
20187
20188 2004-08-25  Martin Baulig  <martin@ximian.com>
20189
20190         * loader.c (mono_get_method_from_token): Abstract methods can also
20191         be generic and thus have type parameters.
20192
20193         * metadata-internals.h
20194         (MonoDynamicImage): Added `GPtrArray *gen_params'.
20195
20196         * reflection.c (mono_image_get_generic_param_info): Don't create a
20197         metadata row, just add an entry to the `gen_params' array.
20198         (build_compressed_metadata): Sort the `gen_params' array and then
20199         actually create the metadata.
20200
20201 2004-08-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20202
20203         * threadpool.c: remove unneeded 'if' around mono_monitor_enter.
20204
20205 2004-08-25  Zoltan Varga  <vargaz@freemail.hu>
20206
20207         * debug-helpers.c: Handle MONO_TYPE_GENERICINST.
20208
20209 2004-08-24  Martin Baulig  <martin@ximian.com>
20210
20211         * class.cs (mono_class_is_subclass_of): Like an interface, a
20212         generic instance also derives from System.Object.
20213
20214 2004-08-23  Zoltan Varga  <vargaz@freemail.hu>
20215
20216         * metadata.c (mono_metadata_parse_type): Alloc pinned, byref and
20217         custom modifiers to be in any order. Fixes #61990.
20218
20219 2004-08-20  Zoltan Varga  <vargaz@freemail.hu>
20220
20221         * object.c: Register mono_object_new_fast icall.
20222         
20223         * object.c (mono_class_get_allocation_ftn): Return to calling
20224         mono_object_new_fast, since it seems faster to compute the object 
20225         size in unmanaged code than passing it as a parameter.
20226
20227         * object.c (mono_class_get_allocation_ftn): Add marshalbyref case.
20228
20229         * gc-internal.h gc.c: Add mono_gc_out_of_memory () function. Register
20230         this function with Boehm as the oom handler, so we don't have to check
20231         the result of GC_malloc.
20232
20233         * object.c: Remove checks for oom.
20234
20235         * object.h object.c (mono_class_get_allocation_ftn): New function to
20236         return the icall which can be used to allocate an instance of a given
20237         class. 
20238
20239         * object.c: Handle common allocation requests using GC_gcj_fast_malloc.
20240
20241         * class-internals.h: Add 'enabled' field.
20242
20243 2004-08-19  Zoltan Varga  <vargaz@freemail.hu>
20244
20245         * domain.c (mono_init_internal): Call MONO_GC_PRE_INIT ().
20246
20247 2004-08-18  Jambunathan K  <kjambunathan@novell.com>
20248         * tabledefs.h: Corretced PARAM_ATTRIBUTE_OPTIONAL to the right
20249         value 0x0010.
20250
20251 2004-08-18 Ben Maurer  <bmaurer@users.sourceforge.net>
20252
20253         * appdomain.c: use the Tls function for appdomain too,
20254         at Zoltan's request. Actually return in mono_context_get
20255
20256         * appdomain.c, profiler.c, threads.c: use __thread
20257
20258 2004-08-18  Zoltan Varga  <vargaz@freemail.hu>
20259
20260         * appdomain.c threads.c: Call GC_CreateThread on windows.
20261
20262         * Makefile.am (libmetadata_la_LIBADD): Avoid linking libmonoos into
20263         multiple libraries since this don't work on windows.
20264
20265 2004-08-18  Martin Baulig  <martin@ximian.com>
20266
20267         * class-internals.h
20268         (MonoMethodNormal): Moved `MonoGenericParam *gen_params' here from
20269         MonoMethodHeader.
20270
20271         * metadata.h (MonoMethodHeader): Moved the `gen_params' field to
20272         MonoMethodNormal since we also need it for abstract and interface
20273         methods.
20274
20275         * reflection.c
20276         (build_compressed_metadata): Sort the GenericParam table.
20277         (mono_image_create_token): Added `gboolean create_methodspec'
20278         argument; this is false when generating a MethodImpl token.
20279         (reflection_methodbuilder_to_mono_method): Abstract and interface
20280         methods may also have generic parameters.
20281
20282 2004-08-17 Ben Maurer  <bmaurer@users.sourceforge.net>
20283
20284         * appdomain.c: thread local alloc
20285
20286 2004-08-17  Martin Baulig  <martin@ximian.com>
20287
20288         * appdomain.c: Bumped MONO_CORLIB_VERSION to 24.
20289
20290         * icall.c
20291         (ves_icall_System_MonoType_getFullName): Added `gboolean full_name'
20292         argument.
20293
20294         * class.c (mono_type_get_full_name): New public function.
20295         (mono_type_get_name): Don't include the type arguments.
20296
20297 2004-08-16  Zoltan Varga  <vargaz@freemail.hu>
20298
20299         * Makefile.am: Build static versions of libmetadata and libmonoruntime
20300         for inclusion into the mono executable.
20301
20302 2004-08-16  Martin Baulig  <martin@ximian.com>
20303
20304         * metadata.c (do_mono_metadata_parse_generic_inst): Store the
20305         MonoGenericInst, not the MonoType in the `generic_inst_cache'.
20306
20307 2004-08-14  Martin Baulig  <martin@ximian.com>
20308
20309         * class.c (dup_type): Also copy the `byref' field.
20310
20311 2004-08-15  Zoltan Varga  <vargaz@freemail.hu>
20312
20313         * reflection.c (create_dynamic_mono_image): Revert the last change 
20314         since it breaks bootstrap.
20315
20316 2004-08-14  Zoltan Varga  <vargaz@freemail.hu>
20317
20318         * reflection.c (create_dynamic_mono_image): Set ref_count to 1.
20319
20320         * image.c (mono_image_close): Dynamic images are GC_MALLOCed, so do
20321         not free them with g_free.
20322
20323 2004-08-11  Martin Baulig  <martin@ximian.com>
20324
20325         * reflection.c (mono_reflection_setup_internal_class): Also call
20326         mono_class_setup_mono_type() if we already have a `tb->type.type'.
20327
20328 2004-08-09  Sebastien Pouliot  <sebastien@ximian.com>
20329
20330         * appdomain.c: Fix ves_icall_System_AppDomain_getDomainByID when 
20331         called during default (first) AppDomain creation. Keep track of
20332         Evidence when loading assemblies.
20333
20334 Mon Aug 9 14:41:45 CEST 2004 Paolo Molaro <lupus@ximian.com>
20335
20336         * opcodes.c, opcodes.h: reduce runtime relocations.
20337
20338 Mon Aug 9 13:30:53 CEST 2004 Paolo Molaro <lupus@ximian.com>
20339
20340         * culture-info.h, locales.c: fixes and chages to sue the new
20341         optimized format of the locale data.
20342         * culture-info-tables.h: regenerated.
20343
20344 2004-08-06  Geoff Norton <gnorton@customerdna.com>
20345         
20346         * filewatcher.c: If HAVE_KQUEUE return mode 3 to use the new kqueue watcher
20347
20348 2004-08-05  Sebastien Pouliot  <sebastien@ximian.com>
20349
20350         * appdomain.c: Bumped MONO_CORLIB_VERSION to 23. Added new icall
20351         ves_icall_System_AppDomain_getDomainByID to get an AppDomain by Id.
20352         * domain-internals.h: icall declaration.
20353         * icall.c: icall registration.
20354         * object-internals.h: New fields in MonoAssembly for CAS.
20355
20356 2004-08-05  Duncan Mak  <duncan@ximian.com>
20357
20358         * verify.c: Renamed CEE_STELEM to CEE_STELEM_ANY and CEE_LDELEM to
20359         CEE_LDELEM_ANY.
20360
20361 Thu Aug 5 17:11:44 CEST 2004 Paolo Molaro <lupus@ximian.com>
20362
20363         * reflection.c: fix to deal with object[] arrays in custom ctors
20364         (bug #62550).
20365
20366 2004-08-05  Martin Baulig  <martin@ximian.com>
20367
20368         * class.c (mono_class_array_element_size): Added support for
20369         generic instances and correctly handle "recursive" types.
20370
20371 2004-08-05  Zoltan Varga  <vargaz@freemail.hu>
20372
20373         * assembly.c: Fix warnings.
20374
20375 2004-08-04  Martin Baulig  <martin@ximian.com>
20376
20377         * class.c
20378         (mono_type_get_name_recurse): Added `gboolean include_arity'
20379         argument specifying whether or not we should include the generic
20380         arity in the type name.
20381         (_mono_type_get_name): New static function.
20382         (mono_class_setup_vtable): If we're a generic instance, don't
20383         include the generic arity in the names of explicit method
20384         implementations.        
20385
20386 2004-08-03  Martin Baulig  <martin@ximian.com>
20387
20388         * class.c (mono_type_get_name_recurse): Enclose the generic type
20389         arguments in `<', '>'.
20390
20391 Tue Aug 3 17:54:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
20392
20393         * gc.c: make GC warning messages use the trace API, they are just
20394         noise to most of the users.
20395
20396 2004-08-03  Martin Baulig  <martin@ximian.com>
20397
20398         * debug-mono-symfile.c (read_string): Correctly read the string.
20399
20400 2004-07-30  Zoltan Varga  <vargaz@freemail.hu>
20401
20402         * marshal.c (signature_dup_add_this): Fix bug in previous patch.
20403         
20404         * marshal.c (mono_marshal_get_icall_wrapper): Add support for vararg
20405         icalls.
20406         (mono_marshal_get_runtime_invoke): Correctly handle valuetype methods.
20407
20408 2004-07-30  Martin Baulig  <martin@ximian.com>
20409
20410         * debug-mono-symfile.c, mono-debug.c, mono-debug-debugger.c:
20411         Reflect latest symbol writer changes.   
20412
20413 Fri Jul 30 16:49:05 CEST 2004 Paolo Molaro <lupus@ximian.com>
20414
20415         * object.c: always create an object if null is passed
20416         to Invoke() where a valuetype is expected.
20417
20418 2004-07-29  Bernie Solomon  <bernard@ugsolutions.com>
20419
20420         * marshal.c (mono_marshal_init): make managed
20421         signatures match native ones better for 64bits.
20422
20423 2004-07-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20424
20425         * appdomain.c: hack to build correctly the private bin path on windows.
20426         Fixes bug #61991.
20427
20428 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
20429
20430         * assembly.c: Load mscorlib from the correct framework directory
20431           (mono/<version>/mscorlib.dll).
20432         * appdomain.h: Added prototypes for new functions.
20433         * internals.h: Added some prototypes.
20434         * domain.c: When initializing the runtime, get from the executable and
20435           the configuration files the runtime version that the app supports.
20436           Added support methods for reading app.exe.config. Added list of versions
20437           supported by the JIT. Added two new methods: mono_init_from_assembly,
20438           which initializes the runtime and determines the required version from
20439           the provided exe file, and mono_init_version, which initializes
20440           the runtime using the provided version.
20441         * icall.c: Get machine.config from version-specific directory.
20442         * reflection.c: When generating an image, embed the version number
20443           of the current runtime.
20444
20445 2004-07-28  Dick Porter  <dick@ximian.com>
20446
20447         * socket-io.c
20448         (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal): Check
20449         returned sockaddr size before creating the remote address object.
20450         Patch by Nick Vaughan (dev@6wardlaw.freeserve.co.uk), fixes bug
20451         61608.
20452
20453 2004-07-28  Dick Porter  <dick@ximian.com>
20454
20455         * locales.c (string_invariant_compare_char): Fix invariant char
20456         compares between upper and lower cases.  Fixes bug 61458.
20457
20458 2004-07-27  Ben Maurer  <bmaurer@ximain.com>
20459         
20460         * marshal.c: actually cache stelem.ref wrappers.
20461         
20462 Tue Jul 27 16:56:55 CEST 2004 Paolo Molaro <lupus@ximian.com>
20463
20464         * class.c, image.c, loader.c, cil-coff.h: lazily mmap the image 
20465         sections and remove the mono_cli_rva_map () function.
20466
20467 Tue Jul 27 15:58:19 CEST 2004 Paolo Molaro <lupus@ximian.com>
20468
20469         * debug-mono-symfile.c: fix one more endianess issue, from a patch
20470         by Geoff Norton (<gnorton@customerdna.com>).
20471
20472 Tue Jul 27 15:47:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
20473
20474         * class.c: fix class loads for pointer types (typeof(int) !=
20475         typeof(int*)).
20476
20477 2004-07-27  Martin Baulig  <martin@ximian.com>
20478
20479         * debug-mono-symfile.c (mono_debug_open_mono_symbol_file): Support
20480         reading the debugging information from an external ".mdb" file.
20481
20482 2004-07-24  Martin Baulig  <martin@ximian.com>
20483
20484         * reflection.c (mono_image_get_type_info): Only write a class
20485         layout entry if we actually have a size or a packing size.
20486
20487 2004-07-21  Bernie Solomon  <bernard@ugsolutions.com>
20488
20489         * reflection.c (type_get_fully_qualified_name): 
20490         insert cast to get type checking of ?: with non-gcc compilers
20491
20492 2004-07-21  Bernie Solomon  <bernard@ugsolutions.com>
20493
20494         * rand.c: use g_getenv for both lookups of
20495         MONO_EGD_SOCKET
20496
20497 2004-07-17  Martin Baulig  <martin@ximian.com>
20498
20499         * reflection.c (mono_reflection_bind_generic_method_parameters):
20500         Set `gmethod->reflection_info'.
20501
20502 2004-07-17  Martin Baulig  <martin@ximian.com>
20503
20504         * class.c (mono_class_create_from_typedef): Insert the newly
20505         created class into the hash table before computing the interfaces
20506         since we could be called recursively.
20507
20508 2004-07-16  Ben Maurer  <bmaurer@ximain.com>
20509
20510         * marshal.[ch] (mono_marshal_get_stelemref): a new wrapper
20511         function to implement stelem.ref in managed code
20512         * class-internals.h, debug-helpers.c: a new wrapper type
20513         for the above.
20514
20515 Wed Jul 14 19:26:05 CEST 2004 Paolo Molaro <lupus@ximian.com>
20516
20517         * gc.c: allow GC handles to work even when no GC is compiled in.
20518         Fix part of bug #61134 (GetAddrOfPinnedObject).
20519
20520 2004-07-13  Peter Williams  <peter@newton.cx>
20521  
20522         * process.c (complete_path): Make sure we don't attempt to execute
20523         directories.
20524  
20525 2004-07-12  Geoff Norton <gnorton@customerdna.com>
20526
20527         * DateTime.cs: Patch for bug #61112.  Our DateTime wasn't roundtripping over timezone
20528           boundaries properly.  This patch checkes ToLocalTime() to see if we're tripping over a boundary
20529           and will add/subtract the hour if needed
20530
20531 2004-07-12  Martin Baulig  <martin@ximian.com>
20532
20533         * reflection.c (mono_field_get_object): If we have
20534         `field->generic_info', take the attributes from
20535         `field->generic_info->generic_type'.    
20536
20537 2004-07-12  Martin Baulig  <martin@ximian.com>
20538
20539         * mono-debug.c (mono_debug_init): Don't take a `MonoDomain *'.
20540         This function must be called before initializing the runtime.
20541         (mono_debug_init_1): New function; call this after initializing
20542         the runtime, but before loading the assembly.  It tells the
20543         debugger to load corlib and the builtin types.
20544
20545         * mono-debug-debugger.c: Did some larger changes in the debugging
20546         code; support recursive class declarations, make sure we actually
20547         add all classes.
20548
20549 2004-07-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20550
20551         * debug-helpers.c: undo my previous patch and fixed the real issue in
20552         ../mini/exceptions-x86.c
20553
20554 2004-07-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20555
20556         * debug-helpers.c: prevent SIGSEGV. It happened running xsp on monodoc
20557         when no HOME env. variable was set and a NullRef was thrown in a .cctor
20558         called from other .cctors.
20559
20560 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
20561
20562         * loader.c: Removed the mono_loader_wine_init hack now that we are
20563         doing a managed version of Windows.Forms.
20564
20565 2004-07-09  Ben Maurer  <bmaurer@ximian.com>
20566
20567         * domain.c, gc.c, marshal.c, mono-debug-debugger.c,
20568         threadpool.c, threads.c: remove static data from rootset.
20569
20570 2004-07-09  Dick Porter  <dick@ximian.com>
20571
20572         * locales.c (ves_icall_System_String_InternalReplace_Str_Comp):
20573         Don't do any more processing if the matched length was 0.  It was
20574         increasing the size of the string before.  Fixes bug 61167.
20575
20576 2004-07-09  Dick Porter  <dick@ximian.com>
20577
20578         * socket-io.h:
20579         * socket-io.c
20580         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
20581         Add support for SO_PEERCRED if its available.
20582
20583 2004-07-09  Peter Bartok <pbartok@novell.com>
20584         * loader.c: winelib.exe.so error message is now only displayed if
20585         MONO_DEBUG is set. To help us avoid questions when people are trying
20586         out the new Managed.Windows.Forms.
20587
20588 2004-07-08  Zoltan Varga  <vargaz@freemail.hu>
20589
20590         * class-internals.h debug-helpers.c marshal.c: Add new wrapper types 
20591         for isinst and castclass wrappers.
20592
20593         * class-internals.h icall.c: Move registration and lookup of JIT icalls
20594         to libmetadata from the JIT, so they could be used by the marshalling
20595         code and the interpreter.
20596
20597         * marshal.c: Register marshalling related JIT icalls here instead of
20598         in mini.c. Use CEE_MONO_ICALL instead of the family of 
20599         CEE_MONO_PROC<x> opcodes to call marshalling functions.
20600
20601         * metadata.h: Remove unneeded marshalling conversions.
20602
20603         * opcodes.c: Update for new opcodes.
20604         
20605 2004-07-08  Martin Baulig  <martin@ximian.com>
20606
20607         * mono-debug.c: Check for `handle->symfile' being non-NULL everywhere.
20608         (mono_debug_get_domain_data): Make this function static.
20609
20610 Wed Jul 7 12:32:29 CEST 2004 Paolo Molaro <lupus@ximian.com>
20611
20612         * gc.c, object.h: add nice GC handle API for embedders.
20613
20614 2004-07-06  Ben Maurer  <bmaurer@ximian.com>
20615
20616         * reflection.c: more changes for the new api
20617
20618         * object.c: When we reflect on a field w/ a constant value, it
20619         will not have a memory location, so we must access metadata. Also,
20620         allow easier reading of strings so that we can read them from
20621         the constant data.
20622
20623         * class.c (mono_class_layout_fields): no need for literal fields here.
20624
20625         * class-internals.h: api changes for const fields
20626
20627         * icall.c (ves_icall_get_enum_info): use new apis for const fields
20628
20629 2004-07-06  Martin Baulig  <martin@ximian.com>
20630
20631         * mono-debug.h: Increment version number to 44.
20632
20633         * mono-debug.c (mono_debug_add_wrapper): The second argument is
20634         now a gpointer, rewrote this whole method.
20635
20636         * mono-debug-debugger.c (mono_debugger_add_wrapper): New
20637         function.  Add information about the wrapper in a new "misc table".
20638
20639         * mono-debug-debugger.h (MonoDebuggerSymbolTable): Added fields
20640         for the new misc table.
20641
20642 2004-07-05  Zoltan Varga  <vargaz@freemail.hu>
20643
20644         * metadata-internals.h image.c: Add a cache for helper signatures.
20645
20646         * monosn.c: Applied patch from "grompf" (grompf@sublimeintervention.com). Fix compilation under OSX.
20647
20648 2004-07-03  Zoltan Varga  <vargaz@freemail.hu>
20649
20650         * marshal.c (mono_marshal_get_managed_wrapper): Handle returning
20651         delegates from a delegate. Fixes #61033.
20652         
20653         * marshal.c: Fix managed->native stringbuilder marshalling. Implement
20654         marshalling of stringbuilder arrays. Fixes #59900.
20655
20656 2004-07-02  Zoltan Varga  <vargaz@freemail.hu>
20657
20658         * icall.c: Add EnumBuilder:setup_enum_type icall.
20659
20660 2004-06-30  Ben Maurer  <bmaurer@ximian.com>
20661
20662         * icall.c: Added a new icall for the property version of
20663         OffsetOfStringData.
20664
20665 2004-06-30  Zoltan Varga  <vargaz@freemail.hu>
20666
20667         * class-internals.h (MonoVTable): Make max_interface_id a guint32 so
20668         it has a constant size across platforms.
20669
20670         * marshal.c (mono_delegate_end_invoke): Avoid crash when there is no
20671         stack trace.
20672
20673 2004-06-29  Martin Baulig  <martin@ximian.com>
20674
20675         * mono-debug.c (mono_debug_add_method): Protect the whole function
20676         in mono_debugger_lock(), not just parts of it.
20677
20678 Fri Jun 25 21:36:26 CEST 2004 Paolo Molaro <lupus@ximian.com>
20679
20680         * reflection.c: make sure padding bytes in heaps are zeroed.
20681
20682 2004-06-24  David Waite  <mass@akuma.org>
20683
20684         * appdomain.c, class.c, domain.c, file-io.c, gc.c, icall.c,
20685         image.c, loader.c, locales.c, marshal.c, metadata.c,
20686         mono-debug.[ch], object.c, reflection.c, security.c, socket-io.c,
20687         string-icalls.c, threads.c: change to C90-style comments from C99 /
20688         C++ -style
20689
20690 2004-06-24  Dick Porter  <dick@ximian.com>
20691
20692         * threads.c
20693         (ves_icall_System_Threading_Mutex_CreateMutex_internal): Correctly
20694         return createdNew.  Fixes bug 60412.
20695
20696         * threads-types.h: 
20697         * icall.c: Add createdNew parameter to CreateMutex icall
20698
20699 Thu Jun 24 16:06:41 CEST 2004 Paolo Molaro <lupus@ximian.com>
20700
20701         * reflection.c, object-internals.h: save default value in params.
20702
20703 2004-06-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20704
20705         * appdomain.c: for paths in PrivateBinPath that are absolute, there's
20706         no need to build a new path combining that with the application base.
20707         Fixes bug #60442.
20708
20709 Wed Jun 23 18:36:58 CEST 2004 Paolo Molaro <lupus@ximian.com>
20710
20711         * reflection.c: fixed minor standard compliance issues.
20712
20713 Wed Jun 23 17:59:29 CEST 2004 Paolo Molaro <lupus@ximian.com>
20714
20715         * reflection.c: fixed issue with encoding some custom attributes
20716         (arrays in properties and fields, bug #60411).
20717
20718 2004-06-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20719
20720         * reflection.c: fix start address when copying the public key token.
20721
20722 2004-06-23  Martin Baulig  <martin@ximian.com>
20723
20724         * mono-debug-debugger.c (mono_debugger_unhandled_exception): Store
20725         the `exc' object in a static object to put it into the GC's root set.
20726
20727 Wed Jun 23 15:37:31 CEST 2004 Paolo Molaro <lupus@ximian.com>
20728
20729         * reflection.c: make mono_reflection_setup_internal_class ()
20730         callable a second time to setup a new parent class.
20731
20732 2004-06-23  Dick Porter  <dick@ximian.com>
20733
20734         * threads.c: Check for WAIT_IO_COMPLETION return values.
20735
20736 2004-06-22  Sebastien Pouliot  <sebastien@ximian.com>
20737
20738         * appdomain.c: Removed the g_free on the public key token. Now copy 
20739         the pk token string into the MonoAssemblyName buffer using g_strlcpy.
20740         * assembly.c: Added public key token string value when loading 
20741         assemblies. Fix bug #60439.
20742         * icall.c: Added missing informations (like public key) in 
20743         GetReferencedAssemblies. Fix #60519.
20744         * image.h: Changed definition for public key token from const char*
20745         public_tok_value to guchar public_key_token [17];
20746         * reflection.c: Updated for changes to public key token.
20747
20748 2004-06-22  Lluis Sanchez Gual
20749
20750         * icall.c: In ves_icall_InternalExecute, when setting a filed, also look 
20751         for the field in base classes.
20752
20753 Tue Jun 22 16:48:02 CEST 2004 Paolo Molaro <lupus@ximian.com>
20754
20755         * mono-debug.h, mono-debug-debugger.h, debug-mono-symfile.h:
20756         mark headers as not supported, they are installed only for use by the
20757         debugger.
20758
20759 Tue Jun 22 16:32:03 CEST 2004 Paolo Molaro <lupus@ximian.com>
20760
20761         * *.c, *.h: avoid namespace pollution in public headers.
20762
20763 2004-06-21  Martin Baulig  <martin@ximian.com>
20764
20765         * exception.c (mono_get_exception_security): It's in
20766         "System.Security", not in "System".
20767
20768         * mono-debug-debugger.c (mono_debugger_add_builtin_types): Add all
20769         the exception classes.
20770
20771 2004-06-21  Martin Baulig  <martin@ximian.com>
20772
20773         * mono-debug-debugger.c (mono_debugger_unhandled_exception):
20774         Protect the exception object from being finalized.
20775
20776 2004-06-21  Martin Baulig  <martin@ximian.com>
20777
20778         * mono-debug-debugger.h (mono_debugger_unhandled_exception): New
20779         public function.
20780
20781 2004-06-21  Sebastien Pouliot  <sebastien@ximian.com>
20782
20783         * reflection.c: Load the assembly in mono_reflection_type_from_name,
20784         if it was not loaded before. Fix parts of #60439.
20785
20786 Mon Jun 21 16:04:43 CEST 2004 Paolo Molaro <lupus@ximian.com>
20787
20788         * marshal.c, icall.c, object.c, image.c: fix the runtime_invoke ()
20789         code that was broken since Ben's change: wrappers are now
20790         dependent on the method signature only again.
20791
20792 2004-06-21  Martin Baulig  <martin@ximian.com>
20793
20794         * mono-debug-debugger.c (write_class): Cleaned this up a bit and
20795         added interface support.
20796
20797 2004-06-21  Martin Baulig  <martin@ximian.com>
20798
20799         * class.c (mono_vtable_get_static_field_data): New public method.
20800
20801 2004-06-20  Atsushi Enomoto  <atsushi@ximian.com>
20802
20803         * filewatcher.c : Windows build fix to be compliant with API changes.
20804
20805 Sat Jun 19 19:04:50 CEST 2004 Paolo Molaro <lupus@ximian.com>
20806
20807         * class.h, class.c: more accessors.
20808         * metadata.h, metadata.c: prepare for hiding MonoType and
20809         MonoMethodSignature: people should use the accessors from now on
20810         outside of the tree.
20811
20812 Sat Jun 19 17:56:50 CEST 2004 Paolo Molaro <lupus@ximian.com>
20813
20814         * *.c, *.h: more API cleanups.
20815
20816 2004-06-18  Jackson Harper  <jackson@ximian.com>
20817
20818         * assembly.c: Trace loading assemblies.
20819         * loader.c: Trace loading native libraries.
20820         * mono-config.c: Trace loading config files.
20821         
20822 2004-06-18  Dick Porter  <dick@ximian.com>
20823
20824         * locales.c: Tell ICU the lengths of strings, it can cope with
20825         embedded \0 then.  Fixes bug 59274, and doesn't break bug 55822.
20826
20827 Fri Jun 18 11:59:57 CEST 2004 Paolo Molaro <lupus@ximian.com>
20828
20829         * image.c: swapped name/filename;
20830
20831 2004-06-18  Martin Baulig  <martin@ximian.com>
20832
20833         * mono-debug-debugger.c (write_class): Write the parent class at
20834         the end of the header.
20835
20836 Thu Jun 17 16:50:44 CEST 2004 Paolo Molaro <lupus@ximian.com>
20837
20838         * *.c, *.h, Makefile.am: more API cleanups and bugfixes.
20839
20840 2004-06-17  Raja R Harinath  <rharinath@novell.com>
20841
20842         * Makefile.am (PLATFORM_LIB): New.  Possibly refer to ../os/libmonoos.la.
20843         (bundle_obj): New conditional define.
20844         (BUILT_SOURCES): Remove.
20845         ($(bundle_srcs)): Make parallel-make safe.
20846         (libmonoruntime_la_LIBADD): Make unconditional.
20847         (libmetadata_la_LIBADD): Make unconditional.  Refer to $(bundle_obj).
20848         (libmetadata_la_SOURCES): Don't refer to $(bundle_srcs).
20849
20850 2004-06-17  Atsushi Enomoto  <atsushi@ximian.com>
20851
20852         * culture-info-tables.h: It was inconsistent with the latest
20853           supp info files.
20854
20855 2004-06-17  Zoltan Varga  <vargaz@freemail.hu>
20856
20857         * assembly.c (mono_assembly_open): Fix crash when the assembly can't
20858         be loaded.
20859
20860         * threads.c (ves_icall_System_Threading_Thread_Resume): Fix compilation
20861         with gcc 2.95.
20862
20863 Wed Jun 16 18:23:45 CEST 2004 Paolo Molaro <lupus@ximian.com>
20864
20865         * threads.h, icall.c, object.c, threadpool.c, threads-types.h:
20866         cleaned up public header threads.h.
20867
20868 Wed Jun 16 18:11:41 CEST 2004 Paolo Molaro <lupus@ximian.com>
20869
20870         * Makefile.am, *.c, *.h: more API cleanups.
20871
20872 Wed Jun 16 14:33:22 CEST 2004 Paolo Molaro <lupus@ximian.com>
20873
20874         * Makefile.am: removed monosn from compilation.
20875         * appdomain.c, assembly.c, assembly.h, blob.h, class.c,
20876         debug-helpers.c, debug-mono-symfile.c, domain.c, icall.c,
20877         image.c, image.h, loader.c, marshal.c, metadata-internals.h,
20878         metadata.c, metadata.h, mono-config.c, mono-debug-debugger.c,
20879         mono-debug.c, object.c, opcodes.c, opcodes.h, pedump.c, process.c,
20880         reflection.c, reflection.h, verify.c: more API cleanups and fixes.
20881
20882 2004-06-15  Jackson Harper  <jackson@ximian.com>
20883
20884         * assembly.c: Make locales lower case when searching the GAC for
20885         assemblies. gacutil will always make locales lowercase when
20886         installing so this effectively makes them case insensitive.
20887         
20888 2004-06-15  Lluis Sanchez Gual  <lluis@ximian.com>
20889
20890         * locales.c, threadpool.c: use mono_monitor_enter instead of mono_monitor_try_enter.
20891         * monitor.c: New method mono_monitor_try_enter_internal, which takes a new
20892           parameter which allows to choose whether the wait can be interrupted or 
20893           not. Also added the method mono_monitor_enter(), which locks the monitor
20894           using an infinite wait and without allowing interruption.
20895           In the Monitor.Enter and Wait icalls, retry the lock if the wait is
20896           interrupted.
20897         * object.h: Added new fields in MonoThread. suspend_event holds the event
20898           used to susped/resume the thread. synch_lock is the lock object to use for
20899           modifying the thread state.
20900         * threads.c: Use the new synch_lock object for locking, instead of "this",
20901           which can generate deadlocks.
20902           Moved thread state change in Thread.Sleep and Thread.Join from managed
20903           to unmanaged code. This avoids a deadlock when the thread was suspended
20904           just after acquiring the thread lock.
20905           In general, use mono_monitor_enter instead of mono_monitor_try_enter.
20906           Implemented Thread.Suspend using an event instead of ThreadSuspend,
20907           which is not fully implemented in the io-layer.
20908         * socket-io.c: Only try IPv6 DNS lookup if IPv4 fails.
20909
20910 Tue Jun 15 18:34:21 CEST 2004 Paolo Molaro <lupus@ximian.com>
20911
20912         * Makefile.am, monitor.h, object.h, threadpool.c, threadpool.h,
20913         threads-types.h: more API cleanups.
20914
20915 Tue Jun 15 16:40:19 CEST 2004 Paolo Molaro <lupus@ximian.com>
20916
20917         * domain-internals.h, Makefile.am, appdomain.c, appdomain.h,
20918         domain.c, gc.c, icall.c, mono-debug.c, object.c, reflection.c,
20919         threadpool.c, threads.c: first pass at the exported API cleanup.
20920
20921 Tue Jun 15 15:29:47 CEST 2004 Paolo Molaro <lupus@ximian.com>
20922
20923         * icall.c: fix signatures of some VolatileRead and VolatileWrite icalls.
20924
20925 2004-06-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20926
20927         * icall.c: added internalGetHome.
20928
20929 2004-06-14  Dick Porter  <dick@ximian.com>
20930
20931         * file-io.c (ves_icall_System_IO_MonoIO_FindFirstFile): It was
20932         possible to return successfully when '.' or '..' were the only
20933         entries in a directory, but were skipped.  The MonoIOStat was not
20934         filled in in that case.  Now return ERROR_NO_MORE_FILES instead.
20935         Fixes bug 59574.
20936
20937 Mon Jun 14 00:27:15 CEST 2004 Paolo Molaro <lupus@ximian.com>
20938
20939         * reflection.c: make binaries run on .Net 1.1 by default.
20940
20941 Sun Jun 13 18:22:40 CEST 2004 Paolo Molaro <lupus@ximian.com>
20942
20943         * threadpool.c, threadpool.h: use the correct return type in SetMinThreads ().
20944
20945 Sun Jun 13 16:44:39 CEST 2004 Paolo Molaro <lupus@ximian.com>
20946
20947         * marshal.c: keep track of struct size with explicit layout
20948         (bug #59979).
20949
20950 2004-06-12  Martin Baulig  <martin@ximian.com>
20951
20952         * mono-debug-debugger.c: Comment out a debugging g_message().
20953
20954 Sat Jun 12 14:15:02 CEST 2004 Paolo Molaro <lupus@ximian.com>
20955
20956         * reflection.c, reflection.h: do not free custom attrs that are cached.
20957         * icall.c: use braces to make code clearer.
20958
20959 2004-06-11  Martin Baulig  <martin@ximian.com>
20960
20961         * class.h (MonoInflatedField): New type.
20962         (MonoClassField): Replaced `MonoType *generic_type' with
20963         `MonoInflatedField *generic_info'.
20964
20965         * icall.c
20966         (ves_icall_MonoField_Mono_GetGenericFieldDefinition): New icall.
20967
20968 2004-06-11  Martin Baulig  <martin@ximian.com>
20969
20970         * reflection.c (mono_image_create_method_token): Correctly encode
20971         varargs methods.
20972
20973 2004-06-11  Martin Baulig  <martin@ximian.com>
20974
20975         * metadata.c (mono_metadata_parse_method_signature): When parsing
20976         a MethodDef which has VarArgs, also set sentinelpos if we don't
20977         have any parameters.
20978
20979 2004-06-11  Martin Baulig  <martin@ximian.com>
20980
20981         * verify.c (mono_method_verify): In CEE_CALL, use
20982         mono_method_get_signature() to get the method's signature, unless
20983         we're a PInvoke method.
20984
20985 2004-06-10  Jackson Harper  <jackson@ximian.com>
20986
20987         * assembly.c: Use <path>/lib/mono/gac for the extra paths
20988         lookup. Rename MONO_GAC_PATH to MONO_GAC_PREFIX, this is a more
20989         logical name as the supplied path is just a prefix to the gac not
20990         the direct path to it.
20991         
20992 Thu Jun 10 20:10:16 CEST 2004 Paolo Molaro <lupus@ximian.com>
20993
20994         * reflection.c: make the token for a created method match
20995         the token of the MethodBuilder it was created from
20996         (IKVM requires this behaviour now).
20997
20998 Thu Jun 10 16:02:27 CEST 2004 Paolo Molaro <lupus@ximian.com>
20999
21000         * image.c, image.h, appdomain.c, assembly.c, loader.c, metadata.c,
21001         reflection.c, socket-io.c: leak fixes.
21002
21003 Wed Jun 9 18:23:59 CEST 2004 Paolo Molaro <lupus@ximian.com>
21004
21005         * icall.c: handle sentinel pos in vararg methods in position different
21006         from 0.
21007
21008 2004-06-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21009
21010         * culture-info-tables.h: freshly generated.
21011
21012 2004-06-09  Martin Baulig  <martin@ximian.com>
21013
21014         * loader.c (mono_get_method_constrained): Call `mono_class_init
21015         (constrained_class)'.   
21016
21017 2004-06-08  Gert Driesen <drieseng@users.sourceforge.net>
21018
21019         * icall.c (ves_icall_MonoType_GetEvent): Handle events without
21020         any methods. Fixes #59629.
21021
21022 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
21023
21024         * culture-info-tables.h: reflecting locale-builder updates.
21025
21026 2004-06-08  Dick Porter  <dick@ximian.com>
21027
21028         * object.h:
21029         * locales.c: Fixed compile warnings, including a real bug in
21030         CompareInfo_internal_compare.
21031         
21032 2004-06-08  Dick Porter  <dick@ximian.com>
21033
21034         * locales.c
21035         (ves_icall_System_Globalization_CompareInfo_internal_index):
21036         (ves_icall_System_Globalization_CompareInfo_internal_index_char):
21037         Double-check the resuls of usearches, because ICU currently
21038         ignores most of the collator settings here.  Fixes bug 59720.
21039         
21040 2004-06-08  Dick Porter  <dick@ximian.com>
21041
21042         * locales.c
21043         (ves_icall_System_Globalization_CompareInfo_internal_index_char):
21044         Fix memory leak and segfault-causing typo.  No idea how this one
21045         lasted so long without being noticed.
21046
21047 2004-06-09  Zoltan Varga  <vargaz@freemail.hu>
21048
21049         * icall.c (ves_icall_Type_GetEvents_internal): Handle events without
21050         any methods. Fixes #59629.
21051
21052 2004-06-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21053
21054         * assembly.c:
21055         (mono_assembly_load): search_loaded -> mono_assembly_loaded (we didn't
21056         own the critical section before). Removed dead code (that's done
21057         in the preload hook).
21058
21059         (mono_assembly_load_with_partial_name): call the preload hook.
21060
21061 2004-06-08  Martin Baulig  <martin@ximian.com>
21062
21063         * metadata.c (mono_metadata_signature_alloc): Default
21064         `sentinelpos' to -1.
21065
21066         * reflection.c (mono_image_get_array_token): Likewise.
21067
21068 2004-06-08  Martin Baulig  <martin@ximian.com>
21069
21070         * icall.c (ves_icall_ModuleBuilder_getMethodToken): New icall.
21071
21072         * metadata.c (mono_metadata_parse_method_signature): When parsing
21073         a MethodDef which has VarArgs, set sentinelpos.
21074
21075         * metadata.h (MonoMethodSignature): Make `sentinalpos' a signed
21076         `gint16' since we're using -1 for non-varargs methods.
21077
21078         * reflection.c
21079         (ReflectionMethodBuilder): Added `MonoArray *opt_types'.
21080         (method_encode_signature): Added varargs support.
21081         (method_builder_encode_signature): Likewise.
21082         (mono_image_get_varargs_method_token): New static method.
21083         (mono_image_create_method_token): New public method; this is
21084         called via an icall instead of mono_image_create_token() when
21085         calling a varargs method.       
21086
21087 2004-06-08  Lluis Sanchez Gual  <lluis@ximian.com>
21088
21089         * locales.c: Fixed memory leak in Char.ToLower/ToUpper.
21090
21091 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
21092
21093         * culture-info-tables.h : Reflecting the latest locale-builder that
21094           fixed empty array representation ({} to {0}).
21095
21096 2004-06-07  Jackson Harper  <jackson@ximian.com>
21097
21098         * assembly.c: It should be <MONO_GAC_PATH>/lib/mono/gac when
21099         looking up extra gac paths. This allows MONO_GAC_PATH to act
21100         exactly like a prefix.
21101         
21102 2004-06-08  Zoltan Varga  <vargaz@freemail.hu>
21103
21104         * reflection.c (mono_reflection_type_from_name): Make a copy of the
21105         type name before modifying it. Fixes #59405.
21106
21107 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
21108
21109         * culture-info.h: added fields for "all datetime patterns".
21110         * locales.c: (  ves_icall_System_Globalization_CultureInfo
21111           _construct_datetime_format ()): fill xxx_patterns fields.
21112         * object.h: added fields for "all datetime patterns" to
21113           MonoDateTimeFormatInfo.
21114         * culture-info-tables.h: reflecting locale-builder updates.
21115
21116 2004-06-08  Zoltan Varga  <vargaz@freemail.hu>
21117
21118         * icall.c (ves_icall_Type_GetEvents_internal): Handle the case when
21119         the event has no add and remove methods. Fixes #59629.
21120
21121 2004-06-05  Sebastien Pouliot  <sebastien@ximian.com>
21122
21123         * object.c: Fixed possible integer overflow when allocating large
21124         strings.
21125
21126 2004-06-05  Atsushi Enomoto  <atsushi@ximian.com>
21127
21128         * culture-info-tables.h: reflecting locale-builder updates.
21129
21130 2004-06-05  Atsushi Enomoto  <atsushi@ximian.com>
21131
21132         * culture-info-tables.h: reflecting locale-builder updates.
21133
21134 2004-06-03  Atsushi Enomoto  <atsushi@ximian.com>
21135
21136         * culture-info-tables.h: reflecting locale-builder updates.
21137
21138 2004-06-03  Lluis Sanchez Gual  <lluis@ximian.com>
21139
21140         * threads.c: Made Thread.Sleep abortable.
21141
21142 2004-06-02  Martin Baulig  <martin@ximian.com>
21143
21144         * mono-debug.h (MONO_DEBUGGER_VERSION): Bumped version to 41.
21145
21146         * debug-mono-symfile.h: Bumped symbol file version number to 37.
21147
21148 2004-05-31  Zoltan Varga  <vargaz@freemail.hu>
21149
21150         * marshal.c (mono_marshal_get_runtime_invoke): Fix CR/LFs.
21151
21152 2004-05-30  Jackson Harper  <jackson@ximian.com>
21153
21154         * reflection.c: Do not hardcode assembly versions or public key
21155         tokens anymore. All of this except the corlib section was dead
21156         code anyways.
21157         
21158 2004-05-29  Zoltan Varga  <vargaz@freemail.hu>
21159
21160         * object.c (mono_runtime_invoke_array): Automatically create boxed
21161         objects for byref valuetypes if needed. Fixes #59300.
21162         
21163         * object.c (mono_method_return_message_restore): Handle 
21164         MONO_TYPE_OBJECT as well.
21165
21166 2004-05-28  Jackson Harper  <jackson@ximian.com>
21167
21168         * reflection.c: The modified type encoding was causing build
21169         problems. Reverted for now.
21170         
21171 2004-05-28  Jackson Harper  <jackson@ximian.com>
21172
21173         * reflection.c/h: Take an assembly ref so that we dont create
21174         fully qualified names when encoding types in the same assembly as
21175         the custom attribute being emitted.
21176         * appdomain.c: Increment version number.
21177         
21178 2004-05-26  Duncan Mak  <duncan@ximian.com>
21179
21180         * icall.c
21181         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
21182         Set the full version number (major, minor, build, revision).
21183
21184 2004-05-28  Vladimir Vukicevic  <vladimir@pobox.com>
21185
21186         * marshal.c (emit_struct_conv): increment src/dst after blit
21187         (mono_marshal_get_managed_wrapper,
21188         mono_marshal_get_native_wrapper): make sure we have marshalling
21189         info before marshalling params (info computation affects
21190         blittable)
21191
21192         * class.c (class_compute_field_layout): correctly deal with
21193         blittable
21194         (mono_class_layout_fields): Don't do gc_aware_layout for AUTO
21195         value types (as per what windows dows by default)
21196         (mono_class_setup_mono_type): System.ValueType is blittable
21197         (mono_ptr_class_get, mono_fnptr_class_get): Pointer classes are
21198         blittable
21199
21200         * marshal.c (mono_marshal_load_type_info): flag types  as
21201         non-blittable if the native layout doesn't match the managed
21202         layout
21203
21204 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21205
21206         * appdomain.c: don't add stuff in the private search path that is
21207         above the application base. If application base is not set, there's
21208         no private search path.
21209
21210 2004-05-28  Zoltan Varga  <vargaz@freemail.hu>
21211
21212         * marshal.c (mono_marshal_get_managed_wrapper): Add proper support for
21213         byref struct arguments in native->managed marshalling.
21214
21215 2004-05-28      Patrik Torstensson      <totte@hiddenpeaks.com>
21216
21217         * marshal.c (mono_marshal_get_runtime_invoke): correctly
21218         cache methods using signature (special case for methods
21219         that are value type or string class)
21220         
21221         * image.c (mono_image_close): clean up allocated GSList's
21222         in runtime_invoke_cache.
21223
21224 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21225
21226         * mono-config.c: set the correct path for mono_cfg_dir on windows when
21227         there's no MONO_CFG_DIR environment variable defined.
21228
21229 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21230
21231         * threads.c: windows version must be >= 0x0500 to include OpenThread.
21232
21233 2004-05-28  Lluis Sanchez Gual  <lluis@ximian.com>
21234
21235         * threadpool.c: Really wait for 500ms after the async call, even if the wait
21236           is interrumped.
21237         * threads.c: In mono_thread_manage, call OpenThread to ref each handle
21238           before waiting for it, and call CloseHandle after the wait to unref it.
21239           This will make sure that handles are not disposed too early.
21240
21241 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21242
21243         * appdomain.c:
21244         * appdomain.h:
21245         * icall.c: removed
21246         ves_icall_System_AppDomainSetup_InitAppDomainSetup as it's not
21247         needed now.
21248
21249         * object.c: se the application_base only for the domain that runs
21250         Main. Fixes bug #59216,
21251
21252 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21253
21254         * appdomain.c:
21255         * object.c: only the domain in which Main is run have
21256         SetupInformation.ConfigurationFile set, so moved a few lines from
21257         appdomain.c to object.c.
21258
21259 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21260
21261         * appdomain.c: we tried to load [name].(dll|exe), but according
21262         to bug #57710, we must also try [culture]/[name].(dll|exe) and
21263         [culture]/[name]/[name](dll|exe). This patch fixes the bug.
21264         There's a test case attached to bug #58922.
21265
21266 2004-05-27  Dick Porter  <dick@ximian.com>
21267
21268         * icall.c:
21269         * file-io.c: Implemented icalls for locking and unlocking regions
21270         in a file.
21271         (ves_icall_System_IO_MonoIO_FindNextFile): FindNextFile() returns
21272         FALSE on error (fixes both compiler warning and real bug.)
21273
21274 2004-05-27  Atsushi Enomoto  <atsushi@ximian.com>
21275
21276         * culture-info-tables.h: reflecting locale-builder updates.
21277
21278           (Added missing ChangeLog entry for 05/26)
21279
21280 2004-05-27  Jackson Harper  <jackson@ximian.com>
21281
21282         * locales.c: Fix some cut and paste errors.
21283         
21284 2004-05-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21285
21286         * mono-config.c: set the correct path for config. directory on windows.
21287
21288 2004-05-26  Atsushi Enomoto  <atsushi@ximian.com>
21289
21290         * icall.c : Fixed ves_icall_System_DateTime_GetNow() to return utc
21291           on win32.
21292
21293 2004-05-26  Zoltan Varga  <vargaz@freemail.hu>
21294
21295         * marshal.c (mono_marshal_get_native_wrapper): Free strings returned
21296         from pinvoke functions.
21297         
21298         * marshal.c (mono_ftnptr_to_delegate): Implement this.
21299
21300 2004-05-26  Atsushi Enomoto  <atsushi@ximian.com>
21301
21302         * culture-info-tables.h: reflecting locale-builder updates.
21303
21304 2004-05-26  Zoltan Varga  <vargaz@freemail.hu>
21305
21306         * profiler.c (simple_allocation): Skip icall wrapper methods. Fixes
21307         #59086.
21308
21309 2004-05-26  Sebastien Pouliot  <sebastien@ximian.com>
21310
21311         * appdomain.cs: Bumped MONO_CORLIB_VERSION to 20.
21312         * icall.c: Modified icalls for RNG.
21313         * rand.c|h: Changed RNG interface to allow thread-safe usage under 
21314         Windows (CryptoAPI).
21315
21316 2004-05-25  Zoltan Varga  <vargaz@freemail.hu>
21317
21318         * locales.c: Fix build.
21319
21320 2004-05-25  Atsushi Enomoto  <atsushi@ximian.com>
21321
21322         * culture-info-tables.h: reflecting locale-builder updates.
21323
21324 2004-05-25  Jackson Harper  <jackson@ximian.com>
21325
21326         * locales.c: When creating the current culture use the $LANGs
21327         specific culture. So DateTimeFormat and NumberFormat entries are created.
21328         
21329 2004-05-25  Zoltan Varga  <vargaz@freemail.hu>
21330
21331         * string-icalls.{h,c} icalls.c: Add new icalls for Strcpy which take
21332         a char array as parameter.
21333
21334 2004-05-24  Lluis Sanchez Gual  <lluis@ximian.com>
21335
21336         * image.c: In mono_image_open(), always use an absolute path name to
21337           look for already loaded images.
21338
21339 2004-05-24  Sebastien Pouliot  <sebastien@ximian.com>
21340
21341         * icall.c: Added define for CSIDL_FLAG_CREATE (0x8000) in case it is
21342         missing in the windows build (like older cygwin include files).
21343
21344 2004-05-23  Sebastien Pouliot  <sebastien@ximian.com>
21345
21346         * icall.c: Fixed check for possible integer overflow in Buffer_
21347         BlockCopy icall. Replaced comments style // by /* */.
21348
21349 2004-05-22  Zoltan Varga  <vargaz@freemail.hu>
21350
21351         * marshal.c (mono_ftnptr_to_delegate): Fix warning.
21352         
21353         * marshal.c (mono_marshal_get_proxy_cancast): Move thread interrupt
21354         check after MONO_VTADDR. Fixes pinvoke2.exe.
21355
21356         * marshal.h marshal.c metadata.h: Add beginnings of support for
21357         ftnptr -> delegate marshalling.
21358
21359 2004-05-21  Zoltan Varga  <vargaz@freemail.hu>
21360
21361         * threads.c (ves_icall_System_Threading_Thread_ResetAbort): Fix compilation on gcc-2.95.
21362         * threads.c: Fix warnings.
21363
21364 2004-05-20  Lluis Sanchez Gual  <lluis@ximian.com>
21365
21366         * appdomain.c, gc.c: Make use of the new WaitForSingleObjectEx.
21367         * icall.c: Registered icalls for Suspend and Resume.
21368         * locales.c: Beware, mono_monitor_try_enter can now be interrupted by
21369           Thread.Abort.
21370         * monitor.c: Use WaitForSingleObjectEx. Added some interruption checkpoints.
21371         * mono-debug-debugger.c: Use WaitForSingleObjectEx et al.
21372         * process.c: Use WaitForSingleObjectEx.
21373         * threadpool.c: Use WaitForSingleObjectEx. Added some interruption 
21374           checkpoints.
21375         * threads.c, threads.h: Make use of new Ex wait methods. Improved
21376           implementation of Thread.Abort and Thread.ResetAbort icalls. Added icalls
21377           for Suspend and Resume. Added new mono_thread_stop, used for stoping
21378           background threads. Added basic support for Abort in Windows.
21379           Start new threads using a managed delegate invoke wrapper. This wrapper
21380           has an interruption checkpoint that is needed since an interruption
21381           can be requested before the thread leaves the unmanaged code that starts 
21382           the thread.
21383         * marshal.c: Added interruption checkpoint after every native call, and
21384           also before managed calls for wrappers called from unmanaged code to
21385           go into managed code.
21386         * object.h: Added new field in MonoThread to keep track of interruption
21387           requests.
21388
21389 2004-05-20  Zoltan Varga  <vargaz@freemail.hu>
21390
21391         * marshal.c: Insert SAVE_LMF and RESTORE_LMF opcodes around native
21392         calls.
21393
21394 2004-05-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21395
21396         * appdomain.c:
21397         * assembly.c:
21398         * gc.c:
21399         * locales.c:
21400         * mono-config.c:
21401         * rand.c: getenv -> g_getenv (windows!)
21402
21403         * process.c: complete_path is also used on non-windows platforms.
21404
21405 2004-05-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21406
21407         * icall.c: new signature for Process_Start.
21408
21409         * process.[ch]: new signature for Process_Start. If we're on windows
21410         and UseShellExecute is false, we have to search for the program by
21411         ourselves if we don't get a full path.
21412
21413 2004-05-18  Zoltan Varga  <vargaz@freemail.hu>
21414
21415         * marshal.c (mono_marshal_get_native_wrapper): Fix up custom 
21416         marshalling and call CleanUpNativeData if needed. Fixes #58646.
21417
21418 2004-05-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21419
21420         * socket-io.c: field value changed for Int32 from 'value' to 'm_value'.
21421         Fixes bug #58373.
21422
21423 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21424
21425         * process.c: use double quotes to quote program name and arguments on
21426         windows. Fixes bug #58575.
21427
21428 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21429
21430         * file-io.c: don't return "." and ".." when using windows Find*File.
21431
21432 2003-05-17      Patrik Torstensson <totte@hiddenpeaks.com>
21433
21434         * marshal.c: Don't pass wrappers to message init because method 
21435         addressed used to lookup metadata. part of remoting[2|3] fix.
21436
21437 2004-05-15  Jackson Harper  <jackson@ximian.com>
21438
21439         * assembly.c: Remove user gac and implement MONO_GAC_PATH, this
21440         path is essentially the same as MONO_PATH except that it points to
21441         GACs instead of lib directories.
21442         * loader.h: The user gac is gone so we dont need function to
21443         enable/disable it.
21444         * mono-config.c: user gac option is now gone.
21445         
21446 2004-05-15  Jackson Harper  <jackson@ximian.com>
21447
21448         * culture-info.h: Make defines more consistent, add calendar data
21449         to the culture info table.
21450         * culture-info-tables.h: Add basic calendar data. Basically
21451         everyone gets default gregorian until all the data is
21452         updated.
21453         * locales.c: Use the new consistent defines. Set calendar data for
21454         culture info objects.
21455         * object.h: add a field for calendar data to CultureInfo
21456         
21457 2004-05-14 Ben Maurer  <bmaurer@users.sourceforge.net>
21458
21459         * image.c: image->runtime_invoke_cache is keyed on signatures now.
21460         * marshal.c (mono_mb_emit_calli): new helper to emit a CEE_CALLI with
21461         a signature.
21462         (mono_mb_emit_managed_call, mono_mb_emit_native_call): use the above.
21463         (mono_marshal_get_runtime_invoke): The runtime invoke method now takes
21464         an extra param that is the pointer of the method to invoke. The IL for
21465         the invoke method is no longer specific to the method, but to the
21466         signature of the method. Thus, we can share the same code for multiple
21467         methods. This reduces the number of methods that have to be compiled.
21468
21469 2004-05-14  Zoltan Varga  <vargaz@freemail.hu>
21470
21471         * icall.c (ves_icall_System_Reflection_Assembly_load_with_partial_name): Fix warning.
21472
21473         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
21474
21475         * icall.c: Optimize Buffer.BlockCopy.
21476
21477 2004-05-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21478
21479         * culture-info-tables.h: seems like Spanish and Portuguese cultures had
21480         DateTimeFormatInfo.YearMonthPattern like "MMMM' yyyy" (note the single
21481         quote). Changed them to "MMMM yyyy".
21482
21483 2004-05-12  Miguel de Icaza  <miguel@ximian.com>
21484
21485         * rand.c
21486         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_InternalGetBytes): Always close the file. 
21487
21488 2004-05-13  Zoltan Varga  <vargaz@freemail.hu>
21489
21490         * reflection.h: Updated after changes to managed structures.
21491
21492         * appdomain.c: Bump corlib version.
21493
21494 2004-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21495
21496         * Makefile.am: also add libmonoos to libmetadata. Fixes the build on
21497         windows.
21498
21499 2004-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21500
21501         * Makefile.am: link to ../os/libmonoos.la on windows.
21502
21503         * assembly.c:
21504                 -If MONO_DEBUG, warn about non-existing directories in
21505                 MONO_PATH.
21506                 -Added mono_assembly_getrootdir() that replaces MONO_ASSEMBLIES
21507                 compile time variable.
21508                 -Removed init_default_path and call mono_set_rootdir from
21509                 libmonoos.a instead (windows only).
21510
21511         * assembly.h: declare mono_assembly_getrootdir().
21512
21513         * domain.c:
21514         * icall.c: use mono_assembly_getrootdir() instead of MONO_ASSEMBLIES.
21515
21516         * loader.c: s/getenv/g_getenv/
21517
21518 2004-05-11  Zoltan Varga  <vargaz@freemail.hu>
21519
21520         * marshal.{h,c}: Add support for UnmanagedType.AsAny.
21521
21522         * marshal.c: Use mono_metadata_signature_{alloc,dup} where appropriate.
21523
21524         * metadata.h: Add new marshalling conversions.
21525
21526         * metadata.h metadata.c (mono_metadata_signature_dup): New helper
21527         function.
21528
21529         * reflection.c (mono_reflection_get_type): Lookup the type in all
21530         modules of a multi-module assembly. Fixes #58291.
21531
21532 2004-05-11  Lluis Sanchez Gual  <lluis@ximian.com>
21533
21534         * threads.c: Before aborting a background, set the StopRequested
21535         state.  This avoids throwing the Abort exception.
21536         In mono_thread_manage, don't continue with the shutdown until all
21537         aborted threads have actually stopped.
21538
21539 2004-05-10  Jackson Harper  <jackson@ximian.com>
21540
21541         * locales.c: Remove the modifier from culture names.
21542         
21543 2004-05-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21544
21545         * Makefile.am: monosn is not installed any more. It has been deprecated
21546         in favor of sn.
21547
21548 2004-05-07  Jackson Harper  <jackson@ximian.com>
21549
21550         * locales.c
21551         (ves_icall_System_Globalization_CultureInfo_internal_get_cultures):
21552         Fix array construction, add bailout if the length is 0.
21553
21554 2004-05-07  Dick Porter  <dick@ximian.com>
21555
21556         * socket-io.c (addrinfo_to_IPHostEntry): Don't crash if the
21557         machine doesn't have a DNS entry.  Patch by Urs Muff
21558         (umuff@quark.com), fixes bug 57928.
21559
21560 2004-05-06  Jackson Harper  <jackson@ximian.com>
21561
21562         * reflection.c: Handle null PublicTokens properly. alloc mem for
21563         assembly names culture so we dont crash when freeing it.
21564         
21565 2004-05-06  Jackson Harper  <jackson@ximian.com>
21566
21567         * assembly.c: Check the usergac when loading with partial names.
21568         
21569 2004-05-05  Sebastien Pouliot  <sebastien@ximian.com>
21570
21571         * rand.c|h: Added new icall for (optionally) seeding the PRNG. This 
21572         does nothing for now (not required for Linux/Windows) but the class
21573         library can call it (and a newer or modified runtime could need it).
21574         * icall.c: Registred icall.
21575
21576 2004-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21577
21578         * loader.c: prints a message on module loading error we set MONO_DEBUG
21579         environment variable.
21580
21581 2004-05-05  Jackson Harper  <jackson@ximian.com>
21582
21583         * appdomain.c: Handle PublicKeyToken=null properly.
21584         
21585 2004-05-05  Sebastien Pouliot  <sebastien@ximian.com>
21586
21587         * environment.c|h: Added icall ves_icall_System_Environment_
21588         GetOSVersionString to get the current OS version as a string.
21589         * icall.c: Registred icall.
21590
21591 2004-05-05  Lluis Sanchez Gual  <lluis@ximian.com>
21592
21593         * object.c: in mono_object_get_virtual_method(), take into account that
21594         non-virtual methods don't have a slot in the vtable. Check needed when
21595         the object is a proxy.
21596
21597 2004-05-05  Zoltan Varga  <vargaz@freemail.hu>
21598
21599         * marshal.h marshal.c icall.c: Applied patch from vladimir@pobox.com
21600         (Vladimir Vukicevic). Implement UnsafeAddrOfPinnedArrayElement.
21601
21602         * object.c (mono_class_compute_gc_descriptor): Fix warning.
21603
21604         * object.c (mono_runtime_invoke_array): Add an assert so null cannot be
21605         passed when a valuetype is expected.
21606
21607         * object.c (mono_unhandled_exception): Only set the exit code if the
21608         exception happens in the main thread. Fixes thread5.exe.
21609
21610         * appdomain.c (get_info_from_assembly_name): Fix infinite loop on
21611         invalid names. Fixes #58047.
21612
21613 2004-05-03  Jackson Harper  <jackson@ximian.com>
21614
21615         * assembly.c: This line was committed accidently and is unneeded.
21616         
21617 2004-05-03  Jackson Harper  <jackson@ximian.com>
21618
21619         * icall.c: Add new icall for Assembly::LoadWithPartialName
21620         * assembly.c/.h: new function that probes the GAC to load partial
21621         assembly names by Paolo Molaro.
21622         
21623 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21624
21625         * appdomain.c: use g_strncasecmp when looking for 'Culture=' et al.
21626         * reflection.c: use g_strncasecmp when looking for 'Culture=' et al.
21627         (type_get_fully_qualified_name): Added PublicKeyToken when building a
21628         full type name.
21629
21630 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21631
21632         * appdomain.c: fixed check for 'neutral' culture and removed warning.
21633         * reflection.c: fix bug when parsing a full type name and Version is not
21634         the last thing in the string.
21635
21636 2004-05-03  Zoltan Varga  <vargaz@freemail.hu>
21637
21638         * appdomain.c (get_info_from_assembly_name): Strdup "" to prevent
21639         crashes when it is freed.
21640
21641 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21642
21643         * assembly.c: print the compat warning to stderr.
21644
21645 2004-05-01  Miguel de Icaza  <miguel@ximian.com>
21646
21647         * assembly.c (mono_assembly_load_references): Add a compatibility
21648         hack to run old applications that might be still referencing the
21649         3300-based assemblies, only do this for System.xxx.
21650
21651 2004-05-01  Jackson Harper  <jackson@ximian.com>
21652
21653         * appdomain.c: If the culture is neutral we set it to "".
21654         
21655 2004-04-29  Jackson Harper  <jackson@ximian.com>
21656
21657         * locales.c: Add some missing MONO_ARCH_SAVE_REGS'.
21658
21659 2004-04-29  Andreas Nahr <ClassDevelopment@A-SoftTech.com>
21660  
21661         * string-icalls.c: added low overhead function for copying chars
21662         * icall.c: added needed icall for the above function
21663  
21664 2004-04-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21665
21666         * icall.c: fix return value of get_global_assembly_cache.  Implemented
21667         Environment.GetLogicalDrives.
21668
21669 2004-04-28  Bernie Solomon  <bernard@ugsolutions.com>
21670
21671         * rand.c: try and talk to egd or prngd
21672         for random bytes if opening devices fail.
21673
21674 2004-04-28  Zoltan Varga  <vargaz@freemail.hu>
21675
21676         * marshal.c (mono_marshal_load_type_info): Calculate the minimum
21677         alignment for the type using the native alignment of its members 
21678         instead of using klass->min_align.
21679
21680         * metadata.c (mono_type_stack_size): Fix size of TYPEDBYREF.
21681
21682 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21683
21684         * file-io.c:
21685         * socket-io.c: added check for sys/aio.h.
21686
21687 2004-04-28  Dick Porter  <dick@ximian.com>
21688
21689         * threads.c: Don't abort a thread thats already aborting, when
21690         terminating everything.
21691
21692 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21693
21694         * icall.c: added 2 new async calls for Socket.
21695
21696         * socket-io.[ch]: fixed some warnings. Added support for asynchronous
21697         IO on *nix systems.
21698
21699         * threadpool.c: removed unused variable.
21700
21701 2004-04-27  Zoltan Varga  <vargaz@freemail.hu>
21702
21703         * marshal.c: Handle null properly in PtrToString* icalls. Fixes #57706.
21704
21705 Tue Apr 27 15:55:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
21706
21707         * locales.c: put back string_invariant_tolower () and
21708         string_invariant_toupper ().
21709
21710 2004-04-26 David Waite <mass@akuma.org>
21711
21712         * file-io.h:
21713         * socket-io.h:
21714         * threads.h:
21715         * unicode.h: remove comma from end of enumeration declarations
21716
21717 2004-04-26 David Waite <mass@akuma.org>
21718
21719         * debug-mono-symfile.h:
21720         * decimal.c:
21721         * mono_debug.h:
21722         * sysmath.c: Define 64 bit constants as long long types (i.e. 10ULL)
21723
21724
21725 2004-04-26  Jackson Harper  <jackson@ximian.com>
21726
21727         * appdomain.c: Increment version number.
21728         
21729 2004-04-26  Jackson Harper  <jackson@ximian.com>
21730
21731         * appdomain.c: Set assembly references public token value when
21732         PublicKeyToken is specified, not the hash_value. Free public token
21733         values when free assembly name data. Previously the public key
21734         token was hex decoded, however we are using hex encoded public key
21735         tokens, so this is not neccasary.
21736         * assembly.c: Lookup assemblies in the gac if their public token
21737         value is set. Add function to allow enabling user gac
21738         lookups. Specify whether or not the assembly was loaded from the
21739         GAC. Compare full assembly names when checking the cache for
21740         assemblies (Temporarily disabled see comment in code). Remove
21741         mscorlib -> corlib mapping cruft. Add trace-loading. When a user
21742         specifies trace-loader they get extra info to stdout on the
21743         loading of assemblies.
21744         * image.h: Add a field for an assembly references public token
21745         value to MonoAssemblyname. Add a field to MonoAssembly to specifiy
21746         whether an assembly has been loaded from the GAC.
21747         * image.c: Remove a corlib -> mscorlib name mapping.
21748         * loader.h: Add function to enable/disable the user gac.
21749         * mono-config.c: Check if the usergac is enabled in the config
21750         file.
21751         * icall.c: New icall to determine whether or not an assembly has
21752         been loaded from the GAC. Remove some mscorlib -> corlib mappings.
21753         * tabldefs.h: Add constant for assemblyref flag that specifies a
21754         full public key is used instead of a public token.
21755         * reflection.c: Remove mscorlib -> corlib mappings. Set
21756         PublicTokenValue instead of hash value. This value is a hex
21757         string so it does not need to be expanded.
21758
21759 2004-04-26  Martin Baulig  <martin@ximian.com>
21760
21761         * mono-debug-debugger.c (mono_debugger_initialize): Set
21762         `mono_debugger_initialized' before calling mono_debug_lock().
21763
21764 2004-04-42  Robert Shade <rshade@dvsconsulting.com>
21765
21766         * icall.c: icalls for Char.ToUpper/ToLower are now hooked to
21767           InternalToUpper/InternalToLower.
21768         * locales.c: (ves_icall_System_{Char,String}_InternalTo{Upper,Lower}_Comp)
21769           removed invariant culture shortcut.  This is now done in managed code.
21770         * locales.c: (string_invariant_toupper/tolower) removed.
21771
21772 2004-04-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21773
21774         * icall.c: added GetSupportsAsync for Socket (same as MonoIO).
21775         Added Poll internal call.
21776
21777         * socket-io.[ch]: _wapi_socket == WSASocket. Added internal
21778         call for Poll. Select was too heavy for polling a single socket.
21779
21780         * threadpool.[ch]: added mono_threadpool_cleanup.
21781         * threads.c: use it. Don't use Thread_Abort on windows.
21782
21783 2004-04-23  Martin Baulig  <martin@ximian.com>
21784
21785         * mono-debug-debugger.c (mono_debugger_lookup_assembly): New function.
21786
21787 2004-04-23  Sebastien Pouliot  <sebastien@ximian.com>
21788
21789         * icall.c: Registred new icalls for key pair protection and added an
21790         icall for Environment.GetFolderPath on Windows.
21791         * security.c|h: Added new icalls for key pair protection.
21792
21793 2004-04-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21794
21795         * socket-io.c: don't display the non-supported family warning for known
21796         families. Now this is not displayed on windows when checking support
21797         for IPv4/IPv6.
21798
21799 2004-04-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21800
21801         * class.c: don't display the layout warning for static fields.
21802
21803 2004-04-21  Lluis Sanchez Gual <lluis@ximian.com>
21804
21805         * icall.cs: Registered new icalls for Char.ToLower and Char.ToUpper.
21806         * locales.c, locales.h: Added new icalls for culture-specific
21807         Char.ToLower and Char.ToUpper.
21808
21809 2004-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21810
21811         * threads.c: the 2nd argument when aborting a thread is NULL now. Patch
21812         by David Waite.
21813
21814 2004-04-20  Martin Baulig  <martin@ximian.com>
21815
21816         * mono-debug-debugger.c (mono_debugger_lookup_type): Make a copy
21817         of the type name before passing it to mono_reflection_type_from_name().
21818
21819 2004-04-19  Zoltan Varga  <vargaz@freemail.hu>
21820
21821         * marshal.c (mono_marshal_get_managed_wrapper): Handle different string
21822         encodings here. Fixes #56965.
21823
21824 2004-04-18  Bernie Solomon <bernard@ugsolutions.com>
21825
21826         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage):
21827         fix test on strstr result not that I can see anything that
21828         relies on the result.
21829
21830 2004-04-18  Zoltan Varga  <vargaz@freemail.hu>
21831
21832         * metadata.c (mono_type_to_unmanaged): Handle MONO_NATIVE_FUNC as well.
21833         Fixes #57081.
21834
21835         * marshal.c (mono_marshal_get_string_encoding): New helper function.
21836
21837         * marshal.c (mono_marshal_get_native_wrapper): Use the new helper
21838         function to determine which marshalling to use for strings. Fixes
21839         #56965.
21840
21841         * marshal.c (mono_marshal_string_array_to_unicode): Fix warning.
21842
21843         * reflection.c (encode_marshal_blob): Add support for LPARRAY.
21844
21845 2004-04-15  Bernie Solomon  <bernard@ugsolutions.com>
21846
21847         * icall.c: #include mono-config.h
21848
21849 2004-04-15  Jackson Harper  <jackson@ximian.com>
21850
21851         * culture-info-tables.h: Fix date formats for en-US culture.
21852         
21853 2004-04-15  Lluis Sanchez Gual  <lluis@ximian.com>
21854
21855         * icall.c: Registered icalls for ThreadPool.GetMinThreads and 
21856         ThreadPool.SetMinThreads.
21857         * threadpool.c: Implemented ThreadPool.GetMinThreads and
21858         ThreadPool.SetMinThreads.
21859
21860 Thu Apr 15 15:36:40 CEST 2004 Paolo Molaro <lupus@ximian.com>
21861
21862         * mono-config.c: also load the .config file in the directory
21863         where the assembly was found.
21864
21865 Thu Apr 15 14:24:49 CEST 2004 Paolo Molaro <lupus@ximian.com>
21866
21867         * assembly.c: load per-assembly config files.
21868         * icall.c: decrapified code to get the config dir and moved to
21869         mono-config.c.
21870         * image.h, loader.c, loader.h, mono-config.c, mono-config.h: allow
21871         per-assembly config files. When doing a dll map lookup give precedence
21872         to the per-assembly data.
21873
21874 2004-04-14  Martin Baulig  <martin@ximian.com>
21875
21876         * mono-debug-debugger.h (MonoDebuggerEvent): Removed
21877         MONO_DEBUGGER_EVENT_TYPE_ADDED and MONO_DEBUGGER_EVENT_METHOD_ADDED
21878         and added MONO_DEBUGGER_EVENT_RELOAD_SYMTABS.
21879
21880         * mono-debugger-debugger.c: While the debugger is locked, remember
21881         whether the symbol tables have changes and send one single
21882         MONO_DEBUGGER_EVENT_RELOAD_SYMTABS when releasing the lock.
21883
21884 2004-04-14  Zoltan Varga  <vargaz@freemail.hu>
21885
21886         * metadata.h: Add STRARRAY_STRWLPARRAY marshalling convention.
21887
21888         * marshal.h marshal.c (mono_marshal_string_array_to_unicode): New 
21889         function.
21890
21891         * marshal.c (mono_marshal_get_native_wrapper): Take CharSet into
21892         account when marshalling string arrays. Fixes #56965.
21893
21894 2004-04-13  Sebastien Pouliot  <sebastien@ximian.com>
21895
21896         * icall.c: Add new icalls mapping for security.
21897         * security.c|h: Add internal calls for WindowsIdentity,
21898         WindowsImpersonationContext and WindowsPrincipal.
21899
21900 2004-04-13  Gert Driesen (drieseng@users.sourceforge.net)
21901
21902         * class.c: Added comment to ensure the System.MonoDummy class
21903         is removed when no longer necessary
21904
21905 2004-04-13  Miguel de Icaza  <miguel@ximian.com>
21906
21907         * appdomain.c: Pass arguments to the bootstraping exceptions to
21908         minimize JITed methods at boot
21909
21910         * metadata.c (mono_exception_from_name_two_strings): Allow for the
21911         second string to be null.
21912
21913         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage):
21914         Change the protocol to minimize the JIT methods at startup.  Now
21915         it Returns the internal codepage, if the value of "int_code_page"
21916         is 1 at entry, and we can not compute a suitable code page
21917         number, returns the code page as a string.
21918
21919 2004-04-13  Jackson Harper  <jackson@ximian.com>
21920
21921         * culture-info-tables.h: Fix number of decimal digits for all
21922         english locales.
21923
21924 2004-04-13  Jackson Harper  <jackson@ximian.com>
21925
21926         * icall.c: Clairfy out of sync error message. It is not always
21927         your corlib that is out of sync.
21928
21929 2004-04-13  Zoltan Varga  <vargaz@freemail.hu>
21930
21931         * icall.c (ves_icall_Type_GetPropertiesByName): Avoid duplicate
21932         properties when only the set accessor is overriden. Fixes #55874.
21933
21934 2004-04-09  Zoltan Varga  <vargaz@freemail.hu>
21935
21936         * assembly.c (mono_assembly_load_references): Make this thread safe.
21937         Fixes #56327.
21938
21939 2004-04-08  Zoltan Varga  <vargaz@freemail.hu>
21940
21941         * monosn.c: Add missing initialization calls.
21942
21943 2004-04-08  Bernie Solomon  <bernard@ugsolutions.com>
21944
21945         * locales.c:
21946         ves_icall_System_Globalization_CultureInfo_construct_number_format
21947         Fix g_assert so it compiles on fussier compilers re int/ptr
21948         mismatch
21949
21950 2004-04-08  Dick Porter  <dick@ximian.com>
21951
21952         * socket-io.h:
21953         * socket-io.c: Don't set SO_REUSEADDR on windows.  Fixes bug
21954         53992.  Also rearrange the code so that the internal calls return
21955         an error value and exceptions are thrown from managed code.
21956
21957         * icall.c: Add type info to the socket icalls.
21958
21959 2004-04-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21960
21961         * object.h: synchronize MonoCompareInfo with CompareInfo class. Someone
21962         owes me a beer.
21963
21964 2004-04-07  Martin Baulig  <martin@ximian.com>
21965
21966         * class.c (mono_class_from_generic_parameter): Don't default
21967         `klass->parent' to `mono_defaults.object_type'.
21968
21969 2004-04-07  Martin Baulig  <martin@ximian.com>
21970
21971         * reflection.c (mono_reflection_initialize_generic_parameter): Set
21972         `param->pklass->reflection_info'.       
21973
21974 2004-04-07  Jackson Harper  <jackson@ximian.com>
21975
21976         * culture-info-tables.h: Fix date separator symbol.
21977         
21978 2004-04-07  Martin Baulig  <martin@ximian.com>
21979
21980         * icall.c (ves_icall_Type_GetGenericArguments): Moved this icall
21981         from System.Type to System.MonoType.
21982
21983 2004-04-07  Martin Baulig  <martin@ximian.com>
21984
21985         * reflection.h
21986         (MonoReflectionGenericParam): Added `has_reference_type' and
21987         `has_value_type' fields.
21988
21989         * reflection.c (mono_image_get_generic_param_info): Encode the
21990         correct flags if we have the `class' or `struct' constraint.
21991
21992 2004-04-07  Martin Baulig  <martin@ximian.com>
21993
21994         * reflection.h
21995         (MonoReflectionGenericParam): Added `MonoBoolean has_ctor_constraint'.
21996
21997 2004-04-07  Jackson Harper  <jackson@ximian.com>
21998
21999         * appdomain.c: Revert extra patches, just wanted to bump the
22000         version number.
22001         
22002 2004-04-07  Jackson Harper  <jackson@ximian.com>
22003
22004         * Makefile.am: Add culture-info private headers.
22005         * icall.c: Add new icalls for contructing locales.
22006         * locales.c: Construct CultureInfo objects from lookup tables instead of using ICU.
22007         * locales.h: Declare new culture info construction methods.
22008         * object.h: Add new fields used to avoid the CultureMap to
22009         MonoCultureInfo.
22010         * culture-info.h: Definition of structs used in the culture info
22011         tables.
22012         * culture-info-tables.h: Autogenerated tables that contain culture
22013         info data. This file was generated with the locale-builder tool.
22014         * appdomain.c: Incement corlib version number.
22015         
22016 2004-04-07  Bernie Solomon  <bernard@ugsolutions.com>
22017
22018         * appdomain.c: (mono_runtime_init) move mono_thread_init
22019         to before mono_object_new calls so critical sections
22020         are initialized before use.
22021
22022 2004-04-07  Martin Baulig  <martin@ximian.com>
22023
22024         * icall.c
22025         (ves_icall_TypeBuilder_define_generic_parameter): Removed.
22026         (ves_icall_MethodBuilder_define_generic_parameter): Removed.
22027         (ves_icall_MonoGenericParam_initialize): Removed.
22028         (monogenericparam_icalls): Removed.
22029         (generictypeparambuilder_icalls): Added new table for
22030         System.Reflection.Emit.GenericTypeParameterBuilder.
22031
22032         * reflection.c
22033         (mono_reflection_define_generic_parameter): Removed.
22034         (mono_reflection_initialize_generic_parameter): This is now called
22035         from GenericTypeParameterBuilder's .ctor.
22036
22037 2004-04-06  Martin Baulig  <martin@ximian.com>
22038
22039         * class.c (mono_class_init): Don't inflate nested classes in a
22040         generic instance.
22041         (mono_type_get_name_recurse): Include the generic arguments for
22042         generic instances and generic type declarations.
22043         (inflate_generic_type): Correctly inflate MONO_TYPE_SZARRAY.
22044         (_mono_class_get_instantiation_name): Removed.
22045         (mono_class_create_generic): Always use `gklass->name' as our name.
22046
22047         * class.h (MonoGenericInst): Removed `nested_in', and `nested'.
22048
22049         * icall.c (ves_icall_MonoGenericInst_GetDeclaringType): Removed.
22050         (ves_icall_MonoGenericInst_GetNestedTypes): Removed.
22051         (ves_icall_MonoMethod_GetGenericParameters): Renamed to
22052         ves_icall_MonoMethod_GetGenericArguments() and correctly handle
22053         closed generic methods here.
22054
22055         * reflection.c
22056         (mono_reflection_generic_inst_get_nested_types): Removed.
22057         (inflate_mono_method): Copy the generic parameters from the
22058         MonoMethodHeader into out MonoGenericMethod.
22059
22060 2004-04-06  Martin Baulig  <martin@ximian.com>
22061
22062         * row-indexes.h
22063         (MONO_GENERICPARAM_DEPRECATED_CONSTRAINT): Removed.
22064
22065         * metadata.c (GenericParamSchema): Removed "DeprecatedConstraint".
22066
22067         * reflection.c (build_compressed_metadata): If we have any entries
22068         in the GenericParam, MethodSpec or GenericParamConstraint tables,
22069         set the header version to 1.1.
22070
22071 2004-04-06  Martin Baulig  <martin@ximian.com>
22072
22073         * class.c (mono_class_init): If we're a generic instance,
22074         initialize our nested classes, too.
22075         (_mono_class_get_instantiation_name): Deal with the new `!%d'
22076         suffix. 
22077
22078 2004-04-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22079
22080         * process.c: quote the argument passed to the shell on windows.
22081
22082 2004-04-05  Zoltan Varga  <vargaz@freemail.hu>
22083
22084         * threads.c (mono_alloc_special_static_data): Allow this to be
22085         called during startup.
22086
22087 2004-04-02  Martin Baulig  <martin@ximian.com>
22088
22089         * icall.c
22090         (ves_icall_MonoGenericInst_GetDeclaringType): New icall.
22091
22092 2004-04-02  Zoltan Varga  <vargaz@freemail.hu>
22093
22094         * icall.c: Fix build.
22095
22096 2004-04-02  Sebastien Pouliot  <sebastien@ximian.com>
22097
22098         * Makefile.am: Added security.c|h.
22099         * icall.c: Added icall for get_UserName;
22100         * security.c: New file for security related icalls. Added function
22101         get_UserName for System.Environment (fix #56144).
22102         * security.h: New. Header file for security.c
22103
22104 2004-04-02  Dick Porter  <dick@ximian.com>
22105
22106         * icall.c: Deleted the icalls that were obsoleted some time ago
22107         by the ICU string code, and which were mixed into the icall
22108         rearranging.  Fixes bug 55969.
22109
22110         * string-icalls.h: 
22111         * string-icalls.c: Deleted the code that those icalls reference.
22112
22113 2004-04-01  Martin Baulig  <martin@ximian.com>
22114
22115         * metadata.h (MONO_CLASS_IS_INTERFACE): New macro.
22116
22117         * class.c (mono_class_from_generic_parameter): Don't set 
22118         TYPE_ATTRIBUTE_INTERFACE.
22119         (my_mono_class_from_generic_parameter): Likewise.
22120
22121 2004-04-01  Martin Baulig  <martin@ximian.com>
22122
22123         * loader.c (find_method): Added an optional `MonoClass *ic'
22124         argument to search in a specific interface.
22125         (mono_get_method_constrained): New public function.
22126
22127 2004-04-01  Martin Baulig  <martin@ximian.com>
22128
22129         * reflection.c (mono_image_get_generic_field_token): Use the
22130         `handleref' cache here.
22131
22132 2004-04-01  Martin Baulig  <martin@ximian.com>
22133
22134         * reflection.h (MonoDynamicImage): Added `GHashTable *typespec'.
22135
22136         * reflection.c (create_generic_typespec): Use the `typespec' hash
22137         here, not the `typeref' one.    
22138
22139 2004-04-01  Martin Baulig  <martin@ximian.com>
22140
22141         * class.c (mono_class_inflate_generic_type): Moved the
22142         functionality into a new static inflate_generic_type() which
22143         returns NULL if it didn't do anything.  Only increment the
22144         `mono_stats.inflated_type_count' if we actually inflated
22145         something.
22146         (mono_class_get_full): Check the classes type to see whether we
22147         need to inflate it; also inflate MONO_TYPE_(M)VAR.
22148
22149 2004-04-01  Jackson Harper  <jackson@ximian.com>
22150
22151         * reflection.c: Set culture for assembly references.
22152         
22153 2004-04-01 Ben Maurer  <bmaurer@users.sourceforge.net>
22154
22155         * reflection.[ch], icall.[ch], Fix support for pinning variables.
22156
22157 2004-04-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22158
22159         * assembly.c:
22160         (do_mono_assembly_open): the critical section also covers
22161         mono_image_open and mono_image_open_from_data. Fixes bug #56327.
22162
22163 2004-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22164
22165         * threads.c:
22166         (mono_manage_threads): abort the background threads when finishing.
22167         Fixes bug #47232.
22168
22169 2004-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22170
22171         * gc.c: only close the done_event handle if there was no timeout.
22172         C-ified comments.
22173
22174 2004-03-30  Martin Baulig  <martin@ximian.com>
22175
22176         * icall.c (icall_entries): It's called "System.Activator", not
22177         "System.Activation".    
22178
22179 2004-03-30  Martin Baulig  <martin@ximian.com>
22180
22181         * class.c (mono_ldtoken): Added `MonoGenericContext *' argument.
22182         (mono_class_create_from_typespec): Likewise.
22183
22184 2004-03-30  Martin Baulig  <martin@ximian.com>
22185
22186         * reflection.h (MonoReflectionGenericParam): Use MonoBoolean for
22187         `has_ctor_constraint' and `initialized'.
22188
22189 2004-03-30  Martin Baulig  <martin@ximian.com>
22190
22191         * reflection.c (encode_new_constraint): New static function to add
22192         the constructor constraint attribute to a type parameter.
22193         (encode_constraints): Call encode_new_constraint() if necessary.
22194
22195         * reflection.h
22196         (MonoReflectionGenericParam): Added `guint32 has_ctor_constraint'.
22197
22198         * row-indexes.h: Added CUSTOM_ATTR_GENERICPAR.
22199         
22200 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
22201
22202         * reflection.c, icall.c: add support for pinning variables. 
22203
22204 2004-03-29  Bernie Solomon  <bernard@ugsolutions.com>
22205
22206         * marshal.c (mono_marshal_get_managed_wrapper):
22207         init bool local with zero rather than null.
22208
22209 2004-03-29  Martin Baulig  <martin@ximian.com>
22210
22211         * icall.c (ves_icall_MonoMethod_get_HasGenericParameters): Show
22212         the "official" behavior here.
22213         (ves_icall_MonoMethod_get_Mono_IsInflatedMethod): New interncall.
22214
22215 2004-03-29  Martin Baulig  <martin@ximian.com>
22216
22217         * icall.c: Reflect latest API changes.
22218
22219 2004-03-29  Martin Baulig  <martin@ximian.com>
22220
22221         * loader.c (mono_get_method_from_token): Also call
22222         mono_metadata_load_generic_params () for abstract and interface
22223         methods; replace the type arguments in the method signature with
22224         the ones which are loaded from the metadata.
22225
22226 2004-03-29  Lluis Sanchez Gual  <lluis@ximian.com>
22227
22228         * monitor.c: In mono_monitor_exit(), don't throw an exception if the owner
22229         of the lock is not the current thread. MS.NET don't do it, in spite of
22230         what the documentation says. See bug #56157.
22231
22232 2004-03-28  Martin Baulig  <martin@ximian.com>
22233
22234         * class.c (mono_class_init): Don't call init_properties() and
22235         init_events() for generic instances; set `prop->parent' when
22236         inflating properties.
22237
22238         * reflection.c (mono_generic_inst_get_object): Call
22239         `mono_class_init (ginst->klass)'.
22240         (mono_type_get_object): Only create a MonoGenericInst if your
22241         generic type is a TypeBuilder.
22242         (do_mono_reflection_bind_generic_parameters): Only set
22243         `ginst->is_dynamic' if our generic type is a TypeBuilder.
22244
22245 2004-03-28  Zoltan Varga  <vargaz@freemail.hu>
22246
22247         * appdomain.c (unload_thread_main): Do not clear proxy_vtable_hash.
22248         Fixes #56091.
22249
22250 2004-03-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22251
22252         * icall.c: added Kill_internal icall.
22253         * process.[ch]: added Kill_internal icall.
22254
22255 2004-03-25  Martin Baulig  <martin@ximian.com>
22256
22257         * class.h (MonoStats): Added `generic_instance_count',
22258         `inflated_method_count', `inflated_type_count' and
22259         `generics_metadata_size'.       
22260
22261 2004-03-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22262
22263         * reflection.c: no warnings now.
22264
22265 2004-03-25  Martin Baulig  <martin@ximian.com>
22266
22267         * class.c (mono_class_get_full): New public function; does a
22268         mono_class_get(), but also takes a `MonoGenericContext *'.
22269
22270         * loader.c (mono_field_from_memberref): Renamed to
22271         `field_from_memberref', made static and added `MonoGenericContext *'
22272         argument.
22273         (mono_field_from_token): Added `MonoGenericInst *' argument.
22274         (method_from_memberef): Likewise.
22275         (mono_get_method_from_token): Likewise.
22276         (mono_get_method_full): New public function; does a
22277         mono_get_method(), but also takes a `MonoGenericContext *'.
22278
22279         * verify.c (mono_method_verify): Get the method's generic context
22280         and pass it to mono_field_from_token(), mono_get_method_full() and
22281         mono_class_get_full().
22282
22283 2004-03-25  Martin Baulig  <martin@ximian.com>
22284
22285         * class.c (mono_class_inflate_generic_type): Take a
22286         `MonoGenericContext *' instead of a `MonoGenericInst *' and a
22287         `MonoGenericMethod *'.
22288
22289 2004-03-25  Martin Baulig  <martin@ximian.com>
22290
22291         * loader.h (MonoMethodInflated): Store the MonoGenericContext
22292         instead of the MonoGenericMethod here.
22293
22294 2004-03-25  Martin Baulig  <martin@ximian.com>
22295
22296         * class.h (MonoGenericInst): Added `MonoGenericContext *context';
22297         each time we create a new MonoGenericInst, we also create a new
22298         context which points back to us.
22299
22300         * class.c (inflate_method): Use `ginst->context' instead of
22301         creating a new context.
22302
22303         * loader.c (method_from_memberref): Use
22304         `klass->generic_inst->context' instead of creating a new context.
22305
22306 2004-03-25  Martin Baulig  <martin@ximian.com>
22307
22308         * class.h (MonoGenericContext): New struct.
22309         (MonoGenericMethod): Removed `generic_inst'.
22310
22311         * class.c (mono_class_inflate_generic_method): Take a
22312         `MonoGenericContext *' instead of a `MonoGenericMethod *'.
22313
22314 2004-03-25  Martin Baulig  <martin@ximian.com>
22315
22316         * loader.h (MonoMethodInflated): New typedef.
22317
22318         * metadata.h (MonoMethodSignature): Removed `gen_method', make
22319         `generic_param_count' consume just 30 bits, added `is_inflated'
22320         and `has_type_parameters' flags (one bit each).
22321
22322         * class.c (mono_class_inflate_generic_method): Create a
22323         MonoMethodInflated instead of a MonoMethodNormal and set
22324         `is_inflated' in the method signature.
22325
22326         * class.h (MonoGenericMethod): Removed `generic_method'.
22327
22328 2004-03-25  Lluis Sanchez Gual  <lluis@ximian.com>
22329
22330         * image.c: Make sure the name of a MonoImage is always an absolute path.
22331           This fixes bug #54415.
22332
22333 2004-03-24  Martin Baulig  <martin@ximian.com>
22334
22335         * class.c (mono_class_setup_vtable): If we're a generic instance,
22336         use our generic type's vtable size.
22337
22338 2004-03-24  Zoltan Varga  <vargaz@freemail.hu>
22339
22340         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Add
22341         MONO_NO_UNLOAD env var as a temporary workaround for unloading 
22342         problems.
22343
22344 2004-03-23  Martin Baulig  <martin@ximian.com>
22345
22346         * class.h (MonoDynamicGenericInst): Added `int count_events' and
22347         `MonoEvent *events'.
22348
22349         * icall.c (ves_icall_MonoGenericInst_GetEvents): New interncall.
22350         (typebuilder_icalls): Added "get_event_info"; calls
22351         mono_reflection_event_builder_get_event_info(). 
22352
22353         * reflection.c (mono_reflection_generic_inst_initialize): Added
22354         `MonoArray *events'.
22355         (mono_reflection_event_builder_get_event_info): New function.
22356
22357 2004-03-23  Bernie Solomon  <bernard@ugsolutions.com>
22358
22359         * object.h: add mono_type_initialization_init
22360
22361         * object.c (mono_runtime_class_init): 
22362         implement class constructor synchronization rules
22363         to cope with threading issues.  
22364         add mono_type_initialization_init
22365
22366         * appdomain.c (mono_runtime_init): call 
22367         mono_type_initialization_init
22368
22369         * class.h: removing initializing field from MonoVTable
22370
22371 2004-03-23  Martin Baulig  <martin@ximian.com>
22372
22373         * class.c (my_mono_class_from_generic_parameter): Use
22374         `param->name' if it's not NULL. 
22375
22376 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
22377
22378         * class.c: do not insert non-virtual methods in the vtable.
22379         * icall.c, mono-debug-debugger.c, object.c: if method->slot == -1,
22380         that means the method is non-virtual. This never would have
22381         happened before.
22382
22383 2004-03-22  Lluis Sanchez Gual  <lluis@ximian.com>
22384
22385         * profiler.c: Added lock for accessing coverage_hash.
22386
22387 2004-03-22  Martin Baulig  <martin@ximian.com>
22388
22389         * icall.c (ves_icall_MethodInfo_get_IsGenericMethod): Use
22390         `method->method->signature->generic_param_count != 0' to make it
22391         work for interface methods.
22392
22393 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22394
22395         * process.c: quote the string passed to the shell using g_shell_quote.
22396
22397 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22398
22399         * threads.c:
22400         (mono_threads_manage): don't remove the finalizer thread and self
22401         from the threads hash table so that mono_thread_manage can be called
22402         more than once.
22403
22404 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22405
22406         * process.c: quote the arguments when UseShellExecute is true. Fixes
22407         bug #55790.
22408
22409 2004-03-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22410
22411         * threads.c: set mono_thread_detach as a cleanup routine for every
22412         thread. This way it's always executed upon thread termination, either
22413         aborted or finished normally. No more xsp hangs!
22414
22415 2004-03-17  Martin Baulig  <martin@ximian.com>
22416
22417         * class.h (MonoGenericInst): Replaced the `GList *nested' with an
22418         `int count_nested' and a `MonoType **nested'.
22419
22420         * reflection.c (mono_reflection_bind_generic_parameters): Moved
22421         most of the functionality into a new static
22422         do_mono_reflection_bind_generic_parameters() and don't take a
22423         `MonoType *nested_in' argument any more.  Don't compute nested
22424         types here.
22425         (mono_reflection_generic_inst_get_nested_types): New public method
22426         to get nested types.
22427
22428         * class.c (mono_class_create_generic): Set `klass->nested_in' if
22429         we're a nested class.
22430
22431         * icall.c (ves_icall_MonoGenericInst_GetNestedTypes): Call
22432         mono_reflection_generic_inst_get_nested_types() to compute the
22433         nested types.
22434
22435 2004-03-17  Zoltan Varga  <vargaz@freemail.hu>
22436
22437         * threads.c (ves_icall_System_Threading_Thread_Abort): Add a more
22438         descriptive error message under windows.
22439         
22440 2004-03-17  Martin Baulig  <martin@ximian.com>
22441
22442         * class.c (dup_type): Added `const MonoType *original' argument;
22443         copy the attrs from the original type.
22444
22445 2004-03-17  Martin Baulig  <martin@ximian.com>
22446
22447         * metadata.c (do_mono_metadata_parse_generic_inst): Use the
22448         `m->generic_inst_cache' here.
22449
22450 2004-03-17  Zoltan Varga  <vargaz@freemail.hu>
22451
22452         * exception.h exception.c: Add stack_overflow_exception.
22453
22454 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22455
22456         * threadpool.c:
22457         (overlapped_callback): call SetEvent *after* invoking the callback.
22458         No need to call CloseHandle.
22459
22460 2004-03-16  Martin Baulig  <martin@ximian.com>
22461
22462         * reflection.c (mono_image_get_fieldref_token): Take a
22463         `MonoReflectionField *' instead of a `MonoClassField *' and a
22464         `MonoClass *'; store the `MonoReflectionField *' in the hash.
22465
22466 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22467
22468         * appdomain.c: don't add the culture to the filename we're looking for
22469         if it's neutral or NULL. Fixes bug #53788. Removed redundant memset.
22470
22471 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22472
22473         * locales.c: don't ignore symbols when doing case insensitive compares.
22474         Thanks Dick! Fixes bug #54046.
22475
22476         * threads.c: surround 'threads' usage with enter/leave in
22477         mono_thread_manage.
22478
22479 2004-03-16  Zoltan Varga  <vargaz@freemail.hu>
22480
22481         * marshal.c (mono_marshal_get_native_wrapper): Char arrays are 
22482         implicitly marshalled as [Out]. Fixes #55450.
22483
22484         (mono_marshal_get_runtime_invoke): Zero out the result if there is
22485         an exception.
22486
22487 2004-03-16  Martin Baulig  <martin@ximian.com>
22488
22489         * class.c (mono_class_from_generic_parameter): Use the actual
22490         parameter name. 
22491
22492 2004-03-16  Martin Baulig  <martin@ximian.com>
22493
22494         * reflection.c (type_get_signature_size): New static function.
22495         Compues the size of the type in a method signature.
22496         (method_get_signature_size): New static function; calls
22497         type_get_signature_size() to compute the actual size of the
22498         method's signature.
22499         (method_encode_signature): Use method_get_signature_size() to get
22500         the signature's size rather than using `nparams * 10'.
22501
22502 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22503
22504         * file-io.h: define here WapiOverlapped on windows. I don't want the
22505         regular OVERLAPPED one.
22506
22507         * file-io.c:
22508         * threadpool.c: somehow, BindIoCompletionCallback is not found.
22509         Disabling AIO on windows.
22510
22511 2004-03-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22512
22513         * marshal.c: Marshal.SizeOf throws an exception for AutoLayout. Fixes
22514         bug #55385.
22515
22516 2004-03-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22517
22518         * appdomain.c: upgraded corlib version.
22519
22520         * file-io.c: implemented new icalls: GetSupportsAIO, BeginRead
22521         and BeginWrite. Allow opening files for asynchrnous operations.
22522
22523         * file-io.h: new struct that maps FileStreamAsyncResult.
22524         * icall.c: added new icalls.
22525         * process.[ch]: support setting child process environment variables
22526         and use the SHELL or COMSPEC when UseShellExecute is true.
22527
22528         * threadpool.[ch]: fixed warnings, moved ThreadPool icalls here. The
22529         callback for async. IO is here and also BindHandle.
22530
22531         * threads.[ch]: added mono_thread_detach and removed ThreadPool icalls
22532         from here.
22533
22534 2004-03-14  Zoltan Varga  <vargaz@freemail.hu>
22535
22536         * reflection.c (create_custom_attr): Allow len == 0.
22537
22538         * object.c (mono_class_compute_gc_descriptor): Fix descriptor
22539         computation on big-endian machines.
22540
22541 2004-03-13  Martin Baulig  <martin@ximian.com>
22542
22543         * class.h (MonoGenericInst): Added `int count_ifaces'.
22544
22545         * iclass.c (ves_icall_MonoGenericInst_GetInterfaces): Use
22546         `ginst->count_ifaces' instead `klass->interface_count' since we
22547         may get called before the vtable is created.
22548
22549         * loader.c (mono_method_get_param_names): If we're a generic
22550         instance, return and don't initialize the class.
22551
22552         * reflection.c (mono_reflection_setup_generic_class): Don't call
22553         ensure_runtime_vtable().
22554         (mono_reflection_bind_generic_parameters): Set
22555         `ginst->count_ifaces'.
22556
22557 2004-03-11  Jackson Harper <jackson@ximian.com>
22558
22559         * icall.c:
22560         * unicode.c:
22561         * unicode.h: Remove unused System.Char icalls.
22562         
22563 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
22564
22565         * loader.c (mono_lookup_pinvoke_call): Call the Windows.Forms init
22566         code when we P/Invoke the first library in Windows.Forms, instead
22567         of when we first open the assembly.
22568
22569         * assembly.c: Drop the lookup from here.
22570
22571 2004-03-10  Martin Baulig  <martin@ximian.com>
22572
22573         * reflection.c (mono_reflection_get_custom_attrs): Use the correct
22574         class for properties, fields and events.  Finally fixes #54945.
22575
22576 2004-03-10  Martin Baulig  <martin@ximian.com>
22577
22578         * metadata.c (mono_metadata_class_equal): New static function;
22579         checks whether two generic instances or two generic parameters are
22580         equal.
22581         (mono_metadata_type_equal): Use mono_metadata_class_equal() to
22582         compare classes.        
22583
22584 2004-03-10  Martin Baulig  <martin@ximian.com>
22585
22586         * class.h (MonoGenericMethod): Added `gpointer reflection_info'.
22587
22588         * reflection.c (inflate_mono_method): Added `MonoObject *obj'
22589         argument and write it into the `reflection_info' field.
22590
22591         * icall.c
22592         (ves_icall_MethodBase_GetGenericMethodDefinition): New interncall.
22593         (ves_icall_MethodBase_get_HasGenericParameters): New interncall.
22594
22595 2004-03-09  Jackson Harper  <jackson@ximian.com>
22596
22597         * char-conversions.h: use 8 bits for numeric data its all we need
22598         * icall.c: numeric data is only 8 bits now.
22599
22600 2004-03-09  Martin Baulig  <martin@ximian.com>
22601
22602         * class.h (MonoProperty, MonoEvent): Added `MonoClass *parent'.
22603
22604         * class.c (init_properties, init_events): Initialize the new
22605         `parent' field.
22606
22607         * reflection.c (typebuilder_setup_properties): Likewise.
22608         (typebuilder_setup_events): Likewise.
22609
22610         * reflection.h (MonoEventInfo): Replaced `parent with
22611         `declaring_type' and `reflected_type'.
22612
22613         * icall.c (ves_icall_get_property_info): Distinguish between
22614         declaring and reflected type.
22615         (ves_icall_get_event_info): Likewise.
22616
22617 2004-03-09  Martin Baulig  <martin@ximian.com>
22618
22619         * icall.c (ves_icall_Type_GetTypeCode): Added MONO_TYPE_GENERICINST.
22620         (ves_icall_Type_GetField): Correctly set field->klass.
22621
22622 2004-03-09  Zoltan Varga  <vargaz@freemail.hu>
22623
22624         * loader.h: Fix warning.
22625
22626 2004-03-08  Miguel de Icaza  <miguel@ximian.com>
22627
22628         *  loader.c, loader.h (mono_loader_wine_init): Loads the Wine/Lib
22629         library routine if present.  Notice that it will still continue
22630         executing even if its missing, for those working on the Gtk#
22631         edition of Windows.Forms.
22632
22633         * assembly.c (do_mono_assembly_open): If loading the
22634         System.Windows.Forms call mono_loader_wini_init.
22635
22636 2004-03-04  Lluis Sanchez Gual  <lluis@ximian.com>
22637
22638         * class.h: Added MonoRemoteClass struct.
22639         * domain.c: Changed hash function for proxy_vtable_hash. It now uses a
22640         function for MonoStrings.
22641         * icall.c: In GetTransparentProxy, assign a MonoRemoteClass to the proxy.
22642         Added internal call for getting the proxy type.
22643         * marshal.c: Get the type of transparent proxies from its remote_class.
22644         Added methods that generate the IL for type checks and casts:
22645         mono_marshal_get_isinst, mono_marshal_get_castclass, 
22646         mono_marshal_get_proxy_cancast.
22647         * marshal.h: Declaration of the previous new methods.
22648         * object.c: Added new moethods for creating and updating MonoRemoteClass
22649         instances: mono_remote_class, mono_upgrade_remote_class, 
22650         * object.h: Added MonoRemoteClass reference in MonoTransparentProxy.
22651         * verify.c: FIx transparent_proxy_fields layout.
22652         * appdomain.c: Bump corlib version.
22653
22654 2004-03-04  Jackson Harper  <jackson@ximian.com>
22655
22656         * icall.c: Add icall to access char conversion tables.
22657         * char-conversions.h: Character conversion tables.
22658         * Makefile.am: Add char-conversions.h private header file.
22659         
22660 2004-03-04  Zoltan Varga  <vargaz@freemail.hu>
22661
22662         * appdomain.c (unload_thread_main): Increase unloading timeout to
22663         10 sec as a temporary workaround for Nant problems.
22664
22665 2004-02-29  Zoltan Varga  <vargaz@freemail.hu>
22666
22667         * gc.c: Add checks for GC_enable and GC_disable.
22668
22669         * string-icalls.c locales.c: Applied patch from Jaroslaw Kowalski
22670         (jaak@zd.com.pl). Fix memory corruption in String.Replace 
22671         (bug #54988).
22672         
22673 2004-02-27  Martin Baulig  <martin@ximian.com>
22674
22675         * reflection.c (mono_reflection_bind_generic_parameters): Take a
22676         `MonoReflectionType *' instead of a `MonoType *'.
22677
22678 2004-02-26  Zoltan Varga  <vargaz@freemail.hu>
22679
22680         * gc.c (run_finalize): Avoid finalizing the object representing the
22681         finalizer thread.
22682         (finalizer_thread): Fix warning.
22683
22684 2004-02-25  Martin Baulig  <martin@ximian.com>
22685
22686         * class.c (_mono_class_get_instantiation_name): Added `int offset'
22687         argument for nested types.
22688         (mono_class_create_generic): Added support for nested generictypes.
22689
22690         * class.h (MonoGenericInst): Added `MonoType *nested_in' and
22691         `GList *nested'.
22692
22693         * icall.c (ves_icall_MonoGenericInst_GetNestedTypes): New icall.
22694
22695         * reflection.c (method_encode_signature): Increase the minimum
22696         value of `size' from 10 to 11.
22697         (mono_reflection_bind_generic_parameters): Take `int type_argc'
22698         and `MonoType **types' arguments instead of the `MonoArray
22699         *types'; added `MonoType *nested_in'.  Recursively instantiate
22700         nested classes. 
22701
22702 2004-02-23  Zoltan Varga  <vargaz@freemail.hu>
22703
22704         * appdomain.h (MonoDomain): Add preallocated null_reference_ex and 
22705         stack_overflow_ex members which are used by exception handling.
22706
22707         * appdomain.c (mono_runtime_init): Initialize the new members.
22708
22709         * gc.c (mono_gc_enable): New helper function.
22710         * gc.c (mono_gc_disable): New helper function.
22711
22712 2004-02-23  Martin Baulig  <martin@ximian.com>
22713
22714         * icall.c: I must have been really stupid - make it actually work
22715         this time ;-)
22716
22717 2004-02-23  Martin Baulig  <martin@ximian.com>
22718
22719         * loader.c (method_from_memberref): Only inflate the method if
22720         it's in another klass.
22721
22722 2004-02-23  Martin Baulig  <martin@ximian.com>
22723
22724         * class.c (mono_class_inflate_generic_type): Fixed two bugs.
22725         (mono_class_init): If we're a generic instance and an interface,
22726         compute `class->interface_id'; also create `class->interfaces'
22727         here and inflate them.
22728
22729         * metadata.c (do_mono_metadata_parse_generic_inst): Compute
22730         `ginst->is_open'.
22731         (mono_type_stack_size): Fix for MONO_TYPE_GENERICINST.
22732
22733         * reflection.c (mono_image_create_token): Allow "MonoGenericInst".
22734
22735 2004-02-15  Miguel de Icaza  <miguel@ximian.com>
22736
22737         * reflection.c (method_encode_code): Improved the error message
22738         generated by the exception.
22739
22740 2004-02-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22741
22742         * icall.c: Martin did not do what he said in the ChangeLog for
22743         2004-02-18, but put back the changes for properties and events.
22744         Commenting those changes out again and adding comment to bug #54518.
22745         
22746         * process.c: removed warning.
22747
22748 2004-02-20  Zoltan Varga  <vargaz@freemail.hu>
22749
22750         * marshal.c (emit_struct_conv): Print an error message instead of
22751         asserting when a type does not have the StructLayout attribute.
22752
22753 2004-02-20  Martin Baulig  <martin@ximian.com>
22754
22755         * reflection.c (mono_type_get_object): Also use the cache for
22756         generic instances.
22757         (mono_reflection_bind_generic_parameters): Always compute
22758         `ginst->ifaces'.        
22759
22760 2004-02-20  Martin Baulig  <martin@ximian.com>
22761
22762         * class.h (MonoGenericMethod): Removed `klass'.
22763
22764         * class.c (mono_class_inflate_generic_method): Added `MonoClass
22765         *klass' argument.
22766
22767 2004-02-20  Martin Baulig  <martin@ximian.com>
22768
22769         * reflection.c (method_encode_methodspec): Actually use the
22770         uninflated signature for the memberref.
22771
22772 2004-02-20  Martin Baulig  <martin@ximian.com>
22773
22774         * class.h (MonoGenericMethod): Removed `declaring'.
22775
22776         * class.c (mono_class_inflate_generic_method): If `gmethod->klass'
22777         is NULL, compute it here.
22778
22779 2004-02-20  Martin Baulig  <martin@ximian.com>
22780
22781         * image.h (MonoImage): Added `GHashTable *generic_inst_cache'.
22782
22783         * metadata.c (mono_metadata_generic_inst_hash): New method.
22784         (mono_metadata_generic_inst_equal): New method.
22785
22786         * reflection.c (mono_reflection_bind_generic_parameters): Use the
22787         `klass->image->generic_inst_cache' cache to avoid creating
22788         duplicate MonoGenericInst's.
22789
22790         * class.c (mono_class_inflate_generic_type): Use the cache.
22791
22792 Thu Feb 19 19:39:09 CET 2004 Paolo Molaro <lupus@ximian.com>
22793
22794         * object.c: fixed gc descriptor calculation for embedded valuetypes.
22795
22796 2004-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22797
22798         * icall.c: added Socket.WSAIoctl icall.
22799
22800         * socket-io.[ch]: implemented
22801         ves_icall_System_Net_Sockets_Socket_WSAIoctl.
22802
22803 2004-02-19  Atsushi Enomoto  <atsushi@ximian.com>
22804
22805         * icall.c: removed IsDigit, IsSeparator, IsWhiteSpace from char_icalls.
22806
22807 2004-02-18  Urs C Muff  <umuff@quark.com>
22808
22809         * debug-mono-symfile.c, mono-debug-debugger.c, mono-debug.c: Make
22810         this work on PPC and other big-endian architectures.
22811
22812         * debug-mono-symfile.h: Prepended the names of all the `guint32'
22813         fields with an underscore to make sure they're only accessed by
22814         the read32() macro.
22815
22816 2004-02-18  Martin Baulig  <martin@ximian.com>
22817
22818         * icall.c: Put the klass->refclass changes back for methods and
22819         fields, but not for properties and events.  We're currently not
22820         distinguishing between DeclaringType and ReflectedType for
22821         properties and events, that's what caused the regressions.
22822
22823 2004-02-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22824
22825         * object.c:
22826         (mono_async_result_new): the handle can be NULL.
22827
22828         * threadpool.c: Use an event instead of a semaphore, don't initialize
22829         it until needed. This saves quite a few semaphores from being created
22830         when using the threadpool.
22831
22832 2004-02-18  Zoltan Varga  <vargaz@freemail.hu>
22833
22834         * object.c (mono_string_is_interned_lookup): Fix interning of long
22835         strings. Fixes #54473.
22836
22837         * domain.c (ldstr_equal): Optimize if the two strings are equal.
22838
22839         * icall.c: Revert the klass->refclass changes since they introduce
22840         regressions (bug #54518).
22841
22842 2004-02-18  Martin Baulig  <martin@ximian.com>
22843
22844         * class.c (mono_class_init): If we're a generic instance and don't
22845         come from a TypeBuilder, inflate our members here.
22846         (mono_class_from_generic): Removed; just use `ginst->klass' instead.
22847         (mono_class_create_generic): New public method.
22848         (mono_class_initialize_generic): Removed.
22849         (get_instantiation_name): Renamed to
22850         _mono_class_get_instantiation_name() and made it public.
22851
22852 2004-02-18  Martin Baulig  <martin@ximian.com>
22853
22854         * class.c (mono_class_inflate_generic_type): Clear the new
22855         instance's `nginst->klass' when inflating a generic instance.
22856         (mono_class_is_subclass_of): Added (basic) support for generic
22857         instances.
22858
22859 Tue Feb 17 21:40:16 CET 2004 Paolo Molaro <lupus@ximian.com>
22860
22861         * appdomain.h, domain.c: use a MonoCodeManager instead of a
22862         MonoMempool to hold compiled native code.
22863
22864 2004-02-17  Martin Baulig  <martin@ximian.com>
22865
22866         * class.h (MonoDynamicGenericInst): Added `count_properties' and
22867         `properties'.
22868
22869         * reflection.c (mono_reflection_generic_inst_initialize): Added
22870         `MonoArray *properties' argument.
22871
22872         * icall.c (ves_icall_MonoGenericInst_GetProperties): New interncall.    
22873
22874 2004-02-17  Martin Baulig  <martin@ximian.com>
22875
22876         * icall.c (ves_icall_Type_GetFields): Renamed to
22877         ves_icall_Type_GetFields_internal() and added a
22878         `MonoReflectionType *rtype' argument; pass it to
22879         mono_field_get_object() to set the field's "reflected" type.
22880         (ves_icall_Type_GetConstructors): Likewise.
22881         (ves_icall_Type_GetEvents): Likewise.
22882         (ves_icall_Type_GetMethodsByName): Added `MonoReflectionType *rtype'
22883         argument; pass it to mono_method_get_object() to set the method's
22884         "reflected" type.       
22885
22886 2004-02-17  Martin Baulig  <martin@ximian.com>
22887
22888         * class.h (MonoDynamicGenericInst): New type.
22889         (MonoGenericInst): Added `dynamic_info' and `is_dynamic' fields.
22890
22891         * icall.c (ves_icall_MonoGenericInst_GetMethods): New interncall.
22892         (ves_icall_MonoGenericInst_GetConstructors): New interncall.
22893         (ves_icall_MonoGenericInst_GetFields): New interncall.
22894
22895         * class.c (mono_class_from_generic): Don't call
22896         mono_class_initialize_generic() if this is a dynamic instance;
22897         ie. it's being created from a TypeBuilder.
22898         Use MONO_TYPE_GENERICINST for `class->this_arg.type' and
22899         `class->byval_arg.type'.
22900
22901         * reflection.c (mono_reflection_inflate_method_or_ctor): Renamed
22902         to `inflate_method' and made static.
22903         (mono_reflection_inflate_field): Removed.
22904         (mono_reflection_generic_inst_initialize): New public method.
22905
22906         * reflection.h (MonoReflectionGenericInst): Removed `methods',
22907         `ctors' and `fields'; added `initialized'.
22908
22909 2004-02-14  Zoltan Varga  <vargaz@freemail.hu>
22910
22911         * debug-helpers.c (mono_method_full_name): Fix output for empty
22912         namespaces.
22913
22914 2004-02-12  Martin Baulig  <martin@ximian.com>
22915
22916         * class.h (MonoClassField): Added `MonoType *generic_type'.
22917
22918         * reflection.c (mono_image_get_fieldref_token): Added support for
22919         instantiated generic types.
22920         (field_encode_inflated_field): Removed.
22921         (mono_image_get_inflated_field_token): Removed.
22922         (mono_reflection_inflate_field): Return a `MonoReflectionField *'.
22923
22924         * reflection.h (MonoReflectionInflatedField): Removed.
22925
22926 2004-02-12  Martin Baulig  <martin@ximian.com>
22927
22928         * metadata.h (MonoMethodHeader, MonoMethodSignature): Moved the
22929         `gen_method' field from MonoMethodHeader to MonoMethodSignature.
22930
22931         * reflection.c (mono_image_get_methodspec_token): Take a
22932         `MonoMethod *' instead of a `MonoReflectionInflatedMethod *'.
22933         (mono_image_create_token): Check whether we have a
22934         `method->signature->gen_method' and call
22935         mono_image_get_methodspec_token() if appropriate.
22936         (inflated_method_get_object): Removed.
22937         (mono_reflection_bind_generic_method_parameters): Return a
22938         `MonoReflectionMethod *', not a `MonoReflectionInflatedMethod *'.
22939         (mono_reflection_inflate_method_or_ctor): Likewise.
22940
22941         * reflection.h (MonoReflectionInflatedMethod): Removed.
22942
22943 2004-02-12  Zoltan Varga  <vargaz@freemail.hu>
22944
22945         * marshal.c (mono_marshal_get_native_wrapper): Implement proper support
22946         for custom valuetype marshalling.
22947
22948         * icall.c (icall_entries): Diagnostic -> Diagnostics. Fixes #54261.
22949
22950 2004-02-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22951
22952         * icall.c: fixed WSAGetLastError_internal name.
22953
22954 2004-02-11  Zoltan Varga  <vargaz@freemail.hu>
22955
22956         * threads.c (mono_thread_attach): Allow this to be called multiple
22957         times for a thread.
22958         
22959         * threads.c (build_wait_tids): Do not wait for ourselves.
22960
22961         * threads.c (mono_thread_pop_appdomain_ref): Avoid crash if the 
22962         appdomain list is empty.
22963
22964         * marshal.c (mono_marshal_get_native_wrapper): Do not free the
22965         memory returned by mono_string_builder_to_utf16, since it points into
22966         managed memory. Thanks to Bernie Solomon for noticing this.
22967
22968         * icall.c: Add AppDomainSetup icalls.
22969
22970         * reflection.h (MonoReflectionMethodAux): Add 'param_cattr' field.
22971
22972         * reflection.c (mono_custom_attrs_from_param): Add support for dynamic
22973         types.
22974
22975         * reflection.c (reflection_methodbuilder_to_mono_method): Save
22976         custom attributes to the method_aux struct. Also fix array indexes etc.
22977
22978         * loader.c (mono_method_get_param_names): Make dynamic case work again.
22979         
22980 Tue Feb 10 17:03:04 CET 2004 Paolo Molaro <lupus@ximian.com>
22981
22982         * icall.c, loader.c: icall cleanup: we save quite a bit of memory
22983         (both static and runtime) and reduce startup time.
22984
22985 2004-02-10  Zoltan Varga  <vargaz@freemail.hu>
22986
22987         * marshal.c (mono_marshal_get_native_wrapper): Throw an exception on
22988         AsAny marshalling conversion instead of crashing.
22989
22990         * marshal.c: Fix warnings.
22991
22992 2004-02-09  Martin Baulig  <martin@ximian.com>
22993
22994         * class.h (MonoGenericMethod): Added `MonoMethod *declaring'.
22995
22996         * reflection.h (MonoReflectionInflatedMethod): Removed the
22997         `declaring' field, it's now in the unmanaged MonoGenericMethod.
22998
22999         * reflection.c (method_encode_methodspec): Removed the `method'
23000         argument; we get it from `gmethod->declaring'.
23001         (inflated_method_get_object): Removed the `declaring' argument.
23002
23003 2004-02-09  Martin Baulig  <martin@ximian.com>
23004
23005         * class.h (MonoGenericMethod): New type.
23006         (MonoGenericInst): Remove `mtype_argc', `mtype_argv' and
23007         `generic_method'.
23008
23009         * metadata.h (MonoMethodHeader): Replaced the `geninst' field with
23010         a `MonoGenericMethod *gen_method' one.
23011
23012         * class.c (mono_class_inflate_generic_type): Take an additional
23013         `MonoGenericMethod * argument.  This is only non-NULL if we're
23014         inflating types for a generic method.   
23015         (mono_class_inflate_generic_signature): Renamed to
23016         inflate_generic_signature() and made static; take a
23017         `MonoGenericMethod *' argument instead of a `MonoGenericInst *'.
23018         (inflate_generic_header): Take a `MonoGenericMethod *' argument
23019         instead of a `MonoGenericInst *' one.
23020         (mono_class_inflate_generic_method): Likewise.
23021
23022         * reflection.c (encode_generic_method_sig): Take a
23023         `MonoGenericMethod *' argument instead of a `MonoGenericInst *'.
23024         (method_encode_methodspec): Likewise.
23025         (inflated_method_get_object): Likewise. 
23026
23027         * reflection.h (MonoReflectionGenericInst): Replaced the `ginst'
23028         field with a `MonoGenericMethod *gmethod' one.  
23029
23030 2004-02-08  Bernie Solomon  <bernard@ugsolutions.com>
23031
23032         * class.h (mono_class_has_parent): add parens to expansion
23033         so you can ! this.
23034
23035 2004-02-08  Martin Baulig  <martin@ximian.com>
23036
23037         * image.h (MonoImage): Removed `generics_cache'.
23038
23039         * class.c (mono_class_from_generic): Take a `MonoGenericInst *'
23040         instead of a `MonoType *' argument; removed the `inflate_methods'
23041         argument.  Don't inflate methods here.
23042
23043         * loader.c (find_method): If it's a generic instance, call
23044         mono_class_init() on the `sclass->generic_inst->generic_type'.
23045
23046         * metadata.c (mono_type_size): Make this work on uninitialized
23047         generic instances; call it on the `ginst->generic_type's class.
23048
23049         * reflection.c (mono_reflection_bind_generic_parameters): Call
23050         mono_class_from_generic() to create the `ginst->klass'.
23051
23052 2004-02-08  Martin Baulig  <martin@ximian.com>
23053
23054         * class.h (MonoClass): Changed type of `generic_inst' from
23055         `MonoType *' to `MonoGenericInst *'.
23056
23057 2004-02-08  Martin Baulig  <martin@ximian.com>
23058
23059         * icall.c (ves_icall_Type_BindGenericParameters): Just call
23060         mono_type_get_object(), this is now creating a `MonoGenericInst'
23061         for MONO_TYPE_GENERICINST.
23062         (ves_icall_MonoGenericInst_GetParentType): Likewise.
23063         (ves_icall_MonoGenericInst_GetInterfaces): Likewise.
23064
23065         * reflection.c (mono_type_get_object): Return a `MonoGenericInst'
23066         instead instead of a `MonoType' for MONO_TYPE_GENERICINST.
23067         (inflated_method_get_object): Added `MonoClass *refclass' argument.
23068         (mono_reflection_inflate_method_or_ctor): Correctly set declaring
23069         and reflected type.
23070
23071         * reflection.h (MonoReflectionInflatedMethod): Removed
23072         `declaring_type' and `reflected_type'.
23073
23074 2004-02-08  Martin Baulig  <martin@ximian.com>
23075
23076         * class.h (MonoGenericInst): Added `MonoType *parent' and
23077         `MonoType **ifaces'.
23078
23079         * reflection.h (MonoReflectionGenericInst): Removed `klass',
23080         `parent' and `interfaces'.
23081
23082         * reflection.c (mono_reflection_bind_generic_parameters): Take a
23083         `MonoType *' argument and return a `MonoType *'.
23084
23085         * icall.c
23086         (ves_icall_MonoGenericInst_GetParentType): New interncall.
23087         (ves_icall_MonoGenericInst_GetInterfaces): Likewise.    
23088
23089 2004-02-06  Zoltan Varga  <vargaz@freemail.hu>
23090
23091         * marshal.c (mono_marshal_get_native_wrapper): Add support for custom
23092         valuetype marshalling.
23093
23094 2004-02-06  Martin Baulig  <martin@ximian.com>
23095
23096         * class.c
23097         (mono_class_from_generic_parameter): Added TYPE_ATTRIBUTE_PUBLIC.
23098         (my_mono_class_from_generic_parameter): Likewise.
23099
23100 2004-02-06  Zoltan Varga  <vargaz@freemail.hu>
23101
23102         * debug-mono-symfile.c debug-mono-symfile.h mono-debug.c: Read the
23103         contents of the symbol files lazily.
23104
23105         * object.h (MonoThread): Add 'name' and 'name_len' fields.
23106
23107         * threads.h threads.c icall.c: New icalls for getting and setting the
23108         threads name.
23109
23110 2004-02-05  Zoltan Varga  <vargaz@freemail.hu>
23111
23112         * appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRefByID): 
23113         Raise an exception when the domain is not found.
23114
23115 2004-02-03  Martin Baulig  <martin@ximian.com>
23116
23117         * reflection.c (mono_image_get_methodspec_token): Use the
23118         uninflated signature; fixes gen-33.
23119
23120 2004-02-02  Zoltan Varga  <vargaz@freemail.hu>
23121
23122         * gc.c threads.c: Make the finalizer thread a normal managed thread so
23123         the finalizer code can use thread functionality.
23124
23125         * gc.c (ves_icall_System_GC_WaitForPendingFinalizers): Fix check for 
23126         the finalizer thread.
23127
23128         * threads.c: Make some functions more robust.
23129
23130         * loader.c (mono_lookup_pinvoke_call): Another attempt at fixing #22532.
23131
23132         * metadata.h: Add new marshalling conventions.
23133
23134         * marshal.c (mono_marshal_get_native_wrapper): Add support for unicode
23135         stringbuilder marshalling. Fixes #53700.
23136
23137         * reflection.h (MonoReflectionTypeBuilder): Add 'permissions' field.
23138
23139         * reflection.c (mono_image_get_type_info): Save declarative security
23140         info.
23141
23142         * reflection.c (mono_image_get_field_info): Handle uninitialized 
23143         unmanaged fields as well.
23144
23145         * appdomain.c: Bump corlib version.
23146
23147 2004-02-01  Martin Baulig  <martin@ximian.com>
23148
23149         * loader.c (method_from_methodspec): Use `ginst->mtype_argc/v' for
23150         method type arguments.  
23151
23152 2004-01-30  Duncan Mak  <duncan@ximian.com>
23153
23154         * marshal.h: Add prototype for
23155         "ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem"
23156         and
23157         "ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem" to
23158         fix the build.
23159
23160 2004-01-30  Zoltan Varga  <vargaz@freemail.hu>
23161
23162         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem): New icall.
23163         (ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem): New icall.
23164
23165 2004-01-29  Zoltan Varga  <vargaz@freemail.hu>
23166
23167         * marshal.c (mono_marshal_get_native_wrapper): Add support for
23168         custom marshalling of valuetypes.
23169
23170         * marshal.c: Fix some warnings.
23171
23172 2004-01-29  Martin Baulig  <martin@ximian.com>
23173
23174         * class.h (MonoGenericInst): Added `mtype_argc' and `mtype_argv'
23175         for generic method parameters.
23176
23177         * reflection.c (method_encode_methodspec): Write the uninflated
23178         signature into the methodspec table.
23179         (mono_reflection_inflate_method_or_ctor): Ensure `res->declaring'
23180         is always the uninflated method.
23181         (reflection_methodbuilder_to_mono_method): Copy the generic
23182         parameters from the MethodBuilder into `header->gen_params'.
23183
23184 2004-01-29  Zoltan Varga  <vargaz@freemail.hu>
23185
23186         * class.c (mono_class_from_generic_parameter): Fix warning.
23187
23188 2004-01-27  Martin Baulig  <martin@ximian.com>
23189
23190         * class.c (mono_class_from_generic_parameter): Don't create
23191         `klass->methods' here.  
23192
23193 2004-01-26  Zoltan Varga  <vargaz@freemail.hu>
23194
23195         * loader.c (mono_lookup_pinvoke_call): Disable trimming of .dll
23196         extension since it does not work with libraries named lib<FOO>.dll.so.
23197
23198 2004-01-25  Martin Baulig  <martin@ximian.com>
23199
23200         * class.c (mono_class_inflate_generic_type): Added support for
23201         MONO_TYPE_GENERICINST.
23202
23203         * reflection.c (mono_reflection_inflate_method_or_ctor): Also
23204         inflate methods on open constructed types.      
23205
23206 2004-01-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23207
23208         * object.c: fire ProcessExit event in the root AppDomain after running
23209         Main. Fixes bug #53299.
23210
23211 Fri Jan 23 21:27:40 CET 2004 Paolo Molaro <lupus@ximian.com>
23212
23213         * socket-io.c: include the new socket-wrappers.h header.
23214         Use the wrappers instead of the unix socket functions to make the code
23215         more clear.
23216
23217 2004-01-23  Zoltan Varga  <vargaz@freemail.hu>
23218
23219         * profiler.c (merge_methods): Fix merging of profile info. Fixes #53010.
23220
23221         * loader.c (mono_lookup_pinvoke_call): Strip .dll from library names.
23222         Fixes #22532.
23223
23224 2004-01-22  Zoltan Varga  <vargaz@freemail.hu>
23225
23226         * reflection.c (mono_image_create_pefile): Handle the case when the
23227         entry point is not a MethodBuilder.
23228
23229         * reflection.h (MonoReflectionAssemblyBuilder): Change 'entry_point'
23230         field to ReflectionMethod since it is not allways a builder.
23231
23232         * reflection.c (type_get_fully_qualified_name): New helper function to
23233         return the fully qualified name of a type.
23234
23235         * reflection.c (encode_marshal_blob): Always emit the fully qualified
23236         type name for custom marshallers.
23237
23238         * reflection.c (mono_marshal_spec_from_builder): Ditto.
23239
23240         * class.c (mono_class_setup_vtable): If a parent class already 
23241         implements an interface, use the implementing methods from that class.
23242         Fixes #53148.
23243
23244 2004-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23245
23246         * threadpool.c: just return instead of ExitThread to allow for thread
23247         clean up earlier.
23248
23249 2004-01-21  Zoltan Varga  <vargaz@freemail.hu>
23250
23251         * icall.c (ves_icall_System_Reflection_Module_Close): Prevent assertion
23252         when closing resource modules.
23253
23254         * reflection.c (mono_image_create_pefile): Handle the case when the
23255         entry point is not a MethodBuilder.
23256
23257         * reflection.h (MonoReflectionAssemblyBuilder): Change 'entry_point'
23258         field to ReflectionMethod since it is not allways a builder.
23259
23260 2004-01-20  Bernie Solomon  <bernard@ugsolutions.com>
23261
23262         * marshal.c (mono_marshal_get_managed_wrapper): 
23263         mono_marshal_alloc takes native int so CONV_I
23264         the arg for 64bits.
23265
23266 2004-01-20  Zoltan Varga  <vargaz@freemail.hu>
23267
23268         * reflection.c (fixup_cattrs): New function to fixup the methoddef
23269         tokens in the cattr table. Fixes #53108.
23270
23271 2004-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23272
23273         * loader.c: don't trim ".dll" before looking up in the config file.
23274         Don't leak orig_scope. Reopened bug #22532 in the meanwhile.
23275
23276 2004-01-19  Zoltan Varga  <vargaz@freemail.hu>
23277
23278         * icall.c (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal): 
23279         Return the module which contains the resource as well.
23280         (ves_icall_System_Reflection_Module_Close): New icall.
23281
23282         * appdomain.c: Bump corlib version number.
23283
23284         * image.c (mono_image_addref): New public function.
23285
23286         * assembly.c: Call mono_image_addref.
23287
23288         * reflection.c (mono_module_get_object): Increase reference count of 
23289         the image.
23290
23291         * loader.c (mono_lookup_pinvoke_call): Strip .dll from library names.
23292         Fixes #22532.
23293
23294         * exception.h exception.c loader.h loader.c icall.c marshal.h marshal.c:
23295         Applied patch from Bernie Solomon  <bernard@ugsolutions.com>. Throw
23296         proper exceptions on DllImport problems.
23297
23298 Mon Jan 19 17:50:27 CET 2004 Paolo Molaro <lupus@ximian.com>
23299
23300         * class.c, metadata.c: eliminate CSIZE macro.
23301
23302 2004-01-19  Lluis Sanchez Gual  <lluis@ximian.com>
23303
23304         * icall.c: Added ves_icall_type_IsInstanceOf internal call.
23305         * object.h: Added async_callback field in MonoAsyncResult.
23306         * marshal.c: In mono_delegate_begin_invoke, set the value of async_callback.
23307         * verify.c: Added async_callback in MonoAsyncResult layout.
23308
23309 2004-01-17  Zoltan Varga  <vargaz@freemail.hu>
23310
23311         * reflection.c (mono_reflection_get_custom_attrs): Add support
23312         for Modules.
23313
23314 2004-01-16  Zoltan Varga  <vargaz@freemail.hu>
23315
23316         * marshal.c (mono_string_builder_to_utf8): Fix stringbuilder 
23317         marshalling.
23318         (mono_marshal_method_from_wrapper): Add null pointer check.
23319
23320 2004-01-16  Martin Baulig  <martin@ximian.com>
23321
23322         * debug-mono-symfile.h: Set version number to 36 and reflect
23323         latest symbol writer changes.
23324
23325 2004-01-16  Zoltan Varga  <vargaz@freemail.hu>
23326
23327         * class.c (mono_bounded_array_class_get): Set 'bounded' to FALSE for
23328         multi-dimensional arrays.
23329         (mono_class_is_assignable_from): Check vectors<->one dim. arrays.
23330         (mono_class_from_mono_type): Use bounded_array_class_get.
23331         
23332         * class.c (mono_bounded_array_class_get): New function which takes
23333         a 'bounded' bool argument to distinguish vectors from one dimensional
23334         arrays.
23335
23336         * icall.c (ves_icall_System_Array_CreateInstanceImpl): Call 
23337         bounded_array_class_get if the array has bounds.
23338
23339         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
23340         Search modules loaded using AssemblyBuilder:AddModule as well.
23341
23342 2004-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23343
23344         * appdomain.c: increased corlib version.
23345         * filewatcher.c: removed g_print.
23346         * icall.c:
23347         (get_property_info): only allocate what is actually requested.
23348         (ves_icall_Type_GetInterfaces): free the bitset in case of early error.
23349
23350 2004-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23351
23352         * Makefile.am: added filewatcher.[ch]
23353         * filewatcher.[ch]: FileSystemWatcher runtime support.
23354         * icall.c: added new FSW icalls.
23355
23356 Tue Jan 13 20:03:17 CET 2004 Paolo Molaro <lupus@ximian.com>
23357
23358         * string-icalls.c: fix stringbuilder regression as suggested by
23359         Iain McCoy <iain@mccoy.id.au>.
23360
23361 2004-01-13  Zoltan Varga  <vargaz@freemail.hu>
23362
23363         * process.c (process_read_stringtable_block): Recognize '007f' as
23364         a language neutral stringtable block.
23365
23366 2004-01-12  Patrik Torstensson
23367
23368         * object.h (MonoStringBuilder) : Changed layout to support our
23369         new stringbuilder class.
23370         * marshal.c: Change marshalling to support the new layout of 
23371         string builder.
23372         * appdomain.c: increased version number because new layout of
23373         string builder.
23374
23375 2004-01-12  Zoltan Varga  <vargaz@freemail.hu>
23376
23377         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Receive the
23378         assembly name as an string instead of an AssemblyName, since it is
23379         easier to extract info from it.
23380
23381         * appdomain.c (mono_domain_assembly_preload): Look for assemblies in
23382         the culture subdirectories too. Fixes #52231.
23383
23384 2004-01-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23385
23386         * icall.c: renamed ves_icall_Type_GetMethods to GetMethodsByName.
23387         It takes 2 new parameters with an optional name for the method to look
23388         for and case ignoring info.
23389
23390         * threadpool.c: removed unused variable.
23391
23392 2004-01-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23393
23394         * icall.c: renamed ves_icall_Type_GetProperties to GetPropertiesByName.
23395         It takes 2 new parameters with an optional name for the property to look
23396         for and case ignoring info.
23397         Fixes bug #52753.
23398
23399 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
23400
23401         * reflection.c: Applied patch from Benjamin Jemlich (pcgod@gmx.net).
23402         Fix #52451.
23403
23404 2004-01-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23405
23406         * appdomain.c:
23407         * assembly.c: escape the uri before passing it to g_filename_from_uri.
23408         Fixes bug #52630.
23409
23410 2004-01-07  Zoltan Varga  <vargaz@freemail.hu>
23411
23412         * reflection.c: Add support for more than one unmanaged resource.
23413
23414         * icall.c (ves_icall_get_enum_info): Store the value of the enum fields
23415         in field->def_value, as done in all other cases.
23416
23417         * reflection.c (mono_reflection_get_custom_attrs): Add support for
23418         TypeBuilders.
23419
23420         * reflection.c (mono_reflection_create_runtime_class): Remove 
23421         errorneous assignment to klass->element_class, since it is already
23422         done in mono_reflection_setup_internal_class.
23423
23424 2004-01-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23425
23426         * gc.c: added missing LeaveCriticalSection.
23427         * icall.c: indented a couple of lines.
23428         * threadpool.c: remove dangling LeaveCriticalSection. Don't wait forever
23429         if we call EndInvoke inside a callback. Fixes bug #52601.
23430
23431 2004-01-07  Martin Baulig  <martin@ximian.com>
23432
23433         * mono-debug-debugger.h
23434         (MonoDebuggerIOLayer): Added `GetCurrentThreadID'.
23435
23436 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
23437
23438         * appdomain.c: Use messages in NotImplementedException.
23439
23440         * exception.c (mono_get_exception_not_implemented): Now this takes
23441         a message argument.
23442
23443         * marshal.c (emit_str_to_ptr_conv): g_warning and throw an
23444         exception instead of g_asserting an aborting when something is not
23445         implemented.
23446
23447         Add some inline docs.
23448
23449 2004-01-05  Zoltan Varga  <vargaz@freemail.hu>
23450
23451         * reflection.h: Update after changes to object layout.
23452
23453         * reflection.c: Implement saving of unmanaged aka win32 resources.
23454
23455         * appdomain.c: Bump version number.
23456
23457         * appdomain.c (ves_icall_System_AppDomain_InternalSetDomainByID): 
23458         Handle missing domains gracefully.
23459
23460 2004-01-05  Atsushi Enomoto <atsushi@ximian.com>
23461
23462         * file-io.c : On Windows, there are much more invalid_path_chars.
23463
23464 Fri Jan 2 13:35:48 CET 2004 Paolo Molaro <lupus@ximian.com>
23465
23466         * class.h, object.c: prepare for GetType () speedup.
23467
23468 2003-12-24  Atsushi Enomoto <atsushi@ximian.com>
23469
23470         * profiler.c: workaround for --profile null reference exception on
23471           cygwin. Patch by Patrik Torstensson.
23472
23473 2003-12-22  Bernie Solomon  <bernard@ugsolutions.com>
23474
23475         * marshal.c: (ves_icall_System_Runtime_InteropServices_Marshal_Read/WriteXXX)
23476         make work for unaligned access.
23477
23478 Mon Dec 22 18:37:02 CET 2003 Paolo Molaro <lupus@ximian.com>
23479
23480         * class.c: small cleanup (class->fields [i] -> field).
23481         * image.c: check address of metadata is valid.
23482
23483 2003-12-22  Zoltan Varga  <vargaz@freemail.hu>
23484
23485         * assembly.h assembly.c (mono_assembly_loaded): New public function to
23486         search the list of loaded assemblies.
23487
23488         * reflection.c (mono_reflection_type_from_name): Use 
23489         mono_assembly_loaded instead of mono_image_loaded.
23490
23491         * reflection.c: Fix warnings.
23492
23493 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
23494
23495         * image.h (MonoImage): Add a new 'dynamic' field to denote that the image 
23496         is dynamic. This is needed since an assembly can contain both dynamic and
23497         non-dynamic images.
23498
23499         * class.c loader.c metadata.c object.c: Use image->dynamic instead of 
23500         assembly->dynamic.
23501
23502         * icall.c reflection.c: Add new AssemblyBuilder:AddModule icall.
23503
23504         * reflection.h (MonoReflectionAssemblyBuilder): Add 'loaded_modules' field
23505         to store modules loaded using AddModule.
23506
23507         * reflection.c (mono_image_fill_file_table): Generalize this so it works
23508         on Modules.
23509
23510         * reflection.c (mono_image_fill_export_table_from_class): New helper function.
23511
23512         * reflection.c (mono_image_fill_export_table_from_module): New function to
23513         fill out the EXPORTEDTYPES table from a module.
23514
23515         * reflection.c (mono_image_emit_manifest): Refactor manifest creation code
23516         into a separate function. Also handle loaded non-dynamic modules.
23517
23518         * reflection.c (mono_image_basic_init): Fix memory allocation.
23519
23520         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
23521
23522         * assembly.c (mono_assembly_load_references): Make this public.
23523
23524 2003-12-19  Martin Baulig  <martin@ximian.com>
23525
23526         * class.c (mono_class_initialize_generic): Made this static, take
23527         a `MonoGenericInst *' instead of a `MonoClass *'.
23528         (mono_class_from_generic): Call mono_class_initialize_generic()
23529         unless we're already initialized or being called from
23530         do_mono_metadata_parse_generic_inst().
23531
23532         * class.h (MonoGenericInst): Added `initialized' and
23533         `init_pending' flags.
23534
23535         * metadata.c (do_mono_metadata_parse_generic_inst): Don't call
23536         `mono_class_init (gklass)' or mono_class_initialize_generic()
23537         here; set `generic_inst->init_pending' while parsing the
23538         `type_argv'.
23539
23540 2003-12-19  Bernie Solomon  <bernard@ugsolutions.com>
23541
23542         * locales.c: include string.h for memxxx prototypes
23543
23544 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
23545
23546         * icall.c (ves_icall_MonoField_GetValueInternal): Do not run the class
23547         constructor when accessing literal fields.
23548
23549 2003-12-17  Zoltan Varga  <vargaz@freemail.hu>
23550
23551         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
23552
23553         * reflection.c (assembly_add_resource_manifest): New function to fill
23554         the MANIFESTRESOURCE table.
23555
23556         * reflection.c (mono_image_build_metadata): Emit MANIFESTRESOURCE table.
23557
23558         * reflection.h: Update to changes in class layout.
23559
23560         * icall.c (ves_icall_System_Environment_get_HasShutdownStarted): 
23561         Reenable call to mono_runtime_is_shutting_down ().
23562
23563         * appdomain.c (mono_runtime_is_shutting_down): New helper function to
23564         determine if the runtime is shutting down.
23565
23566 2003-12-16  Jackson Harper <jackson@ximian.com>
23567
23568         * icall.c: comment out call to mono_runtime_is_shutting_down to
23569         fix build.
23570         
23571 2003-12-16  Zoltan Varga  <vargaz@freemail.hu>
23572
23573         * icall.c (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal): Add support for loading resources from modules.
23574         (ves_icall_System_Environment_get_HasShutdownStarted): New icall.
23575
23576 2003-12-15  Bernie Solomon  <bernard@ugsolutions.com>
23577
23578         * reflection.c: move definition of swap_with_size
23579         to before its first call
23580
23581 2003-12-15  Zoltan Varga  <vargaz@freemail.hu>
23582
23583         * appdomain.c (mono_runtime_is_shutting_down): New public function.
23584
23585         * icall.c (ves_icall_System_Environment_get_HasShutdownStarted): New
23586         icall.
23587
23588         * object.c: Fix warnings.
23589
23590         * icall.c (ves_icall_Type_Get...): Only consider inherited static
23591         members if FlattenHierarchy is set.
23592
23593         * reflection.c (mono_image_add_decl_security): New function to emit
23594         declarative security.
23595
23596         * reflection.h reflection.c: Add support for declarative security.
23597
23598         * appdomain.c (MONO_CORLIB_VERSION): Bump version number.
23599         
23600 2003-12-13  Zoltan Varga  <vargaz@freemail.hu>
23601
23602         appdomain.c (MONO_CORLIB_VERSION): Bump version number.
23603         
23604         * appdomain.c verify.c: Moved corlib version checking into its own
23605         function in appdomain.c since it needs to create vtables etc.
23606
23607 2003-12-13  Patrik Torstensson <p@rxc.se>
23608
23609         * marshal.c (mono_remoting_wrapper): Fix bug 48015, using TP as this 
23610         instead of unwrapped server.
23611
23612 2003-12-12  Zoltan Varga  <vargaz@freemail.hu>
23613
23614         * verify.c (check_corlib): Fix field index.
23615
23616 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
23617
23618         * icall.c: Applied patch from Todd Berman (tbermann@gentoo.org). New
23619         GetGacPath icall.
23620
23621 2003-12-10  Bernie Solomon  <bernard@ugsolutions.com>
23622
23623         * process.c:  (ves_icall_System_Diagnostics_Process_GetWorkingSet_internal
23624         ves_icall_System_Diagnostics_Process_SetWorkingSet_internal):
23625         cope with sizeof(size_t) != sizeof(guint32).
23626
23627 2003-12-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23628
23629         * process.[ch]: the 'pid' field in MonoProcInfo stores GetLastError
23630         in case of failure.
23631
23632 2003-12-10  Mark Crichton <crichton@gimp.org>
23633
23634         * icall.c: removed the GetNonZeroBytes.  We now handle this case
23635         in managed code.
23636
23637         * rand.c, rand.h: Same here.  Also cleaned up the clode slightly.
23638
23639 Tue Dec 9 15:36:18 CET 2003 Paolo Molaro <lupus@ximian.com>
23640
23641         * class.h, class.c, icall.c, marshal.c, object.c: ignore fields
23642         marked as deleted.
23643
23644 2003-12-09  Zoltan Varga  <vargaz@freemail.hu>
23645
23646         * verify.c (check_corlib): Handle the case when the version field is 
23647         initialized by a static constructor.
23648
23649 2003-12-08  Patrik Torstensson  <p@rxc.se>
23650
23651     * rand.c (InternalGetBytes): Implemented win32 version with cryptapi
23652
23653 2003-12-08  Martin Baulig  <martin@ximian.com>
23654
23655         * icall.c (ves_icall_TypeBuilder_define_generic_parameter): Return
23656         a MonoReflectionGenericParameter, also take the parameter index
23657         and name as arguments.
23658         (ves_icall_MethodBuilder_define_generic_parameter): Likewise.
23659         (ves_icall_MonoGenericParam_initialize): New interncall.
23660         (ves_icall_Type_make_byref_type): New interncall.
23661
23662         * reflection.h (MonoReflectionGenericParam): Derive from
23663         MonoReflectionType, not just from MonoObject.  Added `refobj' and
23664         `index' fields.
23665
23666         * reflection.c (mono_reflection_define_generic_parameter): Create
23667         and return a new MonoReflectionGenericParam; don't initialize the
23668         constraints here.
23669         (mono_reflection_initialize_generic_parameter): New public method;
23670         initializes the constraints and creates the `param->pklass'.
23671
23672 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
23673
23674         * reflection.h reflection.c: Use the new fields 'num_types', 
23675         'num_fields' and 'num_methods' to track the number of types etc.
23676
23677         * verify.c (check_corlib): Check corlib version number.
23678
23679 2003-12-07  Zoltan Varga  <vargaz@freemail.hu>
23680
23681         * marshal.c (mono_marshal_method_from_wrapper): Remove assert so this
23682         function works on all methods.
23683
23684 2003-12-07  Lluis Sanchez Gual  <lluis@ximian.com>
23685
23686         * domain.c, loader.h: Added IRemotingTypeInfo interface in MonoDefaults.
23687         * icall.c: in, ves_icall_Remoting_RealProxy_GetTransparentProxy set
23688         the custom_type_info flag of the transparent proxy.
23689         * object.c: Added method mono_object_isinst_mbyref for casting mbyref
23690         objects that supports IRemotingTypeInfo.
23691         * object.h: Added custom_type_info field in transparent proxy.
23692
23693 2003-12-06  Martin Baulig  <martin@ximian.com>
23694
23695         * class.c (mono_class_create_from_generic): Removed.
23696         (mono_class_from_generic): Check `ginst->klass' before doing
23697         anything else.  This is important to fully support "recursive"
23698         generic types.
23699
23700         * metadata.c (do_mono_metadata_parse_generic_inst): Create an
23701         empty `generic_inst->klass' before doing anything else.
23702
23703 2003-12-06  Dick Porter  <dick@ximian.com>
23704
23705         * verify.c: 
23706         * object.h:
23707         * icall.c:
23708         * locales.c: Use C structs to access class fields.  Don't do a
23709         conversion between MonoString and UChar because both are
23710         platform-endian UTF-16.  Compare now takes startindex and count
23711         parameters.  Add a char overload for IndexOf.  Speed up the
23712         invariant string IndexOf.
23713
23714 2003-12-05  Zoltan Varga  <vargaz@freemail.hu>
23715
23716         * Makefile.am (monosn_LDADD): Fix parallel build.
23717
23718 2003-12-04  Martin Baulig  <martin@ximian.com>
23719
23720         * icall.c
23721         (ves_icall_type_GetTypeCode): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
23722         (ves_icall_Type_make_array_type): New interncall.       
23723
23724 2003-12-04  Martin Baulig  <martin@ximian.com>
23725
23726         * locales.c: also change it in the !HAVE_ICU case.
23727
23728 2003-12-04  Dick Porter  <dick@ximian.com>
23729
23730         * icall.c:
23731         * locales.c: construct_compareinfo is now in CompareInfo, not
23732         CultureInfo.
23733
23734 2003-12-04  Zoltan Varga  <vargaz@freemail.hu>
23735
23736         * image.c (mono_image_load_file_for_image): Cache loaded images in the
23737         image->files array.
23738
23739         * image.c (load_class_name): Load class names from the EXPORTEDTYPES
23740         table as well.
23741
23742         * assembly.c (mono_assembly_load_references): Only load references
23743         once.
23744
23745         * class.c (mono_class_from_name): Avoid linear search of the 
23746         EXPORTEDTYPE table.
23747
23748         * loader.c (mono_field_from_token): Cache lookups of fieldrefs as well.
23749
23750 2003-12-03  Zoltan Varga  <vargaz@freemail.hu>
23751
23752         * image.h (MonoImage): Add 'field_cache' field.
23753
23754         * loader.c (mono_field_from_token): Cache field lookups.
23755         
23756         * reflection.c (mono_module_get_object): Fix name property.
23757
23758         * icall.c (ves_icall_get_enum_info): Update after changes to 
23759         mono_metadata_get_constant_index ().
23760
23761         * icall.c: Get rid of get_type_info icall, use a separate icall for
23762         each type property to avoid needless memory allocations. Fixes #51514.
23763
23764         * metadata.c (mono_metadata_get_constant_index): Add a 'hint' parameter
23765         to avoid needless binary searches.
23766
23767         * class.c (class_compute_field_layout): Move the initialization of
23768         field->def_value to mono_class_vtable ().
23769
23770         * class.c (mono_class_layout_fields): Enable GC aware auto layout for
23771         non-corlib types.
23772
23773         * object.c (mono_object_allocate): Make it inline.
23774
23775         * object.c (mono_object_allocate_spec): Make it inline.
23776         
23777 2003-12-02  Dick Porter  <dick@ximian.com>
23778
23779         * locales.c (create_NumberFormat): NumberFormatInfo construction.
23780         Patch by Mohammad DAMT (mdamt@cdl2000.com).
23781
23782 2003-12-01  Dick Porter  <dick@ximian.com>
23783
23784         * threads.c: Fix signature and call in CreateMutex and
23785         CreateEvent.
23786
23787 2003-12-01  Dick Porter  <dick@ximian.com>
23788
23789         * icall.c: 
23790         * locales.c: Implement string compares and searching
23791
23792         * object.h: Add extra Thread field
23793
23794 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
23795
23796         * reflection.c (fixup_method): Add support for MonoCMethod.
23797
23798 2003-11-28  Zoltan Varga  <vargaz@freemail.hu>
23799
23800         * gc.c: Fix hangs and error messages when GC_DONT_GC is set.
23801
23802         * reflection.c (assembly_name_to_aname): Allow extra characters in
23803         assembly names. Fixes #51468.
23804
23805 2003-11-26  Zoltan Varga  <vargaz@freemail.hu>
23806
23807         * exception.c (mono_exception_from_name_domain): New helper function.
23808
23809         * appdomain.c (ves_icall_System_AppDomain_createDomain): Create the
23810         exception object in the correct domain.
23811
23812         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw): Fix 
23813         formatting + make a copy a the input data.
23814
23815         * loader.c (mono_get_method_from_token): Methods which contain
23816         native code do not have entries in the ImplMap.
23817
23818         (ves_icall_System_AppDomain_LoadAssemblyRaw): Fix exception throw.
23819         Thanks to Gonzalo for spotting this.
23820         
23821         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw): Applied
23822         patch from ztashev@openlinksw.co.uk (Zdravko Tashev). New icall.
23823
23824         * assembly.h (mono_assembly_load_from): Split the second part of 
23825         assembly loading into a new public function.
23826
23827         * exception.h (mono_get_exception_bad_image_format): New function.
23828
23829 2003-11-24  Zoltan Varga  <vargaz@freemail.hu>
23830
23831         icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
23832         Enumerate all modules inside a dynamic assembly. Fixes #51293.
23833         
23834         * icall.c: Add new icall for creating dynamic methods.
23835
23836         * loader.h debug-helpers.c: Add new wrapper type for dynamic methods.
23837
23838         * reflection.h (MonoReflectionDynamicMethod): Fix type of bool fields.
23839
23840         * reflection.c (mono_reflection_create_dynamic_method): New icall to
23841         create a dynamic method.
23842
23843         * reflection.c (resolve_object): New helper function.
23844
23845         * reflection.c: Generalize ReflectionMethodBuilder and the functions
23846         which manipulate it so they can also work on dynamic methods.
23847
23848         * reflection.c (reflection_method_builder_to_mono_method): Avoid 
23849         creating the MonoReflectionMethodAux structure if it is not needed.
23850         
23851         * reflection.h verify.c: Update after changes to object layout.
23852
23853         * reflection.c (method_builder_encode_signature): Fix compilation on
23854         gcc 2.95.x.
23855
23856 2003-11-21  Lluis Sanchez Gual  <lluis@ximian.com>
23857
23858         * appdomain.h: Added support for context static fields. Added static_data
23859           field to MonoAppContext and renamed thread_static_fields to a more
23860           generic special_static_fields in MonoAppDomain, since it can now contain
23861           context static fields.
23862         * domain.c: Updated hashtable name.
23863         * object.c: Replaced field_is_thread_static() for a more generic
23864           field_is_special_static() which also checks for context static attribute.
23865           In mono_class_vtable(), added support for static context fields.
23866         * threads.c: Changed methods that manage thread static fields to more
23867           generic methods so they can be reused both for thread and context static
23868           data.
23869         * threads.h: Declared some new methods.
23870
23871 2003-11-21  Zoltan Varga  <vargaz@freemail.hu>
23872
23873         * reflection.h: Update after changes to the managed types.
23874
23875         * reflection.c (encode_custom_modifiers): New helper function.
23876
23877         * reflection.c (method_encode_signature): Emit custom modifiers.
23878
23879         * reflection.c (field_encode_signature): Emit custom modifiers.
23880
23881 2003-11-18  Zoltan Varga  <vargaz@freemail.hu>
23882
23883         * reflection.h (MonoReflectionAssemblyName): Applied patch from Laurent Morichetti (l_m@pacbell.net). Fix type of 'flags' field.
23884
23885         * icall.c (ves_icall_System_ValueType_Equals): New optimized 
23886         implementation.
23887
23888         * icall.c (ves_icall_System_ValueType_InternalGetHashCode): New 
23889         icall.
23890
23891         * object.c (mono_field_get_value_object): New function.
23892
23893         * object.c appdomain.h appdomain.c: Make out_of_memory_ex domain
23894         specific.
23895
23896 2003-11-17  Zoltan Varga  <vargaz@freemail.hu>
23897
23898         * appdomain.c (mono_runtime_get_out_of_memory_ex): New function to
23899         return a preallocated out-of-memory exception instance.
23900
23901         * object.c (out_of_memory): Use the new function.
23902
23903         * metadata.c (mono_metadata_parse_type): Handle the case when the byref
23904         flag is before the custom modifiers. Fixes #49802.
23905
23906 2003-11-16  Martin Baulig  <martin@ximian.com>
23907
23908         * class.c (mono_class_is_open_constructed_type): Implemented the
23909         MONO_TYPE_GENERICINST case.
23910
23911 2003-11-16  Zoltan Varga  <vargaz@freemail.hu>
23912
23913         * assembly.c (mono_assembly_fill_assembly_name): New function to
23914         fill out the MonoAssemblyName structure.
23915         (mono_assembly_open): Use the new function.
23916
23917         * icall.c (fill_reflection_assembly_name): New helper function.
23918
23919         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Use the
23920         new function.
23921
23922         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): New icall.
23923
23924 2003-11-15  Martin Baulig  <martin@ximian.com>
23925
23926         * class.c (mono_class_is_open_constructed_type): New public
23927         function; checks whether a type is an open constructed type,
23928         ie. whether it still contains type parameters.
23929         (mono_class_inflate_generic_type): If we're a type parameter and
23930         the inflated type is also a MONO_TYPE_(M)VAR, return the original
23931         type.
23932
23933         * class.h (MonoGenericInst): Added `guint32 is_open'.
23934
23935         * loader.c (method_from_methodspec): Check whether we're an open
23936         or closed constructed type and set `ginst->is_open'.
23937
23938         * reflection.c (mono_reflection_bind_generic_parameters): Check
23939         whether we're an open or closed constructed type and set
23940         `ginst->is_open'.
23941         (mono_reflection_inflate_method_or_ctor): Don't inflate methods
23942         from open constructed types.
23943
23944 2003-11-15  Martin Baulig  <martin@ximian.com>
23945
23946         * reflection.c (mono_reflection_bind_generic_parameters): If we're
23947         a generic instance (instead of a generic type declaration) with
23948         unbound generic parameters, bind them to our actual types.
23949
23950 2003-11-14  Martin Baulig  <martin@ximian.com>
23951
23952         * reflection.h (MonoReflectionGenericInst): Added `MonoArray *interfaces'.
23953
23954         * reflection.c (mono_reflection_bind_generic_parameters): If we're
23955         an interface type, populate `res->interfaces' with instantiated
23956         versions of all the interfaces we inherit.
23957
23958 2003-11-13  Aleksey Demakov  <avd@openlinksw.com>
23959
23960         * assembly.c (mono_assembly_load): Fixed problem finding mscorlib.dll
23961         when MONO_PATH is set but doesn't contain the install dir.
23962
23963 2003-11-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23964
23965         * icall.c:
23966         (ves_icall_Type_GetInterfaces): don't return an interface twice when
23967         it's also implemented in base classes. Fixes bug #50927.
23968
23969 2003-11-13  Zoltan Varga  <vargaz@freemail.hu>
23970
23971         * gc.c (ves_icall_System_GC_WaitForPendingFinalizers): Avoid deadlocks
23972         if this method is called from a finalizer. Fixes #50913.
23973
23974 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
23975
23976         * threads.c: Implement VolatileRead/VolatileWrite
23977
23978         * icall.c: Add new icalls for VolatileRead/VolatileWrite
23979
23980 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
23981
23982         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Applied 
23983         patch from Danilo Sagan (dsegan@gmx.net). Fix compilation under gcc
23984         2.95.3.
23985
23986         * assembly.c (mono_assembly_open): Fix windows build. Applied patch 
23987         from Peter Ross (pro@missioncriticalit.com).
23988         
23989 2003-11-12  Lluis Sanchez Gual  <lluis@ximian.com>
23990
23991         * icall.c: Added internal call for System.Environment::GetMachineConfigPath
23992
23993 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
23994
23995         * assembly.c (mono_assembly_load_references): Disable check because it
23996         triggers on older corlibs which lots of people have.
23997
23998 2003-11-12  Jackson Harper  <jackson@ximian.com>
23999
24000         * assembly.c: Change corlib name to mscorlib. Add a temp. hack to
24001         load corlib.dll if mscorlib.dll is not found.
24002         * assembly.h: Remove corlib name define.
24003         * class.c:
24004         * domain.c:
24005         * image.c: Change corlib name to mscorlib.
24006         
24007 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
24008
24009         * debug-mono-symfile.c: Add patch from FreeBSD ports tree.
24010
24011 2003-11-11  Miguel de Icaza  <miguel@ximian.com>
24012
24013         * appdomain.h: Added loader_optimization here to sync with the C#
24014         code, and add disallow_binding_redirects field.
24015
24016 2003-11-11  Zoltan Varga  <vargaz@freemail.hu>
24017
24018         * mono-debug.c (mono_debug_add_method): Ignore unknown modules.
24019
24020         * reflection.c (mono_image_build_metadata): Fix crash on modules
24021         with no types.
24022
24023         * reflection.h (MonoMethodInfo): Track changes to the managed structure.
24024
24025         * icall.c (ves_icall_get_method_info): Return callingConvention as
24026         well.
24027
24028         * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces): Add 
24029         namespaces from the EXPORTEDTYPE table as well.
24030
24031         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Merge types
24032         from all modules inside the assembly.
24033         
24034 2003-11-11  Martin Baulig  <martin@ximian.com>
24035
24036         * reflection.c (mono_reflection_bind_generic_parameters): Make
24037         this work for interfaces.
24038
24039 2003-11-11  Martin Baulig  <martin@ximian.com>
24040
24041         * mono-debug.c (mono_debug_add_type): Ignore unknown modules.
24042
24043 2003-11-11  Martin Baulig  <martin@ximian.com>
24044
24045         * reflection.c (mono_reflection_inflate_method_or_ctor): Allow
24046         "MonoInflatedMethod" and "MonoInflatedCtor".
24047
24048 2003-11-11  Zoltan Varga  <vargaz@freemail.hu>
24049
24050         * reflection.c (resolution_scope_from_image): Use the assembly table
24051         from the manifest module, since other modules don't have it.
24052
24053         * debug-helpers.c (mono_type_full_name): New helper function.
24054
24055         * image.h (MonoAssembly): Change 'dynamic' to a boolean.
24056
24057         * image.c (mono_image_load_file_for_image): New public function which
24058         is a replacement for the load_file_for_image in class.c.
24059
24060         * assembly.c (mono_assembly_load_module): A wrapper for the function
24061         above which does assembly association and reference loading too.
24062
24063         * class.c (mono_class_from_name): Call mono_assembly_load_module.
24064
24065 2003-11-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24066
24067         * appdomain.c: not all of the attributes for the full assembly name
24068         are required and the order doesn't matter. Fixes bug #50787.
24069
24070 2003-11-10  Dick Porter  <dick@ximian.com>
24071
24072         * locales.c: Use platform-endian UTF16
24073
24074 2003-11-10  Zoltan Varga  <vargaz@freemail.hu>
24075
24076         * reflection.c: Emit FILE and EXPORTEDTYPE tables.
24077         
24078 2003-11-10  Martin Baulig  <martin@ximian.com>
24079
24080         * metadata.c
24081         (mono_metadata_load_generic_params): Make this actually work.
24082
24083         * reflection.c (mono_reflection_bind_generic_parameters): If our
24084         parent is a generic instance, pass all the `types' to it, no
24085         matter whether it has the same number of type parameters or not.
24086
24087 2003-11-10  Zoltan Varga  <vargaz@freemail.hu>
24088
24089         * reflection.c: Emit FILE and EXPORTEDTYPE tables.
24090
24091         * assembly.c (mono_assembly_load_references): Move the image<->assembly
24092         assignment code to this function so it gets called recursively for all
24093         modules.
24094
24095         * image.c (load_modules): Remove the assembly assignment since it is
24096         now done by mono_assembly_load_references.
24097         
24098         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
24099         Add 'module' argument.
24100         (mono_module_get_types): New helper function.
24101         (ves_icall_System_Reflection_Module_InternalGetTypes): New icall.
24102
24103 2003-11-08  Martin Baulig  <martin@ximian.com>
24104
24105         * class.c (mono_class_inflate_generic_method): Interface method
24106         don't have a header.
24107
24108         * reflection.c (mono_image_get_methodspec_token): Take an
24109         additional `MonoGenericInst *' argument instead of reading it from
24110         the header; this is necessary to support interfaces.
24111         (mono_image_create_token): Pass the `MonoGenericInst *' from the
24112         MonoReflectionInflatedMethod to mono_image_get_methodspec_token().
24113         (inflated_method_get_object): Take an additional `MonoGenericInst *'
24114         argument.
24115
24116         * reflection.h (MonoReflectionInflatedMethod): Added
24117         `MonoGenericInst *ginst'.
24118
24119 2003-11-07  Zoltan Varga  <vargaz@freemail.hu>
24120
24121         * gc.c (mono_domain_finalize): Fix compilation for no GC case.
24122
24123 2003-11-06  Zoltan Varga  <zovarga@ws-zovarga2>
24124
24125         * appdomain.c (mono_domain_unload): Add a workaround for bug #27663.
24126
24127 2003-11-06  Zoltan Varga  <vargaz@freemail.hu>
24128
24129         * reflection.c 
24130         (reflection_methodbuilder_from_method_builder):
24131         (reflection_methodbuilder_from_ctor_builder): New helper functions to 
24132         initialize a ReflectionMethodBuilder structure.
24133         (mono_image_get_methodbuilder_token):
24134         (mono_image_get_ctorbuilder_token): New functions to emit memberref
24135         tokens which point to types in another module inside the same assembly.
24136
24137         * reflection.c: Use the new helper functions.
24138         
24139         * reflection.c (mono_image_basic_init): Initialize basedir and culture.
24140
24141         * icall.c loader.c reflection.c: Use ModuleBuilder->dynamic_image 
24142         instead of AssemblyBuilder->dynamic_assembly in the appropriate places.
24143
24144         * reflection.c (resolution_scope_from_image): Emit a moduleref if
24145         neccesary.
24146
24147         * reflection.c (mono_image_build_metadata): Emit metadata only for the
24148         current module. Emit the manifest only for the main module.
24149
24150         * reflection.c (mono_image_create_token): Add assertion when a 
24151         memberref needs to be created.
24152
24153         * reflection.c reflection.h (MonoDynamicAssembly): Remove unused fields.
24154
24155         * reflection.c (mono_reflection_get_custom_attrs_blob): Allocate a 
24156         larger buffer for the custom attribute blob. Fixes #50637.
24157         
24158 2003-11-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24159
24160         * threadpool.c: notify listener on async processing handles after
24161         invoking the async callback. Thanks to Zoltan.
24162
24163 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
24164
24165         * reflection.c (create_dynamic_mono_image): Call mono_image_init to 
24166         avoid code duplication.
24167
24168         * reflection.h (MonoDynamicImage): New type which is currently unused,
24169         but will be used through the ref.emit code in place of 
24170         MonoDynamicAssembly.
24171
24172         * reflection.h (MonoReflectionAssemblyBuilder): Track changes to the
24173         object layout.
24174
24175         * reflection.c (create_dynamic_mono_image): Rewrote so it now creates
24176         a MonoDynamicImage instead of just a MonoImage.
24177         
24178         * reflection.h reflection.c icall.c: Move nearly all AssemblyBuilder
24179         icalls to ModuleBuilder but keep their semantics, so they will work
24180         with moduleb->assemblyb. This will change later.
24181         
24182 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
24183
24184         * reflection.h (MonoReflectionAssemblyBuilder): Track changes to the
24185         object layout.
24186
24187         * reflection.c (mono_image_build_metadata): Avoid creation of a default
24188         main module, since it is now done by the managed code.
24189
24190 2003-11-03  Martin Baulig  <martin@ximian.com>
24191
24192         * reflection.c (mono_reflection_inflate_method_or_ctor): Set
24193         `ginst->klass' here.
24194         (method_encode_methodspec): Don't use the `ginst->generic_method's
24195         klass if it's a generic instance, use `ginst->klass' in this case.
24196
24197 2003-11-03  Martin Baulig  <martin@ximian.com>
24198
24199         * reflection.c (mono_image_get_generic_method_param_info):
24200         Removed, use mono_image_get_generic_param_info() instead.
24201         (mono_image_get_type_info): Write the GenericParam table before
24202         the Method table.  This is neccessary because in the GenericParam
24203         table, type parameters of the class (ie. '!0' etc.) must come
24204         before the ones from its generic methods (ie. '!!0' etc).
24205
24206 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
24207
24208         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Fill out AssemblyName->codebase. Fixes #50469.
24209
24210 2003-11-02  Martin Baulig  <martin@ximian.com>
24211
24212         * reflection.c (create_generic_typespec): Take a
24213         `MonoReflectionTypeBuilder *' instead of a `MonoType *' and get
24214         the generic parameters from it.
24215
24216 2003-11-02  Martin Baulig  <martin@ximian.com>
24217
24218         * reflection.c (fieldref_encode_signature): Take a `MonoType *'
24219         instead of a `MonoClassField *' since we just need the type.
24220         (create_generic_typespec): New static function.  Creates a
24221         TypeSpec token for a generic type declaration.
24222         (mono_image_get_generic_field_token): New static function.
24223         (mono_image_create_token): If we're a FieldBuilder in a generic
24224         type declaration, call mono_image_get_generic_field_token() to get
24225         the token.
24226
24227 2003-11-02  Martin Baulig  <martin@ximian.com>
24228
24229         * reflection.h
24230         (MonoReflectionInflatedMethod, MonoReflectionInflatedField): Added
24231         `MonoReflectionGenericInst *declaring_type' and
24232         `MonoReflectionGenericInst *reflected_type' fields.
24233
24234         * reflection.c (mono_reflection_inflate_method_or_ctor): Take a
24235         `MonoReflectionGenericInst *declaring_type' and a
24236         `MonoReflectionGenericInst *reflected_type' argument instead of a
24237         single `MonoReflectionGenericInst *type' one.  Set
24238         `res->declaring_type' and `res->reflected_type' from them.
24239         (mono_reflection_inflate_field): Likewise.      
24240
24241 2003-11-02  Martin Baulig  <martin@ximian.com>
24242
24243         * class.c (mono_class_setup_vtable): Don't store generic methods
24244         in the vtable.  
24245
24246 2003-11-02  Martin Baulig  <martin@ximian.com>
24247
24248         * reflection.h (MonoReflectionGenericInst): Added
24249         `MonoReflectionType *declaring_type'.
24250
24251         * reflection.c (mono_reflection_bind_generic_parameters): Use
24252         `if (tb->parent)' instead of `klass->parent'.
24253
24254 2003-11-01  Zoltan Varga  <vargaz@freemail.hu>
24255
24256         * assembly.c (mono_assembly_open): Avoid crash if a module is loaded
24257         with an empty ASSEMBLY table.
24258
24259         * reflection.c (mono_image_build_metadata): Avoid using the same loop
24260         variable in the inner and outer loops.
24261
24262 2003-10-31  Zoltan Varga  <vargaz@freemail.hu>
24263
24264         * metadata.h (mono_metadata_make_token): Put parentheses around macro
24265         argument.
24266
24267         * appdomain.h appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRef): Fix signature.
24268         
24269         * appdomain.c appdomain.h icall.c: Get rid of the InvokeInDomain 
24270         icalls. Instead, do everything in managed code. This is needed since
24271         it is hard to restore the original domain etc. in unmanaged code in the
24272         presence of undeniable exceptions.
24273
24274         * appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRef): 
24275         New icalls to push and pop appdomain refs.
24276
24277 2003-10-31  Martin Baulig  <martin@ximian.com>
24278
24279         * class.c (inflate_generic_type): Renamed to
24280         mono_class_inflate_generic_type() and made it public.
24281
24282         * icall.c ("System.Reflection.MonoGenericInst::inflate_field"):
24283         New interncall.
24284
24285         * loader.c (mono_field_from_memberref): Also set the retklass for
24286         typespecs.
24287
24288         * fielder.c (mono_image_get_inflated_field_token): New static
24289         method; creates a metadata token for an inflated field.
24290         (mono_image_create_token, fixup_method): Added support for
24291         "MonoInflatedField".
24292         (fieldbuilder_to_mono_class_field): New static function.
24293         (mono_reflection_inflate_field): New public function.
24294
24295         * reflection.h
24296         (MonoReflectionGenericInst): Added `MonoArray *fields'.
24297         (MonoReflectionInflatedField): New typedef.     
24298
24299 2003-10-30  Bernie Solomon  <bernard@ugsolutions.com>
24300
24301         * socket-io.c (in6_addr ipaddress_to_struct_in6_addr): fix
24302         for Solaris and other platforms without s6_addr16
24303
24304 2003-10-30  Martin Baulig  <martin@ximian.com>
24305
24306         * class.c (inflate_generic_type): Take just one `MonoGenericInst *'
24307         argument instead of two.
24308         (mono_class_inflate_generic_signature): Likewise.
24309         (inflate_generic_header): Likewise.
24310         (mono_class_inflate_generic_method): Likewise.  In addition, if
24311         `ginst->klass' is set, it becomes the new `method->klass'.
24312
24313         * class.h (MonoGenericInst): Removed the `gpointer mbuilder'
24314         field.
24315
24316         * reflection.c (encode_generic_method_sig): Write a 0xa as the
24317         first byte. [FIXME]
24318         (method_encode_methodspec): If we have generic parameters, create
24319         a MethodSpec instead of a MethodRef.
24320         (fixup_method): Added support for "MonoInflatedMethod" and
24321         "MonoInflatedCtor".
24322         (mono_image_create_token): Added support for "MonoInflatedMethod"
24323         and "MonoInflatedCtor".
24324         (inflated_method_get_object): New static function; returns a
24325         managed "System.Reflection.MonoInflatedMethod" object.
24326         (mono_reflection_bind_generic_method_parameters): Return a
24327         `MonoReflectionInflatedMethod' instead of a `MonoReflectionMethod'.
24328         (mono_reflection_inflate_method_or_ctor): Likewise.
24329         (mono_image_get_generic_method_param_info): Initialize unused
24330         fields to zero.
24331         (mono_image_get_generic_param_info): Likewise.
24332
24333         * reflection.h (MonoReflectionInflatedMethod): New public
24334         typedef.  Corresponds to the managed "S.R.MonoInflatedMethod" and
24335         "S.R.MonoInflatedCtor" classes.
24336
24337         * loader.c (method_from_memberref): If we're a TypeSpec and it
24338         resolves to a generic instance, inflate the method.
24339
24340 2003-10-28  Dick Porter  <dick@ximian.com>
24341
24342         * object.c (mono_runtime_run_main): Convert command-line arguments
24343         into utf8, falling back to the user's locale encoding to do so.
24344
24345 2003-10-27  Zoltan Varga  <vargaz@freemail.hu>
24346
24347         * loader.c (mono_get_method_from_token): Avoid looking up the icalls
24348         at this time.
24349
24350         * marshal.c (mono_marshal_get_native_wrapper): Lookup icalls here.
24351
24352         * reflection.c (reflection_methodbuilder_to_mono_method): Avoid looking
24353         up icalls at method definition time. Partially fixes #33569.
24354
24355 2003-10-25  Zoltan Varga  <vargaz@freemail.hu>
24356
24357         * marshal.c (mono_marshal_get_native_wrapper): Add support for [Out]
24358         marshalling of arrays. Fixes #50116.
24359
24360         * appdomain.c (ves_icall_System_AppDomain_InternalIsFinalizingForUnload): New icall.
24361
24362         * appdomain.c (unload_thread_main): Clear class->cached_vtable if it
24363         points to a vtable in the dying appdomain.
24364
24365         * appdomain.c (mono_domain_unload): Move the notification of OnUnload
24366         listeners into unmanaged code inside the lock.
24367
24368         * object.c (mono_class_vtable): Turn off typed allocation in non-root
24369         domains and add some comments.
24370
24371 2003-10-25  Martin Baulig  <martin@ximian.com>
24372
24373         * class.h (MonoGenericInst): Added `MonoClass *klass' field.
24374
24375         * image.h (MonoImage): Added `GHashTable *typespec_cache'.
24376
24377         * metadata.c (mono_metadata_parse_generic_inst): Renamed to
24378         `do_mono_metadata_parse_generic_inst'; pass it the MonoType we're
24379         currently parsing.  Create the generic class and store it in
24380         `generic_inst->klass' before parsing the type arguments.  This is
24381         required to support "recursive" definitions; see mcs/tests/gen-23.cs
24382         for an example.
24383         (mono_type_create_from_typespec): Use a new `image->typespec_cache'
24384         to support recursive typespec entries.
24385
24386         * class.c (mono_class_setup_parent): If our parent is a generic
24387         instance, we may get called before it has its name set.
24388         (mono_class_from_generic): Splitted into
24389         mono_class_create_from_generic() and mono_class_initialize_generic().
24390
24391 2003-10-25  Martin Baulig  <martin@ximian.com>
24392
24393         * icall.c (ves_icall_Type_BindGenericParameters): Return a
24394         `MonoReflectionGenericInst *' instead of a `MonoReflectionType *'.
24395         ("System.Reflection.MonoGenericInst::inflate_method"): New interncall.
24396         ("System.Reflection.MonoGenericInst::inflate_ctor"): New interncall.
24397
24398         * reflection.c (my_mono_class_from_mono_type): Added MONO_TYPE_GENERICINST.
24399         (create_typespec): Likewise.
24400         (mono_reflection_bind_generic_parameters): Return a
24401         `MonoReflectionGenericInst *' instead of a `MonoClass *'.
24402         (mono_reflection_inflate_method_or_ctor): New public function.
24403
24404         * reflection.h (MonoReflectionGenericInst): New typedef.        
24405
24406 2003-10-24  Zoltan Varga  <vargaz@freemail.hu>
24407
24408         * object.c (mono_class_proxy_vtable): Run the whole vtable construction
24409         inside the domain lock. Fixes #49993.
24410         
24411         * object.c (mono_class_vtable): When typed allocation is used, 
24412         allocate vtables in the GC heap instead of in the mempool, since the
24413         vtables contain GC descriptors which are used by the collector even
24414         after the domain owning the mempool is unloaded.
24415
24416         * domain.c (mono_domain_set): Rename to mono_domain_set_internal.
24417
24418         * domain.c (mono_domain_unload): Rename to mono_domain_free to better
24419         reflect what it does. Also invalidate mempools instead of freeing
24420         them if a define is set.
24421
24422         * appdomain.h (MonoAppDomainState): New enumeration to hold the state
24423         of the appdomain.
24424         
24425         * appdomain.h (_MonoDomain): New field 'finalizable_object_hash' to
24426         hold the finalizable objects in this domain.
24427
24428         * appdomain.h (_MonoDomain): New field 'state' to hold the state of the
24429         appdomain.
24430
24431         * appdomain.c (mono_domain_set): New function to set the current
24432         appdomain, but only if it is not being unloaded.
24433
24434         * appdomain.c threads.c threadpool.c object.c: Avoid entering an
24435         appdomain which is being unloaded.
24436         
24437         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Prevent
24438         unloading of the root appdomain.
24439
24440         * appdomain.c (ves_icall_System_AppDomain_InternalInvokeInDomain): New
24441         icall to execute a method in another appdomain. Intended as a 
24442         replacement for InternalSetDomain, which can confuse the code 
24443         generation in the JIT.
24444
24445         * appdomain.c (mono_domain_is_unloading): New function to determine
24446         whenever an appdomain is unloading.
24447
24448         * appdomain.c (mono_domain_unload): New function to correctly unload
24449         an appdomain.
24450
24451         * assembly.c (mono_assembly_load_references): Check that an assembly
24452         does not references itself.
24453
24454         * gc.c (mono_domain_finalize): Rewrote so instead of finalizing a
24455         domain manually, it asks the finalizer thread to do it, then waits for
24456         the result. Also added a timeout.
24457
24458         * icall.c: Register the new icalls.
24459
24460         * threads.h threads.c: Export the mono_gc_stop_world and 
24461         mono_gc_start_world functions.
24462         
24463         * mempool.h mempool.c (mono_mempool_invalidate): New debugging 
24464         function to fill out the mempool with 0x2a.
24465
24466 2003-10-22  Zoltan Varga  <vargaz@freemail.hu>
24467
24468         * reflection.h (MonoReflectionMethodAux): New structure to store
24469         information which is rarely used, thus is not in the MonoMethod
24470         structure.
24471
24472         * reflection.h (MonoDynamicAssembly): New field 'method_aux_hash' to
24473         store the aux info.
24474
24475         * reflection.c (mono_methodbuilder_to_mono_method): Store param names
24476         and marshalling info into the aux structure.
24477
24478         * loader.c (mono_method_get_marshal_info): Retrieve the marshal info
24479         from the aux structure.
24480
24481         * loader.c (mono_method_get_param_names): Retrieve the param names from
24482         the aux structure.
24483         
24484 2003-10-21  Zoltan Varga  <vargaz@freemail.hu>
24485
24486         * exception.h exception.c: Add AppDomainUnloadedException && fix 
24487         warning.
24488
24489 2003-10-21  Dick Porter  <dick@ximian.com>
24490
24491         * socket-io.c
24492         (ves_icall_System_Net_Sockets_Socket_Select_internal): Applied
24493         patch from Laramie Leavitt moving divide out of loop. (Bug 45381).
24494
24495 2003-10-21  Martin Baulig  <martin@ximian.com>
24496
24497         * reflection.c (mono_reflection_bind_generic_parameters):
24498         `klass->parent' is NULL for interfaces.
24499
24500 2003-10-21  Martin Baulig  <martin@ximian.com>
24501
24502         * reflection.c (create_typespec): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
24503
24504 2003-10-20  Zoltan Varga  <vargaz@freemail.hu>
24505
24506         * exception.c (mono_exception_from_name_msg): New helper function for
24507         creating exceptions and initializing their message field.
24508
24509         * exception.c: Simplify functions using the new helper.
24510
24511         * exception.h exception.c (mono_get_exception_cannot_unload_appdomain):
24512         New function.
24513
24514         * object.h object.c: Remove G_GNUC_NORETURN from the signature of
24515         mono_raise_exception, since otherwise gcc doesn't generate the function
24516         epilog for raise_exception, confusing the stack unwinding in the JIT.
24517         Fixes #45043.
24518
24519         * rawbuffer.c (mono_raw_buffer_load_mmap): Map mmap-ed memory with
24520         PROT_EXEC. This seems to prevent segmentation faults on Fedora Linux.
24521         Fixes #49499.
24522
24523 2003-10-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24524
24525         * icall.c: OutputDebugStringW expects 16-bit unicode characters, not
24526         utf8.
24527
24528 2003-10-18  Lluis Sanchez Gual  <lluis@ximian.com>
24529
24530         * icall.c: Removed GetUninitializedObject method because
24531           AllocateUninitializedClassInstance does the same.
24532
24533 2003-10-18  Martin Baulig  <martin@ximian.com>
24534
24535         * class.c (inflate_generic_signature): Renamed to
24536         mono_class_inflate_generic_signature() and made it public.
24537         (my_mono_class_from_generic_parameter): New static function; if we
24538         don't already have the generic parameter's MonoClass, create a
24539         very simple one which is just used internally in the runtime and
24540         not passed back to managed code.
24541
24542         * class.h (MonoGenericInst): Added `gpointer mbuilder' field.
24543
24544         * metadata.h (MonoMethodSignature): Moved the
24545         `MonoGenericParam *gen_params' to the MonoMethodHeader.
24546         (MonoMethodHeader): Moved the `MonoGenericParam *gen_params' here.
24547
24548         * icall.c (ves_icall_MethodInfo_GetGenericArguments): Renamed to
24549         ves_icall_MonoMethod_GetGenericArguments(); this is now an
24550         interncall on the MonoMethod class, not on MethodInfo.
24551         (ves_icall_MethodInfo_BindGenericParameters): Removed, we're now
24552         calling mono_reflection_bind_generic_method_parameters() directly.
24553
24554         * loader.c (mono_method_get_signature): If this is a MethodSpec;
24555         return the already computed `method->signature'.
24556         (method_from_methodspec): New static function to load a method
24557         from a MethodSpec entry.
24558         (mono_get_method_from_token): Call the new method_from_methodspec()
24559         for MethodSpec tokens.  
24560         (mono_get_method_from_token): If we're a generic method, load the
24561         type parameters.
24562
24563         * reflection.c (mono_image_get_memberref_token): Allow
24564         MEMBERREF_PARENT_TYPEDEF here; this will be used in the MethodSpec
24565         table.
24566         (fixup_method): Added support for MONO_TABLE_METHODSPEC.
24567         (mono_image_create_token): First check whether it's a generic
24568         method (so we'd need to create a MethodSpec), then do the other
24569         two alternatives.
24570         (mono_reflection_bind_generic_method_parameters): Return a
24571         `MonoReflectionMethod *' instead of a `MonoMethod *'; we're now
24572         called directly from the interncall.
24573
24574 2003-10-17  Zoltan Varga  <vargaz@freemail.hu>
24575
24576         * reflection.c (load_public_key): Move loading of the public key
24577         into managed code.
24578
24579         * image.h (MonoAssemblyName): Add public_key and hash_alg fields.
24580
24581         * assembly.c (mono_assembly_open): Fill in public_key and hash_alg
24582         fields.
24583
24584         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Fill in
24585         culture, hash_alg and public_key. Fixes #49555.
24586
24587 2003-10-17  Martin Baulig  <martin@ximian.com>
24588
24589         * class.h (MonoGenericInst): Moved this declaration here and added
24590         `MonoMethod *generic_method'.
24591
24592         * icall.c
24593         (ves_icall_MethodInfo_GetGenericArguments): New interncall.
24594         (ves_icall_MethodInfo_BindGenericParameters): New interncall.
24595
24596         * metadata.c (mono_metadata_type_equal): Two types of
24597         MONO_TYPE_VAR or MONO_TYPE_MVAR equals if they have the same
24598         index; ie. don't compare the address of the `MonoGenericParam'
24599         structure.
24600         (mono_metadata_load_generic_params): Removed the `MonoMethod
24601         *method' argument.
24602
24603         * metadata.h (MonoGenericInst): Moved declaration to class.h.
24604         (MonoMethodHeader): Added `MonoGenericInst *geninst'.
24605
24606         * reflection.c (method_encode_signature): Encode the number of
24607         generic parameters.
24608         (encode_generic_method_sig): New static function.
24609         (method_encode_methodspec): New static function; creates an entry
24610         in the MethodSpec table for a generic method.
24611         (mono_image_get_methodspec_token): New static function.
24612         (mono_image_create_token): Call mono_image_get_methodspec_token()
24613         for generic methods.
24614         (mono_reflection_bind_generic_method_parameters): New public
24615         function.  Instantiates a generic method.
24616
24617 2003-10-16  Martin Baulig  <martin@ximian.com>
24618
24619         * metadata.h (MonoMethodSignature): Moved `MonoGenericParam
24620         *gen_params' here from MonoMethodHeader.
24621
24622         * metadata.c (mono_metadata_parse_method_signature): If we have
24623         generic parameters, initialize `method->gen_params' and then set
24624         the correct `type->data.generic_param' in all the parameters.
24625
24626 2003-10-16  Zoltan Varga  <vargaz@freemail.hu>
24627
24628         * threads.c (mono_threads_get_default_stacksize): New function to 
24629         return the default stacksize.
24630
24631         * gc.c (mono_gc_cleanup): Use a separate event for waiting for the
24632         termination of the finalizer thread, since the previous method had
24633         race conditions. Fixes #49628.
24634
24635         * gc.c (mono_gc_init): Use the same stacksize for the finalizer thread
24636         as for the other managed threads.
24637
24638 2003-10-16  Martin Baulig  <martin@ximian.com>
24639
24640         * class.c (inflate_generic_signature): Copy `generic_param_count'
24641         and `gen_params'.
24642
24643         * icall.c (ves_icall_MethodInfo_get_IsGenericMethodDefinition):
24644         New interncall.
24645
24646         * metadata.c (mono_metadata_parse_method_signature): Actually set
24647         the `method->generic_param_count' here.
24648         (mono_metadata_load_generic_params): Initialize `pklass' to NULL.
24649
24650 2003-10-15  Zoltan Varga  <vargaz@freemail.hu>
24651
24652         * object.h: Add a new field to TypedRef to simplify the implementation
24653         of the REFANY opcodes in the JIT.
24654
24655         * icall.c: Make use of the new field.
24656
24657         * metadata.c (mono_type_size): Compute the size of TYPEDBYREF types
24658         dynamically.
24659
24660 2003-10-15  Martin Baulig  <martin@ximian.com>
24661
24662         * class.c (mono_class_from_gen_param): Renamed to
24663         mono_class_from_generic_parameter() and moved most of the
24664         functionality from mono_reflection_define_generic_parameter()
24665         here; ie. we create a "real" class here.
24666         (mono_class_from_mono_type): Only allow MONO_TYPE_VAR and
24667         MONO_TYPE_MVAR if mono_class_from_generic_parameter() has
24668         previously been called.
24669
24670         * class.h (MonoGenericParam): Moved the declaration of this struct
24671         here from metadata.h and added `MonoMethod *method'.
24672
24673         * icall.c (ves_icall_MonoType_get_DeclaringMethod): New
24674         interncall.
24675
24676         * loader.c (mono_get_method_from_token): If we have any generic
24677         parameters, call mono_metadata_load_generic_params() to read them
24678         from the MONO_TABLE_GENERICPAR.
24679
24680         * metadata.c (mono_metadata_load_generic_params): Added
24681         `MonoMethod *method' argument which is used MONO_TYPE_MVAR.
24682
24683         * metadata.h (MonoMethodSignature): Replaced
24684         `MonoGenericInst *geninst' with `guint16 generic_param_count'.
24685         (MonoMethodHeader): Added `MonoGenericParam *gen_params'.
24686
24687         * reflection.c (mono_reflection_define_generic_parameter): Moved
24688         most of the functionality into the new
24689         mono_class_from_generic_parameter(); set the `method' field if
24690         we're a method parameter.       
24691
24692 2003-10-13 Bernie Solomon  <bernard@ugsolutions.com>
24693
24694         * marshal.c (emit_struct_conv): if native size is 0
24695         emit no code.
24696
24697 2003-10-14  Martin Baulig  <martin@ximian.com>
24698
24699         * icall.c: The generics API has changed in the spec since it was
24700         added to System.Type; these modifications make it match the spec
24701         again.
24702         (ves_icall_Type_GetGenericParameters): Renamed to
24703         `ves_icall_Type_GetGenericArguments'.
24704         (ves_icall_Type_get_IsGenericTypeDefinition): New interncall.
24705         (ves_icall_MonoType_get_HasGenericParameteres): Renamed to
24706         `ves_icall_MonoType_get_HasGenericArguments'.
24707         (ves_icall_MonoType_get_IsUnboundGenericParameter): Renamed to
24708         `ves_icall_MonoType_get_IsGenericParameter'.
24709         (ves_icall_MonoType_get_HasUnboundGenericParameters): Removed;
24710         this is no interncall anymore.
24711         (ves_icall_TypeBuilder_get_IsUnboundGenericParameter): Renamed to
24712         `ves_icall_TypeBuilder_get_IsGenericParameter'.
24713
24714 2003-10-14  Martin Baulig  <martin@ximian.com>
24715
24716         * reflection.c (mono_reflection_bind_generic_parameters): Also
24717         inflate generic methods if we're reading the class from IL.
24718
24719 2003-10-13  Martin Baulig  <martin@ximian.com>
24720
24721         * reflection.c (mono_reflection_define_generic_parameter): This
24722         method isn't called directly from the icall anymore; take a
24723         `MonoReflectionAssemblyBuilder *' so we can use this for type and
24724         method generic parameters.
24725         (ReflectionMethodBuilder): Added `MonoArray *generic_param'.
24726         (method_builder_encode_signature): Encode generic parameters.
24727         (mono_image_get_method_info): Write generic params to the
24728         MONO_TABLE_GENERICPARAM table.
24729
24730         * reflection.h (MonoReflectionMethodBuilder): Added
24731         `MonoArray *generic_params'.
24732
24733         * metadata.h (MonoMethodSignature): Added `MonoGenericInst *geninst'.
24734
24735         * icall.c (ves_icall_TypeBuilder_define_generic_parameter): Added
24736         wrapper for mono_reflection_define_generic_parameter().
24737         (ves_icall_MethodBuilder_define_generic_parameter): Likewise.   
24738
24739 2003-10-13  Zoltan Varga  <vargaz@freemail.hu>
24740
24741         * marshal.h: Add missing function to fix build.
24742
24743         * marshal.c (mono_marshal_get_native_wrapper): Add support for 
24744         the SetLastError pinvoke attribute.
24745
24746         * marshal.c (mono_marshal_set_last_error): New helper function called
24747         by the generated code.
24748         
24749         * marshal.c (mono_mb_emit_branch): New helper function.
24750
24751         * marshal.c (mono_mb_emit_exception): Added exception name parameter.
24752
24753         * marshal.c (mono_marshal_get_managed_wrapper): Added support for
24754         classes as parameters and return values of delegates. Fixes #29256. 
24755
24756 2003-10-12  Bernie Solomon  <bernard@ugsolutions.com>
24757
24758         * locales.c: use gint32 in non HAVE_ICU case
24759
24760 2003-10-11  Martin Baulig  <martin@ximian.com>
24761
24762         * mono-debug.c (mono_debug_add_method): Added a workaround for
24763         bug #48591.
24764
24765 2003-10-10  Zoltan Varga  <vargaz@freemail.hu>
24766
24767         * marshal.c (mono_marshal_get_managed_wrapper): Under windows,
24768         delegates passed to native code must use the STDCALL calling 
24769         convention. Fixes #35987.
24770
24771 2003-10-10  Martin Baulig  <martin@ximian.com>
24772
24773         * class.c (inflate_generic_type): If we're inflating for a generic
24774         type instance (and not for a generic method), return
24775         MONO_TYPE_MVAR unchanged.
24776
24777 2003-10-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24778
24779         * string-icalls.c: Join ignores null strings in the source array.
24780         * threadpool.[ch]: export busy_worker_threads, not mono_worker_threads.
24781         * threads.c: GetAvailableTheads is slightly more accurate.
24782
24783 2003-10-09  Bernie Solomon  <bernard@ugsolutions.com>
24784
24785         * threads.h threads.c : add mono_threads_set_default_stacksize
24786         and pass default to CreateThread calls.
24787
24788 2003-10-09  Dick Porter  <dick@ximian.com>
24789
24790         * icall.c:
24791         * locales.h:
24792         * locales.c: Internal calls for constructing CultureInfo and
24793         related objects from libicu (if its available.)
24794
24795 2003-10-09  Zoltan Varga  <vargaz@freemail.hu>
24796
24797         * debug-helpers.c (wrapper_type_names): Add 'unknown' wrapper type.
24798
24799 2003-10-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24800
24801         * threadpool.c: added an argument to async_invoke_thread that is the
24802         item to process, pass the MonoAsyncResult to the thread start function
24803         when creating a new thread. This way we don't need to acquire any lock
24804         when we're creating a new thread. Readded a semaphore for faster
24805         response times (instead of that Sleep i added).
24806
24807 2003-10-08  Bernie Solomon  <bernard@ugsolutions.com>
24808
24809         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData):
24810         get daylight change dates better on Windows, fix handling
24811         of platforms without tm_gmtoff.
24812
24813 2003-10-06  Martin Baulig  <martin@ximian.com>
24814
24815         * class.c (inflate_generic_method): Renamed to
24816         mono_class_inflate_generic_method() and made public.
24817         (mono_class_init): Don't inflate the generic methods here.
24818         (mono_class_from_generic): Added `gboolean inflate_methods'
24819         argument.  Inflate the methods here.
24820
24821         * loader.c (mono_method_get_param_names): Ignore instances of
24822         generic types for the moment.
24823
24824         * reflection.c (fixup_method): Added support for inflated methods.
24825         (mono_image_create_token): Use mono_image_get_methodref_token()
24826         for inflated methods.
24827         (mono_custom_attrs_from_param): Ignore instances of generic types
24828         for the moment.
24829         (mono_reflection_bind_generic_parameters): New public function.
24830         Moved all the functionality from
24831         ves_icall_Type_BindGenericParameters() here and added support for
24832         dynamic types.
24833         (mono_reflection_define_generic_parameter): Initialize
24834         `klass->methods' here.
24835
24836         * icall.c (ves_icall_Type_BindGenericParameters): Moved all the
24837         functionality into mono_reflection_define_generic_parameter().
24838         (ves_icall_Type_GetGenericTypeDefinition): If we're coming from a
24839         TypeBuilder, return that TypeBuilder.
24840
24841 2003-10-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24842
24843         * appdomain.c: removed mono_delegate_semaphore.
24844
24845         * threadpool.c:
24846         (mono_thread_pool_add): moved hash table creation inside and the thread 
24847         creation outside of the critical region.
24848         (mono_thread_pool_finish): removed obsolete code.
24849         (async_invoke_thread): don't use the semaphore. Use a plain Sleep and
24850         continue or exit the thread depending on the queue.
24851
24852 2003-10-07  Bernie Solomon  <bernard@ugsolutions.com>
24853
24854         * metadata.c (mono_type_to_unmanaged): allow bools to marshal as I1
24855         marshal.c (emit_ptr_to_str_conv & mono_marshal_get_native_wrapper):
24856         handle more bool marshalling options
24857
24858 2003-10-07  Zoltan Varga  <vargaz@freemail.hu>
24859
24860         * marshal.c (mono_marshal_get_native_wrapper): Fix marshalling of
24861         arrays of structs. Also add a more descriptive error message when
24862         a structure member is marshalled as LPArray.
24863
24864 2003-10-06  Zoltan Varga  <vargaz@freemail.hu>
24865
24866         * marshal.c (mono_marshal_get_native_wrapper): Add support for
24867         marshalling arrays of complex types. Fixes #29098. Also remove an
24868         usused and incomplete function.
24869
24870 Mon Oct 6 15:38:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
24871
24872         * gc.c: report heap_size - free_bytes as total memory allocated
24873         (bug#49362).
24874
24875 2003-10-05  Zoltan Varga  <vargaz@freemail.hu>
24876
24877         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Finally 
24878         fix timezone handling problems on Windows.
24879         
24880         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Avoid
24881         asserts when the year is outside the range handled by ms the functions.
24882
24883         * class.c (setup_interface_offsets): If the class is an interface,
24884         fill out its interface_offsets slot.
24885
24886 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24887
24888         * threadpool.c: mark threadpool threads as background.
24889
24890 2003-10-03  Bernie Solomon  <bernard@ugsolutions.com>
24891
24892         * decimal.c - define DECINLINE to nothing if not using GCC
24893
24894 2003-10-03  Zoltan Varga  <vargaz@freemail.hu>
24895
24896         * assembly.c: More refcount fixes.
24897
24898 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24899
24900         * string-icalls.c: if we're not trimming, return the same string.
24901         When not splitting, don't create a new string.
24902
24903 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24904
24905         * image.c:
24906         (mono_image_open): increment the ref_count inside the critical section.
24907
24908 2003-10-02  Zoltan Varga  <vargaz@freemail.hu>
24909
24910         * image.c (mono_image_open): Fix reference counting bug.
24911
24912 2003-09-30  Bernie Solomon  <bernard@ugsolutions.com>
24913
24914         * marshal.c (mono_marshal_type_size) struct alignment changed for 
24915         64bit machines.  (emit_ptr_to_str_conv) Fix bool conversions for 
24916         64bits. Avoid leak in mono_marshal_get_native_wrapper when
24917         mono_lookup_pinvoke_call throws.        
24918
24919 2003-09-30  Zoltan Varga  <vargaz@freemail.hu>
24920
24921         * reflection.c (mono_reflection_parse_type): Fix #49114.
24922
24923         * file-io.c (ves_icall_System_IO_MonoIO_GetFileAttributes): Add
24924         temporary workaround for cygwin header problem.
24925
24926         * object.c (mono_object_isinst): Synchronize this with the code
24927         generated by the JIT for casts.
24928
24929 2003-09-29  Zoltan Varga  <vargaz@freemail.hu>
24930
24931         * reflection.c (encode_type): Fix #38332.
24932
24933 2003-09-26  Zoltan Varga  <vargaz@freemail.hu>
24934
24935         * marshal.c (mono_marshal_method_from_wrapper): New function to return
24936         the original method from the wrapper method.
24937
24938 2003-09-25  Martin Baulig  <martin@ximian.com>
24939
24940         * icall.c (ves_icall_Type_IsGenericTypeDefinition): Removed this
24941         interncall since it was identical to `Type.GetGenericTypeDefinition()'.
24942         (ves_icall_Type_get_IsGenericInstance): New interncall.
24943
24944 2003-09-24 Bernie Solomon <bernard@ugsolutions.com>
24945
24946         * object.c: fix cast warning in big endian code.
24947
24948 2003-09-19 Jackson Harper <jackson@latitudegeo.com>
24949
24950         * icall.c: Timezone patch from Zoltan Varga (vargaz@freemail.hu)
24951         
24952 2003-09-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24953
24954         * assembly.c: don't call check_env from mono_assembly_load. It's
24955         already done once in mono_assemblies_init and may cause headaches when
24956         multiple threads are loading assemblies.
24957
24958 2003-09-19  Martin Baulig  <martin@ximian.com>
24959
24960         * reflection.c (mono_reflection_define_generic_parameter): Don't
24961         allocate `klass->methods', set `klass->flags' to
24962         TYPE_ATTRIBUTE_INTERFACE, not TYPE_ATTRIBUTE_ABSTRACT.
24963
24964 2003-09-18  Martin Baulig  <martin@ximian.com>
24965
24966         * class.c (mono_class_init): Don't create `class->methods' if it's
24967         already initialized.
24968
24969         * metadata.c (mono_metadata_load_generic_params): Make this
24970         actually work.
24971
24972         * reflection.c (mono_reflection_define_generic_parameter): Set
24973         parent class and interfaces from the constraints.
24974
24975         * reflection.h (MonoReflectionGenericParam): Added `guint32 flags'
24976         to keep this struct in sync with the declaration in TypeBuilder.cs.
24977
24978 2003-09-17  Martin Baulig  <martin@ximian.com>
24979
24980         * metadata.h (MonoType): Replaced the data's `int type_param'
24981         field with `MonoGenericParam *generic_param'.
24982         (MonoGenericParam): Added `MonoClass *klass'.
24983
24984         * class.c (mono_class_from_gen_param): Removed the
24985         `MonoImage *image' and `int type_num' arguments.
24986
24987         * metadata.c (mono_metadata_parse_generic_param): New static
24988         method; creates a MonoGenericParam which just contains the index.
24989         (do_mono_metadata_parse_type): Call
24990         mono_metadata_parse_generic_param() for MONO_TYPE_VAR and
24991         MONO_TYPE_MVAR.
24992
24993         * reflection.c (mono_image_typedef_or_ref): Generic type
24994         parameters may be in the same assembly, but never use a typedef
24995         for them.
24996         (mono_reflection_define_generic_parameter): We're now creating a
24997         "real" class for the type parameter; it's now safe to call
24998         mono_class_from_mono_type() on the class'es type, it'll do the
24999         right thing.
25000
25001 2003-09-16  Martin Baulig  <martin@ximian.com>
25002
25003         * mono-debug-debugger.c (allocate_symbol_file_entry): Initialize
25004         `symfile->range_entry_size' and `symfile->class_entry_size' here;
25005         the `symfile' data structure must be fully initialized before it
25006         gets added to the table.
25007
25008 2003-09-15  Zoltan Varga  <vargaz@freemail.hu>
25009
25010         * icall.c (ves_icall_Type_IsArrayImpl): Added MONO_ARCH_SAVE_REGS.
25011
25012         * appdomain.h domain.c (MonoDomain): Added new hashtable to store the
25013         class init trampolines.
25014
25015 2003-09-11  Zoltan Varga  <vargaz@freemail.hu>
25016
25017         * profiler.c (mono_profiler_load): Added '-time' and '-alloc' options
25018         to the built-in profiler to turn off time and allocation profiling
25019         respectively.
25020
25021 2003-09-10  Zoltan Varga  <vargaz@freemail.hu>
25022
25023         * profiler.c (mono_profiler_coverage_alloc): Use NULL instead of
25024         g_direct_equal.
25025
25026         * debug-helpers.c (mono_method_full_name): Print the wrapper type
25027         in human readable form.
25028
25029 2003-09-08  Zoltan Varga  <vargaz@freemail.hu>
25030
25031         * reflection.c icall.c: Fixed warnings.
25032
25033         * image.c (load_class_names): Use a temporary hash table to hold the
25034         namespaces in order to avoid doing many string comparisons.
25035
25036         * image.h: Fix typo.
25037
25038         * image.c class.c rawbuffer.c reflection.c threads.c verify.c domain.c:
25039         Pass NULL instead of g_direct_equal to the GHashTable constructor 
25040         since the NULL case is short-circuited inside g_hash_table_lookup, 
25041         leading to better performance.  
25042
25043         * metadata.c (mono_metadata_custom_attrs_from_index): New function to
25044         obtain the first custom attribute for a given index. Depends on the
25045         CustomAttribute table being sorted by the parent field.
25046
25047         * reflection.c (mono_custom_attrs_from_index): Use the new function 
25048         for better performance.
25049
25050 2003-09-07  Martin Baulig  <martin@ximian.com>
25051
25052         * class.c (mono_class_init): If we're a generic instance, inflate
25053         all our methods instead of loading them from the image.
25054         (mono_class_from_generic): Set `class->methods = gklass->methods'.
25055
25056 2003-09-07  Martin Baulig  <martin@ximian.com>
25057
25058         * mono-debug-debugger.c: Added support for constructors.
25059
25060 2003-09-06  Martin Baulig  <martin@ximian.com>
25061
25062         * icall.c (ves_icall_TypeBuilder_get_IsUnboundGenericParameter):
25063         New interncall.
25064
25065         * reflection.c (mono_reflection_setup_generic_class): Call
25066         ensure_runtime_vtable() to create the vtable.
25067
25068 2003-09-05  Martin Baulig  <martin@ximian.com>
25069
25070         * class.c (mono_class_array_element_size): Added MONO_TYPE_VAR and
25071         MONO_TYPE_MVAR.
25072
25073 2003-09-04  Martin Baulig  <martin@ximian.com>
25074
25075         * reflection.c (mono_reflection_define_generic_parameter): Generic
25076         parameters start with zero.
25077
25078 2003-09-04  Martin Baulig  <martin@ximian.com>
25079
25080         * metadata.c (mono_type_size): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
25081
25082         * reflection.h (MonoReflectionGenericParam): New typedef.
25083         (MonoReflectionTypeBuilder): Added `generic_params' fields to get
25084         the generic parameters from the managed TypeBuilder.
25085
25086         * reflection.c (mono_reflection_define_generic_parameter): New function.
25087         (mono_reflection_create_runtime_class): Encode generic parameters.
25088         (mono_reflection_setup_generic_class): New function; this is
25089         called after adding adding all generic params to the TypeBuilder.
25090         (encode_type): Added MONO_TYPE_VAR.
25091
25092 2003-09-04  Zoltan Varga  <vargaz@freemail.hu>
25093
25094         * class.h class.c (mono_class_needs_cctor_run): Moved this method
25095         here from the JIT.
25096
25097         * assembly.h assembly.c: Moved the AOT loading code into an assembly
25098         load hook.
25099
25100 2003-09-03  Zoltan Varga  <vargaz@freemail.hu>
25101
25102         * reflection.h reflection.c class.h class.c: Delete duplicate 
25103         definition of mono_type_get_name () from reflection.c and export the
25104         one in class.c.
25105
25106         * class.c: Class loading fixes from Bernie Solomon 
25107         (bernard@ugsolutions.com).
25108
25109         * reflection.c: Endianness fixes from Bernie Solomon 
25110         (bernard@ugsolutions.com).
25111         
25112 2003-09-01  Zoltan Varga  <vargaz@freemail.hu>
25113
25114         * assembly.h assembly.c: Define a file format version for AOT
25115         libraries.
25116         
25117         * assembly.c (mono_assembly_open): Fix leaking of MonoImage-s.
25118
25119         * appdomain.h (MonoJitInfo): New field to determine whenever the
25120         code is domain neutral.
25121         
25122 2003-08-31  Miguel de Icaza  <miguel@ximian.com>
25123
25124         * marshal.c (emit_struct_conv): Add MONO_TYPE_CHAR
25125
25126 2003-08-30  Zoltan Varga  <vargaz@freemail.hu>
25127
25128         * icall.c (ves_icall_System_Web_Util_ICalls_get_machine_install_dir): 
25129         (ves_icall_System_Configuration_DefaultConfig_get_machine_config_path):
25130         Avoid caching the result since strings must be domain specific. Fixes
25131         #48050.
25132
25133 2003-08-29  Zoltan Varga  <vargaz@freemail.hu>
25134
25135         * marshal.c (mono_marshal_init): Make this callable multiple times
25136         since it is hard to find a correct place to call it.
25137
25138         * object.c (mono_runtime_class_init): Execute static constructors in
25139         the correct appdomain.
25140
25141         * image.c (build_guid_table): Handle the case when multiple images have
25142         the same GUID.
25143
25144 2003-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25145
25146         * icall.c: added a couple of icalls for System.Web.
25147
25148 2003-08-28  Martin Baulig  <martin@ximian.com>
25149
25150         * icall.c (ves_icall_Type_BindGenericParameters): Use
25151         `klass->generic_inst' instead of `&klass->byval_arg' in the
25152         mono_type_get_object() call.  The returned type must be
25153         MONO_TYPE_GENERICINST and not MONO_TYPE_CLASS.
25154
25155 2003-08-27  Zoltan Varga  <vargaz@freemail.hu>
25156
25157         * NOTES: New file.
25158
25159         * object.c (mono_class_proxy_vtable): Make it thread safe.
25160
25161         * pedump.c: Fix warning.
25162
25163         * object.c appdomain.h: Get rid of metadata_section. 
25164         It is no longer needed and it was causing deadlocks with domain->lock.
25165
25166         * appdomain.c (add_assemblies_to_domain): Make it thread safe.
25167
25168 2003-08-26  Martin Baulig  <martin@ximian.com>
25169
25170         * pedump.c (main): Don't call mono_image_close() if `verify_pe'.
25171
25172 2003-08-26  Martin Baulig  <martin@ximian.com>
25173
25174         * pedump.c (main): Call mono_metadata_init(),
25175         mono_raw_buffer_init(), mono_images_init(), mono_assemblies_init()
25176         and mono_loader_init().
25177
25178 2003-08-26  Zoltan Varga  <vargaz@freemail.hu>
25179
25180         * loader.h: Add missing include to fix build.
25181
25182         * image.h: mono_image_load_references is no more.
25183
25184         * assembly.c: Reworked assembly loading to make it really thread safe.
25185         After these changes, the assembly returned by mono_assembly_open is
25186         fully initialized, i.e. all its references assemblies are loaded.
25187
25188         * assembly.c (mono_image_load_references): Renamed to 
25189         mono_assembly_load_references, and made private, since clients no
25190         longer need to call it.
25191
25192         * class.c: Removed calls to mono_assembly_load_references, since it was
25193         a source of deadlocks.
25194
25195         * loader.h loader.c class.h class.c: Protect data structures using a 
25196         new lock, the loader lock.
25197
25198         * class.c (mono_class_setup_vtable): Create temporary hash tables and
25199         GPtrArrays only when needed.
25200
25201         * class.c (mono_class_layout_fields): Ignore the dummy field inserted 
25202         into empty structures by mcs. Fixes pinvoke7.cs.
25203         
25204         * domain.c (mono_init): Call a new initialization function.
25205
25206         * appdomain.c (mono_runtime_init): Call the new initializer function
25207         of the marshal module.
25208
25209         * marshal.c (mono_marshal_load_type_info): Ignore the dummy field
25210         inserted into empty structures by mcs. Fixes pinvoke7.cs.
25211
25212         * marshal.h marshal.c: Added locks around the wrapper caches to make
25213         this module thread safe.
25214
25215         * icall.c (ves_icall_InternalInvoke): Method wrappers doesn't require a
25216         this argument. Fixes pinvoke1.exe.
25217
25218 2003-08-25  Lluis Sanchez <lluis@ximian.com>
25219
25220         * object.h: Added call_type field to MonoMethodMessage and the corresponding
25221         enumeration of values. Removed fields to store remote call output values in
25222         MonoAsyncResult. Not needed any more.
25223         * object.c: Initialize call_type and async_result fields in mono_message_init.
25224         * marshal.c: mono_delegate_begin_invoke(): for proxies, set call_type before
25225         dispatching the message.
25226         mono_delegate_end_invoke (): delegate to the proxy the work of waiting for the
25227         async call to finish. To do it use a message with EndInvoke call type.
25228
25229 2003-08-25  Zoltan Varga  <vargaz@freemail.hu>
25230
25231         * loader.h loader.c (mono_method_hash_marhal_info): New function which
25232         determines whenever a method has marshalling info.
25233
25234 2003-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25235
25236         * assembly.c: fix the build on windows.
25237
25238 2003-08-22 Lluis Sanchez <lluis@ximian.com>
25239
25240         * object.cs: Fixed bug #47785.
25241
25242 2003-08-22 Jackson Harper <jackson@latitudegeo.com>
25243
25244         * string-icalls.c (StringReplace): If their are no occurances of
25245         the old string found return a reference to the supplied
25246         string. This saves some memory and matches MS behavoir.
25247         
25248 2003-08-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25249
25250         * socket-io.c: fixed compilation for systems that define AF_INET6
25251         and don't define SOL_IP/SOL_IPV6.
25252
25253 2003-08-21  Zoltan Varga  <vargaz@freemail.hu>
25254
25255         * object.c (mono_object_isinst): Fix casts to TransparentProxy in
25256         the interpreter. Patch by Bernie Solomon (bernard@ugsolutions.com).
25257
25258         * rawbuffer.c rawbuffer.h: Make this module thread safe.
25259
25260         * domain.c: Make this module thread safe.
25261
25262         * domain.c (mono_init): Call new initialization function.
25263
25264         * icall.c (ves_icall_System_Array_SetValueImpl): Check types for
25265         reference types too. Fixes #38812.
25266
25267         * image.c (mono_image_init): Fixed warnings.
25268
25269         * class.c (mono_class_from_typeref): Handle assembly load failure
25270         correctly.
25271
25272         * appdomain.c (add_assemblies_to_domain): Handle the case when
25273         the references of an assembly are not yet loaded.
25274
25275         * metadata.c image.c assembly.c: Moved initialization of global
25276         variables to a separate function called at startup since lazy 
25277         initialization of these variables is not thread safe.
25278         
25279         * image.c assembly.c: Made this module thread safe by adding locks in 
25280         the appropriate places.
25281
25282         * domain.c (mono_init): Call the new initialization functions of the
25283         three modules.
25284
25285 2003-08-20  Lluis Sanchez Gual  <lluis@ximian.com>
25286
25287         * marshal.c: mono_delegate_begin_invoke(): If the target is a proxy,
25288           make a direct call. It is proxy's work to make the call asynchronous.
25289           mono_delegate_end_invoke(): If the targe is a proxy, just collect
25290           the return values.
25291         * object.cs: mono_method_call_message_new(): read AsyncResult and
25292           state object from parameters list, if this info is requested.
25293         * object.h: Added fields to store remote call output values in
25294           MonoAsyncResult. Added AsyncResult field in MonoMethodMessage.
25295
25296 Wed Aug 20 12:57:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
25297
25298         * object.h: add needed fields to MonoThread.
25299         * threads.c, threads.h: allow registering a function to cleanup data
25300         allocated per thread by the JIT.
25301
25302 Tue Aug 19 18:22:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
25303
25304         * loader.h: portability fix by Bernie Solomon
25305         * <bernard@ugsolutions.com>.
25306
25307 2003-08-16  Zoltan Varga  <vargaz@freemail.hu>
25308
25309         * reflection.h reflection.c (mono_param_get_objects): Changed this to 
25310         return a MonoArray. This simplifies the code and also ensures that
25311         the cache allways contains an object reference as a value.
25312
25313         * icall.c (ves_icall_get_parameter_info): Simplified using the new
25314         function.
25315
25316 2003-08-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25317
25318         * socket-io.c: patch by Bernie Solomon <bernard@ugsolutions.com> that
25319         fixes a problem with byte ordering when getting the address family for
25320         a socket.
25321
25322 2003-08-15  Zoltan Varga  <vargaz@freemail.hu>
25323
25324         * .cvsignore: Added monosn.
25325
25326         * reflection.h reflection.c loader.c: Added support for parameter
25327         marshalling to dynamically created types. Fixes #47295.
25328
25329 Fri Aug 15 11:42:46 CEST 2003 Paolo Molaro <lupus@ximian.com>
25330
25331         * rand.c: remove useless warnings.
25332
25333 Wed Aug 13 15:49:57 CEST 2003 Paolo Molaro <lupus@ximian.com>
25334
25335         * class.c: implemented ldtoken for methods and fieldrefs.
25336
25337 2003-08-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25338
25339         * threadpool.c: when mono_async_invoke was called, no one took care of
25340         monitoring the queue. So if the method invoked took some time and we
25341         got new async invoke requests after 500 ms (the thread created waited
25342         that long in WaitForSingleObject), the new async invoke was not called
25343         until the previous one finished.
25344
25345         This is fixed now. Thanks to Totte for helping with it.
25346
25347 2003-08-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25348
25349         * threadpool.c: set threadpool_thread to TRUE. Patch by totte.
25350
25351 2003-08-11  Martin Baulig  <martin@ximian.com>
25352
25353         * mono-debug-debugger.c (mono_debugger_lookup_type): New function.
25354
25355 2003-08-06  Martin Baulig  <martin@ximian.com>
25356
25357         * mono-debug-debugger.c: Added support for static fields,
25358         properties and methods.
25359
25360 2003-08-06  Martin Baulig  <martin@ximian.com>
25361
25362         * mono-debug-debugger.c: Don't store the MonoString's vtable to
25363         make this work for applications with multiple application domains.
25364
25365 2003-08-04  Martin Baulig  <martin@ximian.com>
25366
25367         * mono-debug-debugger.c: Completely reworked the type support; the
25368         most important thing is that we're now just using one single
25369         `MonoType' instance per type.
25370
25371 Sat Aug  2 13:05:27 BST 2003 Malte Hildingson <malte@amy.udd.htu.se>
25372
25373         * mono-endian.h, mono-endian.c, icall.c: Added icall
25374         ves_icall_System_Double_AssertEndianity to assert double word endianity
25375         on ARM (FPA). The icall uses a macro defined in mono-endian.h.
25376
25377 Fri Aug 1 16:51:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
25378
25379         * class.c, class.h, reflection.c, metadata.c, icall.c: more generics
25380         support, icalls and fixes.
25381
25382 2003-07-31  Miguel de Icaza  <miguel@ximian.com>
25383
25384         * unicode.c (ves_icall_System_Char_IsPunctuation): The set of
25385         classes that are a punctuation character in .NET is not the same a
25386         g_unichar_ispunct.
25387
25388 Tue Jul 29 18:07:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
25389
25390         * socket-io.c: ipv6 portability fixes from Felix Ortga (guile@lared.es).
25391
25392 2003-07-29  Miguel de Icaza  <miguel@ximian.com>
25393
25394         * icall.c: Add new MemCopy internalcall.
25395         (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal):
25396         Simplified code; It is not necessary to handle all the cases here,
25397         as the C# code takes care of it.  Only handle the case of the name
25398         resource embedded into the assembly.
25399
25400         Changed signature to return the data pointer and the size of the
25401         data. 
25402
25403 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
25404
25405         * reflection.c (mono_image_get_method_info): Allow for 0x40 to be
25406         encoded.        (Partition II.22.1.7: PInvokeAttribute:SupportsLastErr).
25407
25408 2003-07-29  Lluis Sanchez Gual  <lluis@ximian.com>
25409
25410         * socket-io.c: ignore EINTR error in select.
25411
25412 Tue Jul 29 15:25:01 CEST 2003 Paolo Molaro <lupus@ximian.com>
25413
25414         * class.h, class.c: removed unused subclasses field in MonoClass.
25415
25416 2003-07-29  Lluis Sanchez Gual  <lluis@ximian.com>
25417
25418         * icall.c: improve fix of get_base_definition(). If the parent class
25419           doesn't have the mehod, look at the parent of the parent.
25420         * object.c: mono_message_init(): use the attribute PARAM_ATTRIBUTE_OUT
25421           to check if a parameter is an in or out parameter
25422           (PARAM_ATTRIBUTE_IN is not set by default).
25423           mono_method_return_message_restore(): Use mono_class_value_size to
25424           get the size of a value type. mono_type_stack_size (parameterType)
25425           does not return the correct value if parameterType is byRef.
25426           mono_load_remote_field(), mono_load_remote_field_new(),
25427           mono_store_remote_field(), mono_store_remote_field_new():
25428           raise exception if the remote call returns an exception.
25429
25430 2003-07-28  Martin Baulig  <martin@ximian.com>
25431
25432         * mono-debug-debugger.c (mono_debugger_runtime_invoke): New
25433         method.  This is a wrapper around mono_runtime_invoke() which
25434         boxes the instance object if neccessary.
25435
25436 Fri Jul 25 19:14:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
25437
25438         * class.c, class.h, image.c, image.h, loader.c, metadata.c,
25439         metadata.h, row-indexes.h, verify.c: first cut of generics support.
25440
25441 Thu Jul 24 11:34:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
25442
25443         * icall.c: disable mcs bug workaround.
25444
25445 2003-07-21  Miguel de Icaza  <miguel@ximian.com>
25446
25447         * object.c (mono_runtime_class_init): Take the metadata_section
25448         mutex before obtaining the domain mutex.
25449
25450         * appdomain.h: Added definition of metadata_section mutex here. 
25451
25452         * object.c: define metadata_mutex here.
25453
25454 2003-07-24  Ravi Pratap  <ravi@ximian.com>
25455
25456         * icall.c: Remove the FIXED_MCS_45127 workarounds - this has been
25457         fixed.
25458
25459 2003-07-24  Lluis Sanchez Gual  <lluis@ximian.com>
25460
25461         * reflection.c: Fix bug #46669
25462
25463 2003-07-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25464
25465         * exception.c:
25466         * exception.h:
25467         * icall.c:
25468         * object.h: fill in the type name for TypeLoadException.
25469
25470 2003-07-23  Ravi Pratap  <ravi@ximian.com>
25471
25472         * class.c: Fixes from Paolo in response to bug #45415 (Subclass
25473         relationship between TypeBuilders while compiling corlib) and bug
25474         45993 (Array types returned from the runtime while compiling
25475         corlib were from the loaded corlib).
25476
25477 2003-07-22  Martin Baulig  <martin@ximian.com>
25478
25479         * mono-debug-debugger.c: Reworked the type support a bit more;
25480         distinguish between types and classes.
25481
25482 Tue Jul 22 15:48:50 CEST 2003 Paolo Molaro <lupus@ximian.com>
25483
25484         * icall.c: add IsArrayImpl icall.
25485
25486 2003-07-22  Zoltan Varga  <vargaz@freemail.hu>
25487
25488         * class.c (mono_class_layout_fields): Fix gc aware auto layout by
25489         initializing real_size only once. Also fix bug #46602.
25490
25491 2003-07-21  Jerome Laban <jlaban@wanadoo.fr>
25492
25493         * object.c: Renamed mono_metadata_section to metadata_section.
25494
25495 2003-07-21  Lluis Sanchez Gual  <lluis@ximian.com>
25496
25497         * icall.c: in MS.NET ves_icall_Type_GetInterfaces returns an
25498           empty array if the type is an array. Fixed.
25499           ves_icall_MonoMethod_get_base_definition: if the base method
25500           is abstract, get the MethodInfo from the list of methods of
25501           the class.
25502         * reflection.c: ParameterInfo.PositionImpl should be zero-based
25503           and it was 1-based. Fixed in mono_param_get_objects.
25504
25505 2003-07-20  Martin Baulig  <martin@ximian.com>
25506
25507         * mono-debug.h: Set version number to 31.
25508         (mono_debug_init): Added `MonoDomain *' argument.
25509
25510         * mono-debug-debugger.c: Reworked the type support; explicitly
25511         tell the debugger about builtin types; pass the `klass' address to
25512         the debugger.
25513
25514 2003-07-20 Jackson Harper <jackson@latitudegeo.com>
25515
25516         * image.c: Allow new metadata tables to be loaded without a
25517         warning. Also update the warning message to give the new constant value.
25518                 
25519 Fri Jul 18 13:12:21 CEST 2003 Paolo Molaro <lupus@ximian.com>
25520
25521         * class.c, class.h, debug-helpers.c, icall.c, image.c, marshal.c,
25522         metadata.c, metadata.h, mono-debug-debugger.c, object.c, reflection.c: 
25523         array type representation changes.
25524
25525 Fri Jul 18 11:26:58 CEST 2003 Paolo Molaro <lupus@ximian.com>
25526
25527         * icall.c, appdomain.h, appdomain.c: support full runtime shutdown
25528         on Environment.Exit () call.
25529
25530 Thu Jul 17 17:21:57 CEST 2003 Paolo Molaro <lupus@ximian.com>
25531
25532         * icall.c, reflection.h, reflection.c, verify.c: cleanups,
25533         requires a matching corlib.
25534
25535 2003-07-17  Lluis Sanchez Gual  <lluis@ximian.com>
25536
25537         * Changelog: My editor decided to add a CR to each line. Sorry about that.
25538           Committed again without the CRs.
25539         
25540 2003-07-17  Lluis Sanchez Gual  <lluis@ximian.com>
25541
25542         * socket-io.c: Get system_assembly using mono_image_loaded(), instead
25543           getting it from the "this" socket instance. Did not work
25544           if the socket is a subclass of Socket.
25545           Also fixed bug #35371.
25546
25547 Thu Jul 17 13:39:32 CEST 2003 Paolo Molaro <lupus@ximian.com>
25548
25549         * metadata.c: fixed size for TypedByRef.
25550         * loader.c: when searching for a method, consider the vararg amrker.
25551         * unicode.c, decimal.c: constify some arrays.
25552
25553 2003-07-15  Dick Porter  <dick@ximian.com>
25554
25555         * socket-io.c: Fixed compilation for gcc < 3.2.
25556
25557         Fixed compilation for machines that don't have AF_INET6 (thanks to
25558         Bernie Solomon <bernard@ugsolutions.com> for that part.)
25559
25560         Fixed compile warnings.
25561         
25562         Fixed formatting and line endings.
25563
25564 2003-07-14  Jerome Laban <jlaban@wanadoo.fr>
25565
25566         * socket-io.h:
25567         * socket-io.c: Added IPv6 support.
25568
25569 2003-07-13  Zoltan Varga  <vargaz@freemail.hu>
25570
25571         * class.c (mono_class_is_assignable_from): New function to implement
25572         the is_assignable_from logic. Used by mono_object_isinst, 
25573         Type::IsAssignableFrom () and the interpreter.
25574
25575         * class.c (mono_class_is_subclass_of): Make all classes a subclass of
25576         Object, even interfaces.
25577         
25578         * object.c (mono_object_isinst): Implement in terms of 
25579         is_assignable_from.
25580
25581         * icall.c (ves_icall_type_is_assignable_from): New icall.
25582
25583 2003-07-11  Zoltan Varga  <vargaz@freemail.hu>
25584
25585         * domain.c (foreach_domain): fix compiler warning.
25586
25587 2003-07-11  Dietmar Maurer  <dietmar@ximian.com>
25588
25589         * image.c (load_metadata_ptrs): use g_strndup because strndup is
25590         not available on all plattforms
25591
25592 2003-07-10  Zoltan Varga  <vargaz@freemail.hu>
25593
25594         * image.h image.c: Store the metadata version string in MonoImage.
25595         * icall.c: New icall to retrieve the image version.
25596         * reflection.c (create_dynamic_image): Fill in the image version field
25597         * reflection.c (build_compressed_metadata): Use the image version
25598         from the image structure.
25599
25600 2003-07-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25601
25602         * appdomain.c: modified comment.
25603         * gc.c: finalizer_thread can call finalizers even when finished == TRUE.
25604         That will be its last iteration when mono_gc_cleanup is called from
25605         mono_runtime_cleanup and before the domain is unloaded.
25606
25607         Fixes bug #45962.
25608
25609 2003-07-04  Dietmar Maurer  <dietmar@ximian.com>
25610
25611         * marshal.c (mono_marshal_get_native_wrapper): fixes for [out]
25612         attributes.
25613
25614 Thu Jul 3 17:22:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
25615
25616         * object.c, file-io.c, metadata.c, mono-endian.h, reflection.c,
25617         rawbuffer.c: more 64 bit and picky (or old) compiler fixes from
25618         Bernie Solomon <bernard@ugsolutions.com>.
25619
25620 Thu Jul 3 17:17:39 CEST 2003 Paolo Molaro <lupus@ximian.com>
25621
25622         * object.c, object.h: provide mono_object_new_fast() for faster
25623         allocation in some special cases.
25624
25625 Wed Jul 2 13:21:26 CEST 2003 Paolo Molaro <lupus@ximian.com>
25626
25627         * object.h, reflection.h, verify.c: fixes for some 64bit issues,
25628         mostly from a patch by Laramie Leavitt <lar@leavitt.us>.
25629
25630 Tue Jul 1 21:24:14 CEST 2003 Paolo Molaro <lupus@ximian.com>
25631
25632         * threadpool.c: fix leaks.
25633
25634 2003-07-01  Dick Porter  <dick@ximian.com>
25635
25636         * threadpool.c (mono_async_invoke): Use mono_g_hash_table_remove when
25637         using MonoGHashTables.  Fixes threadpool bug posted to list.
25638
25639 Tue Jul 1 11:45:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
25640
25641         * image.h, image.c: added support to load an assembly from a byte array.
25642         * Makefile.am, assembly.c, make-bundle.pl, sample-bundle: added 
25643         assembly bundle support.
25644
25645 2003-06-27  Dietmar Maurer  <dietmar@ximian.com>
25646
25647         * threadpool.c (mono_thread_pool_add): keep a reference to the
25648         AsyncResult to prevent GC
25649
25650 Thu Jun 26 12:13:25 CEST 2003 Paolo Molaro <lupus@ximian.com>
25651
25652         * class.c: leak fix.
25653
25654 2003-06-25  Dick Porter  <dick@ximian.com>
25655
25656         * threadpool.c (mono_thread_pool_add): Don't set up a finaliser
25657         for the async object, the WaitHandle object will close the handle.
25658         Fixes bug 45321.
25659
25660 Wed Jun 25 18:12:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
25661
25662         * class.c: in mono_array_class_get (), lookup from the hash with the
25663         same type we insert: this works around a bug in
25664         mono_metadata_type_hash() with SZARRAY and fixes a leak reported by
25665         lluis. The real fix will have to wait for after the release.
25666
25667 Wed Jun 25 13:14:41 CEST 2003 Paolo Molaro <lupus@ximian.com>
25668
25669         * icall.c: fix memory leak when getting type members.
25670
25671 Mon Jun 23 16:12:48 CEST 2003 Paolo Molaro <lupus@ximian.com>
25672
25673         * reflection.c: added more pubtoken special cases.
25674
25675 Mon Jun 23 15:29:06 CEST 2003 Paolo Molaro <lupus@ximian.com>
25676
25677         * class.c: handle field offset correctly when class size
25678         is set (bug# 45182, partially from a patch by jlaban@wanadoo.Fr (Jerome Laban)).
25679
25680 2003-06-20  Martin Baulig  <martin@ximian.com>
25681
25682         * mono-debug-debugger.h (MonoDebuggerSymbolFile): Added `MonoImage
25683         *image' field.
25684
25685 2003-06-20  Martin Baulig  <martin@ximian.com>
25686
25687         * image.h, mono-debug-debugger.h: Fixed compiler warnings.
25688
25689 2003-06-20  Martin Baulig  <martin@ximian.com>
25690
25691         * mono-debug.h (MONO_DEBUG_VAR_ADDRESS_MODE_STACK): Removed.  We
25692         just distinguish between variables in registers and variables at
25693         an offset relative to a register.
25694
25695 2003-06-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25696
25697         * icall.c: #ifdef out latest changes until mcs is fixed.
25698
25699 Thu Jun 19 11:03:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
25700
25701         * icall.c: return members in metadata order.
25702
25703 Wed Jun 18 15:26:58 CEST 2003 Paolo Molaro <lupus@ximian.com>
25704
25705         * icall.c: avoid infinite loop in GetTimeZoneData.
25706
25707 Wed Jun 18 12:47:43 CEST 2003 Paolo Molaro <lupus@ximian.com>
25708
25709         * icall.c: added Marshal.Prelink/All icalls.
25710
25711 Wed Jun 18 12:17:48 CEST 2003 Paolo Molaro <lupus@ximian.com>
25712
25713         * object.c, object.h: fix warnings and do some overflow checking
25714         when creating arrays.
25715
25716 2003-06-17  Dick Porter  <dick@ximian.com>
25717
25718         * file-io.h:
25719         * file-io.c: File attributes need to be tweaked slightly when
25720         passed from the managed to the w32 world.
25721
25722 2003-06-17  Zoltan Varga  <vargaz@freemail.hu>
25723         * profiler.h profiler-private.h profiler.c: Rework last patch
25724         based on suggestion by Paolo.
25725         
25726 2003-06-17  Zoltan Varga  <vargaz@freemail.hu>
25727
25728         * profiler.h profiler-private.h profiler.c: Added infrastructure for 
25729         instruction level coverage data collection.
25730         * profiler.h profiler.c (: Added new callback function which can be
25731         used by the profiler to limit which functions should have coverage
25732         instrumentation.
25733         * profiler.c (mono_profiler_load): Call g_module_build_path to
25734         generate the file name of the profiler library.
25735
25736 Mon Jun 16 18:11:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
25737
25738         * profiler.c, profiler.h, profiler-private.h: added basic block 
25739         coverage profiling API.
25740
25741 2003-06-15  Zoltan Varga  <vargaz@freemail.hu>
25742
25743         * reflection.c (mono_reflection_create_runtime_class): Add support
25744         for events in dynamically generated code.
25745
25746         * gc.c: Start GCHandle indexes from 1, since 0 means the handle is
25747         not allocated.
25748
25749 Sat Jun 14 19:01:32 CEST 2003 Paolo Molaro <lupus@ximian.com>
25750
25751         * icall.c: when getting timezone info, return reasonable values if we
25752         can't get the actual data.
25753
25754 2003-06-14  Dick Porter  <dick@ximian.com>
25755
25756         * threads.c (start_wrapper): Remove the reference to the thread
25757         object in the TLS data, so the thread object can be finalized.
25758         This won't be reached if the thread threw an uncaught exception,
25759         so those thread handles will stay referenced :-( (This is due to
25760         missing support for scanning thread-specific data in the Boehm GC
25761         - the io-layer keeps a GC-visible hash of pointers to TLS data.)
25762
25763 Sat Jun 14 13:16:17 CEST 2003 Paolo Molaro <lupus@ximian.com>
25764
25765         * reflection.c: ensure streams and tables are first allocated with
25766         ALLOC_ATOMIC (GC_realloc uses plain GC_malloc otherwise).
25767
25768 Sat Jun 14 13:13:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
25769
25770         * icall.c: fixed GetElementType for byrefs (bug# 44792).
25771
25772 2003-06-13  Zoltan Varga  <vargaz@freemail.hu>
25773
25774         * reflection.c (mono_reflection_create_runtime_class): Add support for
25775         properties to dynamically created classes.
25776         * reflection.c: Fix a few places where non-MonoObjects were inserted
25777         into the tokens hashtable.
25778
25779 Fri Jun 13 19:10:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
25780
25781         * object.c: some support to handle out of memory exceptions.
25782
25783 2003-06-12  Dietmar Maurer  <dietmar@ximian.com>
25784
25785         * marshal.c (mono_marshal_get_native_wrapper): support reference
25786         return types
25787
25788 Wed Jun 11 18:32:51 CEST 2003 Paolo Molaro <lupus@ximian.com>
25789
25790         * object.h, object.c: more portability stuff from Bernie Solomon.
25791         Unexport mono_object_allocate(). Added mono_object_unbox ().
25792         Set exitcode when an unhandled exception is thrown.
25793
25794 2003-06-11  Dietmar Maurer  <dietmar@ximian.com>
25795
25796         * marshal.c (mono_marshal_get_native_wrapper): use custom
25797         marshaler for return types.
25798
25799 2003-06-10  Dick Porter  <dick@ximian.com>
25800
25801         * socket-io.c: Don't assume that one of struct ip_mreqn or struct
25802         ip_mreq is available
25803
25804 Tue Jun 10 17:35:03 CEST 2003 Paolo Molaro <lupus@ximian.com>
25805
25806         * debug-mono-symfile.c, marshal.c, metadata.c, monitor.c,
25807         mono-debug-debugger.c, mono-debug.c, process.c: portability fixes
25808         by Bernie Solomon <bernard@ugsolutions.com>.
25809
25810 2003-06-10  Zoltan Varga  <vargaz@freemail.hu>
25811
25812         * gc.c (mono_gc_init): Avoid error message on shutdown when
25813         GC_DONT_GC=1 is used.
25814
25815         * icall.c (ves_icall_System_Reflection_Module_GetGuidInternal): 
25816         New icall to return the GUID of a module.
25817
25818 Mon Jun 9 19:33:51 CEST 2003 Paolo Molaro <lupus@ximian.com>
25819
25820         * class.c: ensure instance size always includes the parent's size
25821         even whem class size is set explicitly (fixes bug#44294).
25822
25823 Thu Jun 5 19:51:49 CEST 2003 Paolo Molaro <lupus@ximian.com>
25824
25825         * profiler.h, profiler.c: made the simple profiler thread-safe,
25826         get more accurate timing info. Allow the loading of an
25827         externally-developed profiler module.
25828
25829 2003-06-05  Dietmar Maurer  <dietmar@ximian.com>
25830
25831         * marshal.c (mono_marshal_get_native_wrapper): improved
25832         class/byref arguments.
25833         (mono_marshal_get_native_wrapper): better string marshaling support.
25834
25835 Wed Jun 4 18:01:22 CEST 2003 Paolo Molaro <lupus@ximian.com>
25836
25837         * class.c: ensure .pack and .size are handled correctly and
25838         simplified layout of static fields.
25839
25840 2003-06-04  Dietmar Maurer  <dietmar@ximian.com>
25841
25842         * appdomain.c
25843         (ves_icall_System_AppDomainSetup_InitAppDomainSetup): fix for bug 42934
25844
25845         * loader.c (mono_lookup_pinvoke_call): look for modules in the
25846         current directory (fix bug 44008)
25847
25848 2003-06-03  Dietmar Maurer  <dietmar@ximian.com>
25849
25850         * marshal.c (mono_marshal_get_native_wrapper): started support for
25851         custom marshalers.
25852         (mono_delegate_to_ftnptr): consider marshalling specifications
25853
25854 Tue Jun 3 11:17:02 CEST 2003 Paolo Molaro <lupus@ximian.com>
25855
25856         * reflection.c, reflection.h: emit custom marshal info.
25857
25858 2003-06-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25859
25860         * object.c: free the GError.
25861         * icall.c: added CloseEvent_internal.
25862         * threads.[ch]:
25863         (ves_icall_System_Threading_Events_CloseEvent_internal): new internal
25864         call.
25865
25866 2003-06-01  Zoltan Varga  <vargaz@freemail.hu>
25867
25868         * loader.c (mono_method_get_signature): Add support for dynamic
25869         assemblies.
25870
25871 Sat May 31 15:22:07 CEST 2003 Paolo Molaro <lupus@ximian.com>
25872
25873         * reflection.c: fixed bug #43905.
25874
25875 Fri May 30 12:56:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
25876
25877         * class.c, domain.c, icall.c, metadata.h, object.h: support for
25878         handling TypedReference and ArgIterator.
25879         * loader.c, loader.h: added function to get signature at call site.
25880
25881 Thu May 29 11:34:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
25882
25883         * metadata.c, metadata.h, private.h, tokentype.h, loader.c: make more 
25884         data readonly. Buglets and warning fixes. Some MethodSpec support.
25885
25886 Tue May 27 16:34:39 CEST 2003 Paolo Molaro <lupus@ximian.com>
25887
25888         * class.h, class.c, object.c: remove relative numbering support.
25889
25890 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
25891
25892         * marshal.c (mono_marshal_get_native_wrapper): For now, do not
25893         free the string, until we get a chance to fix Gtk#
25894
25895 2003-05-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25896
25897         * marshal.c: revert last patch.
25898
25899 Mon May 26 20:21:52 CEST 2003 Paolo Molaro <lupus@ximian.com>
25900
25901         * icall.c: updates for new mono_class_vtable() not calling
25902         the type constructor anymore.
25903
25904 Mon May 26 12:10:35 CEST 2003 Paolo Molaro <lupus@ximian.com>
25905
25906         * object.h, object.c: separate vtable creation from type
25907         initialization. Make running the .cctor thread safe.
25908
25909 2003-05-26  Dietmar Maurer  <dietmar@ximian.com>
25910
25911         * marshal.c (mono_marshal_get_native_wrapper): free string return values.
25912
25913 2003-05-21  Dietmar Maurer  <dietmar@ximian.com>
25914
25915         * loader.c (mono_get_method): consider calling convention
25916
25917 2003-05-21  Zoltan Varga  <vargaz@freemail.hu>
25918
25919         * icall.c (ves_icall_System_Reflection_Module_GetGlobalType): New icall
25920         to return the invisible global type for a module.
25921
25922         * reflection.c (mono_image_build_metadata): Emit global fields too.
25923
25924 2003-05-20  Peter Williams  <peterw@ximian.com>
25925
25926         * loader.c (mono_lookup_internal_call): Add a few newlines.
25927
25928 2003-05-20  Zoltan Varga  <vargaz@freemail.hu>
25929
25930         * reflection.c (mono_reflection_lookup_dynamic_token): Intern dynamic
25931         literal strings.
25932
25933         * appdomain.c (set_domain_search_path): Recalculate search path when
25934         AppDomainSetup.PrivateBinPath changes.
25935
25936         * object.c (mono_class_compute_gc_descriptor): It turns out some
25937         parts of the class libs (like System.Thread) holds pointers to
25938         GC_MALLOC()-d memory in IntPtrs, which is wrong. The workaround is
25939         to treat native int a pointer type here.
25940         
25941 Tue May 20 17:18:16 CEST 2003 Paolo Molaro <lupus@ximian.com>
25942
25943         * appdomain.h, domain.c: add hashtable for jump target resolution.
25944
25945 2003-05-19  Zoltan Varga  <vargaz@freemail.hu>
25946
25947         * reflection.h reflection.c icall.c: Added new icalls 
25948         GetManifestResourceInfoInternal, GetModulesInternal and support
25949         infrastructure.
25950
25951 2003-05-16  Dick Porter  <dick@ximian.com>
25952
25953         * icall.c:
25954         * file-io.h:
25955         * file-io.c: Implement System.IO.MonoIO::GetTempPath
25956
25957 2003-05-14  Lluis Sanchez Gual  <lluis@ideary.com>
25958
25959         * object.c: mono_store_remote_field: little fix to previous patch.
25960
25961 Wed May 14 18:10:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
25962
25963         * class.c: add constructors to array classes.
25964         * icall.c: special case array construction for InternalInvoke (),
25965
25966 2003-05-14  Zoltan Varga  <vargaz@freemail.hu>
25967
25968         * class.h class.c reflection.c object.c: Added support for field
25969         defaults in dynamically generated classes.
25970
25971 Wed May 14 13:35:27 CEST 2003 Paolo Molaro <lupus@ximian.com>
25972
25973         * reflection.c: properly encode charset for ddlimport.
25974
25975 Wed May 14 11:14:54 CEST 2003 Paolo Molaro <lupus@ximian.com>
25976
25977         * threads.c: allow compiling without GC.
25978
25979 Tue May 13 16:41:49 CEST 2003 Paolo Molaro <lupus@ximian.com>
25980
25981         * appdomain.h, object.c, object.h, threads.c, threads.h: added
25982         handling of thread static data.
25983
25984 Tue May 13 16:36:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
25985
25986         * reflection.h, reflection.c: added mono_custom_attrs_free ().
25987
25988 2003-05-13  Dietmar Maurer  <dietmar@ximian.com>
25989
25990         * class.c (mono_array_class_get): always set the serializable flags
25991         (mono_array_class_get): always set the SEALED attribute for array types
25992
25993 2003-05-12  Dietmar Maurer  <dietmar@ximian.com>
25994
25995         * loader.c (mono_lookup_pinvoke_call): consider Ansi/Unicode
25996         attributes (fix for bug 42021).
25997
25998 2003-05-12  Dick Porter  <dick@ximian.com>
25999
26000         * gc.c: Don't run finalizers when the finalizer thread is
26001         finishing up, because the default domain has already been
26002         destroyed.
26003
26004 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
26005
26006         * string-icalls.c (ves_icall_System_String_ctor_chara_int_int): if
26007         value is null, we should throw an exception.   This is slightly
26008         different than the other conventions used for the constructor.
26009
26010 2003-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26011
26012         * socket-io.c: fixed windows build.
26013
26014 2003-05-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26015
26016         * socket-io.c: patch by Jerome Laban that fixes bug #42393.
26017
26018 2003-05-10  Zoltan Varga  <vargaz@freemail.hu>
26019
26020         * object.c (mono_string_new_wrapper): Compatibility fix for MS
26021         compilers.
26022
26023 2003-05-09  Zoltan Varga  <vargaz@freemail.hu>
26024
26025         * class.c (mono_class_layout_fields): Add experimental GC aware
26026         auto layout facility. Requires class library changes to work correctly.
26027
26028         (mono_class_setup_vtable): Avoid overriding explicit interface
26029         method implementations. Fixes iface3.exe test.
26030
26031         * object.c (mono_class_compute_gc_descriptor): Type I can't hold an
26032         object reference.
26033         (mono_array_new_specific): Add MONO_ARCH_SAVE_REGS.
26034         (mono_string_new_wrapper): Add MONO_ARCH_SAVE_REGS.
26035
26036         * metadata.h: Add new type classification macro which determines
26037         whenever the type holds an object reference.
26038
26039 2003-05-08  Dietmar Maurer  <dietmar@ximian.com>
26040
26041         * marshal.c (mono_marshal_get_native_wrapper): cleanups
26042
26043 2003-05-07  Zoltan Varga  <vargaz@freemail.hu>
26044
26045         * gc.c (finalizer_thread): Work around a GC bug.
26046
26047 2003-05-07  Dietmar Maurer  <dietmar@ximian.com>
26048
26049         * marshal.c (emit_struct_conv): allow unions
26050
26051         * class.c (class_compute_field_layout): added patches from Jerome Laban <jlaban@wanadoo.fr>
26052
26053 2003-05-06  Dietmar Maurer  <dietmar@ximian.com>
26054
26055         * marshal.c (mono_marshal_get_native_wrapper): free strings after pinvoke
26056
26057 2003-05-06  Martin Baulig  <martin@ximian.com>
26058
26059         * mono-debug-debugger.h: #include <mono/io-layer/io-layer.h>.
26060
26061 2003-05-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26062
26063         * socket-io.c:
26064         (Select_internal): allow NULLs, don't create arrays if not needed.
26065         Coupled with Socket.cs changes.
26066
26067         * threadpool.c:
26068         (mono_thread_pool_add): use GC_MALLOC to allocate the ASyncCall and
26069         register a finalizer for it that will close the semaphore handle. This
26070         fixes the leak and make Lupus' test run with > 4080 loops.
26071
26072 2003-05-05  Dietmar Maurer  <dietmar@ximian.com>
26073
26074         * marshal.c (mono_marshal_get_struct_to_ptr): added fixes from
26075         Jerome Laban (bug #42287)
26076
26077 2003-05-02  Martin Baulig  <martin@ximian.com>
26078
26079         * debug-mono-symfile.h
26080         (MonoSymbolFile): Moved declaration into mono-debug.h.
26081         (MonoDebugMethodJitInfo): Likewise.
26082         (mono_debug_open_mono_symbol_file): Take the MonoDebugHandle as
26083         argument.
26084         (_mono_debug_address_from_il_offset): Take a
26085         MonoDebugMethodJitInfo instead of a MonoDebugMethodInfo.
26086
26087         * mono-debug.h
26088         (MonoDebugDomainData): New struct.
26089         (mono_debug_get_domain_data): New function.
26090         (mono_debug_add_method): Take an additional `MonoDomain *'
26091         argument.
26092         (mono_debug_source_location_from_address): Likewise.
26093         (mono_debug_il_offset_from_address): Likewise.
26094         (mono_debug_address_from_il_offset): Likewise.
26095
26096 Thu May 1 19:40:37 CEST 2003 Paolo Molaro <lupus@ximian.com>
26097
26098         * reflection.c: one more check for null type in custom attrs.
26099
26100 2003-05-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26101
26102         * reflection.c: avoid warning (comparison is always false due to limited
26103         range of data type).
26104
26105 2003-05-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26106
26107         * icall.c: throw an exception in Type.GetField if the argument 'name'
26108         is NULL.
26109
26110 Wed Apr 30 10:53:09 CEST 2003 Paolo Molaro <lupus@ximian.com>
26111
26112         * reflection.c: fixed handling of enums in named arguments to custom
26113         attributes (bug #42123).
26114
26115 Tue Apr 29 19:15:10 CEST 2003 Paolo Molaro <lupus@ximian.com>
26116
26117         * reflection.c: use the right array element type and handle
26118         a null for a Type argument, too.
26119
26120 Tue Apr 29 15:46:00 CEST 2003 Paolo Molaro <lupus@ximian.com>
26121
26122         * reflection.c: handle arrays as arguments to custom attributes.
26123
26124 Tue Apr 29 11:43:01 CEST 2003 Paolo Molaro <lupus@ximian.com>
26125
26126         * reflection.c: handle a string value in a custom attr
26127         ctor that takes an object.
26128
26129 2003-04-29  Dietmar Maurer  <dietmar@ximian.com>
26130
26131         * marshal.c (mono_mb_emit_restore_result): support MONO_TYPE_PTR
26132         (fix bug #42063)
26133
26134 2003-04-28  Zoltan Varga  <vargaz@freemail.hu>
26135
26136         * icall.c (ves_icall_Type_GetNestedType): Fixed warnings.
26137
26138 2003-04-27  Martin Baulig  <martin@ximian.com>
26139
26140         * mono-debug-debugger.h (MonoDebuggerEvent): Renamed
26141         MONO_DEBUGGER_EVENT_BREAKPOINT_TRAMPOLINE to
26142         MONO_DEBUGGER_EVENT_BREAKPOINT.
26143         (mono_breakpoint_trampoline_code): Removed.
26144         (mono_debugger_event_handler): The last argument is now a
26145         `guint32'.
26146         (mono_debugger_insert_breakpoint_full): Removed the
26147         `use_trampoline' argument.
26148         (mono_debugger_method_has_breakpoint): Likewise.
26149         (mono_debugger_trampoline_breakpoint_callback): Renamed to
26150         mono_debugger_breakpoint_callback(); take the method and
26151         breakpoint number as arguments.
26152
26153 Sat Apr 26 19:25:31 CEST 2003 Paolo Molaro <lupus@ximian.com>
26154
26155         * metadata.c: fix off by one when loading parameters attributes.
26156
26157 2003-04-24  Martin Baulig  <martin@ximian.com>
26158
26159         * mono-debug-debugger.c (mono_debugger_io_layer): Put this back.
26160
26161 2003-04-24  Martin Baulig  <martin@ximian.com>
26162
26163         * mono-debug-debugger.c: Moved all code which interacts with the
26164         Mono Debugger here.
26165
26166         * debug-mono-symfile.c: This code now just deals with the symbol
26167         file itself, the debugger code is now in mono-debug-debugger.c.
26168
26169 2003-04-23  Martin Baulig  <martin@ximian.com>
26170
26171         * mono-debug.c (mono_debug_source_location_from_il_offset):
26172         New method; like mono_debug_source_location_from_address(), but
26173         takes an IL offset instead of a machine address.
26174
26175 2003-04-23  Martin Baulig  <martin@ximian.com>
26176
26177         * debug-mono-symfile.h (MonoDebugLineNumberEntry): Removed the
26178         `line' field; this is now computed by the debugger.
26179
26180 2003-04-23  Martin Baulig  <martin@ximian.com>
26181
26182         * mono-debug.[ch]: New files.  This is the new debugging interface.
26183
26184         * mono-debug-debugger.[ch]: New files.  Moved all code which
26185         interacts with the Mono Debugger here.
26186
26187 2003-04-22  Dietmar Maurer  <dietmar@ximian.com>
26188
26189         * domain.c (mono_init): initialize mono_defaults.monitor_class
26190
26191 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
26192
26193         * reflection.c (method_encode_code): Add a spicy exception to help
26194         future compiler authors.
26195
26196 2003-04-21  Martin Baulig  <martin@ximian.com>
26197
26198         * icall.c
26199         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
26200         Make this work with relative pathnames; g_filename_to_uri() needs
26201         an absolute filename.
26202
26203 2003-04-18  Zoltan Varga  <vargaz@freemail.hu>
26204
26205         * icall.c: Track name changes in Object and ValueType.
26206
26207 2003-04-18  Dietmar Maurer  <dietmar@ximian.com>
26208
26209         * metadata.c (mono_type_stack_size): size should be a multiple of
26210         sizeof (gpointer)
26211
26212 2003-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26213
26214         * gc.c:
26215         (internal_domain_finalize): moved into mono_domain_finalize. No need
26216         to create another thread because the finalizers will be run in the
26217         finalizer thread.
26218         
26219         (ves_icall_System_GC_WaitForPendingFinalizers): implemented.
26220         (finalizer_notify): if shutting down, wait 2 seconds for the finalizers
26221         to be run (MS does this too).
26222
26223 2003-04-17  Zoltan Varga  <vargaz@freemail.hu>
26224
26225         * object.c (mono_class_compute_gc_descriptor): Update comment.
26226
26227         * loader.h marshal.h marshal.c: Added synchronized method wrappers.
26228
26229         * image.h: Add synchronized wrapper cache.
26230
26231         * image.c (do_mono_image_open): Initialize cache.
26232
26233         * reflection.c (create_dynamic_mono_image): Initialize cache.
26234
26235 2003-04-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26236
26237         * icall.c: patch by Jerome Laban <jlaban@wanadoo.fr> that fixes
26238         ves_icall_System_Buffer_ByteLengthInternal.
26239
26240 Tue Apr 15 13:56:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
26241
26242         * reflection.c: setup klass->nested_in earlier. Allow
26243         a dash in the assembly name.
26244
26245 2003-04-15  Dietmar Maurer  <dietmar@ximian.com>
26246
26247         * metadata.c (mono_type_to_unmanaged): dont access
26248         type->data.klass for MONO_TYPE_OBJECT
26249         (mono_type_to_unmanaged): consider System.Delegate class
26250
26251 Tue Apr 15 11:16:05 CEST 2003 Paolo Molaro <lupus@ximian.com>
26252
26253         * class.c: just setup supertypes in the proper place instead of
26254         initializing the full element class for arrays.
26255
26256 Tue Apr 15 11:03:25 CEST 2003 Paolo Molaro <lupus@ximian.com>
26257
26258         * class.c: ensure the element class of arrays is initialized.
26259         Setup the supertype info for array classes, too.
26260
26261 2003-04-14  Miguel de Icaza  <miguel@ximian.com>
26262
26263         * icall.c (ves_icall_Type_GetNestedType): Add new internal call.
26264
26265 2003-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26266
26267         * Makefile.am: re-added -m option when running cygpath. This way,
26268         MONO_ASSEMBLIES and MONO_CFG_DIR will contain '/' as directory
26269         separator.
26270         * mono-config.c: same codepath for locating mono config file for WIN32
26271         and the rest.
26272         * assembly.c: if mono_assembly_setrootdir is called, don't override
26273         the value set.
26274
26275 2003-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26276
26277         * Makefile.am: patch by Urs Muff <umuff@quark.com> that fixes
26278         MONO_ASSEMBLIES variable.
26279
26280 Fri Apr 11 12:44:15 CEST 2003 Paolo Molaro <lupus@ximian.com>
26281
26282         * icall.c: added Assembly::GetNamespaces() icall.
26283
26284 2003-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26285
26286         * reflection.c: fix from Jaak <jaak@zd.com.pl>.
26287
26288 2003-04-10  Lluis Sanchez Gual  <lluis@ideary.com>
26289
26290         * appdomain.c,appdomain.h,icall.c: Added internal method that returns the process guid
26291         * object.c: fixed bug in the construction of vtable for proxies
26292
26293 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
26294
26295         * object.c (mono_array_new): Mark mono_array_new as an icall.
26296
26297 2003-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26298
26299         * class.c: fixed test for public method when overriding interfaces.
26300         Closes bug #40970.
26301
26302 Wed Apr 9 15:19:41 CEST 2003 Paolo Molaro <lupus@ximian.com>
26303
26304         * appdomain.h, domain.c: added mono_domain_foreach() to
26305         be able to access the currently loaded appdomains.
26306         * object.c: make string interning work across sppdomains.
26307         Mark some functions for use as icalls.
26308
26309 2003-04-09  Zoltan Varga  <vargaz@freemail.hu>
26310
26311         * class.c reflection.c: Fix memory leaks reported by ccmalloc.
26312
26313         * reflection.h reflection.c: Allocate long living data using 
26314         GC_MALLOC_ATOMIC so the collector does not need to scan it.
26315
26316         * reflection.c: Double the allocation size in streams instead of
26317         increasing it, to prevent unneccesary copying on large assemblies.
26318         
26319         * reflection.c (mono_reflection_create_runtime_class): Avoid vtable
26320         creation if the assembly does not have the Run flag set.
26321
26322 Tue Apr 8 11:19:53 CEST 2003 Paolo Molaro <lupus@ximian.com>
26323
26324         * class.h: avoid the C++ keywords in header files (Jerome Laban
26325         spotted and fixed this).
26326
26327 2003-04-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26328
26329         * object.c:
26330         (mono_unhandled_exception): fill in the arguments for the
26331         UnhandledException event. Only trigger that event for the default
26332         domain (as MS does).
26333
26334 2003-04-04  Zoltan Varga  <vargaz@freemail.hu>
26335
26336         * object.c: Improve typed allocation stuff based on suggestions from
26337         Paolo. Also turn it on if the GC library supports it.
26338
26339 2003-04-03  Zoltan Varga  <vargaz@freemail.hu>
26340
26341         * object.c object.h class.h: Added experimental typed allocation
26342         facility using the interfaces in gc_gcj.h.
26343
26344         * os/gc_wrapper.h: Added new include files.
26345         
26346 2003-04-03  Martin Baulig  <martin@ximian.com>
26347
26348         All the following changes are conditional to `WITH_INCLUDED_LIBGC'
26349         which is not yet enabled by default.
26350
26351         * gc.c (mono_gc_init): Set the gc_thread_vtable to our thread
26352         functions.
26353         (mono_gc_lock, mono_gc_unlock): New static functions.
26354
26355         * threads.c (mono_gc_stop_world, mono_gc_start_world): New public
26356         functions; stop/start the world for the garbage collector.  This
26357         is using the windows API; we need to complete the SuspendThread()/
26358         ResumeThread() implementation in the io-layer to make this work on Unix.
26359         (mono_gc_push_all_stacks): New public function; tells the garbage
26360         collector about the stack pointers from all managed threads.
26361
26362 2003-04-03  Martin Baulig  <martin@ximian.com>
26363
26364         * object.h (MonoThread): Added `gpointer stack_ptr'.
26365
26366         * threads.c (start_wrapper): Save the stack pointer in `stack_ptr'.
26367
26368 2003-04-03  Martin Baulig  <martin@ximian.com>
26369
26370         * Makefile.am: It's called `cygpath -w', not `cygpath -m'.
26371
26372 2003-04-03  Zoltan Varga  <vargaz@freemail.hu>
26373
26374         * reflection.c (typebuilder_setup_fields): Initialize field.first and
26375         field.last.
26376
26377 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
26378
26379         * loader.c (mono_lookup_internal_call): Report the corlib that is
26380         out of sync.
26381
26382 2003-03-05  Aleksey Demakov <avd@openlinksw.com>
26383
26384         * icall.c (ves_icall_type_GetTypeCode): fixed check for
26385         System.DBNull (it's class not valuetype).
26386
26387 Wed Apr 2 18:37:35 CEST 2003 Paolo Molaro <lupus@ximian.com>
26388
26389         * reflection.c: set table_idx in MonoReflectionArrayMethod object even 
26390         if the array method was already assigned a token (fixes bug#40646).
26391
26392 2003-04-02  Zoltan Varga  <vargaz@freemail.hu>
26393
26394         * reflection.c (mono_reflection_get_type): Attempt type resolve even
26395         if no assembly is given.
26396
26397 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
26398
26399         * metadata.h: Added the new tables.
26400
26401         * row-indexes.h: Added definitions for new tables.
26402
26403         * metadata.c: Add schemas for new tables, and add support for
26404         computing the sizes of them.
26405
26406         * class.c: Update for handling the new type cases.
26407
26408 2003-04-01  Dietmar Maurer  <dietmar@ximian.com>
26409
26410         * metadata.h (MONO_TYPE_IS_VOID): new macro
26411
26412 2003-03-31  Martin Baulig  <martin@ximian.com>
26413
26414         * threads.h (MonoThreadCallbacks): Added `thread_created'.
26415
26416         * threads.c (mono_thread_new_init): Call `thread_created' in the
26417         mono_thread_callbacks.
26418
26419 2003-03-31  Lluis Sanchez Gual <lluis@ideary.com>
26420
26421         * loader.h: added marshalbyrefobject_class to mono_defaults
26422         * domain.c: added initialization of mono_defaults.marshalbyrefobject_class 
26423         * icall.c: ves_icall_InternalExecute: fixed bug in field setter and in the
26424           generation of output parameters.
26425           ves_icall_Remoting_RealProxy_GetTransparentProxy: added support for interfaces.
26426         * marshal.c: mono_remoting_wrapper(): avoided call through proxy when the type is
26427           contextbound and the target object belongs to the context of the caller.
26428         * object.h: added context and unwrapped_server variables in MonoRealProxy.
26429         * object.c: Implemented support for interfaces and abstract classes
26430           in mono_class_proxy_vtable. Fixed several methods to avoid unneeded calls through
26431           proxy. Fixed problem when dealing with output parameters in mono_runtime_invoke_array.
26432
26433 2003-03-30  Zoltan Varga  <vargaz@freemail.hu>
26434
26435         * class.h class.c (mono_class_is_subclass_of): New function.
26436         
26437         * icall.c (ves_icall_System_Array_FastCopy): Added optimized copy
26438         routines for most common case (calls from ArrayList::ToArray).
26439
26440         * icall.c (ves_icall_System_Environment_Exit): Call profiler shutdown 
26441         routine so programs which call Environment::Exit() can be profiled.
26442
26443         * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle): 
26444         Added MONO_ARCH_SAVE_REGS.
26445
26446         * icall.c (ves_icall_type_is_subtype_of): Use new function.
26447
26448 2003-03-29  Miguel de Icaza  <miguel@ximian.com>
26449
26450         * blob.h: Add a couple of new MonoType types definitions.
26451
26452         * tabledefs.h: Add a couple of new call convs.
26453
26454 2003-03-27  Zoltan Varga  <vargaz@freemail.h>
26455
26456         * reflection.h (MonoReflectionDynamicAssembly): track changes in
26457         the layout of the class.
26458
26459         * reflection.c (alloc_table): double the size on overflow to avoid
26460         unnecessary copying.
26461
26462         * reflection.h reflection.c: If AssemblyBuilderAccess is Run, then
26463         avoid filling out metadata tables and blobs. Also set mb->ilgen to
26464         null so it can be garbage collected.
26465         
26466 2003-03-27  Zoltan Varga  <vargaz@freemail.hu>
26467
26468         * reflection.c (mono_reflection_get_type): Return the resolved type
26469         only if it is in the assembly we searched.
26470
26471         * reflection.c (ensure_runtime_vtable): Initialize method slots.
26472
26473         * class.c (mono_class_setup_vtable): Set the slot of the overriding
26474         method.
26475
26476 2003-03-26  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26477
26478         * appdomain.c:
26479         (set_domain_search_path): allow 'file://blah'. It's an invalid URI,
26480         the right one is 'file:///blah', but MS allows it.
26481         * assembly.c:
26482         (mono_assembly_open): allow 'file://blah'
26483
26484         Fixes bug #40306. Thanks to Mitko Iliev (imitko@openlinksw.co.uk).
26485
26486 2003-03-26  Aleksey Demakov <avd@openlinksw.com>
26487
26488         * socket-io.c: fixes bug #40310.
26489
26490 2003-03-25  Zoltan Varga  <vargaz@freemail.hu>
26491
26492         * reflection.c (mono_reflection_parse_type): handle deeply nested
26493         types correctly.
26494
26495         * reflection.c (mono_image_create_token): Use unique token values
26496         since they will be put into a hash table.
26497
26498         * class.c (mono_class_setup_vtable): If a method occurs in more than
26499         one place in the vtable, and it gets overriden, then change the
26500         other occurances too.
26501
26502         * marshal.c (mono_marshal_get_managed_wrapper): Added support for
26503         object as return type.
26504
26505 2003-03-22  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
26506
26507         * icall.c: Deleted "ToString" implementation for double and float
26508         because they are full implemented in managed code.
26509
26510 Wed Mar 19 18:05:57 CET 2003 Paolo Molaro <lupus@ximian.com>
26511
26512         * reflection.c, reflection.h: implemented and exported functions
26513         to retrieve info about custom attributes.
26514
26515 2003-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26516
26517         * appdomain.c: moved Uri handling to assembly.c
26518         * assembly.c: use g_filename_from_uri (). This makes assembly.LoadFrom
26519         work when using a file Uri in *nix and windows.
26520
26521         * icall.c: fixed Assembly.CodeBase to return a valid Uri. The same for
26522         GetReferencedAssemblies.
26523
26524 2003-03-18  Dick Porter  <dick@ximian.com>
26525
26526         * icall.c: Rename a couple of internal calls
26527
26528         * threads.c: Set the thread state to Stopped when a thread exits.
26529         Fixes bug 39377.
26530
26531 2003-03-17  Zoltan Varga  <vargaz@freemail.hu>
26532
26533         * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle):
26534         New icall.
26535
26536         * object.c (mono_class_vtable): fix warning.
26537
26538 2003-03-17  Zoltan Varga  <vargaz@freemail.hu>  
26539
26540         * icall.c (ves_icall_type_is_subtype_of): Avoid vtable creation.
26541
26542         * reflection.c (mono_blob_entry_hash): Avoid reading uninitialized
26543         memory.
26544         (method_encode_clauses): Create exception info structures in the right
26545         order.
26546         (mono_reflection_setup_internal_class): Initialize supertypes field.
26547
26548         * class.c object.c: Handle interfaces which implement other interfaces 
26549         correctly.
26550
26551         * class.h class.c: Move the supertypes array initialization code into 
26552         a separate function so it can be used for dynamic types too. Also call
26553         it earlier, in mono_class_init(), since it can be used before the
26554         type is initialized.
26555
26556 2003-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26557
26558         * Makefile.am:
26559         * assembly.c:
26560         * icall.c: make MONO_ASSEMBLIES and MONO_CFG_DIR work on windows.
26561
26562         * appdomain.c:
26563         * appdomain.h:
26564         * marshal.c:
26565         * object.c: remove warnings.
26566
26567 2003-03-13  Martin Baulig  <martin@ximian.com>
26568
26569         * debug-mono-symfile.h (MonoSymbolFileLexicalBlockEntry): New type.
26570         (MonoDebugLexicalBlockEntry): New types.
26571
26572         * debug-mono-symfile.c
26573         (_mono_debug_address_from_il_offset): Moved here from ../jit/debug.c.
26574
26575 2003-03-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26576
26577         * process.c: ret can be any non-zero value accroding to MS doc.
26578
26579 2003-03-07  Miguel de Icaza  <miguel@ximian.com>
26580
26581         * class.c (mono_marshal_load_type_info): Fix buglet:  Noticed when
26582         fixing a warning for a miss-used prototype, would have cause
26583         random memory corruption.
26584
26585 2003-03-07  Martin Baulig  <martin@ximian.com>
26586
26587         * marshal.c (mono_marshal_free_array): That "TESTFREE %p" was
26588         getting really annoying ....
26589
26590 2003-03-07  Zoltan Varga  <vargaz@freemail.hu>
26591
26592         * reflection.c (fixup_method): added support for array methods.
26593
26594 Tue Mar 4 18:03:27 CET 2003 Paolo Molaro <lupus@ximian.com>
26595
26596         * socket-io.c:  handle case when AF_INET6 and AF_IPX are not defined
26597         (pointed out by Michael Adams).
26598
26599 2003-03-04  Dick Porter  <dick@ximian.com>
26600
26601         * icall.c: Temporarily reverted the Double and Single ToString()
26602         change, because it broke nunit.
26603
26604 Tue Mar 4 12:40:58 CET 2003 Paolo Molaro <lupus@ximian.com>
26605
26606         * object.h, threads.h: make include files compatible with C++
26607         (patch by Jerome Laban <jlaban@wanadoo.fr>).
26608
26609 2003-03-04  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
26610
26611         * icall.c: Erased ToString helper functions for Double and Single.
26612         Now, that implementations ar all in managed code (Double and Single
26613         Formatters).
26614
26615 2003-03-03  Lluis Sanchez Gual  <lluis@ideary.com>
26616
26617         * appdomain.c: Added method for initializing the default context of
26618         a domain. Added internal call for getting the default context.
26619         * appdomain.h: Added context variable in MonoDomain struct.
26620         * domain.c: mono_domain_set also sets the default context of the domain
26621         * icall.c: Mapped internal method InternalGetDefaultContext.
26622         * object.c: mono_object_get_virtual_method returns always a remoting
26623         wrapper if the object is a transparent proxy.
26624         mono_runtime_invoke_array: when creating an object by calling the
26625         constructor, if the created object is a proxy, then the constructor should
26626         be called using the a remoting wrapper.
26627
26628 2003-03-03  Dick Porter  <dick@ximian.com>
26629
26630         * socket-io.c (create_sockaddr_from_object): Rename sockaddr_un
26631         variable so it compiles on solaris.  Problem spotted by
26632         Christopher Taylor <ct@cs.clemson.edu>
26633
26634 2003-03-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26635
26636         * appdomain.c:
26637         (get_info_from_assembly_name): don't leak value.
26638
26639         * icall.c:
26640         (ves_icall_System_Reflection_Assembly_GetFilesInternal): initialize
26641         result.
26642
26643 Sat Mar 1 15:32:56 CET 2003 Paolo Molaro <lupus@ximian.com>
26644
26645         * assembly.c: export mono_image_load_references ().
26646         * class.c: handle function pointers. mono_class_from_name() now
26647         supports nested type names directly.
26648
26649 2003-02-28  Zoltan Varga  <vargaz@freemail.hu>
26650
26651         * reflection.h reflection.c: Encode already created dynamic methods 
26652         and fields correctly as a DEF instead of a REF.
26653
26654         * reflection.c: Get rid of the force_ref argument to 
26655         mono_image_typedef_or_ref since it was wrong in the first place.
26656
26657         * string-icalls.c: add error checking to string constructors according
26658         to the MSDN docs.
26659
26660         * reflection.c: Emit types in the order their TypeBuilders were 
26661         created. Previously, a new table index was assigned to each type before
26662         the tables were emitted. This was wrong because the signature blob
26663         might already refer to a type by its original table index.
26664
26665 2003-02-27  Zoltan Varga  <vargaz@freemail.hu>
26666
26667         * metadata.c (mono_metadata_nesting_typedef): fix bug in previous
26668         change.
26669         
26670 2003-02-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26671
26672         * Makefile.am: make assemblies dir have \ instead of / on windows.
26673
26674 2003-02-27  Zoltan Varga  <vargaz@freemail.hu>  
26675
26676         * metadata.c metadata.h (mono_metadata_nesting_typedef): changed to
26677         iterate over the NESTEDCLASS table using a linear search since the
26678         table is not guaranteed to be sorted by the secondary key.
26679
26680         * class.c (mono_class_create_from_typedef): fixed up call to
26681         mono_metadata_nesting_typedef.
26682         
26683 2003-02-27  Dietmar Maurer  <dietmar@ximian.com>
26684
26685         * marshal.c (mono_string_to_byvalstr): clear the memory as
26686         suggested by Jerome Laban <jlaban@wanadoo.fr>
26687
26688 2003-02-26  Dick Porter  <dick@ximian.com>
26689
26690         * process.c: Cope with padding in .rsrc blocks
26691
26692 2003-02-26  Dietmar Maurer  <dietmar@ximian.com>
26693
26694         * metadata.h: reverted the filter_len change, it breaks reflection
26695         
26696 2003-02-26  Dietmar Maurer  <dietmar@ximian.com>
26697
26698         * metadata.h: added a new field to store the filter_len
26699         
26700
26701 Tue Feb 25 10:56:16 CET 2003 Paolo Molaro <lupus@ximian.com>
26702
26703         * reflection.c: handle custom attributes for types and members
26704         created with Reflection.Emit (bug#38422).
26705
26706 2003-02-22  Zoltan Varga  <vargaz@freemail.hu>
26707
26708         * reflection.c: define RTSpecialName automatically for constructors for
26709         compatibility with MS.NET.
26710
26711         * reflection.c (mono_reflection_create_runtime_class): initialize
26712         nested_in field of dynamically created classes.
26713
26714 2003-02-22  Martin Baulig  <martin@ximian.com>
26715
26716         * debug-mono-symfile.h: Incremented version number.
26717
26718 2003-02-21  Zoltan Varga  <vargaz@freemail.hu>
26719
26720         * object.h icall.c process.c: fix warnings.
26721
26722 2003-02-21  Zoltan Varga  <vargaz@freemail.hu>
26723
26724         * appdomain.h appdomain.c:
26725         (mono_domain_try_type_resolve): split the 
26726         name_or_tb argument into a name and a tb argument.
26727         (mono_domain_has_type_resolve): new function to check whenever the
26728         application has registered a TypeResolve event handler.
26729         
26730         * icall.c reflection.h reflection.c: move the type resolve logic into
26731         mono_reflection_get_type () so it will be invoked when 
26732         Assembly::GetType () is called.
26733
26734         * reflection.c:
26735         (mono_reflection_get_type): renamed to get_type_internal.
26736         (mono_reflection_get_type): fixed type name generation so it works 
26737         for nested types too.
26738         (mono_reflection_get_type): call has_type_resolve () to avoid the 
26739         costly type name generation if there is no resolve event handler.
26740
26741 Fri Feb 21 11:36:57 CET 2003 Paolo Molaro <lupus@ximian.com>
26742
26743         * class.c, image.c: load exported types from file references.
26744
26745 2003-02-19  Lluis Sanchez Gual  <lluis@ideary.com>
26746
26747         * appdomain.h: Added in MonoDomain a couple of MonoMethod* variables
26748           used to cache the managed methods used to create proxies and make 
26749           remote invocation of methods.
26750         * class.h: Added in MonoVTable a flag to indicate that a class needs 
26751           to be remotely created.
26752         * object.c: Modified the method mono_class_vtable(). It now initializes 
26753           the remote flag of the vtable. Modified mono_object_new_specific(), 
26754           so now it checks the remote flag.
26755         * icall.c: Added a couple of internal methods, one for enabling instance 
26756           creation interception for a type, and one for creating objects bypassing
26757           the remote check.
26758
26759 2003-02-18  Martin Baulig  <martin@ximian.com>
26760
26761         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetMethodToken):
26762         New interncall to get a method's metadata token.
26763
26764         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetMethodToken"):
26765         New interncall for the debugger.
26766
26767 2003-02-18  Dietmar Maurer  <dietmar@ximian.com>
26768
26769         * class.c (mono_class_setup_vtable): allocate supertype array
26770
26771 2003-02-18  Martin Baulig  <martin@ximian.com>
26772
26773         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Added `has_this'.
26774
26775 2003-02-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26776
26777         * reflection.c:
26778         (assembly_name_to_aname): jump over unknown properties (i've found
26779         something like: 'type, assembly, version=xxx, custom=null, public...',
26780         so now will ignore custom=null and still get the rest of the values).
26781
26782 2003-02-17  Dick Porter  <dick@ximian.com>
26783
26784         * threads.c: Have Thread.Start() wait for a semaphore to signal
26785         that the thread has set up all its local data.  This fixes bug
26786         34323, where Abort() raced the new thread's TLS data.
26787
26788         Also removes the handle_store() call from start_wrapper, because
26789         threads are now always created suspended and there is no longer a
26790         race between the parent and child threads to store the info.
26791
26792 Mon Feb 17 13:13:31 CET 2003 Paolo Molaro <lupus@ximian.com>
26793
26794         * image.c: explain the #- heap issue in a message, hopefully
26795         avoiding FAQs on mono-list.
26796
26797 2003-02-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26798
26799         * icall.c:
26800         (GetEntryAssembly): if the domain has not invoked
26801         AppDomain.ExecuteAssembly yet, return the assembly of the default
26802         AppDomain.
26803
26804 2003-02-16  Zoltan Varga  <vargaz@freemail.hu>
26805
26806         * class.c (mono_ldtoken): make it work in dynamic assemblies.
26807
26808 Sun Feb 16 13:10:06 CET 2003 Paolo Molaro <lupus@ximian.com>
26809
26810         * metadata.c, reflection.c: simple speedup to type hash
26811         and equals code.
26812
26813 Sat Feb 15 15:15:03 CET 2003 Paolo Molaro <lupus@ximian.com>
26814
26815         * image.c, image.h, class.c, assembly.c: move module loading
26816         to MonoImage. When loading metadata, consider alignemnet from
26817         the start of metadata, not from the metadata address in memory.
26818
26819 2003-02-13  Zoltan Varga  <vargaz@freemail.hu>
26820
26821         * reflection.c (mono_reflection_get_custom_attrs): Added support for 
26822         AssemblyBuilder objects. Factored out custom attribute creation into
26823         a separate function.
26824         (create_custom_attr): new function to create custom attributes.
26825
26826 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
26827
26828         * Makefile.am: Got tired of typing the full pathname to pedump.
26829         Until there is another option, am installing this.
26830
26831 2003-02-12  Dietmar Maurer  <dietmar@ximian.com>
26832
26833         * class.c (class_compute_field_layout): always set field->parent 
26834         (mono_ldtoken): use mono_defaults.fieldhandle_class;
26835
26836 2003-02-11  Dick Porter  <dick@ximian.com>
26837
26838         * threads-types.h:
26839         * monitor.c: Rewrote Monitor, making lock much faster and
26840         Pulse/Wait work as specified.  Also uses much fewer handles, and only
26841         creates them as needed.
26842
26843         * exception.c: Added SynchronizationLockException
26844
26845         * threads.c: Deleted old Monitor implementation.  The new one is
26846         in a new file.
26847
26848 Mon Feb 10 17:54:10 CET 2003 Paolo Molaro <lupus@ximian.com>
26849
26850         * class.c: handled TypedReference type code. Set the correct size for
26851         class data. Setup interface_offsets for interface classes, too.
26852
26853 2003-02-09  Martin Baulig  <martin@ximian.com>
26854
26855         * debug-mono-symfile.h: Reflect latest symbol writer changes.
26856
26857 Sun Feb 9 18:37:01 CET 2003 Paolo Molaro <lupus@ximian.com>
26858
26859         * loader.c: implemented MEMBERREF_PARENT_TYPEDEF.
26860         * metadata.c, reflection.c: missing MONO_TYPE_TYPEDBYREF handling.
26861         * object.c: fixed mono_object_get_virtual_method () for interfaces.
26862         * verify.c: check for code that runs after the end of the method.
26863
26864 2003-02-08  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
26865
26866         * icall.c: Added "System.Math::Floor", "System.Math::Round" and
26867         "System.Math::Round2".
26868         * sysmath.h: Added Floor, Round and Round2 definitions.
26869         * sysmath.c: Modified certain functions that were not 100% compliant
26870         with MS.NET (math precision) and added the implementation of Floor,
26871         Round and Round2.
26872
26873 2003-02-07  Martin Baulig  <martin@ximian.com>
26874
26875         * debug-mono-symfile.c (mono_debug_symfile_add_method): Ignore interncalls.
26876
26877 2003-02-07  Martin Baulig  <martin@ximian.com>
26878
26879         * debug-mono-symfile.c: Reflected latest symwriter changes.
26880         (mono_debug_create_mono_symbol_file): Removed.
26881         (mono_debug_open_mono_symbol_file): Take an argument which
26882         specifies whether to create a dynamic symbol file.
26883
26884 2003-02-07  Dietmar Maurer  <dietmar@ximian.com>
26885
26886         * class.c (mono_class_from_mono_type): added MONO_TYPE_TYPEDBYREF
26887
26888 2003-02-05  Martin Baulig  <martin@ximian.com>
26889
26890         * reflection.c (mono_image_build_metadata): Make this public,
26891         protect it against being called multiple times, don't create
26892         resources and don't build the compressed metadata here.
26893         (mono_image_create_pefile): Do this here.
26894
26895         * icall.c
26896         ("System.Reflection.Emit.AssemblyBuilder::build_metadata"): Added.
26897
26898 2003-02-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26899
26900         * socket-io.c: fixed bug #36322.
26901
26902 2003-02-06  Piers Haken <piersh@friskit.com>
26903
26904         * appdomain.[ch]:
26905         * class.h:
26906         * debug-mono-symfile.c:
26907         * icall.c:
26908         * loader.c:
26909         * mono-config.c:
26910         * monosn.c:
26911         * reflection.c:
26912         * socket-io.c: warning cleanups
26913
26914 2003-02-06  Dietmar Maurer  <dietmar@ximian.com>
26915
26916         * marshal.c (mono_marshal_get_remoting_invoke_with_check): new
26917         function. works like remoting invoke, but does a check for the Proxy first.
26918
26919 2003-02-05  Miguel de Icaza  <miguel@ximian.com>
26920
26921         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Make it compiler.
26922
26923 2003-02-05  Dietmar Maurer  <dietmar@ximian.com>
26924
26925         * marshal.c (mono_marshal_get_native_wrapper): only allocate an
26926         array of pointers.
26927         (mono_marshal_get_ldfld_wrapper): only generate necessary ldfld wrappers.
26928         (mono_marshal_get_stfld_wrapper): only generate necessary stfld wrappers.
26929
26930         * object.c (mono_store_remote_field_new): used by the new jit
26931         instead of mono_store_remote_field
26932         (mono_load_remote_field_new): used by the new jit
26933         instead of mono_load_remote_field
26934
26935 2003-02-05  Patrik Torstensson
26936
26937         * appdomain.c: changed unload to take the domain id instead
26938         of domain
26939         
26940         * icall.c: changed icall for AppDomain.Unload to AppDomain.InternalUnload
26941
26942
26943 2003-02-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26944
26945         * appdomain.c: don't look for assemblies in ApplicationBase if
26946         PrivateBinPathProbe is set.
26947
26948 2003-02-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26949
26950         * object.c: make the first argument in main_args contain the absolute
26951         path to the assembly. Fixes bug #37511.
26952
26953 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26954
26955         * icall.c: get correct UTC offset for countries not using daylight
26956         time saving. Fixes bug #30030.
26957
26958 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26959
26960         * socket-io.c: support AF_UNIX and use the same layout as MS (bytes 0
26961         and 1 are the family).
26962
26963 2003-02-04  Dietmar Maurer  <dietmar@ximian.com>
26964
26965         * icall.c (ves_icall_InternalExecute): removed wrong assertion
26966
26967         * marshal.c (mono_marshal_get_remoting_invoke): generate valid IL
26968
26969 2003-02-04  Zoltan Varga  <vargaz@freemail.hu>
26970
26971         * reflection.c: added support for SignatureHelper tokens, which is
26972         needed by the Calli opcode.
26973
26974         * reflection.h: track changes to SignatureHelper class.
26975
26976         * metadata.c (mono_metadata_parse_signature): handle dynamic tokens.
26977
26978 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26979
26980         * appdomain.c: fixed loading assemblies from PrivateBinPath.
26981
26982 2003-02-03  Patrik Torstensson
26983         * appdomain.[c|h], domain.c : 
26984          - Added support for getting a domain via domain id
26985          - Support for setting and getting domain from System.AppDomain 
26986            (used in cross appdomain channel)
26987          - Added support for get/set for a MonoAppContext on a thread 
26988            (Context class in System.Runtime.Remoting.Contexts),
26989          - Removed hack in Get/SetData and ExecuteAssembly.
26990         
26991         * icall.c : renamed GetTransparantProxy to InternalGetTransparantProxy to allow
26992         the managed world to get control when a proxy is created.
26993
26994         * icall.c (ves_icall_InternalExecute) : bug fix, must return empty array
26995         
26996 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
26997
26998         * icall.c
26999         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
27000         Populate the codebase field as well.
27001
27002 2003-02-02  Martin Baulig  <martin@ximian.com>
27003
27004         * debug-mono-symfile.c
27005         (MonoSymbolFileMethodAddress): Added `wrapper_address' field.
27006         (mono_debug_symfile_add_method): Allow interncalls.
27007
27008 2003-01-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27009
27010         * icall.c: throw parse exception if strtod fails or the string is empty.
27011
27012 Fri Jan 31 16:09:48 CET 2003 Paolo Molaro <lupus@ximian.com>
27013
27014         * marshal.c: handle object type separately from defined
27015         class types.
27016
27017 Fri Jan 31 16:01:20 CET 2003 Paolo Molaro <lupus@ximian.com>
27018
27019         * marshal.c: handle NATIVE_LPSTR for strings when it's
27020         explicitly specified.
27021
27022 Fri Jan 31 11:51:43 CET 2003 Paolo Molaro <lupus@ximian.com>
27023
27024         * reflection.c, reflection.h, icall.c: setup the reflection
27025         handle cache for ModuleBuilders and AssemblyBuilders.
27026
27027 2003-01-30  Dietmar Maurer  <dietmar@ximian.com>
27028
27029         * reflection.c (reflection_methodbuilder_to_mono_method): set
27030         pinvoke flag
27031
27032 2003-01-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27033
27034         * icall.c: implemented ves_icall_MonoMethod_get_base_definition.
27035
27036 2003-01-29  Dick Porter  <dick@ximian.com>
27037
27038         * threads.c: No need for the fake_thread kludge now that Thread
27039         doesn't run a class constructor
27040         
27041 2003-01-29  Dick Porter  <dick@ximian.com>
27042
27043         * threads.c: Use g_direct_hash instead of the rather bogus
27044         g_int_hash
27045
27046 2003-01-29  Dietmar Maurer  <dietmar@ximian.com>
27047
27048         * marshal.c (mono_marshal_get_native_wrapper): add check for null
27049         (fix pinvoke12.exe)
27050         (mono_marshal_get_struct_to_ptr): generate valid IL code
27051         (mono_marshal_get_ptr_to_struct): generate valid IL code
27052         (*): correctly set sig->pinvoke, we need to memdup the signature
27053         to do that
27054
27055 Tue Jan 28 22:57:57 CET 2003 Paolo Molaro <lupus@ximian.com>
27056
27057         * marshal.c, marshal.h: use larger integers in mono_mb_emit_add_to_local()
27058         to avoid overflows (bug spotted and fixed by Jerome Laban <jlaban@wanadoo.fr>).
27059
27060 Tue Jan 28 18:55:19 CET 2003 Paolo Molaro <lupus@ximian.com>
27061
27062         * profiler.c: provide more callers information.
27063
27064 2003-01-28  Dietmar Maurer  <dietmar@ximian.com>
27065
27066         * marshal.c (mono_marshal_get_managed_wrapper): generate valid IL code
27067
27068         * appdomain.h:added fix from Patrik: _MonoAppDomain is a MBR object
27069
27070         * marshal.c (mono_marshal_get_native_wrapper): generate valid IL code
27071
27072 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
27073
27074         * icall.c: (ves_icall_System_CurrentTimeZone_GetTimeZoneData): raise an
27075         exception instead of going into an infinite loop on dates which it 
27076         can't yet handle.
27077
27078         * string-icalls.c (ves_icall_System_String_get_Chars): raise 
27079         out-of-range exception if needed.
27080
27081         * class.c (mono_class_setup_vtable): allow a virtual method to provide
27082         an implementation for an interface method and to override an inherited
27083         method at the same time. 
27084         Imagine a scenario when a virtual method is used to override a
27085         virtual abstract method in a parent class, and this same method 
27086         provides an implementation for an method inherited from an interface. 
27087         In this case, the interface resolution code will set im->slot, which 
27088         means that the virtual method override pass will skip this method 
27089         which means a pointer to the abstract method inherited from the parent
27090         will remain in the vtable of this non-abstract class.
27091
27092         * class.c: (mono_class_setup_vtable): continue search for a real 
27093         method if only an abstract method is found.     
27094
27095 Mon Jan 27 17:12:19 CET 2003 Paolo Molaro <lupus@ximian.com>
27096
27097         * reflection.c: add size to encoding for ByValStr and ByValArray
27098         marshal blob (from "Jerome Laban" <jlaban@wanadoo.fr>).
27099
27100 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
27101
27102         * class.c (mono_class_setup_vtable): pass the override info as an
27103         argument.
27104
27105         * class.c (mono_class_setup_vtable): set the slot of overriding methods
27106         correctly.
27107         
27108         * reflection.c (ensure_runtime_vtable); add support for method 
27109         overrides.
27110         
27111 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
27112
27113         * reflection.c (resolution_scope_from_image): Hack to work to work with
27114         dynamic assemblies.
27115
27116         * reflection.c (mono_image_typedef_or_ref): renamed to ..._aux and 
27117         added a 'force_ref' argument to force this function to allways return 
27118         a TypeRef. This is needed by mono_image_get_memberref_token ().
27119         
27120 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
27121
27122         * reflection.c (mono_image_get_type_info): interfaces really don't have
27123         a parent.
27124
27125         * reflection.c (mono_image_basic_init): fill out missing fields of
27126         image structure.
27127
27128         * reflection.c (mono_image_basic_init): Invoke assembly load hooks for 
27129         dynamic assemblies. This is required so dynamic assemblies show up in
27130         AppDomain.GetAssemblies (), emit an AssembyLoadEvent, gets searched by
27131         Type::GetType() etc. This is consistent with MS behaviour.
27132
27133         * image.c image.h reflection.c: add newly created classes to the name 
27134         cache so mono_class_get () will find them.      
27135
27136 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
27137
27138         First part of changes to get IKVM.NET running under mono.
27139         
27140         * appdomain.h, appdomain.c: added new function 
27141         mono_domain_try_type_resolve() which will emit TypeResolve events. 
27142         This function will call AppDomain::DoTypeResolve to do the actual work.
27143
27144         * class.h, class.c, loader.c, object.c, reflection.h, reflection.c: 
27145         moved existing code dealing with dynamic tokens to a new function 
27146         called mono_reflection_lookup_dynamic_token (). This function will 
27147         raise TypeResolve events when appropriate. Since reflection.c is not 
27148         part of libmetadata, a new hook function called 
27149         mono_lookup_dynamic_token() is added to class.c which will call this.
27150
27151         * assembly.h assembly.c: make the invoke_load_hook function public,
27152         so it can be called for dynamic assemblies.
27153
27154         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): skip interfaces since they do not have initializers.
27155
27156         * icall.c (ves_icall_type_from_name): emit a TypeResolve event if the 
27157         type isn't found.
27158
27159         * reflection.c reflection.h: change MonoDynamicAssembly.tokens to a 
27160         MonoGHashTable, since it contains pointers to objects which the GC 
27161         needs to track.
27162
27163         * assembly.c (search_loaded): remove unused variable.
27164         
27165 Mon Jan 27 12:18:45 CET 2003 Paolo Molaro <lupus@ximian.com>
27166
27167         * object.c: fixed issue exposed by gcc-generated IL programs
27168         that use RVA data for pointers.
27169
27170 2003-01-25  Martin Baulig  <martin@ximian.com>
27171
27172         * threads.c (start_wrapper): Moved the initialization of
27173         `start_func' above the mono_new_thread_init() call to which we
27174         pass it as argument.
27175
27176 2003-01-24  Martin Baulig  <martin@ximian.com>
27177
27178         * threads.h (MonoThreadCallbacks): Pass the thread ID instead of
27179         the MonoThread pointer.
27180
27181 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
27182
27183         * icall.c: Rename `PowImpl' to Pow.
27184
27185 2003-01-23  Dick Porter  <dick@ximian.com>
27186
27187         * threads.c (start_wrapper): Create a Thread object if needed, so
27188         the Main() thread can do the class initialisation in a subthread
27189         that has been set up to allow managed code execution.
27190
27191         Pass the thread ID instead of the MonoThread pointer to the thread
27192         start and attach callbacks.  This change is required, because the
27193         jit thread start callback must be called _before_ the Thread
27194         object can be created.
27195         
27196         (mono_thread_init): Removed much object creation code that is no
27197         longer needed.  No managed code is called from here now.
27198
27199         * object.c (mono_runtime_exec_managed_code): Create a subthread
27200         for Main, and call back to the runtime to use it.
27201         Set the exit code when Main exits.
27202
27203         * gc.c: Make sure domain finalisation happens in a subthread.
27204         Re-enable threaded GC, fixing bug 31333 (again).
27205
27206         * environment.c: System.Environment internall calls (so far just
27207         ExitCode is here, the others are still in icall.c)
27208
27209         * appdomain.c (mono_runtime_cleanup): All threads running managed
27210         code should have finished before mono_runtime_cleanup() is
27211         reached, so no need to clean up threads.
27212
27213 2003-01-22  Martin Baulig  <martin@ximian.com>
27214
27215         * appdomain.h (MonoThreadStartCB): Added `MonoThread *thread' and
27216         `gpointer func' arguments.      
27217         (MonoThreadAttachCB): New typedef; like the old MonoThreadStartCB,
27218         but added `MonoThread *thread' argument.
27219         (mono_runtime_init): The last argument is now a MonoThreadAttachCB.
27220
27221         * threads.c (mono_new_thread_init): Added `gpointer func' argument
27222         and pass it to the mono_thread_start_cb callback.
27223         (mono_install_thread_callbacks): New public function to install a
27224         set of callbacks which are set by the debugger.
27225         (mono_thread_init): The last argument is now a MonoThreadAttachCB.
27226
27227 2003-01-22  Martin Baulig  <martin@ximian.com>
27228
27229         * Makefile.am: Install debug-mono-symfile.h.
27230
27231 2003-01-21  Aleksey Demakov <avd@openlinksw.com>
27232
27233         * marshal.c: fixed copy_from_managed and copy_to_unmanaged for 0 length.
27234
27235 2003-01-21  Dietmar Maurer  <dietmar@ximian.com>
27236
27237         * added the following fix from Jackson Harper <jackson@latitudegeo.com>
27238         * class.c (mono_ptr_class_get): correctly set access levels of pointers
27239         (mono_array_class_get): correctly set access levels of arrays
27240
27241 2003-01-20      Patrik Torstensson
27242         * image.h (MonoAssemblyName): changed major, minor, build, revision
27243         from signed to unsigned.
27244
27245 2003-01-20  sean kasun <skasun@azstarnet.com>
27246
27247         * reflection.c (load_cattr_value): Now this handles
27248         MONO_TYPE_SZARRAY.  Fixes bug #35629
27249
27250 2003-01-20  Miguel de Icaza  <miguel@ximian.com>
27251
27252         * marshal.c (emit_struct_conv): Handle MONO_TYPE_PTR as an
27253         integer value
27254
27255 2003-01-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27256
27257         * decimal.c: fixed bug #26056.
27258
27259 2003-01-17  Martin Baulig  <martin@ximian.com>
27260
27261         * gc.c: Raise an ExecutionEngineException instead of using g_error().
27262
27263 2003-01-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27264
27265         * exception.[ch]:
27266         (mono_get_exception_type_initialization): new function.
27267
27268         * object.c: throw a TypeInitializationException when an exception is
27269         thrown invoking the class constructor.
27270
27271 2003-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27272
27273         * reflection.c: fixed attribute reading.
27274
27275 2003-01-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27276
27277         * icall.c:
27278         (ves_icall_type_from_name): make it work as MS. Ie, if no assembly name
27279         provided, look for the type in the calling assembly and then in
27280         mscorlib; if the assembly name is provided, only try that one.
27281
27282 Tue Jan 14 14:52:52 CET 2003 Paolo Molaro <lupus@ximian.com>
27283
27284         * object.c: register the vtable before there is a chance it's
27285         queried again recursively.
27286
27287 2003-01-13  Duncan Mak  <duncan@ximian.com>
27288
27289         * Makefile.am (libmonoruntime_la_SOURCES): Change gc.h to
27290         gc-internal.h. 
27291         
27292 2003-01-12  Patrik Torstensson <totte@race-x-change.com>
27293
27294         * string-icall.[c|h], icall.c: Added support for CompareOrdinal mode
27295
27296 2003-01-11  Martin Baulig  <martin@ximian.com>
27297
27298         * debug-mono-symfile.h (MONO_SYMBOL_FILE_DYNAMIC_VERSION): Incremented
27299         this to 20 for the release.
27300
27301 2003-01-10  Dietmar Maurer  <dietmar@ximian.com>
27302
27303         * marshal.c (emit_struct_conv): added support for EXPLICIT_LAYOUT
27304
27305         * loader.c (mono_method_get_marshal_info): bug fix
27306
27307         * marshal.c (mono_marshal_get_ptr_to_struct): don't convert
27308         structures with explicit layout
27309
27310 Fri Jan 10 15:58:09 CET 2003 Paolo Molaro <lupus@ximian.com>
27311
27312         * profiler.c: made the output more readable (and sorted). 
27313         Added caller information for the allocation profiler.
27314
27315 2003-01-09  Sebastien Pouliot  <spouliot@videotron.ca>
27316
27317         * icall.c, rand.c, rand.h: Prepended RNG functions with Internal.
27318
27319 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27320
27321         * icall.c: added ves_icall_System_Activator_CreateInstanceInternal. Used
27322         to get value types.
27323         
27324 Thu Jan 9 19:43:11 CET 2003 Paolo Molaro <lupus@ximian.com>
27325
27326         * object.c, profiler.h, profiler.c, profiler-private.h:
27327         Added object allocation profiler.
27328
27329 Thu Jan 9 16:17:00 CET 2003 Paolo Molaro <lupus@ximian.com>
27330
27331         * reflection.h, reflection.c: handle global methods.
27332         Compress blob entries.
27333
27334 Thu Jan 9 15:54:53 CET 2003 Paolo Molaro <lupus@ximian.com>
27335
27336         * marshal.c: fix compilation.
27337
27338 2003-01-09  Dietmar Maurer  <dietmar@ximian.com>
27339
27340         * loader.c (mono_method_get_marshal_info): impl.
27341
27342         * metadata.c (mono_metadata_field_info): use mono_metadata_get_marshal_info
27343
27344 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27345
27346         * icall.c: applied fix from Zoltan Varga that fixes Type.IsPrimitive
27347         for reference types.
27348
27349 Wed Jan 8 20:11:46 CET 2003 Paolo Molaro <lupus@ximian.com>
27350
27351         * loader.c: fixed off by one error in loaded parameter names.
27352
27353 2003-01-08  Dietmar Maurer  <dietmar@ximian.com>
27354
27355         * marshal.c (mono_marshal_get_icall_wrapper): like
27356         mono_marshal_get_native_wrapper, but simpler and use a MonoMethodSignature
27357         instead of a MonoMethod.
27358
27359 2003-01-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27360
27361         * decimal.c: fixed bug #36537.
27362
27363 Mon Jan 6 19:37:59 CET 2003 Paolo Molaro <lupus@ximian.com>
27364
27365         * marshal.c: throw a missing method exception if a
27366         P/Invoke method is not found.
27367
27368 Sun Jan 5 11:57:09 CET 2003 Paolo Molaro <lupus@ximian.com>
27369
27370         * icall.c: allow a null this for constructors.
27371
27372 Sat Jan 4 18:28:42 CET 2003 Paolo Molaro <lupus@ximian.com>
27373
27374         * icall.c: raise the proper exceptions if the arguments to the
27375         internal Invoke are incorrect.
27376
27377 2003-01-03  Dietmar Maurer  <dietmar@ximian.com>
27378
27379         * marshal.c (mono_marshal_get_ptr_to_struct): code cleanups
27380
27381 2003-01-03  Martin Baulig  <martin@ximian.com>
27382
27383         * debug-mono-symfile.h: Increment MONO_SYMBOL_FILE_DYNAMIC_VERSION.
27384
27385 2002-12-31  Martin Baulig  <martin@ximian.com>
27386
27387         * debug-mono-symfile.c: Completely rewrote the type section.
27388         Instead of using individual malloc()ed fields, we use one big
27389         continuous memory area and offsets into this area.
27390         See the comments in the source code for details.
27391
27392 2002-12-30  Martin Baulig  <martin@ximian.com>
27393
27394         * debug-mono-symfile.h (MonoDebugTypeInfo): Renamed to MonoDebugClassInfo.
27395
27396 2002-12-30  Martin Baulig  <martin@ximian.com>
27397
27398         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Include the
27399         line number table in this data blob instead of using an external
27400         pointer.
27401
27402 2002-12-28  Martin Baulig  <martin@ximian.com>
27403
27404         * debug-mono-symfile.h: Increment MONO_SYMBOL_FILE_DYNAMIC_VERSION.
27405
27406 2002-12-22  Rachel Hestilow  <hestilow@ximian.com>
27407
27408         * marshal.c (mono_marshal_get_runtime_invoke): Support MONO_TYPE_CHAR
27409         as a boxed return type.
27410
27411 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
27412
27413         * appdomain.c
27414         (ves_icall_System_AppDomainSetup_InitAppDomainSetup): Use
27415         g_build_filename to properly get separators on the filename created.
27416
27417         * object.h: Small change, introduce MonoMarshalByRefObject to
27418         track the layout of that structure in the C# universe as we make
27419         changes there.
27420
27421 Thu Dec 19 16:23:19 CET 2002 Paolo Molaro <lupus@ximian.com>
27422
27423         * object.c: removed assert to allow static fields on interfaces.
27424         * loader.c: a TypeSpec may be used for any type, not just arrays.
27425
27426 Thu Dec 19 14:19:42 CET 2002 Paolo Molaro <lupus@ximian.com>
27427
27428         * class.c, class.h: added mono_class_array_element_size ().
27429         Ignore static methods in interfaces.
27430
27431 2002-12-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27432
27433         * threads.c: fixed the build under cygwin.
27434
27435 Wed Dec 18 18:43:47 CET 2002 Paolo Molaro <lupus@ximian.com>
27436
27437         * reflection.c: handle nullref constants. Allocate keys for
27438         reflection handles with the GC.
27439
27440 Wed Dec 18 11:34:18 CET 2002 Paolo Molaro <lupus@ximian.com>
27441
27442         * threads.c, threads.h: added mono_thread_get_abort_signal()
27443         to get a suitable signal for thread abort.
27444
27445 Wed Dec 18 11:26:18 CET 2002 Paolo Molaro <lupus@ximian.com>
27446
27447         * metadata.c: fix handling of ExportedType table.
27448
27449 2002-12-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27450
27451         * icall.c: added WriteWindowsDebugString internal call.
27452
27453 2002-12-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27454
27455         * reflection.h: added fields to match C# implementation.
27456
27457 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27458
27459         * icall.c: patch from Jaroslaw Kowalski to fix Environment.MachineName.
27460
27461 2002-12-12  Juli Mallett  <jmallett@FreeBSD.org>
27462
27463         * gc.h, gc-internal.h: Rename header for GC internal calls to
27464         gc-internal.h from gc.h as to not clash with Boehm GC having its
27465         header installed as <gc.h> in outside include paths.
27466         * appdomain.c, gc.c, icall.c, object.c: Account for aforementioned.
27467         * threads.c: If SIGRTMIN is not defined, fall back to SIGUSR1.
27468
27469 2002-12-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27470
27471         * icall.c: assign minor, build and revision in FillName.
27472
27473 2002-12-11  Zoltan Varga  <vargaz@freemail.hu>
27474
27475         * image.h reflection.h reflection.c class.h class.c loader.c object.c:
27476         Added support for running code generated by Reflection.Emit.
27477
27478 2002-12-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27479
27480         * appdomain.c: check for NULL argument in LoadFrom.
27481
27482 2002-12-10  Dick Porter  <dick@ximian.com>
27483
27484         * threads.c: WaitHandle fixes from Tum <tum@veridicus.com>
27485
27486 2002-12-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27487
27488         * appdomain.c: fix buglet when building exe file name.  Handle full
27489         assembly name (needed after latest changes to AssemblyName).
27490         * image.c:
27491         (mono_image_close): free some hashtables.
27492
27493 2002-12-05  Dietmar Maurer  <dietmar@ximian.com>
27494
27495         * threads.c (ves_icall_System_Threading_Thread_Abort): we use SIGRTMIN 
27496         instead of SIGUSR1, because SIGUSR1 is used by the pthread implementation 
27497         on some systems (redhat 7.3) 
27498
27499 Thu Dec 5 16:13:40 CET 2002 Paolo Molaro <lupus@ximian.com>
27500
27501         * threads.c: delete the critical section of a sync block,
27502         spotted and fixed by tum@veridicus.com (Thong (Tum) Nguyen).
27503
27504 Thu Dec 5 12:52:52 CET 2002 Paolo Molaro <lupus@ximian.com>
27505
27506         * pedump.c, cil-coff.h, monosn.c: add strong name cli header flag.
27507
27508 2002-12-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27509
27510         * appdomain.[ch]: handle the assembly preload event to try loading the
27511         assemblies using the paths we have in the current domain.
27512
27513         * assembly.[ch]: created an assembly preload hook that is called to try
27514         loading the assembly by other means that the ones provided here.
27515
27516         * domain.c: initialize the domain search path.
27517
27518         From now on, assemblies (TODO: except corlib and System) are loaded
27519         according to these rules when using mono_assembly_load ():
27520
27521                 1. It tries to load the assembly from the ApplicationBase
27522                 of the current domain appending .dll and .exe (TODO: have to
27523                 try loading from name/name.dll and name/name.exe).
27524
27525                 2. It tries the search path specified in PrivateBinPath for the
27526                 current domain (if any).
27527
27528                 3. Previous behavior.
27529
27530 Wed Dec 4 16:02:25 CET 2002 Paolo Molaro <lupus@ximian.com>
27531
27532         * icall.c: implemented GetInterfaceMap() related icall.
27533         * domain.c, loader.h: load MethodInfo in mono_defaults.
27534
27535 Wed Dec 4 11:02:30 CET 2002 Paolo Molaro <lupus@ximian.com>
27536
27537         * gc.c: disable the finalizer thread for now, untill all the issues
27538         with it are resolved.
27539
27540 Wed Dec 4 10:44:01 CET 2002 Paolo Molaro <lupus@ximian.com>
27541
27542         * string-icalls.c: handle embedded nulls in string ctor when the
27543         length is specified.
27544
27545 Tue Dec 3 19:29:20 CET 2002 Paolo Molaro <lupus@ximian.com>
27546
27547         * class.c: look for explicit interface implementation in parent
27548         classes, too.
27549
27550 2002-12-03  Dietmar Maurer  <dietmar@ximian.com>
27551
27552         * gc.c (run_finalize): dont run the finalizer (strange behaviour on rh7.3) 
27553
27554 Tue Dec 3 12:40:06 CET 2002 Paolo Molaro <lupus@ximian.com>
27555
27556         * gc.c: protect handles with a critical section.
27557
27558 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27559
27560         * icall.c:
27561         (ves_icall_type_from_name): it now has throwOnError and ignoreCase
27562         parameters. If no assembly specified, try getting the type from all
27563         the assemblies in the current domain, else, load the assembly and get
27564         the type from it.
27565
27566 2002-11-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27567
27568         * marshal.c: applied patch from Aleksey Demakov that fixes
27569         ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringUni.
27570
27571 2002-11-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27572
27573         * icall.c: fixed get_location.
27574
27575 2002-11-28  Dietmar Maurer  <dietmar@ximian.com>
27576
27577         * icall.c: moved MONO_ARCH_SAVE_REGS to the end of the
27578         declarations to make it work with older gcc. 
27579
27580         * loader.c (mono_get_method): set signature->pinvoke for native calls
27581
27582 2002-11-20  Dick Porter  <dick@ximian.com>
27583
27584         * threads.c (mono_thread_init): Set the main thread's handle
27585
27586 Tue Nov 19 14:15:34 CET 2002 Paolo Molaro <lupus@ximian.com>
27587
27588         * gc.c: allow compilation without GC support. Changed to match the
27589         mono coding style.
27590
27591 Mon Nov 18 18:41:51 CET 2002 Paolo Molaro <lupus@ximian.com>
27592
27593         * gc.c: don't start the finalizer thread if the env var GC_DONT_GC is set.
27594
27595 Mon Nov 18 16:35:22 CET 2002 Paolo Molaro <lupus@ximian.com>
27596
27597         * reflection.c: set a public key token on the core assemblies.
27598
27599 2002-11-18  Dick Porter  <dick@ximian.com>
27600
27601         * threads.c: Split out some thread initialisation so that other
27602         files can set the start callback function.
27603
27604         * gc.c: Run finalisers in a separate thread, to avoid stack
27605         overflow.  Fixes bug 31333.
27606
27607         * appdomain.c: Set up GC finalisation thread.
27608
27609         * reflection.c: 
27610         * object.c: 
27611         * domain.c: Use gc.h macros for GC_malloc
27612         
27613 2002-11-15  Dick Porter  <dick@ximian.com>
27614
27615         * threadpool.c: 
27616         * threads.c:
27617         * appdomain.c: Removed mono_runtime_init_with_attach(),
27618         mono_thread_create_arg(), and mono_thread_init_with_attach(), by
27619         merging the extra parameter with the existing function.  Removed
27620         unneeded code in mono_thread_attach().
27621
27622 2002-11-14  Dietmar Maurer  <dietmar@ximian.com>
27623
27624         * image.c (mono_image_loaded_by_guid): a method to get loaded
27625         images by guid. 
27626         (load_metadata_ptrs): we store the guid as string.
27627
27628 2002-11-11  Dietmar Maurer  <dietmar@ximian.com>
27629
27630         * assembly.c (mono_assembly_open): check the guid of aot compiled lib.
27631
27632         * metadata.c (mono_guid_to_string): imported method form Zoltan
27633         Varga (slightly modified)
27634
27635         * assembly.c (mono_assembly_open): load precompiled code
27636
27637         * loader.h (MonoMethod): we store the method token for use in the
27638         aot compiler. 
27639
27640 2002-11-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27641
27642         * appdomain.c: insert the loaded assemblies in the domain->assemblies in
27643         the hook function called when an assembly is loaded.
27644         
27645         * domain.c: Modified file.
27646         (mono_domain_assembly_load): removed hash table insertion of assemblies.
27647
27648         Fixes bug #33196.
27649
27650 2002-11-07  Miguel de Icaza  <miguel@ximian.com>
27651
27652         * reflection.c: Map PEFileKind to the value expected by the WinNT
27653         image loader. 
27654
27655 2002-11-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27656
27657         * rand.c: use /dev/urandom. If it fails to open, use the previous one.
27658         Read until the buffer is filled completely.
27659
27660 2002-11-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27661
27662         * icall.c: implemented MonoType.InternalGetEvent ().
27663
27664 2002-11-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27665
27666         * appdomain.c: implemented InitAppDomainSetup. Delayed
27667         AppDomain.SetupInformation until mono_runtime_exec_main, where we get
27668         the entry_assembly.
27669
27670         * assembly.c: base_dir is now an absolute path ending with
27671         G_DIR_SEPARATOR.
27672
27673         * icall.c: modified get_location according to the above changes.
27674
27675         * object.c: init AppDomain.SetupInformation for the default domain after
27676         we have the entry assembly.
27677
27678         * domain.c: when unloading a domain, setup = NULL.
27679
27680 2002-11-04  Dietmar Maurer  <dietmar@ximian.com>
27681
27682         * marshal.c (emit_ptr_to_str_conv): try to fix bug 29548
27683
27684 Sun Nov 3 15:39:28 CET 2002 Paolo Molaro <lupus@ximian.com>
27685
27686         * object.h, object.c: introduced mono_object_get_virtual_method ()
27687         to lookup the method invoked on an object when a callvirt is done on
27688         a method.
27689         * icall.c: make MethodInfo::Invoke() always do a virtual call.
27690
27691 2002-11-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27692
27693         * appdomain.c: invoke AssemblyLoad and AsemblyResolve events in the
27694         current domain when loaded an assembly and failed to load it.
27695
27696         * icall.c: changed ...Assembly_GetType to Assembly_InternalGetType.
27697
27698 2002-10-31  Dick Porter  <dick@ximian.com>
27699
27700         * icall.c: 
27701         * file-io.h: 
27702         * file-io.c: Return the error status in a parameter, as the
27703         GetLastError() value has long since been blown away if we try and
27704         look it up in a subsequent internal call invocation.  Delete the
27705         GetLastError() internal call, because it's useless.
27706
27707 2002-10-31  Dietmar Maurer  <dietmar@ximian.com>
27708
27709         * class.[ch]: added cast_class to fix bug 29517
27710
27711 Wed Oct 30 19:37:32 CET 2002 Paolo Molaro <lupus@ximian.com>
27712
27713         * marshal.c: create valid IL code in the filter clause:
27714         the new JIT is less forgiving:-)
27715
27716 2002-10-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27717
27718         * icall.c: removed get_property internal call.
27719
27720 2002-10-25  Zoltan Varga  <vargaz@freemail.hu>
27721
27722         * appdomain.h domain.c: Added an ID to appdomains.
27723         
27724         * threads.c threads.h icall.c: Implement icall
27725         Thread:GetDomainID(), and remove unused icall 
27726         CurrentThreadDomain_internal.
27727
27728 2002-10-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27729
27730         * icall.c: Don't recurse through the base types in GetConstructor.
27731         Fixes bug #32063. 
27732
27733 Thu Oct 24 16:56:00 CEST 2002 Paolo Molaro <lupus@ximian.com>
27734
27735         * mempool.h, mempool.c: added mono_mempool_empty() and
27736         mono_mempool_stats().
27737
27738 2002-10-23  Dick Porter  <dick@ximian.com>
27739
27740         * file-io.c: 
27741         * file-io.h: 
27742         * icall.c: Added MonoIO.GetFileType internal call
27743
27744 2002-10-17  Dick Porter  <dick@ximian.com>
27745
27746         * appdomain.c (mono_runtime_cleanup): Don't signal the async
27747         delegate semaphore before waiting for all threads to finish,
27748         because new threads can also call async delegates.  Fixes bug
27749         32004.
27750
27751         * threadpool.c (async_invoke_thread): Only wait for 500ms instead
27752         of 3 seconds, in case another async job is queued.  (This part is
27753         needed because the bug fix reintroduced the 3s exit lag.)  This
27754         makes the mono_runtime_shutdown flag superfluous.
27755
27756 Thu Oct 17 13:11:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
27757
27758         * reflection.c: include ehader size in method section headers.
27759         Really check for suplicated modules entries.
27760
27761 2002-10-17  Martin Baulig  <martin@gnome.org>
27762
27763         * debug-mono-symfile.c: Added back support for locals.
27764
27765 2002-10-14  Martin Baulig  <martin@gnome.org>
27766
27767         * debug-mono-symfile.c: Added MONO_TYPE_I, MONO_TYPE_U and
27768         MONO_TYPE_VOID.
27769
27770 2002-10-14  Martin Baulig  <martin@gnome.org>
27771
27772         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetType): Use
27773         mono_class_get() instead of looking in the class cache. 
27774
27775 2002-10-13  Martin Baulig  <martin@gnome.org>
27776
27777         * debug-mono-symfile.c: Set version number to 28, include the
27778         signature in method names.
27779
27780 2002-10-13  Martin Baulig  <martin@gnome.org>
27781
27782         * debug-mono-symfile.h: Set version number to 27.
27783
27784 2002-10-11  Martin Baulig  <martin@gnome.org>
27785
27786         * gc.c: Don't register/unregister NULL pointers as disappearing links.
27787
27788 Thu Oct 10 14:56:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
27789
27790         * metadata.c, metadata.h: added helper function to allocate signatures.
27791
27792 2002-10-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27793
27794         * icall.c: added internal call to get the location of machine.config.
27795
27796 2002-10-08  Martin Baulig  <martin@gnome.org>
27797
27798         * debug-mono-symfile.c: Ignore classes with a pending init for the
27799         moment.
27800
27801 2002-10-03  Dick Porter  <dick@ximian.com>
27802
27803         * threads.c: Freebsd pthread_t is a pointer
27804
27805 2002-10-03  Dick Porter  <dick@ximian.com>
27806
27807         * socket-io.c: Implemented GetHostName_internal
27808
27809 2002-10-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27810
27811         * mono-config.c:
27812         (mono_config_parse_file): don't leak the text.
27813
27814 2002-10-02  Martin Baulig  <martin@gnome.org>
27815
27816         * debug-mono-symfile.c: Added support for methods.
27817
27818 2002-10-01  Martin Baulig  <martin@gnome.org>
27819
27820         * debug-mono-symfile.c: Don't emit methods and line numbers for
27821         the dynamic symbol file, just write the type table.  We can easily
27822         have an external helper program which creates a symbol file for an
27823         IL file.        
27824
27825 2002-10-01  Dick Porter  <dick@ximian.com>
27826
27827         * threads.c (ves_icall_System_Threading_Thread_Start_internal):
27828         Only add the handle to the cleanup array when we're about to
27829         launch the thread.  Bug 31425 deadlocked when the test was run on
27830         mono under w32.
27831
27832 2002-10-01  Martin Baulig  <martin@gnome.org>
27833
27834         * debug-mono-symfile.c: Added support for properties.
27835
27836 Fri Sep 27 18:55:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
27837
27838         * reflection.c: unaligned store fix from Mark Crichton
27839         <crichton@gimp.org>.
27840
27841 2002-09-27  Martin Baulig  <martin@gnome.org>
27842
27843         * icall.c ("System.Reflection.Assembly::GetReferencedAssemblies"):
27844         New interncall.
27845
27846 Fri Sep 27 15:38:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
27847
27848         * assembly.h, assembly.c: use a sane API to hook into the assembly
27849         loading process instead of a useless special-purpouse hack
27850         (ngen needs a hook, too, for example).
27851
27852 2002-09-27  Dick Porter  <dick@ximian.com>
27853
27854         * threads.c (mono_thread_init): Call GetCurrentProcess() so
27855         io-layer can set up some process handle info.  Not needed on w32,
27856         but doesn't hurt either.
27857
27858         * process.c: Pass the program name in the second parameter to
27859         CreateProcess, so the path is searched.  Include the working
27860         directory. Implemented process name, process enumeration, and some
27861         process detail internal calls.
27862         
27863         * icall.c: Added internal calls for process lookup, and some
27864         process details
27865
27866 2002-09-26  Martin Baulig  <martin@gnome.org>
27867
27868         * assembly.c (mono_install_open_assembly_hook): New global
27869         function to install a function to be invoked each time a new
27870         assembly is loaded.
27871         (mono_assembly_open): Run this callback function if set.
27872
27873         * debug-mono-symfile.c: Put back line numbers for the dynamic
27874         symbol file and also record the .il file as source file.  This
27875         allows us to install the temporary symbol file as `file.dbg' just
27876         like a compiler-generated one.
27877
27878 2002-09-26  Nick Zigarovich <nick@chemlab.org>
27879
27880         * Corrected typo in gc.c (BOHEM vs BOEHM).
27881
27882 2002-09-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27883
27884         * icall.c: fixed bug #31235 by copying a few lines from GetMethods to
27885         GetProperties. Also avoid calling g_slist_length in GetProperties and
27886         GetMethods.
27887
27888 Wed Sep 25 22:18:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
27889
27890         * reflection.c: avoid unaligned stores (bug spotted by
27891         Mark Crichton  <crichton@gimp.org>).
27892
27893 2002-09-25  Martin Baulig  <martin@gnome.org>
27894
27895         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Use pointers
27896         instead of guint64 for addresses and added prologue/epilogue info.
27897
27898 2002-09-25  Martin Baulig  <martin@gnome.org>
27899
27900         * debug-mono-symfile.h (MonoDebugLineNumberEntry): New type to
27901         store line number info.  For the dynamic symbol file, we only need
27902         to provide the JIT generated dynamic line number info for the dynamic
27903         symbol file.
27904
27905 2002-09-25  Martin Baulig  <martin@gnome.org>
27906
27907         * debug-mono-symfile.h: Incremented version number.
27908
27909 2002-09-24  Martin Baulig  <martin@gnome.org>
27910
27911         * class.c (mono_debugger_class_init_func): New global function
27912         pointer variable.
27913         (mono_class_init): If mono_debugger_class_init_func is non-NULL,
27914         call it.
27915
27916         * debug-mono-symfile.c (mono_debug_symfile_add_type): New
27917         function.  This is called via the mono_debugger_class_init_func
27918         hook to add all types to the dynamic type table.
27919         (ves_icall_MonoDebugger_GetType): New interncall to get a class
27920         from its metadata token.
27921
27922         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetType"):
27923         New interncall for the debugger.
27924
27925 2002-09-24  Nick Drochak <ndrochak@gol.com>
27926
27927         * icall.c (ves_icall_System_Enum_ToObject): validate the type parameter
27928         before using it in case it is null.
27929         
27930 Tue Sep 24 13:24:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
27931
27932         * metadata.c: allow custom modifiers in local var signatures
27933         (bug spotted by Zoltan Varga).
27934
27935 Tue Sep 24 12:12:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
27936
27937         * class.c: deal with the <Module> class that may have a NULL vtable.
27938         Eliminate warnings.
27939
27940 Tue Sep 24 11:28:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
27941
27942         * image.c, image.h: more strong name helpers.
27943         * monosn.c: more work: convert pem keys to cryptoapi format.
27944
27945 Tue Sep 24 11:27:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
27946
27947         * string-icalls.c: speedup IndexOf.
27948
27949 Tue Sep 24 11:17:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
27950
27951         * icall.c: updates from Zoltan.2.Varga@nokia.com.
27952
27953 Tue Sep 24 11:09:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
27954
27955         * icall.c: cleanup: use mono_object_domain ().
27956
27957 2002-09-23  Martin Baulig  <martin@gnome.org>
27958
27959         * debug-mono-symfile.c: Improved type support.
27960
27961 2002-09-22  Martin Baulig  <martin@gnome.org>
27962
27963         * debug-mono-symfile.c: Added support for reference types and strings.
27964
27965 2002-09-22  Martin Baulig  <martin@gnome.org>
27966
27967         * debug-mono-symfile.c: Started to work on the type table.
27968
27969 2002-09-21  Martin Baulig  <martin@gnome.org>
27970
27971         * debug-mono-symfile.c: Largely reworked the symbol table format.
27972         The symbol table is now incrementally updated each time a new
27973         method is added.  We're now also using our own magic and version
27974         so that you don't need to recompile all your classes if the
27975         dynamic table changes.
27976         (mono_debug_update_mono_symbol_file): Removed.
27977         (mono_debug_symfile_add_method): New function to add a method.
27978
27979 2002-09-21  Martin Baulig  <martin@gnome.org>
27980
27981         * icall.c
27982         ("System.Reflection.Assembly::MonoDebugger_GetLocalTypeFromSignature"):
27983         New interncall.
27984
27985         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetLocalTypeFromSignature):
27986         New interncall to get a method from its metadata token.
27987
27988 2002-09-21  Martin Baulig  <martin@gnome.org>
27989
27990         * debug-mono-symfile.c: Create type table.
27991
27992 2002-09-20  Martin Baulig  <martin@gnome.org>
27993
27994         * debug-mono-symfile.c: Reflect latest Mono.CSharp.Debugger changes.
27995
27996 2002-09-20  Martin Baulig  <martin@gnome.org>
27997
27998         * debug-mono-symfile.c: Provide information about params and locals.
27999
28000 2002-09-20  Martin Baulig  <martin@gnome.org>
28001
28002         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetMethod"):
28003         New interncall.
28004
28005         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetMethod): New
28006         interncall to get a method from its metadata token.
28007
28008 2002-09-20  Martin Baulig  <martin@gnome.org>
28009
28010         * debug-mono-symfile.c: Added a few checks for method->header
28011         being non-NULL.  This should never happen, but for the moment
28012         let's use a g_warning() rather than a g_assert().
28013
28014 2002-09-19  Mark Crichton  <crichton@gimp.org>
28015
28016         * gc.c: ves_icall_System_GCHandle_FreeHandle made a call to libgc
28017         even if support for it isn't present.  Added an #ifdef to fix this.
28018
28019         * socket-io.c: Added checks back for Solaris support.
28020
28021 2002-09-19  Martin Baulig  <martin@gnome.org>
28022
28023         * debug-mono-symfile.c (read_string, write_string): Reflect latest
28024         changes in the symbol file format.
28025
28026 2002-09-18  Martin Baulig  <martin@gnome.org>
28027
28028         * debug-mono-symfile.c: Set version number to 21.
28029
28030 2002-09-18  Dick Porter  <dick@ximian.com>
28031
28032         * threads.c (mon_new): Use the GC_MALLOC macro to hide differences
28033         on netbsd.  Fixes bug 30051.
28034
28035 2002-09-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28036
28037         * reflection.c:
28038         (set_version_from_string): little fix.
28039
28040 Mon Sep 16 18:57:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
28041
28042         * monosn.c, Makefile.am: added strong name utility.
28043         * reflection.h, reflection.c: implemented delayed signing,
28044         locale, version and hash id assembly attributes.
28045
28046 Mon Sep 16 18:51:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
28047
28048         * loader.c, metadata.c: load param attributes in signatures.
28049
28050 2002-09-16  Martin Baulig  <martin@gnome.org>
28051
28052         * debug-mono-symfile.c: Added string table with all method names.
28053
28054 2002-09-14  Martin Baulig  <martin@gnome.org>
28055
28056         * debug-mono-symfile.h (MonoSymbolFile): Added method range table for
28057         fast method lookup.
28058
28059 Fri Sep 13 16:04:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
28060
28061         * reflection.c: record the public key token of referenced assemblies.
28062
28063 Fri Sep 13 15:41:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
28064
28065         * image.c, image.h: added functions to get the strong name and the
28066         public key of an assembly.
28067         * pedump.c: use them.
28068
28069 2002-09-12  Dietmar Maurer  <dietmar@ximian.com>
28070
28071         * marshal.c (emit_str_to_ptr_conv): support marshalling of delegates.
28072
28073 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
28074
28075         * marshal.c (mono_marshal_get_managed_wrapper): Added
28076         MONO_TYPE_BOOLEAN 
28077
28078 2002-09-11  Martin Baulig  <martin@gnome.org>
28079
28080         * gc.c: Call GC_unregister_disappearing_link() on all links when
28081         finalizing them, this is necessary to aviod a crash in boehm's
28082         finalize handler.
28083
28084 Wed Sep 11 17:06:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
28085
28086         * gc.c: handle GetTarget for finalized objects spotted and fixed by
28087         nick@chemlab.org.
28088
28089 Wed Sep 11 15:27:20 CEST 2002 Paolo Molaro <lupus@ximian.com>
28090
28091         * icall.c: implemented MonoType::Module.
28092         * reflection.c, reflection.h: mono_module_get_object () from
28093         Tomi Pakarinen <tomi.pakarinen@welho.com>.
28094
28095 Wed Sep 11 12:53:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
28096
28097         * icall.c: ignore overridden methods in GetMethods ().
28098         Fix for FieldInfo::SetValue().
28099         * object.c: handle float/double in runtime invoke.
28100
28101 Tue Sep 10 15:51:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
28102
28103         * object.c: allow a constructor to be called again on an object.
28104
28105 Tue Sep 10 11:58:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
28106
28107         * class.h, class.c: move field layout code to it's own function and
28108         export it. Get an interface id earlier. Move fields in MonoClass
28109         so they are more cache friendly and align the bitfields.
28110         * loader.c: temporary handle get_param_names() for a runtime method.
28111         * reflection.c, reflection.h: more code to handle runtime creation of
28112         types.
28113
28114 2002-09-09  Martin Baulig  <martin@gnome.org>
28115
28116         * marshal.c (mono_marshal_get_native_wrapper): We need to use a special
28117         signature with the pinvoke field being set for the actual call.
28118
28119 Sat Sep 7 10:12:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
28120
28121         * icall.c: removed some unused icalls. Start of map of glib charsets
28122         to corlib names. Implemented RuntimeMethod::GetFunctionPointer ().
28123
28124 Fri Sep 6 16:08:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
28125
28126         * debug-helpers.c: break infinite loop (found and fixed by
28127         Holger Arnold <harnold@gmx.de>).
28128
28129 Thu Sep 5 18:50:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
28130
28131         * icall.c: target may be null in create_delegate.
28132
28133 Thu Sep 5 17:42:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
28134
28135         * marshal.c: handle a boolean return type.
28136
28137 Thu Sep 5 13:09:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
28138
28139         * gc.c: put HIDE_POINTER/REVEAL_POINTER only here.
28140
28141 Wed Sep 4 19:23:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
28142
28143         * gc.c: fix weakreferences.
28144
28145 Wed Sep 4 13:59:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
28146
28147         * icall.c: added icall to get default codepage.
28148
28149 2002-09-03  Dick Porter  <dick@ximian.com>
28150
28151         * threads.h: 
28152         * threads.c: Use MonoThread instead of MonoObject where
28153         apropriate.
28154
28155         Store running thread objects in a hash table, so that we have all
28156         the info to hand when waiting for them to finish
28157         (means we don't need OpenThread() any more, so mingw builds should
28158         be fully functional again.)
28159
28160         * verify.c:
28161         * object.h: Added thread ID to MonoThread
28162
28163 2002-09-03  Martin Baulig  <martin@gnome.org>
28164
28165         * icall.c (System.Reflection.Assembly::get_location): New interncall.
28166
28167 2002-09-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28168
28169         * icall.c: fixed leak in get_temp_path. Thanks lupus.
28170
28171 2002-09-03  Martin Baulig  <martin@gnome.org>
28172
28173         * debug-helpers.c (mono_disasm_code_one): Added `const guchar **endp'
28174         argument to store the end address of the disassembled instruction.
28175
28176         * debug-mono-symfile.h (MonoDebugMethodInfo, MonoDebugVarInfo): Moved
28177         here from debug-symfile.h.
28178         (MonoDebugMethodJitInfo): Moved all fields which are filled out by the
28179         JIT into this struct.
28180         (MonoSymbolFile): Added `char *image_file' field.
28181         (MonoDebugGetMethodFunc): Removed.
28182         (mono_debug_update_mono_symbol_file): Removed the hash table argument.
28183         (mono_debug_create_mono_symbol_file): Removed the `source_file' argument.
28184         (mono_debug_find_method): New method.
28185
28186         * debug-mono-symfile.c (mono_debug_create_mono_symbol_file): Always
28187         create a full symbol file.
28188         (mono_debug_update_mono_symbol_file): Don't distinguish between dynamic
28189         and static symbol files.
28190         (mono_debug_find_method): The symbol file keeps an internal method hash,
28191         call this to get a MonoDebugMethodInfo from a MonoMethod.
28192
28193         * debug-symfile.[ch]: Removed.
28194
28195 2002-08-29  Miguel de Icaza  <miguel@ximian.com>
28196
28197         * image.c (do_mono_image_open): Remove linker version check.
28198
28199 2002-08-29  Dietmar Maurer  <dietmar@ximian.com>
28200
28201         * marshal.c (mono_marshal_get_managed_wrapper): don't cache
28202         wrappers for instance methods.
28203         
28204 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28205
28206         * icall.c: added ves_icall_System_IO_Path_get_temp_path.
28207
28208 2002-08-28  Dick Porter  <dick@ximian.com>
28209
28210         * Makefile.am: Export HOST_CC for w32 builds
28211
28212 Tue Aug 27 18:34:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
28213
28214         * file-io.c process.c: MonoString are null terminated, no
28215         need for mono_string_to_utf16() anymore.
28216
28217 Tue Aug 27 17:51:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
28218
28219         * icall.c, unicode.h, unicode.c: removed unused iconv stuff.
28220
28221 Tue Aug 27 16:38:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
28222
28223         * icall.c, reflection.h: speedup System.MonoType.
28224
28225 Tue Aug 27 16:37:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
28226
28227         * reflection.c: allow null as the value of a string argument in
28228         custom attributes constructors.
28229
28230 2002-08-27  Martin Baulig  <martin@gnome.org>
28231
28232         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Removed the
28233         `trampoline_address' field.
28234
28235 2002-08-27  Dietmar Maurer  <dietmar@ximian.com>
28236
28237         * marshal.c (mono_marshal_get_native_wrapper): removed wrong null
28238         check (fixes bug #29486) 
28239
28240 2002-08-27  Martin Baulig  <martin@gnome.org>
28241
28242         * debug-mono-symfile.c: Changed the file format in a way that allows us
28243         open it read-only and to use a specially malloced area for all the
28244         dynamic data.  We can now also generate a symbol file on-the-fly if we're
28245         debugging IL code and there is no MCS generated symbol file for it.
28246
28247 Mon Aug 26 16:47:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
28248
28249         * object.c: added a define for a good string and array
28250         creation speedup (not enabled by default because we need to deal with
28251         the synch stuff).
28252
28253 2002-08-26  Martin Baulig  <martin@gnome.org>
28254
28255         * debug-mono-symfile.c (mono_debug_create_mono_symbol_file): New
28256         function to create a dynamic symbol file.  This is used by the
28257         debugger to create a symbol file for IL code on-the-fly.
28258
28259 2002-08-26  Martin Baulig  <martin@gnome.org>
28260
28261         * loader.c (mono_lookup_pinvoke_call): Include the error message
28262         from g_module_error() in the error message.
28263
28264 2002-08-24  Martin Baulig  <martin@gnome.org>
28265
28266         * debug-mono-symfile.c (mono_debug_update_mono_symbol_file): New
28267         function to update the symbol file.  The symbol file is mmap()ed
28268         writable, but private.  This allows us to install the symbol file
28269         together with the assembly.
28270
28271 2002-08-24  Martin Baulig  <martin@gnome.org>
28272
28273         * debug-mono-symfile.[ch]: New files.  Similar to debug-symfile.[ch]
28274         but they can read the new symbol file format which mcs is now creating.
28275
28276         * debug-symfile.c (mono_debug_find_source_location): Moved to
28277         debug-mono-symfile.c; this is now operating on the new symbol file.
28278
28279 2002-08-23  Martin Baulig  <martin@gnome.org>
28280
28281         * debug-helpers.c (mono_method_desc_from_method): New function to get
28282         a MonoMethodDesc from a MonoMethod.
28283
28284 Fri Aug 23 15:54:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
28285
28286         * object.c: fixes assertion failure caused by multiple ExecuteAssembly
28287         calls for same domain (patch by Tomi Pakarinen <Tomi.Pakarinen@iki.fi>).
28288
28289 Fri Aug 23 12:14:45 CEST 2002 Paolo Molaro <lupus@ximian.com>
28290
28291         * string-icalls.[ch]: make helper methods static.
28292
28293 2002-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28294
28295         * icall.c: re-applied patch to GetValueInternal. Also added R4 and R8
28296         types to it and to SetValueInternal.
28297
28298         * object.c: Moved handle_enum label to its proper place. This was the
28299         f... bug! ;-)
28300
28301         This time i compiled mcs and gtk-sharp and they both work.
28302
28303 2002-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28304
28305         * icall.c: reverted partially my previous patch until 
28306         object.c:set_value handles enums correcly.
28307
28308 2002-08-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28309
28310         * icall.c:
28311         (ves_icall_MonoField_GetValue): changed to use mono_field_get_value.
28312         (ves_icall_System_Environment_get_MachineName): removed warning when
28313         compiling under cygwin.
28314
28315 Thu Aug 22 18:49:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
28316
28317         * object.c: fixed field_get_value() for reference types.
28318
28319 2002-08-22  Dick Porter  <dick@ximian.com>
28320
28321         * socket-io.c (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal):
28322         Don't free a buffer while it's still needed.  Patch from Jonathan
28323         Liger <Jonathan.liger@wanadoo.fr>
28324
28325 2002-08-21  Miguel de Icaza  <miguel@ximian.com>
28326
28327         * icall.c (ves_icall_System_Environment_get_Platform): Add new
28328         internal call.
28329
28330 2002-08-21  Dietmar Maurer  <dietmar@ximian.com>
28331
28332         * icall.c (ves_icall_get_method_info): s/MonoMethod/MonoReflectionMethod/
28333         (ves_icall_get_parameter_info): s/MonoMethod/MonoReflectionMethod/
28334
28335         * marshal.c (mono_marshal_get_remoting_invoke): save lmf, because
28336         we call unmanaged code which throws exceptions.
28337
28338 Wed Aug 21 12:56:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
28339
28340         * appdomain.h: added per-domain entry_assembly.
28341         * appdomain.c: ensure mono_runtime_exec_main () gets non-null
28342         arguments.
28343         * icall.c: Assembly::GetEntryAssembly icall.
28344         * object.c: set domain->entry_assembly in mono_runtime_exec_main().
28345         Changes above from a patch by Tomi Pakarinen <tomi.pakarinen@welho.com>.
28346
28347 Tue Aug 20 15:42:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
28348
28349         * appdomain.h, gc.c: added mono_domain_finalize ().
28350
28351 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28352
28353         * object.c:
28354         (mono_print_unhandled_exception): changed g_warning by g_printerr
28355         because g_log has a 1024 characters limit (yeah, i got a big stack
28356         trace). Don't print exception name, that should be in ToString 
28357         returned string.
28358
28359 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28360
28361         * icall.c: added ves_icall_FieldInfo_SetValueInternal.
28362         * object.c: added missing MONO_TYPE_ARRAY in mono_runtime_invoke_array.
28363
28364 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28365
28366         * object.c:
28367         (mono_print_unhandled_exception): after previous commit, i realized
28368         that MS calls ToString on the exception. I changed this function to
28369         do that. This way we get stack_trace for free.
28370
28371 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28372
28373         * object.c:
28374         (mono_print_unhandled_exception): invoke Message property instead of
28375         getting 'message' field from Exception. Don't allocate memory for
28376         'trace' and 'message' if not needed.
28377
28378 2002-08-18  Dick Porter  <dick@ximian.com>
28379
28380         * unicode.c: Fix asserts to match Encoder.cs checks
28381
28382 Fri Aug 16 21:42:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
28383
28384         * marshal.c: fix unaligned store issue and a few wrong
28385         opcode argument types.
28386
28387 2002-08-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28388
28389         * icall.c: added GetUninitializedObjectInternal internal call.
28390
28391 2002-08-16  Dietmar Maurer  <dietmar@ximian.com>
28392
28393         * appdomain.c (mono_runtime_invoke_in_domain): transfer Exception
28394         to the right domain.
28395
28396 2002-08-14  Dietmar Maurer  <dietmar@ximian.com>
28397
28398         * marshal.c (mono_marshal_get_runtime_invoke): unbox value types
28399
28400         * class.c (class_compute_field_layout): set blittable to false for Strings
28401
28402         * appdomain.c (mono_domain_transfer_object): added support for ISerializable
28403
28404 Wed Aug 14 17:26:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
28405
28406         * appdomain.h, reflection.c, icall.c, object.c, reflection.h:
28407         first chunk of code to create types at runtime. Code to
28408         handle ReflectedType/DeclaringType. Make reflection handles
28409         domain specific.
28410
28411 Wed Aug 14 17:24:21 CEST 2002 Paolo Molaro <lupus@ximian.com>
28412
28413         * class.c: set correct name in arrays.
28414
28415 2002-08-13  Dietmar Maurer  <dietmar@ximian.com>
28416
28417         * appdomain.c (mono_domain_transfer_object): make it work with
28418         valuetypes. bug fixes.
28419
28420 2002-08-12  Dick Porter  <dick@ximian.com>
28421
28422         * object.h: Rename some parameters to avoid c++ keywords (Patch
28423         from Joseph Wenninger <kde@jowenn.at>)
28424
28425 Thu Aug 8 13:04:18 CEST 2002 Paolo Molaro <lupus@ximian.com>
28426
28427         * icall.c: added icall to implement Assembly.GetFile*.
28428
28429 Thu Aug 8 10:18:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
28430
28431         * reflection.h, reflection.c: code to embed managed resources.
28432
28433 Tue Aug 6 17:59:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
28434
28435         * class.c: move all the type size stuff into
28436         class_compute_field_layout().
28437
28438 Tue Aug 6 11:20:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
28439
28440         * class.c: ensure enums have always the correct instance size.
28441         * unicode.c: remove wrong assert.
28442
28443 Mon Aug 5 19:30:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
28444
28445         * assembly.c: fix mem corruption issue.
28446         * image.h, image.c: added mono_image_get_resource () to access
28447         managed resources.
28448         * icall.c: implemented Assembly.EntryPoint property and some
28449         Managed Resources related internalcalls.
28450
28451
28452 Mon Aug 5 18:18:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
28453
28454         * image.c, image.h: impemented mono_image_get_entry_point ().
28455         * appdomain.c: use mono_image_get_entry_point.
28456
28457 Mon Aug 5 13:08:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
28458
28459         * reflection.c: support the object type argument when loading
28460         custom attributes.
28461
28462 2002-08-05  Dietmar Maurer  <dietmar@ximian.com>
28463
28464         * marshal.c (mono_marshal_get_managed_wrapper): add suppport for
28465         String as return type.
28466
28467 Fri Aug 2 21:15:42 CEST 2002 Paolo Molaro <lupus@ximian.com>
28468
28469         * reflection.c: fix encoding of named args for custom attrs to match
28470         the ms implementation. Read them back when instantiating custom
28471         attributes.
28472
28473 2002-08-02  Radek Doulik  <rodo@ximian.com>
28474
28475         * marshal.c (mono_mb_add_data): convert ret value to LE, suggested
28476         by Dietmar as quick fix
28477         (mono_marshal_get_delegate_begin_invoke): use sig->param_count +
28478         16 as stack size, used on more places as quick fix before Dietmar
28479         will fix it properly
28480
28481 Fri Aug 2 17:48:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
28482
28483         * object.h, object.c: added accessors for fields and properties.
28484
28485 Fri Aug 2 17:45:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
28486
28487         * class.c, class.h: made mono_class_get_field_from_name ()
28488         loop on parent types.
28489         Added mono_class_get_property_from_name ().
28490
28491 Fri Aug 2 11:40:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
28492
28493         * class.c, class.h: move the code to setup the type vtable in its own
28494         function so that it can be reused also for types created at runtime.
28495         Eliminate the "class" identifier from the header file.
28496         * reflection.c: setup the vtable for enums so that we can create
28497         objects for use in SetConstant ().
28498
28499 2002-08-02  Dietmar Maurer  <dietmar@ximian.com>
28500
28501         * marshal.c (mono_delegate_to_ftnptr): pass delegate->target
28502         instead of the delegate itself as this pointer (bug #28383)
28503
28504 2002-08-01  Dietmar Maurer  <dietmar@ximian.com>
28505
28506         * marshal.c (mono_marshal_get_managed_wrapper): added return type
28507         conversions.
28508
28509 Wed Jul 31 16:49:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
28510
28511         * loader.c: don't set the pinvoke bit on icalls.
28512
28513 2002-07-31  Dietmar Maurer  <dietmar@ximian.com>
28514
28515         * debug-helpers.c (mono_method_full_name): only print a number to
28516         indicate wrapper type (so that the output is more readable in traces).
28517
28518 2002-07-30  Dietmar Maurer  <dietmar@ximian.com>
28519
28520         * class.c (mono_class_init): include method override patch from Paolo
28521
28522 Tue Jul 30 15:20:08 CEST 2002 Paolo Molaro <lupus@ximian.com>
28523
28524         * icall.c: fixed GetTypeCode().
28525
28526 2002-07-29  Dietmar Maurer  <dietmar@ximian.com>
28527
28528         * threads.c (ves_icall_System_Threading_Thread_Thread_internal):
28529         use real delegate invoke function to make it work with multicast
28530         delegates (fix bug# 28291).
28531
28532 Fri Jul 26 11:58:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
28533
28534         * object.c: load constant strings.
28535
28536 Fri Jul 26 11:36:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
28537
28538         * reflection.c: no magic numbers.
28539         * tabledefs.h: security action enum.
28540
28541 Fri Jul 26 11:22:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
28542
28543         * assembly.c: fix possible memory corruption.
28544
28545 Thu Jul 25 13:58:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
28546
28547         * reflection.h, reflection.c: added support for linking resources.
28548         * verify.c: check we have an updated corlib.
28549
28550 2002-07-25  Dietmar Maurer  <dietmar@ximian.com>
28551
28552         * marshal.c (mono_marshal_get_native_wrapper): correctly marshal
28553         string arrays.
28554         (mono_marshal_string_array): null terminate unmanaged string arrays.
28555         (mono_marshal_get_managed_wrapper): print warning for arrays (not implemented)
28556
28557 Wed Jul 24 13:32:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
28558
28559         * icall.c: Type.GetType () can now return also types from the
28560         calling assembly.
28561
28562 Wed Jul 24 13:04:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
28563
28564         * loader.h, loader.c: stack walking support.
28565         * icall.c: implemented GetCurrentMethod, GetExecutingAssembly,
28566         GetCallingAssembly.
28567
28568 2002-07-24  Dietmar Maurer  <dietmar@ximian.com>
28569
28570         * marshal.c: added optimisations for blittable types 
28571
28572         * class.c (mono_array_class_get): do not set blittable attribute on arrays
28573         (mono_class_setup_mono_type): set blittable attribute for single
28574         and double.
28575
28576         * marshal.c (mono_string_utf8_to_builder): impl.
28577         (mono_string_builder_to_utf8): impl.
28578         (mono_marshal_get_native_wrapper): impl. StringBuilder marshaling
28579
28580 2002-07-23  Dietmar Maurer  <dietmar@ximian.com>
28581
28582         * marshal.c (mono_marshal_get_native_wrapper): impl. byref types
28583         (mono_marshal_get_managed_wrapper): impl. byref types
28584
28585 2002-07-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28586
28587         * icall.c:
28588         (search_method): don't display debug message. 
28589
28590 2002-07-22  Dietmar Maurer  <dietmar@ximian.com>
28591
28592         * metadata.c (mono_type_stack_size): removed temporary fix for new gcc
28593
28594 Mon Jul 22 18:17:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
28595
28596         * appdomain.c: set the missing filename when throwing exception.
28597
28598 2002-07-22  Dietmar Maurer  <dietmar@ximian.com>
28599
28600         * metadata.c (mono_type_size): code cleanup
28601         (mono_type_stack_size): removed some test code
28602
28603 2002-07-21  Miguel de Icaza  <miguel@ximian.com>
28604
28605         * appdomain.c (ves_icall_System_Reflection_Assembly_LoadFrom): Use
28606         mono_get_exception_file_not_found now.
28607
28608         * exception.c (mono_exception_from_name_two_strings): New version
28609         that will call a constructor with two string arguments. 
28610         (mono_get_exception_file_not_found): New helper routine, used to
28611         report file-not-found errors.
28612
28613 2002-07-20  Dick Porter  <dick@ximian.com>
28614
28615         * process.h:
28616         * process.c: Pass file handles to CreateProcess
28617         
28618         * icall.c:
28619         * file-io.h:
28620         * file-io.c: Implemented CreatePipe
28621
28622 2002-07-19  Dietmar Maurer  <dietmar@ximian.com>
28623
28624         * metadata.c (mono_get_param_info): set alignment for value types
28625
28626 Fri Jul 19 18:58:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
28627
28628         * appdomain.h, domain.c, threads-types.h: don't include config.h in headers.
28629         Constify mono_domain_assembly_open().
28630         * loader.c: handle null namespace in icalls.
28631
28632 2002-07-19  Dietmar Maurer  <dietmar@ximian.com>
28633
28634         * marshal.c (emit_ptr_to_str_conv): marshal object as structs
28635         (emit_str_to_ptr_conv): marshal object as structs
28636
28637         * metadata.c (mono_type_to_unmanaged): marshal object as structs
28638
28639         * marshal.c (mono_marshal_get_runtime_invoke): support value types
28640
28641 2002-07-18  Dietmar Maurer  <dietmar@ximian.com>
28642
28643         * marshal.c (mono_marshal_get_runtime_invoke): use exception filters
28644         (mono_marshal_get_native_wrapper): we an now return value types
28645
28646 Wed Jul 17 18:21:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
28647
28648         * verify.c: more checks implemented.
28649
28650 2002-07-17  Dietmar Maurer  <dietmar@ximian.com>
28651
28652         * marshal.c (mono_delegate_to_ftnptr): invoke the right method
28653         (fix bug #27695)
28654         (mono_marshal_get_native_wrapper): allow byref arguments
28655         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringXXX):
28656         impl. PtrToStringXXX methods
28657         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure_type): impl.
28658         (ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf): impl.
28659         (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi): impl.
28660         (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): impl.
28661         (ves_icall_System_Runtime_InteropServices_Marshal_DestroyStructure): impl.
28662
28663 Tue Jul 16 19:00:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
28664
28665         * reflection.c: fix buglet in parsing an assembly name.
28666
28667 2002-07-16  Dietmar Maurer  <dietmar@ximian.com>
28668
28669         * marshal.c (emit_ptr_to_str_conv): first impl.
28670
28671 Tue Jul 16 12:39:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
28672
28673         * object.c, class.h: cache the vtable in the class as suggested by
28674         vargaz@freemail.hu (Zoltan Varga).
28675
28676 Tue Jul 16 11:27:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
28677
28678         * class.h, loader.c: added mono_field_from_token().
28679         * verify.c: first cut of type checking code.
28680
28681 2002-07-16  Dietmar Maurer  <dietmar@ximian.com>
28682
28683         * marshal.c (mono_marshal_get_native_wrapper): support valuetypes
28684
28685 2002-07-15  Dietmar Maurer  <dietmar@ximian.com>
28686
28687         * marshal.c (mono_marshal_get_native_wrapper): handle enum types
28688         (fix bug #27782)
28689         (mono_marshal_get_remoting_invoke): impl.
28690         (mono_delegate_begin_invoke): impl.
28691         (mono_mb_emit_save_args): impl.
28692         (mono_delegate_end_invoke): impl.
28693         (mono_marshal_get_delegate_begin_invoke):
28694         (mono_marshal_get_delegate_end_invoke):
28695         (mono_marshal_get_delegate_invoke): generate a special name for
28696         those methods (including the signature) and associate them whith
28697         the delegate class. 
28698
28699 2002-07-13  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
28700
28701         * reflection.[ch]: 
28702         (mono_reflection_type_from_name): now it has a MonoImage parameter
28703         which is used as the default image to search the type in. If the image
28704         is NULL or getting the type from it fails, it defaults to corlib.
28705
28706         * icall.c: changed 1 call to mono_reflection_type_from_name to match
28707         new parameter.
28708
28709 Sat Jul 13 19:32:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
28710
28711         * reflection.c: update the parameter table index.
28712
28713 Sat Jul 13 17:34:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
28714
28715         * domain.c: don't include the mark byte in the string hash.
28716
28717 Sat Jul 13 15:06:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
28718
28719         * icall.cs: icall for Type.GetTypeCode ().
28720         * verify: a couple of fixes and disabled local initialization checks.
28721
28722 2002-07-12  Dietmar Maurer  <dietmar@ximian.com>
28723
28724         * marshal.c: better debugging support (DEBUG_RUNTIME_CODE)
28725
28726         * debug-helpers.c (mono_method_full_name): print the type of the
28727         runtime wrapper
28728
28729         * metadata.c (mono_signature_hash): a hash function for signatures
28730         (mono_signature_hash): better hash algorithm
28731
28732         * marshal.c (mono_marshal_get_delegate_invoke): cache methods by signature
28733
28734         * debug-helpers.c (mono_method_full_name): this can now generate
28735         method names with signatures
28736
28737         * marshal.c (mono_marshal_get_managed_wrapper): bug fix: unmanaged
28738         method dont have this pointers.
28739
28740 Fri Jul 12 11:35:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
28741
28742         * reflection.c: fixup typebuilder tokens.
28743         * image.c: fix buglet.
28744         * marshal.h: remove whitespace.
28745         * metadata.h, metadata.c: reinstate code that was removed.
28746         * verify.c: handle catch directives and fix another couple of bugs.
28747
28748 2002-07-11  Dietmar Maurer  <dietmar@ximian.com>
28749
28750         * marshal.c (mono_marshal_get_native_wrapper): support BOOLEAN
28751         (mono_marshal_get_native_wrapper): make it comp. with the old code
28752         (mono_marshal_get_native_wrapper): support boolean
28753         (mono_marshal_get_managed_wrapper): support more types
28754
28755 2002-06-25  Dietmar Maurer  <dietmar@ximian.com>
28756
28757         * class.c (class_compute_field_layout): compute class->blittable attribute.
28758
28759 2002-07-09  Dick Porter  <dick@ximian.com>
28760
28761         * threads.c: Make the thread cleaning up cope with threads that
28762         call ExitThread()
28763
28764 2002-07-08  Radek Doulik  <rodo@ximian.com>
28765
28766         * reflection.c (method_encode_code): use non-translated values to
28767         compute finally_start, this fixes exception handling on ppc, yay!
28768
28769         * decimal.h (struct signscale): fix endianess
28770
28771 2002-07-07  Radek Doulik  <rodo@ximian.com>
28772
28773         * reflection.c: swap box_val and not val
28774
28775 Mon Jul 8 15:18:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
28776
28777         * reflection.c, reflection.h: handle full assembly info in type name.
28778         Handle Type arguments when loading custom attributes.
28779         * icall.c: updated to use new mono_reflection_type_from_name () method.
28780
28781 2002-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28782
28783         * loader.c:
28784         (method_from_memberref): also print assembly name when method not found.
28785
28786 2002-07-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28787
28788         * icall.c:
28789         (ves_icall_TypeGetProperties): fixed bug #27473. 
28790
28791 2002-07-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28792
28793         * reflection.c: display image name and token when cannot find the
28794         .ctor for an attribute.
28795
28796 2002-07-05  Martin Baulig  <martin@gnome.org>
28797
28798         * debug-symfile.c: Reflect latest MonoDwarfFileWriter changes.
28799
28800 2002-07-04  Dick Porter  <dick@ximian.com>
28801
28802         * threads.c (mono_thread_cleanup): Nasty kludge to get this to
28803         compile on mingw.  This will cause mingw builds to not wait for
28804         subthreads to terminate after the main thread does.  I've lodged a
28805         bug with the mingw developers for them to wrap OpenThread().
28806
28807 2002-07-03  Dick Porter  <dick@ximian.com>
28808
28809         * threads.c: Store thread IDs instead of handles, because
28810         GetCurrentThread() returns a pseudohandle and therefore stores
28811         useless values.  mono_thread_cleanup() continues checking the
28812         array of threads until it is empty, to cope with subthreads
28813         spawning new threads after the main thread has finished.
28814
28815         * profiler.h:
28816         * profiler.c:
28817         * profiler-private.h: Pass the thread ID to thread profiler
28818         functions, instead of a handle
28819
28820 Wed Jul 3 17:43:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
28821
28822         * verify.c: fixes to make it more usable.
28823         * pedump.c: added --verify code to verify IL code in an assembly.
28824
28825 Tue Jul 2 20:40:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
28826
28827         * reflection.c: turn errors into warnings to allow compiling corlib.
28828
28829 Tue Jul 2 19:33:20 CEST 2002 Paolo Molaro <lupus@ximian.com>
28830
28831         * reflection.c: add special cases to compile corlib.
28832
28833 Mon Jul 1 18:00:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
28834
28835         * reflection.c: handle properties with only a set method.
28836
28837 Mon Jul 1 17:11:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
28838
28839         * opcodes.h: add enum with opcodes in opval order.
28840
28841 2002-07-01  Dick Porter  <dick@ximian.com>
28842         
28843         * object.h:
28844         * object.c (mono_runtime_run_main): Removed unneeded argument
28845
28846 2002-06-28  Martin Baulig  <martin@gnome.org>
28847
28848         * debug-symfile.c: Reflect latest MonoDwarfFileWriter changes.
28849
28850 2002-06-27  Dick Porter  <dick@ximian.com>
28851
28852         * threads.c: Store the handle in both the parent thread and in the
28853         subthread, to minimise the time between starting a new thread and
28854         storing its ID.
28855
28856 2002-06-26  Dick Porter  <dick@ximian.com>
28857
28858         * appdomain.c (mono_runtime_cleanup): Close the socket library
28859         after all the threads have finished, not before
28860
28861 2002-06-26  Martin Baulig  <martin@gnome.org>
28862
28863         * debug-symfile.c (mono_debug_find_source_location): Added
28864         `guint32 *line_number' argument.  If it's not NULL, store the line number
28865         there and return the file name without the line number.
28866
28867 2002-06-25  Dick Porter  <dick@ximian.com>
28868
28869         * icall.c:
28870         * process.h:
28871         * process.c: Process forking and other support functions
28872
28873 2002-06-25  Dick Porter  <dick@ximian.com>
28874
28875         * image.c (do_mono_image_open): Set ref_count to 1, so that bad
28876         things dont happen when the image is closed.
28877         (mono_image_lookup_resource): Walk the resource section looking
28878         for a particular entry
28879
28880         * cil-coff.h: PE resource section decoding
28881
28882 2002-06-25  Dick Porter  <dick@ximian.com>
28883         
28884         * assembly.h:
28885         * assembly.c: 
28886         (mono_assembly_foreach): Accessor functions to walk the list of
28887         loaded assemblies
28888         (mono_assembly_set_main):
28889         (mono_assembly_get_main): Process methods need to know which
28890         assembly is the "main" one
28891
28892         * object.c (mono_runtime_run_main): Record the main assembly
28893
28894         * debug-helpers.c: Fix typo
28895
28896 2002-06-24  Dietmar Maurer  <dietmar@ximian.com>
28897
28898         * icall.c (ves_icall_System_Runtime_InteropServices_Marshal_copy_to_unmanaged): impl.
28899         (ves_icall_System_Runtime_InteropServices_Marshal_copy_from_unmanaged): impl.
28900
28901 Sat Jun 22 11:37:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
28902
28903         * icall.c: fix off-by-one in Assembly.GetTypes() reported by bob@karr.ath.cx.
28904
28905 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
28906
28907         * image.c (do_mono_image_open): Initialize reference count,
28908         otherwise we leak the MonoImage.
28909
28910 Fri Jun 21 19:16:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
28911
28912         * reflection.c: small tweak to handle self-hosting.
28913
28914 Thu Jun 20 23:28:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
28915
28916         * reflection.c: fix type name parse code.
28917
28918 Thu Jun 20 19:24:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
28919
28920         * reflection.c: break out of the loop.
28921         * image.c: special case corlib.
28922
28923 Thu Jun 20 16:43:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
28924
28925         * reflection.c: add all the custom attrs at the end to ensure the
28926         ctors have been properly initialized when the attributes are defined
28927         in the current assembly.
28928
28929 Thu Jun 20 13:46:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
28930
28931         * reflection.c: handle correctly multiple-nested types.
28932
28933 Thu Jun 20 11:49:00 CEST 2002 Paolo Molaro <lupus@ximian.com>
28934
28935         * row-indexes.h: fix typos.
28936         * reflection.c: adjust for typos and fix method_def_or_ref
28937         encoding in MethodImpl table.
28938
28939 Wed Jun 19 21:57:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
28940
28941         * reflection.c: fix entry point patching (thanks Serge!).
28942
28943 2002-06-18  Dietmar Maurer  <dietmar@ximian.com>
28944
28945         * verify.c: add check for System.Exception
28946
28947 Mon Jun 17 20:23:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
28948
28949         * image.c, class.c: minifix for code just c&p'ed.
28950         * reflection.c: warning fix.
28951         * object.h, loader.h, domain.c: load also StringBuilder.
28952
28953 Mon Jun 17 17:29:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
28954
28955         * marshal.h, marshal.c: some support code to handle complex marshaling.
28956
28957 Mon Jun 17 16:32:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
28958
28959         * class.h, class.c, reflection.c: handle ignorecase in GetType ().
28960         Better signatures with vtable error dump.
28961
28962 Mon Jun 17 16:13:35 CEST 2002 Paolo Molaro <lupus@ximian.com>
28963
28964         * reflection.c, reflection.h, icall.c: fixes for multiple-nested types.
28965
28966 2002-06-17  Dietmar Maurer  <dietmar@ximian.com>
28967
28968         * icall.c (ves_icall_Type_GetField): impl.
28969
28970 Mon Jun 17 16:08:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
28971
28972         * metadata.h, metadata.c: added mono_metadata_get_marshal_info()
28973         to retrieve a marshal description blob for a field or param.
28974
28975 Mon Jun 17 14:57:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
28976
28977         * reflection.h, reflection.c: change order of nested type emission
28978         to avoid table corruption. The NestedTypes table is sorted.
28979         * icall.c: change order of GetConstructor results to workaround mcs bug.
28980
28981 Fri Jun 14 16:24:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
28982
28983         * reflection.h, reflection.c: handle field and param marshal
28984         information.
28985
28986 Wed Jun 12 16:30:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
28987
28988         * icall.c, marshal.c marshal.h: more Marshal class implementation.
28989
28990 Tue Jun 11 17:29:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
28991
28992         * reflection.c: fix call convention.
28993
28994 Tue Jun 11 16:52:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
28995
28996         * reflection.h, reflection.c: mono_image_get_memberref_token()
28997         takes a type instead of a class, now. Added
28998         mono_image_get_array_token() to create tokens for the special
28999         multi-dim array methods.
29000
29001 Tue Jun 11 13:21:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
29002
29003         * assembly.c: handle modules (no assembly table). Split
29004         loading references in its own function.
29005         * class.c: handle moduleref resolution scope.
29006         * image.c, image.h: cache module name in image.
29007
29008 2002-06-07  Martin Baulig  <martin@gnome.org>
29009
29010         * reflection.c (mono_image_get_type_info): Only add a class layout entry
29011         if we actually have a `tb->class_size' (ie. it's not UnspecifiedTypeSize).
29012
29013 Fri Jun 7 22:07:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
29014
29015         * icall.c: more signature fixes that used uint instead of int.
29016
29017 Fri Jun 7 20:41:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
29018
29019         * reflection.c: fixed signature of field refs.
29020
29021 Fri Jun 7 19:41:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
29022
29023         * class.c, reflection.c: handle typerefs of nested types
29024         (both on read and when writing files).
29025
29026 Fri Jun 7 17:46:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
29027
29028         * icall.c: fix method signatures that tried to workaround the previous
29029         typo, d'oh!
29030
29031 Fri Jun 7 17:36:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
29032
29033         * debug-helpers.c: fix typo.
29034
29035 Fri Jun 7 17:00:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
29036
29037         * cil-coff.h, icall.c, image.c, reflection.c, reflection.h:
29038         rewrote the PE/COFF writing code (our programs are understood by the
29039         ms runtime, now).
29040
29041 Tue Jun 4 18:10:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
29042
29043         * gc.c, gc.h, icall.c: weakreference support.
29044
29045 Tue Jun 4 16:06:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
29046
29047         * Makefile.am, mono-config.c: use $(sysconfdir).
29048
29049 Mon Jun 3 13:13:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
29050
29051         * icall.c: changed default precision of Double.ToString() to 15.
29052         Fixed memory leak. Unified with Single.ToString.
29053
29054 Sat Jun 1 14:26:45 CEST 2002 Paolo Molaro <lupus@ximian.com>
29055
29056         * sysmath.c: workaround systems missing NAN and/or HUGE_VAL.
29057
29058 Sat Jun 1 13:46:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
29059
29060         * pedump.c, appdomain.c, appdomain.h, assembly.c, domain.c,
29061         gc.c, icall.c, image.c, mono-config.c, reflection.c: killed
29062         warnings and compilation fixes from Dennis Haney (davh@davh.dk)
29063         and myself.
29064
29065 Fri May 31 16:58:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
29066
29067         * debug-symfile.c, sysmath.c: yet more compilation fixes.
29068
29069 Fri May 31 16:35:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
29070
29071         * reflection.c, socket-io.c: more compilation fixes.
29072
29073 Fri May 31 15:58:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
29074
29075         * appdomain.c, class.c, class.h, debug-symfile.c, decimal.c,
29076         domain.c, loader.c, object.c, object.h, reflection.c, string-icalls.h,
29077         unicode.c: warning and compiler compatibility fixes.
29078
29079 Fri May 31 15:36:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
29080
29081         * class.h, metadata.c: fixed warnings/compilation errors.
29082
29083 Fri May 31 13:08:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
29084
29085         * Makefile.am, mono-config.c, mono-config.h: configuration file
29086         support routines.
29087         * loader.c, loader.h: make Dll mapping configurable at runtime in the
29088         config file. Export methods to insert and lookup mappings.
29089
29090 Fri May 31 12:45:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
29091
29092         * reflection.c: handle types and boxed objects in custom attr
29093         constructors.
29094
29095 2002-05-30  Martin Baulig  <martin@gnome.org>
29096
29097         * debug-symfile.c
29098         (ves_icall_Debugger_MonoSymbolWriter_method_builder_from_token): Removed.
29099
29100 Thu May 30 14:15:02 CEST 2002 Paolo Molaro <lupus@ximian.com>
29101
29102         * metadata.c, metadata.h: added mono_metadata_implmap_from_method()
29103         to lookup the implmap row for a P/Invoke method.
29104         * loader.c: added mono_lookup_pinvoke_call(): we only lookup a
29105         P/Invoke method from the runtime on an as needed basis.
29106
29107 2002-05-28  Dietmar Maurer  <dietmar@ximian.com>
29108
29109         * metadata.c (mono_metadata_parse_signature): impl.
29110
29111 Tue May 28 16:02:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
29112
29113         * class.c: handle .pack directive.
29114
29115 Tue May 28 11:04:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
29116
29117         * object.c: initialize static fields with RVA data.
29118
29119 2002-05-25  Martin Baulig  <martin@gnome.org>
29120
29121         * debug-symfile.c
29122         (ves_icall_Debugger_DwarfFileWriter_get_type_token): Removed.
29123
29124 2002-05-24  Martin Baulig  <martin@gnome.org>
29125
29126         * debug-symfile.c
29127         (ves_icall_Debugger_MonoSymbolWriter_get_local_type_from_sig): Removed.
29128         (ves_icall_Debugger_MonoSymbolWriter_method_from_token): Renamed to
29129         `ves_icall_Debugger_MonoSymbolWriter_method_builder_from_token'.
29130
29131 Thu May 23 18:44:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
29132
29133         * object.c: special case string ctros in invoke.
29134         * gc.c: silly whitespace changes.
29135
29136 2002-05-23  Dietmar Maurer  <dietmar@ximian.com>
29137
29138         * threadpool.[ch]: impl. a threadpool that can
29139         be used by mint and mono.
29140
29141 2002-05-22  Martin Baulig  <martin@gnome.org>
29142
29143         * debug-symfile.c (ves_icall_Debugger_MonoSymbolWriter_method_from_token):
29144         The first argument is now a `MonoReflectionModuleBuilder *', the return
29145         value is a `MonoReflectionModuleBuilder *'.  Use the AssemblyBuilder's
29146         `methods' field to get the method builder.  The `token' argument is the
29147         unfixed token.
29148
29149         * unicode.c (iconv_get_length, iconv_convert): Silently ignore all
29150         invalid characters instead of g_assert_not_reached()ing.  This seems
29151         to be the behaviour of mscorlib.
29152
29153 2002-05-22  Dietmar Maurer  <dietmar@ximian.com>
29154
29155         * object.c (mono_runtime_invoke_array): applied patch from Rachel
29156         Hestilow to fix bug #25104
29157
29158 2002-05-21  Martin Baulig  <martin@gnome.org>
29159
29160         * debug-symfile.c (mono_debug_find_source_location): New function.
29161         Looks up an IL offset in the line number table and returns the source
29162         location as a string.
29163
29164 2002-05-21  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29165
29166         * icall.c:
29167         (mono_double_ToStringImpl): changed %f by %g until we have something
29168         better.
29169
29170 2002-05-21  Nick Drochak  <ndrochak@gol.com>
29171
29172         * icall.c : Use different name for Math.Pow's icall.  Needed to check
29173         parameters first in C#.
29174
29175 Mon May 20 17:36:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
29176
29177         * icall.c, reflection.h: added icall to get info about an event.
29178
29179 2002-05-20  Radek Doulik  <rodo@ximian.com>
29180
29181         * object.c (mono_value_box): don't use memcpy for boxing on BIG
29182         endian
29183         (mono_value_box): don't use memcpy for small sizes on
29184         architectures with unaligned access
29185
29186 2002-05-20  Martin Baulig  <martin@gnome.org>
29187
29188         * reflection.c (mono_reflection_setup_internal_class): Don't crash
29189         if `tb->parent == NULL'.
29190         (mono_reflection_create_internal_class): New function.  This is
29191         called from TypeBuilder.CreateType() and sets `klass->enum_basetype'
29192         for enum types.
29193
29194         * icall.c ("System.Reflection.Emit.TypeBuilder::create_internal_class"):
29195         New interncall.
29196
29197 2002-05-19  Martin Baulig  <martin@gnome.org>
29198
29199         * unicode.c (ves_icall_iconv_get_bytes): Actually use the `charCount'
29200         argument to get the length, don't default to the array length.
29201
29202 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
29203
29204         * assembly.c (mono_assembly_setrootdir): New function used to
29205         override the MONO_ASSEMBLIES directory.
29206
29207 Fri May 17 20:39:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
29208
29209         * icall.c: ValueType_GetHashCode() initialize local var.
29210
29211 Thu May 16 17:20:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
29212
29213         * reflection.c: sort custom attributes table.
29214
29215 Thu May 16 16:08:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
29216
29217         * reflection.c: support named args in custom attributes (write support).
29218
29219 Thu May 16 13:04:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
29220
29221         * reflection.c: fix finally position calculation.
29222
29223 2002-05-15  Radek Doulik  <rodo@ximian.com>
29224
29225         * reflection.c: fixed endianess at many places
29226
29227         * icall.c (ves_icall_InitializeArray): comment out debug msg
29228
29229 2002-05-15  Dietmar Maurer  <dietmar@ximian.com>
29230
29231         * object.c (mono_unhandled_exception): new function to handle
29232         unhandled exceptions.
29233         (mono_unhandled_exception): call the UnhandledException event.
29234         (mono_runtime_delegate_invoke): impl.
29235
29236 Wed May 15 15:59:55 CEST 2002 Paolo Molaro <lupus@ximian.com>
29237
29238         * metadata.h, metadata.c, class.c: mono_metadata_field_info ()
29239         returns the RVA, not the direct pointer to the data. Handle the case
29240         when the class size is fixed.
29241
29242 Tue May 14 16:59:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
29243
29244         * reflection.c: fix some endianess issues.
29245
29246 2002-05-14  Dietmar Maurer  <dietmar@ximian.com>
29247
29248         * object.c (mono_runtime_invoke): is now able to catch exceptions.
29249
29250         * threads.c (mono_thread_init): added a callback which is invoked
29251         at thread start.
29252
29253 2002-05-14  Dan Lewis  <dihlewis@yahoo.co.uk>
29254         
29255         * icall.c: make GetHashCode return non-negative values.
29256
29257 2002-05-14  Dan Lewis  <dihlewis@yahoo.co.uk>
29258
29259         * object.c, icall.c, gc.c: revert to address-based hashcode.
29260
29261 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
29262
29263         * icall.c (mono_double_ParseImpl): Added ParseImpl method.
29264
29265 Mon May 13 16:40:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
29266
29267         * icall.c, class.c: special case <Module>.
29268
29269 2002-05-13  Dan Lewis  <dihlewis@yahoo.co.uk>
29270
29271         * icall.c: fix bug in GetNow().
29272
29273 2002-05-11  Dietmar Maurer  <dietmar@ximian.com>
29274
29275         * object.c (mono_runtime_class_init): make sure that we call all
29276         static class constructors.
29277
29278 Fri May 10 18:14:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
29279
29280         * reflection.c: sort methodsemantics table.
29281
29282 Fri May 10 16:31:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
29283
29284         * reflection.h, reflection.c: honour init locals setting.
29285
29286 Thu May 9 18:50:00 EDT 2002 Daniel Morgan <danmorg@sc.rr.com>
29287
29288         * icall.c: copied Double ToStringImpl for Single ToStringImpl
29289
29290 Wed May 8 12:28:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
29291
29292         * reflection.c: support ContructorBuilders in attribute blob creation.
29293
29294 Wed May 8 12:06:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
29295
29296         * reflection.c: some changes to build a binary that can be run
29297         directly in windows.
29298
29299 Mon May 6 13:10:34 CEST 2002 Paolo Molaro <lupus@ximian.com>
29300
29301         * loader.c: print a big message when an icall can't be found.
29302
29303 2002-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29304
29305         * string-icalls.c: fix bug 24248.
29306
29307 Sat May 4 14:03:21 CEST 2002 Paolo Molaro <lupus@ximian.com>
29308
29309         * appdomain.c, appdomain.h, assembly.c, assembly.h, image.h,
29310         icall.c, reflection.h: separate assembly loading by pathname and by
29311         assembly name. Use the MONO_PATH env var to search for assemblies.
29312
29313 Thu May 2 17:56:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
29314
29315         * assembly.c, image.h: add some support for assemblies
29316         with multiple modules.
29317         * class.c, class.h: export mono_class_from_typeref().
29318         * loader.c: remove duplicated code and use mono_class_from_typeref(),
29319         instead.
29320
29321 Thu May 2 15:51:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
29322
29323         * unicode.c: Char.IsNumber doesn't include hex digits as the ms
29324         documentation says (the ECMA one is correct).
29325
29326 2002-05-02  Dick Porter  <dick@ximian.com>
29327
29328         * threads.c: Use GC_debug_register_finalizer with GC_debug_malloc.
29329         Don't name the synchronisation mutex.
29330
29331 2002-04-30  Jeffrey Stedfast  <fejj@ximian.com>
29332
29333         * rand.c
29334         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_GetBytes):
29335         Make the prototypes match.
29336         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_GetNonZeroBytes):
29337         Same.
29338
29339         * icall.c
29340         (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Fixed for
29341         systems that use 'timezone' rather than tm.tm_gmtoff. Also, not
29342         all systems have tm.tm_zone, so use strftime() with %Z to print
29343         the timezone abreviation into a temp string.
29344
29345         * object.c (mono_ldstr): Fixed to use mono_string_chars() macro
29346         rather than mono_array_addr() on a MonoString on Big Endian
29347         machines.
29348
29349 2002-04-30  Dietmar Maurer  <dietmar@ximian.com>
29350
29351         * string-icalls.c (ves_icall_System_String_InternalReplace_Str):
29352         fix bug 24041
29353
29354 2002-04-30  Dick Porter  <dick@ximian.com>
29355
29356         * socket-io.c: Cope with SOCKET being an integer rather than a
29357         pointer now.
29358
29359         * threads.c: Added Thread_free_internal, to deal with thread
29360         handle cleanup.  Moved calls to handle_store() and handle_remove()
29361         to start_wrapper(), so each can only be called once.  Allocate
29362         synchronisation blocks with GC_malloc(), and use GC finalisation
29363         to close the handles.
29364
29365         * icall.c: added System.Threading.Thread::Thread_free_internal
29366
29367 Mon Apr 29 15:33:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
29368
29369         * icall.c: support Environment.Exit, CommandLineArgs().
29370
29371 Mon Apr 29 15:15:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
29372
29373         * object.c, object.h: added mono_runtime_run_main () and
29374         mono_runtime_get_main_args () for use in System.Environment.
29375
29376 Mon Apr 29 13:45:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
29377
29378         * gc.c: fix thinko, enable actual finalization since the jit is now
29379         fixed.
29380
29381 Mon Apr 29 12:47:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
29382
29383         * gc.c, object.c: take into account that an object may be offset wrt the address
29384         returned by GC_malloc().
29385
29386 Mon Apr 29 12:14:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
29387
29388         * image.c: handle files without entries in the assembly table (modules).
29389
29390 2002-04-28 Patrik Torstensson <patrik.torstensson@intel.com>
29391
29392         * reflection.c (mono_reflection_setup_internal_class): remove g_assert_not_reached() to allow 
29393         mcs selfhosting again (build breaker) and did move the check to class instead. parent is
29394         allowed to be null when it's System.Object class setup.
29395
29396 2002-04-27  Martin Baulig  <martin@gnome.org>
29397
29398         * reflection.c (mono_reflection_setup_internal_class): g_assert_not_reached()
29399         if `tb->parent == NULL' rather than crashing.
29400
29401 2002-04-28  Nick Drochak  <ndrochak@gol.com>
29402
29403         * sysmath.c (ves_icall_System_Math_Asin): Fix copy-paste error.  Was
29404         calling acos() where asin() should have been called.
29405
29406 2002-04-26  Martin Baulig  <martin@gnome.org>
29407
29408         * assembly.c (default_assembly_name_resolver): Use G_FILE_TEST_IS_REGULAR
29409         instead of G_FILE_TEST_EXISTS - if you're in mcs/class/corlib/System/Test,
29410         there's a subdirectory called `System', but we don't want to read that
29411         subdirectory as an assembly.
29412
29413 2002-04-25  Martin Baulig  <martin@gnome.org>
29414
29415         * debug-symfile.c: Reflect latest MonoString changes.
29416
29417 Thu Apr 25 16:38:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
29418
29419         * rand.c, rand.h: instance method icalls need to have an explicit
29420         this pointer as first argument in the C implementation.
29421
29422 2002-04-25  Nick Drochak <ndrochak@gol.com>
29423
29424         * icall.c: Fix typo in map for GetNonZeroBytes
29425
29426 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
29427
29428         * string-icalls.c : String does now passes unit tests without any 
29429         errors, the following changes has been made:
29430         
29431         Implemented replace methods.
29432         Renaming of methods to (try) follow the standard.
29433         Fixed compare ordinal
29434         Made all memory allocated directly to function instead of via icall function.
29435         Small performance fix in is_in_array function
29436                         
29437  (2002-04-23) Changes from Duncan Mak <duncan@ximian.com>
29438
29439         c (mono_string_Internal_ctor_charp_int_int):
29440         (mono_string_Internal_ctor_sbytep_int_int):  Removed check for
29441         sindex < 0, throw ArgumentOutOfRangeException instead of
29442         ArgumentNullException.
29443
29444         Added new check for length == 0, however
29445         I need to make it return String.Empty from the C code.
29446         
29447         (mono_string_Internal_ctor_sbytep): Use mono_string_new, and let
29448         that calculate the length for us here.
29449         
29450         (mono_string_Internal_ctor_sbytep_int_int): Replaced
29451         mono_string_new_utf16 with mono_string_new, since value is utf8.
29452
29453 Wed Apr 24 18:43:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
29454
29455         * object.c: register the object for finalization if needed.
29456         Allocate one more char in the string for the terminating 0 char.
29457
29458 Wed Apr 24 18:22:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
29459
29460         * class.c, class.h, image.c: check if a type implemenst a destructor.
29461         Use the proper key for array class lookups.
29462         * icall.c: register the icalls in the System.GC class.
29463         * gc.c, gc.h: GC-related functions and icalls.
29464
29465 2002-04-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29466
29467         * icall.c:
29468         * socket-io.c:
29469         * unicode.c: free some strings gotten from mono_string_to_utf8 and
29470         changed a couple of free () by g_free ().
29471
29472         * decimal.c: one-liner in the comments for decimal2string ().
29473
29474 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
29475
29476         * object.c (mono_runtime_invoke_array) : Bug because of my incompetence.
29477
29478 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
29479
29480         * reflection.c (mono_reflection_get_custom_attrs) : fixed image bug (crash)
29481         * object.c (mono_runtime_invoke_array) : handle null in params
29482
29483 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
29484
29485         * string-icalls.c: fixed bug in split (one off bug)
29486
29487 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
29488
29489         * string-icalls.c: fixed bug in remove and lastindexofany, add equals icall.
29490         * icalls.c: added String::Equals as internal method
29491
29492 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
29493
29494         * threads.c: fixed bug in the double interlocked functions
29495
29496 2002-04-22      Patrik Torstensson <patrik.torstensson@labs2.com>
29497
29498         * threads.c: implemented all of the new interlocked icalls.
29499         * string-icalls.c: fix a bug in insert.
29500         * icalls.c: added the icalls for interlocked, removed old string functions.
29501         
29502 Mon Apr 22 19:44:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
29503
29504         * loader.c: fix off-by-one error when reading argument names.
29505
29506 Mon Apr 22 19:28:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
29507
29508         * profiler.c: win32 counter implementation (untested).
29509         * icall.cs: win32 GetNow() and GetTimeZoneData() implementations
29510         (the latter needs testing and more complete impl. from win32 folks).
29511
29512 2002-04-21  Dan Lewis  <dihlewis@yahoo.co.uk>
29513
29514         * object.c: mono_array_new_full workaround mono_array_class_get
29515         problem.
29516
29517 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
29518
29519         * string-icalls.c (mono_string_InternalRemove): Fixed overwrite bug.
29520         * object.h (mono_string_chars): Changed casting type.
29521
29522 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
29523
29524         * string-icalls.c: Fixed trim method, added the constructors done by Duncan, fixed
29525                            method signatures to use gunichar2 instead of gint16.
29526
29527 2002-04-20  Dan Lewis  <dihlewis@yahoo.co.uk>
29528
29529         * object.h, object.c: domain-specific versions of mono_object_new and
29530         mono_array_new.
29531
29532 2002-04-20  Dietmar Maurer  <dietmar@ximian.com>
29533
29534         * object.c: changed String layout
29535
29536         * string-icalls.c (mono_string_Internal_ctor_chara): added
29537         internal string constructors.
29538
29539 Sat Apr 20 13:33:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
29540
29541         * threads.c: pass 'this' to the thread start routine.
29542
29543 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29544
29545         * string-icalls.c: fix IndexOf and LastIndexOf. Now
29546         InternalCompareStr don't call twice mono_string_cmp_char for the last
29547         character. Improved performance in mono_string_cmp_char.
29548
29549 Fri Apr 19 19:26:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
29550
29551         * Makefile.am, appdomain.c, class.c, object.c: split runtime-depended
29552         code into its own library: libmonoruntime.
29553
29554 2002-04-19  Dan Lewis  <dihlewis@yahoo.co.uk>
29555
29556         * object.h, object.c: changed array format so that szarrays do not
29557         require a bounds structure.
29558         * icall.c, appdomain.c: support for new szarray format.
29559
29560 Fri Apr 19 18:04:34 CEST 2002 Paolo Molaro <lupus@ximian.com>
29561
29562         * metadata.c: compare also the retuns type when comparing signatures:
29563         we didn't do this as an optimization since really overloaded methods
29564         must differ also in the arguments, but this doesn't work with
29565         low-level IL code (or when using explicit conversion operators: see
29566         bug#23498 for an example).
29567
29568 Fri Apr 19 16:14:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
29569
29570         * loader.c: SZARRAY types can be saved as TYPESPEC, too.
29571
29572 Thu Apr 18 17:15:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
29573
29574         * icall.c: make MonoType::GetElementType its own icall.
29575
29576 Thu Apr 18 16:41:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
29577
29578         * icall.c: remove MonoMethod_get_Name().
29579         * reflection.c, reflection.h, verify: cache the method name in the MonoMethod
29580         object.
29581
29582 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
29583
29584         * string-icalls.c: optimized a few methods.
29585
29586 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
29587
29588         * icall.c: added all new string internal calls
29589         * string-icalls.c: added, new string internal call implementation.
29590         * object.c: added mono_string_new_size for allocating a string a size
29591
29592 2002-04-17  Dietmar Maurer  <dietmar@ximian.com>
29593
29594         * object.c (mono_object_isinst): use the same code as in the
29595         optimized x86 version.
29596
29597 Wed Apr 17 14:14:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
29598
29599         * profiler.c: TSC-based timer code (faster and more accurate).
29600         Not hooked up in configure, yet (set USE_X86TSC to 1).
29601
29602 Wed Apr 17 12:33:10 CEST 2002 Paolo Molaro <lupus@ximian.com>
29603
29604         * profiler.c, profiler.h: track time spent compiling methods.
29605         * threads.c: track thread creation/destruction.
29606
29607 Tue Apr 16 20:08:43 CEST 2002 Paolo Molaro <lupus@ximian.com>
29608
29609         * profiler.c, profiler.h, profiler-private.h: profiling interface
29610         and sample implementation. Moved here so that it can be used also by
29611         the jit.
29612
29613 Tue Apr 16 12:58:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
29614
29615         * reflection.c, reflection.h: keep types and other handles separate in
29616         the hash tables for referred tokens. Add guid for modules.
29617
29618 Mon Apr 15 11:37:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
29619
29620         * assembly.c: fix bugs found with valgrind.
29621         * metadata.h, metadata.c: added mono_metadata_guid_heap().
29622
29623 2002-04-14      Patrik Torstensson <patrik.torstensson@labs2.com>
29624
29625         * threads: added icall support for getting current domain for
29626                    the thread.
29627  
29628 2002-04-13  Martin Baulig  <martin@gnome.org>
29629
29630         * debug-symfile.h (MonoDebugLocalInfo): Renamed to MonoDebugVarInfo.
29631         (MonoDebugVarInfo): Added `index' field for register based addresses.
29632         (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 9.
29633         (MonoDebugMethodInfo): Replaced `guint32 *param_offsets' with
29634         `MonoDebugVarInfo *params' and `guint32 this_offset' with
29635         `MonoDebugVarInfo *this_var'.
29636
29637         * debug-symfile.c (relocate_variable): New static function to write
29638         a location description for a local variable or method parameter.
29639
29640 2002-04-12  Martin Baulig  <martin@gnome.org>
29641
29642         * debug-symfile.h (MonoDebugLocalInfo): New type. This contains the
29643         stack offset and begin/end scope address of a local variable.
29644         (MonoDebugMethodInfo): Replaced `guint32 *local_offsets' with
29645         'MonoDebugLocalInfo *locals', added `prologue_end' and `epilogue_begin'.
29646         (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 8.
29647
29648         * debug-symfile.c (MRT_variable_start_scope, MRT_variable_end_scope):
29649         Added new relocation types for start/end scope of a local variable.
29650
29651 Fri Apr 12 18:30:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
29652
29653         * object.h: add mono_object_domain() macro.
29654         * reflection.c: handle typespecs.
29655         * icall.c: MonoMethod::get_Name() implementation.
29656
29657 Thu Apr 11 12:29Ni:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
29658
29659         * icall.c: String::GetHashCode() icall implementation.
29660
29661 Wed Apr 10 21:16:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
29662
29663         * icall.c: String::IndexOfAny icall.
29664         * object.c, object.h: make array->max_length more useful.
29665         Intrduced mono_object_class() and mono_string_length() macros.
29666
29667 2002-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29668
29669         * unicode.c (ves_icall_System_Char_IsNumber): use g_unichar_isxdigit
29670         instead of g_unichar_isdigit.
29671
29672 2002-04-11  Nick Drochak  <ndrochak@gol.com>
29673
29674         * icall.c: Implement a simple Double.ToString().
29675
29676 Tue Apr 9 21:31:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
29677
29678         * appdomain.h: only io-layer.h is supposed to be included.
29679         * icall.c: explicitly import environ. Fix warning.
29680
29681 2002-04-10  Nick Drochak  <ndrochak@gol.com>
29682
29683         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData) :
29684                 return true even if it's not Daylight Savings time.
29685                 Only return false for the case where the function isn't
29686                 implemented for a plaform (read Windows).
29687
29688 Tue Apr 9 13:05:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
29689
29690         * appdomain.h, appdomain.c, class.c, object.c: protect MonoDomain
29691         data with a mutex.
29692
29693 2002-04-09  Dietmar Maurer  <dietmar@ximian.com>
29694
29695         * mempool.c (mono_mempool_alloc): only use g_malloc when
29696         absolutely necessary.
29697
29698 2002-04-08  Dietmar Maurer  <dietmar@ximian.com>
29699
29700         * mempool.c (MEM_ALIGN): hardcode MEM_ALIGN to 8
29701
29702         * class.c (mono_class_vtable): use domain mempool to allocate vtable
29703         (mono_class_proxy_vtable): use domain mempool
29704
29705 Mon Apr 8 17:17:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
29706
29707         * appdomain.h, appdomain.c: split initialization that requires the
29708         execution engine support into mono_runtime_init().
29709
29710 2002-04-08  Dietmar Maurer  <dietmar@ximian.com>
29711
29712         * class.c (mono_class_init): don't include vtable inside MonoClass
29713         to save some memory, gather some statistics.
29714         (mono_class_vtable): use g_malloc instead of GC_malloc when possible
29715
29716 Sat Apr 6 20:07:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
29717
29718         * icall.c: internalcall implementation for ValueType.Equals().
29719
29720 2002-04-06  Dietmar Maurer  <dietmar@ximian.com>
29721
29722         * object.c (mono_message_init): moved 
29723         (mono_runtime_exec_main): new arch. independent impl.
29724         (mono_runtime_invoke_array): new method - like
29725         mono_runtime_invoke, but you can pass an array of objects.
29726         (mono_remoting_invoke): new arch. independent impl.
29727         (mono_message_invoke): new arch. independent impl.
29728         (mono_runtime_class_init): new arch. independent impl.
29729         (mono_runtime_object_init): new arch. independent impl.
29730
29731 Fri Apr 5 18:29:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
29732
29733         * metadata.c, object.c, reflection.c: documented the exported
29734         functions.
29735
29736 Fri Apr 5 15:42:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
29737
29738         * icall.c: simpler code to pass the assembly builder data to corlib.
29739         Implement GetNestedTypes() internalcall.
29740
29741 Thu Apr 4 21:46:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
29742
29743         * class.c: warn if a type can't be loaded.
29744
29745 2002-04-04  Dietmar Maurer  <dietmar@ximian.com>
29746
29747         * image.h: typedef MonoImageOpenStatus
29748         * types.h: removed unused file
29749         
29750 2002-04-04  Dan Lewis  <dihlewis@yahoo.co.uk>
29751
29752         * icall.c: Enum_ToObject accepts enum value arguments.
29753
29754 Thu Apr 4 11:35:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
29755
29756         * class.c: move initialization of properties, events and nested
29757         classes, so that they happen for interfaces, too.
29758
29759 Wed Apr 3 20:03:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
29760
29761         * icall.c: cleanup some ugly casts in Array_SetValue*.
29762
29763 Wed Apr 3 19:49:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
29764
29765         * icall.c: the values array fro enums is of the correct type, now.
29766         Implement (correctly) getFullName instead of assQualifiedName for
29767         MonoType.
29768         * reflection.h, reflection.c: added mono_type_get_name ().
29769
29770 Wed Apr 3 17:56:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
29771
29772         * assembly.c, image.h: for each MonoImage, record from wich assembly
29773         it was loaded.
29774         * reflection.h, icall.c: added System_Reflection_Assembly_GetTypes().
29775         Make Type.Assembly work.
29776
29777 2002-04-03  Dietmar Maurer  <dietmar@ximian.com>
29778
29779         * debug-symfile.h: use char* instead of gpointer to avoid
29780         unnecessary casts.
29781
29782         * appdomain.c (mono_jit_info_table_find): use char* instead of gpointer
29783
29784         * icall.c (ves_icall_InternalExecute): impl. FielSetter
29785         (ves_icall_System_Array_SetValueImpl): removed strange MonoArray cast
29786
29787 2002-03-30  Dietmar Maurer  <dietmar@ximian.com>
29788
29789         * icall.c (mono_message_init): impl. (code cleanup)
29790         (ves_icall_InternalExecute): impl. FieldGetter
29791
29792         * class.c (mono_class_init): added exerimental EXT_VTABLE_HACK, if
29793         defined we call all (non-static)methods through the vtable. 
29794
29795 Fri Mar 29 18:09:08 CET 2002 Paolo Molaro <lupus@ximian.com>
29796
29797         * class.c: it seems GC_debug_malloc() makes the Boehm GC call the
29798         finalizer even though the memory is still referenced (and the chunk of
29799         memory is not freed).
29800
29801 Fri Mar 29 17:43:04 CET 2002 Paolo Molaro <lupus@ximian.com>
29802
29803         * assembly.c: fix brokeness.
29804
29805 Fri Mar 29 16:09:54 CET 2002 Paolo Molaro <lupus@ximian.com>
29806
29807         * class.c: kill some warnings. Check explicit interface method
29808         implementation also without considering the namespace.
29809         Load also literal strings in static class data.
29810
29811 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
29812
29813         * assembly.c (default_assembly_name_resolver): Kill memory leak. 
29814         (default_assembly_name_resolver): Make the resolver take the
29815         "base" directory where the assembly was originally defined, so we
29816         can load DLLs that are in the same directory as the assembly that
29817         is being referenced.
29818
29819 2002-03-28  Dick Porter  <dick@ximian.com>
29820
29821         * file-io.h: 
29822         * file-io.c:
29823         * socket-io.c: 
29824         * unicode.h: 
29825         * unicode.c: Warning cleanups
29826
29827 Thu Mar 28 18:06:14 CET 2002 Paolo Molaro <lupus@ximian.com>
29828
29829         * object.h, reflection.h: use the correct type instead of MonoObject.
29830
29831 2002-03-28  Martin Baulig  <martin@gnome.org>
29832
29833         * debug-symfile.c (mono_debug_class_get): Don't look in referenced assemblies.
29834         (mono_debug_update_symbol_file): Initialize classes if necessary.
29835
29836 Thu Mar 28 15:58:43 CET 2002 Paolo Molaro <lupus@ximian.com>
29837
29838         * assembly.c, debug-helpers.c, image.c, image.h, metadata.c, pedump.c,
29839         rawbuffer.c, reflection.c, verify.c: mare warning cleanups.
29840
29841 Thu Mar 28 15:20:39 CET 2002 Paolo Molaro <lupus@ximian.com>
29842
29843         * assembly.h: fix function prototype.
29844         * metadata.h, metadata.c, object.h, private.h: get rid of warnings.
29845         * mono-endian.h: use const cast.
29846
29847 2002-03-28  Dietmar Maurer  <dietmar@ximian.com>
29848
29849         * icall.c (ves_icall_MonoMethodMessage_InitMessage): moved from message.c
29850
29851 Thu Mar 28 12:32:00 CET 2002 Paolo Molaro <lupus@ximian.com>
29852
29853         * loader.c: don't assert when a typeref can't be loaded, give
29854         a chance to the runtime to trow an exception instead.
29855         * loader.h: fix warning.
29856
29857 2002-03-28  Dietmar Maurer  <dietmar@ximian.com>
29858
29859         * class.c (mono_class_proxy_vtable): added proxy support
29860
29861 2002-03-27  Dan Lewis <dihlewis@yahoo.co.uk>
29862
29863         * icall.c: removed last of PAL calls, added System.Environment
29864         * file-io.h, file-io.c: MonoIO implementation
29865         * object.h, object.c: mono_string_to_utf16() now returns gunichar2*
29866
29867 Tue Mar 26 19:56:10 CET 2002 Paolo Molaro <lupus@ximian.com>
29868
29869         * appdomain.c: do not use the byte marker in ldstr table lookup.
29870         * debug-helpers.c: allow two ':' to separate class and method name.
29871         * object.c: allocate arrays bounds with the GC, too.
29872         * verify: add a few more checks.
29873
29874 Tue Mar 26 18:45:46 CET 2002 Paolo Molaro <lupus@ximian.com>
29875
29876         * reflection.c: output also literal strings. Allocate parameter data
29877         with GC_malloc() (thanks, Martin, for catching this!).
29878
29879 2002-03-26  Martin Baulig  <martin@gnome.org>
29880
29881         * debug-symfile.h (MonoDebugMethodInfo): Added `this_offset', don't
29882         include the `this' offset in the `param_offsets'.
29883
29884 2002-03-25  Martin Baulig  <martin@gnome.org>
29885
29886         * debug-symfile.c (mono_debug_update_symbol_file): Use a new
29887         mono_debug_get_class() function to get the classes. Added new
29888         relocation types for arrays and strings.
29889         (mono_debug_get_class): New static function to search in all
29890         referenced assemblies for a metadata token.
29891
29892         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 7.
29893
29894 Mon Mar 25 13:08:18 CET 2002 Paolo Molaro <lupus@ximian.com>
29895
29896         * reflection.h, reflection.c: use a gc-safe hash for hash tables that
29897         hold gc-allocated objects. Make the string heap a stream like the
29898         others. Removed duplicated code when writing stream info.
29899         Added asserts to catch possible buffer overflows. Set the sorted map
29900         for tables that need sorting. Added some documentation.
29901
29902 Mon Mar 25 13:04:56 CET 2002 Paolo Molaro <lupus@ximian.com>
29903
29904         * appdomain.h, appdomain.c, class.c, object.c: use a GC-safe hash table 
29905         for interned strings and vtables.
29906
29907 2002-03-24  Martin Baulig  <martin@gnome.org>
29908
29909         * icall.c (ves_icall_Type_GetFields): Reverse the list before storing
29910         it in the array since it was created with g_slist_prepend().
29911
29912 2002-03-24  Martin Baulig  <martin@gnome.org>
29913
29914         * debug-symfile.c (mono_debug_local_type_from_signature): Renamed
29915         to ves_icall_Debugger_MonoSymbolWriter_get_local_type_from_sig().
29916         (mono_debug_method_from_token): Renamed to
29917         ves_icall_Debugger_MonoSymbolWriter_method_from_token().
29918         (ves_icall_Debugger_DwarfFileWriter_get_type_token): New interncall.
29919
29920         * debug-symfile.c (MRT_type_sizeof, MRT_type_field_offset): New
29921         relocation types.
29922
29923         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 6.
29924
29925 2002-03-24  Martin Baulig  <martin@gnome.org>
29926
29927         * debug-symfile.c (mono_debug_local_type_from_signature): New func.
29928         (mono_debug_method_from_token): New func.
29929
29930         * icall.c (Mono.CSharp.Debugger.MonoSymbolWriter::get_local_type_from_sig):
29931         New interncall, calls mono_debug_local_type_from_signature().
29932         (Mono.CSharp.Debugger.MonoSymbolWriter::get_method): New interncall,
29933         calls mono_debug_method_from_token().
29934
29935 2002-03-23  Martin Baulig  <martin@gnome.org>
29936
29937         * unicode.c (ves_icall_iconv_get_char_count): The `count' argument
29938         specifies the number of bytes to be converted, not the array size.
29939         Return the number of chars, not the number of bytes.
29940         (ves_icall_iconv_get_chars): The `byteCount' argument
29941         specifies the number of bytes to be converted, not the array size.
29942
29943 2002-03-23  Martin Baulig  <martin@gnome.org>
29944
29945         * reflection.h (MonoReflectionSigHelper): New type.
29946
29947         * reflection.c (mono_reflection_sighelper_get_signature_local),
29948         (mono_reflection_sighelper_get_signature_local): New functions.
29949
29950         * icall.c (System.Reflection.Emit.SignatureHelper::get_signature_local),
29951         (System.Reflection.Emit.SignatureHelper::get_signature_field): New
29952         interncalls.
29953
29954 2002-03-23  Martin Baulig  <martin@gnome.org>
29955
29956         * rawbuffer.c (mono_raw_buffer_load_mmap): Use MAP_SHARED when
29957         is_writeable is set.
29958         (mono_raw_buffer_update): New function to write the modified map
29959         back to disk.
29960
29961         * debug-symfile.h (MonoDebugSymbolFile): Added `raw_contents_size'.
29962
29963         * debug-symfile.c (mono_debug_update_symbol_file): Call
29964         mono_raw_buffer_update() when done writing.
29965
29966 2002-03-23  Martin Baulig  <martin@gnome.org>
29967
29968         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 5.
29969
29970         * debug-symfile.c: Added support for arguments and local variables.
29971
29972 2002-03-23  Dick Porter  <dick@ximian.com>
29973
29974         * debug-symfile.c: Remove extraneous 'include <elf.h>' that wasn't
29975         protected by ifdefs, hence breaking the w32 build.
29976
29977 Thu Mar 21 17:35:01 CET 2002 Paolo Molaro <lupus@ximian.com>
29978
29979         * object.c: implement is_interned() the right way.
29980
29981 2002-03-21  Martin Baulig  <martin@gnome.org>
29982
29983         * debug-symfile.[ch]: New files to handle debugging information
29984         files. There's also support to dynamically update these symbol
29985         files to include machine dependent information.
29986
29987 2002-03-20  Dietmar Maurer  <dietmar@ximian.com>
29988
29989         * threads.c (mono_thread_create): new function to create thread
29990         from C
29991
29992 2002-03-20  Martin Baulig  <martin@gnome.org>
29993
29994         * icall.c (ves_icall_InternalInvoke): Create a new object if the
29995         method is a constructor.
29996         (icall_map): Added "System.Reflection.MonoCMethod::InternalInvoke",
29997         points to ves_icall_InternalInvoke().
29998
29999 2002-03-20  Dan Lewis <dihlewis@yahoo.co.uk>
30000
30001         * file-io.c: Flush shouldn't throw exceptions.
30002
30003 2002-03-19  Dan Lewis <dihlewis@yahoo.co.uk>
30004
30005         * file-io.c: FileStream flush support; FileSetLength now
30006         restores file pointer.
30007
30008 Tue Mar 19 18:17:21 CET 2002 Paolo Molaro <lupus@ximian.com>
30009
30010         * class.c: set image for pointer classes.
30011
30012 2002/03/19  Nick Drochak <ndrochak@gol.com>
30013
30014         * sysmath.c: Forgot one.
30015
30016 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
30017
30018         * sysmath.c: Avoid redefining existing names.
30019
30020 2002-03-18  Dan Lewis <dihlewis@yahoo.co.uk>
30021
30022         * sysmath.c, sysmath.h, icall.c, Makefile.am: math routines now
30023         handled by runtime as icall rather than dllimport from libm.so
30024         * file-io.c, file-io.h: fixed handle argument type.
30025
30026 2002-03-18  Dick Porter  <dick@ximian.com>
30027
30028         * reflection.c (mono_image_get_type_info): rename interface to
30029         iface, because of "#define interface struct" on windows.
30030
30031 Sat Mar 16 19:18:38 CET 2002 Paolo Molaro <lupus@ximian.com>
30032
30033         * class.c, class.h: rename and export mono_ptr_class_get().
30034         * metadata.c: support MONO_TYPE_ARRAY in MonoType compare.
30035         * reflection.c, reflection.h, icall.c: better/saner type name
30036         parsing and MonoType creation. Handle MONO_TYPE_ARRAY in
30037         method signatures.
30038
30039 2002-03-14  Dietmar Maurer  <dietmar@ximian.com>
30040
30041         * class.c (mono_class_init): removed hardcoded GHC_SLOT
30042
30043         * icall.c (ves_icall_InternalInvoke): impl.
30044
30045 Wed Mar 13 00:27:30 CET 2002 Paolo Molaro <lupus@ximian.com>
30046
30047         * reflection.c: output the interface map table, too.
30048
30049 2002-03-12  Dietmar Maurer  <dietmar@ximian.com>
30050
30051         * class.c (class_compute_field_layout): separate computation of 
30052         static field layout
30053
30054 2002-03-12  Dan Lewis <dihlewis@yahoo.co.uk>
30055
30056         * icall.c: added System.Buffer support.
30057         * file-io.c: moved file icalls from PAL to FileStream.
30058
30059 2002-03-12  Dietmar Maurer  <dietmar@ximian.com>
30060
30061         * icall.c (ves_icall_System_Object_GetHashCode): impl.
30062
30063 2002-03-11  Dietmar Maurer  <dietmar@ximian.com>
30064
30065         * icall.c (ves_icall_System_ValueType_GetHashCode): impl.
30066
30067 Mon Mar 11 14:45:42 CET 2002 Paolo Molaro <lupus@ximian.com>
30068
30069         * verify.c, verify.h: moved here the corlib/runtime consistency checks.
30070
30071 Mon Mar 11 11:12:23 CET 2002 Paolo Molaro <lupus@ximian.com>
30072
30073         * debug-helpers.{c,h}: moved here from monograph some useful functions
30074         to locate a method by name/signature in a class or image. Included
30075         also a small and flexible IL disassembler.
30076
30077 Fri Mar 8 16:29:29 CET 2002 Paolo Molaro <lupus@ximian.com>
30078
30079         * reflection.c: fixup tokens in methods with small header size, too.
30080
30081 2002-03-08  Dietmar Maurer  <dietmar@ximian.com>
30082
30083         * object.c (mono_string_to_utf8): remove assert(!error), instead
30084         print a warning. 
30085
30086 Thu Mar 7 18:55:15 CET 2002 Paolo Molaro <lupus@ximian.com>
30087
30088         * icall.c: update to the new mono_Array_class_get interface.
30089
30090 Thu Mar 7 17:23:26 CET 2002 Paolo Molaro <lupus@ximian.com>
30091
30092         * appdomain.c, object.c: Boehm-GC enable.
30093         * icall.c: make get_data_chunk() support split data requests.
30094         Ensure a class is initialized in more cases. Return only the first
30095         property found in GetProperties() or the compiler gets confused. 
30096         Implemented GetEvents(). Temporary fix to GetType(), needs rewriting.
30097         * reflection.h, reflection.c: add fixup mechanism for field and method
30098         tokens. Initialize assembly->typeref in a single place. Output
30099         properties after events. Support custom attributes for events, too.
30100         Typo fix for paramter custom attrs.
30101
30102 2002-03-07  Martin Baulig  <martin@gnome.org>
30103
30104         * icall.c (ves_icall_System_Array_FastCopy): Small fix.
30105
30106 2002-03-07  Dietmar Maurer  <dietmar@ximian.com>
30107
30108         * class.c (mono_array_class_get): fix. for multi. dim. arrays
30109
30110 2002-03-06  Martin Baulig  <martin@gnome.org>
30111
30112         * icall.c (ves_icall_System_Array_CreateInstanceImpl): Make this work with
30113         non-zero lower bounds. See testcases #F10-#F13.
30114
30115 2002-03-05  Martin Baulig  <martin@gnome.org>
30116
30117         * exception.c (mono_get_exception_argument_out_of_range): New exception.
30118
30119         * icall.c (ves_icall_System_Array_GetValue): Moved actual implementation to
30120         ves_icall_System_Array_GetValue(), only calculate the absolute array position
30121         here.
30122         (ves_icall_System_Array_SetValue): Likewise.
30123         (ves_icall_System_Array_GetValueImpl): New interncall. Takes an array position
30124         as argument and does the actual work. This function is used when copying a
30125         multi-dimensional array.
30126         (ves_icall_System_Array_SetValueImpl): Almost completely rewrote this. It can
30127         now do all the widening conversions of value types.
30128         (ves_icall_System_Array_CreateInstanceImpl): Implemented.
30129
30130 Tue Mar 5 18:14:01 CET 2002 Paolo Molaro <lupus@ximian.com>
30131
30132         * class.c: remove some magic numbers and use the smbolic names,
30133         instead. Added init_events() to load event info at class init time.
30134         * metadata.h, metadata.c: added mono_metadata_events_from_typedef()
30135         and mono_metadata_methods_from_event().
30136         * reflection.h, reflection.c: added support for writing out the evnets
30137         related information.
30138
30139 Mon Mar 4 20:32:43 CET 2002 Paolo Molaro <lupus@ximian.com>
30140
30141         * reflection.h, icall.c: use a different method (GetInterfaces)
30142         to gather interface info and add isbyref, isprimitive and
30143         ispointer to the ves_icall_get_type_info() return value.
30144
30145 Mon Mar 4 11:22:26 CET 2002 Paolo Molaro <lupus@ximian.com>
30146
30147         * class.h: stared adding support for events.
30148         * icall.c: split find_members implementation. Added debug icall to get
30149         the address of an object.
30150         * reflection.c: handle TypeBuilders in mono_type_get_object().
30151
30152 2002-03-01  Martin Baulig  <martin@gnome.org>
30153
30154         * icall.c (ves_icall_System_Array_GetLength): This must throw an
30155         ArgumentOutOfRangeException(), not an ArgumentException().
30156         (ves_icall_System_Array_GetLowerBound): Likewise.
30157         (ves_icall_System_Array_GetValue): Improved argument checking.
30158         (ves_icall_System_Array_SetValue): Improved argument checking.
30159
30160 2002-03-01  Martin Baulig  <martin@gnome.org>
30161
30162         * icall.c (ves_icall_System_Array_GetValue): Raise an exception when
30163         called with invalid arguments rather than just dying with g_assert().
30164         (ves_icall_System_Array_SetValue): Likewise.
30165         (ves_icall_System_Array_CreateInstanceImpl): Don't g_assert_not_reached(),
30166         raise a NotImplementedException instead.
30167         (ves_icall_System_Array_GetLength): Added argument checking.
30168         (ves_icall_System_Array_GetLowerBound): Added argument checking.
30169
30170 2002-03-01  Dietmar Maurer  <dietmar@ximian.com>
30171
30172         * object.h (mono_assert): new macros mono_assert and
30173         mono_assert_not_reached
30174
30175 2002-02-28  Martin Baulig  <martin@gnome.org>
30176
30177         * icall.c: Rename "System::String::Intern" to "System::String::_Intern"
30178         and "System::String::IsInterned" to "System::String::_IsInterned".
30179
30180 Thu Feb 28 19:19:35 CET 2002 Paolo Molaro <lupus@ximian.com>
30181
30182         * icall.c: remove hacks for typebuilder. Added icall to create a
30183         modified type from a tybebuilder.
30184         * reflection.c: removed hacks for TypeBuilder. Create also a MonoImage
30185         in mono_image_basic_init (). Added mono_reflection_setup_internal_class ()
30186         to create a backing MonoClass for a TypeBuilder.
30187
30188 Thu Feb 28 15:35:51 CET 2002 Paolo Molaro <lupus@ximian.com>
30189
30190         * class.c, class.h: more refactoring of class init.
30191         Export mono_class_setup_mono_type() and mono_class_setup_parent().
30192
30193 Thu Feb 28 12:33:41 CET 2002 Paolo Molaro <lupus@ximian.com>
30194
30195         * marshal.c, marshal.h: start of marshaling interface.
30196
30197 Wed Feb 27 22:15:17 CET 2002 Paolo Molaro <lupus@ximian.com>
30198
30199         * icall.c: fix order in assembly qualified name icall.
30200
30201 Wed Feb 27 18:45:03 CET 2002 Paolo Molaro <lupus@ximian.com>
30202
30203         * class.c: do not free str, since we store it in the hash table.
30204         * reflection.h: add label field to MonoILExceptionInfo.
30205         * reflection.c: handle references to more than one assembly. Handle
30206         case when there isn't a module created in the assembly.
30207
30208 Wed Feb 27 12:35:10 CET 2002 Paolo Molaro <lupus@ximian.com>
30209
30210         * class.c: Fix typo. Start refactoring of class init code.
30211
30212 Wed Feb 27 12:23:00 CET 2002 Paolo Molaro <lupus@ximian.com>
30213
30214         * appdomain.c: exit with 1 on error.
30215         * class.c: we already have the name in MonoClassField.
30216         * image.c, image.h, metadata.c, pedump.c: use directly a pointer in
30217         MonoStreamHeader instead of an offset of image->raw_metadata.
30218
30219 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
30220
30221         * appdomain.c (mono_init): Be even more descriptive about the error.
30222
30223 Tue Feb 26 16:18:07 CET 2002 Paolo Molaro <lupus@ximian.com>
30224
30225         * appdomain.c: give the user an informative message when corlib can't
30226         be loaded.
30227
30228 2002-02-26  Martin Baulig  <martin@gnome.org>
30229
30230         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData):
30231         New icall to get the time zone data.
30232
30233 Mon Feb 25 15:51:51 CET 2002 Paolo Molaro <lupus@ximian.com>
30234
30235         * reflection.c: set virtual and raw size of section correctly.
30236         * threads.c: transfer domain information to newly created threads.
30237
30238 Fri Feb 22 18:55:57 CET 2002 Paolo Molaro <lupus@ximian.com>
30239
30240         * class.c: when instancing a class in a domain, load the default
30241         vaules for static fields from the constant table. Fix System.Enum to
30242         not be an enum.
30243         * icall.c: implement Object::GetType() internalcall. Implemented
30244         MonoField::GetValue() internalcall. Avoid SEGV in search_method().
30245         Fixed checking of binding flags in find_members().
30246         * metadata.c, metadata.h: introduce mono_metadata_type_hash().
30247         * reflection.c: handle enumerations when writing to the constant
30248         table. Use a different object cache for types.
30249
30250
30251 2002-02-22  Dietmar Maurer  <dietmar@ximian.com>
30252
30253         * object.c (mono_object_isinst): fix for arrays
30254
30255         * icall.c (ves_icall_type_is_subtype_of): fix for 2 interfaces
30256
30257 Thu Feb 21 21:00:13 CET 2002 Paolo Molaro <lupus@ximian.com>
30258
30259         * object.c: don't use mprotect ()  and fix intern pool hash table
30260         lookup for big endian systems.
30261
30262 Thu Feb 21 19:30:29 CET 2002 Paolo Molaro <lupus@ximian.com>
30263
30264         * icall.c: change type_is_subtype_of () signature.
30265
30266 2002-02-21  Mark Crichton  <crichton@gimp.org>
30267
30268         * rand.c, rand.h: Added random number generator for
30269         System.Security.Cryptography classes.
30270
30271         * exception.c, exception.h: Added mono_get_exception_not_implemeted.
30272
30273         * icall.c: Added System.Security.Cryptography calls.
30274
30275 Thu Feb 21 16:45:34 CET 2002 Paolo Molaro <lupus@ximian.com>
30276
30277         * class.c, icall.c, metadata.c: better support for pointer types.
30278         Create a class for them as suggested by dietmar. Fix TYPE_ARRAY class.
30279         * reflection.c: Add support for getting custom attrs for properties
30280         and simplify some code.
30281
30282 Wed Feb 20 22:20:29 CET 2002 Paolo Molaro <lupus@ximian.com>
30283
30284         * icall.c: change getToken () and add custom attribute GetBlob()helper
30285         method.
30286         * reflection.h: add custom attrs array to the reflection builder structures.
30287         * reflection.c: encode and emit custom attributes for all the relevant
30288         reflection objects. Cache fieldref and methodref tokens. Change
30289         mono_image_create_token() interface to take a MonoDynamicAssembly.
30290         More complete custom attributes decoder. Load custom attributes for
30291         Assembly, Field, Method and Constructor objects, too. Make the
30292         returned array an Attribute[] one, not object[]. Added
30293         mono_reflection_get_custom_attrs_blob() to encode the arguments of a
30294         custom attribute constructor.
30295
30296 2002-02-20  Dick Porter  <dick@ximian.com>
30297
30298         * icall.c:
30299         * rawbuffer.c:
30300         * socket-io.c: Windows portability fixes (sometimes just ifdeffing
30301         problem code out for now).
30302
30303 2002-02-19  Radek Doulik  <rodo@ximian.com>
30304
30305         * object.c (mono_ldstr): use hash table to avoid multiple swapping
30306
30307 Tue Feb 19 20:23:11 CET 2002 Paolo Molaro <lupus@ximian.com>
30308
30309         * icall.c: register the GetCustomAttributes method.
30310         * object.c, object.h: add mono_string_new_len ().
30311         * reflection.h, reflection.c: added mono_runtime_invoke(),
30312         mono_install_runtime_invoke(). Added
30313         mono_reflection_get_custom_attrs () to load custom attributes and
30314         create the attribute objects.
30315
30316 2002-02-19  Dick Porter  <dick@ximian.com>
30317         * threads-dummy-types.c:
30318         * threads-dummy-types.h:
30319         * threads-dummy.c:
30320         * threads-dummy.h:
30321         * threads-pthread-types.c:
30322         * threads-pthread-types.h:
30323         * threads-pthread.c:
30324         * threads-pthread.h:  Deleted obsolete files
30325
30326 2002-02-19  Dietmar Maurer  <dietmar@ximian.com>
30327
30328         * class.c (mono_class_vtable): runtime init the class when we
30329         allocate static class data.
30330
30331         * icall.c (ves_icall_System_Array_SetValue): check for null values.
30332
30333         * appdomain.c (mono_domain_transfer_object): impl. hack for Arrays
30334         and String - but we will need generic marshalling support in the
30335         future. 
30336         (mono_init): set the domain name in a ms compatible way
30337
30338         * object.c (mono_string_new_utf16): bug fix: use char[] instead of
30339         String[].
30340
30341 2002-02-18  Dietmar Maurer  <dietmar@ximian.com>
30342
30343         * object.c (mono_array_clone): use alloca() instead of g_malloc  
30344         for sizes
30345
30346         * appdomain.c (mono_domain_unload): impl.
30347
30348 Mon Feb 18 15:52:20 CET 2002 Paolo Molaro <lupus@ximian.com>
30349
30350         * appdomain.c, object.c: fix intern pool implementation.
30351         * class.c: fix alignment code.
30352
30353 2002-02-16  Radek Doulik  <rodo@ximian.com>
30354
30355         * icall.c (ves_icall_System_Enum_ToObject): in case of big endian
30356         and s2 > s1, just copy lower bytes to be compatible with little
30357         endian (i.e. 64bit value & 0xffffffff --> 32bit value)
30358         (ves_icall_System_Enum_ToObject): and likewise for s1 > s2
30359
30360         * unicode.c (ves_icall_iconv_new_encoder): decide on big_endian,
30361         force big_endian to be 1 for big endian machines 
30362         (ves_icall_iconv_new_decoder): ditto
30363
30364 2002-02-16  Jeffrey Stedfast  <fejj@ximian.com>
30365
30366         * socket-io.c (convert_sockopt_level_and_name): If the system
30367         doesn't define SOL_IP or SOL_TCP, get them by hand using
30368         getprotobyname() and caching the values (because this could be a
30369         slow operation).
30370         (ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal):
30371         Use the appropriate struct when the system does support it. Ie,
30372         not all systems have struct ip_mreqn so use struct ip_mreq when
30373         appropriate.
30374
30375 Fri Feb 15 18:15:44 CET 2002 Paolo Molaro <lupus@ximian.com>
30376
30377         * reflection.c: handle finally clauses.
30378
30379 Fri Feb 15 15:06:33 CET 2002 Paolo Molaro <lupus@ximian.com>
30380
30381         * socket-io.c: use g_snprintf() instead of snprintf.
30382
30383 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
30384
30385         * reflection.c (mono_param_get_objects): Cast second argument to
30386         mono_method_get_param_names to a const char** to silence the
30387         compiler warning.
30388
30389         * appdomain.c (mono_domain_assembly_open): Put parens around the
30390         truth statement in the for-loop.
30391
30392         * unicode.c (iconv_convert): Got rid of a compiler warning about
30393         int i being unused when the system has a new iconv.
30394         (iconv_get_length): Same.
30395
30396         * image.c (load_class_names): Cast the second argument to
30397         g_hash_table_insert() to char* to hush compiler warnings about the
30398         arg being a const.
30399         (mono_image_open): Same here.
30400
30401         * socket-io.c: Don't conditionally include sys/filio.h or
30402         sys/sockio.h here anymore since we now get them from
30403         io-layer/io-layer.h
30404         (inet_pton): If the system doesn't support inet_aton, implement
30405         using inet_addr and also #define INADDR_NONE if it isn't defined
30406         by the system.
30407
30408 Thu Feb 14 19:01:06 CET 2002 Paolo Molaro <lupus@ximian.com>
30409
30410         * metadata.c, metadata.h: added function to get packing and size info
30411         of a typedef.
30412         * reflection.h, reflection.c: handle field RVA data. Save info about
30413         the table layout if needed. Assign typedef indexes to all the types
30414         before dumping the info about them to avoid forward reference problems.
30415
30416 2002-02-14  Dietmar Maurer  <dietmar@ximian.com>
30417
30418         * socket-io.c (convert_sockopt_level_and_name): ifdef
30419         SO_ACCEPTCONN because it is not defined on my system (old debian)
30420
30421 Thu Feb 14 11:49:30 CET 2002 Paolo Molaro <lupus@ximian.com>
30422
30423         * opcode.c: use stddef.h to get NULL.
30424
30425 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
30426
30427         * socket-io.c: conditionally include sys/filio.h and sys/sockio.h
30428         for FIONBIO, FIONREAD and SIOCATMARK.
30429         (ves_icall_System_Net_Dns_GetHostByAddr_internal): SunOS doesn't
30430         define INADDR_NONE and besides, inet_addr() is deprecated and
30431         should not be used. Use inet_pton() instead - it also has the
30432         added bonus that it can easily handle IPv6 addresses as well.
30433         (inet_pton): Implement using inet_aton() ifndef HAVE_INET_PTON.
30434
30435 Wed Feb 13 23:00:21 CET 2002 Paolo Molaro <lupus@ximian.com>
30436
30437         * decimal.c: remove _MSC_VER conditional.
30438
30439 2002-02-13  Dick Porter  <dick@ximian.com>
30440
30441         * socket-io.c: 
30442         * icall.c: Internal calls for Blocking, Select, Shutdown,
30443         GetSocketOption and SetSocketOption
30444
30445 Wed Feb 13 19:20:01 CET 2002 Paolo Molaro <lupus@ximian.com>
30446
30447         * assembly.cs: better resolver: use it instead of some kludgy
30448         code.
30449
30450 Wed Feb 13 18:25:55 CET 2002 Paolo Molaro <lupus@ximian.com>
30451
30452         * reflection.c: the best way to speed-up the compiler is to avoid
30453         infinite loops.
30454
30455 2002-02-13  Dietmar Maurer  <dietmar@ximian.com>
30456
30457         * class.c (mono_class_vtable): changed the object layout
30458         (obj->vtable->class). 
30459         (mono_class_create_from_typespec): consider MONO_TYPE_PTR
30460
30461 Tue Feb 12 20:06:01 CET 2002 Paolo Molaro <lupus@ximian.com>
30462
30463         * assembly.c: look for assemblies in the assembly dir, too.
30464
30465 Tue Feb 12 14:03:42 CET 2002 Paolo Molaro <lupus@ximian.com>
30466
30467         * class.c: fix thinko in mono_class_from_type().
30468
30469 Mon Feb 11 19:43:51 CET 2002 Paolo Molaro <lupus@ximian.com>
30470
30471         * exception.h, exception.c: added TypeLoadException.
30472         * object.h, object.c: added mono_array_clone ().
30473         * icall.c: handle throwOnError in AssemblyGetType().
30474         Added Array.Clone().
30475         * opcode.h, opcode.c: use a single value for the opcode val.
30476         Compile fix for non-gcc compilers.
30477
30478 Fri Feb 8 12:26:37 CET 2002 Paolo Molaro <lupus@ximian.com>
30479
30480         * opcodes.c, opcodes.h: export interesting info about opcodes.
30481
30482 2002-02-05  Dietmar Maurer  <dietmar@ximian.com>
30483
30484         * object.h (MONO_CHECK_ARG, MONO_CHECK_ARG_NULL): new macro for
30485         icalls. 
30486
30487         * class.c (class_compute_field_layout): set element_class for enums
30488         (mono_class_create_from_typedef): set element_class for normal classes
30489
30490         * icall.c (ves_icall_System_Enum_get_value): impl.
30491
30492         * class.c (mono_class_create_from_typedef): do not set valuetype
30493         flag for System.ValueType and System.Enum
30494
30495 2002-02-04  Dietmar Maurer  <dietmar@ximian.com>
30496
30497         * unicode.c (iconv_convert): fix big endian problem.
30498
30499 Fri Feb 1 16:13:20 CET 2002 Paolo Molaro <lupus@ximian.com>
30500
30501         * class.c: add asserts if we are ever going to scribble over memory.
30502         * socket-io.c: not all systems have AF_IRDA defined.
30503
30504 2002-01-31  Dietmar Maurer  <dietmar@ximian.com>
30505
30506         * class.c (class_compute_field_layout): do not consider static
30507         fields to compute alignment
30508
30509 2002-01-25  Dietmar Maurer  <dietmar@ximian.com>
30510
30511         * appdomain.c (mono_appdomain_get): impl.
30512         (ves_icall_System_AppDomain_ExecuteAssembly): impl.
30513
30514 Thu Jan 24 12:59:23 CET 2002 Paolo Molaro <lupus@ximian.com>
30515
30516         * icall.c: ignore "file://" prefix when loading an assembly.
30517
30518 2002-01-23  Dick Porter  <dick@ximian.com>
30519
30520         * socket-io.c:
30521         * icall.c:
30522         * Makefile.am: Added socket support
30523
30524 2002-01-23  Miguel de Icaza  <miguel@ximian.com>
30525
30526         * icall.c (ves_icall_appdomain_get_default_assemblies): put this
30527         code back.  This should return the assemblies that are loaded by
30528         the runtime on behalf of an application domain. 
30529
30530         The current implementation is still broken, it just returns every
30531         assembly loaded, but until we get real applications domain this
30532         will do.
30533
30534 2002-01-23  Dietmar Maurer  <dietmar@ximian.com>
30535
30536         * icall.c (ves_icall_appdomain_get_cur_domain): runtime_init the
30537         AppDomain object.
30538
30539 2002-01-23  Miguel de Icaza  <miguel@ximian.com>
30540
30541         * icall.c (ves_icall_appdomain_get_cur_domain): Cache the value of
30542         the mono_class_from_name lookup.
30543         (ves_icall_get_parameter_info): ditto.
30544         (ves_icall_appdomain_get_assemblies, add_assembly): Implement new internal
30545         method.
30546         (ves_icall_System_Reflection_Assembly_get_code_base): Another new call.
30547
30548 Tue Jan 22 22:43:47 CET 2002 Paolo Molaro <lupus@ximian.com>
30549
30550         * class.c: load also nested classes on class init.
30551         System.ValueType instance methods gets passed boxed
30552         values, unless methods in derived classed that get a pointer to the
30553         data.
30554         * icall.c: use better name parsing code in GetType().
30555         * image.c, image.h: add mono_image_loaded ().
30556         * metadata.c, metadata.h: add mono_metadata_nesting_typedef ().
30557         * reflection.c, reflection.h: added mono_reflection_parse_type().
30558
30559 2002-01-22  Veronica De Santis <veron78@interfree.it>
30560
30561         * icall.c : Added mapping of internal calls for Manual and Auto reset events
30562         * threads.c : Added the implementation of internal calls for events
30563         * threads.h : Added prototypes of internal calls for events
30564         
30565 2002-01-21  Radek Doulik  <rodo@ximian.com>
30566
30567         * icall.c (ves_icall_InitializeArray): swap bytes on big endians
30568
30569 2002-01-21  Dietmar Maurer  <dietmar@ximian.com>
30570
30571         * class.c (mono_class_init): set min_align to 1 (instead of 0)
30572         (mono_class_value_size): use min_align
30573
30574 2002-01-20  Dick Porter  <dick@ximian.com>
30575
30576         * threads.h:
30577         * threads.c: Replaced all instances of WapiHandle * with HANDLE,
30578         so it compiles on w32.
30579
30580 2002-01-17  Dietmar Maurer  <dietmar@ximian.com>
30581
30582         * metadata.c (mono_type_stack_size): impl.
30583
30584         * class.c (mono_class_get_field): impl. memberref token
30585
30586 2002-01-16 Veronica De Santis <veron78@@interfree.it>
30587
30588         * icall.h : Added the internal calls mapping for CreateMutex_internal
30589                     and ReleaseMutex_internal.
30590         * threads.h : Added the prototype of mutexes internal calls.
30591         * threads.c : Added the implementations of mutexes internal calls.
30592
30593 Tue Jan 15 22:47:57 CET 2002 Paolo Molaro <lupus@ximian.com>
30594
30595         * metaparse.h: removed unused file.
30596         * reflection.c, reflection.h: added stream_data_align () function 
30597         to align data in streams and keep stream aligned. Add support for
30598         exception support in method headers.
30599
30600 Tue Jan 15 19:42:50 CET 2002 Paolo Molaro <lupus@ximian.com>
30601
30602         * unicode.c: make iconv_convert () return the number of bytess written
30603         in the output buffer.
30604
30605 2002-01-15  Dick Porter  <dick@ximian.com>
30606         * threads.c: Make the runtime's idea of infinite timeouts coincide
30607         with the class library's
30608
30609         Fix a particularly egregious bug in mono_thread_cleanup(). That
30610         code was so utterly bogus it must have been written on a Monday.
30611
30612 Mon Jan 14 17:01:03 CET 2002 Paolo Molaro <lupus@ximian.com>
30613
30614         * reflection.h: add subtypes field to TypeBuilder.
30615         * reflection.c: encode constants for literal fields.
30616         Handle subtypes. Fix user string token (and add a zero byte)
30617         at the end.
30618         
30619 2002-01-14  Dietmar Maurer  <dietmar@ximian.com>
30620
30621         * class.c (mono_class_init): bug fix: assign slot numbers for
30622         abstract methods.
30623
30624 Fri Jan 11 18:54:42 CET 2002 Paolo Molaro <lupus@ximian.com>
30625
30626         * reflection.c: don't try to output a code RVA for abstract methods.
30627         Small fixes for method header format. Output parameter info to the
30628         ParamDef table. Save method overriding info to MethodImpl table.
30629         Fix property support. Allow typedef.extends to be a type in the
30630         building assembly.
30631         * verify.c: fix off-by-one error.
30632
30633 Thu Jan 10 19:36:27 CET 2002 Paolo Molaro <lupus@ximian.com>
30634
30635         * class.c: fix mono_class_from_mono_type () for szarray types.
30636         Remove unused cache check in mono_class_from_type_spec().
30637         * icall.c: *type_from_name () functions handle simple arrays and byref.
30638         * reflection.c: handle byref and szarray types. Handle methods without
30639         body (gets P/Invoke compilation working). Handle types and fields in
30640         get_token ().
30641         * reflection.h: add rank to MonoTypeInfo.
30642
30643 2002-01-10  Dick Porter  <dick@ximian.com>
30644
30645         * threads.c: Implemented WaitAll(), WaitAny() and WaitOne()
30646         internal calls
30647
30648 Wed Jan 9 19:27:13 CET 2002 Paolo Molaro <lupus@ximian.com>
30649
30650         * icall.c: initialize class in type_from_handle ().
30651         Loop also in parent classes for get_method ().
30652         * reflection.c: properly encode class and valuetype types.
30653         Start on encoding TypeBuilder types. Handle fieldrefs.
30654         Use correct length when registering a user string.
30655         Handle ConstructorBuilder and MonoMethod in get_token ().
30656         Make mono_type_get_object () aware of cached types.
30657         * object.c: back out change to mono_string_new ().
30658
30659 Tue Jan 8 22:47:44 EST 2002 Matt Kimball <matt@kimball.net>
30660         * object.c: mono_string_new should return a NULL when the string 
30661         passed in is NULL -- not try to deference it.
30662         
30663 Sat Jan 5 15:48:04 CET 2002 Paolo Molaro <lupus@ximian.com>
30664
30665         * icall.c: hack to make IsSubType work for TypeBuilders.
30666         * reflection.c: emit constructors before methods.
30667         Retrieve param names in mono_param_get_objects().
30668
30669 2002/01/05  Nick Drochak  <ndrochak@gol.com>
30670
30671         * Makefile.am: fix list of headers and sources so automake 1.5
30672         doesn't complain. Removed \# at end of list.
30673
30674 Thu Jan 3 23:17:17 CET 2002 Paolo Molaro <lupus@ximian.com>
30675
30676         * reflection.c: get token for a method ref. Set return type of
30677         constructor to void.
30678         * loader.c: debug message.
30679         * class.c: typo fix.
30680
30681 Mon Dec 24 17:18:10 CET 2001 Paolo Molaro <lupus@ximian.com>
30682
30683         * icall.c: fix array init with rank > 1. FindMembers
30684         loops in parent class as well.
30685         * image.c: do not insert nested types in name cache.
30686         * reflection.c: warning fix.
30687         * reflection.h: add override method (for interface impl).
30688
30689 Mon Dec 24 16:16:56 CET 2001 Paolo Molaro <lupus@ximian.com>
30690
30691         * metadata.c: fix customattr decoding.
30692
30693 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
30694
30695         * rawbuffer.cs: Added native Win32 implementation, avoids using
30696         mmap on Cygwin.  This patch is from Dan Lewis (dihlewis@yahoo.co.uk)
30697
30698 Thu Dec 20 20:11:26 CET 2001 Paolo Molaro <lupus@ximian.com>
30699
30700         * class.c: make the low-level routines handle the cache.
30701
30702 Thu Dec 20 15:20:35 CET 2001 Paolo Molaro <lupus@ximian.com>
30703
30704         * image.c: fopen (file, "rb") ("David Dawkins" <david@dawkins.st>).
30705
30706 Tue Dec 18 18:50:00 CET 2001 Paolo Molaro <lupus@ximian.com>
30707
30708         * class.c: fix mono_array_element_size() for objects.
30709         * class.h, class.c: add properties to MonoClass and load them
30710         at init time.
30711         * icall.c: check with isinst() when assigning a value to an array
30712         instead of requiring the classes to match exactly.
30713         Implemented icall for System.Type::GetType().
30714         Implemented icalls to get ParameterInfo, ProprtyInfo and info about
30715         enums. Handle bindingflags when looking for methods and fields.
30716         * metadata.h, metadata.c: implemented mono_metadata_properties_from_typedef()
30717         and mono_metadata_methods_from_property().
30718         * reflection.h, reflection.c: added structures for propreties,
30719         parameters and enums. Implemented mono_property_get_object() and
30720         mono_param_get_objects().
30721
30722 2001-12-18  Dick Porter  <dick@ximian.com>
30723
30724         * file-io.c: Use mono_string_to_utf16() instead of
30725         mono_string_chars()
30726
30727         * object.c: Added mono_string_to_utf16(), which copies the non
30728         NULL-terminated MonoString into a new double-null-terminated
30729         buffer.
30730
30731 2001-12-17  Dietmar Maurer  <dietmar@ximian.com>
30732
30733         * icall.c (ves_icall_System_DateTime_GetNow): added EPOCH adjustment
30734
30735 2001-12-16  Dietmar Maurer  <dietmar@ximian.com>
30736
30737         * file-io.c: raise exceptions if handle is invalid.
30738
30739 Thu Dec 13 20:27:08 CET 2001 Paolo Molaro <lupus@ximian.com>
30740
30741         * assembly.c: yet another check for mscorlib.
30742         * class.c, class.h: load nesting info for classes.
30743         * icall.c: many new functions to support the Reflection classes.
30744         * metadata.c, metadata.h: mono_metadata_nested_in_typedef() added.
30745         * reflection.h, reflection.c: mono_image_create_token(),
30746         mono_assembly_get_object(), mono_type_get_object(),
30747         mono_method_get_object(), mono_field_get_object(): methods to return
30748         objects that parallel the C representation of assemblies, types,
30749         methods, fields.
30750
30751 2001-12-11  Dick Porter  <dick@ximian.com>
30752
30753         * icall.c:
30754         * file-io.c: Internal calls for file IO.
30755
30756 Thu Dec 6 16:21:30 CET 2001 Paolo Molaro <lupus@ximian.com>
30757
30758         * tabledefs.h: missing FileAttributes.
30759         * verify.h, verify.c: use is_valid_string () to simplify and check for
30760         valid strings more correctly. Fix warnings and speeling.
30761         Check more tables: Filed, File, ModuleRef, StandAloneSig.
30762         Check code: branches, maxstack, method calls.
30763
30764 2001-12-04  Dietmar Maurer  <dietmar@ximian.com>
30765
30766         * object.c (mono_object_allocate): removed static, so that the jit
30767         can allocate value types.
30768
30769         * icall.c (ves_icall_System_DateTime_GetNow): impl.
30770
30771 Mon Dec 3 17:02:01 CET 2001 Paolo Molaro <lupus@ximian.com>
30772
30773         * class.c: init enum types right away and register the
30774         token->MonoClass map in mono_class_create_from_typedef ().
30775         * verify.h, verify.c: first cut of the verifier.
30776         * pedump.c: add --verify switch to verify metadata tables.
30777         * tabledefs.h: add some missing enums.
30778
30779 2001-11-30  Dietmar Maurer  <dietmar@ximian.com>
30780
30781         * class.c (mono_install_runtime_class_init): impl.
30782         (mono_class_init): renamed mono_class_metadata_init to
30783         mono_class_init, also removed the metadata_inited flag
30784
30785         * object.c (mono_object_isinst): use faster algorithm
30786
30787 2001-11-30  Radek Doulik  <rodo@ximian.com>
30788
30789         * mono-endian.h: reverted last change
30790         added function prototypes
30791
30792         * Makefile.am (libmetadata_a_SOURCES): reverted my last change and
30793         add mono-endian.c back
30794
30795         * mono-endian.c: returned back, as Paolo pointed out, it's needed
30796         for unaligned access, I've mistaked it with endianess. I am
30797         sorry.
30798         (mono_read16): fix reverted endianess
30799         (mono_read64): ditto
30800         (mono_read32): ditto
30801
30802 2001-11-30  Dick Porter  <dick@ximian.com>
30803
30804         * exception.c: Implement mono_exception_from_name()
30805
30806 Fri Nov 30 12:01:02 CET 2001 Paolo Molaro <lupus@ximian.com>
30807
30808         * metadata.h, metadata.c: remove params_size and locals_size and their
30809         calculation from the metadata code: they are only usefult to the
30810         interp.
30811
30812 2001-11-29  Radek Doulik  <rodo@ximian.com>
30813
30814         * object.c (mono_ldstr): swap bytes here, it's probably not the
30815         best place, but works for me now, I'll redo it once I know mono
30816         better, also note that I add PROT_WRITE and don't reset back, also
30817         note that it's only affects big endians, so x86 should be OK
30818
30819         * mono-endian.h (read16): use just glib macros for both endians
30820
30821         * mono-endian.c: removed as glib macros are used in in
30822         mono-endian.h so we don't need to care about endianess for read
30823         macros as glib does that for us already
30824
30825 Thu Nov 29 18:20:58 CET 2001 Paolo Molaro <lupus@ximian.com>
30826
30827         * class.h, class.h: take minimum alignment into consideration so
30828         that the fields of a class remain aligned also when in an array.
30829
30830 Tue Nov 27 16:39:01 CET 2001 Paolo Molaro <lupus@ximian.com>
30831
30832         * loader.h, loader.c: add mono_method_get_param_names().
30833         * class.c: 0-init class fields.
30834
30835 2001-11-26  Dick Porter  <dick@ximian.com>
30836
30837         * icall.c:
30838         * threads-types.h:
30839         * threads.c: New file that handles System.Threading on all platforms
30840
30841         * object.c: 
30842         * object.h: Remove the synchronisation struct from MonoObject,
30843         replace it with a pointer that gets initialised on demand
30844
30845         * Makefile.am: Replace all the system-specific threading code with
30846         a single file that uses the new wrapper library
30847
30848 Mon Nov 19 11:37:14 CET 2001 Paolo Molaro <lupus@ximian.com>
30849
30850         * class.c, class.h: add mono_install_trampoline() so that the runtime
30851         can register a function to create a trampoline: removes the ugly
30852         requirement that a runtime needed to export arch_create_jit_trampoline.
30853         * object.h, object.c: added mono_install_handler() so that the runtime
30854         can install an handler for exceptions generated in C code (with
30855         mono_raise_exception()). Added C struct for System.Delegate.
30856         * pedump.c: removed arch_create_jit_trampoline.
30857         * reflection.c: some cleanups to allow registering user strings and
30858         later getting a token for methodrefs and fieldrefs before the assembly
30859         is built.
30860         * row-indexes.h: updates and fixes from the new ECMA specs.
30861
30862 Thu Nov 15 17:44:49 CET 2001 Paolo Molaro <lupus@ximian.com>
30863
30864         * class.h, class.c: add enum_basetype field to MonoClass.
30865         * metadata.h, metadata.c: add mono_metadata_get_constant_index()
30866         to get index in the constant table reated to a field, param or
30867         property.
30868         * reflection.h, reflection.c: handle constructors. Set public-key and
30869         version number of the built assembly to 0.
30870         * row-indexes.h: update from new ECMA spec.
30871
30872 Wed Nov 14 19:26:06 CET 2001 Paolo Molaro <lupus@ximian.com>
30873
30874         * class.h, class.c: add a max_interface_id to MonoClass.
30875         * icall.c: rename my_mono_new_object() to my_mono_new_mono_type()
30876         since it's used to do that. Added mono_type_type_from_obj().
30877         Make GetType() return NULL instead of segfaulting if the type was not
30878         found. Handle simple arrays in assQualifiedName.
30879         * object.h: add a struct to represent an Exception.
30880         * reflection.c: output call convention in method signature.
30881         Add code to support P/Invoke methods and fixed offsets for fields.
30882
30883 Mon Nov 12 12:41:32 CET 2001 Paolo Molaro <lupus@ximian.com>
30884
30885         * decimal.c, decimal.h: mono_double2decimal() get the sign bit from
30886         the value.
30887         * icall.c: use mono_array_addr instead of array->vector: fixes the
30888         reflection image writing.
30889         * reflection.c: init call convention byte to 0 in method signature.
30890         Encode the property signature. Don't output property-related methods
30891         twice. Really process the properties for a type (don't cast a field to
30892         a property, my mom always told me that).
30893         Fix 64 bit issues in pointer alignment in a different and more
30894         readable way.
30895
30896 2001-11-10  Sean MacIsaac  <macisaac@ximian.com>
30897
30898         * loader.h: Removed type class from MonoDefaults, added monotype
30899
30900         * loader.c: Loaded MonoType, removed loading of Type
30901
30902         * icall.c (my_mono_new_object): Now returns a System.MonoType,
30903         and fills in System.Type._impl with a RuntimeTypeHandle rather
30904         than the actual MonoClass *
30905
30906         (ves_icall_type_from_handle): change from type_class to
30907         monotype_class
30908
30909         (ves_icall_System_Runtime_InteropServices_Marshal_ReadIntPtr):
30910         implemented
30911
30912         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAuto):
30913         implemented
30914
30915         (ves_icall_System_Reflection_Assembly_LoadFrom): implemented
30916
30917         (ves_icall_System_Reflection_Assembly_GetType): implemented
30918
30919         (ves_icall_System_MonoType_assQualifiedName): implemented
30920
30921         (ves_icall_System_PAL_OpSys_GetCurrentDirecotry): implemented
30922
30923 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
30924
30925         * assembly.c (mono_assembly_open): Implement a cache for the
30926         assemblies. 
30927
30928         (mono_assembly_close): only destroy the assembly when the last
30929         reference is gone.
30930         
30931 2001-11-09  Dick Porter  <dick@ximian.com>
30932
30933         * Makefile.am (pedump_LDADD): Don't need THREAD_LIBS any more
30934
30935 2001-11-09  Dietmar Maurer  <dietmar@ximian.com>
30936
30937         * class.c (mono_class_metadata_init): bug fix: compute the right slot
30938
30939 Fri Nov 9 15:48:02 CET 2001 Paolo Molaro <lupus@ximian.com>
30940
30941         * icall.c, decimal.h, decimal.c: integrated decimal internalcalls
30942         from Martin Weindel.
30943         * object.h: add mono_string_chars ().
30944
30945 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
30946
30947         * reflection.c (build_compressed_metadata): Eliminates warnings
30948         and uses 64-bit clean code.
30949
30950         * metadata.c (mono_type_hash): Change signature to eliminate warnings.
30951         (mono_type_equal): Change signature to eliminate warnings.
30952
30953 Wed Nov 7 15:40:01 CET 2001 Paolo Molaro <lupus@ximian.com>
30954
30955         * icall.c, loader.c: remove the internalcall array constructors.
30956         Changes to match the new MonoArray structure.
30957         * object.h, object.c: an array object doesn't allocate an extra
30958         vector. Add mono_array_new_full () to create jagged arrays easily.
30959
30960 Mon Nov 5 19:51:06 CET 2001 Paolo Molaro <lupus@ximian.com>
30961
30962         * metadata.h, metadata.c: add mono_metadata_field_info () to
30963         retreive all the info about a field from vairous tables.
30964         * icall.c: implement S.Runtime.CServices::InitializeArray () icall.
30965         * class.h, class.c: augment MonoClassField with more info.
30966         Implemented mono_ldtoken for fields. Implemented ExplicitLayout
30967         policy and load a field's RVA if needed.
30968
30969 2001-11-05  Dietmar Maurer  <dietmar@ximian.com>
30970
30971         * class.c (mono_class_metadata_init): create a trampoline for all
30972         virtual functions instead of actually compiling them.
30973
30974 Fri Nov 2 19:37:51 CET 2001 Paolo Molaro <lupus@ximian.com>
30975
30976         * class.h, class.c: include name in MonoClassField.
30977         * class.c: fix fundamental type of System.Object and System.String.
30978         Set the right fundamental type for SZARRAY, too. Handle TypeSpec
30979         tokens in ldtoken.
30980         * icall.c: remove internalcalls for the Reflection stuff that is now
30981         done in C# code.
30982         * loader.c: mono_field_from_memberref () implementation.
30983         * mono-endian.c: thinko (s/struct/union/g).
30984         * object.c, object.h: make the mono_string_* prototypes actually use
30985         MonoString instead of MonoObject.
30986         * reflection.c, reflection.h: updates for changes in the reflection
30987         code in corlib: we use C structures that map to the actual C# classes.
30988         Handle SZARRAYs when encoding types. Handle locals in methods. Use a
30989         fat method header if needed and use the info from the ILGenerator for
30990         methods. Handle fields in types. Misc fixes.
30991
30992 2001-10-17  Dietmar Maurer  <dietmar@ximian.com>
30993
30994         * class.c (mono_class_metadata_init): bug fix: always allocate
30995         space for static class data
30996
30997 2001-10-25  Dietmar Maurer  <dietmar@ximian.com>
30998
30999         * class.c (mono_compute_relative_numbering): use relative
31000         numbering to support fast runtime type checks.
31001
31002 2001-10-17  Sean MacIsaac  <macisaac@ximian.com>
31003
31004         * class.c (mono_class_create_from_typeref): added debugging output
31005         to print class name when MonoDummy is returned instead of real class
31006
31007 2001-10-15  Dietmar Maurer  <dietmar@ximian.com>
31008
31009         * class.c (mono_class_metadata_init): interface offset table now
31010         contains pointers into the vtable - this is more efficient for the jit
31011
31012 2001-10-12  Dietmar Maurer  <dietmar@ximian.com>
31013
31014         * class.c (mono_class_metadata_init): use a temporary vtable (the
31015         old algorithm only worked for the interpreter, but not for the jit)
31016
31017 2001-10-11  Dietmar Maurer  <dietmar@ximian.com>
31018
31019         * loader.c (method_from_memberref): use mono_class_get to get the
31020         class of an array instead of using System.Array directly.
31021         (mono_get_method): also add MEMBERREF methods to the method cache
31022         which usefull for arrays.
31023
31024 2001-10-10  Dietmar Maurer  <dietmar@ximian.com>
31025
31026         * pedump.c (arch_compile_method): added to compute vtable entry
31027
31028         * metadata.c (mono_metadata_interfaces_from_typedef): also return the
31029         number of interfaces.
31030         
31031         * class.h: merged MonoArrayClass into MonoClass
31032
31033         * class.c (mono_class_create_from_typedef): compute the vtable size and
31034         allocate space to include the vtable inside MonoClass
31035         (mono_class_metadata_init): initialize the vtable
31036
31037 Mon Oct 8 16:12:38 CEST 2001 Paolo Molaro <lupus@ximian.com>
31038
31039         * metadata.c, metadata.h: use MonoArrayType to describe the shape of an array.
31040         Guard against calling bsearch with a NULL pointer (pointed out by Laurent Rioux, smoux).
31041         * image.c: endian fixes by Laurent Rioux.
31042         * object.h, object.c: rename MonoStringObject to MonoString and
31043         MonoArrayObject to MonoArray. Change some function names to conform to
31044         the style mono_<object>_<action>. mono_string_new_utf16 () takes a
31045         guint16* as first argument, so don't use char*.
31046         Provide macros to do the interesting things on arrays in a portable way.
31047         * threads-pthread.c: updates for the API changes and #include <sched.h>
31048         (required for sched_yield()).
31049         * icall.c: updates for the API changes above.
31050         * Makefile.am, mono-endian.c. mono-endian.h: include unaligned read routines for
31051         platforms that need them.
31052
31053 Mon Oct 8 10:43:23 CEST 2001 Paolo Molaro <lupus@ximian.com>
31054
31055         * class.c: set the correct type for all the fundamental
31056         type when loading the class.
31057
31058 2001-10-05  Dick Porter  <dick@ximian.com>
31059
31060         * threads-pthread.c (pthread_mutex_timedlock): Simple
31061         compatibility version for C libraries that lack this call.
31062
31063 Thu Oct 4 19:10:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
31064
31065         * class.c: MonoTypes stored in MonoClass are stored as
31066         fundamental MonoTypes when the class represents a
31067         fundamental type (System.Int32, ...).
31068         The TypeHandle return by ldtoken is a MonoType*.
31069         * icall.c: ves_icall_get_data_chunk () write out all the
31070         PE/COFF stuff. Implement ves_icall_define_method (),
31071         ves_icall_set_method_body (), ves_icall_type_from_handle ().
31072         * image.c: properly skip unknown streams.
31073         * loader.h, loader.c: add type_class to mono_defaults.
31074         * metadata.c, metadata.h: export compute_size () as
31075         mono_metadata_compute_size () with a better interface.
31076         Typo and C&P fixes.
31077         * pedump.c: don't try to print the entry point RVA if there is no entry point.
31078         * reflection.c, reflection.h: many cleanups, fixes, output method
31079         signatures and headers, typedef and typeref info, compress the metadata
31080         tables, output all the heap streams, cli header etc.
31081         * row-indexes.h: typo fixes.
31082
31083 2001-10-04  Dick Porter  <dick@ximian.com>
31084
31085         * object.h: Add a synchronisation mutex struct to MonoObject
31086
31087         * object.c (mono_new_object): Initialise the object
31088         synchronisation mutexes
31089
31090         * icall.c: System.Threading.Monitor internal calls
31091         
31092         * threads-pthread.h:
31093         * threads-pthread.c: System.Threading.Monitor internal calls
31094
31095         * threads-types.h: New file, includes the system-specific thread
31096         structures
31097         
31098         * threads-pthread-types.h:
31099         * threads-pthread-types.c: New files, handle pthread-specific
31100         synchronisation types
31101
31102         * threads-dummy-types.h: 
31103         * threads-dummy-types.c: New files of dummy support for
31104         thread-specific types
31105
31106         * metadata.c:
31107         * image.c:
31108         * pedump.c: include mono-endian.h not endian.h
31109         
31110         * Makefile.am: More threads files.
31111         Name mono-endian.h not endian.h
31112
31113 Tue Oct 2 20:33:48 CEST 2001 Paolo Molaro <lupus@ximian.com>
31114
31115         * Makefile.am, reflection.h, reflection.c: move here the reflection related 
31116         stuff and implement a few more bits.
31117         * icall.c: a field needs to be dereferenced twice. Do not use the same
31118         name for two variables in the same scope.
31119         * image.c, image.h: cleanups.
31120
31121 2001-10-02  Dietmar Maurer  <dietmar@ximian.com>
31122
31123         * class.c (mono_class_metadata_init): bug fix: compute the right size
31124
31125 Mon Oct 1 20:43:57 CEST 2001 Paolo Molaro <lupus@ximian.com>
31126
31127         * icall.c: implemented some of the Reflection internalcalls.
31128         * image.c, image.h: start writing out the PE/COFF image.
31129         * metadata.h, metadata.c: implement mono_metadata_encode_value ()
31130         that does the reverse than decode_blob_size ().
31131         * object.c: use mono_metadata_encode_value (). Move here
31132         temporary implementation of mono_string_to_utf8 ().
31133         * rawbuffer.c: make malloc_map static.
31134
31135 Fri Sep 28 19:26:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
31136
31137         * metadata.c: fix type comparison for arrays.
31138         * loader.h, loader.c: half-assed fix to get more tests work in cygwin.
31139         Added a couple of new classes to monodefaults.
31140         * icall.c: added a couple of Reflection-related internalcalls.
31141         * class.h, class.c: implemented mono_ldtoken () for RuntimeTypeHandles.
31142         Added a byval_arg MonoType to MonoClass.
31143
31144 2001-09-28  Dick Porter  <dick@ximian.com>
31145
31146         * icall.c:
31147         * threads-pthread.h: 
31148         * threads-pthread.c: Implemented internal calls for
31149         LocalDataStoreSlot operations.  Applied mutexes around all shared
31150         data.  Reworked the thread creation and Start() operations to
31151         avoid a race condition.
31152         
31153         * threads-dummy.h:
31154         * threads-dummy.c: Dummy calls for the LocalDataStoreSlot operations
31155
31156 Thu Sep 27 21:45:55 CEST 2001 Paolo Molaro <lupus@ximian.com>
31157
31158         * rawbuffer.c: disable mmap on cygwin since it seems to be broken there.
31159
31160 Thu Sep 27 19:52:11 CEST 2001 Paolo Molaro <lupus@ximian.com>
31161
31162         * class.c, loader.c: warn and return NULL instead of erroring out.
31163         * icall.c: added System.AppDomain::getCurDomain().
31164         * loader.c: we don't need to lookup the typedef again for p/invoke calls.
31165
31166 2001-09-25  Dick Porter  <dick@ximian.com>
31167
31168         * threads-pthread.h:
31169         * threads-pthread.c: Implemented timed thread joining and added
31170         System.Threading.Thread::Join_internal internal call
31171
31172         * icall.c: Added System.Threading.Thread::Join_internal internal call
31173
31174         * threads-dummy.h:
31175         * threads-dummy.c: Dummy calls for System.Thread.Thread::Join_internal
31176
31177 Mon Sep 24 18:56:59 CEST 2001 Paolo Molaro <lupus@ximian.com>
31178
31179         * object.c, object.h: added mono_ldstr (), mono_string_is_interned () and
31180         mono_string_intern () to implement the semantics of the ldstr opcode
31181         and the interning of System.Strings.
31182         * icall.c: provide hooks to make String::IsIntern and String::Intern
31183         internalcalls.
31184
31185 2001-09-23  Dick Porter  <dick@ximian.com>
31186
31187         * threads-dummy.c: 
31188         * threads-dummy.h: New files of dummy threading routines
31189
31190         * Makefile.am (THREAD_SOURCE): Arrange to compile different thread
31191         support code based on system specifics
31192
31193         Rename PTHREAD_LIBS to THREAD_LIBS
31194         
31195 2001-09-23  Dick Porter  <dick@ximian.com>
31196
31197         * threads-pthread.c: Implement the System.Threading.Thread::Sleep,
31198         Schedule (called when asked to Sleep for 0 ms) and CurrentThread
31199         internal calls.
31200         (mono_thread_init): Set up a Thread object instance to return when
31201         the main thread calls Thread.CurrentThread
31202         (mono_thread_cleanup): Wait for all subthreads to exit
31203
31204         * icall.c: New internal calls for System.Threading.Thread::Sleep
31205         (including Schedule) and CurrentThread
31206
31207         * threads.h: New file, to insulate thread-specific stuff from the
31208         rest of the code
31209
31210 2001-09-21  Dick Porter  <dick@ximian.com>
31211
31212         * threads-pthread.h: 
31213         * threads-pthread.c: New file, for handling pthreads-style
31214         threading support.  Start() now starts a new thread and executes
31215         the ThreadStart delegate instance.
31216
31217         * icall.c: Added the internalcall for
31218         System.Threading.Thread::Start_internal
31219
31220         * Makefile.am: Added new files, and PTHREADS_LIBS to the link line
31221
31222 Thu Sep 20 19:37:39 CEST 2001 Paolo Molaro <lupus@ximian.com>
31223
31224         * loader.c: work around the different signatures for delegates
31225         constructors csc generates in compiled code vs the ones compiled in mscorlib.
31226
31227 Tue Sep 18 13:16:32 CEST 2001 Paolo Molaro <lupus@ximian.com>
31228
31229         * class.h, class.c: add mono_class_get_field_from_name ().
31230         * *: Fix C comments and other ANSI C issues.
31231
31232 Mon Sep 10 20:21:34 CEST 2001 Paolo Molaro <lupus@ximian.com>
31233
31234         * endian.h, assembly.c: fix some endianness issues.
31235
31236 Fri Sep 7 18:40:40 CEST 2001 Paolo Molaro <lupus@ximian.com>
31237
31238         * loader.h, load.c: add delegate_class to mono_defaults.
31239         Handle runtime provided methods in mono_get_method ().
31240
31241 2001-08-29  Dietmar Maurer  <dietmar@ximian.com>
31242
31243         * loader.c (mono_get_method): use pinvoke for internal call
31244
31245         * icall.c: use pinvoke for internal call
31246
31247         * loader.c (method_from_memberref): set the method name
31248
31249 Wed Aug 29 12:43:41 CEST 2001 Paolo Molaro <lupus@ximian.com>
31250
31251         * metadata.c: help the compiler generate better code for
31252         mono_class_from_mono_type ().
31253
31254 2001-08-28  Dietmar Maurer  <dietmar@ximian.com>
31255
31256         * class.c (mono_class_metadata_init): delayed computing of the
31257         class size to mono_class_metadata_init ()
31258
31259 Tue Aug 28 15:47:15 CEST 2001 Paolo Molaro <lupus@ximian.com>
31260
31261         * class.c, class.h: add an interfaces member to MonoClass.
31262         * image.c, image.h: add assembly_name field to MonoImage
31263         from the assembly table.
31264         * metadata.c, metadata.h: add mono_metadata_interfaces_from_typedef ().
31265
31266 Mon Aug 27 20:12:01 CEST 2001 Paolo Molaro <lupus@ximian.com>
31267
31268         * class.c: Handle Array in mono_class_from_mono_type ().
31269         * metadata.c, pedump.c: some endian fixes.
31270
31271 Mon Aug 27 15:23:23 CEST 2001 Paolo Molaro <lupus@ximian.com>
31272
31273         * class.c, loader.c, loader.h: More types handled in mono_class_from_mono_type ().
31274         * metadata.c: fix small problem introduced with the latest commit.
31275
31276 Mon Aug 27 12:17:17 CEST 2001 Paolo Molaro <lupus@ximian.com>
31277
31278         * loader.c, metadata.c, metadata.h: Export mono_metadata_type_equal().
31279         We don't need a MonoMetadata pointer anymore to compare signatures in
31280         mono_metadata_signature_equal (), update callers.
31281         Reduced memory usage an number of allocations for MonoMethodHeader and
31282         MonoMethodSignature.
31283
31284 Sun Aug 26 23:03:09 CEST 2001 Paolo Molaro <lupus@ximian.com>
31285
31286         * metadata.c: added compare for szarray.
31287
31288 Sun Aug 26 11:34:24 CEST 2001 Paolo Molaro <lupus@ximian.com>
31289
31290         * class.h, class.c, loader.h, loader.c: export mono_class_from_mono_type ()
31291         and add a couple more types to it and mono_defaults. Give an hint on
31292         classes that need implementing in our corlib and are referenced
31293         in mscorlib.
31294
31295 Sat Aug 25 12:52:54 CEST 2001 Paolo Molaro <lupus@ximian.com>
31296
31297         * class.h, class.c: keep track if a class is also an Enum.
31298         * loader.c: Implement a couple more types for use in libffi
31299         marshalling. Gives better diagnostics when failing to dlopen
31300         a library. Set method->klass for P/Invoke methods, too.
31301
31302 Fri Aug 24 19:30:25 CEST 2001 Paolo Molaro <lupus@ximian.com>
31303
31304         * class.c, class.h: add a MonoType this_arg to MonoClass that
31305         represents a pointer to an object of the class' type that
31306         can be used by the interpreter and later the type cache.
31307         Add best guess alignment info for valuetype objects.
31308
31309 Fri Aug 24 15:50:31 CEST 2001 Paolo Molaro <lupus@ximian.com>
31310
31311         * metadata.h, metadata.c, class.h, class.c: squeezed MonoParam
31312         into MonoType: one less level of indirection and allocation and
31313         simplifies quite a bit of code. Added cache for MonoTypes that are
31314         used frequently, so that we don't need to allocate them all the time.
31315
31316 2001-08-24  Dietmar Maurer  <dietmar@ximian.com>
31317
31318         * class.c (mono_class_create_from_typedef): System.Enum is also a
31319         value type, although it does not derive from System.ValueType
31320         (maybe a bug in the ms compiler?)
31321
31322         * metadata.c (mono_type_size): return the right size for value types
31323
31324         * loader.c (mono_get_method): only initialize method header if not abstract
31325
31326         * class.c (mono_class_from_mono_type): use mono_default values. 
31327
31328 2001-08-23  Dietmar Maurer  <dietmar@ximian.com>
31329
31330         * *: use MonoClass pointers instead of <type_tokens>
31331         
31332         * class.h: new flag: metadata_inited.
31333
31334         * class.c (mono_class_metadata_init): impl.
31335         (mono_class_instance_size): impl.
31336         (mono_class_data_size): impl.
31337
31338 Wed Aug 22 16:27:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
31339
31340         * metadata.c, loader.h, loader.c, image.h, image.c, class.h, class.c:
31341         MonoClass now has the name and name_space fields. 
31342         MonoMethod has a pointer to its MonoClass, instead of MonoImage.
31343         mono_get_method () takes and optional MonoClass as argument.
31344         Removed mono_typedef_from_name() and added mono_class_token_from_name()
31345         instead that takes advantage of a map from class names to typedef
31346         tokens in MonoImage.
31347
31348 Tue Aug 21 18:54:58 CEST 2001 Paolo Molaro <lupus@ximian.com>
31349
31350         * metadata.c: zero is not a valid alignment boundary.
31351         Merge MONO_TYPE_VOID in default decoding code.
31352
31353 2001-08-21  Dietmar Maurer  <dietmar@ximian.com>
31354
31355         * image.h: merged MonoMetadata into MonoImage
31356
31357         * class.h: cleanup of MonoArrayClass, use a MonoClass pointer to
31358         identify the type of elements.
31359
31360 Mon Aug 20 19:39:00 CEST 2001 Paolo Molaro <lupus@ximian.com>
31361
31362         * blob.h: fix MONO_TYPE_TYPEDBYREF value.
31363         * cil-coff.h: split MonoMSDOSHeader and add size info.
31364         * image.c: add some consistency checks.
31365         * metadata.c: fix row size computation: one programmer
31366         error and one LAMESPEC. Handle MONO_TYPE_TYPEDBYREF.
31367         add explanation for the locator routine.
31368         Fix decoding of size in method header.
31369         
31370 2001-08-20  Miguel de Icaza  <miguel@ximian.com>
31371
31372         * assembly.c    (g_concat_dir_and_file): Use _S for string concat.
31373         (g_concat_dir_and_file): Bring g_concat_dir_and_file
31374         function from gnome-libs.  This uses the right path separator
31375         based on the OS, and also works around a bug in some systems where
31376         a double slash is not allowed. 
31377         (default_assembly_name_resolver): Use g_concat_dir_and_file
31378         (mono_assembly_open): ditto.
31379
31380 2001-08-20  Dietmar Maurer  <dietmar@ximian.com>
31381
31382         * metadata.c (mono_metadata_signature_equal): impl.
31383
31384         * *: void is now a realy MonoType (instead of using NULL)
31385         
31386         * metadata.c (do_mono_metadata_parse_type): use
31387         mono_metadata_parse_type to parse void value.
31388
31389 Sat Aug 18 12:51:28 CEST 2001 Paolo Molaro <lupus@ximian.com>
31390
31391         * metadata.c, metadata.h: in the signature and method header store
31392         only the space required for holding the loca vars and incoming arguments.
31393
31394 2001-08-15  Dietmar Maurer  <dietmar@ximian.com>
31395
31396         * metadata.c (do_mono_metadata_parse_type): treat void like any
31397         other type (instead of assigning NULL);
31398
31399 2001-08-14  Dietmar Maurer  <dietmar@ximian.com>
31400
31401         * metadata.c (mono_metadata_parse_mh): fixxed pinned/byref value
31402
31403 2001-08-09  Dietmar Maurer  <dietmar@ximian.com>
31404
31405         * image.c (do_mono_image_open): added a cache for arrays.
31406
31407 Sat Aug 4 12:46:02 CEST 2001 Paolo Molaro <lupus@ximian.com>
31408
31409         * metadata.h, metadata.c: add mono_metadata_decode_row_col () to
31410         decode a single column from a row in a metadata table and changes
31411         to take advantage of it in the typedef locator (gives a nice speed up).
31412         Store offset info for function params.
31413
31414 2001-08-02  Dietmar Maurer  <dietmar@ximian.com>
31415
31416         * image.h (MONO_IMAGE_IS_CORLIB): removed 
31417
31418 Wed Aug 1 22:54:08 CEST 2001 Paolo Molaro <lupus@ximian.com>
31419
31420         * assembly.c: how could mono_assembly_close () had ever worked?
31421         * metadata.c, metadata.h: provide offset info for local vars.
31422         Implement mono_type_size () to take care of alignment as well
31423         as size (it was mono_field_type_size in cli/class.c before).
31424
31425 2001-08-01  Dietmar Maurer  <dietmar@ximian.com>
31426
31427         * image.h (MONO_IMAGE_IS_CORLIB): new macro to check root image
31428
31429         * assembly.h (CORLIB_NAME): set to corlib.dll
31430
31431         * assembly.c (mono_assembly_open): replaced strcmp() with !strcmp()
31432
31433 Tue Jul 31 17:54:02 CEST 2001 Paolo Molaro <lupus@ximian.com>
31434
31435         * metadata.h, metadata.c, Makefile.am, private.h, assembly.c, blob.h,
31436         cil-coff.h, image.c, image.h, pedump.c, rawbuffer.c, rawbuffer.h, row-indexes.h,
31437         tokentype.h: massive namespace cleanup.
31438
31439 Mon Jul 30 20:11:01 CEST 2001 Paolo Molaro <lupus@ximian.com>
31440
31441         * metadata.h, metadata.c: decode exception clauses when parsing method header.
31442
31443 2001-07-27  Dietmar Maurer  <dietmar@ximian.com>
31444
31445         * metadata.c (mono_metadata_free_type): added check for type !=
31446         NULL (void) before calling mono_metadata_free_type()
31447
31448 Thu Jul 26 19:11:19 CEST 2001 Paolo Molaro <lupus@ximian.com>
31449
31450         * metadata.h, row_indexes.h: added header with enumerations to use
31451         to index in the columns from tables in metadata and to decode coded
31452         tokens: we should start using this instead of embedding magic numbers
31453         all over the code.
31454
31455 Thu Jul 26 13:03:27 CEST 2001 Paolo Molaro <lupus@ximian.com>
31456
31457         * assembly.c, cil-coff.h, image.c, image.h, pedump.c, typedef.c:
31458         Move metadata_t info from cli_image_info_t to MonoImage, where
31459         it's easily accessible. Changed all the uses accordingly.
31460         Added the method and class caches to MonoImage.
31461         * metadata.c, metadata.h: Changed mono_metadata_decode_blob_size ()
31462         and mono_metadata_decode_value () signature to be more consistent
31463         with the other parse functions (and simplify code). Taken advantage
31464         of zero-length array allocation with GCC. Removed reduntant (and
31465         wrong) MonoFieldType struct and use MonoParam instead. Changed
31466         mono_metadata_parse_field_type () to use common code for parsing.
31467         Added mono_metadata_typedef_from_field () and
31468         mono_metadata_typedef_from_method () to lookup a typedef index from a
31469         field or method token.
31470         Pack the MonoRetType structure more tightly (fits in 8 bytes now).
31471
31472 2001-07-23  Miguel de Icaza  <miguel@ximian.com>
31473
31474         * metadata.c (mono_metadata_parse_field_type): Implement. 
31475         (do_mono_metadata_parse_type): Split engine from
31476         mono_metadata_parse_type, so that we can create smaller structures
31477         for things that just have one pointer to the MonoType (look at
31478         the MonoFieldType)
31479
31480 2001-07-20  Miguel de Icaza  <miguel@ximian.com>
31481
31482         * metadata.c (mono_metadata_parse_mh): Correct the implementation,
31483         as Jan Gray found out, it is incorrect. 
31484
31485 2001-07-18  Miguel de Icaza  <miguel@ximian.com>
31486
31487         * assembly.c: Implement asssembly loading.  This loads an image
31488         and loads all the referenced assemblies.  Come to think of it, we
31489         could always do lazy loading of the assemblies. 
31490
31491         * image.c (mono_image_open): Keep loaded images in a hashtable.
31492
31493         * image.h (MonoImage): Add reference count.
31494
31495 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
31496
31497         * assembly.c (mono_assembly_open): Keep track of the file name in
31498         case the assembly has no ASSEMBLY table.
31499
31500         * metadata.h: Fixed Paolo's quick hack.  Put the documnentation
31501         from get.c here.
31502
31503 Sun Jul 15 19:39:06 CEST 2001 Paolo Molaro <lupus@ximian.com>
31504
31505         * metadata.c, metadata.h: decode local vars in method header
31506         parse function. Change callers accordingly.
31507
31508 Sun Jul 15 17:40:47 CEST 2001 Paolo Molaro <lupus@ximian.com>
31509
31510         * metadata.h, cil-coff.h: protect against multiple inclusion.
31511         Added some new structures to hold information decoded from metadata:
31512         MonoType, MonoParam, MonoArray, MonoMethod, MonoMethodSignature
31513         and relevant decoding/free functions.
31514         * metadata.c: implement decoding functions. Add warning for out of bounds
31515         index in mono_metadata_locate(). Implement mono_get_method () to retreive
31516         all the info about a method signature and invocation. Remove check on
31517         uninitialized local var in parse_mh() and fix memory leak.
31518
31519 2001-07-12  Miguel de Icaza  <miguel@ximian.com>
31520
31521         * metadata.h: More macros.
31522
31523         * tokentype.h: New file.
31524
31525 Fri Jul  6 11:30:53 CEST 2001 Paolo Molaro <lupus@ximian.com>
31526
31527         * assembly.c: added a consistency check and initialize
31528         some structures with g_new0().
31529         * metadata.c: fixed a couple more bugs in table size computation
31530         and add other checks for out-of bound access to metadata.
31531
31532 Thu Jul  5 22:34:21 CEST 2001 Paolo Molaro <lupus@ximian.com>
31533
31534         * metatada.c: fix bugs computing table sizes. Spew a
31535         warning when index in string heap is out of bounds.
31536
31537 2001-07-04  Miguel de Icaza  <miguel@ximian.com>
31538
31539         * metadata.h: Add a couple of macros to manipulate tokens. 
31540
31541 Tue Jul  3 18:33:32 CEST 2001 Paolo Molaro <lupus@ximian.com>
31542
31543         * assembly.c: g_free(ii->cli_sections) (and avoid double free of
31544         cli_section_tables).
31545
31546 2001-07-01  Miguel de Icaza  <miguel@ximian.com>
31547
31548         * metadata.c (mono_metadata_user_string): New function, provides
31549         access to the UserString heap. 
31550
31551 2001-06-27  Miguel de Icaza  <miguel@ximian.com>
31552
31553         * metadata.c: Add inline documentation.
31554
31555 2001-06-26  Miguel de Icaza  <miguel@ximian.com>
31556
31557         * propertyattr.h, paramattr.h, methodsem.h, methodattr.h: New
31558         files. 
31559
31560 2001-06-22  Miguel de Icaza  <miguel@ximian.com>
31561
31562         * typeattr.h: New file, TypeAttribute flags. 
31563
31564 2001-06-21  Miguel de Icaza  <miguel@ximian.com>
31565
31566         * mono/metadata/assembly.c (mono_assembly_ensure_section_idx,
31567         mono_assembly_ensure_section): Section loading code.
31568         (load_section_tables): Load the sections.
31569
31570         * mono/metadata/metadata.c (mono_metadata_locate_token,
31571         mono_metadata_locate): Functions to locate the information
31572         definition given a token or a table and an index.
31573         (mono_metadata_compute_table_bases): New.
31574         (compute_size): New function to compute the sizes of the various
31575         tables.
31576
31577         * mono/metadata/metadata.h: Finish listing the different index
31578         types. 
31579
31580         * mono/metadata/pedump.c: Improve to dump new information.
31581
31582 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
31583
31584         * mono/metadata/metadata.c: Entered all the tables matching
31585         Beta2. 
31586
31587         * mono/metadata/assembly.c (load_metadata_ptrs): Fix for Beta2
31588
31589
31590
31591