Fixed an ANSI to managed string conversion bug on native to managed callback functions.
Make sure a proper 'Not Implemented' exception is thrown instead of an 'Out of Range' exception.
Bug Fix: OpenSubKey will open key as writable when RegistryKeyPermissionCheck is set to ReadWriteSubTree
Allow trailing commas on Json objects
XmlSerializer: Add support to serialize nullable types when the XmlElement has explicity set the DataType

The existing code had a special code path for handling nullables that
ignored the DataType component.

This patch splits the nullable test away, allows the specified XmlDataType
to be probed and then performs the standard type lookup mechanism.

This allows this:

        [XmlElement ("MyNullableTime", DataType="time", IsNullable=true)]
        DateTime? myTime;

To be serialized as a "time" instead of a "datetime".

Fixes bug #329
Merge commit a04edc9d from mono/master

Clone input collection for ObservableCollection<T>. Fixes #2169

The commit has been modified from a04edc9d to remove the added unit
tests, as these cause merge conflicts with the mono-2-10 branch (as
the mcs/class/System/Test/... tests don't exist in mono-2-10).
Checking if a type is a reference must be gsharing aware.

	*  mini-generic-sharing.c: Add mini_type_is_reference
	that returns true for VAR and MVAR if compiling under
	gsharing.

	* method-to-ir.c: Replace usage of mono_type_is_reference
	with mini_type_is_reference.

	* mini-gc.c: Ditto.

	* mini.c: Ditto.

	With the old behavior, the JIT could interpret a (M)VAR
	variable and not been a reference type. This is an issue
	for sgen as we could forgot to emit some write barriers
	or generate the proper stack map.
backport CryptoConfig changes/fixes from master
[System.ServiceModel.Web] Support `null` as value for `DateTime?` field.

Fixes assistly #5863.
[System.ServiceModel.Web] Fix JSON array deserialization for NET_2_1

Fixes DataContractJsonSerializerTest.DeserializeArray() in the NET_2_1
profile, which is also the MonoTouch and Mono for Android base.

The problem is JsonSerializationReader.DeserializeGenericCollection:

	Type listType = collectionType.IsArray ? typeof (List<>).MakeGenericType (elementType) : null;
	var c = (IEnumerable) TypeMap.CreateInstance (listType ??  collectionType);
	// `c` is a List<T>
	...
	ret = collectionType.IsArray ? ((ArrayList) c).ToArray (elementType) : c;
	// yet we cast `c` to an ArrayList?!

This dies with an InvalidCastException on Mono for Android/MonoTouch,
as List<elementType> is not an ArrayList. The solution is to further
separate out the code paths, ensuring that NET_2_1 avoides the cast.
Properly initialize a rgctx template. Fixes bxc #1147.

	* mini-generic-sharing.c (mono_class_get_runtime_generic_context_template):
	When initializing a new rgctx template, we fill it with its parent
	slots.

	When the parent is a non generic class extending a generic class,
	has multiple templates and, finally, the first template has more
	slots that the rest, we would fill more entries than we should
	and later cause an assertion when trying to use those extra slots.

	To fix that we handle it just like a generic parent class and
	count the number of slots each template has.

Fixes bxc #1147.
Add regression test for bxc #1147.
Avoid doing IL lookup in the native crash handler.
Fix stack alignment calculation in mono_arch_setup_async_callback () on amd64.
Call mono_create_jit_trampoline_in_domain () in mono_resolve_patch_target () so shared methods don't end up calling trampolines in another domain.
Allow enum->basetype argument conversion in CreateDelegate(). Fixes #794.
Add memory barriers to interlocked operations on ARM, since the runtime code depends on it.
Don't send the buffered request until GetResponse is called

	Allows changing some header values after writing the request until the
	call to (Begin)GetResponse()
Fix an IndexOutOfBounds exception in the sdb packet writer.
Fix the iteraction between bridge and major  evacuation on a minor overflow major collection.

	* sgen-gc.c: The bridge code is split into 3 steps, one done when we collect finalizable objects,
	one done before we restart the world and the last right after.

	The first step can be executed twice if an overflow major collection happens. We handled this
	situation by avoiding duplicates in the registration code.

	This works fine except if a registered bridge object is moved by the second collection, which can
	happen when defragmentation kicks in.

	Instead of fixing those pointers, which is quite tricky, we move hash building to happen in the second
	step and discard all elements on the registered bridge array before each collection.  Since all bridges
	collected by the first collection will be collected again on the second, we can do it.