Merge pull request #1691 from esdrubal/exitevent
authorMarcos Henrich <marcoshenrich@gmail.com>
Mon, 20 Apr 2015 14:04:32 +0000 (15:04 +0100)
committerMarcos Henrich <marcoshenrich@gmail.com>
Mon, 20 Apr 2015 14:04:32 +0000 (15:04 +0100)
Improved Process.Exited

632 files changed:
.gitignore
AUTHORS [deleted file]
Makefile.am
README.md
README.vsnet [deleted file]
build-mingw32.sh [deleted file]
configure.ac
data/gdb/mono-gdb.py
docs/Makefile.am
docs/assembly-bundle [deleted file]
docs/exceptions
docs/local-regalloc.txt [deleted file]
docs/mono_handle_d [deleted file]
docs/new-regalloc [deleted file]
docs/opcode-decomp.txt [deleted file]
docs/reactive-extension-bundle.txt [deleted file]
docs/release-notes-1.0.html [deleted file]
docs/stack-alignment [deleted file]
docs/tree-mover.txt [deleted file]
external/binary-reference-assemblies
external/ikvm
external/referencesource
man/certmgr.1
man/mcs.1
man/mono.1
mcs/Makefile
mcs/build/Makefile
mcs/build/common/SR.cs
mcs/build/profiles/binary_reference_assemblies.make [new file with mode: 0644]
mcs/build/profiles/net_4_0.make [deleted file]
mcs/class/Facades/System.Runtime.InteropServices/TypeForwarders.cs
mcs/class/Makefile
mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Vbc.cs
mcs/class/Mono.Parallel/Mono.Collections.Concurrent/ConcurrentOrderedList.cs [new file with mode: 0644]
mcs/class/Mono.Parallel/Mono.Parallel.dll.sources
mcs/class/Mono.Security/Mono.Security.Cryptography/ARC4Managed.cs
mcs/class/SMDiagnostics/Assembly/AssemblyInfo.cs [new file with mode: 0644]
mcs/class/SMDiagnostics/Makefile [new file with mode: 0644]
mcs/class/SMDiagnostics/ReferenceSources/TraceSR.cs [new file with mode: 0644]
mcs/class/SMDiagnostics/SMDiagnostics.dll.sources [new file with mode: 0644]
mcs/class/System.Data/.gitignore
mcs/class/System.Data/Assembly/AssemblyInfo.cs
mcs/class/System.Data/mobile_referencesource.sources
mcs/class/System.ServiceModel.Internals/Assembly/AssemblyInfo.cs [new file with mode: 0644]
mcs/class/System.ServiceModel.Internals/EventLogEntryType.cs [new file with mode: 0644]
mcs/class/System.ServiceModel.Internals/InternalSR.cs [new file with mode: 0644]
mcs/class/System.ServiceModel.Internals/Makefile [new file with mode: 0644]
mcs/class/System.ServiceModel.Internals/System.ServiceModel.Internals.dll.sources [new file with mode: 0644]
mcs/class/System.Transactions/Assembly/AssemblyInfo.cs
mcs/class/System.Web.Extensions/System.Web.Script.Serialization/JsonDeserializer.cs
mcs/class/System.Web.Extensions/Test/System.Web.Script.Serialization/JavaScriptSerializerTest.cs
mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializerTests.cs
mcs/class/System/Microsoft.CSharp/CSharpCodeGenerator.cs
mcs/class/System/ReferenceSources/MonoSocketRuntimeWorkItem.cs
mcs/class/System/ReferenceSources/SR.cs
mcs/class/System/ReferenceSources/Socket.cs
mcs/class/System/System.CodeDom/CodeArgumentReferenceExpression.cs [deleted file]
mcs/class/System/System.CodeDom/CodeArrayCreateExpression.cs [deleted file]
mcs/class/System/System.CodeDom/CodeArrayIndexerExpression.cs [deleted file]
mcs/class/System/System.CodeDom/CodeAssignStatement.cs [deleted file]
mcs/class/System/System.CodeDom/CodeAttachEventStatement.cs [deleted file]
mcs/class/System/System.CodeDom/CodeAttributeArgument.cs [deleted file]
mcs/class/System/System.CodeDom/CodeAttributeArgumentCollection.cs [deleted file]
mcs/class/System/System.CodeDom/CodeAttributeDeclaration.cs [deleted file]
mcs/class/System/System.CodeDom/CodeAttributeDeclarationCollection.cs [deleted file]
mcs/class/System/System.CodeDom/CodeBaseReferenceExpression.cs [deleted file]
mcs/class/System/System.CodeDom/CodeBinaryOperatorExpression.cs [deleted file]
mcs/class/System/System.CodeDom/CodeBinaryOperatorType.cs [deleted file]
mcs/class/System/System.CodeDom/CodeCastExpression.cs [deleted file]
mcs/class/System/System.CodeDom/CodeCatchClause.cs [deleted file]
mcs/class/System/System.CodeDom/CodeCatchClauseCollection.cs [deleted file]
mcs/class/System/System.CodeDom/CodeChecksumPragma.cs [deleted file]
mcs/class/System/System.CodeDom/CodeComment.cs [deleted file]
mcs/class/System/System.CodeDom/CodeCommentStatement.cs [deleted file]
mcs/class/System/System.CodeDom/CodeCommentStatementCollection.cs [deleted file]
mcs/class/System/System.CodeDom/CodeCompileUnit.cs [deleted file]
mcs/class/System/System.CodeDom/CodeConditionStatement.cs [deleted file]
mcs/class/System/System.CodeDom/CodeConstructor.cs [deleted file]
mcs/class/System/System.CodeDom/CodeDefaultValueExpression.cs [deleted file]
mcs/class/System/System.CodeDom/CodeDelegateCreateExpression.cs [deleted file]
mcs/class/System/System.CodeDom/CodeDelegateInvokeExpression.cs [deleted file]
mcs/class/System/System.CodeDom/CodeDirectionExpression.cs [deleted file]
mcs/class/System/System.CodeDom/CodeDirective.cs [deleted file]
mcs/class/System/System.CodeDom/CodeDirectiveCollection.cs [deleted file]
mcs/class/System/System.CodeDom/CodeEntryPointMethod.cs [deleted file]
mcs/class/System/System.CodeDom/CodeEventReferenceExpression.cs [deleted file]
mcs/class/System/System.CodeDom/CodeExpression.cs [deleted file]
mcs/class/System/System.CodeDom/CodeExpressionCollection.cs [deleted file]
mcs/class/System/System.CodeDom/CodeExpressionStatement.cs [deleted file]
mcs/class/System/System.CodeDom/CodeFieldReferenceExpression.cs [deleted file]
mcs/class/System/System.CodeDom/CodeGotoStatement.cs [deleted file]
mcs/class/System/System.CodeDom/CodeIndexerExpression.cs [deleted file]
mcs/class/System/System.CodeDom/CodeIterationStatement.cs [deleted file]
mcs/class/System/System.CodeDom/CodeLabeledStatement.cs [deleted file]
mcs/class/System/System.CodeDom/CodeLinePragma.cs [deleted file]
mcs/class/System/System.CodeDom/CodeMemberEvent.cs [deleted file]
mcs/class/System/System.CodeDom/CodeMemberField.cs [deleted file]
mcs/class/System/System.CodeDom/CodeMemberMethod.cs [deleted file]
mcs/class/System/System.CodeDom/CodeMemberProperty.cs [deleted file]
mcs/class/System/System.CodeDom/CodeMethodInvokeExpression.cs [deleted file]
mcs/class/System/System.CodeDom/CodeMethodReferenceExpression.cs [deleted file]
mcs/class/System/System.CodeDom/CodeMethodReturnStatement.cs [deleted file]
mcs/class/System/System.CodeDom/CodeNamespace.cs [deleted file]
mcs/class/System/System.CodeDom/CodeNamespaceCollection.cs [deleted file]
mcs/class/System/System.CodeDom/CodeNamespaceImport.cs [deleted file]
mcs/class/System/System.CodeDom/CodeNamespaceImportCollection.cs [deleted file]
mcs/class/System/System.CodeDom/CodeObject.cs [deleted file]
mcs/class/System/System.CodeDom/CodeObjectCreateExpression.cs [deleted file]
mcs/class/System/System.CodeDom/CodeParameterDeclarationExpression.cs [deleted file]
mcs/class/System/System.CodeDom/CodeParameterDeclarationExpressionCollection.cs [deleted file]
mcs/class/System/System.CodeDom/CodePrimitiveExpression.cs [deleted file]
mcs/class/System/System.CodeDom/CodePropertyReferenceExpression.cs [deleted file]
mcs/class/System/System.CodeDom/CodePropertySetValueReferenceExpression.cs [deleted file]
mcs/class/System/System.CodeDom/CodeRegionDirective.cs [deleted file]
mcs/class/System/System.CodeDom/CodeRegionMode.cs [deleted file]
mcs/class/System/System.CodeDom/CodeRemoveEventStatement.cs [deleted file]
mcs/class/System/System.CodeDom/CodeSnippetCompileUnit.cs [deleted file]
mcs/class/System/System.CodeDom/CodeSnippetExpression.cs [deleted file]
mcs/class/System/System.CodeDom/CodeSnippetStatement.cs [deleted file]
mcs/class/System/System.CodeDom/CodeSnippetTypeMember.cs [deleted file]
mcs/class/System/System.CodeDom/CodeStatement.cs [deleted file]
mcs/class/System/System.CodeDom/CodeStatementCollection.cs [deleted file]
mcs/class/System/System.CodeDom/CodeThisReferenceExpression.cs [deleted file]
mcs/class/System/System.CodeDom/CodeThrowExceptionStatement.cs [deleted file]
mcs/class/System/System.CodeDom/CodeTryCatchFinallyStatement.cs [deleted file]
mcs/class/System/System.CodeDom/CodeTypeConstructor.cs [deleted file]
mcs/class/System/System.CodeDom/CodeTypeDeclaration.cs [deleted file]
mcs/class/System/System.CodeDom/CodeTypeDeclarationCollection.cs [deleted file]
mcs/class/System/System.CodeDom/CodeTypeDelegate.cs [deleted file]
mcs/class/System/System.CodeDom/CodeTypeMember.cs [deleted file]
mcs/class/System/System.CodeDom/CodeTypeMemberCollection.cs [deleted file]
mcs/class/System/System.CodeDom/CodeTypeOfExpression.cs [deleted file]
mcs/class/System/System.CodeDom/CodeTypeParameter.cs [deleted file]
mcs/class/System/System.CodeDom/CodeTypeParameterCollection.cs [deleted file]
mcs/class/System/System.CodeDom/CodeTypeReference.cs [deleted file]
mcs/class/System/System.CodeDom/CodeTypeReferenceCollection.cs [deleted file]
mcs/class/System/System.CodeDom/CodeTypeReferenceExpression.cs [deleted file]
mcs/class/System/System.CodeDom/CodeTypeReferenceOptions.cs [deleted file]
mcs/class/System/System.CodeDom/CodeVariableDeclarationStatement.cs [deleted file]
mcs/class/System/System.CodeDom/CodeVariableReferenceExpression.cs [deleted file]
mcs/class/System/System.CodeDom/FieldDirection.cs [deleted file]
mcs/class/System/System.CodeDom/ICodeDomVisitor.cs [deleted file]
mcs/class/System/System.CodeDom/MemberAttributes.cs [deleted file]
mcs/class/System/System.IO.Compression/DeflateStream.cs
mcs/class/System/System.Net.Sockets/SafeSocketHandle.cs
mcs/class/System/System.Net.Sockets/Socket.cs
mcs/class/System/System.Net.Sockets/SocketAsyncCallback.cs [new file with mode: 0644]
mcs/class/System/System.Net.Sockets/SocketAsyncEventArgs.cs
mcs/class/System/System.Net.Sockets/SocketAsyncResult.cs [new file with mode: 0644]
mcs/class/System/System.Net.Sockets/SocketAsyncWorker.cs [new file with mode: 0644]
mcs/class/System/System.Net.Sockets/SocketOperation.cs [new file with mode: 0644]
mcs/class/System/System.Net.Sockets/Socket_2_1.cs [deleted file]
mcs/class/System/System.Net/Dns.cs
mcs/class/System/System.Net/ServicePoint.cs
mcs/class/System/System.Net/WebConnectionGroup.cs
mcs/class/System/System.Threading/SemaphoreFullException.cs [deleted file]
mcs/class/System/System.dll.sources
mcs/class/System/System/Uri.cs
mcs/class/System/Test/System.CodeDom.Compiler/CodeGeneratorGenerateFromCompileUnitTest.cs
mcs/class/System/Test/System.Diagnostics/ProcessTest.cs
mcs/class/System/Test/System.IO.Compression/DeflateStreamTest.cs
mcs/class/System/Test/System.Net.Sockets/SocketTest.cs
mcs/class/System/Test/System/UriTest3.cs
mcs/class/System/mobile_System.dll.sources
mcs/class/corlib/Assembly/AssemblyInfo.cs
mcs/class/corlib/Makefile
mcs/class/corlib/Microsoft.Win32.SafeHandles/ChangeLog [deleted file]
mcs/class/corlib/Microsoft.Win32.SafeHandles/CriticalHandleMinusOneIsInvalid.cs [deleted file]
mcs/class/corlib/Microsoft.Win32.SafeHandles/CriticalHandleZeroOrMinusOneIsInvalid.cs [deleted file]
mcs/class/corlib/Microsoft.Win32.SafeHandles/SafeFileHandle.cs [deleted file]
mcs/class/corlib/Microsoft.Win32.SafeHandles/SafeHandleMinusOneIsInvalid.cs [deleted file]
mcs/class/corlib/Microsoft.Win32.SafeHandles/SafeHandleZeroOrMinusOneIsInvalid.cs [deleted file]
mcs/class/corlib/Microsoft.Win32.SafeHandles/SafeRegistryHandle.cs [deleted file]
mcs/class/corlib/Microsoft.Win32.SafeHandles/SafeWaitHandle.cs [deleted file]
mcs/class/corlib/ReferenceSources/Buffer.cs [new file with mode: 0644]
mcs/class/corlib/ReferenceSources/CultureData.cs
mcs/class/corlib/ReferenceSources/Environment.cs
mcs/class/corlib/ReferenceSources/JitHelpers.cs
mcs/class/corlib/ReferenceSources/ParseNumbers.cs
mcs/class/corlib/ReferenceSources/RuntimeType.cs
mcs/class/corlib/ReferenceSources/String.cs
mcs/class/corlib/ReferenceSources/TextInfo.cs [new file with mode: 0644]
mcs/class/corlib/ReferenceSources/TimeZoneInfoOptions.cs [deleted file]
mcs/class/corlib/ReferenceSources/TypeBuilderInstantiation.cs [new file with mode: 0644]
mcs/class/corlib/ReferenceSources/win32native.cs [new file with mode: 0644]
mcs/class/corlib/System.Collections.Concurrent/ConcurrentOrderedList.cs [deleted file]
mcs/class/corlib/System.Collections.Generic/Comparer.cs [deleted file]
mcs/class/corlib/System.Collections.Generic/EqualityComparer.cs [deleted file]
mcs/class/corlib/System.Globalization/.gitattributes [deleted file]
mcs/class/corlib/System.Globalization/CalendarAlgorithmType.cs [deleted file]
mcs/class/corlib/System.Globalization/CalendarWeekRule.cs [deleted file]
mcs/class/corlib/System.Globalization/CultureInfo.cs
mcs/class/corlib/System.Globalization/DateTimeStyles.cs [deleted file]
mcs/class/corlib/System.Globalization/DigitShapes.cs [deleted file]
mcs/class/corlib/System.Globalization/GregorianCalendarTypes.cs [deleted file]
mcs/class/corlib/System.Globalization/TextInfo.cs [deleted file]
mcs/class/corlib/System.IO/DirectoryNotFoundException.cs [deleted file]
mcs/class/corlib/System.IO/DriveNotFoundException.cs [deleted file]
mcs/class/corlib/System.IO/EndOfStreamException.cs [deleted file]
mcs/class/corlib/System.IO/FileLoadException.cs [deleted file]
mcs/class/corlib/System.IO/FileNotFoundException.cs [deleted file]
mcs/class/corlib/System.IO/FileStream.cs
mcs/class/corlib/System.IO/IOException.cs [deleted file]
mcs/class/corlib/System.IO/PathTooLongException.cs [deleted file]
mcs/class/corlib/System.Reflection.Emit/CustomAttributeBuilder.cs
mcs/class/corlib/System.Reflection.Emit/UnmanagedMarshal.cs
mcs/class/corlib/System.Reflection/Assembly.cs
mcs/class/corlib/System.Reflection/MonoMethod.cs
mcs/class/corlib/System.Runtime.ConstrainedExecution/CER.cs [deleted file]
mcs/class/corlib/System.Runtime.ConstrainedExecution/ChangeLog [deleted file]
mcs/class/corlib/System.Runtime.ConstrainedExecution/Consistency.cs [deleted file]
mcs/class/corlib/System.Runtime.ConstrainedExecution/CriticialFinalizerObject.cs [deleted file]
mcs/class/corlib/System.Runtime.ConstrainedExecution/PrePrepareMethodAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.ConstrainedExecution/ReliabilityContractAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/BINDPTR.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/BIND_OPTS.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/CALLCONV.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/CONNECTDATA.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/ChangeLog [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/DESCKIND.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/DISPPARAMS.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/ELEMDESC.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/EXCEPINFO.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/FILETIME.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/FUNCDESC.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/FUNCFLAGS.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/FUNCKIND.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IBindCtx.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IConnectionPoint.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IConnectionPointContainer.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IDLDESC.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IDLFLAG.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IEnumConnectionPoints.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IEnumConnections.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IEnumMoniker.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IEnumString.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IEnumVARIANT.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IMPLTYPEFLAGS.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IMoniker.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/INVOKEKIND.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IPersistFile.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IRunningObjectTable.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IStream.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/ITypeComp.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/ITypeInfo.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/ITypeInfo2.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/ITypeLib.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/ITypeLib2.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/LIBFLAGS.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/PARAMDESC.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/PARAMFLAG.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/STATSTG.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/SYSKIND.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/TYPEATTR.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/TYPEDESC.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/TYPEFLAGS.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/TYPEKIND.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/TYPELIBATTR.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/VARDESC.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/VARFLAGS.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.ComTypes/VARKIND.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.Expando/Changelog [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.Expando/IExpando.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/WindowsRuntimeMarshal.cs
mcs/class/corlib/System.Runtime.InteropServices/AllowReversePInvokeCallsAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/AutomationProxyAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/BestFitMappingAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/CONNECTDATA.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/ClassInterfaceAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/ClassInterfaceType.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/CoClassAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/ComAliasNameAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/ComCompatibleVersionAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/ComConversionLossAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/ComDefaultInterfaceAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/ComEventInterfaceAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/ComImportAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/ComInterfaceType.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/ComRegisterFunctionAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/ComSourceInterfacesAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/ComUnregisterFunctionAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/ComVisible.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/DefaultCharSetAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/DefaultDllImportSearchPathsAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/DispIdAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/DllImportAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/DllImportSearchPath.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/EXCEPINFO.cs
mcs/class/corlib/System.Runtime.InteropServices/FieldOffsetAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/GuidAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/IDispatchImplAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/IDispatchImplType.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/IErrorInfo.cs
mcs/class/corlib/System.Runtime.InteropServices/ImportedFromTypeLibAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/InAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/InterfaceTypeAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/LCIDConversionAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/ManagedErrorInfo.cs
mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs
mcs/class/corlib/System.Runtime.InteropServices/OptionalAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/OutAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/PreserveSigAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/PrimaryInteropAssemblyAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/ProgIdAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/SetWin32ContextInIDispatchAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/StructLayoutAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/TypeIdentifierAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/TypeLibFuncAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/TypeLibFuncFlags.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/TypeLibImportClassAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/TypeLibTypeAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/TypeLibTypeFlags.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/TypeLibVarAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/TypeLibVarFlags.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/TypeLibVersionAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/UCOMIConnectionPoint.cs
mcs/class/corlib/System.Runtime.InteropServices/UCOMIConnectionPointContainer.cs
mcs/class/corlib/System.Runtime.InteropServices/UCOMIEnumConnectionPoints.cs
mcs/class/corlib/System.Runtime.InteropServices/UCOMIEnumConnections.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/UCOMITypeComp.cs
mcs/class/corlib/System.Runtime.InteropServices/UCOMITypeInfo.cs
mcs/class/corlib/System.Runtime.InteropServices/UCOMITypeLib.cs
mcs/class/corlib/System.Runtime.InteropServices/UnmanagedFunctionPointerAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/UnmanagedType.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/VarEnum.cs [deleted file]
mcs/class/corlib/System.Runtime.Reliability/CER.cs [deleted file]
mcs/class/corlib/System.Runtime.Reliability/ChangeLog [deleted file]
mcs/class/corlib/System.Runtime.Reliability/Consistency.cs [deleted file]
mcs/class/corlib/System.Runtime.Reliability/PrePrepareMethodAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.Reliability/ReliabilityContractAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.Remoting.Contexts/Context.cs
mcs/class/corlib/System.Runtime.Remoting/TypeInfo.cs
mcs/class/corlib/System.Runtime.Versioning/ChangeLog [deleted file]
mcs/class/corlib/System.Runtime.Versioning/ComponentGuaranteesAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.Versioning/ComponentGuaranteesOptions.cs [deleted file]
mcs/class/corlib/System.Runtime.Versioning/ResourceConsumptionAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.Versioning/ResourceExposureAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.Versioning/ResourceScope.cs [deleted file]
mcs/class/corlib/System.Runtime.Versioning/TargetFrameworkAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.Versioning/VersioningHelper.cs [deleted file]
mcs/class/corlib/System.Security.Claims/Claim.cs [deleted file]
mcs/class/corlib/System.Security.Claims/ClaimTypes.cs [deleted file]
mcs/class/corlib/System.Security.Claims/ClaimValueTypes.cs [deleted file]
mcs/class/corlib/System.Security.Claims/ClaimsIdentity.cs [deleted file]
mcs/class/corlib/System.Security.Claims/ClaimsPrincipal.cs [deleted file]
mcs/class/corlib/System.Security.Principal/GenericIdentity.cs [deleted file]
mcs/class/corlib/System.Security.Principal/WindowsIdentity.cs
mcs/class/corlib/System.Security/AllowPartiallyTrustedCallersAttribute.cs [deleted file]
mcs/class/corlib/System.Security/SecurityCriticalAttribute.cs [deleted file]
mcs/class/corlib/System.Security/SecurityCriticalScope.cs [deleted file]
mcs/class/corlib/System.Security/SecurityRuleSet.cs [deleted file]
mcs/class/corlib/System.Security/SecurityRulesAttribute.cs [deleted file]
mcs/class/corlib/System.Security/SecuritySafeCriticalAttribute.cs [deleted file]
mcs/class/corlib/System.Security/SecurityTransparentAttribute.cs [deleted file]
mcs/class/corlib/System.Security/SecurityTreatAsSafeAttribute.cs [deleted file]
mcs/class/corlib/System.Security/SuppressUnmanagedCodeSecurityAttribute.cs [deleted file]
mcs/class/corlib/System.Security/UnverifiableCodeAttribute.cs [deleted file]
mcs/class/corlib/System.Threading/LockRecursionException.cs [deleted file]
mcs/class/corlib/System.Threading/Thread.cs
mcs/class/corlib/System.Threading/ThreadAbortException.cs [deleted file]
mcs/class/corlib/System.Threading/ThreadInterruptedException.cs [deleted file]
mcs/class/corlib/System/Action.cs [deleted file]
mcs/class/corlib/System/ApplicationId.cs [deleted file]
mcs/class/corlib/System/Array.cs
mcs/class/corlib/System/AsyncCallback.cs [deleted file]
mcs/class/corlib/System/AttributeTargets.cs [deleted file]
mcs/class/corlib/System/BadImageFormatException.cs [deleted file]
mcs/class/corlib/System/Buffer.cs [deleted file]
mcs/class/corlib/System/CLSCompliantAttribute.cs [deleted file]
mcs/class/corlib/System/Comparison.cs [deleted file]
mcs/class/corlib/System/ConsoleCancelEventArgs.cs [deleted file]
mcs/class/corlib/System/ConsoleCancelEventHandler.cs [deleted file]
mcs/class/corlib/System/ConsoleColor.cs [deleted file]
mcs/class/corlib/System/ConsoleKey.cs [deleted file]
mcs/class/corlib/System/ConsoleKeyInfo.cs [deleted file]
mcs/class/corlib/System/ConsoleModifiers.cs [deleted file]
mcs/class/corlib/System/ConsoleSpecialKey.cs [deleted file]
mcs/class/corlib/System/ContextBoundObject.cs [deleted file]
mcs/class/corlib/System/ContextStaticAttribute.cs [deleted file]
mcs/class/corlib/System/Converter.cs [deleted file]
mcs/class/corlib/System/Environment.cs
mcs/class/corlib/System/EventArgs.cs [deleted file]
mcs/class/corlib/System/EventHandler.cs [deleted file]
mcs/class/corlib/System/Exception.cs
mcs/class/corlib/System/FlagsAttribute.cs [deleted file]
mcs/class/corlib/System/Funcs.cs [deleted file]
mcs/class/corlib/System/Guid.cs
mcs/class/corlib/System/IAppDomainSetup.cs [deleted file]
mcs/class/corlib/System/IApplicationDescription.cs [deleted file]
mcs/class/corlib/System/IAsyncResult.cs [deleted file]
mcs/class/corlib/System/ICloneable.cs [deleted file]
mcs/class/corlib/System/IComparable.cs [deleted file]
mcs/class/corlib/System/IConvertible.cs [deleted file]
mcs/class/corlib/System/ICustomFormatter.cs [deleted file]
mcs/class/corlib/System/IDisposable.cs [deleted file]
mcs/class/corlib/System/IEquatable.cs [deleted file]
mcs/class/corlib/System/IFormatProvider.cs [deleted file]
mcs/class/corlib/System/IFormattable.cs [deleted file]
mcs/class/corlib/System/IHostContext.cs [deleted file]
mcs/class/corlib/System/IObservable.cs [deleted file]
mcs/class/corlib/System/IObserver.cs [deleted file]
mcs/class/corlib/System/IProgress.cs [deleted file]
mcs/class/corlib/System/IServiceProvider.cs [deleted file]
mcs/class/corlib/System/InvalidTimeZoneException.cs [deleted file]
mcs/class/corlib/System/LoaderOptimization.cs [deleted file]
mcs/class/corlib/System/LoaderOptimizationAttribute.cs [deleted file]
mcs/class/corlib/System/MTAThreadAttribute.cs [deleted file]
mcs/class/corlib/System/NonSerializedAttribute.cs [deleted file]
mcs/class/corlib/System/NullConsoleDriver.cs
mcs/class/corlib/System/ObsoleteAttribute.cs [deleted file]
mcs/class/corlib/System/ParamArrayAttribute.cs [deleted file]
mcs/class/corlib/System/Predicate.cs [deleted file]
mcs/class/corlib/System/STAThreadAttribute.cs [deleted file]
mcs/class/corlib/System/SerializableAttribute.cs [deleted file]
mcs/class/corlib/System/TermInfoReader.cs
mcs/class/corlib/System/ThreadStaticAttribute.cs [deleted file]
mcs/class/corlib/System/TimeZoneInfo.AdjustmentRule.cs [deleted file]
mcs/class/corlib/System/TimeZoneInfo.TransitionTime.cs [deleted file]
mcs/class/corlib/System/TimeZoneInfo.cs
mcs/class/corlib/System/TimeZoneNotFoundException.cs [deleted file]
mcs/class/corlib/System/TypeLoadException.cs [deleted file]
mcs/class/corlib/System/Variant.cs
mcs/class/corlib/Test/System.Collections.Generic/DictionaryTest.cs
mcs/class/corlib/Test/System.Collections.Generic/EqualityComparerTest.cs
mcs/class/corlib/Test/System.Globalization/CultureInfoTest.cs
mcs/class/corlib/Test/System.Reflection/AssemblyTest.cs
mcs/class/corlib/Test/System.Reflection/FieldInfoTest.cs
mcs/class/corlib/Test/System.Runtime.ExceptionServices/ExceptionDispatchInfoTest.cs
mcs/class/corlib/Test/System.Runtime.Serialization/SerializationTest.cs
mcs/class/corlib/Test/System/AttributeTest.cs
mcs/class/corlib/Test/System/ConvertTest.cs
mcs/class/corlib/Test/System/TimeZoneInfo.AdjustmentRuleTest.cs
mcs/class/corlib/corlib.dll.sources
mcs/class/monodoc/Monodoc/generators/html/Ecma2Html.cs
mcs/class/monodoc/Monodoc/generators/html/Ecmaspec2Html.cs
mcs/class/monodoc/Monodoc/generators/html/Toc2Html.cs
mcs/class/reference-assemblies/Makefile
mcs/errors/cs0104-5.cs [new file with mode: 0644]
mcs/errors/cs0246-35.cs [new file with mode: 0644]
mcs/errors/cs0815-8.cs [new file with mode: 0644]
mcs/mcs/anonymous.cs
mcs/mcs/ecore.cs
mcs/mcs/expression.cs
mcs/mcs/import.cs
mcs/mcs/namespace.cs
mcs/mcs/property.cs
mcs/tests/gtest-autoproperty-03.cs
mcs/tests/gtest-autoproperty-17.cs [new file with mode: 0644]
mcs/tests/gtest-optional-09.cs
mcs/tests/test-anon-70.cs
mcs/tests/test-static-using-08.cs [new file with mode: 0644]
mcs/tests/test-static-using-09-lib.cs [new file with mode: 0644]
mcs/tests/test-static-using-09.cs [new file with mode: 0644]
mcs/tests/test-static-using-10.cs [new file with mode: 0644]
mcs/tests/ver-il-net_4_5.xml
mcs/tools/linker/Mono.Linker.Steps/MarkStep.cs
mcs/tools/xbuild/Makefile
mcs/tools/xbuild/data/Microsoft.VisualBasic.targets
mono-core.spec.in [deleted file]
mono/arch/s390x/s390x-codegen.h
mono/dis/TODO [deleted file]
mono/io-layer/Makefile.am
mono/io-layer/handles.c
mono/io-layer/processes.c
mono/io-layer/system.c [deleted file]
mono/io-layer/system.h [deleted file]
mono/io-layer/threads.h
mono/io-layer/uglify.h
mono/io-layer/wapi.h
mono/io-layer/wthreads.c
mono/metadata/Makefile.am
mono/metadata/TODO [deleted file]
mono/metadata/appdomain.c
mono/metadata/class-internals.h
mono/metadata/class.c
mono/metadata/decimal-ms.c
mono/metadata/domain-internals.h
mono/metadata/domain.c
mono/metadata/file-mmap-posix.c
mono/metadata/file-mmap-windows.c
mono/metadata/gc.c
mono/metadata/icall-def.h
mono/metadata/icall.c
mono/metadata/image.c
mono/metadata/jit-info.c
mono/metadata/loader.c
mono/metadata/lock-tracer.h
mono/metadata/make-bundle.pl [deleted file]
mono/metadata/mempool-internals.h
mono/metadata/metadata-internals.h
mono/metadata/metadata.c
mono/metadata/monitor.c
mono/metadata/mono-endian.h
mono/metadata/monosn.c [deleted file]
mono/metadata/object-internals.h
mono/metadata/object-offsets.h
mono/metadata/object.c
mono/metadata/process.c
mono/metadata/reflection.c
mono/metadata/sample-bundle [deleted file]
mono/metadata/sgen-cardtable.c
mono/metadata/sgen-cardtable.h
mono/metadata/sgen-debug.c
mono/metadata/sgen-fin-weak-hash.c
mono/metadata/sgen-gc.c
mono/metadata/sgen-gc.h
mono/metadata/sgen-internal.c
mono/metadata/sgen-los.c
mono/metadata/sgen-marksweep-drain-gray-stack.h
mono/metadata/sgen-marksweep-scan-object-concurrent.h
mono/metadata/sgen-marksweep.c
mono/metadata/sgen-memory-governor.c
mono/metadata/sgen-memory-governor.h
mono/metadata/sgen-minor-scan-object.h
mono/metadata/sgen-os-mach.c
mono/metadata/sgen-pointer-queue.c
mono/metadata/sgen-pointer-queue.h
mono/metadata/sgen-protocol-def.h
mono/metadata/sgen-protocol.c
mono/metadata/sgen-stw.c
mono/metadata/sgen-tagged-pointer.h
mono/metadata/sgen-thread-pool.c [new file with mode: 0644]
mono/metadata/sgen-thread-pool.h [new file with mode: 0644]
mono/metadata/sgen-toggleref.c
mono/metadata/sgen-workers.c
mono/metadata/sgen-workers.h
mono/metadata/socket-io.c
mono/metadata/socket-io.h
mono/metadata/threadpool-ms-io.c
mono/metadata/threadpool-ms.c
mono/metadata/threadpool-ms.h
mono/metadata/threadpool.c
mono/metadata/threads.c
mono/mini/Makefile.am.in
mono/mini/README [deleted file]
mono/mini/TODO [deleted file]
mono/mini/aot-compiler.c
mono/mini/aot-runtime.c
mono/mini/cpu-amd64.md
mono/mini/cpu-arm.md
mono/mini/cpu-arm64.md
mono/mini/cpu-s390x.md
mono/mini/cpu-x86.md
mono/mini/debugger-agent.c
mono/mini/dominators.c
mono/mini/exceptions-amd64.c
mono/mini/exceptions-mips.c
mono/mini/exceptions-ppc.c
mono/mini/exceptions-s390x.c
mono/mini/exceptions-x86.c
mono/mini/generics.cs
mono/mini/ir-emit.h
mono/mini/liveness.c
mono/mini/method-to-ir.c
mono/mini/mini-amd64.c
mono/mini/mini-amd64.h
mono/mini/mini-arm.c
mono/mini/mini-arm.h
mono/mini/mini-exceptions.c
mono/mini/mini-generic-sharing.c
mono/mini/mini-llvm.c
mono/mini/mini-ops.h
mono/mini/mini-runtime.c
mono/mini/mini-s390x.c
mono/mini/mini-s390x.h
mono/mini/mini-trampolines.c
mono/mini/mini-x86.c
mono/mini/mini-x86.h
mono/mini/mini.c
mono/mini/mini.h
mono/mini/mini.prj [deleted file]
mono/mini/patch-info.h
mono/mini/seq-points.c
mono/mini/simd-intrinsics.c
mono/mini/tramp-amd64.c
mono/mini/tramp-arm.c
mono/mini/tramp-ia64.c
mono/mini/tramp-mips.c
mono/mini/tramp-ppc.c
mono/mini/tramp-s390x.c
mono/mini/tramp-sparc.c
mono/mini/tramp-x86.c
mono/mini/unwind.c
mono/profiler/Makefile.am
mono/profiler/log-profiler.txt [deleted file]
mono/profiler/mono-cov.c [deleted file]
mono/profiler/mono-profiler-logging.c [deleted file]
mono/profiler/proflog.c
mono/profiler/proflog.h
mono/tests/Makefile.am
mono/tests/delegate10.cs [new file with mode: 0644]
mono/tests/dynamic-generic-size.cs [new file with mode: 0644]
mono/tests/runtime-invoke.cs
mono/utils/hazard-pointer.c
mono/utils/lock-free-alloc.c
mono/utils/lock-free-array-queue.c
mono/utils/lock-free-queue.c
mono/utils/mono-codeman.c
mono/utils/mono-codeman.h
mono/utils/mono-counters.c
mono/utils/mono-dl.c
mono/utils/mono-filemap.c
mono/utils/mono-linked-list-set.c
mono/utils/mono-linked-list-set.h
mono/utils/mono-logger.c
mono/utils/mono-mmap.c
mono/utils/mono-mutex.c
mono/utils/mono-mutex.h
mono/utils/mono-networkinterfaces.c
mono/utils/mono-path.c
mono/utils/mono-proclib.c
mono/utils/mono-proclib.h
mono/utils/mono-property-hash.c
mono/utils/mono-threads-coop.c
mono/utils/mono-threads-coop.h
mono/utils/mono-threads-mach.c
mono/utils/mono-threads-posix.c
mono/utils/mono-threads-state-machine.c
mono/utils/mono-threads-windows.c
mono/utils/mono-threads.c
mono/utils/mono-threads.h
mono/utils/mono-time.c
mono/utils/mono-time.h
mono/utils/mono-tls.h
mono/utils/monobitset.c
mono/utils/strtod.h
notes/cil [deleted file]
runtime/Makefile.am
samples/profiler/sample.c
scripts/mono-find-provides.in
scripts/mono-find-requires.in
support/zlib-helper.c

index 6070126688899f54979fb52f35ce6b9e93423472..e5b638b53e876f7e84a53986c778fa3d6f435fdf 100644 (file)
@@ -122,8 +122,6 @@ docs/perlmod*
 compile
 mono.h
 mono-*.tar.*
-mono.spec
-mono-core.spec
 tmpinst-dir.stamp
 msvc/scripts/inputs/
 
diff --git a/AUTHORS b/AUTHORS
deleted file mode 100644 (file)
index 6c19bda..0000000
--- a/AUTHORS
+++ /dev/null
@@ -1,3 +0,0 @@
-Miguel de Icaza (miguel@ximian.com)
-Paolo Molaro (lupus@ximian.com)
-Dietmar Maurer (dietmar@ximian.com)
index cddaff1621145dac0cf0f23f4d6b58b19c002ad9..68269d7e9175ba4c3ac2f06864f3c3b247b6f836 100644 (file)
@@ -36,11 +36,9 @@ EXTRA_DIST= \
         README.md \
            LICENSE \
            autogen.sh \
-           build-mingw32.sh \
            mkinstalldirs \
            mono-uninstalled.pc.in \
            winconfig.h \
-           mono-core.spec \
            external
 
 DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_MCS=false EXTERNAL_RUNTIME=false
@@ -52,7 +50,7 @@ dist-hook:
        d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) distdir=$$d dist-recursive
        rm -rf `find $(top_distdir)/external -path '*\.git'`
        rm -f `find $(top_distdir)/external -path '*\.exe'`
-       rm -f `find $(top_distdir)/external -path '*\.dll' -not -path '*/binary-reference-assemblies/v4\.0*'`
+       rm -f `find $(top_distdir)/external -path '*\.dll' -not -path '*/binary-reference-assemblies/*'`
        cp mcs/class/lib/basic/System.Configuration.dll mcs/class/lib/monolite/
        cp mcs/class/lib/basic/System.Security.dll mcs/class/lib/monolite/
 # Disable this for now because it is very slow and causes wrench to timeout:
index 36a9c1ef398279ceb8e00e30a79ad03f09788f13..e7ed2c4f704790abd401315f7dd1b001e7dd5e11 100644 (file)
--- a/README.md
+++ b/README.md
@@ -3,6 +3,8 @@ create cross platform applications.  It is an open source
 implementation of Microsoft's .NET Framework based on the ECMA
 standards for C# and the Common Language Runtime.
 
+[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mono/mono?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+
 1. [Compilation and Installation](#compilation-and-installation)
 2. [Using Mono](#using-mono)
 3. [Directory Roadmap](#directory-roadmap)
@@ -21,9 +23,9 @@ Officially supported architectures:
 
 Community supported architectures:
 
-| debian-ppc64el              | centos-s390x              |
-|-----------------------------|---------------------------|
-| [![debian-ppc64el][11]][12] | [![centos-s390x][13]][14] |
+| centos-s390x              |
+|---------------------------|
+| [![centos-s390x][11]][12] |
 
 [1]: http://jenkins.mono-project.com/job/test-mono-mainline/label=debian-amd64/badge/icon
 [2]: http://jenkins.mono-project.com/job/test-mono-mainline/label=debian-amd64/
@@ -35,10 +37,8 @@ Community supported architectures:
 [8]: http://jenkins.mono-project.com/job/test-mono-mainline/label=debian-armhf/
 [9]: https://ci.appveyor.com/api/projects/status/1e61ebdfpbiei58v/branch/master?svg=true
 [10]: https://ci.appveyor.com/project/ajlennon/mono-817/branch/master
-[11]: http://jenkins.mono-project.com/job/test-mono-mainline-communityarchitectures/label=debian-ppc64el/badge/icon
-[12]: http://jenkins.mono-project.com/job/test-mono-mainline-communityarchitectures/label=debian-ppc64el/
-[13]: http://jenkins.mono-project.com/job/test-mono-mainline-communityarchitectures/label=centos-s390x/badge/icon
-[14]: http://jenkins.mono-project.com/job/test-mono-mainline-communityarchitectures/label=centos-s390x/
+[11]: http://jenkins.mono-project.com/job/test-mono-mainline-communityarchitectures/label=nealef-s390x-1/badge/icon
+[12]: http://jenkins.mono-project.com/job/test-mono-mainline-communityarchitectures/label=nealef-s390x-1/
 
 Compilation and Installation
 ============================
@@ -145,13 +145,6 @@ runtime as an embedded library.
 
 * `scripts/` - Scripts used to invoke Mono and the corresponding program.
 
-* `../olive/` - Incubation code from [Olive](https://github.com/mono/olive).
-
-  * If the directory ../olive is present (as an
-independent checkout) from the Mono module, that
-directory is automatically configured to share the
-same prefix than this module gets.
-
 Contributing to Mono
 ====================
 
diff --git a/README.vsnet b/README.vsnet
deleted file mode 100644 (file)
index f3a07a1..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-README.vsnet                                   Last updated: 2006-02-01
-
-
-SVN includes a Visual Studio .NET 2005 solution, mono.sln, and some 
-projects files to build most of the unmanaged parts in Mono.
-
-The "mono.sln" solution file contains the VC projects files for:
-
-        * Embedded Samples
-               * test-invoke.vcproj
-               * test-metadata.vcproj
-               * teste.vcproj
-        * Libraries
-               * libgc.vcproj
-               * libmono.vcproj
-        * Tools
-               * genmdesc.vcproj
-               * monoburg.vcproj
-               * monodiet.vcproj
-               * monodis.vcproj
-               * monograph.vcproj
-               * pedump.vcproj
-        * mono.vcproj
-        
-
-REQUIREMENTS
-
-* A working (i.e. where you could succesfully build mono) cygwin 
-(http://www.cygwin.com/) setup! This is required to:
-       * generate some files (via monoburg and genmdesc);
-       * build the class libraries; and
-       * test for regressions.
-
-* Visual Studio .NET 2005. Previous Visual Studio versions may work or 
-requires, hopefully minimal, changes.
-        
-* VSDependencies.zip must be decompressed under the /mono/ directory 
-(otherwise you will need to edit all the projects files). This file can 
-be downloaded from http://www.go-mono.com/archive/VSDependencies.zip
-
-
-LOCAL CHANGES
-
-Sadly solution/projects files aren't easy to move from computers to
-computers (well unless everyone follow the same naming convention) so
-you'll likely have to changes some options in order to compile the
-solution.
-
-        * each executed assembly (i.e. the EXE) must be able to find a
-        working mscorlib.dll (and all the other required assemblies).
-        This can be done in different ways. My preference is to use the
-        project "properties pages" in the "Configuration Properties
-        \Debugging\Environment" options and set MONO_PATH to the class
-        libraries directory build by cygwin (local) or on Linux
-        (remote).
-        
-        e.g. MONO_PATH=z:\svn\mcs\class\lib\default\
-        allows me to use the class libs build under Linux, while
-        MONO_PATH=C:\cygwin\opt\mono\lib\mono\1.0
-        use the one built from cygwin (after a make install)
-
-Some useful informations to adapt the solution/project files...
-
-        * My cygwin root dir is:       c:\cygwin\
-        * My username is:              poupou
-        * My mono install prefix is:   /opt/mono
-                
-
-BUILDING
-
-Once everything is installed (and edited) you can right-click on the
-"mono" solution (in the "Solution Explorer"), select "Clean
-Solution" (for the first time) then "Build Solution".
-
-
-KNOWN ISSUES
-
-[1] Most, BUT NOT ALL, the regressions tests pass under this build. The
-failures seems limited to some mathematical differences and to code
-relying on the stack walking functions. The hacks to replace the GCC
-functions (__builtin_frame_address and __builtin_return_address) are
-incomplete;
-
-[2] The solution doesn't provide complete (i.e. from scratch) build. It
-requires a working cygwin environment to create some files (e.g. via
-genmdesc, monoburg). This isn't so bad as without cygwin you wouldn't be
-able to test Mono properly (see REQUIREMENTS);
-
-[3] Only the Debug target is configured properly (that would be easy to 
-fix, but would require turning off some optimizations like omitting 
-stack frames). Anyway there are other issues [1] to fix before switching
-to Release and IMHO the _biggest_ advantage to VS.NET is it's debugger/
-debugging tools;
-
-[4] The C compiler emits _lots_ of warning during compilation. Some
-warnings have been turned off for some projects (there was so much that
-it slowed down compilation). You can bring them back (or hide more of
-them) using the project "properties pages" windows, "Configuration
-Properties\C/C++\Advanced\Disable Specific Warnings";
-
-[5] Visual Studio 2005 should have all the latest header files required, 
-but if not (or if you're using an older version of VS) then install MS 
-Platform SDK (Windows Server 2003 is the latest) to ensure you have the 
-latest Windows header files. You can download it from:
-http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm
-
-[6] Not everyone has VS.NET so it is possible you may have to add some
-(new) files to the build from time to time. See "more informations" for
-reporting those changes.
-
-[7] Probably a lot more I didn't discover... or has changed since.
-
-
-MORE INFORMATION
-
-Please email <mono-devel-list@lists.ximian.com> if you have any problem
-and/or if there's something wrong/missing in the instructions.
-
-An online version of this file is available at
-http://www.mono-project.com/Compiling_Mono_VSNET
diff --git a/build-mingw32.sh b/build-mingw32.sh
deleted file mode 100755 (executable)
index 4c8ed8c..0000000
+++ /dev/null
@@ -1,227 +0,0 @@
-#!/bin/bash -e
-CURDIR="`pwd`"
-MINGW=i386-mingw32msvc
-CROSS_DIR=/opt/cross/$MINGW
-EXTRA_CROSS_DIR=
-INSTALL_DESTDIR="$CURDIR/mono-win32"
-PROFILES="default net_2_0 net_3_5 net_4_0 net_4_5 moonlight"
-TEMPORARY_PKG_CONFIG_DIR=/tmp/$RANDOM-pkg-config-$RANDOM
-ORIGINAL_PATH="$PATH"
-
-export CPPFLAGS_FOR_EGLIB CFLAGS_FOR_EGLIB CPPFLAGS_FOR_LIBGC CFLAGS_FOR_LIBGC
-
-function cleanup ()
-{
-    if [ -d "$TEMPORARY_PKG_CONFIG_DIR" ]; then
-       rm -rf "$TEMPORARY_PKG_CONFIG_DIR"
-    fi
-}
-
-function check_pkg_config_dir ()
-{
-    local DIR="$1"
-    local DIR_PREFIX="$2"
-
-    if [ ! -d "$DIR" ]; then
-       return
-    fi
-
-    install -d -m 755 "$TEMPORARY_PKG_CONFIG_DIR"
-    for pc in "$DIR"/*.pc; do
-       if [ -f $pc ]; then
-           pcname="`basename $pc`"
-           sed -e "s;^prefix=.*;prefix=$DIR_PREFIX;g" < $pc > "$TEMPORARY_PKG_CONFIG_DIR"/$pcname
-       fi;
-    done
-
-    if [ -z "$CROSS_PKG_CONFIG_DIR" ]; then
-       CROSS_PKG_CONFIG_DIR="$TEMPORARY_PKG_CONFIG_DIR"
-    fi
-}
-
-function show_build_info ()
-{
-    cat <<EOF
-Installation prefix: $MONO_PREFIX
-           CPPFLAGS: ${CPPFLAGS:=not set}
-            LDFLAGS: ${LDFLAGS:=not set}
-          MONO_PATH: ${MONO_PATH:=not set}
-EOF
-}
-
-function setup ()
-{
-    local pcname
-
-    CROSS_BIN_DIR="$CROSS_DIR/bin"
-    CROSS_DLL_DIR="$CROSS_DIR/bin"
-    PATH=$CROSS_BIN_DIR:$PATH
-
-    MONO_VERSION=`grep AC_INIT configure.ac | cut -d ',' -f 2|tr -d '\[ \]'`
-    
-    if [ -d ./.git ]; then
-       MONO_GIT_COMMIT="`git log -1 --format=format:%t`"
-       MONO_GIT_BRANCH="`git branch|grep '\*'|cut -d ' ' -f 2|tr -d '\)'|tr -d '\('`"
-       MONO_RELEASE="$MONO_VERSION-$MONO_GIT_BRANCH-$MONO_GIT_COMMIT"
-    else
-       MONO_RELEASE="$MONO_VERSION"
-    fi
-
-    MONO_PREFIX="$MONO_PREFIX/mono-$MONO_RELEASE"
-
-    NOCONFIGURE=yes
-    export NOCONFIGURE
-
-    check_pkg_config_dir "$CROSS_DIR/lib/pkgconfig" "$CROSS_DIR"
-
-    if [ -n "$EXTRA_CROSS_DIR" -a -d "$EXTRA_CROSS_DIR" ]; then
-       if [ -d "$EXTRA_CROSS_DIR/bin" ]; then
-               PATH="$EXTRA_CROSS_DIR/bin":$PATH
-       fi
-       
-       check_pkg_config_dir "$EXTRA_CROSS_DIR/lib/pkgconfig" "$EXTRA_CROSS_DIR"
-
-       if [ -d "$EXTRA_CROSS_DIR/include" ]; then
-           if [ -z "$CPPFLAGS" ]; then
-               CPPFLAGS="-I \"$EXTRA_CROSS_DIR/include\""
-           else
-               CPPFLAGS="-I \"$EXTRA_CROSS_DIR/include\" $CFLAGS"
-           fi
-       fi
-
-       if [ -d "$EXTRA_CROSS_DIR/lib" ]; then
-           if [ -z "$LDFLAGS" ]; then
-               LDFLAGS="-I \"$EXTRA_CROSS_DIR/lib\""
-           else
-               LDFLAGS="-I \"$EXTRA_CROSS_DIR/lib\" $LDFLAGS"
-           fi
-       fi
-
-       if [ -d "$EXTRA_CROSS_DIR/share/aclocal" ]; then
-           if [ -z "$MONO_PATH" ]; then
-               MONO_PATH="\"$EXTRA_CROSS_DIR\""
-           else
-               MONO_PATH="\"$EXTRA_CROSS_DIR\":$MONO_PATH"
-           fi
-       fi
-    fi
-    
-    export PATH MONO_PATH CPPFLAGS
-    show_build_info
-}
-
-function build ()
-{
-    if [ -f ./Makefile ]; then
-       make distclean
-    fi
-
-    if [ -d ./autom4te.cache ]; then
-       rm -rf ./autom4te.cache
-    fi
-
-    if [ -f ./config.status ]; then
-       for f in `find -name config.status -type f`; do
-           rm $f
-       done
-    fi
-
-    ./autogen.sh 
-
-    BUILD="`./config.guess`"
-
-    if [ ! -d "$CURDIR/build-cross-windows" ]; then
-       mkdir "$CURDIR/build-cross-windows"
-    fi
-
-    cd "$CURDIR/build-cross-windows"
-    rm -rf *
-    ../configure --prefix=$MONO_PREFIX --with-crosspkgdir=$CROSS_PKG_CONFIG_DIR --build=$BUILD --target=$MINGW --host=$MINGW --enable-parallel-mark --program-transform-name="" --with-tls=none --disable-mcs-build --disable-embed-check --enable-win32-dllmain=yes --with-libgc-threads=win32 --with-profile4=yes
-    make
-    cd "$CURDIR"
-
-    if [ ! -d "$CURDIR/build-cross-windows-mcs" ]; then
-       mkdir "$CURDIR/build-cross-windows-mcs"
-    fi
-
-    rm -rf autom4te.cache
-    unset PATH
-    PATH="$ORIGINAL_PATH"
-    export PATH
-    cd "$CURDIR/build-cross-windows-mcs"
-    rm -rf *
-    ../configure --prefix=$MONO_PREFIX --enable-parallel-mark
-    make
-}
-
-function doinstall ()
-{
-    if [ -d "$INSTALL_DIR" ]; then
-       rm -rf "$INSTALL_DIR"
-    fi
-    cd "$CURDIR/build-cross-windows"
-    make DESTDIR="$INSTALL_DESTDIR" USE_BATCH_FILES=yes install
-
-    if test -d $CURDIR/mcs; then
-      mcsdir=$CURDIR/mcs
-    else
-      mcsdir=$CURDIR/../mcs
-    fi
-
-    cd "$mcsdir/mcs"
-    for p in $PROFILES; do
-       make DESTDIR="$INSTALL_DESTDIR" PROFILE=$p install || echo "mcs profile $p installation failed"
-    done
-
-    cd "$mcsdir/class"
-    for p in $PROFILES; do
-       make DESTDIR="$INSTALL_DESTDIR" PROFILE=$p install || echo "class library profile $p installation failed"
-    done
-
-    cd "$mcsdir/tools"
-    for p in $PROFILES; do
-       make DESTDIR="$INSTALL_DESTDIR" PROFILE=$p install || echo "tools profile $p installation failed"
-    done
-
-    cd "$CURDIR/mono-win32"
-    rm -f "$CURDIR/mono-win32-$MONO_RELEASE".zip
-    zip -9r "$CURDIR/mono-win32-$MONO_RELEASE".zip .
-
-}
-
-function usage ()
-{
-    cat <<EOF
-Usage: build-mingw32.sh [OPTIONS]
-
-where OPTIONS are:
-
- -d DIR     Sets the location of directory where MINGW is installed [$CROSS_DIR]
- -e DIR     Sets the location of directory where additional cross develoment packages are installed [${EXTRA_CROSS_DIR:=none}]
- -m MINGW   Sets the MINGW target name to be passed to configure [$MINGW]
- -p PREFIX  Prefix at which Mono is to be installed. Build will append the 'mono-X.Y' string to that path
-EOF
-
-    exit 1
-}
-
-trap cleanup 0
-
-pushd . > /dev/null
-
-while getopts "d:m:e:p:" opt; do
-    case "$opt" in
-       d) CROSS_DIR="$OPTARG" ;;
-       m) MINGW="$OPTARG" ;;
-       e) EXTRA_CROSS_DIR="$OPTARG" ;;
-       p) MONO_PREFIX="$OPTARG" ;;
-       *) usage ;;
-    esac
-done
-
-setup
-build
-doinstall
-show_build_info
-
-popd > /dev/null
index f6680e3cb094ffed258acf5173397010baa38a98..7ef32a6deede7654792f5d54bfa84af1204be718 100644 (file)
@@ -96,20 +96,16 @@ platform_android=no
 platform_darwin=no
 case "$host" in
        *-mingw*|*-*-cygwin*)
-               AC_DEFINE(HOST_WIN32,1,[Host Platform is Win32])
                AC_DEFINE(DISABLE_PORTABILITY,1,[Disable the io-portability layer])
                AC_DEFINE(PLATFORM_NO_SYMLINKS,1,[This platform does not support symlinks])
                host_win32=yes
                mono_cv_clang=no
                if test "x$cross_compiling" = "xno"; then
-                       target_win32=yes
                        if test "x$host" == "x$build" -a "x$host" == "x$target"; then
-                               AC_DEFINE(TARGET_WIN32,1,[Target OS is Win32])
+                               target_win32=yes
                        fi
                else
                        target_win32=yes
-                       AC_DEFINE(TARGET_WIN32,1,[Target OS is Win32/MinGW])
-                       AC_DEFINE(MINGW_CROSS_COMPILE,1,[Cross-compiling using MinGW])
                fi
                HOST_CC="gcc"
                # Windows XP SP2 is required
@@ -360,6 +356,14 @@ if test x$need_link_unlink = xyes; then
    AC_DEFINE(NEED_LINK_UNLINK, 1, [Define if Unix sockets cannot be created in an anonymous namespace])
 fi
 
+if test x$host_win32 = xyes; then
+   AC_DEFINE(HOST_WIN32, 1, [Host Platform is Win32])
+fi
+
+if test x$target_win32 = xyes; then
+   AC_DEFINE(TARGET_WIN32, 1, [Target Platform is Win32])
+fi
+
 AC_SUBST(extra_runtime_ldflags)
 AM_CONDITIONAL(HOST_WIN32, test x$host_win32 = xyes)
 AM_CONDITIONAL(TARGET_WIN32, test x$target_win32 = xyes)
@@ -432,7 +436,7 @@ AC_PROG_LD_GNU
 AM_ICONV()
 
 AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h sys/utime.h semaphore.h sys/un.h linux/rtc.h sys/syscall.h sys/mkdev.h sys/uio.h sys/param.h sys/sysctl.h libproc.h)
-AC_CHECK_HEADERS(sys/param.h sys/socket.h sys/ipc.h sys/sem.h sys/utsname.h alloca.h ucontext.h pwd.h sys/select.h netinet/tcp.h netinet/in.h unistd.h sys/types.h link.h asm/sigcontext.h sys/inotify.h arpa/inet.h)
+AC_CHECK_HEADERS(sys/param.h sys/socket.h sys/ipc.h sys/sem.h sys/utsname.h alloca.h ucontext.h pwd.h sys/select.h netinet/tcp.h netinet/in.h unistd.h sys/types.h link.h asm/sigcontext.h sys/inotify.h arpa/inet.h complex.h)
 AC_CHECK_HEADERS([linux/netlink.h linux/rtnetlink.h],
                   [], [], [#include <stddef.h>
                  #include <sys/socket.h>
@@ -631,17 +635,6 @@ fi
 AC_SUBST([mcs_topdir])
 AC_SUBST([mcs_topdir_from_srcdir])
 
-# Where's the 'olive' source tree?
-if test -d $srcdir/olive; then
-  olivedir=olive
-else
-  olivedir=../olive
-fi
-
-if test -d $srcdir/$olivedir; then
-olive_topdir='$(top_srcdir)/'$olivedir
-fi
-
 # gettext: prepare the translation directories. 
 # we do not configure the full gettext, as we consume it dynamically from C#
 AM_PO_SUBDIRS
@@ -3061,6 +3054,19 @@ if test "x$host" != "x$target"; then
                with_tls=pthread
                target_mach=no
                ;;
+   x86_64-ps4-freebsd)
+               TARGET=AMD64;
+               arch_target=amd64;
+               AC_DEFINE(TARGET_AMD64, 1, [...])
+               AC_DEFINE(TARGET_PS4, 1, [...])
+               CPPFLAGS="$CPPFLAGS"
+               sgen_supported=true
+               # Can't use tls, since it depends on the runtime detection of tls offsets
+               # in mono-compiler.h
+               with_tls=pthread
+               target_mach=no
+               target_win32=no
+               ;;
    aarch64*-linux-*)
                TARGET=ARM64;
                arch_target=arm64;
@@ -3837,7 +3843,6 @@ AC_CONFIG_COMMANDS([nolock-libtool], [sed -e 's/lock_old_archive_extraction=yes/
 
 AC_OUTPUT([
 Makefile
-mono-core.spec
 mono-uninstalled.pc
 scripts/mono-find-provides
 scripts/mono-find-requires
@@ -4018,22 +4023,6 @@ fi
 
   fi
 
-  # if we have an olive folder, override the default settings
-  if test -d $olivedir; then
-
-    if test x$cross_compiling = xno && test x$enable_olive_build != xno; then
-
-      test -w $srcdir/$olivedir/build || chmod +w $srcdir/$olivedir/build
-
-      echo "prefix=$prefix" > $srcdir/$olivedir/build/config.make
-      echo "exec_prefix=$exec_prefix" >> $srcdir/$olivedir/build/config.make
-      echo 'mono_libdir=${exec_prefix}/lib' >> $srcdir/$olivedir/build/config.make
-      echo 'MCS_FLAGS = $(PLATFORM_DEBUG_FLAGS)' >> $srcdir/$olivedir/build/config.make
-      echo "RUNTIME = $mono_build_root/runtime/mono-wrapper" >> $srcdir/$olivedir/build/config.make
-      echo "MONO_VERSION = $myver" >> $srcdir/$olivedir/build/config.make
-    fi
-  fi
-
 )
 
 libgdiplus_msg=${libgdiplus_loc:-assumed to be installed}
index ce34d357f643f46953e45518289e7dc796853b9d..f4dcfe72c09edbea4c3fcf23c19c3e0bbf1c0502 100644 (file)
@@ -31,7 +31,7 @@ class StringPrinter:
         while i < len:
             val = (chars.cast(gdb.lookup_type ("gint64")) + (i * 2)).cast(gdb.lookup_type ("gunichar2").pointer ()).dereference ()
             if val >= 256:
-                c = "\u%X".format (val)
+                c = unichr (val)
             else:
                 c = chr (val)
             res.append (c)
index 811955257bb529eb63ef9261c61089e99af5ad81..9c514420403427864d1c3e36e808f0371b6c01c4 100644 (file)
@@ -14,7 +14,6 @@ ASSEMBLED_DOCS = \
 EXTRA_DIST = \
        abc-removal.txt         \
        api-style.css           \
-       assembly-bundle         \
        check-exports           \
        check-coverage          \
        convert.cs              \
@@ -23,7 +22,6 @@ EXTRA_DIST = \
        docs.make               \
        documented              \
        embedded-api            \
-       exceptions              \
        exdoc                   \
        file-share-modes        \
        gc-issues               \
@@ -35,33 +33,25 @@ EXTRA_DIST = \
        jit-imt                 \
        jit-thoughts            \
        jit-trampolines         \
-       local-regalloc.txt      \
-       magic.diff              \
        mini-doc.txt            \
        mono-api-metadata.html  \
        mono-file-formats.config\
        mono-file-formats.source\
-       mono_handle_d           \
        mono-tools.config       \
        mono-tools.source       \
        monoapi.source          \
-       new-regalloc            \
        object-layout           \
-       opcode-decomp.txt       \
        precise-gc              \
        produce-lists           \
        public                  \
        public-api              \
        README                  \
-       release-notes-1.0.html  \
        remoting                \
        ssapre.txt              \
-       stack-alignment         \
        stack-overflow.txt      \
        threading               \
        toc.xml                 \
        TODO                    \
-       tree-mover.txt          \
        unmanaged-calls 
 
 dist-hook:
diff --git a/docs/assembly-bundle b/docs/assembly-bundle
deleted file mode 100644 (file)
index 3e64e14..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-
-          HOWTO bundle assemblies inside the mono runtime.
-                  Paolo Molaro (lupus@ximian.com)
-
-* Intent
-
-       Bundling assemblies inside the mono runtime may be useful for a number
-       of reasons:
-
-               * creating a standalone complete runtime that can be more easily
-               distributed
-
-               * having an application run against a known set of assemblies
-               that has been tested
-       
-       Of course, there are drawbacks, too: if there has been fixes
-       to the assemblies, replacing them means recompiling the
-       runtime as well and if there are other mono apps, unless they
-       use the same mono binary, there will be less opportunities for
-       the operating system to optimize memory usage. So use this
-       feature only when really needed.
-
-* Creating the Bundle
-       
-       To bundle a set of assemblies, you need to create a file that
-       lists the assembly names and the relative files. Empty lines
-       and lines starting with # are ignored:
-       
-       == cut cut ==
-       # Sample bundle template
-       mscorlib: /path/to/mscorlib/assembly.dll
-       myapp: /path/to/myapp.exe
-       == cut cut ==
-       
-       Next you need to build the mono runtime using a special configure option:
-
-               ./configure --with-bundle=/path/to/bundle/template
-
-       The path to the template should be an absolute path.
-
-       The script metadata/make-bundle.pl will take the specifie
-       assemblies and embed them inside the runtime where the loading
-       routines can find them before searching for them on disk.
-
-* Open Issues
-
-       There are still two issues to solve:
-
-               * config files: sometimes they are needed but they are
-                 not yet bundled inside the library ()
-
-               * building with the included libgc makes it not
-                 possible to build a mono binary statically linked to
-                 libmono: this needs to be fixed to make bundles
-                 really useful.
-
-       
index d5ecaeead43a634984b2701a5c5bd5acaa8ff019..bd22de9f25f4ad5886baa969e9465e6f914fc11e 100644 (file)
@@ -71,40 +71,3 @@ unwinding code.
 
 catch handler: catch hanlders are always called from the stack unwinding
 code. The exception object is passed in a local variable (cfg->exvar).
-
-gcc support for Exceptions
-==========================
-
-gcc supports exceptions in files compiled with the -fexception option. gcc
-generates DWARF exceptions tables in that case, so it is possible to unwind the
-stack. The method to read those exception tables is contained in libgcc.a, and
-in newer versions of glibc (glibc 2.2.5 for example), and it is called
-__frame_state_for(). Another usable glibc function is backtrace_symbols() which
-returns the function name corresponding to a code address.
-
-We dynamically check if those features are available using g_module_symbol(),
-and we use them only when available. If not available we use the LMF as
-fallback.
-
-Using gcc exception information prevents us from saving the LMF at each native
-call, so this is a way to speed up native calls. This is especially valuable
-for internal calls, because we can make sure that all internal calls are
-compiled with -fexceptions (we compile the whole mono runtime with that
-option).
-
-All native function are able to call function without exception tables, and so
-we are unable to restore all caller saved registers if an exception is raised
-in such function. Well, its possible if the previous function already saves all
-registers. So we only omit the the LMF if a function has an exception table
-able to restore all caller saved registers.
-
-One problem is that gcc almost never saves all caller saved registers, because
-it is just unnecessary in normal situations. But there is a trick forcing gcc
-to save all register, we just need to call __builtin_unwind_init() at the
-beginning of a function. That way gcc generates code to save all caller saved
-register on the stack.
-
-
-
-
\ No newline at end of file
diff --git a/docs/local-regalloc.txt b/docs/local-regalloc.txt
deleted file mode 100644 (file)
index a6e5235..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-
-* Proposal for the local register allocator
-
-       The local register allocator deals with allocating registers
-       for temporaries inside a single basic block, while the global 
-       register allocator is concerned with method-wide allocation of 
-       variables.
-       The global register allocator uses callee-saved register for it's 
-       purpouse so that there is no need to save and restore these registers
-       at call sites.
-
-       There are a number of issues the local allocator needs to deal with:
-       *) some instructions expect operands in specific registers (for example
-               the shl instruction on x86, or the call instruction with thiscall
-               convention, or the equivalent call instructions on other architectures, 
-               such as the need to put output registers in %oX on sparc)
-       *) some instructions deliver results only in specific registers (for example
-               the div instruction on x86, or the call instructionson on almost all
-               the architectures).
-       *) it needs to know what registers may be clobbered by an instruction
-               (such as in a method call)
-       *) it should avoid excessive reloads or stores to improve performance
-       
-       While which specific instructions have limitations is architecture-dependent,
-       the problem shold be solved in an arch-independent way to reduce code duplication.
-       The register allocator will be 'driven' by the arch-dependent code, but it's 
-       implementation should be arch-independent.
-
-       To improve the current local register allocator, we need to
-       keep more state in it than the current setup that only keeps busy/free info.
-
-       Possible state information is:
-
-       free: the resgister is free to use and it doesn't contain useful info
-       freeable: the register contains data loaded from a local (there is 
-               also info about _which_ local it contains) as a result from previous
-               instructions (like, there was a store from the register to the local)
-       moveable: it contains live data that is needed in a following instruction, but
-               the contents may be moved to a different register
-       busy: the register contains live data and it is placed there because
-               the following instructions need it exactly in that register
-       allocated: the register is used by the global allocator
-
-       The local register allocator will have the following interfaces:
-
-       int get_register ();
-               Searches for a register in the free state. If it doesn't find it,
-               searches for a freeable register. Sets the status to moveable.
-               Looking for a 'free' register before a freeable one should allow for
-               removing a few redundant loads (though I'm still unsure if such
-               things should be delegated entirely to the peephole pass).
-       
-       int get_register_force (int reg);
-               Returns 'reg' if it is free or freeable. If it is moveable, it moves it 
-               to another free or freeable register.
-               Sets the status of 'reg' to busy.
-       
-       void set_register_freeable (int reg);
-               Sets the status of 'reg' to freeable.
-       
-       void set_register_free (int reg);
-               Sets the status of 'reg' to free.
-
-       void will_clobber (int reg);
-               Spills the register to the stack. Sets the status to freeable.
-               After the clobbering has occurred, set the status to free.
-
-       void register_unspill (int reg);
-               Un-spills register reg and sets the status to moveable.
-
-       FIXME: how is the 'local' information represented? Maybe a MonoInst* pointer.
-
-       Note: the register allocator will insert instructions in the basic block
-       during it's operation.
-
-* Examples
-
-       Given the tree (on x86 the right argument to shl needs to be in ecx):
-
-       store (local1, shl (local1, call (some_arg)))
-
-       At the start of the basic block, the registers are set to the free state.
-       The sequence of instructions may be:
-               instruction             register status -> [%eax %ecx %edx]
-               start                                       free free free
-               eax = load local1                           mov  free free
-               /* call clobbers eax, ecx, edx */
-               spill eax                                   free free free
-               call                                        mov  free free
-               /* now eax contains the right operand of the shl */
-               mov %eax -> %ecx                            free busy free
-               un-spill                                    mov  busy free
-               shl %cl, %eax                               mov  free free
-       
-       The resulting x86 code is:
-               mov $fffc(%ebp), %eax
-               mov %eax, $fff0(%ebp)
-               push some_arg
-               call func
-               mov %eax, %ecx
-               mov $fff0(%ebp), %eax
-               shl %cl, %eax
-               
-       Note that since shl could operate directly on memory, we could have:
-       
-               push some_arg
-               call func
-               mov %eax, %ecx
-               shl %cl, $fffc(%ebp)
-
-       The above example with loading the operand in a register is just to complicate
-       the example and show that the algorithm should be able to handle it.
-
-       Let's take another example with the this-call call convention (the first argument 
-       is passed in %ecx).
-       In this case, will_clobber() will be called only on %eax and %edx, while %ecx
-       will be allocated with get_register_force ().
-       Note: when a register is allocated with get_register_force(), it should be set
-       to a different state as soon as possible.
-
-       store (local1, shl (local1, this-call (local1)))
-
-               instruction             register status -> [%eax %ecx %edx]
-               start                                       free free free
-               eax = load local1                           mov  free free
-               /* force load in %ecx */
-               ecx = load local1                           mov  busy free
-               spill eax                                   free busy free
-               call                                        mov  free free
-               /* now eax contains the right operand of the shl */
-               mov %eax -> %ecx                            free busy free
-               un-spill                                    mov  busy free
-               shl %cl, %eax                               mov  free free
-
-       What happens when a register that we need to allocate with get_register_force ()
-       contains an operand for the next instruction?
-
-               instruction             register status -> [%eax %ecx %edx]
-               eax = load local0                           mov  free free
-               ecx = load local1                           mov  mov  free
-               get_register_force (ecx) here.
-               We have two options: 
-                       mov %ecx, %edx
-               or:
-                       spill %ecx
-               The first option is way better (and allows the peephole pass to
-               just load the value in %edx directly, instead of loading first to %ecx).
-               This doesn't work, though, if the instruction clobbers the %edx register
-               (like in a this-call). So, we first need to clobber the registers
-               (so the state of %ecx changes to freebale and there is no issue
-               with get_register_force ()).
-               What if an instruction both clobbers a register and requires it as 
-               an operand? Lets' take the x86 idiv instruction as an example: it
-               requires the dividend in edx:eax and returns the result in eax,
-               with the modulus in edx.
-       
-       store (local1, div (local1, local2))
-               
-               instruction             register status -> [%eax %ecx %edx]
-               eax = load local0                           mov  free free
-               will_clobber eax, edx                       free mov  free
-               force mov %ecx, %eax                        busy free free
-               set %edx                                    busy free busy
-               idiv                                        mov  free free
-       
-       Note: edx is set to free after idiv, because the modulus is not needed
-       (if it was a rem, eax would have been freed).
-       If we load the divisor before will_clobber(), we'll have to spill
-       eax and reload it later. If we load it just after the idiv, there is no issue.
-       In any case, the algorithm should give the correct results and allow the operation.
-               
-       Working recursively on the isntructions there shouldn't be huge issues
-       with this algorithm (though, of course, it's not optimal and it may
-       introduce excessive spills or register moves). The advantage over the current
-       local reg allocator is that:
-       1) the number of spills/moves would be smaller anyway
-       2) a separate peephole pass could be able to eliminate reg moves
-       3) we'll be able to remove the 'forced' spills we currently do with
-               the return value of method calls
-
-* Issues
-
-       How to best integrate such a reg allocator with the burg stuff.
-
-       Think about a call os sparc with two arguments: they got into %o0 and %o1
-       and each of them sets the register as busy. But what if the values to put there
-       are themselves the result of a call? %o0 is no problem, but for all the 
-       next argument n the above algorithm would spill all the 0...n-1 registers...
-
-* Papers
-
-       More complex solutions to the local register allocator problem:
-       http://dimacs.rutgers.edu/TechnicalReports/abstracts/1997/97-33.html
-
-       Combining register allocation and instruction scheduling:
-       http://citeseer.nj.nec.com/motwani95combining.html
-
-       More on LRA euristics:
-       http://citeseer.nj.nec.com/liberatore97hardness.html
-
-       Linear-time optimal code scheduling for delayedload architectures
-       http://www.cs.wisc.edu/~fischer/cs701.f01/inst.sched.ps.gz
-
-       Precise Register Allocation for Irregular Architectures
-       http://citeseer.nj.nec.com/kong98precise.html
-
-       Allocate registers first to subtrees that need more of them.
-       http://www.upb.de/cs/ag-kastens/compii/folien/comment401-409.2.pdf
diff --git a/docs/mono_handle_d b/docs/mono_handle_d
deleted file mode 100644 (file)
index a8f97b1..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-=pod
-
-=head1 Internal design document for the mono_handle_d
-
-This document is designed to hold the design of the mono_handle_d and
-not as an api reference.
-
-=head2 Primary goal and purpose
-
-The mono_handle_d is a process which takes care of the (de)allocation
-of scratch shared memory and handles (of files, threads, mutexes,
-sockets etc. see L<WapiHandleType>) and refcounts of the
-filehandles. It is designed to be run by a user and to be fast, thus
-minimal error checking on input is done and will most likely crash if
-given a faulty package. No effort has been, or should be, made to have
-the daemon talking to machine of different endianness/size of int.
-
-=head2 How to start the daemon
-
-To start the daemon you either run the mono_handle_d executable or try
-to attach to the shared memory segment via L<_wapi_shm_attach> which
-will start a daemon if one does not exist.
-
-=head1 Internal details
-
-The daemon works by opening a socket and listening to clients. These
-clients send packages over the socket complying to L<struct
-WapiHandleRequest>.
-
-=head2 Possible requests
-
-=over
-
-=item WapiHandleRequest_New
-
-Find a handle in the shared memory segment that is free and allocate
-it to the specified type. To destroy use
-L</WapiHandleRequest_Close>. A L<WapiHandleResponse> with
-.type=WapiHandleResponseType_New will be sent back with .u.new.handle
-set to the handle that was allocated. .u.new.type is the type that was
-requested.
-
-=item WapiHandleRequestType_Open
-
-Increase the ref count of an already created handle. A
-L<WapiHandleResponse> with .type=WapiHandleResponseType_Open will be sent
-back with .u.new.handle set to the handle, .u.new.type is set to the
-type of handle this is.
-
-=item WapiHandleRequestType_Close
-
-Decrease the ref count of an already created handle. A
-L<WapiHandleResponse> with .type=WapiHandleResponseType_Close will be
-sent back with .u.close.destroy set to TRUE if ref count for this
-client reached 0.
-
-=item WapiHandleRequestType_Scratch
-
-Allocate a shared memory area of size .u.scratch.length in bytes. A
-L<WapiHandleResponse> with .type=WapiHandleResponseType_Scratch will be
-sent back with .u.scratch.idx set to the index into the shared
-memory's scratch area where to memory begins. (works just like
-malloc(3))
-
-=item WapiHandleRequestType_Scratch
-
-Deallocate a shared memory area, this must have been allocated before
-deallocating. A L<WapiHandleResponse> with
-.type=WapiHandleResponseType_ScratchFree will be sent back (works just
-like free(3))
-
-=back
-
-=head1 Why a daemon
-
-From an email:
-
-Dennis: I just have one question about the daemon... Why does it
-exist? Isn't it better performancewise to just protect the shared area
-with a mutex when allocation a new handle/shared mem segment or
-changing refcnt? It will however be a less resilient to clients that
-crash (the deamon cleans up ref'd handles if socket closes)
-
-Dick: It's precisely because with a mutex the shared memory segment
-can be left in a locked state. Also, it's not so easy to clean up
-shared memory without it (you can't just mark it deleted when creating
-it, because you can't attach any more readers to the same segment
-after that).  I did some minimal performance testing, and I don't
-think the daemon is particularly slow.
-
-
-=head1 Authors
-
-Documentaion: Dennis Haney
-
-Implementation: Dick Porter
-
-=cut
diff --git a/docs/new-regalloc b/docs/new-regalloc
deleted file mode 100644 (file)
index b687c2b..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-We need to switch to a new register allocator.
-The current one is split in a global and a local register allocator.
-The global one can assign only callee-saves registers and happens
-on the tree-based internal representation: it assigns local variables 
-to hardware registers. 
-The local one happens on the linear representation on a per basic 
-block basis and assigns hard registers to virtual registers (which 
-hold temporary values during expression executions) and it deals also 
-with the platform-specific issues (fixed registers, call conventions).
-
-Moving to a different register will help solve some of the performance 
-issues introduced by the above split, make the register more easily 
-portable and solve some of the issues generated by dealing with trees.
-
-The general design ideas are below.
-
-The new allocator should have a global view of all the method, so it can be
-able to assign variables also to some of the volatile registers if possible,
-even across basic blocks (this would improve performance).
-
-The allocator would be driven by per-arch declarative data, so porting 
-should be easier: an architecture needs to specify register classes,
-call convention and instructions requirements (similar to the gcc code).
-
-The allocator should operate on the linear representation, this way it's 
-easier and faster to track usages more correctly. We need to assign virtual
-registers on a per-method basis instead of per basic block. We can assign 
-virtual registers to variables, too. Note that since we fix the stack offset
-of local vars only after this step (which happens after the burg rules are run),
-some of the burg rules that try to optimize the code won't apply anymore:
-the peephole code may need to be enhanced to do the optimizations instead.
-
-We need to handle floating point registers in the global allocator, too.
-
-The new allocator also needs to keep track precisely of which registers
-contain references or managed pointers to allow us to move to a precise GC.
-
-It may be worth to use a single increasing set of integers for the virtual 
-registers, with the class of the register stored separately (unless the 
-current local allocator which keeps interger and fp registers separate).
-
-Since this is a large task, we need to do it in steps as much as possible. 
-The first is to run the register allocator _after_ the burg rules: this 
-requires a rewrite of the liveness code, too, to use linear indexes instead 
-of basic-block/tree number combinations. This can be done by:
-*) allocating virtual regs to all the locals that can be register allocated
-*) running the burg rules (some may require adjustments): the local virtual 
-registers are assigned starting from global-virt-regs+1, instead of the current
-hardware-regs+1, so we can tell apart global and local virt regs.
-*) running the liveness/whatever code is needed to allocate the global registers
-*) allocate the rest of the local variables to stack slots
-*) continue with the current local allocator
-
-This work could take 2-3 weeks.
-
-The next step is to define the kind of declarative data an architecture needs
-and assigning virtual regs to all the registers and making the allocator
-assign from the volatile registers, too.
-Note that some of the code that is currently emitted in the arch-specific
-code, will need to be emitted as instructions that the reg allocator
-can inspect: think of a method that returns the first argument which is
-received in a register: the current code copies it to either a local slot or
-to a global reg in the prolog an copies it back to the return register
-int he basic block, but since neither the regallocator nor the peephole code
-knows about the prolog code, the first store cannot be optimized away.
-The gcc code has some example of how to specify register classes in a 
-declarative way.
-
diff --git a/docs/opcode-decomp.txt b/docs/opcode-decomp.txt
deleted file mode 100644 (file)
index 48968d1..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-
-* How to handle complex IL opcodes in an arch-independent way
-
-       Many IL opcodes are very simple: add, ldind etc.
-       Such opcodes can be implemented with a single cpu instruction
-       in most architectures (on some, a group of IL instructions
-       can be converted to a single cpu op).
-       There are many IL opcodes, though, that are more complex, but
-       can be expressed as a series of trees or a single tree of
-       simple operations. Such simple operations are architecture-independent.
-       It makes sense to decompose such complex IL instructions in their
-       simpler equivalent so that we gain in several ways:
-       *) porting effort is easier, because only the simple instructions 
-               need to be implemented in arch-specific code
-       *) we could apply BURG rules to the trees and do pattern matching
-               on them to optimize the expressions according to the host cpu
-       
-       The issue is: where do we do such conversion from coarse opcodes to 
-       simple expressions?
-
-* Doing the conversion in method_to_ir ()
-
-       Some of these conversions can certainly be done in method_to_ir (),
-       but it's not always easy to decide which are better done there and 
-       which in a different pass.
-       For example, let's take ldlen: in the mono implementation, ldlen
-       can be simply implemented with a load from a fixed position in the 
-       array object:
-
-               len = [reg + maxlen_offset]
-       
-       However, ldlen carries also semantics information: the result is the
-       length of the array, and since in the CLR arrays are of fixed size,
-       this information can be useful to later do bounds check removal.
-       If we convert this opcode in method_to_ir () we lost some useful
-       information for further optimizations.
-
-       In some other ways, decomposing an opcode in method_to_ir() may
-       allow for better optimizations later on (need to come up with an 
-       example here ...).
-
-* Doing the conversion in inssel.brg
-
-       Some conversion may be done inside the burg rules: this has the 
-       disadvantage that the instruction selector is not run again on
-       the resulting expression tree and we could miss some optimization
-       (this is what effectively happens with the coarse opcodes in the old 
-       jit). This may also interfere with an efficient local register allocator.
-       It may be possible to add an extension in monoburg that allows a rule 
-       such as:
-
-               recheck: LDLEN (reg) {
-                       create an expression tree representing LDLEN
-                       and return it
-               }
-       
-       When the monoburg label process gets back a recheck, it will run
-       the labeling again on the resulting expression tree.
-       If this is possible at all (and in an efficient way) is a 
-       question for dietmar:-)
-       It should be noted, though, that this may not always work, since
-       some complex IL opcodes may require a series of expression trees
-       and handling such cases in monoburg could become quite hairy.
-       For example, think of opcode that need to do multiple actions on the 
-       same object: this basically means a DUP...
-       On the other end, if a complex opcode needs a DUP, monoburg doesn't
-       actually need to create trees if it emits the instructions in
-       the correct sequence and maintains the right values in the registers
-       (usually the values that need a DUP are not changed...). How
-       this integrates with the current register allocator is not clear, since
-       that assigns registers based on the rule, but the instructions emitted 
-       by the rules may be different (this already happens with the current JIT
-       where a MULT is replaced with lea etc...).
-
-* Doing it in a separate pass.
-
-       Doing the conversion in a separate pass over the instructions
-       is another alternative. This can be done right after method_to_ir ()
-       or after the SSA pass (since the IR after the SSA pass should look
-       almost like the IR we get back from method_to_ir ()).
-
-       This has the following advantages:
-       *) monoburg will handle only the simple opcodes (makes porting easier)
-       *) the instruction selection will be run on all the additional trees
-       *) it's easier to support coarse opcodes that produce multiple expression 
-               trees (and apply the monoburg selector on all of them)
-       *) the SSA optimizer will see the original opcodes and will be able to use
-               the semantic info associated with them
-       
-       The disadvantage is that this is a separate pass on the code and
-       it takes time (how much has not been measured yet, though).
-
-       With this approach, we may also be able to have C implementations
-       of some of the opcodes: this pass would insert a function call to 
-       the C implementation (for example in the cases when first porting
-       to a new arch and implemenating some stuff may be too hard in asm).
-
-* Extended basic blocks
-
-       IL code needs a lot of checks, bounds checks, overflow checks,
-       type checks and so on. This potentially increases by a lot
-       the number of basic blocks in a control flow graph. However,
-       all such blocks end up with a throw opcode that gives control to the
-       exception handling mechanism.
-       After method_to_ir () a MonoBasicBlock can be considered a sort
-       of extended basic block where the additional exits don't point
-       to basic blocks in the same procedure (at least when the method
-       doesn't have exception tables).
-       We need to make sure the passes following method_to_ir () can cope
-       with such kinds of extended basic blocks (especially the passes
-       that we need to apply to all the methods: as a start, we could
-       skip SSA optimizations for methods with exception clauses...)
-
diff --git a/docs/reactive-extension-bundle.txt b/docs/reactive-extension-bundle.txt
deleted file mode 100644 (file)
index 175818a..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-With this change, we bundle Reactive Extensions from Microsoft.
-
-Steps to do:
-
-- Until we add submodule, check out Rx sources from http://rx.codeplex.com:
-
-       $ cd external
-       $ git clone git://github.com/atsushieno/rx.git
-       $ cd rx
-       $ git checkout rx-oss-v1.0
-       $ cd ../..
-
-  Note that the original repo at rx.codeplex.com will *fail* on Linux!
-  codeplex.codeplex.com/workitem/26133
-  Also note that rx.codeplex.com is huge and takes very long time to checkout.
-
-- expand rx-mono-changes-3.tar.bz2
-
-       $ tar jxvf rx-mono-changes-3.tar.bz2
-
-- Apply changes to mcs/class/Makefile:
-
-       $ cd mcs/class
-       $ patch -i add-rx-libs.patch -p3
-       $ cd ../..
-
-Then it should be done.
-
-Note that this does not include Mono.Reactive.Testing into the build yet -
-this library depends on nunit.framework.dll but it wouldn't be built before
-this assembly is built. This needs to be resolved.
-
-** Current Status
-
-- We don't have Microsoft.Reactive.Testing.dll. Instead, I created an
-  alternative Mono.Reactive.Testing.dll which *mostly* uses MS sources for
-  that assembly but uses NUnit.Framework instead.
-
-  To make it happen, I added a small script that automatically replaces
-  MSTest dependency parts with that for NUnit (replacer.sh under rx tree).
-
-  (We'll also have to rename namespaces and have more source changes, but
-  so far it is to get things runnable.)
-
-- To check the build sanity, I imported unit tests (as explained above)
-  and it is supposed to run by "make run-test" in Mono.Reactive.Testing
-  directory (the tests were all in one place in MS tests, so I made it
-  in Mono.Reactive.Testing directory instead).
-
diff --git a/docs/release-notes-1.0.html b/docs/release-notes-1.0.html
deleted file mode 100644 (file)
index 9c30543..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<h1>Mono 1.0 Release Notes</h1>
-
-<h2>What does Mono Include</h2>
-
-<h2>Missing functionality</h2>
-
-       <p>COM support.
-
-       <p>EnterpriseServices are non-existant.
-
-       <p>Windows.Forms is only available as a preview, it is not
-       completed nor stable.
-       
-<h3>Assembly: System.Drawing</h3>
-
-       <p>System.Drawing.Printing is not supported.
\ No newline at end of file
diff --git a/docs/stack-alignment b/docs/stack-alignment
deleted file mode 100644 (file)
index da995fb..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-Size and alignment requirements of stack values
-===============================================
-
-P  ... System.IntPtr
-I1 ... System.Int8
-I2 ... System.Int16
-I4 ... System.Int32
-I8 ... System.Int64
-F  ... System.Single
-D  ... System.Double
-LD ... native long double
-
------------------------------------------------------------
-ARCH      |   P |  I1 |  I2 |  I4 |  I8 |  F  |   D |  LD | 
------------------------------------------------------------
-X86       | 4/4 | 4/4 | 4/4 | 4/4 | 8/4 | 4/4 | 8/4 |12/4 |
------------------------------------------------------------
-X86/W32   | 4/4 | 4/4 | 4/4 | 4/4 | 8/4 | 4/4 | 8/4 |12/4 |
------------------------------------------------------------
-ARM       | 4/4 | 4/4 | 4/4 | 4/4 | 8/4 | 4/4 | 8/4 | 8/4 |
------------------------------------------------------------
-M68K      | 4/4 | 4/4 | 4/4 | 4/4 | 8/4 | 4/4 | 8/4 |12/4 |
------------------------------------------------------------
-ALPHA     | 8/8 | 8/8 | 8/8 | 8/8 | 8/8 | 8/8 | 8/8 | 8/8 |
------------------------------------------------------------
-SPARC     | 4/4 | 4/4 | 4/4 | 4/4 | 8/8 | 4/4 | 8/8 |16/8 |
------------------------------------------------------------
-SPARC64   | 8/8 | 8/8 | 8/8 | 8/8 | 8/8 | 8/8 | 8/8 |16/16|
------------------------------------------------------------
-MIPS      | 4/4 | 4/4 | 4/4 | 4/4 | ?/? | 4/4 | 8/8 | 8/8 |
------------------------------------------------------------
-          |     |     |     |     |     |     |     |     |
------------------------------------------------------------
diff --git a/docs/tree-mover.txt b/docs/tree-mover.txt
deleted file mode 100644 (file)
index 3ee836a..0000000
+++ /dev/null
@@ -1,261 +0,0 @@
-
-Purpose
-
-Especially when inlining is active, it can happen that temporary
-variables add pressure to the register allocator, producing bad
-code.
-
-The idea is that some of these temporaries can be totally eliminated
-my moving the MonoInst tree that defines them directly to the use
-point in the code (so the name "tree mover").
-
-Please note that this is *not* an optimization: it is mostly a
-workaround to issues we have in the regalloc.
-Actually, with the new linear IR this will not be possible at all
-(there will be no more trees in the code!).
-Anyway, this workaround turns out to be useful in the current state
-of things...
-
------------------------------------------------------------------------
-
-Base logic
-
-If a local is defined by a value which is a proper expression (a tree
-of MonoInst, not just another local or a constant), and this definition
-is used only once, the tree can be moved directly to the use location,
-and the definition eliminated.
-Of course, none of the variables used in the tree must be defined in
-the code path between the definition and the use, and the tree must be
-free of side effects.
-We do not handle the cases when the tree is just a local or a constant
-because they are handled by copyprop and consprop, respectively.
-
-To make things simpler, we restrict the tree move to the case when:
-- the definition and the use are in the same BB, and
-- the use is followed by another definition in the same BB (it is not
-  possible that the 1st value is used again), or alternatively there
-  is no BB in the whole CFG that contains a use of this local before a
-  definition (so, again, there is no code path that can lead to a
-  subsequent use).
-
-To handle this, we maintain an ACT array (Available Copy Tree, similar
-to the ACP), where we store the "state" of every local.
-Ideally, every local can be in the following state:
-[E] Undefined (by a tree, it could be in the ACP but we don't care).
-[D] Defined (by a tree), and waiting for a use.
-[U] Used, with a tree definition available in the same BB, but still
-    without a definition following the use (always in the same BB).
-Of course state [E] (empty) is the initial one.
-
-Besides, there are two sort of "meta states", or flags:
-[W] Still waiting for a use or definition in this BB (we have seen no
-    occurrence of the local yet).
-[X] Used without being previously defined in the same BB (note that if
-    there is a definition that precedes the use in the same BB, even if
-    the definition is not a tree or is not available because of side
-    effects or because the tree value has changed the local is not in
-    state [X]).
-Also note that state [X] is a sort of "global" condition, which if set
-in one BB will stay valid for the whole CFG, even if the local will
-otherwise change state. The idea of flagging a local as [X] is that if
-there is a definition/use pair that reaches the end of a BB, it could
-be that there is a CFG path that then leads to the BB flagging it as
-[X] (which contains a use), so the tree cannot be moved.
-So state [X] will always be set, and never examined in all the state
-transitions we will describe.
-In practice, we use flag [W] to set state [X]: if, when traversing a
-BB, we find a use for a local in state [W], then that local is flagged
-[X].
-
-
-For each BB, we initialize all states to [E] and [W], and then we
-traverse the code one inst at a time, and update the variable states
-in the ACT in the following ways:
-
-[Definition]
-  - Flag [W] is cleared.
-  - All "affected trees" are killed (go from state [D] to [E]).
-    The "affected trees" are the trees which contain (use) the defined
-    local, and the rationale is that the tree value changed, so the
-    tree is no longer available.
-  - If the local was in state [U], *that* tree move is marked "safe"
-    (because *this* definition makes us sure that the previous tree
-    cannot be used again in any way).
-    The idea is that "safe" moves can happen even if the local is
-    flagged [X], because the second definition "covers" the use.
-    The tree move is then saved in the "todo" list (and the affecting
-    nodes are cleared).
-  - If the local was defined by a tree, it goes to state [D], the tree
-    is recorded, and all the locals used in it are marked as "affecting
-    this tree" (of course these markers are lists, because each local
-    could affect more than one tree).
-
-[IndirectDefinition]
-  - All potentially affected trees (in state [D]) are killed.
-
-[Use]
-  - If the local is still [W], it is flagged [X] (the [W] goes away).
-  - If the local is in state [D], it goes to state [U].
-    The tree move must not yet be recorded in the "todo" list, it still
-    stays in the ACT slot belonging to this local.
-    Anyway, the "affecting" nodes are updated, because now a definition
-    of a local used in this tree will affect only "indirect" (or also
-    "propagated") moves, but not *this* move (see below).
-  - If the local is in state [U], then the tree cannot be moved (it is
-    used two times): the move is canceled, and the state goes [E].
-  - If the local is in state [E], the use is ignored.
-
-[IndirectUse]
-  - All potentially affected trees (in state [D] or [U]) are killed.
-
-[SideEffect]
-  - Tree is marked as "unmovable".
-
-Then, at the end of the BB, for each ACT slot:
-  - If state is [U], the tree move is recorded in the "todo" list, but
-    flagged "unsafe".
-  - Anyway, state goes to [E], the [W] flag is set, and all "affecting"
-    lists are cleared (we get ready to traverse the next BB).
-Finally, when all BBs has been scanned, we traverse the "todo" list,
-moving all "safe" entries, and moving "unsafe" ones only if their ACT
-slot is not flagged [X].
-
-So far, so good.
-But there are two issues that make things harder :-(
-
-The first is the concept of "indirect tree move".
-It can happen that a tree is scheduled for moving, and its destination
-is a use that is located in a second tree, which could also be moved.
-The main issue is that a definition of a variable of the 1st tree on
-the path between the definition and the use of the 2nd one must prevent
-the move.
-But which move? The 1st or the 2nd?
-Well, any of the two!
-The point is, the 2nd move must be prevented *only* if the 1st one
-happens: if it is aborted (for an [X] flag or any other reason), the
-2nd move is OK, and vice versa...
-We must handle this in the following way:
-- The ACT must still remember if a slot is scheduled for moving in
-  this BB, and if it is, all the locals used in the tree.
-  We say that the slot is in state [M].
-  Note that [M] is (like [X] and [W]) a sort of "meta state": a local
-  is flagged [M] when it goes to state [U], and the flag is cleared
-  when the tree move is cancelled
-- A tree that uses a local whose slot is in state [M] is also using all
-  the locals used by the tree in state [M], but the use is "indirect".
-  These use nodes are also included in the "affecting" lists.
-- The definition of a variable used in an "indirect" way has the
-  effect of "linking" the two involved tree moves, saying that only one
-  of the two can happen in practice, but not both.
-- When the 2nd tree is scheduled for moving, the 1st one is *still* in
-  state [M], because a third move could "carry it forward", and all the
-  *three* moves should be mutually exclusive (to be safe!).
-
-The second tricky complication is the "tree forwarding" that can happen
-when copyprop is involved.
-It is conceptually similar to the "indirect tree move".
-Only, the 2nd tree is not really a tree, it is just the local defined
-in the 1st tree move.
-It can happen that copyprop will propagate the definition.
-We cannot make treeprop do the same job of copyprop, because copyprop
-has less constraints, and is therefore more powerful in its scope.
-The main issue is that treeprop cannot propagate a tree to *two* uses,
-while copyprop is perfectly capable of propagating one definition to
-two (or more) different places.
-So we must let copyprop do its job otherwise we'll miss optimizations,
-but we must also make it play safe with treeprop.
-Let's clarify with an example:
-  a = v1 + v2; //a is defined by a tree, state [D], uses v2 and v2
-  b = a; //a is used, state [U] with move scheduled, and
-         //b is defined by a, ACP[b] is a, and b is in state [DC]
-  c = b + v3; // b is used, goes to state [U]
-The real trouble is that copyprop happens *immediately*, while treeprop
-is deferred to the end of the CFG traversal.
-So, in the 3rd statement, the "b" is immediately turned into an "a" by
-copyprop, regardless of what treeprop will do.
-Anyway, if we are careful, this is not so bad.
-First of all, we must "accept" the fact that in the 3rd statement the
-"b" is in fact an "a", as treeprop must happen *after* copyprop.
-The real problem is that "a" is used twice: in the 2nd and 3rd lines.
-In our usual setup, the 2nd line would set it to [U], and the 3rd line
-would kill the move (and set "a" to [E]).
-I have tried to play tricks, and reason as of copyprop didn't happen,
-but everything becomes really messy.
-Instead, we should note that the 2nd line is very likely to be dead.
-At least in this BB, copyprop will turn all "b"s into "a"s as long as
-it can, and when it cannot, it will be because either "a" or "b" have
-been redefined, which would be after the tree move anyway.
-So, the reasoning gets different: let's pretend that "b" will be dead.
-This will make the "a" use in the 2nd statement useless, so there we
-can "reset" "a" to [D], but also take note that if "b" will end up
-not being dead, the tree move associated to this [D] must be aborted.
-We can detect this in the following way:
-- Either "b" is used before being defined in this BB, or
-- It will be flagged "unsafe".
-Both things are very easy to check.
-The only quirk is that the "affecting" lists must not be cleared when
-a slot goes to state [U], because a "propagation" could put it back
-to state [D] (where those lists are needed, because it can be killed
-by a definition to a used slot).
-
------------------------------------------------------------------------
-
-Implementation notes
-
-All the implementation runs inside the existing mono_local_cprop
-function, and a separate memory pool is used to hold the temporary
-data.
-
-A struct, MonoTreeMover, contains the pointers to the pool, the ACT,
-the list of scheduled moves and auxiliary things.
-This struct is allocated if the tree move pass is requested, and is
-then passed along to all the involved functions, which are therefore
-aware of the tree mover state.
-
-The ACT is an array of slots, obviously one per local.
-Each slot is of type MonoTreeMoverActSlot, and contains the used and
-affected locals, a pointer to the pending tree move and the "waiting"
-and "unsafe" flags.
-
-The "affecting" lists a built from "dependency nodes", of type
-MonoTreeMoverDependencyNode.
-Each of the nodes contains the used and affected local, and is in
-two lists: the locals used by a slot, and the locals affected by a
-slot (obviously a different one).
-So, each node means: "variable x is used in tree t, so a definition
-of x affects tree t".
-The "affecting" lists are doubly linked, to allow for O(1) deletion.
-The "used" lists are simply linked, but when they are mantained there
-is always a pointer to the last element to allow for O(1) list moving.
-When a used list is dismissed (which happens often, any time a node is
-killed), its nodes are unlinked from their respective affecting lists
-and are then put in a "free" list in the MonoTreeMover to be reused.
-
-Each tree move is represented by a struct (MonoTreeMoverTreeMove),
-which contains:
-- the definition and use points,
-- the "affected" moves (recall the concept of "indirect tree move"),
-- the "must be dead" slots (recall "tree forwarding"). and
-- a few utility flags.
-The tree moves stays in the relevant ACT slot until it is ready to be
-scheduled for moving, at which point it is put in a list in the
-MonoTreeMover.
-The tree moves structs are reused when they are killed, so there is
-also a "free" list for them in the MonoTreeMover.
-
-The tree mover code has been added to all the relevant functions that
-participate in consprop and copyprop, particularly:
-- mono_cprop_copy_values takes care of variable uses (transitions from
-  states [D] to [U] and [U] to [E] because of killing),
-- mono_cprop_invalidate_values takes care of side effects (indirect
-  accesses, calls...),
-- mono_local_cprop_bb sets up and cleans the traversals for each BB,
-  and for each MonoInst it takes care of variable definitions.
-To each of them has been added a MonoTreeMover parameter, which is not
-NULL if the tree mover is running.
-After mono_local_cprop_bb has run for all BBs, the MonoTreeMover has
-the list of all the pending moves, which must be walked to actually
-perform the moves (when possible, because "unsafe" flags, "affected"
-moves and "must be dead" slots can still have their effects, which
-must be handled now because they are fully known only at the end of
-the CFG traversal).
index 4abf9a74bd9a807380ba8f55a73b322625e15565..7120b21603354fced392a43ab7c581d0114fecac 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 4abf9a74bd9a807380ba8f55a73b322625e15565
+Subproject commit 7120b21603354fced392a43ab7c581d0114fecac
index d589df6e8a206e28b84304a75917006a0e076c29..061a13cc772ef15f4d5528eb84fea4d51d4bda1d 160000 (submodule)
@@ -1 +1 @@
-Subproject commit d589df6e8a206e28b84304a75917006a0e076c29
+Subproject commit 061a13cc772ef15f4d5528eb84fea4d51d4bda1d
index 23a693e927c1191a5c9857d46bcca7a456f59fa5..6507f55cbbc341166ffac92948cd7757eb26e3bf 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 23a693e927c1191a5c9857d46bcca7a456f59fa5
+Subproject commit 6507f55cbbc341166ffac92948cd7757eb26e3bf
index 04100342a006edfa0e3f4a28ff0a730667868acb..b80ffd0457f9fad271952beb31a7389830f52319 100644 (file)
@@ -20,6 +20,26 @@ revocation lists (CRL) or certificate trust lists (CTL) to/from a
 certificate store. Certificate stores are used to build and validate 
 certificate chains for Authenticode(r) code signing validation and SSL 
 server certificates.
+.SH STORES
+The 
+.I store
+represents the certificate store to use.   It can be one of the
+following:
+.TP
+.I "My"
+This is the personal certificate store.
+.TP
+.I "AddressBook"
+This is the store for other people.
+.TP
+.I "CA"
+This is a store for intermediate certificate authorities.
+.TP
+.I "Trust"
+This is for trusted roots.
+.TP
+.I "Disallowed"
+This is for untrusted roots
 .SH ACTIONS
 .TP
 .I "-list"
index 14221a83c1020153fa696e6313ccc290d45c6cd8..a193f9f0850006c9b1bc6e636ff8e412ab14fb75 100644 (file)
--- a/man/mcs.1
+++ b/man/mcs.1
@@ -249,29 +249,6 @@ This will instruct the compiler to reference the System.* libraries
 available on a typical dotnet framework installation, notice that this
 does not include all of the Mono libraries, only the System.* ones.  This
 is a convenient shortcut for those porting code.
-.TP
-.I \-pkg:olive
-Use this to reference the "Olive" libraries (the 3.0 and 3.5 extended
-libraries).
-.TP
-.I \-pkg:silver
-References the assemblies for creating Moonlight/Silverlight
-applications.
-.TP
-.I \-pkg:silverdesktop
-Use this option to create Moonlight/Silverlight applications that
-target the desktop.   This option allows developers to consume the
-Silverlight APIs with the full 2.0 profile API available to them,
-unlike 
-.I smcs 
-it gives full access to all the APIs that are part of Mono.  The only
-downside is that applications created with silverdesktop will not run
-on the browser.   Typically these applications will be launched
-with the 
-.I mopen
-command line tool.
-.TP
-For more details see the PACKAGE section in this document
 .ne
 .RE
 .TP
index 17ec6e294460d086b2082f88c209996ff536c1cb..fc49f3b90653115d573561dd3f39bf3fe6b2fd96 100644 (file)
@@ -1129,9 +1129,16 @@ to 100 percent.  A value of 0 turns evacuation off.
 .TP
 \fB(no-)lazy-sweep\fR
 Enables or disables lazy sweep for the Mark&Sweep collector.  If
-enabled, the sweep phase of the garbage collection is done piecemeal
-whenever the need arises, typically during nursery collections.  Lazy
-sweeping is enabled by default.
+enabled, the sweeping of individual major heap blocks is done
+piecemeal whenever the need arises, typically during nursery
+collections.  Lazy sweeping is enabled by default.
+.TP
+\fB(no-)concurrent-sweep\fR
+Enables or disables concurrent sweep for the Mark&Sweep collector.  If
+enabled, the iteration of all major blocks to determine which ones can
+be freed and which ones have to be kept and swept, is done
+concurrently with the running program.  Concurrent sweeping is enabled
+by default.
 .TP
 \fBstack-mark=\fImark-mode\fR
 Specifies how application threads should be scanned. Options are
@@ -1462,6 +1469,12 @@ include "clearlooks", "nice" and "win32".
 .Sp
 The default is "win32".  
 .TP
+\fBMONO_THREAPOOL\fR
+This environment variable can be used to choose the implementation of
+the ThreadPool used at runtime.  By default this uses the long term
+Mono threadpool implementation.   But a new "microsoft" value switches
+the threadpool implementation to Microsoft's CoreCLR/ReferenceSource implementation.
+.TP
 \fBMONO_TLS_SESSION_CACHE_TIMEOUT\fR
 The time, in seconds, that the SSL/TLS session cache will keep it's entry to
 avoid a new negotiation between the client and a server. Negotiation are very
index cbcfdcc3e0bfbd4f606ea0fb83e24e35c00db1da..b94a7c82d6ef8fd1749bb78b10cbcb38e4a840d8 100644 (file)
@@ -12,7 +12,7 @@ monotouch_runtime_SUBDIRS := build class
 xammac_SUBDIRS := build class
 mobile_SUBDIRS := build class
 mobile_static_SUBDIRS := build class
-net_4_0_SUBDIRS := build class
+binary_reference_assemblies_SUBDIRS := build class
 net_4_5_SUBDIRS := build mcs class nunit24 ilasm tools tests errors docs
 xbuild_12_SUBDIRS := build class tools/xbuild
 xbuild_14_SUBDIRS := build class tools/xbuild
@@ -30,7 +30,7 @@ dir-check:
 
 # fun specialty targets
 
-PROFILES = net_4_5 net_4_0 xbuild_12 xbuild_14
+PROFILES = net_4_5 binary_reference_assemblies xbuild_12 xbuild_14
 
 .PHONY: all-profiles $(STD_TARGETS:=-profiles)
 all-profiles $(STD_TARGETS:=-profiles): %-profiles: profiles-do--%
@@ -51,7 +51,7 @@ profiles-do--run-test:
 _boot_ = all clean install
 $(_boot_:%=profile-do--xbuild_14--%):         profile-do--xbuild_14--%:         profile-do--net_4_5--%
 $(_boot_:%=profile-do--xbuild_12--%):         profile-do--xbuild_12--%:         profile-do--net_4_5--%
-$(_boot_:%=profile-do--net_4_0--%):           profile-do--net_4_0--%:           profile-do--build--%
+$(_boot_:%=profile-do--binary_reference_assemblies--%):           profile-do--binary_reference_assemblies--%:           profile-do--build--%
 $(_boot_:%=profile-do--net_4_5--%):           profile-do--net_4_5--%:           profile-do--build--%
 $(_boot_:%=profile-do--monodroid--%):         profile-do--monodroid--%:         profile-do--build--%
 $(_boot_:%=profile-do--monotouch--%):         profile-do--monotouch--%:         profile-do--build--%
index 8ca1e7c7fa257ad5fd1c95d5afcf1c3566940838..e6d2d0a68afacb7f7ae7b6d2aa6402fc0707c015 100644 (file)
@@ -18,7 +18,7 @@ PLATFORMS = darwin linux win32
 PROFILES = \
        basic \
        build \
-       net_4_0 \
+       binary_reference_assemblies \
        net_4_5 \
        xbuild_12 \
        xbuild_14
index 2a147b946039adc276dcb79c8623868b2f581847..836910f2ecf21ac2833f2f601287dd061b5e12ca 100644 (file)
@@ -9,8 +9,10 @@ static class AssemblyRef
        public const string EcmaPublicKey = "b77a5c561934e089";
 #if NET_2_1
        public const string FrameworkPublicKeyFull = "0024000004800000940000000602000000240000525341310004000001000100B5FC90E7027F67871E773A8FDE8938C81DD402BA65B9201D60593E96C492651E889CC13F1415EBB53FAC1131AE0BD333C5EE6021672D9718EA31A8AEBD0DA0072F25D87DBA6FC90FFD598ED4DA35E44C398C454307E8E33B8426143DAEC9F596836F97C8F74750E5975C64E2189F45DEF46B2A2B1247ADC3652BF5C308055DA9";
+       public const string FrameworkPublicKeyFull2 = "00240000048000009400000006020000002400005253413100040000010001008D56C76F9E8649383049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B37AB";
 #else
        public const string FrameworkPublicKeyFull = "00000000000000000400000000000000";
+       public const string FrameworkPublicKeyFull2 = "00000000000000000400000000000000";
 #endif
        public const string MicrosoftPublicKey = "b03f5f7f11d50a3a";
  
diff --git a/mcs/build/profiles/binary_reference_assemblies.make b/mcs/build/profiles/binary_reference_assemblies.make
new file mode 100644 (file)
index 0000000..d50e674
--- /dev/null
@@ -0,0 +1,7 @@
+# -*- makefile -*-
+
+profile-check:
+       @:
+
+NO_BUILD = yes
+NO_TEST = yes
diff --git a/mcs/build/profiles/net_4_0.make b/mcs/build/profiles/net_4_0.make
deleted file mode 100644 (file)
index 83e22c4..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-# -*- makefile -*-
-
-profile-check:
-       @:
-
-FRAMEWORK_VERSION = 4.0
-XBUILD_VERSION = 4.0
-
-LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)
-
-NO_BUILD = yes
-NO_TEST = yes
index 3fb4b16a43528bc50955432f52eb232e5a016e8d..a088678a7fb96c382503db951a7ce8a31e7bc692 100644 (file)
 //[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.CustomQueryInterfaceMode))]
 //[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.CustomQueryInterfaceResult))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.DefaultCharSetAttribute))]
-//[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.DefaultDllImportSearchPathsAttribute))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.DefaultDllImportSearchPathsAttribute))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.DefaultParameterValueAttribute))]
 //[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.DispatchWrapper))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.DispIdAttribute))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.DllImportAttribute))]
-//[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.DllImportSearchPath))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.DllImportSearchPath))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.GCHandle))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.GCHandleType))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.GuidAttribute))]
index cb92002d7bff765ab6f3095a7de81d1bdbea1a69..5e3a041c1e2dd789b1567efd256b78e769d16765 100644 (file)
@@ -26,6 +26,8 @@ mobile_common_dirs := \
        Mono.Security   \
        System  \
        I18N            \
+       System.ServiceModel.Internals   \
+       SMDiagnostics   \
        System.Runtime.Serialization    \
        System.Xml.Linq \
        System.ServiceModel     \
@@ -221,7 +223,7 @@ monotouch_runtime_SUBDIRS := $(monotouch_runtime_dirs)
 mobile_static_SUBDIRS := $(mobile_static_dirs)
 mobile_SUBDIRS := $(mobile_dynamic_dirs)
 xammac_SUBDIRS := $(xammac_dirs)
-net_4_0_SUBDIRS := reference-assemblies
+binary_reference_assemblies_SUBDIRS := reference-assemblies
 net_4_5_SUBDIRS := $(net_4_5_dirs) $(xbuild_4_0_dirs)
 net_4_5_PARALLEL_SUBDIRS := $(net_4_5_parallel_dirs) aot-compiler
 xbuild_12_SUBDIRS := $(xbuild_4_0_dirs)
@@ -252,6 +254,7 @@ DISTFILES = \
        doc/TemplateTest.cs     \
        notes/BitVecto32.txt    \
        MicrosoftAjaxLibrary/License.htm        \
+       test-helpers/NetworkHelpers.cs  \
        $(monolite_files)
 
 .PHONY: all-local $(STD_TARGETS:=-local)
index bc3a5fbd15e28492432797d72828bc09af43db7f..c81a12d6e773d9b8af05a675591a09e8e2ad2d47 100644 (file)
@@ -91,6 +91,12 @@ namespace Microsoft.Build.Tasks {
                                else
                                        commandLine.AppendSwitch ("/optionstrict-");
 
+                       if (Bag ["OptionInfer"] != null)
+                               if (OptionInfer)
+                                       commandLine.AppendSwitch ("/optioninfer+");
+                               else
+                                       commandLine.AppendSwitch ("/optioninfer-");
+
                        // OptionStrictType
                        
                        // Platform
@@ -114,6 +120,9 @@ namespace Microsoft.Build.Tasks {
                        commandLine.AppendSwitchIfNotNull ("/sdkpath:", SdkPath);
 
                        // TargetCompactFramework
+
+                       if (String.Compare (VBRuntime, "Embed", StringComparison.OrdinalIgnoreCase) == 0) 
+                               commandLine.AppendSwitch ("/vbruntime*");
                        
                        // Verbosity
 
@@ -272,6 +281,12 @@ namespace Microsoft.Build.Tasks {
                        get { return (string) Bag ["OptionStrictType"]; }
                        set { Bag ["OptionStrictType"] = value; }
                }
+
+               [MonoTODO]
+               public bool OptionInfer {
+                       get { return GetBoolParameterWithDefault ("OptionInfer", false); }
+                       set { Bag ["OptionInfer"] = value; }
+               }
                
                [MonoTODO]
                public string Platform {
@@ -316,6 +331,12 @@ namespace Microsoft.Build.Tasks {
                        set { Bag ["UseHostCompilerIfAvailable"] = value; }
                }
 
+               [MonoTODO]
+               public string VBRuntime {
+                       get { return (string) Bag ["VBRuntime"]; }
+                       set { Bag ["VBRuntime"] = value; }
+               }
+
                [MonoTODO]
                public string Verbosity {
                        get { return (string) Bag ["Verbosity"]; }
diff --git a/mcs/class/Mono.Parallel/Mono.Collections.Concurrent/ConcurrentOrderedList.cs b/mcs/class/Mono.Parallel/Mono.Collections.Concurrent/ConcurrentOrderedList.cs
new file mode 100644 (file)
index 0000000..0d0ba10
--- /dev/null
@@ -0,0 +1,338 @@
+// ConcurrentOrderedList.cs
+//
+// Copyright (c) 2010 Jérémie "Garuma" Laval
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+//
+
+
+using System;
+using System.Threading;
+using System.Collections;
+using System.Collections.Generic;
+using System.Runtime.Serialization;
+
+#if INSIDE_MONO_PARALLEL
+using System.Collections.Concurrent;
+
+namespace Mono.Collections.Concurrent
+#else
+namespace System.Collections.Concurrent
+#endif
+{
+#if INSIDE_MONO_PARALLEL
+       public
+#endif
+       class ConcurrentOrderedList<T>: ICollection<T>, IEnumerable<T>
+       {
+               class Node
+               {
+                       public T Data;
+                       public int Key;
+                       public Node Next;
+                       public bool Marked;                
+
+                       public Node ()
+                       {
+
+                       }
+
+                       public Node (Node wrapped)
+                       {
+                               Marked = true;
+                               Next = wrapped;
+                       }
+               }
+
+               Node head;
+               Node tail;
+
+               IEqualityComparer<T> comparer;
+
+               int count;
+
+               public ConcurrentOrderedList () : this (EqualityComparer<T>.Default)
+               {
+                       
+               }
+
+               public ConcurrentOrderedList (IEqualityComparer<T> comparer)
+               {
+                       if (comparer == null)
+                               throw new ArgumentNullException ("comparer");
+
+                       this.comparer = comparer;
+
+                       head = new Node ();
+                       tail = new Node ();
+                       head.Next = tail;
+               }
+
+               public bool TryAdd (T data)
+               {
+                       Node node = new Node ();
+                       node.Data = data;
+                       node.Key = comparer.GetHashCode (data);
+
+                       if (ListInsert (node)) {
+                               Interlocked.Increment (ref count);
+                               return true;
+                       }
+
+                       return false;
+               }
+
+               public bool TryRemove (T data)
+               {
+                       T dummy;
+                       return TryRemoveHash (comparer.GetHashCode (data), out dummy);
+               }
+
+               public bool TryRemoveHash (int key, out T data)
+               {
+                       if (ListDelete (key, out data)) {
+                               Interlocked.Decrement (ref count);
+                               return true;
+                       }
+
+                       return false;
+               }
+
+               public bool TryPop (out T data)
+               {
+                       return ListPop (out data);
+               }
+
+               public bool Contains (T data)
+               {
+                       return ContainsHash (comparer.GetHashCode (data));
+               }
+
+               public bool ContainsHash (int key)
+               {
+                       Node node;
+
+                       if (!ListFind (key, out node))
+                               return false;
+
+                       return true;
+
+               }
+
+               public bool TryGetFromHash (int key, out T data)
+               {
+                       data = default (T);
+                       Node node;
+
+                       if (!ListFind (key, out node))
+                               return false;
+
+                       data = node.Data;
+                       return true;
+               }
+
+               public void Clear ()
+               {
+                       head.Next = tail;
+               }
+
+               public void CopyTo (T[] array, int startIndex)
+               {
+                       if (array == null)
+                               throw new ArgumentNullException ("array");
+                       if (startIndex < 0)
+                               throw new ArgumentOutOfRangeException ("startIndex");
+                       if (count > array.Length - startIndex)
+                               throw new ArgumentException ("array", "The number of elements is greater than the available space from startIndex to the end of the destination array.");
+
+                       foreach (T item in this) {
+                               if (startIndex >= array.Length)
+                                       break;
+
+                               array[startIndex++] = item;
+                       }
+               }
+
+               public IEqualityComparer<T> Comparer {
+                       get {
+                               return comparer;
+                       }
+               }
+
+               public int Count {
+                       get {
+                               return count;
+                       }
+               }
+
+               Node ListSearch (int key, ref Node left)
+               {
+                       Node leftNodeNext = null, rightNode = null;
+
+                       do {
+                               Node t = head;
+                               Node tNext = t.Next;
+                               do {
+                                       if (!tNext.Marked) {
+                                               left = t;
+                                               leftNodeNext = tNext;
+                                       }
+                                       t = tNext.Marked ? tNext.Next : tNext;
+                                       if (t == tail)
+                                               break;
+                                       
+                                       tNext = t.Next;
+                               } while (tNext.Marked || t.Key < key);
+
+                               rightNode = t;
+                               
+                               if (leftNodeNext == rightNode) {
+                                       if (rightNode != tail && rightNode.Next.Marked)
+                                               continue;
+                                       else 
+                                               return rightNode;
+                               }
+                               
+                               if (Interlocked.CompareExchange (ref left.Next, rightNode, leftNodeNext) == leftNodeNext) {
+                                       if (rightNode != tail && rightNode.Next.Marked)
+                                               continue;
+                                       else
+                                               return rightNode;
+                               }
+                       } while (true);
+               }
+
+               bool ListDelete (int key, out T data)
+               {
+                       Node rightNode = null, rightNodeNext = null, leftNode = null;
+                       data = default (T);
+                       
+                       do {
+                               rightNode = ListSearch (key, ref leftNode);
+                               if (rightNode == tail || rightNode.Key != key)
+                                       return false;
+
+                               data = rightNode.Data;
+                               
+                               rightNodeNext = rightNode.Next;
+                               if (!rightNodeNext.Marked)
+                                       if (Interlocked.CompareExchange (ref rightNode.Next, new Node (rightNodeNext), rightNodeNext) == rightNodeNext)
+                                               break;
+                       } while (true);
+                       
+                       if (Interlocked.CompareExchange (ref leftNode.Next, rightNodeNext, rightNode) != rightNodeNext)
+                               ListSearch (rightNode.Key, ref leftNode);
+                       
+                       return true;
+               }
+
+               bool ListPop (out T data)
+               {
+                       Node rightNode = null, rightNodeNext = null, leftNode = head;
+                       data = default (T);
+
+                       do {
+                               rightNode = head.Next;
+                               if (rightNode == tail)
+                                       return false;
+
+                               data = rightNode.Data;
+
+                               rightNodeNext = rightNode.Next;
+                               if (!rightNodeNext.Marked)
+                                       if (Interlocked.CompareExchange (ref rightNode.Next, new Node (rightNodeNext), rightNodeNext) == rightNodeNext)
+                                               break;
+                       } while (true);
+
+                       if (Interlocked.CompareExchange (ref leftNode.Next, rightNodeNext, rightNode) != rightNodeNext)
+                               ListSearch (rightNode.Key, ref leftNode);
+
+                       return true;
+               }
+               
+               bool ListInsert (Node newNode)
+               {
+                       int key = newNode.Key;
+                       Node rightNode = null, leftNode = null;
+                       
+                       do {
+                               rightNode = ListSearch (key, ref leftNode);
+                               if (rightNode != tail && rightNode.Key == key)
+                                       return false;
+                               
+                               newNode.Next = rightNode;
+                               if (Interlocked.CompareExchange (ref leftNode.Next, newNode, rightNode) == rightNode)
+                                       return true;
+                       } while (true);
+               }
+               
+               bool ListFind (int key, out Node data)
+               {
+                       Node rightNode = null, leftNode = null;
+                       data = null;
+                       
+                       data = rightNode = ListSearch (key, ref leftNode);
+                       
+                       return rightNode != tail && rightNode.Key == key;
+               }
+
+               IEnumerator<T> IEnumerable<T>.GetEnumerator ()
+               {
+                       return GetEnumeratorInternal ();
+               }
+
+               IEnumerator IEnumerable.GetEnumerator ()
+               {
+                       return GetEnumeratorInternal ();
+               }
+
+               IEnumerator<T> GetEnumeratorInternal ()
+               {
+                       Node node = head.Next;
+
+                       while (node != tail) {
+                               while (node.Marked) {
+                                       node = node.Next;
+                                       if (node == tail)
+                                               yield break;
+                               }
+                               yield return node.Data;
+                               node = node.Next;
+                       }
+               }
+
+               bool ICollection<T>.IsReadOnly {
+                       get {
+                               return false;
+                       }
+               }
+
+               void ICollection<T>.Add (T item)
+               {
+                       TryAdd (item);
+               }
+
+               bool ICollection<T>.Remove (T item)
+               {
+                       return TryRemove (item);
+               }
+       }
+}
+
index 7ecbf05dd9f36854bb1270f3e2a13c8861090c19..cddaa437481ff1f34019d737821ea6303be57eea 100644 (file)
@@ -2,12 +2,12 @@
 ../../build/common/Locale.cs
 Assembly/AssemblyInfo.cs
 Mono.Collections.Concurrent/ConcurrentSkipList.cs
+Mono.Collections.Concurrent/ConcurrentOrderedList.cs
 Mono.Threading/CSnzi.cs
 Mono.Threading/Snzi.cs
 Mono.Threading/SpinLockWrapper.cs
 Mono.Threading/ReaderWriterLockSlimmer.cs
 Mono.Threading/AtomicBoolean.cs
-../corlib/System.Collections.Concurrent/ConcurrentOrderedList.cs
 Mono.Threading.Tasks/CyclicDeque.cs
 Mono.Threading.Tasks/IConcurrentDeque.cs
 Mono.Threading.Tasks/PopResult.cs
index ca6c2b16c8ab574d727993bffc302c43de8646b4..78cda036a91de106a1427240c2534240bf148dd9 100644 (file)
@@ -154,7 +154,7 @@ namespace Mono.Security.Cryptography {
                                throw new ArgumentOutOfRangeException ("inputCount", "< 0");
                        // ordered to avoid possible integer overflow
                        if (inputOffset > inputBuffer.Length - inputCount)
-                               throw new ArgumentException ("inputBuffer", Locale.GetText ("Overflow"));
+                               throw new ArgumentException (Locale.GetText ("Overflow"), "inputBuffer");
                }
 
                public int TransformBlock (byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset) 
@@ -167,7 +167,7 @@ namespace Mono.Security.Cryptography {
                                throw new ArgumentOutOfRangeException ("outputOffset", "< 0");
                        // ordered to avoid possible integer overflow
                        if (outputOffset > outputBuffer.Length - inputCount)
-                               throw new ArgumentException ("outputBuffer", Locale.GetText ("Overflow"));
+                               throw new ArgumentException (Locale.GetText ("Overflow"), "outputBuffer");
 
                        return InternalTransformBlock (inputBuffer, inputOffset, inputCount, outputBuffer, outputOffset);
                }
diff --git a/mcs/class/SMDiagnostics/Assembly/AssemblyInfo.cs b/mcs/class/SMDiagnostics/Assembly/AssemblyInfo.cs
new file mode 100644 (file)
index 0000000..e83ceb3
--- /dev/null
@@ -0,0 +1,58 @@
+//
+// AssemblyInfo.cs
+//
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Reflection;
+using System.Resources;
+using System.Security;
+using System.Security.Permissions;
+using System.Diagnostics;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+[assembly: AssemblyTitle ("SMDiagnostics.dll")]
+[assembly: AssemblyDescription ("Contains share code for some System.ServiceModel libraries")]
+[assembly: AssemblyDefaultAlias ("System.ServiceModel.dll")]
+
+[assembly: AssemblyInformationalVersion (Consts.FxFileVersion)]
+[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
+
+[assembly: NeutralResourcesLanguage ("en-US")]
+[assembly: CLSCompliant (true)]
+[assembly: AssemblyDelaySign (true)]
+#if NET_2_1
+[assembly: AssemblyKeyFile ("../winfx.pub")]
+#else
+[assembly: AssemblyKeyFile ("../ecma.pub")]
+[assembly: AllowPartiallyTrustedCallers]
+[assembly: ComCompatibleVersion (1, 0, 3300, 0)]
+[assembly: SecurityCritical (SecurityCriticalScope.Explicit)]
+#endif
+[assembly: InternalsVisibleTo ("System.Runtime.Serialization, PublicKey=" + AssemblyRef.FrameworkPublicKeyFull)]
+[assembly: InternalsVisibleTo ("System.IdentityModel, PublicKey=" + AssemblyRef.FrameworkPublicKeyFull)]
+[assembly: InternalsVisibleTo ("System.IdentityModel.Selectors, PublicKey=" + AssemblyRef.FrameworkPublicKeyFull)]
+[assembly: InternalsVisibleTo ("System.ServiceModel, PublicKey=" + AssemblyRef.FrameworkPublicKeyFull)]
+[assembly: InternalsVisibleTo ("System.ServiceModel.Web, PublicKey=" + AssemblyRef.FrameworkPublicKeyFull)]
+
+[assembly: ComVisible (false)]
+
diff --git a/mcs/class/SMDiagnostics/Makefile b/mcs/class/SMDiagnostics/Makefile
new file mode 100644 (file)
index 0000000..685d7f5
--- /dev/null
@@ -0,0 +1,18 @@
+thisdir = class/SMDiagnostics
+SUBDIRS = 
+include ../../build/rules.make
+
+LIBRARY = SMDiagnostics.dll
+LIB_REFS = System System.Core System.Xml System.ServiceModel.Internals
+LIB_MCS_FLAGS =
+ifneq (2.1, $(FRAMEWORK_VERSION))
+       LIB_REFS += System.Configuration
+else
+       LIB_MCS_FLAGS += -d:NO_CONFIGURATION
+endif
+
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
+
+EXTRA_DISTFILES = 
+
+include ../../build/library.make
diff --git a/mcs/class/SMDiagnostics/ReferenceSources/TraceSR.cs b/mcs/class/SMDiagnostics/ReferenceSources/TraceSR.cs
new file mode 100644 (file)
index 0000000..6a979da
--- /dev/null
@@ -0,0 +1,35 @@
+using System.Globalization;
+
+static partial class TraceSR
+{
+       public const string ThrowingException = "throwing exception.";
+       public const string StringNullOrEmpty = "Argument string is null or empty.";
+       public const string GenericCallbackException = "Callback exception has occured.";
+       public const string TraceHandledException = "Trace handled exception.";
+       public const string TraceCodeTraceTruncatedQuotaExceeded = "TraceTruncatedQuotaExceeded";
+       public const string TraceCodeAppDomainUnload = "AppDomainUnload";
+       public const string UnhandledException = "Unhandled exception.";
+       public const string TraceCodeEventLog = "EventLog";
+       public const string WriteCharsInvalidContent = "invalid content.";
+
+       internal static string GetString(string name, params object[] args)
+       {
+               return GetString (CultureInfo.InvariantCulture, name, args);
+       }
+
+       internal static string GetString(CultureInfo culture, string name, params object[] args)
+       {
+               return string.Format (culture, name, args);
+       }
+
+       internal static string GetString(string name)
+       {
+               return name;
+       }
+
+       internal static string GetString(CultureInfo culture, string name)
+       {
+               return name;
+       }
+}
+
diff --git a/mcs/class/SMDiagnostics/SMDiagnostics.dll.sources b/mcs/class/SMDiagnostics/SMDiagnostics.dll.sources
new file mode 100644 (file)
index 0000000..6bf6f6a
--- /dev/null
@@ -0,0 +1,25 @@
+../../build/common/Consts.cs
+../../build/common/Locale.cs
+../../build/common/SR.cs
+
+Assembly/AssemblyInfo.cs
+ReferenceSources/TraceSR.cs
+
+../../../external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/Activity.cs
+../../../external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/DiagnosticsTraceCode.cs
+../../../external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/DiagnosticStrings.cs
+../../../external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/DiagnosticTraceSource.cs
+../../../external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/EncodingFallbackAwareXmlTextWriter.cs
+../../../external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/EventLogCategory.cs
+../../../external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/EventLogEventId.cs
+../../../external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/EventLogger.cs
+../../../external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/ExceptionUtility.cs
+../../../external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/LegacyDiagnosticTrace.cs
+../../../external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/MachineSettingsSection.cs
+../../../external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/NativeMethods.cs
+../../../external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/PiiTraceSource.cs
+../../../external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/PlainXmlWriter.cs
+../../../external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/SafeEventLogWriteHandle.cs
+../../../external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/TraceSourceKind.cs
+../../../external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/TraceXPathNavigator.cs
+../../../external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/Utility.cs
index 26520536f945aaf20cbf2b9b7deb3447f311c4e7..c1bb3ed418613b3b90d0caaa530f6688e75a31f2 100644 (file)
@@ -1 +1,7 @@
 y.output
+/gen_OdbcConnection.cs
+/gen_OdbcParameter.cs
+/gen_OdbcParameterCollection.cs
+/gen_OleDbConnection.cs
+/gen_OleDbParameter.cs
+/gen_OleDbParameterCollection.cs
\ No newline at end of file
index 65930ef17203b2116140f052dc7cb0f761705d22..55252a3c447e72929a69a6ec485f9675554d4d8a 100644 (file)
@@ -61,7 +61,6 @@ using System.Runtime.InteropServices;
        [assembly: AssemblyKeyFile("../ecma.pub")]
 
 [assembly: AssemblyFileVersion (Consts.FxFileVersion)]
-[assembly: ComCompatibleVersion (1, 0, 3300, 0)]
 [assembly: InternalsVisibleTo ("System.Data.DataSetExtensions, PublicKey=" + AssemblyRef.FrameworkPublicKeyFull)]
 [assembly: InternalsVisibleTo ("System.Design, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
 [assembly: InternalsVisibleTo ("System.Web, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
index cf6c782316c92fa7ef62cb0f5bb9d63bdfe67a28..4e86efd946f000aa15d5f900253daaf5cd9ae6d7 100644 (file)
@@ -63,7 +63,6 @@
 ../../../external/referencesource/System.Data/System/Data/Common/MultipartIdentifier.cs
 ../../../external/referencesource/System.Data/System/Data/Common/NameValuePair.cs
 ../../../external/referencesource/System.Data/System/Data/Common/NameValuePermission.cs
-../../../external/referencesource/System.Data/System/Data/Common/NativeMethods.cs
 ../../../external/referencesource/System.Data/System/Data/Common/ObjectStorage.cs
 ../../../external/referencesource/System.Data/System/Data/Common/RowUpdatedEventArgs.cs
 ../../../external/referencesource/System.Data/System/Data/Common/RowUpdatingEventArgs.cs
diff --git a/mcs/class/System.ServiceModel.Internals/Assembly/AssemblyInfo.cs b/mcs/class/System.ServiceModel.Internals/Assembly/AssemblyInfo.cs
new file mode 100644 (file)
index 0000000..649dd19
--- /dev/null
@@ -0,0 +1,59 @@
+//
+// AssemblyInfo.cs
+//
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Reflection;
+using System.Resources;
+using System.Security;
+using System.Security.Permissions;
+using System.Diagnostics;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+[assembly: AssemblyTitle ("System.ServiceModel.Internals.dll")]
+[assembly: AssemblyDescription ("Contains share code for some System.ServiceModel libraries")]
+[assembly: AssemblyDefaultAlias ("System.ServiceModel.dll")]
+
+[assembly: AssemblyInformationalVersion (Consts.FxFileVersion)]
+[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
+
+[assembly: NeutralResourcesLanguage ("en-US")]
+[assembly: CLSCompliant (true)]
+[assembly: AssemblyDelaySign (true)]
+#if NET_2_1
+[assembly: AssemblyKeyFile ("../winfx.pub")]
+#else
+[assembly: AssemblyKeyFile ("../ecma.pub")]
+[assembly: AllowPartiallyTrustedCallers]
+[assembly: ComCompatibleVersion (1, 0, 3300, 0)]
+[assembly: SecurityCritical (SecurityCriticalScope.Explicit)]
+#endif
+[assembly: InternalsVisibleTo ("SMDiagnostics, PublicKey=" + AssemblyRef.FrameworkPublicKeyFull)]
+[assembly: InternalsVisibleTo ("System.Runtime.Serialization, PublicKey=" + AssemblyRef.FrameworkPublicKeyFull2)]
+[assembly: InternalsVisibleTo ("System.IdentityModel, PublicKey=" + AssemblyRef.FrameworkPublicKeyFull2)]
+[assembly: InternalsVisibleTo ("System.IdentityModel.Selectors, PublicKey=" + AssemblyRef.FrameworkPublicKeyFull2)]
+[assembly: InternalsVisibleTo ("System.ServiceModel, PublicKey=" + AssemblyRef.FrameworkPublicKeyFull2)]
+[assembly: InternalsVisibleTo ("System.ServiceModel.Web, PublicKey=" + AssemblyRef.FrameworkPublicKeyFull2)]
+
+[assembly: ComVisible (false)]
+
diff --git a/mcs/class/System.ServiceModel.Internals/EventLogEntryType.cs b/mcs/class/System.ServiceModel.Internals/EventLogEntryType.cs
new file mode 100644 (file)
index 0000000..7481139
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+
+This source is taken from mcs/class/System/System.Diagnostics to make it
+build without adding this public API in System.dll. IF we brought this
+API in mobile world, this will conflict and can be removed.
+
+*/
+
+#if MOBILE
+//
+// System.Diagnostics.EventLogEntryType.cs
+//
+// Authors:
+//   Jonathan Pryor (jonpryor@vt.edu)
+//
+// (C) 2002
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Diagnostics;
+
+namespace System.Diagnostics {
+       public enum EventLogEntryType {
+               Error = 0x01,
+               Warning = 0x02,
+               Information = 0x04,
+               SuccessAudit = 0x08,
+               FailureAudit = 0x10
+       }
+}
+
+#endif
diff --git a/mcs/class/System.ServiceModel.Internals/InternalSR.cs b/mcs/class/System.ServiceModel.Internals/InternalSR.cs
new file mode 100644 (file)
index 0000000..23165ce
--- /dev/null
@@ -0,0 +1,121 @@
+namespace System.Runtime {
+
+       internal static class InternalSR {
+               public static string ArgumentNullOrEmpty(string paramName)
+               {
+                       return string.Format ("{0} is null or empty");
+               }
+               
+               public static string AsyncEventArgsCompletedTwice(Type t)
+               {
+                       return string.Format ("AsyncEventArgs completed twice for {0}", t);
+               }
+
+               public static string AsyncEventArgsCompletionPending(Type t)
+               {
+                       return string.Format ("AsyncEventArgs completion pending for {0}", t);
+               }
+               
+               public static string BufferAllocationFailed(int size)
+               {
+                       return string.Format ("Buffer allocation of size {0} failed", size);
+               }
+               
+               public static string BufferedOutputStreamQuotaExceeded(int maxSizeQuota)
+               {
+                       return string.Format ("Buffered output stream quota exceeded (maxSizeQuota={0})", maxSizeQuota);
+               }
+
+               public static string CannotConvertObject(object source, Type t)
+               {
+                       return string.Format ("Cannot convert object {0} to {1}", source, t);
+               }
+               
+               public static string EtwAPIMaxStringCountExceeded(object max)
+               {
+                       return string.Format ("ETW API max string count exceeded {0}", max);
+               }
+               
+               public static string EtwMaxNumberArgumentsExceeded(object max)
+               {
+                       return string.Format ("ETW max number arguments exceeded {0}", max);
+               }
+               
+               public static string EtwRegistrationFailed(object arg)
+               {
+                       return string.Format ("ETW registration failed {0}", arg);
+               }
+               
+               public static string FailFastMessage(string description)
+               {
+                       return string.Format ("Fail fast: {0}", description);
+               }
+               
+               public static string InvalidAsyncResultImplementation(Type t)
+               {
+                       return string.Format ("Invalid AsyncResult implementation: {0}", t);
+               }
+               
+               public static string LockTimeoutExceptionMessage (object timeout)
+               {
+                       return string.Format ("Lock timeout {0}", timeout);
+               }
+               
+               public static string ShipAssertExceptionMessage(object description)
+               {
+                       return string.Format ("Ship assert exception {0}", description);
+               }
+               
+               public static string TaskTimedOutError (object timeout)
+               {
+                       return string.Format ("Task timed out error {0}", timeout);
+               }
+               
+               public static string TimeoutInputQueueDequeue(object timeout)
+               {
+                       return string.Format ("Timeout input queue dequeue {0}", timeout);
+               }
+               
+               public static string TimeoutMustBeNonNegative(object argumentName, object timeout)
+               {
+                       return string.Format ("Timeout must be non-negative {0} and {1}", argumentName, timeout);
+               }
+               
+               public static string TimeoutMustBePositive(string argumentName, object timeout)
+               {
+                       return string.Format ("Timeout must be positive {0} {1}", argumentName, timeout);
+               }
+               
+               public static string TimeoutOnOperation(object timeout)
+               {
+                       return string.Format ("Timeout on operation {0}", timeout);
+               }
+               
+               public static string AsyncResultCompletedTwice (Type t)
+               {
+                       return string.Format ("AsyncResult Completed Twice for {0}", t);
+               }
+               
+               public const string ActionItemIsAlreadyScheduled = "Action Item Is Already Scheduled";
+               public const string AsyncCallbackThrewException = "Async Callback Threw Exception";
+               public const string AsyncResultAlreadyEnded = "Async Result Already Ended";
+               public const string BadCopyToArray = "Bad Copy To Array";
+               public const string BufferIsNotRightSizeForBufferManager = "Buffer Is Not Right Size For Buffer Manager";
+               public const string DictionaryIsReadOnly = "Dictionary Is Read Only";
+               public const string InvalidAsyncResult = "Invalid Async Result";
+               public const string InvalidAsyncResultImplementationGeneric = "Invalid Async Result Implementation Generic";
+               public const string InvalidNullAsyncResult = "Invalid Null Async Result";
+               public const string InvalidSemaphoreExit = "Invalid Semaphore Exit";
+               public const string KeyCollectionUpdatesNotAllowed = "Key Collection Updates Not Allowed";
+               public const string KeyNotFoundInDictionary = "Key Not Found In Dictionary";
+               public const string MustCancelOldTimer = "Must Cancel Old Timer";
+               public const string NullKeyAlreadyPresent = "Null Key Already Present";
+               public const string ReadNotSupported = "Read Not Supported";
+               public const string SFxTaskNotStarted = "SFx Task Not Started";
+               public const string SeekNotSupported = "Seek Not Supported";
+               public const string ThreadNeutralSemaphoreAborted = "Thread Neutral Semaphore Aborted";
+               public const string ValueCollectionUpdatesNotAllowed = "Value Collection Updates Not Allowed";
+               public const string ValueMustBeNonNegative = "Value Must Be Non Negative";
+       }
+}
+
diff --git a/mcs/class/System.ServiceModel.Internals/Makefile b/mcs/class/System.ServiceModel.Internals/Makefile
new file mode 100644 (file)
index 0000000..a246259
--- /dev/null
@@ -0,0 +1,14 @@
+thisdir = class/System.ServiceModel.Internals
+SUBDIRS = 
+include ../../build/rules.make
+
+LIBRARY = System.ServiceModel.Internals.dll
+LIB_REFS = System System.Core System.Xml
+ifneq (2.1, $(FRAMEWORK_VERSION))
+       LIB_REFS += System.Configuration
+endif
+LIB_MCS_FLAGS = /unsafe
+
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
+
+include ../../build/library.make
diff --git a/mcs/class/System.ServiceModel.Internals/System.ServiceModel.Internals.dll.sources b/mcs/class/System.ServiceModel.Internals/System.ServiceModel.Internals.dll.sources
new file mode 100644 (file)
index 0000000..99b323b
--- /dev/null
@@ -0,0 +1,79 @@
+../../build/common/Consts.cs
+../../build/common/SR.cs
+EventLogEntryType.cs
+InternalSR.cs
+Assembly/AssemblyInfo.cs
+../../../external/referencesource/System.ServiceModel.Internals/AssemblyInfo.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/ActionItem.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/AssertHelper.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/AsyncCompletionResult.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/AsyncEventArgsCallback.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/AsyncEventArgs.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/AsyncResult.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/AsyncWaitHandle.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/BackoffTimeoutHelper.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/BufferedOutputStream.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/CallbackException.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Collections/HopperCache.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Collections/NullableKeyDictionary.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Collections/ObjectCache.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Collections/ObjectCacheItem.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Collections/ObjectCacheSettings.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Collections/OrderedDictionary.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Collections/ValidatingCollection.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/CompletedAsyncResult.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/ComputerNameFormat.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/ActivityControl.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/DiagnosticEventProvider.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/DiagnosticTraceBase.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/DiagnosticTraceSource.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/DictionaryTraceRecord.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EtwDiagnosticTrace.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EtwProvider.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EventDescriptor.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EventLogCategory.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EventLogEventId.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EventLogger.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EventTraceActivity.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/ITraceSourceStringProvider.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/PerformanceCounterNameAttribute.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/StringTraceRecord.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/TraceRecord.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/DiagnosticStrings.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/DuplicateDetector.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/ExceptionTrace.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/FastAsyncCallback.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/FatalException.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/FxCop.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Fx.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/HashHelper.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/IAsyncEventArgs.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/InputQueue.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/InternalBufferManager.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Interop/SafeEventLogWriteHandle.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Interop/UnsafeNativeMethods.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/IOThreadCancellationTokenSource.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/IOThreadScheduler.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/IOThreadTimer.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/MruCache.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/NameGenerator.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/PartialTrustHelpers.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/ReadOnlyDictionaryInternal.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/ReadOnlyKeyedCollection.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/ScheduleActionItemAsyncResult.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/SignalGate.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/SynchronizedPool.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/TaskExtensions.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/ThreadNeutralSemaphore.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Ticks.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/TimeoutHelper.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/TraceChannel.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/TraceEventLevel.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/TraceEventOpcode.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/TraceLevelHelper.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/TracePayload.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/TypedAsyncResult.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/TypeHelper.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/UrlUtility.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/WaitCallbackActionItem.cs
+../../../external/referencesource/System.ServiceModel.Internals/TraceCore.Designer.cs
index dc036a32be80f1bed036c92aeb7388b815a9bb98..4b130a9110a7bc42891c2168ba1144dc257d4f61 100644 (file)
@@ -52,7 +52,6 @@ using System.Security.Permissions;
 [assembly: NeutralResourcesLanguage ("en-US")]
 
 [assembly: ComVisible (false)]
-[assembly: ComCompatibleVersion (1, 0, 3300, 0)]
 [assembly: AllowPartiallyTrustedCallers]
 
        [assembly: CLSCompliant (true)]
index dfc16133567cb0eea19df63708a3870a9ef19e17..891b1ef66ce35e2bd5bfe39da86555d0efe195e4 100644 (file)
@@ -495,21 +495,21 @@ namespace System.Web.Script.Serialization
                                        break;
 
                                case JsonType.TRUE:
-                                       if (String.Compare (s, "true", StringComparison.Ordinal) == 0)
+                                       if (String.Compare (s.Trim (), "true", StringComparison.Ordinal) == 0)
                                                result = true;
                                        else
                                                converted = false;
                                        break;
 
                                case JsonType.FALSE:
-                                       if (String.Compare (s, "false", StringComparison.Ordinal) == 0)
+                                       if (String.Compare (s.Trim (), "false", StringComparison.Ordinal) == 0)
                                                result = false;
                                        else
                                                converted = false;
                                        break;
 
                                case JsonType.NULL:
-                                       if (String.Compare (s, "null", StringComparison.Ordinal) != 0)
+                                       if (String.Compare (s.Trim (), "null", StringComparison.Ordinal) != 0)
                                                converted = false;
                                        break;
 
index 43f9e13be14e1f3519c78f1345ae3f0aa5cd806a..dd2d5a38bc9de2c505e9ebb1f2286e49eafabdb0 100644 (file)
@@ -1416,5 +1416,30 @@ namespace MonoTests.System.Web.Script.Serialization
     ";
                        serializer.DeserializeObject (json_with_newline);
                }
+
+               class Dummy
+               {
+                       public bool t;
+                       public bool f;
+                       public string s;
+                       public int i;
+                       public double d;
+                       public object o;
+               }
+               
+               [Test]
+               public void DeserializeWhiteSpaces ()
+               {
+                       string json = "{\"t\" : true , \"f\" : false , \"s\" : \"s\" , \"i\" : 1337 , \"d\" : 1337.0 , \"o\" : null }";
+                       
+                       var obj = (new JavaScriptSerializer ()).Deserialize<Dummy>(json);
+                       
+                       Assert.IsTrue (obj.t);
+                       Assert.IsFalse (obj.f);
+                       Assert.AreEqual ("s", obj.s);
+                       Assert.AreEqual (1337, obj.i);
+                       Assert.AreEqual (1337.0, obj.d);
+                       Assert.AreEqual (null, obj.o);
+               }
        }
 }
index 70f5591eadcf4decb05d151384e3fd8a88704669..2569fd2e694bb55c6134c16c17290dc23303ae76 100644 (file)
@@ -3514,15 +3514,15 @@ namespace MonoTests.System.XmlSerialization
        [XmlType]
        public class ContainerTypeForTest
        {
-               [XmlElement ("XmlFirstType", typeof (FirstDerivedTypeForTest))]
-               [XmlElement ("XmlIntermediateType", typeof (IntermediateTypeForTest))]
                [XmlElement ("XmlSecondType", typeof (SecondDerivedTypeForTest))]
+               [XmlElement ("XmlIntermediateType", typeof (IntermediateTypeForTest))]
+               [XmlElement ("XmlFirstType", typeof (FirstDerivedTypeForTest))]
                public AbstractTypeForTest MemberToUseInclude { get; set; }
        }
 
-       [XmlInclude (typeof (FirstDerivedTypeForTest))]
-       [XmlInclude (typeof (IntermediateTypeForTest))]
        [XmlInclude (typeof (SecondDerivedTypeForTest))]
+       [XmlInclude (typeof (IntermediateTypeForTest))]
+       [XmlInclude (typeof (FirstDerivedTypeForTest))]
        public abstract class AbstractTypeForTest
        {
        }
index de0f569d5c5d57a002c307b612d0f9e9f10d64b3..ecc7b1a4645f400223e493bd48916a0e9819c5a9 100644 (file)
@@ -205,13 +205,15 @@ namespace Mono.CSharp
                        foreach (CodeNamespace codeNamespace in compileUnit.Namespaces) {
                                if (string.IsNullOrEmpty (codeNamespace.Name)) {
                                        global_imports = codeNamespace.Imports;
-                                       codeNamespace.Imports = new CodeNamespaceImportCollection ();
+                                       codeNamespace.Imports.Clear ();
                                }
 
                                GenerateNamespace (codeNamespace);
 
                                if (global_imports != null) {
-                                       codeNamespace.Imports = global_imports;
+                                       codeNamespace.Imports.Clear ();
+                                       foreach (CodeNamespaceImport ns in global_imports)
+                                       codeNamespace.Imports.Add (ns);
                                        global_imports = null;
                                }
                        }
index 3c9643511f58f3735dfe715b205d4c39a998cc01..c935280838ccbd4e666f64cb106844219a962b9e 100644 (file)
@@ -6,7 +6,7 @@ namespace System.Net.Sockets
 {
        internal sealed class MonoSocketRuntimeWorkItem : IThreadPoolWorkItem
        {
-               Socket.SocketAsyncResult socket_async_result;
+               SocketAsyncResult socket_async_result;
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                public extern void ExecuteWorkItem();
index 7bf4932b6d662fd503ebacb877c3fa072434d5ab..dbda7ac686451f3e87dc078ed726f5fa0dc9e5cc 100644 (file)
@@ -910,4 +910,17 @@ public const string Incorrect_base_type = @"The specified type, '{0}' is not der
 public const string Only_specify_one = @"'switchValue' and 'switchName' cannot both be specified on source '{0}'.";
 public const string Reference_listener_cant_have_properties = @"A listener with no type name specified references the sharedListeners section and cannot have any attributes other than 'Name'.  Listener: '{0}'.";
 public const string Reference_to_nonexistent_listener = @"Listener '{0}' does not exist in the sharedListeners section.";
+
+public const string Argument_NullComment = @"The 'Comment' property of the CodeCommentStatement '{0}' cannot be null.";
+public const string CodeGenOutputWriter = @"The output writer for code generation and the writer supplied don't match and cannot be used. This is generally caused by a bad implementation of a CodeGenerator derived class.";
+public const string CodeGenReentrance = @"This code generation API cannot be called while the generator is being used to generate something else.";
+public const string InvalidElementType = @"Element type {0} is not supported.";
+public const string InvalidIdentifier = @"Identifier '{0}' is not valid.";
+public const string InvalidPrimitiveType = @"Invalid Primitive Type: {0}. Consider using CodeObjectCreateExpression.";
+public const string ArityDoesntMatch = @"The total arity specified in '{0}' does not match the number of TypeArguments supplied.  There were '{1}' TypeArguments supplied.
+";
+public const string InvalidPathCharsInChecksum = @"The CodeChecksumPragma file name '{0}' contains invalid path characters.";
+public const string InvalidLanguageIdentifier = @"The identifier:""{0}"" on the property:""{1}"" of type:""{2}"" is not a valid language-independent identifier name. Check to see if CodeGenerator.IsValidLanguageIndependentIdentifier allows the identifier name.";
+public const string InvalidTypeName = @"The type name:""{0}"" on the property:""{1}"" of type:""{2}"" is not a valid language-independent type name.";
+public const string InvalidRegion = "The region directive '{0}' contains invalid characters.  RegionText cannot contain any new line characters.";
 }
index d6db248b751df90cbebb49c717d577cb8aee01b7..8c1d12b8aaaeea6744f18260c9f1db19986b9c64 100644 (file)
@@ -37,10 +37,10 @@ namespace System.Net.Sockets
                // this version does not throw.
                internal void InternalShutdown (SocketShutdown how)
                {
-                       if (!connected || disposed)
+                       if (!is_connected || is_disposed)
                                return;
                        int error;
-                       Shutdown_internal (socket, how, out error);
+                       Shutdown_internal (safe_handle, how, out error);
                }
 
                internal IAsyncResult UnsafeBeginConnect (EndPoint remoteEP, AsyncCallback callback, object state)
@@ -86,7 +86,7 @@ namespace System.Net.Sockets
 
                internal void SetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, int optionValue, bool silent)
                {
-                       if (disposed && closed) {
+                       if (is_disposed && is_closed) {
                                if (silent)
                                        return;
                                throw new ObjectDisposedException (GetType ().ToString ());
@@ -94,7 +94,7 @@ namespace System.Net.Sockets
 
                        int error;
 
-                       SetSocketOption_internal (socket, optionLevel, optionName, null,
+                       SetSocketOption_internal (safe_handle, optionLevel, optionName, null,
                                null, optionValue, out error);
 
                        if (!silent && error != 0)
diff --git a/mcs/class/System/System.CodeDom/CodeArgumentReferenceExpression.cs b/mcs/class/System/System.CodeDom/CodeArgumentReferenceExpression.cs
deleted file mode 100644 (file)
index 9a7a932..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-// System.CodeDom CodeArgumentReferenceExpression Class implementation
-//
-// Author:
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom {
-
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeArgumentReferenceExpression 
-               : CodeExpression
-       {
-               private string parameterName;
-
-               //
-               // Constructors
-               //
-               public CodeArgumentReferenceExpression()
-               {
-               }
-
-               public CodeArgumentReferenceExpression( string name )
-               {
-                       this.parameterName = name;
-               }
-
-               //
-               // Properties
-               //
-               public string ParameterName {
-                       get {
-                               if (parameterName == null) {
-                                       return string.Empty;
-                               }
-                               return parameterName;
-                       }
-                       set {
-                               parameterName = value;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeArrayCreateExpression.cs b/mcs/class/System/System.CodeDom/CodeArrayCreateExpression.cs
deleted file mode 100644 (file)
index b713efa..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-//
-// System.CodeDom CodeArrayCreateExpression Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom {
-
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeArrayCreateExpression
-               : CodeExpression 
-       {
-               private CodeTypeReference createType;
-               private CodeExpressionCollection initializers;
-               private CodeExpression sizeExpression;
-               private int size;
-               
-               //
-               // Constructors
-               //
-               public CodeArrayCreateExpression ()
-               {
-               }
-
-               public CodeArrayCreateExpression (CodeTypeReference createType, 
-                                                 CodeExpression size )
-               {
-                       this.createType = createType;
-                       this.sizeExpression = size;
-               }
-
-               public CodeArrayCreateExpression (CodeTypeReference createType, 
-                                                 params CodeExpression[] initializers )
-               {
-                       this.createType = createType;
-                       this.Initializers.AddRange( initializers );
-               }
-
-               public CodeArrayCreateExpression (CodeTypeReference createType, 
-                                                 int size)
-               {
-                       this.createType = createType;
-                       this.size = size;
-               }
-
-
-               public CodeArrayCreateExpression (string createType, 
-                                                 CodeExpression size)
-               {
-                       this.createType = new CodeTypeReference( createType );
-                       this.sizeExpression = size;
-               }
-
-               public CodeArrayCreateExpression (string createType, 
-                                                 params CodeExpression[] initializers)
-               {
-                       this.createType = new CodeTypeReference( createType );
-                       this.Initializers.AddRange( initializers );
-               }
-
-               public CodeArrayCreateExpression (string createType, 
-                                                 int size)
-               {
-                       this.createType = new CodeTypeReference( createType );
-                       this.size = size;
-               }
-
-
-               public CodeArrayCreateExpression (Type createType, 
-                                                 CodeExpression size)
-               {
-                       this.createType = new CodeTypeReference( createType );
-                       this.sizeExpression = size;
-               }
-                       
-               public CodeArrayCreateExpression (Type createType, 
-                                                 params CodeExpression[] initializers)
-               {
-                       this.createType = new CodeTypeReference( createType );
-                       this.Initializers.AddRange( initializers );
-               }
-
-               public CodeArrayCreateExpression (Type createType, 
-                                                 int size)
-               {
-                       this.createType = new CodeTypeReference( createType );
-                       this.size = size;
-               }
-
-               //
-               // Properties
-               //
-               public CodeTypeReference CreateType {
-                       get {
-                               if (createType == null) {
-                                       createType = new CodeTypeReference (typeof (void));
-                               }
-                               return createType;
-                       }
-                       set {
-                               createType = value;
-                       }
-               }
-
-               public CodeExpressionCollection Initializers {
-                       get {
-                               if ( initializers == null )
-                                       initializers = new CodeExpressionCollection();
-                                       
-                               return initializers;
-                       }
-               }
-
-               public CodeExpression SizeExpression {
-                       get {
-                               return sizeExpression;
-                       }
-                       set {
-                               sizeExpression = value;
-                       }
-               }
-
-               public int Size {
-                       get {
-                               return size;
-                       }
-                       set {
-                               size = value;
-                               // NOTE: Setting Size in ms.Net does
-                               // not supersede SizeExpression
-                               // values. Instead, the CodeGenerator
-                               // seems to always prefer
-                               // SizeExpression if set to a value !=
-                               // null.
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
-
diff --git a/mcs/class/System/System.CodeDom/CodeArrayIndexerExpression.cs b/mcs/class/System/System.CodeDom/CodeArrayIndexerExpression.cs
deleted file mode 100644 (file)
index 08ade4b..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-//
-// System.CodeDom CodeArrayIndexerExpression Class implementation
-//
-// Author:
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom {
-
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeArrayIndexerExpression
-               : CodeExpression 
-       {
-               private CodeExpressionCollection indices;
-               private CodeExpression targetObject;
-
-               //
-               // Constructors
-               //
-               public CodeArrayIndexerExpression()
-               {
-               }
-
-               public CodeArrayIndexerExpression( CodeExpression targetObject, params CodeExpression[] indices )
-               {
-                       this.targetObject = targetObject;
-                       this.Indices.AddRange( indices );
-               }
-
-               //
-               // Properties
-               //
-               public CodeExpressionCollection Indices {
-                       get {
-                               if ( indices == null )
-                                       indices = new CodeExpressionCollection();
-                               return indices;
-                       }
-               }
-
-               public CodeExpression TargetObject {
-                       get {
-                               return targetObject;
-                       }
-                       set {
-                               targetObject = value;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeAssignStatement.cs b/mcs/class/System/System.CodeDom/CodeAssignStatement.cs
deleted file mode 100644 (file)
index 4392411..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-//
-// System.CodeDom CodeArrayCreateExpression Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom {
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeAssignStatement
-               : CodeStatement 
-       {
-               CodeExpression left, right;
-
-               //
-               // Constructors
-               //
-               public CodeAssignStatement ()
-               {
-               }
-
-               public CodeAssignStatement (CodeExpression left, CodeExpression right)
-               {
-                       this.left = left;
-                       this.right = right;
-               }
-               
-               //
-               // Properties
-               //
-               public CodeExpression Left {
-                       get {
-                               return left;
-                       }
-                       set {
-                               left = value;
-                       }
-               }
-
-               public CodeExpression Right {
-                       get {
-                               return right;
-                       }
-                       set {
-                               right = value;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeAttachEventStatement.cs b/mcs/class/System/System.CodeDom/CodeAttachEventStatement.cs
deleted file mode 100644 (file)
index f560ae1..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-//
-// System.CodeDom CodeAttachEventStatement Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom 
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeAttachEventStatement
-               : CodeStatement 
-       {
-               private CodeEventReferenceExpression eventRef;
-               private CodeExpression listener;
-               
-               //
-               // Constructors
-               //
-               public CodeAttachEventStatement ()
-               {
-               }
-
-               public CodeAttachEventStatement (CodeEventReferenceExpression eventRef,
-                                                CodeExpression listener)
-               {
-                       this.eventRef = eventRef;
-                       this.listener = listener;
-               }
-
-               public CodeAttachEventStatement (CodeExpression targetObject,
-                                                string eventName, 
-                                                CodeExpression listener)
-               {
-                       this.eventRef = new CodeEventReferenceExpression (targetObject,
-                                                                                                                               eventName);
-                       this.listener = listener;
-               }
-
-               //
-               // Properties
-               //
-               public CodeEventReferenceExpression Event {
-                       get {
-                               if (eventRef == null) {
-                                       eventRef = new CodeEventReferenceExpression ();
-                               }
-                               return eventRef;
-                       }
-                       set {
-                               eventRef = value;
-                       }
-               }
-
-               public CodeExpression Listener {
-                       get {
-                               return listener; 
-                       }
-                       set {
-                               listener = value;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeAttributeArgument.cs b/mcs/class/System/System.CodeDom/CodeAttributeArgument.cs
deleted file mode 100644 (file)
index b54b137..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-//
-// System.CodeDom CodeAttributeArgument Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeAttributeArgument
-       {
-               private string name;
-               private CodeExpression value;
-               
-               //
-               // Constructors
-               //
-               public CodeAttributeArgument ()
-               {
-               }
-
-               public CodeAttributeArgument (CodeExpression value)
-               {
-                       this.value = value;
-               }
-
-               public CodeAttributeArgument (string name, CodeExpression value)
-               {
-                       this.name = name;
-                       this.value = value;
-               }
-
-               //
-               // Properties
-               //
-               public string Name {
-                       get {
-                               if (name == null) {
-                                       return string.Empty;
-                               }
-                               return name;
-                       }
-                       set {
-                               name = value;
-                       }
-               }
-
-               public CodeExpression Value {
-                       get {
-                               return this.value;
-                       }
-                       set {
-                               this.value = value;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeAttributeArgumentCollection.cs b/mcs/class/System/System.CodeDom/CodeAttributeArgumentCollection.cs
deleted file mode 100644 (file)
index 8fe8fd3..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-//
-// System.CodeDom CodeAttributeArgumentCollection Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-using System.Collections;
-
-namespace System.CodeDom 
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeAttributeArgumentCollection
-               : CollectionBase
-       {
-               //
-               // Constructors
-               //
-               public CodeAttributeArgumentCollection()
-               {
-               }
-
-               public CodeAttributeArgumentCollection( CodeAttributeArgument[] value )
-               {
-                       AddRange( value );
-               }
-
-               public CodeAttributeArgumentCollection( CodeAttributeArgumentCollection value )
-               {
-                       AddRange( value );
-               }
-
-               //
-               // Properties
-               //
-               public CodeAttributeArgument this[int index]
-               {
-                       get {
-                               return (CodeAttributeArgument)List[index];
-                       }
-                       set {
-                               List[index] = value;
-                       }
-               }
-
-               //
-               // Methods
-               //
-               public int Add (CodeAttributeArgument value)
-               {
-                       return List.Add( value );
-               }
-
-               public void AddRange (CodeAttributeArgument [] value )
-               {
-                       if (value == null) {
-                               throw new ArgumentNullException ("value");
-                       }
-
-                       for (int i = 0; i < value.Length; i++) {
-                               Add (value[i]);
-                       }
-               }
-               
-               public void AddRange (CodeAttributeArgumentCollection value)
-               {
-                       if (value == null) {
-                               throw new ArgumentNullException ("value");
-                       }
-
-                       int count = value.Count;
-                       for (int i = 0; i < count; i++) {
-                               Add (value[i]);
-                       }
-               }
-
-               public bool Contains( CodeAttributeArgument value )
-               {
-                       return List.Contains( value );
-               }
-               
-               public void CopyTo( CodeAttributeArgument[] array, int index )
-               {
-                       List.CopyTo( array, index );
-               }
-
-               public int IndexOf( CodeAttributeArgument value )
-               {
-                       return List.IndexOf( value );
-               }
-
-               public void Insert( int index, CodeAttributeArgument value )
-               {
-                       List.Insert( index, value );
-               }
-
-               public void Remove( CodeAttributeArgument value )
-               {
-                       List.Remove (value);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeAttributeDeclaration.cs b/mcs/class/System/System.CodeDom/CodeAttributeDeclaration.cs
deleted file mode 100644 (file)
index 89bb36a..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-//
-// System.CodeDom CodeAttributeDeclaration Class implementation
-//
-// Authors:
-//   Miguel de Icaza (miguel@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//   Sebastien Pouliot  <sebastien@ximian.com>
-//
-// (C) 2001 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom 
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeAttributeDeclaration 
-       {
-               private string name;
-               private CodeAttributeArgumentCollection arguments;
-               private CodeTypeReference attribute;
-
-               //
-               // Constructors
-               //
-               public CodeAttributeDeclaration ()
-               {
-               }
-
-               public CodeAttributeDeclaration (string name)
-               {
-                       this.Name = name;
-               }
-
-               public CodeAttributeDeclaration (string name, params CodeAttributeArgument [] arguments)
-               {
-                       this.Name = name;
-                       Arguments.AddRange (arguments);
-               }
-
-               public CodeAttributeDeclaration (CodeTypeReference attributeType)
-               {
-                       attribute = attributeType;
-                       if (attributeType != null) {
-                               name = attributeType.BaseType;
-                       }
-               }
-
-               public CodeAttributeDeclaration (CodeTypeReference attributeType, params CodeAttributeArgument [] arguments)
-               {
-                       attribute = attributeType;
-                       if (attributeType != null) {
-                               name = attributeType.BaseType;
-                       }
-                       Arguments.AddRange (arguments);
-               }
-
-               //
-               // Properties
-               //
-               public CodeAttributeArgumentCollection Arguments {
-                       get {
-                               if (arguments == null) {
-                                       arguments = new CodeAttributeArgumentCollection ();
-                               }
-
-                               return arguments;
-                       }
-               }
-
-               public string Name {
-                       get {
-                               if (name == null) {
-                                       return string.Empty;
-                               }
-                               return name;
-                       }
-                       set {
-                               name = value;
-                               attribute = new CodeTypeReference (name);
-                       }
-               }
-
-               public CodeTypeReference AttributeType {
-                       get { return attribute; }
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeAttributeDeclarationCollection.cs b/mcs/class/System/System.CodeDom/CodeAttributeDeclarationCollection.cs
deleted file mode 100644 (file)
index 48e8801..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-//
-// System.CodeDom CodeAttributeDeclarationCollection Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-using System.Collections;
-
-namespace System.CodeDom 
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeAttributeDeclarationCollection 
-               : CollectionBase
-       {
-               //
-               // Constructors
-               //
-               public CodeAttributeDeclarationCollection()
-               {
-               }
-
-               public CodeAttributeDeclarationCollection( CodeAttributeDeclaration[] value )
-               {
-                       AddRange( value );
-               }
-
-               public CodeAttributeDeclarationCollection( CodeAttributeDeclarationCollection value )
-               {
-                       AddRange( value );
-               }
-
-               //
-               // Properties
-               //
-               public CodeAttributeDeclaration this[int index]
-               {
-                       get {
-                               return (CodeAttributeDeclaration)List[index];
-                       }
-                       set {
-                               List[index] = value;
-                       }
-               }
-
-               //
-               // Methods
-               //
-               public int Add (CodeAttributeDeclaration value)
-               {
-                       return List.Add (value);
-               }
-
-               public void AddRange (CodeAttributeDeclaration [] value)
-               {
-                       if (value == null) {
-                               throw new ArgumentNullException ("value");
-                       }
-
-                       for (int i = 0; i < value.Length; i++) {
-                               Add (value[i]);
-                       }
-               }
-
-               public void AddRange (CodeAttributeDeclarationCollection value)
-               {
-                       if (value == null) {
-                               throw new ArgumentNullException ("value");
-                       }
-
-                       int count = value.Count;
-                       for (int i = 0; i < count; i++) {
-                               Add (value[i]);
-                       }
-               }
-
-               public bool Contains( CodeAttributeDeclaration value )
-               {
-                       return List.Contains( value );
-               }
-
-               public void CopyTo( CodeAttributeDeclaration[] array, int index )
-               {
-                       List.CopyTo( array, index );
-               }
-
-               public int IndexOf( CodeAttributeDeclaration value )
-               {
-                       return List.IndexOf( value );
-               }
-
-               public void Insert( int index, CodeAttributeDeclaration value )
-               {
-                       List.Insert( index, value );
-               }
-
-               public void Remove( CodeAttributeDeclaration value )
-               {
-                       List.Remove (value);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeBaseReferenceExpression.cs b/mcs/class/System/System.CodeDom/CodeBaseReferenceExpression.cs
deleted file mode 100644 (file)
index b907215..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// System.CodeDom CodeBaseReferenceExpression Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom 
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeBaseReferenceExpression
-               : CodeExpression 
-       {
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeBinaryOperatorExpression.cs b/mcs/class/System/System.CodeDom/CodeBinaryOperatorExpression.cs
deleted file mode 100644 (file)
index 0cdda07..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-//
-// System.CodeDom CodeBinaryOperatorExpression Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeBinaryOperatorExpression
-               : CodeExpression 
-       {
-               private CodeExpression left, right;
-               private CodeBinaryOperatorType op;
-
-               //
-               // Constructors
-               //
-               public CodeBinaryOperatorExpression ()
-               {
-               }
-
-               public CodeBinaryOperatorExpression (CodeExpression left,
-                                                    CodeBinaryOperatorType op,
-                                                    CodeExpression right)
-               {
-                       this.left = left;
-                       this.op = op;
-                       this.right = right;
-               }
-
-               //
-               // Properties
-               //
-               public CodeExpression Left {
-                       get {
-                               return left;
-                       }
-                       set {
-                               left = value;
-                       }
-               }
-
-               public CodeBinaryOperatorType Operator {
-                       get {
-                               return op;
-                       }
-                       set {
-                               op = value;
-                       }
-               }
-
-               public CodeExpression Right {
-                       get {
-                               return right;
-                       }
-                       set {
-                               right = value;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeBinaryOperatorType.cs b/mcs/class/System/System.CodeDom/CodeBinaryOperatorType.cs
deleted file mode 100644 (file)
index 2a6fcc4..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-//
-// System.CodeDom CodeBinaryOperatorType Enum implementation
-//
-// Author:
-//   Sean MacIsaac (macisaac@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom 
-{
-       [Serializable]
-       [ComVisible(true)]
-       public enum CodeBinaryOperatorType {
-               Add = 0,
-               Subtract = 1,
-               Multiply = 2,
-               Divide = 3,
-               Modulus = 4,
-               Assign = 5,
-               IdentityInequality = 6,
-               IdentityEquality = 7,
-               ValueEquality = 8,
-               BitwiseOr = 9,
-               BitwiseAnd = 10,
-               BooleanOr = 11,
-               BooleanAnd = 12,
-               LessThan = 13,
-               LessThanOrEqual = 14,
-               GreaterThan = 15,
-               GreaterThanOrEqual = 16
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeCastExpression.cs b/mcs/class/System/System.CodeDom/CodeCastExpression.cs
deleted file mode 100644 (file)
index 736400b..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-//
-// System.CodeDom CodeCastExpression Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom 
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeCastExpression : CodeExpression
-       {
-               private CodeTypeReference targetType;
-               private CodeExpression expression;
-               
-               //
-               // Constructors
-               //
-               public CodeCastExpression ()
-               {
-               }
-
-               public CodeCastExpression (CodeTypeReference targetType, CodeExpression expression)
-               {
-                       this.targetType = targetType;
-                       this.expression = expression;
-               }
-
-               public CodeCastExpression (string targetType, CodeExpression expression)
-               {
-                       this.targetType = new CodeTypeReference (targetType);
-                       this.expression = expression;
-               }
-
-               public CodeCastExpression (Type targetType, CodeExpression expression)
-               {
-                       this.targetType = new CodeTypeReference (targetType);
-                       this.expression = expression;
-               }
-
-               //
-               // Properties
-               //
-               public CodeExpression Expression {
-                       get {
-                               return expression;
-                       }
-
-                       set {
-                               expression = value;
-                       }
-               }
-
-               public CodeTypeReference TargetType {
-                       get {
-                               if (targetType == null) {
-                                       targetType = new CodeTypeReference (string.Empty);
-                               }
-                               return targetType;
-                       }
-                       set {
-                               targetType = value;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeCatchClause.cs b/mcs/class/System/System.CodeDom/CodeCatchClause.cs
deleted file mode 100644 (file)
index 993ce9f..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-//
-// System.CodeDom CodeCatchClaus Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeCatchClause
-       {
-               private CodeTypeReference catchExceptionType;
-               private string localName;
-               private CodeStatementCollection statements;
-
-               //
-               // Constructors
-               //
-               public CodeCatchClause ()
-               {
-               }
-
-               public CodeCatchClause ( string localName )
-               {
-                       this.localName = localName;
-               }
-
-               public CodeCatchClause ( string localName,
-                                        CodeTypeReference catchExceptionType )
-               {
-                       this.localName = localName;
-                       this.catchExceptionType = catchExceptionType;
-               }
-
-               public CodeCatchClause ( string localName,
-                                        CodeTypeReference catchExceptionType,
-                                        params CodeStatement[] statements )
-               {
-                       this.localName = localName;
-                       this.catchExceptionType = catchExceptionType;
-                       this.Statements.AddRange (statements);
-               }
-
-               //
-               // Properties
-               //
-               public CodeTypeReference CatchExceptionType {
-                       get {
-                               if (catchExceptionType == null) {
-                                       catchExceptionType = new CodeTypeReference (typeof (Exception));
-                               }
-                               return catchExceptionType;
-                       }
-                       set {
-                               catchExceptionType = value;
-                       }
-               }
-
-               public string LocalName {
-                       get {
-                               if (localName == null) {
-                                       return string.Empty;
-                               }
-                               return localName;
-                       }
-                       set {
-                               localName = value;
-                       }
-               }
-
-               public CodeStatementCollection Statements {
-                       get {
-                               if ( statements == null )
-                                       statements = new CodeStatementCollection();
-                               return statements;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeCatchClauseCollection.cs b/mcs/class/System/System.CodeDom/CodeCatchClauseCollection.cs
deleted file mode 100644 (file)
index 05865d1..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-//
-// System.CodeDom CodeCatchClauseCollection Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-using System.Collections;
-
-namespace System.CodeDom 
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeCatchClauseCollection
-               : CollectionBase
-       {
-               //
-               // Constructors
-               //
-               public CodeCatchClauseCollection()
-               {
-               }
-
-               public CodeCatchClauseCollection( CodeCatchClause[] value )
-               {
-                       AddRange( value );
-               }
-
-               public CodeCatchClauseCollection( CodeCatchClauseCollection value )
-               {
-                       AddRange( value );
-               }
-
-               //
-               // Properties
-               //
-               public CodeCatchClause this[int index] {
-                       get {
-                               return (CodeCatchClause)List[index];
-                       }
-                       set {
-                               List[index] = value;
-                       }
-               }
-
-               //
-               // Methods
-               //
-               public int Add (CodeCatchClause value)
-               {
-                       return List.Add (value);
-               }
-
-               public void AddRange (CodeCatchClause [] value)
-               {
-                       if (value == null) {
-                               throw new ArgumentNullException ("value");
-                       }
-
-                       for (int i = 0; i < value.Length; i++) {
-                               Add (value[i]);
-                       }
-               }
-
-               public void AddRange (CodeCatchClauseCollection value )
-               {
-                       if (value == null) {
-                               throw new ArgumentNullException ("value");
-                       }
-
-                       int count = value.Count;
-                       for (int i = 0; i < count; i++) {
-                               Add (value[i]);
-                       }
-               }
-
-               public bool Contains( CodeCatchClause value )
-               {
-                       return List.Contains( value );
-               }
-               
-               public void CopyTo( CodeCatchClause[] array, int index )
-               {
-                       List.CopyTo( array, index );
-               }
-
-               public int IndexOf( CodeCatchClause value )
-               {
-                       return List.IndexOf( value );
-               }
-
-               public void Insert( int index, CodeCatchClause value )
-               {
-                       List.Insert( index, value );
-               }
-
-               public void Remove( CodeCatchClause value )
-               {
-                       List.Remove (value);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeChecksumPragma.cs b/mcs/class/System/System.CodeDom/CodeChecksumPragma.cs
deleted file mode 100644 (file)
index 44d2a1e..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-//
-// System.CodeDom CodeChecksumPragma class
-//
-// Author:
-//   Marek Safar (marek.safar@seznam.cz)
-//
-// (C) 2004 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ComVisible (true), ClassInterface (ClassInterfaceType.AutoDispatch)]
-       public class CodeChecksumPragma: CodeDirective
-       {
-               string fileName;
-               Guid checksumAlgorithmId;
-               byte[] checksumData;
-
-               public CodeChecksumPragma ()
-               {
-               }
-
-               public CodeChecksumPragma (string fileName, Guid checksumAlgorithmId, byte[] checksumData)
-               {
-                       this.fileName = fileName;
-                       this.checksumAlgorithmId = checksumAlgorithmId;
-                       this.checksumData = checksumData;
-               }
-            
-               public Guid ChecksumAlgorithmId {
-                       get {
-                               return checksumAlgorithmId;
-                       }
-                       set {
-                               checksumAlgorithmId = value;
-                       }
-               }
-
-               public byte[] ChecksumData {
-                       get {
-                               return checksumData;
-                       } 
-                       set {
-                               checksumData = value;
-                       }
-               }
-
-               public string FileName {
-                       get {
-                               if (fileName == null) {
-                                       return string.Empty;
-                               }
-                               return fileName;
-                       }
-                       set {
-                               fileName = value;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeComment.cs b/mcs/class/System/System.CodeDom/CodeComment.cs
deleted file mode 100644 (file)
index ccbd9ef..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-//
-// System.CodeDom CodeComment Class implementation
-//
-// Author:
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeComment
-               : CodeObject
-       {
-               private bool docComment;
-               private string text;
-               
-               //
-               // Constructors
-               //
-               public CodeComment()
-               {
-               }
-
-               public CodeComment( string text )
-               {
-                       this.text = text;
-               }
-
-               public CodeComment( string text, bool docComment )
-               {
-                       this.text = text;
-                       this.docComment = docComment;
-               }
-
-               //
-               // Properties
-               //
-               public bool DocComment {
-                       get {
-                               return docComment;
-                       }
-                       set {
-                               docComment = value;
-                       }
-               }
-               
-               public string Text {
-                       get {
-                               if (text == null)
-                                       return String.Empty;
-                               return text;
-                       }
-                       set {
-                               text = value;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeCommentStatement.cs b/mcs/class/System/System.CodeDom/CodeCommentStatement.cs
deleted file mode 100644 (file)
index d1c9216..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-//
-// System.CodeDom CodeCommentStatement Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001, 2002 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeCommentStatement
-               : CodeStatement
-       {
-               private CodeComment comment;
-               
-               //
-               // Constructors
-               //
-               public CodeCommentStatement ()
-               {
-               }
-
-               public CodeCommentStatement (CodeComment comment)
-               {
-                       this.comment = comment;
-               }
-
-               public CodeCommentStatement (string text)
-               {
-                       this.comment = new CodeComment( text );
-               }
-               
-               public CodeCommentStatement (string text, bool docComment)
-               {
-                       this.comment = new CodeComment( text, docComment );
-               }
-
-               //
-               // Properties
-               //
-               public CodeComment Comment {
-                       get {
-                               return comment;
-                       }
-                       set {
-                               comment = value;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeCommentStatementCollection.cs b/mcs/class/System/System.CodeDom/CodeCommentStatementCollection.cs
deleted file mode 100644 (file)
index 38f83ce..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-//
-// System.CodeDom CodeCommentStatementCollection Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-using System.Collections;
-
-namespace System.CodeDom 
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeCommentStatementCollection
-               : CollectionBase
-       {
-               //
-               // Constructors
-               //
-               public CodeCommentStatementCollection()
-               {
-               }
-               
-               public CodeCommentStatementCollection( CodeCommentStatement[] value )
-               {
-                       AddRange( value );
-               }
-
-               public CodeCommentStatementCollection( CodeCommentStatementCollection value )
-               {
-                       AddRange( value );
-               }
-
-               //
-               // Properties
-               //
-               public CodeCommentStatement this[int index]
-               {
-                       get {
-                               return (CodeCommentStatement)List[index];
-                       }
-                       set {
-                               List[index] = value;
-                       }
-               }
-
-               //
-               // Methods
-               //
-               public int Add (CodeCommentStatement value)
-               {
-                       return List.Add( value );
-               }
-
-               public void AddRange (CodeCommentStatement [] value )
-               {
-                       if (value == null) {
-                               throw new ArgumentNullException ("value");
-                       }
-
-                       for (int i = 0; i < value.Length; i++) {
-                               Add (value[i]);
-                       }
-               }
-               
-               public void AddRange (CodeCommentStatementCollection value)
-               {
-                       if (value == null) {
-                               throw new ArgumentNullException ("value");
-                       }
-
-                       int count = value.Count;
-                       for (int i = 0; i < count; i++) {
-                               Add (value[i]);
-                       }
-               }
-
-               public bool Contains( CodeCommentStatement value )
-               {
-                       return List.Contains( value );
-               }
-               
-               public void CopyTo( CodeCommentStatement[] array, int index )
-               {
-                       List.CopyTo( array, index );
-               }
-
-               public int IndexOf( CodeCommentStatement value )
-               {
-                       return List.IndexOf( value );
-               }
-
-               public void Insert( int index, CodeCommentStatement value )
-               {
-                       List.Insert( index, value );
-               }
-
-               public void Remove( CodeCommentStatement value )
-               {
-                       List.Remove (value);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeCompileUnit.cs b/mcs/class/System/System.CodeDom/CodeCompileUnit.cs
deleted file mode 100644 (file)
index 3ac9cc1..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-//
-// System.CodeDom CodeCompileUnit Class implementation
-//
-// Author:
-//   Daniel Stodden (stodden@in.tum.de)
-//   Marek Safar (marek.safar@seznam.cz)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-using System.Collections.Specialized;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeCompileUnit
-               : CodeObject
-       {
-               private CodeAttributeDeclarationCollection attributes;
-               private CodeNamespaceCollection namespaces;
-               private StringCollection assemblies;
-
-               //
-               // Constructors
-               //
-               public CodeCompileUnit()
-               {
-               }
-
-               //
-               // Properties
-               //
-               public CodeAttributeDeclarationCollection AssemblyCustomAttributes {
-                       get {
-                               if ( attributes == null )
-                                       attributes = 
-                                               new CodeAttributeDeclarationCollection();
-                               return attributes;
-                       }
-               }
-
-               public CodeNamespaceCollection Namespaces {
-                       get {
-                               if ( namespaces == null )
-                                       namespaces = new CodeNamespaceCollection();
-                               return namespaces;
-                       }
-               }
-
-               public StringCollection ReferencedAssemblies {
-                       get {
-                               if ( assemblies == null )
-                                       assemblies = new StringCollection();
-                               return assemblies;
-                       }
-               }
-
-               CodeDirectiveCollection startDirectives;
-               CodeDirectiveCollection endDirectives;
-
-               public CodeDirectiveCollection StartDirectives {
-                       get {
-                               if (startDirectives == null)
-                                       startDirectives = new CodeDirectiveCollection ();
-                               return startDirectives;
-                       }
-               }
-
-               public CodeDirectiveCollection EndDirectives {
-                       get {
-                               if (endDirectives == null)
-                                       endDirectives = new CodeDirectiveCollection ();
-                               return endDirectives;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeConditionStatement.cs b/mcs/class/System/System.CodeDom/CodeConditionStatement.cs
deleted file mode 100644 (file)
index d8cea1f..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-//
-// System.CodeDom CodeConditionStatement Class implementation
-//
-// Author:
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeConditionStatement
-               : CodeStatement
-       {
-               private CodeExpression condition;
-               private CodeStatementCollection trueStatements;
-               private CodeStatementCollection falseStatements;
-
-               //
-               // Constructors
-               //
-               public CodeConditionStatement()
-               {
-               }
-
-               public CodeConditionStatement( CodeExpression condition, 
-                                              params CodeStatement[] trueStatements )
-               {
-                       this.condition = condition;
-                       this.TrueStatements.AddRange( trueStatements );
-               }
-
-               public CodeConditionStatement( CodeExpression condition,
-                                              CodeStatement[] trueStatements,
-                                              CodeStatement[] falseStatements )
-               {
-                       this.condition = condition;
-                       this.TrueStatements.AddRange( trueStatements );
-                       this.FalseStatements.AddRange( falseStatements );
-               }
-               
-               //
-               // Properties
-               //
-               public CodeExpression Condition {
-                       get {
-                               return condition;
-                       }
-                       set {
-                               condition = value;
-                       }
-               }
-
-               public CodeStatementCollection FalseStatements {
-                       get {
-                               if ( falseStatements == null )
-                                       falseStatements = 
-                                               new CodeStatementCollection();
-                               return falseStatements;
-                       }
-               }
-
-               public CodeStatementCollection TrueStatements {
-                       get {
-                               if ( trueStatements == null )
-                                       trueStatements = 
-                                               new CodeStatementCollection();
-                               return trueStatements;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeConstructor.cs b/mcs/class/System/System.CodeDom/CodeConstructor.cs
deleted file mode 100644 (file)
index bf4794e..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-//
-// System.CodeDom CodeConstructor Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom 
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeConstructor
-               : CodeMemberMethod 
-       {
-               private CodeExpressionCollection baseConstructorArgs;
-               private CodeExpressionCollection chainedConstructorArgs;
-
-               //
-               // Constructors
-               //
-               public CodeConstructor()
-               {
-                       this.Name = ".ctor";
-               }
-
-               //
-               // Properties
-               //
-               public CodeExpressionCollection BaseConstructorArgs {
-                       get {
-                               if ( baseConstructorArgs == null )
-                                       baseConstructorArgs = new CodeExpressionCollection();
-
-                               return baseConstructorArgs;
-                       }
-               }
-
-               public CodeExpressionCollection ChainedConstructorArgs {
-                       get {
-                               if ( chainedConstructorArgs == null )
-                                       chainedConstructorArgs = new CodeExpressionCollection();
-
-                               return chainedConstructorArgs;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeDefaultValueExpression.cs b/mcs/class/System/System.CodeDom/CodeDefaultValueExpression.cs
deleted file mode 100644 (file)
index 750f42f..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-//
-// System.CodeDom.CodeDefaultValueExpression class
-//
-// Author:
-//     Sebastien Pouliot  <sebastien@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom {
-
-       [Serializable]
-       [ClassInterface (ClassInterfaceType.AutoDispatch)]
-       [ComVisible (true)]
-       public class CodeDefaultValueExpression : CodeExpression {
-
-               private CodeTypeReference type;
-
-
-               public CodeDefaultValueExpression ()
-               {
-               }
-
-               public CodeDefaultValueExpression (CodeTypeReference type)
-               {
-                       this.type = type;
-               }
-
-
-               public CodeTypeReference Type {
-                       get { 
-                               if (type == null) {
-                                       type = new CodeTypeReference (string.Empty);
-                               }
-                               return type; 
-                       }
-                       set { type = value; }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeDelegateCreateExpression.cs b/mcs/class/System/System.CodeDom/CodeDelegateCreateExpression.cs
deleted file mode 100644 (file)
index ec59d35..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-//
-// System.CodeDom CodeDelegateCreateExpression Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom 
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeDelegateCreateExpression
-               : CodeExpression 
-       {
-               private CodeTypeReference delegateType;
-               private string methodName;
-               private CodeExpression targetObject;
-
-               //
-               // Constructors
-               //
-               public CodeDelegateCreateExpression ()
-               {
-               }
-
-               public CodeDelegateCreateExpression (CodeTypeReference delegateType,
-                                                    CodeExpression targetObject,
-                                                    string methodName)
-               {
-                       this.delegateType = delegateType;
-                       this.targetObject = targetObject;
-                       this.methodName = methodName;
-               }
-
-
-               //
-               // Properties
-               //
-               public CodeTypeReference DelegateType {
-                       get {
-                               if (delegateType == null) {
-                                       delegateType = new CodeTypeReference (string.Empty);
-                               }
-                               return delegateType;
-                       }
-                       set {
-                               delegateType = value;
-                       }
-               }
-
-               public string MethodName {
-                       get {
-                               if (methodName == null) {
-                                       return string.Empty;
-                               }
-                               return methodName;
-                       }
-                       set {
-                               methodName = value;
-                       }
-               }
-
-               public CodeExpression TargetObject {
-                       get {
-                               return targetObject;
-                       }
-                       set {
-                               targetObject = value;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeDelegateInvokeExpression.cs b/mcs/class/System/System.CodeDom/CodeDelegateInvokeExpression.cs
deleted file mode 100644 (file)
index 76f9f5c..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-//
-// System.CodeDom CodeDelegateInvokeExpression Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeDelegateInvokeExpression
-               : CodeExpression 
-       {
-               private CodeExpressionCollection parameters;
-               private CodeExpression targetObject;
-               
-               //
-               // Constructors
-               //
-               public CodeDelegateInvokeExpression ()
-               {
-               }
-               
-               public CodeDelegateInvokeExpression (CodeExpression targetObject)
-               {
-                       this.targetObject = targetObject;
-               }
-
-               public CodeDelegateInvokeExpression (CodeExpression targetObject,
-                                                    params CodeExpression [] parameters)
-               {
-                       this.targetObject = targetObject;
-                       this.Parameters.AddRange( parameters );
-               }
-
-
-               //
-               // Properties
-               //
-               public CodeExpressionCollection Parameters {
-                       get {
-                               if ( parameters == null )
-                                       parameters = new CodeExpressionCollection();
-                               return parameters;
-                       }
-               }
-
-               public CodeExpression TargetObject {
-                       get {
-                               return targetObject;
-                       }
-                       set {
-                               targetObject = value;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeDirectionExpression.cs b/mcs/class/System/System.CodeDom/CodeDirectionExpression.cs
deleted file mode 100644 (file)
index 9bb6bd2..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-//
-// System.CodeDom FieldDirection Enum implementation
-//
-// Author:
-//   Sean MacIsaac (macisaac@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom 
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeDirectionExpression
-               : CodeExpression
-       {
-               private FieldDirection direction;
-               private CodeExpression expression;
-
-               //
-               // Constructors
-               //
-               public CodeDirectionExpression()
-               {
-               }
-
-               public CodeDirectionExpression( FieldDirection direction, 
-                                               CodeExpression expression )
-               {
-                       this.direction = direction;
-                       this.expression = expression;
-               }
-
-               //
-               // Properties
-               //
-               public FieldDirection Direction {
-                       get {
-                               return direction;
-                       }
-                       set {
-                               direction = value;
-                       }
-               }
-
-               public CodeExpression Expression {
-                       get {
-                               return expression;
-                       }
-                       set {
-                               expression = value;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeDirective.cs b/mcs/class/System/System.CodeDom/CodeDirective.cs
deleted file mode 100644 (file)
index 9895e9a..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// System.CodeDom CodeDirective class
-//
-// Author:
-//   Marek Safar (marek.safar@seznam.cz)
-//
-// (C) 2004 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ComVisible (true), ClassInterface (ClassInterfaceType.AutoDispatch)]
-       public class CodeDirective: CodeObject
-       {
-               public CodeDirective () {}
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeDirectiveCollection.cs b/mcs/class/System/System.CodeDom/CodeDirectiveCollection.cs
deleted file mode 100644 (file)
index 68f7ab2..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-//
-// System.CodeDom CodeDirectiveCollection class
-//
-// Authors:
-//     Marek Safar (marek.safar@seznam.cz)
-//     Sebastien Pouliot  <sebastien@ximian.com>
-//
-// (C) 2004 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ComVisible (true), ClassInterface (ClassInterfaceType.AutoDispatch)]
-       public class CodeDirectiveCollection: System.Collections.CollectionBase {
-
-               public CodeDirectiveCollection ()
-               {
-               }
-
-               public CodeDirectiveCollection (CodeDirective[] value)
-               {
-                       AddRange (value);
-               }
-
-               public CodeDirectiveCollection (CodeDirectiveCollection value)
-               {
-                       AddRange (value);
-               }
-
-
-               public CodeDirective this [int index] {
-                       get { return (CodeDirective) List [index]; }
-                       set { List [index] = value; }
-               }
-
-
-               public int Add (CodeDirective value)
-               {
-                       return List.Add (value);
-               }
-
-               public void AddRange (CodeDirective[] value)
-               {
-                       if (value == null) {
-                               throw new ArgumentNullException ("value");
-                       }
-
-                       for (int i = 0; i < value.Length; i++) {
-                               Add (value[i]);
-                       }
-               }
-               
-               public void AddRange (CodeDirectiveCollection value)
-               {
-                       if (value == null) {
-                               throw new ArgumentNullException ("value");
-                       }
-
-                       int count = value.Count;
-                       for (int i = 0; i < count; i++) {
-                               Add (value[i]);
-                       }
-               }
-
-               public bool Contains (CodeDirective value)
-               {
-                       return List.Contains (value);
-               }
-               
-               public void CopyTo (CodeDirective[] array, int index)
-               {
-                       List.CopyTo (array, index);
-               }
-
-               public int IndexOf (CodeDirective value)
-               {
-                       return List.IndexOf (value);
-               }
-
-               public void Insert (int index, CodeDirective value)
-               {
-                       List.Insert (index, value);
-               }
-
-               public void Remove (CodeDirective value)
-               {
-                       List.Remove (value);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeEntryPointMethod.cs b/mcs/class/System/System.CodeDom/CodeEntryPointMethod.cs
deleted file mode 100644 (file)
index 6f423d5..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-// System.CodeDom CodeEntryPointMethod Class implementation
-//
-// Author:
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeEntryPointMethod
-               : CodeMemberMethod
-       {
-               public CodeEntryPointMethod ()
-               {
-                       Attributes = MemberAttributes.Public | MemberAttributes.Static;
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeEventReferenceExpression.cs b/mcs/class/System/System.CodeDom/CodeEventReferenceExpression.cs
deleted file mode 100644 (file)
index b59d3dd..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-//
-// System.CodeDom CodeEventReferenceExpression class implementation
-//
-// Author:
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeEventReferenceExpression
-               : CodeExpression
-       {
-               private string eventName;
-               private CodeExpression targetObject;
-
-               //
-               // Constructors
-               //
-               public CodeEventReferenceExpression()
-               {
-               }
-
-               public CodeEventReferenceExpression( CodeExpression targetObject, string eventName )
-               {
-                       this.targetObject = targetObject;
-                       this.eventName = eventName;
-               }
-
-               //
-               // Properties
-               //
-               public string EventName {
-                       get {
-                               if (eventName == null) {
-                                       return string.Empty;
-                               }
-                               return eventName;
-                       }
-                       set {
-                               eventName = value;
-                       }
-               }
-               
-               public CodeExpression TargetObject {
-                       get {
-                               return targetObject;
-                       }
-                       set {
-                               targetObject = value;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeExpression.cs b/mcs/class/System/System.CodeDom/CodeExpression.cs
deleted file mode 100644 (file)
index e96d8f8..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.CodeDom CodeExpression Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom 
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeExpression
-               : CodeObject
-       {
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeExpressionCollection.cs b/mcs/class/System/System.CodeDom/CodeExpressionCollection.cs
deleted file mode 100644 (file)
index 7a1f19f..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-//
-// System.CodeDom CodeExpressionCollection Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-using System.Collections;
-
-namespace System.CodeDom 
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeExpressionCollection
-               : CollectionBase
-       {
-               //
-               // Constructors
-               //
-               public CodeExpressionCollection()
-               {
-               }
-               
-               public CodeExpressionCollection( CodeExpression[] value )
-               {
-                       AddRange( value );
-               }
-
-               public CodeExpressionCollection( CodeExpressionCollection value )
-               {
-                       AddRange( value );
-               }
-
-               //
-               // Properties
-               //
-               public CodeExpression this[int index]
-               {
-                       get {
-                               return (CodeExpression)List[index];
-                       }
-                       set {
-                               List[index] = value;
-                       }
-               }
-
-               //
-               // Methods
-               //
-               public int Add (CodeExpression value)
-               {
-                       return List.Add( value );
-               }
-
-               public void AddRange (CodeExpression [] value )
-               {
-                       if (value == null) {
-                               throw new ArgumentNullException ("value");
-                       }
-
-                       for (int i = 0; i < value.Length; i++) {
-                               Add (value[i]);
-                       }
-               }
-               
-               public void AddRange (CodeExpressionCollection value)
-               {
-                       if (value == null) {
-                               throw new ArgumentNullException ("value");
-                       }
-
-                       int count = value.Count;
-                       for (int i = 0; i < count; i++) {
-                               Add (value[i]);
-                       }
-               }
-
-               public bool Contains( CodeExpression value )
-               {
-                       return List.Contains( value );
-               }
-               
-               public void CopyTo( CodeExpression[] array, int index )
-               {
-                       List.CopyTo( array, index );
-               }
-
-               public int IndexOf( CodeExpression value )
-               {
-                       return List.IndexOf( value );
-               }
-
-               public void Insert( int index, CodeExpression value )
-               {
-                       List.Insert( index, value );
-               }
-
-               public void Remove( CodeExpression value )
-               {
-                       List.Remove (value);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeExpressionStatement.cs b/mcs/class/System/System.CodeDom/CodeExpressionStatement.cs
deleted file mode 100644 (file)
index 0e4533e..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-//
-// System.CodeDom CodeExpressionStatement Class implementation
-//
-// Author:
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeExpressionStatement
-               : CodeStatement
-       {
-               private CodeExpression expression;
-
-               //
-               // Constructors
-               //
-               public CodeExpressionStatement()
-               {
-               }
-
-               public CodeExpressionStatement(CodeExpression expression)
-               {
-                       Expression = expression;
-               }
-
-               //
-               // Properties
-               //
-               public CodeExpression Expression {
-                       get {
-                               return expression;
-                       }
-                       set {
-                               expression = value;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeFieldReferenceExpression.cs b/mcs/class/System/System.CodeDom/CodeFieldReferenceExpression.cs
deleted file mode 100644 (file)
index cf8922e..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-//
-// System.CodeDom CodeFieldReferenceExpression Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeFieldReferenceExpression
-               : CodeExpression 
-       {
-               private CodeExpression targetObject;
-               private string fieldName;
-
-               //
-               // Constructors
-               //
-               public CodeFieldReferenceExpression ()
-               {
-                       fieldName = String.Empty;
-               }
-               
-               public CodeFieldReferenceExpression (CodeExpression targetObject,
-                                                    string fieldName)
-               {
-                       this.targetObject = targetObject;
-                       this.fieldName = fieldName;
-               }
-
-               //
-               // Properties
-               //
-               public string FieldName {
-                       get {
-                               return fieldName;
-                       }
-                       set {
-                               fieldName = value;
-                       }
-               }
-
-               public CodeExpression TargetObject {
-                       get {
-                               return targetObject;
-                       }
-                       set {
-                               targetObject = value;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeGotoStatement.cs b/mcs/class/System/System.CodeDom/CodeGotoStatement.cs
deleted file mode 100644 (file)
index 57a468a..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-// System.CodeDom CodeGotoStatement Class implementation
-//
-// Author:
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeGotoStatement
-               : CodeStatement
-       {
-               private string label;
-
-               //
-               // Constructors
-               //
-               public CodeGotoStatement ()
-               {
-               }
-
-               public CodeGotoStatement (string label)
-               {
-                       Label = label;
-               }
-
-               //
-               // Properties
-               //
-               public string Label {
-                       get {
-                               return label;
-                       }
-                       set {
-                               if (value == null || value.Length == 0) {
-                                       throw new ArgumentNullException ("value");
-                               }
-                               label = value;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeIndexerExpression.cs b/mcs/class/System/System.CodeDom/CodeIndexerExpression.cs
deleted file mode 100644 (file)
index b9e881d..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-//
-// System.CodeDom CodeIndexerExpression Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom 
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeIndexerExpression
-               : CodeExpression 
-       {
-               private CodeExpression targetObject;
-               private CodeExpressionCollection indices;
-
-               //
-               // Constructors
-               //
-               public CodeIndexerExpression ()
-               {
-               }
-               
-               public CodeIndexerExpression (CodeExpression targetObject, params CodeExpression[] indices)
-               {
-                       this.targetObject = targetObject;
-                       this.Indices.AddRange( indices );
-               }
-
-               //
-               // Properties
-               //
-               public CodeExpressionCollection Indices {
-                       get {
-                               if ( indices == null )
-                                       indices = new CodeExpressionCollection();
-
-                               return indices;
-                       }
-               }
-
-               public CodeExpression TargetObject {
-                       get {
-                               return targetObject;
-                       }
-                       set {
-                               targetObject = value;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeIterationStatement.cs b/mcs/class/System/System.CodeDom/CodeIterationStatement.cs
deleted file mode 100644 (file)
index f140f64..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-//
-// System.CodeDom CodeIterationStatement Class implementation
-//
-// Author:
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeIterationStatement
-               : CodeStatement
-       {
-               private CodeStatement incrementStatement;
-               private CodeStatement initStatement;
-               private CodeStatementCollection statements;
-               private CodeExpression testExpression;
-               
-               //
-               // Constructors
-               //
-               public CodeIterationStatement()
-               {
-               }
-
-               public CodeIterationStatement( CodeStatement initStatement, 
-                                              CodeExpression testExpression,
-                                              CodeStatement incrementStatement,
-                                              params CodeStatement[] statements )
-               {
-                       this.initStatement = initStatement;
-                       this.testExpression = testExpression;
-                       this.incrementStatement = incrementStatement;
-                       this.Statements.AddRange( statements );
-               }
-
-               //
-               // Properties
-               //
-               public CodeStatement IncrementStatement {
-                       get {
-                               return incrementStatement;
-                       }
-                       set {
-                               incrementStatement = value;
-                       }
-               }
-
-               public CodeStatement InitStatement {
-                       get {
-                               return initStatement;
-                       }
-                       set {
-                               initStatement = value;
-                       }
-               }
-
-               public CodeStatementCollection Statements {
-                       get {
-                               if ( statements == null )
-                                       statements = new CodeStatementCollection();
-                               return statements;
-                       }
-               }
-
-               public CodeExpression TestExpression {
-                       get {
-                               return testExpression;
-                       }
-                       set {
-                               testExpression = value;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeLabeledStatement.cs b/mcs/class/System/System.CodeDom/CodeLabeledStatement.cs
deleted file mode 100644 (file)
index ca81185..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-//
-// System.CodeDom CodeLabeledStatement Class implementation
-//
-// Author:
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeLabeledStatement
-               : CodeStatement
-       {
-               private string label;
-               private CodeStatement statement;
-
-               //
-               // Constructors
-               //
-               public CodeLabeledStatement()
-               {
-               }
-
-               public CodeLabeledStatement( string label )
-               {
-                       this.label = label;
-               }
-
-               public CodeLabeledStatement( string label, CodeStatement statement )
-               {
-                       this.label = label;
-                       this.statement = statement;
-               }
-
-               //
-               // Properties
-               //
-               public string Label {
-                       get {
-                               if (label == null) {
-                                       return string.Empty;
-                               }
-                               return label;
-                       }
-                       set {
-                               label = value;
-                       }
-               }
-
-               public CodeStatement Statement {
-                       get {
-                               return statement;
-                       }
-                       set {
-                               statement = value;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeLinePragma.cs b/mcs/class/System/System.CodeDom/CodeLinePragma.cs
deleted file mode 100644 (file)
index 4f37a38..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-//
-// System.CodeDom CodeLinePragma Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom 
-{
-       // <summary>
-       //    Use objects of this class to keep track of locations where
-       //    statements are defined
-       // </summary>
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeLinePragma 
-       {
-               private string fileName;
-               private int lineNumber;
-               
-               //
-               // Constructors
-               //
-               public CodeLinePragma ()
-               {
-               }
-
-               public CodeLinePragma (string fileName, int lineNumber)
-               {
-                       this.fileName = fileName;
-                       this.lineNumber = lineNumber;
-               }
-               
-               //
-               // Properties
-               //
-               public string FileName {
-                       get {
-                               if (fileName == null) {
-                                       return string.Empty;
-                               }
-                               return fileName;
-                       }
-                       set {
-                               fileName = value;
-                       }
-               }
-               
-               public int LineNumber {
-                       get {
-                               return lineNumber;
-                       }
-                       set {
-                               lineNumber = value;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeMemberEvent.cs b/mcs/class/System/System.CodeDom/CodeMemberEvent.cs
deleted file mode 100644 (file)
index ff463ff..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-//
-// System.CodeDom CodeMemberEvent Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeMemberEvent
-               : CodeTypeMember
-       {
-               private CodeTypeReferenceCollection implementationTypes;
-               private CodeTypeReference privateImplementationType;
-               private CodeTypeReference type;
-               
-               //
-               // Constructors
-               //
-               public CodeMemberEvent ()
-               {
-               }
-
-               //
-               // Properties
-               //
-               public CodeTypeReferenceCollection ImplementationTypes
-               {
-                       get {
-                               if (implementationTypes == null)
-                                       implementationTypes = new CodeTypeReferenceCollection ();
-
-                               return implementationTypes;
-                       }
-               }
-
-               public CodeTypeReference PrivateImplementationType
-               {
-                       get {
-                               return privateImplementationType;
-                       }
-                       set {
-                               privateImplementationType = value;
-                       }
-               }
-
-               public CodeTypeReference Type
-               {
-                       get {
-                               if (type == null)
-                                       type = new CodeTypeReference (String.Empty);
-
-                               return type;
-                       }
-                       set {
-                               type = value;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeMemberField.cs b/mcs/class/System/System.CodeDom/CodeMemberField.cs
deleted file mode 100644 (file)
index d143d87..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-//
-// System.CodeDom CodeMemberField Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom 
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeMemberField
-               : CodeTypeMember
-       {
-               private CodeExpression initExpression;
-               private CodeTypeReference type;
-               
-               public CodeMemberField ()
-               {
-               }
-
-               public CodeMemberField (CodeTypeReference type, string name)
-               {
-                       this.type = type;
-                       this.Name = name;
-               }
-               
-               public CodeMemberField (string type, string name)
-               {
-                       this.type = new CodeTypeReference( type );
-                       this.Name = name;
-               }
-                       
-               public CodeMemberField (Type type, string name)
-               {
-                       this.type = new CodeTypeReference( type );
-                       this.Name = name;
-               }
-
-               //
-               // Properties
-               //
-               public CodeExpression InitExpression {
-                       get {
-                               return initExpression;
-                       }
-                       set {
-                               initExpression = value;
-                       }
-               }
-
-               public CodeTypeReference Type {
-                       get {
-                               if (type == null) {
-                                       type = new CodeTypeReference (
-                                                       string.Empty);
-                               }
-                               return type;
-                       }
-                       set {
-                               type = value;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeMemberMethod.cs b/mcs/class/System/System.CodeDom/CodeMemberMethod.cs
deleted file mode 100644 (file)
index 9ef0707..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-//
-// System.CodeDom CodeMemberMethod Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom 
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeMemberMethod
-               : CodeTypeMember 
-       {
-               private CodeTypeReferenceCollection implementationTypes;
-               private CodeParameterDeclarationExpressionCollection parameters;
-               private CodeTypeReference privateImplements;
-               private CodeTypeReference returnType;
-               private CodeStatementCollection statements;
-               private CodeAttributeDeclarationCollection returnAttributes;
-               //int populated;
-
-               CodeTypeParameterCollection typeParameters;
-               //
-               // Constructors
-               //
-               public CodeMemberMethod()
-               {
-               }
-
-               //
-               // Properties
-               // 
-               public CodeTypeReferenceCollection ImplementationTypes {
-                       get {
-                               if ( implementationTypes == null ) {
-                                       implementationTypes = new CodeTypeReferenceCollection();
-                                       if ( PopulateImplementationTypes != null )
-                                               PopulateImplementationTypes( this, EventArgs.Empty );
-                               }
-                               return implementationTypes;
-                       }
-               }
-
-               public CodeParameterDeclarationExpressionCollection Parameters {
-                       get {
-                               if ( parameters == null ) {
-                                       parameters = new CodeParameterDeclarationExpressionCollection();
-                                       if ( PopulateParameters != null )
-                                               PopulateParameters( this, EventArgs.Empty );
-                               }
-                               return parameters;
-                       }
-               }
-
-               public CodeTypeReference PrivateImplementationType {
-                       get {
-                               return privateImplements;
-                       }
-                       set {
-                               privateImplements = value;
-                       }
-               }
-
-               public CodeTypeReference ReturnType {
-                       get {
-                               if ( returnType == null )
-                                       return new CodeTypeReference (typeof (void));
-                               return returnType;
-                       }
-                       set {
-                               returnType = value;
-                       }
-               }
-
-               public CodeStatementCollection Statements {
-                       get {
-                               if ( statements == null ) {
-                                       statements = new CodeStatementCollection();
-                                       if ( PopulateStatements != null )
-                                               PopulateStatements( this, EventArgs.Empty );
-                               }
-                               return statements;
-                       }
-               }
-
-               public CodeAttributeDeclarationCollection ReturnTypeCustomAttributes {
-                       get {
-                               if ( returnAttributes == null )
-                                       returnAttributes = new CodeAttributeDeclarationCollection();
-                               
-                               return returnAttributes;
-                       }
-               }
-
-               [ComVisible (false)]
-               public CodeTypeParameterCollection TypeParameters {
-                       get {
-                               if (typeParameters == null)
-                                       typeParameters = new CodeTypeParameterCollection ();
-                               return typeParameters;
-                       }
-               }
-
-               //
-               // Events
-               //
-               public event EventHandler PopulateImplementationTypes;
-
-               public event EventHandler PopulateParameters;
-
-               public event EventHandler PopulateStatements;
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeMemberProperty.cs b/mcs/class/System/System.CodeDom/CodeMemberProperty.cs
deleted file mode 100644 (file)
index cfc9714..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-//
-// System.CodeDom CodeMemberProperty Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeMemberProperty
-               : CodeTypeMember
-       {
-               private CodeStatementCollection getStatements;
-               private bool hasGet;
-               private bool hasSet;
-               private CodeTypeReferenceCollection implementationTypes;
-               private CodeParameterDeclarationExpressionCollection parameters;
-               private CodeTypeReference privateImplementationType;
-               private CodeStatementCollection setStatements;
-               private CodeTypeReference type;
-               
-               //
-               // Constructors
-               //
-               public CodeMemberProperty ()
-               {
-               }
-
-               //
-               // Properties
-               //
-               public CodeStatementCollection GetStatements {
-                       get {
-                               if ( getStatements == null )
-                                       getStatements = new CodeStatementCollection();
-                               return getStatements;
-                       }
-               }
-
-               public bool HasGet {
-                       get {
-                               return (hasGet || (getStatements != null && getStatements.Count > 0));
-                       }
-                       set {
-                               hasGet = value;
-                               if (!hasGet && getStatements != null)
-                                       getStatements.Clear ();
-                                       
-                       }
-               }
-               
-               public bool HasSet {
-                       get {
-                               return (hasSet || (setStatements != null && setStatements.Count > 0));
-                       }
-                       set {
-                               hasSet = value;
-                               if (!hasSet && setStatements != null)
-                                       setStatements.Clear ();
-                       }
-               }
-
-               public CodeTypeReferenceCollection ImplementationTypes {
-                       get {
-                               if ( implementationTypes == null )
-                                       implementationTypes = new CodeTypeReferenceCollection();
-                               return implementationTypes;
-                       }
-               }
-
-               public CodeParameterDeclarationExpressionCollection Parameters {
-                       get {
-                               if ( parameters == null )
-                                       parameters = new CodeParameterDeclarationExpressionCollection();
-                               return parameters;
-                       }
-               }
-
-               public CodeTypeReference PrivateImplementationType {
-                       get {
-                               return privateImplementationType;
-                       }
-                       set {
-                               privateImplementationType = value;
-                       }
-               }
-
-               public CodeStatementCollection SetStatements {
-                       get {
-                               if ( setStatements == null )
-                                       setStatements = new CodeStatementCollection();
-                               return setStatements;
-                       }
-               }
-
-               public CodeTypeReference Type {
-                       get {
-                               if (type == null) {
-                                       type = new CodeTypeReference(string.Empty);
-                               }
-                               return type;
-                       }
-                       set {
-                               type = value;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeMethodInvokeExpression.cs b/mcs/class/System/System.CodeDom/CodeMethodInvokeExpression.cs
deleted file mode 100644 (file)
index d802646..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-//
-// System.CodeDom CodeMethodInvokeExpression Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom 
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeMethodInvokeExpression
-               : CodeExpression 
-       {
-               private CodeMethodReferenceExpression method;
-               private CodeExpressionCollection parameters;
-               
-               //
-               // Constructors
-               //
-               public CodeMethodInvokeExpression () 
-               {
-               }
-
-               public CodeMethodInvokeExpression (CodeMethodReferenceExpression method, params CodeExpression[] parameters)
-               {
-                       this.method = method;
-                       this.Parameters.AddRange( parameters );
-               }
-
-               public CodeMethodInvokeExpression (CodeExpression targetObject,
-                                                  string methodName,
-                                                  params CodeExpression [] parameters)
-               {
-                       this.method = new CodeMethodReferenceExpression( targetObject, methodName );
-                       this.Parameters.AddRange (parameters);
-               }
-
-               //
-               // Properties
-               //
-               public CodeMethodReferenceExpression Method {
-                       get {
-                               if (method == null) {
-                                       method = new CodeMethodReferenceExpression ();
-                               }
-                               return method;
-                       }
-                       set {
-                               method = value;
-                       }
-               }
-
-               public CodeExpressionCollection Parameters {
-                       get {
-                               if ( parameters == null )
-                                       parameters = new CodeExpressionCollection();
-                               return parameters;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeMethodReferenceExpression.cs b/mcs/class/System/System.CodeDom/CodeMethodReferenceExpression.cs
deleted file mode 100644 (file)
index 40da67b..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-//
-// System.CodeDom CodeMethodInvokeExpression Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//   Marek Safar (marek.safar@seznam.cz)
-//
-// (C) 2001 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom 
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeMethodReferenceExpression
-               : CodeExpression 
-       {
-               private string methodName;
-               private CodeExpression targetObject;
-               CodeTypeReferenceCollection typeArguments;
-               
-               //
-               // Constructors
-               //
-               public CodeMethodReferenceExpression ()
-               {
-               }
-
-               public CodeMethodReferenceExpression (CodeExpression targetObject, 
-                                                     string methodName)
-               {
-                       this.targetObject = targetObject;
-                       this.methodName = methodName;
-               }
-
-               public CodeMethodReferenceExpression (CodeExpression targetObject, 
-                       string methodName, params CodeTypeReference[] typeParameters) :
-                       this (targetObject, methodName)
-               {
-                       if (typeParameters != null && typeParameters.Length > 0)
-                               TypeArguments.AddRange (typeParameters);
-               }
-
-               //
-               // Properties
-               //
-               public string MethodName {
-                       get {
-                               if (methodName == null) {
-                                       return string.Empty;
-                               }
-                               return methodName;
-                       }
-                       set {
-                               methodName = value;
-                       }
-               }
-
-               public CodeExpression TargetObject {
-                       get {
-                               return targetObject;
-                       }
-                       set {
-                               targetObject = value;
-                       }
-               }
-
-               [ComVisible (false)]
-               public CodeTypeReferenceCollection TypeArguments {
-                       get {
-                               if (typeArguments == null)
-                                       typeArguments = new CodeTypeReferenceCollection ();
-                               return typeArguments;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeMethodReturnStatement.cs b/mcs/class/System/System.CodeDom/CodeMethodReturnStatement.cs
deleted file mode 100644 (file)
index 4316b58..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-//
-// System.CodeDom CodeMethodReturnStatement class implementation
-//
-// Author:
-//   Sean MacIsaac (macisaac@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeMethodReturnStatement
-               : CodeStatement
-       {
-               private CodeExpression expression;
-
-               //
-               // Constructors
-               //
-               public CodeMethodReturnStatement()
-               {
-               }
-               
-               public CodeMethodReturnStatement( CodeExpression expression )
-               {
-                       this.expression = expression;
-               }
-               
-               //
-               // Properties
-               //
-               public CodeExpression Expression {
-                       get {
-                               return expression;
-                       }
-                       set {
-                               expression = value;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeNamespace.cs b/mcs/class/System/System.CodeDom/CodeNamespace.cs
deleted file mode 100644 (file)
index 7940975..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-//
-// System.CodeDom CodeNamespace Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeNamespace
-               : CodeObject
-       {
-               private CodeCommentStatementCollection comments;
-               private CodeNamespaceImportCollection imports;
-               //private CodeNamespaceCollection namespaces;
-               private CodeTypeDeclarationCollection classes;
-               private string name;
-               //int populated;
-
-               //
-               // Constructors
-               //
-               public CodeNamespace()
-               {
-               }
-
-               public CodeNamespace(string name)
-               {
-                       this.name = name;
-               }
-
-               //
-               // Properties
-               //
-               public CodeCommentStatementCollection Comments {
-                       get {
-                               if ( comments == null ) {
-                                       comments = new CodeCommentStatementCollection();
-                                       if ( PopulateComments != null )
-                                               PopulateComments( this, EventArgs.Empty );
-                               }
-                               return comments;
-                       }
-               }
-
-               public CodeNamespaceImportCollection Imports {
-                       get {
-                               if ( imports == null ) {
-                                       imports = new CodeNamespaceImportCollection();
-                                       if ( PopulateImports != null )
-                                               PopulateImports( this, EventArgs.Empty );
-                               }
-                               return imports;
-                       }
-                       internal set {
-                               imports = value;
-                       }
-               }
-
-               public string Name {
-                       get {
-                               if (name == null) {
-                                       return string.Empty;
-                               }
-                               return name;
-                       }
-                       set {
-                               name = value;
-                       }
-               }
-
-               public CodeTypeDeclarationCollection Types {
-                       get {
-                               if ( classes == null ) {
-                                       classes = new CodeTypeDeclarationCollection();
-                                       if ( PopulateTypes != null )
-                                               PopulateTypes( this, EventArgs.Empty );
-                               }
-                               return classes;
-                       }
-               }
-
-               //
-               // Events
-               //
-               public event EventHandler PopulateComments;
-               
-               public event EventHandler PopulateImports;
-               
-               public event EventHandler PopulateTypes;
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeNamespaceCollection.cs b/mcs/class/System/System.CodeDom/CodeNamespaceCollection.cs
deleted file mode 100644 (file)
index f2bfbcd..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-//
-// System.CodeDom CodeNamespaceCollection Class implementation
-//
-// Author:
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-using System.Collections;
-
-namespace System.CodeDom 
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeNamespaceCollection
-               : CollectionBase
-       {
-               //
-               // Constructors
-               //
-               public CodeNamespaceCollection()
-               {
-               }
-
-               public CodeNamespaceCollection( CodeNamespace[] value )
-               {
-                       AddRange( value );
-               }
-
-               public CodeNamespaceCollection( CodeNamespaceCollection value )
-               {
-                       AddRange( value );
-               }
-               
-               //
-               // Properties
-               //
-               public CodeNamespace this[int index]
-               {
-                       get {
-                               return (CodeNamespace)List[index];
-                       }
-                       set {
-                               List[index] = value;
-                       }
-               }
-
-               //
-               // Methods
-               //
-               public int Add (CodeNamespace value)
-               {
-                       return List.Add (value); 
-               }
-
-               public void AddRange (CodeNamespace [] value )
-               {
-                       if (value == null) {
-                               throw new ArgumentNullException ("value");
-                       }
-
-                       for (int i = 0; i < value.Length; i++) {
-                               Add (value[i]);
-                       }
-               }
-               
-               public void AddRange (CodeNamespaceCollection value)
-               {
-                       if (value == null) {
-                               throw new ArgumentNullException ("value");
-                       }
-
-                       int count = value.Count;
-                       for (int i = 0; i < count; i++) {
-                               Add (value[i]);
-                       }
-               }
-
-               public bool Contains( CodeNamespace value )
-               {
-                       return List.Contains( value );
-               }
-               
-               public void CopyTo( CodeNamespace[] array, int index )
-               {
-                       List.CopyTo( array, index );
-               }
-
-               public int IndexOf( CodeNamespace value )
-               {
-                       return List.IndexOf( value );
-               }
-
-               public void Insert( int index, CodeNamespace value )
-               {
-                       List.Insert( index, value );
-               }
-
-               public void Remove( CodeNamespace value )
-               {
-                       List.Remove (value);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeNamespaceImport.cs b/mcs/class/System/System.CodeDom/CodeNamespaceImport.cs
deleted file mode 100644 (file)
index fc501d1..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// System.CodeDom CodeNamespaceImport Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeNamespaceImport
-               : CodeObject 
-       {
-               private CodeLinePragma linePragma;
-               private string nameSpace;
-               
-               //
-               // Constructors
-               //
-               public CodeNamespaceImport ()
-               {
-               }
-
-               public CodeNamespaceImport (string nameSpace)
-               {
-                       this.nameSpace = nameSpace;
-               }
-
-               //
-               // Properties
-               //
-               public CodeLinePragma LinePragma {
-                       get {
-                               return linePragma;
-                       }
-                       set {
-                               linePragma = value;
-                       }
-               }
-
-               public string Namespace {
-                       get {
-                               if (nameSpace == null) {
-                                       return string.Empty;
-                               }
-                               return nameSpace;
-                       }
-                       set {
-                               nameSpace = value;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeNamespaceImportCollection.cs b/mcs/class/System/System.CodeDom/CodeNamespaceImportCollection.cs
deleted file mode 100644 (file)
index da5c905..0000000
+++ /dev/null
@@ -1,225 +0,0 @@
-//
-// System.CodeDom CodeNamespaceImportCollection Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-using System.Collections;
-
-namespace System.CodeDom
-{
-       /*
-        * Should probably be derived from CollectionBase like any
-        * other System.CodeDom.*Collection. MS docs say it currently
-        * is not, for whichever reason.
-        */
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeNamespaceImportCollection
-               : IList, ICollection, IEnumerable
-       {
-               private Hashtable keys;
-               private ArrayList data;
-
-               //
-               // Constructors
-               //
-               public CodeNamespaceImportCollection ()
-               {
-                       data = new ArrayList ();
-                       keys = new Hashtable (CaseInsensitiveHashCodeProvider.Default, CaseInsensitiveComparer.Default);
-               }
-
-               //
-               // Properties
-               //
-               int ICollection.Count {
-                       get {
-                               return data.Count;
-                       }
-               }
-               
-               public int Count {
-                       get {
-                               return data.Count;
-                       }
-               }
-
-               public CodeNamespaceImport this [int index] {
-                       get {
-                               return (CodeNamespaceImport)data[index];
-                       }
-                       set {
-                               CodeNamespaceImport oldImport = (CodeNamespaceImport) data [index];
-                               CodeNamespaceImport newImport = (CodeNamespaceImport) value;
-                               keys.Remove (oldImport.Namespace);
-                               data[index] = value;
-                               keys [newImport.Namespace] = newImport;
-                       }
-               }
-
-               //
-               // Methods
-               //
-               public void Add (CodeNamespaceImport value)
-               {
-                       if (value == null) {
-                               throw new NullReferenceException ();
-                       }
-
-                       if (!keys.ContainsKey (value.Namespace)) {
-                               keys [value.Namespace] = value;
-                               data.Add (value);
-                       }
-               }
-
-               public void AddRange (CodeNamespaceImport [] value)
-               {
-                       if (value == null) {
-                               throw new ArgumentNullException ("value");
-                       }
-
-                       foreach (CodeNamespaceImport elem in value) {
-                               Add (elem);
-                       }
-               }
-
-               void IList.Clear ()
-               {
-                       Clear ();
-               }
-               
-               public void Clear ()
-               {
-                       data.Clear ();
-                       keys.Clear ();
-               }
-
-               // IList implementation
-               bool IList.IsFixedSize {
-                       get {
-                               return false;
-                       }
-               }
-
-               bool IList.IsReadOnly {
-                       get {
-                               return false;
-                       }
-               }
-
-               object IList.this[int index] {
-                       get {
-                               return data[index];
-                       }
-                       set {
-                               this [index] = (CodeNamespaceImport) value;
-                       }
-               }
-
-               int IList.Add( object value )
-               {
-                       Add ((CodeNamespaceImport) value);
-                       return data.Count - 1;
-               }
-               
-               bool IList.Contains( object value )
-               {
-                       return data.Contains( value );
-               }
-               
-               int IList.IndexOf( object value )
-               {
-                       return data.IndexOf( value );
-               }
-
-               void IList.Insert( int index, object value )
-               {
-                       data.Insert( index, value );
-                       CodeNamespaceImport import = (CodeNamespaceImport) value;
-                       keys [import.Namespace] = import;
-               }
-
-               void IList.Remove( object value )
-               {
-                       string ns = ((CodeNamespaceImport)value).Namespace;
-                       data.Remove( value );
-                       foreach (CodeNamespaceImport import in data) {
-                               if (import.Namespace == ns) {
-                                       keys [ns] = import;
-                                       return;
-                               }
-                       }
-                       keys.Remove (ns);
-               }
-               
-               void IList.RemoveAt( int index )
-               {
-                       string ns = this [index].Namespace;
-                       data.RemoveAt( index );
-                       foreach (CodeNamespaceImport import in data) {
-                               if (import.Namespace == ns) {
-                                       keys [ns] = import;
-                                       return;
-                               }
-                       }
-                       keys.Remove (ns);
-               }
-
-               // ICollection implementation
-               object ICollection.SyncRoot {
-                       get {
-                               return null;
-                       }
-               }
-
-               bool ICollection.IsSynchronized {
-                       get {
-                               return data.IsSynchronized;
-                       }
-               }
-
-               void ICollection.CopyTo( Array array, int index )
-               {
-                       data.CopyTo( array, index );
-               }
-
-               // IEnumerable implementation
-               IEnumerator IEnumerable.GetEnumerator ()
-               {
-                       return data.GetEnumerator();
-               }
-               
-               // IEnumerable implementation
-               public IEnumerator GetEnumerator ()
-               {
-                       return data.GetEnumerator();
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeObject.cs b/mcs/class/System/System.CodeDom/CodeObject.cs
deleted file mode 100644 (file)
index 67326cd..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// System.CodeDom CodeObject class implementation
-//
-// Author:
-//   Sean MacIsaac (macisaac@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-using System.Collections;
-using System.Collections.Specialized;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeObject
-       {
-               private IDictionary userData;
-
-               //
-               // Properties
-               //
-               public IDictionary UserData {
-                       get {
-                               if ( userData == null )
-                                       userData = new ListDictionary();
-                               return userData;
-                       }
-               }
-
-               internal virtual void Accept (ICodeDomVisitor visitor)
-               {
-                       throw new NotImplementedException ();
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeObjectCreateExpression.cs b/mcs/class/System/System.CodeDom/CodeObjectCreateExpression.cs
deleted file mode 100644 (file)
index 5babdf0..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-//
-// System.CodeDom CodeObjectCreateExpression Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom 
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeObjectCreateExpression
-               : CodeExpression 
-       {
-               private CodeTypeReference createType;
-               private CodeExpressionCollection parameters;
-               
-               //
-               // Constructors
-               //
-               public CodeObjectCreateExpression () 
-               {
-               }
-
-               public CodeObjectCreateExpression (CodeTypeReference createType, 
-                                                  params CodeExpression [] parameters)
-               {
-                       this.createType = createType;
-                       this.Parameters.AddRange( parameters );
-               }
-
-               public CodeObjectCreateExpression (string createType, 
-                                                  params CodeExpression [] parameters)
-               {
-                       this.createType = new CodeTypeReference( createType );
-                       this.Parameters.AddRange( parameters );
-               }
-
-               public CodeObjectCreateExpression (Type createType, 
-                                                  params CodeExpression [] parameters)
-               {
-                       this.createType = new CodeTypeReference( createType );
-                       this.Parameters.AddRange( parameters );
-               }
-
-               //
-               // Properties
-               //
-               public CodeTypeReference CreateType {
-                       get {
-                               if (createType == null) {
-                                       createType = new CodeTypeReference (string.Empty);
-                               }
-                               return createType;
-                       }
-                       set {
-                               createType = value;
-                       }
-               }
-
-               public CodeExpressionCollection Parameters {
-                       get {
-                               if ( parameters == null )
-                                       parameters = new CodeExpressionCollection();
-                               return parameters;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeParameterDeclarationExpression.cs b/mcs/class/System/System.CodeDom/CodeParameterDeclarationExpression.cs
deleted file mode 100644 (file)
index 9df391d..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-//
-// System.CodeDom CodeParameterDeclarationExpression Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeParameterDeclarationExpression
-               : CodeExpression 
-       {
-               private CodeAttributeDeclarationCollection customAttributes;
-               private FieldDirection direction;
-               private string name;
-               private CodeTypeReference type;
-
-               //
-               // Constructors
-               //
-               public CodeParameterDeclarationExpression ()
-               {
-               }
-
-               public CodeParameterDeclarationExpression( CodeTypeReference type, string name )
-               {
-                       this.type = type;
-                       this.name = name;
-               }
-
-               public CodeParameterDeclarationExpression (string type, string name)
-               {
-                       this.type = new CodeTypeReference( type );
-                       this.name = name;
-               }
-
-               public CodeParameterDeclarationExpression (Type type, string name)
-               {
-                       this.type = new CodeTypeReference( type );
-                       this.name = name;
-               }
-
-               //
-               // Properties
-               //
-               public CodeAttributeDeclarationCollection CustomAttributes {
-                       get {
-                               if ( customAttributes == null )
-                                       customAttributes = new CodeAttributeDeclarationCollection();
-                               return customAttributes;
-                       }
-                       set {
-                               customAttributes = value;
-                       }
-               }
-
-               public FieldDirection Direction {
-                       get {
-                               return direction;
-                       }
-                       set {
-                               direction = value;
-                       }
-               }
-
-               public string Name {
-                       get {
-                               if (name == null) {
-                                       return string.Empty;
-                               }
-                               return name;
-                       }
-                       set {
-                               name = value;
-                       }
-               }
-
-               public CodeTypeReference Type {
-                       get {
-                               if (type == null) {
-                                       type = new CodeTypeReference (string.Empty);
-                               }
-                               return type;
-                       }
-                       set {
-                               type = value;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeParameterDeclarationExpressionCollection.cs b/mcs/class/System/System.CodeDom/CodeParameterDeclarationExpressionCollection.cs
deleted file mode 100644 (file)
index 67e8634..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-//
-// System.CodeDom CodeParameterDeclarationExpressionCollection Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-using System.Collections;
-
-namespace System.CodeDom 
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeParameterDeclarationExpressionCollection
-               : CollectionBase
-       {
-               //
-               // Constructors
-               //
-               public CodeParameterDeclarationExpressionCollection()
-               {
-               }
-
-               public CodeParameterDeclarationExpressionCollection( CodeParameterDeclarationExpression[] value )
-               {
-                       AddRange( value );
-               }
-               
-               public CodeParameterDeclarationExpressionCollection( CodeParameterDeclarationExpressionCollection value )
-               {
-                       AddRange( value );
-               }
-
-               //
-               // Properties
-               //
-               public CodeParameterDeclarationExpression this[int index]
-               {
-                       get {
-                               return (CodeParameterDeclarationExpression)List[index];
-                       }
-                       set {
-                               List[index] = value;
-                       }
-               }
-
-               //
-               // Methods
-               //
-               public int Add (CodeParameterDeclarationExpression value)
-               {
-                       return List.Add( value );
-               }
-
-               public void AddRange (CodeParameterDeclarationExpression [] value )
-               {
-                       if (value == null) {
-                               throw new ArgumentNullException ("value");
-                       }
-
-                       for (int i = 0; i < value.Length; i++) {
-                               Add (value[i]);
-                       }
-               }
-               
-               public void AddRange (CodeParameterDeclarationExpressionCollection value)
-               {
-                       if (value == null) {
-                               throw new ArgumentNullException ("value");
-                       }
-
-                       int count = value.Count;
-                       for (int i = 0; i < count; i++) {
-                               Add (value[i]);
-                       }
-               }
-
-               public bool Contains( CodeParameterDeclarationExpression value )
-               {
-                       return List.Contains( value );
-               }
-               
-               public void CopyTo( CodeParameterDeclarationExpression[] array, int index )
-               {
-                       List.CopyTo( array, index );
-               }
-
-               public int IndexOf( CodeParameterDeclarationExpression value )
-               {
-                       return List.IndexOf( value );
-               }
-
-               public void Insert( int index, CodeParameterDeclarationExpression value )
-               {
-                       List.Insert( index, value );
-               }
-
-               public void Remove( CodeParameterDeclarationExpression value )
-               {
-                       List.Remove (value);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodePrimitiveExpression.cs b/mcs/class/System/System.CodeDom/CodePrimitiveExpression.cs
deleted file mode 100644 (file)
index 090d255..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-//
-// System.CodeDom CodePrimitiveExpression Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom 
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodePrimitiveExpression
-               : CodeExpression 
-       {
-               private object value;
-
-               //
-               // Constructors
-               //
-               public CodePrimitiveExpression ()
-               {
-               }
-
-               public CodePrimitiveExpression (Object value)
-               {
-                       this.value = value;
-               }
-
-               //
-               // Properties
-               //
-               public object Value {
-                       get {
-                               return this.value;
-                       }
-                       set {
-                               this.value = value;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodePropertyReferenceExpression.cs b/mcs/class/System/System.CodeDom/CodePropertyReferenceExpression.cs
deleted file mode 100644 (file)
index 44f0222..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-//
-// System.CodeDom CodePropertyReferenceExpression Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodePropertyReferenceExpression
-               : CodeExpression 
-       {
-               private CodeExpression targetObject;
-               private string propertyName;
-               
-               //
-               // Constructors
-               //
-               public CodePropertyReferenceExpression () 
-               {
-               }
-
-               public CodePropertyReferenceExpression (CodeExpression targetObject,
-                                                       string propertyName)
-               {
-                       this.targetObject = targetObject;
-                       this.propertyName = propertyName;
-               }
-
-               //
-               // Properties
-               //
-               public string PropertyName {
-                       get {
-                               if (propertyName == null) {
-                                       return string.Empty;
-                               }
-                               return propertyName;
-                       }
-                       set {
-                               propertyName = value;
-                       }
-               }
-
-               public CodeExpression TargetObject {
-                       get {
-                               return targetObject;
-                       }
-                       set {
-                               targetObject = value;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodePropertySetValueReferenceExpression.cs b/mcs/class/System/System.CodeDom/CodePropertySetValueReferenceExpression.cs
deleted file mode 100644 (file)
index d977a43..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// System.CodeDom CodePropertySetValueReferenceExpression Class implementation
-//
-// Author:
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodePropertySetValueReferenceExpression
-               : CodeExpression
-       {
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeRegionDirective.cs b/mcs/class/System/System.CodeDom/CodeRegionDirective.cs
deleted file mode 100644 (file)
index 4f8c967..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-//
-// System.CodeDom CodeRegionDirective class
-//
-// Author:
-//   Marek Safar (marek.safar@seznam.cz)
-//
-// (C) 2004 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ComVisible (true), ClassInterface (ClassInterfaceType.AutoDispatch)]
-       public class CodeRegionDirective: CodeDirective
-       {
-               CodeRegionMode regionMode;
-               string regionText;
-
-               public CodeRegionDirective () {}
-
-               public CodeRegionDirective (CodeRegionMode regionMode, string regionText)
-               {
-                       this.regionMode = regionMode;
-                       this.regionText = regionText;
-               }
-
-               public CodeRegionMode RegionMode {
-                       get {
-                               return regionMode;
-                       }
-                       set {
-                               regionMode = value;
-                       }
-               }
-
-               public string RegionText {
-                       get {
-                               if (regionText == null) {
-                                       return string.Empty;
-                               }
-                               return regionText;
-                       }
-                       set {
-                               regionText = value;
-                       }
-               }
-       }
-}
-
diff --git a/mcs/class/System/System.CodeDom/CodeRegionMode.cs b/mcs/class/System/System.CodeDom/CodeRegionMode.cs
deleted file mode 100644 (file)
index 8769138..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.CodeDom CodeRegionMode enum
-//
-// Author:
-//   Marek Safar (marek.safar@seznam.cz)
-//
-// (C) 2004 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ComVisible (true)]
-       public enum CodeRegionMode
-       {
-               None = 0,
-               Start = 1,
-               End = 1 << 1
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeRemoveEventStatement.cs b/mcs/class/System/System.CodeDom/CodeRemoveEventStatement.cs
deleted file mode 100644 (file)
index cad191b..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-//
-// System.CodeDom CodeRemoveEventStatement Class implementation
-//
-// Author:
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom 
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeRemoveEventStatement
-               : CodeStatement 
-       {
-               private CodeEventReferenceExpression eventRef;
-               private CodeExpression listener;
-
-               //
-               // Constructors
-               //
-               public CodeRemoveEventStatement ()
-               {
-               }
-
-               public CodeRemoveEventStatement (CodeEventReferenceExpression eventRef,
-                                                CodeExpression listener)
-               {
-                       this.eventRef = eventRef;
-                       this.listener = listener;
-               }
-
-               public CodeRemoveEventStatement (CodeExpression targetObject,
-                                                string eventName,
-                                                CodeExpression listener)
-               {
-                       this.eventRef = new CodeEventReferenceExpression( targetObject,
-                                                                         eventName );
-                       this.listener = listener;
-               }
-
-               //
-               // Properties
-               //
-               public CodeEventReferenceExpression Event {
-                       get {
-                               if (eventRef == null) {
-                                       eventRef = new CodeEventReferenceExpression ();
-                               }
-                               return eventRef;
-                       }
-                       set {
-                               eventRef = value;
-                       }
-               }
-
-               public CodeExpression Listener {
-                       get {
-                               return listener; 
-                       }
-                       set {
-                               listener = value;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
-
diff --git a/mcs/class/System/System.CodeDom/CodeSnippetCompileUnit.cs b/mcs/class/System/System.CodeDom/CodeSnippetCompileUnit.cs
deleted file mode 100644 (file)
index 422ab2c..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// System.CodeDom CodeSnippetCompileUnit Class implementation
-//
-// Author:
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeSnippetCompileUnit
-               : CodeCompileUnit
-       {
-               private CodeLinePragma linePragma;
-               private string value;
-
-               //
-               // Constructors
-               //
-               public CodeSnippetCompileUnit ()
-               {
-               }
-
-               public CodeSnippetCompileUnit( string value )
-               {
-                       this.value = value;
-               }
-
-               //
-               // Properties
-               //
-               public CodeLinePragma LinePragma {
-                       get {
-                               return linePragma;
-                       }
-                       set {
-                               linePragma = value;
-                       }
-               }
-
-               public string Value {
-                       get {
-                               if (this.value == null) {
-                                       return string.Empty;
-                               }
-                               return this.value;
-                       }
-                       set {
-                               this.value = value;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeSnippetExpression.cs b/mcs/class/System/System.CodeDom/CodeSnippetExpression.cs
deleted file mode 100644 (file)
index 1fb8d86..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-// System.CodeDom CodeSnippetExpression Class implementation
-//
-// Author:
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeSnippetExpression
-               : CodeExpression 
-       {
-               private string value;
-
-               //
-               // Constructors
-               //
-               public CodeSnippetExpression()
-               {
-               }
-
-               public CodeSnippetExpression( string value )
-               {
-                       this.value = value;
-               }
-               
-               //
-               // Properties
-               //
-               public string Value {
-                       get {
-                               if (this.value == null) {
-                                       return string.Empty;
-                               }
-                               return this.value;
-                       }
-                       set {
-                               this.value = value;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeSnippetStatement.cs b/mcs/class/System/System.CodeDom/CodeSnippetStatement.cs
deleted file mode 100644 (file)
index c717313..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-//
-// System.CodeDom CodeSnippetStatement Class implementation
-//
-// Author:
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeSnippetStatement
-               : CodeStatement 
-       {
-               private string value;
-
-               //
-               // Constructors
-               //
-               public CodeSnippetStatement()
-               {
-               }
-
-               public CodeSnippetStatement( string value )
-               {
-                       this.value = value;
-               }
-               
-               //
-               // Properties
-               //
-               public string Value {
-                       get {
-                               if (this.value == null) {
-                                       return string.Empty;
-                               }
-                               return this.value;
-                       }
-                       set {
-                               this.value = value;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeSnippetTypeMember.cs b/mcs/class/System/System.CodeDom/CodeSnippetTypeMember.cs
deleted file mode 100644 (file)
index b51cd8d..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-// System.CodeDom CodeSnippetTypeMember Class implementation
-//
-// Author:
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeSnippetTypeMember
-               : CodeTypeMember
-       {
-               private string text;
-
-               //
-               // Constructors
-               //
-               public CodeSnippetTypeMember()
-               {
-               }
-               
-               public CodeSnippetTypeMember( string text )
-               {
-                       this.text = text;
-               }
-
-               //
-               // Properties
-               //
-               public string Text {
-                       get {
-                               if (text == null) {
-                                       return string.Empty;
-                               }
-                               return text;
-                       }
-                       set {
-                               text = value;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeStatement.cs b/mcs/class/System/System.CodeDom/CodeStatement.cs
deleted file mode 100644 (file)
index fa60b58..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-//
-// System.CodeDom CodeStatement class implementation
-//
-// Author:
-//   Sean MacIsaac (macisaac@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//   Marek Safar (marek.safar@seznam.cz)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeStatement
-               : CodeObject
-       {
-               private CodeLinePragma linePragma;
-
-               CodeDirectiveCollection endDirectives;
-               CodeDirectiveCollection startDirectives;
-               
-               //
-               // Constructors
-               //
-               public CodeStatement()
-               {
-               }
-               
-               //
-               // Properties
-               //
-               public CodeLinePragma LinePragma {
-                       get {
-                               return linePragma;
-                       }
-                       set {
-                               linePragma = value;
-                       }
-               }
-
-               public CodeDirectiveCollection EndDirectives {
-                       get {
-                               if (endDirectives == null)
-                                       endDirectives = new CodeDirectiveCollection ();
-                               return endDirectives;
-                       }
-               }
-
-               public CodeDirectiveCollection StartDirectives {
-                       get {
-                               if (startDirectives == null)
-                                       startDirectives = new CodeDirectiveCollection ();
-                               return startDirectives;
-                       }
-               }
-
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeStatementCollection.cs b/mcs/class/System/System.CodeDom/CodeStatementCollection.cs
deleted file mode 100644 (file)
index 3183b58..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-//
-// System.CodeDom CodeStatementCollection Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-using System.Collections;
-
-namespace System.CodeDom 
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeStatementCollection
-               : CollectionBase
-       {
-               //
-               // Constructors
-               //
-               public CodeStatementCollection()
-               {
-               }
-
-               public CodeStatementCollection (CodeStatement[] value)
-               {
-                       AddRange (value);
-               }
-
-               public CodeStatementCollection (CodeStatementCollection value)
-               {
-                       AddRange (value);
-               }
-
-               //
-               // Properties
-               //
-               public CodeStatement this[int index]
-               {
-                       get {
-                               return (CodeStatement) List[index];
-                       }
-                       set {
-                               List[index] = value;
-                       }
-               }
-
-               //
-               // Methods
-               //
-               public int Add (CodeStatement value)
-               {
-                       return List.Add (value);
-               }
-
-               public int Add (CodeExpression value)
-               {
-                       return Add (new CodeExpressionStatement (value));
-               }
-
-               public void AddRange (CodeStatement [] value)
-               {
-                       if (value == null) {
-                               throw new ArgumentNullException ("value");
-                       }
-
-                       for (int i = 0; i < value.Length; i++) {
-                               Add (value[i]);
-                       }
-               }
-               
-               public void AddRange (CodeStatementCollection value)
-               {
-                       if (value == null) {
-                               throw new ArgumentNullException ("value");
-                       }
-
-                       int count = value.Count;
-                       for (int i = 0; i < count; i++) {
-                               Add (value[i]);
-                       }
-               }
-
-               public bool Contains (CodeStatement value)
-               {
-                       return List.Contains (value);
-               }
-               
-               public void CopyTo (CodeStatement[] array, int index)
-               {
-                       List.CopyTo (array, index);
-               }
-
-               public int IndexOf (CodeStatement value)
-               {
-                       return List.IndexOf (value);
-               }
-
-               public void Insert (int index, CodeStatement value)
-               {
-                       List.Insert (index, value);
-               }
-
-               public void Remove (CodeStatement value)
-               {
-                       List.Remove (value);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeThisReferenceExpression.cs b/mcs/class/System/System.CodeDom/CodeThisReferenceExpression.cs
deleted file mode 100644 (file)
index 5decec3..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// System.CodeDom CodeParameterDeclarationExpression Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeThisReferenceExpression
-               : CodeExpression 
-       {
-
-               //
-               // Constructors
-               //
-               public CodeThisReferenceExpression()
-               {
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeThrowExceptionStatement.cs b/mcs/class/System/System.CodeDom/CodeThrowExceptionStatement.cs
deleted file mode 100644 (file)
index 0865e96..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-//
-// System.CodeDom CodeThrowExceptionStatement Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeThrowExceptionStatement
-               : CodeStatement 
-       {
-               private CodeExpression toThrow;
-               
-               //
-               // Constructors
-               //
-               public CodeThrowExceptionStatement ()
-               {
-               }
-
-               public CodeThrowExceptionStatement (CodeExpression toThrow)
-               {
-                       this.toThrow = toThrow;
-               }
-
-               //
-               // Properties
-               //
-               public CodeExpression ToThrow {
-                       get {
-                               return toThrow;
-                       }
-                       set {
-                               toThrow = value;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeTryCatchFinallyStatement.cs b/mcs/class/System/System.CodeDom/CodeTryCatchFinallyStatement.cs
deleted file mode 100644 (file)
index f74c0b6..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-//
-// System.CodeDom CodeTryCatchFinallyStatement Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeTryCatchFinallyStatement
-               : CodeStatement 
-       {
-               private CodeStatementCollection tryStatements, finallyStatements;
-               private CodeCatchClauseCollection catchClauses;
-               
-               //
-               // Constructors
-               //
-               public CodeTryCatchFinallyStatement ()
-               {
-               }
-               
-               public CodeTryCatchFinallyStatement (CodeStatement [] tryStatements,
-                                                    CodeCatchClause [] catchClauses)
-               {
-                       TryStatements.AddRange( tryStatements );
-                       CatchClauses.AddRange( catchClauses );
-               }
-
-               public CodeTryCatchFinallyStatement (CodeStatement [] tryStatements,
-                                                    CodeCatchClause [] catchClauses,
-                                                    CodeStatement [] finallyStatements)
-               {
-                       TryStatements.AddRange( tryStatements );
-                       CatchClauses.AddRange( catchClauses );
-                       FinallyStatements.AddRange( finallyStatements );
-               }
-
-               //
-               // Properties
-               //
-               public CodeStatementCollection FinallyStatements{
-                       get {
-                               if ( finallyStatements == null )
-                                       finallyStatements = new CodeStatementCollection();
-                               return finallyStatements;
-                       }
-               }
-
-               public CodeStatementCollection TryStatements {
-                       get {
-                               if ( tryStatements == null )
-                                       tryStatements = new CodeStatementCollection();
-                               return tryStatements;
-                       }
-               }
-               public CodeCatchClauseCollection CatchClauses {
-                       get {
-                               if ( catchClauses == null )
-                                       catchClauses = new CodeCatchClauseCollection();
-                               return catchClauses;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeTypeConstructor.cs b/mcs/class/System/System.CodeDom/CodeTypeConstructor.cs
deleted file mode 100644 (file)
index 0226c07..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-// System.CodeDom CodeTypeConstructor Class Implementation
-//
-// Author:
-//   Daniel Stodden (stodden@in.tum.de)
-//   
-// (C) 2002 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeTypeConstructor
-               : CodeMemberMethod
-       {
-               public CodeTypeConstructor ()
-               {
-                       this.Name = ".cctor";
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeTypeDeclaration.cs b/mcs/class/System/System.CodeDom/CodeTypeDeclaration.cs
deleted file mode 100644 (file)
index f35ad1e..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-//
-// System.CodeDom CodeTypeDeclaration Class implementation
-//
-// Author:
-//   Sean MacIsaac (macisaac@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//   Marek Safar (marek.safar@seznam.cz)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-using System.Reflection;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeTypeDeclaration
-               : CodeTypeMember
-       {
-               private CodeTypeReferenceCollection baseTypes;
-               private CodeTypeMemberCollection members;
-               private TypeAttributes attributes = TypeAttributes.Public;
-               private bool isEnum;
-               private bool isStruct;
-               //int populated;
-
-               bool isPartial;
-               CodeTypeParameterCollection typeParameters;
-
-               //
-               // Constructors
-               //
-
-               public CodeTypeDeclaration()
-               {
-               }
-               
-               public CodeTypeDeclaration( string name )
-               {
-                       this.Name = name;
-               }
-
-               /* by default, it's a class */
-
-               //
-               // Properties
-               //
-               public CodeTypeReferenceCollection BaseTypes {
-                       get {
-                               if ( baseTypes == null ) {
-                                       baseTypes = new CodeTypeReferenceCollection();
-                                       if ( PopulateBaseTypes != null )
-                                               PopulateBaseTypes( this, EventArgs.Empty );
-                               }
-                               return baseTypes;
-                       }
-               }
-
-               public bool IsClass {
-                       get {
-                               if ( (attributes & TypeAttributes.Interface) != 0 )
-                                       return false;
-                               if ( isEnum )
-                                       return false;
-                               if ( isStruct )
-                                       return false;
-                               return true;
-                       }
-                       set {
-                               if ( value ) {
-                                       attributes &= ~TypeAttributes.Interface;
-                                       isEnum = false;
-                                       isStruct = false;
-                               }
-                       }
-               }
-               
-               public bool IsEnum {
-                       get {
-                               return isEnum;
-                       }
-                       set {
-                               if ( value ) {
-                                       attributes &= ~TypeAttributes.Interface;
-                                       isEnum = true;
-                                       isStruct = false;
-                               }
-                       }
-               }
-
-               public bool IsInterface {
-                       get {
-                               return (attributes & TypeAttributes.Interface) != 0;
-                       }
-                       set {
-                               if ( value ) {
-                                       attributes |= TypeAttributes.Interface;
-                                       isEnum = false;
-                                       isStruct = false;
-                               }
-                       }
-               }
-
-               public bool IsStruct {
-                       get {
-                               return isStruct;
-                       }
-                       set {
-                               if ( value ) {
-                                       attributes &= ~TypeAttributes.Interface;
-                                       isEnum = false;
-                                       isStruct = true;
-                               }
-                       }
-               }
-
-               public CodeTypeMemberCollection Members {
-                       get {
-                               if ( members == null ) {
-                                       members = new CodeTypeMemberCollection();
-                                       if ( PopulateMembers != null )
-                                               PopulateMembers( this, EventArgs.Empty );
-                               }
-                               return members;
-                       }
-               }
-
-               public TypeAttributes TypeAttributes {
-                       get {
-                               return attributes;
-                       }
-                       set {
-                               attributes = value;
-#if FALSE
-                               /* MS does not seem to do this, so don't I */
-                               if ( (attributes & TypeAttributes.Interface) != 0 ) {
-                                       isEnum = false;
-                                       isStruct = false;
-                               }
-#endif
-                       }
-               }
-
-               public bool IsPartial {
-                       get {
-                               return isPartial;
-                       }
-                       set {
-                               isPartial = value;
-                       }
-               }
-
-               [ComVisible (false)]
-               public CodeTypeParameterCollection TypeParameters {
-                       get {
-                               if (typeParameters == null)
-                                       typeParameters = new CodeTypeParameterCollection ();
-                               return typeParameters;
-                       }
-               }
-
-               //
-               // Events
-               // 
-               public event EventHandler PopulateBaseTypes;
-
-               public event EventHandler PopulateMembers;
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeTypeDeclarationCollection.cs b/mcs/class/System/System.CodeDom/CodeTypeDeclarationCollection.cs
deleted file mode 100644 (file)
index 96dc1f4..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-//
-// System.CodeDom CodeTypeDeclarationCollection Class implementation
-//
-// Author:
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-using System.Collections;
-
-namespace System.CodeDom 
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeTypeDeclarationCollection 
-               : CollectionBase
-       {
-               //
-               // Constructors
-               //
-               public CodeTypeDeclarationCollection()
-               {
-               }
-
-               public CodeTypeDeclarationCollection( CodeTypeDeclaration[] value )
-               {
-                       AddRange( value );
-               }
-
-               public CodeTypeDeclarationCollection( CodeTypeDeclarationCollection value )
-               {
-                       AddRange( value );
-               }
-
-               //
-               // Properties
-               //
-               public CodeTypeDeclaration this[int index]
-               {
-                       get {
-                               return (CodeTypeDeclaration)List[index];
-                       }
-                       set {
-                               List[index] = value;
-                       }
-               }
-
-               //
-               // Methods
-               //
-               public int Add (CodeTypeDeclaration value)
-               {
-                       return List.Add (value);
-               }
-
-               public void AddRange (CodeTypeDeclaration [] value)
-               {
-                       if (value == null) {
-                               throw new ArgumentNullException ("value");
-                       }
-
-                       for (int i = 0; i < value.Length; i++) {
-                               Add (value[i]);
-                       }
-               }
-
-               public void AddRange (CodeTypeDeclarationCollection value)
-               {
-                       if (value == null) {
-                               throw new ArgumentNullException ("value");
-                       }
-
-                       int count = value.Count;
-                       for (int i = 0; i < count; i++) {
-                               Add (value[i]);
-                       }
-               }
-
-               public bool Contains( CodeTypeDeclaration value )
-               {
-                       return List.Contains( value );
-               }
-
-               public void CopyTo( CodeTypeDeclaration[] array, int index )
-               {
-                       List.CopyTo( array, index );
-               }
-
-               public int IndexOf( CodeTypeDeclaration value )
-               {
-                       return List.IndexOf( value );
-               }
-
-               public void Insert( int index, CodeTypeDeclaration value )
-               {
-                       List.Insert( index, value );
-               }
-
-               public void Remove( CodeTypeDeclaration value )
-               {
-                       List.Remove (value);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeTypeDelegate.cs b/mcs/class/System/System.CodeDom/CodeTypeDelegate.cs
deleted file mode 100644 (file)
index dab98d1..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// System.CodeDom CodeTypeDelegate Class implementation
-//
-// Author:
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeTypeDelegate : CodeTypeDeclaration
-       {
-               private CodeParameterDeclarationExpressionCollection parameters;
-               private CodeTypeReference returnType;
-
-               //
-               // Constructors
-               //
-               public CodeTypeDelegate()
-               {
-                       base.BaseTypes.Add (new CodeTypeReference ("System.Delegate"));
-               }
-
-               public CodeTypeDelegate(string name) : this()
-               {
-                       this.Name = name;
-               }
-
-               //
-               // Properties
-               //
-               public CodeParameterDeclarationExpressionCollection Parameters {
-                       get {
-                               if (parameters == null) {
-                                       parameters = new CodeParameterDeclarationExpressionCollection ();
-                               }
-                               return parameters;
-                       }
-               }
-
-               public CodeTypeReference ReturnType {
-                       get {
-                               if (returnType == null) {
-                                       this.returnType = new CodeTypeReference(string.Empty);
-                               }
-                               return returnType;
-                       }
-                       set {
-                               returnType = value;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeTypeMember.cs b/mcs/class/System/System.CodeDom/CodeTypeMember.cs
deleted file mode 100644 (file)
index c26fb96..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-//
-// System.CodeDom CodeTypeMember Class implementation
-//
-// Author:
-//   Sean MacIsaac (macisaac@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//   Marek Safar (marek.safar@seznam.cz)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeTypeMember
-               : CodeObject
-       {
-               private string name;
-               private MemberAttributes attributes;
-               private CodeCommentStatementCollection comments;
-               private CodeAttributeDeclarationCollection customAttributes;
-               private CodeLinePragma linePragma;
-               CodeDirectiveCollection endDirectives;
-               CodeDirectiveCollection startDirectives;
-
-               //
-               // Constructors
-               //
-               public CodeTypeMember()
-               {
-                       attributes = (MemberAttributes.Private | MemberAttributes.Final);
-               }
-               
-               //
-               // Properties
-               //
-               public MemberAttributes Attributes {
-                       get {
-                               return attributes;
-                       }
-                       set {
-                               attributes = value;
-                       }
-               }
-
-               public CodeCommentStatementCollection Comments {
-                       get {
-                               if ( comments == null )
-                                       comments = new CodeCommentStatementCollection();
-                               return comments;
-                       }
-               }
-
-               
-               public CodeAttributeDeclarationCollection CustomAttributes {
-                       get {
-                               if ( customAttributes == null )
-                                       customAttributes = new CodeAttributeDeclarationCollection();
-                               return customAttributes;
-                       }
-                       set {
-                               customAttributes = value;
-                       }
-               }
-
-               public CodeLinePragma LinePragma {
-                       get {
-                               return linePragma;
-                       }
-                       set {
-                               linePragma = value;
-                       }
-               }
-
-               public string Name {
-                       get {
-                               if (name == null)
-                                       return String.Empty;
-                               return name;
-                       }
-                       set {
-                               name = value;
-                       }
-               }
-
-               public CodeDirectiveCollection EndDirectives {
-                       get {
-                               if (endDirectives == null)
-                                       endDirectives = new CodeDirectiveCollection ();
-                               return endDirectives;
-                       }
-               }
-
-               public CodeDirectiveCollection StartDirectives {
-                       get {
-                               if (startDirectives == null)
-                                       startDirectives = new CodeDirectiveCollection ();
-                               return startDirectives;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeTypeMemberCollection.cs b/mcs/class/System/System.CodeDom/CodeTypeMemberCollection.cs
deleted file mode 100644 (file)
index d1dee07..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-//
-// System.CodeDom CodeTypeMemberCollection Class implementation
-//
-// Author:
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-using System.Collections;
-
-namespace System.CodeDom 
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeTypeMemberCollection
-               : CollectionBase
-       {
-               //
-               // Constructors
-               //
-               public CodeTypeMemberCollection()
-               {
-               }
-               
-               public CodeTypeMemberCollection( CodeTypeMember[] value )
-               {
-                       AddRange( value );
-               }
-
-               public CodeTypeMemberCollection( CodeTypeMemberCollection value )
-               {
-                       AddRange( value );
-               }
-
-               //
-               // Properties
-               //
-               public CodeTypeMember this[int index]
-               {
-                       get {
-                               return (CodeTypeMember)List[index];
-                       }
-                       set {
-                               List[index] = value;
-                       }
-               }
-
-               //
-               // Methods
-               //
-               public int Add (CodeTypeMember value)
-               {
-                       return List.Add( value );
-               }
-
-               public void AddRange (CodeTypeMember [] value )
-               {
-                       if (value == null) {
-                               throw new ArgumentNullException ("value");
-                       }
-
-                       for (int i = 0; i < value.Length; i++) {
-                               Add (value[i]);
-                       }
-               }
-               
-               public void AddRange (CodeTypeMemberCollection value)
-               {
-                       if (value == null) {
-                               throw new ArgumentNullException ("value");
-                       }
-
-                       int count = value.Count;
-                       for (int i = 0; i < count; i++) {
-                               Add (value[i]);
-                       }
-               }
-
-               public bool Contains( CodeTypeMember value )
-               {
-                       return List.Contains( value );
-               }
-               
-               public void CopyTo( CodeTypeMember[] array, int index )
-               {
-                       List.CopyTo( array, index );
-               }
-
-               public int IndexOf( CodeTypeMember value )
-               {
-                       return List.IndexOf( value );
-               }
-
-               public void Insert( int index, CodeTypeMember value )
-               {
-                       List.Insert( index, value );
-               }
-
-               public void Remove( CodeTypeMember value )
-               {
-                       List.Remove (value);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeTypeOfExpression.cs b/mcs/class/System/System.CodeDom/CodeTypeOfExpression.cs
deleted file mode 100644 (file)
index 09884d3..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-//
-// System.CodeDom CodeTypeOfExpression Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeTypeOfExpression
-               : CodeExpression 
-       {
-               private CodeTypeReference type;
-                       
-               //
-               // Constructors
-               //
-               public CodeTypeOfExpression () 
-               {
-               }
-
-               public CodeTypeOfExpression (CodeTypeReference type)
-               {
-                       this.type = type;
-               }
-
-               public CodeTypeOfExpression (string type)
-               {
-                       this.type = new CodeTypeReference( type );
-               }
-               
-               public CodeTypeOfExpression (Type type)
-               {
-                       this.type = new CodeTypeReference( type );
-               }
-
-               //
-               // Properties
-               //
-               public CodeTypeReference Type {
-                       get {
-                               if (type == null) {
-                                       type = new CodeTypeReference (string.Empty);
-                               }
-                               return type;
-                       }
-                       set {
-                               type = value;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeTypeParameter.cs b/mcs/class/System/System.CodeDom/CodeTypeParameter.cs
deleted file mode 100644 (file)
index 43a9cd0..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-//
-// System.CodeDom CodeTypeParameter class
-//
-// Author:
-//   Marek Safar (marek.safar@seznam.cz)
-//
-// (C) 2004 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ComVisible (true), ClassInterface (ClassInterfaceType.AutoDispatch)]
-       public class CodeTypeParameter: CodeObject
-       {
-               CodeTypeReferenceCollection constraints;
-               CodeAttributeDeclarationCollection customAttributes;
-               bool hasConstructorConstraint;
-               string name;
-
-               public CodeTypeParameter () {}
-
-               public CodeTypeParameter (string name)
-               {
-                       this.name = name;
-               }
-
-               public CodeTypeReferenceCollection Constraints {
-                       get {
-                               if (constraints == null)
-                                       constraints = new CodeTypeReferenceCollection ();
-                               return constraints;
-                       }
-               }
-
-               public CodeAttributeDeclarationCollection CustomAttributes {
-                       get {
-                               if (customAttributes == null)
-                                       customAttributes = new CodeAttributeDeclarationCollection ();
-                               return customAttributes;
-                       }
-               }
-
-               public bool HasConstructorConstraint {
-                       get {
-                               return hasConstructorConstraint;
-                       }
-                       set {
-                               hasConstructorConstraint = value;
-                       }
-               }
-
-               public string Name {
-                       get {
-                               if (name == null) {
-                                       return string.Empty;
-                               }
-                               return name;
-                       }
-                       set {
-                               name = value;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeTypeParameterCollection.cs b/mcs/class/System/System.CodeDom/CodeTypeParameterCollection.cs
deleted file mode 100644 (file)
index 942f097..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-//
-// System.CodeDom CodeTypeParameterCollection class
-//
-// Authors:
-//     Marek Safar (marek.safar@seznam.cz)
-//     Sebastien Pouliot  <sebastien@ximian.com>
-//
-// (C) 2004 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ComVisible (true), ClassInterface (ClassInterfaceType.AutoDispatch)]
-       public class CodeTypeParameterCollection: System.Collections.CollectionBase
-       {
-               public CodeTypeParameterCollection ()
-               {
-               }
-
-               public CodeTypeParameterCollection (CodeTypeParameter[] value)
-               {
-                       AddRange (value);
-               }
-
-               public CodeTypeParameterCollection (CodeTypeParameterCollection value)
-               {
-                       AddRange (value);
-               }
-
-               public int Add (CodeTypeParameter value)
-               {
-                       return List.Add (value);
-               }
-
-               public void Add (string value)
-               {
-                       List.Add (new CodeTypeParameter (value));
-               }
-
-               public void AddRange (CodeTypeParameter[] value)
-               {
-                       if (value == null) {
-                               throw new ArgumentNullException ("value");
-                       }
-
-                       for (int i = 0; i < value.Length; i++) {
-                               Add (value[i]);
-                       }
-               }
-
-               public void AddRange (CodeTypeParameterCollection value)
-               {
-                       if (value == null) {
-                               throw new ArgumentNullException ("value");
-                       }
-
-                       int count = value.Count;
-                       for (int i = 0; i < count; i++) {
-                               Add (value[i]);
-                       }
-               }
-
-               public bool Contains (CodeTypeParameter value)
-               {
-                       return List.Contains (value);
-               }
-               
-               public void CopyTo (CodeTypeParameter[] array, int index)
-               {
-                       List.CopyTo (array, index);
-               }
-
-               public int IndexOf (CodeTypeParameter value)
-               {
-                       return List.IndexOf (value);
-               }
-
-               public void Insert (int index, CodeTypeParameter value)
-               {
-                       List.Insert (index, value);
-               }
-
-               public void Remove (CodeTypeParameter value)
-               {
-                       List.Remove (value);
-               }
-
-               public CodeTypeParameter this [int index]
-               {
-                       get {
-                               return ((CodeTypeParameter) List [index]);
-                       }
-                       set {
-                               List[index] = value;
-                       }
-               }
-       }
-}
-
diff --git a/mcs/class/System/System.CodeDom/CodeTypeReference.cs b/mcs/class/System/System.CodeDom/CodeTypeReference.cs
deleted file mode 100644 (file)
index 49b9c45..0000000
+++ /dev/null
@@ -1,279 +0,0 @@
-//
-// System.CodeDom CodeTypeReferenceExpression Class implementation
-//
-// Author:
-//   Daniel Stodden (stodden@in.tum.de)
-//   Marek Safar (marek.safar@seznam.cz)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-using System.Text;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeTypeReference : CodeObject
-       {
-               private string baseType;
-               private CodeTypeReference arrayElementType;
-               private int arrayRank;
-               private bool isInterface;
-               //bool needsFixup;
-
-               CodeTypeReferenceCollection typeArguments;
-               CodeTypeReferenceOptions referenceOptions;
-
-               //
-               // Constructors
-               //
-
-               public CodeTypeReference ()
-               {
-               }
-
-               [MonoTODO("We should parse basetype from right to left in 2.0 profile.")]
-               public CodeTypeReference (string baseType)
-               {
-                       Parse (baseType);
-               }
-
-               [MonoTODO("We should parse basetype from right to left in 2.0 profile.")]
-               public CodeTypeReference (Type baseType)
-               {
-                       if (baseType == null) {
-                               throw new ArgumentNullException ("baseType");
-                       }
-
-                       if (baseType.IsGenericParameter) {
-                               this.baseType = baseType.Name;
-                               this.referenceOptions = CodeTypeReferenceOptions.GenericTypeParameter;
-                       }
-                       else if (baseType.IsGenericTypeDefinition)
-                               this.baseType = baseType.FullName;
-                       else if (baseType.IsGenericType) {
-                               this.baseType = baseType.GetGenericTypeDefinition ().FullName;
-                               foreach (Type arg in baseType.GetGenericArguments ()) {
-                                       if (arg.IsGenericParameter)
-                                               TypeArguments.Add (new CodeTypeReference (new CodeTypeParameter (arg.Name)));
-                                       else
-                                               TypeArguments.Add (new CodeTypeReference (arg));
-                               }
-                       }
-                       else if (baseType.IsArray) {
-                               this.arrayRank = baseType.GetArrayRank ();
-                               this.arrayElementType = new CodeTypeReference (baseType.GetElementType ());
-                               this.baseType = arrayElementType.BaseType;
-                       } else {
-                               Parse (baseType.FullName);
-                       }
-                       this.isInterface = baseType.IsInterface;
-               }
-
-               public CodeTypeReference( CodeTypeReference arrayElementType, int arrayRank )
-               {
-                       this.baseType = null;
-                       this.arrayRank = arrayRank;
-                       this.arrayElementType = arrayElementType;
-               }
-
-               [MonoTODO("We should parse basetype from right to left in 2.0 profile.")]
-               public CodeTypeReference( string baseType, int arrayRank )
-                       : this (new CodeTypeReference (baseType), arrayRank)
-               {
-               }
-
-               public CodeTypeReference( CodeTypeParameter typeParameter ) :
-                       this (typeParameter.Name)
-               {
-                       this.referenceOptions = CodeTypeReferenceOptions.GenericTypeParameter;
-               }
-
-               public CodeTypeReference( string typeName, CodeTypeReferenceOptions referenceOptions ) :
-                       this (typeName)
-               {
-                       this.referenceOptions = referenceOptions;
-               }
-
-               public CodeTypeReference( Type type, CodeTypeReferenceOptions referenceOptions ) :
-                       this (type)
-               {
-                       this.referenceOptions = referenceOptions;
-               }
-
-               public CodeTypeReference( string typeName, params CodeTypeReference[] typeArguments ) :
-                       this (typeName)
-               {
-                       TypeArguments.AddRange (typeArguments);
-                       if (this.baseType.IndexOf ('`') < 0)
-                               this.baseType += "`" + TypeArguments.Count;
-               }
-
-               //
-               // Properties
-               //
-
-               public CodeTypeReference ArrayElementType
-               {
-                       get {
-                               return arrayElementType;
-                       }
-                       set {
-                               arrayElementType = value;
-                       }
-               }
-               
-               public int ArrayRank {
-                       get {
-                               return arrayRank;
-                       }
-                       set {
-                               arrayRank = value;
-                       }
-               }
-
-               public string BaseType {
-                       get {
-                               if (arrayElementType != null && arrayRank > 0) {
-                                       return arrayElementType.BaseType;
-                               }
-
-                               if (baseType == null)
-                                       return String.Empty;
-
-                               return baseType;
-                       }
-                       set {
-                               baseType = value;
-                       }
-               }
-
-               internal bool IsInterface {
-                       get { return isInterface; }
-               }
-
-               private void Parse (string baseType)
-               {
-                       if (baseType == null || baseType.Length == 0) {
-                               this.baseType = typeof (void).FullName;
-                               return;
-                       }
-
-                       int array_start = baseType.IndexOf ('[');
-                       if (array_start == -1) {
-                               this.baseType = baseType;
-                               return;
-                       }
-
-                       int array_end = baseType.LastIndexOf (']');
-                       if (array_end < array_start) {
-                               this.baseType = baseType;
-                               return;
-                       }
-
-                       int lastAngle = baseType.LastIndexOf ('>');
-                       if (lastAngle != -1 && lastAngle > array_end) {
-                               this.baseType = baseType;
-                               return;
-                       }
-                       
-                       string[] args = baseType.Substring (array_start + 1, array_end - array_start - 1).Split (',');
-
-                       if ((array_end - array_start) != args.Length) {
-                               this.baseType = baseType.Substring (0, array_start);
-                               int escapeCount = 0;
-                               int scanPos = array_start;
-                               StringBuilder tb = new StringBuilder();
-                               while (scanPos < baseType.Length) {
-                                       char currentChar = baseType[scanPos];
-                                       
-                                       switch (currentChar) {
-                                               case '[':
-                                                       if (escapeCount > 1 && tb.Length > 0) {
-                                                               tb.Append (currentChar);
-                                                       }
-                                                       escapeCount++;
-                                                       break;
-                                               case ']':
-                                                       escapeCount--;
-                                                       if (escapeCount > 1 && tb.Length > 0) {
-                                                               tb.Append (currentChar);
-                                                       }
-
-                                                       if (tb.Length != 0 && (escapeCount % 2) == 0) {
-                                                               TypeArguments.Add (tb.ToString ());
-                                                               tb.Length = 0;
-                                                       }
-                                                       break;
-                                               case ',':
-                                                       if (escapeCount > 1) {
-                                                               // skip anything after the type name until we 
-                                                               // reach the next separator
-                                                               while (scanPos + 1 < baseType.Length) {
-                                                                       if (baseType[scanPos + 1] == ']') {
-                                                                               break;
-                                                                       }
-                                                                       scanPos++;
-                                                               }
-                                                       } else if (tb.Length > 0) {
-                                                               CodeTypeReference typeArg = new CodeTypeReference (tb.ToString ());
-                                                               TypeArguments.Add (typeArg);
-                                                               tb.Length = 0;
-                                                       }
-                                                       break;
-                                               default:
-                                                       tb.Append (currentChar);
-                                                       break;
-                                       }
-                                       scanPos++;
-                               }
-                       } else {
-                               arrayElementType = new CodeTypeReference (baseType.Substring (0, array_start));
-                               arrayRank = args.Length;
-                       }
-               }
-
-               [ComVisible (false)]
-               public CodeTypeReferenceOptions Options {
-                       get {
-                               return referenceOptions;
-                       }
-                       set {
-                               referenceOptions = value;
-                       }
-               }
-
-               [ComVisible (false)]
-               public CodeTypeReferenceCollection TypeArguments {
-                       get {
-                               if (typeArguments == null)
-                                       typeArguments = new CodeTypeReferenceCollection ();
-                               return typeArguments;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeTypeReferenceCollection.cs b/mcs/class/System/System.CodeDom/CodeTypeReferenceCollection.cs
deleted file mode 100644 (file)
index 0212e4e..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-//
-// System.CodeDom CodeTypeReferenceCollection Class implementation
-//
-// Author:
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-using System.Collections;
-
-namespace System.CodeDom 
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeTypeReferenceCollection
-               : CollectionBase
-       {
-               //
-               // Constructors
-               //
-               public CodeTypeReferenceCollection()
-               {
-               }
-
-               public CodeTypeReferenceCollection( CodeTypeReference[] value )
-               {
-                       AddRange( value );
-               }
-
-               public CodeTypeReferenceCollection( CodeTypeReferenceCollection value )
-               {
-                       AddRange( value );
-               }
-
-               //
-               // Properties
-               //
-               public CodeTypeReference this[int index]
-               {
-                       get {
-                               return (CodeTypeReference)List[index];
-                       }
-                       set {
-                               List[index] = value;
-                       }
-               }
-
-               //
-               // Methods
-               //
-               public int Add (CodeTypeReference value)
-               {
-                       return List.Add( value );
-               }
-
-               public void Add (string value)
-               {
-                       Add (new CodeTypeReference (value));
-               }
-
-               public void Add (Type value)
-               {
-                       Add (new CodeTypeReference (value));
-               }
-
-               public void AddRange (CodeTypeReference [] value )
-               {
-                       if (value == null) {
-                               throw new ArgumentNullException ("value");
-                       }
-
-                       for (int i = 0; i < value.Length; i++) {
-                               Add (value[i]);
-                       }
-               }
-               
-               public void AddRange (CodeTypeReferenceCollection value)
-               {
-                       if (value == null) {
-                               throw new ArgumentNullException ("value");
-                       }
-
-                       int count = value.Count;
-                       for (int i = 0; i < count; i++) {
-                               Add (value[i]);
-                       }
-               }
-
-               public bool Contains( CodeTypeReference value )
-               {
-                       return List.Contains( value );
-               }
-               
-               public void CopyTo( CodeTypeReference[] array, int index )
-               {
-                       List.CopyTo( array, index );
-               }
-
-               public int IndexOf( CodeTypeReference value )
-               {
-                       return List.IndexOf( value );
-               }
-
-               public void Insert( int index, CodeTypeReference value )
-               {
-                       List.Insert( index, value );
-               }
-
-               public void Remove( CodeTypeReference value )
-               {
-                       List.Remove (value);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeTypeReferenceExpression.cs b/mcs/class/System/System.CodeDom/CodeTypeReferenceExpression.cs
deleted file mode 100644 (file)
index ea71c9d..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-//
-// System.CodeDom CodeTypeReferenceExpression Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeTypeReferenceExpression
-               : CodeExpression
-       {
-               private CodeTypeReference type;
-               
-               //
-               // Constructors
-               //
-               public CodeTypeReferenceExpression ()
-               {
-               }
-
-               public CodeTypeReferenceExpression (CodeTypeReference type)
-               {
-                       this.type = type;
-               }
-               
-               public CodeTypeReferenceExpression (string type)
-               {
-                       this.type = new CodeTypeReference( type );
-               }
-
-               public CodeTypeReferenceExpression (Type type)
-               {
-                       this.type = new CodeTypeReference( type );
-               }
-
-               //
-               // Properties
-               //
-               public CodeTypeReference Type {
-                       get {
-                               if (type == null) {
-                                       return new CodeTypeReference (string.Empty);
-                               }
-                               return type;
-                       }
-                       set {
-                               type = value;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeTypeReferenceOptions.cs b/mcs/class/System/System.CodeDom/CodeTypeReferenceOptions.cs
deleted file mode 100644 (file)
index 8e3ee5b..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// System.CodeDom CodeTypeReferenceOptions enum
-//
-// Author:
-//   Marek Safar (marek.safar@seznam.cz)
-//
-// (C) 2004 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Flags]
-       [Serializable]
-       [ComVisible (true)]
-       public enum CodeTypeReferenceOptions
-       {
-               GlobalReference = 1,
-               GenericTypeParameter = 1 << 1
-       }
-}
-
diff --git a/mcs/class/System/System.CodeDom/CodeVariableDeclarationStatement.cs b/mcs/class/System/System.CodeDom/CodeVariableDeclarationStatement.cs
deleted file mode 100644 (file)
index 171faae..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-//
-// System.CodeDom CodeVariableDeclarationStatement Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom 
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeVariableDeclarationStatement
-               : CodeStatement  
-       {
-               private CodeExpression initExpression;
-               private CodeTypeReference type;
-               private string name;
-
-               //
-               // Constructors
-               //
-               public CodeVariableDeclarationStatement () 
-               {
-               }
-
-               public CodeVariableDeclarationStatement( CodeTypeReference type, string name )
-               {
-                       this.type = type;
-                       this.name = name;
-               }
-               
-               public CodeVariableDeclarationStatement( string type, string name )
-               {
-                       this.type = new CodeTypeReference( type );
-                       this.name = name;
-               }
-
-               public CodeVariableDeclarationStatement( Type type, string name )
-               {
-                       this.type = new CodeTypeReference( type );
-                       this.name = name;
-               }
-
-               public CodeVariableDeclarationStatement( CodeTypeReference type, 
-                                                        string name,
-                                                        CodeExpression initExpression )
-               {
-                       this.type = type;
-                       this.name = name;
-                       this.initExpression = initExpression;
-               }
-
-               public CodeVariableDeclarationStatement( string type,
-                                                        string name, 
-                                                        CodeExpression initExpression )
-               {
-                       this.type = new CodeTypeReference( type );
-                       this.name = name;
-                       this.initExpression = initExpression;
-               }
-
-               public CodeVariableDeclarationStatement( Type type, 
-                                                        string name, 
-                                                        CodeExpression initExpression )
-               {
-                       this.type = new CodeTypeReference( type );
-                       this.name = name;
-                       this.initExpression = initExpression;
-               }
-
-               //
-               // Properties
-               //
-               public CodeExpression InitExpression {
-                       get {
-                               return initExpression;
-                       }
-                       set {
-                               initExpression = value;
-                       }
-               }
-
-               public string Name {
-                       get {
-                               if (name == null) {
-                                       return string.Empty;
-                               }
-                               return name;
-                       }
-                       set {
-                               name = value;
-                       }
-               }
-
-               public CodeTypeReference Type {
-                       get {
-                               if (type == null) {
-                                       type = new CodeTypeReference (string.Empty);
-                               }
-                               return type;
-                       }
-                       set {
-                               type = value;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeVariableReferenceExpression.cs b/mcs/class/System/System.CodeDom/CodeVariableReferenceExpression.cs
deleted file mode 100644 (file)
index 6731b7c..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-// System.CodeDom CodeVariableReferenceExpression Class implementation
-//
-// Author:
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
-       [Serializable]
-       [ClassInterface(ClassInterfaceType.AutoDispatch)]
-       [ComVisible(true)]
-       public class CodeVariableReferenceExpression
-               : CodeExpression 
-       {
-               private string variableName;
-
-               //
-               // Constructors
-               //
-               public CodeVariableReferenceExpression() 
-               {
-               }
-
-               public CodeVariableReferenceExpression( string variableName )
-               {
-                       this.variableName = variableName;
-               }
-
-               //
-               // Properties
-               //
-               public string VariableName {
-                       get {
-                               if (variableName == null) {
-                                       return string.Empty;
-                               }
-                               return variableName;
-                       }
-                       set {
-                               variableName = value;
-                       }
-               }
-
-               //
-               // ICodeDomVisitor method
-               //
-               internal override void Accept (ICodeDomVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/FieldDirection.cs b/mcs/class/System/System.CodeDom/FieldDirection.cs
deleted file mode 100644 (file)
index eae8c1a..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.CodeDom FieldDirection Enum implementation
-//
-// Author:
-//   Sean MacIsaac (macisaac@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom {
-
-       [Serializable]
-       [ComVisible(true)]
-       public enum FieldDirection {
-               In,
-               Out,
-               Ref
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/ICodeDomVisitor.cs b/mcs/class/System/System.CodeDom/ICodeDomVisitor.cs
deleted file mode 100644 (file)
index bc568cd..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-//
-// System.CodeDom.ICodeDomVisitor.cs
-//
-// Author:
-//   Juraj Skripsky (js@hotfeet.ch)
-//
-// Copyright (C) 2008 HotFeet GmbH (http://www.hotfeet.ch)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.CodeDom {
-       internal interface ICodeDomVisitor {
-               // CodeExpression
-               void Visit (CodeArgumentReferenceExpression o);
-               void Visit (CodeArrayCreateExpression o);
-               void Visit (CodeArrayIndexerExpression o);
-               void Visit (CodeBaseReferenceExpression o);
-               void Visit (CodeBinaryOperatorExpression o);
-               void Visit (CodeCastExpression o);
-               void Visit (CodeDefaultValueExpression o);
-               void Visit (CodeDelegateCreateExpression o);
-               void Visit (CodeDelegateInvokeExpression o);
-               void Visit (CodeDirectionExpression o);
-               void Visit (CodeEventReferenceExpression o);
-               void Visit (CodeFieldReferenceExpression o);
-               void Visit (CodeIndexerExpression o);
-               void Visit (CodeMethodInvokeExpression o);
-               void Visit (CodeMethodReferenceExpression o);
-               void Visit (CodeObjectCreateExpression o);
-               void Visit (CodeParameterDeclarationExpression o);
-               void Visit (CodePrimitiveExpression o);
-               void Visit (CodePropertyReferenceExpression o);
-               void Visit (CodePropertySetValueReferenceExpression o);
-               void Visit (CodeSnippetExpression o);
-               void Visit (CodeThisReferenceExpression o);
-               void Visit (CodeTypeOfExpression o);
-               void Visit (CodeTypeReferenceExpression o);
-               void Visit (CodeVariableReferenceExpression o);
-
-               // CodeStatement
-               void Visit (CodeAssignStatement o);
-               void Visit (CodeAttachEventStatement o);
-               void Visit (CodeCommentStatement o);
-               void Visit (CodeConditionStatement o);
-               void Visit (CodeExpressionStatement o);
-               void Visit (CodeGotoStatement o);
-               void Visit (CodeIterationStatement o);
-               void Visit (CodeLabeledStatement o);
-               void Visit (CodeMethodReturnStatement o);
-               void Visit (CodeRemoveEventStatement o);
-               void Visit (CodeThrowExceptionStatement o);
-               void Visit (CodeTryCatchFinallyStatement o);
-               void Visit (CodeVariableDeclarationStatement o);
-
-               // CodeTypeMember
-               void Visit (CodeConstructor o);
-               void Visit (CodeEntryPointMethod o);
-               void Visit (CodeMemberEvent o);
-               void Visit (CodeMemberField o);
-               void Visit (CodeMemberMethod o);
-               void Visit (CodeMemberProperty o);
-               void Visit (CodeSnippetTypeMember o);
-               void Visit (CodeTypeConstructor o);
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/MemberAttributes.cs b/mcs/class/System/System.CodeDom/MemberAttributes.cs
deleted file mode 100644 (file)
index 02c534f..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// System.CodeDom MemberAttributes Enum implementation
-//
-// Author:
-//   Sean MacIsaac (macisaac@ximian.com)
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom {
-
-       [Serializable]
-       [ComVisible(true)]
-       public enum MemberAttributes {
-               Abstract =              0x00000001,
-               Final =                 0x00000002,
-               Static =                0x00000003,
-               Override =              0x00000004,
-               Const =                 0x00000005,
-               ScopeMask =             0x0000000F,
-
-               New =                   0x00000010,
-               VTableMask =            0x000000F0,
-
-               Overloaded =            0x00000100,
-
-               Assembly =              0x00001000, // internal
-               FamilyAndAssembly =     0x00002000, // protected AND internal
-               Family =                0x00003000, // protected
-               FamilyOrAssembly =      0x00004000, // protected internal
-               Private =               0x00005000, // private
-               Public =                0x00006000, // public
-               AccessMask =            0x0000F000
-       }
-}
index 939a0c9b5403474434ff85c9468b65a7c865d9d0..5c38fccfe1c6a064c2014a0f47677537a5a1c6dd 100644 (file)
@@ -171,6 +171,9 @@ namespace System.IO.Compression
                        if (!CanWrite)
                                throw new NotSupportedException ("Stream does not support writing");
 
+                       if (src_offset > src.Length - count)
+                               throw new ArgumentException ("Buffer too small. count/offset wrong.");
+
                        WriteInternal (src, src_offset, count);
                }
 
index 9c9d8d751280f29fb9e163b4ffdc332051ff0863..00f14114077d259e3d7956be41c6f2074d686e4e 100644 (file)
@@ -32,24 +32,6 @@ namespace System.Net.Sockets {
                {
                }
 
-               bool closii;
-
-               /*protected override void Dispose (bool disposing)
-               {
-                       lock (this) {
-                               if (!closii) {
-
-                                       closii = true;
-                                       int error = 0;
-                                       Socket.Blocking_internal (handle, false, out error);
-                                       //AbortRegisteredThreads ();
-                                       Socket.Close_internal (handle, out error);
-                                       //Console.Error.WriteLine ("Closed "+ handle);
-                               }
-                       }
-                       base.Dispose (disposing);
-               }*/
-
                protected override bool ReleaseHandle ()
                {
                        int error = 0;
index f3a1102f464f37eb0c6effe6466f80d57387fe4f..a7dfb4e9e73dab2414651c0f2b19c9214bb50da8 100644 (file)
@@ -6,6 +6,7 @@
 //     Gonzalo Paniagua Javier (gonzalo@ximian.com)
 //     Sridhar Kulkarni (sridharkulkarni@gmail.com)
 //     Brian Nickel (brian.nickel@gmail.com)
+//     Ludovic Henry (ludovic@xamarin.com)
 //
 // Copyright (C) 2001, 2002 Phillip Pearson and Ximian, Inc.
 //    http://www.myelin.co.nz
@@ -50,215 +51,323 @@ namespace System.Net.Sockets
 {
        public partial class Socket : IDisposable
        {
-               private bool islistening;
-               private bool useoverlappedIO;
-               private const int SOCKET_CLOSED = 10004;
+               const int SOCKET_CLOSED_CODE = 10004;
+               const string TIMEOUT_EXCEPTION_MSG = "A connection attempt failed because the connected party did not properly respond" +
+                       "after a period of time, or established connection failed because connected host has failed to respond";
 
-               private static readonly string timeout_exc_msg = "A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond";
+               /*
+                *      These two fields are looked up by name by the runtime, don't change
+                *  their name without also updating the runtime code.
+                */
+               static int ipv4_supported = -1;
+               static int ipv6_supported = -1;
 
-               static void AddSockets (List<Socket> sockets, IList list, string name)
+               /* true if we called Close_internal */
+               bool is_closed;
+
+               bool is_listening;
+               bool use_overlapped_io;
+
+               int linger_timeout;
+
+               /* the field "safe_handle" is looked up by name by the runtime */
+               SafeSocketHandle safe_handle;
+
+               AddressFamily address_family;
+               SocketType socket_type;
+               ProtocolType protocol_type;
+
+               /*
+                * This EndPoint is used when creating new endpoints. Because
+                * there are many types of EndPoints possible,
+                * seed_endpoint.Create(addr) is used for creating new ones.
+                * As such, this value is set on Bind, SentTo, ReceiveFrom,
+                * Connect, etc.
+                */
+               internal EndPoint seed_endpoint = null;
+
+               internal Queue<SocketAsyncWorker> readQ = new Queue<SocketAsyncWorker> (2);
+               internal Queue<SocketAsyncWorker> writeQ = new Queue<SocketAsyncWorker> (2);
+
+               internal bool is_blocking = true;
+               internal bool is_bound;
+
+               /* When true, the socket was connected at the time of the last IO operation */
+               internal bool is_connected;
+
+               internal bool is_disposed;
+               internal bool connect_in_progress;
+
+#region Constructors
+
+               static Socket ()
                {
-                       if (list != null) {
-                               foreach (Socket sock in list) {
-                                       if (sock == null) // MS throws a NullRef
-                                               throw new ArgumentNullException ("name", "Contains a null element");
-                                       sockets.Add (sock);
+                       if (ipv4_supported == -1) {
+                               try {
+                                       Socket tmp = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
+                                       tmp.Close();
+
+                                       ipv4_supported = 1;
+                               } catch {
+                                       ipv4_supported = 0;
                                }
                        }
 
-                       sockets.Add (null);
+                       if (ipv6_supported == -1) {
+                               // We need to put a try/catch around ConfigurationManager methods as will always throw an exception 
+                               // when run in a mono embedded application.  This occurs as embedded applications do not have a setup
+                               // for application config.  The exception is not thrown when called from a normal .NET application. 
+                               //
+                               // We, then, need to guard calls to the ConfigurationManager.  If the config is not found or throws an
+                               // exception, will fall through to the existing Socket / API directly below in the code.
+                               //
+                               // Also note that catching ConfigurationErrorsException specifically would require library dependency
+                               // System.Configuration, and wanted to avoid that.
+#if !NET_2_1
+#if CONFIGURATION_DEP
+                               try {
+                                       SettingsSection config;
+                                       config = (SettingsSection) System.Configuration.ConfigurationManager.GetSection ("system.net/settings");
+                                       if (config != null)
+                                               ipv6_supported = config.Ipv6.Enabled ? -1 : 0;
+                               } catch {
+                                       ipv6_supported = -1;
+                               }
+#else
+                               try {
+                                       NetConfig config = System.Configuration.ConfigurationSettings.GetConfig("system.net/settings") as NetConfig;
+                                       if (config != null)
+                                               ipv6_supported = config.ipv6Enabled ? -1 : 0;
+                               } catch {
+                                       ipv6_supported = -1;
+                               }
+#endif
+#endif
+                               if (ipv6_supported != 0) {
+                                       try {
+                                               Socket tmp = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp);
+                                               tmp.Close();
+
+                                               ipv6_supported = 1;
+                                       } catch {
+                                               ipv6_supported = 0;
+                                       }
+                               }
+                       }
                }
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               private extern static void Select_internal (ref Socket [] sockets,
-                                                       int microSeconds,
-                                                       out int error);
-               public static void Select (IList checkRead, IList checkWrite, IList checkError, int microSeconds)
-               {
-                       var list = new List<Socket> ();
-                       AddSockets (list, checkRead, "checkRead");
-                       AddSockets (list, checkWrite, "checkWrite");
-                       AddSockets (list, checkError, "checkError");
 
-                       if (list.Count == 3) {
-                               throw new ArgumentNullException ("checkRead, checkWrite, checkError",
-                                                                "All the lists are null or empty.");
+               //
+               // This constructor is used by servers that want to listen for instance on both
+               // ipv4 and ipv6.   Mono has historically done that if you use InterNetworkV6 (at
+               // least on Unix), because that is the default behavior unless the IPV6_V6ONLY
+               // option is explicitly set by using setsockopt (sock, IPPROTO_IPV6, IPV6_ONLY)
+               //
+               public Socket (SocketType socketType, ProtocolType protocolType)
+                       : this (AddressFamily.InterNetworkV6, socketType, protocolType)
+               {
+               }
+               
+               public Socket(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType)
+               {
+#if NET_2_1 && !MOBILE
+                       switch (addressFamily) {
+                       case AddressFamily.InterNetwork:    // ok
+                       case AddressFamily.InterNetworkV6:  // ok
+                       case AddressFamily.Unknown:         // SocketException will be thrown later (with right error #)
+                               break;
+                       // case AddressFamily.Unspecified:
+                       default:
+                               throw new ArgumentException ("addressFamily");
+                       }
+
+                       switch (socketType) {
+                       case SocketType.Stream:             // ok
+                       case SocketType.Unknown:            // SocketException will be thrown later (with right error #)
+                               break;
+                       default:
+                               throw new ArgumentException ("socketType");
+                       }
+
+                       switch (protocolType) {
+                       case ProtocolType.Tcp:              // ok
+                       case ProtocolType.Unspecified:      // ok
+                       case ProtocolType.Unknown:          // SocketException will be thrown later (with right error #)
+                               break;
+                       default:
+                               throw new ArgumentException ("protocolType");
                        }
-
+#endif
+                       this.address_family = addressFamily;
+                       this.socket_type = socketType;
+                       this.protocol_type = protocolType;
+                       
                        int error;
-                       /*
-                        * The 'sockets' array contains: READ socket 0-n, null,
-                        *                               WRITE socket 0-n, null,
-                        *                               ERROR socket 0-n, null
-                        */
-                       Socket [] sockets = list.ToArray ();
-                       Select_internal (ref sockets, microSeconds, out error);
+                       var handle = Socket_internal (addressFamily, socketType, protocolType, out error);
+
+                       this.safe_handle = new SafeSocketHandle (handle, true);
 
                        if (error != 0)
                                throw new SocketException (error);
 
-                       if (sockets == null) {
-                               if (checkRead != null)
-                                       checkRead.Clear ();
-                               if (checkWrite != null)
-                                       checkWrite.Clear ();
-                               if (checkError != null)
-                                       checkError.Clear ();
-                               return;
-                       }
+#if !NET_2_1 || MOBILE
+                       SocketDefaults ();
+#endif
+               }
 
-                       int mode = 0;
-                       int count = sockets.Length;
-                       IList currentList = checkRead;
-                       int currentIdx = 0;
-                       for (int i = 0; i < count; i++) {
-                               Socket sock = sockets [i];
-                               if (sock == null) { // separator
-                                       if (currentList != null) {
-                                               // Remove non-signaled sockets after the current one
-                                               int to_remove = currentList.Count - currentIdx;
-                                               for (int k = 0; k < to_remove; k++)
-                                                       currentList.RemoveAt (currentIdx);
-                                       }
-                                       currentList = (mode == 0) ? checkWrite : checkError;
-                                       currentIdx = 0;
-                                       mode++;
-                                       continue;
-                               }
+#if !MOBILE
+               public Socket (SocketInformation socketInformation)
+               {
+                       this.is_listening      = (socketInformation.Options & SocketInformationOptions.Listening) != 0;
+                       this.is_connected      = (socketInformation.Options & SocketInformationOptions.Connected) != 0;
+                       this.is_blocking       = (socketInformation.Options & SocketInformationOptions.NonBlocking) == 0;
+                       this.use_overlapped_io = (socketInformation.Options & SocketInformationOptions.UseOnlyOverlappedIO) != 0;
 
-                               if (mode == 1 && currentList == checkWrite && !sock.connected) {
-                                       if ((int) sock.GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Error) == 0)
-                                               sock.connected = true;
-                               }
+                       var result = Mono.DataConverter.Unpack ("iiiil", socketInformation.ProtocolInformation, 0);
 
-                               // Remove non-signaled sockets before the current one
-                               //int max = currentList.Count;
-                               while (((Socket) currentList [currentIdx]) != sock) {
-                                       currentList.RemoveAt (currentIdx);
-                               }
-                               currentIdx++;
-                       }
+                       this.address_family = (AddressFamily) (int) result [0];
+                       this.socket_type = (SocketType) (int) result [1];
+                       this.protocol_type = (ProtocolType) (int) result [2];
+                       this.is_bound = (ProtocolType) (int) result [3] != 0;
+                       this.safe_handle = new SafeSocketHandle ((IntPtr) (long) result [4], true);
+
+                       SocketDefaults ();
                }
+#endif
 
-               // private constructor used by Accept, which already
-               // has a socket handle to use
-               internal Socket(AddressFamily family, SocketType type,
-                              ProtocolType proto, SafeSocketHandle sock)
+               /* private constructor used by Accept, which already has a socket handle to use */
+               internal Socket(AddressFamily family, SocketType type, ProtocolType proto, SafeSocketHandle safe_handle)
                {
-                       address_family=family;
-                       socket_type=type;
-                       protocol_type=proto;
+                       this.address_family = family;
+                       this.socket_type = type;
+                       this.protocol_type = proto;
                        
-                       socket=sock;
-                       connected=true;
+                       this.safe_handle = safe_handle;
+                       this.is_connected = true;
+               }
+
+               ~Socket ()
+               {
+                       Dispose (false);
                }
 
-               private void SocketDefaults ()
+               void SocketDefaults ()
                {
                        try {
-                               if (address_family == AddressFamily.InterNetwork /* Need to test IPv6 further ||
-                                                                                  address_family == AddressFamily.InterNetworkV6 */) {
-                                       /* This is the default, but it
-                                        * probably has nasty side
-                                        * effects on Linux, as the
-                                        * socket option is kludged by
-                                        * turning on or off PMTU
-                                        * discovery...
-                                        */
+                               /* Need to test IPv6 further */
+                               if (address_family == AddressFamily.InterNetwork
+                                       // || address_family == AddressFamily.InterNetworkV6
+                               ) {
+                                       /* This is the default, but it probably has nasty side
+                                        * effects on Linux, as the socket option is kludged by
+                                        * turning on or off PMTU discovery... */
                                        this.DontFragment = false;
                                }
 
-                               //
-                               // Microsoft sets these to 8192, but we are going to keep them
-                               // both to the OS defaults as these have a big performance impact.
-                               // on WebClient performance.
-                               //
-                               //this.ReceiveBufferSize = 8192;
-                               //this.SendBufferSize = 8192;
+                               /* Microsoft sets these to 8192, but we are going to keep them
+                                * both to the OS defaults as these have a big performance impact.
+                                * on WebClient performance. */
+                               // this.ReceiveBufferSize = 8192;
+                               // this.SendBufferSize = 8192;
                        } catch (SocketException) {
                        }
                }
 
-#if !MOBILE
-               public Socket (SocketInformation socketInformation)
-               {
-                       var options = socketInformation.Options;
-                       islistening = (options & SocketInformationOptions.Listening) != 0;
-                       connected   = (options & SocketInformationOptions.Connected) != 0;
-                       blocking    = (options & SocketInformationOptions.NonBlocking) == 0;
-                       useoverlappedIO = (options & SocketInformationOptions.UseOnlyOverlappedIO) != 0;
+               /* Creates a new system socket, returning the handle */
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               extern IntPtr Socket_internal (AddressFamily family, SocketType type, ProtocolType proto, out int error);
 
-                       var result = Mono.DataConverter.Unpack ("iiiil", socketInformation.ProtocolInformation, 0);
-                       
-                       address_family = (AddressFamily) (int) result [0];
-                       socket_type = (SocketType) (int) result [1];
-                       protocol_type = (ProtocolType) (int) result [2];
-                       isbound = (ProtocolType) (int) result [3] != 0;
-                       socket = new SafeSocketHandle ((IntPtr) (long) result [4], true);
-                       SocketDefaults ();
+#endregion
+
+#region Properties
+
+               public static bool SupportsIPv4 {
+                       get { return ipv4_supported == 1; }
+               }
+
+               [ObsoleteAttribute ("Use OSSupportsIPv6 instead")]
+               public static bool SupportsIPv6 {
+                       get { return ipv6_supported == 1; }
+               }
+
+#if NET_2_1
+               public static bool OSSupportsIPv4 {
+                       get { return ipv4_supported == 1; }
                }
 #endif
-       
-               // Returns the amount of data waiting to be read on socket
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               private extern static int Available_internal(IntPtr socket, out int error);
 
-               private static int Available_internal (SafeSocketHandle safeHandle, out int error)
-               {
-                       bool release = false;
-                       try {
-                               safeHandle.DangerousAddRef (ref release);
-                               return Available_internal (safeHandle.DangerousGetHandle (), out error);
-                       } finally {
-                               if (release)
-                                       safeHandle.DangerousRelease ();
+#if NET_2_1
+               public static bool OSSupportsIPv6 {
+                       get { return ipv6_supported == 1; }
+               }
+#else
+               public static bool OSSupportsIPv6 {
+                       get {
+                               NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces ();
+
+                               foreach (NetworkInterface adapter in nics) {
+                                       if (adapter.Supports (NetworkInterfaceComponent.IPv6))
+                                               return true;
+                               }
+
+                               return false;
                        }
                }
+#endif
 
                public int Available {
                        get {
-                               if (disposed && closed)
-                                       throw new ObjectDisposedException (GetType ().ToString ());
+                               ThrowIfDisposedAndClosed ();
 
                                int ret, error;
-                               
-                               ret = Available_internal(socket, out error);
+                               ret = Available_internal (safe_handle, out error);
 
                                if (error != 0)
                                        throw new SocketException (error);
 
-                               return(ret);
+                               return ret;
+                       }
+               }
+
+               static int Available_internal (SafeSocketHandle safeHandle, out int error)
+               {
+                       bool release = false;
+                       try {
+                               safeHandle.DangerousAddRef (ref release);
+                               return Available_internal (safeHandle.DangerousGetHandle (), out error);
+                       } finally {
+                               if (release)
+                                       safeHandle.DangerousRelease ();
                        }
                }
 
+               /* Returns the amount of data waiting to be read on socket */
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               extern static int Available_internal (IntPtr socket, out int error);
 
                public bool DontFragment {
                        get {
-                               if (disposed && closed) {
-                                       throw new ObjectDisposedException (GetType ().ToString ());
-                               }
-
-                               bool dontfragment;
-                               
-                               if (address_family == AddressFamily.InterNetwork) {
-                                       dontfragment = (int)(GetSocketOption (SocketOptionLevel.IP, SocketOptionName.DontFragment)) != 0;
-                               } else if (address_family == AddressFamily.InterNetworkV6) {
-                                       dontfragment = (int)(GetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.DontFragment)) != 0;
-                               } else {
+                               ThrowIfDisposedAndClosed ();
+
+                               switch (address_family) {
+                               case AddressFamily.InterNetwork:
+                                       return ((int) GetSocketOption (SocketOptionLevel.IP, SocketOptionName.DontFragment)) != 0;
+                               case AddressFamily.InterNetworkV6:
+                                       return ((int) GetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.DontFragment)) != 0;
+                               default:
                                        throw new NotSupportedException ("This property is only valid for InterNetwork and InterNetworkV6 sockets");
                                }
-                               
-                               return(dontfragment);
                        }
                        set {
-                               if (disposed && closed) {
-                                       throw new ObjectDisposedException (GetType ().ToString ());
-                               }
-
-                               if (address_family == AddressFamily.InterNetwork) {
-                                       SetSocketOption (SocketOptionLevel.IP, SocketOptionName.DontFragment, value?1:0);
-                               } else if (address_family == AddressFamily.InterNetworkV6) {
-                                       SetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.DontFragment, value?1:0);
-                               } else {
+                               ThrowIfDisposedAndClosed ();
+
+                               switch (address_family) {
+                               case AddressFamily.InterNetwork:
+                                       SetSocketOption (SocketOptionLevel.IP, SocketOptionName.DontFragment, value ? 1 : 0);
+                                       break;
+                               case AddressFamily.InterNetworkV6:
+                                       SetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.DontFragment, value ? 1 : 0);
+                                       break;
+                               default:
                                        throw new NotSupportedException ("This property is only valid for InterNetwork and InterNetworkV6 sockets");
                                }
                        }
@@ -266,186 +375,124 @@ namespace System.Net.Sockets
 
                public bool EnableBroadcast {
                        get {
-                               if (disposed && closed) {
-                                       throw new ObjectDisposedException (GetType ().ToString ());
-                               }
+                               ThrowIfDisposedAndClosed ();
 
-                               if (protocol_type != ProtocolType.Udp) {
-                                       throw new SocketException ((int)SocketError.ProtocolOption);
-                               }
-                               
-                               return((int)(GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Broadcast)) != 0);
+                               if (protocol_type != ProtocolType.Udp)
+                                       throw new SocketException ((int) SocketError.ProtocolOption);
+
+                               return ((int) GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Broadcast)) != 0;
                        }
                        set {
-                               if (disposed && closed) {
-                                       throw new ObjectDisposedException (GetType ().ToString ());
-                               }
+                               ThrowIfDisposedAndClosed ();
 
-                               if (protocol_type != ProtocolType.Udp) {
-                                       throw new SocketException ((int)SocketError.ProtocolOption);
-                               }
+                               if (protocol_type != ProtocolType.Udp)
+                                       throw new SocketException ((int) SocketError.ProtocolOption);
 
-                               SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Broadcast, value?1:0);
+                               SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Broadcast, value ? 1 : 0);
                        }
                }
-               
+
                public bool ExclusiveAddressUse {
                        get {
-                               if (disposed && closed) {
-                                       throw new ObjectDisposedException (GetType ().ToString ());
-                               }
+                               ThrowIfDisposedAndClosed ();
 
-                               return((int)(GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ExclusiveAddressUse)) != 0);
+                               return ((int) GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ExclusiveAddressUse)) != 0;
                        }
                        set {
-                               if (disposed && closed) {
-                                       throw new ObjectDisposedException (GetType ().ToString ());
-                               }
-                               if (isbound) {
+                               ThrowIfDisposedAndClosed ();
+
+                               if (is_bound)
                                        throw new InvalidOperationException ("Bind has already been called for this socket");
-                               }
-                               
-                               SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ExclusiveAddressUse, value?1:0);
+
+                               SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ExclusiveAddressUse, value ? 1 : 0);
                        }
                }
-               
+
                public bool IsBound {
                        get {
-                               return(isbound);
+                               return is_bound;
                        }
                }
-               
+
                public LingerOption LingerState {
                        get {
-                               if (disposed && closed) {
-                                       throw new ObjectDisposedException (GetType ().ToString ());
-                               }
+                               ThrowIfDisposedAndClosed ();
 
-                               return((LingerOption)GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Linger));
+                               return (LingerOption) GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Linger);
                        }
                        set {
-                               if (disposed && closed) {
-                                       throw new ObjectDisposedException (GetType ().ToString ());
-                               }
-                               
-                               SetSocketOption (SocketOptionLevel.Socket,
-                                                SocketOptionName.Linger,
-                                                value);
+                               ThrowIfDisposedAndClosed ();
+                               SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Linger, value);
                        }
                }
-               
+
                public bool MulticastLoopback {
                        get {
-                               if (disposed && closed) {
-                                       throw new ObjectDisposedException (GetType ().ToString ());
-                               }
-
-                               /* Even though this option can be set
-                                * for TCP sockets on Linux, throw
-                                * this exception anyway to be
-                                * compatible (the MSDN docs say
-                                * "Setting this property on a
-                                * Transmission Control Protocol (TCP)
-                                * socket will have no effect." but
-                                * the MS runtime throws the
-                                * exception...)
-                                */
-                               if (protocol_type == ProtocolType.Tcp) {
+                               ThrowIfDisposedAndClosed ();
+
+                               /* Even though this option can be set for TCP sockets on Linux, throw
+                                * this exception anyway to be compatible (the MSDN docs say
+                                * "Setting this property on a Transmission Control Protocol (TCP)
+                                * socket will have no effect." but the MS runtime throws the
+                                * exception...) */
+                               if (protocol_type == ProtocolType.Tcp)
                                        throw new SocketException ((int)SocketError.ProtocolOption);
-                               }
-                               
-                               bool multicastloopback;
-                               
-                               if (address_family == AddressFamily.InterNetwork) {
-                                       multicastloopback = (int)(GetSocketOption (SocketOptionLevel.IP, SocketOptionName.MulticastLoopback)) != 0;
-                               } else if (address_family == AddressFamily.InterNetworkV6) {
-                                       multicastloopback = (int)(GetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.MulticastLoopback)) != 0;
-                               } else {
+
+                               switch (address_family) {
+                               case AddressFamily.InterNetwork:
+                                       return ((int) GetSocketOption (SocketOptionLevel.IP, SocketOptionName.MulticastLoopback)) != 0;
+                               case AddressFamily.InterNetworkV6:
+                                       return ((int) GetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.MulticastLoopback)) != 0;
+                               default:
                                        throw new NotSupportedException ("This property is only valid for InterNetwork and InterNetworkV6 sockets");
                                }
-                               
-                               return(multicastloopback);
                        }
                        set {
-                               if (disposed && closed) {
-                                       throw new ObjectDisposedException (GetType ().ToString ());
-                               }
-
-                               /* Even though this option can be set
-                                * for TCP sockets on Linux, throw
-                                * this exception anyway to be
-                                * compatible (the MSDN docs say
-                                * "Setting this property on a
-                                * Transmission Control Protocol (TCP)
-                                * socket will have no effect." but
-                                * the MS runtime throws the
-                                * exception...)
-                                */
-                               if (protocol_type == ProtocolType.Tcp) {
+                               ThrowIfDisposedAndClosed ();
+
+                               /* Even though this option can be set for TCP sockets on Linux, throw
+                                * this exception anyway to be compatible (the MSDN docs say
+                                * "Setting this property on a Transmission Control Protocol (TCP)
+                                * socket will have no effect." but the MS runtime throws the
+                                * exception...) */
+                               if (protocol_type == ProtocolType.Tcp)
                                        throw new SocketException ((int)SocketError.ProtocolOption);
-                               }
-                               
-                               if (address_family == AddressFamily.InterNetwork) {
-                                       SetSocketOption (SocketOptionLevel.IP, SocketOptionName.MulticastLoopback, value?1:0);
-                               } else if (address_family == AddressFamily.InterNetworkV6) {
-                                       SetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.MulticastLoopback, value?1:0);
-                               } else {
+
+                               switch (address_family) {
+                               case AddressFamily.InterNetwork:
+                                       SetSocketOption (SocketOptionLevel.IP, SocketOptionName.MulticastLoopback, value ? 1 : 0);
+                                       break;
+                               case AddressFamily.InterNetworkV6:
+                                       SetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.MulticastLoopback, value ? 1 : 0);
+                                       break;
+                               default:
                                        throw new NotSupportedException ("This property is only valid for InterNetwork and InterNetworkV6 sockets");
                                }
                        }
                }
-               
-               
+
                [MonoTODO ("This doesn't do anything on Mono yet")]
                public bool UseOnlyOverlappedIO {
-                       get {
-                               return(useoverlappedIO);
-                       }
-                       set {
-                               useoverlappedIO = value;
-                       }
+                       get { return use_overlapped_io; }
+                       set { use_overlapped_io = value; }
                }
 
                public IntPtr Handle {
-                       get {
-                               return(socket.DangerousGetHandle ());
-                       }
-               }
-
-               // Returns the local endpoint details in addr and port
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               private extern static SocketAddress LocalEndPoint_internal(IntPtr socket, int family, out int error);
-
-               private static SocketAddress LocalEndPoint_internal(SafeSocketHandle safeHandle, int family, out int error)
-               {
-                       bool release = false;
-                       try {
-                               safeHandle.DangerousAddRef (ref release);
-                               return LocalEndPoint_internal (safeHandle.DangerousGetHandle (), family, out error);
-                       } finally {
-                               if (release)
-                                       safeHandle.DangerousRelease ();
-                       }
+                       get { return safe_handle.DangerousGetHandle (); }
                }
 
                // Wish:  support non-IP endpoints.
                public EndPoint LocalEndPoint {
                        get {
-                               if (disposed && closed)
-                                       throw new ObjectDisposedException (GetType ().ToString ());
-                               
-                               /*
-                                * If the seed EndPoint is null, Connect, Bind,
-                                * etc has not yet been called. MS returns null
-                                * in this case.
-                                */
+                               ThrowIfDisposedAndClosed ();
+
+                               /* If the seed EndPoint is null, Connect, Bind, etc has not yet
+                                * been called. MS returns null in this case. */
                                if (seed_endpoint == null)
                                        return null;
-                               
-                               SocketAddress sa;
+
                                int error;
-                               
-                               sa=LocalEndPoint_internal(socket, (int) address_family, out error);
+                               SocketAddress sa = LocalEndPoint_internal (safe_handle, (int) address_family, out error);
 
                                if (error != 0)
                                        throw new SocketException (error);
@@ -454,222 +501,472 @@ namespace System.Net.Sockets
                        }
                }
 
-               public SocketType SocketType {
-                       get {
-                               return(socket_type);
+               static SocketAddress LocalEndPoint_internal (SafeSocketHandle safeHandle, int family, out int error)
+               {
+                       bool release = false;
+                       try {
+                               safeHandle.DangerousAddRef (ref release);
+                               return LocalEndPoint_internal (safeHandle.DangerousGetHandle (), family, out error);
+                       } finally {
+                               if (release)
+                                       safeHandle.DangerousRelease ();
                        }
                }
 
+               /* Returns the local endpoint details in addr and port */
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               extern static SocketAddress LocalEndPoint_internal (IntPtr socket, int family, out int error);
+
+               public SocketType SocketType {
+                       get { return socket_type; }
+               }
+
                public int SendTimeout {
                        get {
-                               if (disposed && closed)
-                                       throw new ObjectDisposedException (GetType ().ToString ());
+                               ThrowIfDisposedAndClosed ();
 
-                               return (int)GetSocketOption(
-                                       SocketOptionLevel.Socket,
-                                       SocketOptionName.SendTimeout);
+                               return (int) GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.SendTimeout);
                        }
                        set {
-                               if (disposed && closed)
-                                       throw new ObjectDisposedException (GetType ().ToString ());
+                               ThrowIfDisposedAndClosed ();
 
                                if (value < -1)
                                        throw new ArgumentOutOfRangeException ("value", "The value specified for a set operation is less than -1");
 
-                               /* According to the MSDN docs we
-                                * should adjust values between 1 and
-                                * 499 to 500, but the MS runtime
-                                * doesn't do this.
-                                */
+                               /* According to the MSDN docs we should adjust values between 1 and
+                                * 499 to 500, but the MS runtime doesn't do this. */
                                if (value == -1)
                                        value = 0;
 
-                               SetSocketOption(
-                                       SocketOptionLevel.Socket,
-                                       SocketOptionName.SendTimeout, value);
+                               SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendTimeout, value);
                        }
                }
 
                public int ReceiveTimeout {
                        get {
-                               if (disposed && closed)
-                                       throw new ObjectDisposedException (GetType ().ToString ());
+                               ThrowIfDisposedAndClosed ();
 
-                               return (int)GetSocketOption(
-                                       SocketOptionLevel.Socket,
-                                       SocketOptionName.ReceiveTimeout);
+                               return (int) GetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout);
                        }
                        set {
-                               if (disposed && closed)
-                                       throw new ObjectDisposedException (GetType ().ToString ());
+                               ThrowIfDisposedAndClosed ();
 
                                if (value < -1)
                                        throw new ArgumentOutOfRangeException ("value", "The value specified for a set operation is less than -1");
 
-                               if (value == -1) {
+                               if (value == -1)
                                        value = 0;
-                               }
-                               
-                               SetSocketOption(
-                                       SocketOptionLevel.Socket,
-                                       SocketOptionName.ReceiveTimeout, value);
+
+                               SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, value);
                        }
                }
 
-               public bool AcceptAsync (SocketAsyncEventArgs e)
-               {
-                       // NO check is made whether e != null in MS.NET (NRE is thrown in such case)
-                       
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
-                       if (!IsBound)
-                               throw new InvalidOperationException ("You must call the Bind method before performing this operation.");
-                       if (!islistening)
-                               throw new InvalidOperationException ("You must call the Listen method before performing this operation.");
-                       if (e.BufferList != null)
-                               throw new ArgumentException ("Multiple buffers cannot be used with this method.");
-                       if (e.Count < 0)
-                               throw new ArgumentOutOfRangeException ("e.Count");
+               public AddressFamily AddressFamily {
+                       get { return address_family; }
+               }
 
-                       Socket acceptSocket = e.AcceptSocket;
-                       if (acceptSocket != null) {
-                               if (acceptSocket.IsBound || acceptSocket.Connected)
-                                       throw new InvalidOperationException ("AcceptSocket: The socket must not be bound or connected.");
-                       }
+               public bool Blocking {
+                       get { return is_blocking; }
+                       set {
+                               ThrowIfDisposedAndClosed ();
 
-                       e.curSocket = this;
-                       Worker w = e.Worker;
-                       w.Init (this, e, SocketOperation.Accept);
-                       int count;
-                       lock (readQ) {
-                               readQ.Enqueue (e.Worker);
-                               count = readQ.Count;
+                               int error;
+                               Blocking_internal (safe_handle, value, out error);
+
+                               if (error != 0)
+                                       throw new SocketException (error);
+
+                               is_blocking = value;
                        }
-                       if (count == 1)
-                               socket_pool_queue (Worker.Dispatcher, w.result);
-                       return true;
                }
-               // Creates a new system socket, returning the handle
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               private extern static IntPtr Accept_internal(IntPtr sock, out int error, bool blocking);
 
-               private static SafeSocketHandle Accept_internal(SafeSocketHandle safeHandle, out int error, bool blocking)
+               static void Blocking_internal (SafeSocketHandle safeHandle, bool block, out int error)
                {
+                       bool release = false;
                        try {
-                               safeHandle.RegisterForBlockingSyscall ();
-                               var ret = Accept_internal (safeHandle.DangerousGetHandle (), out error, blocking);
-                               return new SafeSocketHandle (ret, true);
+                               safeHandle.DangerousAddRef (ref release);
+                               Blocking_internal (safeHandle.DangerousGetHandle (), block, out error);
                        } finally {
-                               safeHandle.UnRegisterForBlockingSyscall ();
+                               if (release)
+                                       safeHandle.DangerousRelease ();
                        }
                }
 
-               public Socket Accept() {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               internal extern static void Blocking_internal(IntPtr socket, bool block, out int error);
+
+               public bool Connected {
+                       get { return is_connected; }
+                       internal set { is_connected = value; }
+               }
+
+               public ProtocolType ProtocolType {
+                       get { return protocol_type; }
+               }
+
+               public bool NoDelay {
+                       get {
+                               ThrowIfDisposedAndClosed ();
+                               ThrowIfUdp ();
+
+                               return ((int) GetSocketOption (SocketOptionLevel.Tcp, SocketOptionName.NoDelay)) != 0;
+                       }
+
+                       set {
+                               ThrowIfDisposedAndClosed ();
+                               ThrowIfUdp ();
+
+                               SetSocketOption (SocketOptionLevel.Tcp, SocketOptionName.NoDelay, value ? 1 : 0);
+                       }
+               }
+
+               public int ReceiveBufferSize {
+                       get {
+                               ThrowIfDisposedAndClosed ();
+
+                               return (int) GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ReceiveBuffer);
+                       }
+                       set {
+                               ThrowIfDisposedAndClosed ();
+
+                               if (value < 0)
+                                       throw new ArgumentOutOfRangeException ("value", "The value specified for a set operation is less than zero");
+
+                               SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ReceiveBuffer, value);
+                       }
+               }
+
+               public int SendBufferSize {
+                       get {
+                               ThrowIfDisposedAndClosed ();
+
+                               return (int) GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.SendBuffer);
+                       }
+                       set {
+                               ThrowIfDisposedAndClosed ();
+
+                               if (value < 0)
+                                       throw new ArgumentOutOfRangeException ("value", "The value specified for a set operation is less than zero");
+
+                               SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.SendBuffer, value);
+                       }
+               }
+
+               public short Ttl {
+                       get {
+                               ThrowIfDisposedAndClosed ();
+
+                               switch (address_family) {
+                               case AddressFamily.InterNetwork:
+                                       return (short) (int) GetSocketOption (SocketOptionLevel.IP, SocketOptionName.IpTimeToLive);
+                               case AddressFamily.InterNetworkV6:
+                                       return (short) (int) GetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.HopLimit);
+                               default:
+                                       throw new NotSupportedException ("This property is only valid for InterNetwork and InterNetworkV6 sockets");
+                               }
+                       }
+                       set {
+                               ThrowIfDisposedAndClosed ();
+
+                               if (value < 0)
+                                       throw new ArgumentOutOfRangeException ("value", "The value specified for a set operation is less than zero");
+
+                               switch (address_family) {
+                               case AddressFamily.InterNetwork:
+                                       SetSocketOption (SocketOptionLevel.IP, SocketOptionName.IpTimeToLive, value);
+                                       break;
+                               case AddressFamily.InterNetworkV6:
+                                       SetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.HopLimit, value);
+                                       break;
+                               default:
+                                       throw new NotSupportedException ("This property is only valid for InterNetwork and InterNetworkV6 sockets");
+                               }
+                       }
+               }
+
+               public EndPoint RemoteEndPoint {
+                       get {
+                               ThrowIfDisposedAndClosed ();
+
+                               /* If the seed EndPoint is null, Connect, Bind, etc has
+                                * not yet been called. MS returns null in this case. */
+                               if (!is_connected || seed_endpoint == null)
+                                       return null;
+
+                               int error;
+                               SocketAddress sa = RemoteEndPoint_internal (safe_handle, (int) address_family, out error);
+
+                               if (error != 0)
+                                       throw new SocketException (error);
+
+                               return seed_endpoint.Create (sa);
+                       }
+               }
+
+               static SocketAddress RemoteEndPoint_internal (SafeSocketHandle safeHandle, int family, out int error)
+               {
+                       bool release = false;
+                       try {
+                               safeHandle.DangerousAddRef (ref release);
+                               return RemoteEndPoint_internal (safeHandle.DangerousGetHandle (), family, out error);
+                       } finally {
+                               if (release)
+                                       safeHandle.DangerousRelease ();
+                       }
+               }
+
+               /* Returns the remote endpoint details in addr and port */
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               extern static SocketAddress RemoteEndPoint_internal (IntPtr socket, int family, out int error);
+
+#endregion
+
+#region Select
+
+               public static void Select (IList checkRead, IList checkWrite, IList checkError, int microSeconds)
+               {
+                       var list = new List<Socket> ();
+                       AddSockets (list, checkRead, "checkRead");
+                       AddSockets (list, checkWrite, "checkWrite");
+                       AddSockets (list, checkError, "checkError");
+
+                       if (list.Count == 3)
+                               throw new ArgumentNullException ("checkRead, checkWrite, checkError", "All the lists are null or empty.");
+
+                       /* The 'sockets' array contains:
+                        *  - READ socket 0-n, null,
+                        *  - WRITE socket 0-n, null,
+                        *  - ERROR socket 0-n, null */
+                       Socket [] sockets = list.ToArray ();
+
+                       int error;
+                       Select_internal (ref sockets, microSeconds, out error);
+
+                       if (error != 0)
+                               throw new SocketException (error);
+
+                       if (sockets == null) {
+                               if (checkRead != null)
+                                       checkRead.Clear ();
+                               if (checkWrite != null)
+                                       checkWrite.Clear ();
+                               if (checkError != null)
+                                       checkError.Clear ();
+                               return;
+                       }
+
+                       int mode = 0;
+                       int count = sockets.Length;
+                       IList currentList = checkRead;
+                       int currentIdx = 0;
+                       for (int i = 0; i < count; i++) {
+                               Socket sock = sockets [i];
+                               if (sock == null) { // separator
+                                       if (currentList != null) {
+                                               // Remove non-signaled sockets after the current one
+                                               int to_remove = currentList.Count - currentIdx;
+                                               for (int k = 0; k < to_remove; k++)
+                                                       currentList.RemoveAt (currentIdx);
+                                       }
+                                       currentList = (mode == 0) ? checkWrite : checkError;
+                                       currentIdx = 0;
+                                       mode++;
+                                       continue;
+                               }
+
+                               if (mode == 1 && currentList == checkWrite && !sock.is_connected) {
+                                       if ((int) sock.GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Error) == 0)
+                                               sock.is_connected = true;
+                               }
+
+                               /* Remove non-signaled sockets before the current one */
+                               while (((Socket) currentList [currentIdx]) != sock)
+                                       currentList.RemoveAt (currentIdx);
+
+                               currentIdx++;
+                       }
+               }
+
+               static void AddSockets (List<Socket> sockets, IList list, string name)
+               {
+                       if (list != null) {
+                               foreach (Socket sock in list) {
+                                       if (sock == null) // MS throws a NullRef
+                                               throw new ArgumentNullException ("name", "Contains a null element");
+                                       sockets.Add (sock);
+                               }
+                       }
+
+                       sockets.Add (null);
+               }
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               extern static void Select_internal (ref Socket [] sockets, int microSeconds, out int error);
+
+#endregion
+
+#region Poll
+
+               public bool Poll (int time_us, SelectMode mode)
+               {
+                       ThrowIfDisposedAndClosed ();
+
+                       if (mode != SelectMode.SelectRead && mode != SelectMode.SelectWrite && mode != SelectMode.SelectError)
+                               throw new NotSupportedException ("'mode' parameter is not valid.");
+
+                       int error;
+                       bool result = Poll_internal (safe_handle, mode, time_us, out error);
+
+                       if (error != 0)
+                               throw new SocketException (error);
+
+                       if (mode == SelectMode.SelectWrite && result && !is_connected) {
+                               /* Update the is_connected state; for non-blocking Connect()
+                                * this is when we can find out that the connect succeeded. */
+                               if ((int) GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Error) == 0)
+                                       is_connected = true;
+                       }
+
+                       return result;
+               }
+
+               static bool Poll_internal (SafeSocketHandle safeHandle, SelectMode mode, int timeout, out int error)
+               {
+                       bool release = false;
+                       try {
+                               safeHandle.DangerousAddRef (ref release);
+                               return Poll_internal (safeHandle.DangerousGetHandle (), mode, timeout, out error);
+                       } finally {
+                               if (release)
+                                       safeHandle.DangerousRelease ();
+                       }
+               }
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               extern static bool Poll_internal (IntPtr socket, SelectMode mode, int timeout, out int error);
+
+#endregion
+
+#region Accept
+
+               public Socket Accept()
+               {
+                       ThrowIfDisposedAndClosed ();
 
                        int error = 0;
-                       var sock = Accept_internal(socket, out error, blocking);
+                       SafeSocketHandle safe_handle = Accept_internal (this.safe_handle, out error, is_blocking);
 
                        if (error != 0) {
-                               if (closed)
-                                       error = SOCKET_CLOSED;
+                               if (is_closed)
+                                       error = SOCKET_CLOSED_CODE;
                                throw new SocketException(error);
                        }
 
-                       Socket accepted = new Socket(this.AddressFamily, this.SocketType,
-                               this.ProtocolType, sock);
+                       Socket accepted = new Socket (this.AddressFamily, this.SocketType, this.ProtocolType, safe_handle) {
+                               seed_endpoint = this.seed_endpoint,
+                               Blocking = this.Blocking,
+                       };
 
-                       accepted.seed_endpoint = this.seed_endpoint;
-                       accepted.Blocking = this.Blocking;
-                       return(accepted);
+                       return accepted;
                }
 
                internal void Accept (Socket acceptSocket)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
-                       
+                       ThrowIfDisposedAndClosed ();
+
                        int error = 0;
-                       var sock = Accept_internal (socket, out error, blocking);
-                       
+                       SafeSocketHandle safe_handle = Accept_internal (this.safe_handle, out error, is_blocking);
+
                        if (error != 0) {
-                               if (closed)
-                                       error = SOCKET_CLOSED;
+                               if (is_closed)
+                                       error = SOCKET_CLOSED_CODE;
                                throw new SocketException (error);
                        }
-                       
+
                        acceptSocket.address_family = this.AddressFamily;
                        acceptSocket.socket_type = this.SocketType;
                        acceptSocket.protocol_type = this.ProtocolType;
-                       acceptSocket.socket = sock;
-                       acceptSocket.connected = true;
+                       acceptSocket.safe_handle = safe_handle;
+                       acceptSocket.is_connected = true;
                        acceptSocket.seed_endpoint = this.seed_endpoint;
                        acceptSocket.Blocking = this.Blocking;
 
-                       /* FIXME: figure out what if anything else
-                        * needs to be reset
-                        */
+                       // FIXME: figure out what if anything else needs to be reset
+               }
+
+               public bool AcceptAsync (SocketAsyncEventArgs e)
+               {
+                       // NO check is made whether e != null in MS.NET (NRE is thrown in such case)
+
+                       ThrowIfDisposedAndClosed ();
+
+                       if (!is_bound)
+                               throw new InvalidOperationException ("You must call the Bind method before performing this operation.");
+                       if (!is_listening)
+                               throw new InvalidOperationException ("You must call the Listen method before performing this operation.");
+                       if (e.BufferList != null)
+                               throw new ArgumentException ("Multiple buffers cannot be used with this method.");
+                       if (e.Count < 0)
+                               throw new ArgumentOutOfRangeException ("e.Count");
+
+                       Socket acceptSocket = e.AcceptSocket;
+                       if (acceptSocket != null) {
+                               if (acceptSocket.is_bound || acceptSocket.is_connected)
+                                       throw new InvalidOperationException ("AcceptSocket: The socket must not be bound or connected.");
+                       }
+
+                       e.curSocket = this;
+                       e.Worker.Init (this, e, SocketOperation.Accept);
+
+                       SocketAsyncResult sockares = e.Worker.result;
+
+                       QueueSocketAsyncResult (readQ, e.Worker, sockares);
+
+                       return true;
                }
 
                public IAsyncResult BeginAccept(AsyncCallback callback, object state)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
+                       ThrowIfDisposedAndClosed ();
 
-                       if (!isbound || !islistening)
+                       if (!is_bound || !is_listening)
                                throw new InvalidOperationException ();
 
-                       SocketAsyncResult req = new SocketAsyncResult (this, state, callback, SocketOperation.Accept);
-                       int count;
-                       lock (readQ) {
-                               readQ.Enqueue (req.Worker);
-                               count = readQ.Count;
-                       }
-                       if (count == 1)
-                               socket_pool_queue (Worker.Dispatcher, req);
-                       return req;
+                       SocketAsyncResult sockares = new SocketAsyncResult (this, state, callback, SocketOperation.Accept);
+
+                       QueueSocketAsyncResult (readQ, sockares.Worker, sockares);
+
+                       return sockares;
                }
 
-               public IAsyncResult BeginAccept (int receiveSize,
-                                                AsyncCallback callback,
-                                                object state)
+               public IAsyncResult BeginAccept (int receiveSize, AsyncCallback callback, object state)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
+                       ThrowIfDisposedAndClosed ();
 
                        if (receiveSize < 0)
                                throw new ArgumentOutOfRangeException ("receiveSize", "receiveSize is less than zero");
 
-                       SocketAsyncResult req = new SocketAsyncResult (this, state, callback, SocketOperation.AcceptReceive);
-                       req.Buffer = new byte[receiveSize];
-                       req.Offset = 0;
-                       req.Size = receiveSize;
-                       req.SockFlags = SocketFlags.None;
-                       int count;
-                       lock (readQ) {
-                               readQ.Enqueue (req.Worker);
-                               count = readQ.Count;
-                       }
-                       if (count == 1)
-                               socket_pool_queue (Worker.Dispatcher, req);
-                       return req;
+                       SocketAsyncResult sockares = new SocketAsyncResult (this, state, callback, SocketOperation.AcceptReceive) {
+                               Buffer = new byte [receiveSize],
+                               Offset = 0,
+                               Size = receiveSize,
+                               SockFlags = SocketFlags.None,
+                       };
+
+                       QueueSocketAsyncResult (readQ, sockares.Worker, sockares);
+
+                       return sockares;
                }
 
-               public IAsyncResult BeginAccept (Socket acceptSocket,
-                                                int receiveSize,
-                                                AsyncCallback callback,
-                                                object state)
+               public IAsyncResult BeginAccept (Socket acceptSocket, int receiveSize, AsyncCallback callback, object state)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
+                       ThrowIfDisposedAndClosed ();
 
                        if (receiveSize < 0)
                                throw new ArgumentOutOfRangeException ("receiveSize", "receiveSize is less than zero");
 
                        if (acceptSocket != null) {
-                               if (acceptSocket.disposed && acceptSocket.closed)
-                                       throw new ObjectDisposedException (acceptSocket.GetType ().ToString ());
+                               ThrowIfDisposedAndClosed (acceptSocket);
 
                                if (acceptSocket.IsBound)
                                        throw new InvalidOperationException ();
@@ -683,1538 +980,2110 @@ namespace System.Net.Sockets
                                        throw new SocketException ((int)SocketError.InvalidArgument);
                        }
                        
-                       SocketAsyncResult req = new SocketAsyncResult (this, state, callback, SocketOperation.AcceptReceive);
-                       req.Buffer = new byte[receiveSize];
-                       req.Offset = 0;
-                       req.Size = receiveSize;
-                       req.SockFlags = SocketFlags.None;
-                       req.AcceptSocket = acceptSocket;
-                       int count;
-                       lock (readQ) {
-                               readQ.Enqueue (req.Worker);
-                               count = readQ.Count;
+                       SocketAsyncResult sockares = new SocketAsyncResult (this, state, callback, SocketOperation.AcceptReceive) {
+                               Buffer = new byte [receiveSize],
+                               Offset = 0,
+                               Size = receiveSize,
+                               SockFlags = SocketFlags.None,
+                               AcceptSocket = acceptSocket,
+                       };
+
+                       QueueSocketAsyncResult (readQ, sockares.Worker, sockares);
+
+                       return sockares;
+               }
+
+               public Socket EndAccept (IAsyncResult result)
+               {
+                       int bytes;
+                       byte[] buffer;
+                       return EndAccept (out buffer, out bytes, result);
+               }
+
+               public Socket EndAccept (out byte[] buffer, IAsyncResult asyncResult)
+               {
+                       int bytes;
+                       return EndAccept (out buffer, out bytes, asyncResult);
+               }
+
+               public Socket EndAccept (out byte[] buffer, out int bytesTransferred, IAsyncResult asyncResult)
+               {
+                       ThrowIfDisposedAndClosed ();
+
+                       SocketAsyncResult sockares = ValidateEndIAsyncResult (asyncResult, "EndAccept", "asyncResult");
+
+                       if (!sockares.IsCompleted)
+                               sockares.AsyncWaitHandle.WaitOne ();
+
+                       sockares.CheckIfThrowDelayedException ();
+
+                       buffer = sockares.Buffer;
+                       bytesTransferred = sockares.Total;
+
+                       return sockares.Socket;
+               }
+
+               static SafeSocketHandle Accept_internal (SafeSocketHandle safeHandle, out int error, bool blocking)
+               {
+                       try {
+                               safeHandle.RegisterForBlockingSyscall ();
+                               var ret = Accept_internal (safeHandle.DangerousGetHandle (), out error, blocking);
+                               return new SafeSocketHandle (ret, true);
+                       } finally {
+                               safeHandle.UnRegisterForBlockingSyscall ();
                        }
-                       if (count == 1)
-                               socket_pool_queue (Worker.Dispatcher, req);
-                       return(req);
                }
 
-               public IAsyncResult BeginConnect (IPAddress address, int port,
-                                                 AsyncCallback callback,
-                                                 object state)
+               /* Creates a new system socket, returning the handle */
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               extern static IntPtr Accept_internal (IntPtr sock, out int error, bool blocking);
+
+#endregion
+
+#region Bind
+
+               public void Bind (EndPoint local_end)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
+                       ThrowIfDisposedAndClosed ();
 
-                       if (address == null)
-                               throw new ArgumentNullException ("address");
+                       if (local_end == null)
+                               throw new ArgumentNullException("local_end");
 
+                       int error;
+                       Bind_internal (safe_handle, local_end.Serialize(), out error);
+
+                       if (error != 0)
+                               throw new SocketException (error);
+                       if (error == 0)
+                               is_bound = true;
+
+                       seed_endpoint = local_end;
+               }
+
+               private static void Bind_internal (SafeSocketHandle safeHandle, SocketAddress sa, out int error)
+               {
+                       bool release = false;
+                       try {
+                               safeHandle.DangerousAddRef (ref release);
+                               Bind_internal (safeHandle.DangerousGetHandle (), sa, out error);
+                       } finally {
+                               if (release)
+                                       safeHandle.DangerousRelease ();
+                       }
+               }
+
+               // Creates a new system socket, returning the handle
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               private extern static void Bind_internal(IntPtr sock, SocketAddress sa, out int error);
+
+#endregion
+
+#region Listen
+
+               public void Listen (int backlog)
+               {
+                       ThrowIfDisposedAndClosed ();
+
+                       if (!is_bound)
+                               throw new SocketException ((int) SocketError.InvalidArgument);
+
+                       int error;
+                       Listen_internal(safe_handle, backlog, out error);
+
+                       if (error != 0)
+                               throw new SocketException (error);
+
+                       is_listening = true;
+               }
+
+               static void Listen_internal (SafeSocketHandle safeHandle, int backlog, out int error)
+               {
+                       bool release = false;
+                       try {
+                               safeHandle.DangerousAddRef (ref release);
+                               Listen_internal (safeHandle.DangerousGetHandle (), backlog, out error);
+                       } finally {
+                               if (release)
+                                       safeHandle.DangerousRelease ();
+                       }
+               }
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               extern static void Listen_internal (IntPtr sock, int backlog, out int error);
+
+#endregion
+
+#region Connect
+
+               public void Connect (IPAddress address, int port)
+               {
+                       Connect (new IPEndPoint (address, port));
+               }
+
+               public void Connect (string host, int port)
+               {
+                       Connect (Dns.GetHostAddresses (host), port);
+               }
+
+               public void Connect (IPAddress[] addresses, int port)
+               {
+                       ThrowIfDisposedAndClosed ();
+
+                       if (addresses == null)
+                               throw new ArgumentNullException ("addresses");
+                       if (this.AddressFamily != AddressFamily.InterNetwork && this.AddressFamily != AddressFamily.InterNetworkV6)
+                               throw new NotSupportedException ("This method is only valid for addresses in the InterNetwork or InterNetworkV6 families");
+                       if (is_listening)
+                               throw new InvalidOperationException ();
+
+                       // FIXME: do non-blocking sockets Poll here?
+                       int error = 0;
+                       foreach (IPAddress address in addresses) {
+                               IPEndPoint iep = new IPEndPoint (address, port);
+
+                               Connect_internal (safe_handle, iep.Serialize (), out error);
+                               if (error == 0) {
+                                       is_connected = true;
+                                       is_bound = true;
+                                       seed_endpoint = iep;
+                                       return;
+                               }
+                               if (error != (int)SocketError.InProgress && error != (int)SocketError.WouldBlock)
+                                       continue;
+
+                               if (!is_blocking) {
+                                       Poll (-1, SelectMode.SelectWrite);
+                                       error = (int)GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Error);
+                                       if (error == 0) {
+                                               is_connected = true;
+                                               is_bound = true;
+                                               seed_endpoint = iep;
+                                               return;
+                                       }
+                               }
+                       }
+
+                       if (error != 0)
+                               throw new SocketException (error);
+               }
+
+
+               public void Connect (EndPoint remoteEP)
+               {
+                       ThrowIfDisposedAndClosed ();
+
+                       if (remoteEP == null)
+                               throw new ArgumentNullException ("remoteEP");
+
+                       IPEndPoint ep = remoteEP as IPEndPoint;
+                       /* Dgram uses Any to 'disconnect' */
+                       if (ep != null && socket_type != SocketType.Dgram) {
+                               if (ep.Address.Equals (IPAddress.Any) || ep.Address.Equals (IPAddress.IPv6Any))
+                                       throw new SocketException ((int) SocketError.AddressNotAvailable);
+                       }
+
+                       if (is_listening)
+                               throw new InvalidOperationException ();
+
+                       SocketAddress serial = remoteEP.Serialize ();
+
+                       int error = 0;
+                       Connect_internal (safe_handle, serial, out error);
+
+                       if (error == 0 || error == 10035)
+                               seed_endpoint = remoteEP; // Keep the ep around for non-blocking sockets
+
+                       if (error != 0) {
+                               if (is_closed)
+                                       error = SOCKET_CLOSED_CODE;
+                               throw new SocketException (error);
+                       }
+
+                       is_connected = !(socket_type == SocketType.Dgram && ep != null && (ep.Address.Equals (IPAddress.Any) || ep.Address.Equals (IPAddress.IPv6Any)));
+                       is_bound = true;
+               }
+
+               public bool ConnectAsync (SocketAsyncEventArgs e)
+               {
+                       // NO check is made whether e != null in MS.NET (NRE is thrown in such case)
+
+                       ThrowIfDisposedAndClosed ();
+
+                       if (is_listening)
+                               throw new InvalidOperationException ("You may not perform this operation after calling the Listen method.");
+                       if (e.RemoteEndPoint == null)
+                               throw new ArgumentNullException ("remoteEP");
+
+                       e.curSocket = this;
+                       e.Worker.Init (this, e, SocketOperation.Connect);
+
+                       SocketAsyncResult result = e.Worker.result;
+
+                       try {
+                               IPAddress [] addresses;
+                               IAsyncResult ares;
+
+                               if (!GetCheckedIPs (e, out addresses)) {
+                                       result.EndPoint = e.RemoteEndPoint;
+                                       ares = BeginConnect (e.RemoteEndPoint, SocketAsyncEventArgs.Dispatcher, e);
+                               } else {
+                                       DnsEndPoint dep = (e.RemoteEndPoint as DnsEndPoint);
+                                       result.Addresses = addresses;
+                                       result.Port = dep.Port;
+                                       ares = BeginConnect (addresses, dep.Port, SocketAsyncEventArgs.Dispatcher, e);
+                               }
+
+                               if (ares.IsCompleted && ares.CompletedSynchronously) {
+                                       ((SocketAsyncResult) ares).CheckIfThrowDelayedException ();
+                                       return false;
+                               }
+                       } catch (Exception exc) {
+                               result.Complete (exc, true);
+                               return false;
+                       }
+
+                       return true;
+               }
+
+               public IAsyncResult BeginConnect (IPAddress address, int port, AsyncCallback callback, object state)
+               {
+                       ThrowIfDisposedAndClosed ();
+
+                       if (address == null)
+                               throw new ArgumentNullException ("address");
                        if (address.ToString ().Length == 0)
                                throw new ArgumentException ("The length of the IP address is zero");
+                       if (port <= 0 || port > 65535)
+                               throw new ArgumentOutOfRangeException ("port", "Must be > 0 and < 65536");
+                       if (is_listening)
+                               throw new InvalidOperationException ();
+
+                       return BeginConnect (new IPEndPoint (address, port), callback, state);
+               }
+
+               public IAsyncResult BeginConnect (string host, int port, AsyncCallback callback, object state)
+               {
+                       ThrowIfDisposedAndClosed ();
+
+                       if (host == null)
+                               throw new ArgumentNullException ("host");
+                       if (address_family != AddressFamily.InterNetwork && address_family != AddressFamily.InterNetworkV6)
+                               throw new NotSupportedException ("This method is valid only for sockets in the InterNetwork and InterNetworkV6 families");
+                       if (port <= 0 || port > 65535)
+                               throw new ArgumentOutOfRangeException ("port", "Must be > 0 and < 65536");
+                       if (is_listening)
+                               throw new InvalidOperationException ();
+
+                       return BeginConnect (Dns.GetHostAddresses (host), port, callback, state);
+               }
+
+               public IAsyncResult BeginConnect (EndPoint end_point, AsyncCallback callback, object state)
+               {
+                       ThrowIfDisposedAndClosed ();
+
+                       if (end_point == null)
+                               throw new ArgumentNullException ("end_point");
+
+                       SocketAsyncResult sockares = new SocketAsyncResult (this, state, callback, SocketOperation.Connect) {
+                               EndPoint = end_point,
+                       };
+
+                       // Bug #75154: Connect() should not succeed for .Any addresses.
+                       if (end_point is IPEndPoint) {
+                               IPEndPoint ep = (IPEndPoint) end_point;
+                               if (ep.Address.Equals (IPAddress.Any) || ep.Address.Equals (IPAddress.IPv6Any)) {
+                                       sockares.Complete (new SocketException ((int) SocketError.AddressNotAvailable), true);
+                                       return sockares;
+                               }
+                       }
+
+                       int error = 0;
+
+                       if (connect_in_progress) {
+                               // This could happen when multiple IPs are used
+                               // Calling connect() again will reset the connection attempt and cause
+                               // an error. Better to just close the socket and move on.
+                               connect_in_progress = false;
+                               safe_handle.Dispose ();
+                               var handle = Socket_internal (address_family, socket_type, protocol_type, out error);
+                               safe_handle = new SafeSocketHandle (handle, true);
+                               if (error != 0)
+                                       throw new SocketException (error);
+                       }
+
+                       bool blk = is_blocking;
+                       if (blk)
+                               Blocking = false;
+                       Connect_internal (safe_handle, end_point.Serialize (), out error);
+                       if (blk)
+                               Blocking = true;
+
+                       if (error == 0) {
+                               // succeeded synch
+                               is_connected = true;
+                               is_bound = true;
+                               sockares.Complete (true);
+                               return sockares;
+                       }
+
+                       if (error != (int) SocketError.InProgress && error != (int) SocketError.WouldBlock) {
+                               // error synch
+                               is_connected = false;
+                               is_bound = false;
+                               sockares.Complete (new SocketException (error), true);
+                               return sockares;
+                       }
+
+                       // continue asynch
+                       is_connected = false;
+                       is_bound = false;
+                       connect_in_progress = true;
+
+                       socket_pool_queue (SocketAsyncWorker.Dispatcher, sockares);
+
+                       return sockares;
+               }
+
+               public IAsyncResult BeginConnect (IPAddress[] addresses, int port, AsyncCallback callback, object state)
+               {
+                       ThrowIfDisposedAndClosed ();
+
+                       if (addresses == null)
+                               throw new ArgumentNullException ("addresses");
+                       if (addresses.Length == 0)
+                               throw new ArgumentException ("Empty addresses list");
+                       if (this.AddressFamily != AddressFamily.InterNetwork && this.AddressFamily != AddressFamily.InterNetworkV6)
+                               throw new NotSupportedException ("This method is only valid for addresses in the InterNetwork or InterNetworkV6 families");
+                       if (port <= 0 || port > 65535)
+                               throw new ArgumentOutOfRangeException ("port", "Must be > 0 and < 65536");
+                       if (is_listening)
+                               throw new InvalidOperationException ();
+
+                       SocketAsyncResult sockares = new SocketAsyncResult (this, state, callback, SocketOperation.Connect) {
+                               Addresses = addresses,
+                               Port = port,
+                       };
+
+                       is_connected = false;
+
+                       return BeginMConnect (sockares);
+               }
+
+               internal IAsyncResult BeginMConnect (SocketAsyncResult sockares)
+               {
+                       IAsyncResult ares = null;
+                       Exception exc = null;
+
+                       for (int i = sockares.CurrentAddress; i < sockares.Addresses.Length; i++) {
+                               try {
+                                       sockares.CurrentAddress++;
+
+                                       ares = BeginConnect (new IPEndPoint (sockares.Addresses [i], sockares.Port), null, sockares);
+                                       if (ares.IsCompleted && ares.CompletedSynchronously) {
+                                               ((SocketAsyncResult) ares).CheckIfThrowDelayedException ();
+                                               sockares.DoMConnectCallback ();
+                                       }
+
+                                       break;
+                               } catch (Exception e) {
+                                       exc = e;
+                                       ares = null;
+                               }
+                       }
+
+                       if (ares == null)
+                               throw exc;
+
+                       return sockares;
+               }
+
+               public void EndConnect (IAsyncResult result)
+               {
+                       ThrowIfDisposedAndClosed ();
+
+                       SocketAsyncResult sockares = ValidateEndIAsyncResult (result, "EndConnect", "result");
+
+                       if (!sockares.IsCompleted)
+                               sockares.AsyncWaitHandle.WaitOne();
+
+                       sockares.CheckIfThrowDelayedException();
+               }
+
+               static void Connect_internal (SafeSocketHandle safeHandle, SocketAddress sa, out int error)
+               {
+                       try {
+                               safeHandle.RegisterForBlockingSyscall ();
+                               Connect_internal (safeHandle.DangerousGetHandle (), sa, out error);
+                       } finally {
+                               safeHandle.UnRegisterForBlockingSyscall ();
+                       }
+               }
+
+               /* Connects to the remote address */
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               extern static void Connect_internal(IntPtr sock, SocketAddress sa, out int error);
+
+               /* Returns :
+                *  - false when it is ok to use RemoteEndPoint
+                *  - true when addresses must be used (and addresses could be null/empty) */
+               bool GetCheckedIPs (SocketAsyncEventArgs e, out IPAddress [] addresses)
+               {
+                       addresses = null;
+
+                       // Connect to the first address that match the host name, like:
+                       // http://blogs.msdn.com/ncl/archive/2009/07/20/new-ncl-features-in-net-4-0-beta-2.aspx
+                       // while skipping entries that do not match the address family
+                       DnsEndPoint dep = e.RemoteEndPoint as DnsEndPoint;
+                       if (dep != null) {
+                               addresses = Dns.GetHostAddresses (dep.Host);
+                               return true;
+                       } else {
+                               e.ConnectByNameError = null;
+                               return false;
+                       }
+               }
+
+#endregion
+
+#region Disconnect
+
+               /* According to the docs, the MS runtime will throw PlatformNotSupportedException
+                * if the platform is newer than w2k.  We should be able to cope... */
+               public void Disconnect (bool reuseSocket)
+               {
+                       ThrowIfDisposedAndClosed ();
+
+                       int error = 0;
+                       Disconnect_internal (safe_handle, reuseSocket, out error);
+
+                       if (error != 0) {
+                               if (error == 50) {
+                                       /* ERROR_NOT_SUPPORTED */
+                                       throw new PlatformNotSupportedException ();
+                               } else {
+                                       throw new SocketException (error);
+                               }
+                       }
+
+                       is_connected = false;
+                       if (reuseSocket) {
+                               /* Do managed housekeeping here... */
+                       }
+               }
+
+               public bool DisconnectAsync (SocketAsyncEventArgs e)
+               {
+                       // NO check is made whether e != null in MS.NET (NRE is thrown in such case)
+
+                       ThrowIfDisposedAndClosed ();
+
+                       e.curSocket = this;
+                       e.Worker.Init (this, e, SocketOperation.Disconnect);
+
+                       SocketAsyncResult sockares = e.Worker.result;
+
+                       socket_pool_queue (SocketAsyncWorker.Dispatcher, sockares);
+
+                       return true;
+               }
+
+
+               public IAsyncResult BeginDisconnect (bool reuseSocket, AsyncCallback callback, object state)
+               {
+                       ThrowIfDisposedAndClosed ();
+
+                       SocketAsyncResult sockares = new SocketAsyncResult (this, state, callback, SocketOperation.Disconnect) {
+                               ReuseSocket = reuseSocket,
+                       };
+
+                       socket_pool_queue (SocketAsyncWorker.Dispatcher, sockares);
+
+                       return sockares;
+               }
+
+               public void EndDisconnect (IAsyncResult asyncResult)
+               {
+                       ThrowIfDisposedAndClosed ();
+
+                       SocketAsyncResult sockares = ValidateEndIAsyncResult (asyncResult, "EndDisconnect", "asyncResult");
+
+                       if (!sockares.IsCompleted)
+                               sockares.AsyncWaitHandle.WaitOne ();
+
+                       sockares.CheckIfThrowDelayedException ();
+               }
+
+               static void Disconnect_internal (SafeSocketHandle safeHandle, bool reuse, out int error)
+               {
+                       bool release = false;
+                       try {
+                               safeHandle.DangerousAddRef (ref release);
+                               Disconnect_internal (safeHandle.DangerousGetHandle (), reuse, out error);
+                       } finally {
+                               if (release)
+                                       safeHandle.DangerousRelease ();
+                       }
+               }
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               extern static void Disconnect_internal (IntPtr sock, bool reuse, out int error);
+
+#endregion
+
+#region Receive
+
+               public int Receive (byte [] buffer)
+               {
+                       return Receive (buffer, SocketFlags.None);
+               }
+
+               public int Receive (byte [] buffer, SocketFlags flags)
+               {
+                       ThrowIfDisposedAndClosed ();
+                       ThrowIfBufferNull (buffer);
+                       ThrowIfBufferOutOfRange (buffer, 0, buffer.Length);
+
+                       SocketError error;
+                       int ret = Receive_nochecks (buffer, 0, buffer.Length, flags, out error);
+
+                       if (error != SocketError.Success) {
+                               if (error == SocketError.WouldBlock && is_blocking) // This might happen when ReceiveTimeout is set
+                                       throw new SocketException ((int) error, TIMEOUT_EXCEPTION_MSG);
+                               throw new SocketException ((int) error);
+                       }
+
+                       return ret;
+               }
+
+               public int Receive (byte [] buffer, int size, SocketFlags flags)
+               {
+                       ThrowIfDisposedAndClosed ();
+                       ThrowIfBufferNull (buffer);
+                       ThrowIfBufferOutOfRange (buffer, 0, size);
+
+                       SocketError error;
+                       int ret = Receive_nochecks (buffer, 0, size, flags, out error);
+
+                       if (error != SocketError.Success) {
+                               if (error == SocketError.WouldBlock && is_blocking) // This might happen when ReceiveTimeout is set
+                                       throw new SocketException ((int) error, TIMEOUT_EXCEPTION_MSG);
+                               throw new SocketException ((int) error);
+                       }
+
+                       return ret;
+               }
+
+               public int Receive (byte [] buffer, int offset, int size, SocketFlags flags)
+               {
+                       ThrowIfDisposedAndClosed ();
+                       ThrowIfBufferNull (buffer);
+                       ThrowIfBufferOutOfRange (buffer, offset, size);
+
+                       SocketError error;
+                       int ret = Receive_nochecks (buffer, offset, size, flags, out error);
+
+                       if (error != SocketError.Success) {
+                               if (error == SocketError.WouldBlock && is_blocking) // This might happen when ReceiveTimeout is set
+                                       throw new SocketException ((int) error, TIMEOUT_EXCEPTION_MSG);
+                               throw new SocketException ((int) error);
+                       }
+
+                       return ret;
+               }
+
+               public int Receive (byte [] buffer, int offset, int size, SocketFlags flags, out SocketError error)
+               {
+                       ThrowIfDisposedAndClosed ();
+                       ThrowIfBufferNull (buffer);
+                       ThrowIfBufferOutOfRange (buffer, offset, size);
+
+                       return Receive_nochecks (buffer, offset, size, flags, out error);
+               }
+
+               public int Receive (IList<ArraySegment<byte>> buffers)
+               {
+                       SocketError error;
+                       int ret = Receive (buffers, SocketFlags.None, out error);
+
+                       if (error != SocketError.Success)
+                               throw new SocketException ((int) error);
+
+                       return ret;
+               }
+
+               [CLSCompliant (false)]
+               public int Receive (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags)
+               {
+                       SocketError error;
+                       int ret = Receive (buffers, socketFlags, out error);
+
+                       if (error != SocketError.Success)
+                               throw new SocketException ((int) error);
+
+                       return(ret);
+               }
+
+               [CLSCompliant (false)]
+               public int Receive (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode)
+               {
+                       ThrowIfDisposedAndClosed ();
+
+                       if (buffers == null || buffers.Count == 0)
+                               throw new ArgumentNullException ("buffers");
+
+                       int numsegments = buffers.Count;
+                       int nativeError;
+                       int ret;
+
+                       /* Only example I can find of sending a byte array reference directly into an internal
+                        * call is in System.Runtime.Remoting/System.Runtime.Remoting.Channels.Ipc.Win32/NamedPipeSocket.cs,
+                        * so taking a lead from that... */
+                       WSABUF[] bufarray = new WSABUF[numsegments];
+                       GCHandle[] gch = new GCHandle[numsegments];
+
+                       for (int i = 0; i < numsegments; i++) {
+                               ArraySegment<byte> segment = buffers[i];
+
+                               if (segment.Offset < 0 || segment.Count < 0 || segment.Count > segment.Array.Length - segment.Offset)
+                                       throw new ArgumentOutOfRangeException ("segment");
+
+                               gch[i] = GCHandle.Alloc (segment.Array, GCHandleType.Pinned);
+                               bufarray[i].len = segment.Count;
+                               bufarray[i].buf = Marshal.UnsafeAddrOfPinnedArrayElement (segment.Array, segment.Offset);
+                       }
+
+                       try {
+                               ret = Receive_internal (safe_handle, bufarray, socketFlags, out nativeError);
+                       } finally {
+                               for (int i = 0; i < numsegments; i++) {
+                                       if (gch[i].IsAllocated)
+                                               gch[i].Free ();
+                               }
+                       }
+
+                       errorCode = (SocketError) nativeError;
+
+                       return ret;
+               }
+
+               public bool ReceiveAsync (SocketAsyncEventArgs e)
+               {
+                       // NO check is made whether e != null in MS.NET (NRE is thrown in such case)
+
+                       ThrowIfDisposedAndClosed ();
+
+                       // LAME SPEC: the ArgumentException is never thrown, instead an NRE is
+                       // thrown when e.Buffer and e.BufferList are null (works fine when one is
+                       // set to a valid object)
+                       if (e.Buffer == null && e.BufferList == null)
+                               throw new NullReferenceException ("Either e.Buffer or e.BufferList must be valid buffers.");
+
+                       e.curSocket = this;
+                       e.Worker.Init (this, e, e.Buffer != null ? SocketOperation.Receive : SocketOperation.ReceiveGeneric);
+
+                       SocketAsyncResult sockares = e.Worker.result;
+                       sockares.SockFlags = e.SocketFlags;
+
+                       if (e.Buffer != null) {
+                               sockares.Buffer = e.Buffer;
+                               sockares.Offset = e.Offset;
+                               sockares.Size = e.Count;
+                       } else {
+                               sockares.Buffers = e.BufferList;
+                       }
+
+                       // Receive takes care of ReceiveGeneric
+                       QueueSocketAsyncResult (readQ, e.Worker, sockares);
+
+                       return true;
+               }
+
+               public IAsyncResult BeginReceive (byte[] buffer, int offset, int size, SocketFlags socket_flags, AsyncCallback callback, object state)
+               {
+                       ThrowIfDisposedAndClosed ();
+                       ThrowIfBufferNull (buffer);
+                       ThrowIfBufferOutOfRange (buffer, offset, size);
+
+                       SocketAsyncResult sockares = new SocketAsyncResult (this, state, callback, SocketOperation.Receive) {
+                               Buffer = buffer,
+                               Offset = offset,
+                               Size = size,
+                               SockFlags = socket_flags,
+                       };
+
+                       QueueSocketAsyncResult (readQ, sockares.Worker, sockares);
+
+                       return sockares;
+               }
+
+               public IAsyncResult BeginReceive (byte[] buffer, int offset, int size, SocketFlags flags, out SocketError error, AsyncCallback callback, object state)
+               {
+                       /* As far as I can tell from the docs and from experimentation, a pointer to the
+                        * SocketError parameter is not supposed to be saved for the async parts.  And as we don't
+                        * set any socket errors in the setup code, we just have to set it to Success. */
+                       error = SocketError.Success;
+                       return BeginReceive (buffer, offset, size, flags, callback, state);
+               }
+
+               [CLSCompliant (false)]
+               public IAsyncResult BeginReceive (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, AsyncCallback callback, object state)
+               {
+                       ThrowIfDisposedAndClosed ();
+
+                       if (buffers == null)
+                               throw new ArgumentNullException ("buffers");
+
+                       SocketAsyncResult sockares = new SocketAsyncResult (this, state, callback, SocketOperation.ReceiveGeneric) {
+                               Buffers = buffers,
+                               SockFlags = socketFlags,
+                       };
+
+                       QueueSocketAsyncResult (readQ, sockares.Worker, sockares);
+
+                       return sockares;
+               }
+
+               [CLSCompliant (false)]
+               public IAsyncResult BeginReceive (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback callback, object state)
+               {
+                       /* I assume the same SocketError semantics as above */
+                       errorCode = SocketError.Success;
+                       return BeginReceive (buffers, socketFlags, callback, state);
+               }
+
+               public int EndReceive (IAsyncResult result)
+               {
+                       SocketError error;
+                       int bytesReceived = EndReceive (result, out error);
+
+                       if (error != SocketError.Success) {
+                               if (error != SocketError.WouldBlock && error != SocketError.InProgress)
+                                       is_connected = false;
+                               throw new SocketException ((int)error);
+                       }
+
+                       return bytesReceived;
+               }
+
+               public int EndReceive (IAsyncResult asyncResult, out SocketError errorCode)
+               {
+                       ThrowIfDisposedAndClosed ();
+
+                       SocketAsyncResult sockares = ValidateEndIAsyncResult (asyncResult, "EndReceive", "asyncResult");
+
+                       if (!sockares.IsCompleted)
+                               sockares.AsyncWaitHandle.WaitOne ();
+
+                       // If no socket error occurred, call CheckIfThrowDelayedException in case there are other
+                       // kinds of exceptions that should be thrown.
+                       if ((errorCode = sockares.ErrorCode) == SocketError.Success)
+                               sockares.CheckIfThrowDelayedException();
+
+                       return sockares.Total;
+               }
+
+               internal int Receive_nochecks (byte [] buf, int offset, int size, SocketFlags flags, out SocketError error)
+               {
+                       int nativeError;
+                       int ret = Receive_internal (safe_handle, buf, offset, size, flags, out nativeError);
+
+                       error = (SocketError) nativeError;
+                       if (error != SocketError.Success && error != SocketError.WouldBlock && error != SocketError.InProgress) {
+                               is_connected = false;
+                               is_bound = false;
+                       } else {
+                               is_connected = true;
+                       }
+
+                       return ret;
+               }
+
+               static int Receive_internal (SafeSocketHandle safeHandle, WSABUF[] bufarray, SocketFlags flags, out int error)
+               {
+                       try {
+                               safeHandle.RegisterForBlockingSyscall ();
+                               return Receive_internal (safeHandle.DangerousGetHandle (), bufarray, flags, out error);
+                       } finally {
+                               safeHandle.UnRegisterForBlockingSyscall ();
+                       }
+               }
+
+               [MethodImplAttribute (MethodImplOptions.InternalCall)]
+               extern static int Receive_internal (IntPtr sock, WSABUF[] bufarray, SocketFlags flags, out int error);
+
+               static int Receive_internal (SafeSocketHandle safeHandle, byte[] buffer, int offset, int count, SocketFlags flags, out int error)
+               {
+                       try {
+                               safeHandle.RegisterForBlockingSyscall ();
+                               return Receive_internal (safeHandle.DangerousGetHandle (), buffer, offset, count, flags, out error);
+                       } finally {
+                               safeHandle.UnRegisterForBlockingSyscall ();
+                       }
+               }
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               extern static int Receive_internal(IntPtr sock, byte[] buffer, int offset, int count, SocketFlags flags, out int error);
+
+#endregion
+
+#region ReceiveFrom
+
+               public int ReceiveFrom (byte [] buffer, ref EndPoint remoteEP)
+               {
+                       ThrowIfDisposedAndClosed ();
+                       ThrowIfBufferNull (buffer);
+                       ThrowIfBufferOutOfRange (buffer, 0, buffer.Length);
+
+                       if (remoteEP == null)
+                               throw new ArgumentNullException ("remoteEP");
+
+                       return ReceiveFrom_nochecks (buffer, 0, buffer.Length, SocketFlags.None, ref remoteEP);
+               }
+
+               public int ReceiveFrom (byte [] buffer, SocketFlags flags, ref EndPoint remoteEP)
+               {
+                       ThrowIfDisposedAndClosed ();
+                       ThrowIfBufferNull (buffer);
+                       ThrowIfBufferOutOfRange (buffer, 0, buffer.Length);
+
+                       if (remoteEP == null)
+                               throw new ArgumentNullException ("remoteEP");
+
+                       return ReceiveFrom_nochecks (buffer, 0, buffer.Length, flags, ref remoteEP);
+               }
+
+               public int ReceiveFrom (byte [] buffer, int size, SocketFlags flags, ref EndPoint remoteEP)
+               {
+                       ThrowIfDisposedAndClosed ();
+                       ThrowIfBufferNull (buffer);
+                       ThrowIfBufferOutOfRange (buffer, 0, size);
+
+                       if (remoteEP == null)
+                               throw new ArgumentNullException ("remoteEP");
+
+                       return ReceiveFrom_nochecks (buffer, 0, size, flags, ref remoteEP);
+               }
+
+               public int ReceiveFrom (byte [] buffer, int offset, int size, SocketFlags flags, ref EndPoint remoteEP)
+               {
+                       ThrowIfDisposedAndClosed ();
+                       ThrowIfBufferNull (buffer);
+                       ThrowIfBufferOutOfRange (buffer, offset, size);
+
+                       if (remoteEP == null)
+                               throw new ArgumentNullException ("remoteEP");
+
+                       return ReceiveFrom_nochecks (buffer, offset, size, flags, ref remoteEP);
+               }
+
+               public bool ReceiveFromAsync (SocketAsyncEventArgs e)
+               {
+                       ThrowIfDisposedAndClosed ();
+
+                       // We do not support recv into multiple buffers yet
+                       if (e.BufferList != null)
+                               throw new NotSupportedException ("Mono doesn't support using BufferList at this point.");
+                       if (e.RemoteEndPoint == null)
+                               throw new ArgumentNullException ("remoteEP", "Value cannot be null.");
+
+                       e.curSocket = this;
+                       e.Worker.Init (this, e, SocketOperation.ReceiveFrom);
 
-                       if (port <= 0 || port > 65535)
-                               throw new ArgumentOutOfRangeException ("port", "Must be > 0 and < 65536");
+                       SocketAsyncResult sockares = e.Worker.result;
+                       sockares.Buffer = e.Buffer;
+                       sockares.Offset = e.Offset;
+                       sockares.Size = e.Count;
+                       sockares.EndPoint = e.RemoteEndPoint;
+                       sockares.SockFlags = e.SocketFlags;
 
-                       if (islistening)
-                               throw new InvalidOperationException ();
+                       QueueSocketAsyncResult (readQ, e.Worker, sockares);
 
-                       IPEndPoint iep = new IPEndPoint (address, port);
-                       return(BeginConnect (iep, callback, state));
+                       return true;
                }
 
-               public IAsyncResult BeginConnect (string host, int port,
-                                                 AsyncCallback callback,
-                                                 object state)
+               public IAsyncResult BeginReceiveFrom (byte[] buffer, int offset, int size, SocketFlags socket_flags, ref EndPoint remote_end, AsyncCallback callback, object state)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
-
-                       if (host == null)
-                               throw new ArgumentNullException ("host");
+                       ThrowIfDisposedAndClosed ();
+                       ThrowIfBufferNull (buffer);
+                       ThrowIfBufferOutOfRange (buffer, offset, size);
 
-                       if (address_family != AddressFamily.InterNetwork &&
-                               address_family != AddressFamily.InterNetworkV6)
-                               throw new NotSupportedException ("This method is valid only for sockets in the InterNetwork and InterNetworkV6 families");
+                       if (remote_end == null)
+                               throw new ArgumentNullException ("remote_end");
 
-                       if (port <= 0 || port > 65535)
-                               throw new ArgumentOutOfRangeException ("port", "Must be > 0 and < 65536");
+                       SocketAsyncResult sockares = new SocketAsyncResult (this, state, callback, SocketOperation.ReceiveFrom) {
+                               Buffer = buffer,
+                               Offset = offset,
+                               Size = size,
+                               SockFlags = socket_flags,
+                               EndPoint = remote_end,
+                       };
 
-                       if (islistening)
-                               throw new InvalidOperationException ();
+                       QueueSocketAsyncResult (readQ, sockares.Worker, sockares);
 
-                       return BeginConnect (Dns.GetHostAddresses (host), port, callback, state);
+                       return sockares;
                }
 
-               public IAsyncResult BeginDisconnect (bool reuseSocket,
-                                                    AsyncCallback callback,
-                                                    object state)
+               public int EndReceiveFrom(IAsyncResult result, ref EndPoint end_point)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
+                       ThrowIfDisposedAndClosed ();
 
-                       SocketAsyncResult req = new SocketAsyncResult (this, state, callback, SocketOperation.Disconnect);
-                       req.ReuseSocket = reuseSocket;
-                       socket_pool_queue (Worker.Dispatcher, req);
-                       return(req);
-               }
+                       if (end_point == null)
+                               throw new ArgumentNullException ("remote_end");
 
-               void CheckRange (byte[] buffer, int offset, int size)
-               {
-                       if (offset < 0)
-                               throw new ArgumentOutOfRangeException ("offset", "offset must be >= 0");
-                               
-                       if (offset > buffer.Length)
-                               throw new ArgumentOutOfRangeException ("offset", "offset must be <= buffer.Length");
+                       SocketAsyncResult sockares = ValidateEndIAsyncResult (result, "EndReceiveFrom", "result");
 
-                       if (size < 0)                          
-                               throw new ArgumentOutOfRangeException ("size", "size must be >= 0");
-                               
-                       if (size > buffer.Length - offset)
-                               throw new ArgumentOutOfRangeException ("size", "size must be <= buffer.Length - offset");
-               }
-               
-               public IAsyncResult BeginReceive(byte[] buffer, int offset,
-                                                int size,
-                                                SocketFlags socket_flags,
-                                                AsyncCallback callback,
-                                                object state) {
+                       if (!sockares.IsCompleted)
+                               sockares.AsyncWaitHandle.WaitOne();
 
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
+                       sockares.CheckIfThrowDelayedException();
 
-                       if (buffer == null)
-                               throw new ArgumentNullException ("buffer");
+                       end_point = sockares.EndPoint;
 
-                       CheckRange (buffer, offset, size);
+                       return sockares.Total;
+               }
 
-                       SocketAsyncResult req = new SocketAsyncResult (this, state, callback, SocketOperation.Receive);
-                       req.Buffer = buffer;
-                       req.Offset = offset;
-                       req.Size = size;
-                       req.SockFlags = socket_flags;
-                       int count;
-                       lock (readQ) {
-                               readQ.Enqueue (req.Worker);
-                               count = readQ.Count;
-                       }
-                       if (count == 1)
-                               socket_pool_queue (Worker.Dispatcher, req);
-                       return req;
-               }
-
-               public IAsyncResult BeginReceive (byte[] buffer, int offset,
-                                                 int size, SocketFlags flags,
-                                                 out SocketError error,
-                                                 AsyncCallback callback,
-                                                 object state)
-               {
-                       /* As far as I can tell from the docs and from
-                        * experimentation, a pointer to the
-                        * SocketError parameter is not supposed to be
-                        * saved for the async parts.  And as we don't
-                        * set any socket errors in the setup code, we
-                        * just have to set it to Success.
-                        */
-                       error = SocketError.Success;
-                       return (BeginReceive (buffer, offset, size, flags, callback, state));
+               internal int ReceiveFrom_nochecks (byte [] buf, int offset, int size, SocketFlags flags, ref EndPoint remote_end)
+               {
+                       int error;
+                       return ReceiveFrom_nochecks_exc (buf, offset, size, flags, ref remote_end, true, out error);
                }
 
-               [CLSCompliant (false)]
-               public IAsyncResult BeginReceive (IList<ArraySegment<byte>> buffers,
-                                                 SocketFlags socketFlags,
-                                                 AsyncCallback callback,
-                                                 object state)
+               internal int ReceiveFrom_nochecks_exc (byte [] buf, int offset, int size, SocketFlags flags, ref EndPoint remote_end, bool throwOnError, out int error)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
+                       SocketAddress sockaddr = remote_end.Serialize();
 
-                       if (buffers == null)
-                               throw new ArgumentNullException ("buffers");
+                       int cnt = ReceiveFrom_internal (safe_handle, buf, offset, size, flags, ref sockaddr, out error);
 
-                       SocketAsyncResult req = new SocketAsyncResult (this, state, callback, SocketOperation.ReceiveGeneric);
-                       req.Buffers = buffers;
-                       req.SockFlags = socketFlags;
-                       int count;
-                       lock(readQ) {
-                               readQ.Enqueue (req.Worker);
-                               count = readQ.Count;
+                       SocketError err = (SocketError) error;
+                       if (err != 0) {
+                               if (err != SocketError.WouldBlock && err != SocketError.InProgress) {
+                                       is_connected = false;
+                               } else if (err == SocketError.WouldBlock && is_blocking) { // This might happen when ReceiveTimeout is set
+                                       if (throwOnError)       
+                                               throw new SocketException ((int) SocketError.TimedOut, TIMEOUT_EXCEPTION_MSG);
+                                       error = (int) SocketError.TimedOut;
+                                       return 0;
+                               }
+
+                               if (throwOnError)
+                                       throw new SocketException (error);
+
+                               return 0;
                        }
-                       if (count == 1)
-                               socket_pool_queue (Worker.Dispatcher, req);
-                       return req;
-               }
-               
-               [CLSCompliant (false)]
-               public IAsyncResult BeginReceive (IList<ArraySegment<byte>> buffers,
-                                                 SocketFlags socketFlags,
-                                                 out SocketError errorCode,
-                                                 AsyncCallback callback,
-                                                 object state)
-               {
-                       /* I assume the same SocketError semantics as
-                        * above
-                        */
-                       errorCode = SocketError.Success;
-                       return (BeginReceive (buffers, socketFlags, callback, state));
-               }
 
-               public IAsyncResult BeginReceiveFrom(byte[] buffer, int offset,
-                                                    int size,
-                                                    SocketFlags socket_flags,
-                                                    ref EndPoint remote_end,
-                                                    AsyncCallback callback,
-                                                    object state) {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
+                       is_connected = true;
+                       is_bound = true;
 
-                       if (buffer == null)
-                               throw new ArgumentNullException ("buffer");
+                       /* If sockaddr is null then we're a connection oriented protocol and should ignore the
+                        * remote_end parameter (see MSDN documentation for Socket.ReceiveFrom(...) ) */
+                       if (sockaddr != null) {
+                               /* Stupidly, EndPoint.Create() is an instance method */
+                               remote_end = remote_end.Create (sockaddr);
+                       }
 
-                       if (remote_end == null)
-                               throw new ArgumentNullException ("remote_end");
+                       seed_endpoint = remote_end;
 
-                       CheckRange (buffer, offset, size);
+                       return cnt;
+               }
 
-                       SocketAsyncResult req = new SocketAsyncResult (this, state, callback, SocketOperation.ReceiveFrom);
-                       req.Buffer = buffer;
-                       req.Offset = offset;
-                       req.Size = size;
-                       req.SockFlags = socket_flags;
-                       req.EndPoint = remote_end;
-                       int count;
-                       lock (readQ) {
-                               readQ.Enqueue (req.Worker);
-                               count = readQ.Count;
+               static int ReceiveFrom_internal (SafeSocketHandle safeHandle, byte[] buffer, int offset, int count, SocketFlags flags, ref SocketAddress sockaddr, out int error)
+               {
+                       try {
+                               safeHandle.RegisterForBlockingSyscall ();
+                               return ReceiveFrom_internal (safeHandle.DangerousGetHandle (), buffer, offset, count, flags, ref sockaddr, out error);
+                       } finally {
+                               safeHandle.UnRegisterForBlockingSyscall ();
                        }
-                       if (count == 1)
-                               socket_pool_queue (Worker.Dispatcher, req);
-                       return req;
                }
 
-               [MonoTODO]
-               public IAsyncResult BeginReceiveMessageFrom (
-                       byte[] buffer, int offset, int size,
-                       SocketFlags socketFlags, ref EndPoint remoteEP,
-                       AsyncCallback callback, object state)
-               {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               extern static int ReceiveFrom_internal(IntPtr sock, byte[] buffer, int offset, int count, SocketFlags flags, ref SocketAddress sockaddr, out int error);
 
-                       if (buffer == null)
-                               throw new ArgumentNullException ("buffer");
+#endregion
+
+#region ReceiveMessageFrom
+
+               [MonoTODO ("Not implemented")]
+               public int ReceiveMessageFrom (byte[] buffer, int offset, int size, ref SocketFlags socketFlags, ref EndPoint remoteEP, out IPPacketInformation ipPacketInformation)
+               {
+                       ThrowIfDisposedAndClosed ();
+                       ThrowIfBufferNull (buffer);
+                       ThrowIfBufferOutOfRange (buffer, offset, size);
 
                        if (remoteEP == null)
                                throw new ArgumentNullException ("remoteEP");
 
-                       CheckRange (buffer, offset, size);
-
+                       // FIXME: figure out how we get hold of the IPPacketInformation
                        throw new NotImplementedException ();
                }
 
-               public IAsyncResult BeginSend (byte[] buffer, int offset, int size, SocketFlags socket_flags,
-                                              AsyncCallback callback, object state)
+               [MonoTODO ("Not implemented")]
+               public bool ReceiveMessageFromAsync (SocketAsyncEventArgs e)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
-
-                       if (buffer == null)
-                               throw new ArgumentNullException ("buffer");
-
-                       CheckRange (buffer, offset, size);
-
-                       if (!connected)
-                               throw new SocketException ((int)SocketError.NotConnected);
+                       // NO check is made whether e != null in MS.NET (NRE is thrown in such case)
 
-                       SocketAsyncResult req = new SocketAsyncResult (this, state, callback, SocketOperation.Send);
-                       req.Buffer = buffer;
-                       req.Offset = offset;
-                       req.Size = size;
-                       req.SockFlags = socket_flags;
-                       int count;
-                       lock (writeQ) {
-                               writeQ.Enqueue (req.Worker);
-                               count = writeQ.Count;
-                       }
-                       if (count == 1)
-                               socket_pool_queue (Worker.Dispatcher, req);
-                       return req;
-               }
+                       ThrowIfDisposedAndClosed ();
 
-               public IAsyncResult BeginSend (byte[] buffer, int offset,
-                                              int size,
-                                              SocketFlags socketFlags,
-                                              out SocketError errorCode,
-                                              AsyncCallback callback,
-                                              object state)
-               {
-                       if (!connected) {
-                               errorCode = SocketError.NotConnected;
-                               throw new SocketException ((int)errorCode);
-                       }
-                       
-                       errorCode = SocketError.Success;
-                       
-                       return (BeginSend (buffer, offset, size, socketFlags, callback,
-                               state));
+                       throw new NotImplementedException ();
                }
 
-               public IAsyncResult BeginSend (IList<ArraySegment<byte>> buffers,
-                                              SocketFlags socketFlags,
-                                              AsyncCallback callback,
-                                              object state)
+               [MonoTODO]
+               public IAsyncResult BeginReceiveMessageFrom (byte[] buffer, int offset, int size, SocketFlags socketFlags, ref EndPoint remoteEP, AsyncCallback callback, object state)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
-
-                       if (buffers == null)
-                               throw new ArgumentNullException ("buffers");
+                       ThrowIfDisposedAndClosed ();
+                       ThrowIfBufferNull (buffer);
+                       ThrowIfBufferOutOfRange (buffer, offset, size);
 
-                       if (!connected)
-                               throw new SocketException ((int)SocketError.NotConnected);
+                       if (remoteEP == null)
+                               throw new ArgumentNullException ("remoteEP");
 
-                       SocketAsyncResult req = new SocketAsyncResult (this, state, callback, SocketOperation.SendGeneric);
-                       req.Buffers = buffers;
-                       req.SockFlags = socketFlags;
-                       int count;
-                       lock (writeQ) {
-                               writeQ.Enqueue (req.Worker);
-                               count = writeQ.Count;
-                       }
-                       if (count == 1)
-                               socket_pool_queue (Worker.Dispatcher, req);
-                       return req;
+                       throw new NotImplementedException ();
                }
 
-               [CLSCompliant (false)]
-               public IAsyncResult BeginSend (IList<ArraySegment<byte>> buffers,
-                                              SocketFlags socketFlags,
-                                              out SocketError errorCode,
-                                              AsyncCallback callback,
-                                              object state)
+               [MonoTODO]
+               public int EndReceiveMessageFrom (IAsyncResult asyncResult, ref SocketFlags socketFlags, ref EndPoint endPoint, out IPPacketInformation ipPacketInformation)
                {
-                       if (!connected) {
-                               errorCode = SocketError.NotConnected;
-                               throw new SocketException ((int)errorCode);
-                       }
-                       
-                       errorCode = SocketError.Success;
-                       return (BeginSend (buffers, socketFlags, callback, state));
-               }
+                       ThrowIfDisposedAndClosed ();
 
-               delegate void SendFileHandler (string fileName, byte [] preBuffer, byte [] postBuffer, TransmitFileOptions flags);
+                       if (endPoint == null)
+                               throw new ArgumentNullException ("endPoint");
 
-               sealed class SendFileAsyncResult : IAsyncResult {
-                       IAsyncResult ares;
-                       SendFileHandler d;
+                       SocketAsyncResult sockares = ValidateEndIAsyncResult (asyncResult, "EndReceiveMessageFrom", "asyncResult");
 
-                       public SendFileAsyncResult (SendFileHandler d, IAsyncResult ares)
-                       {
-                               this.d = d;
-                               this.ares = ares;
-                       }
+                       throw new NotImplementedException ();
+               }
 
-                       public object AsyncState {
-                               get { return ares.AsyncState; }
-                       }
+#endregion
 
-                       public WaitHandle AsyncWaitHandle {
-                               get { return ares.AsyncWaitHandle; }
-                       }
+#region Send
 
-                       public bool CompletedSynchronously {
-                               get { return ares.CompletedSynchronously; }
-                       }
+               public int Send (byte [] buffer)
+               {
+                       ThrowIfDisposedAndClosed ();
+                       ThrowIfBufferNull (buffer);
+                       ThrowIfBufferOutOfRange (buffer, 0, buffer.Length);
 
-                       public bool IsCompleted {
-                               get { return ares.IsCompleted; }
-                       }
+                       SocketError error;
+                       int ret = Send_nochecks (buffer, 0, buffer.Length, SocketFlags.None, out error);
 
-                       public SendFileHandler Delegate {
-                               get { return d; }
-                       }
+                       if (error != SocketError.Success)
+                               throw new SocketException ((int) error);
 
-                       public IAsyncResult Original {
-                               get { return ares; }
-                       }
+                       return ret;
                }
 
-               public IAsyncResult BeginSendFile (string fileName,
-                                                  AsyncCallback callback,
-                                                  object state)
+               public int Send (byte [] buffer, SocketFlags flags)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
+                       ThrowIfDisposedAndClosed ();
+                       ThrowIfBufferNull (buffer);
+                       ThrowIfBufferOutOfRange (buffer, 0, buffer.Length);
 
-                       if (!connected)
-                               throw new NotSupportedException ();
+                       SocketError error;
+                       int ret = Send_nochecks (buffer, 0, buffer.Length, flags, out error);
 
-                       if (!File.Exists (fileName))
-                               throw new FileNotFoundException ();
+                       if (error != SocketError.Success)
+                               throw new SocketException ((int) error);
 
-                       return BeginSendFile (fileName, null, null, 0, callback, state);
+                       return ret;
                }
 
-               public IAsyncResult BeginSendFile (string fileName,
-                                                  byte[] preBuffer,
-                                                  byte[] postBuffer,
-                                                  TransmitFileOptions flags,
-                                                  AsyncCallback callback,
-                                                  object state)
+               public int Send (byte [] buffer, int size, SocketFlags flags)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
+                       ThrowIfDisposedAndClosed ();
+                       ThrowIfBufferNull (buffer);
+                       ThrowIfBufferOutOfRange (buffer, 0, size);
 
-                       if (!connected)
-                               throw new NotSupportedException ();
+                       SocketError error;
+                       int ret = Send_nochecks (buffer, 0, size, flags, out error);
 
-                       if (!File.Exists (fileName))
-                               throw new FileNotFoundException ();
+                       if (error != SocketError.Success)
+                               throw new SocketException ((int) error);
 
-                       SendFileHandler d = new SendFileHandler (SendFile);
-                       return new SendFileAsyncResult (d, d.BeginInvoke (fileName, preBuffer, postBuffer, flags, ar => {
-                               SendFileAsyncResult sfar = new SendFileAsyncResult (d, ar);
-                               callback (sfar);
-                       }, state));
+                       return ret;
                }
 
-               public IAsyncResult BeginSendTo(byte[] buffer, int offset,
-                                               int size,
-                                               SocketFlags socket_flags,
-                                               EndPoint remote_end,
-                                               AsyncCallback callback,
-                                               object state) {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
+               public int Send (byte [] buffer, int offset, int size, SocketFlags flags)
+               {
+                       ThrowIfDisposedAndClosed ();
+                       ThrowIfBufferNull (buffer);
+                       ThrowIfBufferOutOfRange (buffer, offset, size);
 
-                       if (buffer == null)
-                               throw new ArgumentNullException ("buffer");
+                       SocketError error;
+                       int ret = Send_nochecks (buffer, offset, size, flags, out error);
 
-                       CheckRange (buffer, offset, size);
+                       if (error != SocketError.Success)
+                               throw new SocketException ((int) error);
 
-                       SocketAsyncResult req = new SocketAsyncResult (this, state, callback, SocketOperation.SendTo);
-                       req.Buffer = buffer;
-                       req.Offset = offset;
-                       req.Size = size;
-                       req.SockFlags = socket_flags;
-                       req.EndPoint = remote_end;
-                       int count;
-                       lock (writeQ) {
-                               writeQ.Enqueue (req.Worker);
-                               count = writeQ.Count;
-                       }
-                       if (count == 1)
-                               socket_pool_queue (Worker.Dispatcher, req);
-                       return req;
+                       return ret;
                }
 
-               // Creates a new system socket, returning the handle
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               private extern static void Bind_internal(IntPtr sock,
-                                                        SocketAddress sa,
-                                                        out int error);
-
-               private static void Bind_internal (SafeSocketHandle safeHandle,
-                                                        SocketAddress sa,
-                                                        out int error)
+               public int Send (byte [] buffer, int offset, int size, SocketFlags flags, out SocketError error)
                {
-                       bool release = false;
-                       try {
-                               safeHandle.DangerousAddRef (ref release);
-                               Bind_internal (safeHandle.DangerousGetHandle (), sa, out error);
-                       } finally {
-                               if (release)
-                                       safeHandle.DangerousRelease ();
-                       }
-               }
-
-               public void Bind(EndPoint local_end) {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
+                       ThrowIfDisposedAndClosed ();
+                       ThrowIfBufferNull (buffer);
+                       ThrowIfBufferOutOfRange (buffer, offset, size);
 
-                       if (local_end == null)
-                               throw new ArgumentNullException("local_end");
-                       
-                       int error;
-                       
-                       Bind_internal(socket, local_end.Serialize(), out error);
-                       if (error != 0)
-                               throw new SocketException (error);
-                       if (error == 0)
-                               isbound = true;
-                       
-                       seed_endpoint = local_end;
+                       return Send_nochecks (buffer, offset, size, flags, out error);
                }
 
-               public void Connect (IPAddress address, int port)
-               {
-                       Connect (new IPEndPoint (address, port));
-               }
-               
-               public void Connect (IPAddress[] addresses, int port)
+               public
+               int Send (IList<ArraySegment<byte>> buffers)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
-
-                       if (addresses == null)
-                               throw new ArgumentNullException ("addresses");
-
-                       if (this.AddressFamily != AddressFamily.InterNetwork &&
-                               this.AddressFamily != AddressFamily.InterNetworkV6)
-                               throw new NotSupportedException ("This method is only valid for addresses in the InterNetwork or InterNetworkV6 families");
+                       SocketError error;
+                       int ret = Send (buffers, SocketFlags.None, out error);
 
-                       if (islistening)
-                               throw new InvalidOperationException ();
+                       if (error != SocketError.Success)
+                               throw new SocketException ((int) error);
 
-                       /* FIXME: do non-blocking sockets Poll here? */
-                       int error = 0;
-                       foreach (IPAddress address in addresses) {
-                               IPEndPoint iep = new IPEndPoint (address, port);
-                               SocketAddress serial = iep.Serialize ();
-                               
-                               Connect_internal (socket, serial, out error);
-                               if (error == 0) {
-                                       connected = true;
-                                       isbound = true;
-                                       seed_endpoint = iep;
-                                       return;
-                               } else if (error != (int)SocketError.InProgress &&
-                                          error != (int)SocketError.WouldBlock) {
-                                       continue;
-                               }
-                               
-                               if (!blocking) {
-                                       Poll (-1, SelectMode.SelectWrite);
-                                       error = (int)GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Error);
-                                       if (error == 0) {
-                                               connected = true;
-                                               isbound = true;
-                                               seed_endpoint = iep;
-                                               return;
-                                       }
-                               }
-                       }
-                       if (error != 0)
-                               throw new SocketException (error);
+                       return ret;
                }
 
-               public void Connect (string host, int port)
+               public
+               int Send (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags)
                {
-                       IPAddress [] addresses = Dns.GetHostAddresses (host);
-                       Connect (addresses, port);
+                       SocketError error;
+                       int ret = Send (buffers, socketFlags, out error);
+
+                       if (error != SocketError.Success)
+                               throw new SocketException ((int) error);
+
+                       return ret;
                }
 
-               public bool DisconnectAsync (SocketAsyncEventArgs e)
+               [CLSCompliant (false)]
+               public int Send (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode)
                {
-                       // NO check is made whether e != null in MS.NET (NRE is thrown in such case)
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
+                       ThrowIfDisposedAndClosed ();
 
-                       e.curSocket = this;
-                       e.Worker.Init (this, e, SocketOperation.Disconnect);
-                       socket_pool_queue (Worker.Dispatcher, e.Worker.result);
-                       return true;
-               }
+                       if (buffers == null)
+                               throw new ArgumentNullException ("buffers");
+                       if (buffers.Count == 0)
+                               throw new ArgumentException ("Buffer is empty", "buffers");
 
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               extern static void Disconnect_internal(IntPtr sock, bool reuse, out int error);
+                       int numsegments = buffers.Count;
+                       int nativeError;
+                       int ret;
+
+                       WSABUF[] bufarray = new WSABUF[numsegments];
+                       GCHandle[] gch = new GCHandle[numsegments];
+
+                       for(int i = 0; i < numsegments; i++) {
+                               ArraySegment<byte> segment = buffers[i];
+
+                               if (segment.Offset < 0 || segment.Count < 0 || segment.Count > segment.Array.Length - segment.Offset)
+                                       throw new ArgumentOutOfRangeException ("segment");
+
+                               gch[i] = GCHandle.Alloc (segment.Array, GCHandleType.Pinned);
+                               bufarray[i].len = segment.Count;
+                               bufarray[i].buf = Marshal.UnsafeAddrOfPinnedArrayElement (segment.Array, segment.Offset);
+                       }
 
-               private static void Disconnect_internal(SafeSocketHandle safeHandle, bool reuse, out int error)
-               {
-                       bool release = false;
                        try {
-                               safeHandle.DangerousAddRef (ref release);
-                               Disconnect_internal (safeHandle.DangerousGetHandle (), reuse, out error);
+                               ret = Send_internal (safe_handle, bufarray, socketFlags, out nativeError);
                        } finally {
-                               if (release)
-                                       safeHandle.DangerousRelease ();
+                               for(int i = 0; i < numsegments; i++) {
+                                       if (gch[i].IsAllocated) {
+                                               gch[i].Free ();
+                                       }
+                               }
                        }
+
+                       errorCode = (SocketError)nativeError;
+
+                       return ret;
                }
 
-               /* According to the docs, the MS runtime will throw
-                * PlatformNotSupportedException if the platform is
-                * newer than w2k.  We should be able to cope...
-                */
-               public void Disconnect (bool reuseSocket)
+               internal int Send_nochecks (byte [] buf, int offset, int size, SocketFlags flags, out SocketError error)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
+                       if (size == 0) {
+                               error = SocketError.Success;
+                               return 0;
+                       }
 
-                       int error = 0;
-                       
-                       Disconnect_internal (socket, reuseSocket, out error);
+                       int nativeError;
+                       int ret = Send_internal (safe_handle, buf, offset, size, flags, out nativeError);
 
-                       if (error != 0) {
-                               if (error == 50) {
-                                       /* ERROR_NOT_SUPPORTED */
-                                       throw new PlatformNotSupportedException ();
-                               } else {
-                                       throw new SocketException (error);
-                               }
-                       }
+                       error = (SocketError)nativeError;
 
-                       connected = false;
-                       
-                       if (reuseSocket) {
-                               /* Do managed housekeeping here... */
+                       if (error != SocketError.Success && error != SocketError.WouldBlock && error != SocketError.InProgress) {
+                               is_connected = false;
+                               is_bound = false;
+                       } else {
+                               is_connected = true;
                        }
+
+                       return ret;
                }
 
-#if !MOBILE
-               [MonoLimitation ("We do not support passing sockets across processes, we merely allow this API to pass the socket across AppDomains")]
-               public SocketInformation DuplicateAndClose (int targetProcessId)
+               public bool SendAsync (SocketAsyncEventArgs e)
                {
-                       var si = new SocketInformation ();
-                       si.Options =
-                               (islistening ? SocketInformationOptions.Listening : 0) |
-                               (connected ? SocketInformationOptions.Connected : 0) |
-                               (blocking ? 0 : SocketInformationOptions.NonBlocking) |
-                               (useoverlappedIO ? SocketInformationOptions.UseOnlyOverlappedIO : 0);
+                       // NO check is made whether e != null in MS.NET (NRE is thrown in such case)
 
-                       si.ProtocolInformation = Mono.DataConverter.Pack ("iiiil", (int)address_family, (int)socket_type, (int)protocol_type, isbound ? 1 : 0, (long)Handle);
-                       socket = null;
+                       ThrowIfDisposedAndClosed ();
 
-                       return si;
-               }
-#endif
-       
-               public Socket EndAccept (IAsyncResult result)
-               {
-                       int bytes;
-                       byte[] buffer;
-                       
-                       return(EndAccept (out buffer, out bytes, result));
-               }
+                       if (e.Buffer == null && e.BufferList == null)
+                               throw new NullReferenceException ("Either e.Buffer or e.BufferList must be valid buffers.");
 
-               public Socket EndAccept (out byte[] buffer, IAsyncResult asyncResult)
-               {
-                       int bytes;
-                       return(EndAccept (out buffer, out bytes, asyncResult));
-               }
+                       e.curSocket = this;
+                       e.Worker.Init (this, e, e.Buffer != null ? SocketOperation.Send : SocketOperation.SendGeneric);
 
-               public Socket EndAccept (out byte[] buffer, out int bytesTransferred, IAsyncResult asyncResult)
-               {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
+                       SocketAsyncResult sockares = e.Worker.result;
+                       sockares.SockFlags = e.SocketFlags;
 
-                       if (asyncResult == null)
-                               throw new ArgumentNullException ("asyncResult");
-                       
-                       SocketAsyncResult req = asyncResult as SocketAsyncResult;
-                       if (req == null)
-                               throw new ArgumentException ("Invalid IAsyncResult", "asyncResult");
+                       if (e.Buffer != null) {
+                               sockares.Buffer = e.Buffer;
+                               sockares.Offset = e.Offset;
+                               sockares.Size = e.Count;
+                       } else {
+                               sockares.Buffers = e.BufferList;
+                       }
 
-                       if (Interlocked.CompareExchange (ref req.EndCalled, 1, 0) == 1)
-                               throw InvalidAsyncOp ("EndAccept");
-                       if (!asyncResult.IsCompleted)
-                               asyncResult.AsyncWaitHandle.WaitOne ();
+                       // Send takes care of SendGeneric
+                       QueueSocketAsyncResult (writeQ, e.Worker, sockares);
 
-                       req.CheckIfThrowDelayedException ();
-                       
-                       buffer = req.Buffer;
-                       bytesTransferred = req.Total;
-                       
-                       return(req.Socket);
+                       return true;
                }
 
-               public void EndConnect (IAsyncResult result)
+               public IAsyncResult BeginSend (byte[] buffer, int offset, int size, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback callback, object state)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
-
-                       if (result == null)
-                               throw new ArgumentNullException ("result");
-
-                       SocketAsyncResult req = result as SocketAsyncResult;
-                       if (req == null)
-                               throw new ArgumentException ("Invalid IAsyncResult", "result");
-
-                       if (Interlocked.CompareExchange (ref req.EndCalled, 1, 0) == 1)
-                               throw InvalidAsyncOp ("EndConnect");
-                       if (!result.IsCompleted)
-                               result.AsyncWaitHandle.WaitOne();
+                       if (!is_connected) {
+                               errorCode = SocketError.NotConnected;
+                               throw new SocketException ((int) errorCode);
+                       }
 
-                       req.CheckIfThrowDelayedException();
+                       errorCode = SocketError.Success;
+                       return BeginSend (buffer, offset, size, socketFlags, callback, state);
                }
 
-               public void EndDisconnect (IAsyncResult asyncResult)
+               public IAsyncResult BeginSend (byte[] buffer, int offset, int size, SocketFlags socket_flags, AsyncCallback callback, object state)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
+                       ThrowIfDisposedAndClosed ();
+                       ThrowIfBufferNull (buffer);
+                       ThrowIfBufferOutOfRange (buffer, offset, size);
 
-                       if (asyncResult == null)
-                               throw new ArgumentNullException ("asyncResult");
+                       if (!is_connected)
+                               throw new SocketException ((int)SocketError.NotConnected);
 
-                       SocketAsyncResult req = asyncResult as SocketAsyncResult;
-                       if (req == null)
-                               throw new ArgumentException ("Invalid IAsyncResult", "asyncResult");
+                       SocketAsyncResult sockares = new SocketAsyncResult (this, state, callback, SocketOperation.Send) {
+                               Buffer = buffer,
+                               Offset = offset,
+                               Size = size,
+                               SockFlags = socket_flags,
+                       };
 
-                       if (Interlocked.CompareExchange (ref req.EndCalled, 1, 0) == 1)
-                               throw InvalidAsyncOp ("EndDisconnect");
-                       if (!asyncResult.IsCompleted)
-                               asyncResult.AsyncWaitHandle.WaitOne ();
+                       QueueSocketAsyncResult (writeQ, sockares.Worker, sockares);
 
-                       req.CheckIfThrowDelayedException ();
+                       return sockares;
                }
 
-               [MonoTODO]
-               public int EndReceiveMessageFrom (IAsyncResult asyncResult,
-                                                 ref SocketFlags socketFlags,
-                                                 ref EndPoint endPoint,
-                                                 out IPPacketInformation ipPacketInformation)
+               public IAsyncResult BeginSend (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, AsyncCallback callback, object state)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
+                       ThrowIfDisposedAndClosed ();
 
-                       if (asyncResult == null)
-                               throw new ArgumentNullException ("asyncResult");
+                       if (buffers == null)
+                               throw new ArgumentNullException ("buffers");
+                       if (!is_connected)
+                               throw new SocketException ((int)SocketError.NotConnected);
 
-                       if (endPoint == null)
-                               throw new ArgumentNullException ("endPoint");
+                       SocketAsyncResult sockares = new SocketAsyncResult (this, state, callback, SocketOperation.SendGeneric) {
+                               Buffers = buffers,
+                               SockFlags = socketFlags,
+                       };
 
-                       SocketAsyncResult req = asyncResult as SocketAsyncResult;
-                       if (req == null)
-                               throw new ArgumentException ("Invalid IAsyncResult", "asyncResult");
+                       QueueSocketAsyncResult (writeQ, sockares.Worker, sockares);
 
-                       if (Interlocked.CompareExchange (ref req.EndCalled, 1, 0) == 1)
-                               throw InvalidAsyncOp ("EndReceiveMessageFrom");
-                       throw new NotImplementedException ();
+                       return sockares;
                }
 
-               public void EndSendFile (IAsyncResult asyncResult)
+               [CLSCompliant (false)]
+               public IAsyncResult BeginSend (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback callback, object state)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
+                       if (!is_connected) {
+                               errorCode = SocketError.NotConnected;
+                               throw new SocketException ((int)errorCode);
+                       }
 
-                       if (asyncResult == null)
-                               throw new ArgumentNullException ("asyncResult");
+                       errorCode = SocketError.Success;
+                       return BeginSend (buffers, socketFlags, callback, state);
+               }
 
-                       SendFileAsyncResult ares = asyncResult as SendFileAsyncResult;
-                       if (ares == null)
-                               throw new ArgumentException ("Invalid IAsyncResult", "asyncResult");
+               public int EndSend (IAsyncResult result)
+               {
+                       SocketError error;
+                       int bytesSent = EndSend (result, out error);
 
-                       ares.Delegate.EndInvoke (ares.Original);
+                       if (error != SocketError.Success) {
+                               if (error != SocketError.WouldBlock && error != SocketError.InProgress)
+                                       is_connected = false;
+                               throw new SocketException ((int)error);
+                       }
+
+                       return bytesSent;
                }
 
-               public int EndSendTo (IAsyncResult result)
+               public int EndSend (IAsyncResult asyncResult, out SocketError errorCode)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
+                       ThrowIfDisposedAndClosed ();
 
-                       if (result == null)
-                               throw new ArgumentNullException ("result");
+                       SocketAsyncResult sockares = ValidateEndIAsyncResult (asyncResult, "EndSend", "asyncResult");
 
-                       SocketAsyncResult req = result as SocketAsyncResult;
-                       if (req == null)
-                               throw new ArgumentException ("Invalid IAsyncResult", "result");
+                       if (!sockares.IsCompleted)
+                               sockares.AsyncWaitHandle.WaitOne ();
 
-                       if (Interlocked.CompareExchange (ref req.EndCalled, 1, 0) == 1)
-                               throw InvalidAsyncOp ("EndSendTo");
-                       if (!result.IsCompleted)
-                               result.AsyncWaitHandle.WaitOne();
+                       /* If no socket error occurred, call CheckIfThrowDelayedException in
+                        * case there are other kinds of exceptions that should be thrown.*/
+                       if ((errorCode = sockares.ErrorCode) == SocketError.Success)
+                               sockares.CheckIfThrowDelayedException ();
 
-                       req.CheckIfThrowDelayedException();
-                       return req.Total;
+                       return sockares.Total;
                }
 
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               private extern static void GetSocketOption_arr_internal(IntPtr socket,
-                       SocketOptionLevel level, SocketOptionName name, ref byte[] byte_val,
-                       out int error);
-
-               private static void GetSocketOption_arr_internal (SafeSocketHandle safeHandle,
-                       SocketOptionLevel level, SocketOptionName name, ref byte[] byte_val,
-                       out int error)
+               static int Send_internal (SafeSocketHandle safeHandle, WSABUF[] bufarray, SocketFlags flags, out int error)
                {
                        bool release = false;
                        try {
                                safeHandle.DangerousAddRef (ref release);
-                               GetSocketOption_arr_internal (safeHandle.DangerousGetHandle (), level, name, ref byte_val, out error);
+                               return Send_internal (safeHandle.DangerousGetHandle (), bufarray, flags, out error);
                        } finally {
                                if (release)
                                        safeHandle.DangerousRelease ();
                        }
                }
 
-               public void GetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, byte [] optionValue)
+               [MethodImplAttribute (MethodImplOptions.InternalCall)]
+               extern static int Send_internal (IntPtr sock, WSABUF[] bufarray, SocketFlags flags, out int error);
+
+               static int Send_internal (SafeSocketHandle safeHandle, byte[] buf, int offset, int count, SocketFlags flags, out int error)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
+                       try {
+                               safeHandle.RegisterForBlockingSyscall ();
+                               return Send_internal (safeHandle.DangerousGetHandle (), buf, offset, count, flags, out error);
+                       } finally {
+                               safeHandle.UnRegisterForBlockingSyscall ();
+                       }
+               }
 
-                       if (optionValue == null)
-                               throw new SocketException ((int) SocketError.Fault,
-                                       "Error trying to dereference an invalid pointer");
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               extern static int Send_internal(IntPtr sock, byte[] buf, int offset, int count, SocketFlags flags, out int error);
 
-                       int error;
+#endregion
 
-                       GetSocketOption_arr_internal (socket, optionLevel, optionName, ref optionValue,
-                               out error);
-                       if (error != 0)
-                               throw new SocketException (error);
-               }
+#region SendTo
 
-               public byte [] GetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, int length)
+               public int SendTo (byte [] buffer, EndPoint remote_end)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
-
-                       byte[] byte_val=new byte[length];
-                       int error;
+                       ThrowIfDisposedAndClosed ();
+                       ThrowIfBufferNull (buffer);
+                       ThrowIfBufferOutOfRange (buffer, 0, buffer.Length);
 
-                       GetSocketOption_arr_internal (socket, optionLevel, optionName, ref byte_val,
-                               out error);
-                       if (error != 0)
-                               throw new SocketException (error);
+                       if (remote_end == null)
+                               throw new ArgumentNullException ("remote_end");
 
-                       return(byte_val);
+                       return SendTo_nochecks (buffer, 0, buffer.Length, SocketFlags.None, remote_end);
                }
 
-               // See Socket.IOControl, WSAIoctl documentation in MSDN. The
-               // common options between UNIX and Winsock are FIONREAD,
-               // FIONBIO and SIOCATMARK. Anything else will depend on the
-               // system except SIO_KEEPALIVE_VALS which is properly handled
-               // on both windows and linux.
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               extern static int WSAIoctl (IntPtr sock, int ioctl_code, byte [] input,
-                       byte [] output, out int error);
-
-               private static int WSAIoctl (SafeSocketHandle safeHandle, int ioctl_code, byte [] input,
-                       byte [] output, out int error)
+               public int SendTo (byte [] buffer, SocketFlags flags, EndPoint remote_end)
                {
-                       bool release = false;
-                       try {
-                               safeHandle.DangerousAddRef (ref release);
-                               return WSAIoctl (safeHandle.DangerousGetHandle (), ioctl_code, input, output, out error);
-                       } finally {
-                               if (release)
-                                       safeHandle.DangerousRelease ();
-                       }
+                       ThrowIfDisposedAndClosed ();
+                       ThrowIfBufferNull (buffer);
+                       ThrowIfBufferOutOfRange (buffer, 0, buffer.Length);
+
+                       if (remote_end == null)
+                               throw new ArgumentNullException ("remote_end");
+
+                       return SendTo_nochecks (buffer, 0, buffer.Length, flags, remote_end);
                }
 
-               public int IOControl (int ioctl_code, byte [] in_value, byte [] out_value)
+               public int SendTo (byte [] buffer, int size, SocketFlags flags, EndPoint remote_end)
                {
-                       if (disposed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
-
-                       int error;
-                       int result = WSAIoctl (socket, ioctl_code, in_value, out_value,
-                               out error);
+                       ThrowIfDisposedAndClosed ();
+                       ThrowIfBufferNull (buffer);
+                       ThrowIfBufferOutOfRange (buffer, 0, size);
 
-                       if (error != 0)
-                               throw new SocketException (error);
-                       
-                       if (result == -1)
-                               throw new InvalidOperationException ("Must use Blocking property instead.");
+                       if (remote_end == null)
+                               throw new ArgumentNullException ("remote_end");
 
-                       return result;
+                       return SendTo_nochecks (buffer, 0, size, flags, remote_end);
                }
 
-               public int IOControl (IOControlCode ioControlCode, byte[] optionInValue, byte[] optionOutValue)
+               public int SendTo (byte [] buffer, int offset, int size, SocketFlags flags, EndPoint remote_end)
                {
-                       return IOControl ((int) ioControlCode, optionInValue, optionOutValue);
-               }
+                       ThrowIfDisposedAndClosed ();
+                       ThrowIfBufferNull (buffer);
+                       ThrowIfBufferOutOfRange (buffer, offset, size);
 
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               private extern static void Listen_internal(IntPtr sock, int backlog, out int error);
+                       if (remote_end == null)
+                               throw new ArgumentNullException("remote_end");
 
-               private static void Listen_internal (SafeSocketHandle safeHandle, int backlog, out int error)
-               {
-                       bool release = false;
-                       try {
-                               safeHandle.DangerousAddRef (ref release);
-                               Listen_internal (safeHandle.DangerousGetHandle (), backlog, out error);
-                       } finally {
-                               if (release)
-                                       safeHandle.DangerousRelease ();
-                       }
+                       return SendTo_nochecks (buffer, offset, size, flags, remote_end);
                }
 
-               public void Listen (int backlog)
+               internal int SendTo_nochecks (byte [] buffer, int offset, int size, SocketFlags flags, EndPoint remote_end)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
-
-                       if (!isbound)
-                               throw new SocketException ((int)SocketError.InvalidArgument);
-
                        int error;
-                       Listen_internal(socket, backlog, out error);
+                       int ret = SendTo_internal (safe_handle, buffer, offset, size, flags, remote_end.Serialize (), out error);
 
-                       if (error != 0)
+                       SocketError err = (SocketError) error;
+                       if (err != 0) {
+                               if (err != SocketError.WouldBlock && err != SocketError.InProgress)
+                                       is_connected = false;
                                throw new SocketException (error);
+                       }
+
+                       is_connected = true;
+                       is_bound = true;
+                       seed_endpoint = remote_end;
 
-                       islistening = true;
+                       return ret;
                }
 
-               public bool Poll (int time_us, SelectMode mode)
+               public bool SendToAsync (SocketAsyncEventArgs e)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
+                       // NO check is made whether e != null in MS.NET (NRE is thrown in such case)
 
-                       if (mode != SelectMode.SelectRead &&
-                           mode != SelectMode.SelectWrite &&
-                           mode != SelectMode.SelectError)
-                               throw new NotSupportedException ("'mode' parameter is not valid.");
+                       ThrowIfDisposedAndClosed ();
 
-                       int error;
-                       bool result = Poll_internal (socket, mode, time_us, out error);
-                       if (error != 0)
-                               throw new SocketException (error);
+                       if (e.BufferList != null)
+                               throw new NotSupportedException ("Mono doesn't support using BufferList at this point.");
+                       if (e.RemoteEndPoint == null)
+                               throw new ArgumentNullException ("remoteEP", "Value cannot be null.");
 
-                       if (mode == SelectMode.SelectWrite && result && !connected) {
-                               /* Update the connected state; for
-                                * non-blocking Connect()s this is
-                                * when we can find out that the
-                                * connect succeeded.
-                                */
-                               if ((int)GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Error) == 0) {
-                                       connected = true;
-                               }
-                       }
-                       
-                       return result;
-               }
+                       e.curSocket = this;
+                       e.Worker.Init (this, e, SocketOperation.SendTo);
 
-               public int Receive (byte [] buffer)
-               {
-                       return Receive (buffer, SocketFlags.None);
+                       SocketAsyncResult sockares = e.Worker.result;
+                       sockares.Buffer = e.Buffer;
+                       sockares.Offset = e.Offset;
+                       sockares.Size = e.Count;
+                       sockares.SockFlags = e.SocketFlags;
+                       sockares.EndPoint = e.RemoteEndPoint;
+
+                       QueueSocketAsyncResult (writeQ, e.Worker, sockares);
+
+                       return true;
                }
 
-               public int Receive (byte [] buffer, SocketFlags flags)
-               {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
 
-                       if (buffer == null)
-                               throw new ArgumentNullException ("buffer");
+               public IAsyncResult BeginSendTo(byte[] buffer, int offset, int size, SocketFlags socket_flags, EndPoint remote_end, AsyncCallback callback, object state)
+               {
+                       ThrowIfDisposedAndClosed ();
+                       ThrowIfBufferNull (buffer);
+                       ThrowIfBufferOutOfRange (buffer, offset, size);
 
-                       SocketError error;
+                       SocketAsyncResult sockares = new SocketAsyncResult (this, state, callback, SocketOperation.SendTo) {
+                               Buffer = buffer,
+                               Offset = offset,
+                               Size = size,
+                               SockFlags = socket_flags,
+                               EndPoint = remote_end,
+                       };
 
-                       int ret = Receive_nochecks (buffer, 0, buffer.Length, flags, out error);
-                       
-                       if (error != SocketError.Success) {
-                               if (error == SocketError.WouldBlock && blocking) // This might happen when ReceiveTimeout is set
-                                       throw new SocketException ((int) error, timeout_exc_msg);
-                               throw new SocketException ((int) error);
-                       }
+                       QueueSocketAsyncResult (writeQ, sockares.Worker, sockares);
 
-                       return ret;
+                       return sockares;
                }
 
-               public int Receive (byte [] buffer, int size, SocketFlags flags)
+               public int EndSendTo (IAsyncResult result)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
+                       ThrowIfDisposedAndClosed ();
 
-                       if (buffer == null)
-                               throw new ArgumentNullException ("buffer");
+                       SocketAsyncResult sockares = ValidateEndIAsyncResult (result, "EndSendTo", "result");
 
-                       CheckRange (buffer, 0, size);
-
-                       SocketError error;
+                       if (!sockares.IsCompleted)
+                               sockares.AsyncWaitHandle.WaitOne();
 
-                       int ret = Receive_nochecks (buffer, 0, size, flags, out error);
-                       
-                       if (error != SocketError.Success) {
-                               if (error == SocketError.WouldBlock && blocking) // This might happen when ReceiveTimeout is set
-                                       throw new SocketException ((int) error, timeout_exc_msg);
-                               throw new SocketException ((int) error);
-                       }
+                       sockares.CheckIfThrowDelayedException();
 
-                       return ret;
+                       return sockares.Total;
                }
 
-               public int Receive (byte [] buffer, int offset, int size, SocketFlags flags)
+               static int SendTo_internal (SafeSocketHandle safeHandle, byte[] buffer, int offset, int count, SocketFlags flags, SocketAddress sa, out int error)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
-
-                       if (buffer == null)
-                               throw new ArgumentNullException ("buffer");
+                       try {
+                               safeHandle.RegisterForBlockingSyscall ();
+                               return SendTo_internal (safeHandle.DangerousGetHandle (), buffer, offset, count, flags, sa, out error);
+                       } finally {
+                               safeHandle.UnRegisterForBlockingSyscall ();
+                       }
+               }
 
-                       CheckRange (buffer, offset, size);
-                       
-                       SocketError error;
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               extern static int SendTo_internal (IntPtr sock, byte[] buffer, int offset, int count, SocketFlags flags, SocketAddress sa, out int error);
 
-                       int ret = Receive_nochecks (buffer, offset, size, flags, out error);
-                       
-                       if (error != SocketError.Success) {
-                               if (error == SocketError.WouldBlock && blocking) // This might happen when ReceiveTimeout is set
-                                       throw new SocketException ((int) error, timeout_exc_msg);
-                               throw new SocketException ((int) error);
-                       }
+#endregion
 
-                       return ret;
-               }
+#region SendFile
 
-               public int Receive (byte [] buffer, int offset, int size, SocketFlags flags, out SocketError error)
+               public void SendFile (string fileName)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
+                       ThrowIfDisposedAndClosed ();
 
-                       if (buffer == null)
-                               throw new ArgumentNullException ("buffer");
+                       if (!is_connected)
+                               throw new NotSupportedException ();
+                       if (!is_blocking)
+                               throw new InvalidOperationException ();
 
-                       CheckRange (buffer, offset, size);
-                       
-                       return Receive_nochecks (buffer, offset, size, flags, out error);
+                       SendFile (fileName, null, null, 0);
                }
 
-               public bool ReceiveFromAsync (SocketAsyncEventArgs e)
+               public void SendFile (string fileName, byte[] preBuffer, byte[] postBuffer, TransmitFileOptions flags)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
+                       ThrowIfDisposedAndClosed ();
 
-                       // We do not support recv into multiple buffers yet
-                       if (e.BufferList != null)
-                               throw new NotSupportedException ("Mono doesn't support using BufferList at this point.");
-                       if (e.RemoteEndPoint == null)
-                               throw new ArgumentNullException ("remoteEP", "Value cannot be null.");
+                       if (!is_connected)
+                               throw new NotSupportedException ();
+                       if (!is_blocking)
+                               throw new InvalidOperationException ();
 
-                       e.curSocket = this;
-                       e.Worker.Init (this, e, SocketOperation.ReceiveFrom);
-                       SocketAsyncResult res = e.Worker.result;
-                       res.Buffer = e.Buffer;
-                       res.Offset = e.Offset;
-                       res.Size = e.Count;
-                       res.EndPoint = e.RemoteEndPoint;
-                       res.SockFlags = e.SocketFlags;
-                       int count;
-                       lock (readQ) {
-                               readQ.Enqueue (e.Worker);
-                               count = readQ.Count;
+                       if (!SendFile_internal (safe_handle, fileName, preBuffer, postBuffer, flags)) {
+                               SocketException exc = new SocketException ();
+                               if (exc.ErrorCode == 2 || exc.ErrorCode == 3)
+                                       throw new FileNotFoundException ();
+                               throw exc;
                        }
-                       if (count == 1)
-                               socket_pool_queue (Worker.Dispatcher, res);
-                       return true;
                }
 
-               public int ReceiveFrom (byte [] buffer, ref EndPoint remoteEP)
+               public IAsyncResult BeginSendFile (string fileName, AsyncCallback callback, object state)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
-
-                       if (buffer == null)
-                               throw new ArgumentNullException ("buffer");
+                       ThrowIfDisposedAndClosed ();
 
-                       if (remoteEP == null)
-                               throw new ArgumentNullException ("remoteEP");
+                       if (!is_connected)
+                               throw new NotSupportedException ();
+                       if (!File.Exists (fileName))
+                               throw new FileNotFoundException ();
 
-                       return ReceiveFrom_nochecks (buffer, 0, buffer.Length, SocketFlags.None, ref remoteEP);
+                       return BeginSendFile (fileName, null, null, 0, callback, state);
                }
 
-               public int ReceiveFrom (byte [] buffer, SocketFlags flags, ref EndPoint remoteEP)
+               public IAsyncResult BeginSendFile (string fileName, byte[] preBuffer, byte[] postBuffer, TransmitFileOptions flags, AsyncCallback callback, object state)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
+                       ThrowIfDisposedAndClosed ();
 
-                       if (buffer == null)
-                               throw new ArgumentNullException ("buffer");
+                       if (!is_connected)
+                               throw new NotSupportedException ();
+                       if (!File.Exists (fileName))
+                               throw new FileNotFoundException ();
 
-                       if (remoteEP == null)
-                               throw new ArgumentNullException ("remoteEP");
+                       SendFileHandler handler = new SendFileHandler (SendFile);
 
-                       return ReceiveFrom_nochecks (buffer, 0, buffer.Length, flags, ref remoteEP);
+                       return new SendFileAsyncResult (handler, handler.BeginInvoke (fileName, preBuffer, postBuffer, flags, ar => callback (new SendFileAsyncResult (handler, ar)), state));
                }
 
-               public int ReceiveFrom (byte [] buffer, int size, SocketFlags flags,
-                                       ref EndPoint remoteEP)
+               public void EndSendFile (IAsyncResult asyncResult)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
-
-                       if (buffer == null)
-                               throw new ArgumentNullException ("buffer");
+                       ThrowIfDisposedAndClosed ();
 
-                       if (remoteEP == null)
-                               throw new ArgumentNullException ("remoteEP");
+                       if (asyncResult == null)
+                               throw new ArgumentNullException ("asyncResult");
 
-                       if (size < 0 || size > buffer.Length)
-                               throw new ArgumentOutOfRangeException ("size");
+                       SendFileAsyncResult ares = asyncResult as SendFileAsyncResult;
+                       if (ares == null)
+                               throw new ArgumentException ("Invalid IAsyncResult", "asyncResult");
 
-                       return ReceiveFrom_nochecks (buffer, 0, size, flags, ref remoteEP);
+                       ares.Delegate.EndInvoke (ares.Original);
                }
 
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               private extern static int RecvFrom_internal(IntPtr sock,
-                                                           byte[] buffer,
-                                                           int offset,
-                                                           int count,
-                                                           SocketFlags flags,
-                                                           ref SocketAddress sockaddr,
-                                                           out int error);
-
-               private static int RecvFrom_internal (SafeSocketHandle safeHandle,
-                                                           byte[] buffer,
-                                                           int offset,
-                                                           int count,
-                                                           SocketFlags flags,
-                                                           ref SocketAddress sockaddr,
-                                                           out int error)
+               static bool SendFile_internal (SafeSocketHandle safeHandle, string filename, byte [] pre_buffer, byte [] post_buffer, TransmitFileOptions flags)
                {
                        try {
                                safeHandle.RegisterForBlockingSyscall ();
-                               return RecvFrom_internal (safeHandle.DangerousGetHandle (), buffer, offset, count, flags, ref sockaddr, out error);
+                               return SendFile_internal (safeHandle.DangerousGetHandle (), filename, pre_buffer, post_buffer, flags);
                        } finally {
                                safeHandle.UnRegisterForBlockingSyscall ();
                        }
                }
 
-               public int ReceiveFrom (byte [] buffer, int offset, int size, SocketFlags flags,
-                                       ref EndPoint remoteEP)
-               {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               extern static bool SendFile_internal (IntPtr sock, string filename, byte [] pre_buffer, byte [] post_buffer, TransmitFileOptions flags);
 
-                       if (buffer == null)
-                               throw new ArgumentNullException ("buffer");
+               delegate void SendFileHandler (string fileName, byte [] preBuffer, byte [] postBuffer, TransmitFileOptions flags);
 
-                       if (remoteEP == null)
-                               throw new ArgumentNullException ("remoteEP");
+               sealed class SendFileAsyncResult : IAsyncResult {
+                       IAsyncResult ares;
+                       SendFileHandler d;
 
-                       CheckRange (buffer, offset, size);
+                       public SendFileAsyncResult (SendFileHandler d, IAsyncResult ares)
+                       {
+                               this.d = d;
+                               this.ares = ares;
+                       }
 
-                       return ReceiveFrom_nochecks (buffer, offset, size, flags, ref remoteEP);
-               }
+                       public object AsyncState {
+                               get { return ares.AsyncState; }
+                       }
 
-               internal int ReceiveFrom_nochecks (byte [] buf, int offset, int size, SocketFlags flags,
-                                                  ref EndPoint remote_end)
-               {
-                       int error;
-                       return ReceiveFrom_nochecks_exc (buf, offset, size, flags, ref remote_end, true, out error);
-               }
+                       public WaitHandle AsyncWaitHandle {
+                               get { return ares.AsyncWaitHandle; }
+                       }
 
-               internal int ReceiveFrom_nochecks_exc (byte [] buf, int offset, int size, SocketFlags flags,
-                                                  ref EndPoint remote_end, bool throwOnError, out int error)
-               {
-                       SocketAddress sockaddr = remote_end.Serialize();
-                       int cnt = RecvFrom_internal (socket, buf, offset, size, flags, ref sockaddr, out error);
-                       SocketError err = (SocketError) error;
-                       if (err != 0) {
-                               if (err != SocketError.WouldBlock && err != SocketError.InProgress)
-                                       connected = false;
-                               else if (err == SocketError.WouldBlock && blocking) { // This might happen when ReceiveTimeout is set
-                                       if (throwOnError)       
-                                               throw new SocketException ((int) SocketError.TimedOut, timeout_exc_msg);
-                                       error = (int) SocketError.TimedOut;
-                                       return 0;
-                               }
+                       public bool CompletedSynchronously {
+                               get { return ares.CompletedSynchronously; }
+                       }
 
-                               if (throwOnError)
-                                       throw new SocketException (error);
-                               return 0;
+                       public bool IsCompleted {
+                               get { return ares.IsCompleted; }
                        }
 
-                       connected = true;
-                       isbound = true;
+                       public SendFileHandler Delegate {
+                               get { return d; }
+                       }
 
-                       // If sockaddr is null then we're a connection
-                       // oriented protocol and should ignore the
-                       // remote_end parameter (see MSDN
-                       // documentation for Socket.ReceiveFrom(...) )
-                       
-                       if ( sockaddr != null ) {
-                               // Stupidly, EndPoint.Create() is an
-                               // instance method
-                               remote_end = remote_end.Create (sockaddr);
+                       public IAsyncResult Original {
+                               get { return ares; }
                        }
-                       
-                       seed_endpoint = remote_end;
-                       
-                       return cnt;
                }
 
+#endregion
+
+#region SendPackets
+
                [MonoTODO ("Not implemented")]
-               public bool ReceiveMessageFromAsync (SocketAsyncEventArgs e)
+               public bool SendPacketsAsync (SocketAsyncEventArgs e)
                {
                        // NO check is made whether e != null in MS.NET (NRE is thrown in such case)
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
-                       
+
+                       ThrowIfDisposedAndClosed ();
+
                        throw new NotImplementedException ();
                }
-               
-               [MonoTODO ("Not implemented")]
-               public int ReceiveMessageFrom (byte[] buffer, int offset,
-                                              int size,
-                                              ref SocketFlags socketFlags,
-                                              ref EndPoint remoteEP,
-                                              out IPPacketInformation ipPacketInformation)
-               {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
 
-                       if (buffer == null)
-                               throw new ArgumentNullException ("buffer");
+#endregion
 
-                       if (remoteEP == null)
-                               throw new ArgumentNullException ("remoteEP");
+#region DuplicateAndClose
+
+#if !MOBILE
+               [MonoLimitation ("We do not support passing sockets across processes, we merely allow this API to pass the socket across AppDomains")]
+               public SocketInformation DuplicateAndClose (int targetProcessId)
+               {
+                       var si = new SocketInformation ();
+                       si.Options =
+                               (is_listening      ? SocketInformationOptions.Listening : 0) |
+                               (is_connected      ? SocketInformationOptions.Connected : 0) |
+                               (is_blocking       ? 0 : SocketInformationOptions.NonBlocking) |
+                               (use_overlapped_io ? SocketInformationOptions.UseOnlyOverlappedIO : 0);
 
-                       CheckRange (buffer, offset, size);
+                       si.ProtocolInformation = Mono.DataConverter.Pack ("iiiil", (int)address_family, (int)socket_type, (int)protocol_type, is_bound ? 1 : 0, (long)Handle);
+                       safe_handle = null;
 
-                       /* FIXME: figure out how we get hold of the
-                        * IPPacketInformation
-                        */
-                       throw new NotImplementedException ();
+                       return si;
                }
+#endif
 
-               [MonoTODO ("Not implemented")]
-               public bool SendPacketsAsync (SocketAsyncEventArgs e)
+#endregion
+
+#region GetSocketOption
+
+               public void GetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, byte [] optionValue)
                {
-                       // NO check is made whether e != null in MS.NET (NRE is thrown in such case)
-                       
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
-                       
-                       throw new NotImplementedException ();
+                       ThrowIfDisposedAndClosed ();
+
+                       if (optionValue == null)
+                               throw new SocketException ((int) SocketError.Fault, "Error trying to dereference an invalid pointer");
+
+                       int error;
+                       GetSocketOption_arr_internal (safe_handle, optionLevel, optionName, ref optionValue, out error);
+
+                       if (error != 0)
+                               throw new SocketException (error);
                }
 
-               public int Send (byte [] buf)
+               public byte [] GetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, int length)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
+                       ThrowIfDisposedAndClosed ();
+
+                       int error;
+                       byte[] byte_val = new byte [length];
+                       GetSocketOption_arr_internal (safe_handle, optionLevel, optionName, ref byte_val, out error);
 
-                       if (buf == null)
-                               throw new ArgumentNullException ("buf");
+                       if (error != 0)
+                               throw new SocketException (error);
 
-                       SocketError error;
+                       return byte_val;
+               }
 
-                       int ret = Send_nochecks (buf, 0, buf.Length, SocketFlags.None, out error);
+               public object GetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName)
+               {
+                       ThrowIfDisposedAndClosed ();
 
-                       if (error != SocketError.Success)
-                               throw new SocketException ((int) error);
+                       int error;
+                       object obj_val;
+                       GetSocketOption_obj_internal (safe_handle, optionLevel, optionName, out obj_val, out error);
 
-                       return ret;
+                       if (error != 0)
+                               throw new SocketException (error);
+
+                       if (optionName == SocketOptionName.Linger)
+                               return (LingerOption) obj_val;
+                       else if (optionName == SocketOptionName.AddMembership || optionName == SocketOptionName.DropMembership)
+                               return (MulticastOption) obj_val;
+                       else if (obj_val is int)
+                               return (int) obj_val;
+                       else
+                               return obj_val;
                }
 
-               public int Send (byte [] buf, SocketFlags flags)
+               static void GetSocketOption_arr_internal (SafeSocketHandle safeHandle, SocketOptionLevel level, SocketOptionName name, ref byte[] byte_val, out int error)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
+                       bool release = false;
+                       try {
+                               safeHandle.DangerousAddRef (ref release);
+                               GetSocketOption_arr_internal (safeHandle.DangerousGetHandle (), level, name, ref byte_val, out error);
+                       } finally {
+                               if (release)
+                                       safeHandle.DangerousRelease ();
+                       }
+               }
 
-                       if (buf == null)
-                               throw new ArgumentNullException ("buf");
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               extern static void GetSocketOption_arr_internal(IntPtr socket, SocketOptionLevel level, SocketOptionName name, ref byte[] byte_val, out int error);
 
-                       SocketError error;
+               static void GetSocketOption_obj_internal (SafeSocketHandle safeHandle, SocketOptionLevel level, SocketOptionName name, out object obj_val, out int error)
+               {
+                       bool release = false;
+                       try {
+                               safeHandle.DangerousAddRef (ref release);
+                               GetSocketOption_obj_internal (safeHandle.DangerousGetHandle (), level, name, out obj_val, out error);
+                       } finally {
+                               if (release)
+                                       safeHandle.DangerousRelease ();
+                       }
+               }
 
-                       int ret = Send_nochecks (buf, 0, buf.Length, flags, out error);
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               extern static void GetSocketOption_obj_internal(IntPtr socket, SocketOptionLevel level, SocketOptionName name, out object obj_val, out int error);
 
-                       if (error != SocketError.Success)
-                               throw new SocketException ((int) error);
+#endregion
 
-                       return ret;
+#region SetSocketOption
+
+               public void SetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, byte [] optionValue)
+               {
+                       ThrowIfDisposedAndClosed ();
+
+                       // I'd throw an ArgumentNullException, but this is what MS does.
+                       if (optionValue == null)
+                               throw new SocketException ((int) SocketError.Fault, "Error trying to dereference an invalid pointer");
+
+                       int error;
+                       SetSocketOption_internal (safe_handle, optionLevel, optionName, null, optionValue, 0, out error);
+
+                       if (error != 0) {
+                               if (error == (int) SocketError.InvalidArgument)
+                                       throw new ArgumentException ();
+                               throw new SocketException (error);
+                       }
                }
 
-               public int Send (byte [] buf, int size, SocketFlags flags)
+               public void SetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, object optionValue)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
-
-                       if (buf == null)
-                               throw new ArgumentNullException ("buf");
-
-                       CheckRange (buf, 0, size);
+                       ThrowIfDisposedAndClosed ();
 
-                       SocketError error;
+                       // NOTE: if a null is passed, the byte[] overload is used instead...
+                       if (optionValue == null)
+                               throw new ArgumentNullException("optionValue");
 
-                       int ret = Send_nochecks (buf, 0, size, flags, out error);
+                       int error;
 
-                       if (error != SocketError.Success)
-                               throw new SocketException ((int) error);
+                       if (optionLevel == SocketOptionLevel.Socket && optionName == SocketOptionName.Linger) {
+                               LingerOption linger = optionValue as LingerOption;
+                               if (linger == null)
+                                       throw new ArgumentException ("A 'LingerOption' value must be specified.", "optionValue");
+                               SetSocketOption_internal (safe_handle, optionLevel, optionName, linger, null, 0, out error);
+                       } else if (optionLevel == SocketOptionLevel.IP && (optionName == SocketOptionName.AddMembership || optionName == SocketOptionName.DropMembership)) {
+                               MulticastOption multicast = optionValue as MulticastOption;
+                               if (multicast == null)
+                                       throw new ArgumentException ("A 'MulticastOption' value must be specified.", "optionValue");
+                               SetSocketOption_internal (safe_handle, optionLevel, optionName, multicast, null, 0, out error);
+                       } else if (optionLevel == SocketOptionLevel.IPv6 && (optionName == SocketOptionName.AddMembership || optionName == SocketOptionName.DropMembership)) {
+                               IPv6MulticastOption multicast = optionValue as IPv6MulticastOption;
+                               if (multicast == null)
+                                       throw new ArgumentException ("A 'IPv6MulticastOption' value must be specified.", "optionValue");
+                               SetSocketOption_internal (safe_handle, optionLevel, optionName, multicast, null, 0, out error);
+                       } else {
+                               throw new ArgumentException ("Invalid value specified.", "optionValue");
+                       }
 
-                       return ret;
+                       if (error != 0) {
+                               if (error == (int) SocketError.InvalidArgument)
+                                       throw new ArgumentException ();
+                               throw new SocketException (error);
+                       }
                }
 
-               public int Send (byte [] buf, int offset, int size, SocketFlags flags)
+               public void SetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, bool optionValue)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
-
-                       if (buf == null)
-                               throw new ArgumentNullException ("buffer");
-
-                       CheckRange (buf, offset, size);
-
-                       SocketError error;
-
-                       int ret = Send_nochecks (buf, offset, size, flags, out error);
+                       ThrowIfDisposedAndClosed ();
 
-                       if (error != SocketError.Success)
-                               throw new SocketException ((int) error);
+                       int error;
+                       int int_val = optionValue ? 1 : 0;
+                       SetSocketOption_internal (safe_handle, optionLevel, optionName, null, null, int_val, out error);
 
-                       return ret;
+                       if (error != 0) {
+                               if (error == (int) SocketError.InvalidArgument)
+                                       throw new ArgumentException ();
+                               throw new SocketException (error);
+                       }
                }
 
-               public int Send (byte [] buf, int offset, int size, SocketFlags flags, out SocketError error)
+               public void SetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, int optionValue)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
-
-                       if (buf == null)
-                               throw new ArgumentNullException ("buffer");
+                       ThrowIfDisposedAndClosed ();
 
-                       CheckRange (buf, offset, size);
+                       int error;
+                       SetSocketOption_internal (safe_handle, optionLevel, optionName, null, null, optionValue, out error);
 
-                       return Send_nochecks (buf, offset, size, flags, out error);
+                       if (error != 0) {
+                               throw new SocketException (error);
+                       }
                }
 
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               private extern static bool SendFile (IntPtr sock, string filename, byte [] pre_buffer, byte [] post_buffer, TransmitFileOptions flags);
-
-               private static bool SendFile (SafeSocketHandle safeHandle, string filename, byte [] pre_buffer, byte [] post_buffer, TransmitFileOptions flags)
+               static void SetSocketOption_internal (SafeSocketHandle safeHandle, SocketOptionLevel level, SocketOptionName name, object obj_val, byte [] byte_val, int int_val, out int error)
                {
+                       bool release = false;
                        try {
-                               safeHandle.RegisterForBlockingSyscall ();
-                               return SendFile (safeHandle.DangerousGetHandle (), filename, pre_buffer, post_buffer, flags);
+                               safeHandle.DangerousAddRef (ref release);
+                               SetSocketOption_internal (safeHandle.DangerousGetHandle (), level, name, obj_val, byte_val, int_val, out error);
                        } finally {
-                               safeHandle.UnRegisterForBlockingSyscall ();
+                               if (release)
+                                       safeHandle.DangerousRelease ();
                        }
                }
 
-               public void SendFile (string fileName)
-               {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
-
-                       if (!connected)
-                               throw new NotSupportedException ();
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               extern static void SetSocketOption_internal (IntPtr socket, SocketOptionLevel level, SocketOptionName name, object obj_val, byte [] byte_val, int int_val, out int error);
 
-                       if (!blocking)
-                               throw new InvalidOperationException ();
+#endregion
 
-                       SendFile (fileName, null, null, 0);
-               }
+#region IOControl
 
-               public void SendFile (string fileName, byte[] preBuffer, byte[] postBuffer, TransmitFileOptions flags)
+               public int IOControl (int ioctl_code, byte [] in_value, byte [] out_value)
                {
-                       if (disposed && closed)
+                       if (is_disposed)
                                throw new ObjectDisposedException (GetType ().ToString ());
 
-                       if (!connected)
-                               throw new NotSupportedException ();
+                       int error;
+                       int result = IOControl_internal (safe_handle, ioctl_code, in_value, out_value, out error);
 
-                       if (!blocking)
-                               throw new InvalidOperationException ();
+                       if (error != 0)
+                               throw new SocketException (error);
+                       if (result == -1)
+                               throw new InvalidOperationException ("Must use Blocking property instead.");
 
-                       if (!SendFile (socket, fileName, preBuffer, postBuffer, flags)) {
-                               SocketException exc = new SocketException ();
-                               if (exc.ErrorCode == 2 || exc.ErrorCode == 3)
-                                       throw new FileNotFoundException ();
-                               throw exc;
-                       }
+                       return result;
                }
 
-               public bool SendToAsync (SocketAsyncEventArgs e)
+               public int IOControl (IOControlCode ioControlCode, byte[] optionInValue, byte[] optionOutValue)
                {
-                       // NO check is made whether e != null in MS.NET (NRE is thrown in such case)
-                       
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
-                       if (e.BufferList != null)
-                               throw new NotSupportedException ("Mono doesn't support using BufferList at this point.");
-                       if (e.RemoteEndPoint == null)
-                               throw new ArgumentNullException ("remoteEP", "Value cannot be null.");
+                       return IOControl ((int) ioControlCode, optionInValue, optionOutValue);
+               }
 
-                       e.curSocket = this;
-                       e.Worker.Init (this, e, SocketOperation.SendTo);
-                       SocketAsyncResult res = e.Worker.result;
-                       res.Buffer = e.Buffer;
-                       res.Offset = e.Offset;
-                       res.Size = e.Count;
-                       res.SockFlags = e.SocketFlags;
-                       res.EndPoint = e.RemoteEndPoint;
-                       int count;
-                       lock (writeQ) {
-                               writeQ.Enqueue (e.Worker);
-                               count = writeQ.Count;
+               static int IOControl_internal (SafeSocketHandle safeHandle, int ioctl_code, byte [] input, byte [] output, out int error)
+               {
+                       bool release = false;
+                       try {
+                               safeHandle.DangerousAddRef (ref release);
+                               return IOControl_internal (safeHandle.DangerousGetHandle (), ioctl_code, input, output, out error);
+                       } finally {
+                               if (release)
+                                       safeHandle.DangerousRelease ();
                        }
-                       if (count == 1)
-                               socket_pool_queue (Worker.Dispatcher, res);
-                       return true;
                }
-               
-               public int SendTo (byte [] buffer, EndPoint remote_end)
-               {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
 
-                       if (buffer == null)
-                               throw new ArgumentNullException ("buffer");
+               /* See Socket.IOControl, WSAIoctl documentation in MSDN. The common options between UNIX
+                * and Winsock are FIONREAD, FIONBIO and SIOCATMARK. Anything else will depend on the system
+                * except SIO_KEEPALIVE_VALS which is properly handled on both windows and linux. */
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               extern static int IOControl_internal (IntPtr sock, int ioctl_code, byte [] input, byte [] output, out int error);
 
-                       if (remote_end == null)
-                               throw new ArgumentNullException ("remote_end");
+#endregion
 
-                       return SendTo_nochecks (buffer, 0, buffer.Length, SocketFlags.None, remote_end);
+#region Close
+
+               public void Close ()
+               {
+                       linger_timeout = 0;
+                       Dispose ();
                }
 
-               public int SendTo (byte [] buffer, SocketFlags flags, EndPoint remote_end)
+               public void Close (int timeout)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
+                       linger_timeout = timeout;
+                       Dispose ();
+               }
 
-                       if (buffer == null)
-                               throw new ArgumentNullException ("buffer");
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               internal extern static void Close_internal (IntPtr socket, out int error);
 
-                       if (remote_end == null)
-                               throw new ArgumentNullException ("remote_end");
-                               
-                       return SendTo_nochecks (buffer, 0, buffer.Length, flags, remote_end);
-               }
+#endregion
 
-               public int SendTo (byte [] buffer, int size, SocketFlags flags, EndPoint remote_end)
-               {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
+#region Shutdown
 
-                       if (buffer == null)
-                               throw new ArgumentNullException ("buffer");
+               public void Shutdown (SocketShutdown how)
+               {
+                       ThrowIfDisposedAndClosed ();
 
-                       if (remote_end == null)
-                               throw new ArgumentNullException ("remote_end");
+                       if (!is_connected)
+                               throw new SocketException (10057); // Not connected
 
-                       CheckRange (buffer, 0, size);
+                       int error;
+                       Shutdown_internal (safe_handle, how, out error);
 
-                       return SendTo_nochecks (buffer, 0, size, flags, remote_end);
+                       if (error != 0)
+                               throw new SocketException (error);
                }
 
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               private extern static int SendTo_internal(IntPtr sock,
-                                                         byte[] buffer,
-                                                         int offset,
-                                                         int count,
-                                                         SocketFlags flags,
-                                                         SocketAddress sa,
-                                                         out int error);
-
-               private static int SendTo_internal (SafeSocketHandle safeHandle,
-                                                         byte[] buffer,
-                                                         int offset,
-                                                         int count,
-                                                         SocketFlags flags,
-                                                         SocketAddress sa,
-                                                         out int error)
+               static void Shutdown_internal (SafeSocketHandle safeHandle, SocketShutdown how, out int error)
                {
+                       bool release = false;
                        try {
-                               safeHandle.RegisterForBlockingSyscall ();
-                               return SendTo_internal (safeHandle.DangerousGetHandle (), buffer, offset, count, flags, sa, out error);
+                               safeHandle.DangerousAddRef (ref release);
+                               Shutdown_internal (safeHandle.DangerousGetHandle (), how, out error);
                        } finally {
-                               safeHandle.UnRegisterForBlockingSyscall ();
+                               if (release)
+                                       safeHandle.DangerousRelease ();
                        }
                }
 
-               public int SendTo (byte [] buffer, int offset, int size, SocketFlags flags,
-                                  EndPoint remote_end)
-               {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
-
-                       if (buffer == null)
-                               throw new ArgumentNullException ("buffer");
-
-                       if (remote_end == null)
-                               throw new ArgumentNullException("remote_end");
+               [MethodImplAttribute (MethodImplOptions.InternalCall)]
+               extern static void Shutdown_internal (IntPtr socket, SocketShutdown how, out int error);
 
-                       CheckRange (buffer, offset, size);
+#endregion
 
-                       return SendTo_nochecks (buffer, offset, size, flags, remote_end);
-               }
+#region Dispose
 
-               internal int SendTo_nochecks (byte [] buffer, int offset, int size, SocketFlags flags,
-                                             EndPoint remote_end)
+               protected virtual void Dispose (bool disposing)
                {
-                       SocketAddress sockaddr = remote_end.Serialize ();
+                       if (is_disposed)
+                               return;
 
-                       int ret, error;
+                       is_disposed = true;
+                       bool was_connected = is_connected;
+                       is_connected = false;
 
-                       ret = SendTo_internal (socket, buffer, offset, size, flags, sockaddr, out error);
+                       if (safe_handle != null) {
+                               is_closed = true;
+                               IntPtr x = Handle;
 
-                       SocketError err = (SocketError) error;
-                       if (err != 0) {
-                               if (err != SocketError.WouldBlock && err != SocketError.InProgress)
-                                       connected = false;
+                               if (was_connected)
+                                       Linger (x);
 
-                               throw new SocketException (error);
+                               safe_handle.Dispose ();
                        }
+               }
 
-                       connected = true;
-                       isbound = true;
-                       seed_endpoint = remote_end;
-                       
-                       return ret;
+               public void Dispose ()
+               {
+                       Dispose (true);
+                       GC.SuppressFinalize (this);
                }
 
-               public void SetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, byte [] optionValue)
+               void Linger (IntPtr handle)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
+                       if (!is_connected || linger_timeout <= 0)
+                               return;
 
-                       // I'd throw an ArgumentNullException, but this is what MS does.
-                       if (optionValue == null)
-                               throw new SocketException ((int) SocketError.Fault,
-                                       "Error trying to dereference an invalid pointer");
-                       
+                       /* We don't want to receive any more data */
                        int error;
+                       Shutdown_internal (handle, SocketShutdown.Receive, out error);
 
-                       SetSocketOption_internal (socket, optionLevel, optionName, null,
-                                                optionValue, 0, out error);
+                       if (error != 0)
+                               return;
 
-                       if (error != 0) {
-                               if (error == (int) SocketError.InvalidArgument)
-                                       throw new ArgumentException ();
-                               throw new SocketException (error);
+                       int seconds = linger_timeout / 1000;
+                       int ms = linger_timeout % 1000;
+                       if (ms > 0) {
+                               /* If the other end closes, this will return 'true' with 'Available' == 0 */
+                               Poll_internal (handle, SelectMode.SelectRead, ms * 1000, out error);
+                               if (error != 0)
+                                       return;
+                       }
+
+                       if (seconds > 0) {
+                               LingerOption linger = new LingerOption (true, seconds);
+                               SetSocketOption_internal (handle, SocketOptionLevel.Socket, SocketOptionName.Linger, linger, null, 0, out error);
+                               /* Not needed, we're closing upon return */
+                               //if (error != 0)
+                               //      return;
                        }
                }
 
-               public void SetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, object optionValue)
+#endregion
+
+               void ThrowIfDisposedAndClosed (Socket socket)
+               {
+                       if (socket.is_disposed && socket.is_closed)
+                               throw new ObjectDisposedException (socket.GetType ().ToString ());
+               }
+
+               void ThrowIfDisposedAndClosed ()
                {
-                       if (disposed && closed)
+                       if (is_disposed && is_closed)
                                throw new ObjectDisposedException (GetType ().ToString ());
+               }
 
-                       // NOTE: if a null is passed, the byte[] overload is used instead...
-                       if (optionValue == null)
-                               throw new ArgumentNullException("optionValue");
-                       
-                       int error;
+               void ThrowIfBufferNull (byte[] buffer)
+               {
+                       if (buffer == null)
+                               throw new ArgumentNullException ("buffer");
+               }
 
-                       if (optionLevel == SocketOptionLevel.Socket && optionName == SocketOptionName.Linger) {
-                               LingerOption linger = optionValue as LingerOption;
-                               if (linger == null)
-                                       throw new ArgumentException ("A 'LingerOption' value must be specified.", "optionValue");
-                               SetSocketOption_internal (socket, optionLevel, optionName, linger, null, 0, out error);
-                       } else if (optionLevel == SocketOptionLevel.IP && (optionName == SocketOptionName.AddMembership || optionName == SocketOptionName.DropMembership)) {
-                               MulticastOption multicast = optionValue as MulticastOption;
-                               if (multicast == null)
-                                       throw new ArgumentException ("A 'MulticastOption' value must be specified.", "optionValue");
-                               SetSocketOption_internal (socket, optionLevel, optionName, multicast, null, 0, out error);
-                       } else if (optionLevel == SocketOptionLevel.IPv6 && (optionName == SocketOptionName.AddMembership || optionName == SocketOptionName.DropMembership)) {
-                               IPv6MulticastOption multicast = optionValue as IPv6MulticastOption;
-                               if (multicast == null)
-                                       throw new ArgumentException ("A 'IPv6MulticastOption' value must be specified.", "optionValue");
-                               SetSocketOption_internal (socket, optionLevel, optionName, multicast, null, 0, out error);
-                       } else {
-                               throw new ArgumentException ("Invalid value specified.", "optionValue");
-                       }
+               void ThrowIfBufferOutOfRange (byte[] buffer, int offset, int size)
+               {
+                       if (offset < 0)
+                               throw new ArgumentOutOfRangeException ("offset", "offset must be >= 0");
+                       if (offset > buffer.Length)
+                               throw new ArgumentOutOfRangeException ("offset", "offset must be <= buffer.Length");
+                       if (size < 0)
+                               throw new ArgumentOutOfRangeException ("size", "size must be >= 0");
+                       if (size > buffer.Length - offset)
+                               throw new ArgumentOutOfRangeException ("size", "size must be <= buffer.Length - offset");
+               }
 
-                       if (error != 0) {
-                               if (error == (int) SocketError.InvalidArgument)
-                                       throw new ArgumentException ();
-                               throw new SocketException (error);
-                       }
+               void ThrowIfUdp ()
+               {
+#if !NET_2_1 || MOBILE
+                       if (protocol_type == ProtocolType.Udp)
+                               throw new SocketException ((int)SocketError.ProtocolOption);
+#endif
                }
 
-               public void SetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, bool optionValue)
+               SocketAsyncResult ValidateEndIAsyncResult (IAsyncResult ares, string methodName, string argName)
                {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
+                       if (ares == null)
+                               throw new ArgumentNullException (argName);
 
-                       int error;
-                       int int_val = (optionValue) ? 1 : 0;
-                       SetSocketOption_internal (socket, optionLevel, optionName, null, null, int_val, out error);
-                       if (error != 0) {
-                               if (error == (int) SocketError.InvalidArgument)
-                                       throw new ArgumentException ();
-                               throw new SocketException (error);
+                       SocketAsyncResult sockares = ares as SocketAsyncResult;
+                       if (sockares == null)
+                               throw new ArgumentException ("Invalid IAsyncResult", argName);
+                       if (Interlocked.CompareExchange (ref sockares.EndCalled, 1, 0) == 1)
+                               throw new InvalidOperationException (methodName + " can only be called once per asynchronous operation");
+
+                       return sockares;
+               }
+
+               void QueueSocketAsyncResult (Queue<SocketAsyncWorker> queue, SocketAsyncWorker worker, SocketAsyncResult sockares)
+               {
+                       int count;
+                       lock (queue) {
+                               queue.Enqueue (worker);
+                               count = queue.Count;
                        }
+
+                       if (count == 1)
+                               socket_pool_queue (SocketAsyncWorker.Dispatcher, sockares);
+               }
+
+               [StructLayout (LayoutKind.Sequential)]
+               struct WSABUF {
+                       public int len;
+                       public IntPtr buf;
                }
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               internal static extern void cancel_blocking_socket_operation (Thread thread);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               internal static extern void socket_pool_queue (SocketAsyncCallback d, SocketAsyncResult r);
        }
 }
 
diff --git a/mcs/class/System/System.Net.Sockets/SocketAsyncCallback.cs b/mcs/class/System/System.Net.Sockets/SocketAsyncCallback.cs
new file mode 100644 (file)
index 0000000..0ea4479
--- /dev/null
@@ -0,0 +1,32 @@
+// System.Net.Sockets.SocketAsyncCallback.cs
+//
+// Authors:
+//     Ludovic Henry <ludovic@xamarin.com>
+//
+// Copyright (C) 2015 Xamarin, Inc. (https://www.xamarin.com)
+//
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace System.Net.Sockets
+{
+       internal delegate void SocketAsyncCallback (SocketAsyncResult sar);
+}
index b7b38c150c1bcb2222080b01cf0f5735b29ccbbd..8a3f703f295a8ccf0862f1ed4f8b900b5636ed63 100644 (file)
@@ -40,7 +40,7 @@ namespace System.Net.Sockets
        {
                bool disposed;
                int in_progress;
-               internal Socket.Worker Worker;
+               internal SocketAsyncWorker Worker;
                EndPoint remote_ep;
                public Exception ConnectByNameError { get; internal set; }
 
@@ -101,7 +101,7 @@ namespace System.Net.Sockets
                
                public SocketAsyncEventArgs ()
                {
-                       Worker = new Socket.Worker (this);
+                       Worker = new SocketAsyncWorker (this);
                        AcceptSocket = null;
                        Buffer = null;
                        BufferList = null;
@@ -208,33 +208,42 @@ namespace System.Net.Sockets
                static void DispatcherCB (IAsyncResult ares)
                {
                        SocketAsyncEventArgs args = (SocketAsyncEventArgs) ares.AsyncState;
+
                        if (Interlocked.Exchange (ref args.in_progress, 0) != 1)
                                throw new InvalidOperationException ("No operation in progress");
-                       SocketAsyncOperation op = args.LastOperation;
-                       // Notes;
-                       //      -SocketOperation.AcceptReceive not used in SocketAsyncEventArgs
-                       //      -SendPackets and ReceiveMessageFrom are not implemented yet
-                       if (op == SocketAsyncOperation.Receive)
+
+                       /* Notes;
+                        *  -SocketOperation.AcceptReceive not used in SocketAsyncEventArgs
+                        *  -SendPackets and ReceiveMessageFrom are not implemented yet */
+                       switch (args.LastOperation) {
+                       case SocketAsyncOperation.Receive:
                                args.ReceiveCallback (ares);
-                       else if (op == SocketAsyncOperation.Send)
+                               break;
+                       case SocketAsyncOperation.Send:
                                args.SendCallback (ares);
-                       else if (op == SocketAsyncOperation.ReceiveFrom)
+                               break;
+                       case SocketAsyncOperation.ReceiveFrom:
                                args.ReceiveFromCallback (ares);
-                       else if (op == SocketAsyncOperation.SendTo)
+                               break;
+                       case SocketAsyncOperation.SendTo:
                                args.SendToCallback (ares);
-                       else if (op == SocketAsyncOperation.Accept)
+                               break;
+                       case SocketAsyncOperation.Accept:
                                args.AcceptCallback (ares);
-                       else if (op == SocketAsyncOperation.Disconnect)
+                               break;
+                       case SocketAsyncOperation.Disconnect:
                                args.DisconnectCallback (ares);
-                       else if (op == SocketAsyncOperation.Connect)
+                               break;
+                       case SocketAsyncOperation.Connect:
                                args.ConnectCallback (ares);
+                               break;
                        /*
-                       else if (op == Socket.SocketOperation.ReceiveMessageFrom)
-                       else if (op == Socket.SocketOperation.SendPackets)
+                       case SocketOperation.ReceiveMessageFrom:
+                       case SocketOperation.SendPackets:
                        */
-                       else
-                               throw new NotImplementedException (String.Format ("Operation {0} is not implemented", op));
-
+                       default:
+                               throw new NotImplementedException (String.Format ("Operation {0} is not implemented", args.LastOperation));
+                       }
                }
 
                internal void ReceiveCallback (IAsyncResult ares)
diff --git a/mcs/class/System/System.Net.Sockets/SocketAsyncResult.cs b/mcs/class/System/System.Net.Sockets/SocketAsyncResult.cs
new file mode 100644 (file)
index 0000000..5f361f4
--- /dev/null
@@ -0,0 +1,305 @@
+// System.Net.Sockets.SocketAsyncResult.cs
+//
+// Authors:
+//     Ludovic Henry <ludovic@xamarin.com>
+//
+// Copyright (C) 2015 Xamarin, Inc. (https://www.xamarin.com)
+//
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System.Collections;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using System.Runtime.Remoting.Messaging;
+using System.Threading;
+
+namespace System.Net.Sockets
+{
+       [StructLayout (LayoutKind.Sequential)]
+       internal sealed class SocketAsyncResult: IAsyncResult
+       {
+               /* Same structure in the runtime. Keep this in sync with
+                * MonoSocketAsyncResult in metadata/socket-io.h and
+                * ProcessAsyncReader in System.Diagnostics/Process.cs. */
+
+               public Socket socket;
+               IntPtr handle;
+               object state;
+               AsyncCallback callback; // used from the runtime
+               WaitHandle wait_handle;
+
+               Exception delayed_exception;
+
+               public EndPoint EndPoint;                 // Connect,ReceiveFrom,SendTo
+               public byte [] Buffer;                    // Receive,ReceiveFrom,Send,SendTo
+               public int Offset;                        // Receive,ReceiveFrom,Send,SendTo
+               public int Size;                          // Receive,ReceiveFrom,Send,SendTo
+               public SocketFlags SockFlags;             // Receive,ReceiveFrom,Send,SendTo
+               public Socket AcceptSocket;               // AcceptReceive
+               public IPAddress[] Addresses;             // Connect
+               public int Port;                          // Connect
+               public IList<ArraySegment<byte>> Buffers; // Receive, Send
+               public bool ReuseSocket;                  // Disconnect
+
+               // Return values
+               Socket accept_socket;
+               int total;
+
+               bool completed_synchronously;
+               bool completed;
+               bool is_blocking;
+               internal int error;
+               public SocketOperation operation;
+               AsyncResult async_result;
+               public int EndCalled;
+
+               /* These fields are not in MonoSocketAsyncResult */
+               public SocketAsyncWorker Worker;
+               public int CurrentAddress;                // Connect
+
+               public SocketAsyncResult ()
+               {
+               }
+
+               public SocketAsyncResult (Socket socket, object state, AsyncCallback callback, SocketOperation operation)
+               {
+                       Init (socket, state, callback, operation, new SocketAsyncWorker (this));
+               }
+
+               public object AsyncState {
+                       get {
+                               return state;
+                       }
+               }
+
+               public WaitHandle AsyncWaitHandle {
+                       get {
+                               lock (this) {
+                                       if (wait_handle == null)
+                                               wait_handle = new ManualResetEvent (completed);
+                               }
+
+                               return wait_handle;
+                       }
+                       set {
+                               wait_handle = value;
+                       }
+               }
+
+               public bool CompletedSynchronously {
+                       get {
+                               return completed_synchronously;
+                       }
+               }
+
+               public bool IsCompleted {
+                       get {
+                               return completed;
+                       }
+                       set {
+                               completed = value;
+                               lock (this) {
+                                       if (wait_handle != null && value)
+                                               ((ManualResetEvent) wait_handle).Set ();
+                               }
+                       }
+               }
+
+               public Socket Socket {
+                       get {
+                               return accept_socket;
+                       }
+               }
+
+               public int Total {
+                       get { return total; }
+                       set { total = value; }
+               }
+
+               public SocketError ErrorCode {
+                       get {
+                               SocketException ex = delayed_exception as SocketException;
+                               if (ex != null)
+                                       return ex.SocketErrorCode;
+
+                               if (error != 0)
+                                       return (SocketError) error;
+
+                               return SocketError.Success;
+                       }
+               }
+
+               public void Init (Socket socket, object state, AsyncCallback callback, SocketOperation operation, SocketAsyncWorker worker)
+               {
+                       this.socket = socket;
+                       this.is_blocking = socket != null ? socket.is_blocking : true;
+                       this.handle = socket != null ? socket.Handle : IntPtr.Zero;
+                       this.state = state;
+                       this.callback = callback;
+                       this.operation = operation;
+
+                       if (wait_handle != null)
+                               ((ManualResetEvent) wait_handle).Reset ();
+
+                       delayed_exception = null;
+
+                       EndPoint = null;
+                       Buffer = null;
+                       Offset = 0;
+                       Size = 0;
+                       SockFlags = SocketFlags.None;
+                       AcceptSocket = null;
+                       Addresses = null;
+                       Port = 0;
+                       Buffers = null;
+                       ReuseSocket = false;
+                       accept_socket = null;
+                       total = 0;
+
+                       completed_synchronously = false;
+                       completed = false;
+                       is_blocking = false;
+                       error = 0;
+                       async_result = null;
+                       EndCalled = 0;
+                       Worker = worker;
+               }
+
+               public void DoMConnectCallback ()
+               {
+                       if (callback == null)
+                               return;
+                       ThreadPool.UnsafeQueueUserWorkItem (_ => callback (this), null);
+               }
+
+               public void Dispose ()
+               {
+                       Init (null, null, null, 0, Worker);
+                       if (wait_handle != null) {
+                               wait_handle.Close ();
+                               wait_handle = null;
+                       }
+               }
+
+               public void CheckIfThrowDelayedException ()
+               {
+                       if (delayed_exception != null) {
+                               socket.is_connected = false;
+                               throw delayed_exception;
+                       }
+
+                       if (error != 0) {
+                               socket.is_connected = false;
+                               throw new SocketException (error);
+                       }
+               }
+
+               void CompleteDisposed (object unused)
+               {
+                       Complete ();
+               }
+
+               public void Complete ()
+               {
+                       if (operation != SocketOperation.Receive && socket.is_disposed)
+                               delayed_exception = new ObjectDisposedException (socket.GetType ().ToString ());
+
+                       IsCompleted = true;
+
+                       Queue<SocketAsyncWorker> queue = null;
+                       switch (operation) {
+                       case SocketOperation.Receive:
+                       case SocketOperation.ReceiveFrom:
+                       case SocketOperation.ReceiveGeneric:
+                       case SocketOperation.Accept:
+                               queue = socket.readQ;
+                               break;
+                       case SocketOperation.Send:
+                       case SocketOperation.SendTo:
+                       case SocketOperation.SendGeneric:
+                               queue = socket.writeQ;
+                               break;
+                       }
+
+                       if (queue != null) {
+                               lock (queue) {
+                                       /* queue.Count will only be 0 if the socket is closed while receive/send/accept
+                                        * operation(s) are pending and at least one call to this method is waiting
+                                        * on the lock while another one calls CompleteAllOnDispose() */
+                                       if (queue.Count > 0)
+                                               queue.Dequeue (); /* remove ourselves */
+                                       if (queue.Count > 0) {
+                                               if (!socket.is_disposed) {
+                                                       Socket.socket_pool_queue (SocketAsyncWorker.Dispatcher, (queue.Peek ()).result);
+                                               } else {
+                                                       /* CompleteAllOnDispose */
+                                                       SocketAsyncWorker [] workers = queue.ToArray ();
+                                                       for (int i = 0; i < workers.Length; i++)
+                                                               ThreadPool.UnsafeQueueUserWorkItem (workers [i].result.CompleteDisposed, null);
+                                                       queue.Clear ();
+                                               }
+                                       }
+                               }
+                       }
+
+                       // IMPORTANT: 'callback', if any is scheduled from unmanaged code
+               }
+
+               public void Complete (bool synch)
+               {
+                       this.completed_synchronously = synch;
+                       Complete ();
+               }
+
+               public void Complete (int total)
+               {
+                       this.total = total;
+                       Complete ();
+               }
+
+               public void Complete (Exception e, bool synch)
+               {
+                       this.completed_synchronously = synch;
+                       this.delayed_exception = e;
+                       Complete ();
+               }
+
+               public void Complete (Exception e)
+               {
+                       this.delayed_exception = e;
+                       Complete ();
+               }
+
+               public void Complete (Socket s)
+               {
+                       this.accept_socket = s;
+                       Complete ();
+               }
+
+               public void Complete (Socket s, int total)
+               {
+                       this.accept_socket = s;
+                       this.total = total;
+                       Complete ();
+               }
+       }
+}
diff --git a/mcs/class/System/System.Net.Sockets/SocketAsyncWorker.cs b/mcs/class/System/System.Net.Sockets/SocketAsyncWorker.cs
new file mode 100644 (file)
index 0000000..a4e3a75
--- /dev/null
@@ -0,0 +1,381 @@
+// System.Net.Sockets.SocketAsyncWorker.cs
+//
+// Authors:
+//     Ludovic Henry <ludovic@xamarin.com>
+//
+// Copyright (C) 2015 Xamarin, Inc. (https://www.xamarin.com)
+//
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace System.Net.Sockets
+{
+       internal sealed class SocketAsyncWorker
+       {
+               public SocketAsyncResult result;
+               SocketAsyncEventArgs args;
+
+               public SocketAsyncWorker (SocketAsyncEventArgs args)
+               {
+                       this.args = args;
+                       result = new SocketAsyncResult ();
+                       result.Worker = this;
+               }
+
+               public SocketAsyncWorker (SocketAsyncResult ares)
+               {
+                       this.result = ares;
+               }
+
+               public void Dispose ()
+               {
+                       if (result != null) {
+                               result.Dispose ();
+                               result = null;
+                               args = null;
+                       }
+               }
+
+               public static SocketAsyncCallback Dispatcher = new SocketAsyncCallback (DispatcherCB);
+
+               static void DispatcherCB (SocketAsyncResult sar)
+               {
+                       /* SendPackets and ReceiveMessageFrom are not implemented yet */
+                       switch (sar.operation) {
+                       case SocketOperation.Receive:
+                       case SocketOperation.ReceiveGeneric:
+                       case SocketOperation.RecvJustCallback:
+                               sar.Worker.Receive ();
+                               break;
+                       case SocketOperation.Send:
+                       case SocketOperation.SendGeneric:
+                       case SocketOperation.SendJustCallback:
+                               sar.Worker.Send ();
+                               break;
+                       case SocketOperation.ReceiveFrom:
+                               sar.Worker.ReceiveFrom ();
+                               break;
+                       case SocketOperation.SendTo:
+                               sar.Worker.SendTo ();
+                               break;
+                       case SocketOperation.Connect:
+                               sar.Worker.Connect ();
+                               break;
+                       case SocketOperation.Accept:
+                               sar.Worker.Accept ();
+                               break;
+                       case SocketOperation.AcceptReceive:
+                               sar.Worker.AcceptReceive ();
+                               break;
+                       case SocketOperation.Disconnect:
+                               sar.Worker.Disconnect ();
+                               break;
+                       // case SocketOperation.ReceiveMessageFrom
+                       //      sar.Worker.ReceiveMessageFrom ()
+                       //      break;
+                       // case SocketOperation.SendPackets:
+                       //      sar.Worker.SendPackets ();
+                       //      break;
+                       default:
+                               throw new NotImplementedException (String.Format ("Operation {0} is not implemented", sar.operation));
+                       }
+               }
+
+               /* This is called when reusing a SocketAsyncEventArgs */
+               public void Init (Socket sock, SocketAsyncEventArgs args, SocketOperation op)
+               {
+                       result.Init (sock, args, SocketAsyncEventArgs.Dispatcher, op, this);
+
+                       SocketAsyncOperation async_op;
+
+                       // Notes;
+                       //      -SocketOperation.AcceptReceive not used in SocketAsyncEventArgs
+                       //      -SendPackets and ReceiveMessageFrom are not implemented yet
+                       switch (op) {
+                       case SocketOperation.Connect:
+                               async_op = SocketAsyncOperation.Connect;
+                               break;
+                       case SocketOperation.Accept:
+                               async_op = SocketAsyncOperation.Accept;
+                               break;
+                       case SocketOperation.Disconnect:
+                               async_op = SocketAsyncOperation.Disconnect;
+                               break;
+                       case SocketOperation.Receive:
+                       case SocketOperation.ReceiveGeneric:
+                               async_op = SocketAsyncOperation.Receive;
+                               break;
+                       case SocketOperation.ReceiveFrom:
+                               async_op = SocketAsyncOperation.ReceiveFrom;
+                               break;
+                       // case SocketOperation.ReceiveMessageFrom:
+                       //      async_op = SocketAsyncOperation.ReceiveMessageFrom;
+                       //      break;
+                       case SocketOperation.Send:
+                       case SocketOperation.SendGeneric:
+                               async_op = SocketAsyncOperation.Send;
+                               break;
+                       // case SocketOperation.SendPackets:
+                       //      async_op = SocketAsyncOperation.SendPackets;
+                       //      break;
+                       case SocketOperation.SendTo:
+                               async_op = SocketAsyncOperation.SendTo;
+                               break;
+                       default:
+                               throw new NotImplementedException (String.Format ("Operation {0} is not implemented", op));
+                       }
+
+                       args.SetLastOperation (async_op);
+                       args.SocketError = SocketError.Success;
+                       args.BytesTransferred = 0;
+               }
+
+               public void Accept ()
+               {
+                       Socket acc_socket = null;
+                       try {
+                               if (args != null && args.AcceptSocket != null) {
+                                       result.socket.Accept (args.AcceptSocket);
+                                       acc_socket = args.AcceptSocket;
+                               } else {
+                                       acc_socket = result.socket.Accept ();
+                                       if (args != null)
+                                               args.AcceptSocket = acc_socket;
+                               }
+                       } catch (Exception e) {
+                               result.Complete (e);
+                               return;
+                       }
+
+                       result.Complete (acc_socket);
+               }
+
+               /* only used in 2.0 profile and newer, but
+                * leave in older profiles to keep interface
+                * to runtime consistent
+                */
+               public void AcceptReceive ()
+               {
+                       Socket acc_socket = null;
+                       try {
+                               if (result.AcceptSocket == null) {
+                                       acc_socket = result.socket.Accept ();
+                               } else {
+                                       acc_socket = result.AcceptSocket;
+                                       result.socket.Accept (acc_socket);
+                               }
+                       } catch (Exception e) {
+                               result.Complete (e);
+                               return;
+                       }
+
+                       /* It seems the MS runtime
+                        * special-cases 0-length requested
+                        * receive data.  See bug 464201.
+                        */
+                       int total = 0;
+                       if (result.Size > 0) {
+                               try {
+                                       SocketError error;
+                                       total = acc_socket.Receive_nochecks (result.Buffer, result.Offset, result.Size, result.SockFlags, out error);
+                                       if (error != 0) {
+                                               result.Complete (new SocketException ((int) error));
+                                               return;
+                                       }
+                               } catch (Exception e) {
+                                       result.Complete (e);
+                                       return;
+                               }
+                       }
+
+                       result.Complete (acc_socket, total);
+               }
+
+               public void Connect ()
+               {
+                       if (result.EndPoint == null) {
+                               result.Complete (new SocketException ((int)SocketError.AddressNotAvailable));
+                               return;
+                       }
+
+                       SocketAsyncResult mconnect = result.AsyncState as SocketAsyncResult;
+                       bool is_mconnect = (mconnect != null && mconnect.Addresses != null);
+                       try {
+                               int error_code;
+                               EndPoint ep = result.EndPoint;
+                               error_code = (int) result.socket.GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Error);
+                               if (error_code == 0) {
+                                       if (is_mconnect)
+                                               result = mconnect;
+                                       result.socket.seed_endpoint = ep;
+                                       result.socket.is_connected = true;
+                                       result.socket.is_bound = true;
+                                       result.socket.connect_in_progress = false;
+                                       result.error = 0;
+                                       result.Complete ();
+                                       if (is_mconnect)
+                                               result.DoMConnectCallback ();
+                                       return;
+                               }
+
+                               if (!is_mconnect) {
+                                       result.socket.connect_in_progress = false;
+                                       result.Complete (new SocketException (error_code));
+                                       return;
+                               }
+
+                               if (mconnect.CurrentAddress >= mconnect.Addresses.Length) {
+                                       mconnect.Complete (new SocketException (error_code));
+                                       if (is_mconnect)
+                                               mconnect.DoMConnectCallback ();
+                                       return;
+                               }
+                               mconnect.socket.BeginMConnect (mconnect);
+                       } catch (Exception e) {
+                               result.socket.connect_in_progress = false;
+                               if (is_mconnect)
+                                       result = mconnect;
+                               result.Complete (e);
+                               if (is_mconnect)
+                                       result.DoMConnectCallback ();
+                               return;
+                       }
+               }
+
+               /* Also only used in 2.0 profile and newer */
+               public void Disconnect ()
+               {
+                       try {
+                               if (args != null)
+                                       result.ReuseSocket = args.DisconnectReuseSocket;
+                               result.socket.Disconnect (result.ReuseSocket);
+                       } catch (Exception e) {
+                               result.Complete (e);
+                               return;
+                       }
+                       result.Complete ();
+               }
+
+               public void Receive ()
+               {
+                       if (result.operation == SocketOperation.ReceiveGeneric) {
+                               ReceiveGeneric ();
+                               return;
+                       }
+                       // Actual recv() done in the runtime
+                       result.Complete ();
+               }
+
+               public void ReceiveFrom ()
+               {
+                       int total = 0;
+                       try {
+                               total = result.socket.ReceiveFrom_nochecks (result.Buffer, result.Offset, result.Size, result.SockFlags, ref result.EndPoint);
+                       } catch (Exception e) {
+                               result.Complete (e);
+                               return;
+                       }
+
+                       result.Complete (total);
+               }
+
+               public void ReceiveGeneric ()
+               {
+                       int total = 0;
+                       try {
+                               total = result.socket.Receive (result.Buffers, result.SockFlags);
+                       } catch (Exception e) {
+                               result.Complete (e);
+                               return;
+                       }
+                       result.Complete (total);
+               }
+
+               int send_so_far;
+
+               void UpdateSendValues (int last_sent)
+               {
+                       if (result.error == 0) {
+                               send_so_far += last_sent;
+                               result.Offset += last_sent;
+                               result.Size -= last_sent;
+                       }
+               }
+
+               public void Send ()
+               {
+                       if (result.operation == SocketOperation.SendGeneric) {
+                               SendGeneric ();
+                               return;
+                       }
+                       // Actual send() done in the runtime
+                       if (result.error == 0) {
+                               UpdateSendValues (result.Total);
+                               if (result.socket.is_disposed) {
+                                       result.Complete ();
+                                       return;
+                               }
+
+                               if (result.Size > 0) {
+                                       Socket.socket_pool_queue (SocketAsyncWorker.Dispatcher, result);
+                                       return; // Have to finish writing everything. See bug #74475.
+                               }
+                               result.Total = send_so_far;
+                               send_so_far = 0;
+                       }
+                       result.Complete ();
+               }
+
+               public void SendTo ()
+               {
+                       int total = 0;
+                       try {
+                               total = result.socket.SendTo_nochecks (result.Buffer, result.Offset, result.Size, result.SockFlags, result.EndPoint);
+
+                               UpdateSendValues (total);
+                               if (result.Size > 0) {
+                                       Socket.socket_pool_queue (SocketAsyncWorker.Dispatcher, result);
+                                       return; // Have to finish writing everything. See bug #74475.
+                               }
+                               result.Total = send_so_far;
+                               send_so_far = 0;
+                       } catch (Exception e) {
+                               send_so_far = 0;
+                               result.Complete (e);
+                               return;
+                       }
+
+                       result.Complete ();
+               }
+
+               public void SendGeneric ()
+               {
+                       int total = 0;
+                       try {
+                               total = result.socket.Send (result.Buffers, result.SockFlags);
+                       } catch (Exception e) {
+                               result.Complete (e);
+                               return;
+                       }
+                       result.Complete (total);
+               }
+       }
+}
diff --git a/mcs/class/System/System.Net.Sockets/SocketOperation.cs b/mcs/class/System/System.Net.Sockets/SocketOperation.cs
new file mode 100644 (file)
index 0000000..22ffd6e
--- /dev/null
@@ -0,0 +1,48 @@
+// System.Net.Sockets.SocketOperation.cs
+//
+// Authors:
+//     Ludovic Henry <ludovic@xamarin.com>
+//
+// Copyright (C) 2015 Xamarin, Inc. (https://www.xamarin.com)
+//
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace System.Net.Sockets
+{
+       // Used by the runtime
+       internal enum SocketOperation {
+               Accept,
+               Connect,
+               Receive,
+               ReceiveFrom,
+               Send,
+               SendTo,
+               RecvJustCallback,
+               SendJustCallback,
+               UsedInProcess,
+               UsedInConsole2,
+               Disconnect,
+               AcceptReceive,
+               ReceiveGeneric,
+               SendGeneric
+       }
+}
diff --git a/mcs/class/System/System.Net.Sockets/Socket_2_1.cs b/mcs/class/System/System.Net.Sockets/Socket_2_1.cs
deleted file mode 100644 (file)
index 17e9d2a..0000000
+++ /dev/null
@@ -1,2005 +0,0 @@
-// System.Net.Sockets.Socket.cs
-//
-// Authors:
-//     Phillip Pearson (pp@myelin.co.nz)
-//     Dick Porter <dick@ximian.com>
-//     Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//     Sridhar Kulkarni (sridharkulkarni@gmail.com)
-//     Brian Nickel (brian.nickel@gmail.com)
-//
-// Copyright (C) 2001, 2002 Phillip Pearson and Ximian, Inc.
-//    http://www.myelin.co.nz
-// (c) 2004-2011 Novell, Inc. (http://www.novell.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Net;
-using System.Collections;
-using System.Collections.Generic;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using System.Threading;
-using System.IO;
-using System.Security;
-using System.Text;
-
-#if !NET_2_1
-using System.Net.Configuration;
-using System.Net.NetworkInformation;
-#endif
-
-namespace System.Net.Sockets {
-
-       public partial class Socket : IDisposable {
-               [StructLayout (LayoutKind.Sequential)]
-               struct WSABUF {
-                       public int len;
-                       public IntPtr buf;
-               }
-
-               // Used by the runtime
-               internal enum SocketOperation {
-                       Accept,
-                       Connect,
-                       Receive,
-                       ReceiveFrom,
-                       Send,
-                       SendTo,
-                       RecvJustCallback,
-                       SendJustCallback,
-                       UsedInProcess,
-                       UsedInConsole2,
-                       Disconnect,
-                       AcceptReceive,
-                       ReceiveGeneric,
-                       SendGeneric
-               }
-
-               [StructLayout (LayoutKind.Sequential)]
-               internal sealed class SocketAsyncResult: IAsyncResult
-               {
-                       /* Same structure in the runtime */
-                       /*
-                         Keep this in sync with MonoSocketAsyncResult in
-                         metadata/socket-io.h and ProcessAsyncReader
-                         in System.Diagnostics/Process.cs.
-                       */
-
-                       public Socket Sock;
-                       public IntPtr handle;
-                       object state;
-                       AsyncCallback callback; // used from the runtime
-                       WaitHandle waithandle;
-
-                       Exception delayedException;
-
-                       public EndPoint EndPoint;       // Connect,ReceiveFrom,SendTo
-                       public byte [] Buffer;          // Receive,ReceiveFrom,Send,SendTo
-                       public int Offset;              // Receive,ReceiveFrom,Send,SendTo
-                       public int Size;                // Receive,ReceiveFrom,Send,SendTo
-                       public SocketFlags SockFlags;   // Receive,ReceiveFrom,Send,SendTo
-                       public Socket AcceptSocket;     // AcceptReceive
-                       public IPAddress[] Addresses;   // Connect
-                       public int Port;                // Connect
-                       public IList<ArraySegment<byte>> Buffers;       // Receive, Send
-                       public bool ReuseSocket;        // Disconnect
-
-                       // Return values
-                       Socket acc_socket;
-                       int total;
-
-                       bool completed_sync;
-                       bool completed;
-                       public bool blocking;
-                       internal int error;
-                       public SocketOperation operation;
-                       public object ares;
-                       public int EndCalled;
-
-                       // These fields are not in MonoSocketAsyncResult
-                       public Worker Worker;
-                       public int CurrentAddress; // Connect
-
-                       public SocketAsyncResult ()
-                       {
-                       }
-
-                       public void Init (Socket sock, object state, AsyncCallback callback, SocketOperation operation)
-                       {
-                               this.Sock = sock;
-                               if (sock != null) {
-                                       this.blocking = sock.blocking;
-                                       this.handle = sock.Handle;
-                               } else {
-                                       this.blocking = true;
-                                       this.handle = IntPtr.Zero;
-                               }
-                               this.state = state;
-                               this.callback = callback;
-                               GC.KeepAlive (this.callback);
-                               this.operation = operation;
-                               SockFlags = SocketFlags.None;
-                               if (waithandle != null)
-                                       ((ManualResetEvent) waithandle).Reset ();
-
-                               delayedException = null;
-
-                               EndPoint = null;
-                               Buffer = null;
-                               Offset = 0;
-                               Size = 0;
-                               SockFlags = 0;
-                               AcceptSocket = null;
-                               Addresses = null;
-                               Port = 0;
-                               Buffers = null;
-                               ReuseSocket = false;
-                               acc_socket = null;
-                               total = 0;
-
-                               completed_sync = false;
-                               completed = false;
-                               blocking = false;
-                               error = 0;
-                               ares = null;
-                               EndCalled = 0;
-                               Worker = null;
-                       }
-
-                       public void DoMConnectCallback ()
-                       {
-                               if (callback == null)
-                                       return;
-                               ThreadPool.UnsafeQueueUserWorkItem (_ => { callback (this); }, null);
-                       }
-
-                       public void Dispose ()
-                       {
-                               Init (null, null, null, 0);
-                               if (waithandle != null) {
-                                       waithandle.Close ();
-                                       waithandle = null;
-                               }
-                       }
-
-                       public SocketAsyncResult (Socket sock, object state, AsyncCallback callback, SocketOperation operation)
-                       {
-                               this.Sock = sock;
-                               this.blocking = sock.blocking;
-                               this.handle = sock.Handle;
-                               this.state = state;
-                               this.callback = callback;
-                               GC.KeepAlive (this.callback);
-                               this.operation = operation;
-                               SockFlags = SocketFlags.None;
-                               Worker = new Worker (this);
-                       }
-
-                       public void CheckIfThrowDelayedException ()
-                       {
-                               if (delayedException != null) {
-                                       Sock.connected = false;
-                                       throw delayedException;
-                               }
-
-                               if (error != 0) {
-                                       Sock.connected = false;
-                                       throw new SocketException (error);
-                               }
-                       }
-
-                       void CompleteAllOnDispose (Queue queue)
-                       {
-                               object [] pending = queue.ToArray ();
-                               queue.Clear ();
-
-                               WaitCallback cb;
-                               for (int i = 0; i < pending.Length; i++) {
-                                       Worker worker = (Worker) pending [i];
-                                       SocketAsyncResult ares = worker.result;
-                                       cb = new WaitCallback (ares.CompleteDisposed);
-                                       ThreadPool.UnsafeQueueUserWorkItem (cb, null);
-                               }
-                       }
-
-                       void CompleteDisposed (object unused)
-                       {
-                               Complete ();
-                       }
-
-                       public void Complete ()
-                       {
-                               if (operation != SocketOperation.Receive && Sock.disposed)
-                                       delayedException = new ObjectDisposedException (Sock.GetType ().ToString ());
-
-                               IsCompleted = true;
-
-                               Queue queue = null;
-                               if (operation == SocketOperation.Receive ||
-                                   operation == SocketOperation.ReceiveFrom ||
-                                   operation == SocketOperation.ReceiveGeneric ||
-                                   operation == SocketOperation.Accept) {
-                                       queue = Sock.readQ;
-                               } else if (operation == SocketOperation.Send ||
-                                          operation == SocketOperation.SendTo ||
-                                          operation == SocketOperation.SendGeneric) {
-
-                                       queue = Sock.writeQ;
-                               }
-
-                               if (queue != null) {
-                                       Worker worker = null;
-                                       SocketAsyncCall sac = null;
-                                       lock (queue) {
-                                               // queue.Count will only be 0 if the socket is closed while receive/send/accept
-                                               // operation(s) are pending and at least one call to this method is
-                                               // waiting on the lock while another one calls CompleteAllOnDispose()
-                                               if (queue.Count > 0)
-                                                       queue.Dequeue (); // remove ourselves
-                                               if (queue.Count > 0) {
-                                                       worker = (Worker) queue.Peek ();
-                                                       if (!Sock.disposed) {
-                                                               sac = Worker.Dispatcher;
-                                                       } else {
-                                                               CompleteAllOnDispose (queue);
-                                                       }
-                                               }
-                                       }
-
-                                       if (sac != null)
-                                               Socket.socket_pool_queue (sac, worker.result);
-                               }
-                               // IMPORTANT: 'callback', if any is scheduled from unmanaged code
-                       }
-
-                       public void Complete (bool synch)
-                       {
-                               completed_sync = synch;
-                               Complete ();
-                       }
-
-                       public void Complete (int total)
-                       {
-                               this.total = total;
-                               Complete ();
-                       }
-
-                       public void Complete (Exception e, bool synch)
-                       {
-                               completed_sync = synch;
-                               delayedException = e;
-                               Complete ();
-                       }
-
-                       public void Complete (Exception e)
-                       {
-                               delayedException = e;
-                               Complete ();
-                       }
-
-                       public void Complete (Socket s)
-                       {
-                               acc_socket = s;
-                               Complete ();
-                       }
-
-                       public void Complete (Socket s, int total)
-                       {
-                               acc_socket = s;
-                               this.total = total;
-                               Complete ();
-                       }
-
-                       public object AsyncState {
-                               get {
-                                       return state;
-                               }
-                       }
-
-                       public WaitHandle AsyncWaitHandle {
-                               get {
-                                       lock (this) {
-                                               if (waithandle == null)
-                                                       waithandle = new ManualResetEvent (completed);
-                                       }
-
-                                       return waithandle;
-                               }
-                               set {
-                                       waithandle=value;
-                               }
-                       }
-
-                       public bool CompletedSynchronously {
-                               get {
-                                       return(completed_sync);
-                               }
-                       }
-
-                       public bool IsCompleted {
-                               get {
-                                       return(completed);
-                               }
-                               set {
-                                       completed=value;
-                                       lock (this) {
-                                               if (waithandle != null && value) {
-                                                       ((ManualResetEvent) waithandle).Set ();
-                                               }
-                                       }
-                               }
-                       }
-
-                       public Socket Socket {
-                               get {
-                                       return acc_socket;
-                               }
-                       }
-
-                       public int Total {
-                               get { return total; }
-                               set { total = value; }
-                       }
-
-                       public SocketError ErrorCode {
-                               get {
-                                       SocketException ex = delayedException as SocketException;
-                                       if (ex != null)
-                                               return(ex.SocketErrorCode);
-
-                                       if (error != 0)
-                                               return((SocketError)error);
-
-                                       return(SocketError.Success);
-                               }
-                       }
-               }
-
-               internal sealed class Worker
-               {
-                       public SocketAsyncResult result;
-                       SocketAsyncEventArgs args;
-
-                       public Worker (SocketAsyncEventArgs args)
-                       {
-                               this.args = args;
-                               result = new SocketAsyncResult ();
-                               result.Worker = this;
-                       }
-
-                       public Worker (SocketAsyncResult ares)
-                       {
-                               this.result = ares;
-                       }
-
-                       public void Dispose ()
-                       {
-                               if (result != null) {
-                                       result.Dispose ();
-                                       result = null;
-                                       args = null;
-                               }
-                       }
-
-                       public static SocketAsyncCall Dispatcher = new SocketAsyncCall (DispatcherCB);
-
-                       static void DispatcherCB (SocketAsyncResult sar)
-                       {
-                               SocketOperation op = sar.operation;
-                               if (op == Socket.SocketOperation.Receive || op == Socket.SocketOperation.ReceiveGeneric ||
-                                       op == Socket.SocketOperation.RecvJustCallback)
-                                       sar.Worker.Receive ();
-                               else if (op == Socket.SocketOperation.Send || op == Socket.SocketOperation.SendGeneric ||
-                                       op == Socket.SocketOperation.SendJustCallback)
-                                       sar.Worker.Send ();
-                               else if (op == Socket.SocketOperation.ReceiveFrom)
-                                       sar.Worker.ReceiveFrom ();
-                               else if (op == Socket.SocketOperation.SendTo)
-                                       sar.Worker.SendTo ();
-                               else if (op == Socket.SocketOperation.Connect)
-                                       sar.Worker.Connect ();
-                               else if (op == Socket.SocketOperation.Accept)
-                                       sar.Worker.Accept ();
-                               else if (op == Socket.SocketOperation.AcceptReceive)
-                                       sar.Worker.AcceptReceive ();
-                               else if (op == Socket.SocketOperation.Disconnect)
-                                       sar.Worker.Disconnect ();
-
-                               // SendPackets and ReceiveMessageFrom are not implemented yet
-                               /*
-                               else if (op == Socket.SocketOperation.ReceiveMessageFrom)
-                                       async_op = SocketAsyncOperation.ReceiveMessageFrom;
-                               else if (op == Socket.SocketOperation.SendPackets)
-                                       async_op = SocketAsyncOperation.SendPackets;
-                               */
-                               else
-                                       throw new NotImplementedException (String.Format ("Operation {0} is not implemented", op));
-                       }
-
-                       /* This is called when reusing a SocketAsyncEventArgs */
-                       public void Init (Socket sock, SocketAsyncEventArgs args, SocketOperation op)
-                       {
-                               result.Init (sock, args, SocketAsyncEventArgs.Dispatcher, op);
-                               result.Worker = this;
-                               SocketAsyncOperation async_op;
-
-                               // Notes;
-                               //      -SocketOperation.AcceptReceive not used in SocketAsyncEventArgs
-                               //      -SendPackets and ReceiveMessageFrom are not implemented yet
-                               if (op == Socket.SocketOperation.Connect)
-                                       async_op = SocketAsyncOperation.Connect;
-                               else if (op == Socket.SocketOperation.Accept)
-                                       async_op = SocketAsyncOperation.Accept;
-                               else if (op == Socket.SocketOperation.Disconnect)
-                                       async_op = SocketAsyncOperation.Disconnect;
-                               else if (op == Socket.SocketOperation.Receive || op == Socket.SocketOperation.ReceiveGeneric)
-                                       async_op = SocketAsyncOperation.Receive;
-                               else if (op == Socket.SocketOperation.ReceiveFrom)
-                                       async_op = SocketAsyncOperation.ReceiveFrom;
-                               /*
-                               else if (op == Socket.SocketOperation.ReceiveMessageFrom)
-                                       async_op = SocketAsyncOperation.ReceiveMessageFrom;
-                               */
-                               else if (op == Socket.SocketOperation.Send || op == Socket.SocketOperation.SendGeneric)
-                                       async_op = SocketAsyncOperation.Send;
-                               /*
-                               else if (op == Socket.SocketOperation.SendPackets)
-                                       async_op = SocketAsyncOperation.SendPackets;
-                               */
-                               else if (op == Socket.SocketOperation.SendTo)
-                                       async_op = SocketAsyncOperation.SendTo;
-                               else
-                                       throw new NotImplementedException (String.Format ("Operation {0} is not implemented", op));
-
-                               args.SetLastOperation (async_op);
-                               args.SocketError = SocketError.Success;
-                               args.BytesTransferred = 0;
-                       }
-
-                       public void Accept ()
-                       {
-                               Socket acc_socket = null;
-                               try {
-                                       if (args != null && args.AcceptSocket != null) {
-                                               result.Sock.Accept (args.AcceptSocket);
-                                               acc_socket = args.AcceptSocket;
-                                       } else {
-                                               acc_socket = result.Sock.Accept ();
-                                               if (args != null)
-                                                       args.AcceptSocket = acc_socket;
-                                       }
-                               } catch (Exception e) {
-                                       result.Complete (e);
-                                       return;
-                               }
-
-                               result.Complete (acc_socket);
-                       }
-
-                       /* only used in 2.0 profile and newer, but
-                        * leave in older profiles to keep interface
-                        * to runtime consistent
-                        */
-                       public void AcceptReceive ()
-                       {
-                               Socket acc_socket = null;
-                               try {
-                                       if (result.AcceptSocket == null) {
-                                               acc_socket = result.Sock.Accept ();
-                                       } else {
-                                               acc_socket = result.AcceptSocket;
-                                               result.Sock.Accept (acc_socket);
-                                       }
-                               } catch (Exception e) {
-                                       result.Complete (e);
-                                       return;
-                               }
-
-                               /* It seems the MS runtime
-                                * special-cases 0-length requested
-                                * receive data.  See bug 464201.
-                                */
-                               int total = 0;
-                               if (result.Size > 0) {
-                                       try {
-                                               SocketError error;
-                                               total = acc_socket.Receive_nochecks (result.Buffer,
-                                                                                    result.Offset,
-                                                                                    result.Size,
-                                                                                    result.SockFlags,
-                                                                                    out error);
-                                               if (error != 0) {
-                                                       result.Complete (new SocketException ((int) error));
-                                                       return;
-                                               }
-                                       } catch (Exception e) {
-                                               result.Complete (e);
-                                               return;
-                                       }
-                               }
-
-                               result.Complete (acc_socket, total);
-                       }
-
-                       public void Connect ()
-                       {
-                               if (result.EndPoint == null) {
-                                       result.Complete (new SocketException ((int)SocketError.AddressNotAvailable));
-                                       return;
-                               }
-
-                               SocketAsyncResult mconnect = result.AsyncState as SocketAsyncResult;
-                               bool is_mconnect = (mconnect != null && mconnect.Addresses != null);
-                               try {
-                                       int error_code;
-                                       EndPoint ep = result.EndPoint;
-                                       error_code = (int) result.Sock.GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Error);
-                                       if (error_code == 0) {
-                                               if (is_mconnect)
-                                                       result = mconnect;
-                                               result.Sock.seed_endpoint = ep;
-                                               result.Sock.connected = true;
-                                               result.Sock.isbound = true;
-                                               result.Sock.connect_in_progress = false;
-                                               result.error = 0;
-                                               result.Complete ();
-                                               if (is_mconnect)
-                                                       result.DoMConnectCallback ();
-                                               return;
-                                       }
-
-                                       if (!is_mconnect) {
-                                               result.Sock.connect_in_progress = false;
-                                               result.Complete (new SocketException (error_code));
-                                               return;
-                                       }
-
-                                       if (mconnect.CurrentAddress >= mconnect.Addresses.Length) {
-                                               mconnect.Complete (new SocketException (error_code));
-                                               if (is_mconnect)
-                                                       mconnect.DoMConnectCallback ();
-                                               return;
-                                       }
-                                       mconnect.Sock.BeginMConnect (mconnect);
-                               } catch (Exception e) {
-                                       result.Sock.connect_in_progress = false;
-                                       if (is_mconnect)
-                                               result = mconnect;
-                                       result.Complete (e);
-                                       if (is_mconnect)
-                                               result.DoMConnectCallback ();
-                                       return;
-                               }
-                       }
-
-                       /* Also only used in 2.0 profile and newer */
-                       public void Disconnect ()
-                       {
-                               try {
-                                       if (args != null)
-                                               result.ReuseSocket = args.DisconnectReuseSocket;
-                                       result.Sock.Disconnect (result.ReuseSocket);
-                               } catch (Exception e) {
-                                       result.Complete (e);
-                                       return;
-                               }
-                               result.Complete ();
-                       }
-
-                       public void Receive ()
-                       {
-                               if (result.operation == SocketOperation.ReceiveGeneric) {
-                                       ReceiveGeneric ();
-                                       return;
-                               }
-                               // Actual recv() done in the runtime
-                               result.Complete ();
-                       }
-
-                       public void ReceiveFrom ()
-                       {
-                               int total = 0;
-                               try {
-                                       total = result.Sock.ReceiveFrom_nochecks (result.Buffer,
-                                                                        result.Offset,
-                                                                        result.Size,
-                                                                        result.SockFlags,
-                                                                        ref result.EndPoint);
-                               } catch (Exception e) {
-                                       result.Complete (e);
-                                       return;
-                               }
-
-                               result.Complete (total);
-                       }
-
-                       public void ReceiveGeneric ()
-                       {
-                               int total = 0;
-                               try {
-                                       total = result.Sock.Receive (result.Buffers, result.SockFlags);
-                               } catch (Exception e) {
-                                       result.Complete (e);
-                                       return;
-                               }
-                               result.Complete (total);
-                       }
-
-                       int send_so_far;
-
-                       void UpdateSendValues (int last_sent)
-                       {
-                               if (result.error == 0) {
-                                       send_so_far += last_sent;
-                                       result.Offset += last_sent;
-                                       result.Size -= last_sent;
-                               }
-                       }
-
-                       public void Send ()
-                       {
-                               if (result.operation == SocketOperation.SendGeneric) {
-                                       SendGeneric ();
-                                       return;
-                               }
-                               // Actual send() done in the runtime
-                               if (result.error == 0) {
-                                       UpdateSendValues (result.Total);
-                                       if (result.Sock.disposed) {
-                                               result.Complete ();
-                                               return;
-                                       }
-
-                                       if (result.Size > 0) {
-                                               Socket.socket_pool_queue (Worker.Dispatcher, result);
-                                               return; // Have to finish writing everything. See bug #74475.
-                                       }
-                                       result.Total = send_so_far;
-                                       send_so_far = 0;
-                               }
-                               result.Complete ();
-                       }
-
-                       public void SendTo ()
-                       {
-                               int total = 0;
-                               try {
-                                       total = result.Sock.SendTo_nochecks (result.Buffer,
-                                                                   result.Offset,
-                                                                   result.Size,
-                                                                   result.SockFlags,
-                                                                   result.EndPoint);
-
-                                       UpdateSendValues (total);
-                                       if (result.Size > 0) {
-                                               Socket.socket_pool_queue (Worker.Dispatcher, result);
-                                               return; // Have to finish writing everything. See bug #74475.
-                                       }
-                                       result.Total = send_so_far;
-                                       send_so_far = 0;
-                               } catch (Exception e) {
-                                       send_so_far = 0;
-                                       result.Complete (e);
-                                       return;
-                               }
-
-                               result.Complete ();
-                       }
-
-                       public void SendGeneric ()
-                       {
-                               int total = 0;
-                               try {
-                                       total = result.Sock.Send (result.Buffers, result.SockFlags);
-                               } catch (Exception e) {
-                                       result.Complete (e);
-                                       return;
-                               }
-                               result.Complete (total);
-                       }
-               }
-
-               private Queue readQ = new Queue (2);
-               private Queue writeQ = new Queue (2);
-
-               internal delegate void SocketAsyncCall (SocketAsyncResult sar);
-
-               /*
-                *      These two fields are looked up by name by the runtime, don't change
-                *  their name without also updating the runtime code.
-                */
-               private static int ipv4Supported = -1, ipv6Supported = -1;
-               int linger_timeout;
-
-               static Socket ()
-               {
-                       // initialize ipv4Supported and ipv6Supported
-                       CheckProtocolSupport ();
-               }
-
-               internal static void CheckProtocolSupport ()
-               {
-                       if(ipv4Supported == -1) {
-                               try {
-                                       Socket tmp = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-                                       tmp.Close();
-
-                                       ipv4Supported = 1;
-                               } catch {
-                                       ipv4Supported = 0;
-                               }
-                       }
-
-                       if (ipv6Supported == -1) {
-                               // We need to put a try/catch around ConfigurationManager methods as will always throw an exception 
-                               // when run in a mono embedded application.  This occurs as embedded applications do not have a setup
-                               // for application config.  The exception is not thrown when called from a normal .NET application. 
-                               //
-                               // We, then, need to guard calls to the ConfigurationManager.  If the config is not found or throws an
-                               // exception, will fall through to the existing Socket / API directly below in the code.
-                               //
-                               // Also note that catching ConfigurationErrorsException specifically would require library dependency
-                               // System.Configuration, and wanted to avoid that.
-#if !NET_2_1
-#if CONFIGURATION_DEP
-                               try {
-                                       SettingsSection config;
-                                       config = (SettingsSection) System.Configuration.ConfigurationManager.GetSection ("system.net/settings");
-                                       if (config != null)
-                                               ipv6Supported = config.Ipv6.Enabled ? -1 : 0;
-                               } catch {
-                                       ipv6Supported = -1;
-                               }
-#else
-                               try {
-                                       NetConfig config = System.Configuration.ConfigurationSettings.GetConfig("system.net/settings") as NetConfig;
-                                       if (config != null)
-                                               ipv6Supported = config.ipv6Enabled ? -1 : 0;
-                               } catch {
-                                       ipv6Supported = -1;
-                               }
-#endif
-#endif
-                               if (ipv6Supported != 0) {
-                                       try {
-                                               Socket tmp = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp);
-                                               tmp.Close();
-
-                                               ipv6Supported = 1;
-                                       } catch {
-                                               ipv6Supported = 0;
-                                       }
-                               }
-                       }
-               }
-
-               public static bool SupportsIPv4 {
-                       get {
-                               CheckProtocolSupport();
-                               return ipv4Supported == 1;
-                       }
-               }
-
-               [ObsoleteAttribute ("Use OSSupportsIPv6 instead")]
-               public static bool SupportsIPv6 {
-                       get {
-                               CheckProtocolSupport();
-                               return ipv6Supported == 1;
-                       }
-               }
-#if NET_2_1
-               public static bool OSSupportsIPv4 {
-                       get {
-                               CheckProtocolSupport();
-                               return ipv4Supported == 1;
-                       }
-               }
-#endif
-#if NET_2_1
-               public static bool OSSupportsIPv6 {
-                       get {
-                               CheckProtocolSupport();
-                               return ipv6Supported == 1;
-                       }
-               }
-#else
-               public static bool OSSupportsIPv6 {
-                       get {
-                               NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces ();
-                               
-                               foreach (NetworkInterface adapter in nics) {
-                                       if (adapter.Supports (NetworkInterfaceComponent.IPv6))
-                                               return true;
-                               }
-                               return false;
-                       }
-               }
-#endif
-
-               /* the field "socket" is looked up by name by the runtime */
-               private SafeSocketHandle socket;
-               private AddressFamily address_family;
-               private SocketType socket_type;
-               private ProtocolType protocol_type;
-               internal bool blocking=true;
-               private bool isbound;
-               /* When true, the socket was connected at the time of
-                * the last IO operation
-                */
-               private bool connected;
-               /* true if we called Close_internal */
-               private bool closed;
-               internal bool disposed;
-               bool connect_in_progress;
-
-               /*
-                * This EndPoint is used when creating new endpoints. Because
-                * there are many types of EndPoints possible,
-                * seed_endpoint.Create(addr) is used for creating new ones.
-                * As such, this value is set on Bind, SentTo, ReceiveFrom,
-                * Connect, etc.
-                */
-               internal EndPoint seed_endpoint = null;
-
-               // Creates a new system socket, returning the handle
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               private extern IntPtr Socket_internal(AddressFamily family,
-                                                     SocketType type,
-                                                     ProtocolType proto,
-                                                     out int error);
-               
-               public Socket(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType)
-               {
-#if NET_2_1 && !MOBILE
-                       switch (addressFamily) {
-                       case AddressFamily.InterNetwork:        // ok
-                       case AddressFamily.InterNetworkV6:      // ok
-                       case AddressFamily.Unknown:             // SocketException will be thrown later (with right error #)
-                               break;
-                       // case AddressFamily.Unspecified:
-                       default:
-                               throw new ArgumentException ("addressFamily");
-                       }
-
-                       switch (socketType) {
-                       case SocketType.Stream:                 // ok
-                       case SocketType.Unknown:                // SocketException will be thrown later (with right error #)
-                               break;
-                       default:
-                               throw new ArgumentException ("socketType");
-                       }
-
-                       switch (protocolType) {
-                       case ProtocolType.Tcp:                  // ok
-                       case ProtocolType.Unspecified:          // ok
-                       case ProtocolType.Unknown:              // SocketException will be thrown later (with right error #)
-                               break;
-                       default:
-                               throw new ArgumentException ("protocolType");
-                       }
-#endif
-                       address_family = addressFamily;
-                       socket_type = socketType;
-                       protocol_type = protocolType;
-                       
-                       int error;
-                       
-                       var handle = Socket_internal (addressFamily, socketType, protocolType, out error);
-                       socket = new SafeSocketHandle (handle, true);
-
-                       if (error != 0)
-                               throw new SocketException (error);
-#if !NET_2_1 || MOBILE
-                       SocketDefaults ();
-#endif
-               }
-
-               [MonoTODO ("Currently hardcoded to IPv4. Ideally, support v4/v6 dual-stack.")]
-               public Socket (SocketType socketType, ProtocolType protocolType)
-                       : this (AddressFamily.InterNetwork, socketType, protocolType)
-               {
-               }
-
-               ~Socket ()
-               {
-                       Dispose (false);
-               }
-
-
-               public AddressFamily AddressFamily {
-                       get { return address_family; }
-               }
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               internal extern static void Blocking_internal(IntPtr socket,
-                                                            bool block,
-                                                            out int error);
-
-               private static void Blocking_internal (SafeSocketHandle safeHandle,
-                                                            bool block,
-                                                            out int error)
-               {
-                       bool release = false;
-                       try {
-                               safeHandle.DangerousAddRef (ref release);
-                               Blocking_internal (safeHandle.DangerousGetHandle (), block, out error);
-                       } finally {
-                               if (release)
-                                       safeHandle.DangerousRelease ();
-                       }
-               }
-
-               public bool Blocking {
-                       get {
-                               return(blocking);
-                       }
-                       set {
-                               if (disposed && closed)
-                                       throw new ObjectDisposedException (GetType ().ToString ());
-
-                               int error;
-                               
-                               Blocking_internal (socket, value, out error);
-
-                               if (error != 0)
-                                       throw new SocketException (error);
-                               
-                               blocking=value;
-                       }
-               }
-
-               public bool Connected {
-                       get { return connected; }
-                       internal set { connected = value; }
-               }
-
-               public ProtocolType ProtocolType {
-                       get { return protocol_type; }
-               }
-
-               public bool NoDelay {
-                       get {
-                               if (disposed && closed)
-                                       throw new ObjectDisposedException (GetType ().ToString ());
-
-                               ThrowIfUpd ();
-
-                               return (int)(GetSocketOption (
-                                       SocketOptionLevel.Tcp,
-                                       SocketOptionName.NoDelay)) != 0;
-                       }
-
-                       set {
-                               if (disposed && closed)
-                                       throw new ObjectDisposedException (GetType ().ToString ());
-
-                               ThrowIfUpd ();
-
-                               SetSocketOption (
-                                       SocketOptionLevel.Tcp,
-                                       SocketOptionName.NoDelay, value ? 1 : 0);
-                       }
-               }
-
-               public int ReceiveBufferSize {
-                       get {
-                               if (disposed && closed) {
-                                       throw new ObjectDisposedException (GetType ().ToString ());
-                               }
-                               return((int)GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ReceiveBuffer));
-                       }
-                       set {
-                               if (disposed && closed) {
-                                       throw new ObjectDisposedException (GetType ().ToString ());
-                               }
-                               if (value < 0) {
-                                       throw new ArgumentOutOfRangeException ("value", "The value specified for a set operation is less than zero");
-                               }
-                               
-                               SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ReceiveBuffer, value);
-                       }
-               }
-
-               public int SendBufferSize {
-                       get {
-                               if (disposed && closed) {
-                                       throw new ObjectDisposedException (GetType ().ToString ());
-                               }
-                               return((int)GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.SendBuffer));
-                       }
-                       set {
-                               if (disposed && closed) {
-                                       throw new ObjectDisposedException (GetType ().ToString ());
-                               }
-                               if (value < 0) {
-                                       throw new ArgumentOutOfRangeException ("value", "The value specified for a set operation is less than zero");
-                               }
-                               
-                               SetSocketOption (SocketOptionLevel.Socket,
-                                                SocketOptionName.SendBuffer,
-                                                value);
-                       }
-               }
-
-               public short Ttl {
-                       get {
-                               if (disposed && closed) {
-                                       throw new ObjectDisposedException (GetType ().ToString ());
-                               }
-                               
-                               short ttl_val;
-                               
-                               if (address_family == AddressFamily.InterNetwork) {
-                                       ttl_val = (short)((int)GetSocketOption (SocketOptionLevel.IP, SocketOptionName.IpTimeToLive));
-                               } else if (address_family == AddressFamily.InterNetworkV6) {
-                                       ttl_val = (short)((int)GetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.HopLimit));
-                               } else {
-                                       throw new NotSupportedException ("This property is only valid for InterNetwork and InterNetworkV6 sockets");
-                               }
-                               
-                               return(ttl_val);
-                       }
-                       set {
-                               if (disposed && closed) {
-                                       throw new ObjectDisposedException (GetType ().ToString ());
-                               }
-                               if (value < 0) {
-                                       throw new ArgumentOutOfRangeException ("value", "The value specified for a set operation is less than zero");
-                               }
-                               
-                               if (address_family == AddressFamily.InterNetwork) {
-                                       SetSocketOption (SocketOptionLevel.IP, SocketOptionName.IpTimeToLive, value);
-                               } else if (address_family == AddressFamily.InterNetworkV6) {
-                                       SetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.HopLimit, value);
-                               } else {
-                                       throw new NotSupportedException ("This property is only valid for InterNetwork and InterNetworkV6 sockets");
-                               }
-                       }
-               }
-
-               // Returns the remote endpoint details in addr and port
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               private extern static SocketAddress RemoteEndPoint_internal(IntPtr socket, int family, out int error);
-
-               private static SocketAddress RemoteEndPoint_internal (SafeSocketHandle safeHandle, int family, out int error)
-               {
-                       bool release = false;
-                       try {
-                               safeHandle.DangerousAddRef (ref release);
-                               return RemoteEndPoint_internal (safeHandle.DangerousGetHandle (), family, out error);
-                       } finally {
-                               if (release)
-                                       safeHandle.DangerousRelease ();
-                       }
-               }
-
-               public EndPoint RemoteEndPoint {
-                       get {
-                               if (disposed && closed)
-                                       throw new ObjectDisposedException (GetType ().ToString ());
-                               
-                               /*
-                                * If the seed EndPoint is null, Connect, Bind,
-                                * etc has not yet been called. MS returns null
-                                * in this case.
-                                */
-                               if (!connected || seed_endpoint == null)
-                                       return null;
-                               SocketAddress sa;
-                               int error;
-                               
-                               sa=RemoteEndPoint_internal(socket, (int) address_family, out error);
-
-                               if (error != 0)
-                                       throw new SocketException (error);
-
-                               return seed_endpoint.Create (sa);
-                       }
-               }
-
-               void Linger (IntPtr handle)
-               {
-                       if (!connected || linger_timeout <= 0)
-                               return;
-
-                       // We don't want to receive any more data
-                       int error;
-                       Shutdown_internal (handle, SocketShutdown.Receive, out error);
-                       if (error != 0)
-                               return;
-
-                       int seconds = linger_timeout / 1000;
-                       int ms = linger_timeout % 1000;
-                       if (ms > 0) {
-                               // If the other end closes, this will return 'true' with 'Available' == 0
-                               Poll_internal (handle, SelectMode.SelectRead, ms * 1000, out error);
-                               if (error != 0)
-                                       return;
-
-                       }
-                       if (seconds > 0) {
-                               LingerOption linger = new LingerOption (true, seconds);
-                               SetSocketOption_internal (handle, SocketOptionLevel.Socket, SocketOptionName.Linger, linger, null, 0, out error);
-                               /* Not needed, we're closing upon return */
-                               /*if (error != 0)
-                                       return; */
-                       }
-               }
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               internal static extern void cancel_blocking_socket_operation (Thread thread);
-
-               protected virtual void Dispose (bool disposing)
-               {
-                       if (disposed)
-                               return;
-
-                       disposed = true;
-                       bool was_connected = connected;
-                       connected = false;
-                       
-                       if (socket != null) {
-                               closed = true;
-                               IntPtr x = Handle;
-
-                               if (was_connected)
-                                       Linger (x);
-
-                               socket.Dispose ();
-                       }
-               }
-
-               public void Dispose ()
-               {
-                       Dispose (true);
-                       GC.SuppressFinalize (this);
-               }
-
-               // Closes the socket
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               internal extern static void Close_internal(IntPtr socket, out int error);
-
-               public void Close ()
-               {
-                       linger_timeout = 0;
-                       ((IDisposable) this).Dispose ();
-               }
-
-               public void Close (int timeout) 
-               {
-                       linger_timeout = timeout;
-                       ((IDisposable) this).Dispose ();
-               }
-
-               // Connects to the remote address
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               private extern static void Connect_internal(IntPtr sock,
-                                                           SocketAddress sa,
-                                                           out int error);
-               
-               private static void Connect_internal (SafeSocketHandle safeHandle,
-                                                           SocketAddress sa,
-                                                           out int error)
-               {
-                       try {
-                               safeHandle.RegisterForBlockingSyscall ();
-                               Connect_internal (safeHandle.DangerousGetHandle (), sa, out error);
-                       } finally {
-                               safeHandle.UnRegisterForBlockingSyscall ();
-                       }
-               }
-
-               public void Connect (EndPoint remoteEP)
-               {
-                       SocketAddress serial = null;
-
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
-
-                       if (remoteEP == null)
-                               throw new ArgumentNullException ("remoteEP");
-
-                       IPEndPoint ep = remoteEP as IPEndPoint;
-                       if (ep != null && socket_type != SocketType.Dgram) /* Dgram uses Any to 'disconnect' */
-                               if (ep.Address.Equals (IPAddress.Any) || ep.Address.Equals (IPAddress.IPv6Any))
-                                       throw new SocketException ((int) SocketError.AddressNotAvailable);
-
-                       if (islistening)
-                               throw new InvalidOperationException ();
-                       serial = remoteEP.Serialize ();
-
-                       int error = 0;
-
-                       Connect_internal (socket, serial, out error);
-
-                       if (error == 0 || error == 10035)
-                               seed_endpoint = remoteEP; // Keep the ep around for non-blocking sockets
-
-                       if (error != 0) {
-                               if (closed)
-                                       error = SOCKET_CLOSED;
-                               throw new SocketException (error);
-                       }
-
-                       if (socket_type == SocketType.Dgram && ep != null && (ep.Address.Equals (IPAddress.Any) || ep.Address.Equals (IPAddress.IPv6Any)))
-                               connected = false;
-                       else
-                               connected = true;
-                       isbound = true;
-               }
-
-               public bool ReceiveAsync (SocketAsyncEventArgs e)
-               {
-                       // NO check is made whether e != null in MS.NET (NRE is thrown in such case)
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
-
-                       // LAME SPEC: the ArgumentException is never thrown, instead an NRE is
-                       // thrown when e.Buffer and e.BufferList are null (works fine when one is
-                       // set to a valid object)
-                       if (e.Buffer == null && e.BufferList == null)
-                               throw new NullReferenceException ("Either e.Buffer or e.BufferList must be valid buffers.");
-
-                       e.curSocket = this;
-                       SocketOperation op = (e.Buffer != null) ? SocketOperation.Receive : SocketOperation.ReceiveGeneric;
-                       e.Worker.Init (this, e, op);
-                       SocketAsyncResult res = e.Worker.result;
-                       if (e.Buffer != null) {
-                               res.Buffer = e.Buffer;
-                               res.Offset = e.Offset;
-                               res.Size = e.Count;
-                       } else {
-                               res.Buffers = e.BufferList;
-                       }
-                       res.SockFlags = e.SocketFlags;
-                       int count;
-                       lock (readQ) {
-                               readQ.Enqueue (e.Worker);
-                               count = readQ.Count;
-                       }
-                       if (count == 1) {
-                               // Receive takes care of ReceiveGeneric
-                               socket_pool_queue (Worker.Dispatcher, res);
-                       }
-
-                       return true;
-               }
-
-               public bool SendAsync (SocketAsyncEventArgs e)
-               {
-                       // NO check is made whether e != null in MS.NET (NRE is thrown in such case)
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
-                       if (e.Buffer == null && e.BufferList == null)
-                               throw new NullReferenceException ("Either e.Buffer or e.BufferList must be valid buffers.");
-
-                       e.curSocket = this;
-                       SocketOperation op = (e.Buffer != null) ? SocketOperation.Send : SocketOperation.SendGeneric;
-                       e.Worker.Init (this, e, op);
-                       SocketAsyncResult res = e.Worker.result;
-                       if (e.Buffer != null) {
-                               res.Buffer = e.Buffer;
-                               res.Offset = e.Offset;
-                               res.Size = e.Count;
-                       } else {
-                               res.Buffers = e.BufferList;
-                       }
-                       res.SockFlags = e.SocketFlags;
-                       int count;
-                       lock (writeQ) {
-                               writeQ.Enqueue (e.Worker);
-                               count = writeQ.Count;
-                       }
-                       if (count == 1) {
-                               // Send takes care of SendGeneric
-                               socket_pool_queue (Worker.Dispatcher, res);
-                       }
-                       return true;
-               }
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               extern static bool Poll_internal (IntPtr socket, SelectMode mode, int timeout, out int error);
-
-               private static bool Poll_internal (SafeSocketHandle safeHandle, SelectMode mode, int timeout, out int error)
-               {
-                       bool release = false;
-                       try {
-                               safeHandle.DangerousAddRef (ref release);
-                               return Poll_internal (safeHandle.DangerousGetHandle (), mode, timeout, out error);
-                       } finally {
-                               if (release)
-                                       safeHandle.DangerousRelease ();
-                       }
-               }
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               private extern static int Receive_internal(IntPtr sock,
-                                                          byte[] buffer,
-                                                          int offset,
-                                                          int count,
-                                                          SocketFlags flags,
-                                                          out int error);
-
-               private static int Receive_internal (SafeSocketHandle safeHandle,
-                                                          byte[] buffer,
-                                                          int offset,
-                                                          int count,
-                                                          SocketFlags flags,
-                                                          out int error)
-               {
-                       try {
-                               safeHandle.RegisterForBlockingSyscall ();
-                               return Receive_internal (safeHandle.DangerousGetHandle (), buffer, offset, count, flags, out error);
-                       } finally {
-                               safeHandle.UnRegisterForBlockingSyscall ();
-                       }
-               }
-
-               internal int Receive_nochecks (byte [] buf, int offset, int size, SocketFlags flags, out SocketError error)
-               {
-                       int nativeError;
-                       int ret = Receive_internal (socket, buf, offset, size, flags, out nativeError);
-                       error = (SocketError) nativeError;
-                       if (error != SocketError.Success && error != SocketError.WouldBlock && error != SocketError.InProgress) {
-                               connected = false;
-                               isbound = false;
-                       } else {
-                               connected = true;
-                       }
-                       
-                       return ret;
-               }
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               private extern static void GetSocketOption_obj_internal(IntPtr socket,
-                       SocketOptionLevel level, SocketOptionName name, out object obj_val,
-                       out int error);
-
-               private static void GetSocketOption_obj_internal (SafeSocketHandle safeHandle,
-                       SocketOptionLevel level, SocketOptionName name, out object obj_val,
-                       out int error)
-               {
-                       bool release = false;
-                       try {
-                               safeHandle.DangerousAddRef (ref release);
-                               GetSocketOption_obj_internal (safeHandle.DangerousGetHandle (), level, name, out obj_val, out error);
-                       } finally {
-                               if (release)
-                                       safeHandle.DangerousRelease ();
-                       }
-               }
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               private extern static int Send_internal(IntPtr sock,
-                                                       byte[] buf, int offset,
-                                                       int count,
-                                                       SocketFlags flags,
-                                                       out int error);
-
-               private static int Send_internal (SafeSocketHandle safeHandle,
-                                                       byte[] buf, int offset,
-                                                       int count,
-                                                       SocketFlags flags,
-                                                       out int error)
-               {
-                       try {
-                               safeHandle.RegisterForBlockingSyscall ();
-                               return Send_internal (safeHandle.DangerousGetHandle (), buf, offset, count, flags, out error);
-                       } finally {
-                               safeHandle.UnRegisterForBlockingSyscall ();
-                       }
-               }
-
-               internal int Send_nochecks (byte [] buf, int offset, int size, SocketFlags flags, out SocketError error)
-               {
-                       if (size == 0) {
-                               error = SocketError.Success;
-                               return 0;
-                       }
-
-                       int nativeError;
-
-                       int ret = Send_internal (socket, buf, offset, size, flags, out nativeError);
-
-                       error = (SocketError)nativeError;
-
-                       if (error != SocketError.Success && error != SocketError.WouldBlock && error != SocketError.InProgress) {
-                               connected = false;
-                               isbound = false;
-                       } else {
-                               connected = true;
-                       }
-
-                       return ret;
-               }
-
-               public object GetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName)
-               {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
-
-                       object obj_val;
-                       int error;
-
-                       GetSocketOption_obj_internal (socket, optionLevel, optionName, out obj_val,
-                               out error);
-                       if (error != 0)
-                               throw new SocketException (error);
-
-                       if (optionName == SocketOptionName.Linger) {
-                               return((LingerOption)obj_val);
-                       } else if (optionName == SocketOptionName.AddMembership ||
-                                  optionName == SocketOptionName.DropMembership) {
-                               return((MulticastOption)obj_val);
-                       } else if (obj_val is int) {
-                               return((int)obj_val);
-                       } else {
-                               return(obj_val);
-                       }
-               }
-
-               [MethodImplAttribute (MethodImplOptions.InternalCall)]
-               private extern static void Shutdown_internal (IntPtr socket, SocketShutdown how, out int error);
-               
-               private static void Shutdown_internal (SafeSocketHandle safeHandle, SocketShutdown how, out int error)
-               {
-                       bool release = false;
-                       try {
-                               safeHandle.DangerousAddRef (ref release);
-                               Shutdown_internal (safeHandle.DangerousGetHandle (), how, out error);
-                       } finally {
-                               if (release)
-                                       safeHandle.DangerousRelease ();
-                       }
-               }
-
-               public void Shutdown (SocketShutdown how)
-               {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
-
-                       if (!connected)
-                               throw new SocketException (10057); // Not connected
-
-                       int error;
-                       
-                       Shutdown_internal (socket, how, out error);
-                       if (error != 0)
-                               throw new SocketException (error);
-               }
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               private extern static void SetSocketOption_internal (IntPtr socket, SocketOptionLevel level,
-                                                                    SocketOptionName name, object obj_val,
-                                                                    byte [] byte_val, int int_val,
-                                                                    out int error);
-
-               private static void SetSocketOption_internal (SafeSocketHandle safeHandle, SocketOptionLevel level,
-                                                                    SocketOptionName name, object obj_val,
-                                                                    byte [] byte_val, int int_val,
-                                                                    out int error)
-               {
-                       bool release = false;
-                       try {
-                               safeHandle.DangerousAddRef (ref release);
-                               SetSocketOption_internal (safeHandle.DangerousGetHandle (), level, name, obj_val, byte_val, int_val, out error);
-                       } finally {
-                               if (release)
-                                       safeHandle.DangerousRelease ();
-                       }
-               }
-
-               public void SetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, int optionValue)
-               {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
-
-                       int error;
-
-                       SetSocketOption_internal (socket, optionLevel, optionName, null,
-                                                null, optionValue, out error);
-
-                       if (error != 0)
-                               throw new SocketException (error);
-               }
-
-               private void ThrowIfUpd ()
-               {
-#if !NET_2_1 || MOBILE
-                       if (protocol_type == ProtocolType.Udp)
-                               throw new SocketException ((int)SocketError.ProtocolOption);
-#endif
-               }
-
-               public
-               IAsyncResult BeginConnect(EndPoint end_point, AsyncCallback callback, object state)
-               {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
-
-                       if (end_point == null)
-                               throw new ArgumentNullException ("end_point");
-
-                       SocketAsyncResult req = new SocketAsyncResult (this, state, callback, SocketOperation.Connect);
-                       req.EndPoint = end_point;
-
-                       // Bug #75154: Connect() should not succeed for .Any addresses.
-                       if (end_point is IPEndPoint) {
-                               IPEndPoint ep = (IPEndPoint) end_point;
-                               if (ep.Address.Equals (IPAddress.Any) || ep.Address.Equals (IPAddress.IPv6Any)) {
-                                       req.Complete (new SocketException ((int) SocketError.AddressNotAvailable), true);
-                                       return req;
-                               }
-                       }
-
-                       int error = 0;
-                       if (connect_in_progress) {
-                               // This could happen when multiple IPs are used
-                               // Calling connect() again will reset the connection attempt and cause
-                               // an error. Better to just close the socket and move on.
-                               connect_in_progress = false;
-                               socket.Dispose ();
-                               var handle = Socket_internal (address_family, socket_type, protocol_type, out error);
-                               socket = new SafeSocketHandle (handle, true);
-                               if (error != 0)
-                                       throw new SocketException (error);
-                       }
-                       bool blk = blocking;
-                       if (blk)
-                               Blocking = false;
-                       SocketAddress serial = end_point.Serialize ();
-                       Connect_internal (socket, serial, out error);
-                       if (blk)
-                               Blocking = true;
-                       if (error == 0) {
-                               // succeeded synch
-                               connected = true;
-                               isbound = true;
-                               req.Complete (true);
-                               return req;
-                       }
-
-                       if (error != (int) SocketError.InProgress && error != (int) SocketError.WouldBlock) {
-                               // error synch
-                               connected = false;
-                               isbound = false;
-                               req.Complete (new SocketException (error), true);
-                               return req;
-                       }
-
-                       // continue asynch
-                       connected = false;
-                       isbound = false;
-                       connect_in_progress = true;
-                       socket_pool_queue (Worker.Dispatcher, req);
-                       return req;
-               }
-
-               public
-               IAsyncResult BeginConnect (IPAddress[] addresses, int port, AsyncCallback callback, object state)
-
-               {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
-
-                       if (addresses == null)
-                               throw new ArgumentNullException ("addresses");
-
-                       if (addresses.Length == 0)
-                               throw new ArgumentException ("Empty addresses list");
-
-                       if (this.AddressFamily != AddressFamily.InterNetwork &&
-                               this.AddressFamily != AddressFamily.InterNetworkV6)
-                               throw new NotSupportedException ("This method is only valid for addresses in the InterNetwork or InterNetworkV6 families");
-
-                       if (port <= 0 || port > 65535)
-                               throw new ArgumentOutOfRangeException ("port", "Must be > 0 and < 65536");
-                       if (islistening)
-                               throw new InvalidOperationException ();
-
-                       SocketAsyncResult req = new SocketAsyncResult (this, state, callback, SocketOperation.Connect);
-                       req.Addresses = addresses;
-                       req.Port = port;
-                       connected = false;
-                       return BeginMConnect (req);
-               }
-
-               IAsyncResult BeginMConnect (SocketAsyncResult req)
-               {
-                       IAsyncResult ares = null;
-                       Exception exc = null;
-                       for (int i = req.CurrentAddress; i < req.Addresses.Length; i++) {
-                               IPAddress addr = req.Addresses [i];
-                               IPEndPoint ep = new IPEndPoint (addr, req.Port);
-                               try {
-                                       req.CurrentAddress++;
-                                       ares = BeginConnect (ep, null, req);
-                                       if (ares.IsCompleted && ares.CompletedSynchronously) {
-                                               ((SocketAsyncResult) ares).CheckIfThrowDelayedException ();
-                                               req.DoMConnectCallback ();
-                                       }
-                                       break;
-                               } catch (Exception e) {
-                                       exc = e;
-                                       ares = null;
-                               }
-                       }
-
-                       if (ares == null)
-                               throw exc;
-
-                       return req;
-               }
-
-               // Returns false when it is ok to use RemoteEndPoint
-               //         true when addresses must be used (and addresses could be null/empty)
-               bool GetCheckedIPs (SocketAsyncEventArgs e, out IPAddress [] addresses)
-               {
-                       addresses = null;
-                       // Connect to the first address that match the host name, like:
-                       // http://blogs.msdn.com/ncl/archive/2009/07/20/new-ncl-features-in-net-4-0-beta-2.aspx
-                       // while skipping entries that do not match the address family
-                       DnsEndPoint dep = (e.RemoteEndPoint as DnsEndPoint);
-                       if (dep != null) {
-                               addresses = Dns.GetHostAddresses (dep.Host);
-                               return true;
-                       } else {
-                               e.ConnectByNameError = null;
-                                       return false;
-                       }
-               }
-
-               bool ConnectAsyncReal (SocketAsyncEventArgs e)
-               {                       
-                       bool use_remoteep = true;
-                       IPAddress [] addresses = null;
-                       use_remoteep = !GetCheckedIPs (e, out addresses);
-                       e.curSocket = this;
-                       Worker w = e.Worker;
-                       w.Init (this, e, SocketOperation.Connect);
-                       SocketAsyncResult result = w.result;
-                       IAsyncResult ares = null;
-                       try {
-                               if (use_remoteep) {
-                                       result.EndPoint = e.RemoteEndPoint;
-                                       ares = BeginConnect (e.RemoteEndPoint, SocketAsyncEventArgs.Dispatcher, e);
-                               }
-                               else {
-
-                                       DnsEndPoint dep = (e.RemoteEndPoint as DnsEndPoint);
-                                       result.Addresses = addresses;
-                                       result.Port = dep.Port;
-
-                                       ares = BeginConnect (addresses, dep.Port, SocketAsyncEventArgs.Dispatcher, e);
-                               }
-                               if (ares.IsCompleted && ares.CompletedSynchronously) {
-                                       ((SocketAsyncResult) ares).CheckIfThrowDelayedException ();
-                                       return false;
-                               }
-                       } catch (Exception exc) {
-                               result.Complete (exc, true);
-                               return false;
-                       }
-                       return true;
-               }
-
-               public bool ConnectAsync (SocketAsyncEventArgs e)
-               {
-                       // NO check is made whether e != null in MS.NET (NRE is thrown in such case)
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
-                       if (islistening)
-                               throw new InvalidOperationException ("You may not perform this operation after calling the Listen method.");
-                       if (e.RemoteEndPoint == null)
-                               throw new ArgumentNullException ("remoteEP");
-
-                       return ConnectAsyncReal (e);
-               }
-
-               [MethodImplAttribute (MethodImplOptions.InternalCall)]
-               private extern static int Receive_internal (IntPtr sock, WSABUF[] bufarray, SocketFlags flags, out int error);
-
-               private static int Receive_internal (SafeSocketHandle safeHandle, WSABUF[] bufarray, SocketFlags flags, out int error)
-               {
-                       try {
-                               safeHandle.RegisterForBlockingSyscall ();
-                               return Receive_internal (safeHandle.DangerousGetHandle (), bufarray, flags, out error);
-                       } finally {
-                               safeHandle.UnRegisterForBlockingSyscall ();
-                       }
-               }
-
-               public
-               int Receive (IList<ArraySegment<byte>> buffers)
-               {
-                       int ret;
-                       SocketError error;
-                       ret = Receive (buffers, SocketFlags.None, out error);
-                       if (error != SocketError.Success) {
-                               throw new SocketException ((int)error);
-                       }
-                       return(ret);
-               }
-
-               [CLSCompliant (false)]
-               public
-               int Receive (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags)
-               {
-                       int ret;
-                       SocketError error;
-                       ret = Receive (buffers, socketFlags, out error);
-                       if (error != SocketError.Success) {
-                               throw new SocketException ((int)error);
-                       }
-                       return(ret);
-               }
-
-               [CLSCompliant (false)]
-               public
-               int Receive (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode)
-               {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
-
-                       if (buffers == null ||
-                           buffers.Count == 0) {
-                               throw new ArgumentNullException ("buffers");
-                       }
-
-                       int numsegments = buffers.Count;
-                       int nativeError;
-                       int ret;
-
-                       /* Only example I can find of sending a byte
-                        * array reference directly into an internal
-                        * call is in
-                        * System.Runtime.Remoting/System.Runtime.Remoting.Channels.Ipc.Win32/NamedPipeSocket.cs,
-                        * so taking a lead from that...
-                        */
-                       WSABUF[] bufarray = new WSABUF[numsegments];
-                       GCHandle[] gch = new GCHandle[numsegments];
-
-                       for(int i = 0; i < numsegments; i++) {
-                               ArraySegment<byte> segment = buffers[i];
-
-                               if (segment.Offset < 0 || segment.Count < 0 ||
-                                   segment.Count > segment.Array.Length - segment.Offset)
-                                       throw new ArgumentOutOfRangeException ("segment");
-
-                               gch[i] = GCHandle.Alloc (segment.Array, GCHandleType.Pinned);
-                               bufarray[i].len = segment.Count;
-                               bufarray[i].buf = Marshal.UnsafeAddrOfPinnedArrayElement (segment.Array, segment.Offset);
-                       }
-
-                       try {
-                               ret = Receive_internal (socket, bufarray,
-                                                       socketFlags,
-                                                       out nativeError);
-                       } finally {
-                               for(int i = 0; i < numsegments; i++) {
-                                       if (gch[i].IsAllocated) {
-                                               gch[i].Free ();
-                                       }
-                               }
-                       }
-
-                       errorCode = (SocketError)nativeError;
-                       return(ret);
-               }
-
-               [MethodImplAttribute (MethodImplOptions.InternalCall)]
-               private extern static int Send_internal (IntPtr sock, WSABUF[] bufarray, SocketFlags flags, out int error);
-
-               private static int Send_internal (SafeSocketHandle safeHandle, WSABUF[] bufarray, SocketFlags flags, out int error)
-               {
-                       bool release = false;
-                       try {
-                               safeHandle.DangerousAddRef (ref release);
-                               return Send_internal (safeHandle.DangerousGetHandle (), bufarray, flags, out error);
-                       } finally {
-                               if (release)
-                                       safeHandle.DangerousRelease ();
-                       }
-               }
-
-               public
-               int Send (IList<ArraySegment<byte>> buffers)
-               {
-                       int ret;
-                       SocketError error;
-                       ret = Send (buffers, SocketFlags.None, out error);
-                       if (error != SocketError.Success) {
-                               throw new SocketException ((int)error);
-                       }
-                       return(ret);
-               }
-
-               public
-               int Send (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags)
-               {
-                       int ret;
-                       SocketError error;
-                       ret = Send (buffers, socketFlags, out error);
-                       if (error != SocketError.Success) {
-                               throw new SocketException ((int)error);
-                       }
-                       return(ret);
-               }
-
-               [CLSCompliant (false)]
-               public
-               int Send (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode)
-               {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
-                       if (buffers == null)
-                               throw new ArgumentNullException ("buffers");
-                       if (buffers.Count == 0)
-                               throw new ArgumentException ("Buffer is empty", "buffers");
-                       int numsegments = buffers.Count;
-                       int nativeError;
-                       int ret;
-
-                       WSABUF[] bufarray = new WSABUF[numsegments];
-                       GCHandle[] gch = new GCHandle[numsegments];
-                       for(int i = 0; i < numsegments; i++) {
-                               ArraySegment<byte> segment = buffers[i];
-
-                               if (segment.Offset < 0 || segment.Count < 0 ||
-                                   segment.Count > segment.Array.Length - segment.Offset)
-                                       throw new ArgumentOutOfRangeException ("segment");
-
-                               gch[i] = GCHandle.Alloc (segment.Array, GCHandleType.Pinned);
-                               bufarray[i].len = segment.Count;
-                               bufarray[i].buf = Marshal.UnsafeAddrOfPinnedArrayElement (segment.Array, segment.Offset);
-                       }
-
-                       try {
-                               ret = Send_internal (socket, bufarray, socketFlags, out nativeError);
-                       } finally {
-                               for(int i = 0; i < numsegments; i++) {
-                                       if (gch[i].IsAllocated) {
-                                               gch[i].Free ();
-                                       }
-                               }
-                       }
-                       errorCode = (SocketError)nativeError;
-                       return(ret);
-               }
-
-               Exception InvalidAsyncOp (string method)
-               {
-                       return new InvalidOperationException (method + " can only be called once per asynchronous operation");
-               }
-
-               public
-               int EndReceive (IAsyncResult result)
-               {
-                       SocketError error;
-                       int bytesReceived = EndReceive (result, out error);
-                       if (error != SocketError.Success) {
-                               if (error != SocketError.WouldBlock && error != SocketError.InProgress)
-                                       connected = false;
-                               throw new SocketException ((int)error);
-                       }
-                       return bytesReceived;
-               }
-
-               public
-               int EndReceive (IAsyncResult asyncResult, out SocketError errorCode)
-               {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
-
-                       if (asyncResult == null)
-                               throw new ArgumentNullException ("asyncResult");
-
-                       SocketAsyncResult req = asyncResult as SocketAsyncResult;
-                       if (req == null)
-                               throw new ArgumentException ("Invalid IAsyncResult", "asyncResult");
-
-                       if (Interlocked.CompareExchange (ref req.EndCalled, 1, 0) == 1)
-                               throw InvalidAsyncOp ("EndReceive");
-                       if (!asyncResult.IsCompleted)
-                               asyncResult.AsyncWaitHandle.WaitOne ();
-
-                       errorCode = req.ErrorCode;
-                       // If no socket error occurred, call CheckIfThrowDelayedException in case there are other
-                       // kinds of exceptions that should be thrown.
-                       if (errorCode == SocketError.Success)
-                               req.CheckIfThrowDelayedException();
-
-                       return(req.Total);
-               }
-
-               public
-               int EndSend (IAsyncResult result)
-               {
-                       SocketError error;
-                       int bytesSent = EndSend (result, out error);
-                       if (error != SocketError.Success) {
-                               if (error != SocketError.WouldBlock && error != SocketError.InProgress)
-                                       connected = false;
-                               throw new SocketException ((int)error);
-                       }
-                       return bytesSent;
-               }
-
-               public
-               int EndSend (IAsyncResult asyncResult, out SocketError errorCode)
-               {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
-                       if (asyncResult == null)
-                               throw new ArgumentNullException ("asyncResult");
-
-                       SocketAsyncResult req = asyncResult as SocketAsyncResult;
-                       if (req == null)
-                               throw new ArgumentException ("Invalid IAsyncResult", "result");
-
-                       if (Interlocked.CompareExchange (ref req.EndCalled, 1, 0) == 1)
-                               throw InvalidAsyncOp ("EndSend");
-                       if (!asyncResult.IsCompleted)
-                               asyncResult.AsyncWaitHandle.WaitOne ();
-
-                       errorCode = req.ErrorCode;
-                       // If no socket error occurred, call CheckIfThrowDelayedException in case there are other
-                       // kinds of exceptions that should be thrown.
-                       if (errorCode == SocketError.Success)
-                               req.CheckIfThrowDelayedException ();
-
-                       return(req.Total);
-               }
-
-               // Used by Udpclient
-               public
-               int EndReceiveFrom(IAsyncResult result, ref EndPoint end_point)
-               {
-                       if (disposed && closed)
-                               throw new ObjectDisposedException (GetType ().ToString ());
-
-                       if (result == null)
-                               throw new ArgumentNullException ("result");
-
-                       if (end_point == null)
-                               throw new ArgumentNullException ("remote_end");
-
-                       SocketAsyncResult req = result as SocketAsyncResult;
-                       if (req == null)
-                               throw new ArgumentException ("Invalid IAsyncResult", "result");
-
-                       if (Interlocked.CompareExchange (ref req.EndCalled, 1, 0) == 1)
-                               throw InvalidAsyncOp ("EndReceiveFrom");
-                       if (!result.IsCompleted)
-                               result.AsyncWaitHandle.WaitOne();
-
-                       req.CheckIfThrowDelayedException();
-                       end_point = req.EndPoint;
-                       return req.Total;
-               }
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               static extern void socket_pool_queue (SocketAsyncCall d, SocketAsyncResult r);
-       }
-}
-
index d5ff6effa2bce04f95370b76838a9d85d9645ac7..9045052ccf7a35a917619dcc0ee4d1fdd6cb5aa8 100644 (file)
@@ -56,8 +56,6 @@ namespace System.Net {
 
                static Dns ()
                {
-                       System.Net.Sockets.Socket.CheckProtocolSupport();
-
 #if !MOBILE
                        if (Environment.GetEnvironmentVariable ("MONO_DNS") != null) {
                                resolver = new SimpleResolver ();
index 2a2c1cb048fa6aa63336ee442c7902bb971fa39c..bb47c65c48faa262a6dedeeafc554390e796d4cd 100644 (file)
@@ -401,15 +401,21 @@ namespace System.Net
                }
                public bool CloseConnectionGroup (string connectionGroupName)
                {
+                       WebConnectionGroup cncGroup = null;
+
                        lock (this) {
-                               WebConnectionGroup cncGroup = GetConnectionGroup (connectionGroupName);
+                               cncGroup = GetConnectionGroup (connectionGroupName);
                                if (cncGroup != null) {
-                                       cncGroup.Close ();
                                        RemoveConnectionGroup (cncGroup);
-                                       return true;
                                }
                        }
 
+                       // WebConnectionGroup.Close() must *not* be called inside the lock
+                       if (cncGroup != null) {
+                               cncGroup.Close ();
+                               return true;
+                       }
+
                        return false;
                }
 
index 5e142154f913704bd614466144dbe5da559aa014..3936ee428981997dd3f5700a05f8727d20ce6680 100644 (file)
@@ -66,6 +66,8 @@ namespace System.Net
 
                public void Close ()
                {
+                       List<WebConnection> connectionsToClose = null;
+
                        //TODO: what do we do with the queue? Empty it out and abort the requests?
                        //TODO: abort requests or wait for them to finish
                        lock (sPoint) {
@@ -76,7 +78,17 @@ namespace System.Net
                                        var node = iter;
                                        iter = iter.Next;
 
+                                       // Closing connections inside the lock leads to a deadlock.
+                                       if (connectionsToClose == null)
+                                               connectionsToClose = new List<WebConnection>();
+
+                                       connectionsToClose.Add (cnc);
                                        connections.Remove (node);
+                               }
+                       }
+
+                       if (connectionsToClose != null) {
+                               foreach (var cnc in connectionsToClose) {
                                        cnc.Close (false);
                                        OnConnectionClosed ();
                                }
diff --git a/mcs/class/System/System.Threading/SemaphoreFullException.cs b/mcs/class/System/System.Threading/SemaphoreFullException.cs
deleted file mode 100644 (file)
index 6995b35..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-//
-// System.Threading.SemaphoreFullException.cs
-//
-// Author:
-//     Sebastien Pouliot  <sebastien@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if (!NET_4_0 && !INSIDE_CORLIB) || (NET_4_0 && INSIDE_CORLIB)
-
-using System.Runtime.InteropServices;
-using System.Runtime.Serialization;
-using System.Runtime.CompilerServices;
-
-namespace System.Threading {
-
-#if NET_4_0 && INSIDE_CORLIB
-       [TypeForwardedFrom (Consts.AssemblySystem_2_0)]
-#endif
-       [ComVisible (false)]
-       [Serializable]
-       public class SemaphoreFullException : SystemException {
-
-               public SemaphoreFullException ()
-                       : base (Locale.GetText ("Exceeding maximum."))
-               {
-               }
-
-               public SemaphoreFullException (string message)
-                       : base (message)
-               {
-               }
-
-               public SemaphoreFullException (string message, Exception innerException)
-                       : base (message, innerException)
-               {
-               }
-
-               protected SemaphoreFullException (SerializationInfo info, StreamingContext context)
-                       : base (info, context)
-               {
-               }
-       }
-
-}
-#elif NET_4_0 && !INSIDE_CORLIB
-using System.Runtime.CompilerServices;
-using System.Threading;
-
-[assembly: TypeForwardedTo (typeof (SemaphoreFullException))]
-#endif
index b6114e4e51a383e7c3b489f8a0ed2baed2c9066a..b56554343f77f5a702296ab9b525f88203f5b12b 100644 (file)
@@ -27,95 +27,9 @@ Microsoft.Win32/UserPreferenceChangedEventHandler.cs
 Microsoft.Win32/UserPreferenceChangingEventArgs.cs
 Microsoft.Win32/UserPreferenceChangingEventHandler.cs
 Mono.Http/NtlmClient.cs
-System.CodeDom/CodeArgumentReferenceExpression.cs
-System.CodeDom/CodeArrayCreateExpression.cs
-System.CodeDom/CodeArrayIndexerExpression.cs
-System.CodeDom/CodeAssignStatement.cs
-System.CodeDom/CodeAttachEventStatement.cs
-System.CodeDom/CodeAttributeArgumentCollection.cs
-System.CodeDom/CodeAttributeArgument.cs
-System.CodeDom/CodeAttributeDeclarationCollection.cs
-System.CodeDom/CodeAttributeDeclaration.cs
-System.CodeDom/CodeBaseReferenceExpression.cs
-System.CodeDom/CodeBinaryOperatorExpression.cs
-System.CodeDom/CodeBinaryOperatorType.cs
-System.CodeDom/CodeCastExpression.cs
-System.CodeDom/CodeCatchClauseCollection.cs
-System.CodeDom/CodeCatchClause.cs
-System.CodeDom/CodeChecksumPragma.cs
-System.CodeDom/CodeComment.cs
-System.CodeDom/CodeCommentStatementCollection.cs
-System.CodeDom/CodeCommentStatement.cs
-System.CodeDom/CodeCompileUnit.cs
-System.CodeDom/CodeConditionStatement.cs
-System.CodeDom/CodeConstructor.cs
-System.CodeDom/CodeDefaultValueExpression.cs
-System.CodeDom/CodeDelegateCreateExpression.cs
-System.CodeDom/CodeDelegateInvokeExpression.cs
-System.CodeDom/CodeDirectionExpression.cs
-System.CodeDom/CodeDirectiveCollection.cs
-System.CodeDom/CodeDirective.cs
-System.CodeDom/CodeEntryPointMethod.cs
-System.CodeDom/CodeEventReferenceExpression.cs
-System.CodeDom/CodeExpressionCollection.cs
-System.CodeDom/CodeExpression.cs
-System.CodeDom/CodeExpressionStatement.cs
-System.CodeDom/CodeFieldReferenceExpression.cs
-System.CodeDom/CodeGotoStatement.cs
-System.CodeDom/CodeIndexerExpression.cs
-System.CodeDom/CodeIterationStatement.cs
-System.CodeDom/CodeLabeledStatement.cs
-System.CodeDom/CodeLinePragma.cs
-System.CodeDom/CodeMemberEvent.cs
-System.CodeDom/CodeMemberField.cs
-System.CodeDom/CodeMemberMethod.cs
-System.CodeDom/CodeMemberProperty.cs
-System.CodeDom/CodeMethodInvokeExpression.cs
-System.CodeDom/CodeMethodReferenceExpression.cs
-System.CodeDom/CodeMethodReturnStatement.cs
-System.CodeDom/CodeNamespaceCollection.cs
-System.CodeDom/CodeNamespace.cs
-System.CodeDom/CodeNamespaceImportCollection.cs
-System.CodeDom/CodeNamespaceImport.cs
-System.CodeDom/CodeObjectCreateExpression.cs
-System.CodeDom/CodeObject.cs
-System.CodeDom/CodeParameterDeclarationExpressionCollection.cs
-System.CodeDom/CodeParameterDeclarationExpression.cs
-System.CodeDom/CodePrimitiveExpression.cs
-System.CodeDom/CodePropertyReferenceExpression.cs
-System.CodeDom/CodePropertySetValueReferenceExpression.cs
-System.CodeDom/CodeRegionDirective.cs
-System.CodeDom/CodeRegionMode.cs
-System.CodeDom/CodeRemoveEventStatement.cs
-System.CodeDom/CodeSnippetCompileUnit.cs
-System.CodeDom/CodeSnippetExpression.cs
-System.CodeDom/CodeSnippetStatement.cs
-System.CodeDom/CodeSnippetTypeMember.cs
-System.CodeDom/CodeStatementCollection.cs
-System.CodeDom/CodeStatement.cs
-System.CodeDom/CodeThisReferenceExpression.cs
-System.CodeDom/CodeThrowExceptionStatement.cs
-System.CodeDom/CodeTryCatchFinallyStatement.cs
-System.CodeDom/CodeTypeConstructor.cs
-System.CodeDom/CodeTypeDeclarationCollection.cs
-System.CodeDom/CodeTypeDeclaration.cs
-System.CodeDom/CodeTypeDelegate.cs
-System.CodeDom/CodeTypeMemberCollection.cs
-System.CodeDom/CodeTypeMember.cs
-System.CodeDom/CodeTypeOfExpression.cs
-System.CodeDom/CodeTypeParameterCollection.cs
-System.CodeDom/CodeTypeParameter.cs
-System.CodeDom/CodeTypeReferenceCollection.cs
-System.CodeDom/CodeTypeReference.cs
-System.CodeDom/CodeTypeReferenceExpression.cs
-System.CodeDom/CodeTypeReferenceOptions.cs
-System.CodeDom/CodeVariableDeclarationStatement.cs
-System.CodeDom/CodeVariableReferenceExpression.cs
-System.CodeDom/ICodeDomVisitor.cs
 System.CodeDom.Compiler/CodeCompiler.cs
 System.CodeDom.Compiler/CodeDomConfigurationHandler.cs
 System.CodeDom.Compiler/CodeDomProvider.cs
-System.CodeDom.Compiler/CodeGenerator.cs
 System.CodeDom.Compiler/CodeGeneratorOptions.cs
 System.CodeDom.Compiler/CodeParser.cs
 System.CodeDom.Compiler/Compiler.cs
@@ -136,8 +50,6 @@ System.CodeDom.Compiler/ICodeParser.cs
 System.CodeDom.Compiler/IndentedTextWriter.cs
 System.CodeDom.Compiler/LanguageOptions.cs
 System.CodeDom.Compiler/TempFileCollection.cs
-System.CodeDom/FieldDirection.cs
-System.CodeDom/MemberAttributes.cs
 System.Configuration/ApplicationScopedSettingAttribute.cs
 System.Configuration/ApplicationSettingsBase.cs
 System.Configuration/ApplicationSettingsGroup.cs
@@ -533,14 +445,17 @@ System.Net.Sockets/SafeSocketHandle.cs
 System.Net.Sockets/SelectMode.cs
 System.Net.Sockets/SendPacketsElement.cs
 System.Net.Sockets/Socket.cs
-System.Net.Sockets/Socket_2_1.cs
+System.Net.Sockets/SocketAsyncCallback.cs
 System.Net.Sockets/SocketAsyncEventArgs.cs
 System.Net.Sockets/SocketAsyncOperation.cs
+System.Net.Sockets/SocketAsyncResult.cs
+System.Net.Sockets/SocketAsyncWorker.cs
 System.Net.Sockets/SocketError.cs
 System.Net.Sockets/SocketException.cs
 System.Net.Sockets/SocketFlags.cs
 System.Net.Sockets/SocketInformation.cs
 System.Net.Sockets/SocketInformationOptions.cs
+System.Net.Sockets/SocketOperation.cs
 System.Net.Sockets/SocketOptionLevel.cs
 System.Net.Sockets/SocketOptionName.cs
 System.Net.Sockets/SocketShutdown.cs
@@ -647,7 +562,6 @@ System.Security.Permissions/StorePermission.cs
 System.Security.Permissions/StorePermissionFlags.cs
 System/SRDescriptionAttribute.cs
 System.Threading/Semaphore.cs
-System.Threading/SemaphoreFullException.cs
 System.Threading/ThreadExceptionEventArgs.cs
 System.Threading/ThreadExceptionEventHandler.cs
 System.Timers/ElapsedEventArgs.cs
@@ -1119,3 +1033,91 @@ ReferenceSources/MonoSocketRuntimeWorkItem.cs
 ../../../external/referencesource/System/misc/invariantcomparer.cs
 ../../../external/referencesource/System/misc/SecurityUtils.cs
 ../../../external/referencesource/System/misc/WeakHashtable.cs
+
+../../../external/referencesource/System/compmod/system/codedom/CodeArgumentReferenceExpression.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeArrayCreateExpression.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeArrayIndexerExpression.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeAssignStatement.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeAttachEventStatement.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeAttributeArgumentCollection.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeAttributeArgument.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeAttributeDeclarationCollection.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeAttributeDeclaration.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeBaseReferenceExpression.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeBinaryOperatorExpression.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeBinaryOperatorType.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeCastExpression.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeCatchClauseCollection.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeCatchClause.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeChecksumPragma.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeComment.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeCommentStatementCollection.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeCommentStatement.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeCompileUnit.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeConditionStatement.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeConstructor.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeDefaultValueExpression.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeDelegateCreateExpression.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeDelegateInvokeExpression.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeDirectionExpression.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeDirectiveCollection.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeDirective.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeEntryPointMethod.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeEventReferenceExpression.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeExpressionCollection.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeExpression.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeExpressionStatement.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeFieldReferenceExpression.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeGotoStatement.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeIndexerExpression.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeIterationStatement.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeLabeledStatement.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeLinePragma.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeMemberEvent.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeMemberField.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeMemberMethod.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeMemberProperty.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeMethodInvokeExpression.cs
+../../../external/referencesource/System/compmod/system/codedom/codemethodreferenceexpression.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeMethodReturnStatement.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeNamespaceCollection.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeNamespace.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeNamespaceImportCollection.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeNamespaceImport.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeObjectCreateExpression.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeObject.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeParameterDeclarationExpressionCollection.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeParameterDeclarationExpression.cs
+../../../external/referencesource/System/compmod/system/codedom/CodePrimitiveExpression.cs
+../../../external/referencesource/System/compmod/system/codedom/CodePropertyReferenceExpression.cs
+../../../external/referencesource/System/compmod/system/codedom/CodePropertySetValueReferenceExpression.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeRegionDirective.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeRegionMode.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeRemoveEventStatement.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeSnippetCompileUnit.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeSnippetExpression.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeSnippetStatement.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeSnippetTypeMember.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeStatementCollection.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeStatement.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeThisReferenceExpression.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeThrowExceptionStatement.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeTryCatchFinallyStatement.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeTypeConstructor.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeTypeDeclarationCollection.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeTypeDeclaration.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeTypeDelegate.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeTypeMemberCollection.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeTypeMember.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeTypeOfExpression.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeTypeParameterCollection.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeTypeParameter.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeTypeReferenceCollection.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeTypeReference.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeTypeReferenceExpression.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeVariableDeclarationStatement.cs
+../../../external/referencesource/System/compmod/system/codedom/CodeVariableReferenceExpression.cs
+../../../external/referencesource/System/compmod/system/codedom/FieldDirection.cs
+../../../external/referencesource/System/compmod/system/codedom/MemberAttributes.cs
+../../../external/referencesource/System/compmod/system/codedom/compiler/CodeGenerator.cs
+../../../external/referencesource/System/compmod/system/codedom/compiler/CodeValidator.cs
index eab294b3f8f00fb84b3caf15d1acf4b4c1246a71..a1417e99527c0bd59f0befff9246110310ab4080 100644 (file)
@@ -233,6 +233,11 @@ namespace System {
                                        success = false;
                                        break;
                                }
+
+                               if (success && host.Length > 1 && host [0] != '[' && host [host.Length - 1] != ']') {
+                                       // host name present (but not an IPv6 address)
+                                       host = host.ToLower (CultureInfo.InvariantCulture);
+                               }
                        }
                }
 
@@ -1132,9 +1137,6 @@ namespace System {
                {
                        Parse (kind, source);
 
-                       if (userEscaped)
-                               return;
-
                        if (host.Length > 1 && host [0] != '[' && host [host.Length - 1] != ']') {
                                // host name present (but not an IPv6 address)
                                host = host.ToLower (CultureInfo.InvariantCulture);
index b88e1c17cdf8b655345db36699241c8304786ec4..c6ccdf0a26ab1e81b475f0a646aaf63296196b3e 100644 (file)
@@ -39,6 +39,7 @@ namespace MonoTests.System.CodeDom.Compiler
        [TestFixture]
        public class CodeGeneratorGenerateFromCompileUnitTest {
                [Test]
+               [Ignore ("This test is wrong; on .NET, ATTRIBUTE is not written and this attributePosition is always < 0.")]
                public void When_Having_AssemblyAttribute_And_Using_Namespace_It_Should_Generate_Namespace_First_And_Attribute_Afterwards () {
                        ICodeGenerator generator = new SampleCodeGenerator ();
                        var compileUnit = ACompileUnitWithAttributeAndNamespace ();
index 3a82c4258faa17a4adf9cc27e5a6e89c3799402d..b286100b932504342602c79ed75073df342023dc 100644 (file)
@@ -52,6 +52,15 @@ namespace MonoTests.System.Diagnostics
                        }
                }
 
+               [Test] // Covers #26363
+               public void GetProcesses_StartTime ()
+               {
+                       foreach (var p in Process.GetProcesses ()) {
+                               if (!p.HasExited && p.StartTime.Year < 1800)
+                                       Assert.Fail ("Process should not be started since the 18th century.");
+                       }
+               }
+
                [Test]
                public void PriorityClass_NotStarted ()
                {
index 984d13ca93de28c245cd461b52af78092442f3c7..f3cefe8c1513aebc1e7095aad330388f7d960011 100644 (file)
@@ -99,7 +99,7 @@ namespace MonoTests.System.IO.Compression
                        MemoryStream backing = new MemoryStream (data);
                        DeflateStream compressing = new DeflateStream (backing, CompressionMode.Decompress);
                        compressing.Read (dummy, 0, 1);
-               }               
+               }
 
                [Test]
                [ExpectedException (typeof (ArgumentNullException))]
@@ -362,6 +362,41 @@ namespace MonoTests.System.IO.Compression
                        backing.Close();
                }
 #endif 
+
+               [Test]
+               [ExpectedException (typeof (ArgumentException))]
+               public void CheckBufferOverrun ()
+               {
+                       byte[] data = new byte [20];
+                       MemoryStream backing = new MemoryStream ();
+                       DeflateStream compressing = new DeflateStream (backing, CompressionLevel.Fastest, true);
+                       compressing.Write (data, 0, data.Length + 1);
+                       compressing.Close ();
+                       backing.Close ();
+               }
+
+               [Test]
+               public void Bug28777_EmptyFlush ()
+               {
+                       MemoryStream backing = new MemoryStream ();
+                       DeflateStream compressing = new DeflateStream (backing, CompressionLevel.Fastest, true);
+                       compressing.Flush ();
+                       compressing.Close ();
+                       backing.Close ();
+               }
+               
+               [Test]
+               public void Bug28777_DoubleFlush ()
+               {
+                       byte[] buffer = new byte [4096];
+                       MemoryStream backing = new MemoryStream ();
+                       DeflateStream compressing = new DeflateStream (backing, CompressionLevel.Fastest, true);
+                       compressing.Write (buffer, 0, buffer.Length);
+                       compressing.Flush ();
+                       compressing.Flush ();
+                       compressing.Close ();
+                       backing.Close ();
+               }
        }
 }
 
index 697830b3fd848d3d5f96b48aab738910621cfffe..cfe2bb092e2aa14e368c40c948f158fec4b15a0c 100755 (executable)
@@ -3156,7 +3156,7 @@ namespace MonoTests.System.Net.Sockets
 
                        EndPoint remoteEP = new IPEndPoint (IPAddress.Loopback, 8001);
                        try {
-                               s.ReceiveFrom ((Byte []) null, -1, (SocketFlags) 666,
+                               s.ReceiveFrom ((Byte []) null, 0, (SocketFlags) 666,
                                        ref remoteEP);
                                Assert.Fail ("#1");
                        } catch (ArgumentNullException ex) {
@@ -3178,7 +3178,7 @@ namespace MonoTests.System.Net.Sockets
                        byte [] buffer = new byte [5];
                        EndPoint remoteEP = null;
                        try {
-                               s.ReceiveFrom (buffer, -1, (SocketFlags) 666, ref remoteEP);
+                               s.ReceiveFrom (buffer, buffer.Length, (SocketFlags) 666, ref remoteEP);
                                Assert.Fail ("#1");
                        } catch (ArgumentNullException ex) {
                                Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2");
@@ -3322,7 +3322,7 @@ namespace MonoTests.System.Net.Sockets
                        EndPoint remoteEP = null;
 
                        try {
-                               s.ReceiveFrom (buffer, -1, -1, (SocketFlags) 666, ref remoteEP);
+                               s.ReceiveFrom (buffer, 0, buffer.Length, (SocketFlags) 666, ref remoteEP);
                                Assert.Fail ("#1");
                        } catch (ArgumentNullException ex) {
                                Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2");
index 0300aad9d579b981a08d5b90585e0249b3a3f296..7ff8924d0daaed4c9091dbdcbba456fa6b3a0323 100644 (file)
@@ -184,6 +184,12 @@ namespace MonoTests.System
 
                        Assert.IsTrue (Uri.TryCreate ("http://mono-project.com/☕", UriKind.Absolute, out uri), "highunicode-Absolute");
                        Assert.AreEqual("http://mono-project.com/%E2%98%95", uri.AbsoluteUri, "highunicode-Absolute-AbsoluteUri");
+
+                       string mixedCaseUri = "http://mOnO-proJECT.com";
+                       uri = new Uri (mixedCaseUri);
+                       Uri uri2;
+                       Assert.IsTrue (Uri.TryCreate (mixedCaseUri, UriKind.Absolute, out uri2), "mixedcasehost-absolute");
+                       Assert.AreEqual (uri.AbsoluteUri, uri2.AbsoluteUri, "mixedcasehost-absoluteuri-absoluteuri");
                }
 
                [Test] // TryCreate (String, UriKind, Uri)
index 6f061db7e6ec34020c25aea892383c7d9f0b8b0a..28b642e7c237039002576f8b3b3717d3b2da3191 100644 (file)
@@ -129,18 +129,21 @@ System.Net.Sockets/SafeSocketHandle.cs
 System.Net.Sockets/SelectMode.cs
 System.Net.Sockets/SendPacketsElement.cs
 System.Net.Sockets/Socket.cs
+System.Net.Sockets/SocketAsyncCallback.cs
 System.Net.Sockets/SocketAsyncEventArgs.cs
 System.Net.Sockets/SocketAsyncOperation.cs
+System.Net.Sockets/SocketAsyncResult.cs
+System.Net.Sockets/SocketAsyncWorker.cs
 System.Net.Sockets/SocketError.cs
 System.Net.Sockets/SocketException.cs
 System.Net.Sockets/SocketFlags.cs
 System.Net.Sockets/SocketInformation.cs
 System.Net.Sockets/SocketInformationOptions.cs
+System.Net.Sockets/SocketOperation.cs
 System.Net.Sockets/SocketOptionLevel.cs
 System.Net.Sockets/SocketOptionName.cs
 System.Net.Sockets/SocketShutdown.cs
 System.Net.Sockets/SocketType.cs
-System.Net.Sockets/Socket_2_1.cs
 System.Net.Sockets/TcpClient.cs
 System.Net.Sockets/TcpListener.cs
 System.Net.Sockets/TransmitFileOptions.cs
@@ -314,7 +317,6 @@ System.Security.Cryptography/Oid.cs
 System.Security.Cryptography/OidCollection.cs
 System.Security.Cryptography/OidEnumerator.cs
 System.Threading/Semaphore.cs
-System.Threading/SemaphoreFullException.cs
 System.Threading/ThreadExceptionEventArgs.cs
 System.Threading/ThreadExceptionEventHandler.cs
 System.Timers/ElapsedEventArgs.cs
index 4325ba3dcbcb505f324641b255d438e279e4c781..a83741386d1022c3daf27e2c1b59b1d0c241e1c5 100644 (file)
@@ -70,7 +70,6 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyFileVersion (Consts.FxFileVersion)]
 [assembly: ComVisible (false)]
 [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)]
-[assembly: TypeLibVersion (2, 4)]
 [assembly: DefaultDependency (LoadHint.Always)]
 [assembly: StringFreezing]
 
index 05283f88bcffa8d649072360786e3b224b9586f1..18fc4255baecbd2d598a3a414a0660748f5e01b6 100644 (file)
@@ -36,12 +36,12 @@ RESOURCE_FILES = \
        resources/collation.cjkKO.bin \
        resources/collation.cjkKOlv2.bin
 
-REFERENCE_SOURCES_FLAGS = -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION
+REFERENCE_SOURCES_FLAGS = -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION
 
 MOBILE_STATIC := $(filter mobile_static monotouch monotouch_runtime, $(PROFILE))
 
 ifndef MOBILE_STATIC
-REFERENCE_SOURCES_FLAGS += -d:FEATURE_REMOTING,MONO_COM,FEATURE_USE_LCID
+REFERENCE_SOURCES_FLAGS += -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP
 endif
 
 LOCAL_MCS_FLAGS = -unsafe -nostdlib -nowarn:612,618 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC $(REFERENCE_SOURCES_FLAGS)
diff --git a/mcs/class/corlib/Microsoft.Win32.SafeHandles/ChangeLog b/mcs/class/corlib/Microsoft.Win32.SafeHandles/ChangeLog
deleted file mode 100644 (file)
index 728d1d1..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-2008-01-15  Zoltan Varga  <vargaz@gmail.com>
-
-       * SafeWaitHandle.cs: Fix some argument names to be consistent with MS.
-
-2007-07-18  Miguel de Icaza  <miguel@novell.com>
-
-       * SafeWaitHandle.cs: Do not call DangerousGetHandle here as it
-       throws ObjectDisposedException when the refcount reaches zero. 
-
-       * SafeFileHandle.cs: Same.
-
-2007-05-12  Jonathan Chambers  <joncham@gmail.com>
-
-       * SafeWaitHandle.cs: Add internal empty
-       constructor for pinvoke marshalling.
-
-2007-04-30  Dick Porter  <dick@ximian.com>
-
-       * CriticalHandleZeroOrMinusOneIsInvalid.cs: 
-       * CriticalHandleMinusOneIsInvalid.cs: 
-       * SafeWaitHandle.cs: 
-       * SafeHandleZeroOrMinusOneIsInvalid.cs: 
-       * SafeHandleMinusOneIsInvalid.cs: Added ReliabilityContract
-       attributes to complete 2.0 profile
-
-2007-01-13  Miguel de Icaza  <miguel@novell.com>
-
-       * Add a few more missing helper classes.
-
-2006-12-11  Miguel de Icaza  <miguel@novell.com>
-
-       * SafeWaitHandle.cs: Add new.
-
-2006-12-10  Miguel de Icaza  <miguel@novell.com>
-
-       * SafeFileHandle.cs: Implement this one.
-
-2006-12-02  Miguel de Icaza  <miguel@novell.com>
-
-       * SafeFileHandle.cs: Remove the IsInvalid method, as that is
-       present in the base class.
-
-2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
-
-       * SafeHandleZeroOrMinusOneIsInvalid.cs: Update to RTM api
-
-       * SafeFileHandle.cs: Update to RTM api
-
-2005-08-10  Zoltan Varga  <vargaz@freemail.hu>
-
-       * SafeFileHandle.cs: Make this inherit from SafeHandleZeroOrMinusOneIsInvalid.
-
-       * SafeHandleZeroOrMinusOneIsInvalid.cs: New file.
-
-2005-01-31  Sebastien Pouliot  <sebastien@ximian.com>
-
-       * SafeFileHandle.cs: Class declaration to allow compiling System.IO
-       and System.IO.IsolatedStorage for the NET_2_0 profile.
diff --git a/mcs/class/corlib/Microsoft.Win32.SafeHandles/CriticalHandleMinusOneIsInvalid.cs b/mcs/class/corlib/Microsoft.Win32.SafeHandles/CriticalHandleMinusOneIsInvalid.cs
deleted file mode 100644 (file)
index 7884221..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// Microsoft.Win32.SafeHandles.CriticalHandleMinusOneIsInvalid
-//
-// Author
-//      Zoltan Varga (vargaz@gmail.com)
-//       Miguel de Icaza (miguel@novell.com)
-//
-// Copyright (C) 2005, 2006 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Runtime.InteropServices;
-using System.Runtime.ConstrainedExecution;
-
-namespace Microsoft.Win32.SafeHandles {
-
-       public abstract class CriticalHandleMinusOneIsInvalid : CriticalHandle, IDisposable {
-               [ReliabilityContract (Consistency.WillNotCorruptState, Cer.MayFail)]
-               protected CriticalHandleMinusOneIsInvalid () : base ((IntPtr) (-1)) {
-               }
-
-               public override bool IsInvalid {
-                       get {
-                               return handle == (IntPtr)(-1);
-                       }
-               }
-       }
-}
-
diff --git a/mcs/class/corlib/Microsoft.Win32.SafeHandles/CriticalHandleZeroOrMinusOneIsInvalid.cs b/mcs/class/corlib/Microsoft.Win32.SafeHandles/CriticalHandleZeroOrMinusOneIsInvalid.cs
deleted file mode 100644 (file)
index 214611e..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// Microsoft.Win32.SafeHandles.CriticalHandleZeroOrMinusOneIsInvalid
-//
-// Author
-//      Zoltan Varga (vargaz@gmail.com)
-//       Miguel de Icaza (miguel@novell.com)
-//
-// Copyright (C) 2005, 2006 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Runtime.InteropServices;
-using System.Runtime.ConstrainedExecution;
-
-namespace Microsoft.Win32.SafeHandles {
-
-       public abstract class CriticalHandleZeroOrMinusOneIsInvalid : CriticalHandle, IDisposable {
-               [ReliabilityContract (Consistency.WillNotCorruptState, Cer.MayFail)]
-               protected CriticalHandleZeroOrMinusOneIsInvalid () : base ((IntPtr) (-1)) {
-               }
-
-               public override bool IsInvalid {
-                       get {
-                               return handle == (IntPtr)(-1) || handle == IntPtr.Zero;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/corlib/Microsoft.Win32.SafeHandles/SafeFileHandle.cs b/mcs/class/corlib/Microsoft.Win32.SafeHandles/SafeFileHandle.cs
deleted file mode 100644 (file)
index 3f6da35..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// Microsoft.Win32.SafeHandles.SafeFileHandle
-//
-// Authors:
-//     Sebastien Pouliot  <sebastien@ximian.com>
-//      Miguel de Icaza    <miguel@novell.com>
-//
-// Copyright (C) 2005, 2006 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-
-namespace Microsoft.Win32.SafeHandles {
-
-       public sealed class SafeFileHandle : SafeHandleZeroOrMinusOneIsInvalid {
-               public SafeFileHandle (IntPtr preexistingHandle, bool ownsHandle) : base (ownsHandle)
-               {
-                       SetHandle (preexistingHandle);
-               }
-
-               // This is just for marshalling
-               internal SafeFileHandle () : base (true)
-               {
-               }
-
-               protected override bool ReleaseHandle ()
-               {
-                       MonoIOError error;
-                       
-                       MonoIO.Close (handle, out error);
-
-                       return error == MonoIOError.ERROR_SUCCESS;
-               }
-
-       }
-}
-
diff --git a/mcs/class/corlib/Microsoft.Win32.SafeHandles/SafeHandleMinusOneIsInvalid.cs b/mcs/class/corlib/Microsoft.Win32.SafeHandles/SafeHandleMinusOneIsInvalid.cs
deleted file mode 100644 (file)
index 8a0cb90..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// Microsoft.Win32.SafeHandles.SafeHandleMinusOneIsInvalid
-//
-// Author
-//      Zoltan Varga (vargaz@gmail.com)
-//       Miguel de Icaza (miguel@novell.com)
-//
-// Copyright (C) 2005, 2006 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Runtime.InteropServices;
-using System.Runtime.ConstrainedExecution;
-
-namespace Microsoft.Win32.SafeHandles {
-
-       public abstract class SafeHandleMinusOneIsInvalid : SafeHandle, IDisposable {
-               [ReliabilityContract (Consistency.WillNotCorruptState, Cer.MayFail)]
-               protected SafeHandleMinusOneIsInvalid (bool ownsHandle) : base ((IntPtr) 0, ownsHandle) {
-               }
-
-               public override bool IsInvalid {
-                       get {
-                               return handle == (IntPtr)(-1);
-                       }
-               }
-       }
-}
diff --git a/mcs/class/corlib/Microsoft.Win32.SafeHandles/SafeHandleZeroOrMinusOneIsInvalid.cs b/mcs/class/corlib/Microsoft.Win32.SafeHandles/SafeHandleZeroOrMinusOneIsInvalid.cs
deleted file mode 100644 (file)
index 24c7a5f..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid
-//
-// Author
-//      Zoltan Varga (vargaz@gmail.com)
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Runtime.InteropServices;
-using System.Runtime.ConstrainedExecution;
-
-namespace Microsoft.Win32.SafeHandles {
-
-       public abstract class SafeHandleZeroOrMinusOneIsInvalid : SafeHandle, IDisposable {
-               [ReliabilityContract (Consistency.WillNotCorruptState, Cer.MayFail)]
-               protected SafeHandleZeroOrMinusOneIsInvalid (bool ownsHandle) : base ((IntPtr) 0, ownsHandle) {
-               }
-
-               public override bool IsInvalid {
-                       get {
-                               return handle == (IntPtr)(-1) || handle == (IntPtr) 0;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/corlib/Microsoft.Win32.SafeHandles/SafeRegistryHandle.cs b/mcs/class/corlib/Microsoft.Win32.SafeHandles/SafeRegistryHandle.cs
deleted file mode 100644 (file)
index e83eddc..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// Microsoft.Win32.SafeHandles.SafeRegistryHandle
-//
-// Author
-//       Gonzalo Paniagua Javier (gonzalo@novell.com)
-//
-// Copyright (C) 2010 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using System.Runtime.InteropServices;
-using System.Runtime.ConstrainedExecution;
-
-namespace Microsoft.Win32.SafeHandles {
-
-       public sealed class SafeRegistryHandle : SafeHandleZeroOrMinusOneIsInvalid, IDisposable {
-               public SafeRegistryHandle (IntPtr preexistingHandle, bool ownsHandle) : base (ownsHandle)
-               {
-                       handle = preexistingHandle;     
-               }
-
-               protected override bool ReleaseHandle ()
-               {
-                       // Need to release an unmanaged pointer *only* in Windows.
-                       if (Path.DirectorySeparatorChar == '\\')
-                               return RegCloseKey (handle) == 0;
-
-                       return true;
-               }
-
-               [DllImport ("advapi32.dll", CharSet = CharSet.Unicode, EntryPoint="RegCloseKey")]
-               static extern int RegCloseKey (IntPtr keyHandle);
-       }
-}
-
diff --git a/mcs/class/corlib/Microsoft.Win32.SafeHandles/SafeWaitHandle.cs b/mcs/class/corlib/Microsoft.Win32.SafeHandles/SafeWaitHandle.cs
deleted file mode 100644 (file)
index c6f4df5..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// Microsoft.Win32.SafeHandles.SafeWaitHandle
-//
-// Author:
-//     Sebastien Pouliot  <sebastien@ximian.com>
-//      Miguel de Icaza    <miguel@novell.com>
-//
-// Copyright (C) 2005, 2006 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using System.Threading;
-using System.Runtime.ConstrainedExecution;
-
-namespace Microsoft.Win32.SafeHandles {
-
-       public sealed class SafeWaitHandle : SafeHandleZeroOrMinusOneIsInvalid {
-               [ReliabilityContract (Consistency.WillNotCorruptState, Cer.MayFail)]
-               public SafeWaitHandle (IntPtr existingHandle, bool ownsHandle) : base (ownsHandle)
-               {
-                       SetHandle (existingHandle);
-               }
-
-               protected override bool ReleaseHandle ()
-               {
-                       NativeEventCalls.CloseEvent_internal (handle);
-                       return true;
-               }
-
-       }
-}
diff --git a/mcs/class/corlib/ReferenceSources/Buffer.cs b/mcs/class/corlib/ReferenceSources/Buffer.cs
new file mode 100644 (file)
index 0000000..94b3a95
--- /dev/null
@@ -0,0 +1,176 @@
+namespace System
+{
+       partial class Buffer
+       {
+               public static int ByteLength (Array array)
+               {
+                       // note: the other methods in this class also use ByteLength to test for
+                       // null and non-primitive arguments as a side-effect.
+
+                       if (array == null)
+                               throw new ArgumentNullException ("array");
+
+                       int length = _ByteLength (array);
+                       if (length < 0)
+                               throw new ArgumentException (Locale.GetText ("Object must be an array of primitives."));
+
+                       return length;
+               }
+
+               public static byte GetByte (Array array, int index)
+               {
+                       if (index < 0 || index >= ByteLength (array))
+                               throw new ArgumentOutOfRangeException ("index");
+
+                       return _GetByte (array, index);
+               }
+
+               public static void SetByte (Array array, int index, byte value)
+               {
+                       if (index < 0 || index >= ByteLength (array))
+                               throw new ArgumentOutOfRangeException ("index");
+
+                       _SetByte (array, index, value);
+               }
+
+               public static void BlockCopy (Array src, int srcOffset, Array dst, int dstOffset, int count)
+               {
+                       if (src == null)
+                               throw new ArgumentNullException ("src");
+
+                       if (dst == null)
+                               throw new ArgumentNullException ("dst");
+
+                       if (srcOffset < 0)
+                               throw new ArgumentOutOfRangeException ("srcOffset", Locale.GetText(
+                                       "Non-negative number required."));
+
+                       if (dstOffset < 0)
+                               throw new ArgumentOutOfRangeException ("dstOffset", Locale.GetText (
+                                       "Non-negative number required."));
+
+                       if (count < 0)
+                               throw new ArgumentOutOfRangeException ("count", Locale.GetText (
+                                       "Non-negative number required."));
+
+                       // We do the checks in unmanaged code for performance reasons
+                       bool res = InternalBlockCopy (src, srcOffset, dst, dstOffset, count);
+                       if (!res) {
+                               // watch for integer overflow
+                               if ((srcOffset > ByteLength (src) - count) || (dstOffset > ByteLength (dst) - count))
+                                       throw new ArgumentException (Locale.GetText (
+                                               "Offset and length were out of bounds for the array or count is greater than " + 
+                                               "the number of elements from index to the end of the source collection."));
+                       }
+               }
+
+               internal static unsafe void memcpy4 (byte *dest, byte *src, int size) {
+                       /*while (size >= 32) {
+                               // using long is better than int and slower than double
+                               // FIXME: enable this only on correct alignment or on platforms
+                               // that can tolerate unaligned reads/writes of doubles
+                               ((double*)dest) [0] = ((double*)src) [0];
+                               ((double*)dest) [1] = ((double*)src) [1];
+                               ((double*)dest) [2] = ((double*)src) [2];
+                               ((double*)dest) [3] = ((double*)src) [3];
+                               dest += 32;
+                               src += 32;
+                               size -= 32;
+                       }*/
+                       while (size >= 16) {
+                               ((int*)dest) [0] = ((int*)src) [0];
+                               ((int*)dest) [1] = ((int*)src) [1];
+                               ((int*)dest) [2] = ((int*)src) [2];
+                               ((int*)dest) [3] = ((int*)src) [3];
+                               dest += 16;
+                               src += 16;
+                               size -= 16;
+                       }
+                       while (size >= 4) {
+                               ((int*)dest) [0] = ((int*)src) [0];
+                               dest += 4;
+                               src += 4;
+                               size -= 4;
+                       }
+                       while (size > 0) {
+                               ((byte*)dest) [0] = ((byte*)src) [0];
+                               dest += 1;
+                               src += 1;
+                               --size;
+                       }
+               }
+               internal static unsafe void memcpy2 (byte *dest, byte *src, int size) {
+                       while (size >= 8) {
+                               ((short*)dest) [0] = ((short*)src) [0];
+                               ((short*)dest) [1] = ((short*)src) [1];
+                               ((short*)dest) [2] = ((short*)src) [2];
+                               ((short*)dest) [3] = ((short*)src) [3];
+                               dest += 8;
+                               src += 8;
+                               size -= 8;
+                       }
+                       while (size >= 2) {
+                               ((short*)dest) [0] = ((short*)src) [0];
+                               dest += 2;
+                               src += 2;
+                               size -= 2;
+                       }
+                       if (size > 0)
+                               ((byte*)dest) [0] = ((byte*)src) [0];
+               }
+               static unsafe void memcpy1 (byte *dest, byte *src, int size) {
+                       while (size >= 8) {
+                               ((byte*)dest) [0] = ((byte*)src) [0];
+                               ((byte*)dest) [1] = ((byte*)src) [1];
+                               ((byte*)dest) [2] = ((byte*)src) [2];
+                               ((byte*)dest) [3] = ((byte*)src) [3];
+                               ((byte*)dest) [4] = ((byte*)src) [4];
+                               ((byte*)dest) [5] = ((byte*)src) [5];
+                               ((byte*)dest) [6] = ((byte*)src) [6];
+                               ((byte*)dest) [7] = ((byte*)src) [7];
+                               dest += 8;
+                               src += 8;
+                               size -= 8;
+                       }
+                       while (size >= 2) {
+                               ((byte*)dest) [0] = ((byte*)src) [0];
+                               ((byte*)dest) [1] = ((byte*)src) [1];
+                               dest += 2;
+                               src += 2;
+                               size -= 2;
+                       }
+                       if (size > 0)
+                               ((byte*)dest) [0] = ((byte*)src) [0];
+               }
+
+               internal static unsafe void Memcpy (byte *dest, byte *src, int size) {
+                       // FIXME: if pointers are not aligned, try to align them
+                       // so a faster routine can be used. Handle the case where
+                       // the pointers can't be reduced to have the same alignment
+                       // (just ignore the issue on x86?)
+                       if ((((int)dest | (int)src) & 3) != 0) {
+                               if (((int)dest & 1) != 0 && ((int)src & 1) != 0 && size >= 1) {
+                                       dest [0] = src [0];
+                                       ++dest;
+                                       ++src;
+                                       --size;
+                               }
+                               if (((int)dest & 2) != 0 && ((int)src & 2) != 0 && size >= 2) {
+                                       ((short*)dest) [0] = ((short*)src) [0];
+                                       dest += 2;
+                                       src += 2;
+                                       size -= 2;
+                               }
+                               if ((((int)dest | (int)src) & 1) != 0) {
+                                       memcpy1 (dest, src, size);
+                                       return;
+                               }
+                               if ((((int)dest | (int)src) & 2) != 0) {
+                                       memcpy2 (dest, src, size);
+                                       return;
+                               }
+                       }
+                       memcpy4 (dest, src, size);
+               }
+       }
+}
\ No newline at end of file
index 6e69b7c58257bf0e7913c7c6dbe96966803d8832..a0d79238e732dfae4fe248537b30b9fdbef826ae 100644 (file)
@@ -67,6 +67,13 @@ namespace System.Globalization
 
                int numberIndex;
 
+               int iDefaultAnsiCodePage;
+               int iDefaultOemCodePage;
+               int iDefaultMacCodePage;
+               int iDefaultEbcdicCodePage;
+               bool isRightToLeft;
+               string sListSeparator;
+
                private CultureData (string name)
                {
                        this.sRealName = name;
@@ -97,6 +104,13 @@ namespace System.Globalization
                                        // Store for specific data about each calendar
                                invariant.calendars = new CalendarData[CalendarData.MAX_CALENDARS];
                                invariant.calendars[0] = CalendarData.Invariant;
+
+                                       invariant.iDefaultAnsiCodePage = 1252;                   // default ansi code page ID (ACP)
+                                       invariant.iDefaultOemCodePage = 437;                    // default oem code page ID (OCP or OEM)
+                                       invariant.iDefaultMacCodePage = 10000;                  // default macintosh code page
+                                       invariant.iDefaultEbcdicCodePage = 037;                    // default EBCDIC code page
+
+                                       invariant.sListSeparator = ",";
                                        
                                        Interlocked.CompareExchange (ref s_Invariant, invariant, null);
                                }
@@ -115,7 +129,8 @@ namespace System.Globalization
                        }
                }
 
-               public static CultureData GetCultureData (string cultureName, bool useUserOverride, int datetimeIndex, int calendarId, int numberIndex, string iso2lang)
+               public static CultureData GetCultureData (string cultureName, bool useUserOverride, int datetimeIndex, int calendarId, int numberIndex, string iso2lang,
+                       int ansiCodePage, int oemCodePage, int macCodePage, int ebcdicCodePage, bool rightToLeft, string listSeparator)
                {
                        if (string.IsNullOrEmpty (cultureName))
                                return Invariant;
@@ -126,6 +141,12 @@ namespace System.Globalization
                        cd.calendarId = calendarId;
                        cd.numberIndex = numberIndex;
                        cd.sISO639Language = iso2lang;
+                       cd.iDefaultAnsiCodePage = ansiCodePage;
+                       cd.iDefaultOemCodePage = oemCodePage;
+                       cd.iDefaultMacCodePage = macCodePage;
+                       cd.iDefaultEbcdicCodePage = ebcdicCodePage;
+                       cd.isRightToLeft = rightToLeft;
+                       cd.sListSeparator = listSeparator;
                        return cd;
                }
 
@@ -240,11 +261,17 @@ namespace System.Globalization
                        }
                }
 
-        internal String SCOMPAREINFO {
-               get {
-                       return "";
+               internal String SCOMPAREINFO {
+                       get {
+                               return "";
+                       }
+               }
+
+               internal String STEXTINFO {
+                       get {
+                               return sRealName;
+                       }
                }
-       }
 
                internal int ILANGUAGE {
                        get {
@@ -252,6 +279,42 @@ namespace System.Globalization
                        }
                }
 
+               internal int IDEFAULTANSICODEPAGE {
+                       get {
+                               return iDefaultAnsiCodePage;
+                       }
+               }
+
+               internal int IDEFAULTOEMCODEPAGE {
+                       get {
+                               return iDefaultOemCodePage;
+                       }
+               }
+
+               internal int IDEFAULTMACCODEPAGE {
+                       get {
+                               return iDefaultMacCodePage;
+                       }
+               }
+
+               internal int IDEFAULTEBCDICCODEPAGE {
+                       get {
+                               return iDefaultEbcdicCodePage;
+                       }
+               }
+
+               internal bool IsRightToLeft {
+                       get {
+                               return isRightToLeft;
+                       }
+               }
+
+               internal String SLIST {
+                       get {
+                               return sListSeparator;
+                       }
+               }
+
 #region from reference sources
 
         // Are overrides enabled?
index afdf9315a473de132cfac18ac90ea5d9ac96930c..92057e9b5c31c9fa7225878a8f301a8532706f45 100644 (file)
@@ -38,5 +38,11 @@ namespace System
                        default: return codePage.ToString (CultureInfo.InvariantCulture);
                        }
                }
+
+               internal static bool IsWindows8OrAbove {
+                       get {
+                               return false;
+                       }
+               }
        }
 }
\ No newline at end of file
index 05c4d716cc118fafadbf26fdb732f3b1adee7af7..d5d822fdb00e9c4ddcd788046f1b0918b3aa5409 100644 (file)
@@ -6,7 +6,17 @@ namespace System.Runtime.CompilerServices {
        {
                static internal T UnsafeCast<T>(Object o) where T : class
                {
-                       return (T)o;
+                       return Array.UnsafeMov<object, T> (o);
+               }
+
+               static internal int UnsafeEnumCast<T>(T val) where T : struct
+               {
+                       return Array.UnsafeMov<T, int> (val);
+               }
+
+               static internal long UnsafeEnumCastLong<T>(T val) where T : struct
+               {
+                       throw new NotImplementedException ();
                }
        }
 }
\ No newline at end of file
index b6b73bea8179ff708eecdfdb69b00cc9a85365ff..c87ea8f0860935c6a89c82a73368cb2dda6d5f73 100644 (file)
@@ -168,6 +168,13 @@ namespace System {
                        }
                }
 
+               // Value from which a new base 16 digit can cause an overflow.
+               const ulong base16MaxOverflowFreeValue = ulong.MaxValue / (16 * 16);
+
+               // From ulong we can only cast to positive long.
+               // As |long.MinValue| > |long.MaxValue| we need to do this to avoid an overflow.
+               const ulong longMinValue = ((ulong) long.MaxValue) + (ulong) -(long.MinValue + long.MaxValue);
+
                public unsafe static long StringToLong (string value, int fromBase, int flags, int* parsePos)
                {
                        if ((flags & (IsTight | NoSpace)) == 0)
@@ -177,11 +184,13 @@ namespace System {
                                return 0;
 
                        int chars = 0;
-                       int digitValue = -1;
-                       long result = 0;
+                       ulong fromBaseULong = (ulong) fromBase;
+                       ulong digitValue = 0;
+                       ulong result = 0;
 
                        int len = value.Length;
                        bool negative = false;
+                       bool treatAsUnsigned = (flags & ParseNumbers.TreatAsUnsigned) != 0;
 
                        if (len == 0) {
                                // Mimic broken .net behaviour
@@ -195,7 +204,7 @@ namespace System {
                                if (fromBase != 10)
                                        throw new ArgumentException ("String cannot contain a minus sign if the base is not 10.");
 
-                               if ((flags & TreatAsUnsigned) != 0)
+                               if (treatAsUnsigned)
                                        throw new OverflowException ("Negative number");
 
                                negative = true;
@@ -211,9 +220,9 @@ namespace System {
                        while (i < len) {
                                char c = value[i];
                                if (Char.IsNumber (c)) {
-                                       digitValue = c - '0';
+                                       digitValue = (ulong) (c - '0');
                                } else if (Char.IsLetter (c)) {
-                                       digitValue = Char.ToLowerInvariant (c) - 'a' + 10;
+                                       digitValue = (ulong) (Char.ToLowerInvariant (c) - 'a' + 10);
                                } else {
                                        if (i == 0)
                                                throw new FormatException ("Could not find any parsable digits.");
@@ -224,7 +233,7 @@ namespace System {
                                        break;
                                }
 
-                               if (digitValue >= fromBase) {
+                               if (digitValue >= fromBaseULong) {
                                        if (chars > 0) {
                                                throw new FormatException ("Additional unparsable "
                                                        + "characters are at the end of the string.");
@@ -234,7 +243,18 @@ namespace System {
                                        }
                                }
 
-                               result = fromBase * result + digitValue;
+                               if (result <= base16MaxOverflowFreeValue) {
+                                       result = result * (ulong) fromBaseULong + digitValue;
+                               } else {
+                                       // decompose 64 bit operation into 32 bit operations so we can check for overflows
+                                       ulong a = (result >> 32) * fromBaseULong;
+                                       ulong b = (result & uint.MaxValue) * fromBaseULong + digitValue;
+                                       if (((b >> 32) + a) > uint.MaxValue)
+                                               throw new OverflowException ();
+
+                                       result = (a << 32) + b;
+                               }
+
                                chars++;
                                ++i;
                        }
@@ -245,7 +265,24 @@ namespace System {
                        if (parsePos != null)
                                *parsePos = i;
 
-                       return negative ? -result : result;
+                       if (treatAsUnsigned)
+                               return (long) result;
+
+                       if (!negative) {
+                               if (fromBase == 10 && result > ((ulong) long.MaxValue))
+                                       throw new OverflowException ();
+
+                               return (long)result;
+                       }
+
+                       if (result <= (ulong) long.MaxValue)
+                               return -((long) result);
+
+                       if (result > longMinValue)
+                               throw new OverflowException ();
+
+                       // Avoids overflow of -result when result > long.MaxValue
+                       return long.MinValue + (long) (longMinValue - result);
                }
 
                public static string IntToString (int value, int toBase, int width, char paddingChar, int flags)
index 3557e77817c6b392af4e19cf509d4d6ee0219264..c8fae32d36363d570e0c0385504f5d21042fb400 100644 (file)
@@ -358,7 +358,7 @@ namespace System
 
                public override StructLayoutAttribute StructLayoutAttribute {
                        get {
-                               return GetStructLayoutAttribute ();
+                               return StructLayoutAttribute.GetCustomAttribute (this);
                        }
                }
 
@@ -394,42 +394,11 @@ namespace System
                        return constraints;
                }
 
-               public override Type MakeGenericType (params Type[] typeArguments)
+               internal static object CreateInstanceForAnotherGenericParameter (Type genericType, RuntimeType genericArgument)
                {
-                       if (IsUserType)
-                               throw new NotSupportedException ();
-                       if (!IsGenericTypeDefinition)
-                               throw new InvalidOperationException ("not a generic type definition");
-                       if (typeArguments == null)
-                               throw new ArgumentNullException ("typeArguments");
-                       if (GetGenericArguments().Length != typeArguments.Length)
-                               throw new ArgumentException (String.Format ("The type or method has {0} generic parameter(s) but {1} generic argument(s) where provided. A generic argument must be provided for each generic parameter.", GetGenericArguments ().Length, typeArguments.Length), "typeArguments");
-
-                       bool hasUserType = false;
-
-                       Type[] systemTypes = new Type[typeArguments.Length];
-                       for (int i = 0; i < typeArguments.Length; ++i) {
-                               Type t = typeArguments [i];
-                               if (t == null)
-                                       throw new ArgumentNullException ("typeArguments");
-
-                               if (!(t is MonoType))
-                                       hasUserType = true;
-                               systemTypes [i] = t;
-                       }
-
-                       if (hasUserType) {
-#if FULL_AOT_RUNTIME
-                               throw new NotSupportedException ("User types are not supported under full aot");
-#else
-                               return new MonoGenericClass (this, typeArguments);
-#endif
-                       }
-
-                       Type res = MakeGenericType (this, systemTypes);
-                       if (res == null)
-                               throw new TypeLoadException ();
-                       return res;
+                       var gt = (RuntimeType) MakeGenericType (genericType, new Type [] { genericArgument });
+                       var ctor = gt.GetDefaultConstructor ();
+                       return ctor.InternalInvoke (null, null);
                }
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
@@ -484,39 +453,8 @@ namespace System
                        }
                }
 
-               StructLayoutAttribute GetStructLayoutAttribute ()
-               {
-                       LayoutKind kind;
-
-                       if (IsLayoutSequential)
-                               kind = LayoutKind.Sequential;
-                       else if (IsExplicitLayout)
-                               kind = LayoutKind.Explicit;
-                       else
-                               kind = LayoutKind.Auto;
-
-                       StructLayoutAttribute attr = new StructLayoutAttribute (kind);
-
-                       if (IsUnicodeClass)
-                               attr.CharSet = CharSet.Unicode;
-                       else if (IsAnsiClass)
-                               attr.CharSet = CharSet.Ansi;
-                       else
-                               attr.CharSet = CharSet.Auto;
-
-                       if (kind != LayoutKind.Auto) {
-                               int packing;
-                               GetPacking (out packing, out attr.Size);
-                               // 0 means no data provided, we end up with default value
-                               if (packing != 0)
-                                       attr.Pack = packing;
-                       }
-
-                       return attr;
-               }
-
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               extern void GetPacking (out int packing, out int size);
+               internal extern void GetPacking (out int packing, out int size);
 
 #if MONO_COM
                private static Dictionary<Guid, Type> clsid_types;
@@ -612,7 +550,7 @@ namespace System
                internal extern string getFullName(bool full_name, bool assembly_qualified);
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               public extern override Type [] GetGenericArguments ();
+               extern Type[] GetGenericArgumentsInternal (bool runtimeArray);
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                extern GenericParameterAttributes GetGenericParameterAttributes ();
index d4cec69780f1227be6dc612888810dc2e92da8e6..635040127f8e02311aa33f2f5e1361802855b753 100644 (file)
@@ -365,7 +365,7 @@ namespace System
                        return tmp;
                }
 
-               public String ReplaceInternal (String oldValue, String newValue)
+               internal String ReplaceInternal (String oldValue, String newValue)
                {
                        // LAMESPEC: According to MSDN the following method is culture-sensitive but this seems to be incorrect
                        // LAMESPEC: Result is undefined if result Length is longer than maximum string Length
@@ -611,6 +611,44 @@ namespace System
                {
                        Buffer.Memcpy (dest, src, size);
                }
+
+               /* Used by the runtime */
+               internal static unsafe void bzero (byte *dest, int len) {
+                       memset (dest, 0, len);
+               }
+
+               internal static unsafe void bzero_aligned_1 (byte *dest, int len) {
+                       ((byte*)dest) [0] = 0;
+               }
+
+               internal static unsafe void bzero_aligned_2 (byte *dest, int len) {
+                       ((short*)dest) [0] = 0;
+               }
+
+               internal static unsafe void bzero_aligned_4 (byte *dest, int len) {
+                       ((int*)dest) [0] = 0;
+               }
+
+               internal static unsafe void bzero_aligned_8 (byte *dest, int len) {
+                       ((long*)dest) [0] = 0;
+               }
+
+               internal static unsafe void memcpy_aligned_1 (byte *dest, byte *src, int size) {
+                       ((byte*)dest) [0] = ((byte*)src) [0];
+               }
+
+               internal static unsafe void memcpy_aligned_2 (byte *dest, byte *src, int size) {
+                       ((short*)dest) [0] = ((short*)src) [0];
+               }
+
+               internal static unsafe void memcpy_aligned_4 (byte *dest, byte *src, int size) {
+                       ((int*)dest) [0] = ((int*)src) [0];
+               }
+
+               internal static unsafe void memcpy_aligned_8 (byte *dest, byte *src, int size) {
+                       ((long*)dest) [0] = ((long*)src) [0];
+               }
+
                #endregion
 
                // Certain constructors are redirected to CreateString methods with
diff --git a/mcs/class/corlib/ReferenceSources/TextInfo.cs b/mcs/class/corlib/ReferenceSources/TextInfo.cs
new file mode 100644 (file)
index 0000000..52bf3a1
--- /dev/null
@@ -0,0 +1,201 @@
+using System.Runtime.CompilerServices;
+
+namespace System.Globalization
+{
+       partial class TextInfo
+       {
+               unsafe static ushort *to_lower_data_low;
+               unsafe static ushort *to_lower_data_high;
+               unsafe static ushort *to_upper_data_low;
+               unsafe static ushort *to_upper_data_high;
+
+               [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
+               unsafe static extern void GetDataTablePointersLite (out ushort *to_lower_data_low, out ushort *to_lower_data_high, out ushort *to_upper_data_low, out ushort *to_upper_data_high);
+
+               static readonly object cookie = new object ();
+
+               unsafe static void ReadDataTable ()
+               {
+                       if (to_lower_data_low == null) {
+                               lock (cookie) {
+                                       if (to_lower_data_low != null)
+                                               return;
+
+                                       GetDataTablePointersLite (out to_lower_data_low, out to_lower_data_high, out to_upper_data_low, out to_upper_data_high);
+                               }
+                       }
+               }
+
+               unsafe string ToUpperInternal (string str)
+               {
+                       if (str.Length == 0)
+                               return String.Empty;
+
+                       string tmp = String.FastAllocateString (str.Length);
+                       fixed (char* source = str, dest = tmp) {
+
+                               char* destPtr = (char*)dest;
+                               char* sourcePtr = (char*)source;
+
+                               for (int n = 0; n < str.Length; n++) {
+                                       *destPtr = ToUpper (*sourcePtr);
+                                       sourcePtr++;
+                                       destPtr++;
+                               }
+                       }
+                       return tmp;
+               }
+
+               unsafe string ToLowerInternal (string str)
+               {
+                       if (str.Length == 0)
+                               return String.Empty;
+
+                       string tmp = String.FastAllocateString (str.Length);
+                       fixed (char* source = str, dest = tmp) {
+
+                               char* destPtr = (char*)dest;
+                               char* sourcePtr = (char*)source;
+
+                               for (int n = 0; n < str.Length; n++) {
+                                       *destPtr = ToLower (*sourcePtr);
+                                       sourcePtr++;
+                                       destPtr++;
+                               }
+                       }
+                       return tmp;
+               }
+
+               char ToUpperInternal (char c)
+               {
+                       switch (c) {
+                       case '\u0069': // Latin lowercase i
+                               if (!IsAsciiCasingSameAsInvariant)
+                                       return '\u0130'; // dotted capital I
+                               break;
+                       case '\u0131': // dotless i
+                               return '\u0049'; // I
+
+                       case '\u01c5': // see ToLower()
+                               return '\u01c4';
+                       case '\u01c8': // see ToLower()
+                               return '\u01c7';
+                       case '\u01cb': // see ToLower()
+                               return '\u01ca';
+                       case '\u01f2': // see ToLower()
+                               return '\u01f1';
+                       case '\u0390': // GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
+                               return '\u03aa'; // it is not in ICU
+                       case '\u03b0': // GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
+                               return '\u03ab'; // it is not in ICU
+                       case '\u03d0': // GREEK BETA
+                               return '\u0392';
+                       case '\u03d1': // GREEK THETA
+                               return '\u0398';
+                       case '\u03d5': // GREEK PHI
+                               return '\u03a6';
+                       case '\u03d6': // GREEK PI
+                               return '\u03a0';
+                       case '\u03f0': // GREEK KAPPA
+                               return '\u039a';
+                       case '\u03f1': // GREEK RHO
+                               return '\u03a1';
+                       // am not sure why miscellaneous GREEK symbols are 
+                       // not handled here.
+                       }
+
+                       return ToUpperInvariant (c);
+               }               
+
+               char ToLowerInternal (char c)
+               {
+                       switch (c) {
+                       case '\u0049': // Latin uppercase I
+                               if (!IsAsciiCasingSameAsInvariant)
+                                       return '\u0131'; // I becomes dotless i
+                               break;
+                       case '\u0130': // I-dotted
+                               return '\u0069'; // i
+
+                       case '\u01c5': // LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON
+                               return '\u01c6';
+                       // \u01c7 -> \u01c9 (LJ) : invariant
+                       case '\u01c8': // LATIN CAPITAL LETTER L WITH SMALL LETTER J
+                               return '\u01c9';
+                       // \u01ca -> \u01cc (NJ) : invariant
+                       case '\u01cb': // LATIN CAPITAL LETTER N WITH SMALL LETTER J
+                               return '\u01cc';
+                       // WITH CARON : invariant
+                       // WITH DIAERESIS AND * : invariant
+
+                       case '\u01f2': // LATIN CAPITAL LETTER D WITH SMALL LETTER Z
+                               return '\u01f3';
+                       case '\u03d2':  // ? it is not in ICU
+                               return '\u03c5';
+                       case '\u03d3':  // ? it is not in ICU
+                               return '\u03cd';
+                       case '\u03d4':  // ? it is not in ICU
+                               return '\u03cb';
+                       }
+                       return ToLowerInvariant (c);                    
+               }
+
+               static char ToLowerInvariant (char c)
+               {
+                       ReadDataTable ();
+
+                       unsafe {
+                               if (c <= ((char)0x24cf))
+                                       return (char) to_lower_data_low [c];
+                               if (c >= ((char)0xff21))
+                                       return (char) to_lower_data_high[c - 0xff21];
+                       }
+                       return c;
+               }
+
+               static char ToUpperInvariant (char c)
+               {
+                       ReadDataTable ();
+
+                       unsafe {
+                               if (c <= ((char)0x24e9))
+                                       return (char) to_upper_data_low [c];
+                               if (c >= ((char)0xff21))
+                                       return (char) to_upper_data_high [c - 0xff21];
+                       }
+                       return c;
+               }               
+
+               static unsafe int InternalCompareStringOrdinalIgnoreCase (String strA, int indexA, String strB, int indexB, int lenA, int lenB)
+               {
+                       if (strA == null) {
+                               return strB == null ? 0 : -1;
+                       }
+                       if (strB == null) {
+                               return 1;
+                       }
+                       int lengthA = Math.Min (lenA, strA.Length - indexA);
+                       int lengthB = Math.Min (lenB, strB.Length - indexB);
+
+                       if (lengthA == lengthB && Object.ReferenceEquals (strA, strB))
+                               return 0;
+
+                       fixed (char* aptr = strA, bptr = strB) {
+                               char* ap = aptr + indexA;
+                               char* end = ap + Math.Min (lengthA, lengthB);
+                               char* bp = bptr + indexB;
+                               while (ap < end) {
+                                       if (*ap != *bp) {
+                                               char c1 = Char.ToUpperInvariant (*ap);
+                                               char c2 = Char.ToUpperInvariant (*bp);
+                                               if (c1 != c2)
+                                                       return c1 - c2;
+                                       }
+                                       ap++;
+                                       bp++;
+                               }
+                               return lengthA - lengthB;
+                       }
+               }
+       }
+}
\ No newline at end of file
diff --git a/mcs/class/corlib/ReferenceSources/TimeZoneInfoOptions.cs b/mcs/class/corlib/ReferenceSources/TimeZoneInfoOptions.cs
deleted file mode 100644 (file)
index 50ce810..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-namespace System
-{
-    [Flags]
-    internal enum TimeZoneInfoOptions {
-        None                      = 1,
-        NoThrowOnInvalidTime      = 2
-    };
-}
\ No newline at end of file
diff --git a/mcs/class/corlib/ReferenceSources/TypeBuilderInstantiation.cs b/mcs/class/corlib/ReferenceSources/TypeBuilderInstantiation.cs
new file mode 100644 (file)
index 0000000..9e82664
--- /dev/null
@@ -0,0 +1,14 @@
+namespace System.Reflection.Emit
+{
+       abstract class TypeBuilderInstantiation : TypeInfo
+       {
+               internal static Type MakeGenericType (Type type, Type[] typeArguments)
+               {
+#if FULL_AOT_RUNTIME
+                       throw new NotSupportedException ("User types are not supported under full aot");
+#else
+                       return new MonoGenericClass (type, typeArguments);
+#endif
+               }
+       }
+}
\ No newline at end of file
diff --git a/mcs/class/corlib/ReferenceSources/win32native.cs b/mcs/class/corlib/ReferenceSources/win32native.cs
new file mode 100644 (file)
index 0000000..9a8306d
--- /dev/null
@@ -0,0 +1,9 @@
+namespace Microsoft.Win32
+{
+       static class Win32Native
+       {
+               internal const string ADVAPI32 = "advapi32.dll";
+
+               internal const int ERROR_SUCCESS = 0x0;
+       }
+}
\ No newline at end of file
diff --git a/mcs/class/corlib/System.Collections.Concurrent/ConcurrentOrderedList.cs b/mcs/class/corlib/System.Collections.Concurrent/ConcurrentOrderedList.cs
deleted file mode 100644 (file)
index 0d0ba10..0000000
+++ /dev/null
@@ -1,338 +0,0 @@
-// ConcurrentOrderedList.cs
-//
-// Copyright (c) 2010 Jérémie "Garuma" Laval
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-
-using System;
-using System.Threading;
-using System.Collections;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-
-#if INSIDE_MONO_PARALLEL
-using System.Collections.Concurrent;
-
-namespace Mono.Collections.Concurrent
-#else
-namespace System.Collections.Concurrent
-#endif
-{
-#if INSIDE_MONO_PARALLEL
-       public
-#endif
-       class ConcurrentOrderedList<T>: ICollection<T>, IEnumerable<T>
-       {
-               class Node
-               {
-                       public T Data;
-                       public int Key;
-                       public Node Next;
-                       public bool Marked;                
-
-                       public Node ()
-                       {
-
-                       }
-
-                       public Node (Node wrapped)
-                       {
-                               Marked = true;
-                               Next = wrapped;
-                       }
-               }
-
-               Node head;
-               Node tail;
-
-               IEqualityComparer<T> comparer;
-
-               int count;
-
-               public ConcurrentOrderedList () : this (EqualityComparer<T>.Default)
-               {
-                       
-               }
-
-               public ConcurrentOrderedList (IEqualityComparer<T> comparer)
-               {
-                       if (comparer == null)
-                               throw new ArgumentNullException ("comparer");
-
-                       this.comparer = comparer;
-
-                       head = new Node ();
-                       tail = new Node ();
-                       head.Next = tail;
-               }
-
-               public bool TryAdd (T data)
-               {
-                       Node node = new Node ();
-                       node.Data = data;
-                       node.Key = comparer.GetHashCode (data);
-
-                       if (ListInsert (node)) {
-                               Interlocked.Increment (ref count);
-                               return true;
-                       }
-
-                       return false;
-               }
-
-               public bool TryRemove (T data)
-               {
-                       T dummy;
-                       return TryRemoveHash (comparer.GetHashCode (data), out dummy);
-               }
-
-               public bool TryRemoveHash (int key, out T data)
-               {
-                       if (ListDelete (key, out data)) {
-                               Interlocked.Decrement (ref count);
-                               return true;
-                       }
-
-                       return false;
-               }
-
-               public bool TryPop (out T data)
-               {
-                       return ListPop (out data);
-               }
-
-               public bool Contains (T data)
-               {
-                       return ContainsHash (comparer.GetHashCode (data));
-               }
-
-               public bool ContainsHash (int key)
-               {
-                       Node node;
-
-                       if (!ListFind (key, out node))
-                               return false;
-
-                       return true;
-
-               }
-
-               public bool TryGetFromHash (int key, out T data)
-               {
-                       data = default (T);
-                       Node node;
-
-                       if (!ListFind (key, out node))
-                               return false;
-
-                       data = node.Data;
-                       return true;
-               }
-
-               public void Clear ()
-               {
-                       head.Next = tail;
-               }
-
-               public void CopyTo (T[] array, int startIndex)
-               {
-                       if (array == null)
-                               throw new ArgumentNullException ("array");
-                       if (startIndex < 0)
-                               throw new ArgumentOutOfRangeException ("startIndex");
-                       if (count > array.Length - startIndex)
-                               throw new ArgumentException ("array", "The number of elements is greater than the available space from startIndex to the end of the destination array.");
-
-                       foreach (T item in this) {
-                               if (startIndex >= array.Length)
-                                       break;
-
-                               array[startIndex++] = item;
-                       }
-               }
-
-               public IEqualityComparer<T> Comparer {
-                       get {
-                               return comparer;
-                       }
-               }
-
-               public int Count {
-                       get {
-                               return count;
-                       }
-               }
-
-               Node ListSearch (int key, ref Node left)
-               {
-                       Node leftNodeNext = null, rightNode = null;
-
-                       do {
-                               Node t = head;
-                               Node tNext = t.Next;
-                               do {
-                                       if (!tNext.Marked) {
-                                               left = t;
-                                               leftNodeNext = tNext;
-                                       }
-                                       t = tNext.Marked ? tNext.Next : tNext;
-                                       if (t == tail)
-                                               break;
-                                       
-                                       tNext = t.Next;
-                               } while (tNext.Marked || t.Key < key);
-
-                               rightNode = t;
-                               
-                               if (leftNodeNext == rightNode) {
-                                       if (rightNode != tail && rightNode.Next.Marked)
-                                               continue;
-                                       else 
-                                               return rightNode;
-                               }
-                               
-                               if (Interlocked.CompareExchange (ref left.Next, rightNode, leftNodeNext) == leftNodeNext) {
-                                       if (rightNode != tail && rightNode.Next.Marked)
-                                               continue;
-                                       else
-                                               return rightNode;
-                               }
-                       } while (true);
-               }
-
-               bool ListDelete (int key, out T data)
-               {
-                       Node rightNode = null, rightNodeNext = null, leftNode = null;
-                       data = default (T);
-                       
-                       do {
-                               rightNode = ListSearch (key, ref leftNode);
-                               if (rightNode == tail || rightNode.Key != key)
-                                       return false;
-
-                               data = rightNode.Data;
-                               
-                               rightNodeNext = rightNode.Next;
-                               if (!rightNodeNext.Marked)
-                                       if (Interlocked.CompareExchange (ref rightNode.Next, new Node (rightNodeNext), rightNodeNext) == rightNodeNext)
-                                               break;
-                       } while (true);
-                       
-                       if (Interlocked.CompareExchange (ref leftNode.Next, rightNodeNext, rightNode) != rightNodeNext)
-                               ListSearch (rightNode.Key, ref leftNode);
-                       
-                       return true;
-               }
-
-               bool ListPop (out T data)
-               {
-                       Node rightNode = null, rightNodeNext = null, leftNode = head;
-                       data = default (T);
-
-                       do {
-                               rightNode = head.Next;
-                               if (rightNode == tail)
-                                       return false;
-
-                               data = rightNode.Data;
-
-                               rightNodeNext = rightNode.Next;
-                               if (!rightNodeNext.Marked)
-                                       if (Interlocked.CompareExchange (ref rightNode.Next, new Node (rightNodeNext), rightNodeNext) == rightNodeNext)
-                                               break;
-                       } while (true);
-
-                       if (Interlocked.CompareExchange (ref leftNode.Next, rightNodeNext, rightNode) != rightNodeNext)
-                               ListSearch (rightNode.Key, ref leftNode);
-
-                       return true;
-               }
-               
-               bool ListInsert (Node newNode)
-               {
-                       int key = newNode.Key;
-                       Node rightNode = null, leftNode = null;
-                       
-                       do {
-                               rightNode = ListSearch (key, ref leftNode);
-                               if (rightNode != tail && rightNode.Key == key)
-                                       return false;
-                               
-                               newNode.Next = rightNode;
-                               if (Interlocked.CompareExchange (ref leftNode.Next, newNode, rightNode) == rightNode)
-                                       return true;
-                       } while (true);
-               }
-               
-               bool ListFind (int key, out Node data)
-               {
-                       Node rightNode = null, leftNode = null;
-                       data = null;
-                       
-                       data = rightNode = ListSearch (key, ref leftNode);
-                       
-                       return rightNode != tail && rightNode.Key == key;
-               }
-
-               IEnumerator<T> IEnumerable<T>.GetEnumerator ()
-               {
-                       return GetEnumeratorInternal ();
-               }
-
-               IEnumerator IEnumerable.GetEnumerator ()
-               {
-                       return GetEnumeratorInternal ();
-               }
-
-               IEnumerator<T> GetEnumeratorInternal ()
-               {
-                       Node node = head.Next;
-
-                       while (node != tail) {
-                               while (node.Marked) {
-                                       node = node.Next;
-                                       if (node == tail)
-                                               yield break;
-                               }
-                               yield return node.Data;
-                               node = node.Next;
-                       }
-               }
-
-               bool ICollection<T>.IsReadOnly {
-                       get {
-                               return false;
-                       }
-               }
-
-               void ICollection<T>.Add (T item)
-               {
-                       TryAdd (item);
-               }
-
-               bool ICollection<T>.Remove (T item)
-               {
-                       return TryRemove (item);
-               }
-       }
-}
-
diff --git a/mcs/class/corlib/System.Collections.Generic/Comparer.cs b/mcs/class/corlib/System.Collections.Generic/Comparer.cs
deleted file mode 100644 (file)
index d19ce2c..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-//
-// Comparer.cs
-//
-// Authors:
-//     Ben Maurer (bmaurer@ximian.com)
-//     Marek Safar (marek.safar@gmail.com)
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-// Copyright (C) 2012 Xamarin Inc (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Runtime.InteropServices;
-
-namespace System.Collections.Generic {
-       [Serializable]
-       public abstract class Comparer<T> : IComparer<T>, IComparer
-       {
-               static readonly Comparer <T> _default = typeof (IComparable<T>).IsAssignableFrom (typeof (T)) ?
-                       (Comparer<T>) Activator.CreateInstance (typeof (GenericComparer <>).MakeGenericType (typeof (T))) :
-                       new DefaultComparer ();
-               
-               public abstract int Compare (T x, T y);
-       
-               public static Comparer<T> Default {
-                       get {
-                               return _default;
-                       }
-               }
-
-               public static Comparer<T> Create (Comparison<T> comparison)
-               {
-                       if (comparison == null)
-                               throw new ArgumentNullException ("comparison");
-
-                       return new ComparisonComparer<T> (comparison);
-               }
-
-               int IComparer.Compare (object x, object y)
-               {
-                       if (x == y)
-                               return 0;
-                       if (x == null)
-                               return y == null ? 0 : -1;
-                       if (y == null)
-                               return 1;
-                       
-                       if (x is T && y is T)
-                               return Compare ((T) x, (T) y);
-                       
-                       throw new ArgumentException ();
-               }
-       
-               [Serializable]
-               sealed class DefaultComparer : Comparer<T>
-               {
-                       public override int Compare (T x, T y)
-                       {
-                               // `null' is less than any other ref type
-                               if (x == null)
-                                       return y == null ? 0 : -1;
-                               if (y == null)
-                                       return 1;
-       
-                               var i = x as IComparable;
-                               if (i != null)
-                                       return i.CompareTo (y);
-
-                               i = y as IComparable;
-                               if (i != null)
-                                       return -i.CompareTo (x);
-
-                               throw new ArgumentException ("At least one argument has to implement IComparable interface");
-                       }
-               }
-       }
-       
-       [Serializable]
-       sealed class GenericComparer<T> : Comparer<T> where T : IComparable<T>
-       {
-               public override int Compare (T x, T y)
-               {
-                       // `null' is less than any other ref type
-                       if (x == null)
-                               return y == null ? 0 : -1;
-                       if (y == null)
-                               return 1;
-                       
-                       return x.CompareTo (y);
-               }
-       }
-       [Serializable]
-       sealed class ComparisonComparer<T> : Comparer<T>
-       {
-               readonly Comparison<T> comparison;
-
-               public ComparisonComparer (Comparison<T> comparison)
-               {
-                       this.comparison = comparison;
-               }
-
-               public override int Compare (T x, T y)
-               {
-                       return comparison (x, y);
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Collections.Generic/EqualityComparer.cs b/mcs/class/corlib/System.Collections.Generic/EqualityComparer.cs
deleted file mode 100644 (file)
index 9338f96..0000000
+++ /dev/null
@@ -1,229 +0,0 @@
-//
-// EqualityComparer.cs
-//
-// Authors:
-//     Ben Maurer (bmaurer@ximian.com)
-//     Marek Safar (marek.safar@gmail.com)
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-// Copyright (C) 2014 Xamarin Inc (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Runtime.InteropServices;
-
-namespace System.Collections.Generic {
-       [Serializable]
-       public abstract class EqualityComparer <T> : IEqualityComparer, IEqualityComparer <T> {
-               
-               static EqualityComparer ()
-               {
-                       var t = typeof (T);
-                       if (t == typeof (string)) {
-                               _default = (EqualityComparer<T>) (object) new InternalStringComparer ();
-                               return;
-                       }
-
-                       if (t == typeof (int)) {
-                               _default = (EqualityComparer<T>) (object) new IntEqualityComparer ();
-                               return;
-                       }
-
-                       if (t.IsEnum && Enum.GetUnderlyingType (t) == typeof (int)) {
-                               _default = new EnumIntEqualityComparer<T> ();
-                               return;
-                       }
-
-                       if (typeof (IEquatable <T>).IsAssignableFrom (t))
-                               _default = (EqualityComparer <T>) Activator.CreateInstance (typeof (GenericEqualityComparer <>).MakeGenericType (t));
-                       else
-                               _default = new DefaultComparer<T> ();
-               }
-               
-               public abstract int GetHashCode (T obj);
-               public abstract bool Equals (T x, T y);
-       
-               static readonly EqualityComparer <T> _default;
-               
-               public static EqualityComparer <T> Default {
-                       get {
-                               return _default;
-                       }
-               }
-
-               int IEqualityComparer.GetHashCode (object obj)
-               {
-                       if (obj == null)
-                               return 0;
-
-                       if (!(obj is T))
-                               throw new ArgumentException ("Argument is not compatible", "obj");
-
-                       return GetHashCode ((T)obj);
-               }
-
-               bool IEqualityComparer.Equals (object x, object y)
-               {
-                       if (x == y)
-                               return true;
-
-                       if (x == null || y == null)
-                               return false;
-
-                       if (!(x is T))
-                               throw new ArgumentException ("Argument is not compatible", "x");
-                       if (!(y is T))
-                               throw new ArgumentException ("Argument is not compatible", "y");
-                       return Equals ((T)x, (T)y);
-               }
-               
-               internal virtual int IndexOf (T[] array, T value, int startIndex, int endIndex)
-               {
-                       for (int i = startIndex; i < endIndex; ++i) {
-                               if (Equals (Array.UnsafeLoad (array, i), value))
-                                       return i;
-                       }
-
-                       return -1;
-               }
-       }
-
-       [Serializable]
-       sealed class DefaultComparer<T> : EqualityComparer<T> {
-       
-               public override int GetHashCode (T obj)
-               {
-                       if (obj == null)
-                               return 0;
-                       return obj.GetHashCode ();
-               }
-       
-               public override bool Equals (T x, T y)
-               {
-                       if (x == null)
-                               return y == null;
-
-                       return x.Equals (y);
-               }
-       }
-
-       [Serializable]
-       sealed class InternalStringComparer : EqualityComparer<string> {
-       
-               public override int GetHashCode (string obj)
-               {
-                       if (obj == null)
-                               return 0;
-                       return obj.GetHashCode ();
-               }
-       
-               public override bool Equals (string x, string y)
-               {
-                       if (x == null)
-                               return y == null;
-
-                       if ((object) x == (object) y)
-                               return true;
-                               
-                       return x.Equals (y);
-               }
-
-               internal override int IndexOf (string[] array, string value, int startIndex, int endIndex)
-               {
-                       for (int i = startIndex; i < endIndex; ++i) {
-                               if (Array.UnsafeLoad (array, i) == value)
-                                       return i;
-                       }
-
-                       return -1;
-               }
-       }
-
-       [Serializable]
-       sealed class IntEqualityComparer : EqualityComparer<int>
-       {
-               public override int GetHashCode (int obj)
-               {
-                       return obj;
-               }
-
-               public override bool Equals (int x, int y)
-               {
-                       return x == y;
-               }
-
-               internal override int IndexOf (int[] array, int value, int startIndex, int endIndex)
-               {
-                       for (int i = startIndex; i < endIndex; ++i) {
-                               if (Array.UnsafeLoad (array, i) == value)
-                                       return i;
-                       }
-
-                       return -1;
-               }
-       }
-
-       [Serializable]
-       sealed class EnumIntEqualityComparer<T> : EqualityComparer<T>
-       {
-               public override int GetHashCode (T obj)
-               {
-                       return Array.UnsafeMov<T, int> (obj);
-               }
-
-               public override bool Equals (T x, T y)
-               {
-                       return Array.UnsafeMov<T, int> (x) == Array.UnsafeMov<T, int> (y);
-               }
-
-               internal override int IndexOf (T[] array, T value, int startIndex, int endIndex)
-               {
-                       int v = Array.UnsafeMov<T, int> (value);
-                       var a = Array.UnsafeMov<T[], int[]> (array);
-                       for (int i = startIndex; i < endIndex; ++i) {
-                               if (Array.UnsafeLoad (a, i) == v)
-                                       return i;
-                       }
-
-                       return -1;
-               }
-       }
-
-       [Serializable]
-       sealed class GenericEqualityComparer <T> : EqualityComparer <T> where T : IEquatable <T> {
-
-               public override int GetHashCode (T obj)
-               {
-                       if (obj == null)
-                               return 0;
-                       return obj.GetHashCode ();
-               }
-
-               public override bool Equals (T x, T y)
-               {
-                       if (x == null)
-                               return y == null;
-                       
-                       return x.Equals (y);
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Globalization/.gitattributes b/mcs/class/corlib/System.Globalization/.gitattributes
deleted file mode 100644 (file)
index 1e0deee..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/CodePageDataItem.cs -crlf
diff --git a/mcs/class/corlib/System.Globalization/CalendarAlgorithmType.cs b/mcs/class/corlib/System.Globalization/CalendarAlgorithmType.cs
deleted file mode 100644 (file)
index f66c25e..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-// ::MONO
-//
-// System.Globalization.CalendarAlgorithmType.cs
-//
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Globalization
-{
-       [System.Runtime.InteropServices.ComVisible(true)]
-       public enum CalendarAlgorithmType
-       {
-               Unknown = 0,
-               SolarCalendar = 1,
-               LunarCalendar = 2,
-               LunisolarCalendar = 3,
-       }
-
-}
diff --git a/mcs/class/corlib/System.Globalization/CalendarWeekRule.cs b/mcs/class/corlib/System.Globalization/CalendarWeekRule.cs
deleted file mode 100644 (file)
index 678eded..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-// ::MONO
-//
-// System.Globalization.CalendarWeekRule.cs
-//
-// Copyright (C) Wictor Wilén 2001 (wictor@iBizkit.se)
-//
-// Contributors: Wictor Wilén
-//
-// Revisions
-// 2001-09-14: First draft
-// 2001-09-15: First release
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Globalization
-{
-       /// <summary>
-       /// The System.Globalization.CalendarWeekRule enumeration
-       /// </summary>
-       [System.Runtime.InteropServices.ComVisible(true)]
-       [System.Serializable]
-       public enum CalendarWeekRule
-       {
-               FirstDay = 0,
-               FirstFullWeek = 1,
-               FirstFourDayWeek = 2
-
-       }
-
-}
index 0793fe501e44159c1a0cab702f1b2fc60e47f16b..b806082b188853ad5e30e10dfbde8b3e9a9c01e3 100644 (file)
@@ -84,6 +84,16 @@ namespace System.Globalization
                [NonSerialized]
                private unsafe readonly void *textinfo_data;
 
+               [StructLayout (LayoutKind.Sequential)]
+               struct Data {
+                       public int ansi;
+                       public int ebcdic;
+                       public int mac;
+                       public int oem;
+                       public bool right_to_left;
+                       public byte list_sep;
+               }
+
                int m_dataItem;         // MS.NET serializes this.
 #pragma warning restore 169, 649
 
@@ -417,18 +427,26 @@ namespace System.Globalization
                        // The runtime returns a NULL in the first position of the array when
                        // 'neutral' is true. We fill it in with a clone of InvariantCulture
                        // since it must not be read-only
+                       int i = 0;
                        if (neutral && infos.Length > 0 && infos [0] == null) {
-                               infos [0] = (CultureInfo) InvariantCulture.Clone ();
+                               infos [i++] = (CultureInfo) InvariantCulture.Clone ();
                        }
 
-                       for (int i = 1; i < infos.Length; ++i) {
+                       for (; i < infos.Length; ++i) {
                                var ci = infos [i];
-                               infos [i].m_cultureData = CultureData.GetCultureData (ci.m_name, false, ci.datetime_index, ci.CalendarType, ci.number_index, ci.iso2lang);
+                               var ti = ci.GetTextInfoData ();
+                               infos [i].m_cultureData = CultureData.GetCultureData (ci.m_name, false, ci.datetime_index, ci.CalendarType, ci.number_index, ci.iso2lang,
+                                       ti.ansi, ti.oem, ti.mac, ti.ebcdic, ti.right_to_left, ((char)ti.list_sep).ToString ());
                        }
 
                        return infos;
                }
 
+               unsafe Data GetTextInfoData ()
+               {
+                       return *(Data*) textinfo_data;
+               }
+
                public override int GetHashCode ()
                {
                        return cultureID.GetHashCode ();
@@ -624,7 +642,9 @@ namespace System.Globalization
 
                private unsafe TextInfo CreateTextInfo (bool readOnly)
                {
-                       return new TextInfo (this, cultureID, this.textinfo_data, readOnly);
+                       TextInfo tempTextInfo = new TextInfo (this.m_cultureData);
+                       tempTextInfo.SetReadOnlyState (readOnly);
+                       return tempTextInfo;
                }
 
                public CultureInfo (int culture) : this (culture, true) {}
@@ -644,8 +664,8 @@ namespace System.Globalization
 
                        if (culture == InvariantCultureId) {
                                /* Short circuit the invariant culture */
-                               ConstructInvariant (read_only);
                                m_cultureData = CultureData.Invariant;
+                               ConstructInvariant (read_only);
                                return;
                        }
 
@@ -657,7 +677,9 @@ namespace System.Globalization
                                throw new CultureNotFoundException ("culture", msg);
                        }
 
-                       m_cultureData = CultureData.GetCultureData (m_name, m_useUserOverride, datetime_index, CalendarType, number_index, iso2lang);
+                       var ti = GetTextInfoData ();
+                       m_cultureData = CultureData.GetCultureData (m_name, m_useUserOverride, datetime_index, CalendarType, number_index, iso2lang,
+                               ti.ansi, ti.oem, ti.mac, ti.ebcdic, ti.right_to_left, ((char)ti.list_sep).ToString ());
                }
 
                public CultureInfo (string name) : this (name, true) {}
@@ -677,8 +699,8 @@ namespace System.Globalization
 
                        if (name.Length == 0) {
                                /* Short circuit the invariant culture */
-                               ConstructInvariant (read_only);
                                m_cultureData = CultureData.Invariant;
+                               ConstructInvariant (read_only);
                                return;
                        }
 
@@ -686,7 +708,9 @@ namespace System.Globalization
                                throw CreateNotFoundException (name);
                        }
 
-                       m_cultureData = CultureData.GetCultureData (m_name, useUserOverride, datetime_index, CalendarType, number_index, iso2lang);
+                       var ti = GetTextInfoData ();
+                       m_cultureData = CultureData.GetCultureData (m_name, useUserOverride, datetime_index, CalendarType, number_index, iso2lang,
+                               ti.ansi, ti.oem, ti.mac, ti.ebcdic, ti.right_to_left, ((char)ti.list_sep).ToString ());
                }
 
                // This is used when creating by specific name and creating by
@@ -803,7 +827,10 @@ namespace System.Globalization
                        if (ci.IsNeutralCulture)
                                ci = CreateSpecificCultureFromNeutral (ci.Name);
 
-                       ci.m_cultureData = CultureData.GetCultureData (ci.m_name, false, ci.datetime_index, ci.CalendarType, ci.number_index, ci.iso2lang);
+                       var ti = ci.GetTextInfoData ();
+
+                       ci.m_cultureData = CultureData.GetCultureData (ci.m_name, false, ci.datetime_index, ci.CalendarType, ci.number_index, ci.iso2lang,
+                               ti.ansi, ti.oem, ti.mac, ti.ebcdic, ti.right_to_left, ((char)ti.list_sep).ToString ());
                        return ci;
                }
 
diff --git a/mcs/class/corlib/System.Globalization/DateTimeStyles.cs b/mcs/class/corlib/System.Globalization/DateTimeStyles.cs
deleted file mode 100644 (file)
index a61d315..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-// DateTimeStyles.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Fri, 7 Sep 2001 16:32:07 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc.  http://www.ximian.com
-// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Globalization {
-
-       [Flags]
-       [Serializable]
-       [System.Runtime.InteropServices.ComVisible(true)]
-       public enum DateTimeStyles {
-               None                 = 0x00000000,
-               AllowLeadingWhite    = 0x00000001,
-               AllowTrailingWhite   = 0x00000002,
-               AllowInnerWhite      = 0x00000004,
-               AllowWhiteSpaces     = AllowLeadingWhite | AllowTrailingWhite | AllowInnerWhite,
-               NoCurrentDateDefault = 0x00000008,
-               AdjustToUniversal    = 0x00000010,
-               AssumeLocal          = 0x00000020,
-               AssumeUniversal      = 0x00000040,
-               RoundtripKind        = 0x00000080,
-       } // DateTimeStyles
-
-} // System.Globalization
diff --git a/mcs/class/corlib/System.Globalization/DigitShapes.cs b/mcs/class/corlib/System.Globalization/DigitShapes.cs
deleted file mode 100644 (file)
index a1a2142..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Globalization {
-
-       [System.Runtime.InteropServices.ComVisible(true)]
-       [Serializable]
-       public enum DigitShapes {
-               Context = 0,
-               None = 1,
-               NativeNational = 2
-       }
-}
diff --git a/mcs/class/corlib/System.Globalization/GregorianCalendarTypes.cs b/mcs/class/corlib/System.Globalization/GregorianCalendarTypes.cs
deleted file mode 100644 (file)
index 49a98db..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-// GregorianCalendarTypes.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:35:19 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc.  http://www.ximian.com
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Globalization {
-
-
-       [System.Runtime.InteropServices.ComVisible(true)]
-       [System.Serializable]
-       public enum GregorianCalendarTypes {
-
-               /// <summary>
-               /// </summary>
-               Localized = 1,
-
-               /// <summary>
-               /// </summary>
-               USEnglish = 2,
-
-               /// <summary>
-               /// </summary>
-               MiddleEastFrench = 9,
-
-               /// <summary>
-               /// </summary>
-               Arabic = 10,
-
-               /// <summary>
-               /// </summary>
-               TransliteratedEnglish = 11,
-
-               /// <summary>
-               /// </summary>
-               TransliteratedFrench = 12,
-       } // GregorianCalendarTypes
-
-} // System.Globalization
diff --git a/mcs/class/corlib/System.Globalization/TextInfo.cs b/mcs/class/corlib/System.Globalization/TextInfo.cs
deleted file mode 100644 (file)
index 07d1eeb..0000000
+++ /dev/null
@@ -1,673 +0,0 @@
-//
-// System.Globalization.TextInfo.cs
-//
-// Authors:
-//     Dick Porter (dick@ximian.com)
-//     Duncan Mak (duncan@ximian.com)
-//     Atsushi Enomoto (atsushi@ximian.com)
-//     Sebastien Pouliot  <sebastien@ximian.com>
-//
-// (C) 2002 Ximian, Inc.
-// (C) 2005 Novell, Inc.
-//
-// TODO:
-//   Missing the various code page mappings.
-//   Missing the OnDeserialization implementation.
-//
-// Copyright (C) 2004, 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.CompilerServices;
-using System.Runtime.Serialization;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.Diagnostics.Contracts;
-
-namespace System.Globalization {
-
-       [Serializable]
-       [ComVisible (true)]
-       [MonoTODO ("IDeserializationCallback isn't implemented.")]
-       public class TextInfo: IDeserializationCallback, ICloneable
-       {
-               static TextInfo ()
-               {
-                       unsafe {
-                               GetDataTablePointersLite (out to_lower_data_low, out to_lower_data_high, out to_upper_data_low, out to_upper_data_high);
-                       }
-               }
-               
-               private readonly unsafe static ushort *to_lower_data_low;
-               private readonly unsafe static ushort *to_lower_data_high;
-               private readonly unsafe static ushort *to_upper_data_low;
-               private readonly unsafe static ushort *to_upper_data_high;
-               [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
-               private unsafe static extern void GetDataTablePointersLite (out ushort *to_lower_data_low, out ushort *to_lower_data_high,
-                       out ushort *to_upper_data_low, out ushort *to_upper_data_high);
-
-               static char ToLowerInvariant (char c)
-               {
-                       unsafe {
-                               if (c <= ((char)0x24cf))
-                                       return (char) to_lower_data_low [c];
-                               if (c >= ((char)0xff21))
-                                       return (char) to_lower_data_high[c - 0xff21];
-                       }
-                       return c;
-               }
-
-               static char ToUpperInvariant (char c)
-               {
-                       unsafe {
-                               if (c <= ((char)0x24e9))
-                                       return (char) to_upper_data_low [c];
-                               if (c >= ((char)0xff21))
-                                       return (char) to_upper_data_high [c - 0xff21];
-                       }
-                       return c;
-               }
-               
-               [StructLayout (LayoutKind.Sequential)]
-               struct Data {
-                       public int ansi;
-                       public int ebcdic;
-                       public int mac;
-                       public int oem;
-                       public bool right_to_left;
-                       public byte list_sep;
-               }
-
-               string m_listSeparator;
-               bool m_isReadOnly;
-               string customCultureName;
-
-#pragma warning disable 169
-               [NonSerialized]
-               int m_nDataItem;
-               bool m_useUserOverride;
-#pragma warning restore 169            
-
-               int m_win32LangID;
-
-               [NonSerialized]
-               readonly CultureInfo ci;
-
-               [NonSerialized]
-               readonly bool handleDotI;
-
-               [NonSerialized]
-               readonly Data data;
-
-               internal unsafe TextInfo (CultureInfo ci, int lcid, void* data, bool read_only)
-               {
-                       this.m_isReadOnly = read_only;
-                       this.m_win32LangID = lcid;
-                       this.ci = ci;
-                       if (data != null)
-                               this.data = *(Data*) data;
-                       else {
-                               this.data = new Data ();
-                               this.data.list_sep = (byte) ',';
-                       }
-
-                       CultureInfo tmp = ci;
-                       while (tmp.Parent != null && tmp.Parent.LCID != 0x7F && tmp.Parent != tmp)
-                               tmp = tmp.Parent;
-
-                       if (tmp != null) {
-                               switch (tmp.LCID) {
-                               case 44: // Azeri (az)
-                               case 31: // Turkish (tr)
-                                       handleDotI = true;
-                                       break;
-                               }
-                       }
-               }
-
-               private TextInfo (TextInfo textInfo)
-               {
-                       m_win32LangID = textInfo.m_win32LangID;
-                       m_nDataItem = textInfo.m_nDataItem;
-                       m_useUserOverride = textInfo.m_useUserOverride;
-                       m_listSeparator = textInfo.ListSeparator;
-                       customCultureName = textInfo.CultureName;
-                       ci = textInfo.ci;
-                       handleDotI = textInfo.handleDotI;
-                       data = textInfo.data;
-               }
-
-               public virtual int ANSICodePage
-               {
-                       get {
-                               return data.ansi;
-                       }
-               }
-
-               public virtual int EBCDICCodePage
-               {
-                       get {
-                               return data.ebcdic;
-                       }
-               }
-
-               [ComVisible (false)]
-               public int LCID {
-                       get { return m_win32LangID; }
-               }
-
-               public virtual string ListSeparator {
-                       get {
-                               if (m_listSeparator == null)
-                                       m_listSeparator = ((char) data.list_sep).ToString ();
-                               return m_listSeparator;
-                       }
-                       [ComVisible (false)]
-                       set { m_listSeparator = value; }
-               }
-
-               public virtual int MacCodePage
-               {
-                       get {
-                               return data.mac;
-                       }
-               }
-
-               public virtual int OEMCodePage
-               {
-                       get {
-                               return data.oem;
-                       }
-               }
-
-               [ComVisible (false)]
-               public string CultureName {
-                       get {
-                               if (customCultureName == null)
-                                       customCultureName = ci == null ? String.Empty : ci.Name;
-                               return customCultureName;
-                       }
-               }
-
-               [ComVisible (false)]
-               public bool IsReadOnly {
-                       get { return m_isReadOnly; }
-               }
-
-               [ComVisible (false)]
-               public bool IsRightToLeft {
-                       get {
-                               return data.right_to_left;
-                       }
-               }
-
-               public override bool Equals (object obj)
-               {
-                       if (obj == null)
-                               return false;
-                       TextInfo other = obj as TextInfo;
-                       if (other == null)
-                               return false;
-                       if (other.m_win32LangID != m_win32LangID)
-                               return false;
-                       if (other.ci != ci)
-                               return false;
-                       return true;
-               }
-
-               public override int GetHashCode()
-               {
-                       return (m_win32LangID);
-               }
-               
-               public override string ToString()
-               {
-                       return "TextInfo - " + m_win32LangID;
-               }
-
-               public string ToTitleCase (string str)
-               {
-                       if(str == null)
-                               throw new ArgumentNullException ("str");
-
-                       StringBuilder sb = null;
-                       int i = 0;
-                       int start = 0;
-                       while (i < str.Length) {
-                               if (!Char.IsLetter (str [i++]))
-                                       continue;
-                               i--;
-                               char t = ToTitleCase (str [i]);
-                               bool capitalize = true;
-                               if (t == str [i]) {
-                                       capitalize = false;
-                                       bool allTitle = true;
-                                       // if the word is all titlecase,
-                                       // then don't capitalize it.
-                                       int saved = i;
-                                       while (++i < str.Length) {
-                                               var ch = str [i];
-                                               var category = char.GetUnicodeCategory (ch);
-                                               if (IsSeparator (category))
-                                                       break;
-                                               t = ToTitleCase (ch);
-                                               if (t != ch) {
-                                                       allTitle = false;
-                                                       break;
-                                               }
-                                       }
-                                       if (allTitle)
-                                               continue;
-                                       i = saved;
-
-                                       // still check if all remaining
-                                       // characters are lowercase,
-                                       // where we don't have to modify
-                                       // the source word.
-                                       while (++i < str.Length) {
-                                               var ch = str [i];
-                                               var category = char.GetUnicodeCategory (ch);
-                                               if (IsSeparator (category))
-                                                       break;
-                                               if (ToLower (ch) != ch) {
-                                                       capitalize = true;
-                                                       i = saved;
-                                                       break;
-                                               }
-                                       }
-                               }
-
-                               if (capitalize) {
-                                       if (sb == null)
-                                               sb = new StringBuilder (str.Length);
-                                       sb.Append (str, start, i - start);
-                                       sb.Append (ToTitleCase (str [i]));
-                                       start = i + 1;
-                                       while (++i < str.Length) {
-                                               var ch = str [i];
-                                               var category = char.GetUnicodeCategory (ch);
-                                               if (IsSeparator (category))
-                                                       break;
-                                               sb.Append (ToLower (ch));
-                                       }
-                                       start = i;
-                               }
-                       }
-                       if (sb != null)
-                               sb.Append (str, start, str.Length - start);
-
-                       return sb != null ? sb.ToString () : str;
-               }
-
-               static bool IsSeparator (UnicodeCategory category)
-               {
-                       switch (category) {
-                       case UnicodeCategory.SpaceSeparator:
-                       case UnicodeCategory.LineSeparator:
-                       case UnicodeCategory.ParagraphSeparator:
-                       case UnicodeCategory.Control:
-                       case UnicodeCategory.Format:
-                       case UnicodeCategory.ConnectorPunctuation:
-                       case UnicodeCategory.DashPunctuation:
-                       case UnicodeCategory.OpenPunctuation:
-                       case UnicodeCategory.ClosePunctuation:
-                       case UnicodeCategory.InitialQuotePunctuation:
-                       case UnicodeCategory.FinalQuotePunctuation:
-                       case UnicodeCategory.OtherPunctuation:
-                               return true;
-                       }
-
-                       return false;
-               }
-
-               // Only Azeri and Turkish have their own special cases.
-               // Other than them, all languages have common special case
-               // (enumerable enough).
-               public virtual char ToLower (char c)
-               {
-                       // quick ASCII range check
-                       if (c < 0x40 || 0x60 < c && c < 128)
-                               return c;
-                       else if ('A' <= c && c <= 'Z' && (!handleDotI || c != 'I'))
-                               return (char) (c + 0x20);
-
-                       if (ci == null || ci.LCID == 0x7F)
-                               return ToLowerInvariant (c);
-
-                       switch (c) {
-                       case '\u0049': // Latin uppercase I
-                               if (handleDotI)
-                                       return '\u0131'; // I becomes dotless i
-                               break;
-                       case '\u0130': // I-dotted
-                               return '\u0069'; // i
-
-                       case '\u01c5': // LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON
-                               return '\u01c6';
-                       // \u01c7 -> \u01c9 (LJ) : invariant
-                       case '\u01c8': // LATIN CAPITAL LETTER L WITH SMALL LETTER J
-                               return '\u01c9';
-                       // \u01ca -> \u01cc (NJ) : invariant
-                       case '\u01cb': // LATIN CAPITAL LETTER N WITH SMALL LETTER J
-                               return '\u01cc';
-                       // WITH CARON : invariant
-                       // WITH DIAERESIS AND * : invariant
-
-                       case '\u01f2': // LATIN CAPITAL LETTER D WITH SMALL LETTER Z
-                               return '\u01f3';
-                       case '\u03d2':  // ? it is not in ICU
-                               return '\u03c5';
-                       case '\u03d3':  // ? it is not in ICU
-                               return '\u03cd';
-                       case '\u03d4':  // ? it is not in ICU
-                               return '\u03cb';
-                       }
-                       return ToLowerInvariant (c);
-               }
-
-               public virtual char ToUpper (char c)
-               {
-                       // quick ASCII range check
-                       if (c < 0x60)
-                               return c;
-                       else if ('a' <= c && c <= 'z' && (!handleDotI || c != 'i'))
-                               return (char) (c - 0x20);
-
-                       if (ci == null || ci.LCID == 0x7F)
-                               return ToUpperInvariant (c);
-
-                       switch (c) {
-                       case '\u0069': // Latin lowercase i
-                               if (handleDotI)
-                                       return '\u0130'; // dotted capital I
-                               break;
-                       case '\u0131': // dotless i
-                               return '\u0049'; // I
-
-                       case '\u01c5': // see ToLower()
-                               return '\u01c4';
-                       case '\u01c8': // see ToLower()
-                               return '\u01c7';
-                       case '\u01cb': // see ToLower()
-                               return '\u01ca';
-                       case '\u01f2': // see ToLower()
-                               return '\u01f1';
-                       case '\u0390': // GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
-                               return '\u03aa'; // it is not in ICU
-                       case '\u03b0': // GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
-                               return '\u03ab'; // it is not in ICU
-                       case '\u03d0': // GREEK BETA
-                               return '\u0392';
-                       case '\u03d1': // GREEK THETA
-                               return '\u0398';
-                       case '\u03d5': // GREEK PHI
-                               return '\u03a6';
-                       case '\u03d6': // GREEK PI
-                               return '\u03a0';
-                       case '\u03f0': // GREEK KAPPA
-                               return '\u039a';
-                       case '\u03f1': // GREEK RHO
-                               return '\u03a1';
-                       // am not sure why miscellaneous GREEK symbols are 
-                       // not handled here.
-                       }
-
-                       return ToUpperInvariant (c);
-               }
-
-               private char ToTitleCase (char c)
-               {
-                       // Handle some Latin characters.
-                       switch (c) {
-                       case '\u01c4':
-                       case '\u01c5':
-                       case '\u01c6':
-                               return '\u01c5';
-                       case '\u01c7':
-                       case '\u01c8':
-                       case '\u01c9':
-                               return '\u01c8';
-                       case '\u01ca':
-                       case '\u01cb':
-                       case '\u01cc':
-                               return '\u01cb';
-                       case '\u01f1':
-                       case '\u01f2':
-                       case '\u01f3':
-                               return '\u01f2';
-                       }
-                       if ('\u2170' <= c && c <= '\u217f' || // Roman numbers
-                               '\u24d0' <= c && c <= '\u24e9')
-                               return c;
-                       return ToUpper (c);
-               }
-
-               public unsafe virtual string ToLower (string str)
-               {
-                       // In ICU (3.2) there are a few cases that one single
-                       // character results in multiple characters in e.g.
-                       // tr-TR culture. So I tried brute force conversion
-                       // test with single character as a string input, but 
-                       // there was no such conversion. So I think it just
-                       // invokes ToLower(char).
-                       if (str == null)
-                               throw new ArgumentNullException ("str");
-
-                       if (str.Length == 0)
-                               return String.Empty;
-
-                       string tmp = String.FastAllocateString (str.Length);
-                       fixed (char* source = str, dest = tmp) {
-
-                               char* destPtr = (char*)dest;
-                               char* sourcePtr = (char*)source;
-
-                               for (int n = 0; n < str.Length; n++) {
-                                       *destPtr = ToLower (*sourcePtr);
-                                       sourcePtr++;
-                                       destPtr++;
-                               }
-                       }
-                       return tmp;
-               }
-
-               public unsafe virtual string ToUpper (string str)
-               {
-                       // In ICU (3.2) there is a case that string
-                       // is handled beyond per-character conversion, but
-                       // it is only lt-LT culture where MS.NET does not
-                       // handle any special transliteration. So I keep
-                       // ToUpper() just as character conversion.
-                       if (str == null)
-                               throw new ArgumentNullException ("str");
-
-                       if (str.Length == 0)
-                               return String.Empty;
-
-                       string tmp = String.FastAllocateString (str.Length);
-                       fixed (char* source = str, dest = tmp) {
-
-                               char* destPtr = (char*)dest;
-                               char* sourcePtr = (char*)source;
-
-                               for (int n = 0; n < str.Length; n++) {
-                                       *destPtr = ToUpper (*sourcePtr);
-                                       sourcePtr++;
-                                       destPtr++;
-                               }
-                       }
-                       return tmp;
-               }
-
-               [ComVisible (false)]
-               public static TextInfo ReadOnly (TextInfo textInfo)
-               {
-                       if (textInfo == null)
-                               throw new ArgumentNullException ("textInfo");
-
-                       TextInfo ti = new TextInfo (textInfo);
-                       ti.m_isReadOnly = true;
-                       return ti;
-               }
-
-               /* IDeserialization interface */
-               [MonoTODO]
-               void IDeserializationCallback.OnDeserialization(object sender)
-               {
-                       // FIXME: we need to re-create "data" in order to get most properties working
-               }
-
-               /* IClonable */
-               [ComVisible (false)]
-               public virtual object Clone ()
-               {
-                       return new TextInfo (this);
-               }
-
-               internal int GetCaseInsensitiveHashCode (string str)
-               {
-                       return StringComparer.CurrentCultureIgnoreCase.GetHashCode (str);
-               }
-
-               internal static unsafe int GetHashCodeOrdinalIgnoreCase (string s)
-               {
-                       var length = s.Length;
-                       fixed (char * c = s) {
-                               char * cc = c;
-                               char * end = cc + length - 1;
-                               int h = 0;
-                               for (;cc < end; cc += 2) {
-                                       h = (h << 5) - h + Char.ToUpperInvariant (*cc);
-                                       h = (h << 5) - h + Char.ToUpperInvariant (cc [1]);
-                               }
-                               ++end;
-                               if (cc < end)
-                                       h = (h << 5) - h + Char.ToUpperInvariant (*cc);
-                               return h;
-                       }
-               }
-
-               internal static unsafe int CompareOrdinalIgnoreCase(String str1, String str2)
-               {
-                       return CompareOrdinalIgnoreCaseEx (str1, 0, str2, 0, str1.Length, str2.Length);
-               }
-
-               internal static int CompareOrdinalIgnoreCaseEx (String strA, int indexA, String strB, int indexB, int lenA, int lenB)
-               {
-                       return CompareOrdinalCaseInsensitiveUnchecked (strA, indexA, lenA, strB, indexB, lenB);
-               }
-
-               static unsafe int CompareOrdinalCaseInsensitiveUnchecked (String strA, int indexA, int lenA, String strB, int indexB, int lenB)
-               {
-                       if (strA == null) {
-                               return strB == null ? 0 : -1;
-                       }
-                       if (strB == null) {
-                               return 1;
-                       }
-                       int lengthA = Math.Min (lenA, strA.Length - indexA);
-                       int lengthB = Math.Min (lenB, strB.Length - indexB);
-
-                       if (lengthA == lengthB && Object.ReferenceEquals (strA, strB))
-                               return 0;
-
-                       fixed (char* aptr = strA, bptr = strB) {
-                               char* ap = aptr + indexA;
-                               char* end = ap + Math.Min (lengthA, lengthB);
-                               char* bp = bptr + indexB;
-                               while (ap < end) {
-                                       if (*ap != *bp) {
-                                               char c1 = Char.ToUpperInvariant (*ap);
-                                               char c2 = Char.ToUpperInvariant (*bp);
-                                               if (c1 != c2)
-                                                       return c1 - c2;
-                                       }
-                                       ap++;
-                                       bp++;
-                               }
-                               return lengthA - lengthB;
-                       }
-               }
-
-               internal static unsafe int LastIndexOfStringOrdinalIgnoreCase(String source, String value, int startIndex, int count)
-               {
-                       int valueLen = value.Length;
-                       if (count < valueLen)
-                               return -1;
-
-                       if (valueLen == 0)
-                               return startIndex;
-
-                       fixed (char* thisptr = source, valueptr = value) {
-                               char* ap = thisptr + startIndex - valueLen + 1;
-                               char* thisEnd = ap - count + valueLen - 1;
-                               while (ap != thisEnd) {
-                                       for (int i = 0; i < valueLen; i++) {
-                                               if (Char.ToUpperInvariant (ap[i]) != Char.ToUpperInvariant (valueptr[i]))
-                                                       goto NextVal;
-                                       }
-                                       return (int)(ap - thisptr);
-                                       NextVal:
-                                       ap--;
-                               }
-                       }
-                       return -1;
-               }
-
-               internal static int IndexOfStringOrdinalIgnoreCase(String source, String value, int startIndex, int count)
-               {
-            Contract.Assert(source != null, "[TextInfo.IndexOfStringOrdinalIgnoreCase] Caller should've validated source != null");
-            Contract.Assert(value != null, "[TextInfo.IndexOfStringOrdinalIgnoreCase] Caller should've validated value != null");
-            Contract.Assert(startIndex + count <= source.Length, "[TextInfo.IndexOfStringOrdinalIgnoreCase] Caller should've validated startIndex + count <= source.Length");
-
-            // We return 0 if both inputs are empty strings
-            if (source.Length == 0 && value.Length == 0)
-            {
-                return 0;
-            }
-
-            // the search space within [source] starts at offset [startIndex] inclusive and includes
-            // [count] characters (thus the last included character is at index [startIndex + count -1]
-            // [end] is the index of the next character after the search space
-            // (it points past the end of the search space)
-            int end = startIndex + count;
-            
-            // maxStartIndex is the index beyond which we never *start* searching, inclusive; in other words;
-            // a search could include characters beyond maxStartIndex, but we'd never begin a search at an 
-            // index strictly greater than maxStartIndex. 
-            int maxStartIndex = end - value.Length;
-
-            for (; startIndex <= maxStartIndex; startIndex++)
-            {
-                // We should always have the same or more characters left to search than our actual pattern
-                Contract.Assert(end - startIndex >= value.Length);
-                // since this is an ordinal comparison, we can assume that the lengths must match
-                if (CompareOrdinalIgnoreCaseEx(source, startIndex, value, 0, value.Length, value.Length) == 0)
-                {
-                    return startIndex;
-                }
-            }
-            
-            // Not found
-            return -1;
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.IO/DirectoryNotFoundException.cs b/mcs/class/corlib/System.IO/DirectoryNotFoundException.cs
deleted file mode 100644 (file)
index 8a3392e..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-// System.IO.DirectoryNotFoundException.cs
-//
-// Author:
-//   Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc.  http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System.IO {
-
-       [Serializable]
-       [ComVisible (true)]
-       public class DirectoryNotFoundException : IOException {
-               
-               // Constructors
-               public DirectoryNotFoundException ()
-                       : base ("Directory not found")
-               {
-               }
-
-               public DirectoryNotFoundException (string message)
-                       : base (message)
-               {
-               }
-
-               public DirectoryNotFoundException (string message, Exception innerException)
-                       : base (message, innerException)
-               {
-               }
-
-               protected DirectoryNotFoundException (SerializationInfo info, StreamingContext context)
-                       : base (info, context)
-               {
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.IO/DriveNotFoundException.cs b/mcs/class/corlib/System.IO/DriveNotFoundException.cs
deleted file mode 100644 (file)
index 52434e2..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// System.IO.DriveNotFoundException.cs
-//
-// Author:
-//   Kornél Pál <http://www.kornelpal.hu/>
-//
-// Copyright (C) 2006 Kornél Pál
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-using System.Runtime.Serialization;
-
-namespace System.IO
-{
-       [Serializable]
-       [ComVisible (true)]
-       public class DriveNotFoundException : IOException
-       {
-               private const int ErrorCode = unchecked((int)0x80070003);
-
-               // Constructors
-               public DriveNotFoundException ()
-                       : base ("Attempted to access a drive that is not available.")
-               {
-                       this.HResult = ErrorCode;
-               }
-
-               public DriveNotFoundException (string message)
-                       : base (message)
-               {
-                       this.HResult = ErrorCode;
-               }
-
-               public DriveNotFoundException (string message, Exception innerException)
-                       : base (message, innerException)
-               {
-                       this.HResult = ErrorCode;
-               }
-
-               protected DriveNotFoundException (SerializationInfo info, StreamingContext context)
-                       : base (info, context)
-               {
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.IO/EndOfStreamException.cs b/mcs/class/corlib/System.IO/EndOfStreamException.cs
deleted file mode 100644 (file)
index 4073c8b..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-//     
-// System.IO.EndOfStreamException.cs
-//
-// Author:
-//     Duncan Mak (duncan@ximian.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Globalization;
-using System.IO;
-using System.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System.IO
-{
-          [Serializable]
-          [ComVisible (true)]
-          public class EndOfStreamException : IOException
-          {
-                        // Constructors
-                        public EndOfStreamException ()
-                                   : base (Locale.GetText ("Failed to read past end of stream."))
-                        {
-                        }
-
-                        public EndOfStreamException (string message)
-                                   : base (message)
-                        {
-                        }
-                        
-                        protected EndOfStreamException (SerializationInfo info,
-                                   StreamingContext context)
-                                   : base (info, context)
-                        {
-                        }
-
-                        public EndOfStreamException (string message, Exception innerException)
-                                   :base (message, innerException)
-                        {
-                        }
-                                   
-          }
-}
diff --git a/mcs/class/corlib/System.IO/FileLoadException.cs b/mcs/class/corlib/System.IO/FileLoadException.cs
deleted file mode 100644 (file)
index e978bac..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-//
-// System.IO.FileLoadException.cs
-//
-// Author:
-//   Paolo Molaro (lupus@ximian.com)
-//   Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc.  http://www.ximian.com
-// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-using System.Security;
-using System.Security.Permissions;
-using System.Text;
-using System.Runtime.InteropServices;
-
-namespace System.IO {
-
-       [Serializable]
-       [ComVisible (true)]
-       public class FileLoadException : IOException {
-
-               // Fields
-               const int Result = unchecked ((int)0x80070002);
-               string msg;
-               string fileName;
-               string fusionLog;
-               
-               // Constructors
-               public FileLoadException ()
-                       : base (Locale.GetText ("I/O Error"))
-               {
-                       HResult = Result;
-                       msg = Locale.GetText ("I/O Error");
-               }
-
-               public FileLoadException (string message)
-                       : base (message)
-               {
-                       HResult = Result;
-                       msg = message;
-               }
-
-               public FileLoadException (string message, string fileName)
-                       : base (message)
-               {
-                       HResult = Result;
-                       this.msg = message;
-                       this.fileName = fileName;
-               }               
-
-               public FileLoadException (string message, Exception inner)
-                       : base (message, inner)
-               {
-                       HResult = Result;
-                       msg = message;
-               }
-
-               public FileLoadException (string message, string fileName, Exception inner)
-                       : base (message, inner)
-               {
-                       HResult = Result;
-                       this.msg = message;
-                       this.fileName = fileName;
-               }
-
-               protected FileLoadException (SerializationInfo info, StreamingContext context)
-               {
-                       fileName = info.GetString ("FileLoad_FileName");
-                       fusionLog = info.GetString ("FileLoad_FusionLog");
-               }
-
-               // Properties
-               public override string Message {
-                       get { return msg; }
-               }
-
-               public string FileName
-               {
-                       get { return fileName; }
-               }
-               
-               public string FusionLog {
-                       // note: MS runtime throws a SecurityException when the Exception is created
-                       // but a FileLoadException once the exception as been thrown. Mono always
-                       // throw a SecurityException in both case (anyway fusionLog is currently empty)
-                       [SecurityPermission (SecurityAction.Demand, ControlEvidence=true, ControlPolicy=true)]
-                       get { return fusionLog; }
-               }
-
-               // Methods
-               public override void GetObjectData (SerializationInfo info, StreamingContext context)
-               {
-                       base.GetObjectData (info, context);
-                       info.AddValue ("FileLoad_FileName", fileName);
-                       info.AddValue ("FileLoad_FusionLog", fusionLog);
-               }
-
-               public override string ToString ()
-               {
-                       StringBuilder sb = new StringBuilder (GetType ().FullName);
-                       sb.AppendFormat (": {0}", msg);
-
-                       if (fileName != null)
-                               sb.AppendFormat (" : {0}", fileName);
-
-                       if (this.InnerException != null)
-                               sb.AppendFormat (" ----> {0}", InnerException);
-
-                       if (this.StackTrace != null) {
-                               sb.Append (Environment.NewLine);
-                               sb.Append (StackTrace);
-                       }
-
-                       return sb.ToString ();
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.IO/FileNotFoundException.cs b/mcs/class/corlib/System.IO/FileNotFoundException.cs
deleted file mode 100644 (file)
index 0f12284..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-//
-// System.IO.FileNotFoundException.cs
-//
-// Author:
-//   Paolo Molaro (lupus@ximian.com)
-//   Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc.  http://www.ximian.com
-// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-using System.Security.Permissions;
-using System.Text;
-using System.Runtime.InteropServices;
-
-namespace System.IO {
-
-       [Serializable]
-       [ComVisible (true)]
-       public class FileNotFoundException : IOException {
-
-               const int Result = unchecked ((int)0x80131621);
-
-               private string fileName;
-               private string fusionLog;
-
-               // Constructors
-               public FileNotFoundException ()
-                       : base (Locale.GetText ("Unable to find the specified file."))
-               {
-                       HResult = Result;
-               }
-
-               public FileNotFoundException (string message)
-                       : base (message)
-               {
-                       HResult = Result;
-               }
-
-               public FileNotFoundException (string message, Exception innerException)
-                       : base (message, innerException)
-               {
-                       HResult = Result;
-               }
-
-               public FileNotFoundException (string message, string fileName)
-                       : base (message)
-               {
-                       HResult = Result;
-                       this.fileName = fileName;
-               }
-
-               public FileNotFoundException (string message, string fileName, Exception innerException)
-                       : base (message, innerException)
-               {
-                       HResult = Result;
-                       this.fileName = fileName;
-               }
-
-               protected FileNotFoundException (SerializationInfo info, StreamingContext context)
-                       : base (info, context)
-               {
-                       fileName = info.GetString ("FileNotFound_FileName");
-                       fusionLog = info.GetString ("FileNotFound_FusionLog");
-               }
-
-               public string FileName
-               {
-                       get { return fileName; }
-               }
-
-               public string FusionLog {
-                       // note: MS runtime throws a SecurityException when the Exception is created
-                       // but a FileLoadException once the exception as been thrown. Mono always
-                       // throw a SecurityException in both case (anyway fusionLog is currently empty)
-                       [SecurityPermission (SecurityAction.Demand, ControlEvidence=true, ControlPolicy=true)]
-                       get { return fusionLog; }
-               }
-
-               public override string Message {
-                       get {
-                               if (base.message == null) {
-                                       if (fileName != null) {
-                                               string message = string.Format (
-                                                       "Could not load file or assembly '{0}' or one of"
-                                                       + " its dependencies. The system cannot find the"
-                                                       + " file specified.", fileName);
-                                               return message;
-                                       }
-                               }
-                               return base.message;
-                       }
-               }
-
-               public override void GetObjectData (SerializationInfo info, StreamingContext context)
-               {
-                       base.GetObjectData (info, context);
-                       info.AddValue ("FileNotFound_FileName", fileName);
-                       info.AddValue ("FileNotFound_FusionLog", fusionLog);
-               }
-
-               public override string ToString ()
-               {
-                       StringBuilder sb = new StringBuilder (GetType ().FullName);
-                       sb.AppendFormat (": {0}", Message);
-
-                       if (fileName != null && fileName.Length > 0) {
-                               sb.Append (Environment.NewLine);
-                               sb.AppendFormat ("File name: '{0}'", fileName);
-                       }
-
-                       if (this.InnerException != null)
-                               sb.AppendFormat (" ---> {0}", InnerException);
-
-                       if (this.StackTrace != null) {
-                               sb.Append (Environment.NewLine);
-                               sb.Append (StackTrace);
-                       }
-
-                       return sb.ToString ();
-               }
-       }
-}
index 1cc5364dfd5816548fa3f4f6647a6e35895287c3..610247d2e088429f6ca9d36eda5bbea5c5516218 100644 (file)
@@ -988,7 +988,7 @@ namespace System.IO
                        
                        if (count > 0) {
                                // Use the fastest method, all range checks has been done
-                               Buffer.BlockCopyInternal (buf, buf_offset, dest, dest_offset, count);
+                               Buffer.InternalBlockCopy (buf, buf_offset, dest, dest_offset, count);
                                buf_offset += count;
                        }
                        
diff --git a/mcs/class/corlib/System.IO/IOException.cs b/mcs/class/corlib/System.IO/IOException.cs
deleted file mode 100644 (file)
index e4c2def..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// System.IO.IOException.cs
-//
-// Author:
-//   Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc.  http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System.IO {
-       [Serializable]
-       [ComVisible (true)]
-       public class IOException : SystemException {
-
-               // Constructors
-               public IOException ()
-                       : base ("I/O Error")
-               {
-               }
-
-               public IOException (string message)
-                       : base (message)
-               {
-               }
-
-               public IOException (string message, Exception innerException)
-                       : base (message, innerException)
-               {
-               }
-
-               protected IOException (SerializationInfo info, StreamingContext context)
-                       : base (info, context)
-               {
-               }
-
-               public IOException (string message, int hresult)
-                       : base (message)
-               {
-                       this.HResult = hresult;
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.IO/PathTooLongException.cs b/mcs/class/corlib/System.IO/PathTooLongException.cs
deleted file mode 100644 (file)
index a856ea8..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-//     
-// System.IO.PathTooLongException.cs
-//
-// Author:
-//     Duncan Mak (duncan@ximian.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Globalization;
-using System.IO;
-using System.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System.IO
-{
-          [Serializable]
-          [ComVisible (true)]
-          public class PathTooLongException : IOException
-          {
-                        // Constructors
-                        public PathTooLongException ()
-                                   : base (Locale.GetText ("Pathname is longer than the maximum length"))
-                        {
-                        }
-
-                        public PathTooLongException (string message)
-                                   : base (message)
-                        {
-                        }
-                        
-                        protected PathTooLongException (SerializationInfo info,
-                                   StreamingContext context)
-                                   : base (info, context)
-                        {
-                        }
-
-                        public PathTooLongException (string message, Exception innerException)
-                                   :base (message, innerException)
-                        {
-                        }
-                                   
-          }
-}
index 647736bf203d01d6e5cd6baea01790d950502700..f3302e02b9ce491b7e06f8c4dd78eb2f92f13896 100644 (file)
@@ -358,8 +358,10 @@ namespace System.Reflection.Emit {
                                        return UnmanagedMarshal.DefineLPArrayInternal (subtype, sizeConst, sizeParamIndex);
                                else
                                        return UnmanagedMarshal.DefineLPArray (subtype);
+#if FEATURE_COMINTEROP
                        case UnmanagedType.SafeArray:
                                return UnmanagedMarshal.DefineSafeArray (subtype);
+#endif
                        case UnmanagedType.ByValArray:
                                if (!is_field)
                                        throw new ArgumentException ("Specified unmanaged type is only valid on fields");
@@ -367,8 +369,10 @@ namespace System.Reflection.Emit {
                                return UnmanagedMarshal.DefineByValArray (sizeConst);
                        case UnmanagedType.ByValTStr:
                                return UnmanagedMarshal.DefineByValTStr (sizeConst);
+#if FEATURE_COMINTEROP
                        case UnmanagedType.CustomMarshaler:
                                return UnmanagedMarshal.DefineCustom (marshalTypeRef, marshalCookie, marshalTypeName, Guid.Empty);
+#endif
                        default:
                                return UnmanagedMarshal.DefineUnmanagedMarshal ((UnmanagedType)utype);
                        }
index 7cf8c8a5717167a37f5c29d40678931067c77dfa..45b9a2caef31e8cfe4281e8147c7015b83a59ccf 100644 (file)
@@ -68,8 +68,13 @@ namespace System.Reflection.Emit {
                
                public UnmanagedType BaseType {
                        get {
-                               if (t == UnmanagedType.LPArray || t == UnmanagedType.SafeArray)
+                               if (t == UnmanagedType.LPArray)
                                        throw new ArgumentException ();
+
+#if FEATURE_COMINTEROP
+                               if (t == UnmanagedType.SafeArray)
+                                       throw new ArgumentException ();
+#endif
                                return tbase;
                        }
                }
@@ -97,15 +102,15 @@ namespace System.Reflection.Emit {
                public static UnmanagedMarshal DefineLPArray( UnmanagedType elemType) {
                        return new UnmanagedMarshal (UnmanagedType.LPArray, elemType);
                }
-
+#if FEATURE_COMINTEROP
                public static UnmanagedMarshal DefineSafeArray( UnmanagedType elemType) {
                        return new UnmanagedMarshal (UnmanagedType.SafeArray, elemType);
                }
-
+#endif
                public static UnmanagedMarshal DefineUnmanagedMarshal( UnmanagedType unmanagedType) {
                        return new UnmanagedMarshal (unmanagedType, unmanagedType);
                }
-
+#if FEATURE_COMINTEROP
                internal static UnmanagedMarshal DefineCustom (Type typeref, string cookie, string mtype, Guid id) {
                        UnmanagedMarshal res = new UnmanagedMarshal (UnmanagedType.CustomMarshaler, UnmanagedType.CustomMarshaler);
                        res.mcookie = cookie;
@@ -117,7 +122,7 @@ namespace System.Reflection.Emit {
                                res.guid = id.ToString ();
                        return res;
                }
-               
+#endif         
                // sizeConst and sizeParamIndex can be -1 meaning they are not specified
                internal static UnmanagedMarshal DefineLPArrayInternal (UnmanagedType elemType, int sizeConst, int sizeParamIndex) {
                        UnmanagedMarshal res = new UnmanagedMarshal (UnmanagedType.LPArray, elemType);
index ad50e600bbb7a7c4024adb7285023a5bc8ea8444..0bba65f4693a630934df471360618a9d26b4b2f7 100644 (file)
@@ -514,6 +514,9 @@ namespace System.Reflection {
                                // ignore
                        }
 
+                       if (String.IsNullOrEmpty (Location))
+                               return null;
+
                        // Try the assembly directory
                        string location = Path.GetDirectoryName (Location);
                        string fullName = Path.Combine (location, Path.Combine (culture.Name, an.Name + ".dll"));
index 111387296cedafea98868ca522b631c8ff3bfdbe..a7c66597453323b962c65be5b41c476855ed0453 100644 (file)
@@ -382,7 +382,7 @@ namespace System.Reflection {
                }
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               internal static extern DllImportAttribute GetDllImportAttribute (IntPtr mhandle);
+               internal extern void GetPInvoke (out PInvokeAttributes flags, out string entryPoint, out string dllName);
 
                internal object[] GetPseudoCustomAttributes ()
                {
@@ -404,10 +404,7 @@ namespace System.Reflection {
                        if ((info.iattrs & MethodImplAttributes.PreserveSig) != 0)
                                attrs [count ++] = new PreserveSigAttribute ();
                        if ((info.attrs & MethodAttributes.PinvokeImpl) != 0) {
-                               DllImportAttribute attr = GetDllImportAttribute (mhandle);
-                               if ((info.iattrs & MethodImplAttributes.PreserveSig) != 0)
-                                       attr.PreserveSig = true;
-                               attrs [count ++] = attr;
+                               attrs [count ++] = DllImportAttribute.GetCustomAttribute (this);
                        }
 
                        return attrs;
diff --git a/mcs/class/corlib/System.Runtime.ConstrainedExecution/CER.cs b/mcs/class/corlib/System.Runtime.ConstrainedExecution/CER.cs
deleted file mode 100644 (file)
index ba07f91..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// System.Runtime.ConstrainedExecution.Consistency.cs
-//
-// Author:
-//    Duncan Mak (duncan@ximian.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
-//
-
-namespace System.Runtime.ConstrainedExecution {
-
-       [Serializable]
-        public enum Cer {
-                None,
-                MayFail,
-                Success
-        }
-}
diff --git a/mcs/class/corlib/System.Runtime.ConstrainedExecution/ChangeLog b/mcs/class/corlib/System.Runtime.ConstrainedExecution/ChangeLog
deleted file mode 100644 (file)
index 115efbb..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-2008-04-02  Andreas Nahr  <ClassDevelopment@A-SoftTech.com>
-
-       * ReliabilityContractAttribute.cs: Fix parameter names
-
-2005-10-28  Sebastien Pouliot  <sebastien@ximian.com>
-
-       * CriticialFinalizerObject.cs: Added [ReliabilityContract] to ctor.
-       * ReliabilityContractAttribute.cs: Removed (obsoleted) default ctor.
-
-2005-05-24  Sebastien Pouliot  <sebastien@ximian.com>
-
-       * CriticialFinalizerObject.cs: Changed ComVisible to true.
-       * ReliabilityContractAttribute.cs: Default constructor is obsolete.
-       Properties don't have setters.
-
-2005-03-04  Kazuki Oikawa  <kazuki@panicode.com>
-
-       * PrePrepareMethodAttribute.cs:
-       * ReliabilityContractAttribute.cs: Fixed attributes.
-
-2004-08-12  Sebastien Pouliot  <sebastien@ximian.com>
-
-       * CER.cs: Copied from System.Runtime.Reliability. Fixed attributes.
-       * Consistency.cs: Copied from System.Runtime.Reliability. Fixed 
-       attributes.
-       * PrePrepareMethodAttribute.cs: Copied from System.Runtime.Reliability.
-       Fixed attributes.
-       * CriticialFinalizerObject.cs: Added missing finalizer and attributes.
-       * ReliabilityContractAttribute.cs: Copied from System.Runtime.
-       Reliability. Fixed attributes.
-
-2004-08-03  Sebastien Pouliot  <sebastien@ximian.com>
-
-       * CriticalFinalizerObject.cs: Moved from System.Runtime.Reliability to
-       match Fx 2.0 beta 1.
diff --git a/mcs/class/corlib/System.Runtime.ConstrainedExecution/Consistency.cs b/mcs/class/corlib/System.Runtime.ConstrainedExecution/Consistency.cs
deleted file mode 100644 (file)
index fa3d687..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.Runtime.ConstrainedExecution.Consistency.cs
-//
-// Author:
-//    Duncan Mak (duncan@ximian.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
-//
-
-namespace System.Runtime.ConstrainedExecution {
-
-       [Serializable]
-        public enum Consistency {
-                MayCorruptAppDomain = 1,
-                MayCorruptInstance = 2, 
-                MayCorruptProcess = 0,
-                WillNotCorruptState = 3
-        }
-}
diff --git a/mcs/class/corlib/System.Runtime.ConstrainedExecution/CriticialFinalizerObject.cs b/mcs/class/corlib/System.Runtime.ConstrainedExecution/CriticialFinalizerObject.cs
deleted file mode 100644 (file)
index 412377a..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// System.Runtime.ConstrainedExecution.CriticalFinalizerObject class
-//
-// Author:
-//    Duncan Mak (duncan@ximian.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.Runtime.ConstrainedExecution
-{
-       [ComVisible (true)]
-        public abstract class CriticalFinalizerObject
-        {
-               //
-               // WARNING: If you add any fields here, update the definition
-               // for the runtime structures as well
-               //
-               
-               [ReliabilityContract (Consistency.WillNotCorruptState, Cer.MayFail)]
-                protected CriticalFinalizerObject ()
-                {
-                }
-
-               [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
-               ~CriticalFinalizerObject ()
-               {
-               }
-        }
-}
diff --git a/mcs/class/corlib/System.Runtime.ConstrainedExecution/PrePrepareMethodAttribute.cs b/mcs/class/corlib/System.Runtime.ConstrainedExecution/PrePrepareMethodAttribute.cs
deleted file mode 100644 (file)
index d7cb07d..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.Runtime.ConstrainedExecution.PrePrepareMethodAttribute.cs
-//
-// Author:
-//    Duncan Mak (duncan@ximian.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-
-namespace System.Runtime.ConstrainedExecution
-{
-       [AttributeUsage ((AttributeTargets.Constructor | AttributeTargets.Method), Inherited=false)]
-        public sealed class PrePrepareMethodAttribute : Attribute
-        {
-                public PrePrepareMethodAttribute ()
-                {
-                }
-        }
-}
diff --git a/mcs/class/corlib/System.Runtime.ConstrainedExecution/ReliabilityContractAttribute.cs b/mcs/class/corlib/System.Runtime.ConstrainedExecution/ReliabilityContractAttribute.cs
deleted file mode 100644 (file)
index 8f191fd..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// System.Runtime.ConstrainedExecution.ReliabilityContractAttribute.cs
-//
-// Author:
-//    Duncan Mak (duncan@ximian.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
-//
-
-namespace System.Runtime.ConstrainedExecution
-{
-       [AttributeUsage ((AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct |
-               AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Interface), Inherited=false)]
-        public sealed class ReliabilityContractAttribute : Attribute
-        {
-                Consistency consistency;
-                Cer cer;
-
-               public ReliabilityContractAttribute (Consistency consistencyGuarantee, Cer cer)
-                {
-                        this.consistency = consistencyGuarantee;
-                        this.cer = cer;
-                }
-
-                public Cer Cer {
-                        get { return cer; }
-                }
-
-                public Consistency ConsistencyGuarantee {
-                       get { return consistency; }
-                }
-        }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/BINDPTR.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/BINDPTR.cs
deleted file mode 100644 (file)
index bf88b9e..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-// System.Runtime.InteropServices.ComTypes.BINDPTR.cs
-//
-// Paolo Molaro (lupus@ximian.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-// (C) 2002 Ximian, Inc.
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [StructLayout (LayoutKind.Explicit, CharSet = CharSet.Unicode)]
-       public struct BINDPTR {
-               [FieldOffset (0)] 
-               public IntPtr lpfuncdesc;
-               [FieldOffset (0)]
-               public IntPtr lptcomp;
-               [FieldOffset (0)]
-               public IntPtr lpvardesc;
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/BIND_OPTS.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/BIND_OPTS.cs
deleted file mode 100644 (file)
index c3b9b0f..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.BIND_OPTS.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [StructLayout (LayoutKind.Sequential)]
-       public struct BIND_OPTS
-       {
-               public int cbStruct;
-               public int grfFlags;
-               public int grfMode;
-               public int dwTickCountDeadline;
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/CALLCONV.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/CALLCONV.cs
deleted file mode 100644 (file)
index 7534760..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.CALLCONV.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [Serializable]
-       public enum CALLCONV
-       {
-               CC_CDECL = 1,
-               CC_PASCAL = 2,
-               CC_MSCPASCAL = 2,
-               CC_MACPASCAL = 3,
-               CC_STDCALL = 4,
-               CC_RESERVED = 5,
-               CC_SYSCALL = 6,
-               CC_MPWCDECL = 7,
-               CC_MPWPASCAL = 8,
-               CC_MAX = 9
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/CONNECTDATA.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/CONNECTDATA.cs
deleted file mode 100644 (file)
index f1b4957..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.CONNECTDATA.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [StructLayout (LayoutKind.Sequential, CharSet = CharSet.Unicode)]
-       public struct CONNECTDATA
-       {
-               [MarshalAs (UnmanagedType.Interface)]
-               public object pUnk;
-               public int dwCookie;
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/ChangeLog b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/ChangeLog
deleted file mode 100644 (file)
index 650af5d..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-2008-04-02  Andreas Nahr  <ClassDevelopment@A-SoftTech.com>
-
-       * IEnumVARIANT.cs: Fix parameter names
-
-2007-08-10  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * ITypeInfo2.cs, ITypeLib2.cs : added missing 2.0 members.
-         It is so strange that many of them overlap the base interfaces.
-
-2007-08-08  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * IMoniker.cs ELEMDESC.cs VARDESC.cs IRunningObjectTable.cs :
-         cosmetic 2.0 API fixes.
-
-2005-09-21  Kornél Pál  <kornelpal@hotmail.com>
-
-       * IEnumConnections.cs, IEnumMoniker.cs, IEnumString.cs, IStream.cs,
-         ITypeInfo.cs, ITypeLib.cs:
-         Removed UnmanagedType_80 that was required because mcs bug #75945
-         was not discovered.
-
-2005-03-04  Kazuki Oikawa  <kazuki@panicode.com>
-
-       * IBindCtx.cs
-       * IEnumConnectionPoints.cs
-       * IEnumMoniker.cs
-       * IEnumString.cs
-       * IEnumVARIANT.cs
-       * IMoniker.cs
-       * IRunningObjectTable.cs: Added missing attributes and corrected the wrong declarations.
-
-2005-03-03  Kazuki Oikawa  <kazuki@panicode.com>
-
-       * IBindCtx.cs
-       * IConnectionPoint.cs
-       * IConnectionPointContainer.cs
-       * IEnumConnectionPoints.cs
-       * IEnumConnections.cs
-       * IEnumMoniker.cs
-       * IEnumString.cs
-       * IEnumVARIANT.cs
-       * IMoniker.cs
-       * IPersistFile.cs
-       * IRunningObjectTable.cs
-       * IStream.cs
-       * ITypeComp.cs
-       * ITypeInfo.cs
-       * ITypeInfo2.cs
-       * ITypeLib.cs
-       * ITypeLib2.cs
-       * EXCEPINFO.cs
-       * IDLDESC.cs
-       * TYPELIBATTR.cs
-       * VARDESC.cs
-       * INVOKEKIND.cs
-       * SYSKIND.cs: Added missing attributes and corrected wrong declaration.
-
-2005-02-26  Kazuki Oikawa  <kazuki@panicode.com>
-
-       * BINDPTR.cs
-       * BIND_OPTS.cs
-       * CALLCONV.cs
-       * CONNECTDATA.cs
-       * DESCKIND.cs
-       * DISPPARAMS.cs
-       * ELEMDESC.cs
-       * EXCEPINFO.cs
-       * FILETIME.cs
-       * FUNCDESC.cs
-       * FUNCFLAGS.cs
-       * FUNCKIND.cs
-       * IBindCtx.cs
-       * IConnectionPoint.cs
-       * IConnectionPointContainer.cs
-       * IDLDESC.cs
-       * IDLFLAG.cs
-       * IEnumConnectionPoints.cs
-       * IEnumConnections.cs
-       * IEnumMoniker.cs
-       * IEnumString.cs
-       * IEnumVARIANT.cs
-       * IMoniker.cs
-       * IMPLTYPEFLAGS.cs
-       * INVOKEKIND.cs
-       * IPersistFile.cs
-       * IRunningObjectTable.cs
-       * IStream.cs
-       * ITypeComp.cs
-       * ITypeInfo.cs
-       * ITypeInfo2.cs
-       * ITypeLib.cs
-       * ITypeLib2.cs
-       * LIBFLAGS.cs
-       * PARAMDESC.cs
-       * PARAMFLAG.cs
-       * STATSTG.cs
-       * SYSKIND.cs
-       * TYPEATTR.cs
-       * TYPEDESC.cs
-       * TYPEFLAGS.cs
-       * TYPEKIND.cs
-       * TYPELIBATTR.cs
-       * VARDESC.cs
-       * VARFLAGS.cs
-       * VARKIND.cs: Added
\ No newline at end of file
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/DESCKIND.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/DESCKIND.cs
deleted file mode 100644 (file)
index 0fbd696..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-// System.Runtime.InteropServices.ComTypes.DESCKIND.cs
-//
-// Paolo Molaro (lupus@ximian.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-// (C) 2002 Ximian, Inc.
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-
-       [Serializable]
-       public enum DESCKIND {
-               DESCKIND_NONE = 0,
-               DESCKIND_FUNCDESC = 1,
-               DESCKIND_VARDESC = 2,
-               DESCKIND_TYPECOMP = 3,
-               DESCKIND_IMPLICITAPPOBJ = 4,
-               DESCKIND_MAX = 5
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/DISPPARAMS.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/DISPPARAMS.cs
deleted file mode 100644 (file)
index a8518e5..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-// System.Runtime.InteropServices.ComTypes.DISPPARAMS.cs
-//
-// Paolo Molaro (lupus@ximian.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-// (C) 2002 Ximian, Inc.
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [StructLayout (LayoutKind.Sequential, CharSet = CharSet.Unicode)]
-       public struct DISPPARAMS {
-               public IntPtr rgvarg;
-               public IntPtr rgdispidNamedArgs;
-               public int cArgs;
-               public int cNamedArgs;
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/ELEMDESC.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/ELEMDESC.cs
deleted file mode 100644 (file)
index 56429a7..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.ELEMDESC.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [StructLayout (LayoutKind.Sequential, CharSet = CharSet.Unicode)]
-       public struct ELEMDESC
-       {
-               public TYPEDESC tdesc;
-               public DESCUNION desc;
-
-               [StructLayout (LayoutKind.Explicit, CharSet = CharSet.Unicode)]
-               public struct DESCUNION
-               {
-                       [FieldOffset (0)]
-                       public IDLDESC idldesc;
-                       [FieldOffset (0)]
-                       public PARAMDESC paramdesc;
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/EXCEPINFO.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/EXCEPINFO.cs
deleted file mode 100644 (file)
index d30f264..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-// System.Runtime.InteropServices.ComTypes.EXCEPINFO.cs
-//
-// Paolo Molaro (lupus@ximian.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-// (C) 2002 Ximian, Inc.
-using System;
-
-#if !FULL_AOT_RUNTIME
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [StructLayout (LayoutKind.Sequential, CharSet = CharSet.Unicode)]
-       public struct EXCEPINFO {
-               public short wCode;
-               public short wReserved;
-               [MarshalAs (UnmanagedType.BStr)]
-               public string bstrSource;
-               [MarshalAs (UnmanagedType.BStr)]
-               public string bstrDescription;
-               [MarshalAs (UnmanagedType.BStr)]
-               public string bstrHelpFile;
-               public int dwHelpContext;
-               public IntPtr pvReserved;
-               public IntPtr pfnDeferredFillIn;
-               public int scode;
-       }
-}
-#endif
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/FILETIME.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/FILETIME.cs
deleted file mode 100644 (file)
index 1a6b08b..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.FILETIME.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [StructLayout (LayoutKind.Sequential)]
-       public struct FILETIME
-       {
-               public int dwLowDateTime;
-               public int dwHighDateTime;
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/FUNCDESC.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/FUNCDESC.cs
deleted file mode 100644 (file)
index 8276293..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.FUNCDESC.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [StructLayout (LayoutKind.Sequential)]
-       public struct FUNCDESC
-       {
-               public int memid;
-               public IntPtr lprgscode;
-               public IntPtr lprgelemdescParam;
-               public FUNCKIND funckind;
-               public INVOKEKIND invkind;
-               public CALLCONV callconv;
-               public short cParams;
-               public short cParamsOpt;
-               public short oVft;
-               public short cScodes;
-               public ELEMDESC elemdescFunc;
-               public short wFuncFlags;
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/FUNCFLAGS.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/FUNCFLAGS.cs
deleted file mode 100644 (file)
index 10f165f..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.FUNCFLAGS.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [Flags, Serializable]
-       public enum FUNCFLAGS
-       {
-               FUNCFLAG_FRESTRICTED = 1,
-               FUNCFLAG_FSOURCE = 2,
-               FUNCFLAG_FBINDABLE = 4,
-               FUNCFLAG_FREQUESTEDIT = 8,
-               FUNCFLAG_FDISPLAYBIND = 16,
-               FUNCFLAG_FDEFAULTBIND = 32,
-               FUNCFLAG_FHIDDEN = 64,
-               FUNCFLAG_FUSESGETLASTERROR = 128,
-               FUNCFLAG_FDEFAULTCOLLELEM = 256,
-               FUNCFLAG_FUIDEFAULT = 512,
-               FUNCFLAG_FNONBROWSABLE = 1024,
-               FUNCFLAG_FREPLACEABLE = 2048,
-               FUNCFLAG_FIMMEDIATEBIND = 4096
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/FUNCKIND.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/FUNCKIND.cs
deleted file mode 100644 (file)
index 38abc1b..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.FUNCKIND.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [Serializable]
-       public enum FUNCKIND
-       {
-               FUNC_VIRTUAL = 0,
-               FUNC_PUREVIRTUAL = 1,
-               FUNC_NONVIRTUAL = 2,
-               FUNC_STATIC = 3,
-               FUNC_DISPATCH = 4
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IBindCtx.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IBindCtx.cs
deleted file mode 100644 (file)
index 49d9c04..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.IBindCtx.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [ComImport]
-       [Guid ("0000000e-0000-0000-c000-000000000046")]
-       [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
-       public interface IBindCtx
-       {
-               void RegisterObjectBound ([MarshalAs(UnmanagedType.Interface)] object punk);
-               void RevokeObjectBound ([MarshalAs(UnmanagedType.Interface)] object punk);
-               void ReleaseBoundObjects ();
-               void SetBindOptions ([In] ref BIND_OPTS pbindopts);
-               void GetBindOptions (ref BIND_OPTS pbindopts);
-               void GetRunningObjectTable (out IRunningObjectTable pprot);
-               void RegisterObjectParam ([MarshalAs (UnmanagedType.LPWStr)] string pszKey, [MarshalAs (UnmanagedType.Interface)] object punk);
-               void GetObjectParam ([MarshalAs (UnmanagedType.LPWStr)] string pszKey, [MarshalAs (UnmanagedType.Interface)] out object ppunk);
-               void EnumObjectParam (out IEnumString ppenum);
-               [PreserveSig]
-               int RevokeObjectParam ([MarshalAs(UnmanagedType.LPWStr)] string pszKey);
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IConnectionPoint.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IConnectionPoint.cs
deleted file mode 100644 (file)
index 68d9175..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.IConnectionPoint.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [ComImport]
-       [Guid ("b196b286-bab4-101a-b69c-00aa00341d07")]
-       [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
-       public interface IConnectionPoint
-       {
-               void GetConnectionInterface (out Guid pIID);
-               void GetConnectionPointContainer (out IConnectionPointContainer ppCPC);
-               void Advise ([MarshalAs(UnmanagedType.Interface)] object pUnkSink, out int pdwCookie);
-               void Unadvise (int dwCookie);
-               void EnumConnections (out IEnumConnections ppEnum);
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IConnectionPointContainer.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IConnectionPointContainer.cs
deleted file mode 100644 (file)
index 92ab88e..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.IConnectionPointContainer.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [ComImport]
-       [Guid ("b196b284-bab4-101a-b69c-00aa00341d07")]
-       [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
-       public interface IConnectionPointContainer
-       {
-               void EnumConnectionPoints (out IEnumConnectionPoints ppEnum);
-               void FindConnectionPoint ([In] ref Guid riid, out IConnectionPoint ppCP);
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IDLDESC.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IDLDESC.cs
deleted file mode 100644 (file)
index 94aa57d..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.IDLDESC.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [StructLayout (LayoutKind.Sequential, CharSet = CharSet.Unicode)]
-       public struct IDLDESC
-       {
-               public IntPtr dwReserved;
-               public IDLFLAG wIDLFlags;
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IDLFLAG.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IDLFLAG.cs
deleted file mode 100644 (file)
index a2334df..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.IDLFLAG.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [Flags, Serializable]
-       public enum IDLFLAG
-       {
-               IDLFLAG_NONE = 0,
-               IDLFLAG_FIN = 1,
-               IDLFLAG_FOUT = 2,
-               IDLFLAG_FLCID = 4,
-               IDLFLAG_FRETVAL = 8
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IEnumConnectionPoints.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IEnumConnectionPoints.cs
deleted file mode 100644 (file)
index b6afc1d..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.IEnumConnectionPoints.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [ComImport]
-       [Guid ("b196b285-bab4-101a-b69c-00aa00341d07")]
-       [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
-       public interface IEnumConnectionPoints
-       {
-               [PreserveSigAttribute]
-               int Next (int celt, [Out, MarshalAs (UnmanagedType.LPArray, SizeParamIndex = 0)] IConnectionPoint[] rgelt, IntPtr pceltFetched);
-               [PreserveSigAttribute]
-               int Skip (int celt);
-               void Reset ();
-               void Clone (out IEnumConnectionPoints ppenum);
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IEnumConnections.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IEnumConnections.cs
deleted file mode 100644 (file)
index 1980ea5..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.IEnumConnections.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [ComImport]
-       [Guid ("b196b287-bab4-101a-b69c-00aa00341d07")]
-       [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
-       public interface IEnumConnections
-       {
-               [PreserveSigAttribute]
-               int Next (int celt, [Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] CONNECTDATA[] rgelt, IntPtr pceltFetched);
-               [PreserveSigAttribute]
-               int Skip (int celt);
-               void Reset ();
-               void Clone (out IEnumConnections ppenum);
-       }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IEnumMoniker.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IEnumMoniker.cs
deleted file mode 100644 (file)
index 3aa4c79..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.IEnumMoniker.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [ComImport]
-       [Guid ("00000102-0000-0000-c000-000000000046")]
-       [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
-       public interface IEnumMoniker
-       {
-               [PreserveSigAttribute]
-               int Next (int celt, [Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] IMoniker[] rgelt, IntPtr pceltFetched);
-               [PreserveSigAttribute]
-               int Skip (int celt);
-               void Reset ();
-               void Clone (out IEnumMoniker ppenum);
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IEnumString.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IEnumString.cs
deleted file mode 100644 (file)
index b7563f9..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.IEnumString.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [ComImport]
-       [Guid ("00000101-0000-0000-c000-000000000046")]
-       [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
-       public interface IEnumString
-       {
-               [PreserveSigAttribute]
-               int Next (int celt, [Out, MarshalAs (UnmanagedType.LPArray, SizeParamIndex = 0)] string[] rgelt, IntPtr pceltFetched);
-               [PreserveSigAttribute]
-               int Skip (int celt);
-               void Reset ();
-               void Clone (out IEnumString ppenum);
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IEnumVARIANT.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IEnumVARIANT.cs
deleted file mode 100644 (file)
index b107944..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.IEnumVARIANT.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [ComImport]
-       [Guid ("00020404-0000-0000-c000-000000000046")]
-       [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
-       public interface IEnumVARIANT
-       {
-               [PreserveSigAttribute]
-               int Next (int celt, [Out, MarshalAs (UnmanagedType.LPArray, SizeParamIndex=0)] object[] rgVar, IntPtr pceltFetched);
-               [PreserveSigAttribute]
-               int Skip (int celt);
-               [PreserveSigAttribute]
-               int Reset ();
-               IEnumVARIANT Clone ();
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IMPLTYPEFLAGS.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IMPLTYPEFLAGS.cs
deleted file mode 100644 (file)
index ff3375e..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.IMPLTYPEFLAGS.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [Flags, Serializable]
-       public enum IMPLTYPEFLAGS
-       {
-               IMPLTYPEFLAG_FDEFAULT = 1,
-               IMPLTYPEFLAG_FSOURCE = 2,
-               IMPLTYPEFLAG_FRESTRICTED = 4,
-               IMPLTYPEFLAG_FDEFAULTVTABLE = 8
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IMoniker.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IMoniker.cs
deleted file mode 100644 (file)
index ddf2b64..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.IMoniker.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [ComImport]
-       [Guid ("0000000f-0000-0000-c000-000000000046")]
-       [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
-       public interface IMoniker
-       {
-               void GetClassID (out Guid pClassID);
-               [PreserveSig]
-               int IsDirty ();
-               void Load (IStream pStm);
-               void Save (IStream pStm, [MarshalAs (UnmanagedType.Bool)] bool fClearDirty);
-               void GetSizeMax (out long pcbSize);
-               void BindToObject (IBindCtx pbc, IMoniker pmkToLeft, [In] ref Guid riidResult, [MarshalAs (UnmanagedType.Interface)] out object ppvResult);
-               void BindToStorage (IBindCtx pbc, IMoniker pmkToLeft, [In] ref Guid riid, [MarshalAs (UnmanagedType.Interface)] out object ppvObj);
-               void Reduce (IBindCtx pbc, int dwReduceHowFar, ref IMoniker ppmkToLeft, out IMoniker ppmkReduced);
-               void ComposeWith (IMoniker pmkRight, [MarshalAs (UnmanagedType.Bool)] bool fOnlyIfNotGeneric, out IMoniker ppmkComposite);
-               void Enum ([MarshalAs(UnmanagedType.Bool)] bool fForward, out IEnumMoniker ppenumMoniker);
-               [PreserveSig]
-               int IsEqual (IMoniker pmkOtherMoniker);
-               void Hash (out int pdwHash);
-               [PreserveSig]
-               int IsRunning (IBindCtx pbc, IMoniker pmkToLeft, IMoniker pmkNewlyRunning);
-               void GetTimeOfLastChange (IBindCtx pbc, IMoniker pmkToLeft, out FILETIME pFileTime);
-               void Inverse (out IMoniker ppmk);
-               void CommonPrefixWith (IMoniker pmkOther, out IMoniker ppmkPrefix);
-               void RelativePathTo (IMoniker pmkOther, out IMoniker ppmkRelPath);
-               void GetDisplayName (IBindCtx pbc, IMoniker pmkToLeft, [MarshalAs (UnmanagedType.LPWStr)] out string ppszDisplayName);
-               void ParseDisplayName (IBindCtx pbc, IMoniker pmkToLeft, [MarshalAs (UnmanagedType.LPWStr)] string pszDisplayName, out int pchEaten, out IMoniker ppmkOut);
-               [PreserveSig]
-               int IsSystemMoniker (out int pdwMksys);
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/INVOKEKIND.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/INVOKEKIND.cs
deleted file mode 100644 (file)
index 348e335..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-// System.Runtime.InteropServices.ComTypes.INVOKEKIND.cs
-//
-// Paolo Molaro (lupus@ximian.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-// (C) 2002 Ximian, Inc.
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [Flags]
-       [Serializable]
-       public enum INVOKEKIND {
-               INVOKE_FUNC = 1,
-               INVOKE_PROPERTYGET = 2,
-               INVOKE_PROPERTYPUT = 4,
-               INVOKE_PROPERTYPUTREF = 8
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IPersistFile.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IPersistFile.cs
deleted file mode 100644 (file)
index 24e97a0..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.IPersistFile.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [ComImport]
-       [Guid ("0000010b-0000-0000-c000-000000000046")]
-       [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
-       public interface IPersistFile
-       {
-               void GetClassID (out Guid pClassID);
-               [PreserveSig]
-               int IsDirty ();
-               void Load ([MarshalAs(UnmanagedType.LPWStr)] string pszFileName, int dwMode);
-               void Save ([MarshalAs (UnmanagedType.LPWStr)] string pszFileName, [MarshalAs (UnmanagedType.Bool)] bool fRemember);
-               void SaveCompleted ([MarshalAs (UnmanagedType.LPWStr)]string pszFileName);
-               void GetCurFile ([MarshalAs(UnmanagedType.LPWStr)] out string ppszFileName);
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IRunningObjectTable.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IRunningObjectTable.cs
deleted file mode 100644 (file)
index 52e37a0..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.IRunningObjectTable.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [ComImport]
-       [Guid ("00000010-0000-0000-c000-000000000046")]
-       [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
-       public interface IRunningObjectTable
-       {
-               int Register (int grfFlags, [MarshalAs (UnmanagedType.Interface)] object punkObject, IMoniker pmkObjectName);
-               void Revoke (int dwRegister);
-               [PreserveSig]
-               int IsRunning (IMoniker pmkObjectName);
-               [PreserveSig]
-               int GetObject (IMoniker pmkObjectName, [MarshalAs (UnmanagedType.Interface)] out object ppunkObject);
-               void NoteChangeTime (int dwRegister, ref FILETIME pfiletime);
-               [PreserveSig]
-               int GetTimeOfLastChange (IMoniker pmkObjectName, out FILETIME pfiletime);
-               void EnumRunning (out IEnumMoniker ppenumMoniker);
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IStream.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/IStream.cs
deleted file mode 100644 (file)
index 78cccb0..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.IStream.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Runtime.InteropServices.ComTypes;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [ComImport]
-       [Guid ("0000000c-0000-0000-c000-000000000046")]
-       [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
-       public interface IStream
-       {
-               void Read ([Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] byte[] pv, int cb, IntPtr pcbRead);
-               void Write ([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] byte[] pv, int cb, IntPtr pcbWritten);
-               void Seek (long dlibMove, int dwOrigin, IntPtr plibNewPosition);
-               void SetSize (long libNewSize);
-               void CopyTo (IStream pstm, long cb, IntPtr pcbRead, IntPtr pcbWritten);
-               void Commit (int grfCommitFlags);
-               void Revert ();
-               void LockRegion (long libOffset, long cb, int dwLockType);
-               void UnlockRegion (long libOffset, long cb, int dwLockType);
-               void Stat (out STATSTG pstatstg, int grfStatFlag);
-               void Clone (out IStream ppstm);
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/ITypeComp.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/ITypeComp.cs
deleted file mode 100644 (file)
index ad65589..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-// System.Runtime.InteropServices.ComTypes.ITypeComp.cs
-//
-// Paolo Molaro (lupus@ximian.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-// (C) 2002 Ximian, Inc.
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [ComImport]
-       [Guid("00020403-0000-0000-c000-000000000046")]
-       [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
-       public interface ITypeComp {
-               void Bind([MarshalAs(UnmanagedType.LPWStr)] string szName, int lHashVal, short wFlags, out ITypeInfo ppTInfo, out DESCKIND pDescKind, out BINDPTR pBindPtr);
-               void BindType([MarshalAs(UnmanagedType.LPWStr)] string szName, int lHashVal, out ITypeInfo ppTInfo, out ITypeComp ppTComp);
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/ITypeInfo.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/ITypeInfo.cs
deleted file mode 100644 (file)
index 607f044..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-// System.Runtime.InteropServices.ComTypes.ITypeInfo.cs
-//
-// Paolo Molaro (lupus@ximian.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-// (C) 2002 Ximian, Inc.
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [ComImport]
-       [Guid("00020401-0000-0000-c000-000000000046")]
-       [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
-       public interface ITypeInfo {
-               void GetTypeAttr (out IntPtr ppTypeAttr);
-               void GetTypeComp (out ITypeComp ppTComp);
-               void GetFuncDesc (int index, out IntPtr ppFuncDesc);
-               void GetVarDesc (int index, out IntPtr ppVarDesc);
-               void GetNames (int memid, [Out, MarshalAs (UnmanagedType.LPArray, SizeParamIndex=2)] string[] rgBstrNames, int cMaxNames, out int pcNames);
-               void GetRefTypeOfImplType (int index, out int href);
-               void GetImplTypeFlags (int index, out IMPLTYPEFLAGS pImplTypeFlags);
-               void GetIDsOfNames ([In, MarshalAs(UnmanagedType.LPArray, ArraySubType = (UnmanagedType.LPWStr), SizeParamIndex=1)] string[] rgszNames, int cNames, [Out, MarshalAs (UnmanagedType.LPArray, SizeParamIndex=1)] int[] pMemId);
-               void Invoke ([MarshalAs (UnmanagedType.IUnknown)] object pvInstance, int memid, short wFlags, ref DISPPARAMS pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, out int puArgErr);
-               void GetDocumentation (int index, out string strName, out string strDocString, out int dwHelpContext, out string strHelpFile);
-               void GetDllEntry (int memid, INVOKEKIND invKind, IntPtr pBstrDllName, IntPtr pBstrName, IntPtr pwOrdinal);
-               void GetRefTypeInfo (int hRef, out ITypeInfo ppTI);             
-               void AddressOfMember (int memid, INVOKEKIND invKind, out IntPtr ppv); 
-               void CreateInstance ([MarshalAs (UnmanagedType.IUnknown)] object pUnkOuter, [In] ref Guid riid, [MarshalAs (UnmanagedType.IUnknown)] out object ppvObj);
-               void GetMops (int memid, out string pBstrMops);
-               void GetContainingTypeLib (out ITypeLib ppTLB, out int pIndex);
-               [PreserveSig]
-               void ReleaseTypeAttr (IntPtr pTypeAttr);
-               [PreserveSig]
-               void ReleaseFuncDesc (IntPtr pFuncDesc);
-               [PreserveSig]
-               void ReleaseVarDesc (IntPtr pVarDesc);
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/ITypeInfo2.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/ITypeInfo2.cs
deleted file mode 100644 (file)
index 1b9544f..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.ITypeInfo2.cs
-//
-// Author:
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [ComImport]
-       [Guid("00020412-0000-0000-C000-000000000046")]
-       [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
-       public interface ITypeInfo2 : ITypeInfo
-       {
-               new void AddressOfMember (int memid, INVOKEKIND invKind, out IntPtr ppv);
-               new void CreateInstance ([MarshalAs (UnmanagedType.IUnknown)] object pUnkOuter, [In] ref Guid riid, [MarshalAs (UnmanagedType.IUnknown)] out object ppvObj);
-               new void GetContainingTypeLib (out ITypeLib ppTLB, out int pIndex);
-               new void GetDllEntry (int memid, INVOKEKIND invKind, IntPtr pBstrDllName, IntPtr pBstrName, IntPtr pwOrdinal);
-               new void GetDocumentation (int index, out string strName, out string strDocString, out int dwHelpContext, out string strHelpFile);
-               new void GetIDsOfNames ([In, MarshalAs(UnmanagedType.LPArray, ArraySubType = (UnmanagedType.LPWStr), SizeParamIndex=1)] string[] rgszNames, int cNames, [Out, MarshalAs (UnmanagedType.LPArray, SizeParamIndex=1)] int[] pMemId);
-
-               new void GetImplTypeFlags (int index, out IMPLTYPEFLAGS pImplTypeFlags);
-               void GetTypeKind (out TYPEKIND pTypeKind);
-               void GetTypeFlags (out int pTypeFlags);
-               new void GetFuncDesc (int index, out IntPtr ppFuncDesc);
-               new void GetMops (int memid, out string pBstrMops);
-               new void GetNames (int memid, [Out, MarshalAs (UnmanagedType.LPArray, SizeParamIndex=2)] string[] rgBstrNames, int cMaxNames, out int pcNames);
-               new void GetRefTypeInfo (int hRef, out ITypeInfo ppTI);
-               new void GetRefTypeOfImplType (int index, out int href);
-               new void GetTypeAttr (out IntPtr ppTypeAttr);
-               new void GetTypeComp (out ITypeComp ppTComp);
-               new void GetVarDesc (int index, out IntPtr ppVarDesc);
-               void GetFuncIndexOfMemId (int memid, INVOKEKIND invKind, out int pFuncIndex);
-               void GetVarIndexOfMemId (int memid, out int pVarIndex);
-               void GetCustData (ref Guid guid, out object pVarVal);
-               void GetFuncCustData(int index, ref Guid guid, out object pVarVal);
-               void GetParamCustData(int indexFunc, int indexParam, ref Guid guid, out object pVarVal);
-               void GetVarCustData(int index, ref Guid guid, out object pVarVal);
-               void GetImplTypeCustData(int index, ref Guid guid, out object pVarVal);
-               [LCIDConversion (1)]
-               void GetDocumentation2(int memid, out string pbstrHelpString, out int pdwHelpStringContext, out string pbstrHelpStringDll);
-               void GetAllCustData(IntPtr pCustData);
-               void GetAllFuncCustData(int index, IntPtr pCustData);
-               void GetAllParamCustData(int indexFunc, int indexParam, IntPtr pCustData);
-               void GetAllVarCustData(int index, IntPtr pCustData);
-               void GetAllImplTypeCustData(int index, IntPtr pCustData);
-               new void Invoke ([MarshalAs (UnmanagedType.IUnknown)] object pvInstance, int memid, short wFlags, ref DISPPARAMS pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, out int puArgErr);
-               [PreserveSig]
-               new void ReleaseTypeAttr (IntPtr pTypeAttr);
-               [PreserveSig]
-               new void ReleaseFuncDesc (IntPtr pFuncDesc);
-               [PreserveSig]
-               new void ReleaseVarDesc (IntPtr pVarDesc);
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/ITypeLib.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/ITypeLib.cs
deleted file mode 100644 (file)
index 8f9330d..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-// System.Runtime.InteropServices.ComTypes.ITypeLib.cs
-//
-// Paolo Molaro (lupus@ximian.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-// (C) 2002 Ximian, Inc.
-using System;
-using System.Runtime.InteropServices.ComTypes;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [ComImport]
-       [Guid("00020402-0000-0000-c000-000000000046")]
-       [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
-       public interface ITypeLib { 
-               [PreserveSig]
-               int GetTypeInfoCount ();
-               void GetTypeInfo (int index, out ITypeInfo ppTI);
-               void GetTypeInfoType (int index, out TYPEKIND pTKind);
-               void GetTypeInfoOfGuid (ref Guid guid, out ITypeInfo ppTInfo);
-               void GetLibAttr (out IntPtr ppTLibAttr);
-               void GetTypeComp (out ITypeComp ppTComp); 
-               void GetDocumentation (int index, out string strName, out string strDocString, out int dwHelpContext, out string strHelpFile);
-               [return: MarshalAs (UnmanagedType.Bool)]
-               bool IsName ([MarshalAs(UnmanagedType.LPWStr)] string szNameBuf, int lHashVal);
-               void FindName ([MarshalAs(UnmanagedType.LPWStr)] string szNameBuf, int lHashVal, [Out, MarshalAs (UnmanagedType.LPArray)] ITypeInfo[] ppTInfo, [Out, MarshalAs (UnmanagedType.LPArray)] int[] rgMemId, ref short pcFound);
-               [PreserveSig]
-               void ReleaseTLibAttr (IntPtr pTLibAttr);
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/ITypeLib2.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/ITypeLib2.cs
deleted file mode 100644 (file)
index 6aae3ee..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.ITypeLib2.cs
-//
-// Author:
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [ComImport]
-       [Guid ("00020411-0000-0000-C000-000000000046")]
-       [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
-       public interface ITypeLib2 : ITypeLib
-       {
-               new void FindName ([MarshalAs(UnmanagedType.LPWStr)] string szNameBuf, int lHashVal, [Out, MarshalAs (UnmanagedType.LPArray)] ITypeInfo[] ppTInfo, [Out, MarshalAs (UnmanagedType.LPArray)] int[] rgMemId, ref short pcFound);
-               void GetCustData(ref Guid guid, out object pVarVal);
-               new void GetDocumentation (int index, out string strName, out string strDocString, out int dwHelpContext, out string strHelpFile);
-               new void GetLibAttr (out IntPtr ppTLibAttr);
-               void GetLibStatistics(IntPtr pcUniqueNames, out int pcchUniqueNames);
-               [LCIDConversion(1)]
-               void GetDocumentation2(int index, out string pbstrHelpString, out int pdwHelpStringContext, out string pbstrHelpStringDll);
-               void GetAllCustData(IntPtr pCustData);
-               new void GetTypeComp (out ITypeComp ppTComp);
-               new void GetTypeInfo (int index, out ITypeInfo ppTI);
-               new void GetTypeInfoOfGuid (ref Guid guid, out ITypeInfo ppTInfo);
-               new void GetTypeInfoType (int index, out TYPEKIND pTKind);
-               [return: MarshalAs (UnmanagedType.Bool)]
-               new bool IsName ([MarshalAs(UnmanagedType.LPWStr)] string szNameBuf, int lHashVal);
-               [PreserveSig]
-               new void ReleaseTLibAttr (IntPtr pTLibAttr);
-               // undocumented
-               [PreserveSig]
-               new int GetTypeInfoCount ();
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/LIBFLAGS.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/LIBFLAGS.cs
deleted file mode 100644 (file)
index c25dbb2..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.LIBFLAGS.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [Flags, Serializable]
-       public enum LIBFLAGS
-       {
-               LIBFLAG_FRESTRICTED = 1,
-               LIBFLAG_FCONTROL = 2,
-               LIBFLAG_FHIDDEN = 4,
-               LIBFLAG_FHASDISKIMAGE = 8
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/PARAMDESC.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/PARAMDESC.cs
deleted file mode 100644 (file)
index ba54d8b..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.PARAMDESC.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [StructLayout (LayoutKind.Sequential, CharSet = CharSet.Unicode)]
-       public struct PARAMDESC
-       {
-               public IntPtr lpVarValue;
-               public PARAMFLAG wParamFlags;
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/PARAMFLAG.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/PARAMFLAG.cs
deleted file mode 100644 (file)
index 5d2af1c..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.PARAMFLAG.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [Flags, Serializable]
-       public enum PARAMFLAG
-       {
-               PARAMFLAG_NONE = 0,
-               PARAMFLAG_FIN = 1,
-               PARAMFLAG_FOUT = 2,
-               PARAMFLAG_FLCID = 4,
-               PARAMFLAG_FRETVAL = 8,
-               PARAMFLAG_FOPT = 16,
-               PARAMFLAG_FHASDEFAULT = 32,
-               PARAMFLAG_FHASCUSTDATA = 64
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/STATSTG.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/STATSTG.cs
deleted file mode 100644 (file)
index ffc4c1a..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.STATSTG.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
-       public struct STATSTG
-       {
-               public string pwcsName;
-               public int type;
-               public long cbSize;
-               public FILETIME mtime;
-               public FILETIME ctime;
-               public FILETIME atime;
-               public int grfMode;
-               public int grfLocksSupported;
-               public Guid clsid;
-               public int grfStateBits;
-               public int reserved;
-       }
-
-}
-
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/SYSKIND.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/SYSKIND.cs
deleted file mode 100644 (file)
index e854f09..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.SYSKIND.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [Serializable]
-       public enum SYSKIND
-       {
-               SYS_WIN16 = 0,
-               SYS_WIN32 = 1,
-               SYS_MAC = 2,
-               SYS_WIN64 = 3
-       }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/TYPEATTR.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/TYPEATTR.cs
deleted file mode 100644 (file)
index 9ff0bc1..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.TYPEATTR.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [StructLayout (LayoutKind.Sequential, CharSet = CharSet.Unicode)]
-       public struct TYPEATTR
-       {
-               public const int MEMBER_ID_NIL = -1;
-
-               public Guid guid;
-               public int lcid;
-               public int dwReserved;
-               public int memidConstructor;
-               public int memidDestructor;
-               public IntPtr lpstrSchema;
-               public int cbSizeInstance;
-               public TYPEKIND typekind;
-               public short cFuncs;
-               public short cVars;
-               public short cImplTypes;
-               public short cbSizeVft;
-               public short cbAlignment;
-               public TYPEFLAGS wTypeFlags;
-               public short wMajorVerNum;
-               public short wMinorVerNum;
-               public TYPEDESC tdescAlias;
-               public IDLDESC idldescType;
-       }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/TYPEDESC.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/TYPEDESC.cs
deleted file mode 100644 (file)
index ac11106..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.TYPEDESC.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [StructLayout (LayoutKind.Sequential, CharSet = CharSet.Unicode)]
-       public struct TYPEDESC
-       {
-               public IntPtr lpValue;
-               public short vt;
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/TYPEFLAGS.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/TYPEFLAGS.cs
deleted file mode 100644 (file)
index 1a25108..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.TYPEFLAGS.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [Serializable, Flags]
-       public enum TYPEFLAGS
-       {
-               TYPEFLAG_FAPPOBJECT = 1,
-               TYPEFLAG_FCANCREATE = 2,
-               TYPEFLAG_FLICENSED = 4,
-               TYPEFLAG_FPREDECLID = 8,
-               TYPEFLAG_FHIDDEN = 16,
-               TYPEFLAG_FCONTROL = 32,
-               TYPEFLAG_FDUAL = 64,
-               TYPEFLAG_FNONEXTENSIBLE = 128,
-               TYPEFLAG_FOLEAUTOMATION = 256,
-               TYPEFLAG_FRESTRICTED = 512,
-               TYPEFLAG_FAGGREGATABLE = 1024,
-               TYPEFLAG_FREPLACEABLE = 2048,
-               TYPEFLAG_FDISPATCHABLE = 4096,
-               TYPEFLAG_FREVERSEBIND = 8192,
-               TYPEFLAG_FPROXY = 16384
-       }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/TYPEKIND.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/TYPEKIND.cs
deleted file mode 100644 (file)
index 3156769..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-// System.Runtime.InteropServices.ComTypes/TYPEKIND.cs
-//
-// Paolo Molaro (lupus@ximian.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-// (C) 2002 Ximian, Inc.
-
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-
-       [Serializable]
-       public enum TYPEKIND { 
-               TKIND_ENUM = 0,
-               TKIND_RECORD = 1,
-               TKIND_MODULE = 2,
-               TKIND_INTERFACE = 3,
-               TKIND_DISPATCH = 4,
-               TKIND_COCLASS = 5,
-               TKIND_ALIAS = 6,
-               TKIND_UNION = 7,
-               TKIND_MAX = 8
-       }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/TYPELIBATTR.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/TYPELIBATTR.cs
deleted file mode 100644 (file)
index ceacf68..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.TYPELIBATTR.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [Serializable]
-       [StructLayout (LayoutKind.Sequential, CharSet = CharSet.Unicode)]
-       public struct TYPELIBATTR
-       {
-               public Guid guid;
-               public int lcid;
-               public SYSKIND syskind;
-               public short wMajorVerNum;
-               public short wMinorVerNum;
-               public LIBFLAGS wLibFlags;
-       }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/VARDESC.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/VARDESC.cs
deleted file mode 100644 (file)
index 08fb7e6..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.VARDESC.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [StructLayout (LayoutKind.Sequential, CharSet = CharSet.Unicode)]
-       public struct VARDESC
-       {
-               public int memid;
-               public string lpstrSchema;
-               public DESCUNION desc;
-               public ELEMDESC elemdescVar;
-               public short wVarFlags;
-               public VARKIND varkind;
-
-               [StructLayout (LayoutKind.Explicit, CharSet = CharSet.Unicode)]
-               public struct DESCUNION
-               {
-                       [FieldOffset (0)]
-                       public IntPtr lpvarValue;
-                       [FieldOffset (0)]
-                       public int oInst;
-               }
-       } 
-}
-
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/VARFLAGS.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/VARFLAGS.cs
deleted file mode 100644 (file)
index 5ef0007..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.VARFLAGS.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [Serializable, Flags]
-       public enum VARFLAGS
-       {
-               VARFLAG_FREADONLY = 1,
-               VARFLAG_FSOURCE = 2,
-               VARFLAG_FBINDABLE = 4,
-               VARFLAG_FREQUESTEDIT = 8,
-               VARFLAG_FDISPLAYBIND = 16,
-               VARFLAG_FDEFAULTBIND = 32,
-               VARFLAG_FHIDDEN = 64,
-               VARFLAG_FRESTRICTED = 128,
-               VARFLAG_FDEFAULTCOLLELEM = 256,
-               VARFLAG_FUIDEFAULT = 512,
-               VARFLAG_FNONBROWSABLE = 1024,
-               VARFLAG_FREPLACEABLE = 2048,
-               VARFLAG_FIMMEDIATEBIND = 4096
-       }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/VARKIND.cs b/mcs/class/corlib/System.Runtime.InteropServices.ComTypes/VARKIND.cs
deleted file mode 100644 (file)
index d104208..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Runtime.InteropServices.ComTypes.VARKIND.cs
-//
-// Author:
-//   Kazuki Oikawa (kazuki@panicode.com)
-//
-
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-       [Serializable]
-       public enum VARKIND
-       {
-               VAR_PERINSTANCE = 0,
-               VAR_STATIC = 1,
-               VAR_CONST = 2,
-               VAR_DISPATCH = 3
-       }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.Expando/Changelog b/mcs/class/corlib/System.Runtime.InteropServices.Expando/Changelog
deleted file mode 100644 (file)
index 18f209a..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-2007-08-08  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * IExpando.cs : [ComVisible]
-
-2003-11-13  Andreas Nahr <ClassDevelopment@A-SoftTech.com>
-
-       * IExpando.cs: Added attribute
-
-2002-11-20  Alejandro Sánchez Acosta  <raciel@es.gnu.org>
-
-       * IExpando.cs added.
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.Expando/IExpando.cs b/mcs/class/corlib/System.Runtime.InteropServices.Expando/IExpando.cs
deleted file mode 100644 (file)
index 1a2b283..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// System.Runtime.InteropServices.Expando.IExpando.cs
-//
-// Author:
-//    Alejandro Sánchez Acosta (raciel@es.gnu.org)
-// 
-// (C) Alejandro Sánchez Acosta
-// 
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Reflection;
-
-namespace System.Runtime.InteropServices.Expando
-{
-       [Guid("afbf15e6-c37c-11d2-b88e-00a0c9b471b8")]
-       [System.Runtime.InteropServices.ComVisible (true)]
-       public interface IExpando : IReflect
-       {
-               FieldInfo AddField (string name);
-
-               MethodInfo AddMethod (string name, Delegate method);
-
-               PropertyInfo AddProperty(string name);
-
-               void RemoveMember(MemberInfo m);
-       }
-}
index 70d5301222185c5ebccfbf1c17c8006a6a2fa9ca..eb324b5c64e688205b4672058ac9d312360929ed 100644 (file)
@@ -65,6 +65,11 @@ namespace System.Runtime.InteropServices.WindowsRuntime
                {
                        throw new NotImplementedException ();
                }
+
+               internal static bool ReportUnhandledError (Exception e)
+               {
+                       return false;
+               }
        }
 }
 
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/AllowReversePInvokeCallsAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/AllowReversePInvokeCallsAttribute.cs
deleted file mode 100644 (file)
index 60cfe51..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.Runtime.InteropServices.AllowReversePInvokeCallsAttribute.cs
-//
-// Copyrigh 2008 Novell, Inc.  http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-
-namespace System.Runtime.InteropServices {
-
-       [AttributeUsage (AttributeTargets.Method, AllowMultiple = false, Inherited=false)]
-       public sealed class AllowReversePInvokeCallsAttribute : Attribute {
-               public AllowReversePInvokeCallsAttribute () { }
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/AutomationProxyAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/AutomationProxyAttribute.cs
deleted file mode 100644 (file)
index b7277eb..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// System.Runtime.InteropServices.AutomationProxyAttribute.cs
-//
-// Name: Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Runtime.InteropServices {
-
-       [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
-                        AttributeTargets.Interface, Inherited=false)]
-       [ComVisible (true)]
-       public sealed class AutomationProxyAttribute : Attribute
-       {
-               bool val;
-               
-               public AutomationProxyAttribute (bool val)
-               {
-                       this.val = val;
-               }
-
-               public bool Value {
-                       get { return val; }
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/BestFitMappingAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/BestFitMappingAttribute.cs
deleted file mode 100644 (file)
index 758d35b..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-//
-// System.Runtime.InteropServices.BestFitMappingAttribute.cs
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Novell, Inc.  http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Runtime.InteropServices {
-
-       [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class | 
-                        AttributeTargets.Struct | AttributeTargets.Interface,
-                        Inherited=false)]
-       [ComVisible (true)]
-       public sealed class BestFitMappingAttribute : Attribute {
-               bool bfm;
-               
-               public BestFitMappingAttribute (bool BestFitMapping)
-               {
-                       this.bfm = BestFitMapping;
-               }
-
-               public bool ThrowOnUnmappableChar = false;
-               
-               public bool BestFitMapping {
-                       get {
-                               return bfm;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/CONNECTDATA.cs b/mcs/class/corlib/System.Runtime.InteropServices/CONNECTDATA.cs
deleted file mode 100644 (file)
index 50fedf6..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// System.Runtime.InteropServices.CONNECTDATA.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Runtime.InteropServices
-{
-       [Obsolete]
-       [StructLayout (LayoutKind.Sequential, CharSet = CharSet.Unicode)]
-       public struct CONNECTDATA
-       {
-               [MarshalAs (UnmanagedType.Interface)]
-               public object pUnk;
-               public int dwCookie;
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ClassInterfaceAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/ClassInterfaceAttribute.cs
deleted file mode 100644 (file)
index 3600cb4..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// System.Runtime.InteropServices.ClassInterfaceAttribute.cs
-//
-// Author:
-//   Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2002 Nick Drochak
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Runtime.InteropServices {
-
-       [AttributeUsage(AttributeTargets.Assembly | 
-                       AttributeTargets.Class, Inherited=false)]
-       [ComVisible (true)]
-       public sealed class ClassInterfaceAttribute : Attribute {
-               private ClassInterfaceType ciType;
-               
-               public ClassInterfaceAttribute ( short classInterfaceType ) {
-                       ciType = (ClassInterfaceType)classInterfaceType;
-               }
-
-               public ClassInterfaceAttribute ( ClassInterfaceType classInterfaceType ) {
-                       ciType = classInterfaceType;
-               }
-
-               public ClassInterfaceType Value {
-                       get {return ciType;}
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ClassInterfaceType.cs b/mcs/class/corlib/System.Runtime.InteropServices/ClassInterfaceType.cs
deleted file mode 100644 (file)
index 5d1d825..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// System.Runtime.InteropServices.ClassInterfaceType.cs
-//
-// Author:
-//   Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2002 Nick Drochak
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Runtime.InteropServices {
-
-       [Serializable]
-       [ComVisible (true)]
-       public enum ClassInterfaceType 
-       {
-               None = 0,
-  
-               AutoDispatch = 1,
-               AutoDual = 2
-
-       } // ClassInterfaceType
-
-} // System.Runtime.InteropServices
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/CoClassAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/CoClassAttribute.cs
deleted file mode 100644 (file)
index f813a62..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// System.Runtime.InteropServices.CoClassAttribute.cs
-//
-// Name: Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Runtime.InteropServices {
-
-       [AttributeUsage (AttributeTargets.Interface, Inherited=false)]
-       [ComVisible (true)]
-       public sealed class CoClassAttribute : Attribute
-       {
-
-               Type klass;
-               
-               public CoClassAttribute (Type coClass)
-               {
-                       klass = coClass;
-               }
-
-               public Type CoClass {
-                       get { return klass; }
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ComAliasNameAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/ComAliasNameAttribute.cs
deleted file mode 100644 (file)
index 74c3dfb..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// System.Runtime.InteropServices.ComAliasNameAttribute.cs
-//
-// Name: Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Runtime.InteropServices {
-       [AttributeUsage (AttributeTargets.Property | AttributeTargets.Field |
-                        AttributeTargets.Parameter | AttributeTargets.ReturnValue,
-                        Inherited=false)]
-       [ComVisible (true)]
-       public sealed class ComAliasNameAttribute : Attribute
-       {
-               string val;
-               
-               public ComAliasNameAttribute (string alias)
-               {
-                       val = alias;
-               }
-
-               public string Value {
-                       get { return val; }
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ComCompatibleVersionAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/ComCompatibleVersionAttribute.cs
deleted file mode 100644 (file)
index 566f246..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// System.Runtime.InteropServices.ComCompatibleVersionAttribute.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2003 Andreas Nahr
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Runtime.InteropServices
-{
-       [AttributeUsage(AttributeTargets.Assembly,      Inherited = false)]
-       [ComVisible (true)]
-       public sealed class ComCompatibleVersionAttribute : Attribute
-       {
-               private int major;
-               private int minor;
-               private int build;
-               private int revision;
-
-               public ComCompatibleVersionAttribute (int major, int minor, int build, int revision)
-               {
-                       this.major = major;
-                       this.minor = minor;
-                       this.build = build;
-                       this.revision = revision;
-               }
-
-               public int MajorVersion {
-                       get { return major; }
-               }
-
-               public int MinorVersion {
-                       get { return minor; }
-               }
-
-               public int BuildNumber {
-                       get { return build; }
-               }
-
-               public int RevisionNumber {
-                       get { return revision; }
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ComConversionLossAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/ComConversionLossAttribute.cs
deleted file mode 100644 (file)
index 6e633a5..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// System.Runtime.InteropServices.ComConversionLossAttribute.cs
-//
-// Name: Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Runtime.InteropServices {
-
-       [AttributeUsage (AttributeTargets.All, Inherited=false)]
-       [ComVisible (true)]
-       public sealed class ComConversionLossAttribute : Attribute
-       {
-               public ComConversionLossAttribute ()
-               {
-               }
-       }
-       
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ComDefaultInterfaceAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/ComDefaultInterfaceAttribute.cs
deleted file mode 100644 (file)
index 330255e..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Runtime.InteropServices.ComDefaultInterfaceAttribute
-//
-// Author:
-//   Kazuki Oikawa  (kazuki@panicode.com)
-//
-
-using System;
-
-namespace System.Runtime.InteropServices
-{
-       [AttributeUsage (AttributeTargets.Class, Inherited = false)]
-       [ComVisible (true)]
-       public sealed class ComDefaultInterfaceAttribute : Attribute
-       {
-               Type _type;
-
-               public ComDefaultInterfaceAttribute (Type defaultInterface)
-               {
-                       _type = defaultInterface;
-               }
-
-               public Type Value { get { return _type; }}
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ComEventInterfaceAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/ComEventInterfaceAttribute.cs
deleted file mode 100644 (file)
index 3b7000b..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// System.Runtime.InteropServices.ComEventInterfaceAttribute.cs
-//
-// Name: Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Runtime.InteropServices {
-
-       [AttributeUsage (AttributeTargets.Interface, Inherited=false)]
-       [ComVisible (true)]
-       public sealed class ComEventInterfaceAttribute : Attribute
-       {
-               Type si, ep;
-               
-               public ComEventInterfaceAttribute (Type SourceInterface,
-                                                  Type EventProvider)
-               {
-                       si = SourceInterface;
-                       ep = EventProvider;
-               }
-
-               public Type EventProvider {
-                       get { return ep; }
-               }
-
-               public Type SourceInterface {
-                       get { return si; }
-               }
-       }
-}
-               
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ComImportAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/ComImportAttribute.cs
deleted file mode 100644 (file)
index 7bf558e..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// System.Runtime.InteropServices.ComImportAttribute.cs
-//
-// Name: Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-// Copyright 2011 Xamarin Inc. All rights reserved.
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Runtime.InteropServices {
-
-       [AttributeUsage (AttributeTargets.Class |
-                        AttributeTargets.Interface, Inherited=false)]
-       [ComVisible (true)]
-#if MONOTOUCH
-       // code with [ComImport] will assert when running on device (AOT)
-       // the linker removes the attribute but it's not used, by default, on 
-       // user code. ref: assistly #2357
-       internal
-#else
-       public 
-#endif
-       sealed class ComImportAttribute : Attribute {
-
-               public ComImportAttribute ()
-               {
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ComInterfaceType.cs b/mcs/class/corlib/System.Runtime.InteropServices/ComInterfaceType.cs
deleted file mode 100644 (file)
index edfe6af..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// System.Runtime.InteropServices.ComInterfaceType.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Runtime.InteropServices
-{
-       [Serializable]
-       [ComVisible (true)]
-       public enum ComInterfaceType
-       {
-               InterfaceIsDual = 0,
-               InterfaceIsIUnknown = 1,
-               InterfaceIsIDispatch = 2,
-               InterfaceIsIInspectable = 3
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ComRegisterFunctionAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/ComRegisterFunctionAttribute.cs
deleted file mode 100644 (file)
index 5007b0f..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.Runtime.InteropServices.ComRegisterFunctionAttribute.cs
-//
-// Name: Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Runtime.InteropServices {
-
-       [AttributeUsage (AttributeTargets.Method, Inherited=false)]
-       [ComVisible (true)]
-       public sealed class ComRegisterFunctionAttribute : Attribute
-       {
-               public ComRegisterFunctionAttribute ()
-               {
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ComSourceInterfacesAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/ComSourceInterfacesAttribute.cs
deleted file mode 100644 (file)
index e03f494..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-//
-// System.Runtime.InteropServices.ComSourceInterfacesAttribute.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Runtime.Serialization;
-
-namespace System.Runtime.InteropServices
-{
-       [AttributeUsage (AttributeTargets.Class, Inherited = true),ComVisible(true)]
-       public sealed class ComSourceInterfacesAttribute : Attribute
-       {
-               private string internalValue;
-
-               public ComSourceInterfacesAttribute (string sourceInterfaces)
-               {
-                       internalValue = sourceInterfaces;
-               }
-
-               public ComSourceInterfacesAttribute (Type sourceInterface)
-               {
-                       internalValue = sourceInterface.ToString ();
-               }
-
-               public ComSourceInterfacesAttribute (Type sourceInterface1, Type sourceInterface2)
-               {
-                       internalValue = sourceInterface1.ToString () + sourceInterface2.ToString ();
-               }
-
-               public ComSourceInterfacesAttribute (Type sourceInterface1, Type sourceInterface2, Type sourceInterface3)
-               {
-                       internalValue = sourceInterface1.ToString () + sourceInterface2.ToString () +
-                               sourceInterface3.ToString ();
-               }
-
-               public ComSourceInterfacesAttribute (Type sourceInterface1, Type sourceInterface2, Type sourceInterface3, Type sourceInterface4)
-               {
-                       internalValue = sourceInterface1.ToString () + sourceInterface2.ToString () +
-                               sourceInterface3.ToString () + sourceInterface4.ToString ();
-               }
-               
-               public string Value {
-                       get {return internalValue; } 
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ComUnregisterFunctionAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/ComUnregisterFunctionAttribute.cs
deleted file mode 100644 (file)
index 86e0f4a..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// System.Runtime.InteropServices.ComUnregisterFunctionAttribute.cs
-//
-// Name: Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Runtime.InteropServices {
-
-       [AttributeUsage (AttributeTargets.Method, Inherited=false)]
-       [ComVisible (true)]
-       public sealed class ComUnregisterFunctionAttribute : Attribute
-       {
-               public ComUnregisterFunctionAttribute ()
-               {
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ComVisible.cs b/mcs/class/corlib/System.Runtime.InteropServices/ComVisible.cs
deleted file mode 100644 (file)
index efb88b0..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// System.Runtime.InteropServices.ComVisibleAttribute.cs
-//
-// Author:
-//   Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2002 Nick Drochak
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Runtime.InteropServices {
-
-       [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class
-               | AttributeTargets.Struct | AttributeTargets.Enum |
-               AttributeTargets.Method | AttributeTargets.Property |
-               AttributeTargets.Field | AttributeTargets.Interface |
-               AttributeTargets.Delegate, Inherited=false)]
-       [ComVisible (true)]
-       [StructLayout (LayoutKind.Sequential)]
-       public sealed class ComVisibleAttribute : Attribute {
-
-               private bool Visible = false;
-
-               public ComVisibleAttribute (bool visibility)
-               {
-                       Visible = visibility;
-               }
-
-               public bool Value {
-                       get { return Visible; }
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/DefaultCharSetAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/DefaultCharSetAttribute.cs
deleted file mode 100644 (file)
index c2baa7e..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// System.Runtime.InteropServices.DefaultCharSetAttribute
-//
-// Author:
-//   Kazuki Oikawa  (kazuki@panicode.com)
-//
-
-using System;
-using System.Runtime.Serialization;
-
-namespace System.Runtime.InteropServices
-{
-       [AttributeUsage (AttributeTargets.Module, Inherited = false)]
-       [ComVisible (true)]
-       public sealed class DefaultCharSetAttribute : Attribute
-       {
-               CharSet _set;
-
-               public DefaultCharSetAttribute (CharSet charSet)
-               {
-                       _set = charSet;
-               }
-
-               public CharSet CharSet { get { return _set; } }
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/DefaultDllImportSearchPathsAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/DefaultDllImportSearchPathsAttribute.cs
deleted file mode 100644 (file)
index 863a1f0..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// DefaultDllImportSearchPathsAttribute.cs
-//
-// Authors:
-//     Marek Safar  <marek.safar@gmail.com>
-//
-// Copyright (C) 2015 Xamarin Inc (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Runtime.InteropServices
-{
-       [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Method, AllowMultiple = false)]
-       [System.Runtime.InteropServices.ComVisible (false)]
-       public sealed class DefaultDllImportSearchPathsAttribute : Attribute
-       {
-               public DefaultDllImportSearchPathsAttribute(DllImportSearchPath paths)
-               {
-                       Paths = paths;
-               }
-
-               public DllImportSearchPath Paths { get; private set; }
-       }
-}
\ No newline at end of file
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/DispIdAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/DispIdAttribute.cs
deleted file mode 100644 (file)
index 488a440..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// System.Runtime.InteropServices.DispIdAttribute.cs
-//
-// Name: Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Runtime.InteropServices {
-
-       [AttributeUsage (AttributeTargets.Method | AttributeTargets.Property |
-                        AttributeTargets.Field | AttributeTargets.Event,
-                        Inherited=false)]
-       [ComVisible (true)]
-       public sealed class DispIdAttribute : Attribute
-       {
-               int id;
-               
-               public DispIdAttribute (int dispId)
-               {
-                       id = dispId;
-               }
-
-               public int Value {
-                       get { return id; }
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/DllImportAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/DllImportAttribute.cs
deleted file mode 100644 (file)
index 39ac038..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// System.Runtime.InteropServices.DllImportAttribute.cs
-//
-// Author:
-//   Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc.  http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-
-namespace System.Runtime.InteropServices {
-
-       [ComVisible(true)]
-       [AttributeUsage (AttributeTargets.Method, Inherited=false)]
-       [StructLayout (LayoutKind.Sequential)]
-       public sealed class DllImportAttribute: Attribute {
-               #region Sync with reflection.h
-               public CallingConvention CallingConvention;
-               public CharSet CharSet;
-               private string Dll;
-               public string EntryPoint;
-               public bool ExactSpelling;
-               public bool PreserveSig;
-               public bool SetLastError;
-
-               public bool BestFitMapping;
-               public bool ThrowOnUnmappableChar;
-               #endregion
-
-               public string Value {
-                       get {return Dll;}
-               }
-               
-               public DllImportAttribute (string dllName) {
-                       Dll = dllName;
-               }
-
-               
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/DllImportSearchPath.cs b/mcs/class/corlib/System.Runtime.InteropServices/DllImportSearchPath.cs
deleted file mode 100644 (file)
index 9bfa505..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// DllImportSearchPath.cs
-//
-// Authors:
-//     Marek Safar  <marek.safar@gmail.com>
-//
-// Copyright (C) 2015 Xamarin Inc (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Runtime.InteropServices
-{
-       [Flags]
-       public enum DllImportSearchPath
-       {
-               UseDllDirectoryForDependencies = 0x100,
-               ApplicationDirectory = 0x200,
-               UserDirectories = 0x400,
-               System32 = 0x800,
-               SafeDirectories = 0x1000,
-               AssemblyDirectory = 0x2,
-               LegacyBehavior = 0x0
-       }
-}
\ No newline at end of file
index 0e61c36b7fd57029c7db92ec042e5a68b6a15426..c9ce2f0949f58cead92740654fb9180cc6593e16 100644 (file)
@@ -30,7 +30,7 @@
 
 using System;
 
-#if !FULL_AOT_RUNTIME
+#if !MOBILE
 namespace System.Runtime.InteropServices
 {
        [Obsolete]
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/FieldOffsetAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/FieldOffsetAttribute.cs
deleted file mode 100644 (file)
index 93ffec0..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Runtime.InteropServices {
-       [ComVisible (true)]
-       [AttributeUsage (AttributeTargets.Field, Inherited=false)]
-       public sealed class FieldOffsetAttribute : Attribute {
-               private int val;
-               
-               public FieldOffsetAttribute( int offset) {
-                       val = offset;
-               }
-               public int Value {
-                       get {return val;}
-               }
-               
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/GuidAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/GuidAttribute.cs
deleted file mode 100644 (file)
index 894d767..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// System.Runtime.InteropServices.InAttribute.cs
-//
-// Author:
-//   Kevin Winchester (kwin@ns.sympatico.ca)
-//
-// (C) 2002 Kevin Winchester
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Runtime.InteropServices {
-
-       [ComVisible(true)]
-       [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | 
-                       AttributeTargets.Struct | AttributeTargets.Enum | 
-                       AttributeTargets.Interface | AttributeTargets.Delegate,
-                       Inherited=false)]
-       [StructLayout (LayoutKind.Sequential)]
-       public sealed class GuidAttribute : Attribute {
-               
-               private string guidValue;
-               
-               public GuidAttribute (string guid) {
-                       guidValue = guid;       
-               }
-               
-               public string Value {
-                       get {return guidValue;}
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/IDispatchImplAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/IDispatchImplAttribute.cs
deleted file mode 100644 (file)
index 6004233..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// System.Runtime.InteropServices.IDispatchImplAttribute.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Runtime.Serialization;
-
-namespace System.Runtime.InteropServices
-{
-       [Obsolete]
-       [ComVisible (true)]
-       [AttributeUsage (AttributeTargets.Class | AttributeTargets.Assembly, Inherited = false)]
-       public sealed class IDispatchImplAttribute : Attribute
-       {
-               private IDispatchImplType Impl;
-
-               public IDispatchImplAttribute (IDispatchImplType implType)
-               {
-                       Impl = implType;
-               }
-
-               public IDispatchImplAttribute (short implType)
-               {
-                       Impl = (IDispatchImplType)implType;
-               }
-
-               public IDispatchImplType Value {
-                       get { return Impl; } 
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/IDispatchImplType.cs b/mcs/class/corlib/System.Runtime.InteropServices/IDispatchImplType.cs
deleted file mode 100644 (file)
index 9b2db8b..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.Runtime.InteropServices.IDispatchImplType.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Runtime.InteropServices
-{
-       [Obsolete]
-       [ComVisible (true)]
-       [Serializable]
-       public enum IDispatchImplType
-       {
-               SystemDefinedImpl = 0,
-               InternalImpl = 1,
-               CompatibleImpl = 2
-       }
-}
index 36c663cb7de4d823e2e24c591665f7e597443617..8d23dc645970f3fb69e0bcd44bb7596bc07a96f5 100644 (file)
@@ -3,6 +3,9 @@
 // Eberhard Beilharz (eb1@sil.org)
 //
 // Copyright (C) 2011 SIL International
+
+#if FEATURE_COMINTEROP
+
 using System;
 using System.Runtime.CompilerServices;
 using System.Security;
@@ -36,3 +39,5 @@ namespace System.Runtime.InteropServices
                int GetHelpContext (out uint pdwHelpContext);
        }
 }
+
+#endif
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ImportedFromTypeLibAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/ImportedFromTypeLibAttribute.cs
deleted file mode 100644 (file)
index 2a26c78..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// System.Runtime.InteropServices.ImportedFromTypeLibAttribute.cs
-//
-// Name: Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if !FULL_AOT_RUNTIME
-using System;
-
-namespace System.Runtime.InteropServices {
-       
-       [ComVisible(true)]
-       [AttributeUsage (AttributeTargets.Assembly, Inherited=false)]
-       public sealed class ImportedFromTypeLibAttribute : Attribute
-       {
-               string TlbFile;
-               public ImportedFromTypeLibAttribute (string tlbFile)
-               {
-                       TlbFile = tlbFile;
-               }
-
-               public string Value {
-                       get { return TlbFile; }
-               }
-       } 
-}
-#endif
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/InAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/InAttribute.cs
deleted file mode 100644 (file)
index 01e8001..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.Runtime.InteropServices.InAttribute.cs
-//
-// Author:
-//   Paolo Molaro (lupus@ximian.com)
-//
-// (C) Ximian, Inc.  http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Runtime.InteropServices {
-
-       [ComVisible(true)]
-       [AttributeUsage (AttributeTargets.Parameter, Inherited=false)]
-       public sealed class InAttribute : Attribute {
-               public InAttribute () {
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/InterfaceTypeAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/InterfaceTypeAttribute.cs
deleted file mode 100644 (file)
index f409191..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-// System.Runtime.InteropServices.InterfaceTypeAttribute.cs
-//
-// Author:
-//   Kevin Winchester (kwin@ns.sympatico.ca)
-//
-// (C) 2002 Kevin Winchester
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Runtime.InteropServices {
-
-       [ComVisible(true)]
-       [AttributeUsage(AttributeTargets.Interface, Inherited=false)]
-       [StructLayout (LayoutKind.Sequential)]
-       public sealed class InterfaceTypeAttribute : Attribute {
-               
-               private ComInterfaceType intType;
-               
-               public InterfaceTypeAttribute (ComInterfaceType interfaceType){
-                       intType = interfaceType;
-               }
-
-               public InterfaceTypeAttribute (short interfaceType) {
-                       intType = (ComInterfaceType)interfaceType;
-               }
-               
-               public ComInterfaceType Value {
-                       get {return intType;}
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/LCIDConversionAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/LCIDConversionAttribute.cs
deleted file mode 100644 (file)
index ff370af..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// System.Runtime.InteropServices.LCIDConversionAttribute.cs
-//
-// Name: Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Runtime.InteropServices {
-
-       [ComVisible(true)]
-       [AttributeUsage (AttributeTargets.Method, Inherited=false)]
-       public sealed class LCIDConversionAttribute : Attribute
-       {
-               int id;
-               
-               public LCIDConversionAttribute (int lcid)
-               {
-                       id = lcid;
-               }
-
-               public int Value {
-                       get { return id; }
-               }
-       }
-}
index c77857c9db4dd14fc838e65332c83d1da25f0958..a58aa28cc7820b420904bbce01d868ff453a7ecc 100644 (file)
@@ -3,6 +3,9 @@
 // Eberhard Beilharz (eb1@sil.org)
 //
 // Copyright (C) 2012 SIL International
+
+#if FEATURE_COMINTEROP
+
 using System;
 using System.Runtime.CompilerServices;
 using System.Security;
@@ -61,3 +64,5 @@ namespace System.Runtime.InteropServices
                #endregion
        }
 }
+
+#endif
index b95713d4e0d013c99a68a7bc78cb4a3587728605..1b650da569d25bda48ab02c01ab63dadb89c4d9e 100644 (file)
@@ -408,10 +408,14 @@ namespace System.Runtime.InteropServices
 #if !FULL_AOT_RUNTIME
                public static int GetHRForException (Exception e)
                {
+#if FEATURE_COMINTEROP
                        var errorInfo = new ManagedErrorInfo(e);
                        SetErrorInfo (0, errorInfo);
 
                        return e.hresult;
+#else                  
+                       return -1;
+#endif
                }
 
                [MonoTODO]
@@ -574,7 +578,7 @@ namespace System.Runtime.InteropServices
                        throw new NotImplementedException ();                   
                }
 
-#if !FULL_AOT_RUNTIME
+#if !MOBILE
                [Obsolete]
                [MonoTODO]
                public static string GetTypeInfoName (UCOMITypeInfo pTI)
@@ -1503,6 +1507,7 @@ namespace System.Runtime.InteropServices
                        return null;
                }
 
+#if FEATURE_COMINTEROP
                [DllImport ("oleaut32.dll", CharSet=CharSet.Unicode, EntryPoint = "SetErrorInfo")]
                static extern int _SetErrorInfo (int dwReserved,
                        [MarshalAs(UnmanagedType.Interface)] IErrorInfo pIErrorInfo);
@@ -1551,7 +1556,7 @@ namespace System.Runtime.InteropServices
                        }
                        return retVal;
                }
-
+#endif
                public static Exception GetExceptionForHR (int errorCode)
                {
                        return GetExceptionForHR (errorCode, IntPtr.Zero);
@@ -1559,7 +1564,7 @@ namespace System.Runtime.InteropServices
 
                public static Exception GetExceptionForHR (int errorCode, IntPtr errorInfo)
                {
-#if !MOBILE
+#if FEATURE_COMINTEROP
                        IErrorInfo info = null;
                        if (errorInfo != (IntPtr)(-1)) {
                                if (errorInfo == IntPtr.Zero) {
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/OptionalAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/OptionalAttribute.cs
deleted file mode 100644 (file)
index 9aa7f2f..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Runtime.InteropServices {
-
-       [ComVisible(true)]
-       [AttributeUsage (AttributeTargets.Parameter, Inherited=false)]
-       public sealed class OptionalAttribute : Attribute {
-               public OptionalAttribute () {
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/OutAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/OutAttribute.cs
deleted file mode 100644 (file)
index a8ebb10..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// System.Runtime.InteropServices.OutAttribute.cs
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc.  http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Runtime.InteropServices {
-
-       [ComVisible(true)]
-       [AttributeUsage (AttributeTargets.Parameter, Inherited=false)]
-       public sealed class OutAttribute : Attribute {
-
-               public OutAttribute ()
-               {
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/PreserveSigAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/PreserveSigAttribute.cs
deleted file mode 100644 (file)
index c675cdb..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-// System.Runtime.InteropServices.PreserveSigAttribute.cs
-//
-// Name: Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Runtime.InteropServices {
-
-       [ComVisible(true)]
-       [AttributeUsage (AttributeTargets.Method, Inherited=false)]
-       public sealed class PreserveSigAttribute : Attribute
-       {
-               public PreserveSigAttribute ()
-               {
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/PrimaryInteropAssemblyAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/PrimaryInteropAssemblyAttribute.cs
deleted file mode 100644 (file)
index 3e56417..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// System.Runtime.InteropServices.PrimaryInteropAssemblyAttribute.cs
-//
-// Name: Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Runtime.InteropServices {
-
-       [ComVisible(true)]
-       [AttributeUsage (AttributeTargets.Assembly, Inherited=false
-               , AllowMultiple = true
-       )]
-       public sealed class PrimaryInteropAssemblyAttribute : Attribute
-       {
-               int major, minor;
-               
-               public PrimaryInteropAssemblyAttribute (int major, int minor)
-               {
-                       this.major = major;
-                       this.minor = minor;
-               }
-
-               public int MajorVersion {
-                       get { return major; }
-               }
-
-               public int MinorVersion {
-                       get { return minor; }
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ProgIdAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/ProgIdAttribute.cs
deleted file mode 100644 (file)
index 4168f15..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// System.Runtime.InteropServices.ProgIdAttribute.cs
-//
-// Name: Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Runtime.InteropServices {
-
-       [ComVisible(true)]
-       [AttributeUsage (AttributeTargets.Class, Inherited=false)]
-       public sealed class ProgIdAttribute : Attribute
-       {
-               string pid;
-               
-               public ProgIdAttribute (string progId)
-               {
-                       pid = progId;
-               }
-
-               public string Value {
-                       get { return pid; }
-               }
-       }
-
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/SetWin32ContextInIDispatchAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/SetWin32ContextInIDispatchAttribute.cs
deleted file mode 100644 (file)
index 694b265..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// System.Runtime.InteropServices.SetWin32ContextInIDispatchAttribute.cs
-//
-// Author:
-//   Gert Driesen (drieseng@users.sourceforge.net)
-//
-// (C) Novell, Inc.  http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Runtime.InteropServices 
-{
-       [Obsolete]
-       [ComVisible(true)]      
-       [AttributeUsage (AttributeTargets.Assembly, Inherited = false)]
-       public sealed class SetWin32ContextInIDispatchAttribute : Attribute
-       {
-               public SetWin32ContextInIDispatchAttribute ()
-               {
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/StructLayoutAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/StructLayoutAttribute.cs
deleted file mode 100644 (file)
index 2770391..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Runtime.InteropServices {
-
-       [ComVisible (true)]
-       [AttributeUsage (AttributeTargets.Class | AttributeTargets.Struct,
-                        Inherited=false)]
-       public sealed class StructLayoutAttribute : Attribute {
-               public CharSet CharSet = CharSet.Auto;
-               public int Pack = 8;
-               public int Size = 0;
-               private LayoutKind lkind;
-               
-               public StructLayoutAttribute( short layoutKind) {
-                       lkind = (LayoutKind)layoutKind;
-               }
-               public StructLayoutAttribute( LayoutKind layoutKind) {
-                       lkind = layoutKind;
-               }
-               public LayoutKind Value {
-                       get {return lkind;}
-               }
-               
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/TypeIdentifierAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/TypeIdentifierAttribute.cs
deleted file mode 100644 (file)
index 94e66d9..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-// System.Runtime.InteropServices.TypeIdentifierAttribute.cs
-// 
-// Name: Rodrigo Kumpera <rkumpera@novell.com>
-// 
-//
-// Copyright (C) 2010 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Runtime.InteropServices {
-       [AttributeUsageAttribute (AttributeTargets.Struct | AttributeTargets.Enum |
-                AttributeTargets.Interface | AttributeTargets.Delegate,
-               Inherited = false)]
-       public sealed class TypeIdentifierAttribute : Attribute {
-               string scope;
-               string identifier;
-
-               public TypeIdentifierAttribute ()
-               {
-               }
-
-               public TypeIdentifierAttribute (string scope, string identifier)
-               {
-                       this.scope = scope;
-                       this.identifier = identifier;
-               }               
-
-               public string Scope {
-                       get { return scope; }
-               }
-
-               public string Identifier {
-                       get { return identifier; }
-               }
-       }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/TypeLibFuncAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/TypeLibFuncAttribute.cs
deleted file mode 100644 (file)
index 215efa6..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// System.Runtime.InteropServices.TypeLibFuncAttribute.cs
-//
-// Name: Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if !FULL_AOT_RUNTIME
-using System;
-
-namespace System.Runtime.InteropServices {
-
-       [ComVisible(true)]
-       [AttributeUsage (AttributeTargets.Method, Inherited=false)]
-       public sealed class TypeLibFuncAttribute : Attribute
-       {
-               TypeLibFuncFlags flags;
-               
-               public TypeLibFuncAttribute (short flags)
-               {
-                       this.flags = (TypeLibFuncFlags) flags;
-               }
-
-               public TypeLibFuncAttribute (TypeLibFuncFlags flags)
-               {
-                       this.flags = flags;
-               }
-
-               public TypeLibFuncFlags Value {
-                       get { return flags; }
-               }
-       }
-}
-#endif
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/TypeLibFuncFlags.cs b/mcs/class/corlib/System.Runtime.InteropServices/TypeLibFuncFlags.cs
deleted file mode 100644 (file)
index b0dddbd..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-// System.Runtime.InteropServices.TypeLibFuncFlags.cs
-// 
-// Name: Duncan Mak  (duncan@ximian.com)
-// 
-// (C) Ximian, Inc.
-// 
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if !FULL_AOT_RUNTIME
-namespace System.Runtime.InteropServices {
-
-       [ComVisible(true)]
-       [Flags] [Serializable]
-       public enum TypeLibFuncFlags {
-               FRestricted = 1,
-               FSource = 2,
-               FBindable = 4,
-               FRequestEdit = 8,
-               FDisplayBind = 16,
-               FDefaultBind = 32,
-               FHidden = 64,
-               FUsesGetLastError = 128,
-               FDefaultCollelem = 256,
-               FUiDefault = 512,
-               FNonBrowsable = 1024,
-               FReplaceable = 2048,
-               FImmediateBind = 4096,
-       }
-}
-#endif
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/TypeLibImportClassAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/TypeLibImportClassAttribute.cs
deleted file mode 100644 (file)
index 43eb92a..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// System.Runtime.InteropServices.TypeLibImportClassAttribute.cs
-//
-// Author:
-//   Gert Driesen (drieseng@users.sourceforge.net)
-//
-// (C) 2005 Novell
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if !FULL_AOT_RUNTIME
-using System;
-
-namespace System.Runtime.InteropServices {
-
-       [ComVisible(true)]
-       [AttributeUsage(AttributeTargets.Interface, Inherited=false)]
-       public sealed class TypeLibImportClassAttribute : Attribute {
-               private string _importClass;
-               
-               public TypeLibImportClassAttribute (Type importClass) {
-                       _importClass = importClass.ToString ();
-               }
-
-               public string Value {
-                       get { return _importClass; }
-               }
-       }
-}
-#endif
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/TypeLibTypeAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/TypeLibTypeAttribute.cs
deleted file mode 100644 (file)
index 9a8a6a8..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// System.Runtime.InteropServices.TypeLibTypeAttribute.cs
-//
-// Name: Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if !FULL_AOT_RUNTIME
-using System;
-
-namespace System.Runtime.InteropServices {
-
-       [ComVisible(true)]
-       [AttributeUsage (AttributeTargets.Class | AttributeTargets.Struct |
-                        AttributeTargets.Enum | AttributeTargets.Interface, Inherited=false)]
-       public sealed class TypeLibTypeAttribute : Attribute
-       {
-               TypeLibTypeFlags flags;
-               
-               public TypeLibTypeAttribute (short flags)
-               {
-                       this.flags = (TypeLibTypeFlags) flags;
-               }
-
-               public TypeLibTypeAttribute (TypeLibTypeFlags flags)
-               {
-                       this.flags = flags;
-               }
-
-               public TypeLibTypeFlags Value {
-                       get { return flags; }
-               }
-       }
-}
-#endif
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/TypeLibTypeFlags.cs b/mcs/class/corlib/System.Runtime.InteropServices/TypeLibTypeFlags.cs
deleted file mode 100644 (file)
index 48e141b..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-// System.Runtime.InteropServices.TypeLibTypeFlags.cs
-// 
-// Name: Duncan Mak  (duncan@ximian.com)
-// 
-// (C) Ximian, Inc.
-// 
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if !FULL_AOT_RUNTIME
-namespace System.Runtime.InteropServices {
-       [ComVisible(true)]
-       [Flags] [Serializable]
-       public enum TypeLibTypeFlags {
-               FAppObject = 1,
-               FCanCreate = 2,
-               FLicensed = 4,
-               FPreDeclId = 8,
-               FHidden= 16,
-               FControl = 32,
-               FDual = 64,
-               FNonExtensible = 128,
-               FOleAutomation = 256,
-               FRestricted = 512,
-               FAggregatable = 1024,
-               FReplaceable = 2048,
-               FDispatchable = 4096,
-               FReverseBind = 8192,
-       }
-}
-#endif
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/TypeLibVarAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/TypeLibVarAttribute.cs
deleted file mode 100644 (file)
index 595f9d8..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// System.Runtime.InteropServices.TypeLibTypeAttribute.cs
-//
-// Name: Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if !FULL_AOT_RUNTIME
-using System;
-
-namespace System.Runtime.InteropServices {
-
-       [ComVisible(true)]
-       [AttributeUsage (AttributeTargets.Field, Inherited=false)]
-       public sealed class TypeLibVarAttribute : Attribute
-       {
-               TypeLibVarFlags flags;
-               
-               public TypeLibVarAttribute (short flags)
-               {
-                       this.flags = (TypeLibVarFlags) flags;
-               }
-
-               public TypeLibVarAttribute (TypeLibVarFlags flags)
-               {
-                       this.flags = flags;
-               }
-
-               public TypeLibVarFlags Value {
-                       get { return flags; }
-               }
-       }
-}
-#endif
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/TypeLibVarFlags.cs b/mcs/class/corlib/System.Runtime.InteropServices/TypeLibVarFlags.cs
deleted file mode 100644 (file)
index 09030d7..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-// System.Runtime.InteropServices.TypeLibVarFlags.cs
-// 
-// Name: Duncan Mak  (duncan@ximian.com)
-// 
-// (C) Ximian, Inc.
-// 
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if !FULL_AOT_RUNTIME
-namespace System.Runtime.InteropServices {
-       
-       [ComVisible(true)]
-       [Flags] [Serializable]
-       public enum TypeLibVarFlags {
-               FReadOnly = 1,
-               FSource = 2,
-               FBindable = 4,
-               FRequestEdit = 8,
-               FDisplayBind = 16,
-               FDefaultBind = 32,
-               FHidden = 64,
-               FRestricted = 128,
-               FDefaultCollelem = 256,
-               FUiDefault = 512,
-               FNonBrowsable = 1024,
-               FReplaceable = 2048,
-               FImmediateBind = 4096,
-       }
-}
-#endif
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/TypeLibVersionAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/TypeLibVersionAttribute.cs
deleted file mode 100644 (file)
index e4a16bf..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// System.Runtime.InteropServices.TypeLibVersionAttribute.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2003 Andreas Nahr
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Runtime.InteropServices
-{
-       [ComVisible(true)]
-       [AttributeUsage(AttributeTargets.Assembly, Inherited = false)]
-       public sealed class TypeLibVersionAttribute : Attribute
-       {
-               private int major;
-               private int minor;
-
-               public TypeLibVersionAttribute (int major, int minor)
-               {
-                       this.major = major;
-                       this.minor = minor;
-               }
-
-               public int MajorVersion {
-                       get { return major; }
-               }
-
-               public int MinorVersion {
-                       get { return minor; }
-               }
-       }
-}
-
-
index cd0e84f3fc81d116272581d4771f4e5d0532543b..0e4a5d4592f0e15ffc21580de6833c0ca67b0620 100644 (file)
@@ -26,7 +26,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if !FULL_AOT_RUNTIME
+#if !MOBILE
 namespace System.Runtime.InteropServices
 {
        [Obsolete]
index 8011610ab7bcf250fc236fa0a56ef2ab359d0523..d652123058a73830f002b67d6e42898e9ba47b90 100644 (file)
@@ -26,7 +26,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if !FULL_AOT_RUNTIME
+#if !MOBILE
 namespace System.Runtime.InteropServices
 {
        [Obsolete]
index bb669b78e0d47ed47cdcf9dcd2befe3b6f13b757..02f4a456d4b1d1eeedb8954afc4aadc3c435e04a 100644 (file)
@@ -26,7 +26,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if !FULL_AOT_RUNTIME
+#if !MOBILE
 namespace System.Runtime.InteropServices
 {
        [Obsolete]
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/UCOMIEnumConnections.cs b/mcs/class/corlib/System.Runtime.InteropServices/UCOMIEnumConnections.cs
deleted file mode 100644 (file)
index abfb10c..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// System.Runtime.InteropServices.UCOMIEnumConnections.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if !FULL_AOT_RUNTIME
-namespace System.Runtime.InteropServices
-{
-       [Obsolete]
-       [ComImport]
-       [Guid ("b196b287-bab4-101a-b69c-00aa00341d07")]
-       [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
-       public interface UCOMIEnumConnections
-       {
-               [PreserveSig]
-               int Next (int celt, [Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] CONNECTDATA[] rgelt, out int pceltFetched);
-               [PreserveSig]
-               int Skip (int celt);
-               [PreserveSig]
-               void Reset ();
-               void Clone (out UCOMIEnumConnections ppenum);
-       }
-}
-#endif
index 12af145c4cd4ae22756c4f5cbc5eb7823fdc91d3..eb10fe08716812160c5daa133f4c5ce826f0c96a 100644 (file)
@@ -28,7 +28,7 @@
 //
 // (C) 2002 Ximian, Inc.
 
-#if !FULL_AOT_RUNTIME
+#if !MOBILE
 namespace System.Runtime.InteropServices
 {
        [Obsolete]
index a8b4a1600b6429d838223683ed21783147f38dd3..5d374f12ea93616af855dcbcadf642eccbf05b90 100644 (file)
@@ -28,7 +28,7 @@
 //
 // (C) 2002 Ximian, Inc.
 
-#if !FULL_AOT_RUNTIME
+#if !MOBILE
 namespace System.Runtime.InteropServices
 {
        [Obsolete]
index 2b9c1ccdc0da9ae69006d80cf71dc6e0b45217ec..46137121a6db1be7833f29f802bb59fbe4d425a3 100644 (file)
@@ -28,7 +28,7 @@
 //
 // (C) 2002 Ximian, Inc.
 
-#if !FULL_AOT_RUNTIME
+#if !MOBILE
 namespace System.Runtime.InteropServices
 {
        [Obsolete]
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/UnmanagedFunctionPointerAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/UnmanagedFunctionPointerAttribute.cs
deleted file mode 100644 (file)
index 9b73299..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-// System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute.cs
-//
-// Author:
-//   Zoltan Varga (vargaz@gmail.com)
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Runtime.InteropServices {
-
-       [AttributeUsage (AttributeTargets.Delegate, Inherited = false,AllowMultiple=false),ComVisible(true)]
-       [StructLayout (LayoutKind.Sequential)]
-       public sealed class UnmanagedFunctionPointerAttribute: Attribute {
-               #region Sync with object-internals.h
-               private CallingConvention call_conv;
-               public CharSet CharSet;
-               public bool SetLastError;
-               public bool BestFitMapping;
-               public bool ThrowOnUnmappableChar;
-               #endregion
-
-               public CallingConvention CallingConvention {
-                       get {
-                               return call_conv;
-                       }
-               }
-               
-               public UnmanagedFunctionPointerAttribute (CallingConvention callingConvention) {
-                       this.call_conv = callingConvention;
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/UnmanagedType.cs b/mcs/class/corlib/System.Runtime.InteropServices/UnmanagedType.cs
deleted file mode 100644 (file)
index b2fbb14..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-// UnmanagedType.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc.  http://www.ximian.com
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Runtime.InteropServices {
-
-
-       [ComVisible(true)]
-       [Serializable]
-       public enum UnmanagedType {
-
-               Bool = 2,
-               I1 = 3,
-               U1 = 4,
-               I2 = 5,
-               U2 = 6,
-               I4 = 7,
-               U4 = 8,
-               I8 = 9,
-               U8 = 10,
-               R4 = 11,
-               R8 = 12,
-               Currency = 15,
-               BStr = 19,
-               LPStr = 20,
-               LPWStr = 21,
-               LPTStr = 22,
-               ByValTStr = 23,
-               IUnknown = 25,
-               IDispatch = 26,
-               Struct = 27,
-               Interface = 28,
-               SafeArray = 29,
-               ByValArray = 30,
-               SysInt = 31,
-               SysUInt = 32,
-               VBByRefStr = 34,
-               AnsiBStr = 35,
-               TBStr = 36,
-               VariantBool = 37,
-               FunctionPtr = 38,
-               // LPVoid = 39,
-               AsAny = 40,
-               //RPrecise = 41,
-               LPArray = 42,
-               LPStruct = 43,
-               CustomMarshaler = 44,
-               Error = 45
-       } 
-
-} 
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/VarEnum.cs b/mcs/class/corlib/System.Runtime.InteropServices/VarEnum.cs
deleted file mode 100644 (file)
index afca3f6..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Runtime.InteropServices {
-       [ComVisible(true)]
-       [Serializable]
-       public enum VarEnum {
-               VT_EMPTY = 0,
-               VT_NULL = 1,
-               VT_I2 = 2,
-               VT_I4 = 3,
-               VT_R4 = 4,
-               VT_R8 = 5,
-               VT_CY = 6,
-               VT_DATE = 7,
-               VT_BSTR = 8,
-               VT_DISPATCH = 9,
-               VT_ERROR = 10,
-               VT_BOOL = 11,
-               VT_VARIANT = 12,
-               VT_UNKNOWN = 13,
-               VT_DECIMAL = 14,
-               VT_I1 = 16,
-               VT_UI1 = 17,
-               VT_UI2 = 18,
-               VT_UI4 = 19,
-               VT_I8 = 20,
-               VT_UI8 = 21,
-               VT_INT = 22,
-               VT_UINT = 23,
-               VT_VOID = 24,
-               VT_HRESULT = 25,
-               VT_PTR = 26,
-               VT_SAFEARRAY = 27,
-               VT_CARRAY = 28,
-               VT_USERDEFINED = 29,
-               VT_LPSTR = 30,
-               VT_LPWSTR = 31,
-               VT_RECORD = 36,
-               VT_FILETIME = 64,
-               VT_BLOB = 65,
-               VT_STREAM = 66,
-               VT_STORAGE = 67,
-               VT_STREAMED_OBJECT = 68,
-               VT_STORED_OBJECT = 69,
-               VT_BLOB_OBJECT = 70,
-               VT_CF = 71,
-               VT_CLSID = 72,
-               VT_VECTOR = 4096,
-               VT_ARRAY = 8192,
-               VT_BYREF = 16384
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.Reliability/CER.cs b/mcs/class/corlib/System.Runtime.Reliability/CER.cs
deleted file mode 100644 (file)
index 3a80a16..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.Runtime.Reliability.Consistency.cs
-//
-// Author:
-//    Duncan Mak (duncan@ximian.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-
-using System.Runtime.InteropServices;
-namespace System.Runtime.Reliability
-{
-       [Serializable]
-       [ComVisible (false)]
-        public enum CER
-        {
-                MayFail = 1,
-                None = 0, 
-                Success = 2
-        }
-}
diff --git a/mcs/class/corlib/System.Runtime.Reliability/ChangeLog b/mcs/class/corlib/System.Runtime.Reliability/ChangeLog
deleted file mode 100644 (file)
index 57a6f68..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-2005-03-04  Kazuki Oikawa  <kazuki@panicode.com>
-
-       * CER.cs:
-       * Consistency.cs:
-       * PrePrepareMethodAttribute.cs:
-       * ReliabilityContractAttribute.cs: Added missing attributes.
-
-2004-08-03  Sebastien Pouliot  <sebastien@ximian.com>
-
-       * CriticialFinalizerObject.cs: Moved to System.Runtime.
-       ConstrainedExecution to match Fx 2.0 beta 1.
-
-2004-07-12  Duncan Mak  <duncan@ximian.com>
-
-       * CER.cs: 
-       * Consistency.cs:
-       * CriticialFinalizerObject.cs:
-       * PrePrepareMethodAttribute.cs:
-       * ReliabilityContractAttribute.cs: Added.
-
diff --git a/mcs/class/corlib/System.Runtime.Reliability/Consistency.cs b/mcs/class/corlib/System.Runtime.Reliability/Consistency.cs
deleted file mode 100644 (file)
index 5babff4..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// System.Runtime.Reliability.Consistency.cs
-//
-// Author:
-//    Duncan Mak (duncan@ximian.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-
-using System.Runtime.InteropServices;
-namespace System.Runtime.Reliability
-{
-       [ComVisible (false)]
-       [Serializable]
-        public enum Consistency
-        {
-                MayCorruptAppDomain = 1,
-                MayCorruptInstance = 2, 
-                MayCorruptProcess = 0,
-                WillNotCorruptState = 3
-        }
-}
diff --git a/mcs/class/corlib/System.Runtime.Reliability/PrePrepareMethodAttribute.cs b/mcs/class/corlib/System.Runtime.Reliability/PrePrepareMethodAttribute.cs
deleted file mode 100644 (file)
index 8f1c055..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// System.Runtime.Reliability.PrePrepareMethodAttribute.cs
-//
-// Author:
-//    Duncan Mak (duncan@ximian.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-
-using System.Runtime.InteropServices;
-namespace System.Runtime.Reliability
-{
-               [Obsolete]
-               [AttributeUsage (AttributeTargets.Constructor | AttributeTargets.Method, Inherited = false)]
-               [ComVisible (false)]
-        public sealed class PrePrepareMethodAttribute : Attribute
-        {
-                public PrePrepareMethodAttribute ()
-                {
-                }
-        }
-}
diff --git a/mcs/class/corlib/System.Runtime.Reliability/ReliabilityContractAttribute.cs b/mcs/class/corlib/System.Runtime.Reliability/ReliabilityContractAttribute.cs
deleted file mode 100644 (file)
index 59e76c5..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// System.Runtime.Reliability.ReliabilityContractAttribute.cs
-//
-// Author:
-//    Duncan Mak (duncan@ximian.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-
-using System.Runtime.InteropServices;
-namespace System.Runtime.Reliability
-{
-               [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
-                       AttributeTargets.Struct | AttributeTargets.Constructor |
-                       AttributeTargets.Method | AttributeTargets.Interface, Inherited = false)]
-               [ComVisible (false)]
-               [Obsolete]
-        public sealed class ReliabilityContractAttribute : Attribute
-        {
-                Consistency consistency;
-                CER cer;
-                
-                public ReliabilityContractAttribute ()
-                {
-                }
-
-                public ReliabilityContractAttribute (Consistency consistency, CER cer)
-                {
-                        this.consistency = consistency;
-                        this.cer = cer;
-                }
-
-                public CER CER {
-                        get { return cer; }
-                                               set { cer = value;}
-                }
-
-                public Consistency ConsistencyGuarantee {
-
-                        get { return consistency; }
-
-                        set { consistency = value; }
-                }
-        }
-}
-
index 3dcdce4733ecca97dae696a57d974965f35a6a6e..7b8c0dfd92063a89d2543afc13374d44f769f9cc 100644 (file)
@@ -150,7 +150,13 @@ namespace System.Runtime.Remoting.Contexts {
                                        return rp.ObjectIdentity.ClientDynamicProperties;
                                }
                                else
+                               {
+#if FEATURE_REMOTING
                                        return obj.ObjectIdentity.ServerDynamicProperties;
+#else
+                                       throw new NotSupportedException ();
+#endif                                 
+                               }
                        }
                        else if (ctx != null && obj == null)
                        {
index 59f2c8bbd8ee64a53fe29e349622ea8034a6da92..06f54b12cebc44afca5334119e9e1837c7f64297 100644 (file)
@@ -56,7 +56,7 @@ namespace System.Runtime.Remoting
 
                                int baseCount = 0;
                                Type baseType = type.BaseType;
-                               while (baseType != typeof (MarshalByRefObject) && baseType != typeof(object))
+                               while (baseType != typeof (MarshalByRefObject) && baseType != null)
                                {
                                        baseType = baseType.BaseType;
                                        baseCount++;
diff --git a/mcs/class/corlib/System.Runtime.Versioning/ChangeLog b/mcs/class/corlib/System.Runtime.Versioning/ChangeLog
deleted file mode 100644 (file)
index 2497cc5..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-2009-12-03  Marek Habersack  <mhabersack@novell.com>
-
-       * FrameworkName.cs: added
-
-       * TargetFrameworkAttribute.cs: added
-
-2009-09-20  Sebastien Pouliot  <sebastien@ximian.com> 
-
-       * VersioningHelper.cs: Refactor AppDomain.Id for NET_2_1
-
-2005-10-31  Sebastien Pouliot  <sebastien@ximian.com> 
-
-       * ResourceConsumptionAttribute.cs: New. 2.0 attribute.
-       * ResourceExposureAttribute.cs: New. 2.0 attribute.
-       * ResourceScope.cs: New. 2.0 enum.
-       * VersioningHelper.cs: New. 2.0 public helper class.
diff --git a/mcs/class/corlib/System.Runtime.Versioning/ComponentGuaranteesAttribute.cs b/mcs/class/corlib/System.Runtime.Versioning/ComponentGuaranteesAttribute.cs
deleted file mode 100644 (file)
index d0c5f62..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// ComponentGuaranteesAttribute.cs
-//
-// Author:
-//   Marek Safar (marek.safar@gmail.com)
-//
-// Copyright (C) 2010 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Runtime.Versioning
-{
-       [AttributeUsageAttribute (AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct |
-               AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Event |
-               AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
-       public sealed class ComponentGuaranteesAttribute : Attribute
-       {
-               readonly ComponentGuaranteesOptions guarantees;
-
-               public ComponentGuaranteesAttribute (ComponentGuaranteesOptions guarantees)
-               {
-                       this.guarantees = guarantees;
-               }
-               
-               public ComponentGuaranteesOptions Guarantees {
-                       get {
-                               return guarantees;
-                       }
-               }
-       }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.Versioning/ComponentGuaranteesOptions.cs b/mcs/class/corlib/System.Runtime.Versioning/ComponentGuaranteesOptions.cs
deleted file mode 100644 (file)
index 70c0bbb..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// ComponentGuaranteesOptions.cs
-//
-// Author:
-//   Marek Safar (marek.safar@gmail.com)
-//
-// Copyright (C) 2010 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Runtime.Versioning
-{
-       [FlagsAttribute]
-       public enum ComponentGuaranteesOptions
-       {
-               None = 0,
-               Exchange = 1,
-               Stable = 2,
-               SideBySide = 4
-       }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.Versioning/ResourceConsumptionAttribute.cs b/mcs/class/corlib/System.Runtime.Versioning/ResourceConsumptionAttribute.cs
deleted file mode 100644 (file)
index 6d70d98..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// System.Runtime.Versioning.ResourceConsumptionAttribute class
-//
-// Authors
-//     Sebastien Pouliot  <sebastien@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Diagnostics;
-
-namespace System.Runtime.Versioning {
-
-       [AttributeUsage (AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property, Inherited = false)]
-       [Conditional ("RESOURCE_ANNOTATION_WORK")]
-       public sealed class ResourceConsumptionAttribute: Attribute {
-
-               private ResourceScope resource;
-               private ResourceScope consumption;
-
-               public ResourceConsumptionAttribute (ResourceScope resourceScope)
-               {
-                       resource = resourceScope;
-                       consumption = resourceScope;
-               }
-
-               public ResourceConsumptionAttribute (ResourceScope resourceScope, ResourceScope consumptionScope)
-               {
-                       resource = resourceScope;
-                       consumption = consumptionScope;
-               }
-
-
-               public ResourceScope ConsumptionScope {
-                       get { return consumption; }
-               }
-
-               public ResourceScope ResourceScope {
-                       get { return resource; }
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.Versioning/ResourceExposureAttribute.cs b/mcs/class/corlib/System.Runtime.Versioning/ResourceExposureAttribute.cs
deleted file mode 100644 (file)
index 23b4e71..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// System.Runtime.Versioning.ResourceExposureAttribute class
-//
-// Authors
-//     Sebastien Pouliot  <sebastien@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Diagnostics;
-
-namespace System.Runtime.Versioning {
-
-       [AttributeUsage (AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field, Inherited = false)]
-       [Conditional ("RESOURCE_ANNOTATION_WORK")]
-       public sealed class ResourceExposureAttribute: Attribute {
-
-               private ResourceScope exposure;
-
-               public ResourceExposureAttribute (ResourceScope exposureLevel)
-               {
-                       exposure = exposureLevel;
-               }
-
-
-               public ResourceScope ResourceExposureLevel {
-                       get { return exposure; }
-               }
-       }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.Versioning/ResourceScope.cs b/mcs/class/corlib/System.Runtime.Versioning/ResourceScope.cs
deleted file mode 100644 (file)
index 274dc6f..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// System.Runtime.Versioning.ResourceScope enumeration
-//
-// Authors
-//     Sebastien Pouliot  <sebastien@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Runtime.Versioning {
-
-       [Flags]
-       public enum ResourceScope {
-               None = 0,
-               Machine = 1,
-               Process = 2,
-               AppDomain = 4,
-               Library = 8,
-               Private = 16,
-               Assembly = 32
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.Versioning/TargetFrameworkAttribute.cs b/mcs/class/corlib/System.Runtime.Versioning/TargetFrameworkAttribute.cs
deleted file mode 100644 (file)
index a8f8c8f..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// System.Runtime.Versioning.TargetFrameworkAttribute class
-//
-// Authors
-//     Marek Habersack <mhabersack@novell.com>
-//
-// Copyright (C) 2009 Novell, Inc (http://novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Runtime.Versioning
-{
-       [AttributeUsageAttribute(AttributeTargets.Assembly, AllowMultiple = false, Inherited = false)]
-       public sealed class TargetFrameworkAttribute : Attribute
-       {
-               public string FrameworkName {
-                       get; private set;
-               }
-
-               public string FrameworkDisplayName {
-                       get; set;
-               }
-               
-               public TargetFrameworkAttribute (string frameworkName)
-               {
-                       if (frameworkName == null)
-                               throw new ArgumentNullException ("frameworkName");
-                       
-                       this.FrameworkName = frameworkName;
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.Versioning/VersioningHelper.cs b/mcs/class/corlib/System.Runtime.Versioning/VersioningHelper.cs
deleted file mode 100644 (file)
index 1f7dda0..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-//
-// System.Runtime.Versioning.VersioningHelper class
-//
-// Authors
-//     Sebastien Pouliot  <sebastien@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Runtime.Versioning {
-
-       public static class VersioningHelper {
-
-               static private int GetDomainId ()
-               {
-#if NET_2_1
-                       return 0;
-#else
-                       return AppDomain.CurrentDomain.Id;
-#endif
-               }
-
-               static private int GetProcessId ()
-               {
-                       // TODO - System.Diagnostics.Process class is located in System.dll
-                       return 0;
-               }
-
-               static string SafeName (string name, bool process, bool appdomain)
-               {
-                       if (process && appdomain) {
-                               return String.Concat (name, "_", GetProcessId ().ToString (),
-                                       "_", GetDomainId ().ToString ());
-                       } else if (process) {
-                               return String.Concat (name, "_", GetProcessId ().ToString ());
-                       } else if (appdomain) {
-                               return String.Concat (name, "_", GetDomainId ().ToString ());
-                       }
-                       // nothing, return original string
-                       return name;
-               }
-
-               static private string ConvertFromMachine (string name, ResourceScope to, Type type)
-               {
-                       switch (to) {
-                       case ResourceScope.Machine:
-                               return SafeName (name, false, false);
-                       case ResourceScope.Process:
-                               return SafeName (name, true, false);
-                       case ResourceScope.AppDomain:
-                               return SafeName (name, true, true);
-                       default:
-                               throw new ArgumentException ("to");
-                       }
-               }
-
-               static private string ConvertFromProcess (string name, ResourceScope to, Type type)
-               {
-                       if ((to < ResourceScope.Process) || (to >= ResourceScope.Private))
-                               throw new ArgumentException ("to");
-                       bool ad = ((to & ResourceScope.AppDomain) == ResourceScope.AppDomain);
-                       return SafeName (name, false, ad);
-               }
-
-               static private string ConvertFromAppDomain (string name, ResourceScope to, Type type)
-               {
-                       if ((to < ResourceScope.AppDomain) || (to >= ResourceScope.Private))
-                               throw new ArgumentException ("to");
-                       return SafeName (name, false, false);
-               }
-
-               [MonoTODO ("process id is always 0")]
-               static public string MakeVersionSafeName (string name, ResourceScope from, ResourceScope to)
-               {
-                       return MakeVersionSafeName (name, from, to, null);
-               }
-
-               [MonoTODO ("type?")]
-               static public string MakeVersionSafeName (string name, ResourceScope from, ResourceScope to, Type type)
-               {
-                       if ((from & ResourceScope.Private) != 0) {
-                               to &= ~(ResourceScope.Private | ResourceScope.Assembly);
-                       } else if ((from & ResourceScope.Assembly) != 0) {
-                               to &= ~ResourceScope.Assembly;
-                       }
-                       
-                       string result = (name == null) ? String.Empty : name;
-                       switch (from) {
-                       case ResourceScope.Machine:
-                       case ResourceScope.Machine | ResourceScope.Private:
-                       case ResourceScope.Machine | ResourceScope.Assembly:
-                               return ConvertFromMachine (result, to, type);
-                       case ResourceScope.Process:
-                       case ResourceScope.Process | ResourceScope.Private:
-                       case ResourceScope.Process | ResourceScope.Assembly:
-                               return ConvertFromProcess (result, to, type);
-                       case ResourceScope.AppDomain:
-                       case ResourceScope.AppDomain | ResourceScope.Private:
-                       case ResourceScope.AppDomain | ResourceScope.Assembly:
-                               return ConvertFromAppDomain (result, to, type);
-                       default:
-                               throw new ArgumentException ("from");
-                       }
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Security.Claims/Claim.cs b/mcs/class/corlib/System.Security.Claims/Claim.cs
deleted file mode 100644 (file)
index e40023f..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-//
-// Claim.cs
-//
-// Authors:
-//  Miguel de Icaza (miguel@xamarin.com)
-//
-// Copyright 2014 Xamarin Inc
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections.Generic;
-namespace System.Security.Claims {
-
-       [Serializable]
-       public class Claim {
-               public Claim (string type, string value)
-               : this (type, value, valueType: null, issuer: null, originalIssuer:null, subject: null)
-               {
-               }
-
-               public Claim (string type, string value, string valueType)
-               : this (type, value, valueType, issuer: null, originalIssuer: null, subject: null)
-               {
-               }
-
-               public Claim (string type, string value, string valueType, string issuer)
-               : this (type, value, valueType, issuer, originalIssuer: null, subject: null)
-               {
-               }
-               
-               public Claim (string type, string value, string valueType, string issuer, string originalIssuer)
-               : this (type, value, valueType, issuer, originalIssuer, subject: null)
-               {
-               }
-
-               public Claim (string type, string value, string valueType, string issuer, string originalIssuer, ClaimsIdentity subject)
-               {
-                       if (type == null)
-                               throw new ArgumentNullException ("type");
-                       if (value == null)
-                               throw new ArgumentNullException ("value");
-
-                       Properties = new Dictionary <string, string> ();
-
-                       Type = type;
-                       Value = value;
-                       ValueType = valueType == null ? ClaimValueTypes.String : valueType;
-                       Issuer = issuer == null ? ClaimsIdentity.DefaultIssuer : issuer;
-                       OriginalIssuer = originalIssuer == null ? Issuer : originalIssuer;
-                       Subject = subject;
-               }
-
-               public string Type { get; private set; }
-               public string Value { get; private set; }
-               public string ValueType { get; private set; }
-               public string Issuer { get; private set; }
-               public string OriginalIssuer { get; private set; }
-               public ClaimsIdentity Subject { get; internal set; }
-               public IDictionary<string,string> Properties { get; private set; }
-
-               // The new copy does not have a Subject
-               public virtual Claim Clone ()
-               {
-                       return Clone (null);
-               }
-
-               public virtual Claim Clone (ClaimsIdentity identity)
-               {
-                       return new Claim (Type, Value, ValueType, Issuer, OriginalIssuer, identity);
-               }
-
-               public override string ToString ()
-               {
-                       return String.Format ("{0}: {1}", Type, Value);
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Security.Claims/ClaimTypes.cs b/mcs/class/corlib/System.Security.Claims/ClaimTypes.cs
deleted file mode 100644 (file)
index 07ae8fd..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-//
-// ClaimTypes.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Security.Claims
-{
-       public static class ClaimTypes
-       {
-               public const string Actor = "http://schemas.xmlsoap.org/ws/2009/09/identity/claims/actor";
-
-               public const string Anonymous = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/anonymous";
-
-               public const string Authentication = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/authentication";
-
-               public const string AuthenticationInstant = "http://schemas.microsoft.com/ws/2008/06/identity/claims/authenticationinstant";
-
-               public const string AuthenticationMethod = "http://schemas.microsoft.com/ws/2008/06/identity/claims/authenticationmethod";
-
-               public const string AuthorizationDecision = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/authorizationdecision";
-
-               public const string CookiePath = "http://schemas.microsoft.com/ws/2008/06/identity/claims/cookiepath";
-
-               public const string Country = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/country";
-
-               public const string DateOfBirth = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/dateofbirth";
-
-               public const string DenyOnlyPrimaryGroupSid = "http://schemas.microsoft.com/ws/2008/06/identity/claims/denyonlyprimarygroupsid";
-
-               public const string DenyOnlyPrimarySid = "http://schemas.microsoft.com/ws/2008/06/identity/claims/denyonlyprimarysid";
-
-               public const string DenyOnlySid = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/denyonlysid";
-
-               public const string DenyOnlyWindowsDeviceGroup = "http://schemas.microsoft.com/ws/2008/06/identity/claims/denyonlywindowsdevicegroup";
-
-               public const string Dns = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/dns";
-
-               public const string Dsa = "http://schemas.microsoft.com/ws/2008/06/identity/claims/dsa";
-
-               public const string Email = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress";
-
-               public const string Expiration = "http://schemas.microsoft.com/ws/2008/06/identity/claims/expiration";
-
-               public const string Expired = "http://schemas.microsoft.com/ws/2008/06/identity/claims/expired";
-
-               public const string Gender = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/gender";
-
-               public const string GivenName = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname";
-
-               public const string GroupSid = "http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid";
-
-               public const string Hash = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/hash";
-
-               public const string HomePhone = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/homephone";
-
-               public const string IsPersistent = "http://schemas.microsoft.com/ws/2008/06/identity/claims/ispersistent";
-
-               public const string Locality = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/locality";
-
-               public const string MobilePhone = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/mobilephone";
-
-               public const string Name = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name";
-
-               public const string NameIdentifier = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier";
-
-               public const string OtherPhone = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/otherphone";
-
-               public const string PostalCode = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/postalcode";
-
-               public const string PrimaryGroupSid = "http://schemas.microsoft.com/ws/2008/06/identity/claims/primarygroupsid";
-
-               public const string PrimarySid = "http://schemas.microsoft.com/ws/2008/06/identity/claims/primarysid";
-
-               public const string Role = "http://schemas.microsoft.com/ws/2008/06/identity/claims/role";
-
-               public const string Rsa = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/rsa";
-
-               public const string SerialNumber = "http://schemas.microsoft.com/ws/2008/06/identity/claims/serialnumber";
-
-               public const string Sid = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/sid";
-
-               public const string Spn = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/spn";
-
-               public const string StateOrProvince = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/stateorprovince";
-
-               public const string StreetAddress = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/streetaddress";
-
-               public const string Surname = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname";
-
-               public const string System = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/system";
-
-               public const string Thumbprint = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/thumbprint";
-
-               public const string Upn = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn";
-
-               public const string Uri = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/uri";
-
-               public const string UserData = "http://schemas.microsoft.com/ws/2008/06/identity/claims/userdata";
-
-               public const string Version = "http://schemas.microsoft.com/ws/2008/06/identity/claims/version";
-
-               public const string Webpage = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/webpage";
-
-               public const string WindowsAccountName = "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname";
-
-               public const string WindowsDeviceClaim = "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsdeviceclaim";
-
-               public const string WindowsDeviceGroup = "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsdevicegroup";
-
-               public const string WindowsFqbnVersion = "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsfqbnversion";
-
-               public const string WindowsSubAuthority = "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowssubauthority";
-
-               public const string WindowsUserClaim = "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsuserclaim";
-
-               public const string X500DistinguishedName = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/x500distinguishedname";
-       }
-}
diff --git a/mcs/class/corlib/System.Security.Claims/ClaimValueTypes.cs b/mcs/class/corlib/System.Security.Claims/ClaimValueTypes.cs
deleted file mode 100644 (file)
index abffe8c..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// Claim.cs
-//
-// Authors:
-//  Miguel de Icaza (miguel@xamarin.com)
-//
-// Copyright 2014 Xamarin Inc
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-namespace System.Security.Claims {
-
-       public static class ClaimValueTypes {
-               public const string Base64Binary = "http://www.w3.org/2001/XMLSchema#base64Binary";
-               public const string Base64Octet = "http://www.w3.org/2001/XMLSchema#base64Octet";
-               public const string Boolean = "http://www.w3.org/2001/XMLSchema#boolean";
-               public const string Date = "http://www.w3.org/2001/XMLSchema#date";
-               public const string DateTime = "http://www.w3.org/2001/XMLSchema#dateTime";
-               public const string DaytimeDuration = "http://www.w3.org/TR/2002/WD-xquery-operators-20020816#dayTimeDuration";
-               public const string DnsName = "http://schemas.xmlsoap.org/claims/dns";
-               public const string Double = "http://www.w3.org/2001/XMLSchema#double";
-               public const string DsaKeyValue = "http://www.w3.org/2000/09/xmldsig#DSAKeyValue";
-               public const string Email = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress";
-               public const string Fqbn = "http://www.w3.org/2001/XMLSchema#fqbn";
-               public const string HexBinary = "http://www.w3.org/2001/XMLSchema#hexBinary";
-               public const string Integer = "http://www.w3.org/2001/XMLSchema#integer";
-               public const string Integer32 = "http://www.w3.org/2001/XMLSchema#integer32";
-               public const string Integer64 = "http://www.w3.org/2001/XMLSchema#integer64";
-               public const string KeyInfo = "http://www.w3.org/2000/09/xmldsig#KeyInfo";
-               public const string Rfc822Name = "urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name";
-               public const string Rsa = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/rsa";
-               public const string RsaKeyValue = "http://www.w3.org/2000/09/xmldsig#RSAKeyValue";
-               public const string Sid = "http://www.w3.org/2001/XMLSchema#sid";
-               public const string String = "http://www.w3.org/2001/XMLSchema#string";
-               public const string Time = "http://www.w3.org/2001/XMLSchema#time";
-               public const string UInteger32 = "http://www.w3.org/2001/XMLSchema#uinteger32";
-               public const string UInteger64 = "http://www.w3.org/2001/XMLSchema#uinteger64";
-               public const string UpnName = "http://schemas.xmlsoap.org/claims/UPN";
-               public const string X500Name = "urn:oasis:names:tc:xacml:1.0:data-type:x500Name";
-               public const string YearMonthDuration = "http://www.w3.org/TR/2002/WD-xquery-operators-20020816#yearMonthDuration";
-
-       }
-}
diff --git a/mcs/class/corlib/System.Security.Claims/ClaimsIdentity.cs b/mcs/class/corlib/System.Security.Claims/ClaimsIdentity.cs
deleted file mode 100644 (file)
index dd31436..0000000
+++ /dev/null
@@ -1,283 +0,0 @@
-//
-// ClaimIdentity.cs
-//
-// Authors:
-//  Miguel de Icaza (miguel@xamarin.com)
-//  Marek Safar (marek.safar@gmail.com)
-//
-// Copyright 2014 Xamarin Inc
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Collections.Generic;
-using System.Security.Principal;
-using System.Runtime.Serialization;
-
-namespace System.Security.Claims {
-
-       [Serializable]
-       public class ClaimsIdentity : IIdentity {
-               [NonSerializedAttribute]
-               public const string DefaultNameClaimType = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name";
-               [NonSerializedAttribute]
-               public const string DefaultRoleClaimType = "http://schemas.microsoft.com/ws/2008/06/identity/claims/role";
-               [NonSerializedAttribute]
-               public const string DefaultIssuer = "LOCAL AUTHORITY";
-               
-               readonly List<Claim> claims;
-               ClaimsIdentity actor;
-               readonly string auth_type;
-
-               public ClaimsIdentity ()
-                       : this (claims: null, authenticationType: null, nameType: null, roleType: null)
-               { }
-               
-               public ClaimsIdentity(IEnumerable<Claim> claims)
-                       : this (claims: claims, authenticationType: null, nameType: null, roleType: null)
-               { }
-               
-               public ClaimsIdentity (string authenticationType)
-                       : this (claims: null, authenticationType: authenticationType, nameType: null, roleType: null)
-               { }
-
-               public ClaimsIdentity (IEnumerable<Claim> claims, string authenticationType) 
-                       : this (claims, authenticationType, null, null)
-               {}
-               
-               public ClaimsIdentity (string authenticationType, string nameType, string roleType)
-                       : this (claims: null, authenticationType: authenticationType, nameType: nameType, roleType: roleType)
-               { }
-               
-               public ClaimsIdentity (IIdentity identity) : this (identity: identity, claims: null)
-               {
-               }
-               
-               public ClaimsIdentity(IEnumerable<Claim> claims, string authenticationType, string nameType, string roleType)
-                       : this (identity: null, claims: claims, authenticationType: authenticationType, nameType: nameType, roleType: roleType)
-               {
-               }
-
-               public ClaimsIdentity (IIdentity identity, IEnumerable<Claim> claims)
-                       : this (identity, claims, authenticationType: null, nameType: null, roleType: null)
-               {
-               }
-               
-               public ClaimsIdentity (IIdentity identity, IEnumerable<Claim> claims, string authenticationType, string nameType, string roleType)
-               {
-                       NameClaimType = string.IsNullOrEmpty (nameType) ? DefaultNameClaimType : nameType;
-                       RoleClaimType = string.IsNullOrEmpty (roleType) ? DefaultRoleClaimType : roleType;
-                       auth_type = authenticationType;
-
-                       this.claims = new List<Claim> ();
-
-                       if (identity != null) {
-                               if (string.IsNullOrEmpty (authenticationType))
-                                       auth_type = identity.AuthenticationType;
-
-                               var ci = identity as ClaimsIdentity;
-                               if (ci != null) {
-                                       actor = ci.Actor;
-                                       BootstrapContext = ci.BootstrapContext;
-                                       foreach (var c in ci.Claims)
-                                               this.claims.Add (c);
-                               
-                                       Label = ci.Label;
-                                       NameClaimType = string.IsNullOrEmpty (nameType) ? ci.NameClaimType : nameType;
-                                       RoleClaimType = string.IsNullOrEmpty (roleType) ? ci.RoleClaimType : roleType;
-                               } else if (!string.IsNullOrEmpty (identity.Name)) {
-                                       AddDefaultClaim (identity.Name);
-                               }
-                       }
-
-                       if (claims != null) {
-                               AddClaims (claims);
-                       }
-               }
-
-               [MonoTODO]
-               protected ClaimsIdentity (SerializationInfo info)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               protected ClaimsIdentity (SerializationInfo info, StreamingContext context)
-               {
-                       if (info == null)
-                               throw new ArgumentNullException ("info");
-                       throw new NotImplementedException ();
-               }
-               
-               public ClaimsIdentity Actor {
-                       get {
-                               return actor;
-                       }
-                       set {
-                               if (value == this)
-                                       throw new InvalidOperationException ("can not set the Actor property to this instance");
-
-                               actor = value;
-                       }
-               }
-
-               public virtual string AuthenticationType {
-                       get {
-                               return auth_type;
-                       }
-               }
-               public object BootstrapContext { get; set; }
-               public string Label { get; set; }
-               public virtual string Name {
-                       get {
-                               var target = NameClaimType;
-                               foreach (var c in claims){
-                                       if (c.Type == target)
-                                               return c.Value;
-                               }
-                               return null;
-                       }
-               }
-               public string NameClaimType { get; private set; }
-               public string RoleClaimType { get; private set; }
-
-               public virtual IEnumerable<Claim> Claims {
-                       get {
-                               return claims;
-                       }
-               }
-
-               public virtual bool IsAuthenticated {
-                       get {
-                               return AuthenticationType != null && AuthenticationType != "";
-                       }
-               }
-
-               public virtual void AddClaim (Claim claim)
-               {
-                       if (claim == null)
-                               throw new ArgumentNullException ("claim");
-
-                       if (claim.Subject != this)
-                               claim = claim.Clone (this);
-
-                       claims.Add (claim);
-               }
-
-               public virtual void AddClaims (IEnumerable<Claim> claims)
-               {
-                       if (claims == null)
-                               throw new ArgumentNullException ("claims");
-
-                       foreach (var c in claims)
-                               AddClaim (c);
-               }
-
-               internal void AddDefaultClaim (string identityName)
-               {
-                       this.claims.Add (new Claim (NameClaimType, identityName, "http://www.w3.org/2001/XMLSchema#string", DefaultIssuer, DefaultIssuer, this)); 
-               }
-
-               public virtual ClaimsIdentity Clone ()
-               {
-                       return new ClaimsIdentity (null, claims, AuthenticationType, NameClaimType, RoleClaimType){
-                               BootstrapContext = this.BootstrapContext,
-                               Actor = this.Actor,
-                               Label = this.Label
-                       };
-               }
-
-               public virtual IEnumerable<Claim> FindAll(Predicate<Claim> match)
-               {
-                       if (match == null)
-                               throw new ArgumentNullException ("match");
-                       foreach (var c in claims)
-                               if (match (c))
-                                       yield return c;
-               }
-
-               public virtual IEnumerable<Claim> FindAll (string type)
-               {
-                       if (type == null)
-                               throw new ArgumentNullException ("type");
-                       foreach (var c in claims)
-                               if (string.Equals (c.Type, type, StringComparison.OrdinalIgnoreCase))
-                                       yield return c;
-               }
-
-               public virtual Claim FindFirst (Predicate<Claim> match)
-               {
-                       if (match == null)
-                               throw new ArgumentNullException ("match");
-                       foreach (var c in claims)
-                               if (match (c))
-                                       return c;
-                       return null;
-               }
-
-               public virtual Claim FindFirst (string type)
-               {
-                       if (type == null)
-                               throw new ArgumentNullException ("type");
-                       foreach (var c in claims)
-                               if (string.Equals (c.Type, type, StringComparison.OrdinalIgnoreCase))
-                                       return c;
-                       return null;
-               }
-
-               public virtual bool HasClaim (Predicate<Claim> match)
-               {
-                       if (match == null)
-                               throw new ArgumentNullException ("match");
-                       foreach (var c in claims)
-                               if (match (c))
-                                       return true;
-                       return false;
-               }
-
-               public virtual bool HasClaim (string type, string value)
-               {
-                       if (type == null)
-                               throw new ArgumentNullException ("type");
-                       if (value == null)
-                               throw new ArgumentNullException ("value");
-                       foreach (var c in claims){
-                               if (string.Equals (c.Type, type, StringComparison.OrdinalIgnoreCase) && c.Value == value)
-                                       return true;
-                       }
-                       return false;
-               }
-
-               public virtual void RemoveClaim (Claim claim)
-               {
-                       if (!TryRemoveClaim (claim))
-                               throw new InvalidOperationException ();
-               }
-
-               [MonoTODO ("This one should return false if the claim is owned by someone else, this does not exist yet")]
-               public virtual bool TryRemoveClaim (Claim claim)
-               {
-                       if (claim == null)
-                               return true;
-                       claims.Remove (claim);
-                       return true;
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Security.Claims/ClaimsPrincipal.cs b/mcs/class/corlib/System.Security.Claims/ClaimsPrincipal.cs
deleted file mode 100755 (executable)
index b8a660f..0000000
+++ /dev/null
@@ -1,218 +0,0 @@
-//
-// ClaimPrincipal.cs
-//
-// Authors:
-//  Miguel de Icaza (miguel@xamarin.com)
-//
-// Copyright 2014 Xamarin Inc
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Collections.Generic;
-using System.Security.Principal;
-using System.Runtime.Serialization;
-using System.Threading;
-
-namespace System.Security.Claims {
-
-       [SerializableAttribute]
-       public class ClaimsPrincipal : IPrincipal
-       {
-               List<ClaimsIdentity> identities;
-
-               static ClaimsPrincipal ()
-               {
-                       ClaimsPrincipalSelector = DefaultClaimsPrincipal;
-               }
-
-               static ClaimsPrincipal DefaultClaimsPrincipal ()
-               {
-                       return Thread.CurrentPrincipal as ClaimsPrincipal;
-               }
-               
-               public ClaimsPrincipal ()
-               {
-                       identities =  new List<ClaimsIdentity>();
-               }
-
-               public ClaimsPrincipal (IEnumerable<ClaimsIdentity> identities)
-               {
-                       if (identities == null)
-                               throw new ArgumentNullException ("identities");
-                       
-                       this.identities = new List<ClaimsIdentity> (identities);
-               }
-
-               public ClaimsPrincipal (IIdentity identity)
-               {
-                       if (identity == null)
-                               throw new ArgumentNullException ("identity");
-
-                       identities = new List<ClaimsIdentity> ();
-                       identities.Add (identity as ClaimsIdentity ?? new ClaimsIdentity (identity));
-               }
-
-               public ClaimsPrincipal (IPrincipal principal)
-               {
-                       if (principal == null)
-                               throw new ArgumentNullException ("principal");
-                       var cp = principal as ClaimsPrincipal;
-                       if (cp != null)
-                               identities = new List<ClaimsIdentity> (cp.identities);
-                       else {
-                               identities = new List<ClaimsIdentity> ();
-                               identities.Add (new ClaimsIdentity (principal.Identity));
-                       }
-               }
-
-               [MonoTODO]
-               protected ClaimsPrincipal (SerializationInfo info, StreamingContext context)
-               {
-                       throw new NotImplementedException ();
-               }
-               
-               public virtual IEnumerable<Claim> Claims {
-                       get {
-                               foreach (var ci in identities)
-                                       foreach (var claim in ci.Claims)
-                                               yield return claim;
-                       }
-               }
-
-               public static Func<ClaimsPrincipal> ClaimsPrincipalSelector { get; set; }
-
-               public static ClaimsPrincipal Current {
-                       get {
-                               return ClaimsPrincipalSelector ();
-                       }
-               }
-
-               public virtual IEnumerable<ClaimsIdentity> Identities {
-                       get {
-                               return identities;
-                       }
-               }
-
-               public static Func<IEnumerable<ClaimsIdentity>, ClaimsIdentity> PrimaryIdentitySelector { get; set; }
-
-               public virtual IIdentity Identity {
-                       get {
-                               if (identities == null)
-                                       throw new ArgumentNullException ("Identities");
-
-                               if (PrimaryIdentitySelector != null)
-                                       return PrimaryIdentitySelector (identities);
-                                               
-                               ClaimsIdentity firstCI = null;
-                               foreach (var ident in identities){
-                                       if (ident is WindowsIdentity)
-                                               return ident;
-                                       if (firstCI == null && ident is ClaimsIdentity)
-                                               firstCI = ident as ClaimsIdentity;
-                               }
-                               return firstCI;
-                       }
-               }
-
-               public virtual void AddIdentities (IEnumerable<ClaimsIdentity> identities)
-               {
-                       if (identities == null)
-                               throw new ArgumentNullException ("identities");
-                       foreach (var id in identities)
-                               this.identities.Add (id);
-               }
-
-               public virtual void AddIdentity (ClaimsIdentity identity)
-               {
-                       if (identity == null)
-                               throw new ArgumentNullException ("identity");
-                       identities.Add (identity);
-               }
-
-               public virtual IEnumerable<Claim> FindAll (Predicate<Claim> match)
-               {
-                       if (match == null)
-                               throw new ArgumentNullException ("match");
-                       foreach (var claim in Claims){
-                               if (match (claim))
-                                       yield return claim;
-                       }
-               }
-
-               public virtual Claim FindFirst (Predicate<Claim> match)
-               {
-                       if (match == null)
-                               throw new ArgumentNullException ("match");
-                       foreach (var claim in Claims)
-                               if (match (claim))
-                                       return claim;
-                       return null;
-               }
-
-               public virtual bool HasClaim (Predicate<Claim> match)
-               {
-                       if (match == null)
-                               throw new ArgumentNullException ("match");
-                       foreach (var claim in Claims)
-                               if (match (claim))
-                                       return true;
-                       return false;
-               }
-
-               public virtual bool IsInRole (string role)
-               {
-                       foreach (var id in identities){
-                               if (id.HasClaim (id.RoleClaimType, role))
-                                       return true;
-                       }
-                       return false;
-               }
-
-               public virtual bool HasClaim (string type, string value)
-               {
-                       foreach(var claim in Claims){
-                               if (claim.Type == type && claim.Value == value)
-                                       return true;
-                       }
-                       return false;
-               }
-
-               public virtual Claim FindFirst (string type)
-               {
-                       if (type == null)
-                               throw new ArgumentNullException ("type");
-                       return FindFirst(x => x.Type == type);
-               }
-
-               public virtual IEnumerable<Claim> FindAll (string type)
-               {
-                       if (type == null)
-                               throw new ArgumentNullException ("type");
-                       return FindAll(x => x.Type == type);
-               }
-
-               [MonoTODO]
-               protected virtual void GetObjectData (SerializationInfo info, StreamingContext context)
-               {
-                       throw new NotImplementedException ();
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Security.Principal/GenericIdentity.cs b/mcs/class/corlib/System.Security.Principal/GenericIdentity.cs
deleted file mode 100644 (file)
index 23069f6..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-//
-// System.Security.Principal.GenericIdentity.cs
-//
-// Authors:
-//   Miguel de Icaza (miguel@ximian.com)
-//   Marek Safar (marek.safar@gmail.com)
-//
-// (C) Ximian, Inc.  http://www.ximian.com
-// Copyright (C) 2004-2006 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-using System.Collections.Generic;
-using System.Security.Claims;
-
-namespace System.Security.Principal {
-
-       [Serializable]
-       [ComVisible (true)]
-       public class GenericIdentity :
-               ClaimsIdentity
-       {
-
-               // field names are serialization compatible with .net
-               private string m_name;
-               private string m_type;
-               
-               public GenericIdentity (string name, string type)
-               {
-                       if (name == null)
-                               throw new ArgumentNullException ("name");
-
-                       if (type == null)
-                               throw new ArgumentNullException ("type");
-
-                       m_name = name;
-                       m_type = type;
-
-                       AddDefaultClaim (name);
-               }
-
-               public GenericIdentity (string name)
-                       : this (name, String.Empty)
-               {
-               }
-
-               protected GenericIdentity (GenericIdentity identity)
-                       : base (identity)
-               {
-               }
-
-               override
-               public string AuthenticationType {
-                       get {
-                               return m_type;
-                       }
-               }
-
-               override
-               public string Name {
-                       get {
-                               return m_name;
-                       }
-               }
-
-               override
-               public bool IsAuthenticated {
-                       get {
-                               return (m_name.Length > 0);
-                       }
-               }
-
-               public override IEnumerable<Claim> Claims {
-                       get {
-                               return base.Claims;
-                       }
-               }
-       }
-}
index 7f2eef3e1e4eb098e1f5fb239ec01cc833d4bdf7..0ce7736f57432c0bbe1981d60cba712af09d597b 100644 (file)
@@ -33,6 +33,7 @@ using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 using System.Runtime.Serialization;
 using System.Security.Permissions;
+using System.Security.Claims;
 
 namespace System.Security.Principal {
 
@@ -113,6 +114,15 @@ namespace System.Security.Principal {
                        _info = info;
                }
 
+               internal WindowsIdentity (ClaimsIdentity claimsIdentity, IntPtr userToken)
+                       : base (claimsIdentity)
+               {
+                       if (userToken != IntPtr.Zero && userToken.ToInt64() > 0)
+                       {
+                               SetToken (userToken);
+                       }
+               }
+
                [ComVisible (false)]
                public void Dispose ()
                {
@@ -269,6 +279,16 @@ namespace System.Security.Principal {
                        info.AddValue ("m_isAuthenticated", _authenticated);
                }
 
+               internal ClaimsIdentity CloneAsBase ()
+               {
+                       return base.Clone();
+               }
+
+               internal IntPtr GetTokenInternal ()
+               {
+                       return _token;
+               }
+
                private void SetToken (IntPtr token) 
                {
                        if (Environment.IsUnix) {
diff --git a/mcs/class/corlib/System.Security/AllowPartiallyTrustedCallersAttribute.cs b/mcs/class/corlib/System.Security/AllowPartiallyTrustedCallersAttribute.cs
deleted file mode 100644 (file)
index cbe0765..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// System.Security.AllowPartiallyTrustedCallersAttribute implementation
-//
-// Author:
-//     Sebastien Pouliot  <sebastien@ximian.com>
-//
-// (C) 2003, 2004 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.Security {
-
-       [ComVisible (true)]
-       [AttributeUsage (AttributeTargets.Assembly, AllowMultiple=false, Inherited=false)]
-       public sealed class AllowPartiallyTrustedCallersAttribute : Attribute {
-
-               public AllowPartiallyTrustedCallersAttribute ()
-                       : base ()
-               {
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Security/SecurityCriticalAttribute.cs b/mcs/class/corlib/System.Security/SecurityCriticalAttribute.cs
deleted file mode 100644 (file)
index ed01b54..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// System.Security.SecurityCriticalAttribute implementation
-//
-// Author:
-//     Sebastien Pouliot  <sebastien@ximian.com>
-//
-// Copyright (C) 2005, 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Security {
-
-#if NET_2_1
-
-       [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct |
-               AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property |
-               AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate,
-               AllowMultiple=false, Inherited=false)]
-       public sealed class SecurityCriticalAttribute : Attribute {
-
-               public SecurityCriticalAttribute ()
-               {
-               }
-       }
-
-#else
-       [MonoTODO ("Only supported by the runtime when CoreCLR is enabled")]
-       [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct |
-               AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method |
-               AttributeTargets.Field | AttributeTargets.Interface | AttributeTargets.Delegate,
-               AllowMultiple=false, Inherited=false)]
-       public sealed class SecurityCriticalAttribute : Attribute {
-
-               private SecurityCriticalScope _scope;
-
-               public SecurityCriticalAttribute ()
-                       : base ()
-               {
-                       _scope = SecurityCriticalScope.Explicit;
-               }
-
-               public SecurityCriticalAttribute (SecurityCriticalScope scope)
-                       : base ()
-               {
-                       switch (scope) {
-                       case SecurityCriticalScope.Everything:
-                               _scope = SecurityCriticalScope.Everything;
-                               break;
-                       default:
-                               // that includes all bad enums values
-                               _scope = SecurityCriticalScope.Explicit;
-                               break;
-                       }
-               }
-
-               [Obsolete]
-               public SecurityCriticalScope Scope {
-                       get { return _scope; }
-               }
-       }
-#endif
-}
diff --git a/mcs/class/corlib/System.Security/SecurityCriticalScope.cs b/mcs/class/corlib/System.Security/SecurityCriticalScope.cs
deleted file mode 100644 (file)
index 37be161..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// System.Security.SecurityCriticalScope enum
-//
-// Author:
-//     Sebastien Pouliot  <sebastien@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Security {
-
-       [Obsolete]
-       public enum SecurityCriticalScope {
-               Explicit,
-               Everything
-       }
-}
-
diff --git a/mcs/class/corlib/System.Security/SecurityRuleSet.cs b/mcs/class/corlib/System.Security/SecurityRuleSet.cs
deleted file mode 100644 (file)
index f67e35c..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.Security.SecurityRuleSet.cs
-//
-// Author:
-//   Marek Safar (marek.safar@gmail.com)
-//
-// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Security {
-
-       public enum SecurityRuleSet : byte
-       {
-               None    = 0,
-               Level1  = 1,
-               Level2  = 2
-       }
-}
-
diff --git a/mcs/class/corlib/System.Security/SecurityRulesAttribute.cs b/mcs/class/corlib/System.Security/SecurityRulesAttribute.cs
deleted file mode 100644 (file)
index b6ed53f..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// System.Security.SecurityRulesAttribute.cs
-//
-// Author:
-//     Marek Safar  <marek.safar@gmail.com>
-//
-// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Security {
-
-       [AttributeUsage (AttributeTargets.Assembly, AllowMultiple=false)]
-       public sealed class SecurityRulesAttribute : Attribute
-       {
-               public SecurityRulesAttribute (SecurityRuleSet ruleSet)
-               {
-                       RuleSet = ruleSet;
-               }
-               
-               public SecurityRuleSet RuleSet { get; private set; }
-               
-               public bool SkipVerificationInFullTrust { get; set; }
-       }
-}
-
diff --git a/mcs/class/corlib/System.Security/SecuritySafeCriticalAttribute.cs b/mcs/class/corlib/System.Security/SecuritySafeCriticalAttribute.cs
deleted file mode 100644 (file)
index 06d0807..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// System.Security.SecuritySafeCriticalAttribute implementation
-//
-// Author:
-//     Sebastien Pouliot  <sebastien@ximian.com>
-//
-// Copyright (C) 2005,2007,2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Security {
-
-       [MonoTODO ("Only supported by the runtime when CoreCLR is enabled")]
-       [AttributeUsage (AttributeTargets.Delegate | AttributeTargets.Interface | AttributeTargets.Field | AttributeTargets.Method |
-                       AttributeTargets.Constructor | AttributeTargets.Enum | AttributeTargets.Struct | AttributeTargets.Class, AllowMultiple=false, Inherited=false)]
-       public sealed class SecuritySafeCriticalAttribute : Attribute {
-
-               public SecuritySafeCriticalAttribute ()
-               {
-               }
-       }
-}
-
diff --git a/mcs/class/corlib/System.Security/SecurityTransparentAttribute.cs b/mcs/class/corlib/System.Security/SecurityTransparentAttribute.cs
deleted file mode 100644 (file)
index 92e94ca..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.Security.SecurityTransparentAttribute implementation
-//
-// Author:
-//     Sebastien Pouliot  <sebastien@ximian.com>
-//
-// Copyright (C) 2005, 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Security {
-
-       [MonoTODO ("Only supported by the runtime when CoreCLR is enabled")]
-       [AttributeUsage (AttributeTargets.Assembly, AllowMultiple=false, Inherited=false)]
-       public sealed class SecurityTransparentAttribute : Attribute {
-
-               public SecurityTransparentAttribute ()
-               {
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Security/SecurityTreatAsSafeAttribute.cs b/mcs/class/corlib/System.Security/SecurityTreatAsSafeAttribute.cs
deleted file mode 100644 (file)
index b86b369..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// System.Security.SecurityTreatAsSafeAttribute implementation
-//
-// Author:
-//     Sebastien Pouliot  <sebastien@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Security {
-
-       [AttributeUsage (AttributeTargets.Delegate | AttributeTargets.Interface | AttributeTargets.Field |
-               AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Enum | AttributeTargets.Struct |
-               AttributeTargets.Class | AttributeTargets.Assembly,
-               AllowMultiple=false, Inherited=false)]
-       [Obsolete ("Use the SecuritySafeCriticalAttribute instead")]
-       [MonoTODO ("Not supported by the runtime")]
-       public sealed class SecurityTreatAsSafeAttribute : Attribute {
-
-               public SecurityTreatAsSafeAttribute ()
-                       : base ()
-               {
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Security/SuppressUnmanagedCodeSecurityAttribute.cs b/mcs/class/corlib/System.Security/SuppressUnmanagedCodeSecurityAttribute.cs
deleted file mode 100644 (file)
index defe471..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.Security.SuppressUnmanagedCodeSecurityAttribute.cs
-//
-// Author:
-//   Nick Drochak(ndrochak@gol.com)
-//
-// (C) Nick Drochak
-// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.Security {
-
-       [AttributeUsage (AttributeTargets.Class | AttributeTargets.Method | 
-               AttributeTargets.Interface | AttributeTargets.Delegate, 
-               AllowMultiple=true, Inherited=false)]
-       [ComVisible (true)]
-       public sealed class SuppressUnmanagedCodeSecurityAttribute : Attribute {
-       }
-}
diff --git a/mcs/class/corlib/System.Security/UnverifiableCodeAttribute.cs b/mcs/class/corlib/System.Security/UnverifiableCodeAttribute.cs
deleted file mode 100644 (file)
index 6c130c8..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.Security.UnverifiableCodeAttribute.cs
-//
-// Author:
-//   Nick Drochak(ndrochak@gol.com)
-//
-// (C) Nick Drochak
-// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.Security {
-
-       [ComVisible (true)]
-       [AttributeUsage (AttributeTargets.Module, AllowMultiple=true, Inherited=false)]
-       public sealed class UnverifiableCodeAttribute : Attribute {
-       }
-}
diff --git a/mcs/class/corlib/System.Threading/LockRecursionException.cs b/mcs/class/corlib/System.Threading/LockRecursionException.cs
deleted file mode 100644 (file)
index 8a4f4bb..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * System.Threading.LockRecursionException
- *
- * Author(s)
- *     Marek Safar <marek.safar@gmail.com>
- *
- * Copyright 2011 Xamarin Inc (http://www.xamarin.com).
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- * 
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-
-using System;
-using System.Runtime.Serialization;
-using System.Runtime.CompilerServices;
-
-namespace System.Threading
-{
-       [Serializable]
-#if !MOBILE
-       [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
-#endif
-       public class LockRecursionException : Exception
-       {
-               public LockRecursionException () 
-                       : base ()
-               {
-               }
-
-               public LockRecursionException (string message) 
-                       : base (message)
-               {
-               }
-
-               public LockRecursionException (string message, Exception innerException) 
-                       : base (message, innerException)
-               {
-               }
-
-               protected LockRecursionException (SerializationInfo info, StreamingContext context)
-                        : base (info, context)
-               {
-               }
-       }
-}
-
index 4be83d2cd58c9807089f4146144911f26f85ccce..3774614caec9556e74a896a807c8444c09f01211 100644 (file)
@@ -622,7 +622,13 @@ namespace System.Threading {
                }
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               internal extern object GetAbortExceptionState ();
+               extern object GetAbortExceptionState ();
+
+               internal object AbortReason {
+                       get {
+                               return GetAbortExceptionState ();
+                       }
+               }
 
                [MethodImplAttribute (MethodImplOptions.InternalCall)]
                private extern static void Interrupt_internal (InternalThread thread);
diff --git a/mcs/class/corlib/System.Threading/ThreadAbortException.cs b/mcs/class/corlib/System.Threading/ThreadAbortException.cs
deleted file mode 100644 (file)
index 19e5cba..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// System.Threading.ThreadAbortException.cs
-//
-// Author:
-//   Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc.  http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.CompilerServices;
-using System.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System.Threading
-{
-       [Serializable]
-       [ComVisible (true)]
-       public sealed class ThreadAbortException : SystemException
-       {
-               private ThreadAbortException () : base ("Thread was being aborted")
-               {
-                       HResult = unchecked ((int) 0x80131530);
-               }
-
-               private ThreadAbortException (SerializationInfo info, StreamingContext sc) : base (info, sc)
-               {
-               }
-
-#if !NET_2_1
-               public object ExceptionState {
-                       get {
-                               return Thread.CurrentThread.GetAbortExceptionState ();
-                       }
-               }
-#endif
-       }
-}
diff --git a/mcs/class/corlib/System.Threading/ThreadInterruptedException.cs b/mcs/class/corlib/System.Threading/ThreadInterruptedException.cs
deleted file mode 100644 (file)
index 9bcb6f7..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// System.Threading.ThreadInterruptedException.cs
-//
-// Author:
-//   Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc.  http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System.Threading
-{
-       [Serializable]
-       [ComVisible (true)]
-       public class ThreadInterruptedException : SystemException
-       {
-               public ThreadInterruptedException()
-                       : base ("Thread interrupted") {
-               }
-
-               public ThreadInterruptedException(string message)
-                       : base (message) {
-               }
-
-               protected ThreadInterruptedException(SerializationInfo info, StreamingContext context)
-                       : base (info, context) {
-               }
-
-               public ThreadInterruptedException(string message, Exception innerException)
-                       : base (message, innerException) {
-               }
-       }
-}
diff --git a/mcs/class/corlib/System/Action.cs b/mcs/class/corlib/System/Action.cs
deleted file mode 100644 (file)
index 438f7fc..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// Action.cs
-//
-// Authors:
-//  Ben Maurer (bmaurer@ximian.com)
-//  Marek Safar (marek.safar@gmail.com)
-//
-// Copyright (C) 2004, 2010 Novell
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.CompilerServices;
-
-namespace System
-{
-#if MOBILE
-       [TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#else
-       [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
-#endif
-       public delegate void Action ();
-       
-       public delegate void Action <in T> (T obj);
-       
-#if MOBILE
-       [TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#else
-       [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
-#endif
-       public delegate void Action <in T1, in T2> (T1 arg1, T2 arg2);
-       
-#if MOBILE
-       [TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#else
-       [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
-#endif
-       public delegate void Action <in T1, in T2, in T3> (T1 arg1, T2 arg2, T3 arg3);
-       
-#if MOBILE
-       [TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#else
-       [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
-#endif
-       public delegate void Action <in T1, in T2, in T3, in T4> (T1 arg1, T2 arg2, T3 arg3, T4 arg4);
-       
-       public delegate void Action <in T1, in T2, in T3, in T4, in T5> (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5);
-       public delegate void Action <in T1, in T2, in T3, in T4, in T5, in T6> (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6);
-       public delegate void Action <in T1, in T2, in T3, in T4, in T5, in T6, in T7> (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7);
-       public delegate void Action <in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8> (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8);
-}
diff --git a/mcs/class/corlib/System/ApplicationId.cs b/mcs/class/corlib/System/ApplicationId.cs
deleted file mode 100644 (file)
index b867591..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-//
-// System.ApplicationId class
-//
-// Author:
-//     Sebastien Pouliot  <sebastien@ximian.com>
-//
-// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-using System.Text;
-
-namespace System {
-
-       [Serializable]
-       [ComVisible (true)]
-       public sealed class ApplicationId {
-
-               private byte[] _token;
-               private string _name;
-               private Version _version;
-               private string _proc;
-               private string _culture;
-
-               public ApplicationId (byte[] publicKeyToken, string name, Version version, string processorArchitecture, string culture)
-               {
-                       if (publicKeyToken == null)
-                               throw new ArgumentNullException ("publicKeyToken");
-                       if (name == null)
-                               throw new ArgumentNullException ("name");
-                       if (version == null)
-                               throw new ArgumentNullException ("version");
-
-                       _token = (byte[]) publicKeyToken.Clone ();
-                       _name = name;
-                       _version = version;
-                       _proc = processorArchitecture;
-                       _culture = culture;
-               }
-
-               // properties
-
-               public string Culture {
-                       get { return _culture; }
-               }
-
-               public string Name {
-                       get { return _name; }
-               }
-
-               public string ProcessorArchitecture {
-                       get { return _proc; }
-               }
-
-               public byte[] PublicKeyToken {
-                       get { return (byte[]) _token.Clone (); }
-               }
-
-               public Version Version {
-                       get { return _version; }
-               }
-
-               // methods
-
-               public ApplicationId Copy () 
-               {
-                       return new ApplicationId (_token, _name, _version, _proc, _culture);
-               }
-
-               public override bool Equals (object o)
-               {
-                       if (o == null)
-                               return false;
-                       ApplicationId appid = (o as ApplicationId);
-                       if (appid == null)
-                               return false;
-                       if (_name != appid._name)
-                               return false;
-                       if (_proc != appid._proc)
-                               return false;
-                       if (_culture != appid._culture)
-                               return false;
-                       if (!_version.Equals (appid._version))
-                               return false;
-                       if (_token.Length != appid._token.Length)
-                               return false;
-                       for (int i=0; i < _token.Length; i++)
-                               if (_token [i] != appid._token [i])
-                                       return false;
-                       return true;
-               }
-
-               public override int GetHashCode ()
-               {
-                       int code = _name.GetHashCode () ^ _version.GetHashCode ();
-                       for (int i=0; i < _token.Length; i++)
-                               code ^= _token [i];
-                       // ProcessorArchitecture and Culture aren't part of the hash code
-                       // Confirmed by Microsoft in FDBK13339
-                       return code;
-               }
-
-               public override string ToString ()
-               {
-                       StringBuilder sb = new StringBuilder ();
-                       sb.Append (_name);
-                       if (_culture != null)
-                               sb.AppendFormat (", culture=\"{0}\"", _culture);
-                       sb.AppendFormat (", version=\"{0}\", publicKeyToken=\"", _version);
-                       for (int i=0; i < _token.Length; i++)
-                               sb.Append (_token [i].ToString ("X2"));
-                       if (_proc != null)
-                               sb.AppendFormat ("\", processorArchitecture =\"{0}\"", _proc);
-                       else
-                               sb.Append ("\"");
-                       return sb.ToString ();
-               }
-       }
-}
index b4afbe2eb84bd10203be62dc732b40647bd43a0f..9c263400572cc9681d3fba5d8ad1ce6f5c579a1c 100644 (file)
@@ -3045,7 +3045,7 @@ namespace System
                        if (count < 0 || startIndex < array.GetLowerBound (0) || startIndex - 1 > array.GetUpperBound (0) - count)
                                throw new ArgumentOutOfRangeException ();
 
-                       return EqualityComparer<T>.Default.IndexOf (array, value, startIndex, startIndex + count);
+                       return EqualityComparer<T>.Default.IndexOf (array, value, startIndex, count);
                }
                
                public static int LastIndexOf<T> (T [] array, T value)
diff --git a/mcs/class/corlib/System/AsyncCallback.cs b/mcs/class/corlib/System/AsyncCallback.cs
deleted file mode 100644 (file)
index 3f2bf73..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.AsyncCallback.cs
-//
-// Author:
-//   Paolo Molaro (lupus@ximian.com)
-//
-// (C) Ximian, Inc.  http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System
-{
-       [System.Runtime.InteropServices.ComVisible (true)]
-       [Serializable]
-       public delegate void AsyncCallback (IAsyncResult ar);
-}
diff --git a/mcs/class/corlib/System/AttributeTargets.cs b/mcs/class/corlib/System/AttributeTargets.cs
deleted file mode 100644 (file)
index 3a023d3..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-// System.AttributeTargets.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Fri, 7 Sep 2001 16:31:48 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc.  http://www.ximian.com
-// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System {
-
-       [ComVisible (true)]
-       [Serializable]
-       [Flags]
-       public enum AttributeTargets
-       {
-               Assembly = 0x00000001,
-               Module = 0x00000002,
-               Class = 0x00000004,
-               Struct = 0x00000008,
-               Enum = 0x00000010,
-               Constructor = 0x00000020,
-               Method = 0x00000040,
-               Property = 0x00000080,
-               Field = 0x00000100,
-               Event = 0x00000200,
-               Interface = 0x00000400,
-               Parameter = 0x00000800,
-               Delegate = 0x00001000,
-               ReturnValue = 0x00002000,
-
-               GenericParameter = 0x00004000,
-               All = Assembly | Module | Class | Struct | Enum | Constructor |
-                       Method | Property | Field | Event | Interface | Parameter | Delegate | ReturnValue | GenericParameter
-       }
-}
-
diff --git a/mcs/class/corlib/System/BadImageFormatException.cs b/mcs/class/corlib/System/BadImageFormatException.cs
deleted file mode 100644 (file)
index a6db337..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-//
-// System.BadImageFormatException.cs
-//
-// Authors:
-//   Sean MacIsaac (macisaac@ximian.com)
-//   Duncan Mak (duncan@ximian.com)
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2001 Ximian, Inc.
-// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-using System.Security.Permissions;
-using System.Runtime.InteropServices;
-using System.Text;
-
-namespace System
-{
-       [Serializable]
-       [ComVisible (true)]
-       public class BadImageFormatException : SystemException
-       {
-               const int Result = unchecked ((int)0x8007000B);
-
-               // Fields
-               private string fileName;
-               private string fusionLog;
-
-               // Constructors
-               public BadImageFormatException ()
-                       : base (Locale.GetText ("Format of the executable (.exe) or library (.dll) is invalid."))
-               {
-                       HResult = Result;
-               }
-
-               public BadImageFormatException (string message)
-                       : base (message)
-               {
-                       HResult = Result;
-               }
-
-               protected BadImageFormatException (SerializationInfo info, StreamingContext context)
-                       : base (info, context)
-               {
-                       fileName = info.GetString ("BadImageFormat_FileName");
-                       fusionLog = info.GetString ("BadImageFormat_FusionLog");
-               }
-
-               public BadImageFormatException (string message, Exception inner)
-                       : base (message, inner)
-               {
-                       HResult = Result;
-               }
-
-               public BadImageFormatException (string message, string fileName)
-                       : base (message)
-               {
-                       this.fileName = fileName;
-                       HResult = Result;
-               }
-
-               public BadImageFormatException (string message, string fileName, Exception inner)
-                       : base (message, inner)
-               {
-                       this.fileName = fileName;
-                       HResult = Result;
-               }
-
-               // Properties
-               public override string Message
-               {
-                       get {
-                               if (base.message == null) {
-                                       return string.Format (
-                                               "Could not load file or assembly '{0}' or one of"
-                                               + " its dependencies. An attempt was made to load"
-                                               + " a program with an incorrect format.", fileName);
-                               }
-                               return base.Message;
-                       }
-               }
-
-               public string FileName
-               {
-                       get { return fileName; }
-               }
-
-               [MonoTODO ("Probably not entirely correct. fusionLog needs to be set somehow (we are probably missing internal constuctor)")]
-               public string FusionLog {
-                       // note: MS runtime throws a SecurityException when the Exception is created
-                       // but a FileLoadException once the exception as been thrown. Mono always
-                       // throw a SecurityException in both case (anyway fusionLog is currently empty)
-                       [SecurityPermission (SecurityAction.Demand, ControlEvidence=true, ControlPolicy=true)]
-                       get { return fusionLog; }
-               }
-
-               // Methods
-               public override void GetObjectData (SerializationInfo info, StreamingContext context)
-               {
-                       base.GetObjectData (info, context);
-                       info.AddValue ("BadImageFormat_FileName", fileName);
-                       info.AddValue ("BadImageFormat_FusionLog", fusionLog);
-               }
-
-               public override string ToString ()
-               {
-                       StringBuilder sb = new StringBuilder (GetType ().FullName);
-                       sb.AppendFormat (": {0}", Message);
-
-                       if (fileName != null && fileName.Length > 0) {
-                               sb.Append (Environment.NewLine);
-                               sb.AppendFormat ("File name: '{0}'", fileName);
-                       }
-
-                       if (this.InnerException != null)
-                               sb.AppendFormat (" ---> {0}", InnerException);
-
-                       if (this.StackTrace != null) {
-                               sb.Append (Environment.NewLine);
-                               sb.Append (StackTrace);
-                       }
-
-                       return sb.ToString ();
-               }
-       }
-}
diff --git a/mcs/class/corlib/System/Buffer.cs b/mcs/class/corlib/System/Buffer.cs
deleted file mode 100644 (file)
index 3f4960d..0000000
+++ /dev/null
@@ -1,264 +0,0 @@
-//
-// System.Buffer.cs
-//
-// Authors:
-//   Paolo Molaro (lupus@ximian.com)
-//   Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// (C) 2001 Ximian, Inc.  http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using System.Diagnostics.Contracts;
-
-namespace System {
-       [ComVisible (true)]
-       public static class Buffer {
-
-               public static int ByteLength (Array array)
-               {
-                       // note: the other methods in this class also use ByteLength to test for
-                       // null and non-primitive arguments as a side-effect.
-
-                       if (array == null)
-                               throw new ArgumentNullException ("array");
-
-                       int length = ByteLengthInternal (array);
-                       if (length < 0)
-                               throw new ArgumentException (Locale.GetText ("Object must be an array of primitives."));
-
-                       return length;
-               }
-
-               public static byte GetByte (Array array, int index)
-               {
-                       if (index < 0 || index >= ByteLength (array))
-                               throw new ArgumentOutOfRangeException ("index", Locale.GetText(
-                                       "Value must be non-negative and less than the size of the collection."));
-
-                       return GetByteInternal (array, index);
-               }
-
-               public static void SetByte (Array array, int index, byte value)
-               {
-                       if (index < 0 || index >= ByteLength (array))
-                               throw new ArgumentOutOfRangeException ("index", Locale.GetText(
-                                       "Value must be non-negative and less than the size of the collection."));
-
-                       SetByteInternal (array, index, value);
-               }
-
-               public static void BlockCopy (Array src, int srcOffset, Array dst, int dstOffset, int count)
-               {
-                       if (src == null)
-                               throw new ArgumentNullException ("src");
-
-                       if (dst == null)
-                               throw new ArgumentNullException ("dst");
-
-                       if (srcOffset < 0)
-                               throw new ArgumentOutOfRangeException ("srcOffset", Locale.GetText(
-                                       "Non-negative number required."));
-
-                       if (dstOffset < 0)
-                               throw new ArgumentOutOfRangeException ("dstOffset", Locale.GetText (
-                                       "Non-negative number required."));
-
-                       if (count < 0)
-                               throw new ArgumentOutOfRangeException ("count", Locale.GetText (
-                                       "Non-negative number required."));
-
-                       // We do the checks in unmanaged code for performance reasons
-                       bool res = BlockCopyInternal (src, srcOffset, dst, dstOffset, count);
-                       if (!res) {
-                               // watch for integer overflow
-                               if ((srcOffset > ByteLength (src) - count) || (dstOffset > ByteLength (dst) - count))
-                                       throw new ArgumentException (Locale.GetText (
-                                               "Offset and length were out of bounds for the array or count is greater than " + 
-                                               "the number of elements from index to the end of the source collection."));
-                       }
-               }
-
-               // private
-               [MethodImplAttribute (MethodImplOptions.InternalCall)]
-               private extern static int ByteLengthInternal (Array array);
-
-               [MethodImplAttribute (MethodImplOptions.InternalCall)]
-               private extern static byte GetByteInternal (Array array, int index);
-
-               [MethodImplAttribute (MethodImplOptions.InternalCall)]
-               private extern static void SetByteInternal (Array array, int index, int value);
-
-               [MethodImplAttribute (MethodImplOptions.InternalCall)]
-               internal extern static bool BlockCopyInternal (Array src, int src_offset, Array dest, int dest_offset, int count);
-
-               internal static bool InternalBlockCopy (Array src, int src_offset, Array dest, int dest_offset, int count)
-               {
-                       return BlockCopyInternal (src, src_offset, dest, dest_offset, count);
-               }
-
-               internal unsafe static void ZeroMemory (byte* src, long len)
-               {
-                       while(len-- > 0)
-                               *(src + len) = 0;
-               }
-
-        internal unsafe static void Memcpy (byte* pDest, int destIndex, byte[] src, int srcIndex, int len)
-        {
-            Contract.Assert( (srcIndex >= 0) && (destIndex >= 0) && (len >= 0), "Index and length must be non-negative!");        
-            Contract.Assert(src.Length - srcIndex >= len, "not enough bytes in src");
-            // If dest has 0 elements, the fixed statement will throw an 
-            // IndexOutOfRangeException.  Special-case 0-byte copies.
-            if (len==0)
-                return;
-            fixed(byte* pSrc = src) {
-                Memcpy(pDest + destIndex, pSrc + srcIndex, len);
-            }
-        }
-
-        internal unsafe static void Memcpy(byte[] dest, int destIndex, byte* src, int srcIndex, int len) {
-            Contract.Assert( (srcIndex >= 0) && (destIndex >= 0) && (len >= 0), "Index and length must be non-negative!");
-            Contract.Assert(dest.Length - destIndex >= len, "not enough bytes in dest");
-            // If dest has 0 elements, the fixed statement will throw an 
-            // IndexOutOfRangeException.  Special-case 0-byte copies.
-            if (len==0)
-                return;
-            fixed(byte* pDest = dest) {
-                Memcpy(pDest + destIndex, src + srcIndex, len);
-            }
-        }
-
-               internal static unsafe void memcpy4 (byte *dest, byte *src, int size) {
-                       /*while (size >= 32) {
-                               // using long is better than int and slower than double
-                               // FIXME: enable this only on correct alignment or on platforms
-                               // that can tolerate unaligned reads/writes of doubles
-                               ((double*)dest) [0] = ((double*)src) [0];
-                               ((double*)dest) [1] = ((double*)src) [1];
-                               ((double*)dest) [2] = ((double*)src) [2];
-                               ((double*)dest) [3] = ((double*)src) [3];
-                               dest += 32;
-                               src += 32;
-                               size -= 32;
-                       }*/
-                       while (size >= 16) {
-                               ((int*)dest) [0] = ((int*)src) [0];
-                               ((int*)dest) [1] = ((int*)src) [1];
-                               ((int*)dest) [2] = ((int*)src) [2];
-                               ((int*)dest) [3] = ((int*)src) [3];
-                               dest += 16;
-                               src += 16;
-                               size -= 16;
-                       }
-                       while (size >= 4) {
-                               ((int*)dest) [0] = ((int*)src) [0];
-                               dest += 4;
-                               src += 4;
-                               size -= 4;
-                       }
-                       while (size > 0) {
-                               ((byte*)dest) [0] = ((byte*)src) [0];
-                               dest += 1;
-                               src += 1;
-                               --size;
-                       }
-               }
-               internal static unsafe void memcpy2 (byte *dest, byte *src, int size) {
-                       while (size >= 8) {
-                               ((short*)dest) [0] = ((short*)src) [0];
-                               ((short*)dest) [1] = ((short*)src) [1];
-                               ((short*)dest) [2] = ((short*)src) [2];
-                               ((short*)dest) [3] = ((short*)src) [3];
-                               dest += 8;
-                               src += 8;
-                               size -= 8;
-                       }
-                       while (size >= 2) {
-                               ((short*)dest) [0] = ((short*)src) [0];
-                               dest += 2;
-                               src += 2;
-                               size -= 2;
-                       }
-                       if (size > 0)
-                               ((byte*)dest) [0] = ((byte*)src) [0];
-               }
-               static unsafe void memcpy1 (byte *dest, byte *src, int size) {
-                       while (size >= 8) {
-                               ((byte*)dest) [0] = ((byte*)src) [0];
-                               ((byte*)dest) [1] = ((byte*)src) [1];
-                               ((byte*)dest) [2] = ((byte*)src) [2];
-                               ((byte*)dest) [3] = ((byte*)src) [3];
-                               ((byte*)dest) [4] = ((byte*)src) [4];
-                               ((byte*)dest) [5] = ((byte*)src) [5];
-                               ((byte*)dest) [6] = ((byte*)src) [6];
-                               ((byte*)dest) [7] = ((byte*)src) [7];
-                               dest += 8;
-                               src += 8;
-                               size -= 8;
-                       }
-                       while (size >= 2) {
-                               ((byte*)dest) [0] = ((byte*)src) [0];
-                               ((byte*)dest) [1] = ((byte*)src) [1];
-                               dest += 2;
-                               src += 2;
-                               size -= 2;
-                       }
-                       if (size > 0)
-                               ((byte*)dest) [0] = ((byte*)src) [0];
-               }
-
-               internal static unsafe void Memcpy (byte *dest, byte *src, int size) {
-                       // FIXME: if pointers are not aligned, try to align them
-                       // so a faster routine can be used. Handle the case where
-                       // the pointers can't be reduced to have the same alignment
-                       // (just ignore the issue on x86?)
-                       if ((((int)dest | (int)src) & 3) != 0) {
-                               if (((int)dest & 1) != 0 && ((int)src & 1) != 0 && size >= 1) {
-                                       dest [0] = src [0];
-                                       ++dest;
-                                       ++src;
-                                       --size;
-                               }
-                               if (((int)dest & 2) != 0 && ((int)src & 2) != 0 && size >= 2) {
-                                       ((short*)dest) [0] = ((short*)src) [0];
-                                       dest += 2;
-                                       src += 2;
-                                       size -= 2;
-                               }
-                               if ((((int)dest | (int)src) & 1) != 0) {
-                                       memcpy1 (dest, src, size);
-                                       return;
-                               }
-                               if ((((int)dest | (int)src) & 2) != 0) {
-                                       memcpy2 (dest, src, size);
-                                       return;
-                               }
-                       }
-                       memcpy4 (dest, src, size);
-               }
-       }
-}
diff --git a/mcs/class/corlib/System/CLSCompliantAttribute.cs b/mcs/class/corlib/System/CLSCompliantAttribute.cs
deleted file mode 100644 (file)
index 37d317d..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// System.CLSCompliantAttribute.cs
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc.  http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System.Runtime.InteropServices;
-
-namespace System
-{
-       /// <summary>
-       ///   Used to indicate if an element of a program is CLS compliant.
-       /// </summary>
-       [AttributeUsage (AttributeTargets.All)]
-       [Serializable]
-       [ComVisible (true)]
-       public sealed class CLSCompliantAttribute : Attribute
-       {
-               bool is_compliant;
-
-               public CLSCompliantAttribute (bool isCompliant)
-               {
-                       this.is_compliant = isCompliant;
-               }
-
-               public bool IsCompliant {
-                       get {
-                               return is_compliant;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/corlib/System/Comparison.cs b/mcs/class/corlib/System/Comparison.cs
deleted file mode 100644 (file)
index f15ba11..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// Comparison.cs
-//
-// Authors:
-//  Ben Maurer (bmaurer@ximian.com)
-//  Marek Safar (marek.safar@gmail.com)
-//
-// Copyright (C) 2004 Novell
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System
-{
-       public delegate int Comparison <in T> (T x, T y);
-}
-
diff --git a/mcs/class/corlib/System/ConsoleCancelEventArgs.cs b/mcs/class/corlib/System/ConsoleCancelEventArgs.cs
deleted file mode 100644 (file)
index 8684879..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// System.ConsoleCancelEventArgs
-//
-// Authors:
-//     Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) 2005 Novell, Inc (http://www.novell.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System {
-       [Serializable]
-       public sealed class ConsoleCancelEventArgs : EventArgs {
-               bool cancel;
-               ConsoleSpecialKey specialKey;
-
-               internal ConsoleCancelEventArgs (ConsoleSpecialKey key)
-               {
-                       specialKey = key;
-               }
-
-               public bool Cancel {
-                       get { return cancel; }
-                       set { cancel = value; }
-               }
-
-               public ConsoleSpecialKey SpecialKey {
-                       get { return specialKey; }
-               }
-       }
-}
-
diff --git a/mcs/class/corlib/System/ConsoleCancelEventHandler.cs b/mcs/class/corlib/System/ConsoleCancelEventHandler.cs
deleted file mode 100644 (file)
index 027072f..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// System.ConsoleCancelEventHandler
-//
-// Authors:
-//     Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) 2005 Novell, Inc (http://www.novell.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-namespace System {
-       public delegate void ConsoleCancelEventHandler (object sender, ConsoleCancelEventArgs e);
-}
-
diff --git a/mcs/class/corlib/System/ConsoleColor.cs b/mcs/class/corlib/System/ConsoleColor.cs
deleted file mode 100644 (file)
index e148296..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// System.ConsoleColor
-//
-// Authors:
-//     Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) 2005 Novell, Inc (http://www.novell.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-namespace System {
-       [Serializable]
-       public enum ConsoleColor {
-               Black,
-               DarkBlue,
-               DarkGreen,
-               DarkCyan,
-               DarkRed,
-               DarkMagenta,
-               DarkYellow,
-               Gray,
-               DarkGray,
-               Blue,
-               Green,
-               Cyan,
-               Red,
-               Magenta,
-               Yellow,
-               White
-       }
-}
-
diff --git a/mcs/class/corlib/System/ConsoleKey.cs b/mcs/class/corlib/System/ConsoleKey.cs
deleted file mode 100644 (file)
index 78660b5..0000000
+++ /dev/null
@@ -1,180 +0,0 @@
-//
-// System.ConsoleKey
-//
-// Authors:
-//     Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) 2005 Novell, Inc (http://www.novell.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-namespace System {
-
-       [Serializable]
-       public enum ConsoleKey {
-               Backspace = 8,
-               Tab = 9,
-               Clear = 12,
-               Enter = 13,
-               Pause = 19,
-               Escape = 27,
-               Spacebar = 32,
-               PageUp = 33,
-               PageDown = 34,
-               End = 35,
-               Home = 36,
-               LeftArrow = 37,
-               UpArrow = 38,
-               RightArrow = 39,
-               DownArrow = 40,
-               Select = 41,
-               Print = 42,
-               Execute = 43,
-               PrintScreen = 44,
-               Insert = 45,
-               Delete = 46,
-               Help = 47,
-               D0 = 48,
-               D1 = 49,
-               D2 = 50,
-               D3 = 51,
-               D4 = 52,
-               D5 = 53,
-               D6 = 54,
-               D7 = 55,
-               D8 = 56,
-               D9 = 57,
-               A = 65,
-               B = 66,
-               C = 67,
-               D = 68,
-               E = 69,
-               F = 70,
-               G = 71,
-               H = 72,
-               I = 73,
-               J = 74,
-               K = 75,
-               L = 76,
-               M = 77,
-               N = 78,
-               O = 79,
-               P = 80,
-               Q = 81,
-               R = 82,
-               S = 83,
-               T = 84,
-               U = 85,
-               V = 86,
-               W = 87,
-               X = 88,
-               Y = 89,
-               Z = 90,
-               LeftWindows = 91,
-               RightWindows = 92,
-               Applications = 93,
-               Sleep = 95,
-               NumPad0 = 96,
-               NumPad1 = 97,
-               NumPad2 = 98,
-               NumPad3 = 99,
-               NumPad4 = 100,
-               NumPad5 = 101,
-               NumPad6 = 102,
-               NumPad7 = 103,
-               NumPad8 = 104,
-               NumPad9 = 105,
-               Multiply = 106,
-               Add = 107,
-               Separator = 108,
-               Subtract = 109,
-               Decimal = 110,
-               Divide = 111,
-               F1 = 112,
-               F2 = 113,
-               F3 = 114,
-               F4 = 115,
-               F5 = 116,
-               F6 = 117,
-               F7 = 118,
-               F8 = 119,
-               F9 = 120,
-               F10 = 121,
-               F11 = 122,
-               F12 = 123,
-               F13 = 124,
-               F14 = 125,
-               F15 = 126,
-               F16 = 127,
-               F17 = 128,
-               F18 = 129,
-               F19 = 130,
-               F20 = 131,
-               F21 = 132,
-               F22 = 133,
-               F23 = 134,
-               F24 = 135,
-               BrowserBack = 166,
-               BrowserForward = 167,
-               BrowserRefresh = 168,
-               BrowserStop = 169,
-               BrowserSearch = 170,
-               BrowserFavorites = 171,
-               BrowserHome = 172,
-               VolumeMute = 173,
-               VolumeDown = 174,
-               VolumeUp = 175,
-               MediaNext = 176,
-               MediaPrevious = 177,
-               MediaStop = 178,
-               MediaPlay = 179,
-               LaunchMail = 180,
-               LaunchMediaSelect = 181,
-               LaunchApp1 = 182,
-               LaunchApp2 = 183,
-               Oem1 = 186,
-               OemPlus = 187,
-               OemComma = 188,
-               OemMinus = 189,
-               OemPeriod = 190,
-               Oem2 = 191,
-               Oem3 = 192,
-               Oem4 = 219,
-               Oem5 = 220,
-               Oem6 = 221,
-               Oem7 = 222,
-               Oem8 = 223,
-               Oem102 = 226,
-               Process = 229,
-               Packet = 231,
-               Attention = 246,
-               CrSel = 247,
-               ExSel = 248,
-               EraseEndOfFile = 249,
-               Play = 250,
-               Zoom = 251,
-               NoName = 252,
-               Pa1 = 253,
-               OemClear = 254,
-       }
-}
-
diff --git a/mcs/class/corlib/System/ConsoleKeyInfo.cs b/mcs/class/corlib/System/ConsoleKeyInfo.cs
deleted file mode 100644 (file)
index 961cb94..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-//
-// System.ConsoleKeyInfo.cs
-//
-// Authors:
-//     Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) 2005 Novell, Inc (http://www.novell.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-namespace System {
-       [Serializable]
-       public struct ConsoleKeyInfo {
-               internal static ConsoleKeyInfo Empty = new ConsoleKeyInfo ('\0', 0, false, false, false);
-               ConsoleKey _key;
-               char _keyChar;
-               ConsoleModifiers _mods;
-
-               public ConsoleKeyInfo (char keyChar, ConsoleKey key, bool shift, bool alt, bool control)
-               {
-                       _key = key;
-                       _keyChar = keyChar;
-                       _mods = 0;
-                       SetModifiers (shift, alt, control);
-               }
-
-               internal ConsoleKeyInfo (ConsoleKeyInfo other)
-               {
-                       _key = other._key;
-                       _keyChar = other._keyChar;
-                       _mods = other._mods;
-               }
-
-               internal void SetKey (ConsoleKey key)
-               {
-                       _key = key;
-               }
-
-               internal void SetKeyChar (char keyChar)
-               {
-                       _keyChar = keyChar;
-               }
-
-               internal void SetModifiers (bool shift, bool alt, bool control)
-               {
-                       _mods = (shift) ? ConsoleModifiers.Shift : 0;
-                       _mods |= (alt) ? ConsoleModifiers.Alt : 0;
-                       _mods |= (control) ? ConsoleModifiers.Control : 0;
-               }
-
-               public ConsoleKey Key 
-               {
-                       get { return _key; }
-               }
-
-               public char KeyChar 
-               {
-                       get { return _keyChar; }
-               }
-
-               public ConsoleModifiers Modifiers 
-               {
-                       get { return _mods; }
-               }
-
-               public override bool Equals (object value)
-               {
-                       if (!(value is ConsoleKeyInfo))
-                               return false;
-
-                       return Equals ((ConsoleKeyInfo) value);
-               }
-
-               public static bool operator == (ConsoleKeyInfo a, ConsoleKeyInfo b)
-               {
-                       return a.Equals (b);
-               }
-
-               public static bool operator != (ConsoleKeyInfo a, ConsoleKeyInfo b)
-               {
-                       return !a.Equals (b);
-               }
-
-               public bool Equals (ConsoleKeyInfo obj)
-               {
-                       return _key == obj._key && _keyChar == obj._keyChar && _mods == obj._mods;
-               }
-
-               public override int GetHashCode ()
-               {
-                       return _key.GetHashCode () ^ _keyChar.GetHashCode () ^ _mods.GetHashCode ();
-               }
-       }
-}
diff --git a/mcs/class/corlib/System/ConsoleModifiers.cs b/mcs/class/corlib/System/ConsoleModifiers.cs
deleted file mode 100644 (file)
index da71626..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.ConsoleModifiers
-//
-// Authors:
-//     Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) 2005 Novell, Inc (http://www.novell.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-namespace System {
-       [Flags]
-       [Serializable]
-       public enum ConsoleModifiers {
-               Alt = 1,
-               Shift = 2,
-               Control = 4
-       }
-}
-
diff --git a/mcs/class/corlib/System/ConsoleSpecialKey.cs b/mcs/class/corlib/System/ConsoleSpecialKey.cs
deleted file mode 100644 (file)
index 2d08ba4..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.ConsoleSpecialKey
-//
-// Authors:
-//     Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) 2005 Novell, Inc (http://www.novell.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-namespace System {
-       [Serializable]
-       public enum ConsoleSpecialKey {
-               ControlC,
-               ControlBreak
-       }
-}
-
-
diff --git a/mcs/class/corlib/System/ContextBoundObject.cs b/mcs/class/corlib/System/ContextBoundObject.cs
deleted file mode 100644 (file)
index ca954d6..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// System.ContextBoundObject.cs
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc.  http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System.Runtime.InteropServices;
-
-namespace System
-{
-       [Serializable]
-       [ComVisible (true)]
-       public abstract class ContextBoundObject : MarshalByRefObject
-       {
-               protected ContextBoundObject ()
-               {
-               }
-       }
-}
diff --git a/mcs/class/corlib/System/ContextStaticAttribute.cs b/mcs/class/corlib/System/ContextStaticAttribute.cs
deleted file mode 100644 (file)
index 9593d24..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// System.ContextStaticAttribute.cs
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc.  http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System.Runtime.InteropServices;
-
-namespace System
-{
-       /// <summary>
-       ///   The ContextStatic attribute is used to flag fields as being unique
-       /// </summary>
-       [AttributeUsage (AttributeTargets.Field, Inherited=false)]
-       [Serializable]
-       [ComVisible (true)]
-       public class ContextStaticAttribute : Attribute
-       {
-               public ContextStaticAttribute ()
-                       : base ()
-               {
-               }
-       }
-}
diff --git a/mcs/class/corlib/System/Converter.cs b/mcs/class/corlib/System/Converter.cs
deleted file mode 100644 (file)
index 07e5618..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// Converter.cs
-//
-// Authors:
-//  Ben Maurer (bmaurer@ximian.com)
-//  Marek Safar (marek.safar@gmail.com)
-//
-// Copyright (C) 2004 Novell
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System
-{
-       public delegate TOutput Converter <in TInput, out TOutput> (TInput input);
-}
index ddbd37a5e27b405a9485c8495f309cbec47840cd..d4062a91b9bebd045f91179f3c03bf4ef36d615e 100644 (file)
@@ -57,7 +57,7 @@ namespace System {
                 * of icalls, do not require an increment.
                 */
 #pragma warning disable 169
-               private const int mono_corlib_version = 125;
+               private const int mono_corlib_version = 129;
 #pragma warning restore 169
 
                [ComVisible (true)]
diff --git a/mcs/class/corlib/System/EventArgs.cs b/mcs/class/corlib/System/EventArgs.cs
deleted file mode 100644 (file)
index 6d903ec..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// System.EventArgs.cs 
-//
-// Author:
-//   Michael Lambert (michaellambert@email.com)
-//
-// (C) 2001 Michael Lambert, All Rights Reserved
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System.Runtime.InteropServices;
-
-namespace System
-{
-       [Serializable]
-       [ComVisible (true)]
-       public class EventArgs
-       {
-               public static readonly EventArgs Empty = new EventArgs ();
-
-               public EventArgs ()
-               {
-               }
-       }
-}
diff --git a/mcs/class/corlib/System/EventHandler.cs b/mcs/class/corlib/System/EventHandler.cs
deleted file mode 100644 (file)
index 4d67067..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// System.EventHandler.cs
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//   Marek Safar (marek.safar@gmail.com)
-//
-// (C) Ximian, Inc.  http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System {
-
-       [Serializable]
-       public delegate void EventHandler<TEventArgs> (object sender, TEventArgs e)
-       ;
-
-       [Serializable]
-       [System.Runtime.InteropServices.ComVisible (true)]
-       public delegate void EventHandler (object sender, EventArgs e);
-}
index 23e4469433b04aade86e7e1e090c3dd105fd147f..0e305c1ede2b5035e4b9be9d82a3aeabe2f2a571 100644 (file)
@@ -57,7 +57,7 @@ namespace System
                   (vtable/MRGCTX) of the frames. */
                IntPtr [] trace_ips;
                Exception inner_exception;
-               internal string message;
+               internal string _message;
                string help_link;
                string class_name;
                string stack_trace;
@@ -80,7 +80,7 @@ namespace System
 
                public Exception (string message)
                {
-                       this.message = message;
+                       this._message = message;
                }
 
                protected Exception (SerializationInfo info, StreamingContext context)
@@ -89,7 +89,7 @@ namespace System
                                throw new ArgumentNullException ("info");
 
                        class_name          = info.GetString ("ClassName");
-                       message             = info.GetString ("Message");
+                       _message             = info.GetString ("Message");
                        help_link           = info.GetString ("HelpURL");
                        stack_trace         = info.GetString ("StackTraceString");
                        _remoteStackTraceString  = info.GetString ("RemoteStackTraceString");
@@ -108,7 +108,7 @@ namespace System
                public Exception (string message, Exception innerException)
                {
                        inner_exception = innerException;
-                       this.message = message;
+                       this._message = message;
                }
 
                public Exception InnerException {
@@ -132,7 +132,7 @@ namespace System
 
                internal void SetMessage (string s)
                {
-                       message = s;
+                       _message = s;
                }
 
                internal void SetStackTrace (string s)
@@ -150,11 +150,11 @@ namespace System
 
                public virtual string Message {
                        get {
-                               if (message == null)
-                                       message = string.Format (Locale.GetText ("Exception of type '{0}' was thrown."),
+                               if (_message == null)
+                                       _message = string.Format (Locale.GetText ("Exception of type '{0}' was thrown."),
                                                ClassName);
 
-                               return message;
+                               return _message;
                        }
                }
                
@@ -302,7 +302,7 @@ namespace System
                                throw new ArgumentNullException ("info");
 
                        info.AddValue ("ClassName", ClassName);
-                       info.AddValue ("Message", message);
+                       info.AddValue ("Message", _message);
                        info.AddValue ("InnerException", inner_exception);
                        info.AddValue ("HelpURL", help_link);
                        info.AddValue ("StackTraceString", StackTrace);
@@ -407,13 +407,7 @@ namespace System
                // For ExceptionDispatchInfo
                internal void RestoreExceptionDispatchInfo (System.Runtime.ExceptionServices.ExceptionDispatchInfo exceptionDispatchInfo)
                {
-                       if (captured_traces != null) {
-                               Array.Resize (ref captured_traces, captured_traces.Length + 1);
-                       } else {
-                               captured_traces = new StackTrace [1];
-                       }
-                       captured_traces [captured_traces.Length - 1] = new StackTrace (this, 0, true, true);
-
+                       captured_traces = (StackTrace[]) exceptionDispatchInfo.BinaryStackTraceArray;
                        trace_ips = null;
                }
 
diff --git a/mcs/class/corlib/System/FlagsAttribute.cs b/mcs/class/corlib/System/FlagsAttribute.cs
deleted file mode 100644 (file)
index cab0eec..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-// System.FlagsAttribute.cs
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc.  http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System.Runtime.InteropServices;
-
-namespace System {
-
-       /// <summary>
-       ///   The FlagsAttribute tags enumerations as bitfields.
-       /// </summary>
-       ///
-       /// <remarks>
-       ///   The FlagsAttribute can be used to tag an enumeration to be 
-       ///   a bit field.  This will allow the compiler and visual tools
-       ///   to treat the bits in an enumeration as a set of flags.
-       /// </remarks>
-
-       [AttributeUsage (AttributeTargets.Enum, Inherited=false)]
-       [Serializable]
-       [ComVisible (true)]
-       public class FlagsAttribute : Attribute {
-
-               // No methods.
-               
-       }
-}
diff --git a/mcs/class/corlib/System/Funcs.cs b/mcs/class/corlib/System/Funcs.cs
deleted file mode 100644 (file)
index df011e8..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-//
-// System.Func.cs
-//
-// Authors:
-//      Alejandro Serrano "Serras" (trupill@yahoo.es)
-//     Marek Safar (marek.safar@gmail.com)
-//
-
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR TArg PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-//
-
-using System.Runtime.CompilerServices;
-
-namespace System {
-
-#if MOBILE
-       [TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#else
-       [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
-#endif
-       public delegate TResult Func<out TResult> ();
-       
-#if MOBILE
-       [TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#else
-       [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
-#endif
-       public delegate TResult Func<in T, out TResult> (T arg);
-       
-#if MOBILE
-       [TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#else
-       [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
-#endif
-       public delegate TResult Func<in T1, in T2, out TResult> (T1 arg1, T2 arg2);
-       
-#if MOBILE
-       [TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#else
-       [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
-#endif
-       public delegate TResult Func<in T1, in T2, in T3, out TResult> (T1 arg1, T2 arg2, T3 arg3);
-       
-#if MOBILE
-       [TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#else
-       [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
-#endif
-       public delegate TResult Func<in T1, in T2, in T3, in T4, out TResult> (T1 arg1, T2 arg2, T3 arg3, T4 arg4);
-       
-       public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, out TResult> (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5);
-       public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, out TResult> (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6);
-       public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, in T7, out TResult> (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7);
-       public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, out TResult> (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8);
-}
index be979f692bf9d38a039227eb50e0b48c3363f8f0..753855f7a7775786c377950c9b6d17fa8b8d4e31 100644 (file)
@@ -30,7 +30,7 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-#if !MONOTOUCH
+#if !(MONOTOUCH && FULL_AOT_RUNTIME)
 
 using System.Security.Cryptography;
 
diff --git a/mcs/class/corlib/System/IAppDomainSetup.cs b/mcs/class/corlib/System/IAppDomainSetup.cs
deleted file mode 100644 (file)
index c4e6a7a..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-// System.IAppDomainSetup.cs
-//
-// Author:
-//   Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) 2001 Ximian, Inc.  http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Runtime.InteropServices;
-
-namespace System {
-
-       [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
-       [Guid ("27FFF232-A7A8-40DD-8D4A-734AD59FCD41")]
-       [ComVisible(true)]
-       public interface IAppDomainSetup {
-
-               string ApplicationBase { get; set; }
-
-               string ApplicationName { get; set; }
-
-               string CachePath { get; set; }
-
-               string ConfigurationFile { get; set; }
-
-               string DynamicBase { get; set; }
-
-               string LicenseFile { get; set; }
-
-               string PrivateBinPath { get; set; }
-
-               string PrivateBinPathProbe { get; set; }
-
-               string ShadowCopyDirectories { get; set; }
-
-               string ShadowCopyFiles { get; set; }
-       }
-}
diff --git a/mcs/class/corlib/System/IApplicationDescription.cs b/mcs/class/corlib/System/IApplicationDescription.cs
deleted file mode 100644 (file)
index 95f2967..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// System.IApplicationDescription interface
-//
-// Author:
-//     Sebastien Pouliot  <sebastien@ximian.com>
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System {
-
-       public interface IApplicationDescription : ICloneable {
-
-               string ApplicationCodeBase {
-                       get;
-               }
-
-               string ApplicationManifest {
-                       get;
-               }
-
-               string ApplicationManifestPath {
-                       get;
-               }
-
-               string DeploymentCodeBase {
-                       get;
-               }
-
-               string DeploymentManifest {
-                       get;
-               }
-
-               string DeploymentManifestPath {
-                       get;
-               }
-       }
-}
diff --git a/mcs/class/corlib/System/IAsyncResult.cs b/mcs/class/corlib/System/IAsyncResult.cs
deleted file mode 100644 (file)
index 94062b8..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-//------------------------------------------------------------------------------
-// 
-// System.IAsyncResult.cs 
-//
-// Copyright (C) 2001 Michael Lambert, All Rights Reserved
-// 
-// Author:         Michael Lambert, michaellambert@email.com
-// Created:        Mon 08/24/2001 
-//
-//------------------------------------------------------------------------------
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Threading;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-namespace System {
-
-       [ComVisible(true)]
-       public interface IAsyncResult
-       {
-               object AsyncState
-               {
-                       get;
-               }
-
-               WaitHandle AsyncWaitHandle
-               {
-                       get;
-               }
-
-               bool CompletedSynchronously
-               {
-                       get;
-               }
-
-               bool IsCompleted
-               {
-                       get;
-               }
-       }
-       
-} // Namespace System
-
-
diff --git a/mcs/class/corlib/System/ICloneable.cs b/mcs/class/corlib/System/ICloneable.cs
deleted file mode 100644 (file)
index 931f534..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// System.ICloneable.cs
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc.  http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System.Runtime.InteropServices;
-
-namespace System {
-       [ComVisible(true)]
-#if INSIDE_CORLIB
-       public
-#else
-       internal
-#endif
-       interface ICloneable {
-               object Clone ();
-       }
-}
diff --git a/mcs/class/corlib/System/IComparable.cs b/mcs/class/corlib/System/IComparable.cs
deleted file mode 100644 (file)
index c533002..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// System.IComparable.cs
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//   Marek Safar (marek.safar@gmail.com)
-//
-// (C) Ximian, Inc.  http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System.Runtime.InteropServices;
-
-namespace System {
-
-       [ComVisible(true)]
-       public interface IComparable {
-               int CompareTo (object obj);
-       }
-       
-       public interface IComparable <in T> {
-               int CompareTo (T other);
-       }
-}
diff --git a/mcs/class/corlib/System/IConvertible.cs b/mcs/class/corlib/System/IConvertible.cs
deleted file mode 100644 (file)
index 3816252..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// System.IConvertible.cs
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc.  http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-//
-// Functions Implementing this interface should check out 
-// System.Convert. Most of these methods are implemented 
-// there for all these data types.
-//
-// System.Convert has ToType helper method for the object 
-// ToType (Type conversionType, IFormatProvider provider)
-// method. In most cases you can specify your ToType function
-// as calling 
-//
-// public Type value; // value of this data type
-// public object ToType(Type conversionType, IFormatProvider provider) {
-//    Convert.ToType (value, conversionType, provider);
-// } 
-// 
-// Which is just a wrapper for your ToType methods.
-//
-// See http://lists.ximian.com/archives/public/mono-list/2001-July/000525.html
-// for more discussion on the topic
-//
-using System.Runtime.InteropServices;
-
-namespace System {
-
-    [ComVisible(true)]
-    [CLSCompliant(false)]
-    public interface IConvertible {
-       
-       TypeCode GetTypeCode ();
-       
-       bool     ToBoolean  (IFormatProvider provider);
-       byte     ToByte     (IFormatProvider provider);
-       char     ToChar     (IFormatProvider provider);
-       DateTime ToDateTime (IFormatProvider provider);
-       decimal  ToDecimal  (IFormatProvider provider);
-       double   ToDouble   (IFormatProvider provider);
-       short    ToInt16    (IFormatProvider provider);
-       int      ToInt32    (IFormatProvider provider);
-       long     ToInt64    (IFormatProvider provider);
-       sbyte    ToSByte    (IFormatProvider provider);
-       float    ToSingle   (IFormatProvider provider);
-       string   ToString   (IFormatProvider provider);
-       object   ToType     (Type conversionType, IFormatProvider provider);
-       ushort   ToUInt16   (IFormatProvider provider);
-       uint     ToUInt32   (IFormatProvider provider);
-       ulong    ToUInt64   (IFormatProvider provider);
-    }
-}
diff --git a/mcs/class/corlib/System/ICustomFormatter.cs b/mcs/class/corlib/System/ICustomFormatter.cs
deleted file mode 100644 (file)
index 876c5ce..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.ICustomFormatter.cs
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc.  http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System.Runtime.InteropServices;
-
-namespace System {
-
-        [ComVisible(true)]
-       public interface ICustomFormatter {
-               string Format (string format, object arg, IFormatProvider formatProvider);
-       }
-}
diff --git a/mcs/class/corlib/System/IDisposable.cs b/mcs/class/corlib/System/IDisposable.cs
deleted file mode 100644 (file)
index 9c1859a..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.IDisposable.cs
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc.  http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System.Runtime.InteropServices;
-
-namespace System {
-
-        [ComVisible(true)]
-       public interface IDisposable {
-
-               void Dispose ();
-               
-       }
-}
diff --git a/mcs/class/corlib/System/IEquatable.cs b/mcs/class/corlib/System/IEquatable.cs
deleted file mode 100644 (file)
index c4092d9..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// System.IEquatable.cs
-//
-// Author:
-//   Ben Maurer <bmaurer@novell.com>
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System {
-       public interface IEquatable <T> {
-               bool Equals (T other);
-       }
-}
diff --git a/mcs/class/corlib/System/IFormatProvider.cs b/mcs/class/corlib/System/IFormatProvider.cs
deleted file mode 100644 (file)
index 26afc9e..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.IFormatProvider.cs
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc.  http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System.Runtime.InteropServices;
-
-namespace System {
-
-        [ComVisible(true)]
-       public interface IFormatProvider {
-               object GetFormat (Type formatType);
-       }
-}
diff --git a/mcs/class/corlib/System/IFormattable.cs b/mcs/class/corlib/System/IFormattable.cs
deleted file mode 100644 (file)
index 30a8670..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.IFormattable.cs
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc.  http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System.Runtime.InteropServices;
-
-namespace System {
-
-        [ComVisible(true)]
-       public interface IFormattable {
-               string ToString (string format, IFormatProvider formatProvider);
-       }
-}
diff --git a/mcs/class/corlib/System/IHostContext.cs b/mcs/class/corlib/System/IHostContext.cs
deleted file mode 100644 (file)
index 841fa08..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// System.IHostContext interface
-//
-// Author:
-//     Sebastien Pouliot  <sebastien@ximian.com>
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System {
-
-       public interface IHostContext {
-
-               bool AssumeTrust {
-                       get;
-               }
-
-               bool ExclusiveGrant {
-                       get;
-               }
-
-               bool IsFirstTimeInstall {
-                       get;
-               }
-
-               bool NoPrompt {
-                       get;
-               }
-
-               bool Persist {
-                       get;
-               }
-       }
-}
diff --git a/mcs/class/corlib/System/IObservable.cs b/mcs/class/corlib/System/IObservable.cs
deleted file mode 100644 (file)
index 5274dbb..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// IObservable.cs
-//
-// Authors:
-//     Marek Safar  <marek.safar@gmail.com>
-//
-// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System
-{
-       public interface IObservable<out T>
-       {
-               IDisposable Subscribe (IObserver<T> observer);
-       }
-}
-
diff --git a/mcs/class/corlib/System/IObserver.cs b/mcs/class/corlib/System/IObserver.cs
deleted file mode 100644 (file)
index f6aaf6b..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// IObserver.cs
-//
-// Authors:
-//     Marek Safar  <marek.safar@gmail.com>
-//
-// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System
-{
-       public interface IObserver<in T>
-       {
-               void OnCompleted ();
-               void OnError (Exception error);
-               void OnNext(T value);
-       }
-}
-
diff --git a/mcs/class/corlib/System/IProgress.cs b/mcs/class/corlib/System/IProgress.cs
deleted file mode 100644 (file)
index 690f62d..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// IProgress.cs
-//
-// Authors:
-//     Marek Safar  <marek.safar@gmail.com>
-//
-// Copyright (C) 2011 Xamarin, Inc (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System
-{
-       public interface IProgress<in T>
-       {
-               void Report (T value);
-       }
-}
-
diff --git a/mcs/class/corlib/System/IServiceProvider.cs b/mcs/class/corlib/System/IServiceProvider.cs
deleted file mode 100644 (file)
index d9d0faa..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// System.IServiceProvider.cs
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc.  http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System
-{
-       public interface IServiceProvider
-       {
-               object GetService (Type serviceType);
-       }
-}
diff --git a/mcs/class/corlib/System/InvalidTimeZoneException.cs b/mcs/class/corlib/System/InvalidTimeZoneException.cs
deleted file mode 100644 (file)
index 27dd66a..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * System.InvalidimeZoneException
- *
- * Author(s)
- *     Stephane Delcroix <stephane@delcroix.org>
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- * 
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-using System.Runtime.CompilerServices;
-
-namespace System
-{
-       [Serializable]
-#if MOBILE
-       [TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#else
-       [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
-#endif
-       public
-       class InvalidTimeZoneException : Exception
-       {
-               public InvalidTimeZoneException () : base ()
-               {}
-
-               public InvalidTimeZoneException (string message) : base (message)
-               {}
-
-               public InvalidTimeZoneException (string message, Exception innerException) : base (message, innerException)
-               {}
-
-               protected InvalidTimeZoneException (Runtime.Serialization.SerializationInfo info, Runtime.Serialization.StreamingContext context) : base (info, context)
-               {}
-       }
-}
diff --git a/mcs/class/corlib/System/LoaderOptimization.cs b/mcs/class/corlib/System/LoaderOptimization.cs
deleted file mode 100644 (file)
index 885ee07..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// System.LoaderOptimization.cs
-//
-// Author:
-//   Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.  http://www.ximian.com
-// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System
-{
-       [ComVisible (true)]
-       [Serializable]
-       public enum LoaderOptimization
-       {
-               NotSpecified = 0,
-               SingleDomain = 1,
-               MultiDomain = 2,
-               MultiDomainHost = 3,
-
-               [Obsolete]
-               DomainMask = 3,
-
-               [Obsolete]
-               DisallowBindings = 4
-       }
-}
diff --git a/mcs/class/corlib/System/LoaderOptimizationAttribute.cs b/mcs/class/corlib/System/LoaderOptimizationAttribute.cs
deleted file mode 100644 (file)
index c817f15..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// System.LoaderOptimizationAttribute.cs
-//
-// Author: 
-//   Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.  http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System.Runtime.InteropServices;
-
-namespace System
-{
-       [AttributeUsage (AttributeTargets.Method)]
-       [ComVisible (true)]
-       public sealed class LoaderOptimizationAttribute : Attribute
-       {
-               private LoaderOptimization lo;
-               
-               // Constructors
-               public LoaderOptimizationAttribute (byte value)
-               {
-                       lo = (LoaderOptimization) value;
-               }
-
-               public LoaderOptimizationAttribute (LoaderOptimization value)
-               {
-                       lo = value;
-               }
-
-               // Properties
-               public LoaderOptimization Value {
-                       get { return lo; }
-               }
-       }
-}
diff --git a/mcs/class/corlib/System/MTAThreadAttribute.cs b/mcs/class/corlib/System/MTAThreadAttribute.cs
deleted file mode 100644 (file)
index d684ee9..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// System.MTAThreadAttribute.cs
-//
-// Author: Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.  http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System.Runtime.InteropServices;
-
-namespace System
-{
-       [AttributeUsage (AttributeTargets.Method)]
-       [ComVisible (true)]
-       public sealed class MTAThreadAttribute : Attribute
-       {
-               // Constructors
-               public MTAThreadAttribute () : base ()
-               {
-               }
-       }
-}
diff --git a/mcs/class/corlib/System/NonSerializedAttribute.cs b/mcs/class/corlib/System/NonSerializedAttribute.cs
deleted file mode 100644 (file)
index e5e2eea..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// System.NonSerializedAttribute.cs
-//
-// Author:
-//   Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc.  http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System.Runtime.InteropServices;
-
-namespace System
-{
-       [ComVisible (true)]
-       [AttributeUsage (AttributeTargets.Field, Inherited=false)]
-       public sealed class NonSerializedAttribute : Attribute
-       {
-               public NonSerializedAttribute ()
-               {
-               }
-       }
-}
index 4ffabc85a30ca39319c5d8555afdc3d68c362196..ecec3b508b2c32b309de3bfa33770b20c04d9d07 100644 (file)
 using System.Runtime.InteropServices;
 using System.Text;
 namespace System {
-       class NullConsoleDriver : IConsoleDriver {
+       class NullConsoleDriver : IConsoleDriver
+       {
+               static readonly ConsoleKeyInfo EmptyConsoleKeyInfo = new ConsoleKeyInfo ('\0', 0, false, false, false);
+
                public ConsoleColor BackgroundColor {
                        get { return ConsoleColor.Black; }
                        set {
@@ -151,7 +154,7 @@ namespace System {
 
                public ConsoleKeyInfo ReadKey (bool intercept)
                {
-                       return ConsoleKeyInfo.Empty;
+                       return EmptyConsoleKeyInfo;
                }
 
                public void ResetColor ()
diff --git a/mcs/class/corlib/System/ObsoleteAttribute.cs b/mcs/class/corlib/System/ObsoleteAttribute.cs
deleted file mode 100644 (file)
index 942bbbc..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-//
-// System.ObsoleteAttribute.cs
-//
-// Author:
-//   Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.  http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System.Runtime.InteropServices;
-
-namespace System
-{
-       [AttributeUsage (AttributeTargets.Class | AttributeTargets.Struct |
-               AttributeTargets.Enum | AttributeTargets.Constructor |
-               AttributeTargets.Method | AttributeTargets.Property |
-               AttributeTargets.Field | AttributeTargets.Event |
-               AttributeTargets.Interface | AttributeTargets.Delegate,
-               Inherited=false)]
-       [Serializable]
-       [ComVisible (true)]
-       public sealed class ObsoleteAttribute : Attribute
-       {
-               private string _message;
-               private bool _error;
-
-               //       Constructors
-               public ObsoleteAttribute ()
-                       : base ()
-               {
-               }
-
-               public ObsoleteAttribute (string message)
-               {
-                       _message = message;
-               }
-
-               public ObsoleteAttribute (string message, bool error)
-               {
-                       _message = message;
-                       _error = error;
-               }
-
-               // Properties
-               public string Message {
-                       get { return _message; }
-               }
-
-               public bool IsError {
-                       get { return _error; }
-               }
-       }
-}
diff --git a/mcs/class/corlib/System/ParamArrayAttribute.cs b/mcs/class/corlib/System/ParamArrayAttribute.cs
deleted file mode 100644 (file)
index 4084798..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// System.ParamArrayAttribute.cs
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc.  http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System.Runtime.InteropServices;
-
-namespace System
-{
-       /// <summary>
-       ///   Used to flag that the method will take a variable number
-       ///   of arguments
-       /// </summary>
-       [AttributeUsage (AttributeTargets.Parameter)]
-       [ComVisible (true)]
-       public sealed class ParamArrayAttribute : Attribute
-       {
-               public ParamArrayAttribute ()
-               {
-               }
-       }
-}
diff --git a/mcs/class/corlib/System/Predicate.cs b/mcs/class/corlib/System/Predicate.cs
deleted file mode 100644 (file)
index 66086b0..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// System.Predicate.cs
-//
-// Authors:
-//  Ben Maurer (bmaurer@ximian.com)
-//  Marek Safar (marek.safar@gmail.com)
-//
-// Copyright (C) 2004 Novell
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System
-{
-       public delegate bool Predicate <in T> (T obj);
-}
-
diff --git a/mcs/class/corlib/System/STAThreadAttribute.cs b/mcs/class/corlib/System/STAThreadAttribute.cs
deleted file mode 100644 (file)
index 754ad34..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// System.STAThreadAttribute.cs
-//
-// Author:
-//   Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.  http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System.Runtime.InteropServices;
-
-namespace System
-{
-       [AttributeUsage (AttributeTargets.Method)]
-       [ComVisible (true)]
-       public sealed class STAThreadAttribute : Attribute
-       {
-               // Constructors
-               public STAThreadAttribute ()
-                       : base ()
-               {
-               }
-       }
-}
diff --git a/mcs/class/corlib/System/SerializableAttribute.cs b/mcs/class/corlib/System/SerializableAttribute.cs
deleted file mode 100644 (file)
index cfbb766..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// System.SerializableAttribute.cs
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc.  http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System.Runtime.InteropServices;
-
-namespace System
-{
-       /// <summary>
-       ///   Serialization Attribute for classes. 
-       /// </summary>
-       
-       /// <remarks>
-       ///   Use SerializableAttribute to mark classes that do not implement
-       ///   the ISerializable interface but that want to be serialized.
-       ///
-       ///   Failing to do so will cause the system to throw an exception.
-       ///
-       ///   When a class is market with the SerializableAttribute, all the
-       ///   fields are automatically serialized with the exception of those
-       ///   that are tagged with the NonSerializedAttribute.
-       ///
-       ///   SerializableAttribute should only be used for classes that contain
-       ///   simple data types that can be serialized and deserialized by the
-       ///   runtime (typically you would use NonSerializedAttribute on data
-       ///   that can be reconstructed at any point: like caches or precomputed
-       ///   tables). 
-       /// </remarks>
-
-       [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct 
-               | AttributeTargets.Enum | AttributeTargets.Delegate, 
-               Inherited=false)]
-       [ComVisible (true)]
-       public sealed class SerializableAttribute : Attribute
-       {
-       }
-}
index f4b03396225bc510f824640e6c8a482d5ba2928e..6424d4fb79a74e81837f8e64d441f228384725a6 100644 (file)
@@ -229,7 +229,7 @@ namespace System {
                                length++;
 
                        byte [] result = new byte [length];
-                       Buffer.BlockCopyInternal (buffer, offset, result, 0, length);
+                       Buffer.InternalBlockCopy (buffer, offset, result, 0, length);
                        return result;
                }
 
diff --git a/mcs/class/corlib/System/ThreadStaticAttribute.cs b/mcs/class/corlib/System/ThreadStaticAttribute.cs
deleted file mode 100644 (file)
index 3c13c3d..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// System.ThreadStaticAttribute.cs
-//
-// Author:
-//   Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.  http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System.Runtime.InteropServices;
-
-namespace System
-{
-       [AttributeUsage (AttributeTargets.Field, Inherited=false)]
-       [Serializable]
-       [ComVisible (true)]
-       public class ThreadStaticAttribute : Attribute
-       {
-               // Constructors
-               public ThreadStaticAttribute ()
-                       : base ()
-               {
-               }
-       }
-}
diff --git a/mcs/class/corlib/System/TimeZoneInfo.AdjustmentRule.cs b/mcs/class/corlib/System/TimeZoneInfo.AdjustmentRule.cs
deleted file mode 100644 (file)
index 3afac77..0000000
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * System.TimeZoneInfo.AdjustmentRule
- *
- * Author(s)
- *     Stephane Delcroix <stephane@delcroix.org>
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- * 
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-using System.Runtime.CompilerServices;
-using System.Runtime.Serialization;
-
-namespace System
-{
-       public
-       sealed partial class TimeZoneInfo {
-               [SerializableAttribute]
-#if MOBILE
-       [TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#else
-       [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
-#endif
-               public sealed class AdjustmentRule : IEquatable<TimeZoneInfo.AdjustmentRule>, ISerializable, IDeserializationCallback
-               {
-                       DateTime dateEnd;
-                       public DateTime DateEnd {
-                               get { return dateEnd; } 
-                       }
-
-                       DateTime dateStart;
-                       public DateTime DateStart {
-                               get { return dateStart; }
-                       }
-
-                       TimeSpan daylightDelta;
-                       public TimeSpan DaylightDelta {
-                               get { return daylightDelta; }
-                       }
-
-                       TransitionTime daylightTransitionEnd;
-                       public TransitionTime DaylightTransitionEnd {
-                               get { return daylightTransitionEnd; }
-                       }
-
-                       TransitionTime daylightTransitionStart;
-                       public TransitionTime DaylightTransitionStart {
-                               get { return daylightTransitionStart; }
-                       }
-
-                       public static AdjustmentRule CreateAdjustmentRule (
-                               DateTime dateStart,
-                               DateTime dateEnd,
-                               TimeSpan daylightDelta,
-                               TransitionTime daylightTransitionStart,
-                               TransitionTime daylightTransitionEnd)
-                       {
-                               return new AdjustmentRule (dateStart, dateEnd, daylightDelta, daylightTransitionStart, daylightTransitionEnd);
-                       }
-
-                       private AdjustmentRule (SerializationInfo info, StreamingContext context)
-                       {
-                               if (info == null)
-                                       throw new ArgumentNullException ("info");
-                               dateStart = (DateTime) info.GetValue ("DateStart", typeof (DateTime));
-                               dateEnd = (DateTime) info.GetValue ("DateEnd", typeof (DateTime));
-                               daylightDelta = (TimeSpan) info.GetValue ("DaylightDelta", typeof (TimeSpan));
-                               daylightTransitionStart = (TimeZoneInfo.TransitionTime) info.GetValue ("DaylightTransitionStart", typeof (TimeZoneInfo.TransitionTime));
-                               daylightTransitionEnd = (TimeZoneInfo.TransitionTime) info.GetValue ("DaylightTransitionEnd", typeof (TimeZoneInfo.TransitionTime));
-                       }
-                       
-                       private AdjustmentRule (
-                               DateTime dateStart,
-                               DateTime dateEnd,
-                               TimeSpan daylightDelta,
-                               TransitionTime daylightTransitionStart,
-                               TransitionTime daylightTransitionEnd)
-                       {
-                               if (dateStart.Kind != DateTimeKind.Unspecified || dateEnd.Kind != DateTimeKind.Unspecified)
-                                       throw new ArgumentException ("the Kind property of dateStart or dateEnd parameter does not equal DateTimeKind.Unspecified");
-
-                               if (daylightTransitionStart == daylightTransitionEnd)
-                                       throw new ArgumentException ("daylightTransitionStart parameter cannot equal daylightTransitionEnd parameter");
-
-                               if (dateStart.Ticks % TimeSpan.TicksPerDay != 0 || dateEnd.Ticks % TimeSpan.TicksPerDay != 0)
-                                       throw new ArgumentException ("dateStart or dateEnd parameter includes a time of day value");
-
-                               if (dateEnd < dateStart)
-                                       throw new ArgumentOutOfRangeException ("dateEnd is earlier than dateStart");
-
-                               if (daylightDelta > new TimeSpan (14, 0, 0) || daylightDelta < new TimeSpan (-14, 0, 0))
-                                       throw new ArgumentOutOfRangeException ("daylightDelta is less than -14 or greater than 14 hours");
-
-                               if (daylightDelta.Ticks % TimeSpan.TicksPerSecond != 0)
-                                       throw new ArgumentOutOfRangeException ("daylightDelta parameter does not represent a whole number of seconds");
-
-                               this.dateStart = dateStart;
-                               this.dateEnd = dateEnd;
-                               this.daylightDelta = daylightDelta;
-                               this.daylightTransitionStart = daylightTransitionStart;
-                               this.daylightTransitionEnd = daylightTransitionEnd;
-                       }
-
-                       public bool Equals (TimeZoneInfo.AdjustmentRule other)
-                       {
-                               return dateStart == other.dateStart &&
-                                       dateEnd == other.dateEnd &&
-                                       daylightDelta == other.daylightDelta && 
-                                       daylightTransitionStart == other.daylightTransitionStart &&
-                                       daylightTransitionEnd == other.daylightTransitionEnd;
-                       }
-
-                       public override int GetHashCode ()
-                       {
-                               return dateStart.GetHashCode () ^ 
-                                       dateEnd.GetHashCode () ^
-                                       daylightDelta.GetHashCode () ^
-                                       daylightTransitionStart.GetHashCode () ^
-                                       daylightTransitionEnd.GetHashCode ();
-                       }
-                                       
-                       void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)
-                       {
-                               if (info == null)
-                                       throw new ArgumentNullException ("info");
-                               info.AddValue ("DateStart", DateStart);
-                               info.AddValue ("DateEnd", DateEnd);
-                               info.AddValue ("DaylightDelta", DaylightDelta);
-                               info.AddValue ("DaylightTransitionStart", DaylightTransitionStart);
-                               info.AddValue ("DaylightTransitionEnd", DaylightTransitionEnd);
-                       }
-                       void IDeserializationCallback.OnDeserialization (object sender)
-                       {
-                               try {
-                                       TimeZoneInfo.AdjustmentRule.Validate (dateStart, dateEnd, daylightDelta, 
-                                                                             daylightTransitionStart, daylightTransitionEnd);
-                               } catch (ArgumentException ex) {
-                                       throw new SerializationException ("invalid serialization data", ex);
-                               }
-                       }
-
-                       private static void Validate (
-                               DateTime dateStart,
-                               DateTime dateEnd,
-                               TimeSpan daylightDelta,
-                               TransitionTime daylightTransitionStart,
-                               TransitionTime daylightTransitionEnd)
-                       {
-                               if (dateStart.Kind != DateTimeKind.Unspecified || dateEnd.Kind != DateTimeKind.Unspecified)
-                                       throw new ArgumentException ("the Kind property of dateStart or dateEnd parameter does not equal DateTimeKind.Unspecified");
-
-                               if (daylightTransitionStart == daylightTransitionEnd)
-                                       throw new ArgumentException ("daylightTransitionStart parameter cannot equal daylightTransitionEnd parameter");
-
-                               if (dateStart.Ticks % TimeSpan.TicksPerDay != 0 || dateEnd.Ticks % TimeSpan.TicksPerDay != 0)
-                                       throw new ArgumentException ("dateStart or dateEnd parameter includes a time of day value");
-
-                               if (dateEnd < dateStart)
-                                       throw new ArgumentOutOfRangeException ("dateEnd is earlier than dateStart");
-
-                               if (daylightDelta > new TimeSpan (14, 0, 0) || daylightDelta < new TimeSpan (-14, 0, 0))
-                                       throw new ArgumentOutOfRangeException ("daylightDelta is less than -14 or greater than 14 hours");
-
-                               if (daylightDelta.Ticks % TimeSpan.TicksPerSecond != 0)
-                                       throw new ArgumentOutOfRangeException ("daylightDelta parameter does not represent a whole number of seconds");
-                       }
-               }
-       }
-}
diff --git a/mcs/class/corlib/System/TimeZoneInfo.TransitionTime.cs b/mcs/class/corlib/System/TimeZoneInfo.TransitionTime.cs
deleted file mode 100644 (file)
index 37a7064..0000000
+++ /dev/null
@@ -1,290 +0,0 @@
-/*
- * System.TimeZoneInfo.TransitionTime
- *
- * Author(s)
- *     Stephane Delcroix <stephane@delcroix.org>
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- * 
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-using System.Runtime.CompilerServices;
-using System.Runtime.Serialization;
-
-namespace System
-{
-       public
-       sealed partial class TimeZoneInfo
-       {
-               [SerializableAttribute]
-#if MOBILE
-       [TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#else
-       [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
-#endif
-               public struct TransitionTime : IEquatable<TimeZoneInfo.TransitionTime>, ISerializable, IDeserializationCallback
-               {
-                       DateTime timeOfDay;
-                       public DateTime TimeOfDay {
-                               get { return timeOfDay; }
-                       }
-
-                       int month;
-                       public int Month {
-                               get { return month; }
-                       }
-
-                       int day;
-                       public int Day {
-                               get { 
-#if STRICT
-                                       if (!isFixedDateRule)
-                                               throw new Exception ("Day property is not valid for floating date rules");
-#endif
-                                       return day; 
-                               }
-                       }
-
-                       int week;
-                       public int Week {
-                               get { 
-#if STRICT
-                                       if (isFixedDateRule)
-                                               throw new Exception ("Week property is not valid for fixed date rules");
-#endif
-               
-                                       return week; 
-                               }
-                       }
-
-                       DayOfWeek dayOfWeek;
-                       public DayOfWeek DayOfWeek {
-                               get { 
-#if STRICT
-                                       if (isFixedDateRule)
-                                               throw new Exception ("DayOfWeek property is not valid for fixed date rules");
-#endif
-       
-                                       return dayOfWeek; 
-                               }
-                       }
-
-                       bool isFixedDateRule;
-                       public bool IsFixedDateRule {
-                               get { return isFixedDateRule; }
-                       }
-
-                       public static TransitionTime CreateFixedDateRule (
-                               DateTime timeOfDay, 
-                               int month, 
-                               int day)
-                       {
-                               return new TransitionTime (timeOfDay, month, day);
-                       }
-
-                       public static TransitionTime CreateFloatingDateRule (
-                               DateTime timeOfDay,
-                               int month,
-                               int week,
-                               DayOfWeek dayOfWeek)
-                       {
-                               return new TransitionTime (timeOfDay, month, week, dayOfWeek);
-                       }
-
-                       private TransitionTime (SerializationInfo info, StreamingContext context)
-                       {
-                               if (info == null)
-                                       throw new ArgumentNullException ("info");
-                               timeOfDay = (DateTime) info.GetValue ("TimeOfDay", typeof (DateTime));
-                               month = (byte) info.GetValue ("Month", typeof (byte));
-                               week = (byte) info.GetValue ("Week", typeof (byte));
-                               day = (byte) info.GetValue ("Day", typeof (byte));
-                               dayOfWeek = (DayOfWeek) info.GetValue ("DayOfWeek", typeof (DayOfWeek));
-                               isFixedDateRule = (bool) info.GetValue ("IsFixedDateRule", typeof (bool));
-
-                               if (isFixedDateRule)
-                               {
-                                       week = -1;
-                                       dayOfWeek = (DayOfWeek) (-1);
-                               }
-                               if (!isFixedDateRule)                   
-                                       day = -1;
-                       }
-
-                       private TransitionTime (
-                               DateTime timeOfDay,
-                               int month,
-                               int day) : this (timeOfDay, month)
-                       {
-                               if (day < 1 || day > 31)
-                                       throw new ArgumentOutOfRangeException ("day parameter is less than 1 or greater than 31");
-
-                               this.day = day; 
-                               this.isFixedDateRule = true;
-                       }
-
-                       private TransitionTime (
-                               DateTime timeOfDay,
-                               int month,
-                               int week,
-                               DayOfWeek dayOfWeek)  : this (timeOfDay, month)
-                       {
-                               if (week < 1 || week > 5)
-                                       throw new ArgumentOutOfRangeException ("week parameter is less than 1 or greater than 5");
-
-                               if (dayOfWeek != DayOfWeek.Sunday &&
-                                               dayOfWeek != DayOfWeek.Monday &&
-                                               dayOfWeek != DayOfWeek.Tuesday &&
-                                               dayOfWeek != DayOfWeek.Wednesday &&
-                                               dayOfWeek != DayOfWeek.Thursday &&
-                                               dayOfWeek != DayOfWeek.Friday &&
-                                               dayOfWeek != DayOfWeek.Saturday)
-                                       throw new ArgumentOutOfRangeException ("dayOfWeek parameter is not a member od DayOfWeek enumeration");
-
-                               this.week = week;
-                               this.dayOfWeek = dayOfWeek;
-                               this.isFixedDateRule = false;
-                       }
-
-                       private TransitionTime (
-                               DateTime timeOfDay,
-                               int month)
-                       {
-                               if (timeOfDay.Year != 1 || timeOfDay.Month != 1 || timeOfDay.Day != 1)
-                                       throw new ArgumentException ("timeOfDay parameter has a non-default date component");
-
-                               if (timeOfDay.Kind != DateTimeKind.Unspecified)
-                                       throw new ArgumentException ("timeOfDay parameter Kind's property is not DateTimeKind.Unspecified");
-
-                               if (timeOfDay.Ticks % TimeSpan.TicksPerMillisecond != 0)
-                                       throw new ArgumentException ("timeOfDay parameter does not represent a whole number of milliseconds");
-
-                               if (month < 1 || month > 12)
-                                       throw new ArgumentOutOfRangeException ("month parameter is less than 1 or greater than 12");
-                               
-                               this.timeOfDay = timeOfDay;
-                               this.month = month;
-
-                               this.week = -1;
-                               this.dayOfWeek = (System.DayOfWeek)(-1);
-                               this.day = -1;
-                               this.isFixedDateRule = false;
-                       }
-
-                       public static bool operator == (TransitionTime t1, TransitionTime t2)
-                       {
-                               return ( t1.day == t2.day &&
-                                               t1.dayOfWeek == t2.dayOfWeek &&
-                                               t1.isFixedDateRule == t2.isFixedDateRule &&
-                                               t1.month == t2.month &&
-                                               t1.timeOfDay == t2.timeOfDay &&
-                                               t1.week == t2.week);    
-                       }
-
-                       public static bool operator != (TransitionTime t1, TransitionTime t2)
-                       {
-                               return !(t1 == t2);
-                       }
-
-
-                       void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)
-                       {
-                               if (info == null)
-                                       throw new ArgumentNullException ("info");
-                               info.AddValue ("TimeOfDay", TimeOfDay);
-                               info.AddValue ("Month", System.Convert.ToByte(Month));
-                               if (week > -1)
-                                       info.AddValue ("Week", System.Convert.ToByte(week));
-                               else 
-                                       info.AddValue ("Week", (byte) 1);
-                               if (day > -1)
-                                       info.AddValue ("Day", System.Convert.ToByte(day));
-                               else
-                                       info.AddValue ("Day", (byte) 1);
-                               if (dayOfWeek !=  ((System.DayOfWeek) (-1)))
-                                       info.AddValue ("DayOfWeek", dayOfWeek);
-                               else
-                                       info.AddValue ("DayOfWeek", DayOfWeek.Sunday);
-                               info.AddValue ("IsFixedDateRule", IsFixedDateRule);
-                       }       
-       
-                       public override bool Equals (object obj)
-                       {
-                               if (obj is TransitionTime)
-                                       return this == (TransitionTime) obj;
-                               return false;
-                       }
-
-                       public bool Equals (TimeZoneInfo.TransitionTime other)
-                       {
-                               return this == other;
-                       }
-
-                       public override int GetHashCode ()
-                       {
-                               return (day ^ (int)dayOfWeek ^ month ^ (int)timeOfDay.Ticks ^ week);
-                       }
-
-                       void IDeserializationCallback.OnDeserialization (object sender)
-                       {
-                               try {
-                                       TimeZoneInfo.TransitionTime.Validate (timeOfDay, month, week, day, dayOfWeek, isFixedDateRule);
-                               } catch (ArgumentException ex) {
-                                       throw new SerializationException ("invalid serialization data", ex);
-                               }
-                       }
-
-                       private static void Validate (DateTime timeOfDay, int month,int week, int day, DayOfWeek dayOfWeek, bool isFixedDateRule)
-                       {
-                               if (timeOfDay.Year != 1 || timeOfDay.Month != 1 || timeOfDay.Day != 1)
-                                       throw new ArgumentException ("timeOfDay parameter has a non-default date component");
-
-                               if (timeOfDay.Kind != DateTimeKind.Unspecified)
-                                       throw new ArgumentException ("timeOfDay parameter Kind's property is not DateTimeKind.Unspecified");
-
-                               if (timeOfDay.Ticks % TimeSpan.TicksPerMillisecond != 0)
-                                       throw new ArgumentException ("timeOfDay parameter does not represent a whole number of milliseconds");
-
-                               if (day < 1 || day > 31) {
-                                       if (!(!isFixedDateRule && day == -1))
-                                               throw new ArgumentOutOfRangeException ("day parameter is less than 1 or greater than 31");
-                               }
-
-                               if (week < 1 || week > 5) {
-                                       if (!(isFixedDateRule && week == -1))
-                                               throw new ArgumentOutOfRangeException ("week parameter is less than 1 or greater than 5");
-                               }
-
-                               if (month < 1 || month > 12)
-                                       throw new ArgumentOutOfRangeException ("month parameter is less than 1 or greater than 12");
-
-                               if (dayOfWeek != DayOfWeek.Sunday &&
-                                               dayOfWeek != DayOfWeek.Monday &&
-                                               dayOfWeek != DayOfWeek.Tuesday &&
-                                               dayOfWeek != DayOfWeek.Wednesday &&
-                                               dayOfWeek != DayOfWeek.Thursday &&
-                                               dayOfWeek != DayOfWeek.Friday &&
-                                               dayOfWeek != DayOfWeek.Saturday) {
-                                       if (!(isFixedDateRule && dayOfWeek == (DayOfWeek) (-1)))
-                                               throw new ArgumentOutOfRangeException ("dayOfWeek parameter is not a member od DayOfWeek enumeration");
-                               }
-                       }
-               }
-       }
-}
index 3c0b535b43b0575a82dc606a44501ce8b9ffb74d..aa93584c933c92e8461a9929723304005038acf9 100644 (file)
@@ -45,14 +45,7 @@ using Microsoft.Win32;
 
 namespace System
 {
-#if MOBILE
-       [TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#else
-       [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
-#endif
-       [SerializableAttribute]
-       public
-       sealed partial class TimeZoneInfo : IEquatable<TimeZoneInfo>, ISerializable, IDeserializationCallback
+       partial class TimeZoneInfo
        {
                TimeSpan baseUtcOffset;
                public TimeSpan BaseUtcOffset {
diff --git a/mcs/class/corlib/System/TimeZoneNotFoundException.cs b/mcs/class/corlib/System/TimeZoneNotFoundException.cs
deleted file mode 100644 (file)
index 1333d97..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * System.TimeZoneNotFoundException
- *
- * Author(s)
- *     Stephane Delcroix <stephane@delcroix.org>
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- * 
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-using System.Runtime.CompilerServices;
-
-namespace System
-{
-       [Serializable]
-#if MOBILE
-       [TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#else
-       [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
-#endif
-       public
-       class TimeZoneNotFoundException : Exception
-       {
-               public TimeZoneNotFoundException () : base ()
-               {}
-
-               public TimeZoneNotFoundException (string message) : base (message)
-               {}
-
-               public TimeZoneNotFoundException (string message, Exception innerException) : base (message, innerException)
-               {}
-
-               protected TimeZoneNotFoundException (Runtime.Serialization.SerializationInfo info, Runtime.Serialization.StreamingContext context) : base (info, context)
-               {}
-       }
-}
diff --git a/mcs/class/corlib/System/TypeLoadException.cs b/mcs/class/corlib/System/TypeLoadException.cs
deleted file mode 100644 (file)
index f963ae1..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-//
-// System.TypeLoadException.cs
-//
-// Authors:
-//   Sean MacIsaac (macisaac@ximian.com)
-//   Duncan Mak  (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc.  http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
-       [Serializable]
-       [ComVisible (true)]
-       [StructLayout (LayoutKind.Sequential)]
-       public class TypeLoadException : SystemException
-       {
-               const int Result = unchecked ((int)0x80131522);
-               
-               // Fields
-               private string className, assemblyName;
-
-               // Constructors
-               public TypeLoadException ()
-                       : base (Locale.GetText ("A type load exception has occurred."))
-               {
-                       HResult = Result;
-               }
-
-               public TypeLoadException (string message)
-                       : base (message)
-               {
-                       HResult = Result;
-               }
-
-               public TypeLoadException (string message, Exception inner)
-                       : base (message, inner)
-               {
-                       HResult = Result;
-               }
-
-               internal TypeLoadException (string className, string assemblyName) : this ()
-               {
-                       this.className = className;
-                       this.assemblyName = assemblyName;
-               }
-
-               protected TypeLoadException (SerializationInfo info, StreamingContext context)
-                       : base (info, context)
-               {
-                       if (info == null)
-                               throw new ArgumentNullException ("info");
-
-                       className = info.GetString ("TypeLoadClassName");
-                       assemblyName = info.GetString ("TypeLoadAssemblyName");
-               }
-
-               // Properties
-               public override string Message {
-                       get {
-                               if (className != null) {
-                                       if ((assemblyName != null) && (assemblyName != String.Empty))
-                                               return String.Format ("Could not load type '{0}' from assembly '{1}'.", className, assemblyName);
-                                       else
-                                               return String.Format ("Could not load type '{0}'.", className);
-                               }
-                               else
-                                       return base.Message;
-                       }
-               }
-
-               public string TypeName {
-                       get { 
-                               if (className == null)
-                                       return String.Empty;
-                               else
-                                       return className;
-                       }
-               }
-
-               // Methods
-               public override void GetObjectData (SerializationInfo info, StreamingContext context)
-               {
-                       if (info == null)
-                               throw new ArgumentNullException ("info");
-
-                       base.GetObjectData (info, context);
-                       info.AddValue ("TypeLoadClassName", className, typeof (string)); 
-                       info.AddValue ("TypeLoadAssemblyName", assemblyName, typeof (string)); 
-                       info.AddValue ("TypeLoadMessageArg", "", typeof (string)); 
-                       info.AddValue ("TypeLoadResourceID", 0, typeof (int)); 
-               }
-       }
-}
index 8ac242b346e64ac4cfc6b37d96b88765f6c9470a..e2b4380be7e54598cd3f30d5ec1b7fae35f732df 100644 (file)
@@ -168,7 +168,7 @@ namespace System
                                vt = (short)VarEnum.VT_BSTR;
                                bstrVal = Marshal.StringToBSTR(((BStrWrapper)obj).WrappedObject);
                        }
-#if !FULL_AOT_RUNTIME
+#if FEATURE_COMINTEROP
                        else if (t == typeof (UnknownWrapper))
                        {
                                vt = (short)VarEnum.VT_UNKNOWN;
@@ -182,7 +182,7 @@ namespace System
 #endif
                        else
                        {
-#if FULL_AOT_RUNTIME
+#if !FEATURE_COMINTEROP
                                throw new NotImplementedException(string.Format("Variant couldn't handle object of type {0}", obj.GetType()));
 #else
                                try 
@@ -301,7 +301,7 @@ namespace System
                        case VarEnum.VT_BSTR:
                                obj = Marshal.PtrToStringBSTR(bstrVal);
                                break;
-#if !FULL_AOT_RUNTIME
+#if FEATURE_COMINTEROP
                        case VarEnum.VT_UNKNOWN:
                        case VarEnum.VT_DISPATCH:
                                if (pdispVal != IntPtr.Zero)
@@ -324,10 +324,12 @@ namespace System
                        if ((VarEnum)vt == VarEnum.VT_BSTR) {
                                Marshal.FreeBSTR (bstrVal);
                        }
+#if !DISABLE_COM
                        else if ((VarEnum)vt == VarEnum.VT_DISPATCH || (VarEnum)vt == VarEnum.VT_UNKNOWN) {
                                if (pdispVal != IntPtr.Zero)
                                        Marshal.Release (pdispVal);
                        }
+#endif
                }
        }
 
index a361fbc50f8ff913da46beffb9d8fdb30541f765..129ee6d0bcc4693cafca827dad552fc5a012101c 100644 (file)
@@ -633,6 +633,60 @@ namespace MonoTests.System.Collections.Generic {
                        }
                }
 
+#if !MONO
+               [Test]
+               public void SerializationCompatibilty ()
+               {
+                       /* Serialization output from .net 
+
+                       var dict = new Dictionary<string, string> ();
+                       dict.Add ("key", "value");
+
+                       var dictSerializedStream = new MemoryStream ();
+                       fmt.Serialize (dictSerializedStream, dict);
+
+                       dictSerializedStream.Seek (0, SeekOrigin.Begin);
+                       var res = Convert.ToBase64String (dictSerializedStream.ToArray (), Base64FormattingOptions.InsertLineBreaks);
+
+                       */
+
+                       var x = "AAEAAAD/////AQAAAAAAAAAEAQAAAOIBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuRGljdGlv" +
+                               "bmFyeWAyW1tTeXN0ZW0uU3RyaW5nLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJl" +
+                               "PW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldLFtTeXN0ZW0uU3RyaW5n" +
+                               "LCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRv" +
+                               "a2VuPWI3N2E1YzU2MTkzNGUwODldXQQAAAAHVmVyc2lvbghDb21wYXJlcghIYXNoU2l6ZQ1LZXlW" +
+                               "YWx1ZVBhaXJzAAMAAwiSAVN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkdlbmVyaWNFcXVhbGl0" +
+                               "eUNvbXBhcmVyYDFbW1N5c3RlbS5TdHJpbmcsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1" +
+                               "bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dCOYBU3lzdGVt" +
+                               "LkNvbGxlY3Rpb25zLkdlbmVyaWMuS2V5VmFsdWVQYWlyYDJbW1N5c3RlbS5TdHJpbmcsIG1zY29y" +
+                               "bGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3" +
+                               "YTVjNTYxOTM0ZTA4OV0sW1N5c3RlbS5TdHJpbmcsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAs" +
+                               "IEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dW10BAAAA" + 
+                               "CQIAAAADAAAACQMAAAAEAgAAAJIBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuR2VuZXJpY0Vx" +
+                               "dWFsaXR5Q29tcGFyZXJgMVtbU3lzdGVtLlN0cmluZywgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAu" + 
+                               "MCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0AAAAA" + 
+                               "BwMAAAAAAQAAAAEAAAAD5AFTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYy5LZXlWYWx1ZVBhaXJg" + 
+                               "MltbU3lzdGVtLlN0cmluZywgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0" + 
+                               "cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XSxbU3lzdGVtLlN0cmluZywgbXNj" + 
+                               "b3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1i" + 
+                               "NzdhNWM1NjE5MzRlMDg5XV0E/P///+QBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuS2V5VmFs" + 
+                               "dWVQYWlyYDJbW1N5c3RlbS5TdHJpbmcsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1" + 
+                               "cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV0sW1N5c3RlbS5TdHJp" + 
+                               "bmcsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5" + 
+                               "VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAgAAAANrZXkFdmFsdWUBAQYFAAAAA2tleQYGAAAABXZh" + 
+                               "bHVlCw==";
+
+                       var dict = new Dictionary<string, string> ();
+                       dict.Add ("key", "value");
+               
+                       BinaryFormatter fmt = new BinaryFormatter ();
+                       var mdict = (Dictionary<string, string>) fmt.Deserialize (new MemoryStream (Convert.FromBase64String (x)));
+
+                       Assert.AreEqual (1, dict.Count);
+                       Assert.AreEqual (dict.Comparer.GetType (), mdict.Comparer.GetType ());
+               }
+#endif
+
                [Test]
                public void ZeroCapacity ()
                {
index 5a0fd3b6a253da373385e2652435f3db626a6e8a..e238781bcb73f4cce4f887eb2c9bc9ef37bda514 100644 (file)
@@ -37,6 +37,11 @@ namespace MonoTests.System.Collections.Generic {
 
        [TestFixture]
        public class EqualityComparerTest {
+               enum E
+               {
+                       A,
+                       B
+               }
 
                [Test]
                public void Default_GetHashCode_Null ()
@@ -59,6 +64,13 @@ namespace MonoTests.System.Collections.Generic {
                        IEqualityComparer comparer = EqualityComparer<object>.Default;
                        Assert.IsTrue (comparer.Equals (null, null));
                }
+
+               [Test]
+               public void EnumComparison ()
+               {
+                       Assert.IsFalse (EqualityComparer<E>.Default.Equals (E.A, E.B));
+                       Assert.IsFalse (EqualityComparer<object>.Default.Equals (E.A, E.B));
+               }
        }
 }
 
index 3b7438453719cdaa66c66564ec60c24fcc90a6e2..48a8e76b63d2e9f318fa91ed934f417b125a3c75 100644 (file)
@@ -225,6 +225,15 @@ namespace MonoTests.System.Globalization
                        Assert.Fail ("InvariantCulture not found in the array from GetCultures()");
                }
 
+               [Test]
+               public void GetAllCultures_Specific ()
+               {
+                       CultureInfo [] infos = CultureInfo.GetCultures (CultureTypes.SpecificCultures);
+                       foreach (CultureInfo ci in infos) {
+                               Assert.IsNotNull (ci.DateTimeFormat);
+                       }
+               }
+
                [Test]
 #if !NET_4_0
                [ExpectedException (typeof (NotSupportedException))]
index 499c6b840962a7bcd4cc843079baad5580cae9c4..b7227d972c3c0f20fa68c9f187f3403720fa144a 100644 (file)
@@ -42,6 +42,7 @@ using System.Threading;
 using System.Runtime.Serialization;
 using System.Security;
 using System.Linq;
+using System.Resources;
 
 namespace MonoTests.System.Reflection
 {
@@ -464,6 +465,63 @@ namespace MonoTests.System.Reflection
                        }
                }
 
+               [Test]
+               public void SateliteAssemblyForInMemoryAssembly ()
+               {
+                       string assemblyFileName = Path.Combine (
+                               Path.GetTempPath (), "AssemblyLocation1.dll");
+
+                       try {
+                               AssemblyName assemblyName = new AssemblyName ();
+                               assemblyName.Name = "AssemblyLocation1";
+
+                               AssemblyBuilder ab = AppDomain.CurrentDomain
+                                       .DefineDynamicAssembly (assemblyName,
+                                               AssemblyBuilderAccess.Save,
+                                               Path.GetTempPath ());
+
+                               ModuleBuilder moduleBuilder = ab.DefineDynamicModule (assemblyName.Name, assemblyName.Name + ".dll");
+                               TypeBuilder typeBuilder = moduleBuilder.DefineType ("Program", TypeAttributes.Public);
+
+                               MethodBuilder methodBuilder = typeBuilder.DefineMethod ("TestCall", MethodAttributes.Public | MethodAttributes.Static, typeof(void), Type.EmptyTypes);
+                               ILGenerator gen = methodBuilder.GetILGenerator ();
+
+                               //
+                               //      var resourceManager = new ResourceManager (typeof (Program));
+                               //      resourceManager.GetString ("test");
+                               //
+                               gen.Emit (OpCodes.Ldtoken, typeBuilder);
+                               gen.Emit (OpCodes.Call, typeof(Type).GetMethod ("GetTypeFromHandle"));
+                               gen.Emit (OpCodes.Newobj, typeof(ResourceManager).GetConstructor (new Type[] { typeof(Type) }));
+                               gen.Emit (OpCodes.Ldstr, "test");
+                               gen.Emit (OpCodes.Callvirt, typeof(ResourceManager).GetMethod ("GetString", new Type[] { typeof(string) }));
+                               gen.Emit (OpCodes.Pop);
+                               gen.Emit (OpCodes.Ret);
+
+                               typeBuilder.CreateType ();
+
+                               ab.Save (Path.GetFileName (assemblyFileName));
+
+                               using (FileStream fs = File.OpenRead (assemblyFileName)) {
+                                       byte[] buffer = new byte[fs.Length];
+                                       fs.Read (buffer, 0, buffer.Length);
+                                       Assembly assembly = Assembly.Load (buffer);
+
+                                       var mm = assembly.GetType ("Program").GetMethod ("TestCall");
+                                       try {
+                                               mm.Invoke (null, null);
+                                               Assert.Fail ();
+                                       } catch (TargetInvocationException e) {
+                                               Assert.IsTrue (e.InnerException is MissingManifestResourceException);
+                                       }
+
+                                       fs.Close ();
+                               }
+                       } finally {
+                               File.Delete (assemblyFileName);
+                       }
+               }
+
                [Test]
                [Category ("NotWorking")]
                public void bug78464 ()
index a6ad35550cc7155c8d40d5afb482261514e85a27..852282a8a1f39753c390f64d61187819370f2969 100644 (file)
@@ -58,13 +58,13 @@ namespace MonoTests.System.Reflection
 
                [MarshalAs(UnmanagedType.ByValTStr, SizeConst=100)]
                public string f2;
-
+#if FEATURE_COMINTEROP
                [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof (Marshal1), MarshalCookie="5")]
                public int f3;
 
                [MarshalAs (UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof (Marshal1), MarshalCookie = "5")]
                public object f4;
-
+#endif
                [Obsolete]
                public int f5;
        }
@@ -350,21 +350,27 @@ namespace MonoTests.System.Reflection
                        attrs = typeof (Class2).GetField ("f3").GetCustomAttributes (true);
                        Assert.AreEqual (1, attrs.Length, "#F1");
                        attr = (MarshalAsAttribute) attrs [0];
+#if FEATURE_COMINTEROP
                        Assert.AreEqual (UnmanagedType.CustomMarshaler, attr.Value, "#F2");
+#endif
                        Assert.AreEqual ("5", attr.MarshalCookie, "#F3");
                        Assert.AreEqual (typeof (Marshal1), Type.GetType (attr.MarshalType), "#F4");
 
                        attrs = typeof (Class3).GetField ("f3").GetCustomAttributes (false);
                        Assert.AreEqual (1, attrs.Length, "#G1");
                        attr = (MarshalAsAttribute) attrs [0];
+#if FEATURE_COMINTEROP
                        Assert.AreEqual (UnmanagedType.CustomMarshaler, attr.Value, "#G2");
+#endif
                        Assert.AreEqual ("5", attr.MarshalCookie, "#G3");
                        Assert.AreEqual (typeof (Marshal1), Type.GetType (attr.MarshalType), "#G4");
 
                        attrs = typeof (Class3).GetField ("f3").GetCustomAttributes (true);
                        Assert.AreEqual (1, attrs.Length, "#H1");
                        attr = (MarshalAsAttribute) attrs [0];
+#if FEATURE_COMINTEROP
                        Assert.AreEqual (UnmanagedType.CustomMarshaler, attr.Value, "#H2");
+#endif
                        Assert.AreEqual ("5", attr.MarshalCookie, "#H3");
                        Assert.AreEqual (typeof (Marshal1), Type.GetType (attr.MarshalType), "#H4");
 
@@ -372,7 +378,9 @@ namespace MonoTests.System.Reflection
                        attrs = typeof (Class2).GetField ("f3").GetCustomAttributes (true);
                        Assert.AreEqual (1, attrs.Length, "#I1");
                        attr = (MarshalAsAttribute) attrs [0];
+#if FEATURE_COMINTEROP
                        Assert.AreEqual (UnmanagedType.CustomMarshaler, attr.Value, "#I2");
+#endif
                        Assert.AreEqual ("5", attr.MarshalCookie, "#I3");
                        Assert.AreEqual (typeof (Marshal1), Type.GetType (attr.MarshalType), "#I4");
                }
index 3be96507bf4bf421fcaea062f5461051a09f5177..fb7d0e57f7c3d3a3801b30f20fe4df8787cf1ada 100644 (file)
@@ -26,8 +26,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_4_5
-
 using System;
 using NUnit.Framework;
 using System.Runtime.ExceptionServices;
@@ -91,10 +89,40 @@ namespace MonoTests.System.Runtime.ExceptionServices
                                Assert.Fail ("#0");
                        } catch (OperationCanceledException e) {
                                Assert.IsFalse (e.StackTrace.Contains ("---"));
+                               Assert.AreEqual (2, e.StackTrace.Split (new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries).Length);
                        }
                }
 
+               [Test]
+               public void LastThrowWins ()
+               {
+                       Exception e;
+                       try {
+                               throw new Exception ("test");
+                       } catch (Exception e2) {
+                               e = e2;
+                       }
+
+                       var edi = ExceptionDispatchInfo.Capture (e);
+
+                       try {
+                               edi.Throw ();
+                       } catch {
+                       }
+
+                       try {
+                               edi.Throw ();
+                       } catch (Exception ex) {
+                       }
+
+                       try {
+                               edi.Throw ();
+                       } catch (Exception ex) {
+                               var split = ex.StackTrace.Split (new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
+                               Assert.AreEqual (4, split.Length, "#1");
+                               Assert.IsTrue (split [1].Contains ("---"), "#2");
+                       }
+               }
        }
 }
 
-#endif
\ No newline at end of file
index 48e686ab8ddf840fa0d270485df8d622ae447611..e15cb30a839f080416f2678485a48cebfea7784b 100644 (file)
@@ -28,8 +28,8 @@ namespace MonoTests.System.Runtime.Serialization
                MemoryStream ms;
                string uri;
 
+#if FEATURE_REMOTING
                [Test]
-               [Category ("MobileNotWorking")]
                public void TestSerialization ()
                {
                        MethodTester mt = new MethodTester();
@@ -41,6 +41,7 @@ namespace MonoTests.System.Runtime.Serialization
 
                        RemotingServices.Disconnect (mt);
                }
+#endif
 
 #if !MONOTOUCH
                [Test]
@@ -77,6 +78,7 @@ namespace MonoTests.System.Runtime.Serialization
                        return 2;
                }
 
+#if FEATURE_REMOTING
                void WriteData ()
                {
                        StreamingContext context = new StreamingContext (StreamingContextStates.Other);
@@ -148,7 +150,7 @@ namespace MonoTests.System.Runtime.Serialization
                        CheckMessages ("MethodCall", originalMsgData, ProcessMessages (null, calls));
                        CheckMessages ("MethodResponse", originalMsgData, ProcessMessages (null, resps));
                }
-
+#endif
                BinderTester_A CreateBinderTestData ()
                {
                        BinderTester_A bta = new BinderTester_A();
index 160b9b98df29899dc9d770d6ade3b7142c759963..75ebb2abc1ce48888f920843772b9fa107d1b7af 100644 (file)
@@ -828,6 +828,22 @@ namespace MonoTests.System
                        Assert.IsFalse (Attribute.IsDefined (typeof (AttributeTest), typeof(SerializableAttribute), true), "#2");
                }
 
+               [YourCustomAttribute (0)]
+               [Serializable]
+               [MyCustomAttribute ("")]
+               class ClassForOrderIsImportant
+               {
+               }
+
+               [Test]
+               public void OrderIsImportant ()
+               {
+                       var custom = typeof (ClassForOrderIsImportant).GetCustomAttributes (false);
+                       Assert.IsTrue (custom [0].GetType () == typeof (YourCustomAttribute));
+                       Assert.IsTrue (custom [1].GetType () == typeof (MyCustomAttribute));
+                       Assert.IsTrue (custom [2].GetType () == typeof (SerializableAttribute));
+               }
+
 #if !MONOTOUCH
                [Test]
                public void GetCustomAttributeOnNewSreTypes ()
index c97a0a31b7e8efef77818a2016c941aecbb73fcb..f9dc5929d3107412fcd6141a8da70093abad780d 100644 (file)
@@ -4711,6 +4711,86 @@ namespace MonoTests.System {
                        Convert.ToUInt64 ("-", 16);
                }
 
+               [Test]
+               public void ToInt64_Base10_MaxValue ()
+               {
+                       Assert.AreEqual (Int64.MaxValue, Convert.ToInt64 (Int64.MaxValue.ToString(), 10));
+               }
+
+               [Test]
+               [ExpectedException (typeof (OverflowException))]
+               public void ToInt64_Base10_MaxValueOverflow ()
+               {
+                       var overflowValue = ((UInt64) Int64.MaxValue) + 1;
+                       Convert.ToInt64 (overflowValue.ToString (), 10);
+               }
+
+               [Test]
+               public void ToInt64_Base10_MinValue ()
+               {
+                       Assert.AreEqual (Int64.MinValue, Convert.ToInt64 (Int64.MinValue.ToString(), 10));
+               }
+
+               [Test]
+               [ExpectedException (typeof (OverflowException))]
+               public void ToInt64_Base10_MinValueOverflow ()
+               {
+                       var overflowValue = ((UInt64) Int64.MaxValue) + 2;
+                       Convert.ToInt64 ("-" + overflowValue.ToString (), 10);
+               }
+
+               [Test]
+               public void ToInt64_Base16_MaxValue ()
+               {
+                       Assert.AreEqual (Int64.MaxValue, Convert.ToInt64 (Int64.MaxValue.ToString("x"), 16));
+               }
+
+               [Test]
+               public void ToInt64_Base16_MaxValueOverflow ()
+               {
+                       var overflowValue = ((UInt64) Int64.MaxValue) + 1;
+                       Assert.AreEqual (-9223372036854775808, Convert.ToInt64 (overflowValue.ToString("x"), 16));
+               }
+
+               [Test]
+               [ExpectedException (typeof (OverflowException))]
+               public void ToInt64_Base16_MaxValueOverflow2 ()
+               {
+                       Convert.ToInt64 (UInt64.MaxValue.ToString ("x") + "0", 16);
+               }
+
+               [Test]
+               public void ToInt64_Base16_MinValue ()
+               {
+                       Assert.AreEqual (Int64.MinValue, Convert.ToInt64 (Int64.MinValue.ToString ("x"), 16));
+               }
+
+               [Test]
+               public void ToUInt64_Base10_MaxValue ()
+               {
+                       Assert.AreEqual (UInt64.MaxValue, Convert.ToUInt64 (UInt64.MaxValue.ToString (), 10));
+               }
+
+               [Test]
+               [ExpectedException (typeof (OverflowException))]
+               public void ToUInt64_Base10_MaxValueOverflow ()
+               {
+                       Convert.ToUInt64 (UInt64.MaxValue.ToString () + "0", 10);
+               }
+
+               [Test]
+               public void ToUInt64_Base16_MaxValue ()
+               {
+                       Assert.AreEqual (UInt64.MaxValue, Convert.ToUInt64 (UInt64.MaxValue.ToString ("x"), 16));
+               }
+
+               [Test]
+               [ExpectedException (typeof (OverflowException))]
+               public void ToUInt64_Base16_MaxValueOverflow ()
+               {
+                       Convert.ToInt64 (UInt64.MaxValue.ToString ("x") + "0", 16);
+               }
+
                [Test] // bug #481687
                public void ChangeType_Value_IConvertible ()
                {
index 940b1290ea323a4c12dc25ef5ff342acb7672a18..62ae67cfc814755576e69e8a862864bc5bc71e36 100644 (file)
@@ -55,16 +55,17 @@ namespace MonoTests.System
                        }
                
                        [Test]
-                       [ExpectedException (typeof (ArgumentOutOfRangeException))]
                        public void EndBeforeStart ()
                        {
-                               if (Environment.OSVersion.Platform != PlatformID.Unix)
-                                       throw new ArgumentOutOfRangeException ();;
                                DateTime dateStart = new DateTime (2007,01,01);
                                DateTime dateEnd = new DateTime (2006,01,01);
                                TimeZoneInfo.TransitionTime daylightTransitionStart = TimeZoneInfo.TransitionTime.CreateFixedDateRule (new DateTime (1,1,1,2,0,0), 03, 11);
                                TimeZoneInfo.TransitionTime daylightTransitionEnd = TimeZoneInfo.TransitionTime.CreateFixedDateRule (new DateTime (1,1,1,2,0,0), 10, 11);
-                               TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (dateStart, dateEnd, new TimeSpan (1,0,0), daylightTransitionStart, daylightTransitionEnd);
+                               try {
+                                       TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (dateStart, dateEnd, new TimeSpan (1,0,0), daylightTransitionStart, daylightTransitionEnd);
+                                       Assert.Fail ();
+                               } catch (ArgumentException) {
+                               }
                        }
                
                        [Test]
@@ -79,7 +80,6 @@ namespace MonoTests.System
                        }
                
                        [Test]
-                       [ExpectedException (typeof (ArgumentOutOfRangeException))]
                        public void DeltaNotInSeconds ()
                        {
                                if (Environment.OSVersion.Platform != PlatformID.Unix)
@@ -88,7 +88,11 @@ namespace MonoTests.System
                                DateTime dateEnd = new DateTime (2008,01,01);
                                TimeZoneInfo.TransitionTime daylightTransitionStart = TimeZoneInfo.TransitionTime.CreateFixedDateRule (new DateTime (1,1,1,2,0,0), 03, 11);
                                TimeZoneInfo.TransitionTime daylightTransitionEnd = TimeZoneInfo.TransitionTime.CreateFixedDateRule (new DateTime (1,1,1,2,0,0), 10, 11);
-                               TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (dateStart, dateEnd, new TimeSpan (55), daylightTransitionStart, daylightTransitionEnd);
+                               try {
+                                       TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (dateStart, dateEnd, new TimeSpan (55), daylightTransitionStart, daylightTransitionEnd);
+                                       Assert.Fail ();
+                               } catch (ArgumentException) {
+                               }
                        }
                }
        
index 079fc0d66883314d199d1a016145dd715de2c239..89e8ad633899a0097eb3db692a048f3838038d58 100644 (file)
@@ -13,13 +13,6 @@ Microsoft.Win32/RegistryView.cs
 Microsoft.Win32/UnixRegistryApi.cs
 Microsoft.Win32/Win32RegistryApi.cs
 Microsoft.Win32/Win32ResultCode.cs
-Microsoft.Win32.SafeHandles/CriticalHandleZeroOrMinusOneIsInvalid.cs
-Microsoft.Win32.SafeHandles/CriticalHandleMinusOneIsInvalid.cs
-Microsoft.Win32.SafeHandles/SafeHandleZeroOrMinusOneIsInvalid.cs
-Microsoft.Win32.SafeHandles/SafeHandleMinusOneIsInvalid.cs
-Microsoft.Win32.SafeHandles/SafeFileHandle.cs
-Microsoft.Win32.SafeHandles/SafeRegistryHandle.cs
-Microsoft.Win32.SafeHandles/SafeWaitHandle.cs
 Mono.Globalization.Unicode/CodePointIndexer.cs
 Mono.Globalization.Unicode/MSCompatUnicodeTable.cs
 Mono.Globalization.Unicode/MSCompatUnicodeTableUtil.cs
@@ -88,31 +81,16 @@ System/AppDomain.cs
 System/AppDomainInitializer.cs
 System/AppDomainManager.cs
 System/AppDomainSetup.cs
-System/ApplicationId.cs
 System/ApplicationIdentity.cs
 System/ArgIterator.cs
 System/Array.cs
 System/AssemblyLoadEventArgs.cs
 System/AssemblyLoadEventHandler.cs
-System/AsyncCallback.cs
-System/AttributeTargets.cs
-System/BadImageFormatException.cs
-System/Buffer.cs
-System/CLSCompliantAttribute.cs
 System/CStreamReader.cs
 System/CStreamWriter.cs
 System/Console.cs
 System/Console.iOS.cs
-System/ConsoleCancelEventArgs.cs
-System/ConsoleCancelEventHandler.cs
-System/ConsoleColor.cs
 System/ConsoleDriver.cs
-System/ConsoleKey.cs
-System/ConsoleKeyInfo.cs
-System/ConsoleModifiers.cs
-System/ConsoleSpecialKey.cs
-System/ContextBoundObject.cs
-System/ContextStaticAttribute.cs
 System/ControlCharacters.cs
 System/CrossAppDomainDelegate.cs
 System/Delegate.cs
@@ -122,36 +100,15 @@ System/Double.cs
 System/EmptyArray.cs
 System/Environment.cs
 System/EnvironmentVariableTarget.cs
-System/EventArgs.cs
-System/EventHandler.cs
 System/Exception.cs
-System/FlagsAttribute.cs
-System/Funcs.cs
 System/GC.cs
 System/GCCollectionMode.cs
 System/GCNotificationStatus.cs
 System/Guid.cs
 System/Guid.MonoTouch.cs
-System/IAppDomainSetup.cs
-System/IAsyncResult.cs
-System/IObservable.cs
-System/IObserver.cs
-System/ICloneable.cs
-System/IComparable.cs
-System/IEquatable.cs
 System/IConsoleDriver.cs
-System/IConvertible.cs
-System/ICustomFormatter.cs
-System/IDisposable.cs
-System/IFormatProvider.cs
-System/IFormattable.cs
 System/IntPtr.cs
-System/InvalidTimeZoneException.cs
-System/IProgress.cs
-System/IServiceProvider.cs
 System/KnownTerminals.cs
-System/LoaderOptimization.cs
-System/LoaderOptimizationAttribute.cs
 System/LocalDataStoreSlot.cs
 System/MarshalByRefObject.cs
 System/Math.cs
@@ -161,16 +118,12 @@ System/MonoCustomAttrs.cs
 System/MonoListItem.cs
 System/MonoType.cs
 System/MonoTouchAOTHelper.cs
-System/MTAThreadAttribute.cs
 System/MulticastDelegate.cs
-System/NonSerializedAttribute.cs
 System/NullConsoleDriver.cs
 System/Nullable.cs
 System/NumberFormatter.cs
 System/Object.cs
-System/ObsoleteAttribute.cs
 System/OperatingSystem.cs
-System/ParamArrayAttribute.cs
 System/PlatformID.cs
 System/ResolveEventArgs.cs
 System/ResolveEventHandler.cs
@@ -179,28 +132,21 @@ System/RuntimeFieldHandle.cs
 System/RuntimeMethodHandle.cs
 System/RuntimeTypeHandle.cs
 System/ModuleHandle.cs
-System/SerializableAttribute.cs
 System/Single.cs
-System/STAThreadAttribute.cs
 System/StringComparison.cs
 System/TermInfoBooleans.cs
 System/TermInfoDriver.cs
 System/TermInfoNumbers.cs
 System/TermInfoReader.cs
 System/TermInfoStrings.cs
-System/ThreadStaticAttribute.cs
 System/TimeZone.cs
 System/TimeZoneInfo.cs
-System/TimeZoneInfo.AdjustmentRule.cs
 System/TimeZoneInfo.Android.cs
 System/TimeZoneInfo.MonoTouch.cs
 System/TimeZoneInfo.Serialization.cs
-System/TimeZoneInfo.TransitionTime.cs
-System/TimeZoneNotFoundException.cs
 ../../build/common/MonoTODOAttribute.cs
 System/TypeSpec.cs
 System/TypeCode.cs
-System/TypeLoadException.cs
 System/UIntPtr.cs
 System/ValueType.cs
 System/Variant.cs
@@ -208,7 +154,6 @@ System/Void.cs
 System/WeakReference.cs
 System/WeakReference_T.cs
 System/WindowsConsoleDriver.cs
-System/_AppDomain.cs
 System/__ComObject.cs
 System.Configuration.Assemblies/AssemblyHash.cs
 System.Configuration.Assemblies/AssemblyHashAlgorithm.cs
@@ -242,44 +187,31 @@ System.Diagnostics.SymbolStore/SymbolToken.cs
 System.Diagnostics.SymbolStore/SymDocumentType.cs
 System.Diagnostics.SymbolStore/SymLanguageType.cs
 System.Diagnostics.SymbolStore/SymLanguageVendor.cs
-System.Globalization/CalendarAlgorithmType.cs
-System.Globalization/CalendarWeekRule.cs
 System.Globalization/CultureInfo.cs
-System.Globalization/DateTimeStyles.cs
-System.Globalization/DigitShapes.cs
-System.Globalization/GregorianCalendarTypes.cs
 System.Globalization/IdnMapping.cs
 System.Globalization/RegionInfo.cs
 System.Globalization/RegionInfo.MonoTouch.cs
-System.Globalization/TextInfo.cs
 System.IO/Directory.cs
 System.IO/DirectoryInfo.cs
-System.IO/DirectoryNotFoundException.cs
 System.IO/DriveInfo.cs
-System.IO/DriveNotFoundException.cs
 System.IO/DriveType.cs
-System.IO/EndOfStreamException.cs
 System.IO/File.cs
 System.IO/FileAccess.cs
 System.IO/FileAttributes.cs
 System.IO/FileInfo.cs
-System.IO/FileLoadException.cs
 System.IO/FileMode.cs
-System.IO/FileNotFoundException.cs
 System.IO/FileOptions.cs
 System.IO/FileShare.cs
 System.IO/FileStream.cs
 System.IO/FileStreamAsyncResult.cs
 System.IO/FileSystemInfo.cs
 System.IO/HGlobalUnmanagedMemoryStream.cs
-System.IO/IOException.cs
 System.IO/LogcatTextWriter.cs
 System.IO/MonoIO.cs
 System.IO/MonoIOError.cs
 System.IO/MonoFileType.cs
 System.IO/MonoIOStat.cs
 System.IO/Path.cs
-System.IO/PathTooLongException.cs
 System.IO/SearchOption.cs
 System.IO/SearchPattern.cs
 System.IO/SeekOrigin.cs
@@ -381,11 +313,6 @@ System.Runtime/GCSettings.cs
 System.Runtime/MemoryFailPoint.cs
 System.Runtime.CompilerServices/ConditionalWeakTable.cs
 System.Runtime.CompilerServices/RuntimeHelpers.cs
-System.Runtime.ConstrainedExecution/CriticialFinalizerObject.cs
-System.Runtime.ConstrainedExecution/CER.cs
-System.Runtime.ConstrainedExecution/Consistency.cs
-System.Runtime.ConstrainedExecution/PrePrepareMethodAttribute.cs
-System.Runtime.ConstrainedExecution/ReliabilityContractAttribute.cs
 System.Runtime.Hosting/ActivationArguments.cs
 System.Runtime.Hosting/ApplicationActivator.cs
 System.Runtime.InteropServices/_Activator.cs
@@ -419,64 +346,37 @@ System.Runtime.InteropServices/_SignatureHelper.cs
 System.Runtime.InteropServices/_Thread.cs
 System.Runtime.InteropServices/_Type.cs
 System.Runtime.InteropServices/_TypeBuilder.cs
-System.Runtime.InteropServices/AllowReversePInvokeCallsAttribute.cs
 System.Runtime.InteropServices/ArrayWithOffset.cs
 System.Runtime.InteropServices/AssemblyRegistrationFlags.cs
-System.Runtime.InteropServices/AutomationProxyAttribute.cs
-System.Runtime.InteropServices/BestFitMappingAttribute.cs
 System.Runtime.InteropServices/BIND_OPTS.cs
 System.Runtime.InteropServices/BINDPTR.cs
 System.Runtime.InteropServices/BStrWrapper.cs
 System.Runtime.InteropServices/CALLCONV.cs
 System.Runtime.InteropServices/CallingConvention.cs
 System.Runtime.InteropServices/CharSet.cs
-System.Runtime.InteropServices/ClassInterfaceAttribute.cs
-System.Runtime.InteropServices/ClassInterfaceType.cs
-System.Runtime.InteropServices/CoClassAttribute.cs
-System.Runtime.InteropServices/ComAliasNameAttribute.cs
-System.Runtime.InteropServices/ComCompatibleVersionAttribute.cs
-System.Runtime.InteropServices/ComConversionLossAttribute.cs
-System.Runtime.InteropServices/ComDefaultInterfaceAttribute.cs
 System.Runtime.InteropServices/COMException.cs
-System.Runtime.InteropServices/ComEventInterfaceAttribute.cs
-System.Runtime.InteropServices/ComImportAttribute.cs
-System.Runtime.InteropServices/ComInterfaceType.cs
 System.Runtime.InteropServices/ComMemberType.cs
-System.Runtime.InteropServices/ComRegisterFunctionAttribute.cs
-System.Runtime.InteropServices/ComSourceInterfacesAttribute.cs
-System.Runtime.InteropServices/ComUnregisterFunctionAttribute.cs
-System.Runtime.InteropServices/ComVisible.cs
-System.Runtime.InteropServices/CONNECTDATA.cs
 System.Runtime.InteropServices/CriticalHandle.cs
 System.Runtime.InteropServices/CurrencyWrapper.cs
-System.Runtime.InteropServices/DefaultCharSetAttribute.cs
-System.Runtime.InteropServices/DllImportSearchPath.cs
-System.Runtime.InteropServices/DefaultDllImportSearchPathsAttribute.cs
 System.Runtime.InteropServices/DESCKIND.cs
 System.Runtime.InteropServices/DispatchWrapper.cs
 System.Runtime.InteropServices/DISPPARAMS.cs
-System.Runtime.InteropServices/DispIdAttribute.cs
-System.Runtime.InteropServices/DllImportAttribute.cs
 System.Runtime.InteropServices/ELEMDESC.cs
 System.Runtime.InteropServices/ErrorWrapper.cs
 System.Runtime.InteropServices/EXCEPINFO.cs
 System.Runtime.InteropServices/ExporterEventKind.cs
 System.Runtime.InteropServices/ExtensibleClassFactory.cs
 System.Runtime.InteropServices/ExternalException.cs
-System.Runtime.InteropServices/FieldOffsetAttribute.cs
 System.Runtime.InteropServices/FILETIME.cs
 System.Runtime.InteropServices/FUNCDESC.cs
 System.Runtime.InteropServices/FUNCFLAGS.cs
 System.Runtime.InteropServices/FUNCKIND.cs
 System.Runtime.InteropServices/GCHandle.cs
 System.Runtime.InteropServices/GCHandleType.cs
-System.Runtime.InteropServices/GuidAttribute.cs
 System.Runtime.InteropServices/HandleRef.cs
 System.Runtime.InteropServices/ICustomAdapter.cs
 System.Runtime.InteropServices/ICustomFactory.cs
 System.Runtime.InteropServices/ICustomMarshaler.cs
-System.Runtime.InteropServices/IDispatchImplAttribute.cs
-System.Runtime.InteropServices/IDispatchImplType.cs
 System.Runtime.InteropServices/IDLDESC.cs
 System.Runtime.InteropServices/IDLFLAG.cs
 System.Runtime.InteropServices/IErrorInfo.cs
@@ -487,13 +387,9 @@ System.Runtime.InteropServices/ITypeLibConverter.cs
 System.Runtime.InteropServices/ITypeLibExporterNameProvider.cs
 System.Runtime.InteropServices/ITypeLibExporterNotifySink.cs
 System.Runtime.InteropServices/ITypeLibImporterNotifySink.cs
-System.Runtime.InteropServices/ImportedFromTypeLibAttribute.cs
 System.Runtime.InteropServices/ImporterEventKind.cs
-System.Runtime.InteropServices/InAttribute.cs
-System.Runtime.InteropServices/InterfaceTypeAttribute.cs
 System.Runtime.InteropServices/InvalidComObjectException.cs
 System.Runtime.InteropServices/InvalidOleVariantTypeException.cs
-System.Runtime.InteropServices/LCIDConversionAttribute.cs
 System.Runtime.InteropServices/LIBFLAGS.cs
 System.Runtime.InteropServices/LayoutKind.cs
 System.Runtime.InteropServices/ManagedErrorInfo.cs
@@ -501,48 +397,31 @@ System.Runtime.InteropServices/Marshal.cs
 System.Runtime.InteropServices/MarshalAsAttribute.cs
 System.Runtime.InteropServices/MarshalDirectiveException.cs
 System.Runtime.InteropServices/ObjectCreationDelegate.cs
-System.Runtime.InteropServices/OptionalAttribute.cs
-System.Runtime.InteropServices/OutAttribute.cs
 System.Runtime.InteropServices/PARAMDESC.cs
 System.Runtime.InteropServices/PARAMFLAG.cs
-System.Runtime.InteropServices/PreserveSigAttribute.cs
-System.Runtime.InteropServices/PrimaryInteropAssemblyAttribute.cs
 System.Runtime.InteropServices/RegistrationClassContext.cs
 System.Runtime.InteropServices/RegistrationConnectionType.cs
 System.Runtime.InteropServices/SEHException.cs
 System.Runtime.InteropServices/STATSTG.cs
-System.Runtime.InteropServices/ProgIdAttribute.cs
 System.Runtime.InteropServices/RegistrationServices.cs
 System.Runtime.InteropServices/RuntimeEnvironment.cs
 System.Runtime.InteropServices/SafeArrayRankMismatchException.cs
 System.Runtime.InteropServices/SafeArrayTypeMismatchException.cs
 System.Runtime.InteropServices/SafeBuffer.cs
 System.Runtime.InteropServices/SafeHandle.cs
-System.Runtime.InteropServices/SetWin32ContextInIDispatchAttribute.cs
-System.Runtime.InteropServices/StructLayoutAttribute.cs
 System.Runtime.InteropServices/SYSKIND.cs
 System.Runtime.InteropServices/TYPEATTR.cs
 System.Runtime.InteropServices/TYPEDESC.cs
 System.Runtime.InteropServices/TYPEFLAGS.cs
 System.Runtime.InteropServices/TYPEKIND.cs
 System.Runtime.InteropServices/TYPELIBATTR.cs
-System.Runtime.InteropServices/TypeIdentifierAttribute.cs
 System.Runtime.InteropServices/TypeLibConverter.cs
 System.Runtime.InteropServices/TypeLibExporterFlags.cs
-System.Runtime.InteropServices/TypeLibFuncAttribute.cs
-System.Runtime.InteropServices/TypeLibFuncFlags.cs
-System.Runtime.InteropServices/TypeLibImportClassAttribute.cs
 System.Runtime.InteropServices/TypeLibImporterFlags.cs
-System.Runtime.InteropServices/TypeLibTypeAttribute.cs
-System.Runtime.InteropServices/TypeLibTypeFlags.cs
-System.Runtime.InteropServices/TypeLibVarAttribute.cs
-System.Runtime.InteropServices/TypeLibVarFlags.cs
-System.Runtime.InteropServices/TypeLibVersionAttribute.cs
 System.Runtime.InteropServices/UCOMIBindCtx.cs
 System.Runtime.InteropServices/UCOMIConnectionPoint.cs
 System.Runtime.InteropServices/UCOMIConnectionPointContainer.cs
 System.Runtime.InteropServices/UCOMIEnumConnectionPoints.cs
-System.Runtime.InteropServices/UCOMIEnumConnections.cs
 System.Runtime.InteropServices/UCOMIEnumMoniker.cs
 System.Runtime.InteropServices/UCOMIEnumString.cs
 System.Runtime.InteropServices/UCOMIEnumVARIANT.cs
@@ -554,59 +433,10 @@ System.Runtime.InteropServices/UCOMITypeComp.cs
 System.Runtime.InteropServices/UCOMITypeInfo.cs
 System.Runtime.InteropServices/UCOMITypeLib.cs
 System.Runtime.InteropServices/UnknownWrapper.cs
-System.Runtime.InteropServices/UnmanagedFunctionPointerAttribute.cs
-System.Runtime.InteropServices/UnmanagedType.cs
 System.Runtime.InteropServices/VARDESC.cs
-System.Runtime.InteropServices/VarEnum.cs
 System.Runtime.InteropServices/VARFLAGS.cs
 System.Runtime.InteropServices/VariantWrapper.cs
-System.Runtime.InteropServices.ComTypes/BINDPTR.cs
-System.Runtime.InteropServices.ComTypes/BIND_OPTS.cs
-System.Runtime.InteropServices.ComTypes/CALLCONV.cs
-System.Runtime.InteropServices.ComTypes/CONNECTDATA.cs
-System.Runtime.InteropServices.ComTypes/DESCKIND.cs
-System.Runtime.InteropServices.ComTypes/DISPPARAMS.cs
-System.Runtime.InteropServices.ComTypes/ELEMDESC.cs
-System.Runtime.InteropServices.ComTypes/EXCEPINFO.cs
-System.Runtime.InteropServices.ComTypes/FILETIME.cs
-System.Runtime.InteropServices.ComTypes/FUNCDESC.cs
-System.Runtime.InteropServices.ComTypes/FUNCFLAGS.cs
-System.Runtime.InteropServices.ComTypes/FUNCKIND.cs
-System.Runtime.InteropServices.ComTypes/IBindCtx.cs
-System.Runtime.InteropServices.ComTypes/IConnectionPoint.cs
-System.Runtime.InteropServices.ComTypes/IConnectionPointContainer.cs
-System.Runtime.InteropServices.ComTypes/IDLDESC.cs
-System.Runtime.InteropServices.ComTypes/IDLFLAG.cs
-System.Runtime.InteropServices.ComTypes/IEnumConnectionPoints.cs
-System.Runtime.InteropServices.ComTypes/IEnumConnections.cs
-System.Runtime.InteropServices.ComTypes/IEnumMoniker.cs
-System.Runtime.InteropServices.ComTypes/IEnumString.cs
-System.Runtime.InteropServices.ComTypes/IEnumVARIANT.cs
-System.Runtime.InteropServices.ComTypes/IMoniker.cs
-System.Runtime.InteropServices.ComTypes/IMPLTYPEFLAGS.cs
-System.Runtime.InteropServices.ComTypes/INVOKEKIND.cs
-System.Runtime.InteropServices.ComTypes/IPersistFile.cs
-System.Runtime.InteropServices.ComTypes/IRunningObjectTable.cs
-System.Runtime.InteropServices.ComTypes/IStream.cs
-System.Runtime.InteropServices.ComTypes/ITypeComp.cs
-System.Runtime.InteropServices.ComTypes/ITypeInfo.cs
-System.Runtime.InteropServices.ComTypes/ITypeInfo2.cs
-System.Runtime.InteropServices.ComTypes/ITypeLib.cs
-System.Runtime.InteropServices.ComTypes/ITypeLib2.cs
-System.Runtime.InteropServices.ComTypes/LIBFLAGS.cs
-System.Runtime.InteropServices.ComTypes/PARAMDESC.cs
-System.Runtime.InteropServices.ComTypes/PARAMFLAG.cs
-System.Runtime.InteropServices.ComTypes/STATSTG.cs
-System.Runtime.InteropServices.ComTypes/SYSKIND.cs
-System.Runtime.InteropServices.ComTypes/TYPEATTR.cs
-System.Runtime.InteropServices.ComTypes/TYPEDESC.cs
-System.Runtime.InteropServices.ComTypes/TYPEFLAGS.cs
-System.Runtime.InteropServices.ComTypes/TYPEKIND.cs
-System.Runtime.InteropServices.ComTypes/TYPELIBATTR.cs
-System.Runtime.InteropServices.ComTypes/VARDESC.cs
-System.Runtime.InteropServices.ComTypes/VARFLAGS.cs
-System.Runtime.InteropServices.ComTypes/VARKIND.cs
-System.Runtime.InteropServices.Expando/IExpando.cs
+
 System.Runtime.InteropServices.WindowsRuntime/DefaultInterfaceAttribute.cs
 System.Runtime.InteropServices.WindowsRuntime/DesignerNamespaceResolveEventArgs.cs
 System.Runtime.InteropServices.WindowsRuntime/EventRegistrationToken.cs
@@ -798,14 +628,6 @@ System.Runtime.Remoting.Services/EnterpriseServicesHelper.cs
 System.Runtime.Remoting.Services/ITrackingHandler.cs
 System.Runtime.Remoting.Services/TrackingServices.cs
 System.Runtime.Versioning/CompatibilitySwitch.cs
-System.Runtime.Versioning/ComponentGuaranteesAttribute.cs
-System.Runtime.Versioning/ComponentGuaranteesOptions.cs
-System.Runtime.Versioning/ResourceConsumptionAttribute.cs
-System.Runtime.Versioning/ResourceExposureAttribute.cs
-System.Runtime.Versioning/ResourceScope.cs
-System.Runtime.Versioning/TargetFrameworkAttribute.cs
-System.Runtime.Versioning/VersioningHelper.cs
-System.Security/AllowPartiallyTrustedCallersAttribute.cs
 System.Security/CodeAccessPermission.cs
 System.Security/HostProtectionException.cs
 System.Security/HostSecurityManager.cs
@@ -822,22 +644,13 @@ System.Security/PolicyLevelType.cs
 System.Security/SecureString.cs
 System.Security/SecurityContext.cs
 System.Security/SecurityContextSource.cs
-System.Security/SecurityCriticalAttribute.cs
-System.Security/SecurityCriticalScope.cs
 System.Security/SecurityElement.cs
 System.Security/SecurityFrame.cs
 System.Security/SecurityException.cs
 System.Security/SecurityManager.cs
 System.Security/SecurityManager_mobile.cs
-System.Security/SecurityRuleSet.cs
-System.Security/SecurityRulesAttribute.cs
-System.Security/SecuritySafeCriticalAttribute.cs
 System.Security/SecurityState.cs
-System.Security/SecurityTransparentAttribute.cs
-System.Security/SecurityTreatAsSafeAttribute.cs
 System.Security/SecurityZone.cs
-System.Security/SuppressUnmanagedCodeSecurityAttribute.cs
-System.Security/UnverifiableCodeAttribute.cs
 System.Security/VerificationException.cs
 System.Security/XmlSyntaxException.cs
 System.Security.AccessControl/AccessControlActions.cs
@@ -909,11 +722,6 @@ System.Security.AccessControl/SddlAccessRight.cs
 System.Security.AccessControl/SecurityInfos.cs
 System.Security.AccessControl/SystemAcl.cs
 System.Security.Cryptography/Aes.cs
-System.Security.Claims/Claim.cs
-System.Security.Claims/ClaimsIdentity.cs
-System.Security.Claims/ClaimsPrincipal.cs
-System.Security.Claims/ClaimTypes.cs
-System.Security.Claims/ClaimValueTypes.cs
 System.Security.Cryptography/AsymmetricAlgorithm.cs
 System.Security.Cryptography/AsymmetricKeyExchangeDeformatter.cs
 System.Security.Cryptography/AsymmetricKeyExchangeFormatter.cs
@@ -1103,7 +911,6 @@ System.Security.Policy/Url.cs
 System.Security.Policy/UrlMembershipCondition.cs
 System.Security.Policy/Zone.cs
 System.Security.Policy/ZoneMembershipCondition.cs
-System.Security.Principal/GenericIdentity.cs
 System.Security.Principal/GenericPrincipal.cs
 System.Security.Principal/IdentityNotMappedException.cs
 System.Security.Principal/IdentityReferenceCollection.cs
@@ -1135,7 +942,6 @@ System.Threading/HostExecutionContextManager.cs
 System.Threading/Interlocked.cs
 System.Threading/LockCookie.cs
 System.Threading/LockQueue.cs
-System.Threading/LockRecursionException.cs
 System.Threading/Monitor.cs
 System.Threading/Mutex.cs
 System.Threading/NamedDataSlot.cs
@@ -1144,22 +950,13 @@ System.Threading/NativeOverlapped.cs
 System.Threading/Overlapped.cs
 System.Threading/ReaderWriterLock.cs
 System.Threading/RegisteredWaitHandle.cs
-../System/System.Threading/SemaphoreFullException.cs
 System.Threading/SynchronizationContext.cs
 System.Threading/Thread.cs
-System.Threading/ThreadAbortException.cs
-System.Threading/ThreadInterruptedException.cs
 System.Threading/ThreadPool.cs
 System.Threading/Timer.cs
 System.Threading/TimerCallback.cs
 System.Threading/Volatile.cs
 System.Threading/WaitHandle.cs
-System/Action.cs
-System/Comparison.cs
-System/Converter.cs
-System/Predicate.cs
-System.Collections.Generic/Comparer.cs
-System.Collections.Generic/EqualityComparer.cs
 
 System.Threading.Tasks/DecoupledTask.cs
 ../Mono.Parallel/Mono.Threading/AtomicBoolean.cs
@@ -1176,7 +973,6 @@ ReferenceSources/Environment.cs
 ReferenceSources/ExecutionContext.cs
 ReferenceSources/HashHelpers.cs
 ReferenceSources/ParseNumbers.cs
-ReferenceSources/TimeZoneInfoOptions.cs
 ReferenceSources/AppDomain.cs
 ReferenceSources/CLRConfig.cs
 ReferenceSources/JitHelpers.cs
@@ -1189,28 +985,48 @@ ReferenceSources/MonoRuntimeWorkItem.cs
 ReferenceSources/MethodBase.cs
 ReferenceSources/RuntimeHandles.cs
 ReferenceSources/CompareInfo.cs
+ReferenceSources/TypeBuilderInstantiation.cs
+ReferenceSources/Buffer.cs
+ReferenceSources/TextInfo.cs
+ReferenceSources/win32native.cs
 
 ../../../external/referencesource/mscorlib/system/__filters.cs
 ../../../external/referencesource/mscorlib/system/__hresults.cs
 ../../../external/referencesource/mscorlib/system/accessviolationexception.cs
+../../../external/referencesource/mscorlib/system/action.cs
 ../../../external/referencesource/mscorlib/system/activator.cs
 ../../../external/referencesource/mscorlib/system/AggregateException.cs
+../../../external/referencesource/mscorlib/system/appdomainattributes.cs
 ../../../external/referencesource/mscorlib/system/appdomainunloadedexception.cs
 ../../../external/referencesource/mscorlib/system/applicationexception.cs
+../../../external/referencesource/mscorlib/system/applicationid.cs
 ../../../external/referencesource/mscorlib/system/argumentexception.cs
 ../../../external/referencesource/mscorlib/system/argumentnullexception.cs
 ../../../external/referencesource/mscorlib/system/argumentoutofrangeexception.cs
 ../../../external/referencesource/mscorlib/system/arithmeticexception.cs
 ../../../external/referencesource/mscorlib/system/arraysegment.cs
 ../../../external/referencesource/mscorlib/system/arraytypemismatchexception.cs
+../../../external/referencesource/mscorlib/system/asynccallback.cs
 ../../../external/referencesource/mscorlib/system/attribute.cs
+../../../external/referencesource/mscorlib/system/attributetargets.cs
 ../../../external/referencesource/mscorlib/system/attributeusageattribute.cs
+../../../external/referencesource/mscorlib/system/badimageformatexception.cs
 ../../../external/referencesource/mscorlib/system/bitconverter.cs
 ../../../external/referencesource/mscorlib/system/boolean.cs
+../../../external/referencesource/mscorlib/system/buffer.cs
 ../../../external/referencesource/mscorlib/system/byte.cs
 ../../../external/referencesource/mscorlib/system/cannotunloadappdomainexception.cs
 ../../../external/referencesource/mscorlib/system/char.cs
 ../../../external/referencesource/mscorlib/system/charenumerator.cs
+../../../external/referencesource/mscorlib/system/consolecanceleventargs.cs
+../../../external/referencesource/mscorlib/system/consolecolor.cs
+../../../external/referencesource/mscorlib/system/consolekey.cs
+../../../external/referencesource/mscorlib/system/consolekeyinfo.cs
+../../../external/referencesource/mscorlib/system/consolemodifiers.cs
+../../../external/referencesource/mscorlib/system/consolespecialkey.cs
+../../../external/referencesource/mscorlib/system/contextboundobject.cs
+../../../external/referencesource/mscorlib/system/contextstaticattribute.cs
+../../../external/referencesource/mscorlib/system/clscompliantattribute.cs
 ../../../external/referencesource/mscorlib/system/contextmarshalexception.cs
 ../../../external/referencesource/mscorlib/system/convert.cs
 ../../../external/referencesource/mscorlib/system/datamisalignedexception.cs
@@ -1227,10 +1043,24 @@ ReferenceSources/CompareInfo.cs
 ../../../external/referencesource/mscorlib/system/empty.cs
 ../../../external/referencesource/mscorlib/system/enum.cs
 ../../../external/referencesource/mscorlib/system/entrypointnotfoundexception.cs
+../../../external/referencesource/mscorlib/system/eventargs.cs
+../../../external/referencesource/mscorlib/system/eventhandler.cs
 ../../../external/referencesource/mscorlib/system/executionengineexception.cs
 ../../../external/referencesource/mscorlib/system/fieldaccessexception.cs
+../../../external/referencesource/mscorlib/system/flagsattribute.cs
 ../../../external/referencesource/mscorlib/system/formatexception.cs
 ../../../external/referencesource/mscorlib/system/guid.cs
+../../../external/referencesource/mscorlib/system/iappdomain.cs
+../../../external/referencesource/mscorlib/system/iappdomainsetup.cs
+../../../external/referencesource/mscorlib/system/iasyncresult.cs
+../../../external/referencesource/mscorlib/system/icloneable.cs
+../../../external/referencesource/mscorlib/system/icomparable.cs
+../../../external/referencesource/mscorlib/system/iconvertible.cs
+../../../external/referencesource/mscorlib/system/icustomformatter.cs
+../../../external/referencesource/mscorlib/system/idisposable.cs
+../../../external/referencesource/mscorlib/system/iequatable.cs
+../../../external/referencesource/mscorlib/system/iformatprovider.cs
+../../../external/referencesource/mscorlib/system/iformattable.cs
 ../../../external/referencesource/mscorlib/system/invalidcastexception.cs
 ../../../external/referencesource/mscorlib/system/indexoutofrangeexception.cs
 ../../../external/referencesource/mscorlib/system/invalidoperationexception.cs
@@ -1240,23 +1070,31 @@ ReferenceSources/CompareInfo.cs
 ../../../external/referencesource/mscorlib/system/int16.cs
 ../../../external/referencesource/mscorlib/system/int32.cs
 ../../../external/referencesource/mscorlib/system/int64.cs
+../../../external/referencesource/mscorlib/system/iobservable.cs
+../../../external/referencesource/mscorlib/system/iobserver.cs
+../../../external/referencesource/mscorlib/system/iprogress.cs
+../../../external/referencesource/mscorlib/system/iserviceobjectprovider.cs
+../../../external/referencesource/mscorlib/system/invalidtimezoneexception.cs
 ../../../external/referencesource/mscorlib/system/Lazy.cs
 ../../../external/referencesource/mscorlib/system/memberaccessexception.cs
 ../../../external/referencesource/mscorlib/system/methodaccessexception.cs
+../../../external/referencesource/mscorlib/system/midpointrounding.cs
 ../../../external/referencesource/mscorlib/system/missingfieldexception.cs
 ../../../external/referencesource/mscorlib/system/missingmemberexception.cs
 ../../../external/referencesource/mscorlib/system/missingmethodexception.cs
 ../../../external/referencesource/mscorlib/system/multicastnotsupportedexception.cs
+../../../external/referencesource/mscorlib/system/nonserializedattribute.cs
 ../../../external/referencesource/mscorlib/system/notfinitenumberexception.cs
 ../../../external/referencesource/mscorlib/system/notimplementedexception.cs
 ../../../external/referencesource/mscorlib/system/notsupportedexception.cs
-../../../external/referencesource/mscorlib/system/midpointrounding.cs
 ../../../external/referencesource/mscorlib/system/nullreferenceexception.cs
 ../../../external/referencesource/mscorlib/system/number.cs
 ../../../external/referencesource/mscorlib/system/objectdisposedexception.cs
+../../../external/referencesource/mscorlib/system/obsoleteattribute.cs
 ../../../external/referencesource/mscorlib/system/operationcanceledexception.cs
 ../../../external/referencesource/mscorlib/system/outofmemoryexception.cs
 ../../../external/referencesource/mscorlib/system/overflowexception.cs
+../../../external/referencesource/mscorlib/system/paramarrayattribute.cs
 ../../../external/referencesource/mscorlib/system/platformnotsupportedexception.cs
 ../../../external/referencesource/mscorlib/system/progress.cs
 ../../../external/referencesource/mscorlib/system/random.cs
@@ -1264,6 +1102,7 @@ ReferenceSources/CompareInfo.cs
 ../../../external/referencesource/mscorlib/system/resid.cs
 ../../../external/referencesource/mscorlib/system/rttype.cs
 ../../../external/referencesource/mscorlib/system/sbyte.cs
+../../../external/referencesource/mscorlib/system/serializableattribute.cs
 ../../../external/referencesource/mscorlib/system/stackoverflowexception.cs
 ../../../external/referencesource/mscorlib/system/string.cs
 ../../../external/referencesource/mscorlib/system/stringcomparer.cs
@@ -1271,11 +1110,16 @@ ReferenceSources/CompareInfo.cs
 ../../../external/referencesource/mscorlib/system/systemexception.cs
 ../../../external/referencesource/mscorlib/system/timeoutexception.cs
 ../../../external/referencesource/mscorlib/system/timespan.cs
+../../../external/referencesource/mscorlib/system/threadattributes.cs
+../../../external/referencesource/mscorlib/system/threadstaticattribute.cs
 ../../../external/referencesource/mscorlib/system/throwhelper.cs
+../../../external/referencesource/mscorlib/system/timezoneinfo.cs
+../../../external/referencesource/mscorlib/system/timezonenotfoundexception.cs
 ../../../external/referencesource/mscorlib/system/tuple.cs
 ../../../external/referencesource/mscorlib/system/type.cs
 ../../../external/referencesource/mscorlib/system/typeaccessexception.cs
 ../../../external/referencesource/mscorlib/system/typeinitializationexception.cs
+../../../external/referencesource/mscorlib/system/typeloadexception.cs
 ../../../external/referencesource/mscorlib/system/typedreference.cs
 ../../../external/referencesource/mscorlib/system/typeunloadedexception.cs
 ../../../external/referencesource/mscorlib/system/uint16.cs
@@ -1322,8 +1166,10 @@ ReferenceSources/CompareInfo.cs
 ../../../external/referencesource/mscorlib/system/collections/stack.cs
 ../../../external/referencesource/mscorlib/system/collections/structuralcomparisons.cs
 
+../../../external/referencesource/mscorlib/system/collections/generic/comparer.cs
 ../../../external/referencesource/mscorlib/system/collections/generic/debugview.cs
 ../../../external/referencesource/mscorlib/system/collections/generic/dictionary.cs
+../../../external/referencesource/mscorlib/system/collections/generic/equalitycomparer.cs
 ../../../external/referencesource/mscorlib/system/collections/generic/icollection.cs
 ../../../external/referencesource/mscorlib/system/collections/generic/icomparer.cs
 ../../../external/referencesource/mscorlib/system/collections/generic/idictionary.cs
@@ -1359,7 +1205,9 @@ ReferenceSources/CompareInfo.cs
 
 ../../../external/referencesource/mscorlib/system/globalization/bidicategory.cs
 ../../../external/referencesource/mscorlib/system/globalization/calendar.cs
+../../../external/referencesource/mscorlib/system/globalization/calendaralgorithmtype.cs
 ../../../external/referencesource/mscorlib/system/globalization/calendardata.cs
+../../../external/referencesource/mscorlib/system/globalization/calendarweekrule.cs
 ../../../external/referencesource/mscorlib/system/globalization/charunicodeinfo.cs
 ../../../external/referencesource/mscorlib/system/globalization/chineselunisolarcalendar.cs
 ../../../external/referencesource/mscorlib/system/globalization/compareinfo.cs
@@ -1370,10 +1218,13 @@ ReferenceSources/CompareInfo.cs
 ../../../external/referencesource/mscorlib/system/globalization/datetimeformatinfo.cs
 ../../../external/referencesource/mscorlib/system/globalization/datetimeformatinfoscanner.cs
 ../../../external/referencesource/mscorlib/system/globalization/datetimeparse.cs
+../../../external/referencesource/mscorlib/system/globalization/datetimestyles.cs
+../../../external/referencesource/mscorlib/system/globalization/digitshapes.cs
 ../../../external/referencesource/mscorlib/system/globalization/eastasianlunisolarcalendar.cs
 ../../../external/referencesource/mscorlib/system/globalization/globalizationassembly.cs
 ../../../external/referencesource/mscorlib/system/globalization/gregoriancalendar.cs
 ../../../external/referencesource/mscorlib/system/globalization/gregoriancalendarhelper.cs
+../../../external/referencesource/mscorlib/system/globalization/gregoriancalendartypes.cs
 ../../../external/referencesource/mscorlib/system/globalization/hebrewcalendar.cs
 ../../../external/referencesource/mscorlib/system/globalization/hebrewnumber.cs
 ../../../external/referencesource/mscorlib/system/globalization/hijricalendar.cs
@@ -1392,15 +1243,24 @@ ReferenceSources/CompareInfo.cs
 ../../../external/referencesource/mscorlib/system/globalization/textelementenumerator.cs
 ../../../external/referencesource/mscorlib/system/globalization/timespanformat.cs
 ../../../external/referencesource/mscorlib/system/globalization/timespanparse.cs
+../../../external/referencesource/mscorlib/system/globalization/textinfo.cs
 ../../../external/referencesource/mscorlib/system/globalization/thaibuddhistcalendar.cs
 ../../../external/referencesource/mscorlib/system/globalization/umalquracalendar.cs
 ../../../external/referencesource/mscorlib/system/globalization/unicodecategory.cs
 
 ../../../external/referencesource/mscorlib/system/io/__error.cs
+../../../external/referencesource/mscorlib/system/io/__hresults.cs
 ../../../external/referencesource/mscorlib/system/io/binaryreader.cs
 ../../../external/referencesource/mscorlib/system/io/binarywriter.cs
 ../../../external/referencesource/mscorlib/system/io/bufferedstream.cs
+../../../external/referencesource/mscorlib/system/io/directorynotfoundexception.cs
+../../../external/referencesource/mscorlib/system/io/drivenotfoundexception.cs
+../../../external/referencesource/mscorlib/system/io/endofstreamexception.cs
+../../../external/referencesource/mscorlib/system/io/ioexception.cs
+../../../external/referencesource/mscorlib/system/io/fileloadexception.cs
+../../../external/referencesource/mscorlib/system/io/filenotfoundexception.cs
 ../../../external/referencesource/mscorlib/system/io/memorystream.cs
+../../../external/referencesource/mscorlib/system/io/pathtoolongexception.cs
 ../../../external/referencesource/mscorlib/system/io/pinnedbuffermemorystream.cs
 ../../../external/referencesource/mscorlib/system/io/stream.cs
 ../../../external/referencesource/mscorlib/system/io/streamreader.cs
@@ -1431,6 +1291,7 @@ ReferenceSources/CompareInfo.cs
 ../../../external/referencesource/mscorlib/system/reflection/ireflect.cs
 ../../../external/referencesource/mscorlib/system/reflection/ireflectabletype.cs
 ../../../external/referencesource/mscorlib/system/reflection/manifestresourceinfo.cs
+../../../external/referencesource/mscorlib/system/reflection/mdimport.cs
 ../../../external/referencesource/mscorlib/system/reflection/memberfilter.cs
 ../../../external/referencesource/mscorlib/system/reflection/memberinfo.cs
 ../../../external/referencesource/mscorlib/system/reflection/memberinfoserializationholder.cs
@@ -1480,9 +1341,36 @@ ReferenceSources/CompareInfo.cs
 ../../../external/referencesource/mscorlib/system/runtime/exceptionservices/exceptionnotification.cs
 ../../../external/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs
 
-../../../external/referencesource/mscorlib/system/runtime/versioning/binarycompatibility.cs
-../../../external/referencesource/mscorlib/system/runtime/versioning/multitargetinghelpers.cs
-../../../external/referencesource/mscorlib/system/runtime/versioning/targetframeworkid.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/attributes.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ucomienumconnections.cs
+
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/ibindctx.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/iconnectionpoint.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/iconnectionpointcontainer.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/ienumconnectionpoints.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/ienumconnections.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/ienumerable.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/ienumerator.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/ienummoniker.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/ienumstring.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/ienumvariant.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/iexpando.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/imoniker.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/ipersistfile.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/ireflect.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/irunningobjecttable.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/istream.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/itypecomp.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/itypeinfo.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/itypeinfo2.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/itypelib.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/itypelib2.cs
+
+../../../external/referencesource/mscorlib/system/runtime/interopservices/expando/iexpando.cs
+
+../../../external/referencesource/mscorlib//system/runtime/reliability/criticalfinalizerobject.cs
+../../../external/referencesource/mscorlib//system/runtime/reliability/prepreparemethodattribute.cs
+../../../external/referencesource/mscorlib//system/runtime/reliability/reliabilitycontractattribute.cs
 
 ../../../external/referencesource/mscorlib/system/runtime/compilerservices/accessedthroughpropertyattribute.cs
 ../../../external/referencesource/mscorlib/system/runtime/compilerservices/assemblyattributesgohere.cs
@@ -1542,6 +1430,19 @@ ReferenceSources/CompareInfo.cs
 ../../../external/referencesource/mscorlib/system/runtime/compilerservices/unsafevaluetypeattribute.cs
 ../../../external/referencesource/mscorlib/system/runtime/compilerservices/YieldAwaitable.cs
 
+../../../external/referencesource/mscorlib/system/security/attributes.cs
+
+../../../external/referencesource/mscorlib/system/security/claims/Claim.cs
+../../../external/referencesource/mscorlib/system/security/claims/ClaimsIdentity.cs
+../../../external/referencesource/mscorlib/system/security/claims/ClaimsPrincipal.cs
+../../../external/referencesource/mscorlib/system/security/claims/ClaimTypes.cs
+../../../external/referencesource/mscorlib/system/security/claims/ClaimValueTypes.cs
+../../../external/referencesource/mscorlib/system/security/claims/RoleClaimProvider.cs
+
+../../../external/referencesource/mscorlib/system/security/principal/genericidentity.cs
+
+../../../external/referencesource/mscorlib/system/security/util/hex.cs
+
 ../../../external/referencesource/mscorlib/system/text/asciiencoding.cs
 ../../../external/referencesource/mscorlib/system/text/codepageencoding.cs
 ../../../external/referencesource/mscorlib/system/text/decoderbestfitfallback.cs
@@ -1614,6 +1515,13 @@ ReferenceSources/CompareInfo.cs
 ../../../external/referencesource/mscorlib/system/runtime/serialization/formatters/soapfault.cs
 ../../../external/referencesource/mscorlib/system/runtime/serialization/formatters/soapmessage.cs
 
+../../../external/referencesource/mscorlib/system/runtime/versioning/binarycompatibility.cs
+../../../external/referencesource/mscorlib/system/runtime/versioning/componentguaranteesattribute.cs
+../../../external/referencesource/mscorlib/system/runtime/versioning/multitargetinghelpers.cs
+../../../external/referencesource/mscorlib/system/runtime/versioning/resourceattributes.cs
+../../../external/referencesource/mscorlib/system/runtime/versioning/targetframeworkattribute.cs
+../../../external/referencesource/mscorlib/system/runtime/versioning/targetframeworkid.cs
+
 ../../../external/referencesource/mscorlib/system/threading/abandonedmutexexception.cs
 ../../../external/referencesource/mscorlib/system/threading/apartmentstate.cs
 ../../../external/referencesource/mscorlib/system/threading/autoresetevent.cs
@@ -1623,14 +1531,18 @@ ReferenceSources/CompareInfo.cs
 ../../../external/referencesource/mscorlib/system/threading/CountdownEvent.cs
 ../../../external/referencesource/mscorlib/system/threading/eventresetmode.cs
 ../../../external/referencesource/mscorlib/system/threading/LazyInitializer.cs
+../../../external/referencesource/mscorlib/system/threading/lockrecursionexception.cs
 ../../../external/referencesource/mscorlib/system/threading/manualresetevent.cs
 ../../../external/referencesource/mscorlib/system/threading/ManualResetEventSlim.cs
 ../../../external/referencesource/mscorlib/system/threading/parameterizedthreadstart.cs
+../../../external/referencesource/mscorlib/system/threading/semaphorefullexception.cs
 ../../../external/referencesource/mscorlib/system/threading/SemaphoreSlim.cs
 ../../../external/referencesource/mscorlib/system/threading/sendorpostcallback.cs
 ../../../external/referencesource/mscorlib/system/threading/SpinLock.cs
 ../../../external/referencesource/mscorlib/system/threading/SpinWait.cs
 ../../../external/referencesource/mscorlib/system/threading/synchronizationlockexception.cs
+../../../external/referencesource/mscorlib/system/threading/threadabortexception.cs
+../../../external/referencesource/mscorlib/system/threading/threadinterruptedexception.cs
 ../../../external/referencesource/mscorlib/system/threading/threadpriority.cs
 ../../../external/referencesource/mscorlib/system/threading/threadstart.cs
 ../../../external/referencesource/mscorlib/system/threading/threadstartexception.cs
@@ -1659,5 +1571,10 @@ ReferenceSources/CompareInfo.cs
 ../../../external/referencesource/mscorlib/system/threading/Tasks/ProducerConsumerQueues.cs
 ../../../external/referencesource/mscorlib/system/threading/Tasks/TaskToApm.cs
 
+../../../external/referencesource/mscorlib/microsoft/win32/safehandles/safefilehandle.cs
+../../../external/referencesource/mscorlib/microsoft/win32/safehandles/saferegistryhandle.cs
+../../../external/referencesource/mscorlib/microsoft/win32/safehandles/safewaithandle.cs
+../../../external/referencesource/mscorlib/microsoft/win32/safehandles/win32safehandles.cs
+
 ReferenceSources/String.cs
 ReferenceSources/Type.cs
index 04353c4546900bc12021ea0b7fa92a0fa6ea1eaa..560c9619a3fdabeee46209521a7c11071c10bb25 100644 (file)
@@ -101,7 +101,7 @@ namespace Monodoc.Generators.Html
                {
                        if (ecma_transform == null) {
                                ecma_transform = new XslCompiledTransform ();
-                               var assembly = System.Reflection.Assembly.GetCallingAssembly ();
+                               var assembly = System.Reflection.Assembly.GetAssembly (typeof (Ecma2Html));
                        
                                Stream stream = assembly.GetManifestResourceStream ("mono-ecma-css.xsl");
                                XmlReader xml_reader = new XmlTextReader (stream);
index bafc0baf3fc182717c86d9d7fc14cbdc50e0822c..3585b4842b6c2e3286bcaeeb87c451ec8578e2a4 100644 (file)
@@ -17,7 +17,7 @@ namespace Monodoc.Generators.Html
                        get {
                                if (css_ecmaspec != null)
                                        return css_ecmaspec;
-                               System.Reflection.Assembly assembly = System.Reflection.Assembly.GetCallingAssembly ();
+                               System.Reflection.Assembly assembly = System.Reflection.Assembly.GetAssembly (typeof (Ecmaspec2Html));
                                Stream str_css = assembly.GetManifestResourceStream ("ecmaspec.css");
                                css_ecmaspec = (new StreamReader (str_css)).ReadToEnd ();
                                return css_ecmaspec;
@@ -46,7 +46,7 @@ namespace Monodoc.Generators.Html
                {
                        if (ecma_transform == null){
                                ecma_transform = new XslTransform ();
-                               System.Reflection.Assembly assembly = System.Reflection.Assembly.GetCallingAssembly ();
+                               System.Reflection.Assembly assembly = System.Reflection.Assembly.GetAssembly (typeof (Ecmaspec2Html));
                                Stream stream;
                                stream = assembly.GetManifestResourceStream ("ecmaspec-html-css.xsl");
 
index ee6a95b993c87b0edff23e3e970ae949a19afd58..cb34b98850981503d572f6c3c1a0959a55671e0d 100644 (file)
@@ -15,7 +15,7 @@ namespace Monodoc.Generators.Html
                public Toc2Html ()
                {
                        transform = new XslTransform ();
-                       var assembly = Assembly.GetCallingAssembly ();
+                       var assembly = Assembly.GetAssembly (typeof (Toc2Html));
                        var stream = assembly.GetManifestResourceStream ("toc-html.xsl");
                        XmlReader xml_reader = new XmlTextReader (stream);
                        transform.Load (xml_reader, null, null);
index a14f96f208a34c766d684648faa0b742fe5caa9b..e4b660ba5df7fe8b8eaa8444984c58caf7a16344 100644 (file)
@@ -4,10 +4,16 @@ include ../../build/rules.make
 
 all-local:
 
+PROFILE_DIR=$(DESTDIR)$(mono_libdir)/mono/
+
 install-local:
-       $(MKINSTALLDIRS) $(DESTDIR)$(LIBRARY_INSTALL_DIR)
-       $(INSTALL_LIB) ../../../external/binary-reference-assemblies/v4.0/* $(DESTDIR)$(LIBRARY_INSTALL_DIR)
+       $(MKINSTALLDIRS) $(PROFILE_DIR)/2.0
+       $(MKINSTALLDIRS) $(PROFILE_DIR)/3.5
+       $(MKINSTALLDIRS) $(PROFILE_DIR)/4.0
+       $(INSTALL_LIB) ../../../external/binary-reference-assemblies/v2.0/* $(PROFILE_DIR)/2.0
+       $(INSTALL_LIB) ../../../external/binary-reference-assemblies/v3.5/* $(PROFILE_DIR)/3.5
+       $(INSTALL_LIB) ../../../external/binary-reference-assemblies/v4.0/* $(PROFILE_DIR)/4.0
 
-DISTFILES = $(wildcard ../../../external/binary-reference-assemblies/v4.0/*) Makefile
+DISTFILES = $(wildcard ../../../external/binary-reference-assemblies/v4.0/*) $(wildcard ../../../external/binary-reference-assemblies/v3.5/*) $(wildcard ../../../external/binary-reference-assemblies/v2.0/*) Makefile
 
 dist-local: dist-default
diff --git a/mcs/errors/cs0104-5.cs b/mcs/errors/cs0104-5.cs
new file mode 100644 (file)
index 0000000..295e443
--- /dev/null
@@ -0,0 +1,35 @@
+// CS0104: `N' is an ambiguous reference between `C.N' and `A.T.N'
+// Line: 32
+
+namespace A
+{
+       public class T
+       {
+               public class N
+               {
+
+               }
+       }
+}
+
+namespace C
+{
+       struct N
+       {
+
+       }
+}
+
+namespace B
+{
+       using static A.T;
+       using C;
+
+       static class Program
+       {
+               static void Main ()
+               {
+                       var u = new N ();
+               }
+       }
+}
diff --git a/mcs/errors/cs0246-35.cs b/mcs/errors/cs0246-35.cs
new file mode 100644 (file)
index 0000000..79f1c78
--- /dev/null
@@ -0,0 +1,23 @@
+// CS0246: The type or namespace name `B' could not be found. Are you missing an assembly reference?
+// Line: 21
+
+using static A;
+
+class A : B
+{
+}
+
+class P
+{
+       public class N<T>
+       {
+       }
+}
+
+class Test
+{
+       public static void Main ()
+       {
+               var n = default (N<int>);
+       }
+}
\ No newline at end of file
diff --git a/mcs/errors/cs0815-8.cs b/mcs/errors/cs0815-8.cs
new file mode 100644 (file)
index 0000000..31ed659
--- /dev/null
@@ -0,0 +1,13 @@
+// CS0815: An implicitly typed local variable declaration cannot be initialized with `anonymous method'
+// Line: 11
+
+using System;
+using System.Threading.Tasks;
+
+class X
+{
+       public static void Main ()
+       {
+               Task.Run(async () => { var a = async () => { }; Console.WriteLine(a); });
+       }
+}
\ No newline at end of file
index 12bf992bbcca22df81e61c6adde66b10d3216f3a..010418e470dc7d302d18501c3480ae023d4e12b7 100644 (file)
@@ -1188,6 +1188,9 @@ namespace Mono.CSharp {
                        if (compatibles.TryGetValue (type, out am))
                                return am;
 
+                       if (type == InternalType.ErrorType)
+                               return null;
+
                        TypeSpec delegate_type = CompatibleChecks (ec, type);
                        if (delegate_type == null)
                                return null;
index d7d370893c6af08c8361f1596be6794f3f14533e..14d69f65acd341fb010d3d8bb0c9463847ed425b 100644 (file)
@@ -4727,6 +4727,9 @@ namespace Mono.CSharp {
                                var cand_param = candidate_pd.FixedParameters [j];
                                var best_param = best_pd.FixedParameters [j];
 
+                               if (cand_param.HasDefaultValue != best_param.HasDefaultValue)
+                                       return cand_param.HasDefaultValue;
+
                                if (candidate_pd.Count == best_pd.Count) {
                                        //
                                        // LAMESPEC:
@@ -4734,8 +4737,6 @@ namespace Mono.CSharp {
                                        // void Foo (int i = 0) is better than void Foo (params int[]) for Foo ()
                                        // void Foo (string[] s, string value = null) is better than Foo (string s, params string[]) for Foo (null) or Foo ()
                                        //
-                                       if (cand_param.HasDefaultValue != best_param.HasDefaultValue)
-                                               return cand_param.HasDefaultValue;
 
                                        if (cand_param.HasDefaultValue) {
                                                ++j;
@@ -4749,8 +4750,7 @@ namespace Mono.CSharp {
                                        // void Foo (string s, int i = 0) <-> Foo (string s, byte i = 0)
                                        // void Foo (string s, params int[]) <-> Foo (string s, params byte[])
                                        //
-                                       if (cand_param.HasDefaultValue && best_param.HasDefaultValue)
-                                               return false;
+                                       return false;
                                }
 
                                break;
@@ -7600,6 +7600,7 @@ namespace Mono.CSharp {
                                ec.Report.Error (815, loc,
                                        "An implicitly typed local variable declaration cannot be initialized with `{0}'",
                                        type.GetSignatureForError ());
+                               type = InternalType.ErrorType;
                                return false;
                        }
 
index f4df8c9c44375d7f0307ed0c4fffedf1ce231ca6..40eb0068b2db9dfdf56910b7d64900fa828a6aff 100644 (file)
@@ -11437,19 +11437,19 @@ namespace Mono.CSharp
        //
        public class StackAlloc : Expression {
                TypeSpec otype;
-               Expression t;
+               Expression texpr;
                Expression count;
                
                public StackAlloc (Expression type, Expression count, Location l)
                {
-                       t = type;
+                       texpr = type;
                        this.count = count;
                        loc = l;
                }
 
                public Expression TypeExpression {
                        get {
-                               return this.t;
+                               return texpr;
                        }
                }
 
@@ -11490,7 +11490,7 @@ namespace Mono.CSharp
                                ec.Report.Error (255, loc, "Cannot use stackalloc in finally or catch");
                        }
 
-                       otype = t.ResolveAsType (ec);
+                       otype = texpr.ResolveAsType (ec);
                        if (otype == null)
                                return null;
 
@@ -11522,7 +11522,7 @@ namespace Mono.CSharp
                {
                        StackAlloc target = (StackAlloc) t;
                        target.count = count.Clone (clonectx);
-                       target.t = t.Clone (clonectx);
+                       target.texpr = texpr.Clone (clonectx);
                }
                
                public override object Accept (StructuralVisitor visitor)
index 98254207136904fa18e8867abc8b3fe401c1cf0e..630548ce8d28a7665d7f15a4a23e2820e0eaa862 100644 (file)
@@ -209,14 +209,14 @@ namespace Mono.CSharp
                                Constant c = field_type.Kind == MemberKind.MissingType ?
                                        new NullConstant (InternalType.ErrorType, Location.Null) :
                                        CreateConstantFromValue (field_type, fi);
-                               return new ConstSpec (declaringType, definition, field_type, fi, mod, c);
+                               return new ConstSpec (declaringType, definition, field_type, fi, mod | Modifiers.STATIC, c);
                        }
 
                        if ((fa & FieldAttributes.InitOnly) != 0) {
                                if (field_type.BuiltinType == BuiltinTypeSpec.Type.Decimal) {
                                        var dc = ReadDecimalConstant (CustomAttributeData.GetCustomAttributes (fi));
                                        if (dc != null)
-                                               return new ConstSpec (declaringType, definition, field_type, fi, mod, dc);
+                                               return new ConstSpec (declaringType, definition, field_type, fi, mod | Modifiers.STATIC, dc);
                                }
 
                                mod |= Modifiers.READONLY;
index 4549efbc3ff846832841a6010713570a2c8ecc27..bed7f9e5e7164b027a3101870220ffc2ee03859a 100644 (file)
@@ -1147,10 +1147,7 @@ namespace Mono.CSharp {
                                var better = Namespace.IsImportedTypeOverride (Module, texpr_match.Type, texpr_fne.Type);
                                if (better == null) {
                                        if (mode == LookupMode.Normal) {
-                                               Compiler.Report.SymbolRelatedToPreviousError (texpr_match.Type);
-                                               Compiler.Report.SymbolRelatedToPreviousError (texpr_fne.Type);
-                                               Compiler.Report.Error (104, loc, "`{0}' is an ambiguous reference between `{1}' and `{2}'",
-                                                       name, texpr_match.GetSignatureForError (), texpr_fne.GetSignatureForError ());
+                                               Error_AmbiguousReference (name, texpr_match, texpr_fne, loc);
                                        }
 
                                        return match;
@@ -1160,9 +1157,56 @@ namespace Mono.CSharp {
                                        match = texpr_fne;
                        }
 
+                       if (types_using_table != null) {
+                               foreach (var using_type in types_using_table) {
+                                       var members = MemberCache.FindMembers (using_type, name, true);
+                                       if (members == null)
+                                               continue;
+
+                                       foreach (var member in members) {
+                                               if (arity > 0 && member.Arity != arity)
+                                                       continue;
+                                               
+                                               if ((member.Kind & MemberKind.NestedMask) != 0) {
+                                                       // non-static nested type is included with using static
+                                               } else {
+                                                       if ((member.Modifiers & Modifiers.STATIC) == 0)
+                                                               continue;
+
+                                                       if ((member.Modifiers & Modifiers.METHOD_EXTENSION) != 0)
+                                                               continue;
+
+                                                       if (mode == LookupMode.Normal)
+                                                               throw new NotImplementedException ();
+                                                       
+                                                       return null;
+                                               }
+
+                                               fne = new TypeExpression ((TypeSpec) member, loc);
+                                               if (match == null) {
+                                                       match = fne;
+                                                       continue;
+                                               }
+
+                                               if (mode == LookupMode.Normal) {
+                                                       Error_AmbiguousReference (name, match, fne, loc);
+                                               }
+                                       }
+                               }
+                       }
+
                        return match;
                }
 
+               void Error_AmbiguousReference (string name, FullNamedExpression a, FullNamedExpression b, Location loc)
+               {
+                       var report = Compiler.Report;
+                       report.SymbolRelatedToPreviousError (a.Type);
+                       report.SymbolRelatedToPreviousError (b.Type);
+                       report.Error (104, loc, "`{0}' is an ambiguous reference between `{1}' and `{2}'",
+                               name, a.GetSignatureForError (), b.GetSignatureForError ());
+               }
+
                public static Expression LookupStaticUsings (IMemberContext mc, string name, int arity, Location loc)
                {
                        for (var m = mc.CurrentMemberDefinition; m != null; m = m.Parent) {
@@ -1175,26 +1219,27 @@ namespace Mono.CSharp {
                                if (nc.types_using_table != null) {
                                        foreach (var using_type in nc.types_using_table) {
                                                var members = MemberCache.FindMembers (using_type, name, true);
-                                               if (members != null) {
-                                                       foreach (var member in members) {
-                                                               if ((member.Kind & MemberKind.NestedMask) != 0) {
-                                                                       // non-static nested type is included with using static
-                                                               } else {
-                                                                       if ((member.Modifiers & Modifiers.STATIC) == 0)
-                                                                               continue;
-
-                                                                       if ((member.Modifiers & Modifiers.METHOD_EXTENSION) != 0)
-                                                                               continue;
-                                                               }
-
-                                                               if (arity > 0 && member.Arity != arity)
+                                               if (members == null)
+                                                       continue;
+                                               
+                                               foreach (var member in members) {
+                                                       if ((member.Kind & MemberKind.NestedMask) != 0) {
+                                                               // non-static nested type is included with using static
+                                                       } else {
+                                                               if ((member.Modifiers & Modifiers.STATIC) == 0)
                                                                        continue;
 
-                                                               if (candidates == null)
-                                                                       candidates = new List<MemberSpec> ();
-
-                                                               candidates.Add (member);
+                                                               if ((member.Modifiers & Modifiers.METHOD_EXTENSION) != 0)
+                                                                       continue;
                                                        }
+
+                                                       if (arity > 0 && member.Arity != arity)
+                                                               continue;
+
+                                                       if (candidates == null)
+                                                               candidates = new List<MemberSpec> ();
+
+                                                       candidates.Add (member);
                                                }
                                        }
                                }
index 1d46ab2dab8b87ed13f9e871bd5459a3ee07f6a4..7d95e44efdb433bcd01ea8229d9b719af3b86099 100644 (file)
@@ -548,19 +548,21 @@ namespace Mono.CSharp
                        }
 
                        if (Set == null) {
-                               if ((ModFlags & Modifiers.SEALED) != 0 && base_prop.HasSet && !base_prop.Set.IsAccessible (this)) {
-                                       // TODO: Should be different error code but csc uses for some reason same
-                                       Report.SymbolRelatedToPreviousError (base_prop);
-                                       Report.Error (546, Location,
-                                               "`{0}': cannot override because `{1}' does not have accessible set accessor",
-                                               GetSignatureForError (), base_prop.GetSignatureForError ());
-                                       ok = false;
-                               }
+                               if (base_prop.HasSet) {
+                                       if ((ModFlags & Modifiers.SEALED) != 0 && !base_prop.Set.IsAccessible (this)) {
+                                               // TODO: Should be different error code but csc uses for some reason same
+                                               Report.SymbolRelatedToPreviousError (base_prop);
+                                               Report.Error (546, Location,
+                                                       "`{0}': cannot override because `{1}' does not have accessible set accessor",
+                                                       GetSignatureForError (), base_prop.GetSignatureForError ());
+                                               ok = false;
+                                       }
 
-                               if ((ModFlags & Modifiers.AutoProperty) != 0) {
-                                       Report.Error (8080, Location, "`{0}': Auto-implemented properties must override all accessors of the overridden property",
-                                               GetSignatureForError ());
-                                       ok = false;
+                                       if ((ModFlags & Modifiers.AutoProperty) != 0) {
+                                               Report.Error (8080, Location, "`{0}': Auto-implemented properties must override all accessors of the overridden property",
+                                                       GetSignatureForError ());
+                                               ok = false;
+                                       }
                                }
                        } else {
                                if (!base_prop.HasSet) {
index 6484043543afeb1b25e41905f882f715ae519e2f..2b48661f53923066ef52f1fd15ed5495a815d817 100644 (file)
@@ -17,9 +17,9 @@ public class Test
                object [] field_atts = fields[0].GetCustomAttributes (false);
                if (field_atts.Length != 2)
                        return 2;
-               if (field_atts[0].GetType() != typeof (DebuggerBrowsableAttribute))
+               if (field_atts[1].GetType() != typeof (DebuggerBrowsableAttribute))
                        return 3;
-               if (field_atts[1].GetType() != typeof (CompilerGeneratedAttribute))
+               if (field_atts[0].GetType() != typeof (CompilerGeneratedAttribute))
                        return 4;
                        
                if (fields [0].Name != "<Foo>k__BackingField")
diff --git a/mcs/tests/gtest-autoproperty-17.cs b/mcs/tests/gtest-autoproperty-17.cs
new file mode 100644 (file)
index 0000000..1897e33
--- /dev/null
@@ -0,0 +1,18 @@
+using System;
+
+class MainClass
+{
+       abstract public class Bar
+       {
+               abstract public bool Condition { get; }
+       }
+
+       class Baz: Bar
+       {
+               public override bool Condition { get; } = true;
+       }
+
+       public static void Main (string[] args)
+       {
+       }
+}
index cfbe860a7dc9e52dc174bc43b2879ecf1843a62c..7117ab291e7ce6b4fed42288979c4a60936c1279 100644 (file)
@@ -59,20 +59,30 @@ public class Program
 
        static int Test_6 (params object[] o)
        {
-               return 0;
+               return 1;
        }
 
        static int Test_6 (int i = 1, params object[] a)
        {
-               return 1;
+               return 0;
        }
 
        static int Test_7 (bool b, params object[] o)
        {
-               return 0;
+               return 1;
        }
 
        static int Test_7 (bool b, int i = 1, params object[] a)
+       {
+               return 0;
+       }
+
+       static int Test_8 (Type t, bool b = false, int x = 0)
+       {
+               return 0;
+       }
+
+       static int Test_8 (Type t, params int[] x)
        {
                return 1;
        }
@@ -100,6 +110,9 @@ public class Program
                if (Test_7 (false) != 0)
                        return 7;
 
+               if (Test_8 (typeof (bool)) != 0)
+                       return 8;
+
                Console.WriteLine ("ok");
                return 0;
        }
index 2376311430a67850f0652e333238936258707279..d0fe4b7a07a7e3867f65815af18f0fe09b435a9a 100644 (file)
@@ -26,9 +26,12 @@ public class C
                Test (delegate () {
                        int i = *v.GetUnsafeValue ();
                });
+
+               Test (delegate () {
+                       byte* buffer = stackalloc byte[8192];
+               });
        }
        
-       
        public static void Main ()
        {
                Exception diffException;
diff --git a/mcs/tests/test-static-using-08.cs b/mcs/tests/test-static-using-08.cs
new file mode 100644 (file)
index 0000000..f146050
--- /dev/null
@@ -0,0 +1,17 @@
+using static A;
+//using N = System.Int32;
+
+class A
+{
+       public class N
+       {
+       }
+}
+
+class Test
+{
+       public static void Main ()
+       {
+               N n = default (N); // Am I Int32 or A.N
+       }
+}
\ No newline at end of file
diff --git a/mcs/tests/test-static-using-09-lib.cs b/mcs/tests/test-static-using-09-lib.cs
new file mode 100644 (file)
index 0000000..cd0468b
--- /dev/null
@@ -0,0 +1,6 @@
+// Compiler options: -t:library
+
+public static class Constants
+{
+       public const long One = 1;
+}
\ No newline at end of file
diff --git a/mcs/tests/test-static-using-09.cs b/mcs/tests/test-static-using-09.cs
new file mode 100644 (file)
index 0000000..993fd8d
--- /dev/null
@@ -0,0 +1,11 @@
+// Compiler options: -r:test-static-using-09-lib.dll
+
+using static Constants;
+
+static class Program
+{
+       static void Main ()
+       {
+               System.Console.WriteLine (One);
+       }
+}
\ No newline at end of file
diff --git a/mcs/tests/test-static-using-10.cs b/mcs/tests/test-static-using-10.cs
new file mode 100644 (file)
index 0000000..50f9d35
--- /dev/null
@@ -0,0 +1,24 @@
+namespace A
+{
+       public class T
+       {
+               public class N
+               {
+
+               }
+       }
+}
+
+namespace B
+{
+       using static A.T;
+
+       static class Program
+       {
+               static void Main ()
+               {
+                       var t = typeof (N);
+                       var u = new N ();
+               }
+       }
+}
index 9e8bdce22c8c3bf8b2306fbd846654fbcf1f7cf5..288ea3a6032608bf781b0b08690581ae549621e7 100644 (file)
       </method>
     </type>
   </test>
+  <test name="gtest-autoproperty-17.cs">
+    <type name="MainClass">
+      <method name="Void Main(System.String[])" attrs="150">
+        <size>2</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+    <type name="MainClass+Bar">
+      <method name="Boolean get_Condition()" attrs="3526">
+        <size>0</size>
+      </method>
+      <method name="Void .ctor()" attrs="6276">
+        <size>7</size>
+      </method>
+    </type>
+    <type name="MainClass+Baz">
+      <method name="Boolean get_Condition()" attrs="2246">
+        <size>14</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>14</size>
+      </method>
+    </type>
+  </test>
   <test name="gtest-collectioninit-01.cs">
     <type name="Test">
       <method name="Void TestList(System.Collections.Generic.List`1[System.Int32], Int32)" attrs="145">
         <size>10</size>
       </method>
       <method name="Int32 Main()" attrs="150">
-        <size>161</size>
+        <size>192</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
       </method>
+      <method name="Int32 Test_8(System.Type, Boolean, Int32)" attrs="145">
+        <size>10</size>
+      </method>
+      <method name="Int32 Test_8(System.Type, Int32[])" attrs="145">
+        <size>10</size>
+      </method>
     </type>
   </test>
   <test name="gtest-optional-10.cs">
     </type>
     <type name="C">
       <method name="Void UnsafeTests()" attrs="145">
-        <size>36</size>
+        <size>70</size>
       </method>
       <method name="Void Main()" attrs="150">
         <size>99</size>
       </method>
     </type>
     <type name="C">
-      <method name="Void &lt;Main&gt;m__0()" attrs="145">
+      <method name="Void &lt;UnsafeTests&gt;m__0()" attrs="145">
+        <size>12</size>
+      </method>
+      <method name="Void &lt;Main&gt;m__1()" attrs="145">
         <size>17</size>
       </method>
     </type>
       </method>
     </type>
   </test>
+  <test name="test-static-using-08.cs">
+    <type name="A">
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+    <type name="A+N">
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+    <type name="Test">
+      <method name="Void Main()" attrs="150">
+        <size>4</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
+  <test name="test-static-using-09.cs">
+    <type name="Program">
+      <method name="Void Main()" attrs="145">
+        <size>9</size>
+      </method>
+    </type>
+  </test>
+  <test name="test-static-using-10.cs">
+    <type name="A.T">
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+    <type name="A.T+N">
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+    <type name="B.Program">
+      <method name="Void Main()" attrs="145">
+        <size>19</size>
+      </method>
+    </type>
+  </test>
   <test name="test-var-01.cs">
     <type name="Test">
       <method name="Int32 Main()" attrs="150">
index b6276ac2490d3fa84f7b6297386aa13378685406..b47f8603c5a3faca95020602390ee59bc5f52643 100644 (file)
@@ -288,9 +288,25 @@ namespace Mono.Linker.Steps {
                // even if we (just before saving) will resolve all type references (bug #26752)
                void MarkWithResolvedScope (TypeReference type)
                {
-                       // we cannot set the Scope of a TypeSpecification so there's no point in resolving it
-                       if ((type == null) || (type is TypeSpecification))
+                       if (type == null)
+                               return;
+
+                       // a GenericInstanceType can could contains generic arguments with scope that
+                       // needs to be updated out of the PCL facade (bug #28823)
+                       var git = (type as GenericInstanceType);
+                       if ((git != null) && git.HasGenericArguments) {
+                               foreach (var ga in git.GenericArguments)
+                                       MarkWithResolvedScope (ga);
                                return;
+                       }
+                       // we cannot set the Scope of a TypeSpecification but it's element type can be set
+                       // e.g. System.String[] -> System.String
+                       var ts = (type as TypeSpecification);
+                       if (ts != null) {
+                               MarkWithResolvedScope (ts.GetElementType ());
+                               return;
+                       }
+
                        var td = type.Resolve ();
                        if (td != null)
                                type.Scope = td.Scope;
index 05c24763cdeaed4ac7bfc12aa0b87e441e5792e0..949f3e59663186f07097e723e8577a8f6f4b4134 100644 (file)
@@ -41,8 +41,12 @@ install-bin-data:
 install-frameworks:
        $(MKINSTALLDIRS) $(DESTDIR)$(NETFRAMEWORK_DIR)/v$(FRAMEWORK_VERSION)/RedistList
        $(INSTALL_DATA) frameworks/net_$(FRAMEWORK_VERSION).xml $(DESTDIR)$(NETFRAMEWORK_DIR)/v$(FRAMEWORK_VERSION)/RedistList/FrameworkList.xml
+       $(MKINSTALLDIRS) $(DESTDIR)$(NETFRAMEWORK_DIR)/v2.0/RedistList
+       $(INSTALL_DATA) frameworks/net_2.0.xml $(DESTDIR)$(NETFRAMEWORK_DIR)/v2.0/RedistList/FrameworkList.xml
        $(MKINSTALLDIRS) $(DESTDIR)$(NETFRAMEWORK_DIR)/v3.0/RedistList
        $(INSTALL_DATA) frameworks/net_3.0.xml $(DESTDIR)$(NETFRAMEWORK_DIR)/v3.0/RedistList/FrameworkList.xml
+       $(MKINSTALLDIRS) $(DESTDIR)$(NETFRAMEWORK_DIR)/v3.5/RedistList
+       $(INSTALL_DATA) frameworks/net_3.5.xml $(DESTDIR)$(NETFRAMEWORK_DIR)/v3.5/RedistList/FrameworkList.xml
        $(MKINSTALLDIRS) $(DESTDIR)$(NETFRAMEWORK_DIR)/v4.0/RedistList
        $(INSTALL_DATA) frameworks/net_4.0.xml $(DESTDIR)$(NETFRAMEWORK_DIR)/v4.0/RedistList/FrameworkList.xml
        $(MKINSTALLDIRS) $(DESTDIR)$(NETFRAMEWORK_DIR)/v4.0/Profile/Client/RedistList
index aba4cfa286e0bf687be52c8918a83d261189b0fc..a94157c8584e0c600ff49e78106925cd1016a822 100644 (file)
@@ -65,6 +65,7 @@
                        OptionExplicit="$(OptionExplicit)"
                        OptionStrict="$(OptionStrict)"
                        OptionStrictType="$(OptionStrictType)"
+                       OptionInfer="$(OptionInfer)"
                        OutputAssembly="@(IntermediateAssembly)"
                        Platform="$(PlatformTarget)"
                        References="@(ResolvedFiles)"
@@ -77,6 +78,7 @@
                        TreatWarningsAsErrors="$(TreatWarningsAsErrors)"
                        UseHostCompilerIfAvailable="$(UseHostCompilerIfAvailable)"
                        Utf8Output="$(Utf8Output)"
+                       VBRuntime="$(VBRuntime)"
                        Verbosity="$(VbcVerbosity)"
                        WarningsAsErrors="$(WarningsAsErrors)"
                        WarningsNotAsErrors="$(WarningsNotAsErrors)"
diff --git a/mono-core.spec.in b/mono-core.spec.in
deleted file mode 100644 (file)
index 04c4e32..0000000
+++ /dev/null
@@ -1,1518 +0,0 @@
-%{!?ext_man: %define ext_man .gz}
-%define llvm no
-%define sgen yes
-
-%ifnarch %ix86 x86_64
-%define llvm no
-%endif
-
-%ifnarch %ix86 x86_64 s390x
-%define sgen no
-%endif
-
-Name:           mono-core
-License:        LGPL v2.1 only
-Group:          Development/Languages/Mono
-Summary:        A .NET Runtime Environment
-Url:            http://www.mono-project.com
-Version:        @VERSION@
-Release:        0
-Source0:        mono-%{version}.tar.bz2
-BuildRequires:  bison
-%if 0%{?suse_version}
-BuildRequires:  fdupes
-BuildRequires:  xorg-x11-libX11-devel
-%else
-BuildRequires: libX11-devel
-%endif
-BuildRequires:  gcc-c++
-BuildRequires:  pkgconfig
-BuildRequires:  zlib-devel
-%ifnarch ia64
-BuildRequires:  valgrind-devel
-%endif
-%if %llvm == yes
-BuildRequires:  llvm-mono-devel
-%endif
-BuildRoot:      %{_tmppath}/%{name}-%{version}-build
-Obsoletes:      mono
-Obsoletes:      mono-cairo
-Obsoletes:      mono-drawing
-Obsoletes:      mono-ikvm
-Obsoletes:      mono-posix
-Obsoletes:      mono-xml-relaxng
-Obsoletes:      mono-ziplib
-Provides:       mono = %{version}-%{release}
-Provides:       mono-cairo
-Provides:       mono-drawing
-Provides:       mono-ikvm
-Provides:       mono-posix
-Provides:       mono-xml-relaxng
-Provides:       mono-ziplib
-# This version of mono has issues with the following versions of apps:
-#  (not because of regressions, but because bugfixes in mono uncover bugs in the apps)
-Conflicts:      banshee < 1.0
-Conflicts:      f-spot < 0.4
-Conflicts:      helix-banshee < 1.0
-Conflicts:      mono-addins < 0.3.1
-%if 0%{?suse_version}
-Recommends:     libgdiplus0 >= 2.6
-%endif
-%if %llvm == yes
-Recommends:     libmono-llvm0 = %{version}-%{release}
-%endif
-Provides:       mono(Commons.Xml.Relaxng) = 1.0.5000.0
-Provides:       mono(CustomMarshalers) = 1.0.5000.0
-Provides:       mono(I18N) = 1.0.5000.0
-Provides:       mono(I18N.West) = 1.0.5000.0
-Provides:       mono(ICSharpCode.SharpZipLib) = 0.6.0.0
-Provides:       mono(ICSharpCode.SharpZipLib) = 0.84.0.0
-Provides:       mono(Mono.Cairo) = 1.0.5000.0
-Provides:       mono(Mono.CompilerServices.SymbolWriter) = 1.0.5000.0
-Provides:       mono(Mono.Posix) = 1.0.5000.0
-Provides:       mono(Mono.Security) = 1.0.5000.0
-Provides:       mono(System) = 1.0.5000.0
-Provides:       mono(System.Security) = 1.0.5000.0
-Provides:       mono(System.Xml) = 1.0.5000.0
-Provides:       mono(mscorlib) = 1.0.5000.0
-
-%define _use_internal_dependency_generator 0
-%define __find_provides env sh -c 'filelist=($(cat)) && { printf "%s\\n" "${filelist[@]}" | /usr/lib/rpm/find-provides && printf "%s\\n" "${filelist[@]}" | prefix=%{buildroot}%{_prefix} %{buildroot}%{_bindir}/mono-find-provides ; } | sort | uniq'
-%define __find_requires env sh -c 'filelist=($(cat)) && { printf "%s\\n" "${filelist[@]}" | /usr/lib/rpm/find-requires && printf "%s\\n" "${filelist[@]}" | prefix=%{buildroot}%{_prefix} %{buildroot}%{_bindir}/mono-find-requires ; } | sort | uniq'
-
-%description
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-%prep
-%setup -q -n mono-%{version}
-
-%build
-# These are only needed if there are patches to the runtime
-#rm -f libgc/libtool.m4
-#autoreconf --force --install
-#autoreconf --force --install libgc
-export CFLAGS=" $RPM_OPT_FLAGS -fno-strict-aliasing"
-# distro specific configure options
-%if %llvm == yes
-export PATH=/opt/novell/llvm-mono/bin:$PATH
-%endif
-%configure \
-  --target=%{_host} \
-  --with-sgen=%{sgen} \
-%if %llvm == yes
-  --enable-loadedllvm \
-  --disable-system-aot \
-%endif
-%ifnarch %ix86 x86_64
-  --disable-system-aot \
-%endif
-  --with-ikvm=yes \
-  --with-moonlight=no
-#make # We are not -jN safe! %{?jobs:-j%jobs}
-# We are now !
-make get-monolite-latest
-make %{?_smp_mflags}
-
-%install
-make install DESTDIR=%buildroot
-# remove .la files (they are generally bad news)
-rm -f %buildroot%_libdir/*.la
-# remove Windows-only stuff
-rm -rf %buildroot%_prefix/lib/mono/*/Mono.Security.Win32*
-rm -f %buildroot%_libdir/libMonoSupportW.*
-# remove .a files for libraries that are really only for us
-rm -f %buildroot%_libdir/libMonoPosixHelper.a
-rm -f %buildroot%_libdir/libikvm-native.a
-rm -f %buildroot%_libdir/libmono-llvm.a
-# remove libgc cruft
-rm -rf %buildroot%_datadir/libgc-mono
-# remove stuff that we don't package
-rm -f %buildroot%_bindir/cilc
-rm -f %buildroot%_mandir/man1/cilc.1*
-rm -f %buildroot%_prefix/lib/mono/*/browsercaps-updater.exe*
-rm -f %buildroot%_prefix/lib/mono/*/culevel.exe*
-rm -f %buildroot%_prefix/lib/mono/2.0/cilc.exe*
-# brp-compress doesn't search _mandir
-# so we cheat it
-ln -s . %buildroot%_prefix%_prefix
-RPM_BUILD_ROOT=%buildroot%_prefix /usr/lib/rpm/brp-compress
-rm %buildroot%_prefix%_prefix
-%if 0%{?suse_version}
-%fdupes %buildroot%_prefix
-%endif
-%find_lang mcs
-
-%clean
-rm -rf %buildroot
-
-%files -f mcs.lang
-%defattr(-, root, root)
-%doc AUTHORS COPYING.LIB ChangeLog NEWS README.md
-%config %_sysconfdir/mono/2.0/machine.config
-%config %_sysconfdir/mono/2.0/settings.map
-%config %_sysconfdir/mono/4.0/machine.config
-%config %_sysconfdir/mono/4.0/settings.map
-%config %_sysconfdir/mono/4.5/machine.config
-%config %_sysconfdir/mono/4.5/settings.map
-%config %_sysconfdir/mono/config
-%dir %_prefix/lib/mono
-%dir %_prefix/lib/mono/2.0
-%dir %_prefix/lib/mono/3.5
-%dir %_prefix/lib/mono/4.0
-%dir %_prefix/lib/mono/4.5
-%dir %_prefix/lib/mono/compat-2.0
-%dir %_prefix/lib/mono/gac
-%dir %_sysconfdir/mono
-%dir %_sysconfdir/mono/2.0
-%dir %_sysconfdir/mono/4.0
-%dir %_sysconfdir/mono/4.5
-%_bindir/al
-%_bindir/al2
-%_bindir/certmgr
-%_bindir/chktrust
-%_bindir/crlupdate
-%_bindir/csharp
-%_bindir/dmcs
-%_bindir/gacutil
-%_bindir/gacutil2
-%_bindir/ikdasm
-%_bindir/mcs
-%_bindir/mono
-%_bindir/mono-configuration-crypto
-%if %sgen == yes
-%_bindir/mono-sgen
-%endif
-%_bindir/mono-boehm
-%_bindir/mono-test-install
-%_bindir/mozroots
-%_bindir/peverify
-%_bindir/setreg
-%_bindir/sn
-%_libdir/libMonoPosixHelper.so*
-%_libdir/libikvm-native.so
-%_mandir/man1/certmgr.1%ext_man
-%_mandir/man1/chktrust.1%ext_man
-%_mandir/man1/crlupdate.1%ext_man
-%_mandir/man1/csharp.1%ext_man
-%_mandir/man1/gacutil.1%ext_man
-%_mandir/man1/mcs.1%ext_man
-%_mandir/man1/mono-configuration-crypto.1%ext_man
-%_mandir/man1/mono.1%ext_man
-%_mandir/man1/mozroots.1%ext_man
-%_mandir/man1/setreg.1%ext_man
-%_mandir/man1/sn.1%ext_man
-%_mandir/man5/mono-config.5%ext_man
-%_prefix/lib/mono/2.0/Commons.Xml.Relaxng.dll
-%_prefix/lib/mono/2.0/CustomMarshalers.dll
-%_prefix/lib/mono/2.0/I18N.West.dll
-%_prefix/lib/mono/2.0/I18N.dll
-%_prefix/lib/mono/2.0/ICSharpCode.SharpZipLib.dll
-%_prefix/lib/mono/2.0/Microsoft.VisualC.dll
-%_prefix/lib/mono/2.0/Mono.C5.dll
-%_prefix/lib/mono/2.0/Mono.CSharp.dll
-%_prefix/lib/mono/2.0/Mono.Cairo.dll
-%_prefix/lib/mono/2.0/Mono.CompilerServices.SymbolWriter.dll
-%_prefix/lib/mono/2.0/Mono.Management.dll
-%_prefix/lib/mono/2.0/Mono.Posix.dll
-%_prefix/lib/mono/2.0/Mono.Security.dll
-%_prefix/lib/mono/2.0/Mono.Simd.dll
-%_prefix/lib/mono/2.0/Mono.Tasklets.dll
-%_prefix/lib/mono/2.0/System.Configuration.dll
-%_prefix/lib/mono/2.0/System.Core.dll
-%_prefix/lib/mono/2.0/System.Drawing.dll
-%_prefix/lib/mono/2.0/System.Net.dll
-%_prefix/lib/mono/2.0/System.Security.dll
-%_prefix/lib/mono/2.0/System.Xml.Linq.dll
-%_prefix/lib/mono/2.0/System.Xml.dll
-%_prefix/lib/mono/2.0/System.dll
-%_prefix/lib/mono/2.0/System.Json.dll
-%_prefix/lib/mono/2.0/al.exe*
-%_prefix/lib/mono/2.0/cscompmgd.dll
-%_prefix/lib/mono/2.0/gacutil.exe*
-%_prefix/lib/mono/2.0/mscorlib.dll*
-%_prefix/lib/mono/4.0/Commons.Xml.Relaxng.dll
-%_prefix/lib/mono/4.0/CustomMarshalers.dll
-%_prefix/lib/mono/4.0/I18N.West.dll
-%_prefix/lib/mono/4.0/I18N.dll
-%_prefix/lib/mono/4.0/ICSharpCode.SharpZipLib.dll
-%_prefix/lib/mono/4.0/Microsoft.CSharp.dll
-%_prefix/lib/mono/4.0/Microsoft.VisualC.dll
-%_prefix/lib/mono/4.0/Mono.C5.dll
-%_prefix/lib/mono/4.0/Mono.CSharp.dll
-%_prefix/lib/mono/4.0/Mono.Cairo.dll
-%_prefix/lib/mono/4.0/Mono.CompilerServices.SymbolWriter.dll
-%_prefix/lib/mono/4.0/Mono.Management.dll
-%_prefix/lib/mono/4.0/Mono.Parallel.dll
-%_prefix/lib/mono/4.0/Mono.Posix.dll
-%_prefix/lib/mono/4.0/Mono.Security.dll
-%_prefix/lib/mono/4.0/Mono.Simd.dll
-%_prefix/lib/mono/4.0/Mono.Tasklets.dll
-%_prefix/lib/mono/4.0/System.Configuration.dll
-%_prefix/lib/mono/4.0/System.Core.dll
-%_prefix/lib/mono/4.0/System.Drawing.dll
-%_prefix/lib/mono/4.0/System.Dynamic.dll
-%_prefix/lib/mono/4.0/System.Json.dll
-%_prefix/lib/mono/4.0/System.Json.Microsoft.dll
-%_prefix/lib/mono/4.0/System.Net.dll
-%_prefix/lib/mono/4.0/System.Numerics.dll
-%_prefix/lib/mono/4.0/System.Security.dll
-%_prefix/lib/mono/4.0/System.Xml.Linq.dll
-%_prefix/lib/mono/4.0/System.Xml.dll
-%_prefix/lib/mono/4.0/System.dll
-%_prefix/lib/mono/4.5/al.exe*
-%_prefix/lib/mono/4.5/certmgr.exe*
-%_prefix/lib/mono/4.5/chktrust.exe*
-%_prefix/lib/mono/4.5/crlupdate.exe*
-%_prefix/lib/mono/4.0/cscompmgd.dll
-%_prefix/lib/mono/4.5/csharp.exe*
-%_prefix/lib/mono/4.5/gacutil.exe*
-%_prefix/lib/mono/4.5/ikdasm.exe*
-%_prefix/lib/mono/4.5/mcs.exe*
-%_prefix/lib/mono/4.5/mozroots.exe*
-%_prefix/lib/mono/4.0/mscorlib.dll*
-%_prefix/lib/mono/4.5/setreg.exe*
-%_prefix/lib/mono/4.5/sn.exe*
-%_prefix/lib/mono/4.5/Commons.Xml.Relaxng.dll
-%_prefix/lib/mono/4.5/CustomMarshalers.dll
-%_prefix/lib/mono/4.5/I18N.CJK.dll
-%_prefix/lib/mono/4.5/I18N.MidEast.dll
-%_prefix/lib/mono/4.5/I18N.Other.dll
-%_prefix/lib/mono/4.5/I18N.Rare.dll
-%_prefix/lib/mono/4.5/I18N.West.dll
-%_prefix/lib/mono/4.5/I18N.dll
-%_prefix/lib/mono/4.5/IBM.Data.DB2.dll
-%_prefix/lib/mono/4.5/ICSharpCode.SharpZipLib.dll
-%_prefix/lib/mono/4.5/Microsoft.CSharp.dll
-%_prefix/lib/mono/4.5/Microsoft.VisualC.dll
-%_prefix/lib/mono/4.5/Mono.C5.dll
-%_prefix/lib/mono/4.5/Mono.CSharp.dll
-%_prefix/lib/mono/4.5/Mono.Cairo.dll
-%_prefix/lib/mono/4.5/Mono.CompilerServices.SymbolWriter.dll
-%_prefix/lib/mono/4.5/Mono.Management.dll
-%_prefix/lib/mono/4.5/Mono.Parallel.dll
-%_prefix/lib/mono/4.5/Mono.Posix.dll
-%_prefix/lib/mono/4.5/Mono.Security.dll
-%_prefix/lib/mono/4.5/Mono.Simd.dll
-%_prefix/lib/mono/4.5/Mono.Tasklets.dll
-%_prefix/lib/mono/4.5/System.Configuration.dll
-%_prefix/lib/mono/4.5/System.Core.dll
-%_prefix/lib/mono/4.5/System.Drawing.dll
-%_prefix/lib/mono/4.5/System.Dynamic.dll
-%_prefix/lib/mono/4.5/System.IO.Compression.dll
-%_prefix/lib/mono/4.5/System.IO.Compression.FileSystem.dll
-%_prefix/lib/mono/4.5/System.Json.dll
-%_prefix/lib/mono/4.5/System.Json.Microsoft.dll
-%_prefix/lib/mono/4.5/System.Net.dll
-%_prefix/lib/mono/4.5/System.Net.Http.dll
-%_prefix/lib/mono/4.5/System.Net.Http.WebRequest.dll
-%_prefix/lib/mono/4.5/System.Numerics.dll
-%_prefix/lib/mono/4.5/System.Security.dll
-%_prefix/lib/mono/4.5/System.Threading.Tasks.Dataflow.dll
-%_prefix/lib/mono/4.5/System.Xml.Linq.dll
-%_prefix/lib/mono/4.5/System.Xml.dll
-%_prefix/lib/mono/4.5/System.dll
-%_prefix/lib/mono/4.5/cscompmgd.dll
-%_prefix/lib/mono/4.5/mscorlib.dll*
-%_prefix/lib/mono/4.5/System.Windows.dll
-%_prefix/lib/mono/4.5/System.Xml.Serialization.dll
-%_prefix/lib/mono/4.5/Facades/*.dll
-%_prefix/lib/mono/compat-2.0/ICSharpCode.SharpZipLib.dll
-%_prefix/lib/mono/gac/Commons.Xml.Relaxng
-%_prefix/lib/mono/gac/CustomMarshalers
-%_prefix/lib/mono/gac/I18N
-%_prefix/lib/mono/gac/I18N.West
-%_prefix/lib/mono/gac/ICSharpCode.SharpZipLib
-%_prefix/lib/mono/gac/Microsoft.CSharp
-%_prefix/lib/mono/gac/Microsoft.VisualC
-%_prefix/lib/mono/gac/Mono.C5
-%_prefix/lib/mono/gac/Mono.CSharp
-%_prefix/lib/mono/gac/Mono.Cairo
-%_prefix/lib/mono/gac/Mono.Cecil
-%_prefix/lib/mono/gac/Mono.Cecil.Mdb
-%_prefix/lib/mono/gac/Mono.CompilerServices.SymbolWriter
-%_prefix/lib/mono/gac/Mono.Management
-%_prefix/lib/mono/gac/Mono.Parallel
-%_prefix/lib/mono/gac/Mono.Posix
-%_prefix/lib/mono/gac/Mono.Security
-%_prefix/lib/mono/gac/Mono.Simd
-%_prefix/lib/mono/gac/Mono.Tasklets
-%_prefix/lib/mono/gac/System
-%_prefix/lib/mono/gac/System.Configuration
-%_prefix/lib/mono/gac/System.Core
-%_prefix/lib/mono/gac/System.Drawing
-%_prefix/lib/mono/gac/System.Dynamic
-%_prefix/lib/mono/gac/System.IO.Compression
-%_prefix/lib/mono/gac/System.IO.Compression.FileSystem
-%_prefix/lib/mono/gac/System.Net
-%_prefix/lib/mono/gac/System.Net.Http
-%_prefix/lib/mono/gac/System.Net.Http.WebRequest
-%_prefix/lib/mono/gac/System.Numerics
-%_prefix/lib/mono/gac/System.Security
-%_prefix/lib/mono/gac/System.Threading.Tasks.Dataflow
-%_prefix/lib/mono/gac/System.Xml
-%_prefix/lib/mono/gac/System.Xml.Linq
-%_prefix/lib/mono/gac/System.Json
-%_prefix/lib/mono/gac/System.Json.Microsoft
-%_prefix/lib/mono/gac/System.Windows
-%_prefix/lib/mono/gac/System.Xml.Serialization
-%_prefix/lib/mono/gac/cscompmgd
-%_prefix/lib/mono/mono-configuration-crypto
-
-%package -n libmono-2_0-1
-License:        LGPL v2.1 only
-Summary:       A Library for embedding Mono in your Application
-Group:          Development/Libraries/C and C++
-
-%description -n libmono-2_0-1
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-A Library for embedding Mono in your Application.
-
-%files -n libmono-2_0-1
-%defattr(-, root, root)
-%_libdir/libmono-2.0.so.1*
-
-%post -n libmono-2_0-1 -p /sbin/ldconfig
-
-%postun -n libmono-2_0-1 -p /sbin/ldconfig
-
-%package -n libmono-2_0-devel
-License:        LGPL v2.1 only
-Summary:       Development files for libmono
-Group:          Development/Languages/Mono
-Requires:       mono-core == %version-%release
-
-%description -n libmono-2_0-devel
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Development files for libmono.
-
-%files -n libmono-2_0-devel
-%defattr(-, root, root)
-%_bindir/mono-gdb.py
-%_includedir/mono-2.0
-%_libdir/libmono-2.0.a
-%_libdir/libmono-2.0.so
-%_libdir/pkgconfig/mono-2.pc
-
-%if %sgen == yes
-%package -n libmonosgen-2_0-1
-License:        LGPL v2.1 only
-Summary:       A Library for embedding Mono in your Application (sgen version)
-Group:          Development/Libraries/C and C++
-
-%description -n libmonosgen-2_0-1
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-A Library for embedding Mono in your Application (sgen version).
-
-%files -n libmonosgen-2_0-1
-%defattr(-, root, root)
-%_libdir/libmonosgen-2.0.so.1*
-
-%post -n libmonosgen-2_0-1 -p /sbin/ldconfig
-
-%postun -n libmonosgen-2_0-1 -p /sbin/ldconfig
-
-%package -n libmonosgen-2_0-devel
-License:        LGPL v2.1 only
-Summary:       Development files for libmonosgen
-Group:          Development/Languages/Mono
-Requires:       mono-core == %version-%release
-Requires:       libmono-2_0-devel
-
-%description -n libmonosgen-2_0-devel
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Development files for libmonosgen.
-
-%files -n libmonosgen-2_0-devel
-%defattr(-, root, root)
-%_bindir/mono-sgen-gdb.py
-%_libdir/libmonosgen-2.0.a
-%_libdir/libmonosgen-2.0.so
-%_libdir/pkgconfig/monosgen-2.pc
-%endif
-
-%package -n libmonoboehm-2_0-1
-License:        LGPL v2.1 only
-Summary:       A Library for embedding Mono in your Application (boehm version)
-Group:          Development/Libraries/C and C++
-
-%description -n libmonoboehm-2_0-1
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-A Library for embedding Mono in your Application (boehm version).
-
-%files -n libmonoboehm-2_0-1
-%defattr(-, root, root)
-%_libdir/libmonoboehm-2.0.so.1*
-
-%post -n libmonoboehm-2_0-1 -p /sbin/ldconfig
-
-%postun -n libmonoboehm-2_0-1 -p /sbin/ldconfig
-
-%package -n libmonoboehm-2_0-devel
-License:        LGPL v2.1 only
-Summary:       Development files for libmonosgen
-Group:          Development/Languages/Mono
-Requires:       mono-core == %version-%release
-Requires:       libmono-2_0-devel
-
-%description -n libmonoboehm-2_0-devel
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Development files for libmonoboehm.
-
-%files -n libmonoboehm-2_0-devel
-%defattr(-, root, root)
-%_libdir/libmonoboehm-2.0.a
-%_libdir/libmonoboehm-2.0.so
-
-%if %llvm == yes
-%package -n libmono-llvm0
-License:        LGPL v2.1 only
-Summary:       Loadable LLVM libary for mono
-Group:          Development/Libraries/C and C++
-
-%description -n libmono-llvm0
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Loadable LLVM libary for mono.
-
-%files -n libmono-llvm0
-%defattr(-, root, root)
-%_libdir/libmono-llvm.so*
-
-%post -n libmono-llvm0 -p /sbin/ldconfig
-
-%postun -n libmono-llvm0 -p /sbin/ldconfig
-%endif
-
-%package -n mono-locale-extras
-License:        LGPL v2.1 only
-Summary:        Extra locale information
-Group:          Development/Languages/Mono
-Requires:       mono-core == %version-%release
-Provides:       mono(I18N.CJK) = 1.0.5000.0
-Provides:       mono(I18N.MidEast) = 1.0.5000.0
-Provides:       mono(I18N.Other) = 1.0.5000.0
-Provides:       mono(I18N.Rare) = 1.0.5000.0
-
-%description -n mono-locale-extras
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Extra locale information.
-
-%files -n mono-locale-extras
-%defattr(-, root, root)
-%_prefix/lib/mono/2.0/I18N.CJK.dll
-%_prefix/lib/mono/2.0/I18N.MidEast.dll
-%_prefix/lib/mono/2.0/I18N.Other.dll
-%_prefix/lib/mono/2.0/I18N.Rare.dll
-%_prefix/lib/mono/4.0/I18N.CJK.dll
-%_prefix/lib/mono/4.0/I18N.MidEast.dll
-%_prefix/lib/mono/4.0/I18N.Other.dll
-%_prefix/lib/mono/4.0/I18N.Rare.dll
-%_prefix/lib/mono/4.5/I18N.CJK.dll
-%_prefix/lib/mono/4.5/I18N.MidEast.dll
-%_prefix/lib/mono/4.5/I18N.Other.dll
-%_prefix/lib/mono/4.5/I18N.Rare.dll
-%_prefix/lib/mono/gac/I18N.CJK
-%_prefix/lib/mono/gac/I18N.MidEast
-%_prefix/lib/mono/gac/I18N.Other
-%_prefix/lib/mono/gac/I18N.Rare
-
-%package -n mono-data
-License:        LGPL v2.1 only
-Summary:        Database connectivity for Mono
-Group:          Development/Languages/Mono
-Requires:       mono-core == %version-%release
-Obsoletes:      mono-directory
-Obsoletes:      mono-ms-enterprise
-Obsoletes:      mono-novell-directory
-Provides:       mono-directory
-Provides:       mono-ms-enterprise
-Provides:       mono-novell-directory
-Provides:       mono(Mono.Data.Tds) = 1.0.5000.0
-Provides:       mono(Novell.Directory.Ldap) = 1.0.5000.0
-Provides:       mono(System.Data) = 1.0.5000.0
-Provides:       mono(System.DirectoryServices) = 1.0.5000.0
-Provides:       mono(System.DirectoryServices.Protocols) = 1.0.5000.0
-Provides:       mono(System.EnterpriseServices) = 1.0.5000.0
-
-%description -n mono-data
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Database connectivity for Mono.
-
-%files -n mono-data
-%defattr(-, root, root)
-%_bindir/sqlmetal
-%_bindir/sqlsharp
-%_mandir/man1/sqlsharp.1%ext_man
-%_prefix/lib/mono/2.0/Mono.Data.Tds.dll
-%_prefix/lib/mono/2.0/Novell.Directory.Ldap.dll
-%_prefix/lib/mono/2.0/System.Data.DataSetExtensions.dll
-%_prefix/lib/mono/2.0/System.Data.Linq.dll
-%_prefix/lib/mono/2.0/System.Data.dll
-%_prefix/lib/mono/2.0/System.DirectoryServices.dll
-%_prefix/lib/mono/2.0/System.DirectoryServices.Protocols.dll
-%_prefix/lib/mono/2.0/System.EnterpriseServices.dll
-%_prefix/lib/mono/2.0/System.Runtime.Serialization.dll
-%_prefix/lib/mono/2.0/System.Transactions.dll
-%_prefix/lib/mono/4.0/Mono.Data.Tds.dll
-%_prefix/lib/mono/4.0/Novell.Directory.Ldap.dll
-%_prefix/lib/mono/4.0/System.Data.DataSetExtensions.dll
-%_prefix/lib/mono/4.0/System.Data.Linq.dll
-%_prefix/lib/mono/4.0/System.Data.dll
-%_prefix/lib/mono/4.0/System.DirectoryServices.dll
-%_prefix/lib/mono/4.0/System.DirectoryServices.Protocols.dll
-%_prefix/lib/mono/4.0/System.EnterpriseServices.dll
-%_prefix/lib/mono/4.0/System.Runtime.Serialization.dll
-%_prefix/lib/mono/4.0/System.Transactions.dll
-%_prefix/lib/mono/4.0/WebMatrix.Data.dll
-%_prefix/lib/mono/4.5/Mono.Data.Tds.dll
-%_prefix/lib/mono/4.5/Novell.Directory.Ldap.dll
-%_prefix/lib/mono/4.5/System.Data.DataSetExtensions.dll
-%_prefix/lib/mono/4.5/System.Data.Linq.dll
-%_prefix/lib/mono/4.5/System.Data.dll
-%_prefix/lib/mono/4.5/System.DirectoryServices.dll
-%_prefix/lib/mono/4.5/System.DirectoryServices.Protocols.dll
-%_prefix/lib/mono/4.5/System.EnterpriseServices.dll
-%_prefix/lib/mono/4.5/System.Runtime.Serialization.dll
-%_prefix/lib/mono/4.5/System.Transactions.dll
-%_prefix/lib/mono/4.5/WebMatrix.Data.dll
-%_prefix/lib/mono/4.5/EntityFramework.dll
-%_prefix/lib/mono/4.5/EntityFramework.SqlServer.dll
-%_prefix/lib/mono/4.5/sqlmetal.exe*
-%_prefix/lib/mono/4.5/sqlsharp.exe*
-%_prefix/lib/mono/gac/Mono.Data.Tds
-%_prefix/lib/mono/gac/Novell.Directory.Ldap
-%_prefix/lib/mono/gac/System.Data
-%_prefix/lib/mono/gac/System.Data.DataSetExtensions
-%_prefix/lib/mono/gac/System.Data.Linq
-%_prefix/lib/mono/gac/System.DirectoryServices
-%_prefix/lib/mono/gac/System.DirectoryServices.Protocols
-%_prefix/lib/mono/gac/System.EnterpriseServices
-%_prefix/lib/mono/gac/System.Runtime.Serialization
-%_prefix/lib/mono/gac/System.Transactions
-%_prefix/lib/mono/gac/WebMatrix.Data
-%_prefix/lib/mono/gac/EntityFramework
-%_prefix/lib/mono/gac/EntityFramework.SqlServer
-
-%package -n mono-winforms
-License:        LGPL v2.1 only
-Summary:        Mono's Windows Forms implementation
-Group:          Development/Languages/Mono
-Requires:       mono-core == %version-%release
-Provides:       mono-window-forms
-Obsoletes:      mono-window-forms
-Provides:       mono(Accessibility) = 1.0.5000.0
-Provides:       mono(System.Design) = 1.0.5000.0
-Provides:       mono(System.Drawing) = 1.0.5000.0
-Provides:       mono(System.Drawing.Design) = 1.0.5000.0
-Provides:       mono(System.Windows.Forms) = 1.0.5000.0
-
-%description -n mono-winforms
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Mono's Windows Forms implementation.
-
-%files -n mono-winforms
-%defattr(-, root, root)
-%_prefix/lib/mono/2.0/Accessibility.dll
-%_prefix/lib/mono/2.0/Mono.WebBrowser.dll
-%_prefix/lib/mono/2.0/System.Design.dll
-%_prefix/lib/mono/2.0/System.Drawing.Design.dll
-%_prefix/lib/mono/2.0/System.Windows.Forms.dll
-%_prefix/lib/mono/4.0/Accessibility.dll
-%_prefix/lib/mono/4.0/Mono.WebBrowser.dll
-%_prefix/lib/mono/4.0/System.Design.dll
-%_prefix/lib/mono/4.0/System.Drawing.Design.dll
-%_prefix/lib/mono/4.0/System.Windows.Forms.DataVisualization.dll
-%_prefix/lib/mono/4.0/System.Windows.Forms.dll
-%_prefix/lib/mono/4.5/Accessibility.dll
-%_prefix/lib/mono/4.5/Mono.WebBrowser.dll
-%_prefix/lib/mono/4.5/System.Design.dll
-%_prefix/lib/mono/4.5/System.Drawing.Design.dll
-%_prefix/lib/mono/4.5/System.Windows.Forms.DataVisualization.dll
-%_prefix/lib/mono/4.5/System.Windows.Forms.dll
-%_prefix/lib/mono/gac/Accessibility
-%_prefix/lib/mono/gac/Mono.WebBrowser
-%_prefix/lib/mono/gac/System.Design
-%_prefix/lib/mono/gac/System.Drawing.Design
-%_prefix/lib/mono/gac/System.Windows.Forms
-%_prefix/lib/mono/gac/System.Windows.Forms.DataVisualization
-
-%package -n ibm-data-db2
-License:        LGPL v2.1 only
-Summary:        Database connectivity for DB2
-Group:          Development/Languages/Mono
-Requires:       mono-core == %version-%release
-
-%description -n ibm-data-db2
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Database connectivity for DB2.
-
-%files -n ibm-data-db2
-%defattr(-, root, root)
-%_prefix/lib/mono/2.0/IBM.Data.DB2.dll
-%_prefix/lib/mono/4.0/IBM.Data.DB2.dll
-%_prefix/lib/mono/4.5/IBM.Data.DB2.dll
-%_prefix/lib/mono/gac/IBM.Data.DB2
-
-%package -n mono-extras
-License:        LGPL v2.1 only
-Summary:        Extra packages
-Group:          Development/Languages/Mono
-Requires:       mono-core == %version-%release
-Obsoletes:      mono-ms-extras
-Provides:       mono-ms-extras
-Provides:       mono(Mono.Messaging) = 1.0.5000.0
-Provides:       mono(Mono.Messaging.RabbitMQ) = 1.0.5000.0
-Provides:       mono(RabbitMQ.Client) = 1.0.5000.0
-Provides:       mono(System.Configuration.Install) = 1.0.5000.0
-Provides:       mono(System.Management) = 1.0.5000.0
-Provides:       mono(System.Messaging) = 1.0.5000.0
-Provides:       mono(System.ServiceProcess) = 1.0.5000.0
-Provides:       mono(mono-service) = 1.0.5000.0
-
-%description -n mono-extras
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Extra packages.
-
-%files -n mono-extras
-%defattr(-, root, root)
-%_bindir/mono-service
-%_bindir/mono-service2
-%_mandir/man1/mono-service.1%ext_man
-%_prefix/lib/mono/2.0/Mono.Messaging.RabbitMQ.dll
-%_prefix/lib/mono/2.0/Mono.Messaging.dll
-%_prefix/lib/mono/2.0/RabbitMQ.Client.Apigen.exe*
-%_prefix/lib/mono/2.0/RabbitMQ.Client.dll
-%_prefix/lib/mono/2.0/System.Configuration.Install.dll
-%_prefix/lib/mono/2.0/System.Management.dll
-%_prefix/lib/mono/2.0/System.Messaging.dll
-%_prefix/lib/mono/2.0/System.ServiceProcess.dll
-%_prefix/lib/mono/2.0/mono-service.exe*
-%_prefix/lib/mono/4.0/Mono.Messaging.RabbitMQ.dll
-%_prefix/lib/mono/4.0/Mono.Messaging.dll
-%_prefix/lib/mono/4.0/RabbitMQ.Client.Apigen.exe*
-%_prefix/lib/mono/4.0/RabbitMQ.Client.dll
-%_prefix/lib/mono/4.0/System.Configuration.Install.dll
-%_prefix/lib/mono/4.0/System.Management.dll
-%_prefix/lib/mono/4.0/System.Messaging.dll
-%_prefix/lib/mono/4.0/System.Runtime.Caching.dll
-%_prefix/lib/mono/4.0/System.ServiceProcess.dll
-%_prefix/lib/mono/4.0/System.Xaml.dll
-%_prefix/lib/mono/4.5/installutil.exe*
-%_prefix/lib/mono/4.5/mono-service.exe*
-%_prefix/lib/mono/4.5/Mono.Messaging.RabbitMQ.dll
-%_prefix/lib/mono/4.5/Mono.Messaging.dll
-%_prefix/lib/mono/4.5/RabbitMQ.Client.Apigen.exe*
-%_prefix/lib/mono/4.5/RabbitMQ.Client.dll
-%_prefix/lib/mono/4.5/System.Configuration.Install.dll
-%_prefix/lib/mono/4.5/System.Management.dll
-%_prefix/lib/mono/4.5/System.Messaging.dll
-%_prefix/lib/mono/4.5/System.Runtime.Caching.dll
-%_prefix/lib/mono/4.5/System.ServiceProcess.dll
-%_prefix/lib/mono/4.5/System.Xaml.dll
-%_prefix/lib/mono/gac/Mono.Messaging
-%_prefix/lib/mono/gac/Mono.Messaging.RabbitMQ
-%_prefix/lib/mono/gac/RabbitMQ.Client
-%_prefix/lib/mono/gac/System.Configuration.Install
-%_prefix/lib/mono/gac/System.Management
-%_prefix/lib/mono/gac/System.Messaging
-%_prefix/lib/mono/gac/System.Runtime.Caching
-%_prefix/lib/mono/gac/System.ServiceProcess
-%_prefix/lib/mono/gac/System.Xaml
-%_prefix/lib/mono/gac/mono-service
-
-%package -n mono-data-sqlite
-License:        LGPL v2.1 only
-Summary:        Database connectivity for Mono
-Group:          Development/Languages/Mono
-Requires:       mono-core == %version-%release
-Requires:       mono-data == %version-%release
-Provides:       mono(Mono.Data.Sqlite) = 1.0.5000.0
-
-%description -n mono-data-sqlite
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Database connectivity for Mono.
-
-%files -n mono-data-sqlite
-%defattr(-, root, root)
-%_prefix/lib/mono/2.0/Mono.Data.Sqlite.dll
-%_prefix/lib/mono/4.0/Mono.Data.Sqlite.dll
-%_prefix/lib/mono/4.5/Mono.Data.Sqlite.dll
-%_prefix/lib/mono/gac/Mono.Data.Sqlite
-
-%package -n mono-wcf
-License:        MIT License (or similar) ; Ms-Pl
-Summary:        Mono implementation of WCF, Windows Communication Foundation
-Group:          Development/Languages/Mono
-Requires:       mono-core == %version-%release
-
-%description -n mono-wcf
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Mono implementation of WCF, Windows Communication Foundation
-
-%files -n mono-wcf
-%defattr(-, root, root)
-%_bindir/svcutil
-%_libdir/pkgconfig/wcf.pc
-%_prefix/lib/mono/2.0/System.Data.Services.dll
-%_prefix/lib/mono/2.0/System.IdentityModel.Selectors.dll
-%_prefix/lib/mono/2.0/System.IdentityModel.dll
-%_prefix/lib/mono/2.0/System.ServiceModel.Web.dll
-%_prefix/lib/mono/2.0/System.ServiceModel.dll
-%_prefix/lib/mono/4.0/System.Data.Services.dll
-%_prefix/lib/mono/4.0/System.IdentityModel.Selectors.dll
-%_prefix/lib/mono/4.0/System.IdentityModel.dll
-%_prefix/lib/mono/4.0/System.Runtime.DurableInstancing.dll
-%_prefix/lib/mono/4.0/System.ServiceModel.Activation.dll
-%_prefix/lib/mono/4.0/System.ServiceModel.Discovery.dll
-%_prefix/lib/mono/4.0/System.ServiceModel.Routing.dll
-%_prefix/lib/mono/4.0/System.ServiceModel.Web.dll
-%_prefix/lib/mono/4.0/System.ServiceModel.dll
-%_prefix/lib/mono/4.5/System.Data.Services.dll
-%_prefix/lib/mono/4.5/System.IdentityModel.Selectors.dll
-%_prefix/lib/mono/4.5/System.IdentityModel.dll
-%_prefix/lib/mono/4.5/System.Runtime.DurableInstancing.dll
-%_prefix/lib/mono/4.5/System.ServiceModel.Activation.dll
-%_prefix/lib/mono/4.5/System.ServiceModel.Discovery.dll
-%_prefix/lib/mono/4.5/System.ServiceModel.Routing.dll
-%_prefix/lib/mono/4.5/System.ServiceModel.Web.dll
-%_prefix/lib/mono/4.5/System.ServiceModel.dll
-%_prefix/lib/mono/4.5/svcutil.exe*
-%_prefix/lib/mono/gac/System.Data.Services
-%_prefix/lib/mono/gac/System.IdentityModel
-%_prefix/lib/mono/gac/System.IdentityModel.Selectors
-%_prefix/lib/mono/gac/System.Runtime.DurableInstancing
-%_prefix/lib/mono/gac/System.ServiceModel
-%_prefix/lib/mono/gac/System.ServiceModel.Activation
-%_prefix/lib/mono/gac/System.ServiceModel.Discovery
-%_prefix/lib/mono/gac/System.ServiceModel.Routing
-%_prefix/lib/mono/gac/System.ServiceModel.Web
-
-%package -n mono-winfxcore
-License:        MIT License (or similar) ; Ms-Pl
-Summary:        Mono implementation of core WinFX APIs
-Group:          Development/Languages/Mono
-Requires:       mono-core == %version-%release
-
-%description -n mono-winfxcore
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Mono implementation of core WinFX APIs
-
-%files -n mono-winfxcore
-%defattr(-, root, root)
-%_prefix/lib/mono/2.0/System.Data.Services.Client.dll*
-%_prefix/lib/mono/2.0/WindowsBase.dll*
-%_prefix/lib/mono/4.0/System.Data.Services.Client.dll*
-%_prefix/lib/mono/4.0/WindowsBase.dll*
-%_prefix/lib/mono/4.5/System.Data.Services.Client.dll*
-%_prefix/lib/mono/4.5/WindowsBase.dll*
-%_prefix/lib/mono/gac/System.Data.Services.Client
-%_prefix/lib/mono/gac/WindowsBase
-
-%package -n mono-web
-License:        MIT License (or similar) ; Ms-Pl
-Summary:        Mono implementation of ASP.NET, Remoting and Web Services
-Group:          Development/Languages/Mono
-Requires:       mono-core == %version-%release
-Obsoletes:      mono-remoting
-Obsoletes:      mono-web-forms
-Obsoletes:      mono-web-services
-Provides:       mono-remoting
-Provides:       mono-web-forms
-Provides:       mono-web-services
-Provides:       mono(Mono.Http) = 1.0.5000.0
-Provides:       mono(System.Runtime.Remoting) = 1.0.5000.0
-Provides:       mono(System.Runtime.Serialization.Formatters.Soap) = 1.0.5000.0
-Provides:       mono(System.Web) = 1.0.5000.0
-Provides:       mono(System.Web.Services) = 1.0.5000.0
-
-%description -n mono-web
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Mono implementation of ASP.NET, Remoting and Web Services.
-
-%files -n mono-web
-%defattr(-, root, root)
-%config %_sysconfdir/mono/2.0/Browsers
-%config %_sysconfdir/mono/2.0/DefaultWsdlHelpGenerator.aspx
-%config %_sysconfdir/mono/2.0/web.config
-%config %_sysconfdir/mono/4.0/Browsers
-%config %_sysconfdir/mono/4.0/DefaultWsdlHelpGenerator.aspx
-%config %_sysconfdir/mono/4.0/web.config
-%config %_sysconfdir/mono/4.5/Browsers
-%config %_sysconfdir/mono/4.5/DefaultWsdlHelpGenerator.aspx
-%config %_sysconfdir/mono/4.5/web.config
-%config %_sysconfdir/mono/browscap.ini
-%config %_sysconfdir/mono/mconfig/config.xml
-%dir %_sysconfdir/mono/mconfig
-%_bindir/disco
-%_bindir/mconfig
-%_bindir/soapsuds
-%_bindir/wsdl
-%_bindir/wsdl2
-%_bindir/xsd
-%_libdir/pkgconfig/aspnetwebstack.pc
-%_mandir/man1/disco.1%ext_man
-%_mandir/man1/mconfig.1%ext_man
-%_mandir/man1/soapsuds.1%ext_man
-%_mandir/man1/wsdl.1%ext_man
-%_mandir/man1/xsd.1%ext_man
-%_prefix/lib/mono/2.0/Mono.Http.dll
-%_prefix/lib/mono/2.0/System.ComponentModel.DataAnnotations.dll
-%_prefix/lib/mono/2.0/System.Runtime.Remoting.dll
-%_prefix/lib/mono/2.0/System.Runtime.Serialization.Formatters.Soap.dll
-%_prefix/lib/mono/2.0/System.Web.Abstractions.dll
-%_prefix/lib/mono/2.0/System.Web.Routing.dll
-%_prefix/lib/mono/2.0/System.Web.Services.dll
-%_prefix/lib/mono/2.0/System.Web.dll
-%_prefix/lib/mono/2.0/wsdl.exe*
-%_prefix/lib/mono/2.0/xsd.exe*
-%_prefix/lib/mono/4.0/Microsoft.Web.Infrastructure.dll
-%_prefix/lib/mono/4.0/Mono.Http.dll
-%_prefix/lib/mono/4.0/System.ComponentModel.Composition.dll
-%_prefix/lib/mono/4.0/System.ComponentModel.DataAnnotations.dll
-%_prefix/lib/mono/4.0/System.Runtime.Remoting.dll
-%_prefix/lib/mono/4.0/System.Runtime.Serialization.Formatters.Soap.dll
-%_prefix/lib/mono/4.0/System.Web.Abstractions.dll
-%_prefix/lib/mono/4.0/System.Web.ApplicationServices.dll
-%_prefix/lib/mono/4.0/System.Web.Routing.dll
-%_prefix/lib/mono/4.0/System.Web.Services.dll
-%_prefix/lib/mono/4.0/System.Web.dll
-%_prefix/lib/mono/4.5/Mono.Http.dll
-%_prefix/lib/mono/4.5/System.ComponentModel.Composition.dll
-%_prefix/lib/mono/4.5/System.ComponentModel.DataAnnotations.dll
-%_prefix/lib/mono/4.5/System.Net.Http.Formatting.dll
-%_prefix/lib/mono/4.5/System.Runtime.Remoting.dll
-%_prefix/lib/mono/4.5/System.Runtime.Serialization.Formatters.Soap.dll
-%_prefix/lib/mono/4.5/System.Web.Abstractions.dll
-%_prefix/lib/mono/4.5/System.Web.ApplicationServices.dll
-%_prefix/lib/mono/4.5/System.Web.Http.dll
-%_prefix/lib/mono/4.5/System.Web.Http.SelfHost.dll
-%_prefix/lib/mono/4.5/System.Web.Http.WebHost.dll
-%_prefix/lib/mono/4.5/System.Web.Routing.dll
-%_prefix/lib/mono/4.5/System.Web.Razor.dll
-%_prefix/lib/mono/4.5/System.Web.Services.dll
-%_prefix/lib/mono/4.5/System.Web.WebPages.Deployment.dll
-%_prefix/lib/mono/4.5/System.Web.WebPages.Razor.dll
-%_prefix/lib/mono/4.5/System.Web.WebPages.dll
-%_prefix/lib/mono/4.5/System.Web.dll
-%_prefix/lib/mono/4.5/disco.exe*
-%_prefix/lib/mono/4.5/mconfig.exe*
-%_prefix/lib/mono/4.5/soapsuds.exe*
-%_prefix/lib/mono/4.5/wsdl.exe*
-%_prefix/lib/mono/4.5/xsd.exe*
-%_prefix/lib/mono/4.5/Microsoft.Web.Infrastructure.dll
-%_prefix/lib/mono/gac/Microsoft.Web.Infrastructure
-%_prefix/lib/mono/gac/Mono.Http
-%_prefix/lib/mono/gac/System.ComponentModel.Composition
-%_prefix/lib/mono/gac/System.ComponentModel.DataAnnotations
-%_prefix/lib/mono/gac/System.Net.Http.Formatting
-%_prefix/lib/mono/gac/System.Runtime.Remoting
-%_prefix/lib/mono/gac/System.Runtime.Serialization.Formatters.Soap
-%_prefix/lib/mono/gac/System.Web
-%_prefix/lib/mono/gac/System.Web.Abstractions
-%_prefix/lib/mono/gac/System.Web.ApplicationServices
-%_prefix/lib/mono/gac/System.Web.Http
-%_prefix/lib/mono/gac/System.Web.Http.SelfHost
-%_prefix/lib/mono/gac/System.Web.Http.WebHost
-%_prefix/lib/mono/gac/System.Web.Routing
-%_prefix/lib/mono/gac/System.Web.Razor
-%_prefix/lib/mono/gac/System.Web.Services
-%_prefix/lib/mono/gac/System.Web.WebPages.Deployment
-%_prefix/lib/mono/gac/System.Web.WebPages.Razor
-%_prefix/lib/mono/gac/System.Web.WebPages
-
-%package -n mono-mvc
-License:        MIT License (or similar) ; Ms-Pl
-Summary:        Mono implementation of ASP.NET MVC
-Group:          Development/Languages/Mono
-Requires:       mono-core == %version-%release
-
-%description -n mono-mvc
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Mono implementation of ASP.NET MVC.
-
-%files -n mono-mvc
-%defattr(-, root, root)
-%_libdir/pkgconfig/system.web.extensions.design_1.0.pc
-%_libdir/pkgconfig/system.web.extensions_1.0.pc
-%_libdir/pkgconfig/system.web.mvc.pc
-%_libdir/pkgconfig/system.web.mvc2.pc
-%_libdir/pkgconfig/system.web.mvc3.pc
-%_prefix/lib/mono/2.0/System.Web.DynamicData.dll
-%_prefix/lib/mono/2.0/System.Web.Extensions.Design.dll
-%_prefix/lib/mono/2.0/System.Web.Extensions.dll
-%_prefix/lib/mono/2.0/System.Web.Mvc.dll
-%_prefix/lib/mono/4.0/System.Web.DynamicData.dll
-%_prefix/lib/mono/4.0/System.Web.Extensions.Design.dll
-%_prefix/lib/mono/4.0/System.Web.Extensions.dll
-%_prefix/lib/mono/4.5/System.Web.DynamicData.dll
-%_prefix/lib/mono/4.5/System.Web.Extensions.Design.dll
-%_prefix/lib/mono/4.5/System.Web.Extensions.dll
-%_prefix/lib/mono/4.5/System.Web.Mvc.dll
-%_prefix/lib/mono/compat-2.0/System.Web.Extensions.Design.dll
-%_prefix/lib/mono/compat-2.0/System.Web.Extensions.dll
-%_prefix/lib/mono/compat-2.0/System.Web.Mvc.dll
-%_prefix/lib/mono/gac/System.Web.DynamicData
-%_prefix/lib/mono/gac/System.Web.Extensions
-%_prefix/lib/mono/gac/System.Web.Extensions.Design
-%_prefix/lib/mono/gac/System.Web.Mvc
-
-%package -n mono-data-oracle
-License:        LGPL v2.1 only
-Summary:        Database connectivity for Mono
-Group:          Development/Languages/Mono
-Requires:       mono-core == %version-%release
-Requires:       mono-data == %version-%release
-Provides:       mono(System.Data.OracleClient) = 1.0.5000.0
-
-%description -n mono-data-oracle
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Database connectivity for Mono.
-
-%files -n mono-data-oracle
-%defattr(-, root, root)
-%_prefix/lib/mono/2.0/System.Data.OracleClient.dll
-%_prefix/lib/mono/4.0/System.Data.OracleClient.dll
-%_prefix/lib/mono/4.5/System.Data.OracleClient.dll
-%_prefix/lib/mono/gac/System.Data.OracleClient
-
-%package -n mono-data-postgresql
-License:        LGPL v2.1 only
-Summary:        Database connectivity for Mono
-Group:          Development/Languages/Mono
-Requires:       mono-core == %version-%release
-Requires:       mono-data == %version-%release
-Provides:       mono(Npgsql) = 1.0.5000.0
-
-%description -n mono-data-postgresql
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Database connectivity for Mono.
-
-%files -n mono-data-postgresql
-%defattr(-, root, root)
-%_prefix/lib/mono/2.0/Npgsql.dll
-%_prefix/lib/mono/4.0/Npgsql.dll
-%_prefix/lib/mono/4.5/Npgsql.dll
-%_prefix/lib/mono/gac/Npgsql
-
-%package -n mono-rx-core
-License:        MIT License (or similar) ; Apache License 2.0
-Summary:        Reactive Extensions for Mono core libraries
-Group:          Development/Languages/Mono
-Requires:       mono-core == %version-%release
-Provides:       mono(System.Reactive.Interfaces) = 1.0.5000.0
-
-%description -n mono-rx-core
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Reactive Extensions for Mono, core packages, which don't depend on
-desktop-specific features.
-
-%files -n mono-rx-core
-%defattr(-, root, root)
-%_libdir/pkgconfig/reactive.pc
-%_prefix/lib/mono/4.5/System.Reactive.Core.dll
-%_prefix/lib/mono/4.5/System.Reactive.Debugger.dll
-%_prefix/lib/mono/4.5/System.Reactive.Experimental.dll
-%_prefix/lib/mono/4.5/System.Reactive.Interfaces.dll
-%_prefix/lib/mono/4.5/System.Reactive.Linq.dll
-%_prefix/lib/mono/4.5/System.Reactive.Observable.Aliases.dll
-%_prefix/lib/mono/4.5/System.Reactive.PlatformServices.dll
-%_prefix/lib/mono/4.5/System.Reactive.Providers.dll
-%_prefix/lib/mono/4.5/System.Reactive.Runtime.Remoting.dll
-%_prefix/lib/mono/gac/System.Reactive.Core
-%_prefix/lib/mono/gac/System.Reactive.Debugger
-%_prefix/lib/mono/gac/System.Reactive.Experimental
-%_prefix/lib/mono/gac/System.Reactive.Interfaces
-%_prefix/lib/mono/gac/System.Reactive.Linq
-%_prefix/lib/mono/gac/System.Reactive.Observable.Aliases
-%_prefix/lib/mono/gac/System.Reactive.PlatformServices
-%_prefix/lib/mono/gac/System.Reactive.Providers
-%_prefix/lib/mono/gac/System.Reactive.Runtime.Remoting
-
-%package -n mono-rx-desktop
-License:        MIT License (or similar) ; Apache License 2.0
-Summary:        Reactive Extensions for Mono desktop-specific libraries
-Group:          Development/Languages/Mono
-Requires:       mono-core == %version-%release
-Requires:       mono-rx-core == %version-%release
-Provides:       mono(System.Reactive.Interfaces) = 1.0.5000.0
-
-%description -n mono-rx-desktop
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Reactive Extensions for Mono, desktop-specific packages (winforms,
-windows threading).
-
-%files -n mono-rx-desktop
-%defattr(-, root, root)
-%_prefix/lib/mono/4.5/System.Reactive.Windows.Forms.dll
-%_prefix/lib/mono/4.5/System.Reactive.Windows.Threading.dll
-%_prefix/lib/mono/gac/System.Reactive.Windows.Forms
-%_prefix/lib/mono/gac/System.Reactive.Windows.Threading
-
-%package -n mono-nunit
-License:        LGPL v2.1 only
-Summary:        NUnit Testing Framework
-Group:          Development/Languages/Mono
-Requires:       mono-core == %version-%release
-
-%description -n mono-nunit
-NUnit is a unit-testing framework for all .Net languages.  Initially
-ported from JUnit, the current release, version 2.2,  is the fourth
-major release of this  Unit based unit testing tool for Microsoft .NET.
-It is written entirely in C# and  has been completely redesigned to
-take advantage of many .NET language            features, for example
-custom attributes and other reflection related capabilities. NUnit
-brings xUnit to all .NET languages.
-
-%files -n mono-nunit
-%defattr(-, root, root)
-%_libdir/pkgconfig/mono-nunit.pc
-%_prefix/bin/nunit-console
-%_prefix/bin/nunit-console2
-%_prefix/bin/nunit-console4
-%_prefix/lib/mono/2.0/nunit-console-runner.dll
-%_prefix/lib/mono/2.0/nunit-console.exe*
-%_prefix/lib/mono/2.0/nunit.core.dll
-%_prefix/lib/mono/2.0/nunit.core.extensions.dll
-%_prefix/lib/mono/2.0/nunit.core.interfaces.dll
-%_prefix/lib/mono/2.0/nunit.framework.dll
-%_prefix/lib/mono/2.0/nunit.framework.extensions.dll
-%_prefix/lib/mono/2.0/nunit.mocks.dll
-%_prefix/lib/mono/2.0/nunit.util.dll
-%_prefix/lib/mono/4.5/nunit-console-runner.dll
-%_prefix/lib/mono/4.5/nunit-console.exe*
-%_prefix/lib/mono/4.5/nunit.core.dll
-%_prefix/lib/mono/4.5/nunit.core.extensions.dll
-%_prefix/lib/mono/4.5/nunit.core.interfaces.dll
-%_prefix/lib/mono/4.5/nunit.framework.dll
-%_prefix/lib/mono/4.5/nunit.framework.extensions.dll
-%_prefix/lib/mono/4.5/nunit.mocks.dll
-%_prefix/lib/mono/4.5/nunit.util.dll
-%_prefix/lib/mono/gac/nunit-console-runner
-%_prefix/lib/mono/gac/nunit.core
-%_prefix/lib/mono/gac/nunit.core.extensions
-%_prefix/lib/mono/gac/nunit.core.interfaces
-%_prefix/lib/mono/gac/nunit.framework
-%_prefix/lib/mono/gac/nunit.framework.extensions
-%_prefix/lib/mono/gac/nunit.mocks
-%_prefix/lib/mono/gac/nunit.util
-
-%package -n mono-devel
-License:        LGPL v2.1 only
-Summary:        Mono development tools
-Group:          Development/Languages/Mono
-Requires:       mono-core == %version-%release
-Requires:       libgdiplus0
-Requires:       pkgconfig
-Provides:       mono-xbuild
-# Required because they are referenced by .pc files
-Requires:       mono-data == %version-%release
-Requires:       mono-data-oracle == %version-%release
-Requires:       mono-extras == %version-%release
-Requires:       mono-web == %version-%release
-Requires:       mono-winforms == %version-%release
-# We build natively on ppc64 now
-%ifarch ppc64
-Provides:       mono-biarchcompat
-Obsoletes:      mono-biarchcompat
-%endif
-Provides:       mono(PEAPI) = 1.0.5000.0
-Provides:       mono(resgen) = 1.0.5000.0
-
-%description -n mono-devel
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. This package contains compilers and
-other tools needed to develop .NET applications.
-
-Mono development tools.
-
-%post -n mono-devel -p /sbin/ldconfig
-
-%postun -n mono-devel -p /sbin/ldconfig
-
-%files -n mono-devel
-%defattr(-, root, root)
-%_bindir/caspol
-%_bindir/ccrewrite
-%_bindir/cccheck
-%_bindir/cert2spc
-%_bindir/dtd2rng
-%_bindir/dtd2xsd
-%_bindir/genxs
-%_bindir/httpcfg
-%_bindir/ilasm
-%_bindir/installvst
-%_bindir/lc
-%_bindir/macpack
-%_bindir/makecert
-%_bindir/mkbundle
-%_bindir/mono-api-info
-%_bindir/mono-cil-strip
-%_bindir/mono-find-provides
-%_bindir/mono-find-requires
-%_bindir/mono-heapviz
-%_bindir/mono-shlib-cop
-%_bindir/mono-xmltool
-%_bindir/monodis
-%_bindir/monograph
-%_bindir/monolinker
-%_bindir/monop
-%_bindir/monop2
-%_bindir/mprof-report
-%_bindir/pdb2mdb
-%_bindir/pedump
-%_bindir/permview
-%_bindir/prj2make
-%_bindir/resgen
-%_bindir/resgen2
-%_bindir/secutil
-%_bindir/sgen
-%_bindir/signcode
-%_bindir/xbuild
-%_bindir/mdbrebase
-%dir %_datadir/mono-2.0
-%dir %_datadir/mono-2.0/mono
-%dir %_datadir/mono-2.0/mono/cil
-%_datadir/mono-2.0/mono/cil/cil-opcodes.xml
-%_libdir/libmono-profiler-*.*
-%_libdir/pkgconfig/cecil.pc
-%_libdir/pkgconfig/dotnet.pc
-%_libdir/pkgconfig/dotnet35.pc
-%_libdir/pkgconfig/mono-cairo.pc
-%_libdir/pkgconfig/mono-lineeditor.pc
-%_libdir/pkgconfig/mono-options.pc
-%_libdir/pkgconfig/mono.pc
-%_libdir/pkgconfig/xbuild12.pc
-%_mandir/man1/al.1%ext_man
-%_mandir/man1/ccrewrite.1%ext_man
-%_mandir/man1/cccheck.1%ext_man
-%_mandir/man1/cert2spc.1%ext_man
-%_mandir/man1/dtd2xsd.1%ext_man
-%_mandir/man1/genxs.1%ext_man
-%_mandir/man1/httpcfg.1%ext_man
-%_mandir/man1/ilasm.1%ext_man
-%_mandir/man1/lc.1%ext_man
-%_mandir/man1/macpack.1%ext_man
-%_mandir/man1/makecert.1%ext_man
-%_mandir/man1/mkbundle.1%ext_man
-%_mandir/man1/mono-api-info.1%ext_man
-%_mandir/man1/mono-cil-strip.1%ext_man
-%_mandir/man1/mono-shlib-cop.1%ext_man
-%_mandir/man1/mono-xmltool.1%ext_man
-%_mandir/man1/monodis.1%ext_man
-%_mandir/man1/monolinker.1%ext_man
-%_mandir/man1/monop.1%ext_man
-%_mandir/man1/mprof-report.1%ext_man
-%_mandir/man1/pdb2mdb.1%ext_man
-%_mandir/man1/permview.1%ext_man
-%_mandir/man1/prj2make.1%ext_man
-%_mandir/man1/resgen.1%ext_man
-%_mandir/man1/secutil.1%ext_man
-%_mandir/man1/sgen.1%ext_man
-%_mandir/man1/signcode.1%ext_man
-%_mandir/man1/xbuild.1%ext_man
-%_prefix/lib/mono-source-libs
-%_prefix/lib/mono/2.0/MSBuild
-%_prefix/lib/mono/2.0/Microsoft.Build.Engine.dll
-%_prefix/lib/mono/2.0/Microsoft.Build.Framework.dll
-%_prefix/lib/mono/2.0/Microsoft.Build.Tasks.dll
-%_prefix/lib/mono/2.0/Microsoft.Build.Utilities.dll
-%_prefix/lib/mono/2.0/Microsoft.Build.xsd
-%_prefix/lib/mono/2.0/Microsoft.CSharp.targets
-%_prefix/lib/mono/2.0/Microsoft.Common.targets
-%_prefix/lib/mono/2.0/Microsoft.Common.tasks
-%_prefix/lib/mono/2.0/Microsoft.VisualBasic.targets
-%_prefix/lib/mono/2.0/Mono.Debugger.Soft.dll
-%_prefix/lib/mono/2.0/Mono.XBuild.Tasks.dll
-%_prefix/lib/mono/2.0/PEAPI.dll
-%_prefix/lib/mono/2.0/genxs.exe*
-%_prefix/lib/mono/2.0/ilasm.exe*
-%_prefix/lib/mono/2.0/mkbundle.exe*
-%_prefix/lib/mono/2.0/monolinker.*
-%_prefix/lib/mono/2.0/monop.exe*
-%_prefix/lib/mono/2.0/resgen.exe*
-%_prefix/lib/mono/2.0/xbuild.exe*
-%_prefix/lib/mono/2.0/xbuild.rsp
-%_prefix/lib/mono/3.5/MSBuild
-%_prefix/lib/mono/3.5/Microsoft.Build.Engine.dll
-%_prefix/lib/mono/3.5/Microsoft.Build.Framework.dll
-%_prefix/lib/mono/3.5/Microsoft.Build.Tasks.v3.5.dll
-%_prefix/lib/mono/3.5/Microsoft.Build.Utilities.v3.5.dll
-%_prefix/lib/mono/3.5/Microsoft.Build.xsd
-%_prefix/lib/mono/3.5/Microsoft.CSharp.targets
-%_prefix/lib/mono/3.5/Microsoft.Common.targets
-%_prefix/lib/mono/3.5/Microsoft.Common.tasks
-%_prefix/lib/mono/3.5/Microsoft.VisualBasic.targets
-%_prefix/lib/mono/3.5/Mono.XBuild.Tasks.dll
-%_prefix/lib/mono/3.5/xbuild.exe*
-%_prefix/lib/mono/3.5/xbuild.rsp
-%_prefix/lib/mono/4.0/Microsoft.Build.dll
-%_prefix/lib/mono/4.0/Microsoft.Build.Engine.dll
-%_prefix/lib/mono/4.0/Microsoft.Build.Framework.dll
-%_prefix/lib/mono/4.0/Microsoft.Build.Tasks.v4.0.dll
-%_prefix/lib/mono/4.0/Microsoft.Build.Utilities.v4.0.dll
-%_prefix/lib/mono/4.0/Mono.Debugger.Soft.dll
-%_prefix/lib/mono/4.0/Mono.XBuild.Tasks.dll
-%_prefix/lib/mono/4.0/PEAPI.dll
-%_prefix/lib/mono/4.5/MSBuild
-%_prefix/lib/mono/4.5/Microsoft.Build.dll
-%_prefix/lib/mono/4.5/Microsoft.Build.Engine.dll
-%_prefix/lib/mono/4.5/Microsoft.Build.Framework.dll
-%_prefix/lib/mono/4.5/Microsoft.Build.Tasks.v4.0.dll
-%_prefix/lib/mono/4.5/Microsoft.Build.Utilities.v4.0.dll
-%_prefix/lib/mono/4.5/Microsoft.Build.xsd
-%_prefix/lib/mono/4.5/Microsoft.CSharp.targets
-%_prefix/lib/mono/4.5/Microsoft.Common.targets
-%_prefix/lib/mono/4.5/Microsoft.Common.tasks
-%_prefix/lib/mono/4.5/Microsoft.VisualBasic.targets
-%_prefix/lib/mono/4.5/Mono.Debugger.Soft.dll
-%_prefix/lib/mono/4.5/Mono.CodeContracts.dll
-%_prefix/lib/mono/4.5/Mono.XBuild.Tasks.dll
-%_prefix/lib/mono/4.5/PEAPI.dll
-%_prefix/lib/mono/4.5/caspol.exe*
-%_prefix/lib/mono/4.5/cccheck.exe*
-%_prefix/lib/mono/4.5/ccrewrite.exe*
-%_prefix/lib/mono/4.5/cert2spc.exe*
-%_prefix/lib/mono/4.5/dtd2rng.exe*
-%_prefix/lib/mono/4.5/dtd2xsd.exe*
-%_prefix/lib/mono/4.5/genxs.exe*
-%_prefix/lib/mono/4.5/httpcfg.exe*
-%_prefix/lib/mono/4.5/ictool.exe*
-%_prefix/lib/mono/4.5/ilasm.exe*
-%_prefix/lib/mono/4.5/installvst.exe*
-%_prefix/lib/mono/4.5/lc.exe*
-%_prefix/lib/mono/4.5/macpack.exe*
-%_prefix/lib/mono/4.5/makecert.exe*
-%_prefix/lib/mono/4.5/mkbundle.exe*
-%_prefix/lib/mono/4.5/mono-api-info.exe*
-%_prefix/lib/mono/4.5/mono-cil-strip.exe*
-%_prefix/lib/mono/4.5/mono-shlib-cop.exe*
-%_prefix/lib/mono/4.5/mono-xmltool.exe*
-%_prefix/lib/mono/4.5/monolinker.*
-%_prefix/lib/mono/4.5/monop.exe*
-%_prefix/lib/mono/4.5/pdb2mdb.exe*
-%_prefix/lib/mono/4.5/permview.exe*
-%_prefix/lib/mono/4.5/resgen.exe*
-%_prefix/lib/mono/4.5/secutil.exe*
-%_prefix/lib/mono/4.5/sgen.exe*
-%_prefix/lib/mono/4.5/signcode.exe*
-%_prefix/lib/mono/4.5/xbuild.exe*
-%_prefix/lib/mono/4.5/xbuild.rsp
-%_prefix/lib/mono/4.5/mdbrebase.exe*
-%_prefix/lib/mono/gac/Microsoft.Build
-%_prefix/lib/mono/gac/Microsoft.Build.Engine
-%_prefix/lib/mono/gac/Microsoft.Build.Framework
-%_prefix/lib/mono/gac/Microsoft.Build.Tasks
-%_prefix/lib/mono/gac/Microsoft.Build.Tasks.v3.5
-%_prefix/lib/mono/gac/Microsoft.Build.Tasks.v4.0
-%_prefix/lib/mono/gac/Microsoft.Build.Tasks.v12.0
-%_prefix/lib/mono/gac/Microsoft.Build.Utilities
-%_prefix/lib/mono/gac/Microsoft.Build.Utilities.v3.5
-%_prefix/lib/mono/gac/Microsoft.Build.Utilities.v4.0
-%_prefix/lib/mono/gac/Microsoft.Build.Utilities.v12.0
-%_prefix/lib/mono/gac/Mono.CodeContracts
-%_prefix/lib/mono/gac/Mono.Debugger.Soft
-%_prefix/lib/mono/gac/Mono.XBuild.Tasks
-%_prefix/lib/mono/gac/PEAPI
-%_prefix/lib/mono/xbuild
-%_prefix/lib/mono/xbuild-frameworks
-
-%package -n monodoc-core
-License:        LGPL v2.1 only
-Summary:        Monodoc - Documentation tools for C# code
-Group:          Development/Tools/Other
-Requires:       mono-core == %version-%release
-Obsoletes:      monodoc
-Provides:       monodoc
-# Added to uncompress and compare documentation used by build-compare
-Requires:       unzip
-
-%description -n monodoc-core
-Monodoc-core contains documentation tools for C#.
-
-%files -n monodoc-core
-%defattr(-, root, root)
-%_bindir/mdassembler
-%_bindir/mdoc
-%_bindir/mdoc-assemble
-%_bindir/mdoc-export-html
-%_bindir/mdoc-export-msxdoc
-%_bindir/mdoc-update
-%_bindir/mdoc-validate
-%_bindir/mdvalidater
-%_bindir/mod
-%_bindir/monodocer
-%_bindir/monodocs2html
-%_bindir/monodocs2slashdoc
-%_libdir/pkgconfig/monodoc.pc
-%_mandir/man1/mdassembler.1%ext_man
-%_mandir/man1/mdoc-assemble.1%ext_man
-%_mandir/man1/mdoc-export-html.1%ext_man
-%_mandir/man1/mdoc-export-msxdoc.1%ext_man
-%_mandir/man1/mdoc-update.1%ext_man
-%_mandir/man1/mdoc-validate.1%ext_man
-%_mandir/man1/mdoc.1%ext_man
-%_mandir/man1/mdvalidater.1%ext_man
-%_mandir/man1/monodocer.1%ext_man
-%_mandir/man1/monodocs2html.1%ext_man
-%_mandir/man5/mdoc.5%ext_man
-%_prefix/lib/mono/4.5/mdoc.exe*
-%_prefix/lib/mono/4.5/mod.exe*
-%_prefix/lib/mono/4.0/monodoc.dll*
-%_prefix/lib/mono/gac/monodoc
-%_prefix/lib/mono/monodoc
-%_prefix/lib/monodoc
-
-%package -n mono-complete
-License:        LGPL v2.1 only
-Summary:        Install everything built from the mono source tree
-Group:          Development/Languages/Mono
-Requires:       mono-core = %version-%release
-Requires:       ibm-data-db2 = %version-%release
-Requires:       libmono-2_0-1 = %version-%release
-Requires:       libmono-2_0-devel = %version-%release
-%if %llvm == yes
-Requires:       libmono-llvm0 = %version-%release
-%endif
-%if %sgen == yes
-Requires:       libmonosgen-2_0-1 = %version-%release
-Requires:       libmonosgen-2_0-devel = %version-%release
-%endif
-Requires:       mono-data = %version-%release
-Requires:       mono-data-oracle = %version-%release
-Requires:       mono-data-postgresql = %version-%release
-Requires:       mono-data-sqlite = %version-%release
-Requires:       mono-devel = %version-%release
-Requires:       mono-extras = %version-%release
-Requires:       mono-locale-extras = %version-%release
-Requires:       mono-nunit = %version-%release
-Requires:       mono-wcf = %version-%release
-Requires:       mono-web = %version-%release
-Requires:       mono-winforms = %version-%release
-Requires:       mono-winfxcore = %version-%release
-Requires:       monodoc-core = %version-%release
-
-%description -n mono-complete
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Install everything built from the mono source tree.  Note that this does
-not install anything from outside the mono source (XSP, mono-basic, etc.).
-
-%files -n mono-complete
-%defattr(-, root, root)
-%dir %_prefix/lib/mono/compat-2.0
-
-%changelog
index 8c9244d33331cbab54ed00150db8918e6423e4e0..cd3df077ff64502059fea31dc138f0528c5b03c4 100644 (file)
@@ -759,6 +759,7 @@ typedef struct {
 #define s390_clgr(c, r1, r2)           S390_RRE(c, 0xb921, r1, r2)
 #define s390_clgrj(c, r1, r2, m, v)    S390_RIE_2(c, 0xec65, r1, r2, m, v)
 #define s390_clgrb(c, r1, r2, m3, b, d)        S390_RRS(c, 0xece5, r1, r2, m3, b, d)
+#define s390_cli(c, b, d, v)           S390_SI(c, 0x95, b, d, v)
 #define s390_clib(c, r, i, m, b, d)    S390_RIS(c, 0xecff, r, i, m, b, d)
 #define s390_clij(c, r, i, b)          S390_RIE_3(c, 0xec7f, r, i, m, d)
 #define s390_clr(c, r1, r2)            S390_RR(c, 0x15, r1, r2)
@@ -915,6 +916,7 @@ typedef struct {
 #define s390_mvc(c, l, b1, d1, b2, d2) S390_SS_1(c, 0xd2, l, b1, d1, b2, d2)
 #define s390_mvcl(c, r1, r2)           S390_RR(c, 0x0e, r1, r2)
 #define s390_mvcle(c, r1, r3, d2, b2)  S390_RS_1(c, 0xa8, r1, r3, d2, b2)
+#define s390_mvi(c, b, d, v)           S390_SI(c, 0x92, b, d, v)
 #define s390_n(c, r, x, b, d)          S390_RX(c, 0x54, r, x, b, d)
 #define s390_nc(c, l, b1, d1, b2, d2)  S390_SS_1(c, 0xd4, l, b1, d1, b2, d2)
 #define s390_ng(c, r, x, b, d)         S390_RXY(c, 0xe380, r, x, b, d)
@@ -996,6 +998,10 @@ typedef struct {
 #define s390_sty(c, r, x, b, d)                S390_RXY(c, 0xe350, r, x, b, d)
 #define s390_tcdb(c, r, x, b, d)       S390_RXE(c, 0xed11, r, x, b, d)
 #define s390_tceb(c, r, x, b, d)       S390_RXE(c, 0xed10, r, x, b, d)
+#define s390_tmhh(c, r, m)             S390_RI(c, 0xa73, r, m)
+#define s390_tmhl(c, r, m)             S390_RI(c, 0xa72, r, m)
+#define s390_tmlh(c, r, m)             S390_RI(c, 0xa70, r, m)
+#define s390_tmll(c, r, m)             S390_RI(c, 0xa71, r, m)
 #define s390_x(c, r, x, b, d)          S390_RX(c, 0x57, r, x, b, d)
 #define s390_xihf(c, r, v)             S390_RIL_1(c, 0xc06, r, v)
 #define s390_xilf(c, r, v)             S390_RIL_1(c, 0xc07, r, v)
diff --git a/mono/dis/TODO b/mono/dis/TODO
deleted file mode 100644 (file)
index fb42dc0..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-* Write test cases
-
-       Write test cases to stress test TypeSpec.  This is done by
-       creating arrays of various dimensions, sizes, and lower
-       bounds.
index bca6a11439994e29a73e8d85316ed73b1d308707..47e31071494b9df89ae82ae2fea109eaa4ab91ee 100644 (file)
@@ -28,7 +28,6 @@ OTHER_H = \
        semaphores.h    \
        sockets.h       \
        status.h        \
-       system.h        \
        threads.h       \
        timefuncs.h     \
        types.h         \
@@ -83,8 +82,6 @@ OTHER_SRC = \
        socket-private.h        \
        socket-wrappers.h       \
        status.h                \
-       system.c                \
-       system.h                \
        threads.h               \
        thread-private.h        \
        timefuncs.c             \
index ac064054bd10240cc24a53c8c139e8595a27764e..c6657dea405fae40128ca2d373287dabc312e384 100644 (file)
@@ -1503,6 +1503,13 @@ static int timedwait_signal_poll_cond (pthread_cond_t *cond, mono_mutex_t *mutex
        int ret;
 
        if (!alertable) {
+               /*
+                * pthread_cond_(timed)wait() can return 0 even if the condition was not
+                * signalled.  This happens at least on Darwin.  We surface this, i.e., we
+                * get spurious wake-ups.
+                *
+                * http://pubs.opengroup.org/onlinepubs/007908775/xsh/pthread_cond_wait.html
+                */
                if (timeout)
                        ret=mono_cond_timedwait (cond, mutex, timeout);
                else
index 913a08570a4706be089a033700e4e79c98011e03..cdb191f3171efc1ad6582ad4201bd023a61f65ca 100644 (file)
@@ -90,6 +90,7 @@
 #include <mono/utils/mono-membar.h>
 #include <mono/utils/mono-mutex.h>
 #include <mono/utils/mono-signal-handler.h>
+#include <mono/utils/mono-proclib.h>
 
 /* The process' environment strings */
 #if defined(__APPLE__) && !defined (__arm__) && !defined (__aarch64__)
@@ -838,7 +839,6 @@ gboolean CreateProcess (const gunichar2 *appname, const gunichar2 *cmdline,
        } else {
                if (!is_executable (prog)) {
                        DEBUG ("%s: Executable permisson not set on %s", __func__, prog);
-                       g_free (prog);
                        SetLastError (ERROR_ACCESS_DENIED);
                        goto free_strings;
                }
@@ -1309,11 +1309,19 @@ GetProcessTimes (gpointer process, WapiFileTime *create_time,
                /* Not sure if w32 allows NULLs here or not */
                return FALSE;
        
-       if (WAPI_IS_PSEUDO_PROCESS_HANDLE (process))
-               /* This is a pseudo handle, so just fail for now
-                */
-               return FALSE;
-       
+       if (WAPI_IS_PSEUDO_PROCESS_HANDLE (process)) {
+               gpointer pid = GINT_TO_POINTER (WAPI_HANDLE_TO_PID(process));
+               gint64 start_ticks, user_ticks, kernel_ticks;
+
+               mono_process_get_times (pid, &start_ticks, &user_ticks, &kernel_ticks);
+
+               _wapi_guint64_to_filetime (start_ticks, create_time);
+               _wapi_guint64_to_filetime (user_ticks, kernel_time);
+               _wapi_guint64_to_filetime (kernel_ticks, user_time);
+
+               return TRUE;
+       }
+
        process_handle = lookup_process_handle (process);
        if (!process_handle) {
                DEBUG ("%s: Can't find process %p", __func__, process);
diff --git a/mono/io-layer/system.c b/mono/io-layer/system.c
deleted file mode 100644 (file)
index 3a336ce..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * system.c:  System information
- *
- * Author:
- *     Dick Porter (dick@ximian.com)
- *
- * (C) 2002 Ximian, Inc.
- */
-
-#include <config.h>
-#include <glib.h>
-#include <sys/time.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include "mono/io-layer/wapi.h"
-
-void GetSystemInfo(WapiSystemInfo *info)
-{
-       info->dwPageSize=getpagesize();
-
-       /* Fill in the rest of this junk. Maybe with libgtop */
-#ifdef _SC_NPROCESSORS_ONLN
-       info->dwNumberOfProcessors = sysconf (_SC_NPROCESSORS_ONLN);
-       if (info->dwNumberOfProcessors <= 0)
-               info->dwNumberOfProcessors = 1;
-#else
-       info->dwNumberOfProcessors = 1;
-#endif
-}
-
-
diff --git a/mono/io-layer/system.h b/mono/io-layer/system.h
deleted file mode 100644 (file)
index 390b177..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * system.h:  System information
- *
- * Author:
- *     Dick Porter (dick@ximian.com)
- *
- * (C) 2002 Ximian, Inc.
- */
-
-#ifndef _WAPI_SYSTEM_H_
-#define _WAPI_SYSTEM_H_
-
-#include <glib.h>
-
-G_BEGIN_DECLS
-
-typedef struct _WapiSystemInfo WapiSystemInfo;
-
-struct _WapiSystemInfo 
-{
-       union _anon_union
-       {
-               guint32 dwOemId;
-               struct _anon_struct
-               {
-                       guint16 wProcessorArchitecture;
-                       guint16 wReserved;
-               } _anon_struct;
-       } _anon_union;
-       
-       guint32 dwPageSize;
-       gpointer lpMinimumApplicationAddress;
-       gpointer lpMaximumApplicationAddress;
-       guint32 /*_PTR?*/ dwActiveProcessorMask;
-       guint32 dwNumberOfProcessors;
-       guint32 dwProcessorType;
-       guint32 dwAllocationGranularity;
-       guint16 wProcessorLevel;
-       guint16 wProcessorRevision;
-};
-
-extern void GetSystemInfo(WapiSystemInfo *info);
-
-G_END_DECLS
-#endif /* _WAPI_SYSTEM_H_ */
index d2dbcbfaf1cd0944af16160cf53f03953d87ca74..13b6bd1401f0b9192d258690f512272d7176e71e 100644 (file)
@@ -30,7 +30,6 @@ extern gsize GetCurrentThreadId(void); /* NB return is 32bit in MS API */
 extern void Sleep(guint32 ms);
 extern guint32 SleepEx(guint32 ms, gboolean alertable);
 
-void wapi_interrupt_thread (gpointer handle);
 void wapi_clear_interruption (void);
 gboolean wapi_thread_set_wait_handle (gpointer handle);
 void wapi_thread_clear_wait_handle (gpointer handle);
index 120ce31774778abc0c355b050e52d54b1fe7353e..aa847569cb898c8e9087a5b285955d7cf53e85ae 100644 (file)
@@ -63,8 +63,6 @@ typedef WapiLargeInteger LARGE_INTEGER;
 typedef WapiLargeInteger *PLARGE_INTEGER;
 typedef WapiULargeInteger ULARGE_INTEGER;
 typedef WapiULargeInteger *PULARGE_INTEGER;
-typedef WapiSystemInfo SYSTEM_INFO;
-typedef WapiSystemInfo *LPSYSTEM_INFO;
 typedef WapiFloatingSaveArea FLOATING_SAVE_AREA;
 typedef WapiFloatingSaveArea *PFLOATING_SAVE_AREA;
 typedef WapiContext CONTEXT;
index e2c9639c3d4a57df5634e3a18c0542c4a11ae450..c2a89920c3469295084603cbc06377c335b92199 100644 (file)
@@ -26,7 +26,6 @@
 #include <mono/io-layer/semaphores.h>
 #include <mono/io-layer/sockets.h>
 #include <mono/io-layer/status.h>
-#include <mono/io-layer/system.h>
 #include <mono/io-layer/threads.h>
 #include <mono/io-layer/timefuncs.h>
 #include <mono/io-layer/versioninfo.h>
index 98a932b7e259eaf09de77597a67e5ebd8b2b6ae9..90a8cc4ffa855b6690c0895b78f9778b096f8b1b 100644 (file)
@@ -341,15 +341,6 @@ _wapi_thread_apc_pending (gpointer handle)
  * call the wait function again. This essentially means that the target thread will
  * busy wait until it is ready to process the interruption.
  */
-void
-wapi_interrupt_thread (gpointer thread_handle)
-{
-       gpointer wait_handle;
-
-       wait_handle = wapi_prepare_interrupt_thread (thread_handle);
-       wapi_finish_interrupt_thread (wait_handle);
-}
-
 gpointer
 wapi_prepare_interrupt_thread (gpointer thread_handle)
 {
index 0a6e4067d19b5f9fdf0d342c92d98c5d7c8f4919..1241a7a079e60d46d531e556a58f8ddd0bde10d0 100644 (file)
@@ -291,6 +291,8 @@ sgen_sources = \
        sgen-layout-stats.h     \
        sgen-qsort.c    \
        sgen-qsort.h    \
+       sgen-thread-pool.c      \
+       sgen-thread-pool.h      \
        sgen-tagged-pointer.h
 
 libmonoruntime_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(null_gc_sources) $(boehm_sources)
@@ -365,5 +367,5 @@ endif
 endif
 endif
 
-EXTRA_DIST = make-bundle.pl sample-bundle $(win32_sources) $(unix_sources) $(null_sources) runtime.h \
+EXTRA_DIST = $(win32_sources) $(unix_sources) $(null_sources) runtime.h \
                tpool-poll.c tpool-epoll.c tpool-kqueue.c
diff --git a/mono/metadata/TODO b/mono/metadata/TODO
deleted file mode 100644 (file)
index f37fd65..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-
-* Uniform names
-
-       We have a mess of names in the icall.c file, we need to sort that out.
index b959cb96b044c12c25bc6400171af99f58e92842..b010c10b5d7dcaf289b98933f0096c65915917d1 100644 (file)
@@ -78,7 +78,7 @@
  * Changes which are already detected at runtime, like the addition
  * of icalls, do not require an increment.
  */
-#define MONO_CORLIB_VERSION 125
+#define MONO_CORLIB_VERSION 129
 
 typedef struct
 {
@@ -2360,6 +2360,18 @@ mono_domain_unload (MonoDomain *domain)
                mono_raise_exception ((MonoException*)exc);
 }
 
+static guint32
+guarded_wait (HANDLE handle, guint32 timeout, gboolean alertable)
+{
+       guint32 result;
+
+       MONO_PREPARE_BLOCKING
+       result = WaitForSingleObjectEx (handle, timeout, alertable);
+       MONO_FINISH_BLOCKING
+
+       return result;
+}
+
 /*
  * mono_domain_unload:
  * @domain: The domain to unload
@@ -2446,7 +2458,7 @@ mono_domain_try_unload (MonoDomain *domain, MonoObject **exc)
        g_free (name);
 
        /* Wait for the thread */       
-       while (!thread_data->done && WaitForSingleObjectEx (thread_handle, INFINITE, TRUE) == WAIT_IO_COMPLETION) {
+       while (!thread_data->done && guarded_wait (thread_handle, INFINITE, TRUE) == WAIT_IO_COMPLETION) {
                if (mono_thread_internal_has_appdomain_ref (mono_thread_internal_current (), domain) && (mono_thread_interruption_requested ())) {
                        /* The unload thread tries to abort us */
                        /* The icall wrapper will execute the abort */
index 36080792d107ea526d24586b69dd865113d6cf60..832c8b7e802aa4b2da462e576fa92dc566235346 100644 (file)
@@ -567,10 +567,10 @@ struct _MonoGenericParam {
        MonoGenericContainer *owner;
        guint16 num;
        /*
-        * If != 0, this is a generated generic param used by the JIT to implement generic
+        * If != NULL, this is a generated generic param used by the JIT to implement generic
         * sharing.
         */
-       MonoTypeEnum gshared_constraint;
+       MonoType *gshared_constraint;
        /* 
         * If owner is NULL, or owner is 'owned' by this gparam,
         * then this is the image whose mempool this struct was allocated from.
@@ -1062,7 +1062,6 @@ mono_inflate_generic_signature (MonoMethodSignature *sig, MonoGenericContext *co
 
 typedef struct {
        MonoImage *corlib;
-       MonoImage *system;
        MonoClass *object_class;
        MonoClass *byte_class;
        MonoClass *void_class;
@@ -1091,6 +1090,7 @@ typedef struct {
        MonoClass *methodhandle_class;
        MonoClass *systemtype_class;
        MonoClass *monotype_class;
+       MonoClass *runtimetype_class;
        MonoClass *exception_class;
        MonoClass *threadabortexception_class;
        MonoClass *thread_class;
@@ -1406,6 +1406,9 @@ mono_class_get_checked (MonoImage *image, guint32 type_token, MonoError *error);
 MonoClass *
 mono_class_get_and_inflate_typespec_checked (MonoImage *image, guint32 type_token, MonoGenericContext *context, MonoError *error);
 
+MonoClass *
+mono_class_from_name_checked (MonoImage *image, const char* name_space, const char *name, MonoError *error);
+
 MonoClass *
 mono_class_from_name_case_checked (MonoImage *image, const char* name_space, const char *name, MonoError *error);
 
index 4148bec95083759ff96f247783820d91be3ccdb6..f508da0d2965d0fa4072a6a483a1d584713f1bb1 100644 (file)
@@ -196,13 +196,13 @@ mono_class_from_typeref_checked (MonoImage *image, guint32 type_token, MonoError
                The defacto behavior is that it's just a typedef in disguise.
                */
                /* a typedef in disguise */
-               res = mono_class_from_name (image, nspace, name); /*FIXME proper error handling*/
+               res = mono_class_from_name_checked (image, nspace, name, error);
                goto done;
 
        case MONO_RESOLUTION_SCOPE_MODULEREF:
                module = mono_image_load_module (image, idx);
                if (module)
-                       res = mono_class_from_name (module, nspace, name); /*FIXME proper error handling*/
+                       res = mono_class_from_name_checked (module, nspace, name, error);
                goto done;
 
        case MONO_RESOLUTION_SCOPE_TYPEREF: {
@@ -266,8 +266,7 @@ mono_class_from_typeref_checked (MonoImage *image, guint32 type_token, MonoError
                return NULL;
        }
 
-       /* FIXME this leaks loader errors */
-       res = mono_class_from_name (image->references [idx - 1]->image, nspace, name);
+       res = mono_class_from_name_checked (image->references [idx - 1]->image, nspace, name, error);
 
 done:
        /* Generic case, should be avoided for when a better error is possible. */
@@ -1767,7 +1766,7 @@ mono_type_get_basic_type_from_generic (MonoType *type)
 {
        /* When we do generic sharing we let type variables stand for reference/primitive types. */
        if (!type->byref && (type->type == MONO_TYPE_VAR || type->type == MONO_TYPE_MVAR) &&
-               (!type->data.generic_param->gshared_constraint || type->data.generic_param->gshared_constraint == MONO_TYPE_OBJECT))
+               (!type->data.generic_param->gshared_constraint || type->data.generic_param->gshared_constraint->type == MONO_TYPE_OBJECT))
                return &mono_defaults.object_class->byval_arg;
        return type;
 }
@@ -6051,7 +6050,13 @@ mono_generic_class_get_class (MonoGenericClass *gclass)
        mono_generic_class_setup_parent (klass, gklass);
 
        if (gclass->is_dynamic) {
-               klass->inited = 1;
+               /*
+                * We don't need to do any init workf with unbaked typebuilders. Generic instances created at this point will be later unregistered and/or fixed.
+                * This is to avoid work that would probably give wrong results as fields change as we build the TypeBuilder.
+                * See remove_instantiations_of_and_ensure_contents in reflection.c and its usage in reflection.c to understand the fixup stage of SRE banking.
+               */
+               if (!gklass->wastypebuilder)
+                       klass->inited = 1;
 
                mono_class_setup_supertypes (klass);
 
@@ -6185,19 +6190,31 @@ make_generic_param_class (MonoGenericParam *param, MonoImage *image, gboolean is
 static MonoClass *
 get_anon_gparam_class (MonoGenericParam *param, gboolean is_mvar, gboolean take_lock)
 {
-       int n = mono_generic_param_num (param) | ((guint32)param->gshared_constraint << 16);
+       int n = mono_generic_param_num (param);
        MonoImage *image = param->image;
+       MonoClass *klass = NULL;
        GHashTable *ht;
 
        g_assert (image);
 
+       if (param->gshared_constraint) {
+               ht = is_mvar ? image->mvar_cache_constrained : image->var_cache_constrained;
+               if (ht) {
+                       if (take_lock)
+                               mono_image_lock (image);
+                       klass = g_hash_table_lookup (ht, param);
+                       if (take_lock)
+                               mono_image_unlock (image);
+               }
+               return klass;
+       }
+
        if (n < FAST_CACHE_SIZE) {
                if (is_mvar)
                        return image->mvar_cache_fast ? image->mvar_cache_fast [n] : NULL;
                else
                        return image->var_cache_fast ? image->var_cache_fast [n] : NULL;
        } else {
-               MonoClass *klass = NULL;
                ht = is_mvar ? image->mvar_cache_slow : image->var_cache_slow;
                if (ht) {
                        if (take_lock)
@@ -6216,12 +6233,23 @@ get_anon_gparam_class (MonoGenericParam *param, gboolean is_mvar, gboolean take_
 static void
 set_anon_gparam_class (MonoGenericParam *param, gboolean is_mvar, MonoClass *klass)
 {
-       int n = mono_generic_param_num (param) | ((guint32)param->gshared_constraint << 16);
+       int n = mono_generic_param_num (param);
        MonoImage *image = param->image;
 
        g_assert (image);
 
-       if (n < FAST_CACHE_SIZE) {
+       if (param->gshared_constraint) {
+               GHashTable *ht = is_mvar ? image->mvar_cache_constrained : image->var_cache_constrained;
+               if (!ht) {
+                       ht = g_hash_table_new ((GHashFunc)mono_metadata_generic_param_hash, (GEqualFunc)mono_metadata_generic_param_equal);
+                       mono_memory_barrier ();
+                       if (is_mvar)
+                               image->mvar_cache_constrained = ht;
+                       else
+                               image->var_cache_constrained = ht;
+               }
+               g_hash_table_insert (ht, param, klass);
+       } else if (n < FAST_CACHE_SIZE) {
                if (is_mvar) {
                        /* Requires locking to avoid droping an already published class */
                        if (!image->mvar_cache_fast)
@@ -7676,23 +7704,9 @@ search_modules (MonoImage *image, const char *name_space, const char *name)
        return NULL;
 }
 
-/**
- * mono_class_from_name:
- * @image: The MonoImage where the type is looked up in
- * @name_space: the type namespace
- * @name: the type short name.
- *
- * Obtains a MonoClass with a given namespace and a given name which
- * is located in the given MonoImage.
- *
- * To reference nested classes, use the "/" character as a separator.
- * For example use "Foo/Bar" to reference the class Bar that is nested
- * inside Foo, like this: "class Foo { class Bar {} }".
- */
 MonoClass *
-mono_class_from_name (MonoImage *image, const char* name_space, const char *name)
+mono_class_from_name_checked (MonoImage *image, const char* name_space, const char *name, MonoError *error)
 {
-       MonoError error;
        GHashTable *nspace_table;
        MonoImage *loaded_image;
        guint32 token = 0;
@@ -7701,6 +7715,8 @@ mono_class_from_name (MonoImage *image, const char* name_space, const char *name
        char *nested;
        char buf [1024];
 
+       mono_error_init (error);
+
        if ((nested = strchr (name, '/'))) {
                int pos = nested - name;
                int len = strlen (name);
@@ -7794,14 +7810,37 @@ mono_class_from_name (MonoImage *image, const char* name_space, const char *name
 
        token = MONO_TOKEN_TYPE_DEF | token;
 
-       class = mono_class_get_checked (image, token, &error);
+       class = mono_class_get_checked (image, token, error);
+       if (nested)
+               return return_nested_in (class, nested);
+       return class;
+}
+
+/**
+ * mono_class_from_name:
+ * @image: The MonoImage where the type is looked up in
+ * @name_space: the type namespace
+ * @name: the type short name.
+ *
+ * Obtains a MonoClass with a given namespace and a given name which
+ * is located in the given MonoImage.
+ *
+ * To reference nested classes, use the "/" character as a separator.
+ * For example use "Foo/Bar" to reference the class Bar that is nested
+ * inside Foo, like this: "class Foo { class Bar {} }".
+ */
+MonoClass *
+mono_class_from_name (MonoImage *image, const char* name_space, const char *name)
+{
+       MonoError error;
+       MonoClass *klass;
+
+       klass = mono_class_from_name_checked (image, name_space, name, &error);
        if (!mono_error_ok (&error)) {
                mono_loader_set_error_from_mono_error (&error);
                mono_error_cleanup (&error); /* FIXME Don't swallow the error */
        }
-       if (nested)
-               return return_nested_in (class, nested);
-       return class;
+       return klass;
 }
 
 /**
index 47a4ed06ca805dbd598e47cb196a27f210192d64..9330f0fb57b5bb2d6f3d7212a1850ef948fb3333 100644 (file)
@@ -55,8 +55,13 @@ static const uint32_t ten_to_ten_div_4 = 2500000000U;
 #define DECIMAL_LO32(dec)        ((dec).v.v.Lo32)
 #define DECIMAL_MID32(dec)       ((dec).v.v.Mid32)
 #define DECIMAL_HI32(dec)        ((dec).Hi32)
-#define DECIMAL_LO64_GET(dec)    ((dec).v.Lo64)
-#define DECIMAL_LO64_SET(dec,value)   {(dec).v.Lo64 = value; }
+#if G_BYTE_ORDER != G_LITTLE_ENDIAN
+# define DECIMAL_LO64_GET(dec)   (((uint64_t)((dec).v.v.Mid32) << 32) | (dec).v.v.Lo32)
+# define DECIMAL_LO64_SET(dec,value)   {(dec).v.v.Lo32 = (value); (dec).v.v.Mid32 = ((value) >> 32); }
+#else
+# define DECIMAL_LO64_GET(dec)    ((dec).v.Lo64)
+# define DECIMAL_LO64_SET(dec,value)   {(dec).v.Lo64 = value; }
+#endif
 
 #define DECIMAL_SETZERO(dec) {DECIMAL_LO32(dec) = 0; DECIMAL_MID32(dec) = 0; DECIMAL_HI32(dec) = 0; DECIMAL_SIGNSCALE(dec) = 0;}
 #define COPYDEC(dest, src) {DECIMAL_SIGNSCALE(dest) = DECIMAL_SIGNSCALE(src); DECIMAL_HI32(dest) = DECIMAL_HI32(src); \
@@ -2215,6 +2220,8 @@ mono_decimal_compare (MonoDecimal *left, MonoDecimal *right)
        uint32_t   right_sign;
        MonoDecimal result;
 
+       result.Hi32 = 0;        // Just to shut up the compiler
+
        // First check signs and whether either are zero.  If both are
        // non-zero and of the same sign, just use subtraction to compare.
        //
index 317db53276f91980f8cdc758f9a9fac8d589b570..a5fc96dec612bcc55e66d709aff4f89e8cef9f67 100644 (file)
@@ -210,6 +210,7 @@ struct _MonoJitInfo {
                MonoMethod *method;
                MonoImage *image;
                gpointer aot_info;
+               gpointer tramp_info;
        } d;
        struct _MonoJitInfo *next_jit_code_hash;
        gpointer    code_start;
@@ -230,6 +231,11 @@ struct _MonoJitInfo {
        gboolean    async:1;
        gboolean    dbg_step_through:1;
        gboolean    dbg_non_user_code:1;
+       /*
+        * Whenever this jit info refers to a trampoline.
+        * d.tramp_info contains additional data in this case.
+        */
+       gboolean    is_trampoline:1;
 
        /* FIXME: Embed this after the structure later*/
        gpointer    gc_info; /* Currently only used by SGen */
@@ -685,7 +691,7 @@ void mono_reflection_cleanup_domain (MonoDomain *domain);
 
 void mono_assembly_cleanup_domain_bindings (guint32 domain_id);
 
-MonoJitInfo* mono_jit_info_table_find_internal (MonoDomain *domain, char *addr, gboolean try_aot);
+MonoJitInfo* mono_jit_info_table_find_internal (MonoDomain *domain, char *addr, gboolean try_aot, gboolean allow_trampolines);
 
 void mono_enable_debug_domain_unload (gboolean enable);
 
index 801d58e41629f0b6beefca40b87d97271b9d2ba1..37058adb8900d853f0ae96cd48fb94f845429a9c 100755 (executable)
@@ -600,9 +600,6 @@ mono_init_internal (const char *filename, const char *exe_filename, const char *
        }
        mono_defaults.corlib = mono_assembly_get_image (ass);
 
-       /* might be NULL if System.dll is not yet loaded */
-       mono_defaults.system = mono_image_loaded ("System");
-
        mono_defaults.object_class = mono_class_from_name (
                 mono_defaults.corlib, "System", "Object");
        g_assert (mono_defaults.object_class != 0);
@@ -716,6 +713,10 @@ mono_init_internal (const char *filename, const char *exe_filename, const char *
                 mono_defaults.corlib, "System", "MonoType");
        g_assert (mono_defaults.monotype_class != 0);
 
+       mono_defaults.runtimetype_class = mono_class_from_name (
+                mono_defaults.corlib, "System", "RuntimeType");
+       g_assert (mono_defaults.runtimetype_class != 0);
+
        mono_defaults.exception_class = mono_class_from_name (
                 mono_defaults.corlib, "System", "Exception");
        g_assert (mono_defaults.exception_class != 0);
@@ -1922,9 +1923,9 @@ mono_get_aot_cache_config (void)
 void
 mono_domain_lock (MonoDomain *domain)
 {
-       MONO_PREPARE_BLOCKING
+       MONO_TRY_BLOCKING
        mono_locks_acquire (&(domain)->lock, DomainLock);
-       MONO_FINISH_BLOCKING
+       MONO_FINISH_TRY_BLOCKING
 }
 
 void
index e4b2bd75d6d38df474fa2cb11d08c8351c8ab3a2..227b3cc96971a800e71c7a85bae27f3c8dcd2859 100644 (file)
@@ -9,7 +9,7 @@
 
 #include <config.h>
 
-#ifndef TARGET_WIN32
+#ifndef HOST_WIN32
 
 #include <glib.h>
 #include <string.h>
index 78203ad47a81c5b53c252604e07d0f65e6ec3f05..56d598ee7f21523345f5187b5f8e09cf00eab753 100644 (file)
@@ -9,7 +9,7 @@
 
 #include <config.h>
 
-#ifdef TARGET_WIN32
+#ifdef HOST_WIN32
 
 #include <glib.h>
 #include <string.h>
index 30179bd9fbaa61bd00f982b0db376fcd16b1ebbd..c942c0ecebd08facfee099919bc950bd7cd9f3da 100644 (file)
@@ -86,6 +86,18 @@ static HANDLE shutdown_event;
 
 GCStats gc_stats;
 
+static guint32
+guarded_wait (HANDLE handle, guint32 timeout, gboolean alertable)
+{
+       guint32 result;
+
+       MONO_PREPARE_BLOCKING
+       result = WaitForSingleObjectEx (handle, timeout, alertable);
+       MONO_FINISH_BLOCKING
+
+       return result;
+}
+
 static void
 add_thread_to_finalize (MonoInternalThread *thread)
 {
@@ -399,7 +411,7 @@ mono_domain_finalize (MonoDomain *domain, guint32 timeout)
                timeout = INFINITE;
 
        while (TRUE) {
-               res = WaitForSingleObjectEx (done_event, timeout, TRUE);
+               res = guarded_wait (done_event, timeout, TRUE);
                /* printf ("WAIT RES: %d.\n", res); */
 
                if (res == WAIT_IO_COMPLETION) {
@@ -497,7 +509,7 @@ ves_icall_System_GC_WaitForPendingFinalizers (void)
        ResetEvent (pending_done_event);
        mono_gc_finalize_notify ();
        /* g_print ("Waiting for pending finalizers....\n"); */
-       WaitForSingleObjectEx (pending_done_event, INFINITE, TRUE);
+       guarded_wait (pending_done_event, INFINITE, TRUE);
        /* g_print ("Done pending....\n"); */
 #endif
 }
@@ -1210,7 +1222,7 @@ mono_gc_cleanup (void)
                        mono_gc_finalize_notify ();
                        /* Finishing the finalizer thread, so wait a little bit... */
                        /* MS seems to wait for about 2 seconds */
-                       if (WaitForSingleObjectEx (shutdown_event, 2000, FALSE) == WAIT_TIMEOUT) {
+                       if (guarded_wait (shutdown_event, 2000, FALSE) == WAIT_TIMEOUT) {
                                int ret;
 
                                /* Set a flag which the finalizer thread can check */
@@ -1220,7 +1232,7 @@ mono_gc_cleanup (void)
                                mono_thread_internal_stop (gc_thread);
 
                                /* Wait for it to stop */
-                               ret = WaitForSingleObjectEx (gc_thread->handle, 100, TRUE);
+                               ret = guarded_wait (gc_thread->handle, 100, TRUE);
 
                                if (ret == WAIT_TIMEOUT) {
                                        /* 
@@ -1237,7 +1249,7 @@ mono_gc_cleanup (void)
                                int ret;
 
                                /* Wait for the thread to actually exit */
-                               ret = WaitForSingleObjectEx (gc_thread->handle, INFINITE, TRUE);
+                               ret = guarded_wait (gc_thread->handle, INFINITE, TRUE);
                                g_assert (ret == WAIT_OBJECT_0);
 
                                mono_thread_join (GUINT_TO_POINTER (gc_thread->tid));
index 87bb85e566447bb2dec2f28fb270b6035a4fb0e1..e72d85be37ffaf435443b117cfef64f885b6b0d3 100644 (file)
@@ -105,10 +105,10 @@ ICALL(ARRAY_12, "SetValue",         ves_icall_System_Array_SetValue)
 ICALL(ARRAY_13, "SetValueImpl",     ves_icall_System_Array_SetValueImpl)
 
 ICALL_TYPE(BUFFER, "System.Buffer", BUFFER_1)
-ICALL(BUFFER_1, "BlockCopyInternal", ves_icall_System_Buffer_BlockCopyInternal)
-ICALL(BUFFER_2, "ByteLengthInternal", ves_icall_System_Buffer_ByteLengthInternal)
-ICALL(BUFFER_3, "GetByteInternal", ves_icall_System_Buffer_GetByteInternal)
-ICALL(BUFFER_4, "SetByteInternal", ves_icall_System_Buffer_SetByteInternal)
+ICALL(BUFFER_1, "InternalBlockCopy", ves_icall_System_Buffer_BlockCopyInternal)
+ICALL(BUFFER_2, "_ByteLength", ves_icall_System_Buffer_ByteLengthInternal)
+ICALL(BUFFER_3, "_GetByte", ves_icall_System_Buffer_GetByteInternal)
+ICALL(BUFFER_4, "_SetByte", ves_icall_System_Buffer_SetByteInternal)
 
 ICALL_TYPE (COMPO_W, "System.ComponentModel.Win32Exception", COMPO_W_1)
 ICALL (COMPO_W_1, "W32ErrorMessage", ves_icall_System_ComponentModel_Win32Exception_W32ErrorMessage)
@@ -426,22 +426,22 @@ ICALL(SOCK_6, "Connect_internal(intptr,System.Net.SocketAddress,int&)", ves_ical
 ICALL (SOCK_6a, "Disconnect_internal(intptr,bool,int&)", ves_icall_System_Net_Sockets_Socket_Disconnect_internal)
 ICALL(SOCK_7, "GetSocketOption_arr_internal(intptr,System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName,byte[]&,int&)", ves_icall_System_Net_Sockets_Socket_GetSocketOption_arr_internal)
 ICALL(SOCK_8, "GetSocketOption_obj_internal(intptr,System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName,object&,int&)", ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal)
+ICALL(SOCK_21, "IOControl_internal(intptr,int,byte[],byte[],int&)", ves_icall_System_Net_Sockets_Socket_IOControl_internal)
 ICALL(SOCK_9, "Listen_internal(intptr,int,int&)", ves_icall_System_Net_Sockets_Socket_Listen_internal)
 ICALL(SOCK_10, "LocalEndPoint_internal(intptr,int,int&)", ves_icall_System_Net_Sockets_Socket_LocalEndPoint_internal)
 ICALL(SOCK_11, "Poll_internal", ves_icall_System_Net_Sockets_Socket_Poll_internal)
+ICALL(SOCK_13, "ReceiveFrom_internal(intptr,byte[],int,int,System.Net.Sockets.SocketFlags,System.Net.SocketAddress&,int&)", ves_icall_System_Net_Sockets_Socket_ReceiveFrom_internal)
 ICALL(SOCK_11a, "Receive_internal(intptr,System.Net.Sockets.Socket/WSABUF[],System.Net.Sockets.SocketFlags,int&)", ves_icall_System_Net_Sockets_Socket_Receive_array_internal)
 ICALL(SOCK_12, "Receive_internal(intptr,byte[],int,int,System.Net.Sockets.SocketFlags,int&)", ves_icall_System_Net_Sockets_Socket_Receive_internal)
-ICALL(SOCK_13, "RecvFrom_internal(intptr,byte[],int,int,System.Net.Sockets.SocketFlags,System.Net.SocketAddress&,int&)", ves_icall_System_Net_Sockets_Socket_RecvFrom_internal)
 ICALL(SOCK_14, "RemoteEndPoint_internal(intptr,int,int&)", ves_icall_System_Net_Sockets_Socket_RemoteEndPoint_internal)
 ICALL(SOCK_15, "Select_internal(System.Net.Sockets.Socket[]&,int,int&)", ves_icall_System_Net_Sockets_Socket_Select_internal)
-ICALL(SOCK_15a, "SendFile(intptr,string,byte[],byte[],System.Net.Sockets.TransmitFileOptions)", ves_icall_System_Net_Sockets_Socket_SendFile)
+ICALL(SOCK_15a, "SendFile_internal(intptr,string,byte[],byte[],System.Net.Sockets.TransmitFileOptions)", ves_icall_System_Net_Sockets_Socket_SendFile_internal)
 ICALL(SOCK_16, "SendTo_internal(intptr,byte[],int,int,System.Net.Sockets.SocketFlags,System.Net.SocketAddress,int&)", ves_icall_System_Net_Sockets_Socket_SendTo_internal)
 ICALL(SOCK_16a, "Send_internal(intptr,System.Net.Sockets.Socket/WSABUF[],System.Net.Sockets.SocketFlags,int&)", ves_icall_System_Net_Sockets_Socket_Send_array_internal)
 ICALL(SOCK_17, "Send_internal(intptr,byte[],int,int,System.Net.Sockets.SocketFlags,int&)", ves_icall_System_Net_Sockets_Socket_Send_internal)
 ICALL(SOCK_18, "SetSocketOption_internal(intptr,System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName,object,byte[],int,int&)", ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal)
 ICALL(SOCK_19, "Shutdown_internal(intptr,System.Net.Sockets.SocketShutdown,int&)", ves_icall_System_Net_Sockets_Socket_Shutdown_internal)
 ICALL(SOCK_20, "Socket_internal(System.Net.Sockets.AddressFamily,System.Net.Sockets.SocketType,System.Net.Sockets.ProtocolType,int&)", ves_icall_System_Net_Sockets_Socket_Socket_internal)
-ICALL(SOCK_21, "WSAIoctl(intptr,int,byte[],byte[],int&)", ves_icall_System_Net_Sockets_Socket_WSAIoctl)
 ICALL(SOCK_21a, "cancel_blocking_socket_operation", icall_cancel_blocking_socket_operation)
 ICALL(SOCK_22, "socket_pool_queue", icall_append_io_job)
 
@@ -599,10 +599,10 @@ ICALL(MGENCL_6, "register_with_runtime", mono_reflection_register_with_runtime)
 ICALL_TYPE(MGENM, "System.Reflection.MonoGenericMethod", MGENM_1)
 ICALL(MGENM_1, "get_ReflectedType", ves_icall_MonoGenericMethod_get_ReflectedType)
 
-ICALL_TYPE(MMETH, "System.Reflection.MonoMethod", MMETH_1)
-ICALL(MMETH_1, "GetDllImportAttribute", ves_icall_MonoMethod_GetDllImportAttribute)
+ICALL_TYPE(MMETH, "System.Reflection.MonoMethod", MMETH_2)
 ICALL(MMETH_2, "GetGenericArguments", ves_icall_MonoMethod_GetGenericArguments)
 ICALL(MMETH_3, "GetGenericMethodDefinition_impl", ves_icall_MonoMethod_GetGenericMethodDefinition)
+ICALL(MMETH_11, "GetPInvoke", ves_icall_MonoMethod_GetPInvoke)
 ICALL(MMETH_4, "InternalInvoke", ves_icall_InternalInvoke)
 ICALL(MMETH_5, "MakeGenericMethod_impl", mono_reflection_bind_generic_method_parameters)
 ICALL(MMETH_6, "get_IsGenericMethod", ves_icall_MonoMethod_get_IsGenericMethod)
@@ -721,6 +721,10 @@ ICALL(REMSER_1, "InternalExecute", ves_icall_InternalExecute)
 ICALL(REMSER_2, "IsTransparentProxy", ves_icall_IsTransparentProxy)
 #endif
 
+ICALL_TYPE(RVH, "System.Runtime.Versioning.VersioningHelper", RVH_1)
+ICALL(RVH_1, "GetCurrentProcessId", ves_icall_System_Diagnostics_Process_GetPid_internal)
+ICALL(RVH_2, "GetRuntimeId", ves_icall_System_Runtime_Versioning_VersioningHelper_GetRuntimeId)
+
 ICALL_TYPE(RFH, "System.RuntimeFieldHandle", RFH_1)
 ICALL(RFH_1, "SetValueDirect", ves_icall_System_RuntimeFieldHandle_SetValueDirect)
 ICALL(RFH_2, "SetValueInternal", ves_icall_MonoField_SetValueInternal)
@@ -733,7 +737,7 @@ ICALL(RT_1, "CreateInstanceInternal", ves_icall_System_Activator_CreateInstanceI
 ICALL(RT_2, "GetConstructors_internal", ves_icall_Type_GetConstructors_internal)
 ICALL(RT_3, "GetEvents_internal", ves_icall_Type_GetEvents_internal)
 ICALL(RT_5, "GetFields_internal", ves_icall_Type_GetFields_internal)
-ICALL(RT_6, "GetGenericArguments", ves_icall_MonoType_GetGenericArguments)
+ICALL(RT_6, "GetGenericArgumentsInternal", ves_icall_MonoType_GetGenericArguments)
 ICALL(RT_7, "GetGenericParameterAttributes", ves_icall_Type_GetGenericParameterAttributes)
 ICALL(RT_8, "GetGenericParameterConstraints_impl", ves_icall_Type_GetGenericParameterConstraints)
 ICALL(RT_9, "GetGenericParameterPosition", ves_icall_Type_GetGenericParameterPosition)
index 056e76eada46bdee71cbe5c52eaecf6548181f40..62040ceb6d928807e6769975538f9e9400d2c25f 100644 (file)
@@ -2293,31 +2293,38 @@ ves_icall_MonoType_GetArrayRank (MonoReflectionType *type)
        return class->rank;
 }
 
+static MonoArray*
+create_type_array (MonoDomain *domain, MonoBoolean runtimeTypeArray, int count)
+{
+       MonoArray *res;
+       res = mono_array_new (domain, runtimeTypeArray ? mono_defaults.runtimetype_class : mono_defaults.systemtype_class, count);
+       return res;
+}
+
 ICALL_EXPORT MonoArray*
-ves_icall_MonoType_GetGenericArguments (MonoReflectionType *type)
+ves_icall_MonoType_GetGenericArguments (MonoReflectionType *type, MonoBoolean runtimeTypeArray)
 {
        MonoArray *res;
        MonoClass *klass, *pklass;
        MonoDomain *domain = mono_object_domain (type);
-       MonoVTable *array_vtable = mono_class_vtable_full (domain, mono_array_class_get_cached (mono_defaults.systemtype_class, 1), TRUE);
        int i;
 
        klass = mono_class_from_mono_type (type->type);
 
        if (klass->generic_container) {
                MonoGenericContainer *container = klass->generic_container;
-               res = mono_array_new_specific (array_vtable, container->type_argc);
+               res = create_type_array (domain, runtimeTypeArray, container->type_argc);
                for (i = 0; i < container->type_argc; ++i) {
                        pklass = mono_class_from_generic_parameter (mono_generic_container_get_param (container, i), klass->image, FALSE);
                        mono_array_setref (res, i, mono_type_get_object (domain, &pklass->byval_arg));
                }
        } else if (klass->generic_class) {
                MonoGenericInst *inst = klass->generic_class->context.class_inst;
-               res = mono_array_new_specific (array_vtable, inst->type_argc);
+               res = create_type_array (domain, runtimeTypeArray, inst->type_argc);
                for (i = 0; i < inst->type_argc; ++i)
                        mono_array_setref (res, i, mono_type_get_object (domain, inst->type_argv [i]));
        } else {
-               res = mono_array_new_specific (array_vtable, 0);
+               res = NULL;
        }
        return res;
 }
@@ -2518,14 +2525,12 @@ ves_icall_MonoType_get_DeclaringMethod (MonoReflectionType *ref_type)
        return mono_method_get_object (mono_object_domain (ref_type), method, method->klass);
 }
 
-ICALL_EXPORT MonoReflectionDllImportAttribute*
-ves_icall_MonoMethod_GetDllImportAttribute (MonoMethod *method)
+ICALL_EXPORT void
+ves_icall_MonoMethod_GetPInvoke (MonoReflectionMethod *method, int* flags, MonoString** entry_point, MonoString** dll_name)
 {
-       static MonoClass *DllImportAttributeClass = NULL;
        MonoDomain *domain = mono_domain_get ();
-       MonoReflectionDllImportAttribute *attr;
-       MonoImage *image = method->klass->image;
-       MonoMethodPInvoke *piinfo = (MonoMethodPInvoke *)method;
+       MonoImage *image = method->method->klass->image;
+       MonoMethodPInvoke *piinfo = (MonoMethodPInvoke *)method->method;
        MonoTableInfo *tables = image->tables;
        MonoTableInfo *im = &tables [MONO_TABLE_IMPLMAP];
        MonoTableInfo *mr = &tables [MONO_TABLE_MODULEREF];
@@ -2533,22 +2538,10 @@ ves_icall_MonoMethod_GetDllImportAttribute (MonoMethod *method)
        guint32 scope_token;
        const char *import = NULL;
        const char *scope = NULL;
-       guint32 flags;
-
-       if (!(method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL))
-               return NULL;
 
-       if (!DllImportAttributeClass) {
-               DllImportAttributeClass = 
-                       mono_class_from_name (mono_defaults.corlib,
-                                                                 "System.Runtime.InteropServices", "DllImportAttribute");
-               g_assert (DllImportAttributeClass);
-       }
-                                                                                                               
-       if (image_is_dynamic (method->klass->image)) {
+       if (image_is_dynamic (image)) {
                MonoReflectionMethodAux *method_aux = 
-                       g_hash_table_lookup (
-                                                                         ((MonoDynamicImage*)method->klass->image)->method_aux_hash, method);
+                       g_hash_table_lookup (((MonoDynamicImage*)image)->method_aux_hash, method->method);
                if (method_aux) {
                        import = method_aux->dllentry;
                        scope = method_aux->dll;
@@ -2556,7 +2549,7 @@ ves_icall_MonoMethod_GetDllImportAttribute (MonoMethod *method)
 
                if (!import || !scope) {
                        mono_set_pending_exception (mono_get_exception_argument ("method", "System.Reflection.Emit method with invalid pinvoke information"));
-                       return NULL;
+                       return;
                }
        }
        else {
@@ -2569,23 +2562,10 @@ ves_icall_MonoMethod_GetDllImportAttribute (MonoMethod *method)
                        scope = mono_metadata_string_heap (image, scope_token);
                }
        }
-       flags = piinfo->piflags;
        
-       attr = (MonoReflectionDllImportAttribute*)mono_object_new (domain, DllImportAttributeClass);
-
-       MONO_OBJECT_SETREF (attr, dll, mono_string_new (domain, scope));
-       MONO_OBJECT_SETREF (attr, entry_point, mono_string_new (domain, import));
-       attr->call_conv = (flags & 0x700) >> 8;
-       attr->charset = ((flags & 0x6) >> 1) + 1;
-       if (attr->charset == 1)
-               attr->charset = 2;
-       attr->exact_spelling = (flags & 0x1) != 0;
-       attr->set_last_error = (flags & 0x40) != 0;
-       attr->best_fit_mapping = (flags & 0x30) == 0x10;
-       attr->throw_on_unmappable = (flags & 0x3000) == 0x1000;
-       attr->preserve_sig = FALSE;
-
-       return attr;
+       *flags = piinfo->piflags;
+       *entry_point = mono_string_new (domain, import);
+       *dll_name = mono_string_new (domain, scope);
 }
 
 ICALL_EXPORT MonoReflectionMethod *
@@ -2783,15 +2763,19 @@ ves_icall_InternalInvoke (MonoReflectionMethod *method, MonoObject *this, MonoAr
 
                if (m->klass->rank == pcount) {
                        /* Only lengths provided. */
-                       lower_bounds = NULL;
+                       return (MonoObject*)mono_array_new_full (mono_object_domain (params), m->klass, lengths, NULL);
                } else {
                        g_assert (pcount == (m->klass->rank * 2));
-                       /* lower bounds are first. */
-                       lower_bounds = (intptr_t*)lengths;
-                       lengths += m->klass->rank;
-               }
+                       /* The arguments are lower-bound-length pairs */
+                       lower_bounds = g_alloca (sizeof (intptr_t) * pcount);
+
+                       for (i = 0; i < pcount / 2; ++i) {
+                               lower_bounds [i] = *(int32_t*) ((char*)mono_array_get (params, gpointer, (i * 2)) + sizeof (MonoObject));
+                               lengths [i] = *(int32_t*) ((char*)mono_array_get (params, gpointer, (i * 2) + 1) + sizeof (MonoObject));
+                       }
 
-               return (MonoObject*)mono_array_new_full (mono_object_domain (params), m->klass, lengths, lower_bounds);
+                       return (MonoObject*)mono_array_new_full (mono_object_domain (params), m->klass, lengths, lower_bounds);
+               }
        }
        return mono_runtime_invoke_array (m, obj, params, NULL);
 }
@@ -6461,6 +6445,12 @@ ves_icall_System_Environment_BroadcastSettingChange (void)
 #endif
 }
 
+ICALL_EXPORT gint32
+ves_icall_System_Runtime_Versioning_VersioningHelper_GetRuntimeId (void)
+{
+       return 9;
+}
+
 ICALL_EXPORT void
 ves_icall_MonoMethodMessage_InitMessage (MonoMethodMessage *this, 
                                         MonoReflectionMethod *method,
@@ -6996,8 +6986,8 @@ mono_TypedReference_MakeTypedReferenceInternal (MonoObject *target, MonoArray *f
        MonoTypedRef res;
        MonoReflectionField *f;
        MonoClass *klass;
-       MonoType *ftype;
-       guint8 *p;
+       MonoType *ftype = NULL;
+       guint8 *p = NULL;
        int i;
 
        memset (&res, 0, sizeof (res));
index 1e9596cff5d1b321602945115e868ffdb90d2a83..efea4081e219c6b345041d8c1cadaf48ee8ab75d 100644 (file)
@@ -1642,8 +1642,9 @@ mono_image_close_except_pools (MonoImage *image)
        free_hash (image->thunk_invoke_cache);
        free_hash (image->var_cache_slow);
        free_hash (image->mvar_cache_slow);
+       free_hash (image->var_cache_constrained);
+       free_hash (image->mvar_cache_constrained);
        free_hash (image->wrapper_param_names);
-       free_hash (image->native_wrapper_aot_cache);
        free_hash (image->pinvoke_scopes);
        free_hash (image->pinvoke_scope_filenames);
        for (i = 0; i < image->gshared_types_len; ++i)
index cc0b76622fb8458887eece9a0b021608ab7d49cc..0698d6c1b9ef056e2933196cc889def49957de1d 100644 (file)
@@ -266,12 +266,13 @@ jit_info_table_find (MonoJitInfoTable *table, MonoThreadHazardPointers *hp, gint
  *
  * If TRY_AOT is FALSE, avoid loading information for missing methods from AOT images, which is currently not async safe.
  * In this case, only those AOT methods will be found whose jit info is already loaded.
+ * If ALLOW_TRAMPOLINES is TRUE, this can return a MonoJitInfo which represents a trampoline (ji->is_trampoline is true).
  * ASYNC SAFETY: When called in an async context (mono_thread_info_is_async_context ()), this is async safe.
  * In this case, the returned MonoJitInfo might not have metadata information, in particular,
  * mono_jit_info_get_method () could fail.
  */
 MonoJitInfo*
-mono_jit_info_table_find_internal (MonoDomain *domain, char *addr, gboolean try_aot)
+mono_jit_info_table_find_internal (MonoDomain *domain, char *addr, gboolean try_aot, gboolean allow_trampolines)
 {
        MonoJitInfoTable *table;
        MonoJitInfo *ji, *module_ji;
@@ -292,6 +293,8 @@ mono_jit_info_table_find_internal (MonoDomain *domain, char *addr, gboolean try_
        ji = jit_info_table_find (table, hp, (gint8*)addr);
        if (hp)
                mono_hazard_pointer_clear (hp, JIT_INFO_TABLE_HAZARD_INDEX);
+       if (ji && ji->is_trampoline && !allow_trampolines)
+               return NULL;
        if (ji)
                return ji;
 
@@ -304,6 +307,9 @@ mono_jit_info_table_find_internal (MonoDomain *domain, char *addr, gboolean try_
                if (hp)
                        mono_hazard_pointer_clear (hp, JIT_INFO_TABLE_HAZARD_INDEX);
        }
+
+       if (ji && ji->is_trampoline && !allow_trampolines)
+               return NULL;
        
        return ji;
 }
@@ -311,7 +317,7 @@ mono_jit_info_table_find_internal (MonoDomain *domain, char *addr, gboolean try_
 MonoJitInfo*
 mono_jit_info_table_find (MonoDomain *domain, char *addr)
 {
-       return mono_jit_info_table_find_internal (domain, addr, TRUE);
+       return mono_jit_info_table_find_internal (domain, addr, TRUE, FALSE);
 }
 
 static G_GNUC_UNUSED void
@@ -817,6 +823,7 @@ MonoMethod*
 mono_jit_info_get_method (MonoJitInfo* ji)
 {
        g_assert (!ji->async);
+       g_assert (!ji->is_trampoline);
        return ji->d.method;
 }
 
index 9d7a46496f2af6341471cbd9e2517b7455690c44..05cc3f7f83358d9caa035fb1985d7caf4a648938 100644 (file)
@@ -2455,9 +2455,9 @@ static gboolean loader_lock_track_ownership = FALSE;
 void
 mono_loader_lock (void)
 {
-       MONO_PREPARE_BLOCKING
+       MONO_TRY_BLOCKING
        mono_locks_acquire (&loader_mutex, LoaderLock);
-       MONO_FINISH_BLOCKING
+       MONO_FINISH_TRY_BLOCKING
                
        if (G_UNLIKELY (loader_lock_track_ownership)) {
                mono_native_tls_set_value (loader_lock_nest_id, GUINT_TO_POINTER (GPOINTER_TO_UINT (mono_native_tls_get_value (loader_lock_nest_id)) + 1));
index 82e29ad5ffa824c959a3219b73541276de8ee810..7c49bf4f59706b42bf1dfedccf81f32775626d32 100644 (file)
@@ -19,7 +19,8 @@ typedef enum {
        AssemblyBindingLock,
        MarshalLock,
        ClassesLock,
-       LoaderGlobalDataLock
+       LoaderGlobalDataLock,
+       ThreadsLock,
 } RuntimeLocks;
 
 #ifdef LOCK_TRACER
diff --git a/mono/metadata/make-bundle.pl b/mono/metadata/make-bundle.pl
deleted file mode 100755 (executable)
index fff9a87..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-#!/usr/bin/perl -w
-# Copyright (C) 2003 Ximian, Inc.
-# Paolo Molaro (lupus@ximian.com)
-#
-# Create an header file to be included in the mono libraries to
-# bundle assemblies inside the runtime.
-# The template file contains a list of assemblies, one per line,
-# with the name followed by a ':' and the filename.
-# Lines starting with '#' and empty lines are ignored.
-# See sample-bundle for an example.
-# We need to use an assembly file because gcc can't handle large arrays:-(
-
-if ($#ARGV != 2) {
-       die "Usage: make-bundle.pl template headerfile.h asm-file\n";
-}
-
-my $template = $ARGV [0];
-my $header = $ARGV [1];
-my $output = $ARGV [2];
-my %assemblies = ();
-
-my $line = 0;
-open (T, $template) || die "Cannot open bundle template: $!\n";
-while (<T>) {
-       ++$line;
-       next if (/^\s*#/);
-       next if (/^\s*$/);
-       if (/^([a-zA-Z0-9-.]+):\s*(.+?)\s*$/) {
-               my ($name, $filename) = ($1, $2);
-               if (exists $assemblies {$name}) {
-                       die "Assembly $name defined multiple times.\n";
-               } else {
-                       $assemblies {$name} = $filename;
-               }
-       } else {
-               die "Unknown format at line $line: $_";
-       }
-}
-close (T);
-
-open (O, ">$output.tmp") || die "Cannot open $output: $!\n";
-open (H, ">$header.tmp") || die "Cannot open $output: $!\n";
-print H <<"EOF";
-/* File generated by make-bundle: do not edit! */
-
-#ifndef __MONO_BUNDLE_H__
-#define __MONO_BUNDLE_H__
-
-typedef struct {
-       const char *name;
-       const unsigned char *data;
-       const unsigned int size;
-} MonoBundledAssembly;
-
-EOF
-
-my $bundle_entries = "";
-
-foreach my $name (sort keys %assemblies) {
-       my $file = $assemblies {$name};
-       my ($nread, $buf, $i, $cname, $need_eol, $size);
-       $cname = $name;
-       $cname =~ s/[-.]/_/g;
-       open (F, $file) || die "Cannot open $file: $!\n";
-       $size = -s F;
-#      print O "/* assembly $name from $file */\n";
-#      print O "static const unsigned char assembly_data_$cname [] = {\n";
-       print O ".globl assembly_data_$cname\n";
-       print O "\t.section .rodata\n";
-       print O "\t.align 32\n";
-       print O "\t.type assembly_data_$cname, \@object\n";
-       print O "\t.size assembly_data_$cname, $size\n";
-       print O "assembly_data_$cname:\n";
-       print H "extern const unsigned char assembly_data_$cname [];\n";
-       print H "static const MonoBundledAssembly assembly_bundle_$cname = {\"$name\", assembly_data_$cname, $size};\n";
-       $bundle_entries .= "\t&assembly_bundle_$cname,\n";
-       $need_eol = 0;
-       print "Adding assembly '$name' from $file...\n";
-       while (($n = sysread (F, $buf, 32))) {
-               for ($i = 0; $i < $n; ++$i) {
-                       print O "\t.byte ", ord (substr ($buf, $i, 1)), "\n";
-               }
-#              print O ",\n" if ($need_eol);
-#              $need_eol = 1;
-#              print O "\t";
-#              for ($i = 0; $i < $n; ++$i) {
-#                      print O ", " if $i > 0;
-#                      print O ord (substr ($buf, $i, 1));
-#              }
-       }
-#      print O "\n};\n\n";
-       close (F);
-}
-
-print H "\nstatic const MonoBundledAssembly* bundled_assemblies [] = {\n";
-print H $bundle_entries;
-print H "\tNULL\n";
-print H "};\n\n";
-print H "#endif /* __MONO_BUNDLE_H__ */\n";
-close (O);
-close (H);
-rename ("$header.tmp", $header);
-rename ("$output.tmp", $output);
-
index afaf812d778cbce27b04b5be8a030019af078bd9..b1ea15c1f22a611073b76af96b4ffc94dc614d2f 100644 (file)
@@ -11,7 +11,7 @@ g_list_prepend_mempool (MonoMemPool *mp, GList *list, gpointer data)
 {
        GList *new_list;
        
-       new_list = mono_mempool_alloc (mp, sizeof (GList));
+       new_list = (GList *) mono_mempool_alloc (mp, sizeof (GList));
        new_list->data = data;
        new_list->prev = list ? list->prev : NULL;
     new_list->next = list;
@@ -29,7 +29,7 @@ g_slist_prepend_mempool (MonoMemPool *mp, GSList *list, gpointer  data)
 {
        GSList *new_list;
        
-       new_list = mono_mempool_alloc (mp, sizeof (GSList));
+       new_list = (GSList *) mono_mempool_alloc (mp, sizeof (GSList));
        new_list->data = data;
        new_list->next = list;
 
@@ -42,7 +42,7 @@ g_slist_append_mempool (MonoMemPool *mp, GSList *list, gpointer data)
        GSList *new_list;
        GSList *last;
 
-       new_list = mono_mempool_alloc (mp, sizeof (GSList));
+       new_list = (GSList *) mono_mempool_alloc (mp, sizeof (GSList));
        new_list->data = data;
        new_list->next = NULL;
 
index e171606ed4c974217d6a878d6dda67f3306c391f..2840cc2c25c1437166b3514a3ff2f2d4caebc87c 100644 (file)
@@ -333,6 +333,8 @@ struct _MonoImage {
        MonoClass **mvar_cache_fast;
        GHashTable *var_cache_slow;
        GHashTable *mvar_cache_slow;
+       GHashTable *var_cache_constrained;
+       GHashTable *mvar_cache_constrained;
 
        /* Maps malloc-ed char* pinvoke scope -> MonoDl* */
        GHashTable *pinvoke_scopes;
@@ -666,11 +668,6 @@ mono_metadata_parse_type_full               (MonoImage             *image,
                                             const char            *ptr,
                                             const char           **rptr);
 
-MonoMethodSignature *
-mono_metadata_parse_signature_full          (MonoImage             *image,
-                                            MonoGenericContainer  *generic_container,
-                                            guint32                token);
-
 MONO_API MonoMethodSignature *
 mono_metadata_parse_method_signature_full   (MonoImage             *image,
                                             MonoGenericContainer  *generic_container,
@@ -715,6 +712,12 @@ mono_metadata_lookup_generic_class          (MonoClass                *gclass,
 
 MonoGenericInst * mono_metadata_inflate_generic_inst  (MonoGenericInst *ginst, MonoGenericContext *context, MonoError *error);
 
+guint
+mono_metadata_generic_param_hash (MonoGenericParam *p);
+
+gboolean
+mono_metadata_generic_param_equal (MonoGenericParam *p1, MonoGenericParam *p2);
+
 void mono_dynamic_stream_reset  (MonoDynamicStream* stream);
 void mono_assembly_addref       (MonoAssembly *assembly);
 void mono_assembly_load_friends (MonoAssembly* ass);
index 138cb114b002d6625d832cc4e30c017104c84f67..dc426f58353ee0a35551df571623e87fadaa154d 100644 (file)
@@ -48,7 +48,6 @@ static void free_generic_class (MonoGenericClass *ginst);
 static void free_inflated_method (MonoMethodInflated *method);
 static void free_inflated_signature (MonoInflatedMethodSignature *sig);
 static void mono_metadata_field_info_full (MonoImage *meta, guint32 index, guint32 *offset, guint32 *rva, MonoMarshalSpec **marshal_spec, gboolean alloc_from_image);
-static guint mono_metadata_generic_param_hash (MonoGenericParam *p);
 
 /*
  * This enumeration is used to describe the data types in the metadata
@@ -1746,20 +1745,18 @@ mono_metadata_get_param_attrs (MonoImage *m, int def, int param_count)
        return pattrs;
 }
 
+
 /*
- * mono_metadata_parse_signature_full:
+ * mono_metadata_parse_signature:
  * @image: metadata context
- * @generic_container: generic container
  * @toke: metadata token
  *
  * Decode a method signature stored in the STANDALONESIG table
  *
- * LOCKING: Assumes the loader lock is held.
- *
  * Returns: a MonoMethodSignature describing the signature.
  */
 MonoMethodSignature*
-mono_metadata_parse_signature_full (MonoImage *image, MonoGenericContainer *generic_container, guint32 token)
+mono_metadata_parse_signature (MonoImage *image, guint32 token)
 {
        MonoError error;
        MonoMethodSignature *ret;
@@ -1778,29 +1775,11 @@ mono_metadata_parse_signature_full (MonoImage *image, MonoGenericContainer *gene
        ptr = mono_metadata_blob_heap (image, sig);
        mono_metadata_decode_blob_size (ptr, &ptr);
 
-       ret = mono_metadata_parse_method_signature_full (image, generic_container, 0, ptr, NULL, &error);
-       if (!ret) {
-               mono_loader_set_error_from_mono_error (&error);
-               mono_error_cleanup (&error); /*FIXME don't swallow the error message*/
-       }
+       ret = mono_metadata_parse_method_signature_full (image, NULL, 0, ptr, NULL, &error);
+       mono_error_cleanup (&error); /*FIXME don't swallow the error message*/
        return ret;
 }
 
-/*
- * mono_metadata_parse_signature:
- * @image: metadata context
- * @toke: metadata token
- *
- * Decode a method signature stored in the STANDALONESIG table
- *
- * Returns: a MonoMethodSignature describing the signature.
- */
-MonoMethodSignature*
-mono_metadata_parse_signature (MonoImage *image, guint32 token)
-{
-       return mono_metadata_parse_signature_full (image, NULL, token);
-}
-
 /*
  * mono_metadata_signature_alloc:
  * @image: metadata context
@@ -4449,12 +4428,12 @@ mono_type_size (MonoType *t, int *align)
        }
        case MONO_TYPE_VAR:
        case MONO_TYPE_MVAR:
-               if (t->data.generic_param->gshared_constraint == 0 || t->data.generic_param->gshared_constraint == MONO_TYPE_VALUETYPE) {
+               if (!t->data.generic_param->gshared_constraint || t->data.generic_param->gshared_constraint->type == MONO_TYPE_VALUETYPE) {
                        *align = MONO_ABI_ALIGNOF (gpointer);
                        return sizeof (gpointer);
                } else {
                        /* The gparam can only match types given by gshared_constraint */
-                       simple_type = t->data.generic_param->gshared_constraint;
+                       return mono_type_size (t->data.generic_param->gshared_constraint, align);
                        goto again;
                }
        default:
@@ -4500,7 +4479,6 @@ mono_type_stack_size_internal (MonoType *t, int *align, gboolean allow_open)
        }
 
        simple_type = t->type;
- again:
        switch (simple_type) {
        case MONO_TYPE_BOOLEAN:
        case MONO_TYPE_CHAR:
@@ -4524,13 +4502,12 @@ mono_type_stack_size_internal (MonoType *t, int *align, gboolean allow_open)
        case MONO_TYPE_VAR:
        case MONO_TYPE_MVAR:
                g_assert (allow_open);
-               if (t->data.generic_param->gshared_constraint == 0 || t->data.generic_param->gshared_constraint == MONO_TYPE_VALUETYPE) {
+               if (!t->data.generic_param->gshared_constraint || t->data.generic_param->gshared_constraint->type == MONO_TYPE_VALUETYPE) {
                        *align = stack_slot_align;
                        return stack_slot_size;
                } else {
                        /* The gparam can only match types given by gshared_constraint */
-                       simple_type = t->data.generic_param->gshared_constraint;
-                       goto again;
+                       return mono_type_stack_size_internal (t->data.generic_param->gshared_constraint, align, allow_open);
                }
        case MONO_TYPE_TYPEDBYREF:
                *align = stack_slot_align;
@@ -4719,13 +4696,15 @@ mono_metadata_type_hash (MonoType *t1)
        }
 }
 
-static guint
+guint
 mono_metadata_generic_param_hash (MonoGenericParam *p)
 {
        guint hash;
        MonoGenericParamInfo *info;
 
-       hash = (mono_generic_param_num (p) << 2) | p->gshared_constraint;
+       hash = (mono_generic_param_num (p) << 2);
+       if (p->gshared_constraint)
+               hash = ((hash << 5) - hash) ^ mono_metadata_type_hash (p->gshared_constraint);
        info = mono_generic_param_info (p);
        /* Can't hash on the owner klass/method, since those might not be set when this is called */
        if (info)
@@ -4734,14 +4713,19 @@ mono_metadata_generic_param_hash (MonoGenericParam *p)
 }
 
 static gboolean
-mono_metadata_generic_param_equal (MonoGenericParam *p1, MonoGenericParam *p2, gboolean signature_only)
+mono_metadata_generic_param_equal_internal (MonoGenericParam *p1, MonoGenericParam *p2, gboolean signature_only)
 {
        if (p1 == p2)
                return TRUE;
        if (mono_generic_param_num (p1) != mono_generic_param_num (p2))
                return FALSE;
-       if (p1->gshared_constraint != p2->gshared_constraint)
-               return FALSE;
+       if (p1->gshared_constraint && p2->gshared_constraint) {
+               if (!mono_metadata_type_equal (p1->gshared_constraint, p2->gshared_constraint))
+                       return FALSE;
+       } else {
+               if (p1->gshared_constraint != p2->gshared_constraint)
+                       return FALSE;
+       }
 
        /*
         * We have to compare the image as well because if we didn't,
@@ -4767,6 +4751,12 @@ mono_metadata_generic_param_equal (MonoGenericParam *p1, MonoGenericParam *p2, g
        return signature_only;
 }
 
+gboolean
+mono_metadata_generic_param_equal (MonoGenericParam *p1, MonoGenericParam *p2)
+{
+       return mono_metadata_generic_param_equal_internal (p1, p2, TRUE);
+}
+
 static gboolean
 mono_metadata_class_equal (MonoClass *c1, MonoClass *c2, gboolean signature_only)
 {
@@ -4779,10 +4769,10 @@ mono_metadata_class_equal (MonoClass *c1, MonoClass *c2, gboolean signature_only
        if (c1->generic_container && c2->generic_class)
                return _mono_metadata_generic_class_container_equal (c2->generic_class, c1, signature_only);
        if ((c1->byval_arg.type == MONO_TYPE_VAR) && (c2->byval_arg.type == MONO_TYPE_VAR))
-               return mono_metadata_generic_param_equal (
+               return mono_metadata_generic_param_equal_internal (
                        c1->byval_arg.data.generic_param, c2->byval_arg.data.generic_param, signature_only);
        if ((c1->byval_arg.type == MONO_TYPE_MVAR) && (c2->byval_arg.type == MONO_TYPE_MVAR))
-               return mono_metadata_generic_param_equal (
+               return mono_metadata_generic_param_equal_internal (
                        c1->byval_arg.data.generic_param, c2->byval_arg.data.generic_param, signature_only);
        if (signature_only &&
            (c1->byval_arg.type == MONO_TYPE_SZARRAY) && (c2->byval_arg.type == MONO_TYPE_SZARRAY))
@@ -4872,10 +4862,10 @@ do_mono_metadata_type_equal (MonoType *t1, MonoType *t2, gboolean signature_only
                return _mono_metadata_generic_class_equal (
                        t1->data.generic_class, t2->data.generic_class, signature_only);
        case MONO_TYPE_VAR:
-               return mono_metadata_generic_param_equal (
+               return mono_metadata_generic_param_equal_internal (
                        t1->data.generic_param, t2->data.generic_param, signature_only);
        case MONO_TYPE_MVAR:
-               return mono_metadata_generic_param_equal (
+               return mono_metadata_generic_param_equal_internal (
                        t1->data.generic_param, t2->data.generic_param, signature_only);
        case MONO_TYPE_FNPTR:
                return mono_metadata_fnptr_equal (t1->data.method, t2->data.method, signature_only);
index f75606c501039317808607c7bdfaccbfe8930a97..0c457acace4b420feaceac597cdd94b3ce684981 100644 (file)
@@ -1133,7 +1133,9 @@ ves_icall_System_Threading_Monitor_Monitor_wait (MonoObject *obj, guint32 ms)
                /* Poll the event again, just in case it was signalled
                 * while we were trying to regain the monitor lock
                 */
+               MONO_PREPARE_BLOCKING
                ret = WaitForSingleObjectEx (event, 0, FALSE);
+               MONO_FINISH_BLOCKING
        }
 
        /* Pulse will have popped our event from the queue if it signalled
index 343b97194a2144e4bb4104c6cc07f03014af20ab..acc2590193fc74fac651b5f5a2237834460584be 100644 (file)
@@ -14,7 +14,49 @@ typedef union {
        unsigned char cval [8];
 } mono_rdouble;
 
-#if NO_UNALIGNED_ACCESS
+#if defined(__s390x__)
+
+#define read16(x)      s390x_read16(*(guint16 *)(x))
+#define read32(x)      s390x_read32(*(guint32 *)(x))
+#define read64(x)      s390x_read64(*(guint64 *)(x))
+
+static __inline__ guint16
+s390x_read16(guint16 x)
+{
+       guint16 ret;
+
+       __asm__ ("      lrvr    %0,%1\n"
+                "      sra     %0,16\n"
+                : "=r" (ret) : "r" (x));
+
+       return(ret);
+}
+
+static __inline__ guint32
+s390x_read32(guint32 x)
+{
+       guint32 ret;
+
+       __asm__ ("      lrvr    %0,%1\n"
+                : "=r" (ret) : "r" (x));
+
+       return(ret);
+}
+
+static __inline__ guint64
+s390x_read64(guint64 x)
+{
+       guint64 ret;
+
+       __asm__ ("      lrvgr   %0,%1\n"
+                : "=r" (ret) : "r" (x));
+
+       return(ret);
+}
+
+#else
+
+# if NO_UNALIGNED_ACCESS
 
 guint16 mono_read16 (const unsigned char *x);
 guint32 mono_read32 (const unsigned char *x);
@@ -24,12 +66,14 @@ guint64 mono_read64 (const unsigned char *x);
 #define read32(x) (mono_read32 ((const unsigned char *)(x)))
 #define read64(x) (mono_read64 ((const unsigned char *)(x)))
 
-#else
+# else
 
 #define read16(x) GUINT16_FROM_LE (*((const guint16 *) (x)))
 #define read32(x) GUINT32_FROM_LE (*((const guint32 *) (x)))
 #define read64(x) GUINT64_FROM_LE (*((const guint64 *) (x)))
 
+# endif
+
 #endif
 
 #define readr4(x,dest) \
diff --git a/mono/metadata/monosn.c b/mono/metadata/monosn.c
deleted file mode 100644 (file)
index c9114c4..0000000
+++ /dev/null
@@ -1,551 +0,0 @@
-/*
- * monosn.c: Mono String Name Utility
- *
- * Author:
- *   Paolo Molaro (lupus@ximian.com)
- *
- * Copyright 2002-2003 Ximian, Inc (http://www.ximian.com)
- * Copyright 2004-2009 Novell, Inc (http://www.novell.com)
- *
- */
-#include <mono/metadata/class.h>
-#include <mono/metadata/debug-helpers.h>
-#include <mono/metadata/tokentype.h>
-#include <mono/metadata/appdomain.h>
-#include <mono/metadata/assembly.h>
-#include "mono/utils/mono-digest.h"
-/* trim headers */
-
-#include <string.h>
-#include <ctype.h>
-
-#define RSA1_MAGIC     0x32415351
-#define RSA2_MAGIC     0x32415352
-#define PRIVKEY_MAGIC  0x00000207
-#define PUBKEY_MAGIC   0x00008004
-
-typedef struct {
-       guchar type, version;
-       guint16 reserved1;
-       guint32 algid;
-} MonoKeyHeader;
-
-typedef struct {
-       MonoKeyHeader header;
-       guint32 bitlen;
-       guint32 exponent;
-       guchar  modulus [MONO_ZERO_LEN_ARRAY];
-} MonoRSAPubHeader;
-
-static void
-print_data (const char *data, int len)
-{
-       int i;
-       for (i = 0; i < len; ++i) {
-               if (i && !(i % 32))
-                       printf ("\n");
-               printf ("%02x", data [i] & 0xff);
-       }
-       printf ("\n");
-}
-
-static int
-show_token (const char *file, int is_assembly, int show_pubkey) {
-       char token [20];
-       if (!is_assembly) {
-               char *pubkey;
-               gsize len;
-               if (!g_file_get_contents (file, &pubkey, &len, NULL)) {
-                       printf ("Cannot load file: %s\n", file);
-                       return 2;
-               }
-               mono_digest_get_public_token (token, pubkey, len);
-               if (show_pubkey) {
-                       printf ("Public key is\n");
-                       print_data (pubkey, len);
-               }
-               g_free (pubkey);
-       } else {
-               MonoImage *image;
-               const char *pubkey;
-               guint32 len;
-
-               mono_metadata_init ();
-        mono_images_init ();
-        mono_assemblies_init ();
-        mono_loader_init ();
-
-               image = mono_image_open (file, NULL);
-               if (!image) {
-                       printf ("Cannot open image file: %s\n", file);
-                       return 2;
-               }
-               pubkey = mono_image_get_public_key (image, &len);
-               if (!pubkey) {
-                       printf ("%s does not represent a strongly named assembly\n", mono_image_get_name(image));
-                       mono_image_close (image);
-                       return 2;
-               }
-               if (show_pubkey) {
-                       printf ("Public key is\n");
-                       print_data (pubkey, len);
-               }
-               mono_digest_get_public_token (token, pubkey, len);
-               mono_image_close (image);
-       }
-       printf ("Public key token is ");
-       print_data (token, 8);
-       return 0;
-}
-
-static int
-extract_data_to_file (int pubk, const char *assembly, const char *outfile) {
-       MonoImage *image;
-       FILE *file;
-       const char *pubkey;
-       guint32 len;
-       
-       image = mono_image_open (assembly, NULL);
-       if (!image) {
-               printf ("Cannot open image file: %s\n", assembly);
-               return 2;
-       }
-       if (pubk)
-               pubkey = mono_image_get_public_key (image, &len);
-       else
-               pubkey = mono_image_get_strong_name (image, &len);
-       if (!pubkey) {
-               printf ("%s does not represent a strongly named assembly\n", mono_image_get_name(image));
-               mono_image_close (image);
-               return 2;
-       }
-       if (!(file = fopen (outfile, "wb"))) {
-               printf ("Cannot open output file: %s\n", outfile);
-               return 2;
-       }
-       fwrite (pubkey, len, 1, file);
-       fclose (file);
-       mono_image_close (image);
-       return 0;
-}
-
-const static guint8 asciitable [128] = {
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0x3e, 0xff, 0xff, 0xff, 0x3f,
-       0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
-       0x3a, 0x3b, 0x3c, 0x3d, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
-       0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
-       0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c,
-       0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12,
-       0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
-       0x19, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e,
-       0x1f, 0x20, 0x21, 0x22, 0x23, 0x24,
-       0x25, 0x26, 0x27, 0x28, 0x29, 0x2a,
-       0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30,
-       0x31, 0x32, 0x33, 0xff, 0xff, 0xff,
-       0xff, 0xff
-};
-
-/* data is changed in place */
-static char*
-pem_decode (guchar *data, int len, int *rlen) {
-       guchar *p, *s;
-       int b64len, i, rem = 0, full;
-       int b0, b1, b2, b3, offset, dlen;
-
-       p = strstr (data, "-----BEGIN");
-       s = strstr (data, "\n-----END");
-       if (!p || !s)
-               return NULL;
-       while (*p != '\n') p++;
-       *s = 0;
-       s = data = p;
-       while (*p) {
-               if (isalnum (*p) || *p == '+' || *p == '=' || *p == '/') {
-                       *s++ = *p++;
-               } else {
-                       p++;
-               }
-       }
-       *s = 0;
-       b64len = s - data;
-
-       full = b64len >> 2;
-       if (data [b64len - 1] == '=') {
-               full--;
-               rem++;
-       }
-       if (data [b64len - 2] == '=')
-               rem++;
-       offset = 0;
-       p = data;
-       for (i = 0; i < full; ++i) {
-               b0 = asciitable [data [offset++]];
-               b1 = asciitable [data [offset++]];
-               b2 = asciitable [data [offset++]];
-               b3 = asciitable [data [offset++]];
-
-               *p++ = (b0 << 2) | (b1 >> 4);
-               *p++ = (b1 << 4) | (b2 >> 2);
-               *p++ = (b2 << 6) | b3;
-       }
-       dlen = full * 3;
-       switch (rem) {
-       case 1:
-               b0 = asciitable [data [offset++]];
-               b1 = asciitable [data [offset++]];
-               b2 = asciitable [data [offset++]];
-
-               *p++ = (b0 << 2) | (b1 >> 4);
-               *p++ = (b1 << 4) | (b2 >> 2);
-               dlen += 2;
-               break;
-       case 2:
-               b0 = asciitable [data [offset++]];
-               b1 = asciitable [data [offset++]];
-
-               *p++ = (b0 << 2) | (b1 >> 4);
-               dlen++;
-               break;
-       }
-       *rlen = dlen;
-       return data;
-}
-
-enum {
-       DER_INTEGER = 2,
-       DER_BITSTRING = 3,
-       DER_NULL = 5,
-       DER_OBJID = 6,
-       DER_SEQUENCE = 16,
-       DER_INVALID = -1,
-       DER_END = -2
-};
-
-static int
-der_get_next (guchar *data, int dlen, int offset, int *len, guchar **rdata)
-{
-       int i, l, type, val;
-
-       if (offset + 1 >= dlen)
-               return DER_END;
-
-       type = data [offset++] & 0x1f;
-       if (data [offset] == 0x80) /* not supported */
-               return DER_INVALID;
-       l = 0;
-       if (data [offset] & 0x80) {
-               val = data [offset++] & 0x7f;
-               for (i = 0; i < val; ++i) {
-                       l = (l << 8) | data [offset++];
-               }
-       } else {
-               l = data [offset++];
-       }
-       *len = l;
-       *rdata = data + offset;
-       return type;
-}
-
-static void
-dump_asn1 (guchar *key, int len) {
-       int type, offset, elen;
-       guchar *edata;
-
-       offset = 0;
-       while ((type = der_get_next (key, len, offset, &elen, &edata)) >= 0) {
-               switch (type) {
-               case DER_SEQUENCE:
-                       g_print ("seq (%d) at %d\n", elen, offset);
-                       dump_asn1 (edata, elen);
-                       offset = elen + edata - key;
-                       break;
-               case DER_BITSTRING:
-                       g_print ("bits (%d) at %p + %d\n", elen, edata, offset);
-                       dump_asn1 (edata + 1, elen);
-                       offset = 1 + elen + edata - key;
-                       break;
-               case DER_INTEGER:
-                       g_print ("int (%d) at %d\n", elen, offset);
-                       offset = elen + edata - key;
-                       break;
-               case DER_NULL:
-                       g_print ("null (%d) at %d\n", elen, offset);
-                       offset = elen + edata - key;
-                       break;
-               case DER_OBJID:
-                       g_print ("objid (%d) at %d\n", elen, offset);
-                       offset = elen + edata - key;
-                       break;
-               default:
-                       return;
-               }
-       }
-}
-
-static guint32
-get_der_int (guchar *data, int len)
-{
-       guint32 val = 0;
-       int i;
-       for (i = 0; i < len; ++i)
-               val = (val << 8) | data [i];
-       return val;
-}
-
-static void
-mem_reverse (guchar *p, int len) {
-       int i, t;
-
-       for (i = 0; i < len/2; ++i) {
-               t = p [i];
-               p [i] = p [len - i - 1];
-               p [len - i - 1] = t;
-       }
-}
-
-static int
-convert_der_key (guchar *key, int len, guchar **ret, int *retlen)
-{
-       int type, offset, val, elen;
-       guchar *r, *edata;
-
-       offset = 0;
-       type = der_get_next (key, len, offset, &elen, &edata);
-       if (type != DER_SEQUENCE)
-               return 1;
-       key = edata;
-       len = elen;
-       type = der_get_next (key, len, offset, &elen, &edata);
-       if (type == DER_INTEGER) {
-               int i;
-               guchar *ints [6];
-               int lengths [6];
-               guchar *p;
-               /* a private RSA key */
-               val = get_der_int (edata, elen);
-               if (val != 0)
-                       return 2;
-               offset = elen + edata - key;
-               /* the modulus */
-               type = der_get_next (key, len, offset, &elen, &edata);
-               if (type != DER_INTEGER)
-                       return 2;
-               offset = elen + edata - key;
-               if ((elen & 1) && *edata == 0) {
-                       edata ++;
-                       elen--;
-               }
-               r = g_new0 (guchar, elen*4 + elen/2 + 20);
-               r [0] = 0x7; r [1] = 0x2; r [5] = 0x24;
-               r [8] = 0x52; r [9] = 0x53; r [10] = 0x41; r [11] = 0x32;
-               *(guint32*)(r + 12) = elen * 8;
-               memcpy (r + 20, edata, elen);
-               mem_reverse (r + 20, elen);
-               p = r + 20 + elen;
-               /* the exponent */
-               type = der_get_next (key, len, offset, &elen, &edata);
-               if (type != DER_INTEGER)
-                       return 2;
-               offset = elen + edata - key;
-               val = get_der_int (edata, elen);
-               *(guint32*)(r + 16) = val;
-               for (i = 0; i < 6; i++) {
-                       type = der_get_next (key, len, offset, &elen, &edata);
-                       if (type != DER_INTEGER)
-                               return 2;
-                       offset = elen + edata - key;
-                       if ((elen & 1) && *edata == 0) {
-                               edata++;
-                               elen--;
-                       }
-                       ints [i] = edata;
-                       lengths [i] = elen;
-                       g_print ("len: %d\n", elen);
-               }
-               /* prime1 */
-               g_print ("prime1 at %d (%d)\n", p-r, lengths [1]);
-               memcpy (p, ints [1], lengths [1]);
-               mem_reverse (p, lengths [1]);
-               p += lengths [1];
-               /* prime2 */
-               g_print ("prime2 at %d (%d)\n", p-r, lengths [2]);
-               memcpy (p, ints [2], lengths [2]);
-               mem_reverse (p, lengths [2]);
-               p += lengths [2];
-               /* exponent1 */
-               g_print ("exp1 at %d (%d)\n", p-r, lengths [3]);
-               memcpy (p, ints [3], lengths [3]);
-               mem_reverse (p, lengths [3]);
-               p += lengths [3];
-               /* exponent2 */
-               g_print ("exp2 at %d (%d)\n", p-r, lengths [4]);
-               memcpy (p, ints [4], lengths [4]);
-               mem_reverse (p, lengths [4]);
-               p += lengths [4];
-               /* coeff */
-               g_print ("coeff at %d (%d)\n", p-r, lengths [5]);
-               memcpy (p, ints [5], lengths [5]);
-               mem_reverse (p, lengths [5]);
-               p += lengths [5];
-               /* private exponent */
-               g_print ("prive at %d (%d)\n", p-r, lengths [0]);
-               memcpy (p, ints [0], lengths [0]);
-               mem_reverse (p, lengths [0]);
-               p += lengths [0];
-               *ret = r;
-               *retlen = p-r;
-               return 0;
-       }
-       return 1;
-}
-
-static int
-convert_format (const char *from, const char *outfile) {
-       guchar *key, *bindata, *keyout;
-       gsize len;
-       int binlen, ret, lenout;
-       FILE *file;
-       
-       if (!g_file_get_contents (from, (gchar**) &key, &len, NULL)) {
-               printf ("Cannot load file: %s\n", from);
-               return 2;
-       }
-
-       if (*key == 0 || *key == 0x24) {
-               g_free (key);
-               printf ("Cannot convert to pem format yet\n");
-               return 2;
-       }
-       bindata = pem_decode (key, len, &binlen);
-       if (!(file = fopen (outfile, "wb"))) {
-               g_free (key);
-               printf ("Cannot open output file: %s\n", outfile);
-               return 2;
-       }
-       dump_asn1 (bindata, binlen);
-       ret = convert_der_key (bindata, binlen, &keyout, &lenout);
-       if (!ret) {
-               fwrite (keyout, lenout, 1, file);
-               g_free (keyout);
-       } else {
-               printf ("Cannot convert key\n");
-       }
-       fclose (file);
-       g_free (key);
-       return ret;
-}
-
-static int
-get_digest (const char *from, const char *outfile)
-{
-       guchar *ass;
-       guchar digest [20];
-       gsize len;
-       guint32 snpos, snsize;
-       FILE *file;
-       MonoImage *image;
-       MonoSHA1Context sha1;
-       
-       image = mono_image_open (from, NULL);
-       if (!image) {
-               printf ("Cannot open image file: %s\n", from);
-               return 2;
-       }
-       snpos = mono_image_strong_name_position (image, &snsize);
-       if (!snpos) {
-               /*printf ("%s does not represent a strongly named assembly\n", from);
-               mono_image_close (image);
-               return 2;*/
-               snsize = 0;
-       }
-       
-       if (!g_file_get_contents (from, (gchar**) &ass, &len, NULL)) {
-               printf ("Cannot load file: %s\n", from);
-               mono_image_close (image);
-               return 2;
-       }
-       /* 
-        * FIXME: we may need to set the STRONGNAMESIGNED flag in the cli header 
-        * before taking the sha1 digest of the image.
-        */
-       mono_sha1_init (&sha1);
-       mono_sha1_update (&sha1, ass, snpos);
-       mono_sha1_update (&sha1, ass + snpos + snsize, len - snsize - snpos);
-       mono_sha1_final (&sha1, digest);
-
-       mono_image_close (image);
-       g_free (ass);
-       if (!(file = fopen (outfile, "wb"))) {
-               printf ("Cannot open output file: %s\n", outfile);
-               return 2;
-       }
-       fwrite (digest, 20, 1, file);
-       fclose (file);
-       return 0;
-}
-
-static void 
-help (int err) {
-       printf ("monosn: Mono Strong Name Utility\nUsage: monosn option [arguments]\n");
-       printf ("Available options:\n");
-       printf ("\t-C keyin keyout   Convert key file format from PEM to cryptoAPI (or the reverse).\n");
-       printf ("\t-e assembly file  Extract the public key from assembly to file.\n");
-       printf ("\t-E assembly file  Extract the strong name from assembly to file.\n");
-       printf ("\t-r assembly file  Extract the sha1 digest from assembly to file.\n");
-       printf ("\t-t[p] file        Display the public key token from file.\n");
-       printf ("\t-T[p] assembly    Display the public key token from assembly.\n");
-       exit (err);
-}
-
-int 
-main (int argc, char *argv[]) {
-       int opt;
-       
-       if (argc < 2 || argv [1] [0] != '-')
-               help (1);
-
-       opt = argv [1] [1];
-       switch (opt) {
-       case 'C':
-               if (argc != 4)
-                       help (1);
-               return convert_format (argv [2], argv [3]);
-       case 'e':
-               if (argc != 4)
-                       help (1);
-               return extract_data_to_file (1, argv [2], argv [3]);
-       case 'E':
-               if (argc != 4)
-                       help (1);
-               return extract_data_to_file (0, argv [2], argv [3]);
-       case 'h':
-       case '?':
-               help (0);
-               return 0;
-       case 'r':
-               if (argc != 4)
-                       help (1);
-               return get_digest (argv [2], argv [3]);
-       case 't':
-               if (argc != 3)
-                       help (1);
-               return show_token (argv [2], 0, argv [1] [2] == 'p');
-       case 'T':
-               if (argc != 3)
-                       help (1);
-               return show_token (argv [2], 1, argv [1] [2] == 'p');
-       default:
-               help (1);
-       }
-       return 0;
-}
-
index 15be4b4a5c2444aed6eaf2012eb4c557cfec8e28..09582a7b3f25bd63bf6093dda92714b7f1505079 100644 (file)
@@ -266,12 +266,6 @@ typedef struct {
        MonoString *param_name;
 } MonoArgumentException;
 
-typedef struct {
-       MonoSystemException base;
-       MonoString *msg;
-       MonoString *type_name;
-} MonoTypeLoadException;
-
 typedef struct {
        MonoObject   object;
        MonoObject  *async_state;
@@ -1286,27 +1280,13 @@ typedef struct {
        gint16 size_param_index;
 } MonoReflectionMarshalAsAttribute;
 
-
 typedef struct {
        MonoObject object;
        gint32 call_conv;
        gint32 charset;
-       MonoString *dll;
-       MonoString *entry_point;
-       MonoBoolean exact_spelling;
-       MonoBoolean preserve_sig;
-       MonoBoolean set_last_error;
        MonoBoolean best_fit_mapping;
        MonoBoolean throw_on_unmappable;
-} MonoReflectionDllImportAttribute;
-
-typedef struct {
-       MonoObject object;
-       gint32 call_conv;
-       gint32 charset;
        MonoBoolean set_last_error;
-       MonoBoolean best_fit_mapping;
-       MonoBoolean throw_on_unmappable;
 } MonoReflectionUnmanagedFunctionPointerAttribute;
 
 typedef struct {
index ec6eb18540d8c7ce10b89079eafc851c7718d4aa..37d0f3612cec06245c7f797ce698ec694a31d6c3 100644 (file)
@@ -203,6 +203,7 @@ DECL_OFFSET(MonoContext, rsp)
 DECL_OFFSET(MonoContext, r8)
 DECL_OFFSET(MonoContext, r9)
 DECL_OFFSET(MonoContext, r10)
+DECL_OFFSET(MonoContext, r11)
 DECL_OFFSET(MonoContext, r12)
 DECL_OFFSET(MonoContext, r13)
 DECL_OFFSET(MonoContext, r14)
@@ -217,9 +218,10 @@ DECL_OFFSET(MonoLMF, rsp)
 DECL_OFFSET(MonoLMF, rbp)
 DECL_OFFSET(MonoLMF, rip)
 
+DECL_OFFSET(SeqPointInfo, ss_tramp_addr)
 DECL_OFFSET(SeqPointInfo, bp_addrs)
+
 DECL_OFFSET(DynCallArgs, res)
-DECL_OFFSET(SeqPointInfo, ss_trigger_page)
 
 DECL_OFFSET(MonoLMFTramp, regs)
 DECL_OFFSET(MonoLMFTramp, lmf_addr)
index 76460f4d2c3f68f6801fafd3a15969fdde26a1b2..ebab623f7880f1da2707ad0b373c579f2e55bef9 100644 (file)
@@ -148,9 +148,9 @@ static mono_mutex_t type_initialization_section;
 static void
 mono_type_init_lock (TypeInitializationLock *lock)
 {
-       MONO_PREPARE_BLOCKING
+       MONO_TRY_BLOCKING
        mono_mutex_lock (&lock->initialization_section);
-       MONO_FINISH_BLOCKING
+       MONO_FINISH_TRY_BLOCKING
 }
 
 static void
@@ -530,8 +530,7 @@ default_delegate_trampoline (MonoDomain *domain, MonoClass *klass)
 static MonoTrampoline arch_create_jit_trampoline = default_trampoline;
 static MonoJumpTrampoline arch_create_jump_trampoline = default_jump_trampoline;
 static MonoDelegateTrampoline arch_create_delegate_trampoline = default_delegate_trampoline;
-static MonoImtThunkBuilder imt_thunk_builder = NULL;
-#define ARCH_USE_IMT (imt_thunk_builder != NULL)
+static MonoImtThunkBuilder imt_thunk_builder;
 #if (MONO_IMT_SIZE > 32)
 #error "MONO_IMT_SIZE cannot be larger than 32"
 #endif
@@ -1417,7 +1416,7 @@ build_imt_slots (MonoClass *klass, MonoVTable *vt, MonoDomain *domain, gpointer*
                                 * The IMT thunk might be called with an instance of one of the 
                                 * generic virtual methods, so has to fallback to the IMT trampoline.
                                 */
-                               imt [i] = initialize_imt_slot (vt, domain, imt_builder [i], callbacks.get_imt_trampoline ? callbacks.get_imt_trampoline (i) : NULL);
+                               imt [i] = initialize_imt_slot (vt, domain, imt_builder [i], callbacks.get_imt_trampoline (i));
                        } else {
                                imt [i] = initialize_imt_slot (vt, domain, imt_builder [i], NULL);
                        }
@@ -1965,16 +1964,12 @@ mono_class_create_runtime_vtable (MonoDomain *domain, MonoClass *class, gboolean
        if (class_size)
                vtable_slots++;
 
-       if (ARCH_USE_IMT) {
-               if (class->interface_offsets_count) {
-                       imt_table_bytes = sizeof (gpointer) * (MONO_IMT_SIZE);
-                       mono_stats.imt_number_of_tables++;
-                       mono_stats.imt_tables_size += imt_table_bytes;
-               } else {
-                       imt_table_bytes = 0;
-               }
+       if (class->interface_offsets_count) {
+               imt_table_bytes = sizeof (gpointer) * (MONO_IMT_SIZE);
+               mono_stats.imt_number_of_tables++;
+               mono_stats.imt_tables_size += imt_table_bytes;
        } else {
-               imt_table_bytes = sizeof (gpointer) * (class->max_interface_id + 1);
+               imt_table_bytes = 0;
        }
 
        vtable_size = imt_table_bytes + MONO_SIZEOF_VTABLE + vtable_slots * sizeof (gpointer);
@@ -2106,15 +2101,6 @@ mono_class_create_runtime_vtable (MonoDomain *domain, MonoClass *class, gboolean
        
        //printf ("Initializing VT for class %s (interface_offsets_count = %d)\n",
        //              class->name, class->interface_offsets_count);
-       
-       if (! ARCH_USE_IMT) {
-               /* initialize interface offsets */
-               for (i = 0; i < class->interface_offsets_count; ++i) {
-                       int interface_id = class->interfaces_packed [i]->interface_id;
-                       int slot = class->interface_offsets_packed [i];
-                       interface_offsets [class->max_interface_id - interface_id] = &(vt->vtable [slot]);
-               }
-       }
 
        /* Initialize vtable */
        if (callbacks.get_vtable_trampoline) {
@@ -2133,15 +2119,10 @@ mono_class_create_runtime_vtable (MonoDomain *domain, MonoClass *class, gboolean
                }
        }
 
-       if (ARCH_USE_IMT && imt_table_bytes) {
+       if (imt_table_bytes) {
                /* Now that the vtable is full, we can actually fill up the IMT */
-               if (callbacks.get_imt_trampoline) {
-                       /* lazy construction of the IMT entries enabled */
                        for (i = 0; i < MONO_IMT_SIZE; ++i)
                                interface_offsets [i] = callbacks.get_imt_trampoline (i);
-               } else {
-                       build_imt (class, vt, domain, interface_offsets, NULL);
-               }
        }
 
        /*
@@ -2297,13 +2278,9 @@ mono_class_proxy_vtable (MonoDomain *domain, MonoRemoteClass *remote_class, Mono
                if (iclass->max_interface_id > max_interface_id) max_interface_id = iclass->max_interface_id;
        }
 
-       if (ARCH_USE_IMT) {
-               imt_table_bytes = sizeof (gpointer) * MONO_IMT_SIZE;
-               mono_stats.imt_number_of_tables++;
-               mono_stats.imt_tables_size += imt_table_bytes;
-       } else {
-               imt_table_bytes = sizeof (gpointer) * (max_interface_id + 1);
-       }
+       imt_table_bytes = sizeof (gpointer) * MONO_IMT_SIZE;
+       mono_stats.imt_number_of_tables++;
+       mono_stats.imt_tables_size += imt_table_bytes;
 
        vtsize = imt_table_bytes + MONO_SIZEOF_VTABLE + class->vtable_size * sizeof (gpointer);
 
@@ -2349,14 +2326,6 @@ mono_class_proxy_vtable (MonoDomain *domain, MonoRemoteClass *remote_class, Mono
        bitmap = mono_domain_alloc0 (domain, bsize);
 #endif
 
-       if (! ARCH_USE_IMT) {
-               /* initialize interface offsets */
-               for (i = 0; i < class->interface_offsets_count; ++i) {
-                       int interface_id = class->interfaces_packed [i]->interface_id;
-                       int slot = class->interface_offsets_packed [i];
-                       interface_offsets [class->max_interface_id - interface_id] = &(pvt->vtable [slot]);
-               }
-       }
        for (i = 0; i < class->interface_offsets_count; ++i) {
                int interface_id = class->interfaces_packed [i]->interface_id;
                bitmap [interface_id >> 3] |= (1 << (interface_id & 7));
@@ -2373,9 +2342,6 @@ mono_class_proxy_vtable (MonoDomain *domain, MonoRemoteClass *remote_class, Mono
                for (list_item = extra_interfaces; list_item != NULL; list_item=list_item->next) {
                        interf = list_item->data;
                        
-                       if (! ARCH_USE_IMT) {
-                               interface_offsets [max_interface_id - interf->interface_id] = &pvt->vtable [slot];
-                       }
                        bitmap [interf->interface_id >> 3] |= (1 << (interf->interface_id & 7));
 
                        iter = NULL;
@@ -2385,17 +2351,12 @@ mono_class_proxy_vtable (MonoDomain *domain, MonoRemoteClass *remote_class, Mono
                        
                        slot += mono_class_num_methods (interf);
                }
-               if (! ARCH_USE_IMT) {
-                       g_slist_free (extra_interfaces);
-               }
        }
 
-       if (ARCH_USE_IMT) {
-               /* Now that the vtable is full, we can actually fill up the IMT */
-               build_imt (class, pvt, domain, interface_offsets, extra_interfaces);
-               if (extra_interfaces) {
-                       g_slist_free (extra_interfaces);
-               }
+       /* Now that the vtable is full, we can actually fill up the IMT */
+       build_imt (class, pvt, domain, interface_offsets, extra_interfaces);
+       if (extra_interfaces) {
+               g_slist_free (extra_interfaces);
        }
 
 #ifdef COMPRESSED_INTERFACE_BITMAP
index f4d4e3044d3cb534194740d93bf2da54933b5bc4..86e7d187d34121735941b9dd30b33119254bad86 100644 (file)
@@ -692,12 +692,15 @@ MonoBoolean ves_icall_System_Diagnostics_Process_WaitForExit_internal (MonoObjec
 {
        guint32 ret;
        
+       MONO_PREPARE_BLOCKING
        if(ms<0) {
                /* Wait forever */
                ret=WaitForSingleObjectEx (process, INFINITE, TRUE);
        } else {
                ret=WaitForSingleObjectEx (process, ms, TRUE);
        }
+       MONO_FINISH_BLOCKING
+
        if(ret==WAIT_OBJECT_0) {
                return(TRUE);
        } else {
index b82a3c23e59fbac10149d110ad67950d24674792..d085e1c008e29a830f876bc7655a531ae86e8695 100644 (file)
@@ -8705,6 +8705,7 @@ mono_custom_attrs_from_index (MonoImage *image, guint32 idx)
        MonoCustomAttrInfo *ainfo;
        GList *tmp, *list = NULL;
        const char *data;
+       MonoCustomAttrEntry* attr;
 
        ca = &image->tables [MONO_TABLE_CUSTOMATTRIBUTE];
 
@@ -8724,7 +8725,7 @@ mono_custom_attrs_from_index (MonoImage *image, guint32 idx)
        ainfo = g_malloc0 (MONO_SIZEOF_CUSTOM_ATTR_INFO + sizeof (MonoCustomAttrEntry) * len);
        ainfo->num_attrs = len;
        ainfo->image = image;
-       for (i = 0, tmp = list; i < len; ++i, tmp = tmp->next) {
+       for (i = len, tmp = list; i != 0; --i, tmp = tmp->next) {
                mono_metadata_decode_row (ca, GPOINTER_TO_UINT (tmp->data), cols, MONO_CUSTOM_ATTR_SIZE);
                mtoken = cols [MONO_CUSTOM_ATTR_TYPE] >> MONO_CUSTOM_ATTR_TYPE_BITS;
                switch (cols [MONO_CUSTOM_ATTR_TYPE] & MONO_CUSTOM_ATTR_TYPE_MASK) {
@@ -8738,8 +8739,9 @@ mono_custom_attrs_from_index (MonoImage *image, guint32 idx)
                        g_error ("Unknown table for custom attr type %08x", cols [MONO_CUSTOM_ATTR_TYPE]);
                        break;
                }
-               ainfo->attrs [i].ctor = mono_get_method (image, mtoken, NULL);
-               if (!ainfo->attrs [i].ctor) {
+               attr = &ainfo->attrs [i - 1];
+               attr->ctor = mono_get_method (image, mtoken, NULL);
+               if (!attr->ctor) {
                        g_warning ("Can't find custom attr constructor image: %s mtoken: 0x%08x", image->name, mtoken);
                        g_list_free (list);
                        g_free (ainfo);
@@ -8754,8 +8756,8 @@ mono_custom_attrs_from_index (MonoImage *image, guint32 idx)
                        return NULL;
                }
                data = mono_metadata_blob_heap (image, cols [MONO_CUSTOM_ATTR_VALUE]);
-               ainfo->attrs [i].data_size = mono_metadata_decode_value (data, &data);
-               ainfo->attrs [i].data = (guchar*)data;
+               attr->data_size = mono_metadata_decode_value (data, &data);
+               attr->data = (guchar*)data;
        }
        g_list_free (list);
 
diff --git a/mono/metadata/sample-bundle b/mono/metadata/sample-bundle
deleted file mode 100644 (file)
index ef8bbb3..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-# sample bundle template for use with the configure option --with-bundle=...
-
-console: ../tests/console.exe
-mscorlib: /usr/local/lib/corlib.dll
-
index 3b57a1a974a786f1261dc15fe1f7fc4961827180..6f852df9577bcbbfdd87c421f1621aacb10ebb03 100644 (file)
@@ -290,37 +290,37 @@ sgen_card_table_find_address_with_cards (char *cards_start, guint8 *cards, char
 }
 
 static void
-update_mod_union (guint8 *dest, gboolean init, guint8 *start_card, size_t num_cards)
+update_mod_union (guint8 *dest, guint8 *start_card, size_t num_cards)
 {
-       if (init) {
-               memcpy (dest, start_card, num_cards);
-       } else {
-               int i;
-               for (i = 0; i < num_cards; ++i)
-                       dest [i] |= start_card [i];
-       }
+       int i;
+       for (i = 0; i < num_cards; ++i)
+               dest [i] |= start_card [i];
 }
 
-static guint8*
-alloc_mod_union (size_t num_cards)
+guint8*
+sgen_card_table_alloc_mod_union (char *obj, mword obj_size)
 {
-       return sgen_alloc_internal_dynamic (num_cards, INTERNAL_MEM_CARDTABLE_MOD_UNION, TRUE);
+       size_t num_cards = cards_in_range ((mword) obj, obj_size);
+       guint8 *mod_union = sgen_alloc_internal_dynamic (num_cards, INTERNAL_MEM_CARDTABLE_MOD_UNION, TRUE);
+       memset (mod_union, 0, num_cards);
+       return mod_union;
 }
 
-guint8*
-sgen_card_table_update_mod_union_from_cards (guint8 *dest, guint8 *start_card, size_t num_cards)
+void
+sgen_card_table_free_mod_union (guint8 *mod_union, char *obj, mword obj_size)
 {
-       gboolean init = dest == NULL;
-
-       if (init)
-               dest = alloc_mod_union (num_cards);
-
-       update_mod_union (dest, init, start_card, num_cards);
+       size_t num_cards = cards_in_range ((mword) obj, obj_size);
+       sgen_free_internal_dynamic (mod_union, num_cards, INTERNAL_MEM_CARDTABLE_MOD_UNION);
+}
 
-       return dest;
+void
+sgen_card_table_update_mod_union_from_cards (guint8 *dest, guint8 *start_card, size_t num_cards)
+{
+       SGEN_ASSERT (0, dest, "Why don't we have a mod union?");
+       update_mod_union (dest, start_card, num_cards);
 }
 
-guint8*
+void
 sgen_card_table_update_mod_union (guint8 *dest, char *obj, mword obj_size, size_t *out_num_cards)
 {
        guint8 *start_card = sgen_card_table_get_card_address ((mword)obj);
@@ -328,7 +328,6 @@ sgen_card_table_update_mod_union (guint8 *dest, char *obj, mword obj_size, size_
        guint8 *end_card = sgen_card_table_get_card_address ((mword)obj + obj_size - 1) + 1;
 #endif
        size_t num_cards;
-       guint8 *result = NULL;
 
 #ifdef SGEN_HAVE_OVERLAPPING_CARDS
        size_t rest;
@@ -337,9 +336,7 @@ sgen_card_table_update_mod_union (guint8 *dest, char *obj, mword obj_size, size_
 
        while (start_card + rest > SGEN_CARDTABLE_END) {
                size_t count = SGEN_CARDTABLE_END - start_card;
-               dest = sgen_card_table_update_mod_union_from_cards (dest, start_card, count);
-               if (!result)
-                       result = dest;
+               sgen_card_table_update_mod_union_from_cards (dest, start_card, count);
                dest += count;
                rest -= count;
                start_card = sgen_cardtable;
@@ -349,14 +346,10 @@ sgen_card_table_update_mod_union (guint8 *dest, char *obj, mword obj_size, size_
        num_cards = end_card - start_card;
 #endif
 
-       dest = sgen_card_table_update_mod_union_from_cards (dest, start_card, num_cards);
-       if (!result)
-               result = dest;
+       sgen_card_table_update_mod_union_from_cards (dest, start_card, num_cards);
 
        if (out_num_cards)
                *out_num_cards = num_cards;
-
-       return result;
 }
 
 #ifdef SGEN_HAVE_OVERLAPPING_CARDS
@@ -426,7 +419,7 @@ sgen_card_table_finish_minor_collection (void)
 }
 
 static void
-sgen_card_table_scan_remsets (SgenGrayQueue *queue)
+sgen_card_table_scan_remsets (ScanCopyContext ctx)
 {
        SGEN_TV_DECLARE (atv);
        SGEN_TV_DECLARE (btv);
@@ -443,11 +436,11 @@ sgen_card_table_scan_remsets (SgenGrayQueue *queue)
        sgen_card_table_clear_cards ();
 #endif
        SGEN_TV_GETTIME (atv);
-       sgen_major_collector_scan_card_table (queue);
+       sgen_get_major_collector ()->scan_card_table (FALSE, ctx);
        SGEN_TV_GETTIME (btv);
        last_major_scan_time = SGEN_TV_ELAPSED (atv, btv); 
        major_card_scan_time += last_major_scan_time;
-       sgen_los_scan_card_table (FALSE, queue);
+       sgen_los_scan_card_table (FALSE, ctx);
        SGEN_TV_GETTIME (atv);
        last_los_scan_time = SGEN_TV_ELAPSED (btv, atv);
        los_card_scan_time += last_los_scan_time;
@@ -557,7 +550,7 @@ find_next_card (guint8 *card_data, guint8 *end)
 }
 
 void
-sgen_cardtable_scan_object (char *obj, mword block_obj_size, guint8 *cards, gboolean mod_union, SgenGrayQueue *queue)
+sgen_cardtable_scan_object (char *obj, mword block_obj_size, guint8 *cards, gboolean mod_union, ScanCopyContext ctx)
 {
        MonoVTable *vt = (MonoVTable*)SGEN_LOAD_VTABLE (obj);
        MonoClass *klass = vt->klass;
@@ -635,19 +628,19 @@ LOOP_HEAD:
 
                        elem = first_elem = (char*)mono_array_addr_with_size_fast ((MonoArray*)obj, elem_size, index);
                        if (klass->element_class->valuetype) {
-                               ScanVTypeFunc scan_vtype_func = sgen_get_current_object_ops ()->scan_vtype;
+                               ScanVTypeFunc scan_vtype_func = ctx.ops->scan_vtype;
 
                                for (; elem < card_end; elem += elem_size)
-                                       scan_vtype_func (elem, desc, queue BINARY_PROTOCOL_ARG (elem_size));
+                                       scan_vtype_func (obj, elem, desc, ctx.queue BINARY_PROTOCOL_ARG (elem_size));
                        } else {
-                               CopyOrMarkObjectFunc copy_func = sgen_get_current_object_ops ()->copy_or_mark_object;
+                               CopyOrMarkObjectFunc copy_func = ctx.ops->copy_or_mark_object;
 
                                HEAVY_STAT (++los_array_cards);
                                for (; elem < card_end; elem += SIZEOF_VOID_P) {
                                        gpointer new, old = *(gpointer*)elem;
                                        if ((mod_union && old) || G_UNLIKELY (sgen_ptr_in_nursery (old))) {
                                                HEAVY_STAT (++los_array_remsets);
-                                               copy_func ((void**)elem, queue);
+                                               copy_func ((void**)elem, ctx.queue);
                                                new = *(gpointer*)elem;
                                                if (G_UNLIKELY (sgen_ptr_in_nursery (new)))
                                                        sgen_add_to_global_remset (elem, new);
@@ -672,9 +665,9 @@ LOOP_HEAD:
                HEAVY_STAT (++bloby_objects);
                if (cards) {
                        if (sgen_card_table_is_range_marked (cards, (mword)obj, block_obj_size))
-                               sgen_get_current_object_ops ()->scan_object (obj, sgen_obj_get_descriptor (obj), queue);
+                               ctx.ops->scan_object (obj, sgen_obj_get_descriptor (obj), ctx.queue);
                } else if (sgen_card_table_region_begin_scanning ((mword)obj, block_obj_size)) {
-                       sgen_get_current_object_ops ()->scan_object (obj, sgen_obj_get_descriptor (obj), queue);
+                       ctx.ops->scan_object (obj, sgen_obj_get_descriptor (obj), ctx.queue);
                }
 
                binary_protocol_card_scan (obj, sgen_safe_object_get_size ((MonoObject*)obj));
index 578d5bac5eae90a8ac21724956b1e3d379541b48..ea8543ba1549d99ea2234d78eade265845a9f6be 100644 (file)
@@ -28,12 +28,15 @@ void sgen_card_table_reset_region (mword start, mword end);
 void* sgen_card_table_align_pointer (void *ptr);
 void sgen_card_table_mark_range (mword address, mword size);
 void sgen_cardtable_scan_object (char *obj, mword obj_size, guint8 *cards,
-               gboolean mod_union, SgenGrayQueue *queue);
+               gboolean mod_union, ScanCopyContext ctx);
 
 gboolean sgen_card_table_get_card_data (guint8 *dest, mword address, mword cards);
 
-guint8* sgen_card_table_update_mod_union_from_cards (guint8 *dest, guint8 *start_card, size_t num_cards);
-guint8* sgen_card_table_update_mod_union (guint8 *dest, char *obj, mword obj_size, size_t *out_num_cards);
+guint8* sgen_card_table_alloc_mod_union (char *obj, mword obj_size);
+void sgen_card_table_free_mod_union (guint8 *mod_union, char *obj, mword obj_size);
+
+void sgen_card_table_update_mod_union_from_cards (guint8 *dest, guint8 *start_card, size_t num_cards);
+void sgen_card_table_update_mod_union (guint8 *dest, char *obj, mword obj_size, size_t *out_num_cards);
 
 void sgen_card_table_init (SgenRememberedSet *remset);
 
@@ -125,4 +128,10 @@ sgen_card_table_mark_address (mword address)
        *sgen_card_table_get_card_address (address) = 1;
 }
 
+static inline size_t
+sgen_card_table_get_card_offset (char *ptr, char *base)
+{
+       return (ptr - base) >> CARD_BITS;
+}
+
 #endif
index 08d953a7aad6d70b94cfe0d5b08b6ae26de96684..4801bd65338d51dc21e543cc3238a3e7d1e8521e 100644 (file)
@@ -126,7 +126,7 @@ describe_pointer (char *ptr, gboolean need_setup)
                printf ("VTable is invalid (points inside nursery).\n");
                goto bridge;
        }
-       printf ("Class: %s\n", vtable->klass->name);
+       printf ("Class: %s.%s\n", vtable->klass->name_space, vtable->klass->name);
 
        desc = ((GCVTable*)vtable)->desc;
        printf ("Descriptor: %lx\n", (long)desc);
@@ -366,20 +366,20 @@ describe_nursery_ptr (char *ptr, gboolean need_setup)
        if (need_setup)
                setup_valid_nursery_objects ();
 
-       for (i = 0; i < valid_nursery_object_count; ++i) {
-               if (valid_nursery_objects [i] >= ptr)
+       for (i = 0; i < valid_nursery_object_count - 1; ++i) {
+               if (valid_nursery_objects [i + 1] > ptr)
                        break;
        }
 
        if (i >= valid_nursery_object_count || valid_nursery_objects [i] + safe_object_get_size ((MonoObject *)valid_nursery_objects [i]) < ptr) {
-               SGEN_LOG (0, "nursery-ptr (unalloc'd-memory)\n");
+               SGEN_LOG (0, "nursery-ptr (unalloc'd-memory)");
                return NULL;
        } else {
                char *obj = valid_nursery_objects [i];
                if (obj == ptr)
-                       SGEN_LOG (0, "nursery-ptr\n");
+                       SGEN_LOG (0, "nursery-ptr %p", obj);
                else
-                       SGEN_LOG (0, "nursery-ptr (interior-ptr offset %td)\n", ptr - obj);
+                       SGEN_LOG (0, "nursery-ptr %p (interior-ptr offset %td)", obj, ptr - obj);
                return obj;
        }
 }
index 1ae6ff614eda857346332a09754728399e8d4693..85552777bf7346dd9c7969df0cc0c15ef24933e3 100644 (file)
@@ -111,7 +111,7 @@ sgen_mark_bridge_object (MonoObject *obj)
 void
 sgen_collect_bridge_objects (int generation, ScanCopyContext ctx)
 {
-       CopyOrMarkObjectFunc copy_func = ctx.copy_func;
+       CopyOrMarkObjectFunc copy_func = ctx.ops->copy_or_mark_object;
        GrayQueue *queue = ctx.queue;
        SgenHashTable *hash_table = get_finalize_entry_hash_table (generation);
        MonoObject *object;
@@ -183,7 +183,7 @@ sgen_collect_bridge_objects (int generation, ScanCopyContext ctx)
 void
 sgen_finalize_in_range (int generation, ScanCopyContext ctx)
 {
-       CopyOrMarkObjectFunc copy_func = ctx.copy_func;
+       CopyOrMarkObjectFunc copy_func = ctx.ops->copy_or_mark_object;
        GrayQueue *queue = ctx.queue;
        SgenHashTable *hash_table = get_finalize_entry_hash_table (generation);
        MonoObject *object;
@@ -663,7 +663,7 @@ add_or_remove_disappearing_link (MonoObject *obj, void **link, int generation)
 void
 sgen_null_link_in_range (int generation, gboolean before_finalization, ScanCopyContext ctx)
 {
-       CopyOrMarkObjectFunc copy_func = ctx.copy_func;
+       CopyOrMarkObjectFunc copy_func = ctx.ops->copy_or_mark_object;
        GrayQueue *queue = ctx.queue;
        void **link;
        gpointer dummy G_GNUC_UNUSED;
index 532e1f74aa5287eba0508c99748a59418f28face..0b358c41e426dd7761f72e25b6c053800225dbff 100644 (file)
@@ -328,19 +328,15 @@ static guint64 time_minor_pre_collection_fragment_clear = 0;
 static guint64 time_minor_pinning = 0;
 static guint64 time_minor_scan_remsets = 0;
 static guint64 time_minor_scan_pinned = 0;
-static guint64 time_minor_scan_registered_roots = 0;
-static guint64 time_minor_scan_thread_data = 0;
+static guint64 time_minor_scan_roots = 0;
 static guint64 time_minor_finish_gray_stack = 0;
 static guint64 time_minor_fragment_creation = 0;
 
 static guint64 time_major_pre_collection_fragment_clear = 0;
 static guint64 time_major_pinning = 0;
 static guint64 time_major_scan_pinned = 0;
-static guint64 time_major_scan_registered_roots = 0;
-static guint64 time_major_scan_thread_data = 0;
-static guint64 time_major_scan_alloc_pinned = 0;
-static guint64 time_major_scan_finalized = 0;
-static guint64 time_major_scan_big_objects = 0;
+static guint64 time_major_scan_roots = 0;
+static guint64 time_major_scan_mod_union = 0;
 static guint64 time_major_finish_gray_stack = 0;
 static guint64 time_major_free_bigobjs = 0;
 static guint64 time_major_los_sweep = 0;
@@ -540,14 +536,14 @@ static mword objects_pinned;
 typedef SgenGrayQueue GrayQueue;
 
 /* forward declarations */
-static void scan_thread_data (void *start_nursery, void *end_nursery, gboolean precise, GrayQueue *queue);
+static void scan_thread_data (void *start_nursery, void *end_nursery, gboolean precise, ScanCopyContext ctx);
 static void scan_from_registered_roots (char *addr_start, char *addr_end, int root_type, ScanCopyContext ctx);
 static void scan_finalizer_entries (FinalizeReadyEntry *list, ScanCopyContext ctx);
 static void report_finalizer_roots (void);
 static void report_registered_roots (void);
 
-static void pin_from_roots (void *start_nursery, void *end_nursery, GrayQueue *queue);
-static void finish_gray_stack (int generation, GrayQueue *queue);
+static void pin_from_roots (void *start_nursery, void *end_nursery, ScanCopyContext ctx);
+static void finish_gray_stack (int generation, ScanCopyContext ctx);
 
 void mono_gc_scan_for_specific_ref (MonoObject *key, gboolean precise);
 
@@ -558,9 +554,9 @@ static int mark_ephemerons_in_range (ScanCopyContext ctx);
 static void clear_unreachable_ephemerons (ScanCopyContext ctx);
 static void null_ephemerons_for_domain (MonoDomain *domain);
 
-SgenObjectOperations current_object_ops;
 SgenMajorCollector major_collector;
 SgenMinorCollector sgen_minor_collector;
+/* FIXME: get rid of this */
 static GrayQueue gray_queue;
 
 static SgenRememberedSet remset;
@@ -593,12 +589,7 @@ gray_queue_redirect (SgenGrayQueue *queue)
 
        if (wake) {
                g_assert (concurrent_collection_in_progress);
-               if (sgen_workers_have_started ()) {
-                       sgen_workers_ensure_awake ();
-               } else {
-                       if (concurrent_collection_in_progress)
-                               g_assert (current_collection_generation == -1);
-               }
+               sgen_workers_ensure_awake ();
        }
 }
 
@@ -748,6 +739,8 @@ mono_gc_clear_domain (MonoDomain * domain)
                sgen_perform_collection (0, GENERATION_OLD, "clear domain", TRUE);
        g_assert (!concurrent_collection_in_progress);
 
+       major_collector.finish_sweeping ();
+
        sgen_process_fin_stage_entries ();
        sgen_process_dislink_stage_entries ();
 
@@ -875,7 +868,7 @@ sgen_add_to_global_remset (gpointer ptr, gpointer obj)
 gboolean
 sgen_drain_gray_stack (int max_objs, ScanCopyContext ctx)
 {
-       ScanObjectFunc scan_func = ctx.scan_func;
+       ScanObjectFunc scan_func = ctx.ops->scan_object;
        GrayQueue *queue = ctx.queue;
 
        if (current_collection_generation == GENERATION_OLD && major_collector.drain_gray_stack)
@@ -904,7 +897,7 @@ sgen_drain_gray_stack (int max_objs, ScanCopyContext ctx)
  * pinned objects.  Return the number of pinned objects.
  */
 static int
-pin_objects_from_nursery_pin_queue (ScanCopyContext ctx)
+pin_objects_from_nursery_pin_queue (gboolean do_scan_objects, ScanCopyContext ctx)
 {
        GCMemSection *section = nursery_section;
        void **start =  sgen_pinning_get_entry (section->pin_queue_first_entry);
@@ -918,7 +911,7 @@ pin_objects_from_nursery_pin_queue (ScanCopyContext ctx)
        void *pinning_front = start_nursery;
        size_t idx;
        void **definitely_pinned = start;
-       ScanObjectFunc scan_func = ctx.scan_func;
+       ScanObjectFunc scan_func = ctx.ops->scan_object;
        SgenGrayQueue *queue = ctx.queue;
 
        sgen_nursery_allocator_prepare_for_pinning ();
@@ -1032,7 +1025,7 @@ pin_objects_from_nursery_pin_queue (ScanCopyContext ctx)
                 * Finally - pin the object!
                 */
                desc = sgen_obj_get_descriptor_safe (obj_to_pin);
-               if (scan_func) {
+               if (do_scan_objects) {
                        scan_func (obj_to_pin, desc, queue);
                } else {
                        SGEN_LOG (4, "Pinned object %p, vtable %p (%s), count %d\n",
@@ -1076,14 +1069,14 @@ pin_objects_from_nursery_pin_queue (ScanCopyContext ctx)
 }
 
 static void
-pin_objects_in_nursery (ScanCopyContext ctx)
+pin_objects_in_nursery (gboolean do_scan_objects, ScanCopyContext ctx)
 {
        size_t reduced_to;
 
        if (nursery_section->pin_queue_first_entry == nursery_section->pin_queue_last_entry)
                return;
 
-       reduced_to = pin_objects_from_nursery_pin_queue (ctx);
+       reduced_to = pin_objects_from_nursery_pin_queue (do_scan_objects, ctx);
        nursery_section->pin_queue_last_entry = nursery_section->pin_queue_first_entry + reduced_to;
 }
 
@@ -1227,7 +1220,7 @@ conservatively_pin_objects_from (void **start, void **end, void *start_nursery,
  * conservatively scanned.
  */
 static void
-pin_from_roots (void *start_nursery, void *end_nursery, GrayQueue *queue)
+pin_from_roots (void *start_nursery, void *end_nursery, ScanCopyContext ctx)
 {
        void **start_root;
        RootRecord *root;
@@ -1244,7 +1237,7 @@ pin_from_roots (void *start_nursery, void *end_nursery, GrayQueue *queue)
         * *) the _last_ managed stack frame
         * *) pointers slots in managed frames
         */
-       scan_thread_data (start_nursery, end_nursery, FALSE, queue);
+       scan_thread_data (start_nursery, end_nursery, FALSE, ctx);
 }
 
 static void
@@ -1261,17 +1254,11 @@ unpin_objects_from_queue (SgenGrayQueue *queue)
        }
 }
 
-typedef struct {
-       CopyOrMarkObjectFunc func;
-       GrayQueue *queue;
-} UserCopyOrMarkData;
-
 static void
 single_arg_user_copy_or_mark (void **obj, void *gc_data)
 {
-       UserCopyOrMarkData *data = gc_data;
-
-       data->func (obj, data->queue);
+       ScanCopyContext *ctx = gc_data;
+       ctx->ops->copy_or_mark_object (obj, ctx->queue);
 }
 
 /*
@@ -1285,7 +1272,7 @@ single_arg_user_copy_or_mark (void **obj, void *gc_data)
 static void
 precisely_scan_objects_from (void** start_root, void** end_root, char* n_start, char *n_end, mword desc, ScanCopyContext ctx)
 {
-       CopyOrMarkObjectFunc copy_func = ctx.copy_func;
+       CopyOrMarkObjectFunc copy_func = ctx.ops->copy_or_mark_object;
        SgenGrayQueue *queue = ctx.queue;
 
        switch (desc & ROOT_DESC_TYPE_MASK) {
@@ -1321,9 +1308,8 @@ precisely_scan_objects_from (void** start_root, void** end_root, char* n_start,
                break;
        }
        case ROOT_DESC_USER: {
-               UserCopyOrMarkData data = { copy_func, queue };
                MonoGCRootMarkFunc marker = sgen_get_user_descriptor_func (desc);
-               marker (start_root, single_arg_user_copy_or_mark, &data);
+               marker (start_root, single_arg_user_copy_or_mark, &ctx);
                break;
        }
        case ROOT_DESC_RUN_LEN:
@@ -1533,7 +1519,7 @@ report_registered_roots (void)
 static void
 scan_finalizer_entries (FinalizeReadyEntry *list, ScanCopyContext ctx)
 {
-       CopyOrMarkObjectFunc copy_func = ctx.copy_func;
+       CopyOrMarkObjectFunc copy_func = ctx.ops->copy_or_mark_object;
        SgenGrayQueue *queue = ctx.queue;
        FinalizeReadyEntry *fin;
 
@@ -1561,23 +1547,15 @@ sgen_generation_name (int generation)
        return generation_name (generation);
 }
 
-SgenObjectOperations *
-sgen_get_current_object_ops (void){
-       return &current_object_ops;
-}
-
-
 static void
-finish_gray_stack (int generation, GrayQueue *queue)
+finish_gray_stack (int generation, ScanCopyContext ctx)
 {
        TV_DECLARE (atv);
        TV_DECLARE (btv);
        int done_with_ephemerons, ephemeron_rounds = 0;
-       CopyOrMarkObjectFunc copy_func = current_object_ops.copy_or_mark_object;
-       ScanObjectFunc scan_func = current_object_ops.scan_object;
-       ScanCopyContext ctx = { scan_func, copy_func, queue };
        char *start_addr = generation == GENERATION_NURSERY ? sgen_get_nursery_start () : NULL;
        char *end_addr = generation == GENERATION_NURSERY ? sgen_get_nursery_end () : (char*)-1;
+       SgenGrayQueue *queue = ctx.queue;
 
        /*
         * We copied all the reachable objects. Now it's the time to copy
@@ -1902,19 +1880,14 @@ init_stats (void)
        mono_counters_register ("Minor pinning", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_minor_pinning);
        mono_counters_register ("Minor scan remembered set", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_minor_scan_remsets);
        mono_counters_register ("Minor scan pinned", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_minor_scan_pinned);
-       mono_counters_register ("Minor scan registered roots", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_minor_scan_registered_roots);
-       mono_counters_register ("Minor scan thread data", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_minor_scan_thread_data);
-       mono_counters_register ("Minor finish gray stack", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_minor_finish_gray_stack);
+       mono_counters_register ("Minor scan roots", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_minor_scan_roots);
        mono_counters_register ("Minor fragment creation", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_minor_fragment_creation);
 
        mono_counters_register ("Major fragment clear", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_pre_collection_fragment_clear);
        mono_counters_register ("Major pinning", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_pinning);
        mono_counters_register ("Major scan pinned", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_scan_pinned);
-       mono_counters_register ("Major scan registered roots", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_scan_registered_roots);
-       mono_counters_register ("Major scan thread data", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_scan_thread_data);
-       mono_counters_register ("Major scan alloc_pinned", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_scan_alloc_pinned);
-       mono_counters_register ("Major scan finalized", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_scan_finalized);
-       mono_counters_register ("Major scan big objects", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_scan_big_objects);
+       mono_counters_register ("Major scan roots", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_scan_roots);
+       mono_counters_register ("Major scan mod union", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_scan_mod_union);
        mono_counters_register ("Major finish gray stack", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_finish_gray_stack);
        mono_counters_register ("Major free big objects", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_free_bigobjs);
        mono_counters_register ("Major LOS sweep", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_los_sweep);
@@ -1991,69 +1964,91 @@ sgen_concurrent_collection_in_progress (void)
        return concurrent_collection_in_progress;
 }
 
+typedef struct {
+       SgenThreadPoolJob job;
+       SgenObjectOperations *ops;
+} ScanJob;
+
 static void
-job_remembered_set_scan (WorkerData *worker_data, void *dummy)
+job_remembered_set_scan (void *worker_data_untyped, SgenThreadPoolJob *job)
 {
-       remset.scan_remsets (sgen_workers_get_job_gray_queue (worker_data));
+       WorkerData *worker_data = worker_data_untyped;
+       ScanJob *job_data = (ScanJob*)job;
+       ScanCopyContext ctx = CONTEXT_FROM_OBJECT_OPERATIONS (job_data->ops, sgen_workers_get_job_gray_queue (worker_data));
+       remset.scan_remsets (ctx);
 }
 
-typedef struct
-{
-       CopyOrMarkObjectFunc copy_or_mark_func;
-       ScanObjectFunc scan_func;
+typedef struct {
+       SgenThreadPoolJob job;
+       SgenObjectOperations *ops;
        char *heap_start;
        char *heap_end;
        int root_type;
-} ScanFromRegisteredRootsJobData;
+} ScanFromRegisteredRootsJob;
 
 static void
-job_scan_from_registered_roots (WorkerData *worker_data, void *job_data_untyped)
+job_scan_from_registered_roots (void *worker_data_untyped, SgenThreadPoolJob *job)
 {
-       ScanFromRegisteredRootsJobData *job_data = job_data_untyped;
-       ScanCopyContext ctx = { job_data->scan_func, job_data->copy_or_mark_func,
-               sgen_workers_get_job_gray_queue (worker_data) };
+       WorkerData *worker_data = worker_data_untyped;
+       ScanFromRegisteredRootsJob *job_data = (ScanFromRegisteredRootsJob*)job;
+       ScanCopyContext ctx = CONTEXT_FROM_OBJECT_OPERATIONS (job_data->ops, sgen_workers_get_job_gray_queue (worker_data));
 
        scan_from_registered_roots (job_data->heap_start, job_data->heap_end, job_data->root_type, ctx);
-       sgen_free_internal_dynamic (job_data, sizeof (ScanFromRegisteredRootsJobData), INTERNAL_MEM_WORKER_JOB_DATA);
 }
 
-typedef struct
-{
+typedef struct {
+       SgenThreadPoolJob job;
+       SgenObjectOperations *ops;
        char *heap_start;
        char *heap_end;
-} ScanThreadDataJobData;
+} ScanThreadDataJob;
 
 static void
-job_scan_thread_data (WorkerData *worker_data, void *job_data_untyped)
+job_scan_thread_data (void *worker_data_untyped, SgenThreadPoolJob *job)
 {
-       ScanThreadDataJobData *job_data = job_data_untyped;
+       WorkerData *worker_data = worker_data_untyped;
+       ScanThreadDataJob *job_data = (ScanThreadDataJob*)job;
+       ScanCopyContext ctx = CONTEXT_FROM_OBJECT_OPERATIONS (job_data->ops, sgen_workers_get_job_gray_queue (worker_data));
 
-       scan_thread_data (job_data->heap_start, job_data->heap_end, TRUE,
-                       sgen_workers_get_job_gray_queue (worker_data));
-       sgen_free_internal_dynamic (job_data, sizeof (ScanThreadDataJobData), INTERNAL_MEM_WORKER_JOB_DATA);
+       scan_thread_data (job_data->heap_start, job_data->heap_end, TRUE, ctx);
 }
 
+typedef struct {
+       SgenThreadPoolJob job;
+       SgenObjectOperations *ops;
+       FinalizeReadyEntry *list;
+} ScanFinalizerEntriesJob;
+
 static void
-job_scan_finalizer_entries (WorkerData *worker_data, void *job_data_untyped)
+job_scan_finalizer_entries (void *worker_data_untyped, SgenThreadPoolJob *job)
 {
-       FinalizeReadyEntry *list = job_data_untyped;
-       ScanCopyContext ctx = { NULL, current_object_ops.copy_or_mark_object, sgen_workers_get_job_gray_queue (worker_data) };
+       WorkerData *worker_data = worker_data_untyped;
+       ScanFinalizerEntriesJob *job_data = (ScanFinalizerEntriesJob*)job;
+       ScanCopyContext ctx = CONTEXT_FROM_OBJECT_OPERATIONS (job_data->ops, sgen_workers_get_job_gray_queue (worker_data));
 
-       scan_finalizer_entries (list, ctx);
+       scan_finalizer_entries (job_data->list, ctx);
 }
 
 static void
-job_scan_major_mod_union_cardtable (WorkerData *worker_data, void *job_data_untyped)
+job_scan_major_mod_union_card_table (void *worker_data_untyped, SgenThreadPoolJob *job)
 {
+       WorkerData *worker_data = worker_data_untyped;
+       ScanJob *job_data = (ScanJob*)job;
+       ScanCopyContext ctx = CONTEXT_FROM_OBJECT_OPERATIONS (job_data->ops, sgen_workers_get_job_gray_queue (worker_data));
+
        g_assert (concurrent_collection_in_progress);
-       major_collector.scan_card_table (TRUE, sgen_workers_get_job_gray_queue (worker_data));
+       major_collector.scan_card_table (TRUE, ctx);
 }
 
 static void
-job_scan_los_mod_union_cardtable (WorkerData *worker_data, void *job_data_untyped)
+job_scan_los_mod_union_card_table (void *worker_data_untyped, SgenThreadPoolJob *job)
 {
+       WorkerData *worker_data = worker_data_untyped;
+       ScanJob *job_data = (ScanJob*)job;
+       ScanCopyContext ctx = CONTEXT_FROM_OBJECT_OPERATIONS (job_data->ops, sgen_workers_get_job_gray_queue (worker_data));
+
        g_assert (concurrent_collection_in_progress);
-       sgen_los_scan_card_table (TRUE, sgen_workers_get_job_gray_queue (worker_data));
+       sgen_los_scan_card_table (TRUE, ctx);
 }
 
 static void
@@ -2155,6 +2150,49 @@ init_gray_queue (void)
        sgen_gray_object_queue_init (&gray_queue, NULL);
 }
 
+static void
+enqueue_scan_from_roots_jobs (char *heap_start, char *heap_end, SgenObjectOperations *ops)
+{
+       ScanFromRegisteredRootsJob *scrrj;
+       ScanThreadDataJob *stdj;
+       ScanFinalizerEntriesJob *sfej;
+
+       /* registered roots, this includes static fields */
+
+       scrrj = (ScanFromRegisteredRootsJob*)sgen_thread_pool_job_alloc ("scan from registered roots normal", job_scan_from_registered_roots, sizeof (ScanFromRegisteredRootsJob));
+       scrrj->ops = ops;
+       scrrj->heap_start = heap_start;
+       scrrj->heap_end = heap_end;
+       scrrj->root_type = ROOT_TYPE_NORMAL;
+       sgen_workers_enqueue_job (&scrrj->job);
+
+       scrrj = (ScanFromRegisteredRootsJob*)sgen_thread_pool_job_alloc ("scan from registered roots wbarrier", job_scan_from_registered_roots, sizeof (ScanFromRegisteredRootsJob));
+       scrrj->ops = ops;
+       scrrj->heap_start = heap_start;
+       scrrj->heap_end = heap_end;
+       scrrj->root_type = ROOT_TYPE_WBARRIER;
+       sgen_workers_enqueue_job (&scrrj->job);
+
+       /* Threads */
+
+       stdj = (ScanThreadDataJob*)sgen_thread_pool_job_alloc ("scan thread data", job_scan_thread_data, sizeof (ScanThreadDataJob));
+       stdj->heap_start = heap_start;
+       stdj->heap_end = heap_end;
+       sgen_workers_enqueue_job (&stdj->job);
+
+       /* Scan the list of objects ready for finalization. */
+
+       sfej = (ScanFinalizerEntriesJob*)sgen_thread_pool_job_alloc ("scan finalizer entries", job_scan_finalizer_entries, sizeof (ScanFinalizerEntriesJob));
+       sfej->list = fin_ready_list;
+       sfej->ops = ops;
+       sgen_workers_enqueue_job (&sfej->job);
+
+       sfej = (ScanFinalizerEntriesJob*)sgen_thread_pool_job_alloc ("scan critical finalizer entries", job_scan_finalizer_entries, sizeof (ScanFinalizerEntriesJob));
+       sfej->list = critical_fin_list;
+       sfej->ops = ops;
+       sgen_workers_enqueue_job (&sfej->job);
+}
+
 /*
  * Perform a nursery collection.
  *
@@ -2166,10 +2204,10 @@ collect_nursery (SgenGrayQueue *unpin_queue, gboolean finish_up_concurrent_mark)
        gboolean needs_major;
        size_t max_garbage_amount;
        char *nursery_next;
-       ScanFromRegisteredRootsJobData *scrrjd_normal, *scrrjd_wbarrier;
-       ScanThreadDataJobData *stdjd;
        mword fragment_total;
-       ScanCopyContext ctx;
+       ScanJob *sj;
+       SgenObjectOperations *object_ops = &sgen_minor_collector.serial_ops;
+       ScanCopyContext ctx = CONTEXT_FROM_OBJECT_OPERATIONS (object_ops, &gray_queue);
        TV_DECLARE (atv);
        TV_DECLARE (btv);
 
@@ -2189,7 +2227,8 @@ collect_nursery (SgenGrayQueue *unpin_queue, gboolean finish_up_concurrent_mark)
 #endif
 
        current_collection_generation = GENERATION_NURSERY;
-       current_object_ops = sgen_minor_collector.serial_ops;
+
+       SGEN_ASSERT (0, !sgen_collection_is_concurrent (), "Why is the nursery collection concurrent?");
 
        reset_pinned_from_failed_allocation ();
 
@@ -2243,16 +2282,14 @@ collect_nursery (SgenGrayQueue *unpin_queue, gboolean finish_up_concurrent_mark)
        /* pin from pinned handles */
        sgen_init_pinning ();
        mono_profiler_gc_event (MONO_GC_EVENT_MARK_START, 0);
-       pin_from_roots (sgen_get_nursery_start (), nursery_next, WORKERS_DISTRIBUTE_GRAY_QUEUE);
+       pin_from_roots (sgen_get_nursery_start (), nursery_next, ctx);
        /* pin cemented objects */
        sgen_pin_cemented_objects ();
        /* identify pinned objects */
        sgen_optimize_pin_queue ();
        sgen_pinning_setup_section (nursery_section);
-       ctx.scan_func = NULL;
-       ctx.copy_func = NULL;
-       ctx.queue = WORKERS_DISTRIBUTE_GRAY_QUEUE;
-       pin_objects_in_nursery (ctx);
+
+       pin_objects_in_nursery (FALSE, ctx);
        sgen_pinning_trim_queue_to_section (nursery_section);
 
        TV_GETTIME (atv);
@@ -2267,7 +2304,9 @@ collect_nursery (SgenGrayQueue *unpin_queue, gboolean finish_up_concurrent_mark)
         * as part of which we scan the card table.  Then, later, we scan the mod union
         * cardtable.  We should only have to do one.
         */
-       sgen_workers_enqueue_job ("scan remset", job_remembered_set_scan, NULL);
+       sj = (ScanJob*)sgen_thread_pool_job_alloc ("scan remset", job_remembered_set_scan, sizeof (ScanJob));
+       sj->ops = object_ops;
+       sgen_workers_enqueue_job (&sj->job);
 
        /* we don't have complete write barrier yet, so we scan all the old generation sections */
        TV_GETTIME (btv);
@@ -2276,10 +2315,6 @@ collect_nursery (SgenGrayQueue *unpin_queue, gboolean finish_up_concurrent_mark)
 
        MONO_GC_CHECKPOINT_4 (GENERATION_NURSERY);
 
-       /* FIXME: why is this here? */
-       ctx.scan_func = current_object_ops.scan_object;
-       ctx.copy_func = NULL;
-       ctx.queue = &gray_queue;
        sgen_drain_gray_stack (-1, ctx);
 
        if (mono_profiler_get_events () & MONO_PROFILE_GC_ROOTS)
@@ -2291,63 +2326,22 @@ collect_nursery (SgenGrayQueue *unpin_queue, gboolean finish_up_concurrent_mark)
 
        MONO_GC_CHECKPOINT_5 (GENERATION_NURSERY);
 
-       /* registered roots, this includes static fields */
-       scrrjd_normal = sgen_alloc_internal_dynamic (sizeof (ScanFromRegisteredRootsJobData), INTERNAL_MEM_WORKER_JOB_DATA, TRUE);
-       scrrjd_normal->copy_or_mark_func = current_object_ops.copy_or_mark_object;
-       scrrjd_normal->scan_func = current_object_ops.scan_object;
-       scrrjd_normal->heap_start = sgen_get_nursery_start ();
-       scrrjd_normal->heap_end = nursery_next;
-       scrrjd_normal->root_type = ROOT_TYPE_NORMAL;
-       sgen_workers_enqueue_job ("scan from registered roots normal", job_scan_from_registered_roots, scrrjd_normal);
-
-       scrrjd_wbarrier = sgen_alloc_internal_dynamic (sizeof (ScanFromRegisteredRootsJobData), INTERNAL_MEM_WORKER_JOB_DATA, TRUE);
-       scrrjd_wbarrier->copy_or_mark_func = current_object_ops.copy_or_mark_object;
-       scrrjd_wbarrier->scan_func = current_object_ops.scan_object;
-       scrrjd_wbarrier->heap_start = sgen_get_nursery_start ();
-       scrrjd_wbarrier->heap_end = nursery_next;
-       scrrjd_wbarrier->root_type = ROOT_TYPE_WBARRIER;
-       sgen_workers_enqueue_job ("scan from registered roots wbarrier", job_scan_from_registered_roots, scrrjd_wbarrier);
+       enqueue_scan_from_roots_jobs (sgen_get_nursery_start (), nursery_next, object_ops);
 
        TV_GETTIME (btv);
-       time_minor_scan_registered_roots += TV_ELAPSED (atv, btv);
+       time_minor_scan_roots += TV_ELAPSED (atv, btv);
 
        MONO_GC_CHECKPOINT_6 (GENERATION_NURSERY);
-
-       /* thread data */
-       stdjd = sgen_alloc_internal_dynamic (sizeof (ScanThreadDataJobData), INTERNAL_MEM_WORKER_JOB_DATA, TRUE);
-       stdjd->heap_start = sgen_get_nursery_start ();
-       stdjd->heap_end = nursery_next;
-       sgen_workers_enqueue_job ("scan thread data", job_scan_thread_data, stdjd);
-
-       TV_GETTIME (atv);
-       time_minor_scan_thread_data += TV_ELAPSED (btv, atv);
-       btv = atv;
-
        MONO_GC_CHECKPOINT_7 (GENERATION_NURSERY);
-
-       g_assert (!sgen_collection_is_concurrent ());
-
-       /* Scan the list of objects ready for finalization. If */
-       sgen_workers_enqueue_job ("scan finalizer entries", job_scan_finalizer_entries, fin_ready_list);
-       sgen_workers_enqueue_job ("scan criticial finalizer entries", job_scan_finalizer_entries, critical_fin_list);
-
        MONO_GC_CHECKPOINT_8 (GENERATION_NURSERY);
 
-       finish_gray_stack (GENERATION_NURSERY, &gray_queue);
+       finish_gray_stack (GENERATION_NURSERY, ctx);
        TV_GETTIME (atv);
        time_minor_finish_gray_stack += TV_ELAPSED (btv, atv);
        mono_profiler_gc_event (MONO_GC_EVENT_MARK_END, 0);
 
        MONO_GC_CHECKPOINT_9 (GENERATION_NURSERY);
 
-       /*
-        * The (single-threaded) finalization code might have done
-        * some copying/marking so we can only reset the GC thread's
-        * worker data here instead of earlier when we joined the
-        * workers.
-        */
-       sgen_workers_reset_data ();
-
        if (objects_pinned) {
                sgen_optimize_pin_queue ();
                sgen_pinning_setup_section (nursery_section);
@@ -2422,7 +2416,7 @@ scan_nursery_objects_callback (char *obj, size_t size, ScanCopyContext *ctx)
         * This is called on all objects in the nursery, including pinned ones, so we need
         * to use sgen_obj_get_descriptor_safe(), which masks out the vtable tag bits.
         */
-       ctx->scan_func (obj, sgen_obj_get_descriptor_safe (obj), ctx->queue);
+       ctx->ops->scan_object (obj, sgen_obj_get_descriptor_safe (obj), ctx->queue);
 }
 
 static void
@@ -2432,8 +2426,14 @@ scan_nursery_objects (ScanCopyContext ctx)
                        (IterateObjectCallbackFunc)scan_nursery_objects_callback, (void*)&ctx, FALSE);
 }
 
+typedef enum {
+       COPY_OR_MARK_FROM_ROOTS_SERIAL,
+       COPY_OR_MARK_FROM_ROOTS_START_CONCURRENT,
+       COPY_OR_MARK_FROM_ROOTS_FINISH_CONCURRENT
+} CopyOrMarkFromRootsMode;
+
 static void
-major_copy_or_mark_from_roots (size_t *old_next_pin_slot, gboolean start_concurrent_mark, gboolean finish_up_concurrent_mark, gboolean scan_mod_union, gboolean scan_whole_nursery)
+major_copy_or_mark_from_roots (size_t *old_next_pin_slot, CopyOrMarkFromRootsMode mode, gboolean scan_whole_nursery, SgenObjectOperations *object_ops)
 {
        LOSObject *bigobj;
        TV_DECLARE (atv);
@@ -2445,11 +2445,15 @@ major_copy_or_mark_from_roots (size_t *old_next_pin_slot, gboolean start_concurr
        char *heap_end = (char*)-1;
        gboolean profile_roots = mono_profiler_get_events () & MONO_PROFILE_GC_ROOTS;
        GCRootReport root_report = { 0 };
-       ScanFromRegisteredRootsJobData *scrrjd_normal, *scrrjd_wbarrier;
-       ScanThreadDataJobData *stdjd;
-       ScanCopyContext ctx;
+       ScanCopyContext ctx = CONTEXT_FROM_OBJECT_OPERATIONS (object_ops, WORKERS_DISTRIBUTE_GRAY_QUEUE);
+       gboolean concurrent = mode != COPY_OR_MARK_FROM_ROOTS_SERIAL;
 
-       if (concurrent_collection_in_progress) {
+       SGEN_ASSERT (0, !!concurrent == !!concurrent_collection_in_progress, "We've been called with the wrong mode.");
+
+       if (scan_whole_nursery)
+               SGEN_ASSERT (0, mode == COPY_OR_MARK_FROM_ROOTS_FINISH_CONCURRENT, "Scanning whole nursery only makes sense when we're finishing a concurrent collection.");
+
+       if (concurrent) {
                /*This cleans up unused fragments */
                sgen_nursery_allocator_prepare_for_pinning ();
 
@@ -2468,7 +2472,7 @@ major_copy_or_mark_from_roots (size_t *old_next_pin_slot, gboolean start_concurr
        sgen_clear_nursery_fragments ();
 
        if (whole_heap_check_before_collection)
-               sgen_check_whole_heap (finish_up_concurrent_mark);
+               sgen_check_whole_heap (mode == COPY_OR_MARK_FROM_ROOTS_FINISH_CONCURRENT);
 
        TV_GETTIME (btv);
        time_major_pre_collection_fragment_clear += TV_ELAPSED (atv, btv);
@@ -2486,7 +2490,7 @@ major_copy_or_mark_from_roots (size_t *old_next_pin_slot, gboolean start_concurr
                sgen_check_for_xdomain_refs ();
        }
 
-       if (!concurrent_collection_in_progress) {
+       if (!concurrent) {
                /* Remsets are not useful for a major collection */
                remset.clear_cards ();
        }
@@ -2497,9 +2501,9 @@ major_copy_or_mark_from_roots (size_t *old_next_pin_slot, gboolean start_concurr
        TV_GETTIME (atv);
        sgen_init_pinning ();
        SGEN_LOG (6, "Collecting pinned addresses");
-       pin_from_roots ((void*)lowest_heap_address, (void*)highest_heap_address, WORKERS_DISTRIBUTE_GRAY_QUEUE);
+       pin_from_roots ((void*)lowest_heap_address, (void*)highest_heap_address, ctx);
 
-       if (!concurrent_collection_in_progress || finish_up_concurrent_mark) {
+       if (mode != COPY_OR_MARK_FROM_ROOTS_START_CONCURRENT) {
                if (major_collector.is_concurrent) {
                        /*
                         * The concurrent major collector cannot evict
@@ -2544,7 +2548,7 @@ major_copy_or_mark_from_roots (size_t *old_next_pin_slot, gboolean start_concurr
 #endif
 
                        if (sgen_los_object_is_pinned (bigobj->data)) {
-                               g_assert (finish_up_concurrent_mark);
+                               SGEN_ASSERT (0, mode == COPY_OR_MARK_FROM_ROOTS_FINISH_CONCURRENT, "LOS objects can only be pinned here after concurrent marking.");
                                continue;
                        }
                        sgen_los_pin_object (bigobj->data);
@@ -2561,9 +2565,6 @@ major_copy_or_mark_from_roots (size_t *old_next_pin_slot, gboolean start_concurr
        if (profile_roots)
                notify_gc_roots (&root_report);
        /* second pass for the sections */
-       ctx.scan_func = concurrent_collection_in_progress ? current_object_ops.scan_object : NULL;
-       ctx.copy_func = NULL;
-       ctx.queue = WORKERS_DISTRIBUTE_GRAY_QUEUE;
 
        /*
         * Concurrent mark never follows references into the nursery.  In the start and
@@ -2591,12 +2592,12 @@ major_copy_or_mark_from_roots (size_t *old_next_pin_slot, gboolean start_concurr
         * Non-concurrent mark evacuates from the nursery, so it's
         * sufficient to just scan pinned nursery objects.
         */
-       if (scan_whole_nursery || finish_up_concurrent_mark || (concurrent_collection_in_progress && sgen_minor_collector.is_split)) {
+       if (scan_whole_nursery || mode == COPY_OR_MARK_FROM_ROOTS_FINISH_CONCURRENT || (concurrent && sgen_minor_collector.is_split)) {
                scan_nursery_objects (ctx);
        } else {
-               pin_objects_in_nursery (ctx);
+               pin_objects_in_nursery (concurrent, ctx);
                if (check_nursery_objects_pinned && !sgen_minor_collector.is_split)
-                       sgen_check_nursery_objects_pinned (!concurrent_collection_in_progress || finish_up_concurrent_mark);
+                       sgen_check_nursery_objects_pinned (mode != COPY_OR_MARK_FROM_ROOTS_START_CONCURRENT);
        }
 
        major_collector.pin_objects (WORKERS_DISTRIBUTE_GRAY_QUEUE);
@@ -2616,8 +2617,9 @@ major_copy_or_mark_from_roots (size_t *old_next_pin_slot, gboolean start_concurr
         * before pinning has finished.  For the non-concurrent
         * collector we start the workers after pinning.
         */
-       if (start_concurrent_mark) {
-               sgen_workers_start_all_workers ();
+       if (mode != COPY_OR_MARK_FROM_ROOTS_SERIAL) {
+               SGEN_ASSERT (0, sgen_workers_all_done (), "Why are the workers not done when we start or finish a major collection?");
+               sgen_workers_start_all_workers (object_ops);
                gray_queue_enable_redirect (WORKERS_DISTRIBUTE_GRAY_QUEUE);
        }
 
@@ -2630,59 +2632,33 @@ major_copy_or_mark_from_roots (size_t *old_next_pin_slot, gboolean start_concurr
        TV_GETTIME (atv);
        time_major_scan_pinned += TV_ELAPSED (btv, atv);
 
-       /* registered roots, this includes static fields */
-       scrrjd_normal = sgen_alloc_internal_dynamic (sizeof (ScanFromRegisteredRootsJobData), INTERNAL_MEM_WORKER_JOB_DATA, TRUE);
-       scrrjd_normal->copy_or_mark_func = current_object_ops.copy_or_mark_object;
-       scrrjd_normal->scan_func = current_object_ops.scan_object;
-       scrrjd_normal->heap_start = heap_start;
-       scrrjd_normal->heap_end = heap_end;
-       scrrjd_normal->root_type = ROOT_TYPE_NORMAL;
-       sgen_workers_enqueue_job ("scan from registered roots normal", job_scan_from_registered_roots, scrrjd_normal);
-
-       scrrjd_wbarrier = sgen_alloc_internal_dynamic (sizeof (ScanFromRegisteredRootsJobData), INTERNAL_MEM_WORKER_JOB_DATA, TRUE);
-       scrrjd_wbarrier->copy_or_mark_func = current_object_ops.copy_or_mark_object;
-       scrrjd_wbarrier->scan_func = current_object_ops.scan_object;
-       scrrjd_wbarrier->heap_start = heap_start;
-       scrrjd_wbarrier->heap_end = heap_end;
-       scrrjd_wbarrier->root_type = ROOT_TYPE_WBARRIER;
-       sgen_workers_enqueue_job ("scan from registered roots wbarrier", job_scan_from_registered_roots, scrrjd_wbarrier);
-
-       TV_GETTIME (btv);
-       time_major_scan_registered_roots += TV_ELAPSED (atv, btv);
-
-       /* Threads */
-       stdjd = sgen_alloc_internal_dynamic (sizeof (ScanThreadDataJobData), INTERNAL_MEM_WORKER_JOB_DATA, TRUE);
-       stdjd->heap_start = heap_start;
-       stdjd->heap_end = heap_end;
-       sgen_workers_enqueue_job ("scan thread data", job_scan_thread_data, stdjd);
-
-       TV_GETTIME (atv);
-       time_major_scan_thread_data += TV_ELAPSED (btv, atv);
-
-       TV_GETTIME (btv);
-       time_major_scan_alloc_pinned += TV_ELAPSED (atv, btv);
-
        if (mono_profiler_get_events () & MONO_PROFILE_GC_ROOTS)
                report_finalizer_roots ();
 
-       /* scan the list of objects ready for finalization */
-       sgen_workers_enqueue_job ("scan finalizer entries", job_scan_finalizer_entries, fin_ready_list);
-       sgen_workers_enqueue_job ("scan critical finalizer entries", job_scan_finalizer_entries, critical_fin_list);
+       /*
+        * FIXME: is this the right context?  It doesn't seem to contain a copy function
+        * unless we're concurrent.
+        */
+       enqueue_scan_from_roots_jobs (heap_start, heap_end, object_ops);
+
+       TV_GETTIME (btv);
+       time_major_scan_roots += TV_ELAPSED (atv, btv);
 
-       if (scan_mod_union) {
-               g_assert (finish_up_concurrent_mark);
+       if (mode == COPY_OR_MARK_FROM_ROOTS_FINISH_CONCURRENT) {
+               ScanJob *sj;
 
                /* Mod union card table */
-               sgen_workers_enqueue_job ("scan mod union cardtable", job_scan_major_mod_union_cardtable, NULL);
-               sgen_workers_enqueue_job ("scan LOS mod union cardtable", job_scan_los_mod_union_cardtable, NULL);
-       }
+               sj = (ScanJob*)sgen_thread_pool_job_alloc ("scan mod union cardtable", job_scan_major_mod_union_card_table, sizeof (ScanJob));
+               sj->ops = object_ops;
+               sgen_workers_enqueue_job (&sj->job);
 
-       TV_GETTIME (atv);
-       time_major_scan_finalized += TV_ELAPSED (btv, atv);
-       SGEN_LOG (2, "Root scan: %d usecs", TV_ELAPSED (btv, atv));
+               sj = (ScanJob*)sgen_thread_pool_job_alloc ("scan LOS mod union cardtable", job_scan_los_mod_union_card_table, sizeof (ScanJob));
+               sj->ops = object_ops;
+               sgen_workers_enqueue_job (&sj->job);
 
-       TV_GETTIME (btv);
-       time_major_scan_big_objects += TV_ELAPSED (atv, btv);
+               TV_GETTIME (atv);
+               time_major_scan_mod_union += TV_ELAPSED (btv, atv);
+       }
 }
 
 static void
@@ -2707,6 +2683,8 @@ major_finish_copy_or_mark (void)
 static void
 major_start_collection (gboolean concurrent, size_t *old_next_pin_slot)
 {
+       SgenObjectOperations *object_ops;
+
        MONO_GC_BEGIN (GENERATION_OLD);
        binary_protocol_collection_begin (gc_stats.major_gc_count, GENERATION_OLD);
 
@@ -2723,9 +2701,9 @@ major_start_collection (gboolean concurrent, size_t *old_next_pin_slot)
                g_assert (major_collector.is_concurrent);
                concurrent_collection_in_progress = TRUE;
 
-               current_object_ops = major_collector.major_concurrent_ops;
+               object_ops = &major_collector.major_ops_concurrent_start;
        } else {
-               current_object_ops = major_collector.major_ops;
+               object_ops = &major_collector.major_ops_serial;
        }
 
        reset_pinned_from_failed_allocation ();
@@ -2744,38 +2722,26 @@ major_start_collection (gboolean concurrent, size_t *old_next_pin_slot)
        if (major_collector.start_major_collection)
                major_collector.start_major_collection ();
 
-       major_copy_or_mark_from_roots (old_next_pin_slot, concurrent, FALSE, FALSE, FALSE);
+       major_copy_or_mark_from_roots (old_next_pin_slot, concurrent ? COPY_OR_MARK_FROM_ROOTS_START_CONCURRENT : COPY_OR_MARK_FROM_ROOTS_SERIAL, FALSE, object_ops);
        major_finish_copy_or_mark ();
 }
 
 static void
-wait_for_workers_to_finish (void)
-{
-       while (!sgen_workers_all_done ())
-               g_usleep (200);
-}
-
-static void
-major_finish_collection (const char *reason, size_t old_next_pin_slot, gboolean scan_whole_nursery)
+major_finish_collection (const char *reason, size_t old_next_pin_slot, gboolean forced, gboolean scan_whole_nursery)
 {
        ScannedObjectCounts counts;
-       LOSObject *bigobj, *prevbo;
+       SgenObjectOperations *object_ops;
        TV_DECLARE (atv);
        TV_DECLARE (btv);
 
        TV_GETTIME (btv);
 
        if (concurrent_collection_in_progress) {
-               sgen_workers_signal_start_nursery_collection_and_wait ();
-
-               current_object_ops = major_collector.major_concurrent_ops;
-
-               major_copy_or_mark_from_roots (NULL, FALSE, TRUE, TRUE, scan_whole_nursery);
+               object_ops = &major_collector.major_ops_concurrent_finish;
 
-               sgen_workers_signal_finish_nursery_collection ();
+               major_copy_or_mark_from_roots (NULL, COPY_OR_MARK_FROM_ROOTS_FINISH_CONCURRENT, scan_whole_nursery, object_ops);
 
                major_finish_copy_or_mark ();
-               gray_queue_enable_redirect (WORKERS_DISTRIBUTE_GRAY_QUEUE);
 
                sgen_workers_join ();
 
@@ -2789,7 +2755,7 @@ major_finish_collection (const char *reason, size_t old_next_pin_slot, gboolean
                        check_nursery_is_clean ();
        } else {
                SGEN_ASSERT (0, !scan_whole_nursery, "scan_whole_nursery only applies to concurrent collections");
-               current_object_ops = major_collector.major_ops;
+               object_ops = &major_collector.major_ops_serial;
        }
 
        /*
@@ -2801,20 +2767,12 @@ major_finish_collection (const char *reason, size_t old_next_pin_slot, gboolean
        g_assert (sgen_section_gray_queue_is_empty (sgen_workers_get_distribute_section_gray_queue ()));
 
        /* all the objects in the heap */
-       finish_gray_stack (GENERATION_OLD, &gray_queue);
+       finish_gray_stack (GENERATION_OLD, CONTEXT_FROM_OBJECT_OPERATIONS (object_ops, &gray_queue));
        TV_GETTIME (atv);
        time_major_finish_gray_stack += TV_ELAPSED (btv, atv);
 
        SGEN_ASSERT (0, sgen_workers_all_done (), "Can't have workers working after joining");
 
-       /*
-        * The (single-threaded) finalization code might have done
-        * some copying/marking so we can only reset the GC thread's
-        * worker data here instead of earlier when we joined the
-        * workers.
-        */
-       sgen_workers_reset_data ();
-
        if (objects_pinned) {
                g_assert (!concurrent_collection_in_progress);
 
@@ -2865,32 +2823,8 @@ major_finish_collection (const char *reason, size_t old_next_pin_slot, gboolean
        TV_GETTIME (btv);
        time_major_fragment_creation += TV_ELAPSED (atv, btv);
 
-
        MONO_GC_SWEEP_BEGIN (GENERATION_OLD, !major_collector.sweeps_lazily);
 
-       /* sweep the big objects list */
-       prevbo = NULL;
-       for (bigobj = los_object_list; bigobj;) {
-               g_assert (!object_is_pinned (bigobj->data));
-               if (sgen_los_object_is_pinned (bigobj->data)) {
-                       sgen_los_unpin_object (bigobj->data);
-                       sgen_update_heap_boundaries ((mword)bigobj->data, (mword)bigobj->data + sgen_los_object_size (bigobj));
-               } else {
-                       LOSObject *to_free;
-                       /* not referenced anywhere, so we can free it */
-                       if (prevbo)
-                               prevbo->next = bigobj->next;
-                       else
-                               los_object_list = bigobj->next;
-                       to_free = bigobj;
-                       bigobj = bigobj->next;
-                       sgen_los_free_object (to_free);
-                       continue;
-               }
-               prevbo = bigobj;
-               bigobj = bigobj->next;
-       }
-
        TV_GETTIME (atv);
        time_major_free_bigobjs += TV_ELAPSED (btv, atv);
 
@@ -2916,7 +2850,7 @@ major_finish_collection (const char *reason, size_t old_next_pin_slot, gboolean
 
        g_assert (sgen_gray_object_queue_is_empty (&gray_queue));
 
-       sgen_memgov_major_collection_end ();
+       sgen_memgov_major_collection_end (forced);
        current_collection_generation = -1;
 
        memset (&counts, 0, sizeof (ScannedObjectCounts));
@@ -2939,7 +2873,7 @@ major_finish_collection (const char *reason, size_t old_next_pin_slot, gboolean
 }
 
 static gboolean
-major_do_collection (const char *reason)
+major_do_collection (const char *reason, gboolean forced)
 {
        TV_DECLARE (time_start);
        TV_DECLARE (time_end);
@@ -2957,7 +2891,7 @@ major_do_collection (const char *reason)
        TV_GETTIME (time_start);
 
        major_start_collection (FALSE, &old_next_pin_slot);
-       major_finish_collection (reason, old_next_pin_slot, FALSE);
+       major_finish_collection (reason, old_next_pin_slot, forced, FALSE);
 
        TV_GETTIME (time_end);
        gc_stats.major_gc_time += TV_ELAPSED (time_start, time_end);
@@ -3033,7 +2967,7 @@ major_update_concurrent_collection (void)
 }
 
 static void
-major_finish_concurrent_collection (void)
+major_finish_concurrent_collection (gboolean forced)
 {
        TV_DECLARE (total_start);
        TV_DECLARE (total_end);
@@ -3052,7 +2986,7 @@ major_finish_concurrent_collection (void)
         * marking before the nursery collection is allowed to run, otherwise we might miss
         * some remsets.
         */
-       wait_for_workers_to_finish ();
+       sgen_workers_wait ();
 
        SGEN_TV_GETTIME (time_major_conc_collection_end);
        gc_stats.major_gc_time_concurrent += SGEN_TV_ELAPSED (time_major_conc_collection_start, time_major_conc_collection_end);
@@ -3066,7 +3000,7 @@ major_finish_concurrent_collection (void)
                sgen_check_mod_union_consistency ();
 
        current_collection_generation = GENERATION_OLD;
-       major_finish_collection ("finishing", -1, late_pinned);
+       major_finish_collection ("finishing", -1, forced, late_pinned);
 
        if (whole_heap_check_before_collection)
                sgen_check_whole_heap (FALSE);
@@ -3093,7 +3027,6 @@ sgen_ensure_free_space (size_t size)
        int generation_to_collect = -1;
        const char *reason = NULL;
 
-
        if (size > SGEN_MAX_SMALL_OBJ_SIZE) {
                if (sgen_need_major_collection (size)) {
                        reason = "LOS overflow";
@@ -3163,7 +3096,7 @@ sgen_perform_collection (size_t requested_size, int generation_to_collect, const
                gboolean finish = major_should_finish_concurrent_collection () || (wait_to_finish && generation_to_collect == GENERATION_OLD);
 
                if (finish) {
-                       major_finish_concurrent_collection ();
+                       major_finish_concurrent_collection (wait_to_finish);
                        oldest_generation_collected = GENERATION_OLD;
                } else {
                        sgen_workers_signal_start_nursery_collection_and_wait ();
@@ -3210,7 +3143,7 @@ sgen_perform_collection (size_t requested_size, int generation_to_collect, const
                        goto done;
                }
 
-               if (major_do_collection (reason)) {
+               if (major_do_collection (reason, wait_to_finish)) {
                        overflow_generation_to_collect = GENERATION_NURSERY;
                        overflow_reason = "Excessive pinning";
                }
@@ -3242,7 +3175,7 @@ sgen_perform_collection (size_t requested_size, int generation_to_collect, const
                if (overflow_generation_to_collect == GENERATION_NURSERY)
                        collect_nursery (NULL, FALSE);
                else
-                       major_do_collection (overflow_reason);
+                       major_do_collection (overflow_reason, wait_to_finish);
 
                TV_GETTIME (gc_end);
                infos [1].total_time = SGEN_TV_ELAPSED (infos [1].total_time, gc_end);
@@ -3462,7 +3395,7 @@ null_ephemerons_for_domain (MonoDomain *domain)
 static void
 clear_unreachable_ephemerons (ScanCopyContext ctx)
 {
-       CopyOrMarkObjectFunc copy_func = ctx.copy_func;
+       CopyOrMarkObjectFunc copy_func = ctx.ops->copy_or_mark_object;
        GrayQueue *queue = ctx.queue;
        EphemeronLinkNode *current = ephemeron_list, *prev = NULL;
        MonoArray *array;
@@ -3527,7 +3460,7 @@ Limitations: We scan all ephemerons on every collection since the current design
 static int
 mark_ephemerons_in_range (ScanCopyContext ctx)
 {
-       CopyOrMarkObjectFunc copy_func = ctx.copy_func;
+       CopyOrMarkObjectFunc copy_func = ctx.ops->copy_or_mark_object;
        GrayQueue *queue = ctx.queue;
        int nothing_marked = 1;
        EphemeronLinkNode *current = ephemeron_list;
@@ -3755,8 +3688,8 @@ mono_gc_conservatively_scan_area (void *start, void *end)
 void*
 mono_gc_scan_object (void *obj, void *gc_data)
 {
-       UserCopyOrMarkData *data = gc_data;
-       current_object_ops.copy_or_mark_object (&obj, data->queue);
+       ScanCopyContext *ctx = gc_data;
+       ctx->ops->copy_or_mark_object (&obj, ctx->queue);
        return obj;
 }
 
@@ -3764,7 +3697,7 @@ mono_gc_scan_object (void *obj, void *gc_data)
  * Mark from thread stacks and registers.
  */
 static void
-scan_thread_data (void *start_nursery, void *end_nursery, gboolean precise, GrayQueue *queue)
+scan_thread_data (void *start_nursery, void *end_nursery, gboolean precise, ScanCopyContext ctx)
 {
        SgenThreadInfo *info;
 
@@ -3787,8 +3720,7 @@ scan_thread_data (void *start_nursery, void *end_nursery, gboolean precise, Gray
                g_assert (info->suspend_done);
                SGEN_LOG (3, "Scanning thread %p, range: %p-%p, size: %td, pinned=%zd", info, info->stack_start, info->stack_end, (char*)info->stack_end - (char*)info->stack_start, sgen_get_pinned_count ());
                if (gc_callbacks.thread_mark_func && !conservative_stack_mark) {
-                       UserCopyOrMarkData data = { NULL, queue };
-                       gc_callbacks.thread_mark_func (info->runtime_data, info->stack_start, info->stack_end, precise, &data);
+                       gc_callbacks.thread_mark_func (info->runtime_data, info->stack_start, info->stack_end, precise, &ctx);
                } else if (!precise) {
                        if (!conservative_stack_mark) {
                                fprintf (stderr, "Precise stack mark not supported - disabling.\n");
@@ -4855,9 +4787,6 @@ mono_gc_base_init (void)
                g_strfreev (opts);
        }
 
-       if (major_collector.is_concurrent)
-               sgen_workers_init (1);
-
        if (major_collector_opt)
                g_free (major_collector_opt);
 
@@ -5029,6 +4958,9 @@ mono_gc_base_init (void)
        if (major_collector.post_param_init)
                major_collector.post_param_init (&major_collector);
 
+       if (major_collector.needs_thread_pool)
+               sgen_workers_init (1);
+
        sgen_memgov_init (max_heap, soft_limit, debug_print_allowance, allowance_ratio, save_target);
 
        memset (&remset, 0, sizeof (remset));
@@ -5297,12 +5229,6 @@ sgen_major_collector_iterate_live_block_ranges (sgen_cardtable_block_callback ca
        major_collector.iterate_live_block_ranges (callback);
 }
 
-void
-sgen_major_collector_scan_card_table (SgenGrayQueue *queue)
-{
-       major_collector.scan_card_table (FALSE, queue);
-}
-
 SgenMajorCollector*
 sgen_get_major_collector (void)
 {
index f9c09677b86015038ac5b0bc63dd6cc3dc54a712..d82685cbde9b37ff42fc4c0628702a0374b2c951 100644 (file)
@@ -156,10 +156,10 @@ struct _GCMemSection {
    its use in mono_gc_base_init in sgen-gc.c */
 #define LOCK_INIT(name)        mono_mutex_init (&(name))
 #define LOCK_GC do {                                           \
-               MONO_PREPARE_BLOCKING   \
+               MONO_TRY_BLOCKING       \
                mono_mutex_lock (&gc_mutex);                    \
                MONO_GC_LOCKED ();                              \
-               MONO_FINISH_BLOCKING    \
+               MONO_FINISH_TRY_BLOCKING        \
        } while (0)
 #define UNLOCK_GC do { sgen_gc_unlock (); } while (0)
 
@@ -169,6 +169,7 @@ extern LOCK_DECLARE (sgen_interruption_mutex);
 #define UNLOCK_INTERRUPTION mono_mutex_unlock (&sgen_interruption_mutex)
 
 /* FIXME: Use InterlockedAdd & InterlockedAdd64 to reduce the CAS cost. */
+#define SGEN_CAS       InterlockedCompareExchange
 #define SGEN_CAS_PTR   InterlockedCompareExchangePointer
 #define SGEN_ATOMIC_ADD(x,i)   do {                                    \
                int __old_x;                                            \
@@ -391,8 +392,6 @@ gboolean sgen_resume_thread (SgenThreadInfo *info);
 void sgen_wait_for_suspend_ack (int count);
 void sgen_os_init (void);
 
-gboolean sgen_is_worker_thread (MonoNativeThreadId thread);
-
 void sgen_update_heap_boundaries (mword low, mword high);
 
 void sgen_scan_area_with_callback (char *start, char *end, IterateObjectCallbackFunc callback, void *data, gboolean allow_flags);
@@ -420,7 +419,7 @@ enum {
        INTERNAL_MEM_MS_BLOCK_INFO_SORT,
        INTERNAL_MEM_EPHEMERON_LINK,
        INTERNAL_MEM_WORKER_DATA,
-       INTERNAL_MEM_WORKER_JOB_DATA,
+       INTERNAL_MEM_THREAD_POOL_JOB,
        INTERNAL_MEM_BRIDGE_DATA,
        INTERNAL_MEM_OLD_BRIDGE_HASH_TABLE,
        INTERNAL_MEM_OLD_BRIDGE_HASH_TABLE_ENTRY,
@@ -432,7 +431,6 @@ enum {
        INTERNAL_MEM_TARJAN_BRIDGE_HASH_TABLE_ENTRY,
        INTERNAL_MEM_TARJAN_OBJ_BUCKET,
        INTERNAL_MEM_BRIDGE_DEBUG,
-       INTERNAL_MEM_JOB_QUEUE_ENTRY,
        INTERNAL_MEM_TOGGLEREF_DATA,
        INTERNAL_MEM_CARDTABLE_MOD_UNION,
        INTERNAL_MEM_BINARY_PROTOCOL,
@@ -462,15 +460,23 @@ struct _ObjectList {
 
 typedef void (*CopyOrMarkObjectFunc) (void**, SgenGrayQueue*);
 typedef void (*ScanObjectFunc) (char *obj, mword desc, SgenGrayQueue*);
-typedef void (*ScanVTypeFunc) (char*, mword desc, SgenGrayQueue* BINARY_PROTOCOL_ARG (size_t size));
+typedef void (*ScanVTypeFunc) (char *full_object, char *start, mword desc, SgenGrayQueue* BINARY_PROTOCOL_ARG (size_t size));
+
+typedef struct {
+       CopyOrMarkObjectFunc copy_or_mark_object;
+       ScanObjectFunc scan_object;
+       ScanVTypeFunc scan_vtype;
+       /*FIXME add allocation function? */
+} SgenObjectOperations;
 
 typedef struct
 {
-       ScanObjectFunc scan_func;
-       CopyOrMarkObjectFunc copy_func;
+       SgenObjectOperations *ops;
        SgenGrayQueue *queue;
 } ScanCopyContext;
 
+#define CONTEXT_FROM_OBJECT_OPERATIONS(ops, queue) ((ScanCopyContext) { (ops), (queue) })
+
 void sgen_report_internal_mem_usage (void);
 void sgen_dump_internal_mem_usage (FILE *heap_dump_file);
 void sgen_dump_section (GCMemSection *section, const char *type);
@@ -497,15 +503,6 @@ int sgen_get_current_collection_generation (void);
 gboolean sgen_collection_is_concurrent (void);
 gboolean sgen_concurrent_collection_in_progress (void);
 
-typedef struct {
-       CopyOrMarkObjectFunc copy_or_mark_object;
-       ScanObjectFunc scan_object;
-       ScanVTypeFunc scan_vtype;
-       /*FIXME add allocation function? */
-} SgenObjectOperations;
-
-SgenObjectOperations *sgen_get_current_object_ops (void);
-
 typedef struct _SgenFragment SgenFragment;
 
 struct _SgenFragment {
@@ -612,12 +609,13 @@ void sgen_split_nursery_init (SgenMinorCollector *collector);
 /* Updating references */
 
 #ifdef SGEN_CHECK_UPDATE_REFERENCE
+gboolean sgen_thread_pool_is_thread_pool_thread (MonoNativeThreadId some_thread) MONO_INTERNAL;
 static inline void
 sgen_update_reference (void **p, void *o, gboolean allow_null)
 {
        if (!allow_null)
                SGEN_ASSERT (0, o, "Cannot update a reference with a NULL pointer");
-       SGEN_ASSERT (0, !sgen_is_worker_thread (mono_native_thread_id_get ()), "Can't update a reference in the worker thread");
+       SGEN_ASSERT (0, !sgen_thread_pool_is_thread_pool_thread (mono_native_thread_id_get ()), "Can't update a reference in the worker thread");
        *p = o;
 }
 
@@ -653,6 +651,7 @@ typedef struct _SgenMajorCollector SgenMajorCollector;
 struct _SgenMajorCollector {
        size_t section_size;
        gboolean is_concurrent;
+       gboolean needs_thread_pool;
        gboolean supports_cardtable;
        gboolean sweeps_lazily;
 
@@ -668,22 +667,31 @@ struct _SgenMajorCollector {
        void* (*alloc_small_pinned_obj) (MonoVTable *vtable, size_t size, gboolean has_references);
        void* (*alloc_degraded) (MonoVTable *vtable, size_t size);
 
-       SgenObjectOperations major_ops;
-       SgenObjectOperations major_concurrent_ops;
+       SgenObjectOperations major_ops_serial;
+       SgenObjectOperations major_ops_concurrent_start;
+       SgenObjectOperations major_ops_concurrent;
+       SgenObjectOperations major_ops_concurrent_finish;
 
        void* (*alloc_object) (MonoVTable *vtable, size_t size, gboolean has_references);
        void (*free_pinned_object) (char *obj, size_t size);
+
+       /*
+        * This is used for domain unloading, heap walking from the logging profiler, and
+        * debugging.  Can assume the world is stopped.
+        */
        void (*iterate_objects) (IterateObjectsFlags flags, IterateObjectCallbackFunc callback, void *data);
+
        void (*free_non_pinned_object) (char *obj, size_t size);
        void (*pin_objects) (SgenGrayQueue *queue);
        void (*pin_major_object) (char *obj, SgenGrayQueue *queue);
-       void (*scan_card_table) (gboolean mod_union, SgenGrayQueue *queue);
+       void (*scan_card_table) (gboolean mod_union, ScanCopyContext ctx);
        void (*iterate_live_block_ranges) (sgen_cardtable_block_callback callback);
        void (*update_cardtable_mod_union) (void);
        void (*init_to_space) (void);
        void (*sweep) (void);
-       gboolean (*have_finished_sweeping) (void);
-       void (*free_swept_blocks) (void);
+       gboolean (*have_swept) (void);
+       void (*finish_sweeping) (void);
+       void (*free_swept_blocks) (size_t allowance);
        void (*check_scan_starts) (void);
        void (*dump_heap) (FILE *heap_dump_file);
        gint64 (*get_used_size) (void);
@@ -696,13 +704,10 @@ struct _SgenMajorCollector {
        gboolean (*obj_is_from_pinned_alloc) (char *obj);
        void (*report_pinned_memory_usage) (void);
        size_t (*get_num_major_sections) (void);
+       size_t (*get_bytes_survived_last_sweep) (void);
        gboolean (*handle_gc_param) (const char *opt);
        void (*print_gc_param_usage) (void);
-       gboolean (*is_worker_thread) (MonoNativeThreadId thread);
        void (*post_param_init) (SgenMajorCollector *collector);
-       void* (*alloc_worker_data) (void);
-       void (*init_worker_thread) (void *data);
-       void (*reset_worker_data) (void *data);
        gboolean (*is_valid_object) (char *object);
        MonoVTable* (*describe_pointer) (char *pointer);
        guint8* (*get_cardtable_mod_union_for_object) (char *object);
@@ -729,7 +734,7 @@ typedef struct _SgenRememberedSet {
        void (*wbarrier_generic_nostore) (gpointer ptr);
        void (*record_pointer) (gpointer ptr);
 
-       void (*scan_remsets) (SgenGrayQueue *queue);
+       void (*scan_remsets) (ScanCopyContext ctx);
 
        void (*clear_cards) (void);
 
@@ -835,6 +840,14 @@ sgen_safe_object_get_size (MonoObject *obj)
        return sgen_par_object_get_size ((MonoVTable*)SGEN_LOAD_VTABLE (obj), obj);
 }
 
+static inline gboolean
+sgen_safe_object_is_small (MonoObject *obj, int type)
+{
+       if (type <= DESC_TYPE_MAX_SMALL_OBJ)
+               return TRUE;
+       return SGEN_ALIGN_UP (sgen_safe_object_get_size ((MonoObject*)obj)) <= SGEN_MAX_SMALL_OBJ_SIZE;
+}
+
 /*
  * This variant guarantees to return the exact size of the object
  * before alignment. Needed for canary support.
@@ -959,6 +972,7 @@ typedef struct {
 
 int sgen_stop_world (int generation);
 int sgen_restart_world (int generation, GGTimingInfo *timing);
+gboolean sgen_is_world_stopped (void);
 void sgen_init_stw (void);
 
 /* LOS */
@@ -967,7 +981,7 @@ typedef struct _LOSObject LOSObject;
 struct _LOSObject {
        LOSObject *next;
        mword size; /* this is the object size, lowest bit used for pin/mark */
-       guint8 *cardtable_mod_union; /* only used by the concurrent collector */
+       guint8 * volatile cardtable_mod_union; /* only used by the concurrent collector */
 #if SIZEOF_VOID_P < 8
        mword dummy;            /* to align object to sizeof (double) */
 #endif
@@ -983,17 +997,16 @@ void sgen_los_sweep (void);
 gboolean sgen_ptr_is_in_los (char *ptr, char **start);
 void sgen_los_iterate_objects (IterateObjectCallbackFunc cb, void *user_data);
 void sgen_los_iterate_live_block_ranges (sgen_cardtable_block_callback callback);
-void sgen_los_scan_card_table (gboolean mod_union, SgenGrayQueue *queue);
+void sgen_los_scan_card_table (gboolean mod_union, ScanCopyContext ctx);
 void sgen_los_update_cardtable_mod_union (void);
 void sgen_los_count_cards (long long *num_total_cards, long long *num_marked_cards);
-void sgen_major_collector_scan_card_table (SgenGrayQueue *queue);
 gboolean sgen_los_is_valid_object (char *object);
 gboolean mono_sgen_los_describe_pointer (char *ptr);
 LOSObject* sgen_los_header_for_object (char *data);
 mword sgen_los_object_size (LOSObject *obj);
 void sgen_los_pin_object (char *obj);
-void sgen_los_unpin_object (char *obj);
 gboolean sgen_los_object_is_pinned (char *obj);
+void sgen_los_mark_mod_union_card (MonoObject *mono_obj, void **ptr);
 
 
 /* nursery allocator */
index f5b8995355fe58edeb341cb656fd8c0763ade96b..dc484cc2a10bbc85204b75ee62368466d03360bc 100644 (file)
@@ -134,7 +134,7 @@ description_for_type (int type)
        case INTERNAL_MEM_MS_BLOCK_INFO_SORT: return "marksweep-block-info-sort";
        case INTERNAL_MEM_EPHEMERON_LINK: return "ephemeron-link";
        case INTERNAL_MEM_WORKER_DATA: return "worker-data";
-       case INTERNAL_MEM_WORKER_JOB_DATA: return "worker-job-data";
+       case INTERNAL_MEM_THREAD_POOL_JOB: return "thread-pool-job";
        case INTERNAL_MEM_BRIDGE_DATA: return "bridge-data";
        case INTERNAL_MEM_OLD_BRIDGE_HASH_TABLE: return "old-bridge-hash-table";
        case INTERNAL_MEM_OLD_BRIDGE_HASH_TABLE_ENTRY: return "old-bridge-hash-table-entry";
@@ -146,7 +146,6 @@ description_for_type (int type)
        case INTERNAL_MEM_BRIDGE_ALIVE_HASH_TABLE: return "bridge-alive-hash-table";
        case INTERNAL_MEM_BRIDGE_ALIVE_HASH_TABLE_ENTRY: return "bridge-alive-hash-table-entry";
        case INTERNAL_MEM_BRIDGE_DEBUG: return "bridge-debug";
-       case INTERNAL_MEM_JOB_QUEUE_ENTRY: return "job-queue-entry";
        case INTERNAL_MEM_TOGGLEREF_DATA: return "toggleref-data";
        case INTERNAL_MEM_CARDTABLE_MOD_UNION: return "cardtable-mod-union";
        case INTERNAL_MEM_BINARY_PROTOCOL: return "binary-protocol";
index de12002d364558ed223bc514a7d19c6164822f82..6619519a07e5e11ee5ca601b234a74e8963ab6cb 100644 (file)
@@ -292,6 +292,8 @@ static int pagesize;
 void
 sgen_los_free_object (LOSObject *obj)
 {
+       SGEN_ASSERT (0, !obj->cardtable_mod_union, "We should never free a LOS object with a mod-union table.");
+
 #ifndef LOS_DUMMY
        size_t size = obj->size;
        SGEN_LOG (4, "Freed large object %p, size %lu", obj->data, (unsigned long)obj->size);
@@ -399,13 +401,46 @@ sgen_los_alloc_large_inner (MonoVTable *vtable, size_t size)
        return obj->data;
 }
 
+static void sgen_los_unpin_object (char *data);
+
 void
 sgen_los_sweep (void)
 {
+       LOSObject *bigobj, *prevbo;
        LOSSection *section, *prev;
        int i;
        int num_sections = 0;
 
+       /* sweep the big objects list */
+       prevbo = NULL;
+       for (bigobj = los_object_list; bigobj;) {
+               SGEN_ASSERT (0, !SGEN_OBJECT_IS_PINNED (bigobj->data), "Who pinned a LOS object?");
+
+               if (bigobj->cardtable_mod_union) {
+                       sgen_card_table_free_mod_union (bigobj->cardtable_mod_union, bigobj->data, bigobj->size);
+                       bigobj->cardtable_mod_union = NULL;
+               }
+
+               if (sgen_los_object_is_pinned (bigobj->data)) {
+                       sgen_los_unpin_object (bigobj->data);
+                       sgen_update_heap_boundaries ((mword)bigobj->data, (mword)bigobj->data + sgen_los_object_size (bigobj));
+               } else {
+                       LOSObject *to_free;
+                       /* not referenced anywhere, so we can free it */
+                       if (prevbo)
+                               prevbo->next = bigobj->next;
+                       else
+                               los_object_list = bigobj->next;
+                       to_free = bigobj;
+                       bigobj = bigobj->next;
+                       sgen_los_free_object (to_free);
+                       continue;
+               }
+               prevbo = bigobj;
+               bigobj = bigobj->next;
+       }
+
+       /* Try to free memory */
        for (i = 0; i < LOS_NUM_FAST_SIZES; ++i)
                los_fast_free_lists [i] = NULL;
 
@@ -541,8 +576,25 @@ sgen_los_iterate_live_block_ranges (sgen_cardtable_block_callback callback)
        }
 }
 
+static guint8*
+get_cardtable_mod_union_for_object (LOSObject *obj)
+{
+       guint8 *mod_union = obj->cardtable_mod_union;
+       guint8 *other;
+       if (mod_union)
+               return mod_union;
+       mod_union = sgen_card_table_alloc_mod_union (obj->data, obj->size);
+       other = SGEN_CAS_PTR ((gpointer*)&obj->cardtable_mod_union, mod_union, NULL);
+       if (!other) {
+               SGEN_ASSERT (0, obj->cardtable_mod_union == mod_union, "Why did CAS not replace?");
+               return mod_union;
+       }
+       sgen_card_table_free_mod_union (mod_union, obj->data, obj->size);
+       return other;
+}
+
 void
-sgen_los_scan_card_table (gboolean mod_union, SgenGrayQueue *queue)
+sgen_los_scan_card_table (gboolean mod_union, ScanCopyContext ctx)
 {
        LOSObject *obj;
 
@@ -556,13 +608,13 @@ sgen_los_scan_card_table (gboolean mod_union, SgenGrayQueue *queue)
                        if (!sgen_los_object_is_pinned (obj->data))
                                continue;
 
-                       cards = obj->cardtable_mod_union;
+                       cards = get_cardtable_mod_union_for_object (obj);
                        g_assert (cards);
                } else {
                        cards = NULL;
                }
 
-               sgen_cardtable_scan_object (obj->data, obj->size, cards, mod_union, queue);
+               sgen_cardtable_scan_object (obj->data, obj->size, cards, mod_union, ctx);
        }
 }
 
@@ -601,7 +653,7 @@ sgen_los_update_cardtable_mod_union (void)
        for (obj = los_object_list; obj; obj = obj->next) {
                if (!SGEN_OBJECT_HAS_REFERENCES (obj->data))
                        continue;
-               obj->cardtable_mod_union = sgen_card_table_update_mod_union (obj->cardtable_mod_union,
+               sgen_card_table_update_mod_union (get_cardtable_mod_union_for_object (obj),
                                obj->data, obj->size, NULL);
        }
 }
@@ -630,7 +682,7 @@ sgen_los_pin_object (char *data)
        binary_protocol_pin (data, (gpointer)SGEN_LOAD_VTABLE (data), sgen_safe_object_get_size ((MonoObject*)data));
 }
 
-void
+static void
 sgen_los_unpin_object (char *data)
 {
        LOSObject *obj = sgen_los_header_for_object (data);
@@ -644,4 +696,15 @@ sgen_los_object_is_pinned (char *data)
        return obj->size & 1;
 }
 
+void
+sgen_los_mark_mod_union_card (MonoObject *mono_obj, void **ptr)
+{
+       LOSObject *obj = sgen_los_header_for_object ((char*)mono_obj);
+       guint8 *mod_union = get_cardtable_mod_union_for_object (obj);
+       size_t offset = sgen_card_table_get_card_offset ((char*)ptr, (char*)sgen_card_table_align_pointer ((char*)obj));
+       SGEN_ASSERT (0, mod_union, "FIXME: optionally allocate the mod union if it's not here and CAS it in.");
+       SGEN_ASSERT (0, (char*)obj == (char*)sgen_card_table_align_pointer ((char*)obj), "Why are LOS objects not card aligned?");
+       mod_union [offset] = 1;
+}
+
 #endif /* HAVE_SGEN_GC */
index 73d22fedf307384e7e4f5c90db433c2f742bfff7..2397c6a74e605a9fb39092a720160a28befb8d1b 100644 (file)
@@ -152,7 +152,7 @@ COPY_OR_MARK_FUNCTION_NAME (void **ptr, void *obj, SgenGrayQueue *queue)
                desc = sgen_vtable_get_descriptor ((MonoVTable*)vtable_word);
                type = desc & DESC_TYPE_MASK;
 
-               if (type <= DESC_TYPE_MAX_SMALL_OBJ || SGEN_ALIGN_UP (sgen_safe_object_get_size ((MonoObject*)obj)) <= SGEN_MAX_SMALL_OBJ_SIZE) {
+               if (sgen_safe_object_is_small ((MonoObject*)obj, type)) {
 #ifdef HEAVY_STATISTICS
                        if (type <= DESC_TYPE_MAX_SMALL_OBJ)
                                ++stat_optimized_copy_major_small_fast;
@@ -232,7 +232,7 @@ DRAIN_GRAY_STACK_FUNCTION_NAME (ScanCopyContext ctx)
 {
        SgenGrayQueue *queue = ctx.queue;
 
-       SGEN_ASSERT (0, ctx.scan_func == major_scan_object_with_evacuation, "Wrong scan function");
+       SGEN_ASSERT (0, ctx.ops->scan_object == major_scan_object_with_evacuation, "Wrong scan function");
 
        for (;;) {
                char *obj;
index d21c363fbae550d3ab9ab4eb459a8d7b1638b5c8..5b4625c88176c4125fba32a1ad427f7aafaca3c5 100644 (file)
@@ -39,18 +39,23 @@ extern guint64 stat_scan_object_called_major;
                binary_protocol_scan_process_reference ((obj), (ptr), __old); \
                if (__old && !sgen_ptr_in_nursery (__old)) {            \
                        PREFETCH_READ (__old);                  \
-                       major_copy_or_mark_object_with_evacuation_concurrent ((ptr), __old, queue); \
+                       major_copy_or_mark_object_concurrent ((ptr), __old, queue); \
                } else {                                                \
                        if (G_UNLIKELY (sgen_ptr_in_nursery (__old) && !sgen_ptr_in_nursery ((ptr)))) \
-                               sgen_add_to_global_remset ((ptr), __old); \
+                               ADD_TO_GLOBAL_REMSET ((MonoObject*)(full_object), (ptr), __old); \
                }                                                       \
        } while (0)
 
 /* FIXME: Unify this with optimized code in sgen-marksweep.c. */
 
+#undef ADD_TO_GLOBAL_REMSET
+#define ADD_TO_GLOBAL_REMSET(object,ptr,target)        mark_mod_union_card ((object), (ptr))
+
 static void
-major_scan_object_no_mark_concurrent (char *start, mword desc, SgenGrayQueue *queue)
+major_scan_object_no_mark_concurrent_anywhere (char *full_object, mword desc, SgenGrayQueue *queue)
 {
+       char *start = full_object;
+
        SGEN_OBJECT_LAYOUT_STATISTICS_DECLARE_BITMAP;
 
 #ifdef HEAVY_STATISTICS
@@ -68,7 +73,23 @@ major_scan_object_no_mark_concurrent (char *start, mword desc, SgenGrayQueue *qu
 }
 
 static void
-major_scan_vtype_concurrent (char *start, mword desc, SgenGrayQueue *queue BINARY_PROTOCOL_ARG (size_t size))
+major_scan_object_no_mark_concurrent_start (char *start, mword desc, SgenGrayQueue *queue)
+{
+       major_scan_object_no_mark_concurrent_anywhere (start, desc, queue);
+}
+
+static void
+major_scan_object_no_mark_concurrent (char *start, mword desc, SgenGrayQueue *queue)
+{
+       SGEN_ASSERT (0, !sgen_ptr_in_nursery (start), "Why are we scanning nursery objects in the concurrent collector?");
+       major_scan_object_no_mark_concurrent_anywhere (start, desc, queue);
+}
+
+#undef ADD_TO_GLOBAL_REMSET
+#define ADD_TO_GLOBAL_REMSET(object,ptr,target)        sgen_add_to_global_remset ((ptr), (target))
+
+static void
+major_scan_vtype_concurrent_finish (char *full_object, char *start, mword desc, SgenGrayQueue *queue BINARY_PROTOCOL_ARG (size_t size))
 {
        SGEN_OBJECT_LAYOUT_STATISTICS_DECLARE_BITMAP;
 
index db91b6773c85c5f9f898137fdb4b7d9b9b23d6cd..aa3cf492cf23a7bbdfb6c1d538aa03a791e8f52e 100644 (file)
@@ -43,6 +43,7 @@
 #include "metadata/sgen-pointer-queue.h"
 #include "metadata/sgen-pinning.h"
 #include "metadata/sgen-workers.h"
+#include "metadata/sgen-thread-pool.h"
 
 #if defined(ARCH_MIN_MS_BLOCK_SIZE) && defined(ARCH_MIN_MS_BLOCK_SIZE_SHIFT)
 #define MS_BLOCK_SIZE  ARCH_MIN_MS_BLOCK_SIZE
 
 #define MS_NUM_MARK_WORDS      ((MS_BLOCK_SIZE / SGEN_ALLOC_ALIGN + sizeof (mword) * 8 - 1) / (sizeof (mword) * 8))
 
+/*
+ * Blocks progress from one state to the next:
+ *
+ * SWEPT           The block is fully swept.  It might or might not be in
+ *                 a free list.
+ *
+ * MARKING         The block might or might not contain live objects.  If
+ *                 we're in between an initial collection pause and the
+ *                 finishing pause, the block might or might not be in a
+ *                 free list.
+ *
+ * CHECKING        The sweep thread is investigating the block to determine
+ *                 whether or not it contains live objects.  The block is
+ *                 not in a free list.
+ *
+ * NEED_SWEEPING   The block contains live objects but has not yet been
+ *                 swept.  It also contains free slots.  It is in a block
+ *                 free list.
+ *
+ * SWEEPING        The block is being swept.  It might be in a free list.
+ */
+
+enum {
+       BLOCK_STATE_SWEPT,
+       BLOCK_STATE_MARKING,
+       BLOCK_STATE_CHECKING,
+       BLOCK_STATE_NEED_SWEEPING,
+       BLOCK_STATE_SWEEPING
+};
+
 typedef struct _MSBlockInfo MSBlockInfo;
 struct _MSBlockInfo {
        guint16 obj_size;
@@ -79,14 +110,15 @@ struct _MSBlockInfo {
         * recalculating to save the space.
         */
        guint16 obj_size_index;
+       /* FIXME: Reduce this - it only needs a byte. */
+       volatile gint32 state;
        unsigned int pinned : 1;
        unsigned int has_references : 1;
        unsigned int has_pinned : 1;    /* means cannot evacuate */
        unsigned int is_to_space : 1;
-       unsigned int swept : 1;
        void ** volatile free_list;
        MSBlockInfo * volatile next_free;
-       guint8 *cardtable_mod_union;
+       guint8 * volatile cardtable_mod_union;
        mword mark_words [MS_NUM_MARK_WORDS];
 };
 
@@ -144,16 +176,30 @@ static float evacuation_threshold = 0.666f;
 static float concurrent_evacuation_threshold = 0.666f;
 static gboolean want_evacuation = FALSE;
 
-static gboolean lazy_sweep = TRUE;
-static gboolean have_swept = TRUE;
+static gboolean lazy_sweep = FALSE;
+
+enum {
+       SWEEP_STATE_SWEPT,
+       SWEEP_STATE_NEED_SWEEPING,
+       SWEEP_STATE_SWEEPING,
+       SWEEP_STATE_SWEEPING_AND_ITERATING,
+       SWEEP_STATE_COMPACTING
+};
+
+static volatile int sweep_state = SWEEP_STATE_SWEPT;
 
 static gboolean concurrent_mark;
+static gboolean concurrent_sweep = TRUE;
 
 #define BLOCK_IS_TAGGED_HAS_REFERENCES(bl)     SGEN_POINTER_IS_TAGGED_1 ((bl))
 #define BLOCK_TAG_HAS_REFERENCES(bl)           SGEN_POINTER_TAG_1 ((bl))
-#define BLOCK_UNTAG_HAS_REFERENCES(bl)         SGEN_POINTER_UNTAG_1 ((bl))
 
-#define BLOCK_TAG(bl)  ((bl)->has_references ? BLOCK_TAG_HAS_REFERENCES ((bl)) : (bl))
+#define BLOCK_IS_TAGGED_CHECKING(bl)           SGEN_POINTER_IS_TAGGED_2 ((bl))
+#define BLOCK_TAG_CHECKING(bl)                 SGEN_POINTER_TAG_2 ((bl))
+
+#define BLOCK_UNTAG(bl)                                SGEN_POINTER_UNTAG_12 ((bl))
+
+#define BLOCK_TAG(bl)                          ((bl)->has_references ? BLOCK_TAG_HAS_REFERENCES ((bl)) : (bl))
 
 /* all allocated blocks in the system */
 static SgenPointerQueue allocated_blocks;
@@ -162,14 +208,42 @@ static SgenPointerQueue allocated_blocks;
 static void *empty_blocks = NULL;
 static size_t num_empty_blocks = 0;
 
-#define FOREACH_BLOCK(bl)      { size_t __index; for (__index = 0; __index < allocated_blocks.next_slot; ++__index) { (bl) = BLOCK_UNTAG_HAS_REFERENCES (allocated_blocks.data [__index]);
-#define FOREACH_BLOCK_HAS_REFERENCES(bl,hr)    { size_t __index; for (__index = 0; __index < allocated_blocks.next_slot; ++__index) { (bl) = allocated_blocks.data [__index]; (hr) = BLOCK_IS_TAGGED_HAS_REFERENCES ((bl)); (bl) = BLOCK_UNTAG_HAS_REFERENCES ((bl));
-#define END_FOREACH_BLOCK      } }
-#define DELETE_BLOCK_IN_FOREACH()      (allocated_blocks.data [__index] = NULL)
-
-static size_t num_major_sections = 0;
-/* one free block list for each block object size */
-static MSBlockInfo **free_block_lists [MS_BLOCK_TYPE_MAX];
+#define FOREACH_BLOCK_NO_LOCK_CONDITION(cond,bl) {                     \
+       size_t __index;                                                 \
+       SGEN_ASSERT (0, (cond) && !sweep_in_progress (), "Can't iterate blocks while the world is running or sweep is in progress."); \
+       for (__index = 0; __index < allocated_blocks.next_slot; ++__index) { \
+               (bl) = BLOCK_UNTAG (allocated_blocks.data [__index]);
+#define FOREACH_BLOCK_NO_LOCK(bl)                                      \
+       FOREACH_BLOCK_NO_LOCK_CONDITION(sgen_is_world_stopped (), bl)
+#define FOREACH_BLOCK_HAS_REFERENCES_NO_LOCK(bl,hr) {                  \
+       size_t __index;                                                 \
+       SGEN_ASSERT (0, sgen_is_world_stopped () && !sweep_in_progress (), "Can't iterate blocks while the world is running or sweep is in progress."); \
+       for (__index = 0; __index < allocated_blocks.next_slot; ++__index) { \
+               (bl) = allocated_blocks.data [__index];                 \
+               (hr) = BLOCK_IS_TAGGED_HAS_REFERENCES ((bl));           \
+               (bl) = BLOCK_UNTAG ((bl));
+#define END_FOREACH_BLOCK_NO_LOCK      } }
+
+static volatile size_t num_major_sections = 0;
+/*
+ * One free block list for each block object size.  We add and remove blocks from these
+ * lists lock-free via CAS.
+ *
+ * Blocks accessed/removed from `free_block_lists`:
+ *   from the mutator (with GC lock held)
+ *   in nursery collections
+ *   in non-concurrent major collections
+ *   in the finishing pause of concurrent major collections (whole list is cleared)
+ *
+ * Blocks added to `free_block_lists`:
+ *   in the sweeping thread
+ *   during nursery collections
+ *   from domain clearing (with the world stopped and no sweeping happening)
+ *
+ * The only item of those that doesn't require the GC lock is the sweep thread.  The sweep
+ * thread only ever adds blocks to the free list, so the ABA problem can't occur.
+ */
+static MSBlockInfo * volatile *free_block_lists [MS_BLOCK_TYPE_MAX];
 
 static guint64 stat_major_blocks_alloced = 0;
 static guint64 stat_major_blocks_freed = 0;
@@ -206,8 +280,7 @@ add_scanned_object (void *ptr)
 }
 #endif
 
-static void
-sweep_block (MSBlockInfo *block, gboolean during_major_collection);
+static gboolean sweep_block (MSBlockInfo *block);
 
 static int
 ms_find_block_obj_size_index (size_t size)
@@ -246,6 +319,9 @@ update_heap_boundaries_for_block (MSBlockInfo *block)
        sgen_update_heap_boundaries ((mword)MS_BLOCK_FOR_BLOCK_INFO (block), (mword)MS_BLOCK_FOR_BLOCK_INFO (block) + MS_BLOCK_SIZE);
 }
 
+/*
+ * Thread safe
+ */
 static void*
 ms_get_empty_block (void)
 {
@@ -327,6 +403,24 @@ ms_free_block (void *block)
        } while (SGEN_CAS_PTR (&empty_blocks, block, empty) != empty);
 
        SGEN_ATOMIC_ADD_P (num_empty_blocks, 1);
+
+       binary_protocol_block_free (block, MS_BLOCK_SIZE);
+}
+
+static gboolean
+sweep_in_progress (void)
+{
+       int state = sweep_state;
+       return state == SWEEP_STATE_SWEEPING ||
+               state == SWEEP_STATE_SWEEPING_AND_ITERATING ||
+               state == SWEEP_STATE_COMPACTING;
+}
+
+static inline gboolean
+block_is_swept_or_marking (MSBlockInfo *block)
+{
+       gint32 state = block->state;
+       return state == BLOCK_STATE_SWEPT || state == BLOCK_STATE_MARKING;
 }
 
 //#define MARKSWEEP_CONSISTENCY_CHECK
@@ -335,16 +429,15 @@ ms_free_block (void *block)
 static void
 check_block_free_list (MSBlockInfo *block, int size, gboolean pinned)
 {
-       MSBlockInfo *b;
-
+       SGEN_ASSERT (0, !sweep_in_progress (), "Can't examine allocated blocks during sweep");
        for (; block; block = block->next_free) {
+               SGEN_ASSERT (0, block->state != BLOCK_STATE_CHECKING, "Can't have a block we're checking in a free list.");
                g_assert (block->obj_size == size);
                g_assert ((pinned && block->pinned) || (!pinned && !block->pinned));
 
                /* blocks in the free lists must have at least
                   one free slot */
-               if (block->swept)
-                       g_assert (block->free_list);
+               g_assert (block->free_list);
 
                /* the block must be in the allocated_blocks array */
                g_assert (sgen_pointer_queue_find (&allocated_blocks, BLOCK_TAG (block)) != (size_t)-1);
@@ -368,14 +461,11 @@ consistency_check (void)
        int i;
 
        /* check all blocks */
-       FOREACH_BLOCK (block) {
+       FOREACH_BLOCK_NO_LOCK (block) {
                int count = MS_BLOCK_FREE / block->obj_size;
                int num_free = 0;
                void **free;
 
-               /* check block header */
-               g_assert (((MSBlockHeader*)block->block)->info == block);
-
                /* count number of free slots */
                for (i = 0; i < count; ++i) {
                        void **obj = (void**) MS_BLOCK_OBJ (block, i);
@@ -391,11 +481,11 @@ consistency_check (void)
                g_assert (num_free == 0);
 
                /* check all mark words are zero */
-               if (block->swept) {
+               if (!sgen_concurrent_collection_in_progress () && block_is_swept_or_marking (block)) {
                        for (i = 0; i < MS_NUM_MARK_WORDS; ++i)
                                g_assert (block->mark_words [i] == 0);
                }
-       } END_FOREACH_BLOCK;
+       } END_FOREACH_BLOCK_NO_LOCK;
 
        /* check free blocks */
        for (i = 0; i < num_block_obj_sizes; ++i) {
@@ -408,13 +498,24 @@ consistency_check (void)
 }
 #endif
 
+static void
+add_free_block (MSBlockInfo * volatile *free_blocks, int size_index, MSBlockInfo *block)
+{
+       MSBlockInfo *old;
+       do {
+               block->next_free = old = free_blocks [size_index];
+       } while (SGEN_CAS_PTR ((gpointer)&free_blocks [size_index], block, old) != old);
+}
+
+static void major_finish_sweep_checking (void);
+
 static gboolean
 ms_alloc_block (int size_index, gboolean pinned, gboolean has_references)
 {
        int size = block_obj_sizes [size_index];
        int count = MS_BLOCK_FREE / size;
        MSBlockInfo *info;
-       MSBlockInfo **free_blocks = FREE_BLOCKS (pinned, has_references);
+       MSBlockInfo * volatile * free_blocks = FREE_BLOCKS (pinned, has_references);
        char *obj_start;
        int i;
 
@@ -437,11 +538,14 @@ ms_alloc_block (int size_index, gboolean pinned, gboolean has_references)
         * want further evacuation.
         */
        info->is_to_space = (sgen_get_current_collection_generation () == GENERATION_OLD);
-       info->swept = 1;
+       info->state = (info->is_to_space || sgen_concurrent_collection_in_progress ()) ? BLOCK_STATE_MARKING : BLOCK_STATE_SWEPT;
+       SGEN_ASSERT (6, !sweep_in_progress () || info->state == BLOCK_STATE_SWEPT, "How do we add a new block to be swept while sweeping?");
        info->cardtable_mod_union = NULL;
 
        update_heap_boundaries_for_block (info);
 
+       binary_protocol_block_alloc (info, MS_BLOCK_SIZE);
+
        /* build free list */
        obj_start = MS_BLOCK_FOR_BLOCK_INFO (info) + MS_BLOCK_SKIP;
        info->free_list = (void**)obj_start;
@@ -454,12 +558,19 @@ ms_alloc_block (int size_index, gboolean pinned, gboolean has_references)
        /* the last one */
        *(void**)obj_start = NULL;
 
-       info->next_free = free_blocks [size_index];
-       free_blocks [size_index] = info;
+       add_free_block (free_blocks, size_index, info);
+
+       /*
+        * This is the only place where the `allocated_blocks` array can potentially grow.
+        * We need to make sure concurrent sweep isn't running when that happens, so in that
+        * specific case we just wait for sweep to finish.
+        */
+       if (sgen_pointer_queue_will_grow (&allocated_blocks))
+               major_finish_sweep_checking ();
 
        sgen_pointer_queue_add (&allocated_blocks, BLOCK_TAG (info));
 
-       ++num_major_sections;
+       SGEN_ATOMIC_ADD_P (num_major_sections, 1);
        return TRUE;
 }
 
@@ -468,36 +579,68 @@ obj_is_from_pinned_alloc (char *ptr)
 {
        MSBlockInfo *block;
 
-       FOREACH_BLOCK (block) {
+       FOREACH_BLOCK_NO_LOCK (block) {
                if (ptr >= MS_BLOCK_FOR_BLOCK_INFO (block) && ptr <= MS_BLOCK_FOR_BLOCK_INFO (block) + MS_BLOCK_SIZE)
                        return block->pinned;
-       } END_FOREACH_BLOCK;
+       } END_FOREACH_BLOCK_NO_LOCK;
        return FALSE;
 }
 
+static void
+ensure_can_access_block_free_list (MSBlockInfo *block)
+{
+ retry:
+       for (;;) {
+               switch (block->state) {
+               case BLOCK_STATE_SWEPT:
+               case BLOCK_STATE_MARKING:
+                       return;
+               case BLOCK_STATE_CHECKING:
+                       SGEN_ASSERT (0, FALSE, "How did we get a block that's being checked from a free list?");
+                       break;
+               case BLOCK_STATE_NEED_SWEEPING:
+                       if (sweep_block (block))
+                               ++stat_major_blocks_lazy_swept;
+                       break;
+               case BLOCK_STATE_SWEEPING:
+                       /* FIXME: do this more elegantly */
+                       g_usleep (100);
+                       goto retry;
+               default:
+                       SGEN_ASSERT (0, FALSE, "Illegal block state");
+                       break;
+               }
+       }
+}
+
 static void*
-unlink_slot_from_free_list_uncontested (MSBlockInfo **free_blocks, int size_index)
+unlink_slot_from_free_list_uncontested (MSBlockInfo * volatile *free_blocks, int size_index)
 {
-       MSBlockInfo *block;
-       void *obj;
+       MSBlockInfo *block, *next_free_block;
+       void *obj, *next_free_slot;
 
+ retry:
        block = free_blocks [size_index];
        SGEN_ASSERT (9, block, "no free block to unlink from free_blocks %p size_index %d", free_blocks, size_index);
 
-       if (G_UNLIKELY (!block->swept)) {
-               stat_major_blocks_lazy_swept ++;
-               sweep_block (block, FALSE);
-       }
+       ensure_can_access_block_free_list (block);
 
        obj = block->free_list;
-       SGEN_ASSERT (9, obj, "block %p in free list had no available object to alloc from", block);
+       SGEN_ASSERT (6, obj, "block %p in free list had no available object to alloc from", block);
 
-       block->free_list = *(void**)obj;
-       if (!block->free_list) {
-               free_blocks [size_index] = block->next_free;
-               block->next_free = NULL;
+       next_free_slot = *(void**)obj;
+       if (next_free_slot) {
+               block->free_list = next_free_slot;
+               return obj;
        }
 
+       next_free_block = block->next_free;
+       if (SGEN_CAS_PTR ((gpointer)&free_blocks [size_index], next_free_block, block) != block)
+               goto retry;
+
+       block->free_list = NULL;
+       block->next_free = NULL;
+
        return obj;
 }
 
@@ -505,7 +648,7 @@ static void*
 alloc_obj (MonoVTable *vtable, size_t size, gboolean pinned, gboolean has_references)
 {
        int size_index = MS_BLOCK_OBJ_SIZE_INDEX (size);
-       MSBlockInfo **free_blocks = FREE_BLOCKS (pinned, has_references);
+       MSBlockInfo * volatile * free_blocks = FREE_BLOCKS (pinned, has_references);
        void *obj;
 
        if (!free_blocks [size_index]) {
@@ -538,23 +681,28 @@ free_object (char *obj, size_t size, gboolean pinned)
 {
        MSBlockInfo *block = MS_BLOCK_FOR_OBJ (obj);
        int word, bit;
+       gboolean in_free_list;
+
+       SGEN_ASSERT (9, sweep_state == SWEEP_STATE_SWEPT, "Should have waited for sweep to free objects.");
 
-       if (!block->swept)
-               sweep_block (block, FALSE);
+       ensure_can_access_block_free_list (block);
        SGEN_ASSERT (9, (pinned && block->pinned) || (!pinned && !block->pinned), "free-object pinning mixup object %p pinned %d block %p pinned %d", obj, pinned, block, block->pinned);
        SGEN_ASSERT (9, MS_OBJ_ALLOCED (obj, block), "object %p is already free", obj);
        MS_CALC_MARK_BIT (word, bit, obj);
        SGEN_ASSERT (9, !MS_MARK_BIT (block, word, bit), "object %p has mark bit set");
-       if (!block->free_list) {
-               MSBlockInfo **free_blocks = FREE_BLOCKS (pinned, block->has_references);
-               int size_index = MS_BLOCK_OBJ_SIZE_INDEX (size);
-               SGEN_ASSERT (9, !block->next_free, "block %p doesn't have a free-list of object but belongs to a free-list of blocks");
-               block->next_free = free_blocks [size_index];
-               free_blocks [size_index] = block;
-       }
+
        memset (obj, 0, size);
+
+       in_free_list = !!block->free_list;
        *(void**)obj = block->free_list;
        block->free_list = (void**)obj;
+
+       if (!in_free_list) {
+               MSBlockInfo * volatile *free_blocks = FREE_BLOCKS (pinned, block->has_references);
+               int size_index = MS_BLOCK_OBJ_SIZE_INDEX (size);
+               SGEN_ASSERT (9, !block->next_free, "block %p doesn't have a free-list of object but belongs to a free-list of blocks");
+               add_free_block (free_blocks, size_index, block);
+       }
 }
 
 static void
@@ -592,17 +740,10 @@ free_pinned_object (char *obj, size_t size)
 static void*
 major_alloc_degraded (MonoVTable *vtable, size_t size)
 {
-       void *obj;
-       size_t old_num_sections;
-
-       old_num_sections = num_major_sections;
-
-       obj = alloc_obj (vtable, size, FALSE, SGEN_VTABLE_HAS_REFERENCES (vtable));
+       void *obj = alloc_obj (vtable, size, FALSE, SGEN_VTABLE_HAS_REFERENCES (vtable));
        if (G_LIKELY (obj)) {
                HEAVY_STAT (++stat_objects_alloced_degraded);
                HEAVY_STAT (stat_bytes_alloced_degraded += size);
-               g_assert (num_major_sections >= old_num_sections);
-               sgen_register_major_sections_alloced (num_major_sections - old_num_sections);
        }
        return obj;
 }
@@ -640,7 +781,7 @@ major_ptr_is_in_non_pinned_space (char *ptr, char **start)
 {
        MSBlockInfo *block;
 
-       FOREACH_BLOCK (block) {
+       FOREACH_BLOCK_NO_LOCK (block) {
                if (ptr >= MS_BLOCK_FOR_BLOCK_INFO (block) && ptr <= MS_BLOCK_FOR_BLOCK_INFO (block) + MS_BLOCK_SIZE) {
                        int count = MS_BLOCK_FREE / block->obj_size;
                        int i;
@@ -654,10 +795,71 @@ major_ptr_is_in_non_pinned_space (char *ptr, char **start)
                        }
                        return !block->pinned;
                }
-       } END_FOREACH_BLOCK;
+       } END_FOREACH_BLOCK_NO_LOCK;
        return FALSE;
 }
 
+static gboolean
+try_set_sweep_state (int new, int expected)
+{
+       int old = SGEN_CAS (&sweep_state, new, expected);
+       return old == expected;
+}
+
+static void
+set_sweep_state (int new, int expected)
+{
+       gboolean success = try_set_sweep_state (new, expected);
+       SGEN_ASSERT (0, success, "Could not set sweep state.");
+}
+
+static gboolean ensure_block_is_checked_for_sweeping (int block_index, gboolean wait, gboolean *have_checked);
+
+static SgenThreadPoolJob * volatile sweep_job;
+
+static void
+major_finish_sweep_checking (void)
+{
+       int block_index;
+       SgenThreadPoolJob *job;
+
+ retry:
+       switch (sweep_state) {
+       case SWEEP_STATE_SWEPT:
+       case SWEEP_STATE_NEED_SWEEPING:
+               return;
+       case SWEEP_STATE_SWEEPING:
+               if (try_set_sweep_state (SWEEP_STATE_SWEEPING_AND_ITERATING, SWEEP_STATE_SWEEPING))
+                       break;
+               goto retry;
+       case SWEEP_STATE_SWEEPING_AND_ITERATING:
+               SGEN_ASSERT (0, FALSE, "Is there another minor collection running?");
+               goto retry;
+       case SWEEP_STATE_COMPACTING:
+               goto wait;
+       default:
+               SGEN_ASSERT (0, FALSE, "Invalid sweep state.");
+               break;
+       }
+
+       /*
+        * We're running with the world stopped and the only other thread doing work is the
+        * sweep thread, which doesn't add blocks to the array, so we can safely access
+        * `next_slot`.
+        */
+       for (block_index = 0; block_index < allocated_blocks.next_slot; ++block_index)
+               ensure_block_is_checked_for_sweeping (block_index, FALSE, NULL);
+
+       set_sweep_state (SWEEP_STATE_SWEEPING, SWEEP_STATE_SWEEPING_AND_ITERATING);
+
+ wait:
+       job = sweep_job;
+       if (job)
+               sgen_thread_pool_job_wait (job);
+       SGEN_ASSERT (0, !sweep_job, "Why did the sweep job not null itself?");
+       SGEN_ASSERT (0, sweep_state == SWEEP_STATE_SWEPT, "How is the sweep job done but we're not swept?");
+}
+
 static void
 major_iterate_objects (IterateObjectsFlags flags, IterateObjectCallbackFunc callback, void *data)
 {
@@ -666,7 +868,8 @@ major_iterate_objects (IterateObjectsFlags flags, IterateObjectCallbackFunc call
        gboolean pinned = flags & ITERATE_OBJECTS_PINNED;
        MSBlockInfo *block;
 
-       FOREACH_BLOCK (block) {
+       major_finish_sweep_checking ();
+       FOREACH_BLOCK_NO_LOCK (block) {
                int count = MS_BLOCK_FREE / block->obj_size;
                int i;
 
@@ -675,14 +878,21 @@ major_iterate_objects (IterateObjectsFlags flags, IterateObjectCallbackFunc call
                if (!block->pinned && !non_pinned)
                        continue;
                if (sweep && lazy_sweep) {
-                       sweep_block (block, FALSE);
-                       SGEN_ASSERT (0, block->swept, "Block must be swept after sweeping");
+                       sweep_block (block);
+                       SGEN_ASSERT (6, block->state == BLOCK_STATE_SWEPT, "Block must be swept after sweeping");
                }
 
                for (i = 0; i < count; ++i) {
                        void **obj = (void**) MS_BLOCK_OBJ (block, i);
-                       if (!block->swept) {
+                       /*
+                        * We've finished sweep checking, but if we're sweeping lazily and
+                        * the flags don't require us to sweep, the block might still need
+                        * sweeping.  In that case, we need to consult the mark bits to tell
+                        * us whether an object slot is live.
+                        */
+                       if (!block_is_swept_or_marking (block)) {
                                int word, bit;
+                               SGEN_ASSERT (6, !sweep && block->state == BLOCK_STATE_NEED_SWEEPING, "Has sweeping not finished?");
                                MS_CALC_MARK_BIT (word, bit, obj);
                                if (!MS_MARK_BIT (block, word, bit))
                                        continue;
@@ -690,7 +900,7 @@ major_iterate_objects (IterateObjectsFlags flags, IterateObjectCallbackFunc call
                        if (MS_OBJ_ALLOCED (obj, block))
                                callback ((char*)obj, block->obj_size, data);
                }
-       } END_FOREACH_BLOCK;
+       } END_FOREACH_BLOCK_NO_LOCK;
 }
 
 static gboolean
@@ -698,7 +908,7 @@ major_is_valid_object (char *object)
 {
        MSBlockInfo *block;
 
-       FOREACH_BLOCK (block) {
+       FOREACH_BLOCK_NO_LOCK (block) {
                int idx;
                char *obj;
 
@@ -710,7 +920,7 @@ major_is_valid_object (char *object)
                if (obj != object)
                        return FALSE;
                return MS_OBJ_ALLOCED (obj, block);
-       } END_FOREACH_BLOCK;
+       } END_FOREACH_BLOCK_NO_LOCK;
 
        return FALSE;
 }
@@ -721,7 +931,7 @@ major_describe_pointer (char *ptr)
 {
        MSBlockInfo *block;
 
-       FOREACH_BLOCK (block) {
+       FOREACH_BLOCK_NO_LOCK (block) {
                int idx;
                char *obj;
                gboolean live;
@@ -759,7 +969,7 @@ major_describe_pointer (char *ptr)
                SGEN_LOG (0, " marked %d)\n", marked ? 1 : 0);
 
                return vtable;
-       } END_FOREACH_BLOCK;
+       } END_FOREACH_BLOCK_NO_LOCK;
 
        return NULL;
 }
@@ -780,7 +990,7 @@ major_dump_heap (FILE *heap_dump_file)
        for (i = 0; i < num_block_obj_sizes; ++i)
                slots_available [i] = slots_used [i] = 0;
 
-       FOREACH_BLOCK (block) {
+       FOREACH_BLOCK_NO_LOCK (block) {
                int index = ms_find_block_obj_size_index (block->obj_size);
                int count = MS_BLOCK_FREE / block->obj_size;
 
@@ -789,7 +999,7 @@ major_dump_heap (FILE *heap_dump_file)
                        if (MS_OBJ_ALLOCED (MS_BLOCK_OBJ (block, i), block))
                                ++slots_used [index];
                }
-       } END_FOREACH_BLOCK;
+       } END_FOREACH_BLOCK_NO_LOCK;
 
        fprintf (heap_dump_file, "<occupancies>\n");
        for (i = 0; i < num_block_obj_sizes; ++i) {
@@ -798,7 +1008,7 @@ major_dump_heap (FILE *heap_dump_file)
        }
        fprintf (heap_dump_file, "</occupancies>\n");
 
-       FOREACH_BLOCK (block) {
+       FOREACH_BLOCK_NO_LOCK (block) {
                int count = MS_BLOCK_FREE / block->obj_size;
                int i;
                int start = -1;
@@ -818,7 +1028,52 @@ major_dump_heap (FILE *heap_dump_file)
                }
 
                fprintf (heap_dump_file, "</section>\n");
-       } END_FOREACH_BLOCK;
+       } END_FOREACH_BLOCK_NO_LOCK;
+}
+
+static guint8*
+get_cardtable_mod_union_for_block (MSBlockInfo *block, gboolean allocate)
+{
+       guint8 *mod_union = block->cardtable_mod_union;
+       guint8 *other;
+       if (mod_union)
+               return mod_union;
+       else if (!allocate)
+               return NULL;
+       mod_union = sgen_card_table_alloc_mod_union (MS_BLOCK_FOR_BLOCK_INFO (block), MS_BLOCK_SIZE);
+       other = SGEN_CAS_PTR ((gpointer*)&block->cardtable_mod_union, mod_union, NULL);
+       if (!other) {
+               SGEN_ASSERT (0, block->cardtable_mod_union == mod_union, "Why did CAS not replace?");
+               return mod_union;
+       }
+       sgen_card_table_free_mod_union (mod_union, MS_BLOCK_FOR_BLOCK_INFO (block), MS_BLOCK_SIZE);
+       return other;
+}
+
+static inline guint8*
+major_get_cardtable_mod_union_for_reference (char *ptr)
+{
+       MSBlockInfo *block = MS_BLOCK_FOR_OBJ (ptr);
+       size_t offset = sgen_card_table_get_card_offset (ptr, (char*)sgen_card_table_align_pointer (MS_BLOCK_FOR_BLOCK_INFO (block)));
+       guint8 *mod_union = get_cardtable_mod_union_for_block (block, TRUE);
+       SGEN_ASSERT (0, mod_union, "FIXME: optionally allocate the mod union if it's not here and CAS it in.");
+       return &mod_union [offset];
+}
+
+/*
+ * Mark the mod-union card for `ptr`, which must be a reference within the object `obj`.
+ */
+static void
+mark_mod_union_card (MonoObject *obj, void **ptr)
+{
+       int type = sgen_obj_get_descriptor ((char*)obj) & DESC_TYPE_MASK;
+       if (sgen_safe_object_is_small (obj, type)) {
+               guint8 *card_byte = major_get_cardtable_mod_union_for_reference ((char*)ptr);
+               SGEN_ASSERT (0, MS_BLOCK_FOR_OBJ (obj) == MS_BLOCK_FOR_OBJ (ptr), "How can an object and a reference inside it not be in the same block?");
+               *card_byte = 1;
+       } else {
+               sgen_los_mark_mod_union_card (obj, ptr);
+       }
 }
 
 #define LOAD_VTABLE    SGEN_LOAD_VTABLE
@@ -863,10 +1118,10 @@ pin_major_object (char *obj, SgenGrayQueue *queue)
 #include "sgen-major-copy-object.h"
 
 static void
-major_copy_or_mark_object_with_evacuation_concurrent (void **ptr, void *obj, SgenGrayQueue *queue)
+major_copy_or_mark_object_concurrent (void **ptr, void *obj, SgenGrayQueue *queue)
 {
        SGEN_ASSERT (9, sgen_concurrent_collection_in_progress (), "Why are we scanning concurrently when there's no concurrent collection on?");
-       SGEN_ASSERT (9, !sgen_workers_are_working () || sgen_is_worker_thread (mono_native_thread_id_get ()), "We must not scan from two threads at the same time!");
+       SGEN_ASSERT (9, !sgen_workers_are_working () || sgen_thread_pool_is_thread_pool_thread (mono_native_thread_id_get ()), "We must not scan from two threads at the same time!");
 
        g_assert (!SGEN_OBJECT_IS_FORWARDED (obj));
 
@@ -985,7 +1240,13 @@ major_copy_or_mark_object_canonical (void **ptr, SgenGrayQueue *queue)
 static void
 major_copy_or_mark_object_concurrent_canonical (void **ptr, SgenGrayQueue *queue)
 {
-       major_copy_or_mark_object_with_evacuation_concurrent (ptr, *ptr, queue);
+       major_copy_or_mark_object_concurrent (ptr, *ptr, queue);
+}
+
+static void
+major_copy_or_mark_object_concurrent_finish_canonical (void **ptr, SgenGrayQueue *queue)
+{
+       major_copy_or_mark_object_no_evacuation (ptr, *ptr, queue);
 }
 
 static void
@@ -1045,22 +1306,56 @@ sweep_block_for_size (MSBlockInfo *block, int count, int obj_size)
        }
 }
 
+static inline gboolean
+try_set_block_state (MSBlockInfo *block, gint32 new_state, gint32 expected_state)
+{
+       gint32 old_state = SGEN_CAS (&block->state, new_state, expected_state);
+       gboolean success = old_state == expected_state;
+       if (success)
+               binary_protocol_block_set_state (block, MS_BLOCK_SIZE, old_state, new_state);
+       return success;
+}
+
+static inline void
+set_block_state (MSBlockInfo *block, gint32 new_state, gint32 expected_state)
+{
+       SGEN_ASSERT (6, block->state == expected_state, "Block state incorrect before set");
+       block->state = new_state;
+}
+
 /*
- * sweep_block:
+ * If `block` needs sweeping, sweep it and return TRUE.  Otherwise return FALSE.
  *
- *   Traverse BLOCK, freeing and zeroing unused objects.
+ * Sweeping means iterating through the block's slots and building the free-list from the
+ * unmarked ones.  They will also be zeroed.  The mark bits will be reset.
  */
-static void
-sweep_block (MSBlockInfo *block, gboolean during_major_collection)
+static gboolean
+sweep_block (MSBlockInfo *block)
 {
        int count;
        void *reversed = NULL;
 
-       if (!during_major_collection)
-               g_assert (!sgen_concurrent_collection_in_progress ());
+ retry:
+       switch (block->state) {
+       case BLOCK_STATE_SWEPT:
+               return FALSE;
+       case BLOCK_STATE_MARKING:
+       case BLOCK_STATE_CHECKING:
+               SGEN_ASSERT (0, FALSE, "How did we get to sweep a block that's being marked or being checked?");
+               goto retry;
+       case BLOCK_STATE_SWEEPING:
+               /* FIXME: Do this more elegantly */
+               g_usleep (100);
+               goto retry;
+       case BLOCK_STATE_NEED_SWEEPING:
+               if (!try_set_block_state (block, BLOCK_STATE_SWEEPING, BLOCK_STATE_NEED_SWEEPING))
+                       goto retry;
+               break;
+       default:
+               SGEN_ASSERT (0, FALSE, "Illegal block state");
+       }
 
-       if (block->swept)
-               return;
+       SGEN_ASSERT (6, block->state == BLOCK_STATE_SWEEPING, "How did we get here without setting state to sweeping?");
 
        count = MS_BLOCK_FREE / block->obj_size;
 
@@ -1090,7 +1385,11 @@ sweep_block (MSBlockInfo *block, gboolean during_major_collection)
        }
        block->free_list = reversed;
 
-       block->swept = 1;
+       mono_memory_write_barrier ();
+
+       set_block_state (block, BLOCK_STATE_SWEPT, BLOCK_STATE_SWEEPING);
+
+       return TRUE;
 }
 
 static inline int
@@ -1112,105 +1411,237 @@ bitcount (mword d)
        return count;
 }
 
+/* statistics for evacuation */
+static size_t *sweep_slots_available;
+static size_t *sweep_slots_used;
+static size_t *sweep_num_blocks;
+
+static volatile size_t num_major_sections_before_sweep;
+static volatile size_t num_major_sections_freed_in_sweep;
+
 static void
-major_sweep (void)
+sweep_start (void)
 {
        int i;
-       MSBlockInfo *block;
-
-       /* statistics for evacuation */
-       int *slots_available = alloca (sizeof (int) * num_block_obj_sizes);
-       int *slots_used = alloca (sizeof (int) * num_block_obj_sizes);
-       int *num_blocks = alloca (sizeof (int) * num_block_obj_sizes);
-
-       mword total_evacuate_heap = 0;
-       mword total_evacuate_saved = 0;
 
        for (i = 0; i < num_block_obj_sizes; ++i)
-               slots_available [i] = slots_used [i] = num_blocks [i] = 0;
+               sweep_slots_available [i] = sweep_slots_used [i] = sweep_num_blocks [i] = 0;
 
        /* clear all the free lists */
        for (i = 0; i < MS_BLOCK_TYPE_MAX; ++i) {
-               MSBlockInfo **free_blocks = free_block_lists [i];
+               MSBlockInfo * volatile *free_blocks = free_block_lists [i];
                int j;
                for (j = 0; j < num_block_obj_sizes; ++j)
                        free_blocks [j] = NULL;
        }
+}
+
+static void sweep_finish (void);
+
+/*
+ * If `wait` is TRUE and the block is currently being checked, this function will wait until
+ * the checking has finished.
+ *
+ * Returns whether the block is still there.  If `wait` is FALSE, the return value will not
+ * be correct, i.e. must not be used.
+ */
+static gboolean
+ensure_block_is_checked_for_sweeping (int block_index, gboolean wait, gboolean *have_checked)
+{
+       int count;
+       gboolean have_live = FALSE;
+       gboolean have_free = FALSE;
+       int nused = 0;
+       int block_state;
+       int i;
+       void *tagged_block;
+       MSBlockInfo *block;
+
+       SGEN_ASSERT (6, sweep_in_progress (), "Why do we call this function if there's no sweep in progress?");
+
+       if (have_checked)
+               *have_checked = FALSE;
+
+ retry:
+       tagged_block = *(void * volatile *)&allocated_blocks.data [block_index];
+       if (!tagged_block)
+               return FALSE;
+
+       if (BLOCK_IS_TAGGED_CHECKING (tagged_block)) {
+               if (!wait)
+                       return FALSE;
+               /* FIXME: do this more elegantly */
+               g_usleep (100);
+               goto retry;
+       }
 
-       /* traverse all blocks, free and zero unmarked objects */
-       FOREACH_BLOCK (block) {
-               int count;
-               gboolean have_live = FALSE;
-               gboolean has_pinned;
-               gboolean have_free = FALSE;
-               int obj_size_index;
-               int nused = 0;
+       if (SGEN_CAS_PTR (&allocated_blocks.data [block_index], BLOCK_TAG_CHECKING (tagged_block), tagged_block) != tagged_block)
+               goto retry;
 
-               obj_size_index = block->obj_size_index;
+       block = BLOCK_UNTAG (tagged_block);
+       block_state = block->state;
 
-               has_pinned = block->has_pinned;
-               block->has_pinned = block->pinned;
+       if (!sweep_in_progress ()) {
+               SGEN_ASSERT (6, block_state != BLOCK_STATE_SWEEPING && block_state != BLOCK_STATE_CHECKING, "Invalid block state.");
+               if (!lazy_sweep)
+                       SGEN_ASSERT (6, block_state != BLOCK_STATE_NEED_SWEEPING, "Invalid block state.");
+       }
 
-               block->is_to_space = FALSE;
-               block->swept = 0;
+       switch (block_state) {
+       case BLOCK_STATE_SWEPT:
+       case BLOCK_STATE_NEED_SWEEPING:
+       case BLOCK_STATE_SWEEPING:
+               goto done;
+       case BLOCK_STATE_MARKING:
+               break;
+       case BLOCK_STATE_CHECKING:
+               SGEN_ASSERT (0, FALSE, "We set the CHECKING bit - how can the stage be CHECKING?");
+               goto done;
+       default:
+               SGEN_ASSERT (0, FALSE, "Illegal block state");
+               break;
+       }
 
-               count = MS_BLOCK_FREE / block->obj_size;
+       SGEN_ASSERT (6, block->state == BLOCK_STATE_MARKING, "When we sweep all blocks must start out marking.");
+       set_block_state (block, BLOCK_STATE_CHECKING, BLOCK_STATE_MARKING);
 
-               if (block->cardtable_mod_union) {
-                       sgen_free_internal_dynamic (block->cardtable_mod_union, CARDS_PER_BLOCK, INTERNAL_MEM_CARDTABLE_MOD_UNION);
-                       block->cardtable_mod_union = NULL;
-               }
+       if (have_checked)
+               *have_checked = TRUE;
+
+       block->has_pinned = block->pinned;
+
+       block->is_to_space = FALSE;
+
+       count = MS_BLOCK_FREE / block->obj_size;
+
+       if (block->cardtable_mod_union) {
+               sgen_card_table_free_mod_union (block->cardtable_mod_union, MS_BLOCK_FOR_BLOCK_INFO (block), MS_BLOCK_SIZE);
+               block->cardtable_mod_union = NULL;
+       }
 
-               /* Count marked objects in the block */
-               for (i = 0; i < MS_NUM_MARK_WORDS; ++i) {
-                       nused += bitcount (block->mark_words [i]);
+       /* Count marked objects in the block */
+       for (i = 0; i < MS_NUM_MARK_WORDS; ++i)
+               nused += bitcount (block->mark_words [i]);
+
+       if (nused)
+               have_live = TRUE;
+       if (nused < count)
+               have_free = TRUE;
+
+       if (have_live) {
+               int obj_size_index = block->obj_size_index;
+               gboolean has_pinned = block->has_pinned;
+
+               set_block_state (block, BLOCK_STATE_NEED_SWEEPING, BLOCK_STATE_CHECKING);
+
+               /*
+                * FIXME: Go straight to SWEPT if there are no free slots.  We need
+                * to set the free slot list to NULL, though, and maybe update some
+                * statistics.
+                */
+               if (!lazy_sweep)
+                       sweep_block (block);
+
+               if (!has_pinned) {
+                       ++sweep_num_blocks [obj_size_index];
+                       sweep_slots_used [obj_size_index] += nused;
+                       sweep_slots_available [obj_size_index] += count;
                }
-               if (nused) {
-                       have_live = TRUE;
+
+               /*
+                * If there are free slots in the block, add
+                * the block to the corresponding free list.
+                */
+               if (have_free) {
+                       MSBlockInfo * volatile *free_blocks = FREE_BLOCKS (block->pinned, block->has_references);
+
+                       if (!lazy_sweep)
+                               SGEN_ASSERT (6, block->free_list, "How do we not have a free list when there are free slots?");
+
+                       add_free_block (free_blocks, obj_size_index, block);
                }
-               if (nused < count)
-                       have_free = TRUE;
 
-               if (!lazy_sweep)
-                       sweep_block (block, TRUE);
+               /* FIXME: Do we need the heap boundaries while we do nursery collections? */
+               update_heap_boundaries_for_block (block);
+       } else {
+               /*
+                * Blocks without live objects are removed from the
+                * block list and freed.
+                */
+               SGEN_ASSERT (6, block_index < allocated_blocks.next_slot, "How did the number of blocks shrink?");
+               SGEN_ASSERT (6, allocated_blocks.data [block_index] == BLOCK_TAG_CHECKING (tagged_block), "How did the block move?");
 
-               if (have_live) {
-                       if (!has_pinned) {
-                               ++num_blocks [obj_size_index];
-                               slots_used [obj_size_index] += nused;
-                               slots_available [obj_size_index] += count;
-                       }
+               binary_protocol_empty (MS_BLOCK_OBJ (block, 0), (char*)MS_BLOCK_OBJ (block, count) - (char*)MS_BLOCK_OBJ (block, 0));
+               ms_free_block (block);
 
-                       /*
-                        * If there are free slots in the block, add
-                        * the block to the corresponding free list.
-                        */
-                       if (have_free) {
-                               MSBlockInfo **free_blocks = FREE_BLOCKS (block->pinned, block->has_references);
-                               int index = MS_BLOCK_OBJ_SIZE_INDEX (block->obj_size);
-                               block->next_free = free_blocks [index];
-                               free_blocks [index] = block;
-                       }
+               SGEN_ATOMIC_ADD_P (num_major_sections, -1);
 
-                       update_heap_boundaries_for_block (block);
-               } else {
-                       /*
-                        * Blocks without live objects are removed from the
-                        * block list and freed.
-                        */
-                       DELETE_BLOCK_IN_FOREACH ();
+               tagged_block = NULL;
+       }
+
+ done:
+       allocated_blocks.data [block_index] = tagged_block;
+       return !!tagged_block;
+}
+
+static void
+sweep_job_func (void *thread_data_untyped, SgenThreadPoolJob *job)
+{
+       int block_index;
+       int num_blocks = num_major_sections_before_sweep;
+
+       SGEN_ASSERT (0, sweep_in_progress (), "Sweep thread called with wrong state");
+       SGEN_ASSERT (0, num_blocks <= allocated_blocks.next_slot, "How did we lose blocks?");
 
-                       binary_protocol_empty (MS_BLOCK_OBJ (block, 0), (char*)MS_BLOCK_OBJ (block, count) - (char*)MS_BLOCK_OBJ (block, 0));
-                       ms_free_block (block);
+       /*
+        * We traverse the block array from high to low.  Nursery collections will have to
+        * cooperate with the sweep thread to finish sweeping, and they will traverse from
+        * low to high, to avoid constantly colliding on the same blocks.
+        */
+       for (block_index = num_blocks - 1; block_index >= 0; --block_index) {
+               gboolean have_checked;
 
-                       --num_major_sections;
+               /*
+                * The block might have been freed by another thread doing some checking
+                * work.
+                */
+               if (!ensure_block_is_checked_for_sweeping (block_index, TRUE, &have_checked))
+                       ++num_major_sections_freed_in_sweep;
+       }
+
+       while (!try_set_sweep_state (SWEEP_STATE_COMPACTING, SWEEP_STATE_SWEEPING)) {
+               /*
+                * The main GC thread is currently iterating over the block array to help us
+                * finish the sweep.  We have already finished, but we don't want to mess up
+                * that iteration, so we just wait for it.
+                */
+               g_usleep (100);
+       }
+
+       if (SGEN_MAX_ASSERT_LEVEL >= 6) {
+               for (block_index = num_blocks; block_index < allocated_blocks.next_slot; ++block_index) {
+                       MSBlockInfo *block = BLOCK_UNTAG (allocated_blocks.data [block_index]);
+                       SGEN_ASSERT (6, block && block->state == BLOCK_STATE_SWEPT, "How did a new block to be swept get added while swept?");
                }
-       } END_FOREACH_BLOCK;
+       }
+
        sgen_pointer_queue_remove_nulls (&allocated_blocks);
 
+       sweep_finish ();
+
+       sweep_job = NULL;
+}
+
+static void
+sweep_finish (void)
+{
+       mword total_evacuate_heap = 0;
+       mword total_evacuate_saved = 0;
+       int i;
+
        for (i = 0; i < num_block_obj_sizes; ++i) {
-               float usage = (float)slots_used [i] / (float)slots_available [i];
-               if (num_blocks [i] > 5 && usage < evacuation_threshold) {
+               float usage = (float)sweep_slots_used [i] / (float)sweep_slots_available [i];
+               if (sweep_num_blocks [i] > 5 && usage < evacuation_threshold) {
                        evacuate_block_obj_sizes [i] = TRUE;
                        /*
                        g_print ("slot size %d - %d of %d used\n",
@@ -1220,22 +1651,43 @@ major_sweep (void)
                        evacuate_block_obj_sizes [i] = FALSE;
                }
                {
-                       mword total_bytes = block_obj_sizes [i] * slots_available [i];
+                       mword total_bytes = block_obj_sizes [i] * sweep_slots_available [i];
                        total_evacuate_heap += total_bytes;
                        if (evacuate_block_obj_sizes [i])
-                               total_evacuate_saved += total_bytes - block_obj_sizes [i] * slots_used [i];
+                               total_evacuate_saved += total_bytes - block_obj_sizes [i] * sweep_slots_used [i];
                }
        }
 
        want_evacuation = (float)total_evacuate_saved / (float)total_evacuate_heap > (1 - concurrent_evacuation_threshold);
 
-       have_swept = TRUE;
+       set_sweep_state (SWEEP_STATE_SWEPT, SWEEP_STATE_COMPACTING);
+}
+
+static void
+major_sweep (void)
+{
+       set_sweep_state (SWEEP_STATE_SWEEPING, SWEEP_STATE_NEED_SWEEPING);
+
+       sweep_start ();
+
+       SGEN_ASSERT (0, num_major_sections == allocated_blocks.next_slot, "We don't know how many blocks we have?");
+
+       num_major_sections_before_sweep = num_major_sections;
+       num_major_sections_freed_in_sweep = 0;
+
+       SGEN_ASSERT (0, !sweep_job, "We haven't finished the last sweep?");
+       if (concurrent_sweep) {
+               sweep_job = sgen_thread_pool_job_alloc ("sweep", sweep_job_func, sizeof (SgenThreadPoolJob));
+               sgen_thread_pool_job_enqueue (sweep_job);
+       } else {
+               sweep_job_func (NULL, NULL);
+       }
 }
 
 static gboolean
-major_have_finished_sweeping (void)
+major_have_swept (void)
 {
-       return have_swept;
+       return sweep_state == SWEEP_STATE_SWEPT;
 }
 
 static int count_pinned_ref;
@@ -1343,15 +1795,20 @@ major_finish_nursery_collection (void)
 #ifdef MARKSWEEP_CONSISTENCY_CHECK
        consistency_check ();
 #endif
-       sgen_register_major_sections_alloced (num_major_sections - old_num_major_sections);
 }
 
 static void
 major_start_major_collection (void)
 {
+       MSBlockInfo *block;
        int i;
 
-       /* clear the free lists */
+       major_finish_sweep_checking ();
+
+       /*
+        * Clear the free lists for block sizes where we do evacuation.  For those block
+        * sizes we will have to allocate new blocks.
+        */
        for (i = 0; i < num_block_obj_sizes; ++i) {
                if (!evacuate_block_obj_sizes [i])
                        continue;
@@ -1360,21 +1817,21 @@ major_start_major_collection (void)
                free_block_lists [MS_BLOCK_FLAG_REFS][i] = NULL;
        }
 
-       // Sweep all unswept blocks
-       if (lazy_sweep) {
-               MSBlockInfo *block;
-
+       if (lazy_sweep)
                MONO_GC_SWEEP_BEGIN (GENERATION_OLD, TRUE);
 
-               FOREACH_BLOCK (block) {
-                       sweep_block (block, TRUE);
-               } END_FOREACH_BLOCK;
+       /* Sweep all unswept blocks and set them to MARKING */
+       FOREACH_BLOCK_NO_LOCK (block) {
+               if (lazy_sweep)
+                       sweep_block (block);
+               SGEN_ASSERT (0, block->state == BLOCK_STATE_SWEPT, "All blocks must be swept when we're pinning.");
+               set_block_state (block, BLOCK_STATE_MARKING, BLOCK_STATE_SWEPT);
+       } END_FOREACH_BLOCK_NO_LOCK;
 
+       if (lazy_sweep)
                MONO_GC_SWEEP_END (GENERATION_OLD, TRUE);
-       }
 
-       SGEN_ASSERT (0, have_swept, "Cannot start major collection without having finished sweeping");
-       have_swept = FALSE;
+       set_sweep_state (SWEEP_STATE_NEED_SWEEPING, SWEEP_STATE_SWEPT);
 }
 
 static void
@@ -1404,12 +1861,16 @@ compare_pointers (const void *va, const void *vb) {
 }
 #endif
 
+/*
+ * This is called with sweep completed and the world stopped.
+ */
 static void
-major_free_swept_blocks (void)
+major_free_swept_blocks (size_t allowance)
 {
-       size_t section_reserve = sgen_get_minor_collection_allowance () / MS_BLOCK_SIZE;
+       /* FIXME: This is probably too much.  It's assuming all objects are small. */
+       size_t section_reserve = allowance / MS_BLOCK_SIZE;
 
-       g_assert (have_swept);
+       SGEN_ASSERT (0, sweep_state == SWEEP_STATE_SWEPT, "Sweeping must have finished before freeing blocks");
 
 #if SIZEOF_VOID_P != 8
        {
@@ -1460,7 +1921,7 @@ major_free_swept_blocks (void)
                        for (i = 0; i < arr_length; ++i) {
                                int d = dest;
                                void *block = empty_block_arr [i];
-                               SGEN_ASSERT (0, block, "we're not shifting correctly");
+                               SGEN_ASSERT (6, block, "we're not shifting correctly");
                                if (i != dest) {
                                        empty_block_arr [dest] = block;
                                        /*
@@ -1476,7 +1937,7 @@ major_free_swept_blocks (void)
                                        continue;
                                }
 
-                               SGEN_ASSERT (0, first >= 0 && d > first, "algorithm is wrong");
+                               SGEN_ASSERT (6, first >= 0 && d > first, "algorithm is wrong");
 
                                if ((char*)block != ((char*)empty_block_arr [d-1]) + MS_BLOCK_SIZE) {
                                        first = d;
@@ -1509,9 +1970,9 @@ major_free_swept_blocks (void)
                                }
                        }
 
-                       SGEN_ASSERT (0, dest <= i && dest <= arr_length, "array length is off");
+                       SGEN_ASSERT (6, dest <= i && dest <= arr_length, "array length is off");
                        arr_length = dest;
-                       SGEN_ASSERT (0, arr_length == num_empty_blocks, "array length is off");
+                       SGEN_ASSERT (6, arr_length == num_empty_blocks, "array length is off");
 
                        num_blocks >>= 1;
                }
@@ -1520,7 +1981,7 @@ major_free_swept_blocks (void)
                rebuild_next = (void**)&empty_blocks;
                for (i = 0; i < arr_length; ++i) {
                        void *block = empty_block_arr [i];
-                       SGEN_ASSERT (0, block, "we're missing blocks");
+                       SGEN_ASSERT (6, block, "we're missing blocks");
                        *rebuild_next = block;
                        rebuild_next = (void**)block;
                }
@@ -1563,13 +2024,13 @@ major_pin_objects (SgenGrayQueue *queue)
 {
        MSBlockInfo *block;
 
-       FOREACH_BLOCK (block) {
+       FOREACH_BLOCK_NO_LOCK (block) {
                size_t first_entry, last_entry;
-               SGEN_ASSERT (0, block->swept, "All blocks must be swept when we're pinning.");
+               SGEN_ASSERT (6, block_is_swept_or_marking (block), "All blocks must be swept when we're pinning.");
                sgen_find_optimized_pin_queue_area (MS_BLOCK_FOR_BLOCK_INFO (block) + MS_BLOCK_SKIP, MS_BLOCK_FOR_BLOCK_INFO (block) + MS_BLOCK_SIZE,
                                &first_entry, &last_entry);
                mark_pinned_objects_in_block (block, first_entry, last_entry, queue);
-       } END_FOREACH_BLOCK;
+       } END_FOREACH_BLOCK_NO_LOCK;
 }
 
 static void
@@ -1589,23 +2050,42 @@ major_get_used_size (void)
        gint64 size = 0;
        MSBlockInfo *block;
 
-       FOREACH_BLOCK (block) {
+       /*
+        * We're holding the GC lock, but the sweep thread might be running.  Make sure it's
+        * finished, then we can iterate over the block array.
+        */
+       major_finish_sweep_checking ();
+
+       FOREACH_BLOCK_NO_LOCK_CONDITION (TRUE, block) {
                int count = MS_BLOCK_FREE / block->obj_size;
                void **iter;
                size += count * block->obj_size;
                for (iter = block->free_list; iter; iter = (void**)*iter)
                        size -= block->obj_size;
-       } END_FOREACH_BLOCK;
+       } END_FOREACH_BLOCK_NO_LOCK;
 
        return size;
 }
 
+/* FIXME: return number of bytes, not of sections */
 static size_t
 get_num_major_sections (void)
 {
        return num_major_sections;
 }
 
+/*
+ * Returns the number of bytes in blocks that were present when the last sweep was
+ * initiated, and were not freed during the sweep.  They are the basis for calculating the
+ * allowance.
+ */
+static size_t
+get_bytes_survived_last_sweep (void)
+{
+       SGEN_ASSERT (0, sweep_state == SWEEP_STATE_SWEPT, "Can only query unswept sections after sweep");
+       return (num_major_sections_before_sweep - num_major_sections_freed_in_sweep) * MS_BLOCK_SIZE;
+}
+
 static gboolean
 major_handle_gc_param (const char *opt)
 {
@@ -1624,6 +2104,12 @@ major_handle_gc_param (const char *opt)
        } else if (!strcmp (opt, "no-lazy-sweep")) {
                lazy_sweep = FALSE;
                return TRUE;
+       } else if (!strcmp (opt, "concurrent-sweep")) {
+               concurrent_sweep = TRUE;
+               return TRUE;
+       } else if (!strcmp (opt, "no-concurrent-sweep")) {
+               concurrent_sweep = FALSE;
+               return TRUE;
        }
 
        return FALSE;
@@ -1636,19 +2122,24 @@ major_print_gc_param_usage (void)
                        ""
                        "  evacuation-threshold=P (where P is a percentage, an integer in 0-100)\n"
                        "  (no-)lazy-sweep\n"
+                       "  (no-)concurrent-sweep\n"
                        );
 }
 
+/*
+ * This callback is used to clear cards, move cards to the shadow table and do counting.
+ */
 static void
 major_iterate_live_block_ranges (sgen_cardtable_block_callback callback)
 {
        MSBlockInfo *block;
        gboolean has_references;
 
-       FOREACH_BLOCK_HAS_REFERENCES (block, has_references) {
+       major_finish_sweep_checking ();
+       FOREACH_BLOCK_HAS_REFERENCES_NO_LOCK (block, has_references) {
                if (has_references)
                        callback ((mword)MS_BLOCK_FOR_BLOCK_INFO (block), MS_BLOCK_SIZE);
-       } END_FOREACH_BLOCK;
+       } END_FOREACH_BLOCK_NO_LOCK;
 }
 
 #ifdef HEAVY_STATISTICS
@@ -1698,153 +2189,156 @@ initial_skip_card (guint8 *card_data)
 #define MS_BLOCK_OBJ_FAST(b,os,i)                      ((b) + MS_BLOCK_SKIP + (os) * (i))
 #define MS_OBJ_ALLOCED_FAST(o,b)               (*(void**)(o) && (*(char**)(o) < (b) || *(char**)(o) >= (b) + MS_BLOCK_SIZE))
 
-static size_t
-card_offset (char *obj, char *base)
-{
-       return (obj - base) >> CARD_BITS;
-}
-
 static void
-major_scan_card_table (gboolean mod_union, SgenGrayQueue *queue)
+scan_card_table_for_block (MSBlockInfo *block, gboolean mod_union, ScanCopyContext ctx)
 {
-       MSBlockInfo *block;
-       gboolean has_references;
-       ScanObjectFunc scan_func = sgen_get_current_object_ops ()->scan_object;
-
-       if (!concurrent_mark)
-               g_assert (!mod_union);
-
-       FOREACH_BLOCK_HAS_REFERENCES (block, has_references) {
+       SgenGrayQueue *queue = ctx.queue;
+       ScanObjectFunc scan_func = ctx.ops->scan_object;
 #ifndef SGEN_HAVE_OVERLAPPING_CARDS
-               guint8 cards_copy [CARDS_PER_BLOCK];
+       guint8 cards_copy [CARDS_PER_BLOCK];
 #endif
-               gboolean small_objects;
-               int block_obj_size;
-               char *block_start;
-               guint8 *card_data, *card_base;
-               guint8 *card_data_end;
-               char *scan_front = NULL;
+       gboolean small_objects;
+       int block_obj_size;
+       char *block_start;
+       guint8 *card_data, *card_base;
+       guint8 *card_data_end;
+       char *scan_front = NULL;
 
-#ifdef PREFETCH_CARDS
-               int prefetch_index = __index + 6;
-               if (prefetch_index < allocated_blocks.next_slot) {
-                       MSBlockInfo *prefetch_block = BLOCK_UNTAG_HAS_REFERENCES (allocated_blocks.data [prefetch_index]);
-                       guint8 *prefetch_cards = sgen_card_table_get_card_scan_address ((mword)MS_BLOCK_FOR_BLOCK_INFO (prefetch_block));
-                       PREFETCH_READ (prefetch_block);
-                       PREFETCH_WRITE (prefetch_cards);
-                       PREFETCH_WRITE (prefetch_cards + 32);
-                }
-#endif
+       block_obj_size = block->obj_size;
+       small_objects = block_obj_size < CARD_SIZE_IN_BYTES;
 
-               if (!has_references)
-                       continue;
-
-               block_obj_size = block->obj_size;
-               small_objects = block_obj_size < CARD_SIZE_IN_BYTES;
-
-               block_start = MS_BLOCK_FOR_BLOCK_INFO (block);
+       block_start = MS_BLOCK_FOR_BLOCK_INFO (block);
 
+       /*
+        * This is safe in face of card aliasing for the following reason:
+        *
+        * Major blocks are 16k aligned, or 32 cards aligned.
+        * Cards aliasing happens in powers of two, so as long as major blocks are aligned to their
+        * sizes, they won't overflow the cardtable overlap modulus.
+        */
+       if (mod_union) {
+               card_data = card_base = block->cardtable_mod_union;
                /*
-                * This is safe in face of card aliasing for the following reason:
-                *
-                * Major blocks are 16k aligned, or 32 cards aligned.
-                * Cards aliasing happens in powers of two, so as long as major blocks are aligned to their
-                * sizes, they won't overflow the cardtable overlap modulus.
+                * This happens when the nursery collection that precedes finishing
+                * the concurrent collection allocates new major blocks.
                 */
-               if (mod_union) {
-                       card_data = card_base = block->cardtable_mod_union;
-                       /*
-                        * This happens when the nursery collection that precedes finishing
-                        * the concurrent collection allocates new major blocks.
-                        */
-                       if (!card_data)
-                               continue;
-               } else {
+               if (!card_data)
+                       return;
+       } else {
 #ifdef SGEN_HAVE_OVERLAPPING_CARDS
-                       card_data = card_base = sgen_card_table_get_card_scan_address ((mword)block_start);
+               card_data = card_base = sgen_card_table_get_card_scan_address ((mword)block_start);
 #else
-                       if (!sgen_card_table_get_card_data (cards_copy, (mword)block_start, CARDS_PER_BLOCK))
-                               continue;
-                       card_data = card_base = cards_copy;
+               if (!sgen_card_table_get_card_data (cards_copy, (mword)block_start, CARDS_PER_BLOCK))
+                       return;
+               card_data = card_base = cards_copy;
 #endif
-               }
-               card_data_end = card_data + CARDS_PER_BLOCK;
+       }
+       card_data_end = card_data + CARDS_PER_BLOCK;
 
-               card_data += MS_BLOCK_SKIP >> CARD_BITS;
+       card_data += MS_BLOCK_SKIP >> CARD_BITS;
 
-               card_data = initial_skip_card (card_data);
-               while (card_data < card_data_end) {
-                       size_t card_index, first_object_index;
-                       char *start;
-                       char *end;
-                       char *first_obj, *obj;
+       card_data = initial_skip_card (card_data);
+       while (card_data < card_data_end) {
+               size_t card_index, first_object_index;
+               char *start;
+               char *end;
+               char *first_obj, *obj;
 
-                       HEAVY_STAT (++scanned_cards);
+               HEAVY_STAT (++scanned_cards);
 
-                       if (!*card_data) {
-                               ++card_data;
-                               continue;
-                       }
+               if (!*card_data) {
+                       ++card_data;
+                       continue;
+               }
 
-                       card_index = card_data - card_base;
-                       start = (char*)(block_start + card_index * CARD_SIZE_IN_BYTES);
-                       end = start + CARD_SIZE_IN_BYTES;
+               card_index = card_data - card_base;
+               start = (char*)(block_start + card_index * CARD_SIZE_IN_BYTES);
+               end = start + CARD_SIZE_IN_BYTES;
 
-                       if (!block->swept)
-                               sweep_block (block, FALSE);
+               if (!block_is_swept_or_marking (block))
+                       sweep_block (block);
 
-                       HEAVY_STAT (++marked_cards);
+               HEAVY_STAT (++marked_cards);
 
-                       if (small_objects)
-                               sgen_card_table_prepare_card_for_scanning (card_data);
+               if (small_objects)
+                       sgen_card_table_prepare_card_for_scanning (card_data);
 
-                       /*
-                        * If the card we're looking at starts at or in the block header, we
-                        * must start at the first object in the block, without calculating
-                        * the index of the object we're hypothetically starting at, because
-                        * it would be negative.
-                        */
-                       if (card_index <= (MS_BLOCK_SKIP >> CARD_BITS))
-                               first_object_index = 0;
-                       else
-                               first_object_index = MS_BLOCK_OBJ_INDEX_FAST (start, block_start, block_obj_size);
+               /*
+                * If the card we're looking at starts at or in the block header, we
+                * must start at the first object in the block, without calculating
+                * the index of the object we're hypothetically starting at, because
+                * it would be negative.
+                */
+               if (card_index <= (MS_BLOCK_SKIP >> CARD_BITS))
+                       first_object_index = 0;
+               else
+                       first_object_index = MS_BLOCK_OBJ_INDEX_FAST (start, block_start, block_obj_size);
 
-                       obj = first_obj = (char*)MS_BLOCK_OBJ_FAST (block_start, block_obj_size, first_object_index);
+               obj = first_obj = (char*)MS_BLOCK_OBJ_FAST (block_start, block_obj_size, first_object_index);
 
-                       while (obj < end) {
-                               if (obj < scan_front || !MS_OBJ_ALLOCED_FAST (obj, block_start))
-                                       goto next_object;
+               binary_protocol_card_scan (first_obj, end - first_obj);
 
-                               if (mod_union) {
-                                       /* FIXME: do this more efficiently */
-                                       int w, b;
-                                       MS_CALC_MARK_BIT (w, b, obj);
-                                       if (!MS_MARK_BIT (block, w, b))
-                                               goto next_object;
-                               }
+               while (obj < end) {
+                       if (obj < scan_front || !MS_OBJ_ALLOCED_FAST (obj, block_start))
+                               goto next_object;
 
-                               if (small_objects) {
-                                       HEAVY_STAT (++scanned_objects);
-                                       scan_func (obj, sgen_obj_get_descriptor (obj), queue);
-                               } else {
-                                       size_t offset = card_offset (obj, block_start);
-                                       sgen_cardtable_scan_object (obj, block_obj_size, card_base + offset, mod_union, queue);
-                               }
-                       next_object:
-                               obj += block_obj_size;
-                               g_assert (scan_front <= obj);
-                               scan_front = obj;
+                       if (mod_union) {
+                               /* FIXME: do this more efficiently */
+                               int w, b;
+                               MS_CALC_MARK_BIT (w, b, obj);
+                               if (!MS_MARK_BIT (block, w, b))
+                                       goto next_object;
                        }
 
-                       HEAVY_STAT (if (*card_data) ++remarked_cards);
-                       binary_protocol_card_scan (first_obj, obj - first_obj);
-
-                       if (small_objects)
-                               ++card_data;
-                       else
-                               card_data = card_base + card_offset (obj, block_start);
+                       if (small_objects) {
+                               HEAVY_STAT (++scanned_objects);
+                               scan_func (obj, sgen_obj_get_descriptor (obj), queue);
+                       } else {
+                               size_t offset = sgen_card_table_get_card_offset (obj, block_start);
+                               sgen_cardtable_scan_object (obj, block_obj_size, card_base + offset, mod_union, ctx);
+                       }
+               next_object:
+                       obj += block_obj_size;
+                       g_assert (scan_front <= obj);
+                       scan_front = obj;
                }
-       } END_FOREACH_BLOCK;
+
+               HEAVY_STAT (if (*card_data) ++remarked_cards);
+
+               if (small_objects)
+                       ++card_data;
+               else
+                       card_data = card_base + sgen_card_table_get_card_offset (obj, block_start);
+       }
+}
+
+static void
+major_scan_card_table (gboolean mod_union, ScanCopyContext ctx)
+{
+       MSBlockInfo *block;
+       gboolean has_references;
+
+       if (!concurrent_mark)
+               g_assert (!mod_union);
+
+       major_finish_sweep_checking ();
+       FOREACH_BLOCK_HAS_REFERENCES_NO_LOCK (block, has_references) {
+#ifdef PREFETCH_CARDS
+               int prefetch_index = __index + 6;
+               if (prefetch_index < allocated_blocks.next_slot) {
+                       MSBlockInfo *prefetch_block = BLOCK_UNTAG (allocated_blocks.data [prefetch_index]);
+                       guint8 *prefetch_cards = sgen_card_table_get_card_scan_address ((mword)MS_BLOCK_FOR_BLOCK_INFO (prefetch_block));
+                       PREFETCH_READ (prefetch_block);
+                       PREFETCH_WRITE (prefetch_cards);
+                       PREFETCH_WRITE (prefetch_cards + 32);
+                }
+#endif
+
+               if (!has_references)
+                       continue;
+
+               scan_card_table_for_block (block, mod_union, ctx);
+       } END_FOREACH_BLOCK_NO_LOCK;
 }
 
 static void
@@ -1855,7 +2349,13 @@ major_count_cards (long long *num_total_cards, long long *num_marked_cards)
        long long total_cards = 0;
        long long marked_cards = 0;
 
-       FOREACH_BLOCK_HAS_REFERENCES (block, has_references) {
+       if (sweep_in_progress ()) {
+               *num_total_cards = -1;
+               *num_marked_cards = -1;
+               return;
+       }
+
+       FOREACH_BLOCK_HAS_REFERENCES_NO_LOCK (block, has_references) {
                guint8 *cards = sgen_card_table_get_card_scan_address ((mword) MS_BLOCK_FOR_BLOCK_INFO (block));
                int i;
 
@@ -1867,7 +2367,7 @@ major_count_cards (long long *num_total_cards, long long *num_marked_cards)
                        if (cards [i])
                                ++marked_cards;
                }
-       } END_FOREACH_BLOCK;
+       } END_FOREACH_BLOCK_NO_LOCK;
 
        *num_total_cards = total_cards;
        *num_marked_cards = marked_cards;
@@ -1878,30 +2378,12 @@ update_cardtable_mod_union (void)
 {
        MSBlockInfo *block;
 
-       FOREACH_BLOCK (block) {
+       FOREACH_BLOCK_NO_LOCK (block) {
                size_t num_cards;
-
-               block->cardtable_mod_union = sgen_card_table_update_mod_union (block->cardtable_mod_union,
-                               MS_BLOCK_FOR_BLOCK_INFO (block), MS_BLOCK_SIZE, &num_cards);
-
-               SGEN_ASSERT (0, num_cards == CARDS_PER_BLOCK, "Number of cards calculation is wrong");
-       } END_FOREACH_BLOCK;
-}
-
-static guint8*
-major_get_cardtable_mod_union_for_object (char *obj)
-{
-       MSBlockInfo *block = MS_BLOCK_FOR_OBJ (obj);
-       size_t offset = card_offset (obj, (char*)sgen_card_table_align_pointer (MS_BLOCK_FOR_BLOCK_INFO (block)));
-       return &block->cardtable_mod_union [offset];
-}
-
-static void
-alloc_free_block_lists (MSBlockInfo ***lists)
-{
-       int i;
-       for (i = 0; i < MS_BLOCK_TYPE_MAX; ++i)
-               lists [i] = sgen_alloc_internal_dynamic (sizeof (MSBlockInfo*) * num_block_obj_sizes, INTERNAL_MEM_MS_TABLES, TRUE);
+               guint8 *mod_union = get_cardtable_mod_union_for_block (block, TRUE);
+               sgen_card_table_update_mod_union (mod_union, MS_BLOCK_FOR_BLOCK_INFO (block), MS_BLOCK_SIZE, &num_cards);
+               SGEN_ASSERT (6, num_cards == CARDS_PER_BLOCK, "Number of cards calculation is wrong");
+       } END_FOREACH_BLOCK_NO_LOCK;
 }
 
 #undef pthread_create
@@ -1910,6 +2392,7 @@ static void
 post_param_init (SgenMajorCollector *collector)
 {
        collector->sweeps_lazily = lazy_sweep;
+       collector->needs_thread_pool = concurrent_mark || concurrent_sweep;
 }
 
 static void
@@ -1927,6 +2410,10 @@ sgen_marksweep_init_internal (SgenMajorCollector *collector, gboolean is_concurr
        for (i = 0; i < num_block_obj_sizes; ++i)
                evacuate_block_obj_sizes [i] = FALSE;
 
+       sweep_slots_available = sgen_alloc_internal_dynamic (sizeof (size_t) * num_block_obj_sizes, INTERNAL_MEM_MS_TABLES, TRUE);
+       sweep_slots_used = sgen_alloc_internal_dynamic (sizeof (size_t) * num_block_obj_sizes, INTERNAL_MEM_MS_TABLES, TRUE);
+       sweep_num_blocks = sgen_alloc_internal_dynamic (sizeof (size_t) * num_block_obj_sizes, INTERNAL_MEM_MS_TABLES, TRUE);
+
        /*
        {
                int i;
@@ -1936,7 +2423,8 @@ sgen_marksweep_init_internal (SgenMajorCollector *collector, gboolean is_concurr
        }
        */
 
-       alloc_free_block_lists (free_block_lists);
+       for (i = 0; i < MS_BLOCK_TYPE_MAX; ++i)
+               free_block_lists [i] = sgen_alloc_internal_dynamic (sizeof (MSBlockInfo*) * num_block_obj_sizes, INTERNAL_MEM_MS_TABLES, TRUE);
 
        for (i = 0; i < MS_NUM_FAST_BLOCK_OBJ_SIZE_INDEXES; ++i)
                fast_block_obj_size_indexes [i] = ms_find_block_obj_size_index (i * 8);
@@ -1957,13 +2445,12 @@ sgen_marksweep_init_internal (SgenMajorCollector *collector, gboolean is_concurr
        collector->section_size = MAJOR_SECTION_SIZE;
 
        concurrent_mark = is_concurrent;
-       if (is_concurrent) {
-               collector->is_concurrent = TRUE;
+       collector->is_concurrent = is_concurrent;
+       collector->needs_thread_pool = is_concurrent || concurrent_sweep;
+       if (is_concurrent)
                collector->want_synchronous_collection = &want_evacuation;
-       } else {
-               collector->is_concurrent = FALSE;
+       else
                collector->want_synchronous_collection = NULL;
-       }
        collector->get_and_reset_num_major_objects_marked = major_get_and_reset_num_major_objects_marked;
        collector->supports_cardtable = TRUE;
 
@@ -1982,11 +2469,12 @@ sgen_marksweep_init_internal (SgenMajorCollector *collector, gboolean is_concurr
        collector->iterate_live_block_ranges = (void*)(void*) major_iterate_live_block_ranges;
        if (is_concurrent) {
                collector->update_cardtable_mod_union = update_cardtable_mod_union;
-               collector->get_cardtable_mod_union_for_object = major_get_cardtable_mod_union_for_object;
+               collector->get_cardtable_mod_union_for_object = major_get_cardtable_mod_union_for_reference;
        }
        collector->init_to_space = major_init_to_space;
        collector->sweep = major_sweep;
-       collector->have_finished_sweeping = major_have_finished_sweeping;
+       collector->have_swept = major_have_swept;
+       collector->finish_sweeping = major_finish_sweep_checking;
        collector->free_swept_blocks = major_free_swept_blocks;
        collector->check_scan_starts = major_check_scan_starts;
        collector->dump_heap = major_dump_heap;
@@ -1999,6 +2487,7 @@ sgen_marksweep_init_internal (SgenMajorCollector *collector, gboolean is_concurr
        collector->obj_is_from_pinned_alloc = obj_is_from_pinned_alloc;
        collector->report_pinned_memory_usage = major_report_pinned_memory_usage;
        collector->get_num_major_sections = get_num_major_sections;
+       collector->get_bytes_survived_last_sweep = get_bytes_survived_last_sweep;
        collector->handle_gc_param = major_handle_gc_param;
        collector->print_gc_param_usage = major_print_gc_param_usage;
        collector->post_param_init = post_param_init;
@@ -2006,16 +2495,21 @@ sgen_marksweep_init_internal (SgenMajorCollector *collector, gboolean is_concurr
        collector->describe_pointer = major_describe_pointer;
        collector->count_cards = major_count_cards;
 
-       collector->major_ops.copy_or_mark_object = major_copy_or_mark_object_canonical;
-       collector->major_ops.scan_object = major_scan_object_with_evacuation;
+       collector->major_ops_serial.copy_or_mark_object = major_copy_or_mark_object_canonical;
+       collector->major_ops_serial.scan_object = major_scan_object_with_evacuation;
        if (is_concurrent) {
-               collector->major_concurrent_ops.copy_or_mark_object = major_copy_or_mark_object_concurrent_canonical;
-               collector->major_concurrent_ops.scan_object = major_scan_object_no_mark_concurrent;
-               collector->major_concurrent_ops.scan_vtype = major_scan_vtype_concurrent;
+               collector->major_ops_concurrent_start.copy_or_mark_object = major_copy_or_mark_object_concurrent_canonical;
+               collector->major_ops_concurrent_start.scan_object = major_scan_object_no_mark_concurrent_start;
+
+               collector->major_ops_concurrent.copy_or_mark_object = major_copy_or_mark_object_concurrent_canonical;
+               collector->major_ops_concurrent.scan_object = major_scan_object_no_mark_concurrent;
+
+               collector->major_ops_concurrent_finish.copy_or_mark_object = major_copy_or_mark_object_concurrent_finish_canonical;
+               collector->major_ops_concurrent_finish.scan_object = major_scan_object_no_evacuation;
+               collector->major_ops_concurrent_finish.scan_vtype = major_scan_vtype_concurrent_finish;
        }
 
 #if !defined (FIXED_HEAP) && !defined (SGEN_PARALLEL_MARK)
-       /* FIXME: this will not work with evacuation or the split nursery. */
        if (!is_concurrent)
                collector->drain_gray_stack = drain_gray_stack;
 
index 63b01840674b0f1136a648715cfad9fd98b9ab71..70cc6f0788329a1d2c27525d9bd5e2ba5162bec4 100644 (file)
@@ -29,6 +29,7 @@
 
 #include "metadata/sgen-gc.h"
 #include "metadata/sgen-memory-governor.h"
+#include "metadata/sgen-thread-pool.h"
 #include "metadata/mono-gc.h"
 
 #include "utils/mono-counters.h"
@@ -57,18 +58,15 @@ static gboolean debug_print_allowance = FALSE;
 
 /* use this to tune when to do a major/minor collection */
 static mword memory_pressure = 0;
-static mword minor_collection_allowance;
-static mword minor_collection_sections_alloced = 0;
+static mword major_collection_trigger_size;
 
 static mword last_major_num_sections = 0;
 static mword last_los_memory_usage = 0;
 
 static gboolean need_calculate_minor_collection_allowance;
 
-static mword last_collection_old_num_major_sections;
+/* The size of the LOS after the last major collection, after sweeping. */
 static mword last_collection_los_memory_usage = 0;
-static mword last_collection_old_los_memory_usage;
-static mword last_collection_los_memory_alloced;
 
 static mword sgen_memgov_available_free_space (void);
 
@@ -76,26 +74,16 @@ static mword sgen_memgov_available_free_space (void);
 /* GC trigger heuristics. */
 
 static void
-sgen_memgov_try_calculate_minor_collection_allowance (gboolean overwrite)
+sgen_memgov_calculate_minor_collection_allowance (void)
 {
-       size_t num_major_sections;
-       mword new_major, new_heap_size, allowance_target;
-
-       if (overwrite)
-               g_assert (need_calculate_minor_collection_allowance);
+       size_t new_major, new_heap_size, allowance_target, allowance;
 
        if (!need_calculate_minor_collection_allowance)
                return;
 
-       if (!major_collector.have_finished_sweeping ()) {
-               if (overwrite)
-                       minor_collection_allowance = MIN_MINOR_COLLECTION_ALLOWANCE;
-               return;
-       }
-
-       num_major_sections = major_collector.get_num_major_sections ();
+       SGEN_ASSERT (0, major_collector.have_swept (), "Can only calculate allowance if heap is swept");
 
-       new_major = num_major_sections * major_collector.section_size;
+       new_major = major_collector.get_bytes_survived_last_sweep ();
        new_heap_size = new_major + last_collection_los_memory_usage;
 
        /*
@@ -104,47 +92,55 @@ sgen_memgov_try_calculate_minor_collection_allowance (gboolean overwrite)
         */
        allowance_target = new_heap_size / 3;
 
-       minor_collection_allowance = MAX (allowance_target, MIN_MINOR_COLLECTION_ALLOWANCE);
+       allowance = MAX (allowance_target, MIN_MINOR_COLLECTION_ALLOWANCE);
 
-       if (new_heap_size + minor_collection_allowance > soft_heap_limit) {
+       if (new_heap_size + allowance > soft_heap_limit) {
                if (new_heap_size > soft_heap_limit)
-                       minor_collection_allowance = MIN_MINOR_COLLECTION_ALLOWANCE;
+                       allowance = MIN_MINOR_COLLECTION_ALLOWANCE;
                else
-                       minor_collection_allowance = MAX (soft_heap_limit - new_heap_size, MIN_MINOR_COLLECTION_ALLOWANCE);
-       }
-
-       if (debug_print_allowance) {
-               mword old_major = last_collection_old_num_major_sections * major_collector.section_size;
-
-               SGEN_LOG (1, "Before collection: %ld bytes (%ld major, %ld LOS)",
-                                 (long)(old_major + last_collection_old_los_memory_usage), (long)old_major, (long)last_collection_old_los_memory_usage);
-               SGEN_LOG (1, "After collection: %ld bytes (%ld major, %ld LOS)",
-                                 (long)new_heap_size, (long)new_major, (long)last_collection_los_memory_usage);
-               SGEN_LOG (1, "Allowance: %ld bytes", (long)minor_collection_allowance);
+                       allowance = MAX (soft_heap_limit - new_heap_size, MIN_MINOR_COLLECTION_ALLOWANCE);
        }
 
+       /* FIXME: Why is this here? */
        if (major_collector.free_swept_blocks)
-               major_collector.free_swept_blocks ();
+               major_collector.free_swept_blocks (allowance);
+
+       major_collection_trigger_size = new_heap_size + allowance;
 
        need_calculate_minor_collection_allowance = FALSE;
-}
 
+       if (debug_print_allowance) {
+               SGEN_LOG (0, "Surviving sweep: %ld bytes (%ld major, %ld LOS)", (long)new_heap_size, (long)new_major, (long)last_collection_los_memory_usage);
+               SGEN_LOG (0, "Allowance: %ld bytes", (long)allowance);
+               SGEN_LOG (0, "Trigger size: %ld bytes", (long)major_collection_trigger_size);
+       }
+}
 
 gboolean
 sgen_need_major_collection (mword space_needed)
 {
-       mword los_alloced;
+       size_t heap_size;
+
        if (sgen_concurrent_collection_in_progress ())
                return FALSE;
-       los_alloced = los_memory_usage - MIN (last_collection_los_memory_usage, los_memory_usage);
-       return (space_needed > sgen_memgov_available_free_space ()) ||
-               minor_collection_sections_alloced * major_collector.section_size + los_alloced > minor_collection_allowance;
+
+       /* FIXME: This is a cop-out.  We should have some way of figuring this out. */
+       if (!major_collector.have_swept ())
+               return FALSE;
+
+       if (space_needed > sgen_memgov_available_free_space ())
+               return TRUE;
+
+       sgen_memgov_calculate_minor_collection_allowance ();
+
+       heap_size = major_collector.get_num_major_sections () * major_collector.section_size + los_memory_usage;
+
+       return heap_size > major_collection_trigger_size;
 }
 
 void
 sgen_memgov_minor_collection_start (void)
 {
-       sgen_memgov_try_calculate_minor_collection_allowance (FALSE);
 }
 
 void
@@ -155,32 +151,22 @@ sgen_memgov_minor_collection_end (void)
 void
 sgen_memgov_major_collection_start (void)
 {
-       last_collection_old_num_major_sections = sgen_get_major_collector ()->get_num_major_sections ();
-
-       /*
-        * A domain could have been freed, resulting in
-        * los_memory_usage being less than last_collection_los_memory_usage.
-        */
-       last_collection_los_memory_alloced = los_memory_usage - MIN (last_collection_los_memory_usage, los_memory_usage);
-       last_collection_old_los_memory_usage = los_memory_usage;
-
        need_calculate_minor_collection_allowance = TRUE;
+
+       if (debug_print_allowance) {
+               SGEN_LOG (0, "Starting collection with heap size %ld bytes", (long)(major_collector.get_num_major_sections () * major_collector.section_size + los_memory_usage));
+       }
 }
 
 void
-sgen_memgov_major_collection_end (void)
+sgen_memgov_major_collection_end (gboolean forced)
 {
-       sgen_memgov_try_calculate_minor_collection_allowance (TRUE);
-
-       minor_collection_sections_alloced = 0;
        last_collection_los_memory_usage = los_memory_usage;
-}
 
-void
-sgen_memgov_collection_start (int generation)
-{
-       last_major_num_sections = major_collector.get_num_major_sections ();
-       last_los_memory_usage = los_memory_usage;
+       if (forced) {
+               sgen_get_major_collector ()->finish_sweeping ();
+               sgen_memgov_calculate_minor_collection_allowance ();
+       }
 }
 
 static void
@@ -214,6 +200,12 @@ log_timming (GGTimingInfo *info)
                        los_memory_usage / 1024);       
 }
 
+/* FIXME: Remove either these or the specialized ones above. */
+void
+sgen_memgov_collection_start (int generation)
+{
+}
+
 void
 sgen_memgov_collection_end (int generation, GGTimingInfo* info, int info_count)
 {
@@ -224,18 +216,6 @@ sgen_memgov_collection_end (int generation, GGTimingInfo* info, int info_count)
        }
 }
 
-void
-sgen_register_major_sections_alloced (size_t num_sections)
-{
-       minor_collection_sections_alloced += num_sections;
-}
-
-mword
-sgen_get_minor_collection_allowance (void)
-{
-       return minor_collection_allowance;
-}
-
 /* Memory pressure API */
 
 /* Negative value to remove */
@@ -356,7 +336,7 @@ gboolean
 sgen_memgov_try_alloc_space (mword size, int space)
 {
        if (sgen_memgov_available_free_space () < size) {
-               SGEN_ASSERT (4, !sgen_is_worker_thread (mono_native_thread_id_get ()), "Memory shouldn't run out in worker thread");
+               SGEN_ASSERT (4, !sgen_thread_pool_is_thread_pool_thread (mono_native_thread_id_get ()), "Memory shouldn't run out in worker thread");
                return FALSE;
        }
 
@@ -372,7 +352,7 @@ sgen_memgov_init (size_t max_heap, size_t soft_limit, gboolean debug_allowance,
                soft_heap_limit = soft_limit;
 
        debug_print_allowance = debug_allowance;
-       minor_collection_allowance = MIN_MINOR_COLLECTION_ALLOWANCE;
+       major_collection_trigger_size = MIN_MINOR_COLLECTION_ALLOWANCE;
 
        mono_counters_register ("Memgov alloc", MONO_COUNTER_GC | MONO_COUNTER_WORD | MONO_COUNTER_BYTES | MONO_COUNTER_VARIABLE, &total_alloc);
        mono_counters_register ("Memgov max alloc", MONO_COUNTER_GC | MONO_COUNTER_WORD | MONO_COUNTER_BYTES | MONO_COUNTER_MONOTONIC, &total_alloc_max);
@@ -396,7 +376,6 @@ sgen_memgov_init (size_t max_heap, size_t soft_limit, gboolean debug_allowance,
 
        if (save_target)
                save_target_ratio = save_target;
-       minor_collection_allowance = MIN_MINOR_COLLECTION_ALLOWANCE;
 }
 
 #endif
index 16b9ac358a98265151aabe106668e3a56c594804..0115ec6e0605e2755c4b28dc8c020b89f8ea9466 100644 (file)
@@ -34,13 +34,11 @@ void sgen_memgov_minor_collection_start (void);
 void sgen_memgov_minor_collection_end (void);
 
 void sgen_memgov_major_collection_start (void);
-void sgen_memgov_major_collection_end (void);
+void sgen_memgov_major_collection_end (gboolean forced);
 
 void sgen_memgov_collection_start (int generation);
 void sgen_memgov_collection_end (int generation, GGTimingInfo* info, int info_count);
 
-void sgen_register_major_sections_alloced (size_t num_sections);
-mword sgen_get_minor_collection_allowance (void);
 gboolean sgen_need_major_collection (mword space_needed);
 
 
index cd660cc9de277aaa4bae2e781b2edc1e47103a9b..7ebac8d424d70d4d16ecda392399af253e47c9e5 100644 (file)
@@ -64,7 +64,7 @@ SERIAL_SCAN_OBJECT (char *start, mword desc, SgenGrayQueue *queue)
 }
 
 static void
-SERIAL_SCAN_VTYPE (char *start, mword desc, SgenGrayQueue *queue BINARY_PROTOCOL_ARG (size_t size))
+SERIAL_SCAN_VTYPE (char *full_object, char *start, mword desc, SgenGrayQueue *queue BINARY_PROTOCOL_ARG (size_t size))
 {
        SGEN_OBJECT_LAYOUT_STATISTICS_DECLARE_BITMAP;
 
index 7d599e20908e59e6559b0e1bafbaa41e01e76f4f..403d04c3d9a56f95560c27f08f8b55e2d0a0bdd9 100644 (file)
@@ -31,6 +31,7 @@
 #include "metadata/sgen-gc.h"
 #include "metadata/sgen-archdep.h"
 #include "metadata/sgen-protocol.h"
+#include "metadata/sgen-thread-pool.h"
 #include "metadata/object-internals.h"
 #include "metadata/gc-internal.h"
 
@@ -116,7 +117,7 @@ sgen_thread_handshake (BOOL suspend)
 
        cur_thread->suspend_done = TRUE;
        FOREACH_THREAD_SAFE (info) {
-               if (info == cur_thread || sgen_is_worker_thread (mono_thread_info_get_tid (info)))
+               if (info == cur_thread || sgen_thread_pool_is_thread_pool_thread (mono_thread_info_get_tid (info)))
                        continue;
 
                info->suspend_done = FALSE;
index e201e12751b3eb9b427a28262af9970ef84a4c8b..13cb5ee54134df4554e6b3d9593a3c93448bf589 100644 (file)
@@ -51,10 +51,16 @@ realloc_queue (SgenPointerQueue *queue)
        SGEN_LOG (4, "Reallocated pointer queue to size: %lu", new_size);
 }
 
+gboolean
+sgen_pointer_queue_will_grow (SgenPointerQueue *queue)
+{
+       return queue->next_slot >= queue->size;
+}
+
 void
 sgen_pointer_queue_add (SgenPointerQueue *queue, void *ptr)
 {
-       if (queue->next_slot >= queue->size)
+       if (sgen_pointer_queue_will_grow (queue))
                realloc_queue (queue);
 
        queue->data [queue->next_slot++] = ptr;
index 303562e974cf4219f706bb190b0906fd1b6b7698..2f8b4cc3874ea3585566402e1653790a77c24bad 100644 (file)
@@ -39,5 +39,6 @@ void sgen_pointer_queue_init (SgenPointerQueue *queue, int mem_type);
 void* sgen_pointer_queue_pop (SgenPointerQueue *queue);
 gboolean sgen_pointer_queue_is_empty (SgenPointerQueue *queue);
 void sgen_pointer_queue_free (SgenPointerQueue *queue);
+gboolean sgen_pointer_queue_will_grow (SgenPointerQueue *queue);
 
 #endif
index bd449e10dfc12e7e41d30ada3a1225f9e2deed14..f9196ffe5b99a11a9899f6be2eb335f24387ec30 100644 (file)
@@ -71,6 +71,27 @@ MATCH_INDEX (BINARY_PROTOCOL_MATCH)
 IS_VTABLE_MATCH (FALSE)
 END_PROTOCOL_ENTRY
 
+BEGIN_PROTOCOL_ENTRY_HEAVY2 (binary_protocol_block_alloc, TYPE_POINTER, addr, TYPE_SIZE, size)
+DEFAULT_PRINT ()
+IS_ALWAYS_MATCH (FALSE)
+MATCH_INDEX (matches_interval (ptr, entry->addr, entry->size) ? 0 : BINARY_PROTOCOL_NO_MATCH)
+IS_VTABLE_MATCH (FALSE)
+END_PROTOCOL_ENTRY_HEAVY
+
+BEGIN_PROTOCOL_ENTRY_HEAVY2 (binary_protocol_block_free, TYPE_POINTER, addr, TYPE_SIZE, size)
+DEFAULT_PRINT ()
+IS_ALWAYS_MATCH (FALSE)
+MATCH_INDEX (matches_interval (ptr, entry->addr, entry->size) ? 0 : BINARY_PROTOCOL_NO_MATCH)
+IS_VTABLE_MATCH (FALSE)
+END_PROTOCOL_ENTRY_HEAVY
+
+BEGIN_PROTOCOL_ENTRY_HEAVY4 (binary_protocol_block_set_state, TYPE_POINTER, addr, TYPE_SIZE, size, TYPE_INT, old, TYPE_INT, new)
+DEFAULT_PRINT ()
+IS_ALWAYS_MATCH (FALSE)
+MATCH_INDEX (matches_interval (ptr, entry->addr, entry->size) ? 0 : BINARY_PROTOCOL_NO_MATCH)
+IS_VTABLE_MATCH (FALSE)
+END_PROTOCOL_ENTRY_HEAVY
+
 BEGIN_PROTOCOL_ENTRY_HEAVY3 (binary_protocol_alloc, TYPE_POINTER, obj, TYPE_POINTER, vtable, TYPE_INT, size)
 DEFAULT_PRINT ()
 IS_ALWAYS_MATCH (FALSE)
index 22f70c3041784664a3658c7ba4b4a282b7c67c70..bbabb8ee36d78d9a48b9b897173eec52003ace2e 100644 (file)
@@ -27,6 +27,7 @@
 #include "sgen-gc.h"
 #include "sgen-protocol.h"
 #include "sgen-memory-governor.h"
+#include "sgen-thread-pool.h"
 #include "utils/mono-mmap.h"
 #include "utils/mono-threads.h"
 
@@ -293,7 +294,7 @@ protocol_entry (unsigned char type, gpointer data, int size)
        if (binary_protocol_file == -1)
                return;
 
-       if (sgen_is_worker_thread (mono_native_thread_id_get ()))
+       if (sgen_thread_pool_is_thread_pool_thread (mono_native_thread_id_get ()))
                type |= 0x80;
 
        lock_recursive ();
index b994e0bdf489bfe41fa7fa5a2a030ee1cf5564af..c16d380d5a7e6a592808e718e4942c60c4f3437f 100644 (file)
 #include "metadata/sgen-gc.h"
 #include "metadata/sgen-protocol.h"
 #include "metadata/sgen-memory-governor.h"
+#include "metadata/sgen-thread-pool.h"
 #include "metadata/profiler-private.h"
 #include "utils/mono-time.h"
 #include "utils/dtrace.h"
 #include "utils/mono-counters.h"
 #include "utils/mono-threads.h"
 
+static gboolean world_is_stopped = FALSE;
+
 #define TV_DECLARE SGEN_TV_DECLARE
 #define TV_GETTIME SGEN_TV_GETTIME
 #define TV_ELAPSED SGEN_TV_ELAPSED
@@ -101,7 +104,7 @@ is_ip_in_managed_allocator (MonoDomain *domain, gpointer ip)
         * missing methods (#13951). To work around this, we disable the AOT fallback. For this to work, the JIT needs
         * to register the jit info for all GC critical methods after they are JITted/loaded.
         */
-       ji = mono_jit_info_table_find_internal (domain, ip, FALSE);
+       ji = mono_jit_info_table_find_internal (domain, ip, FALSE, FALSE);
        if (!ji)
                return FALSE;
 
@@ -216,6 +219,8 @@ sgen_stop_world (int generation)
        TV_DECLARE (end_handshake);
        int count, dead;
 
+       SGEN_ASSERT (0, !world_is_stopped, "Why are we stopping a stopped world?");
+
        mono_profiler_gc_event (MONO_GC_EVENT_PRE_STOP_WORLD, generation);
        MONO_GC_WORLD_STOP_BEGIN ();
        binary_protocol_world_stopping (sgen_timestamp ());
@@ -240,6 +245,8 @@ sgen_stop_world (int generation)
                count -= dead;
        }
 
+       world_is_stopped = TRUE;
+
        SGEN_LOG (3, "world stopped %d thread(s)", count);
        mono_profiler_gc_event (MONO_GC_EVENT_POST_STOP_WORLD, generation);
        MONO_GC_WORLD_STOP_END ();
@@ -271,6 +278,8 @@ sgen_restart_world (int generation, GGTimingInfo *timing)
        TV_DECLARE (end_bridge);
        unsigned long usec, bridge_usec;
 
+       SGEN_ASSERT (0, world_is_stopped, "Why are we restarting a running world?");
+
        if (binary_protocol_is_enabled ()) {
                long long major_total = -1, major_marked = -1, los_total = -1, los_marked = -1;
                if (binary_protocol_is_heavy_enabled ())
@@ -305,6 +314,9 @@ sgen_restart_world (int generation, GGTimingInfo *timing)
        time_restart_world += TV_ELAPSED (start_handshake, end_sw);
        usec = TV_ELAPSED (stop_world_time, end_sw);
        max_pause_usec = MAX (usec, max_pause_usec);
+
+       world_is_stopped = FALSE;
+
        SGEN_LOG (2, "restarted %d thread(s) (pause time: %d usec, max: %d)", count, (int)usec, (int)max_pause_usec);
        mono_profiler_gc_event (MONO_GC_EVENT_POST_START_WORLD, generation);
        MONO_GC_WORLD_RESTART_END (generation);
@@ -340,6 +352,12 @@ sgen_restart_world (int generation, GGTimingInfo *timing)
        return count;
 }
 
+gboolean
+sgen_is_world_stopped (void)
+{
+       return world_is_stopped;
+}
+
 void
 sgen_init_stw (void)
 {
@@ -380,7 +398,7 @@ sgen_is_thread_in_current_stw (SgenThreadInfo *info)
        We can't suspend the workers that will do all the heavy lifting.
        FIXME Use some state bit in SgenThreadInfo for this.
        */
-       if (sgen_is_worker_thread (mono_thread_info_get_tid (info))) {
+       if (sgen_thread_pool_is_thread_pool_thread (mono_thread_info_get_tid (info))) {
                return FALSE;
        }
 
index 3d63e94bfcd89bb3678b5c5bbae166e594a5ad34..2d55abbbcc19839bf2e6348f6a683ffd6c5c123a 100644 (file)
@@ -37,6 +37,7 @@
 #define SGEN_POINTER_TAG_4(p)          ((void*)((mword)(p) | 4))
 #define SGEN_POINTER_UNTAG_4(p)                ((void*)((mword)(p) & ~4))
 
+#define SGEN_POINTER_UNTAG_12(p)       ((void*)((mword)(p) & ~3))
 #define SGEN_POINTER_UNTAG_24(p)       ((void*)((mword)(p) & ~6))
 
 #define SGEN_POINTER_IS_TAGGED_ANY(p)  ((mword)(p) & SGEN_TAGGED_POINTER_MASK)
diff --git a/mono/metadata/sgen-thread-pool.c b/mono/metadata/sgen-thread-pool.c
new file mode 100644 (file)
index 0000000..3ee55cf
--- /dev/null
@@ -0,0 +1,255 @@
+/*
+ * sgen-thread-pool.c: Threadpool for all concurrent GC work.
+ *
+ * Copyright (C) 2015 Xamarin Inc
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License 2.0 as published by the Free Software Foundation;
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License 2.0 along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include "config.h"
+#ifdef HAVE_SGEN_GC
+
+#include "mono/metadata/sgen-gc.h"
+#include "mono/metadata/sgen-thread-pool.h"
+#include "mono/metadata/sgen-pointer-queue.h"
+#include "mono/utils/mono-mutex.h"
+#include "mono/utils/mono-threads.h"
+
+static mono_mutex_t lock;
+static mono_cond_t work_cond;
+static mono_cond_t done_cond;
+
+static MonoNativeThreadId thread;
+
+/* Only accessed with the lock held. */
+static SgenPointerQueue job_queue;
+
+static SgenThreadPoolThreadInitFunc thread_init_func;
+static SgenThreadPoolIdleJobFunc idle_job_func;
+static SgenThreadPoolContinueIdleJobFunc continue_idle_job_func;
+
+enum {
+       STATE_WAITING,
+       STATE_IN_PROGRESS,
+       STATE_DONE
+};
+
+/* Assumes that the lock is held. */
+static SgenThreadPoolJob*
+get_job_and_set_in_progress (void)
+{
+       for (size_t i = 0; i < job_queue.next_slot; ++i) {
+               SgenThreadPoolJob *job = job_queue.data [i];
+               if (job->state == STATE_WAITING) {
+                       job->state = STATE_IN_PROGRESS;
+                       return job;
+               }
+       }
+       return NULL;
+}
+
+/* Assumes that the lock is held. */
+static ssize_t
+find_job_in_queue (SgenThreadPoolJob *job)
+{
+       for (ssize_t i = 0; i < job_queue.next_slot; ++i) {
+               if (job_queue.data [i] == job)
+                       return i;
+       }
+       return -1;
+}
+
+/* Assumes that the lock is held. */
+static void
+remove_job (SgenThreadPoolJob *job)
+{
+       ssize_t index;
+       SGEN_ASSERT (0, job->state == STATE_DONE, "Why are we removing a job that's not done?");
+       index = find_job_in_queue (job);
+       SGEN_ASSERT (0, index >= 0, "Why is the job we're trying to remove not in the queue?");
+       job_queue.data [index] = NULL;
+       sgen_pointer_queue_remove_nulls (&job_queue);
+       sgen_thread_pool_job_free (job);
+}
+
+static gboolean
+continue_idle_job (void)
+{
+       if (!continue_idle_job_func)
+               return FALSE;
+       return continue_idle_job_func ();
+}
+
+static mono_native_thread_return_t
+thread_func (void *thread_data)
+{
+       thread_init_func (thread_data);
+
+       mono_mutex_lock (&lock);
+       for (;;) {
+               /*
+                * It's important that we check the continue idle flag with the lock held.
+                * Suppose we didn't check with the lock held, and the result is FALSE.  The
+                * main thread might then set continue idle and signal us before we can take
+                * the lock, and we'd lose the signal.
+                */
+               gboolean do_idle = continue_idle_job ();
+               SgenThreadPoolJob *job = get_job_and_set_in_progress ();
+
+               if (!job && !do_idle) {
+                       /*
+                        * pthread_cond_wait() can return successfully despite the condition
+                        * not being signalled, so we have to run this in a loop until we
+                        * really have work to do.
+                        */
+                       mono_cond_wait (&work_cond, &lock);
+                       continue;
+               }
+
+               mono_mutex_unlock (&lock);
+
+               if (job) {
+                       job->func (thread_data, job);
+
+                       mono_mutex_lock (&lock);
+
+                       SGEN_ASSERT (0, job->state == STATE_IN_PROGRESS, "The job should still be in progress.");
+                       job->state = STATE_DONE;
+                       remove_job (job);
+                       /*
+                        * Only the main GC thread will ever wait on the done condition, so we don't
+                        * have to broadcast.
+                        */
+                       mono_cond_signal (&done_cond);
+               } else {
+                       SGEN_ASSERT (0, do_idle, "Why did we unlock if we still have to wait for idle?");
+                       SGEN_ASSERT (0, idle_job_func, "Why do we have idle work when there's no idle job function?");
+                       do {
+                               idle_job_func (thread_data);
+                               do_idle = continue_idle_job ();
+                       } while (do_idle && !job_queue.next_slot);
+
+                       mono_mutex_lock (&lock);
+
+                       if (!do_idle)
+                               mono_cond_signal (&done_cond);
+               }
+       }
+}
+
+void
+sgen_thread_pool_init (int num_threads, SgenThreadPoolThreadInitFunc init_func, SgenThreadPoolIdleJobFunc idle_func, SgenThreadPoolContinueIdleJobFunc continue_idle_func, void **thread_datas)
+{
+       SGEN_ASSERT (0, num_threads == 1, "We only support 1 thread pool thread for now.");
+
+       mono_mutex_init (&lock);
+       mono_cond_init (&work_cond, NULL);
+       mono_cond_init (&done_cond, NULL);
+
+       thread_init_func = init_func;
+       idle_job_func = idle_func;
+       continue_idle_job_func = continue_idle_func;
+
+       mono_native_thread_create (&thread, thread_func, thread_datas ? thread_datas [0] : NULL);
+}
+
+SgenThreadPoolJob*
+sgen_thread_pool_job_alloc (const char *name, SgenThreadPoolJobFunc func, size_t size)
+{
+       SgenThreadPoolJob *job = sgen_alloc_internal_dynamic (size, INTERNAL_MEM_THREAD_POOL_JOB, TRUE);
+       job->name = name;
+       job->size = size;
+       job->state = STATE_WAITING;
+       job->func = func;
+       return job;
+}
+
+void
+sgen_thread_pool_job_free (SgenThreadPoolJob *job)
+{
+       sgen_free_internal_dynamic (job, job->size, INTERNAL_MEM_THREAD_POOL_JOB);
+}
+
+void
+sgen_thread_pool_job_enqueue (SgenThreadPoolJob *job)
+{
+       mono_mutex_lock (&lock);
+
+       sgen_pointer_queue_add (&job_queue, job);
+       /*
+        * FIXME: We could check whether there is a job in progress.  If there is, there's
+        * no need to signal the condition, at least as long as we have only one thread.
+        */
+       mono_cond_signal (&work_cond);
+
+       mono_mutex_unlock (&lock);
+}
+
+void
+sgen_thread_pool_job_wait (SgenThreadPoolJob *job)
+{
+       SGEN_ASSERT (0, job, "Where's the job?");
+
+       mono_mutex_lock (&lock);
+
+       while (find_job_in_queue (job) >= 0)
+               mono_cond_wait (&done_cond, &lock);
+
+       mono_mutex_unlock (&lock);
+}
+
+void
+sgen_thread_pool_idle_signal (void)
+{
+       SGEN_ASSERT (0, idle_job_func, "Why are we signaling idle without an idle function?");
+
+       mono_mutex_lock (&lock);
+
+       if (continue_idle_job_func ())
+               mono_cond_signal (&work_cond);
+
+       mono_mutex_unlock (&lock);
+}
+
+void
+sgen_thread_pool_idle_wait (void)
+{
+       SGEN_ASSERT (0, idle_job_func, "Why are we waiting for idle without an idle function?");
+
+       mono_mutex_lock (&lock);
+
+       while (continue_idle_job_func ())
+               mono_cond_wait (&done_cond, &lock);
+
+       mono_mutex_unlock (&lock);
+}
+
+void
+sgen_thread_pool_wait_for_all_jobs (void)
+{
+       mono_mutex_lock (&lock);
+
+       while (!sgen_pointer_queue_is_empty (&job_queue))
+               mono_cond_wait (&done_cond, &lock);
+
+       mono_mutex_unlock (&lock);
+}
+
+gboolean
+sgen_thread_pool_is_thread_pool_thread (MonoNativeThreadId some_thread)
+{
+       return some_thread == thread;
+}
+
+#endif
diff --git a/mono/metadata/sgen-thread-pool.h b/mono/metadata/sgen-thread-pool.h
new file mode 100644 (file)
index 0000000..4dcb3a9
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * sgen-thread-pool.h: Threadpool for all concurrent GC work.
+ *
+ * Copyright (C) 2015 Xamarin Inc
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License 2.0 as published by the Free Software Foundation;
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License 2.0 along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __MONO_SGEN_THREAD_POOL_H__
+#define __MONO_SGEN_THREAD_POOL_H__
+
+typedef struct _SgenThreadPoolJob SgenThreadPoolJob;
+
+typedef void (*SgenThreadPoolJobFunc) (void *thread_data, SgenThreadPoolJob *job);
+
+struct _SgenThreadPoolJob {
+       const char *name;
+       SgenThreadPoolJobFunc func;
+       size_t size;
+       volatile gint32 state;
+};
+
+typedef void (*SgenThreadPoolThreadInitFunc) (void*);
+typedef void (*SgenThreadPoolIdleJobFunc) (void*);
+typedef gboolean (*SgenThreadPoolContinueIdleJobFunc) (void);
+
+void sgen_thread_pool_init (int num_threads, SgenThreadPoolThreadInitFunc init_func, SgenThreadPoolIdleJobFunc idle_func, SgenThreadPoolContinueIdleJobFunc continue_idle_func, void **thread_datas);
+
+SgenThreadPoolJob* sgen_thread_pool_job_alloc (const char *name, SgenThreadPoolJobFunc func, size_t size);
+/* This only needs to be called on jobs that are not enqueued. */
+void sgen_thread_pool_job_free (SgenThreadPoolJob *job);
+
+void sgen_thread_pool_job_enqueue (SgenThreadPoolJob *job);
+/* This must only be called after the job has been enqueued. */
+void sgen_thread_pool_job_wait (SgenThreadPoolJob *job);
+
+void sgen_thread_pool_idle_signal (void);
+void sgen_thread_pool_idle_wait (void);
+
+void sgen_thread_pool_wait_for_all_jobs (void);
+
+gboolean sgen_thread_pool_is_thread_pool_thread (MonoNativeThreadId thread);
+
+#endif
index 4709ccfeef6cd3a9cd19dd1bb175019594916f08..c1f0ffc1acde58600318ac76ed62432e00f6c53e 100644 (file)
@@ -92,7 +92,7 @@ sgen_process_togglerefs (void)
 
 void sgen_mark_togglerefs (char *start, char *end, ScanCopyContext ctx)
 {
-       CopyOrMarkObjectFunc copy_func = ctx.copy_func;
+       CopyOrMarkObjectFunc copy_func = ctx.ops->copy_or_mark_object;
        SgenGrayQueue *queue = ctx.queue;
        int i;
 
@@ -112,7 +112,7 @@ void sgen_mark_togglerefs (char *start, char *end, ScanCopyContext ctx)
 
 void sgen_clear_togglerefs (char *start, char *end, ScanCopyContext ctx)
 {
-       CopyOrMarkObjectFunc copy_func = ctx.copy_func;
+       CopyOrMarkObjectFunc copy_func = ctx.ops->copy_or_mark_object;
        SgenGrayQueue *queue = ctx.queue;
        int i;
 
index 9920845e468a1fd0c2ee4fad6989149b739ad8f4..9880d9b6ef0c05c75db9ed3c2a20f3a79b574543 100644 (file)
 
 #include "metadata/sgen-gc.h"
 #include "metadata/sgen-workers.h"
+#include "metadata/sgen-thread-pool.h"
 #include "utils/mono-counters.h"
 
 static int workers_num;
 static WorkerData *workers_data;
-static void *workers_gc_thread_major_collector_data = NULL;
 
 static SgenSectionGrayQueue workers_distribute_gray_queue;
 static gboolean workers_distribute_gray_queue_inited;
 
-static gboolean workers_started = FALSE;
+/*
+ * Allowed transitions:
+ *
+ * | from \ to          | NOT WORKING | WORKING | WORK ENQUEUED | NURSERY COLLECTION |
+ * |--------------------+-------------+---------+---------------+--------------------|
+ * | NOT WORKING        | -           | -       | main          | main               |
+ * | WORKING            | worker      | -       | main          | main               |
+ * | WORK ENQUEUED      | -           | worker  | -             | main               |
+ * | NURSERY COLLECTION | -           | -       | main          | -                  |
+ *
+ * The WORK ENQUEUED state guarantees that the worker thread will inspect the queue again at
+ * least once.  Only after looking at the queue will it go back to WORKING, and then,
+ * eventually, to NOT WORKING.  After enqueuing work the main thread transitions the state
+ * to WORK ENQUEUED.  Signalling the worker thread to wake up is only necessary if the old
+ * state was NOT WORKING.
+ */
 
 enum {
        STATE_NOT_WORKING,
        STATE_WORKING,
+       STATE_WORK_ENQUEUED,
        STATE_NURSERY_COLLECTION
 } WorkersStateName;
 
-/*
- * | state                    | num_awake | num_posted                 | post_done |
- * |--------------------------+-----------+----------------------------+-----------|
- * | STATE_NOT_WORKING        | 0         | *                          |         0 |
- * | STATE_WORKING            | > 0       | <= workers_num - num_awake |         * |
- * | STATE_NURSERY_COLLECTION | *         | <= workers_num - num_awake |         1 |
- * | STATE_NURSERY_COLLECTION | 0         | 0                          |         0 |
- */
-typedef union {
-       gint32 value;
-       struct {
-               guint state : 4; /* WorkersStateName */
-               /* Number of worker threads awake. */
-               guint num_awake : 8;
-               /* The state of the waiting semaphore. */
-               guint num_posted : 8;
-               /* Whether to post `workers_done_sem` */
-               guint post_done : 1;
-       } data;
-} State;
+typedef gint32 State;
 
 static volatile State workers_state;
 
-static MonoSemType workers_waiting_sem;
-static MonoSemType workers_done_sem;
-
-static volatile int workers_job_queue_num_entries = 0;
-static volatile JobQueueEntry *workers_job_queue = NULL;
-static LOCK_DECLARE (workers_job_queue_mutex);
-static int workers_num_jobs_enqueued = 0;
-static volatile int workers_num_jobs_finished = 0;
+static SgenObjectOperations * volatile idle_func_object_ops;
 
-static guint64 stat_workers_stolen_from_self_lock;
-static guint64 stat_workers_stolen_from_self_no_lock;
-static guint64 stat_workers_stolen_from_others;
-static guint64 stat_workers_num_waited;
+static guint64 stat_workers_num_finished;
 
 static gboolean
 set_state (State old_state, State new_state)
 {
-       if (old_state.data.state == STATE_NURSERY_COLLECTION)
-               SGEN_ASSERT (0, new_state.data.state != STATE_NOT_WORKING, "Can't go from nursery collection to not working");
-
-       return InterlockedCompareExchange (&workers_state.value,
-                       new_state.value, old_state.value) == old_state.value;
-}
-
-static void
-assert_not_working (State state)
-{
-       SGEN_ASSERT (0, state.data.state == STATE_NOT_WORKING, "Can only signal enqueue work when in no work state");
-       SGEN_ASSERT (0, state.data.num_awake == 0, "No workers can be awake when not working");
-       SGEN_ASSERT (0, state.data.num_posted == 0, "Can't have posted already");
-       SGEN_ASSERT (0, !state.data.post_done, "post_done can only be set when working");
-
+       SGEN_ASSERT (0, old_state != new_state, "Why are we transitioning to the same state?");
+       if (new_state == STATE_NOT_WORKING)
+               SGEN_ASSERT (0, old_state == STATE_WORKING, "We can only transition to NOT WORKING from WORKING");
+       else if (new_state == STATE_WORKING)
+               SGEN_ASSERT (0, old_state == STATE_WORK_ENQUEUED, "We can only transition to WORKING from WORK ENQUEUED");
+       if (new_state == STATE_NOT_WORKING || new_state == STATE_WORKING)
+               SGEN_ASSERT (6, sgen_thread_pool_is_thread_pool_thread (mono_native_thread_id_get ()), "Only the worker thread is allowed to transition to NOT_WORKING or WORKING");
+
+       return InterlockedCompareExchange (&workers_state, new_state, old_state) == old_state;
 }
 
 static void
-assert_working (State state, gboolean from_worker)
+assert_nursery_collection (State state)
 {
-       SGEN_ASSERT (0, state.data.state == STATE_WORKING, "A worker can't wait without being in working state");
-       if (from_worker)
-               SGEN_ASSERT (0, state.data.num_awake > 0, "How can we be awake, yet we are not counted?");
-       else
-               SGEN_ASSERT (0, state.data.num_awake + state.data.num_posted > 0, "How can we be working, yet no worker threads are awake or to be awoken?");
-       SGEN_ASSERT (0, state.data.num_awake + state.data.num_posted <= workers_num, "There are too many worker threads awake");
+       SGEN_ASSERT (0, state == STATE_NURSERY_COLLECTION, "Must be in the nursery collection state");
 }
 
-static void
-assert_nursery_collection (State state, gboolean from_worker)
-{
-       SGEN_ASSERT (0, state.data.state == STATE_NURSERY_COLLECTION, "Must be in the nursery collection state");
-       if (from_worker) {
-               SGEN_ASSERT (0, state.data.num_awake > 0, "We're awake, but num_awake is zero");
-               SGEN_ASSERT (0, state.data.post_done, "post_done must be set in the nursery collection state");
-       }
-       SGEN_ASSERT (0, state.data.num_awake <= workers_num, "There are too many worker threads awake");
-       if (!state.data.post_done) {
-               SGEN_ASSERT (0, state.data.num_awake == 0, "Once done has been posted no threads can be awake");
-               SGEN_ASSERT (0, state.data.num_posted == 0, "Once done has been posted no thread must be awoken");
-       }
-}
-
-static void
-assert_working_or_nursery_collection (State state)
+static gboolean
+state_is_working_or_enqueued (State state)
 {
-       if (state.data.state == STATE_WORKING)
-               assert_working (state, TRUE);
-       else
-               assert_nursery_collection (state, TRUE);
+       return state == STATE_WORKING || state == STATE_WORK_ENQUEUED;
 }
 
 static void
-workers_signal_enqueue_work (int num_wake_up, gboolean from_nursery_collection)
+workers_signal_enqueue_work (gboolean from_nursery_collection)
 {
-       State old_state = workers_state;
-       State new_state = old_state;
-       int i;
+       State old_state;
        gboolean did_set_state;
 
-       SGEN_ASSERT (0, num_wake_up <= workers_num, "Cannot wake up more workers than are present");
+       do {
+               old_state = workers_state;
 
-       if (from_nursery_collection)
-               assert_nursery_collection (old_state, FALSE);
-       else
-               assert_not_working (old_state);
+               if (from_nursery_collection)
+                       assert_nursery_collection (old_state);
+               else
+                       SGEN_ASSERT (0, old_state != STATE_NURSERY_COLLECTION, "If we're not in a nursery collection, how come the state is NURSERY COLLECTION?");
 
-       new_state.data.state = STATE_WORKING;
-       new_state.data.num_posted = num_wake_up;
+               if (old_state == STATE_WORK_ENQUEUED)
+                       break;
 
-       did_set_state = set_state (old_state, new_state);
-       SGEN_ASSERT (0, did_set_state, "Nobody else should be mutating the state");
+               did_set_state = set_state (old_state, STATE_WORK_ENQUEUED);
+               if (from_nursery_collection)
+                       SGEN_ASSERT (0, did_set_state, "Nobody else should be mutating the state");
+       } while (!did_set_state);
 
-       for (i = 0; i < num_wake_up; ++i)
-               MONO_SEM_POST (&workers_waiting_sem);
-}
-
-static void
-workers_signal_enqueue_work_if_necessary (int num_wake_up)
-{
-       if (workers_state.data.state == STATE_NOT_WORKING)
-               workers_signal_enqueue_work (num_wake_up, FALSE);
+       if (!state_is_working_or_enqueued (old_state))
+               sgen_thread_pool_idle_signal ();
 }
 
 void
 sgen_workers_ensure_awake (void)
 {
-       SGEN_ASSERT (0, workers_state.data.state != STATE_NURSERY_COLLECTION, "Can't wake workers during nursery collection");
-       workers_signal_enqueue_work_if_necessary (workers_num);
+       SGEN_ASSERT (0, workers_state != STATE_NURSERY_COLLECTION, "Can't wake workers during nursery collection");
+       workers_signal_enqueue_work (FALSE);
 }
 
 static void
-workers_wait (void)
+worker_try_finish (void)
 {
-       State old_state, new_state;
-       gboolean post_done;
-
-       ++stat_workers_num_waited;
-
-       do {
-               new_state = old_state = workers_state;
-
-               assert_working_or_nursery_collection (old_state);
-
-               --new_state.data.num_awake;
-               post_done = FALSE;
-               if (!new_state.data.num_awake && !new_state.data.num_posted) {
-                       /* We are the last thread to go to sleep. */
-                       if (old_state.data.state == STATE_WORKING)
-                               new_state.data.state = STATE_NOT_WORKING;
-
-                       new_state.data.post_done = 0;
-                       if (old_state.data.post_done)
-                               post_done = TRUE;
-               }
-       } while (!set_state (old_state, new_state));
-
-       if (post_done)
-               MONO_SEM_POST (&workers_done_sem);
+       State old_state;
 
-       MONO_SEM_WAIT (&workers_waiting_sem);
+       ++stat_workers_num_finished;
 
        do {
-               new_state = old_state = workers_state;
-
-               SGEN_ASSERT (0, old_state.data.num_posted > 0, "How can we be awake without the semaphore having been posted?");
-               SGEN_ASSERT (0, old_state.data.num_awake < workers_num, "There are too many worker threads awake");
+               old_state = workers_state;
 
-               --new_state.data.num_posted;
-               ++new_state.data.num_awake;
+               SGEN_ASSERT (0, old_state != STATE_NOT_WORKING, "How did we get from doing idle work to NOT WORKING without setting it ourselves?");
+               if (old_state == STATE_NURSERY_COLLECTION)
+                       return;
+               if (old_state == STATE_WORK_ENQUEUED)
+                       return;
+               SGEN_ASSERT (0, old_state == STATE_WORKING, "What other possibility is there?");
 
-               assert_working_or_nursery_collection (new_state);
-       } while (!set_state (old_state, new_state));
+               /* We are the last thread to go to sleep. */
+       } while (!set_state (old_state, STATE_NOT_WORKING));
 }
 
 static gboolean
@@ -223,117 +152,53 @@ collection_needs_workers (void)
 }
 
 void
-sgen_workers_enqueue_job (const char *name, JobFunc func, void *data)
+sgen_workers_enqueue_job (SgenThreadPoolJob *job)
 {
-       int num_entries;
-       JobQueueEntry *entry;
-
        if (!collection_needs_workers ()) {
-               func (NULL, data);
+               job->func (NULL, job);
+               sgen_thread_pool_job_free (job);
                return;
        }
 
-       entry = sgen_alloc_internal (INTERNAL_MEM_JOB_QUEUE_ENTRY);
-       entry->name = name;
-       entry->func = func;
-       entry->data = data;
-
-       mono_mutex_lock (&workers_job_queue_mutex);
-       entry->next = workers_job_queue;
-       workers_job_queue = entry;
-       num_entries = ++workers_job_queue_num_entries;
-       ++workers_num_jobs_enqueued;
-       mono_mutex_unlock (&workers_job_queue_mutex);
-
-       if (workers_state.data.state != STATE_NURSERY_COLLECTION)
-               workers_signal_enqueue_work_if_necessary (num_entries < workers_num ? num_entries : workers_num);
+       sgen_thread_pool_job_enqueue (job);
 }
 
 void
 sgen_workers_wait_for_jobs_finished (void)
 {
-       // FIXME: implement this properly
-       while (workers_num_jobs_finished < workers_num_jobs_enqueued) {
-               workers_signal_enqueue_work_if_necessary (workers_num);
-               /* FIXME: sleep less? */
-               g_usleep (1000);
-       }
+       sgen_thread_pool_wait_for_all_jobs ();
+       /*
+        * If the idle task was never triggered or it finished before the last job did and
+        * then didn't get triggered again, we might end up in the situation of having
+        * something in the gray queue yet the idle task not working.  The easiest way to
+        * make sure this doesn't stay that way is to just trigger it again after all jobs
+        * have finished.
+        */
+       sgen_workers_ensure_awake ();
 }
 
 void
 sgen_workers_signal_start_nursery_collection_and_wait (void)
 {
-       State old_state, new_state;
+       State old_state;
 
        do {
-               new_state = old_state = workers_state;
-
-               new_state.data.state = STATE_NURSERY_COLLECTION;
-
-               if (old_state.data.state == STATE_NOT_WORKING) {
-                       assert_not_working (old_state);
-               } else {
-                       assert_working (old_state, FALSE);
-                       SGEN_ASSERT (0, !old_state.data.post_done, "We are not waiting for the workers");
+               old_state = workers_state;
 
-                       new_state.data.post_done = 1;
-               }
-       } while (!set_state (old_state, new_state));
+               if (old_state != STATE_NOT_WORKING)
+                       SGEN_ASSERT (0, old_state != STATE_NURSERY_COLLECTION, "Why are we transitioning to NURSERY COLLECTION when we're already there?");
+       } while (!set_state (old_state, STATE_NURSERY_COLLECTION));
 
-       if (new_state.data.post_done)
-               MONO_SEM_WAIT (&workers_done_sem);
+       sgen_thread_pool_idle_wait ();
 
-       old_state = workers_state;
-       assert_nursery_collection (old_state, FALSE);
-       SGEN_ASSERT (0, !old_state.data.post_done, "We got the semaphore, so it must have been posted");
+       assert_nursery_collection (workers_state);
 }
 
 void
 sgen_workers_signal_finish_nursery_collection (void)
 {
-       State old_state = workers_state;
-
-       assert_nursery_collection (old_state, FALSE);
-       SGEN_ASSERT (0, !old_state.data.post_done, "We are finishing the nursery collection, so we should have waited for the semaphore earlier");
-
-       workers_signal_enqueue_work (workers_num, TRUE);
-}
-
-static gboolean
-workers_dequeue_and_do_job (WorkerData *data)
-{
-       JobQueueEntry *entry;
-
-       /*
-        * At this point the GC might not be running anymore.  We
-        * could have been woken up by a job that was then taken by
-        * another thread, after which the collection finished, so we
-        * first have to successfully dequeue a job before doing
-        * anything assuming that the collection is still ongoing.
-        */
-
-       if (!workers_job_queue_num_entries)
-               return FALSE;
-
-       mono_mutex_lock (&workers_job_queue_mutex);
-       entry = (JobQueueEntry*)workers_job_queue;
-       if (entry) {
-               workers_job_queue = entry->next;
-               --workers_job_queue_num_entries;
-       }
-       mono_mutex_unlock (&workers_job_queue_mutex);
-
-       if (!entry)
-               return FALSE;
-
-       g_assert (collection_needs_workers ());
-
-       entry->func (data, entry->data);
-       sgen_free_internal (entry, INTERNAL_MEM_JOB_QUEUE_ENTRY);
-
-       SGEN_ATOMIC_ADD (workers_num_jobs_finished, 1);
-
-       return TRUE;
+       assert_nursery_collection (workers_state);
+       workers_signal_enqueue_work (TRUE);
 }
 
 static gboolean
@@ -373,66 +238,63 @@ init_private_gray_queue (WorkerData *data)
                        sgen_get_major_collector ()->is_concurrent ? concurrent_enqueue_check : NULL);
 }
 
-static mono_native_thread_return_t
-workers_thread_func (void *data_untyped)
+static void
+thread_pool_init_func (void *data_untyped)
 {
        WorkerData *data = data_untyped;
        SgenMajorCollector *major = sgen_get_major_collector ();
 
        mono_thread_info_register_small_id ();
 
-       if (major->init_worker_thread)
-               major->init_worker_thread (data->major_collector_data);
+       if (!major->is_concurrent)
+               return;
 
        init_private_gray_queue (data);
+}
 
-       for (;;) {
-               gboolean did_work = FALSE;
-
-               SGEN_ASSERT (0, sgen_get_current_collection_generation () != GENERATION_NURSERY, "Why are we doing work while there's a nursery collection happening?");
+static gboolean
+continue_idle_func (void)
+{
+       return state_is_working_or_enqueued (workers_state);
+}
 
-               while (workers_state.data.state == STATE_WORKING && workers_dequeue_and_do_job (data)) {
-                       did_work = TRUE;
-                       /* FIXME: maybe distribute the gray queue here? */
-               }
+static void
+marker_idle_func (void *data_untyped)
+{
+       WorkerData *data = data_untyped;
 
-               if (!did_work && (!sgen_gray_object_queue_is_empty (&data->private_gray_queue) || workers_get_work (data))) {
-                       SgenObjectOperations *ops = sgen_concurrent_collection_in_progress ()
-                               ? &major->major_concurrent_ops
-                               : &major->major_ops;
-                       ScanCopyContext ctx = { ops->scan_object, NULL, &data->private_gray_queue };
+       if (!continue_idle_func ())
+               return;
 
-                       g_assert (!sgen_gray_object_queue_is_empty (&data->private_gray_queue));
+       SGEN_ASSERT (0, sgen_concurrent_collection_in_progress (), "The worker should only mark in concurrent collections.");
+       SGEN_ASSERT (0, sgen_get_current_collection_generation () != GENERATION_NURSERY, "Why are we doing work while there's a nursery collection happening?");
 
-                       while (!sgen_drain_gray_stack (32, ctx)) {
-                               if (workers_state.data.state == STATE_NURSERY_COLLECTION)
-                                       workers_wait ();
-                       }
-                       g_assert (sgen_gray_object_queue_is_empty (&data->private_gray_queue));
+       if (workers_state == STATE_WORK_ENQUEUED) {
+               set_state (STATE_WORK_ENQUEUED, STATE_WORKING);
+               SGEN_ASSERT (0, workers_state != STATE_NOT_WORKING, "How did we get from WORK ENQUEUED to NOT WORKING?");
+       }
 
-                       init_private_gray_queue (data);
+       if (!sgen_gray_object_queue_is_empty (&data->private_gray_queue) || workers_get_work (data)) {
+               ScanCopyContext ctx = CONTEXT_FROM_OBJECT_OPERATIONS (idle_func_object_ops, &data->private_gray_queue);
 
-                       did_work = TRUE;
-               }
+               SGEN_ASSERT (0, !sgen_gray_object_queue_is_empty (&data->private_gray_queue), "How is our gray queue empty if we just got work?");
 
-               if (!did_work)
-                       workers_wait ();
+               sgen_drain_gray_stack (32, ctx);
+       } else {
+               worker_try_finish ();
        }
-
-       /* dummy return to make compilers happy */
-       return NULL;
 }
 
 static void
-init_distribute_gray_queue (gboolean locked)
+init_distribute_gray_queue (void)
 {
        if (workers_distribute_gray_queue_inited) {
                g_assert (sgen_section_gray_queue_is_empty (&workers_distribute_gray_queue));
-               g_assert (!workers_distribute_gray_queue.locked == !locked);
+               g_assert (workers_distribute_gray_queue.locked);
                return;
        }
 
-       sgen_section_gray_queue_init (&workers_distribute_gray_queue, locked,
+       sgen_section_gray_queue_init (&workers_distribute_gray_queue, TRUE,
                        sgen_get_major_collector ()->is_concurrent ? concurrent_enqueue_check : NULL);
        workers_distribute_gray_queue_inited = TRUE;
 }
@@ -440,19 +302,21 @@ init_distribute_gray_queue (gboolean locked)
 void
 sgen_workers_init_distribute_gray_queue (void)
 {
-       if (!collection_needs_workers ())
-               return;
-
-       init_distribute_gray_queue (sgen_get_major_collector ()->is_concurrent);
+       SGEN_ASSERT (0, sgen_get_major_collector ()->is_concurrent && collection_needs_workers (),
+                       "Why should we init the distribute gray queue if we don't need it?");
+       init_distribute_gray_queue ();
 }
 
 void
 sgen_workers_init (int num_workers)
 {
        int i;
+       void *workers_data_ptrs [num_workers];
 
-       if (!sgen_get_major_collector ()->is_concurrent)
+       if (!sgen_get_major_collector ()->is_concurrent) {
+               sgen_thread_pool_init (num_workers, thread_pool_init_func, NULL, NULL, NULL);
                return;
+       }
 
        //g_print ("initing %d workers\n", num_workers);
 
@@ -461,163 +325,67 @@ sgen_workers_init (int num_workers)
        workers_data = sgen_alloc_internal_dynamic (sizeof (WorkerData) * num_workers, INTERNAL_MEM_WORKER_DATA, TRUE);
        memset (workers_data, 0, sizeof (WorkerData) * num_workers);
 
-       MONO_SEM_INIT (&workers_waiting_sem, 0);
-       MONO_SEM_INIT (&workers_done_sem, 0);
+       init_distribute_gray_queue ();
 
-       init_distribute_gray_queue (sgen_get_major_collector ()->is_concurrent);
-
-       if (sgen_get_major_collector ()->alloc_worker_data)
-               workers_gc_thread_major_collector_data = sgen_get_major_collector ()->alloc_worker_data ();
-
-       for (i = 0; i < workers_num; ++i) {
-               workers_data [i].index = i;
-
-               if (sgen_get_major_collector ()->alloc_worker_data)
-                       workers_data [i].major_collector_data = sgen_get_major_collector ()->alloc_worker_data ();
-       }
-
-       LOCK_INIT (workers_job_queue_mutex);
-
-       sgen_register_fixed_internal_mem_type (INTERNAL_MEM_JOB_QUEUE_ENTRY, sizeof (JobQueueEntry));
-
-       mono_counters_register ("Stolen from self lock", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_workers_stolen_from_self_lock);
-       mono_counters_register ("Stolen from self no lock", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_workers_stolen_from_self_no_lock);
-       mono_counters_register ("Stolen from others", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_workers_stolen_from_others);
-       mono_counters_register ("# workers waited", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_workers_num_waited);
-}
-
-/* only the GC thread is allowed to start and join workers */
+       for (i = 0; i < workers_num; ++i)
+               workers_data_ptrs [i] = &workers_data [i];
 
-static void
-workers_start_worker (int index)
-{
-       g_assert (index >= 0 && index < workers_num);
+       sgen_thread_pool_init (num_workers, thread_pool_init_func, marker_idle_func, continue_idle_func, workers_data_ptrs);
 
-       g_assert (!workers_data [index].thread);
-       mono_native_thread_create (&workers_data [index].thread, workers_thread_func, &workers_data [index]);
+       mono_counters_register ("# workers finished", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_workers_num_finished);
 }
 
 void
-sgen_workers_start_all_workers (void)
+sgen_workers_start_all_workers (SgenObjectOperations *object_ops)
 {
-       State old_state, new_state;
-       int i;
-       gboolean result;
-
        if (!collection_needs_workers ())
                return;
 
-       if (sgen_get_major_collector ()->init_worker_thread)
-               sgen_get_major_collector ()->init_worker_thread (workers_gc_thread_major_collector_data);
-
-       old_state = new_state = workers_state;
-       assert_not_working (old_state);
-
-       g_assert (workers_job_queue_num_entries == 0);
-       workers_num_jobs_enqueued = 0;
-       workers_num_jobs_finished = 0;
-
-       if (workers_started) {
-               workers_signal_enqueue_work (workers_num, FALSE);
-               return;
-       }
-
-       new_state.data.state = STATE_WORKING;
-       new_state.data.num_awake = workers_num;
-       result = set_state (old_state, new_state);
-       SGEN_ASSERT (0, result, "Nobody else should have modified the state - workers have not been started yet");
-
-       for (i = 0; i < workers_num; ++i)
-               workers_start_worker (i);
+       idle_func_object_ops = object_ops;
+       mono_memory_write_barrier ();
 
-       workers_started = TRUE;
-}
-
-gboolean
-sgen_workers_have_started (void)
-{
-       return workers_started;
+       workers_signal_enqueue_work (FALSE);
 }
 
 void
 sgen_workers_join (void)
 {
-       State old_state;
        int i;
 
+       SGEN_ASSERT (0, workers_state != STATE_NURSERY_COLLECTION, "Can't be in nursery collection when joining");
+
        if (!collection_needs_workers ())
                return;
 
-       for (;;) {
-               old_state = workers_state;
-               SGEN_ASSERT (0, old_state.data.state != STATE_NURSERY_COLLECTION, "Can't be in nursery collection when joining");
-
-               if (old_state.data.state == STATE_WORKING) {
-                       State new_state = old_state;
-
-                       SGEN_ASSERT (0, !old_state.data.post_done, "Why is post_done already set?");
-                       new_state.data.post_done = 1;
-                       if (!set_state (old_state, new_state))
-                               continue;
-
-                       MONO_SEM_WAIT (&workers_done_sem);
-
-                       old_state = workers_state;
-               }
-
-               assert_not_working (old_state);
-
-               /*
-                * Checking whether there is still work left and, if not, going to sleep,
-                * are two separate actions that are not performed atomically by the
-                * workers.  Therefore there's a race condition where work can be added
-                * after they've checked for work, and before they've gone to sleep.
-                */
-               if (!workers_job_queue_num_entries && sgen_section_gray_queue_is_empty (&workers_distribute_gray_queue))
-                       break;
-
-               workers_signal_enqueue_work (workers_num, FALSE);
-       }
+       sgen_thread_pool_wait_for_all_jobs ();
+       sgen_thread_pool_idle_wait ();
+       SGEN_ASSERT (0, workers_state == STATE_NOT_WORKING, "Can only signal enqueue work when in no work state");
 
        /* At this point all the workers have stopped. */
 
-       if (sgen_get_major_collector ()->reset_worker_data) {
-               for (i = 0; i < workers_num; ++i)
-                       sgen_get_major_collector ()->reset_worker_data (workers_data [i].major_collector_data);
-       }
-
-       g_assert (workers_job_queue_num_entries == 0);
-       g_assert (sgen_section_gray_queue_is_empty (&workers_distribute_gray_queue));
+       SGEN_ASSERT (0, sgen_section_gray_queue_is_empty (&workers_distribute_gray_queue), "Why is there still work left to do?");
        for (i = 0; i < workers_num; ++i)
-               g_assert (sgen_gray_object_queue_is_empty (&workers_data [i].private_gray_queue));
+               SGEN_ASSERT (0, sgen_gray_object_queue_is_empty (&workers_data [i].private_gray_queue), "Why is there still work left to do?");
 }
 
 gboolean
 sgen_workers_all_done (void)
 {
-       return workers_state.data.state == STATE_NOT_WORKING;
+       return workers_state == STATE_NOT_WORKING;
 }
 
+/* Must only be used for debugging */
 gboolean
 sgen_workers_are_working (void)
 {
-       State state = workers_state;
-       return state.data.num_awake > 0 || state.data.num_posted > 0;
+       return state_is_working_or_enqueued (workers_state);
 }
 
-gboolean
-sgen_is_worker_thread (MonoNativeThreadId thread)
+void
+sgen_workers_wait (void)
 {
-       int i;
-
-       if (sgen_get_major_collector ()->is_worker_thread && sgen_get_major_collector ()->is_worker_thread (thread))
-               return TRUE;
-
-       for (i = 0; i < workers_num; ++i) {
-               if (workers_data [i].thread == thread)
-                       return TRUE;
-       }
-       return FALSE;
+       sgen_thread_pool_idle_wait ();
+       SGEN_ASSERT (0, sgen_workers_all_done (), "Why are the workers not done after we wait for them?");
 }
 
 SgenSectionGrayQueue*
@@ -626,10 +394,4 @@ sgen_workers_get_distribute_section_gray_queue (void)
        return &workers_distribute_gray_queue;
 }
 
-void
-sgen_workers_reset_data (void)
-{
-       if (sgen_get_major_collector ()->reset_worker_data)
-               sgen_get_major_collector ()->reset_worker_data (workers_gc_thread_major_collector_data);
-}
 #endif
index 5c509de612898c2bb40264c5862b615a46266427..6755f9e36786106cb06256eccce22731358a8f14 100644 (file)
 #ifndef __MONO_SGEN_WORKER_H__
 #define __MONO_SGEN_WORKER_H__
 
+#include "mono/metadata/sgen-thread-pool.h"
+
 typedef struct _WorkerData WorkerData;
 struct _WorkerData {
-       int index;
-       MonoNativeThreadId thread;
-       void *major_collector_data;
-
        SgenGrayQueue private_gray_queue; /* only read/written by worker thread */
 };
 
-typedef void (*JobFunc) (WorkerData *worker_data, void *job_data);
-
-typedef struct _JobQueueEntry JobQueueEntry;
-struct _JobQueueEntry {
-       const char *name;
-       JobFunc func;
-       void *data;
-
-       volatile JobQueueEntry *next;
-};
-
 void sgen_workers_init (int num_workers);
-void sgen_workers_start_all_workers (void);
-gboolean sgen_workers_have_started (void);
+void sgen_workers_start_all_workers (SgenObjectOperations *object_ops);
 void sgen_workers_ensure_awake (void);
 void sgen_workers_init_distribute_gray_queue (void);
-void sgen_workers_enqueue_job (const char *name, JobFunc func, void *data);
+void sgen_workers_enqueue_job (SgenThreadPoolJob *job);
 void sgen_workers_wait_for_jobs_finished (void);
 void sgen_workers_distribute_gray_queue_sections (void);
 void sgen_workers_reset_data (void);
 void sgen_workers_join (void);
 gboolean sgen_workers_all_done (void);
 gboolean sgen_workers_are_working (void);
+void sgen_workers_wait (void);
 SgenSectionGrayQueue* sgen_workers_get_distribute_section_gray_queue (void);
 
 void sgen_workers_signal_start_nursery_collection_and_wait (void);
index a3c2ac0c336bc91921b783d5c028ac31a28182cf..62b66b027d4db094277441f94735d229e35d3480 100644 (file)
@@ -633,8 +633,8 @@ static gint32 get_family_hint(void)
                MonoVTable *vtable;
 
                socket_class = mono_class_from_name (get_socket_assembly (), "System.Net.Sockets", "Socket");
-               ipv4_field = mono_class_get_field_from_name (socket_class, "ipv4Supported");
-               ipv6_field = mono_class_get_field_from_name (socket_class, "ipv6Supported");
+               ipv4_field = mono_class_get_field_from_name (socket_class, "ipv4_supported");
+               ipv6_field = mono_class_get_field_from_name (socket_class, "ipv6_supported");
                vtable = mono_class_vtable (mono_domain_get (), socket_class);
                g_assert (vtable);
                mono_runtime_class_init (vtable);
@@ -1406,7 +1406,7 @@ gint32 ves_icall_System_Net_Sockets_Socket_Receive_array_internal(SOCKET sock, M
        return(recv);
 }
 
-gint32 ves_icall_System_Net_Sockets_Socket_RecvFrom_internal(SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, MonoObject **sockaddr, gint32 *error)
+gint32 ves_icall_System_Net_Sockets_Socket_ReceiveFrom_internal(SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, MonoObject **sockaddr, gint32 *error)
 {
        int ret;
        guchar *buf;
@@ -1573,7 +1573,7 @@ static SOCKET Socket_to_SOCKET(MonoObject *sockobj)
        MonoSafeHandle *safe_handle;
        MonoClassField *field;
        
-       field = mono_class_get_field_from_name (sockobj->vtable->klass, "socket");
+       field = mono_class_get_field_from_name (sockobj->vtable->klass, "safe_handle");
        safe_handle = ((MonoSafeHandle*) (*(gpointer *)(((char *)sockobj)+field->offset)));
 
        if (safe_handle == NULL)
@@ -2198,7 +2198,7 @@ void ves_icall_System_Net_Sockets_Socket_Shutdown_internal(SOCKET sock,
 }
 
 gint
-ves_icall_System_Net_Sockets_Socket_WSAIoctl (SOCKET sock, gint32 code,
+ves_icall_System_Net_Sockets_Socket_IOControl_internal (SOCKET sock, gint32 code,
                                              MonoArray *input,
                                              MonoArray *output, gint32 *error)
 {
@@ -2372,6 +2372,8 @@ MonoBoolean ves_icall_System_Net_Dns_GetHostByName_internal(MonoString *host, Mo
        gchar this_hostname [256];
        MonoAddressInfo *info = NULL;
        char *hostname = mono_string_to_utf8 (host);
+       int hint = get_addrinfo_family_hint ();
+
        MONO_PREPARE_BLOCKING
 
        if (*hostname == '\0') {
@@ -2385,7 +2387,7 @@ MonoBoolean ves_icall_System_Net_Dns_GetHostByName_internal(MonoString *host, Mo
                }
        }
 
-       if (*hostname && mono_get_address_info (hostname, 0, MONO_HINT_CANONICAL_NAME | get_addrinfo_family_hint (), &info))
+       if (*hostname && mono_get_address_info (hostname, 0, MONO_HINT_CANONICAL_NAME | hint, &info))
                add_info_ok = FALSE;
 
        g_free(hostname);
@@ -2405,6 +2407,10 @@ extern MonoBoolean ves_icall_System_Net_Dns_GetHostByAddr_internal(MonoString *a
        gint32 family;
        char hostname[NI_MAXHOST] = {0};
        int flags = 0;
+       int hint = get_addrinfo_family_hint ();
+       gboolean add_info_ok;
+
+       MONO_PREPARE_BLOCKING
 
        address = mono_string_to_utf8 (addr);
 
@@ -2445,10 +2451,13 @@ extern MonoBoolean ves_icall_System_Net_Dns_GetHostByAddr_internal(MonoString *a
                }
        }
 
-       if (mono_get_address_info (hostname, 0, get_addrinfo_family_hint () | MONO_HINT_CANONICAL_NAME | MONO_HINT_CONFIGURED_ONLY, &info))
-               return FALSE;
+       add_info_ok = !mono_get_address_info (hostname, 0, hint | MONO_HINT_CANONICAL_NAME | MONO_HINT_CONFIGURED_ONLY, &info);
+       MONO_FINISH_BLOCKING
+
+       if (add_info_ok)
+               return addrinfo_to_IPHostEntry (info, h_name, h_aliases, h_addr_list, FALSE);
 
-       return(addrinfo_to_IPHostEntry (info, h_name, h_aliases, h_addr_list, FALSE));
+       return FALSE;
 }
 
 extern MonoBoolean ves_icall_System_Net_Dns_GetHostName_internal(MonoString **h_name)
@@ -2467,7 +2476,7 @@ extern MonoBoolean ves_icall_System_Net_Dns_GetHostName_internal(MonoString **h_
 }
 
 gboolean
-ves_icall_System_Net_Sockets_Socket_SendFile (SOCKET sock, MonoString *filename, MonoArray *pre_buffer, MonoArray *post_buffer, gint flags)
+ves_icall_System_Net_Sockets_Socket_SendFile_internal (SOCKET sock, MonoString *filename, MonoArray *pre_buffer, MonoArray *post_buffer, gint flags)
 {
        HANDLE file;
        gint32 error;
index 3f2dd85a5ad2b359adf743b42ee46a8d3e1c05f0..6eda7248c613ff474d8a645b63401fec4cd7dd45 100644 (file)
@@ -204,7 +204,7 @@ extern void ves_icall_System_Net_Sockets_Socket_Bind_internal(SOCKET sock, MonoO
 extern void ves_icall_System_Net_Sockets_Socket_Connect_internal(SOCKET sock, MonoObject *sockaddr, gint32 *error);
 extern gint32 ves_icall_System_Net_Sockets_Socket_Receive_internal(SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, gint32 *error);
 extern gint32 ves_icall_System_Net_Sockets_Socket_Receive_array_internal(SOCKET sock, MonoArray *buffers, gint32 flags, gint32 *error);
-extern gint32 ves_icall_System_Net_Sockets_Socket_RecvFrom_internal(SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, MonoObject **sockaddr, gint32 *error);
+extern gint32 ves_icall_System_Net_Sockets_Socket_ReceiveFrom_internal(SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, MonoObject **sockaddr, gint32 *error);
 extern gint32 ves_icall_System_Net_Sockets_Socket_Send_internal(SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, gint32 *error);
 extern gint32 ves_icall_System_Net_Sockets_Socket_Send_array_internal(SOCKET sock, MonoArray *buffers, gint32 flags, gint32 *error);
 extern gint32 ves_icall_System_Net_Sockets_Socket_SendTo_internal(SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, MonoObject *sockaddr, gint32 *error);
@@ -213,13 +213,13 @@ extern void ves_icall_System_Net_Sockets_Socket_Shutdown_internal(SOCKET sock, g
 extern void ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal(SOCKET sock, gint32 level, gint32 name, MonoObject **obj_val, gint32 *error);
 extern void ves_icall_System_Net_Sockets_Socket_GetSocketOption_arr_internal(SOCKET sock, gint32 level, gint32 name, MonoArray **byte_val, gint32 *error);
 extern void ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal(SOCKET sock, gint32 level, gint32 name, MonoObject *obj_val, MonoArray *byte_val, gint32 int_val, gint32 *error);
-extern int ves_icall_System_Net_Sockets_Socket_WSAIoctl (SOCKET sock, gint32 code, MonoArray *input, MonoArray *output, gint32 *error);
+extern int ves_icall_System_Net_Sockets_Socket_IOControl_internal (SOCKET sock, gint32 code, MonoArray *input, MonoArray *output, gint32 *error);
 extern MonoBoolean ves_icall_System_Net_Dns_GetHostByName_internal(MonoString *host, MonoString **h_name, MonoArray **h_aliases, MonoArray **h_addr_list);
 extern MonoBoolean ves_icall_System_Net_Dns_GetHostByAddr_internal(MonoString *addr, MonoString **h_name, MonoArray **h_aliases, MonoArray **h_addr_list);
 extern MonoBoolean ves_icall_System_Net_Dns_GetHostName_internal(MonoString **h_name);
 extern MonoBoolean ves_icall_System_Net_Sockets_Socket_Poll_internal (SOCKET sock, gint mode, gint timeout, gint32 *error);
 extern void ves_icall_System_Net_Sockets_Socket_Disconnect_internal(SOCKET sock, MonoBoolean reuse, gint32 *error);
-extern gboolean ves_icall_System_Net_Sockets_Socket_SendFile (SOCKET sock, MonoString *filename, MonoArray *pre_buffer, MonoArray *post_buffer, gint flags);
+extern gboolean ves_icall_System_Net_Sockets_Socket_SendFile_internal (SOCKET sock, MonoString *filename, MonoArray *pre_buffer, MonoArray *post_buffer, gint flags);
 void icall_cancel_blocking_socket_operation (MonoThread *thread);
 
 extern void mono_network_init(void);
index 5bc9830d515aa9895ca7b8ce6b3fb525cd2fce5b..772a2fe5c6cef28614acadbf5c93efc698131fc5 100644 (file)
@@ -259,7 +259,7 @@ epoll_init (void)
 #ifdef EPOOL_CLOEXEC
        threadpool_io->epoll.fd = epoll_create1 (EPOLL_CLOEXEC);
 #else
-       threadpool_io->epoll.fd = epoll_create1 (256);
+       threadpool_io->epoll.fd = epoll_create (256);
        fcntl (threadpool_io->epoll.fd, F_SETFD, FD_CLOEXEC);
 #endif
 
@@ -1062,43 +1062,39 @@ ensure_cleanedup (void)
        io_status = STATUS_CLEANED_UP;
 }
 
-gboolean
-mono_threadpool_ms_is_io (MonoObject *target, MonoObject *state)
+static gboolean
+is_socket_async_callback (MonoImage *system_image, MonoClass *class)
 {
-       static MonoClass *socket_class = NULL;
-       static MonoClass *socket_async_class = NULL;
-       static MonoClass *process_class = NULL;
-       static MonoClass *async_read_handler_class = NULL;
-       MonoClass *class;
-       MonoSocketAsyncResult *sockares;
+       MonoClass *socket_async_callback_class = NULL;
 
-       if (!mono_defaults.system)
-               mono_defaults.system = mono_image_loaded ("System");
-       if (!mono_defaults.system)
-               return FALSE;
-       g_assert (mono_defaults.system);
+       socket_async_callback_class = mono_class_from_name (system_image, "System.Net.Sockets", "SocketAsyncCallback");
+       g_assert (socket_async_callback_class);
 
-       if (!socket_class)
-               socket_class = mono_class_from_name (mono_defaults.system, "System.Net.Sockets", "Socket");
-       g_assert (socket_class);
+       return class == socket_async_callback_class;
+}
+
+static gboolean
+is_async_read_handler (MonoImage *system_image, MonoClass *class)
+{
+       MonoClass *process_class = NULL;
 
-       if (!process_class)
-               process_class = mono_class_from_name (mono_defaults.system, "System.Diagnostics", "Process");
+       process_class = mono_class_from_name (system_image, "System.Diagnostics", "Process");
        g_assert (process_class);
 
-       class = target->vtable->klass;
+       return class->nested_in && class->nested_in == process_class && strcmp (class->name, "AsyncReadHandler") == 0;
+}
 
-       if (!socket_async_class) {
-               if (class->nested_in && class->nested_in == socket_class && strcmp (class->name, "SocketAsyncCall") == 0)
-                       socket_async_class = class;
-       }
+gboolean
+mono_threadpool_ms_is_io (MonoObject *target, MonoObject *state)
+{
+       MonoImage *system_image;
+       MonoSocketAsyncResult *sockares;
 
-       if (!async_read_handler_class) {
-               if (class->nested_in && class->nested_in == process_class && strcmp (class->name, "AsyncReadHandler") == 0)
-                       async_read_handler_class = class;
-       }
+       system_image = mono_image_loaded ("System");
+       if (!system_image)
+               return FALSE;
 
-       if (class != socket_async_class && class != async_read_handler_class)
+       if (!is_socket_async_callback (system_image, target->vtable->klass) && !is_async_read_handler (system_image, target->vtable->klass))
                return FALSE;
 
        sockares = (MonoSocketAsyncResult*) state;
@@ -1237,17 +1233,16 @@ mono_threadpool_ms_io_remove_domain_jobs (MonoDomain *domain)
 void
 mono_threadpool_io_enqueue_socket_async_result (MonoDomain *domain, MonoSocketAsyncResult *sockares)
 {
-       static MonoClass *socket_runtime_work_item_class = NULL;
+       MonoImage *system_image;
+       MonoClass *socket_runtime_work_item_class;
        MonoSocketRuntimeWorkItem *srwi;
 
        g_assert (sockares);
 
-       if (!mono_defaults.system)
-               mono_defaults.system = mono_image_loaded ("System");
-       g_assert (mono_defaults.system);
+       system_image = mono_image_loaded ("System");
+       g_assert (system_image);
 
-       if (!socket_runtime_work_item_class)
-               socket_runtime_work_item_class = mono_class_from_name (mono_defaults.system, "System.Net.Sockets", "MonoSocketRuntimeWorkItem");
+       socket_runtime_work_item_class = mono_class_from_name (system_image, "System.Net.Sockets", "MonoSocketRuntimeWorkItem");
        g_assert (socket_runtime_work_item_class);
 
        srwi = (MonoSocketRuntimeWorkItem*) mono_object_new (domain, socket_runtime_work_item_class);
index 529f46e59119b01b870fb3fad2e0c71205647e41..6793ca7b045897fd9fe9ea8a54e3ef312e989849 100644 (file)
 
 #include <stdlib.h>
 #include <math.h>
+#include <config.h>
+#include <glib.h>
 
-#ifdef PLATFORM_ANDROID
+#if !defined (HAVE_COMPLEX_H)
 #include <../../support/libm/complex.h>
 #else
 #include <complex.h>
 #endif
 
-#include <config.h>
-#include <glib.h>
-
 #include <mono/metadata/class-internals.h>
 #include <mono/metadata/exception.h>
+#include <mono/metadata/gc-internal.h>
 #include <mono/metadata/object.h>
 #include <mono/metadata/object-internals.h>
 #include <mono/metadata/threadpool-ms.h>
@@ -238,7 +238,7 @@ rand_free (gpointer handle)
 }
 
 static void
-ensure_initialized (gboolean *enable_worker_tracking)
+ensure_initialized (MonoBoolean *enable_worker_tracking)
 {
        ThreadPoolHillClimbing *hc;
        const char *threads_per_cpu_env;
@@ -419,7 +419,7 @@ mono_threadpool_ms_enqueue_work_item (MonoDomain *domain, MonoObject *work_item)
        f = FALSE;
 
        args [0] = (gpointer) work_item;
-       args [1] = (gpointer) mono_value_box (domain, mono_defaults.boolean_class, &f);
+       args [1] = (gpointer) &f;
 
        current_domain = mono_domain_get ();
        if (current_domain == domain) {
@@ -703,7 +703,9 @@ worker_thread (gpointer data)
 
                                if (park) {
                                        mono_mutex_unlock (&threadpool->domains_lock);
+                                       mono_gc_set_skip_thread (TRUE);
                                        worker_park ();
+                                       mono_gc_set_skip_thread (FALSE);
                                        mono_mutex_lock (&threadpool->domains_lock);
 
                                        COUNTER_ATOMIC (counter, {
@@ -824,6 +826,8 @@ monitor_thread (void)
 
                g_assert (monitor_status != MONITOR_STATUS_NOT_RUNNING);
 
+               mono_gc_set_skip_thread (TRUE);
+
                do {
                        guint32 ts;
 
@@ -839,6 +843,8 @@ monitor_thread (void)
                                mono_thread_interruption_checkpoint ();
                } while (interval_left > 0 && ++awake < 10);
 
+               mono_gc_set_skip_thread (FALSE);
+
                if (threadpool->suspended)
                        continue;
 
@@ -1318,7 +1324,9 @@ mono_threadpool_ms_finish (MonoAsyncResult *ares, MonoArray **out_args, MonoObje
                        MONO_OBJECT_SETREF (ares, handle, (MonoObject*) mono_wait_handle_new (mono_object_domain (ares), wait_event));
                }
                mono_monitor_exit ((MonoObject*) ares);
+               MONO_PREPARE_BLOCKING
                WaitForSingleObjectEx (wait_event, INFINITE, TRUE);
+               MONO_FINISH_BLOCKING
        }
 
        ac = (MonoAsyncCall*) ares->object_data;
@@ -1364,7 +1372,9 @@ mono_threadpool_ms_remove_domain_jobs (MonoDomain *domain, int timeout)
        mono_memory_write_barrier ();
 
        while (domain->threadpool_jobs) {
+               MONO_PREPARE_BLOCKING
                WaitForSingleObject (sem, timeout);
+               MONO_FINISH_BLOCKING
                if (timeout != -1) {
                        timeout -= mono_msec_ticks () - start;
                        if (timeout <= 0) {
@@ -1443,7 +1453,7 @@ ves_icall_System_Threading_Microsoft_ThreadPool_GetMaxThreadsNative (gint *worke
        *completion_port_threads = threadpool->limit_io_max;
 }
 
-gboolean
+MonoBoolean
 ves_icall_System_Threading_Microsoft_ThreadPool_SetMinThreadsNative (gint worker_threads, gint completion_port_threads)
 {
        ensure_initialized (NULL);
@@ -1459,7 +1469,7 @@ ves_icall_System_Threading_Microsoft_ThreadPool_SetMinThreadsNative (gint worker
        return TRUE;
 }
 
-gboolean
+MonoBoolean
 ves_icall_System_Threading_Microsoft_ThreadPool_SetMaxThreadsNative (gint worker_threads, gint completion_port_threads)
 {
        gint cpu_count = mono_cpu_count ();
@@ -1478,12 +1488,12 @@ ves_icall_System_Threading_Microsoft_ThreadPool_SetMaxThreadsNative (gint worker
 }
 
 void
-ves_icall_System_Threading_Microsoft_ThreadPool_InitializeVMTp (gboolean *enable_worker_tracking)
+ves_icall_System_Threading_Microsoft_ThreadPool_InitializeVMTp (MonoBoolean *enable_worker_tracking)
 {
        ensure_initialized (enable_worker_tracking);
 }
 
-gboolean
+MonoBoolean
 ves_icall_System_Threading_Microsoft_ThreadPool_NotifyWorkItemComplete (void)
 {
        ThreadPoolCounter counter;
@@ -1510,14 +1520,35 @@ ves_icall_System_Threading_Microsoft_ThreadPool_NotifyWorkItemProgressNative (vo
 }
 
 void
-ves_icall_System_Threading_Microsoft_ThreadPool_ReportThreadStatus (gboolean is_working)
+ves_icall_System_Threading_Microsoft_ThreadPool_ReportThreadStatus (MonoBoolean is_working)
 {
        // TODO
        mono_raise_exception (mono_get_exception_not_implemented (NULL));
 }
 
-gboolean
+MonoBoolean
 ves_icall_System_Threading_Microsoft_ThreadPool_RequestWorkerThread (void)
 {
        return worker_request (mono_domain_get ());
 }
+
+MonoBoolean G_GNUC_UNUSED
+ves_icall_System_Threading_Microsoft_ThreadPool_PostQueuedCompletionStatus (MonoNativeOverlapped *native_overlapped)
+{
+       /* This copy the behavior of the current Mono implementation */
+       mono_raise_exception (mono_get_exception_not_implemented (NULL));
+       return FALSE;
+}
+
+MonoBoolean G_GNUC_UNUSED
+ves_icall_System_Threading_Microsoft_ThreadPool_BindIOCompletionCallbackNative (gpointer file_handle)
+{
+       /* This copy the behavior of the current Mono implementation */
+       return TRUE;
+}
+
+MonoBoolean G_GNUC_UNUSED
+ves_icall_System_Threading_Microsoft_ThreadPool_IsThreadPoolHosted (void)
+{
+       return FALSE;
+}
index 3f579faa178e31ddf3c8a008a0cc7ed7bbcbe80a..5768b159045301a93ddc6892c7beeb1da516a8dd 100644 (file)
@@ -19,13 +19,13 @@ enum {
 typedef struct _MonoRuntimeWorkItem MonoRuntimeWorkItem;
 typedef struct _MonoNativeOverlapped MonoNativeOverlapped;
 
-static void
+static void G_GNUC_UNUSED
 mono_threadpool_ms_init (void)
 {
        /* Initialization is done lazily */
 }
 
-static void
+static void G_GNUC_UNUSED
 mono_threadpool_ms_init_tls (void)
 {
        /* The WSQ is now implemented in managed */
@@ -47,7 +47,7 @@ mono_threadpool_ms_suspend (void);
 void
 mono_threadpool_ms_resume (void);
 
-static gboolean
+static gboolean G_GNUC_UNUSED
 mono_threadpool_ms_is_queue_array (MonoArray *arr)
 {
        /* The queue is in managed code */
@@ -63,41 +63,29 @@ void
 ves_icall_System_Threading_Microsoft_ThreadPool_GetMinThreadsNative (gint *worker_threads, gint *completion_port_threads);
 void
 ves_icall_System_Threading_Microsoft_ThreadPool_GetMaxThreadsNative (gint *worker_threads, gint *completion_port_threads);
-gboolean
+MonoBoolean
 ves_icall_System_Threading_Microsoft_ThreadPool_SetMinThreadsNative (gint worker_threads, gint completion_port_threads);
-gboolean
+MonoBoolean
 ves_icall_System_Threading_Microsoft_ThreadPool_SetMaxThreadsNative (gint worker_threads, gint completion_port_threads);
 void
-ves_icall_System_Threading_Microsoft_ThreadPool_InitializeVMTp (gboolean *enable_worker_tracking);
-gboolean
+ves_icall_System_Threading_Microsoft_ThreadPool_InitializeVMTp (MonoBoolean *enable_worker_tracking);
+MonoBoolean
 ves_icall_System_Threading_Microsoft_ThreadPool_NotifyWorkItemComplete (void);
 void
 ves_icall_System_Threading_Microsoft_ThreadPool_NotifyWorkItemProgressNative (void);
 void
-ves_icall_System_Threading_Microsoft_ThreadPool_ReportThreadStatus (gboolean is_working);
-gboolean
+ves_icall_System_Threading_Microsoft_ThreadPool_ReportThreadStatus (MonoBoolean is_working);
+MonoBoolean
 ves_icall_System_Threading_Microsoft_ThreadPool_RequestWorkerThread (void);
 
-static gboolean
-ves_icall_System_Threading_Microsoft_ThreadPool_PostQueuedCompletionStatus (MonoNativeOverlapped *native_overlapped)
-{
-       /* This copy the behavior of the current Mono implementation */
-       mono_raise_exception (mono_get_exception_not_implemented (NULL));
-       return FALSE;
-}
+MonoBoolean
+ves_icall_System_Threading_Microsoft_ThreadPool_PostQueuedCompletionStatus (MonoNativeOverlapped *native_overlapped);
 
-static gboolean
-ves_icall_System_Threading_Microsoft_ThreadPool_BindIOCompletionCallbackNative (gpointer file_handle)
-{
-       /* This copy the behavior of the current Mono implementation */
-       return TRUE;
-}
+MonoBoolean
+ves_icall_System_Threading_Microsoft_ThreadPool_BindIOCompletionCallbackNative (gpointer file_handle);
 
-static gboolean
-ves_icall_System_Threading_Microsoft_ThreadPool_IsThreadPoolHosted (void)
-{
-       return FALSE;
-}
+MonoBoolean
+ves_icall_System_Threading_Microsoft_ThreadPool_IsThreadPoolHosted (void);
 
 /* Internals */
 
@@ -106,4 +94,4 @@ mono_threadpool_ms_enqueue_async_result (MonoDomain *domain, MonoAsyncResult *as
 void
 mono_threadpool_ms_enqueue_work_item (MonoDomain *domain, MonoObject *work_item);
 
-#endif // _MONO_THREADPOOL_MICROSOFT_H_
\ No newline at end of file
+#endif // _MONO_THREADPOOL_MICROSOFT_H_
index c32a0700a72034a75437a38b59f041d925035275..8f9ce57f149eca6ee934c6429ecabdf356a08f57 100644 (file)
@@ -213,16 +213,6 @@ is_corlib_type (MonoDomain *domain, MonoClass *klass)
        return klass->image == mono_defaults.corlib;
 }
 
-/*
- * Note that we call it is_socket_type() where 'socket' refers to the image
- * that contains the System.Net.Sockets.Socket type.
-*/
-static gboolean
-is_socket_type (MonoDomain *domain, MonoClass *klass)
-{
-       return is_system_type (domain, klass);
-}
-
 #define check_type_cached(domain, ASSEMBLY, _class, _namespace, _name, loc) do { \
        if (*loc) \
                return *loc == _class; \
@@ -235,8 +225,6 @@ is_socket_type (MonoDomain *domain, MonoClass *klass)
 
 #define check_corlib_type_cached(domain, _class, _namespace, _name, loc) check_type_cached (domain, corlib, _class, _namespace, _name, loc)
 
-#define check_socket_type_cached(domain, _class, _namespace, _name, loc) check_type_cached (domain, socket, _class, _namespace, _name, loc)
-
 #define check_system_type_cached(domain, _class, _namespace, _name, loc) check_type_cached (domain, system, _class, _namespace, _name, loc)
 
 static gboolean
@@ -245,26 +233,18 @@ is_corlib_asyncresult (MonoDomain *domain, MonoClass *klass)
        check_corlib_type_cached (domain, klass, "System.Runtime.Remoting.Messaging", "AsyncResult", &domain->corlib_asyncresult_class);
 }
 
-static gboolean
-is_socket (MonoDomain *domain, MonoClass *klass)
-{
-       check_socket_type_cached (domain, klass, "System.Net.Sockets", "Socket", &domain->socket_class);
-}
-
 static gboolean
 is_socketasyncresult (MonoDomain *domain, MonoClass *klass)
 {
-       return (klass->nested_in &&
-                       is_socket (domain, klass->nested_in) &&
-                       !strcmp (klass->name, "SocketAsyncResult"));
+       static MonoClass *socket_async_result_klass = NULL;
+       check_system_type_cached (domain, klass, "System.Net.Sockets", "SocketAsyncResult", &socket_async_result_klass);
 }
 
 static gboolean
 is_socketasynccall (MonoDomain *domain, MonoClass *klass)
 {
-       return (klass->nested_in &&
-                       is_socket (domain, klass->nested_in) &&
-                       !strcmp (klass->name, "SocketAsyncCall"));
+       static MonoClass *socket_async_callback_klass = NULL;
+       check_system_type_cached (domain, klass, "System.Net.Sockets", "SocketAsyncCallback", &socket_async_callback_klass);
 }
 
 static gboolean
@@ -850,6 +830,7 @@ monitor_thread (gpointer unused)
        while (1) {
                ms = SAMPLES_PERIOD;
                i = 10; //number of spurious awakes we tolerate before doing a round of rebalancing.
+               mono_gc_set_skip_thread (TRUE);
                do {
                        guint32 ts;
                        ts = mono_msec_ticks ();
@@ -858,9 +839,9 @@ monitor_thread (gpointer unused)
                        ms -= (mono_msec_ticks () - ts);
                        if (mono_runtime_is_shutting_down ())
                                break;
-                       if (THREAD_WANTS_A_BREAK (thread))
-                               mono_thread_interruption_checkpoint ();
+                       check_for_interruption_critical ();
                } while (ms > 0 && i--);
+               mono_gc_set_skip_thread (FALSE);
 
                if (mono_runtime_is_shutting_down ())
                        break;
@@ -1093,7 +1074,9 @@ mono_thread_pool_finish (MonoAsyncResult *ares, MonoArray **out_args, MonoObject
                        wait_event = mono_wait_handle_get_handle ((MonoWaitHandle *) ares->handle);
                }
                mono_monitor_exit ((MonoObject *) ares);
+               MONO_PREPARE_BLOCKING
                WaitForSingleObjectEx (wait_event, INFINITE, TRUE);
+               MONO_FINISH_BLOCKING
        } else {
                mono_monitor_exit ((MonoObject *) ares);
        }
@@ -1368,7 +1351,9 @@ mono_thread_pool_remove_domain_jobs (MonoDomain *domain, int timeout)
        if (domain->threadpool_jobs && timeout != -1)
                start_time = mono_msec_ticks ();
        while (domain->threadpool_jobs) {
+               MONO_PREPARE_BLOCKING
                WaitForSingleObject (sem_handle, timeout);
+               MONO_FINISH_BLOCKING
                if (timeout != -1 && (mono_msec_ticks () - start_time) > timeout) {
                        result = FALSE;
                        break;
@@ -1467,7 +1452,9 @@ try_steal (MonoWSQ *local_wsq, gpointer *data, gboolean retry)
                if (mono_runtime_is_shutting_down ())
                        return;
 
+               MONO_PREPARE_BLOCKING
                mono_mutex_lock (&wsqs_lock);
+               MONO_FINISH_BLOCKING
                for (i = 0; wsqs != NULL && i < wsqs->len; i++) {
                        MonoWSQ *wsq;
 
index 6af48dbd3186d360e902d68c9d782857d07be704..a2b1a03ec3b2b469ddcda236d91167285cbe4ed1 100644 (file)
@@ -126,8 +126,8 @@ typedef struct {
 #define UICULTURES_START_IDX NUM_CACHED_CULTURES
 
 /* Controls access to the 'threads' hash table */
-#define mono_threads_lock() mono_mutex_lock (&threads_mutex)
-#define mono_threads_unlock() mono_mutex_unlock (&threads_mutex)
+static void mono_threads_lock (void);
+static void mono_threads_unlock (void);
 static mono_mutex_t threads_mutex;
 
 /* Controls access to context static data */
@@ -228,6 +228,22 @@ static gboolean shutting_down = FALSE;
 
 static gint32 managed_thread_id_counter = 0;
 
+
+static void
+mono_threads_lock (void)
+{
+       MONO_TRY_BLOCKING
+       mono_locks_acquire (&threads_mutex, ThreadsLock);
+       MONO_FINISH_TRY_BLOCKING
+}
+
+static void
+mono_threads_unlock (void)
+{
+       mono_locks_release (&threads_mutex, ThreadsLock);
+}
+
+
 static guint32
 get_next_managed_thread_id (void)
 {
@@ -362,7 +378,10 @@ lock_thread (MonoInternalThread *thread)
                ensure_synch_cs_set (thread);
 
        g_assert (thread->synch_cs);
+
+       MONO_TRY_BLOCKING
        mono_mutex_lock (thread->synch_cs);
+       MONO_FINISH_TRY_BLOCKING
 }
 
 static inline void
@@ -434,7 +453,7 @@ static void thread_cleanup (MonoInternalThread *thread)
                }
                /* This needs to be called even if handle_remove () fails */
                if (mono_thread_cleanup_fn)
-                       mono_thread_cleanup_fn (thread->tid);
+                       mono_thread_cleanup_fn ((MonoNativeThreadId)thread->tid);
                return;
        }
        mono_release_type_locks (thread);
@@ -461,7 +480,7 @@ static void thread_cleanup (MonoInternalThread *thread)
        thread->appdomain_refs = NULL;
 
        if (mono_thread_cleanup_fn)
-               mono_thread_cleanup_fn (thread->tid);
+               mono_thread_cleanup_fn ((MonoNativeThreadId)thread->tid);
 
        if (mono_gc_is_moving ()) {
                MONO_GC_UNREGISTER_ROOT (thread->thread_pinning_ref);
@@ -2704,7 +2723,9 @@ static void wait_for_tids (struct wait_data *wait, guint32 timeout)
        
        THREAD_DEBUG (g_message("%s: %d threads to wait for in this batch", __func__, wait->num));
 
+       MONO_PREPARE_BLOCKING
        ret=WaitForMultipleObjectsEx(wait->num, wait->handles, TRUE, timeout, TRUE);
+       MONO_FINISH_BLOCKING
 
        if(ret==WAIT_FAILED) {
                /* See the comment in build_wait_tids() */
@@ -2765,7 +2786,9 @@ static void wait_for_tids_or_state_change (struct wait_data *wait, guint32 timeo
                count++;
        }
 
+       MONO_PREPARE_BLOCKING
        ret=WaitForMultipleObjectsEx (count, wait->handles, FALSE, timeout, TRUE);
+       MONO_FINISH_BLOCKING
 
        if(ret==WAIT_FAILED) {
                /* See the comment in build_wait_tids() */
@@ -3163,7 +3186,10 @@ void mono_thread_suspend_all_other_threads (void)
 
                /*Only wait on the suspend event if we are using the old path */
                if (eventidx > 0 && !mono_thread_info_new_interrupt_enabled ()) {
+                       MONO_PREPARE_BLOCKING
                        WaitForMultipleObjectsEx (eventidx, events, TRUE, 100, FALSE);
+                       MONO_FINISH_BLOCKING
+
                        for (i = 0; i < wait->num; ++i) {
                                MonoInternalThread *thread = wait->threads [i];
 
@@ -4774,8 +4800,10 @@ self_suspend_internal (MonoInternalThread *thread)
                        for (;;)
                                Sleep (1000);
                }
-               
+
+               MONO_PREPARE_BLOCKING
                WaitForSingleObject (thread->suspend_event, INFINITE);
+               MONO_FINISH_BLOCKING
                
                LOCK_THREAD (thread);
 
@@ -4816,7 +4844,10 @@ resume_thread_internal (MonoInternalThread *thread)
                UNLOCK_THREAD (thread);
 
                /* Wait for the thread to awake */
+               MONO_PREPARE_BLOCKING
                WaitForSingleObject (thread->resume_event, INFINITE);
+               MONO_FINISH_BLOCKING
+
                CloseHandle (thread->resume_event);
                thread->resume_event = NULL;
                return TRUE;
index 794512a093d1c7df389ece26bc218b4f286b53e9..95bba7dd6107728c2aad66d429e68c34e64e5d89 100755 (executable)
@@ -658,7 +658,7 @@ rcheck: mono $(regtests)
 if NACL_CODEGEN
        for i in $(regtests); do echo "running test $$i"; $(RUNTIME) $$i --exclude 'NaClDisable' || exit 1; done
 else
-       -($(RUNTIME) --regression $(regtests); echo $$? > regressionexitcode.out) | ./emitnunit.pl
+       -($(RUNTIME) --regression $(regtests); echo $$? > regressionexitcode.out) | $(srcdir)/emitnunit.pl
        exit $$(cat regressionexitcode.out)
 endif
 
@@ -667,9 +667,9 @@ rcheck2: mono $(regtests)
 
 check-seq-points: mono $(regtests)
        rm -f TestResults_op_il_seq_point.xml
-       for i in $(regtests); do ./test_op_il_seq_point.sh $$i || (./test_op_il_seq_point_headerfooter.sh; exit 1) || exit 1; done
-       for i in $(regtests); do ./test_op_il_seq_point.sh $$i --aot || (./test_op_il_seq_point_headerfooter.sh; exit 1) || exit 1; done
-       ./test_op_il_seq_point_headerfooter.sh
+       for i in $(regtests); do $(srcdir)/test_op_il_seq_point.sh $$i || ($(srcdir)/test_op_il_seq_point_headerfooter.sh; exit 1) || exit 1; done
+       for i in $(regtests); do $(srcdir)/test_op_il_seq_point.sh $$i --aot || ($(srcdir)/test_op_il_seq_point_headerfooter.sh; exit 1) || exit 1; done
+       $(srcdir)/test_op_il_seq_point_headerfooter.sh
 
 gctest: mono gc-test.exe
        MONO_DEBUG_OPTIONS=clear-nursery-at-gc $(RUNTIME) --regression gc-test.exe
@@ -740,6 +740,7 @@ BUILT_SOURCES = version.h $(arch_built)
 CLEANFILES= $(BUILT_SOURCES) *.exe *.dll
 EXTRA_DIST = TestDriver.cs \
        genmdesc.pl                             \
+       emitnunit.pl                    \
        $(test_sources)                         \
        $(x86_sources) cpu-x86.md               \
        $(amd64_sources) cpu-amd64.md           \
@@ -774,6 +775,11 @@ patch-libtool:
        sed -e 's,if (for obj in $$oldobjs,if (for obj in "",g' < ../../libtool > 2; mv 2 ../../libtool
        chmod a+x ../../libtool
 
+# Utility target for patching libtool to get rid of the 'ranlib: file <file> has no symbols" warnings
+patch-libtool-osx:
+       sed -e 's/old_archive_cmds=.*/old_archive_cmds="libtool -no_warning_for_no_symbols -static -o \\$$oldlib \\$$oldobjs"/g' < ../../libtool > 2; mv 2 ../../libtool
+       chmod a+x ../../libtool
+
 # Utility target to patch automake to generate the same format silent output as the old mono silent build did
 patch-automake:
        src="@echo \"  '. \$$name . ' ' x (8 - length (\$$name)) . '\""; dst="@echo \"'. \$$name . ' ' x (7 - length (\$$name)) .'\""; sed -e "s/$$src/$$dst/g" < $$EXE > 2 && cp 2 $$EXE && rm -f 2
diff --git a/mono/mini/README b/mono/mini/README
deleted file mode 100644 (file)
index 7a64e0a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Mini is the new JIT compiler for Mono.
diff --git a/mono/mini/TODO b/mono/mini/TODO
deleted file mode 100644 (file)
index d214318..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-* use a pool of MBState structures to speedup monoburg instead of using a
-  mempool.
-* the decode tables in the burg-generated could use short instead of int
-  (this should save about 1 KB)
-* track the use of ESP, so that we can avoid the x86_lea in the epilog
-
-
-Other Ideas:
-
-* the ORP people avoids optimizations inside catch handlers - just to save
-  memory (for example allocation of strings - instead they allocate strings when
-  the code is executed (like the --shared option)). But there are only a few
-  functions using catch handlers, so I consider this a minor issue.
-
-* some performance critical functions should be inlined. These include:
-       - mono_mempool_alloc and mono_mempool_alloc0
-       - EnterCriticalSection and LeaveCriticalSection
-       - TlsSetValue
-       - mono_metadata_row_col
-       - mono_g_hash_table_lookup
-       - mono_domain_get
-
-* if a function which involves locking is called from another function which
-  acquires the same lock, it might be useful to create a separate _inner 
-  version of the function which does not re-acquire the lock. This is a perf
-  win only if the function is called a lot of times, like mono_get_method.
-
-* we can avoid calls to class init trampolines if the are multiple calls to the
-  same trampoline in the same basic block. See:
-
-  http://bugzilla.ximian.com/show_bug.cgi?id=51096
-
-Usability
----------
-
-* Remove the various optimization list of flags description, have an 
-  extra --help-optimizations flag.
-
-* Remove the various graph options, have a separate --help-graph for 
-  that list.
-
-Cleanup
--------
-
-Clean up the usage of the various CEE_/OP_ constants inside the JIT. 
-
-Currently, there are the 5 variants for each opcode:
-- CEE_...
-- OP_...
-- OP_I...
-- OP_L...
-- OP_P...
-
-Some opcodes have some variants, while others don't.
-
-They are used as follows:
-- In method_to_ir, CEE_ means the IL opcode ie. without operand size information
-- In the rules inside the .brg files CEE_ means the same as OP_I..., since
-  long opcodes were transformed into OP_L.... by method_to_ir.
-- In the IR emitted by the rules inside the .brg files, CEE_ means the same as
-  OP_P..., since it is usually generated for pointer manipulation.
-- In mono_arch_emit_opcode, CEE_ means OP_P....
-
-As can be seen above, this is a mess. A proposed solution would be the 
-following:
-
-- In method_to_ir, transform CEE_ opcodes into the appropriate OP_I/OP_L
-  opcodes.
-- Get rid of the OP_P opcodes, and use the OP_... opcodes instead, since the
-  two usually means the same.
-- In the IR emitted by the burg rules, use the OP_... opcodes instead of the
-  CEE and OP_P opcodes.
-
-Using these rules would ensure that the same opcode means the same thing in
-all parts of the JIT.
-
-
index 3e57a1c1f74651877a8fb82567b00d2ca70b63f2..4591832e254e64f51d381090ace9ba14bfbdd3ed 100644 (file)
@@ -137,7 +137,7 @@ typedef struct MonoAotOptions {
 
 typedef struct MonoAotStats {
        int ccount, mcount, lmfcount, abscount, gcount, ocount, genericcount;
-       int code_size, info_size, ex_info_size, unwind_info_size, got_size, class_info_size, got_info_size, plt_size;
+       gint64 code_size, info_size, ex_info_size, unwind_info_size, got_size, class_info_size, got_info_size, plt_size;
        int methods_without_got_slots, direct_calls, all_calls, llvm_count;
        int got_slots, offsets_size;
        int got_slot_types [MONO_PATCH_INFO_NONE];
@@ -2498,13 +2498,29 @@ encode_klass_ref_inner (MonoAotCompile *acfg, MonoClass *klass, guint8 *buf, gui
                encode_value (container ? 1 : 0, p, &p);
                if (container) {
                        encode_value (container->is_method, p, &p);
-                       g_assert (par->gshared_constraint == 0);
+                       g_assert (!par->gshared_constraint);
                        if (container->is_method)
                                encode_method_ref (acfg, container->owner.method, p, &p);
                        else
                                encode_klass_ref (acfg, container->owner.klass, p, &p);
                } else {
-                       encode_value (par->gshared_constraint, p, &p);
+                       encode_value (par->gshared_constraint ? 1 : 0, p, &p);
+                       if (par->gshared_constraint) {
+                               const char *name;
+
+                               encode_type (acfg, par->gshared_constraint, p, &p);
+
+                               name = mono_generic_param_name (par);
+                               if (name) {
+                                       int len = strlen (name);
+
+                                       encode_value (len, p, &p);
+                                       memcpy (p, name, len);
+                                       p += len;
+                               } else {
+                                       encode_value (0, p, &p);
+                               }
+                       }
                }
        } else if (klass->byval_arg.type == MONO_TYPE_PTR) {
                encode_value (MONO_AOT_TYPEREF_PTR, p, &p);
@@ -3093,6 +3109,8 @@ static MonoPltEntry*
 get_plt_entry (MonoAotCompile *acfg, MonoJumpInfo *patch_info)
 {
        MonoPltEntry *res;
+       gboolean synchronized = FALSE;
+       static int synchronized_symbol_idx;
 
        if (!is_plt_patch (patch_info))
                return NULL;
@@ -3108,6 +3126,7 @@ get_plt_entry (MonoAotCompile *acfg, MonoJumpInfo *patch_info)
                 * wrapper.
                 */
                res = NULL;
+               synchronized = TRUE;
        }
 
        if (!res) {
@@ -3121,6 +3140,13 @@ get_plt_entry (MonoAotCompile *acfg, MonoJumpInfo *patch_info)
                res->symbol = get_plt_symbol (acfg, res->plt_offset, patch_info);
                if (acfg->aot_opts.write_symbols)
                        res->debug_sym = get_plt_entry_debug_sym (acfg, res->ji, acfg->plt_entry_debug_sym_cache);
+               if (synchronized) {
+                       /* Avoid duplicate symbols because we don't cache */
+                       res->symbol = g_strdup_printf ("%s_%d", res->symbol, synchronized_symbol_idx);
+                       if (res->debug_sym)
+                               res->debug_sym = g_strdup_printf ("%s_%d", res->debug_sym, synchronized_symbol_idx);
+                       synchronized_symbol_idx ++;
+               }
                if (res->debug_sym)
                        res->llvm_symbol = g_strdup_printf ("%s_%s_llvm", res->symbol, res->debug_sym);
                else
@@ -5261,6 +5287,12 @@ encode_patch (MonoAotCompile *acfg, MonoJumpInfo *patch_info, guint8 *buf, guint
                p += len + 1;
                break;
        }
+       case MONO_PATCH_INFO_VIRT_METHOD:
+               encode_klass_ref (acfg, patch_info->data.virt_method->klass, p, &p);
+               encode_method_ref (acfg, patch_info->data.virt_method->method, p, &p);
+               break;
+       case MONO_PATCH_INFO_GC_SAFE_POINT_FLAG:
+               break;
        default:
                g_warning ("unable to handle jump info %d", patch_info->type);
                g_assert_not_reached ();
@@ -5527,7 +5559,13 @@ emit_exception_debug_info (MonoAotCompile *acfg, MonoCompile *cfg, gboolean stor
                        MonoJitExceptionInfo *ei = &jinfo->clauses [k];
 
                        encode_value (ei->flags, p, &p);
+#ifdef MONO_CONTEXT_SET_LLVM_EXC_REG
+                       /* Not used for catch clauses */
+                       if (ei->flags != MONO_EXCEPTION_CLAUSE_NONE)
+                               encode_value (ei->exvar_offset, p, &p);
+#else
                        encode_value (ei->exvar_offset, p, &p);
+#endif
 
                        if (ei->flags == MONO_EXCEPTION_CLAUSE_FILTER || ei->flags == MONO_EXCEPTION_CLAUSE_FINALLY)
                                encode_value ((gint)((guint8*)ei->data.filter - code), p, &p);
@@ -7890,7 +7928,7 @@ emit_exception_info (MonoAotCompile *acfg)
                        // By design aot-runtime decode_exception_debug_info is not able to load sequence point debug data from a file.
                        // As it is not possible to load debug data from a file its is also not possible to store it in a file.
                        gboolean method_seq_points_to_file = acfg->aot_opts.gen_seq_points_file &&
-                               cfg->gen_seq_points && !cfg->gen_seq_points_debug_data;
+                               cfg->gen_seq_points && !cfg->gen_sdb_seq_points;
                        gboolean method_seq_points_to_binary = cfg->gen_seq_points && !method_seq_points_to_file;
                        
                        emit_exception_debug_info (acfg, cfg, method_seq_points_to_binary);
@@ -8529,6 +8567,7 @@ static void
 emit_objc_selectors (MonoAotCompile *acfg)
 {
        int i;
+       char symbol [128];
 
        if (!acfg->objc_selectors || acfg->objc_selectors->len == 0)
                return;
@@ -8548,8 +8587,11 @@ emit_objc_selectors (MonoAotCompile *acfg)
        fprintf (acfg->fp, ".section    __DATA,__objc_selrefs,literal_pointers,no_dead_strip\n");
        fprintf (acfg->fp, ".align      3\n");
        for (i = 0; i < acfg->objc_selectors->len; ++i) {
-               fprintf (acfg->fp, "L_OBJC_SELECTOR_REFERENCES_%d:\n", i);
-               fprintf (acfg->fp, ".long       L_OBJC_METH_VAR_NAME_%d\n", i);
+               sprintf (symbol, "L_OBJC_SELECTOR_REFERENCES_%d", i);
+               emit_label (acfg, symbol);
+               sprintf (symbol, "L_OBJC_METH_VAR_NAME_%d", i);
+               emit_pointer (acfg, symbol);
+
        }
        fprintf (acfg->fp, ".section    __TEXT,__cstring,cstring_literals\n");
        for (i = 0; i < acfg->objc_selectors->len; ++i) {
@@ -9175,7 +9217,8 @@ int
 mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options)
 {
        MonoImage *image = ass->image;
-       int i, res, all_sizes;
+       int i, res;
+       gint64 all_sizes;
        MonoAotCompile *acfg;
        char *outfile_name, *tmp_outfile_name, *p;
        char llvm_stats_msg [256];
@@ -9235,7 +9278,7 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options)
                MonoDebugOptions *opt = mini_get_debug_options ();
 
                opt->mdb_optimizations = TRUE;
-               opt->gen_seq_points_debug_data = TRUE;
+               opt->gen_sdb_seq_points = TRUE;
 
                if (!mono_debug_enabled ()) {
                        aot_printerrf (acfg, "The soft-debug AOT option requires the --debug option.\n");
@@ -9562,14 +9605,14 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options)
        all_sizes = acfg->stats.code_size + acfg->stats.info_size + acfg->stats.ex_info_size + acfg->stats.unwind_info_size + acfg->stats.class_info_size + acfg->stats.got_info_size + acfg->stats.offsets_size + acfg->stats.plt_size;
 
        aot_printf (acfg, "Code: %d(%d%%) Info: %d(%d%%) Ex Info: %d(%d%%) Unwind Info: %d(%d%%) Class Info: %d(%d%%) PLT: %d(%d%%) GOT Info: %d(%d%%) Offsets: %d(%d%%) GOT: %d\n",
-                       acfg->stats.code_size, acfg->stats.code_size * 100 / all_sizes,
-                       acfg->stats.info_size, acfg->stats.info_size * 100 / all_sizes,
-                       acfg->stats.ex_info_size, acfg->stats.ex_info_size * 100 / all_sizes,
-                       acfg->stats.unwind_info_size, acfg->stats.unwind_info_size * 100 / all_sizes,
-                       acfg->stats.class_info_size, acfg->stats.class_info_size * 100 / all_sizes,
-                       acfg->stats.plt_size ? acfg->stats.plt_size : acfg->plt_offset, acfg->stats.plt_size ? acfg->stats.plt_size * 100 / all_sizes : 0,
-                       acfg->stats.got_info_size, acfg->stats.got_info_size * 100 / all_sizes,
-                       acfg->stats.offsets_size, acfg->stats.offsets_size * 100 / all_sizes,
+                               (int)acfg->stats.code_size, (int)(acfg->stats.code_size * 100 / all_sizes),
+                               (int)acfg->stats.info_size, (int)(acfg->stats.info_size * 100 / all_sizes),
+                               (int)acfg->stats.ex_info_size, (int)(acfg->stats.ex_info_size * 100 / all_sizes),
+                               (int)acfg->stats.unwind_info_size, (int)(acfg->stats.unwind_info_size * 100 / all_sizes),
+                               (int)acfg->stats.class_info_size, (int)(acfg->stats.class_info_size * 100 / all_sizes),
+                               acfg->stats.plt_size ? (int)acfg->stats.plt_size : (int)acfg->plt_offset, acfg->stats.plt_size ? (int)(acfg->stats.plt_size * 100 / all_sizes) : 0,
+                               (int)acfg->stats.got_info_size, (int)(acfg->stats.got_info_size * 100 / all_sizes),
+                               (int)acfg->stats.offsets_size, (int)(acfg->stats.offsets_size * 100 / all_sizes),
                        (int)(acfg->got_offset * sizeof (gpointer)));
        aot_printf (acfg, "Compiled: %d/%d (%d%%)%s, No GOT slots: %d (%d%%), Direct calls: %d (%d%%)\n", 
                        acfg->stats.ccount, acfg->stats.mcount, acfg->stats.mcount ? (acfg->stats.ccount * 100) / acfg->stats.mcount : 100,
index c4047274cbf3518bb63a09b20832050cce715387..996729a9bfc409fe5cc229d207bef36fac99e95c 100644 (file)
@@ -468,7 +468,8 @@ decode_klass_ref (MonoAotModule *module, guint8 *buf, guint8 **endbuf)
                int type = decode_value (p, &p);
                int num = decode_value (p, &p);
                gboolean has_container = decode_value (p, &p);
-               MonoTypeEnum gshared_constraint = 0;
+               MonoType *gshared_constraint = NULL;
+               char *par_name = NULL;
 
                if (has_container) {
                        gboolean is_method = decode_value (p, &p);
@@ -491,14 +492,29 @@ decode_klass_ref (MonoAotModule *module, guint8 *buf, guint8 **endbuf)
                                container = class_def->generic_container;
                        }
                } else {
-                       gshared_constraint = decode_value (p, &p);
+                       gboolean has_gshared_constraint = decode_value (p, &p);
+                       if (has_gshared_constraint) {
+                               int len;
+
+                               gshared_constraint = decode_type (module, p, &p);
+                               if (!gshared_constraint)
+                                       return NULL;
+
+                               len = decode_value (p, &p);
+                               if (len) {
+                                       par_name = mono_image_alloc (module->assembly->image, len + 1);
+                                       memcpy (par_name, p, len);
+                                       p += len;
+                                       par_name [len] = '\0';
+                               }
+                       }
                }
 
                t = g_new0 (MonoType, 1);
                t->type = type;
                if (container) {
                        t->data.generic_param = mono_generic_container_get_param (container, num);
-                       g_assert (gshared_constraint == 0);
+                       g_assert (gshared_constraint == NULL);
                } else {
                        /* Anonymous */
                        MonoGenericParam *par = (MonoGenericParam*)mono_image_alloc0 (module->assembly->image, sizeof (MonoGenericParamFull));
@@ -507,6 +523,8 @@ decode_klass_ref (MonoAotModule *module, guint8 *buf, guint8 **endbuf)
                        // FIXME:
                        par->image = mono_defaults.corlib;
                        t->data.generic_param = par;
+                       if (par_name)
+                               ((MonoGenericParamFull*)par)->info.name = par_name;
                }
 
                // FIXME: Maybe use types directly to avoid
@@ -860,7 +878,10 @@ decode_method_ref_with_target (MonoAotModule *module, MethodRef *ref, MonoMethod
                        int atype = decode_value (p, &p);
 
                        ref->method = mono_gc_get_managed_allocator_by_type (atype);
-                       g_assert (ref->method);
+                       if (!ref->method) {
+                               fprintf (stderr, "Error: No managed allocator, but we need one for AOT.\nAre you using non-standard GC options?\n");
+                               exit (1);
+                       }
                        break;
                }
                case MONO_WRAPPER_WRITE_BARRIER:
@@ -2696,7 +2717,13 @@ decode_exception_debug_info (MonoAotModule *amodule, MonoDomain *domain,
 
                        ei->flags = decode_value (p, &p);
 
+#ifdef MONO_CONTEXT_SET_LLVM_EXC_REG
+                       /* Not used for catch clauses */
+                       if (ei->flags != MONO_EXCEPTION_CLAUSE_NONE)
+                               ei->exvar_offset = decode_value (p, &p);
+#else
                        ei->exvar_offset = decode_value (p, &p);
+#endif
 
                        if (ei->flags == MONO_EXCEPTION_CLAUSE_FILTER || ei->flags == MONO_EXCEPTION_CLAUSE_FINALLY)
                                ei->data.filter = code + decode_value (p, &p);
@@ -3422,6 +3449,19 @@ decode_patch (MonoAotModule *aot_module, MonoMemPool *mp, MonoJumpInfo *ji, guin
                ji->data.target = s;
                break;
        }
+       case MONO_PATCH_INFO_VIRT_METHOD: {
+               MonoJumpInfoVirtMethod *info = mono_mempool_alloc0 (mp, sizeof (MonoJumpInfoVirtMethod));
+
+               info->klass = decode_klass_ref (aot_module, p, &p);
+               g_assert (info->klass);
+               info->method = decode_resolve_method_ref (aot_module, p, &p);
+               g_assert (info->method);
+
+               ji->data.target = info;
+               break;
+       }
+       case MONO_PATCH_INFO_GC_SAFE_POINT_FLAG:
+               break;
        default:
                g_warning ("unhandled type %d", ji->type);
                g_assert_not_reached ();
index 00b01e9a47c575bdf5f2ab9447d42122280ead0d..4fd06a36d5d885e889b9db7e624dfb4f25b1bb65 100755 (executable)
@@ -109,6 +109,8 @@ rethrow: src1:i len:18 nacl:50
 start_handler: len:16
 endfinally: len:9 nacl:22
 endfilter: src1:a len:9 nacl:19
+get_ex_obj: dest:a len:16
+
 ckfinite: dest:f src1:f len:43
 ceq: dest:c len:8
 cgt: dest:c len:8
@@ -293,7 +295,7 @@ move_f_to_i8: dest:i src1:f len:5
 move_i8_to_f: dest:f src1:i len:5
 call_handler: len:14 clob:c nacl:52
 aot_const: dest:i len:10
-nacl_gc_safe_point: clob:c
+gc_safe_point: clob:c src1:i len:40
 x86_test_null: src1:i len:5
 x86_compare_membase_reg: src1:b src2:i len:9
 x86_compare_membase_imm: src1:b len:13
index 9501ea5786becfa463afa63d78cbe8021f37aab8..8e58519c7f1cfe7f1909a231c87fbf280b6d8e43 100644 (file)
@@ -65,6 +65,7 @@ start_handler: len:20
 endfinally: len:32
 call_handler: len:16 clob:c
 endfilter: src1:i len:16
+get_ex_obj: dest:i len:16
 
 ckfinite: dest:f src1:f len:112
 ceq: dest:i len:12
index 9fdca593e335c84842b025f93d3ea74ab5a01651..a50a0d20b06548fd683e9baa7db61fbc3e9d0997 100644 (file)
@@ -65,6 +65,7 @@ start_handler: len:32
 endfinally: len:32
 call_handler: len:16 clob:c
 endfilter: src1:i len:32
+get_ex_obj: dest:i len:16
 
 ckfinite: dest:f src1:f len:64
 ceq: dest:i len:12
index bc1a513d40b1c5ab3ca82594c065fc5046b2126c..091c6b1103d159be11814fea62bd843d204f8caa 100644 (file)
@@ -132,9 +132,9 @@ float_rem_un: dest:f src1:f src2:f len:16
 float_sub: dest:f src1:f src2:f len:6
 fmove: dest:f src1:f len:4
 move_f_to_i4: dest:i src1:f len:4
-move_i4_to_f: dest:f src1:i len:4
+move_i4_to_f: dest:f src1:i len:8
 move_f_to_i8: dest:i src1:f len:4
-move_i8_to_f: dest:f src1:i len:4
+move_i8_to_f: dest:f src1:i len:8
 i8const: dest:i len:20
 icompare: src1:i src2:i len:4
 icompare_imm: src1:i len:18
index 8319bb25280ec09783e99ae3a2b2559d75fa8e5b..2bd196cc76c0fd4f1de577e8ae0cc99770a8554f 100644 (file)
@@ -120,6 +120,7 @@ rethrow: src1:i len:13
 start_handler: len:16
 endfinally: len:16 nacl:21
 endfilter: src1:a len:16 nacl:21
+get_ex_obj: dest:a len:16
 
 ckfinite: dest:f src1:f len:32
 ceq: dest:y len:6
@@ -250,7 +251,7 @@ call_handler: len:11 clob:c
 aot_const: dest:i len:5
 load_gotaddr: dest:i len:64
 got_entry: dest:i src1:b len:7
-nacl_gc_safe_point: clob:c
+gc_safe_point: clob:c src1:i len:20
 x86_test_null: src1:i len:2
 x86_compare_membase_reg: src1:b src2:i len:7
 x86_compare_membase_imm: src1:b len:11
index fbc149244f01677e4a83e0e5ae8006fab8a03be6..6e07d05e5da01fc6eda01ddaae9206c4fd6957b7 100644 (file)
@@ -1032,7 +1032,7 @@ mono_debugger_agent_init (void)
        breakpoints_init ();
        suspend_init ();
 
-       mini_get_debug_options ()->gen_seq_points_debug_data = TRUE;
+       mini_get_debug_options ()->gen_sdb_seq_points = TRUE;
        /* 
         * This is needed because currently we don't handle liveness info.
         */
@@ -2309,7 +2309,7 @@ decode_ptr_id (guint8 *buf, guint8 **endbuf, guint8 *limit, IdType type, MonoDom
        dbg_unlock ();
 
        if (res->domain == NULL) {
-               DEBUG_PRINTF (0, "ERR_UNLOADED, id=%d, type=%d.\n", id, type);
+               DEBUG_PRINTF (1, "ERR_UNLOADED, id=%d, type=%d.\n", id, type);
                *err = ERR_UNLOADED;
                return NULL;
        }
@@ -5324,6 +5324,18 @@ ss_start (SingleStepReq *ss_req, MonoMethod *method, SeqPoint* sp, MonoSeqPointI
 
                if (ss_req->nframes == 0)
                        ss_req->nframes = nframes;
+
+               if ((ss_req->depth == STEP_DEPTH_OVER) && (!sp && !parent_sp)) {
+                       DEBUG_PRINTF (1, "[dbg] No parent frame for step over, transition to step into.\n");
+                       /*
+                        * This is needed since if we leave managed code, and later return to it, step over
+                        * is not going to stop.
+                        * This approach is a bit ugly, since we change the step depth, but it only affects
+                        * clients who reuse the same step request, and only in this special case.
+                        */
+                       ss_req->depth = STEP_DEPTH_INTO;
+               }
+
                if (ss_req->depth == STEP_DEPTH_OVER) {
                        /* Need to stop in catch clauses as well */
                        for (i = 0; i < nframes; ++i) {
index d4071234f12e0475f79ae9979d0572dcfc19973d..b9437db9be4aea35c456101921a911d5c6529e29 100644 (file)
@@ -17,8 +17,6 @@
 
 #ifndef DISABLE_JIT
 
-//#define DEBUG_DOMINATORS
-
 /*
  * bb->dfn == 0 means either the bblock is ignored by the dfn calculation, or
  * it is the entry bblock.
@@ -48,16 +46,17 @@ compute_dominators (MonoCompile *cfg)
        doms = g_new0 (MonoBasicBlock*, cfg->num_bblocks);
        doms [entry->dfn] = entry;
 
-#ifdef DEBUG_DOMINATORS
-       for (i = 0; i < cfg->num_bblocks; ++i) {
-               MonoBasicBlock *bb = cfg->bblocks [i];
+       if (cfg->verbose_level > 1) {
+               for (i = 0; i < cfg->num_bblocks; ++i) {
+                       int j;
+                       MonoBasicBlock *bb = cfg->bblocks [i];
 
-               printf ("BB%d IN: ", bb->block_num);
-               for (j = 0; j < bb->in_count; ++j) 
-                       printf ("%d ", bb->in_bb [j]->block_num);
-               printf ("\n");
+                       printf ("BB%d IN: ", bb->block_num);
+                       for (j = 0; j < bb->in_count; ++j)
+                               printf ("%d ", bb->in_bb [j]->block_num);
+                       printf ("\n");
+               }
        }
-#endif
 
        changed = TRUE;
        while (changed) {
@@ -142,15 +141,15 @@ compute_dominators (MonoCompile *cfg)
 
        cfg->comp_done |= MONO_COMP_DOM | MONO_COMP_IDOM;
 
-#ifdef DEBUG_DOMINATORS
-       printf ("DTREE %s %d\n", mono_method_full_name (cfg->method, TRUE), 
-               cfg->header->num_clauses);
-       for (i = 0; i < cfg->num_bblocks; ++i) {
-               MonoBasicBlock *bb = cfg->bblocks [i];
-               printf ("BB%d(dfn=%d) (IDOM=BB%d): ", bb->block_num, bb->dfn, bb->idom ? bb->idom->block_num : -1);
-               mono_blockset_print (cfg, bb->dominators, NULL, -1);
+       if (cfg->verbose_level > 1) {
+               printf ("DTREE %s %d\n", mono_method_full_name (cfg->method, TRUE),
+                       cfg->header->num_clauses);
+               for (i = 0; i < cfg->num_bblocks; ++i) {
+                       MonoBasicBlock *bb = cfg->bblocks [i];
+                       printf ("BB%d(dfn=%d) (IDOM=BB%d): ", bb->block_num, bb->dfn, bb->idom ? bb->idom->block_num : -1);
+                       mono_blockset_print (cfg, bb->dominators, NULL, -1);
+               }
        }
-#endif
 }
 
 #if 0
@@ -296,8 +295,6 @@ mono_compile_dominator_info (MonoCompile *cfg, int dom_flags)
                compute_dominance_frontier (cfg);
 }
 
-//#define DEBUG_NATURAL_LOOPS
-
 /*
  * code to detect loops and loop nesting level
  */
@@ -316,8 +313,13 @@ mono_compute_natural_loops (MonoCompile *cfg)
 
                for (j = 0; j < n->out_count; j++) {
                        MonoBasicBlock *h = n->out_bb [j];
+                       /* check for single block loops */
+                       if (n == h) {
+                               h->loop_blocks = g_list_prepend_mempool (cfg->mempool, h->loop_blocks, h);
+                               h->nesting++;
+                       }
                        /* check for back-edge from n to h */
-                       if (n != h && mono_bitset_test_fast (n->dominators, h->dfn)) {
+                       else if (n != h && mono_bitset_test_fast (n->dominators, h->dfn)) {
                                GSList *todo;
 
                                /* already in loop_blocks? */
@@ -385,9 +387,6 @@ mono_compute_natural_loops (MonoCompile *cfg)
                        /* The loop body start is the first bblock in the order they will be emitted */
                        MonoBasicBlock *h = cfg->bblocks [i];
                        MonoBasicBlock *body_start = h;
-#if defined(__native_client_codegen__)
-                       MonoInst *inst;
-#endif
                        GList *l;
 
                        for (l = h->loop_blocks; l; l = l->next) {
@@ -398,31 +397,24 @@ mono_compute_natural_loops (MonoCompile *cfg)
                                }
                        }
 
-#if defined(__native_client_codegen__)
-                       /* Instrument the loop (GC back branch safe point) */
-                       MONO_INST_NEW (cfg, inst, OP_NACL_GC_SAFE_POINT);
-                       inst->dreg = mono_alloc_dreg (cfg, STACK_I4);
-                       mono_bblock_insert_before_ins (body_start, NULL, inst);
-#endif
                        body_start->loop_body_start = 1;
                }
        }
        g_free (bb_indexes);
 
-#ifdef DEBUG_NATURAL_LOOPS
-       for (i = 0; i < cfg->num_bblocks; ++i) {
-               if (cfg->bblocks [i]->loop_blocks) {
-                       MonoBasicBlock *h = (MonoBasicBlock *)cfg->bblocks [i]->loop_blocks->data;
-                       GList *l;
-                       printf ("LOOP START %d\n", h->block_num);
-                       for (l = h->loop_blocks; l; l = l->next) {
-                               MonoBasicBlock *cb = (MonoBasicBlock *)l->data;
-                               printf (" BB%d %d %p\n", cb->block_num, cb->nesting, cb->loop_blocks);
+       if (cfg->verbose_level > 1) {
+               for (i = 0; i < cfg->num_bblocks; ++i) {
+                       if (cfg->bblocks [i]->loop_blocks) {
+                               MonoBasicBlock *h = (MonoBasicBlock *)cfg->bblocks [i]->loop_blocks->data;
+                               GList *l;
+                               printf ("LOOP START %d\n", h->block_num);
+                               for (l = h->loop_blocks; l; l = l->next) {
+                                       MonoBasicBlock *cb = (MonoBasicBlock *)l->data;
+                                       printf ("\tBB%d %d %p\n", cb->block_num, cb->nesting, cb->loop_blocks);
+                               }
                        }
                }
        }
-#endif
-
 }
 
 static void
index 6b2fa44a737fc5c00db03e9662830300db32439c..502015268f6e3d654b88257a8f7db67b585a6a56 100644 (file)
@@ -271,6 +271,8 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot)
        amd64_mov_reg_membase (code, AMD64_RDI, AMD64_ARG_REG1,  MONO_STRUCT_OFFSET (MonoContext, rdi), 8);
        amd64_mov_reg_membase (code, AMD64_RSI, AMD64_ARG_REG1,  MONO_STRUCT_OFFSET (MonoContext, rsi), 8);
 #endif
+       /* load exc register */
+       amd64_mov_reg_membase (code, AMD64_RAX, AMD64_ARG_REG1,  MONO_STRUCT_OFFSET (MonoContext, rax), 8);
 
        /* call the handler */
        amd64_call_reg (code, AMD64_ARG_REG2);
index 8ab97bf5a30068e487b4fd27e97ca02fd8fed0ca..f0158e5b7a9f2657d1665227a8930b52d8a133c6 100644 (file)
@@ -77,6 +77,7 @@ mono_arch_get_restore_context (MonoTrampInfo **info, gboolean aot)
 
        g_assert ((code - start) < sizeof(start));
        mono_arch_flush_icache (start, code - start);
+       mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
        return start;
 }
 
@@ -168,6 +169,7 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot)
 
        g_assert ((code - start) < sizeof(start));
        mono_arch_flush_icache (start, code - start);
+       mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
        return start;
 }
 
@@ -281,6 +283,7 @@ mono_arch_get_throw_exception_generic (guint8 *start, int size, int corlib, gboo
 
        g_assert ((code - start) < size);
        mono_arch_flush_icache (start, code - start);
+       mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
        return start;
 }
 
@@ -348,6 +351,7 @@ mono_arch_get_throw_exception_by_name (void)
        start = code = mono_global_codeman_reserve (size);
        mips_break (code, 0xfd);
        mono_arch_flush_icache (start, code - start);
+       mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
        return start;
 }
 
index aa0b3f778cc125981b3faefb3d2fd961c87e42e8..4b8d1642c166986decc197df563fe673ba0bcb1d 100644 (file)
@@ -218,6 +218,7 @@ mono_arch_get_restore_context (MonoTrampInfo **info, gboolean aot)
 
        g_assert ((code - start) <= size);
        mono_arch_flush_icache (start, code - start);
+       mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
 
        if (info)
                *info = mono_tramp_info_create ("restore_context", start, code - start, ji, unwind_ops);
@@ -306,6 +307,7 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot)
 
        g_assert ((code - start) < size);
        mono_arch_flush_icache (start, code - start);
+       mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
 
        if (info)
                *info = mono_tramp_info_create ("call_filter", start, code - start, ji, unwind_ops);
@@ -434,6 +436,7 @@ mono_arch_get_throw_exception_generic (int size, MonoTrampInfo **info, int corli
        ppc_break (code);
        g_assert ((code - start) <= size);
        mono_arch_flush_icache (start, code - start);
+       mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
 
        if (info)
                *info = mono_tramp_info_create (corlib ? "throw_corlib_exception" : (rethrow ? "rethrow_exception" : "throw_exception"), start, code - start, ji, unwind_ops);
index 9c2cfc932d53a468890e4d7ef0dda901adf41dcd..78fd645c7859aebac069ccb3616e3ab256880b55 100644 (file)
@@ -210,6 +210,9 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot)
 
        g_assert ((code - start) < SZ_THROW); 
 
+       mono_arch_flush_icache(start, code - start);
+       mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
+
        if (info)
                *info = mono_tramp_info_create ("call_filter",
                                                start, code - start, ji,
@@ -357,6 +360,9 @@ mono_arch_get_throw_exception_generic (int size, MonoTrampInfo **info,
        s390_break (code);
        g_assert ((code - start) < size);
 
+       mono_arch_flush_icache (start, code - start);
+       mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
+
        if (info)
                *info = mono_tramp_info_create (corlib ? "throw_corlib_exception" 
                                                       : (rethrow ? "rethrow_exception" 
index bfd42414e0bf535b9080d175f45b1de5d342f569..03e7aec44a0bf721b0fd95799e49b524ff110a40 100644 (file)
@@ -109,6 +109,9 @@ mono_win32_get_handle_stackoverflow (void)
        /* return */
        x86_ret (code);
 
+       mono_arch_flush_icache (start, code - start);
+       mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
+
        return start;
 }
 
@@ -354,6 +357,9 @@ mono_arch_get_restore_context (MonoTrampInfo **info, gboolean aot)
                g_slist_free (unwind_ops);
        }
 
+       mono_arch_flush_icache (start, code - start);
+       mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
+
        return start;
 }
 
@@ -431,6 +437,9 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot)
                g_slist_free (unwind_ops);
        }
 
+       mono_arch_flush_icache (start, code - start);
+       mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
+
        g_assert ((code - start) < kMaxCodeSize);
        return start;
 }
@@ -653,6 +662,9 @@ get_throw_trampoline (const char *name, gboolean rethrow, gboolean llvm, gboolea
                g_slist_free (unwind_ops);
        }
 
+       mono_arch_flush_icache (start, code - start);
+       mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
+
        return start;
 }
 
@@ -943,6 +955,9 @@ mono_x86_get_signal_exception_trampoline (MonoTrampInfo **info, gboolean aot)
                g_slist_free (unwind_ops);
        }
 
+       mono_arch_flush_icache (start, code - start);
+       mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
+
        return start;
 }
 
index 98b743b01321bdb9ef8932b70c776e3eb8f8e3a1..c122f17dd037986fcb76a9b2b510ac544490f3a5 100644 (file)
@@ -1140,6 +1140,83 @@ class Tests
                MyClass<FooStruct2>.foo ();
                return 0;
        }
+
+       enum AnEnum {
+               A,
+               B
+       }
+
+       [MethodImplAttribute (MethodImplOptions.NoInlining)]
+       public static string constrained_tostring<T> (T t) {
+               return t.ToString ();
+       }
+
+       [MethodImplAttribute (MethodImplOptions.NoInlining)]
+       public static bool constrained_equals<T> (T t1, T t2) {
+               var c = EqualityComparer<T>.Default;
+
+               return c.Equals (t1, t2);
+       }
+
+       [MethodImplAttribute (MethodImplOptions.NoInlining)]
+       public static int constrained_gethashcode<T> (T t) {
+               return t.GetHashCode ();
+       }
+
+       public static int test_0_constrained_partial_sharing () {
+               string s;
+
+               s = constrained_tostring<int> (5);
+               if (s != "5")
+                       return 1;
+               s = constrained_tostring<AnEnum> (AnEnum.B);
+               if (s != "B")
+                       return 2;
+
+               if (!constrained_equals<int> (1, 1))
+                       return 3;
+               if (constrained_equals<int> (1, 2))
+                       return 4;
+               if (!constrained_equals<AnEnum> (AnEnum.A, AnEnum.A))
+                       return 5;
+               if (constrained_equals<AnEnum> (AnEnum.A, AnEnum.B))
+                       return 6;
+
+               int i = constrained_gethashcode<int> (5);
+               if (i != 5)
+                       return 7;
+               i = constrained_gethashcode<AnEnum> (AnEnum.B);
+               if (i != 1)
+                       return 8;
+               return 0;
+       }
+
+       enum Enum1 {
+               A,
+               B
+       }
+
+       enum Enum2 {
+               A,
+               B
+       }
+
+       public static int test_0_partial_sharing_ginst () {
+               var l1 = new List<KeyValuePair<int, Enum1>> ();
+               l1.Add (new KeyValuePair<int, Enum1>(5, Enum1.A));
+               if (l1 [0].Key != 5)
+                       return 1;
+               if (l1 [0].Value != Enum1.A)
+                       return 2;
+               var l2 = new List<KeyValuePair<int, Enum2>> ();
+               l2.Add (new KeyValuePair<int, Enum2>(5, Enum2.B));
+               if (l2 [0].Key != 5)
+                       return 3;
+               if (l2 [0].Value != Enum2.B)
+                       return 4;
+               return 0;
+       }
+
 }
 
 #if !MOBILE
index 67d073448d3fbdf9b440e87c663538ce8a7d9e7f..fe05ecca2d36a5569abfd30b622b71bf3868d86b 100644 (file)
@@ -408,7 +408,7 @@ handle_gsharedvt_ldaddr (MonoCompile *cfg)
        } while (0)
 
 #define NEW_SEQ_POINT(cfg,dest,il_offset,intr_loc) do {         \
-       MONO_INST_NEW ((cfg), (dest), cfg->gen_seq_points_debug_data ? OP_SEQ_POINT : OP_IL_SEQ_POINT); \
+       MONO_INST_NEW ((cfg), (dest), cfg->gen_sdb_seq_points ? OP_SEQ_POINT : OP_IL_SEQ_POINT); \
        (dest)->inst_imm = (il_offset); \
        (dest)->flags = intr_loc ? MONO_INST_SINGLE_STEP_LOC : 0; \
        } while (0)
index 85b6ba04001d48715d8385c4b0eb0d7d504e253a..a3bd43d3a41acf4e20506addc84669f6561aa5a3 100644 (file)
@@ -812,7 +812,7 @@ update_liveness2 (MonoCompile *cfg, MonoInst *ins, gboolean set_volatile, int in
                        }
                        else {
                                /* Try dead code elimination */
-                               if ((var != cfg->ret) && !(var->flags & (MONO_INST_VOLATILE|MONO_INST_INDIRECT)) && ((ins->opcode == OP_ICONST) || (ins->opcode == OP_I8CONST) || (ins->opcode == OP_R8CONST)) && !(var->flags & MONO_INST_VOLATILE)) {
+                               if (!cfg->disable_deadce_vars && (var != cfg->ret) && !(var->flags & (MONO_INST_VOLATILE|MONO_INST_INDIRECT)) && ((ins->opcode == OP_ICONST) || (ins->opcode == OP_I8CONST) || (ins->opcode == OP_R8CONST)) && !(var->flags & MONO_INST_VOLATILE)) {
                                        LIVENESS_DEBUG (printf ("\tdead def of R%d, eliminated\n", ins->dreg));
                                        NULLIFY_INS (ins);
                                        return;
index 89c241957707c503b5f11fd90ed11f9aecba2738..018898013211a6ee4a4a38b64e91c2fe1ba97d03 100755 (executable)
@@ -407,7 +407,7 @@ static MONO_NEVER_INLINE void
 gshared_failure (MonoCompile *cfg, int opcode, const char *file, int line)
 {
        if (cfg->verbose_level > 2)                                                                                     \
-               printf ("sharing failed for method %s.%s.%s/%d opcode %s line %d\n", cfg->current_method->klass->name_space, cfg->current_method->klass->name, cfg->current_method->name, cfg->current_method->signature->param_count, mono_opcode_name ((opcode)), __LINE__);
+               printf ("sharing failed for method %s.%s.%s/%d opcode %s line %d\n", cfg->current_method->klass->name_space, cfg->current_method->klass->name, cfg->current_method->name, cfg->current_method->signature->param_count, mono_opcode_name ((opcode)), line);
        mono_cfg_set_exception (cfg, MONO_EXCEPTION_GENERIC_SHARING_FAILED);
 }
 
@@ -2286,7 +2286,8 @@ target_type_is_incompatible (MonoCompile *cfg, MonoType *target, MonoInst *arg)
                        if (arg->type != STACK_VTYPE)
                                return 1;
                        klass = mono_class_from_mono_type (simple_type);
-                       if (klass != arg->klass)
+                       /* The second cases is needed when doing partial sharing */
+                       if (klass != arg->klass && mono_class_from_mono_type (target) != arg->klass)
                                return 1;
                        return 0;
                } else {
@@ -2898,18 +2899,10 @@ mono_emit_method_call_full (MonoCompile *cfg, MonoMethod *method, MonoMethodSign
                        vtable_reg = alloc_preg (cfg);
                        MONO_EMIT_NEW_LOAD_MEMBASE_FAULT (cfg, vtable_reg, this_reg, MONO_STRUCT_OFFSET (MonoObject, vtable));
                        if (method->klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
-                               slot_reg = -1;
-                               if (mono_use_imt) {
-                                       guint32 imt_slot = mono_method_get_imt_slot (method);
-                                       emit_imt_argument (cfg, call, call->method, imt_arg);
-                                       slot_reg = vtable_reg;
-                                       offset = ((gint32)imt_slot - MONO_IMT_SIZE) * SIZEOF_VOID_P;
-                               }
-                               if (slot_reg == -1) {
-                                       slot_reg = alloc_preg (cfg);
-                                       mini_emit_load_intf_reg_vtable (cfg, slot_reg, vtable_reg, method->klass);
-                                       offset = mono_method_get_vtable_index (method) * SIZEOF_VOID_P;
-                               }
+                               guint32 imt_slot = mono_method_get_imt_slot (method);
+                               emit_imt_argument (cfg, call, call->method, imt_arg);
+                               slot_reg = vtable_reg;
+                               offset = ((gint32)imt_slot - MONO_IMT_SIZE) * SIZEOF_VOID_P;
                        } else {
                                slot_reg = vtable_reg;
                                offset = MONO_STRUCT_OFFSET (MonoVTable, vtable) +
@@ -2998,7 +2991,7 @@ direct_icalls_enabled (MonoCompile *cfg)
        if (cfg->compile_llvm)
                return FALSE;
 #endif
-       if (cfg->gen_seq_points_debug_data || cfg->disable_direct_icalls)
+       if (cfg->gen_sdb_seq_points || cfg->disable_direct_icalls)
                return FALSE;
        return TRUE;
 }
@@ -3514,6 +3507,28 @@ emit_get_rgctx_gsharedvt_call (MonoCompile *cfg, int context_used,
        return emit_rgctx_fetch (cfg, rgctx, entry);
 }
 
+/*
+ * emit_get_rgctx_virt_method:
+ *
+ *   Return data for method VIRT_METHOD for a receiver of type KLASS.
+ */
+static MonoInst*
+emit_get_rgctx_virt_method (MonoCompile *cfg, int context_used,
+                                                       MonoClass *klass, MonoMethod *virt_method, MonoRgctxInfoType rgctx_type)
+{
+       MonoJumpInfoVirtMethod *info;
+       MonoJumpInfoRgctxEntry *entry;
+       MonoInst *rgctx;
+
+       info = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoJumpInfoVirtMethod));
+       info->klass = klass;
+       info->method = virt_method;
+
+       entry = mono_patch_info_rgctx_entry_new (cfg->mempool, cfg->current_method, context_used & MONO_GENERIC_CONTEXT_USED_METHOD, MONO_PATCH_INFO_VIRT_METHOD, info, rgctx_type);
+       rgctx = emit_get_rgctx (cfg, cfg->current_method, context_used);
+
+       return emit_rgctx_fetch (cfg, rgctx, entry);
+}
 
 static MonoInst*
 emit_get_rgctx_gsharedvt_method (MonoCompile *cfg, int context_used,
@@ -5675,7 +5690,7 @@ static MonoInst*
 mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoInst **args)
 {
        MonoInst *ins = NULL;
-       
+
        static MonoClass *runtime_helpers_class = NULL;
        if (! runtime_helpers_class)
                runtime_helpers_class = mono_class_from_name (mono_defaults.corlib,
@@ -6508,12 +6523,16 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign
                 * all inputs:
                 * http://everything2.com/?node_id=1051618
                 */
-       } else if ((!strcmp (cmethod->klass->image->assembly->aname.name, "MonoMac") ||
+       } else if (((!strcmp (cmethod->klass->image->assembly->aname.name, "MonoMac") ||
                    !strcmp (cmethod->klass->image->assembly->aname.name, "monotouch")) &&
-                  !strcmp (cmethod->klass->name_space, "XamCore.ObjCRuntime") &&
-                  !strcmp (cmethod->klass->name, "Selector")) {
+                               !strcmp (cmethod->klass->name_space, "XamCore.ObjCRuntime") &&
+                               !strcmp (cmethod->klass->name, "Selector")) ||
+                          (!strcmp (cmethod->klass->image->assembly->aname.name, "Xamarin.iOS") &&
+                               !strcmp (cmethod->klass->name_space, "ObjCRuntime") &&
+                               !strcmp (cmethod->klass->name, "Selector"))
+                          ) {
 #ifdef MONO_ARCH_HAVE_OBJC_GET_SELECTOR
-               if (!strcmp (cmethod->klass->name, "GetHandle") && fsig->param_count == 1 &&
+               if (!strcmp (cmethod->name, "GetHandle") && fsig->param_count == 1 &&
                    (args [0]->opcode == OP_GOT_ENTRY || args [0]->opcode == OP_AOTCONST) &&
                    cfg->compile_aot) {
                        MonoInst *pi;
@@ -7798,16 +7817,13 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
        cfg->stat_cil_code_size += header->code_size;
 
        seq_points = cfg->gen_seq_points && cfg->method == method;
-#ifdef PLATFORM_ANDROID
-       seq_points &= cfg->method->wrapper_type == MONO_WRAPPER_NONE;
-#endif
 
        if (method->wrapper_type == MONO_WRAPPER_NATIVE_TO_MANAGED) {
                /* We could hit a seq point before attaching to the JIT (#8338) */
                seq_points = FALSE;
        }
 
-       if (cfg->gen_seq_points_debug_data && cfg->method == method) {
+       if (cfg->gen_sdb_seq_points && cfg->method == method) {
                minfo = mono_debug_lookup_method (method);
                if (minfo) {
                        int i, n_il_offsets;
@@ -7903,11 +7919,6 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                cfg->bb_entry = start_bblock;
                start_bblock->cil_code = NULL;
                start_bblock->cil_length = 0;
-#if defined(__native_client_codegen__)
-               MONO_INST_NEW (cfg, ins, OP_NACL_GC_SAFE_POINT);
-               ins->dreg = alloc_dreg (cfg, STACK_I4);
-               MONO_ADD_INS (start_bblock, ins);
-#endif
 
                /* EXIT BLOCK */
                NEW_BBLOCK (cfg, end_bblock);
@@ -7962,7 +7973,6 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                        tblock->flags |= BB_EXCEPTION_UNSAFE;
                        }
 
-
                        /*printf ("clause try IL_%04x to IL_%04x handler %d at IL_%04x to IL_%04x\n", clause->try_offset, clause->try_offset + clause->try_len, clause->flags, clause->handler_offset, clause->handler_offset + clause->handler_len);
                          while (p < end) {
                          printf ("%s", mono_disasm_code_one (NULL, method, p, &p));
@@ -7970,7 +7980,6 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                        /* catch and filter blocks get the exception object on the stack */
                        if (clause->flags == MONO_EXCEPTION_CLAUSE_NONE ||
                            clause->flags == MONO_EXCEPTION_CLAUSE_FILTER) {
-                               MonoInst *dummy_use;
 
                                /* mostly like handle_stack_args (), but just sets the input args */
                                /* printf ("handling clause at IL_%04x\n", clause->handler_offset); */
@@ -7978,12 +7987,24 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                tblock->in_stack = mono_mempool_alloc (cfg->mempool, sizeof (MonoInst*));
                                tblock->in_stack [0] = mono_create_exvar_for_offset (cfg, clause->handler_offset);
 
+                               cfg->cbb = tblock;
+
+#ifdef MONO_CONTEXT_SET_LLVM_EXC_REG
+                               /* The EH code passes in the exception in a register to both JITted and LLVM compiled code */
+                               if (!cfg->compile_llvm) {
+                                       MONO_INST_NEW (cfg, ins, OP_GET_EX_OBJ);
+                                       ins->dreg = tblock->in_stack [0]->dreg;
+                                       MONO_ADD_INS (tblock, ins);
+                               }
+#else
+                               MonoInst *dummy_use;
+
                                /* 
                                 * Add a dummy use for the exvar so its liveness info will be
                                 * correct.
                                 */
-                               cfg->cbb = tblock;
                                EMIT_NEW_DUMMY_USE (cfg, dummy_use, tblock->in_stack [0]);
+#endif
                                
                                if (clause->flags == MONO_EXCEPTION_CLAUSE_FILTER) {
                                        GET_BBLOCK (cfg, tblock, ip + clause->data.filter_offset);
@@ -8849,6 +8870,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                        gboolean skip_ret = FALSE;
                        gboolean delegate_invoke = FALSE;
                        gboolean direct_icall = FALSE;
+                       gboolean constrained_partial_call = FALSE;
                        MonoMethod *cil_method;
 
                        CHECK_OPSIZE (5);
@@ -8863,10 +8885,8 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                if ((constrained_class->byval_arg.type == MONO_TYPE_VAR || constrained_class->byval_arg.type == MONO_TYPE_MVAR) && cfg->generic_sharing_context) {
                                        if (!mini_is_gsharedvt_klass (cfg, constrained_class)) {
                                                g_assert (!cmethod->klass->valuetype);
-                                               if (!mini_type_is_reference (cfg, &constrained_class->byval_arg)) {
-                                                       /* FIXME: gshared type constrained to a primitive type */
-                                                       GENERIC_SHARING_FAILURE (CEE_CALL);
-                                               }
+                                               if (!mini_type_is_reference (cfg, &constrained_class->byval_arg))
+                                                       constrained_partial_call = TRUE;
                                        }
                                }
 
@@ -9006,7 +9026,69 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                /*
                                 * We have the `constrained.' prefix opcode.
                                 */
-                               if (constrained_class->valuetype && (cmethod->klass == mono_defaults.object_class || cmethod->klass == mono_defaults.enum_class->parent || cmethod->klass == mono_defaults.enum_class)) {
+                               if (constrained_partial_call) {
+                                       gboolean need_box = TRUE;
+
+                                       /*
+                                        * The receiver is a valuetype, but the exact type is not known at compile time. This means the
+                                        * called method is not known at compile time either. The called method could end up being
+                                        * one of the methods on the parent classes (object/valuetype/enum), in which case we need
+                                        * to box the receiver.
+                                        * A simple solution would be to box always and make a normal virtual call, but that would
+                                        * be bad performance wise.
+                                        */
+                                       if (cmethod->klass->flags & TYPE_ATTRIBUTE_INTERFACE && cmethod->klass->generic_class) {
+                                               /*
+                                                * The parent classes implement no generic interfaces, so the called method will be a vtype method, so no boxing neccessary.
+                                                */
+                                               need_box = FALSE;
+                                       }
+
+                                       if (need_box) {
+                                               MonoInst *box_type;
+                                               MonoBasicBlock *is_ref_bb, *end_bb;
+                                               MonoInst *nonbox_call;
+
+                                               /*
+                                                * Determine at runtime whenever the called method is defined on object/valuetype/enum, and emit a boxing call
+                                                * if needed.
+                                                * FIXME: It is possible to inline the called method in a lot of cases, i.e. for T_INT,
+                                                * the no-box case goes to a method in Int32, while the box case goes to a method in Enum.
+                                                */
+                                               addr = emit_get_rgctx_virt_method (cfg, mono_class_check_context_used (constrained_class), constrained_class, cmethod, MONO_RGCTX_INFO_VIRT_METHOD_CODE);
+
+                                               NEW_BBLOCK (cfg, is_ref_bb);
+                                               NEW_BBLOCK (cfg, end_bb);
+
+                                               box_type = emit_get_rgctx_virt_method (cfg, mono_class_check_context_used (constrained_class), constrained_class, cmethod, MONO_RGCTX_INFO_VIRT_METHOD_BOX_TYPE);
+                                               MONO_EMIT_NEW_BIALU_IMM (cfg, OP_COMPARE_IMM, -1, box_type->dreg, 1);
+                                               MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_IBEQ, is_ref_bb);
+
+                                               /* Non-ref case */
+                                               nonbox_call = (MonoInst*)mono_emit_calli (cfg, fsig, sp, addr, NULL, NULL);
+
+                                               MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_BR, end_bb);
+
+                                               /* Ref case */
+                                               MONO_START_BB (cfg, is_ref_bb);
+                                               EMIT_NEW_LOAD_MEMBASE_TYPE (cfg, ins, &constrained_class->byval_arg, sp [0]->dreg, 0);
+                                               ins->klass = constrained_class;
+                                               sp [0] = handle_box (cfg, ins, constrained_class, mono_class_check_context_used (constrained_class), &bblock);
+                                               ins = (MonoInst*)mono_emit_calli (cfg, fsig, sp, addr, NULL, NULL);
+
+                                               MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_BR, end_bb);
+
+                                               MONO_START_BB (cfg, end_bb);
+                                               bblock = end_bb;
+
+                                               nonbox_call->dreg = ins->dreg;
+                                       } else {
+                                               g_assert (cmethod->klass->flags & TYPE_ATTRIBUTE_INTERFACE);
+                                               addr = emit_get_rgctx_virt_method (cfg, mono_class_check_context_used (constrained_class), constrained_class, cmethod, MONO_RGCTX_INFO_VIRT_METHOD_CODE);
+                                               ins = (MonoInst*)mono_emit_calli (cfg, fsig, sp, addr, NULL, NULL);
+                                       }
+                                       goto call_end;
+                               } else if (constrained_class->valuetype && (cmethod->klass == mono_defaults.object_class || cmethod->klass == mono_defaults.enum_class->parent || cmethod->klass == mono_defaults.enum_class)) {
                                        /*
                                         * The type parameter is instantiated as a valuetype,
                                         * but that type doesn't override the method we're
@@ -9180,7 +9262,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                        GSHAREDVT_FAILURE (*ip);
 
 #if MONO_ARCH_HAVE_GENERALIZED_IMT_THUNK && defined(MONO_ARCH_GSHARED_SUPPORTED)
-                               if (cmethod->wrapper_type == MONO_WRAPPER_NONE && mono_use_imt)
+                               if (cmethod->wrapper_type == MONO_WRAPPER_NONE)
                                        use_imt = TRUE;
 #endif
 
@@ -9333,7 +9415,6 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                                GSHAREDVT_FAILURE (*ip);
                                        if (fsig->generic_param_count) {
                                                /* virtual generic call */
-                                               g_assert (mono_use_imt);
                                                g_assert (!imt_arg);
                                                /* Same as the virtual generic case above */
                                                imt_arg = emit_get_rgctx_method (cfg, context_used,
@@ -13074,7 +13155,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
        }
 
        /* Add a sequence point for method entry/exit events */
-       if (seq_points && cfg->gen_seq_points_debug_data) {
+       if (seq_points && cfg->gen_sdb_seq_points) {
                NEW_SEQ_POINT (cfg, ins, METHOD_ENTRY_IL_OFFSET, FALSE);
                MONO_ADD_INS (init_localsbb, ins);
                NEW_SEQ_POINT (cfg, ins, METHOD_EXIT_IL_OFFSET, FALSE);
index cd1070c42f07a43b8b3447bf66e3069cf31b6be9..c24fe349514d516044634b0139fa92ccab4fe0c5 100755 (executable)
@@ -32,6 +32,7 @@
 #include <mono/utils/mono-memory-model.h>
 #include <mono/utils/mono-tls.h>
 #include <mono/utils/mono-hwcap-x86.h>
+#include <mono/utils/mono-threads.h>
 
 #include "trace.h"
 #include "ir-emit.h"
@@ -52,7 +53,7 @@ static gboolean optimize_for_xen = TRUE;
 
 #define IS_REX(inst) (((inst) >= 0x40) && ((inst) <= 0x4f))
 
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
 /* Under windows, the calling convention is never stdcall */
 #define CALLCONV_IS_STDCALL(call_conv) (FALSE)
 #else
@@ -526,7 +527,7 @@ typedef struct {
 
 #define DEBUG(a) if (cfg->verbose_level > 1) a
 
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
 static AMD64_Reg_No param_regs [] = { AMD64_RCX, AMD64_RDX, AMD64_R8, AMD64_R9 };
 
 static AMD64_Reg_No return_regs [] = { AMD64_RAX, AMD64_RDX };
@@ -554,7 +555,7 @@ add_general (guint32 *gr, guint32 *stack_size, ArgInfo *ainfo)
     }
 }
 
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
 #define FLOAT_PARAM_REGS 4
 #else
 #define FLOAT_PARAM_REGS 8
@@ -618,7 +619,7 @@ merge_argument_class_from_type (MonoGenericSharingContext *gsctx, MonoType *type
                break;
        case MONO_TYPE_R4:
        case MONO_TYPE_R8:
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
                class2 = ARG_CLASS_INTEGER;
 #else
                class2 = ARG_CLASS_SSE;
@@ -751,7 +752,7 @@ add_valuetype (MonoGenericSharingContext *gsctx, MonoMethodSignature *sig, ArgIn
 
        klass = mono_class_from_mono_type (type);
        size = mini_type_stack_size_full (gsctx, &klass->byval_arg, NULL, sig->pinvoke);
-#ifndef HOST_WIN32
+#ifndef TARGET_WIN32
        if (!sig->pinvoke && ((is_return && (size == 8)) || (!is_return && (size <= 16)))) {
                /* We pass and return vtypes of size 8 in a register */
        } else if (!sig->pinvoke || (size == 0) || (size > 16)) {
@@ -833,7 +834,7 @@ add_valuetype (MonoGenericSharingContext *gsctx, MonoMethodSignature *sig, ArgIn
                g_assert (info);
                g_assert (fields);
 
-#ifndef HOST_WIN32
+#ifndef TARGET_WIN32
                if (info->native_size > 16) {
                        ainfo->offset = *stack_size;
                        *stack_size += ALIGN_TO (info->native_size, 8);
@@ -1006,7 +1007,7 @@ get_call_info (MonoGenericSharingContext *gsctx, MonoMemPool *mp, MonoMethodSign
        gr = 0;
        fr = 0;
 
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
        /* Reserve space where the callee can save the argument registers */
        stack_size = 4 * sizeof (mgreg_t);
 #endif
@@ -1115,7 +1116,7 @@ get_call_info (MonoGenericSharingContext *gsctx, MonoMemPool *mp, MonoMethodSign
                ArgInfo *ainfo = &cinfo->args [sig->hasthis + i];
                MonoType *ptype;
 
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
                /* The float param registers and other param registers must be the same index on Windows x64.*/
                if (gr > fr)
                        fr = gr;
@@ -1540,7 +1541,7 @@ mono_arch_get_global_int_regs (MonoCompile *cfg)
 #ifndef __native_client_codegen__
                regs = g_list_prepend (regs, (gpointer)AMD64_R15);
 #endif
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
                regs = g_list_prepend (regs, (gpointer)AMD64_RDI);
                regs = g_list_prepend (regs, (gpointer)AMD64_RSI);
 #endif
@@ -2008,7 +2009,7 @@ mono_arch_create_vars (MonoCompile *cfg)
                }
        }
 
-       if (cfg->gen_seq_points_debug_data) {
+       if (cfg->gen_sdb_seq_points) {
                MonoInst *ins;
 
                if (cfg->compile_aot) {
@@ -2031,7 +2032,7 @@ mono_arch_create_vars (MonoCompile *cfg)
 
        if (cfg->method->save_lmf) {
                cfg->lmf_ir = TRUE;
-#if !defined(HOST_WIN32)
+#if !defined(TARGET_WIN32)
                if (mono_get_lmf_tls_offset () != -1 && !optimize_for_xen)
                        cfg->lmf_ir_mono_lmf = TRUE;
 #endif
@@ -3002,12 +3003,12 @@ emit_call_body (MonoCompile *cfg, guint8 *code, guint32 patch_type, gconstpointe
 static inline guint8*
 emit_call (MonoCompile *cfg, guint8 *code, guint32 patch_type, gconstpointer data, gboolean win64_adjust_stack)
 {
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
        if (win64_adjust_stack)
                amd64_alu_reg_imm (code, X86_SUB, AMD64_RSP, 32);
 #endif
        code = emit_call_body (cfg, code, patch_type, data);
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
        if (win64_adjust_stack)
                amd64_alu_reg_imm (code, X86_ADD, AMD64_RSP, 32);
 #endif 
@@ -3347,7 +3348,7 @@ mono_emit_stack_alloc (MonoCompile *cfg, guchar *code, MonoInst* tree)
        int sreg = tree->sreg1;
        int need_touch = FALSE;
 
-#if defined(HOST_WIN32)
+#if defined(TARGET_WIN32)
        need_touch = TRUE;
 #elif defined(MONO_ARCH_SIGSEGV_ON_ALTSTACK)
        if (!tree->flags & MONO_INST_INIT)
@@ -3591,7 +3592,7 @@ mono_amd64_get_tls_gs_offset (void)
 guint8*
 mono_amd64_emit_tls_get (guint8* code, int dreg, int tls_offset)
 {
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
        if (tls_offset < 64) {
                x86_prefix (code, X86_GS_PREFIX);
                amd64_mov_reg_mem (code, dreg, (tls_offset * 8) + 0x1480, 8);
@@ -3657,7 +3658,7 @@ emit_tls_get_reg (guint8* code, int dreg, int offset_reg)
 static guint8*
 amd64_emit_tls_set (guint8 *code, int sreg, int tls_offset)
 {
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
        g_assert_not_reached ();
 #elif defined(__APPLE__)
        x86_prefix (code, X86_GS_PREFIX);
@@ -3674,7 +3675,7 @@ static guint8*
 amd64_emit_tls_set_reg (guint8 *code, int sreg, int offset_reg)
 {
        /* offset_reg contains a value translated by mono_arch_translate_tls_offset () */
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
        g_assert_not_reached ();
 #elif defined(__APPLE__)
        x86_prefix (code, X86_GS_PREFIX);
@@ -4994,7 +4995,10 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                        amd64_ret (code);
                        break;
                }
-
+               case OP_GET_EX_OBJ:
+                       if (ins->dreg != AMD64_RAX)
+                               amd64_mov_reg_reg (code, ins->dreg, AMD64_RAX, sizeof (gpointer));
+                       break;
                case OP_LABEL:
                        ins->inst_c0 = code - cfg->native_code;
                        break;
@@ -6552,22 +6556,28 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                        MONO_VARINFO (cfg, ins->inst_c0)->live_range_end = code - cfg->native_code;
                        break;
                }
-               case OP_NACL_GC_SAFE_POINT: {
-#if defined(__native_client_codegen__) && defined(__native_client_gc__)
-                       if (cfg->compile_aot)
-                               code = emit_call (cfg, code, MONO_PATCH_INFO_ABS, (gpointer)mono_nacl_gc, TRUE);
-                       else {
-                               guint8 *br [1];
+               case OP_GC_SAFE_POINT: {
+                       gpointer polling_func = NULL;
+                       int compare_val = 0;
+                       guint8 *br [1];
 
-                               amd64_mov_reg_imm_size (code, AMD64_R11, (gpointer)&__nacl_thread_suspension_needed, 4);
-                               amd64_test_membase_imm_size (code, AMD64_R11, 0, 0xFFFFFFFF, 4);
-                               br[0] = code; x86_branch8 (code, X86_CC_EQ, 0, FALSE);
-                               code = emit_call (cfg, code, MONO_PATCH_INFO_ABS, (gpointer)mono_nacl_gc, TRUE);
-                               amd64_patch (br[0], code);
-                       }
+#if defined (USE_COOP_GC)
+                       polling_func = (gpointer)mono_threads_state_poll;
+                       compare_val = 1;
+#elif defined(__native_client_codegen__) && defined(__native_client_gc__)
+                       polling_func = (gpointer)mono_nacl_gc;
+                       compare_val = 0xFFFFFFFF;
 #endif
+                       if (!polling_func)
+                               break;
+
+                       amd64_test_membase_imm_size (code, ins->sreg1, 0, compare_val, 4);
+                       br[0] = code; x86_branch8 (code, X86_CC_EQ, 0, FALSE);
+                       code = emit_call (cfg, code, MONO_PATCH_INFO_ABS, polling_func, TRUE);
+                       amd64_patch (br[0], code);
                        break;
                }
+
                case OP_GC_LIVENESS_DEF:
                case OP_GC_LIVENESS_USE:
                case OP_GC_PARAM_SLOT_LIVENESS_DEF:
@@ -6774,7 +6784,7 @@ mono_arch_emit_prolog (MonoCompile *cfg)
                mono_emit_unwind_op_def_cfa_offset (cfg, code, cfa_offset);
                mono_emit_unwind_op_offset (cfg, code, AMD64_RBP, - cfa_offset);
                async_exc_point (code);
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
                mono_arch_unwindinfo_add_push_nonvol (&cfg->arch.unwindinfo, cfg->native_code, code, AMD64_RBP);
 #endif
                /* These are handled automatically by the stack marking code */
@@ -6783,7 +6793,7 @@ mono_arch_emit_prolog (MonoCompile *cfg)
                amd64_mov_reg_reg (code, AMD64_RBP, AMD64_RSP, sizeof(mgreg_t));
                mono_emit_unwind_op_def_cfa_reg (cfg, code, AMD64_RBP);
                async_exc_point (code);
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
                mono_arch_unwindinfo_add_set_fpreg (&cfg->arch.unwindinfo, cfg->native_code, code, AMD64_RBP);
 #endif
        }
@@ -6824,7 +6834,7 @@ mono_arch_emit_prolog (MonoCompile *cfg)
        /* Allocate stack frame */
        if (alloc_size) {
                /* See mono_emit_stack_alloc */
-#if defined(HOST_WIN32) || defined(MONO_ARCH_SIGSEGV_ON_ALTSTACK)
+#if defined(TARGET_WIN32) || defined(MONO_ARCH_SIGSEGV_ON_ALTSTACK)
                guint32 remaining_size = alloc_size;
                /*FIXME handle unbounded code expansion, we should use a loop in case of more than X interactions*/
                guint32 required_code_size = ((remaining_size / 0x1000) + 1) * 10; /*10 is the max size of amd64_alu_reg_imm + amd64_test_membase_reg*/
@@ -6844,7 +6854,7 @@ mono_arch_emit_prolog (MonoCompile *cfg)
                                mono_emit_unwind_op_def_cfa_offset (cfg, code, cfa_offset);
                        }
                        async_exc_point (code);
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
                        if (cfg->arch.omit_fp) 
                                mono_arch_unwindinfo_add_alloc_stack (&cfg->arch.unwindinfo, cfg->native_code, code, 0x1000);
 #endif
@@ -6859,7 +6869,7 @@ mono_arch_emit_prolog (MonoCompile *cfg)
                                mono_emit_unwind_op_def_cfa_offset (cfg, code, cfa_offset);
                                async_exc_point (code);
                        }
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
                        if (cfg->arch.omit_fp) 
                                mono_arch_unwindinfo_add_alloc_stack (&cfg->arch.unwindinfo, cfg->native_code, code, remaining_size);
 #endif
@@ -7213,7 +7223,7 @@ mono_arch_emit_prolog (MonoCompile *cfg)
                }
        }
 
-       if (cfg->gen_seq_points_debug_data) {
+       if (cfg->gen_sdb_seq_points) {
                MonoInst *info_var = cfg->arch.seq_point_info_var;
 
                /* Initialize seq_point_info_var */
@@ -7953,7 +7963,7 @@ get_delegate_invoke_impl (gboolean has_target, guint32 param_count, guint32 *cod
                        /* We have to shift the arguments left */
                        amd64_mov_reg_reg (code, AMD64_RAX, AMD64_ARG_REG1, 8);
                        for (i = 0; i < param_count; ++i) {
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
                                if (i < 3)
                                        amd64_mov_reg_reg (code, param_regs [i], param_regs [i + 1], 8);
                                else
index 1b48c14caa69bef3097b7a9522a7042518c86b93..d17167372ac926f14680c49bf6f56e1c6a8f0256 100644 (file)
@@ -213,7 +213,7 @@ typedef struct MonoCompileArch {
 
 
 
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
 #define PARAM_REGS 4
 #else
 #define PARAM_REGS 6
@@ -231,7 +231,6 @@ typedef struct {
        guint8 *ret;
 } DynCallArgs;
 
-
 #define MONO_CONTEXT_SET_LLVM_EXC_REG(ctx, exc) do { (ctx)->rax = (gsize)exc; } while (0)
 #define MONO_CONTEXT_SET_LLVM_EH_SELECTOR_REG(ctx, sel) do { (ctx)->rdx = (gsize)(sel); } while (0)
 
@@ -287,7 +286,7 @@ typedef struct {
 #define MONO_ARCH_NOMAP32BIT 1
 #endif
 
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
 #define MONO_AMD64_ARG_REG1 AMD64_RCX
 #define MONO_AMD64_ARG_REG2 AMD64_RDX
 #define MONO_AMD64_ARG_REG3 AMD64_R8
@@ -320,6 +319,7 @@ typedef struct {
  * clobbered across method call boundaries.
  */
 #define MONO_ARCH_RGCTX_REG MONO_ARCH_IMT_REG
+#define MONO_ARCH_EXC_REG AMD64_RAX
 #define MONO_ARCH_HAVE_CMOV_OPS 1
 #define MONO_ARCH_HAVE_NOTIFY_PENDING_EXC 1
 #define MONO_ARCH_HAVE_EXCEPTIONS_INIT 1
@@ -410,7 +410,7 @@ typedef struct {
 
 extern MonoBreakpointInfo mono_breakpoint_info [MONO_BREAKPOINT_ARRAY_SIZE];
 
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
 
 void mono_arch_unwindinfo_add_push_nonvol (gpointer* monoui, gpointer codebegin, gpointer nextip, guchar reg );
 void mono_arch_unwindinfo_add_set_fpreg (gpointer* monoui, gpointer codebegin, gpointer nextip, guchar reg );
index 3a12ed0329f321c2b96bbef3073b9cb798e60c44..6060dabba6f652a9e019f79723833d3c793561a1 100644 (file)
@@ -2154,7 +2154,7 @@ mono_arch_create_vars (MonoCompile *cfg)
                }
        }
 
-       if (cfg->gen_seq_points_debug_data) {
+       if (cfg->gen_sdb_seq_points) {
                if (cfg->soft_breakpoints) {
                        MonoInst *ins = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_LOCAL);
                        ins->flags |= MONO_INST_VOLATILE;
@@ -5256,6 +5256,11 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                        code = mono_arm_patchable_bl (code, ARMCOND_AL);
                        mono_cfg_add_try_hole (cfg, ins->inst_eh_block, code, bb);
                        break;
+               case OP_GET_EX_OBJ:
+                       if (ins->dreg != ARMREG_R0)
+                               ARM_MOV_REG_REG (code, ins->dreg, ARMREG_R0);
+                       break;
+
                case OP_LABEL:
                        ins->inst_c0 = code - cfg->native_code;
                        break;
index f055611ea80c8bb64c2148096cc10375fda44024..f46ee40726da19fb944c96776954a97661627757 100644 (file)
@@ -304,6 +304,7 @@ typedef struct MonoCompileArch {
 #define MONO_ARCH_RGCTX_REG ARMREG_V5
 /* First argument reg */
 #define MONO_ARCH_VTABLE_REG ARMREG_R0
+#define MONO_ARCH_EXC_REG ARMREG_R0
 
 #define MONO_CONTEXT_SET_LLVM_EXC_REG(ctx, exc) do { (ctx)->regs [0] = (gsize)exc; } while (0)
 
index 276df0f69d60169da4eba4c6de036c8ecf8fb61d..d457487ce93d0a578300cd74873e990a3c0ad92b 100644 (file)
@@ -1169,14 +1169,14 @@ get_exception_catch_class (MonoJitExceptionInfo *ei, MonoJitInfo *ji, MonoContex
 }
 
 /*
- * mini_jit_info_table_find:
+ * mini_jit_info_table_find_ext:
  *
  *   Same as mono_jit_info_table_find, but search all the domains of the current thread
  * if ADDR is not found in DOMAIN. The domain where the method was found is stored into
  * OUT_DOMAIN if it is not NULL.
  */
 MonoJitInfo*
-mini_jit_info_table_find (MonoDomain *domain, char *addr, MonoDomain **out_domain)
+mini_jit_info_table_find_ext (MonoDomain *domain, char *addr, gboolean allow_trampolines, MonoDomain **out_domain)
 {
        MonoJitInfo *ji;
        MonoInternalThread *t = mono_thread_internal_current ();
@@ -1185,7 +1185,7 @@ mini_jit_info_table_find (MonoDomain *domain, char *addr, MonoDomain **out_domai
        if (out_domain)
                *out_domain = NULL;
 
-       ji = mono_jit_info_table_find (domain, addr);
+       ji = mono_jit_info_table_find_internal (domain, addr, TRUE, allow_trampolines);
        if (ji) {
                if (out_domain)
                        *out_domain = domain;
@@ -1194,7 +1194,7 @@ mini_jit_info_table_find (MonoDomain *domain, char *addr, MonoDomain **out_domai
 
        /* maybe it is shared code, so we also search in the root domain */
        if (domain != mono_get_root_domain ()) {
-               ji = mono_jit_info_table_find (mono_get_root_domain (), addr);
+               ji = mono_jit_info_table_find_internal (mono_get_root_domain (), addr, TRUE, allow_trampolines);
                if (ji) {
                        if (out_domain)
                                *out_domain = mono_get_root_domain ();
@@ -1208,7 +1208,7 @@ mini_jit_info_table_find (MonoDomain *domain, char *addr, MonoDomain **out_domai
        refs = (t->appdomain_refs) ? *(gpointer *) t->appdomain_refs : NULL;
        for (; refs && *refs; refs++) {
                if (*refs != domain && *refs != mono_get_root_domain ()) {
-                       ji = mono_jit_info_table_find ((MonoDomain*) *refs, addr);
+                       ji = mono_jit_info_table_find_internal ((MonoDomain*) *refs, addr, TRUE, allow_trampolines);
                        if (ji) {
                                if (out_domain)
                                        *out_domain = (MonoDomain*) *refs;
@@ -1220,6 +1220,12 @@ mini_jit_info_table_find (MonoDomain *domain, char *addr, MonoDomain **out_domai
        return NULL;
 }
 
+MonoJitInfo*
+mini_jit_info_table_find (MonoDomain *domain, char *addr, MonoDomain **out_domain)
+{
+       return mini_jit_info_table_find_ext (domain, addr, FALSE, out_domain);
+}
+
 /*
  * wrap_non_exception_throws:
  *
@@ -1483,16 +1489,17 @@ mono_handle_exception_internal_first_pass (MonoContext *ctx, gpointer obj, gint3
                                        if (is_user_frame)
                                                setup_managed_stacktrace_information ();
 
-                                       if (ji->from_llvm) {
 #ifdef MONO_CONTEXT_SET_LLVM_EXC_REG
+                                       if (ji->from_llvm)
                                                MONO_CONTEXT_SET_LLVM_EXC_REG (ctx, ex_obj);
+                                       else
+                                               /* Can't pass the ex object in a register yet to filter clauses, because call_filter () might not support it */
+                                               *((gpointer *)(gpointer)((char *)MONO_CONTEXT_GET_BP (ctx) + ei->exvar_offset)) = ex_obj;
 #else
-                                               g_assert_not_reached ();
+                                       g_assert (!ji->from_llvm);
+                                       /* store the exception object in bp + ei->exvar_offset */
+                                       *((gpointer *)(gpointer)((char *)MONO_CONTEXT_GET_BP (ctx) + ei->exvar_offset)) = ex_obj;
 #endif
-                                       } else {
-                                               /* store the exception object in bp + ei->exvar_offset */
-                                               *((gpointer *)(gpointer)((char *)MONO_CONTEXT_GET_BP (ctx) + ei->exvar_offset)) = ex_obj;
-                                       }
 
 #ifdef MONO_CONTEXT_SET_LLVM_EH_SELECTOR_REG
                                        /*
@@ -1788,16 +1795,13 @@ mono_handle_exception_internal (MonoContext *ctx, gpointer obj, gboolean resume,
                                        ex_obj = obj;
 
                                if (((ei->flags == MONO_EXCEPTION_CLAUSE_NONE) || (ei->flags == MONO_EXCEPTION_CLAUSE_FILTER))) {
-                                       if (ji->from_llvm) {
 #ifdef MONO_CONTEXT_SET_LLVM_EXC_REG
-                                               MONO_CONTEXT_SET_LLVM_EXC_REG (ctx, ex_obj);
+                                       MONO_CONTEXT_SET_LLVM_EXC_REG (ctx, ex_obj);
 #else
-                                               g_assert_not_reached ();
+                                       g_assert (!ji->from_llvm);
+                                       /* store the exception object in bp + ei->exvar_offset */
+                                       *((gpointer *)(gpointer)((char *)MONO_CONTEXT_GET_BP (ctx) + ei->exvar_offset)) = ex_obj;
 #endif
-                                       } else {
-                                               /* store the exception object in bp + ei->exvar_offset */
-                                               *((gpointer *)(gpointer)((char *)MONO_CONTEXT_GET_BP (ctx) + ei->exvar_offset)) = ex_obj;
-                                       }
                                }
 
 #ifdef MONO_CONTEXT_SET_LLVM_EH_SELECTOR_REG
@@ -2656,7 +2660,9 @@ mono_thread_state_init_from_sigctx (MonoThreadUnwindState *ctx, void *sigctx)
        if (sigctx)
                mono_sigctx_to_monoctx (sigctx, &ctx->ctx);
        else
-#if MONO_ARCH_HAS_MONO_CONTEXT && !defined(MONO_CROSS_COMPILE)
+#if defined(MONO_CROSS_COMPILE)
+               ctx->valid = FALSE; //A cross compiler doesn't need to suspend.
+#elif MONO_ARCH_HAS_MONO_CONTEXT
                MONO_CONTEXT_GET_CURRENT (ctx->ctx);
 #else
                g_error ("Use a null sigctx requires a working mono-context");
index 4a0947fc2b5794e899ccf6248f8ff926c653ac80..d4905eefb7f7f97ba50187d7c04951fc479f4c4c 100644 (file)
@@ -15,8 +15,8 @@
 
 #include "mini.h"
 
-//#define ALLOW_PARTIAL_SHARING TRUE
-#define ALLOW_PARTIAL_SHARING FALSE
+#define ALLOW_PARTIAL_SHARING TRUE
+//#define ALLOW_PARTIAL_SHARING FALSE
  
 #if 0
 #define DEBUG(...) __VA_ARGS__
@@ -662,7 +662,25 @@ inflate_info (MonoRuntimeGenericContextInfoTemplate *oti, MonoGenericContext *co
                g_assert (mono_error_ok (&error));
                return isig;
        }
+       case MONO_RGCTX_INFO_VIRT_METHOD_CODE:
+       case MONO_RGCTX_INFO_VIRT_METHOD_BOX_TYPE: {
+               MonoJumpInfoVirtMethod *info = data;
+               MonoJumpInfoVirtMethod *res;
+               MonoType *t;
+               MonoDomain *domain = mono_domain_get ();
+               MonoError error;
+
+               // FIXME: Temporary
+               res = mono_domain_alloc0 (domain, sizeof (MonoJumpInfoVirtMethod));
+               t = mono_class_inflate_generic_type (&info->klass->byval_arg, context);
+               res->klass = mono_class_from_mono_type (t);
+               mono_metadata_free_type (t);
+
+               res->method = mono_class_inflate_generic_method_checked (info->method, context, &error);
+               g_assert (mono_error_ok (&error)); /* FIXME don't swallow the error */
 
+               return res;
+       }
        default:
                g_assert_not_reached ();
        }
@@ -702,49 +720,6 @@ class_uninstantiated (MonoClass *class)
        return class;
 }
 
-static gboolean
-generic_inst_is_sharable (MonoGenericInst *inst, gboolean allow_type_vars,
-                                                 gboolean allow_partial)
-{
-       int i;
-
-       for (i = 0; i < inst->type_argc; ++i) {
-               MonoType *type = inst->type_argv [i];
-
-               if (MONO_TYPE_IS_REFERENCE (type) || (allow_type_vars && (type->type == MONO_TYPE_VAR || type->type == MONO_TYPE_MVAR)))
-                       continue;
-               /* Allow non ref arguments if they are primitive types or enums (partial sharing). */
-               if (allow_partial && !type->byref && (((type->type >= MONO_TYPE_BOOLEAN) && (type->type <= MONO_TYPE_R8)) || (type->type == MONO_TYPE_I) || (type->type == MONO_TYPE_U) || (type->type == MONO_TYPE_VALUETYPE && type->data.klass->enumtype)))
-                       continue;
-
-               return FALSE;
-       }
-
-       return TRUE;
-}
-
-/*
- * mono_is_partially_sharable_inst:
- *
- *   Return TRUE if INST has ref and non-ref type arguments.
- */
-gboolean
-mono_is_partially_sharable_inst (MonoGenericInst *inst)
-{
-       int i;
-       gboolean has_refs = FALSE, has_non_refs = FALSE;
-
-       for (i = 0; i < inst->type_argc; ++i) {
-               if (MONO_TYPE_IS_REFERENCE (inst->type_argv [i]) || inst->type_argv [i]->type == MONO_TYPE_VAR || inst->type_argv [i]->type == MONO_TYPE_MVAR)
-                       has_refs = TRUE;
-               else
-                       has_non_refs = TRUE;
-       }
-
-       return has_refs && has_non_refs;
-}
-
 /*
  * get_shared_class:
  *
@@ -753,52 +728,6 @@ mono_is_partially_sharable_inst (MonoGenericInst *inst)
 static MonoClass*
 get_shared_class (MonoClass *class)
 {
-       /*
-        * FIXME: This conflicts with normal instances. Also, some code in this file
-        * like class_get_rgctx_template_oti treats these as normal generic instances
-        * instead of generic classes.
-        */
-       //g_assert_not_reached ();
-
-#if 0
-       /* The gsharedvt changes break this */
-       if (ALLOW_PARTIAL_SHARING)
-               g_assert_not_reached ();
-#endif
-
-#if 0
-       if (class->is_inflated) {
-               MonoGenericContext *context = &class->generic_class->context;
-               MonoGenericContext *container_context;
-               MonoGenericContext shared_context;
-               MonoGenericInst *inst;
-               MonoType **type_argv;
-               int i;
-
-               inst = context->class_inst;
-               if (mono_is_partially_sharable_inst (inst)) {
-                       container_context = &class->generic_class->container_class->generic_container->context;
-                       type_argv = g_new0 (MonoType*, inst->type_argc);
-                       for (i = 0; i < inst->type_argc; ++i) {
-                               if (MONO_TYPE_IS_REFERENCE (inst->type_argv [i]) || inst->type_argv [i]->type == MONO_TYPE_VAR || inst->type_argv [i]->type == MONO_TYPE_MVAR)
-                                       type_argv [i] = container_context->class_inst->type_argv [i];
-                               else
-                                       type_argv [i] = inst->type_argv [i];
-                       }
-
-                       memset (&shared_context, 0, sizeof (MonoGenericContext));
-                       shared_context.class_inst = mono_metadata_get_generic_inst (inst->type_argc, type_argv);
-                       g_free (type_argv);
-
-                       return mono_class_inflate_generic_class (class->generic_class->container_class, &shared_context);
-               } else if (!generic_inst_is_sharable (inst, TRUE, FALSE)) {
-                       /* Happens for partially shared methods of nono-sharable generic class */
-                       return class;
-               }
-       }
-#endif
-
-       // FIXME: Use this in all cases can be problematic wrt domain/assembly unloading
        return class_uninstantiated (class);
 }
 
@@ -1262,6 +1191,57 @@ instantiate_info (MonoDomain *domain, MonoRuntimeGenericContextInfoTemplate *oti
                addr = mono_compile_method (data);
                return mini_add_method_trampoline (NULL, data, addr, mono_method_needs_static_rgctx_invoke (data, FALSE), FALSE);
        }
+       case MONO_RGCTX_INFO_VIRT_METHOD_CODE: {
+               MonoJumpInfoVirtMethod *info = data;
+               MonoClass *iface_class = info->method->klass;
+               MonoMethod *method;
+               int ioffset, slot;
+               gpointer addr;
+
+               mono_class_setup_vtable (info->klass);
+               // FIXME: Check type load
+               if (iface_class->flags & TYPE_ATTRIBUTE_INTERFACE) {
+                       ioffset = mono_class_interface_offset (info->klass, iface_class);
+                       g_assert (ioffset != -1);
+               } else {
+                       ioffset = 0;
+               }
+               slot = mono_method_get_vtable_slot (info->method);
+               g_assert (slot != -1);
+               g_assert (info->klass->vtable);
+               method = info->klass->vtable [ioffset + slot];
+
+               addr = mono_compile_method (method);
+               return mini_add_method_trampoline (NULL, method, addr, mono_method_needs_static_rgctx_invoke (method, FALSE), FALSE);
+       }
+       case MONO_RGCTX_INFO_VIRT_METHOD_BOX_TYPE: {
+               MonoJumpInfoVirtMethod *info = data;
+               MonoClass *iface_class = info->method->klass;
+               MonoMethod *method;
+               MonoClass *impl_class;
+               int ioffset, slot;
+
+               mono_class_setup_vtable (info->klass);
+               // FIXME: Check type load
+               if (iface_class->flags & TYPE_ATTRIBUTE_INTERFACE) {
+                       ioffset = mono_class_interface_offset (info->klass, iface_class);
+                       g_assert (ioffset != -1);
+               } else {
+                       ioffset = 0;
+               }
+               slot = mono_method_get_vtable_slot (info->method);
+               g_assert (slot != -1);
+               g_assert (info->klass->vtable);
+               method = info->klass->vtable [ioffset + slot];
+
+               impl_class = method->klass;
+               if (MONO_TYPE_IS_REFERENCE (&impl_class->byval_arg))
+                       return GUINT_TO_POINTER (1);
+               else if (mono_class_is_nullable (impl_class))
+                       return GUINT_TO_POINTER (2);
+               else
+                       return GUINT_TO_POINTER (0);
+       }
 #ifndef DISABLE_REMOTING
        case MONO_RGCTX_INFO_REMOTING_INVOKE_WITH_CHECK:
                return mono_compile_method (mono_marshal_get_remoting_invoke_with_check (data));
@@ -1548,6 +1528,8 @@ mono_rgctx_info_type_to_str (MonoRgctxInfoType type)
        case MONO_RGCTX_INFO_BZERO: return "BZERO";
        case MONO_RGCTX_INFO_NULLABLE_CLASS_BOX: return "NULLABLE_CLASS_BOX";
        case MONO_RGCTX_INFO_NULLABLE_CLASS_UNBOX: return "NULLABLE_CLASS_UNBOX";
+       case MONO_RGCTX_INFO_VIRT_METHOD_CODE: return "VIRT_METHOD_CODE";
+       case MONO_RGCTX_INFO_VIRT_METHOD_BOX_TYPE: return "VIRT_METHOD_BOX_TYPE";
        default:
                return "<UNKNOWN RGCTX INFO TYPE>";
        }
@@ -1643,6 +1625,13 @@ info_equal (gpointer data1, gpointer data2, MonoRgctxInfoType info_type)
        case MONO_RGCTX_INFO_METHOD_GSHAREDVT_OUT_TRAMPOLINE_VIRT:
        case MONO_RGCTX_INFO_SIG_GSHAREDVT_OUT_TRAMPOLINE_CALLI:
                return data1 == data2;
+       case MONO_RGCTX_INFO_VIRT_METHOD_CODE:
+       case MONO_RGCTX_INFO_VIRT_METHOD_BOX_TYPE: {
+               MonoJumpInfoVirtMethod *info1 = data1;
+               MonoJumpInfoVirtMethod *info2 = data2;
+
+               return info1->klass == info2->klass && info1->method == info2->method;
+       }
        default:
                g_assert_not_reached ();
        }
@@ -2039,6 +2028,71 @@ mono_method_lookup_rgctx (MonoVTable *class_vtable, MonoGenericInst *method_inst
        return mrgctx;
 }
 
+
+static gboolean
+generic_inst_is_sharable (MonoGenericInst *inst, gboolean allow_type_vars,
+                                                 gboolean allow_partial);
+
+static gboolean
+type_is_sharable (MonoType *type, gboolean allow_type_vars, gboolean allow_partial)
+{
+       if (MONO_TYPE_IS_REFERENCE (type) || (allow_type_vars && (type->type == MONO_TYPE_VAR || type->type == MONO_TYPE_MVAR)))
+               return TRUE;
+
+       /* Allow non ref arguments if they are primitive types or enums (partial sharing). */
+       if (allow_partial && !type->byref && (((type->type >= MONO_TYPE_BOOLEAN) && (type->type <= MONO_TYPE_R8)) || (type->type == MONO_TYPE_I) || (type->type == MONO_TYPE_U) || (type->type == MONO_TYPE_VALUETYPE && type->data.klass->enumtype)))
+               return TRUE;
+
+       if (allow_partial && !type->byref && type->type == MONO_TYPE_GENERICINST && MONO_TYPE_ISSTRUCT (type)) {
+               MonoGenericClass *gclass = type->data.generic_class;
+
+               if (gclass->context.class_inst && !generic_inst_is_sharable (gclass->context.class_inst, allow_type_vars, allow_partial))
+                       return FALSE;
+               if (gclass->context.method_inst && !generic_inst_is_sharable (gclass->context.method_inst, allow_type_vars, allow_partial))
+                       return FALSE;
+               if (mono_class_is_nullable (mono_class_from_mono_type (type)))
+                       return FALSE;
+               return TRUE;
+       }
+
+       return FALSE;
+}
+
+static gboolean
+generic_inst_is_sharable (MonoGenericInst *inst, gboolean allow_type_vars,
+                                                 gboolean allow_partial)
+{
+       int i;
+
+       for (i = 0; i < inst->type_argc; ++i) {
+               if (!type_is_sharable (inst->type_argv [i], allow_type_vars, allow_partial))
+                       return FALSE;
+       }
+
+       return TRUE;
+}
+
+/*
+ * mono_is_partially_sharable_inst:
+ *
+ *   Return TRUE if INST has ref and non-ref type arguments.
+ */
+gboolean
+mono_is_partially_sharable_inst (MonoGenericInst *inst)
+{
+       int i;
+       gboolean has_refs = FALSE, has_non_refs = FALSE;
+
+       for (i = 0; i < inst->type_argc; ++i) {
+               if (MONO_TYPE_IS_REFERENCE (inst->type_argv [i]) || inst->type_argv [i]->type == MONO_TYPE_VAR || inst->type_argv [i]->type == MONO_TYPE_MVAR)
+                       has_refs = TRUE;
+               else
+                       has_non_refs = TRUE;
+       }
+
+       return has_refs && has_non_refs;
+}
+
 /*
  * mono_generic_context_is_sharable_full:
  * @context: a generic context
@@ -2196,6 +2250,10 @@ mono_method_is_generic_sharable_full (MonoMethod *method, gboolean allow_type_va
        if (!partial_sharing_supported ())
                allow_partial = FALSE;
 
+       if (mono_class_is_nullable (method->klass))
+               // FIXME:
+               allow_partial = FALSE;
+
        if (method->klass->image->dynamic)
                /*
                 * Enabling this causes corlib test failures because the JIT encounters generic instances whose
@@ -2549,18 +2607,15 @@ mini_get_basic_type_from_generic (MonoGenericSharingContext *gsctx, MonoType *ty
        if (!type->byref && (type->type == MONO_TYPE_VAR || type->type == MONO_TYPE_MVAR) && mini_is_gsharedvt_type_gsctx (gsctx, type))
                return type;
        else if (!type->byref && (type->type == MONO_TYPE_VAR || type->type == MONO_TYPE_MVAR)) {
-               MonoTypeEnum constraint = type->data.generic_param->gshared_constraint;
+               MonoType *constraint = type->data.generic_param->gshared_constraint;
                /* The gparam serial encodes the type this gparam can represent */
-               if (constraint == 0) {
+               if (!constraint) {
                        return &mono_defaults.object_class->byval_arg;
                } else {
-                       MonoType t;
                        MonoClass *klass;
 
-                       g_assert (constraint != MONO_TYPE_VALUETYPE);
-                       memset (&t, 0, sizeof (t));
-                       t.type = constraint;
-                       klass = mono_class_from_mono_type (&t);
+                       g_assert (constraint != &mono_defaults.int_class->parent->byval_arg);
+                       klass = mono_class_from_mono_type (constraint);
                        return &klass->byval_arg;
                }
        } else {
@@ -2735,13 +2790,19 @@ mini_class_is_generic_sharable (MonoClass *klass)
        return (klass->generic_class && mono_generic_context_is_sharable (&klass->generic_class->context, FALSE));
 }
 
-
 gboolean
 mini_is_gsharedvt_variable_klass (MonoCompile *cfg, MonoClass *klass)
 {
        return mini_is_gsharedvt_variable_type (cfg, &klass->byval_arg);
 }
 
+gboolean
+mini_is_gsharedvt_gparam (MonoType *t)
+{
+       /* Matches get_gsharedvt_type () */
+       return (t->type == MONO_TYPE_VAR || t->type == MONO_TYPE_MVAR) && t->data.generic_param->gshared_constraint && t->data.generic_param->gshared_constraint->type == MONO_TYPE_VALUETYPE;
+}
+
 static char*
 get_shared_gparam_name (MonoTypeEnum constraint, const char *name)
 {
@@ -2749,6 +2810,8 @@ get_shared_gparam_name (MonoTypeEnum constraint, const char *name)
                return g_strdup_printf ("%s_GSHAREDVT", name);
        } else if (constraint == MONO_TYPE_OBJECT) {
                return g_strdup_printf ("%s_REF", name);
+       } else if (constraint == MONO_TYPE_GENERICINST) {
+               return g_strdup_printf ("%s_INST", name);
        } else {
                MonoType t;
                char *tname, *tname2, *res;
@@ -2764,20 +2827,57 @@ get_shared_gparam_name (MonoTypeEnum constraint, const char *name)
        }
 }
 
+typedef struct {
+       MonoGenericParam *par;
+       MonoType *constraint;
+} SharedGParam;
+
+static guint
+shared_gparam_hash (gconstpointer data)
+{
+       SharedGParam *p = (SharedGParam*)data;
+       guint hash;
+
+       hash = mono_metadata_generic_param_hash (p->par);
+       hash = ((hash << 5) - hash) ^ mono_metadata_type_hash (p->constraint);
+
+       return hash;
+}
+
+static gboolean
+shared_gparam_equal (gconstpointer ka, gconstpointer kb)
+{
+       SharedGParam *p1 = (SharedGParam*)ka;
+       SharedGParam *p2 = (SharedGParam*)kb;
+
+       if (p1 == p2)
+               return TRUE;
+       if (p1->par != p2->par)
+               return FALSE;
+       if (!mono_metadata_type_equal (p1->constraint, p2->constraint))
+               return FALSE;
+       return TRUE;
+}
+
 /*
  * get_shared_gparam:
  *
  *   Create an anonymous gparam with a type variable with a constraint which encodes which types can match it.
  */
 static MonoType*
-get_shared_gparam (MonoType *t, MonoTypeEnum constraint)
+get_shared_gparam (MonoType *t, MonoType *constraint)
 {
        MonoGenericParam *par = t->data.generic_param;
        MonoGenericParam *copy;
+       SharedGParam key;
        MonoType *res;
        MonoImage *image = NULL;
        char *name;
 
+       memset (&key, 0, sizeof (key));
+       key.par = par;
+       key.constraint = constraint;
+
        g_assert (mono_generic_param_info (par));
        /* image might not be set for sre */
        if (par->owner && par->owner->image) {
@@ -2788,15 +2888,15 @@ get_shared_gparam (MonoType *t, MonoTypeEnum constraint)
                        image->gshared_types_len = MONO_TYPE_INTERNAL;
                        image->gshared_types = g_new0 (GHashTable*, image->gshared_types_len);
                }
-               if (!image->gshared_types [constraint])
-                       image->gshared_types [constraint] = g_hash_table_new (NULL, NULL);
-               res = g_hash_table_lookup (image->gshared_types [constraint], par);
+               if (!image->gshared_types [constraint->type])
+                       image->gshared_types [constraint->type] = g_hash_table_new (shared_gparam_hash, shared_gparam_equal);
+               res = g_hash_table_lookup (image->gshared_types [constraint->type], &key);
                mono_image_unlock (image);
                if (res)
                        return res;
                copy = mono_image_alloc0 (image, sizeof (MonoGenericParamFull));
                memcpy (copy, par, sizeof (MonoGenericParamFull));
-               name = get_shared_gparam_name (constraint, ((MonoGenericParamFull*)copy)->info.name);
+               name = get_shared_gparam_name (constraint->type, ((MonoGenericParamFull*)copy)->info.name);
                ((MonoGenericParamFull*)copy)->info.name = mono_image_strdup (image, name);
                g_free (name);
        } else {
@@ -2807,38 +2907,75 @@ get_shared_gparam (MonoType *t, MonoTypeEnum constraint)
        copy->owner = NULL;
        // FIXME:
        copy->image = mono_defaults.corlib;
+
        copy->gshared_constraint = constraint;
        res = mono_metadata_type_dup (NULL, t);
        res->data.generic_param = copy;
 
        if (image) {
+               SharedGParam *dkey;
+
+               dkey = mono_image_alloc0 (image, sizeof (SharedGParam));
+               dkey->par = par;
+               dkey->constraint = constraint;
+
                mono_image_lock (image);
                /* Duplicates are ok */
-               g_hash_table_insert (image->gshared_types [constraint], par, res);
+               g_hash_table_insert (image->gshared_types [constraint->type], dkey, res);
                mono_image_unlock (image);
        }
 
        return res;
 }
 
+static MonoGenericInst*
+get_shared_inst (MonoGenericInst *inst, MonoGenericInst *shared_inst, MonoGenericContainer *container, gboolean all_vt, gboolean gsharedvt, gboolean partial);
+
 static MonoType*
 get_shared_type (MonoType *t, MonoType *type)
 {
        MonoTypeEnum ttype;
 
+       if (!type->byref && type->type == MONO_TYPE_GENERICINST && MONO_TYPE_ISSTRUCT (type)) {
+               MonoGenericClass *gclass = type->data.generic_class;
+               MonoGenericContext context;
+               MonoClass *k;
+
+               memset (&context, 0, sizeof (context));
+               if (gclass->context.class_inst)
+                       context.class_inst = get_shared_inst (gclass->context.class_inst, gclass->container_class->generic_container->context.class_inst, NULL, FALSE, FALSE, TRUE);
+               if (gclass->context.method_inst)
+                       context.method_inst = get_shared_inst (gclass->context.method_inst, gclass->container_class->generic_container->context.method_inst, NULL, FALSE, FALSE, TRUE);
+
+               k = mono_class_inflate_generic_class (gclass->container_class, &context);
+
+               return get_shared_gparam (t, &k->byval_arg);
+       }
+
        g_assert (!type->byref && (((type->type >= MONO_TYPE_BOOLEAN) && (type->type <= MONO_TYPE_R8)) || (type->type == MONO_TYPE_I) || (type->type == MONO_TYPE_U) || (type->type == MONO_TYPE_VALUETYPE && type->data.klass->enumtype)));
 
        /* Create a type variable with a constraint which encodes which types can match it */
        ttype = type->type;
        if (type->type == MONO_TYPE_VALUETYPE)
                ttype = mono_class_enum_basetype (type->data.klass)->type;
-       return get_shared_gparam (t, ttype);
+
+       {
+               MonoType t2;
+               MonoClass *klass;
+
+               memset (&t2, 0, sizeof (t2));
+               t2.type = ttype;
+               klass = mono_class_from_mono_type (&t2);
+
+               return get_shared_gparam (t, &klass->byval_arg);
+       }
 }
 
 static MonoType*
 get_gsharedvt_type (MonoType *t)
 {
-       return get_shared_gparam (t, MONO_TYPE_VALUETYPE);
+       /* Use TypeHandle as the constraint type since its a valuetype */
+       return get_shared_gparam (t, &mono_defaults.typehandle_class->byval_arg);
 }
 
 static MonoGenericInst*
@@ -2854,7 +2991,7 @@ get_shared_inst (MonoGenericInst *inst, MonoGenericInst *shared_inst, MonoGeneri
                        type_argv [i] = get_gsharedvt_type (shared_inst->type_argv [i]);
                } else if ((MONO_TYPE_IS_REFERENCE (inst->type_argv [i]) || inst->type_argv [i]->type == MONO_TYPE_VAR || inst->type_argv [i]->type == MONO_TYPE_MVAR)) {
                        g_assert (shared_inst);
-                       type_argv [i] = get_shared_gparam (shared_inst->type_argv [i], MONO_TYPE_OBJECT);
+                       type_argv [i] = get_shared_gparam (shared_inst->type_argv [i], &mono_defaults.object_class->byval_arg);
                } else if (partial) {
                        /* These types match the ones in generic_inst_is_sharable () */
                        type_argv [i] = get_shared_type (shared_inst->type_argv [i], inst->type_argv [i]);
index faf1de75321cda573e8f16074b8d2c967a9441a4..a436f52d410208cce21656a1aeb204adb6e6369f 100644 (file)
@@ -1106,6 +1106,8 @@ emit_volatile_load (EmitContext *ctx, int vreg)
                 */
                if (t->type == MONO_TYPE_U1 || t->type == MONO_TYPE_U2 || t->type == MONO_TYPE_CHAR || t->type == MONO_TYPE_BOOLEAN)
                        v = LLVMBuildZExt (ctx->builder, v, LLVMInt32Type (), "");
+               else if (t->type == MONO_TYPE_I1 || t->type == MONO_TYPE_I2)
+                       v = LLVMBuildSExt (ctx->builder, v, LLVMInt32Type (), "");
                else if (t->type == MONO_TYPE_U8)
                        v = LLVMBuildZExt (ctx->builder, v, LLVMInt64Type (), "");
        }
@@ -2573,11 +2575,6 @@ emit_handler_start (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef builder
                 * These symbols are not really used, the clause_index is embedded into the EH tables generated by DwarfMonoException in LLVM.
                 */
                LLVMSetLinkage (type_info, LLVMInternalLinkage);
-
-#ifdef TARGET_ARM
-               // test_0_invalid_unbox_arrays () fails
-               LLVM_FAILURE (ctx, "aot+clauses");
-#endif
        } else {
                /*
                 * After the cfg mempool is freed, the type info will point to stale memory,
@@ -2697,6 +2694,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
                }
 
                emit_handler_start (ctx, bb, builder);
+               CHECK_FAILURE (ctx);
                builder = ctx->builder;
        }
 
@@ -5539,70 +5537,66 @@ add_intrinsics (LLVMModuleRef module)
         * type doesn't seem to do any locking.
         */
        {
-               LLVMTypeRef memset_params [] = { LLVMPointerType (LLVMInt8Type (), 0), LLVMInt8Type (), LLVMInt32Type (), LLVMInt32Type (), LLVMInt1Type () };
+               LLVMTypeRef params [] = { LLVMPointerType (LLVMInt8Type (), 0), LLVMInt8Type (), LLVMInt32Type (), LLVMInt32Type (), LLVMInt1Type () };
 
                memset_param_count = 5;
                memset_func_name = "llvm.memset.p0i8.i32";
 
-               LLVMAddFunction (module, memset_func_name, LLVMFunctionType (LLVMVoidType (), memset_params, memset_param_count, FALSE));
+               AddFunc (module, memset_func_name, LLVMVoidType (), params, memset_param_count);
        }
 
        {
-               LLVMTypeRef memcpy_params [] = { LLVMPointerType (LLVMInt8Type (), 0), LLVMPointerType (LLVMInt8Type (), 0), LLVMInt32Type (), LLVMInt32Type (), LLVMInt1Type () };
+               LLVMTypeRef params [] = { LLVMPointerType (LLVMInt8Type (), 0), LLVMPointerType (LLVMInt8Type (), 0), LLVMInt32Type (), LLVMInt32Type (), LLVMInt1Type () };
 
                memcpy_param_count = 5;
                memcpy_func_name = "llvm.memcpy.p0i8.p0i8.i32";
 
-               LLVMAddFunction (module, memcpy_func_name, LLVMFunctionType (LLVMVoidType (), memcpy_params, memcpy_param_count, FALSE));
+               AddFunc (module, memcpy_func_name, LLVMVoidType (), params, memcpy_param_count);
        }
 
        {
                LLVMTypeRef params [] = { LLVMDoubleType () };
 
-               LLVMAddFunction (module, "llvm.sin.f64", LLVMFunctionType (LLVMDoubleType (), params, 1, FALSE));
-               LLVMAddFunction (module, "llvm.cos.f64", LLVMFunctionType (LLVMDoubleType (), params, 1, FALSE));
-               LLVMAddFunction (module, "llvm.sqrt.f64", LLVMFunctionType (LLVMDoubleType (), params, 1, FALSE));
+               AddFunc (module, "llvm.sin.f64", LLVMDoubleType (), params, 1);
+               AddFunc (module, "llvm.cos.f64", LLVMDoubleType (), params, 1);
+               AddFunc (module, "llvm.sqrt.f64", LLVMDoubleType (), params, 1);
 
                /* This isn't an intrinsic, instead llvm seems to special case it by name */
-               LLVMAddFunction (module, "fabs", LLVMFunctionType (LLVMDoubleType (), params, 1, FALSE));
+               AddFunc (module, "fabs", LLVMDoubleType (), params, 1);
        }
 
        {
                LLVMTypeRef ovf_res_i32 [] = { LLVMInt32Type (), LLVMInt1Type () };
-               LLVMTypeRef ovf_params_i32 [] = { LLVMInt32Type (), LLVMInt32Type () };
-
-               LLVMAddFunction (module, "llvm.sadd.with.overflow.i32", LLVMFunctionType (LLVMStructType (ovf_res_i32, 2, FALSE), ovf_params_i32, 2, FALSE));
-               LLVMAddFunction (module, "llvm.uadd.with.overflow.i32", LLVMFunctionType (LLVMStructType (ovf_res_i32, 2, FALSE), ovf_params_i32, 2, FALSE));
-               LLVMAddFunction (module, "llvm.ssub.with.overflow.i32", LLVMFunctionType (LLVMStructType (ovf_res_i32, 2, FALSE), ovf_params_i32, 2, FALSE));
-               LLVMAddFunction (module, "llvm.usub.with.overflow.i32", LLVMFunctionType (LLVMStructType (ovf_res_i32, 2, FALSE), ovf_params_i32, 2, FALSE));
-               LLVMAddFunction (module, "llvm.smul.with.overflow.i32", LLVMFunctionType (LLVMStructType (ovf_res_i32, 2, FALSE), ovf_params_i32, 2, FALSE));
-               LLVMAddFunction (module, "llvm.umul.with.overflow.i32", LLVMFunctionType (LLVMStructType (ovf_res_i32, 2, FALSE), ovf_params_i32, 2, FALSE));
+               LLVMTypeRef params [] = { LLVMInt32Type (), LLVMInt32Type () };
+               LLVMTypeRef ret_type = LLVMStructType (ovf_res_i32, 2, FALSE);
+
+               AddFunc (module, "llvm.sadd.with.overflow.i32", ret_type, params, 2);
+               AddFunc (module, "llvm.sadd.with.overflow.i32", ret_type, params, 2);
+               AddFunc (module, "llvm.uadd.with.overflow.i32", ret_type, params, 2);
+               AddFunc (module, "llvm.ssub.with.overflow.i32", ret_type, params, 2);
+               AddFunc (module, "llvm.usub.with.overflow.i32", ret_type, params, 2);
+               AddFunc (module, "llvm.smul.with.overflow.i32", ret_type, params, 2);
+               AddFunc (module, "llvm.umul.with.overflow.i32", ret_type, params, 2);
        }
 
        {
                LLVMTypeRef ovf_res_i64 [] = { LLVMInt64Type (), LLVMInt1Type () };
-               LLVMTypeRef ovf_params_i64 [] = { LLVMInt64Type (), LLVMInt64Type () };
-
-               LLVMAddFunction (module, "llvm.sadd.with.overflow.i64", LLVMFunctionType (LLVMStructType (ovf_res_i64, 2, FALSE), ovf_params_i64, 2, FALSE));
-               LLVMAddFunction (module, "llvm.uadd.with.overflow.i64", LLVMFunctionType (LLVMStructType (ovf_res_i64, 2, FALSE), ovf_params_i64, 2, FALSE));
-               LLVMAddFunction (module, "llvm.ssub.with.overflow.i64", LLVMFunctionType (LLVMStructType (ovf_res_i64, 2, FALSE), ovf_params_i64, 2, FALSE));
-               LLVMAddFunction (module, "llvm.usub.with.overflow.i64", LLVMFunctionType (LLVMStructType (ovf_res_i64, 2, FALSE), ovf_params_i64, 2, FALSE));
-               LLVMAddFunction (module, "llvm.smul.with.overflow.i64", LLVMFunctionType (LLVMStructType (ovf_res_i64, 2, FALSE), ovf_params_i64, 2, FALSE));
-               LLVMAddFunction (module, "llvm.umul.with.overflow.i64", LLVMFunctionType (LLVMStructType (ovf_res_i64, 2, FALSE), ovf_params_i64, 2, FALSE));
+               LLVMTypeRef params [] = { LLVMInt64Type (), LLVMInt64Type () };
+               LLVMTypeRef ret_type = LLVMStructType (ovf_res_i64, 2, FALSE);
+
+               AddFunc (module, "llvm.sadd.with.overflow.i64", ret_type, params, 2);
+               AddFunc (module, "llvm.uadd.with.overflow.i64", ret_type, params, 2);
+               AddFunc (module, "llvm.ssub.with.overflow.i64", ret_type, params, 2);
+               AddFunc (module, "llvm.usub.with.overflow.i64", ret_type, params, 2);
+               AddFunc (module, "llvm.smul.with.overflow.i64", ret_type, params, 2);
+               AddFunc (module, "llvm.umul.with.overflow.i64", ret_type, params, 2);
        }
 
        /* EH intrinsics */
        {
-               LLVMTypeRef arg_types [2];
-               LLVMTypeRef ret_type;
-
-               arg_types [0] = LLVMPointerType (LLVMInt8Type (), 0);
-               arg_types [1] = LLVMPointerType (LLVMInt8Type (), 0);
-               ret_type = LLVMInt32Type ();
-
-               LLVMAddFunction (module, "mono_personality", LLVMFunctionType (LLVMVoidType (), NULL, 0, FALSE));
+               AddFunc (module, "mono_personality", LLVMVoidType (), NULL, 0);
 
-               LLVMAddFunction (module, "llvm_resume_unwind_trampoline", LLVMFunctionType (LLVMVoidType (), NULL, 0, FALSE));
+               AddFunc (module, "llvm_resume_unwind_trampoline", LLVMVoidType (), NULL, 0);
        }
 
        /* SSE intrinsics */
@@ -5765,7 +5759,7 @@ add_intrinsics (LLVMModuleRef module)
                        arg_types [2] = LLVMInt1Type ();
                        arg_types [3] = LLVMInt32Type ();
                        sprintf (name, "llvm.mono.load.i%d.p0i%d", i * 8, i * 8);
-                       LLVMAddFunction (module, name, LLVMFunctionType (LLVMIntType (i * 8), arg_types, 4, FALSE));
+                       AddFunc (module, name, LLVMIntType (i * 8), arg_types, 4);
 
                        arg_types [0] = LLVMIntType (i * 8);
                        arg_types [1] = LLVMPointerType (LLVMIntType (i * 8), 0);
@@ -5773,7 +5767,7 @@ add_intrinsics (LLVMModuleRef module)
                        arg_types [3] = LLVMInt1Type ();
                        arg_types [4] = LLVMInt32Type ();
                        sprintf (name, "llvm.mono.store.i%d.p0i%d", i * 8, i * 8);
-                       LLVMAddFunction (module, name, LLVMFunctionType (LLVMVoidType (), arg_types, 5, FALSE));
+                       AddFunc (module, name, LLVMVoidType (), arg_types, 5);
                }
        }
 }
index cdab7a8481523fba87997df9f72b1e22db0d4583..2484e6cc9beb0d5c7a66be0e9058631963609a4c 100644 (file)
@@ -640,6 +640,11 @@ MINI_OP(OP_CALL_HANDLER  , "call_handler", NONE, NONE, NONE)
 MINI_OP(OP_START_HANDLER  , "start_handler", NONE, NONE, NONE)
 MINI_OP(OP_ENDFILTER,  "endfilter", NONE, IREG, NONE)
 MINI_OP(OP_ENDFINALLY,  "endfinally", NONE, NONE, NONE)
+/*
+ * Returns the exception object passed to catch clauses in
+ * by the EH code in a register.
+ */
+MINI_OP(OP_GET_EX_OBJ, "get_ex_obj", IREG, NONE, NONE)
 
 /* inline (long)int * (long)int */
 MINI_OP(OP_BIGMUL, "bigmul", LREG, IREG, IREG)
@@ -1066,8 +1071,8 @@ MINI_OP(OP_GC_PARAM_SLOT_LIVENESS_DEF, "gc_param_slot_liveness_def", NONE, NONE,
 /* #if defined(__native_client_codegen__) || defined(__native_client__) */
 /* We have to define these in terms of the TARGET defines, not NaCl defines */
 /* because genmdesc.pl doesn't have multiple defines per platform.          */
-#if defined(TARGET_AMD64) || defined(TARGET_X86) || defined(TARGET_ARM)
-MINI_OP(OP_NACL_GC_SAFE_POINT,     "nacl_gc_safe_point", IREG, NONE, NONE)
+#if defined(TARGET_AMD64) || defined(TARGET_X86)
+MINI_OP(OP_GC_SAFE_POINT,     "gc_safe_point", NONE, IREG, NONE)
 #endif
 
 #if defined(TARGET_X86) || defined(TARGET_AMD64)
index 215bbf53283c94db7ac135bce685221122009dfb..841ee66b2a7594df2a549754375afba4a0f475a1 100755 (executable)
@@ -86,8 +86,7 @@ MONO_FAST_TLS_DECLARE(mono_jit_tls);
 gboolean mono_compile_aot = FALSE;
 /* If this is set, no code is generated dynamically, everything is taken from AOT files */
 gboolean mono_aot_only = FALSE;
-/* Whenever to use IMT */
-gboolean mono_use_imt = TRUE;
+
 const char *mono_build_date;
 gboolean mono_do_signal_chaining;
 gboolean mono_do_crash_chaining;
@@ -227,29 +226,28 @@ mono_print_method_from_ip (void *ip)
        FindTrampUserData user_data;
        MonoGenericSharingContext*gsctx;
        const char *shared_type;
-       GSList *l;
 
-       ji = mini_jit_info_table_find (domain, ip, &target_domain);
+       ji = mini_jit_info_table_find_ext (domain, ip, TRUE, &target_domain);
+       if (ji && ji->is_trampoline) {
+               MonoTrampInfo *tinfo = ji->d.tramp_info;
+
+               printf ("IP %p is at offset 0x%x of trampoline '%s'.\n", ip, (int)((guint8*)ip - tinfo->code), tinfo->name);
+               return;
+       }
+
        if (!ji) {
                user_data.ip = ip;
                user_data.method = NULL;
                mono_domain_lock (domain);
                g_hash_table_foreach (domain_jit_info (domain)->jit_trampoline_hash, find_tramp, &user_data);
                mono_domain_unlock (domain);
+
                if (user_data.method) {
                        char *mname = mono_method_full_name (user_data.method, TRUE);
                        printf ("IP %p is a JIT trampoline for %s\n", ip, mname);
                        g_free (mname);
                        return;
                }
-               for (l = tramp_infos; l; l = l->next) {
-                       MonoTrampInfo *tinfo = l->data;
-
-                       if ((guint8*)ip >= tinfo->code && (guint8*)ip <= tinfo->code + tinfo->code_size) {
-                               printf ("IP %p is at offset 0x%x of trampoline '%s'.\n", ip, (int)((guint8*)ip - tinfo->code), tinfo->name);
-                               return;
-                       }
-               }
 
                g_print ("No method at %p\n", ip);
                fflush (stdout);
@@ -472,6 +470,20 @@ mono_tramp_info_free (MonoTrampInfo *info)
        g_free (info);
 }
 
+static void
+register_trampoline_jit_info (MonoDomain *domain, MonoTrampInfo *info)
+{
+       MonoJitInfo *ji;
+
+       ji = mono_domain_alloc0 (domain, mono_jit_info_size (0, 0, 0));
+       mono_jit_info_init (ji, NULL, info->code, info->code_size, 0, 0, 0);
+       ji->d.tramp_info = info;
+       ji->is_trampoline = TRUE;
+       // FIXME: Unwind info
+
+       mono_jit_info_table_add (domain, ji);
+}
+
 /*
  * mono_tramp_info_register:
  *
@@ -498,6 +510,9 @@ mono_tramp_info_register (MonoTrampInfo *info)
 
        mono_save_trampoline_xdebug_info (info);
 
+       if (mono_get_root_domain ())
+               register_trampoline_jit_info (mono_get_root_domain (), copy);
+
        if (mono_jit_map_is_enabled ())
                mono_emit_jit_tramp (info->code, info->code_size, info->name);
 
@@ -517,6 +532,19 @@ mono_tramp_info_cleanup (void)
        g_slist_free (tramp_infos);
 }
 
+/* Register trampolines created before the root domain was created in the jit info tables */
+static void
+register_trampolines (MonoDomain *domain)
+{
+       GSList *l;
+
+       for (l = tramp_infos; l; l = l->next) {
+               MonoTrampInfo *info = l->data;
+
+               register_trampoline_jit_info (domain, info);
+       }
+}
+
 G_GNUC_UNUSED static void
 break_count (void)
 {
@@ -1108,6 +1136,16 @@ mono_patch_info_dup_mp (MonoMemPool *mp, MonoJumpInfo *patch_info)
                //memcpy (info->locals_types, oinfo->locals_types, info->nlocals * sizeof (MonoType*));
                break;
        }
+       case MONO_PATCH_INFO_VIRT_METHOD: {
+               MonoJumpInfoVirtMethod *info;
+               MonoJumpInfoVirtMethod *oinfo;
+
+               oinfo = patch_info->data.virt_method;
+               info = mono_mempool_alloc0 (mp, sizeof (MonoJumpInfoVirtMethod));
+               res->data.virt_method = info;
+               memcpy (info, oinfo, sizeof (MonoJumpInfoVirtMethod));
+               break;
+       }
        default:
                break;
        }
@@ -1166,6 +1204,7 @@ mono_patch_info_hash (gconstpointer data)
        case MONO_PATCH_INFO_MONITOR_ENTER_V4:
        case MONO_PATCH_INFO_MONITOR_EXIT:
        case MONO_PATCH_INFO_GOT_OFFSET:
+       case MONO_PATCH_INFO_GC_SAFE_POINT_FLAG:
                return (ji->type << 8);
        case MONO_PATCH_INFO_CASTCLASS_CACHE:
                return (ji->type << 8) | (ji->data.index);
@@ -1180,6 +1219,11 @@ mono_patch_info_hash (gconstpointer data)
                return (ji->type << 8) | (gsize)ji->data.del_tramp->klass | (gsize)ji->data.del_tramp->method | (gsize)ji->data.del_tramp->virtual;
        case MONO_PATCH_INFO_LDSTR_LIT:
                return g_str_hash (ji->data.target);
+       case MONO_PATCH_INFO_VIRT_METHOD: {
+               MonoJumpInfoVirtMethod *info = ji->data.virt_method;
+
+               return (ji->type << 8) | (gssize)info->klass | (gssize)info->method;
+       }
        default:
                printf ("info type: %d\n", ji->type);
                mono_print_ji (ji); printf ("\n");
@@ -1237,6 +1281,8 @@ mono_patch_info_equal (gconstpointer ka, gconstpointer kb)
                return ji1->data.del_tramp->klass == ji2->data.del_tramp->klass && ji1->data.del_tramp->method == ji2->data.del_tramp->method && ji1->data.del_tramp->virtual == ji2->data.del_tramp->virtual;
        case MONO_PATCH_INFO_CASTCLASS_CACHE:
                return ji1->data.index == ji2->data.index;
+       case MONO_PATCH_INFO_VIRT_METHOD:
+               return ji1->data.virt_method->klass == ji2->data.virt_method->klass && ji1->data.virt_method->method == ji2->data.virt_method->method;
        default:
                if (ji1->data.target != ji2->data.target)
                        return 0;
@@ -1339,6 +1385,15 @@ mono_resolve_patch_target (MonoMethod *method, MonoDomain *domain, guint8 *code,
                target = code_slot;
                break;
        }
+       case MONO_PATCH_INFO_GC_SAFE_POINT_FLAG:
+#if defined(__native_client_codegen__)
+               target = (gpointer)&__nacl_thread_suspension_needed;
+#elif defined (USE_COOP_GC)
+               target = (gpointer)&mono_polling_required;
+#else
+               g_error ("Unsuported patch target");
+#endif
+               break;
        case MONO_PATCH_INFO_SWITCH: {
                gpointer *jump_table;
                int i;
@@ -1574,6 +1629,15 @@ mono_resolve_patch_target (MonoMethod *method, MonoDomain *domain, guint8 *code,
                        slot = mono_method_lookup_or_register_info (entry->method, entry->in_mrgctx, info, entry->info_type, mono_method_get_context (entry->method));
                        break;
                }
+               case MONO_PATCH_INFO_VIRT_METHOD: {
+                       MonoJumpInfoVirtMethod *info;
+                       MonoJumpInfoVirtMethod *oinfo = entry->data->data.virt_method;
+
+                       info = g_malloc0 (sizeof (MonoJumpInfoVirtMethod));
+                       memcpy (info, oinfo, sizeof (MonoJumpInfoVirtMethod));
+                       slot = mono_method_lookup_or_register_info (entry->method, entry->in_mrgctx, info, entry->info_type, mono_method_get_context (entry->method));
+                       break;
+               }
                default:
                        g_assert_not_reached ();
                        break;
@@ -1665,12 +1729,6 @@ mono_resolve_patch_target (MonoMethod *method, MonoDomain *domain, guint8 *code,
        return (gpointer)target;
 }
 
-static gboolean
-is_gsharedvt_type (MonoType *t)
-{
-       return (t->type == MONO_TYPE_VAR || t->type == MONO_TYPE_MVAR) && t->data.generic_param->gshared_constraint == MONO_TYPE_VALUETYPE;
-}
-
 void
 mini_init_gsctx (MonoDomain *domain, MonoMemPool *mp, MonoGenericContext *context, MonoGenericSharingContext *gsctx)
 {
@@ -1691,7 +1749,7 @@ mini_init_gsctx (MonoDomain *domain, MonoMemPool *mp, MonoGenericContext *contex
                for (i = 0; i < inst->type_argc; ++i) {
                        MonoType *type = inst->type_argv [i];
 
-                       if (is_gsharedvt_type (type))
+                       if (mini_is_gsharedvt_gparam (type))
                                gsctx->var_is_vt [i] = TRUE;
                }
        }
@@ -1707,7 +1765,7 @@ mini_init_gsctx (MonoDomain *domain, MonoMemPool *mp, MonoGenericContext *contex
                for (i = 0; i < inst->type_argc; ++i) {
                        MonoType *type = inst->type_argv [i];
 
-                       if (is_gsharedvt_type (type))
+                       if (mini_is_gsharedvt_gparam (type))
                                gsctx->mvar_is_vt [i] = TRUE;
                }
        }
@@ -2664,7 +2722,7 @@ mini_parse_debug_options (void)
                else if (!strcmp (arg, "explicit-null-checks"))
                        debug_options.explicit_null_checks = TRUE;
                else if (!strcmp (arg, "gen-seq-points"))
-                       debug_options.gen_seq_points_debug_data = TRUE;
+                       debug_options.gen_sdb_seq_points = TRUE;
                else if (!strcmp (arg, "gen-compact-seq-points"))
                        debug_options.gen_seq_points_compact_data = TRUE;
                else if (!strcmp (arg, "init-stacks"))
@@ -2677,9 +2735,11 @@ mini_parse_debug_options (void)
                        debug_options.check_pinvoke_callconv = TRUE;
                else if (!strcmp (arg, "debug-domain-unload"))
                        mono_enable_debug_domain_unload (TRUE);
+               else if (!strcmp (arg, "partial-sharing"))
+                       mono_set_partial_sharing_supported (TRUE);
                else {
                        fprintf (stderr, "Invalid option for the MONO_DEBUG env variable: %s\n", arg);
-                       fprintf (stderr, "Available options: 'handle-sigint', 'keep-delegates', 'reverse-pinvoke-exceptions', 'collect-pagefault-stats', 'break-on-unverified', 'no-gdb-backtrace', 'dont-free-domains', 'suspend-on-sigsegv', 'suspend-on-exception', 'suspend-on-unhandled', 'dyn-runtime-invoke', 'gdb', 'explicit-null-checks', 'init-stacks', 'check-pinvoke-callconv', 'debug-domain-unload'\n");
+                       fprintf (stderr, "Available options: 'handle-sigint', 'keep-delegates', 'reverse-pinvoke-exceptions', 'collect-pagefault-stats', 'break-on-unverified', 'no-gdb-backtrace', 'dont-free-domains', 'suspend-on-sigsegv', 'suspend-on-exception', 'suspend-on-unhandled', 'dyn-runtime-invoke', 'gdb', 'explicit-null-checks', 'init-stacks', 'check-pinvoke-callconv', 'debug-domain-unload', 'partial-sharing'\n");
                        exit (1);
                }
        }
@@ -2958,10 +3018,8 @@ mini_init (const char *filename, const char *runtime_version)
        callbacks.debug_log_is_enabled = mono_debugger_agent_debug_log_is_enabled;
        callbacks.tls_key_supported = mini_tls_key_supported;
 
-       if (mono_use_imt) {
-               callbacks.get_vtable_trampoline = mini_get_vtable_trampoline;
-               callbacks.get_imt_trampoline = mini_get_imt_trampoline;
-       }
+       callbacks.get_vtable_trampoline = mini_get_vtable_trampoline;
+       callbacks.get_imt_trampoline = mini_get_imt_trampoline;
 
        mono_install_callbacks (&callbacks);
 
@@ -3070,12 +3128,10 @@ mini_init (const char *filename, const char *runtime_version)
                mono_marshal_use_aot_wrappers (TRUE);
        }
 
-       if (mono_use_imt) {
-               if (mono_aot_only)
-                       mono_install_imt_thunk_builder (mono_aot_get_imt_thunk);
-               else
-                       mono_install_imt_thunk_builder (mono_arch_build_imt_thunk);
-       }
+       if (mono_aot_only)
+               mono_install_imt_thunk_builder (mono_aot_get_imt_thunk);
+       else
+               mono_install_imt_thunk_builder (mono_arch_build_imt_thunk);
 
        /*Init arch tls information only after the metadata side is inited to make sure we see dynamic appdomain tls keys*/
        mono_arch_finish_init ();
@@ -3114,6 +3170,8 @@ mini_init (const char *filename, const char *runtime_version)
        mono_tasklets_init ();
 #endif
 
+       register_trampolines (domain);
+
        if (mono_compile_aot)
                /*
                 * Avoid running managed code when AOT compiling, since the platform
@@ -3188,6 +3246,10 @@ register_icalls (void)
 #if defined(__native_client__) || defined(__native_client_codegen__)
        register_icall (mono_nacl_gc, "mono_nacl_gc", "void", TRUE);
 #endif
+#if defined(USE_COOP_GC)
+       register_icall (mono_threads_state_poll, "mono_threads_state_poll", "void", TRUE);
+#endif
+
 #ifndef MONO_ARCH_NO_EMULATE_LONG_MUL_OPTS
        register_opcode_emulation (OP_LMUL, "__emul_lmul", "long long long", mono_llmult, "mono_llmult", TRUE);
        register_opcode_emulation (OP_LDIV, "__emul_ldiv", "long long long", mono_lldiv, "mono_lldiv", FALSE);
index 004540fb7e2bc7bbf8790e10411aee7e0a852a2d..02d93488e078e7c74faa6ac6af22d261898136cc 100644 (file)
@@ -4669,6 +4669,9 @@ mono_arch_patch_code (MonoMethod *method, MonoDomain *domain,
                        case MONO_PATCH_INFO_CLASS_INIT:
                        case MONO_PATCH_INFO_GENERIC_CLASS_INIT:
                        case MONO_PATCH_INFO_RGCTX_FETCH:
+                       case MONO_PATCH_INFO_MONITOR_ENTER:
+                       case MONO_PATCH_INFO_MONITOR_ENTER_V4:
+                       case MONO_PATCH_INFO_MONITOR_EXIT:
                        case MONO_PATCH_INFO_ABS: {
                                S390_EMIT_CALL (ip, target);
                                continue;
index 7de88fdf1e2ca5018981c576fb841f1a12df9cf0..26ec96de7cb582a6676c1016b34f22ae377a2e6b 100644 (file)
@@ -62,6 +62,8 @@ typedef struct
 #define MONO_ARCH_MONITOR_ENTER_ADJUSTMENT             1
 #define MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD             1
 #define MONO_ARCH_HAVE_INVALIDATE_METHOD               1
+#define MONO_ARCH_MONITOR_OBJECT_REG                   s390_r2
+#define MONO_ARCH_LOCK_TAKEN_REG                       s390_r1
 
 #define S390_STACK_ALIGNMENT            8
 #define S390_FIRST_ARG_REG             s390_r2
index 51d7e12dca05ecdd20289adb319c25e6d20c8e23..1268f2f10d8fc9a1af46792976e87a43cfdea90d 100644 (file)
@@ -386,7 +386,7 @@ mini_add_method_trampoline (MonoMethod *orig_method, MonoMethod *m, gpointer com
  * from JITted and LLVM compiled code.
  */
 static gpointer
-common_call_trampoline (mgreg_t *regs, guint8 *code, MonoMethod *m, guint8* tramp, MonoVTable *vt, gpointer *vtable_slot, gboolean need_rgctx_tramp)
+common_call_trampoline_inner (mgreg_t *regs, guint8 *code, MonoMethod *m, guint8* tramp, MonoVTable *vt, gpointer *vtable_slot, gboolean need_rgctx_tramp)
 {
        gpointer addr, compiled_method;
        gboolean generic_shared = FALSE;
@@ -697,6 +697,16 @@ common_call_trampoline (mgreg_t *regs, guint8 *code, MonoMethod *m, guint8* tram
        return addr;
 }
 
+static gpointer
+common_call_trampoline (mgreg_t *regs, guint8 *code, MonoMethod *m, guint8* tramp, MonoVTable *vt, gpointer *vtable_slot, gboolean need_rgctx_tramp)
+{
+       gpointer res;
+       MONO_PREPARE_RESET_BLOCKING
+       res = common_call_trampoline_inner (regs, code, m, tramp, vt, vtable_slot, need_rgctx_tramp);
+       MONO_FINISH_RESET_BLOCKING
+       return res;
+}
+
 /**
  * mono_magic_trampoline:
  *
@@ -1073,10 +1083,17 @@ mono_delegate_trampoline (mgreg_t *regs, guint8 *code, gpointer *arg, guint8* tr
                        }
 
                        if (sig->hasthis && method->klass->valuetype) {
-                               if (mono_aot_only)
-                                       need_unbox_tramp = TRUE;
-                               else
-                                       method = mono_marshal_get_unbox_wrapper (method);
+                               gboolean need_unbox = TRUE;
+
+                               if (tramp_info->invoke_sig->param_count > sig->param_count && tramp_info->invoke_sig->params [0]->byref)
+                                       need_unbox = FALSE;
+
+                               if (need_unbox) {
+                                       if (mono_aot_only)
+                                               need_unbox_tramp = TRUE;
+                                       else
+                                               method = mono_marshal_get_unbox_wrapper (method);
+                               }
                        }
                }
        } else {
@@ -1879,12 +1896,12 @@ mini_get_single_step_trampoline (void)
 
        if (!trampoline) {
                gpointer tramp;
-               MonoTrampInfo *info;
 
                if (mono_aot_only) {
                        tramp = mono_aot_get_trampoline ("sdb_single_step_trampoline");
                } else {
 #ifdef MONO_ARCH_HAVE_SDB_TRAMPOLINES
+                       MonoTrampInfo *info;
                        tramp = mono_arch_create_sdb_trampoline (TRUE, &info, FALSE);
                        mono_tramp_info_register (info);
 #else
@@ -1911,12 +1928,12 @@ mini_get_breakpoint_trampoline (void)
 
        if (!trampoline) {
                gpointer tramp;
-               MonoTrampInfo *info;
 
                if (mono_aot_only) {
                        tramp = mono_aot_get_trampoline ("sdb_breakpoint_trampoline");
                } else {
 #ifdef MONO_ARCH_HAVE_SDB_TRAMPOLINES
+                       MonoTrampInfo *info;
                        tramp = mono_arch_create_sdb_trampoline (FALSE, &info, FALSE);
                        mono_tramp_info_register (info);
 #else
index 474ea72c771723c0e372bb5b8547a8aff42d9dd0..78a4fc05628e7e22628b808ae803b55c8781b82a 100644 (file)
@@ -29,6 +29,7 @@
 #include <mono/utils/mono-mmap.h>
 #include <mono/utils/mono-memory-model.h>
 #include <mono/utils/mono-hwcap-x86.h>
+#include <mono/utils/mono-threads.h>
 
 #include "trace.h"
 #include "mini-x86.h"
@@ -3382,6 +3383,10 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                        x86_ret (code);
                        break;
                }
+               case OP_GET_EX_OBJ:
+                       if (ins->dreg != X86_EAX)
+                               x86_mov_reg_reg (code, ins->dreg, X86_EAX, sizeof (gpointer));
+                       break;
 
                case OP_LABEL:
                        ins->inst_c0 = code - cfg->native_code;
@@ -5019,19 +5024,26 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                        MONO_VARINFO (cfg, ins->inst_c0)->live_range_end = code - cfg->native_code;
                        break;
                }
-               case OP_NACL_GC_SAFE_POINT: {
-#if defined(__native_client_codegen__) && defined(__native_client_gc__)
-                       if (cfg->compile_aot)
-                               code = emit_call (cfg, code, MONO_PATCH_INFO_ABS, (gpointer)mono_nacl_gc);
-                       else {
-                               guint8 *br [1];
-
-                               x86_test_mem_imm8 (code, (gpointer)&__nacl_thread_suspension_needed, 0xFFFFFFFF);
-                               br[0] = code; x86_branch8 (code, X86_CC_EQ, 0, FALSE);
-                               code = emit_call (cfg, code, MONO_PATCH_INFO_ABS, (gpointer)mono_nacl_gc);
-                               x86_patch (br[0], code);
-                       }
+               case OP_GC_SAFE_POINT: {
+                       gpointer polling_func = NULL;
+                       int compare_val;
+                       guint8 *br [1];
+
+#if defined (USE_COOP_GC)
+                       polling_func = (gpointer)mono_threads_state_poll;
+                       compare_val = 1;
+#elif defined(__native_client_codegen__) && defined(__native_client_gc__)
+                       polling_func = (gpointer)mono_nacl_gc;
+                       compare_val = 0xFFFFFFFF;
 #endif
+                       if (!polling_func)
+                               break;
+
+                       x86_test_membase_imm (code, ins->sreg1, 0, compare_val);
+                       br[0] = code; x86_branch8 (code, X86_CC_EQ, 0, FALSE);
+                       code = emit_call (cfg, code, MONO_PATCH_INFO_ABS, polling_func);
+                       x86_patch (br [0], code);
+
                        break;
                }
                case OP_GC_LIVENESS_DEF:
index c5dfcc1cf14c5a0dc8af59f60d093f06905c429e..173f05fa58d0a5babd562254f1f80a7fc5bfc0fa 100644 (file)
@@ -211,6 +211,7 @@ typedef struct {
 #define MONO_ARCH_IMT_REG X86_EDX
 #define MONO_ARCH_VTABLE_REG X86_EDX
 #define MONO_ARCH_RGCTX_REG MONO_ARCH_IMT_REG
+#define MONO_ARCH_EXC_REG X86_EAX
 #define MONO_ARCH_HAVE_GENERALIZED_IMT_THUNK 1
 #define MONO_ARCH_HAVE_LIVERANGE_OPS 1
 #define MONO_ARCH_HAVE_SIGCTX_TO_MONOCTX 1
index 7b36bf8d4571d71bc6d08433cd87f1aa010ecab1..774bcc3b5797c052cd27c56762eab6c0330cd272 100755 (executable)
@@ -2412,7 +2412,7 @@ mono_codegen (MonoCompile *cfg)
                if (cfg->opt & MONO_OPT_PEEPHOLE)
                        mono_arch_peephole_pass_2 (cfg, bb);
 
-               if (cfg->gen_seq_points && !cfg->gen_seq_points_debug_data)
+               if (cfg->gen_seq_points && !cfg->gen_sdb_seq_points)
                        bb_deduplicate_op_il_seq_points (cfg, bb);
        }
 
@@ -2464,7 +2464,7 @@ mono_codegen (MonoCompile *cfg)
 #endif
                /* Allocate the code into a separate memory pool so it can be freed */
                cfg->dynamic_info = g_new0 (MonoJitDynamicMethodInfo, 1);
-               cfg->dynamic_info->code_mp = mono_code_manager_new_dynamic ();
+               cfg->dynamic_info->code_mp = mono_code_manager_new_dynamic (cfg->thunk_area);
                mono_domain_lock (cfg->domain);
                mono_dynamic_code_hash_insert (cfg->domain, cfg->method, cfg->dynamic_info);
                mono_domain_unlock (cfg->domain);
@@ -2829,6 +2829,9 @@ create_jit_info (MonoCompile *cfg, MonoMethod *method_to_compile)
 
                        ei->flags = ec->flags;
 
+                       if (G_UNLIKELY (cfg->verbose_level >= 4))
+                               printf ("IL clause: try 0x%x-0x%x handler 0x%x-0x%x filter 0x%x\n", ec->try_offset, ec->try_offset + ec->try_len, ec->handler_offset, ec->handler_offset + ec->handler_len, ec->flags == MONO_EXCEPTION_CLAUSE_FILTER ? ec->data.filter_offset : 0);
+
                        /*
                         * The spvars are needed by mono_arch_install_handler_block_guard ().
                         */
@@ -2960,12 +2963,6 @@ create_jit_info (MonoCompile *cfg, MonoMethod *method_to_compile)
 }
 #endif
 
-static gboolean
-is_gsharedvt_type (MonoType *t)
-{
-       return (t->type == MONO_TYPE_VAR || t->type == MONO_TYPE_MVAR) && t->data.generic_param->gshared_constraint == MONO_TYPE_VALUETYPE;
-}
-
 /* Return whenever METHOD is a gsharedvt method */
 static gboolean
 is_gsharedvt_method (MonoMethod *method)
@@ -2980,13 +2977,13 @@ is_gsharedvt_method (MonoMethod *method)
        inst = context->class_inst;
        if (inst) {
                for (i = 0; i < inst->type_argc; ++i)
-                       if (is_gsharedvt_type (inst->type_argv [i]))
+                       if (mini_is_gsharedvt_gparam (inst->type_argv [i]))
                                return TRUE;
        }
        inst = context->method_inst;
        if (inst) {
                for (i = 0; i < inst->type_argc; ++i)
-                       if (is_gsharedvt_type (inst->type_argv [i]))
+                       if (mini_is_gsharedvt_gparam (inst->type_argv [i]))
                                return TRUE;
        }
        return FALSE;
@@ -3008,6 +3005,71 @@ is_open_method (MonoMethod *method)
 }
 
 #ifndef DISABLE_JIT
+
+static void
+mono_create_gc_safepoint (MonoCompile *cfg, MonoBasicBlock *bblock)
+{
+#if defined(__native_client_codegen__) || USE_COOP_GC
+
+       MonoInst *poll_addr, *ins;
+       if (cfg->verbose_level)
+               printf ("ADDING SAFE POINT TO BB %d\n", bblock->block_num);
+
+#if defined(__native_client_codegen__)
+       NEW_AOTCONST (cfg, poll_addr, MONO_PATCH_INFO_GC_SAFE_POINT_FLAG, (gpointer)&__nacl_thread_suspension_needed);
+#else
+       NEW_AOTCONST (cfg, poll_addr, MONO_PATCH_INFO_GC_SAFE_POINT_FLAG, (gpointer)&mono_polling_required);
+#endif
+
+       MONO_INST_NEW (cfg, ins, OP_GC_SAFE_POINT);
+       ins->sreg1 = poll_addr->dreg;
+
+        if (bblock->flags & BB_EXCEPTION_HANDLER) {
+               MonoInst *eh_op = bblock->code;
+
+               // we only skip the ops that start EH blocks.
+               if (eh_op && eh_op->opcode != OP_START_HANDLER && eh_op->opcode != OP_GET_EX_OBJ)
+                       eh_op = NULL;
+
+               mono_bblock_insert_after_ins (bblock, eh_op, poll_addr);
+               mono_bblock_insert_after_ins (bblock, poll_addr, ins);
+       } else if (bblock == cfg->bb_entry) {
+               mono_bblock_insert_after_ins (bblock, bblock->last_ins, poll_addr);
+               mono_bblock_insert_after_ins (bblock, poll_addr, ins);
+
+       } else {
+               mono_bblock_insert_before_ins (bblock, NULL, poll_addr);
+               mono_bblock_insert_after_ins (bblock, poll_addr, ins);
+       }
+
+#endif
+}
+
+/*
+This code inserts safepoints into managed code at important code paths.
+Those are:
+
+-the first basic block
+-landing BB for exception handlers
+-loop body starts.
+
+*/
+static void
+mono_insert_safepoints (MonoCompile *cfg)
+{
+#if defined(__native_client_codegen__) || defined(USE_COOP_GC)
+       MonoBasicBlock *bb;
+
+       if (cfg->verbose_level)
+               printf ("INSERTING SAFEPOINTS\n");
+
+       for (bb = cfg->bb_entry; bb; bb = bb->next_bb) {
+               if (bb->loop_body_start || bb == cfg->bb_entry || bb->flags & BB_EXCEPTION_HANDLER)
+                       mono_create_gc_safepoint (cfg, bb);
+       }
+#endif
+}
+
 /*
  * mini_method_compile:
  * @method: the method to compile
@@ -3119,8 +3181,20 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl
        cfg->full_aot = full_aot;
        cfg->skip_visibility = method->skip_visibility;
        cfg->orig_method = method;
-       cfg->gen_seq_points = debug_options.gen_seq_points_compact_data || debug_options.gen_seq_points_debug_data;
-       cfg->gen_seq_points_debug_data = debug_options.gen_seq_points_debug_data;
+       cfg->gen_seq_points = debug_options.gen_seq_points_compact_data || debug_options.gen_sdb_seq_points;
+       cfg->gen_sdb_seq_points = debug_options.gen_sdb_seq_points;
+
+#ifdef PLATFORM_ANDROID
+       if (cfg->method->wrapper_type != MONO_WRAPPER_NONE) {
+               /* FIXME: Why is this needed */
+               cfg->gen_seq_points = FALSE;
+               cfg->gen_sdb_seq_points = FALSE;
+       }
+#endif
+       /* coop / nacl requires loop detection to happen */
+#if defined(__native_client_codegen__) || defined(USE_COOP_GC)
+       cfg->opt |= MONO_OPT_LOOP;
+#endif
 
        cfg->explicit_null_checks = debug_options.explicit_null_checks;
        cfg->soft_breakpoints = debug_options.soft_breakpoints;
@@ -3545,6 +3619,8 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl
                mono_compute_natural_loops (cfg);
        }
 
+       mono_insert_safepoints (cfg);
+
        /* after method_to_ir */
        if (parts == 1) {
                if (MONO_METHOD_COMPILE_END_ENABLED ())
index 4f57200d16d3c902f55e050f1b9c8e584e4e51f5..11b446709a9d72e8bb7228c4abbc64f26038e79d 100644 (file)
 #endif
 
 /* Version number of the AOT file format */
-#define MONO_AOT_FILE_VERSION 110
+#define MONO_AOT_FILE_VERSION 115
 
 //TODO: This is x86/amd64 specific.
 #define mono_simd_shuffle_mask(a,b,c,d) ((a) | ((b) << 2) | ((c) << 4) | ((d) << 6))
@@ -482,7 +482,6 @@ extern gboolean mono_break_on_exc;
 extern int mono_exc_esp_offset;
 extern gboolean mono_compile_aot;
 extern gboolean mono_aot_only;
-extern gboolean mono_use_imt;
 extern MonoMethodDesc *mono_inject_async_exc_method;
 extern int mono_inject_async_exc_pos;
 extern MonoMethodDesc *mono_break_at_bb_method;
@@ -1123,6 +1122,14 @@ typedef enum {
        /* The address of Nullable<T>.Box () */
        MONO_RGCTX_INFO_NULLABLE_CLASS_BOX,
        MONO_RGCTX_INFO_NULLABLE_CLASS_UNBOX,
+       /* MONO_PATCH_INFO_VCALL_METHOD */
+       MONO_RGCTX_INFO_VIRT_METHOD_CODE,
+       /*
+        * MONO_PATCH_INFO_VCALL_METHOD
+        * Same as MONO_RGCTX_INFO_CLASS_BOX_TYPE, but for the class
+        * which implements the method.
+        */
+       MONO_RGCTX_INFO_VIRT_METHOD_BOX_TYPE
 } MonoRgctxInfoType;
 
 typedef struct _MonoRuntimeGenericContextInfoTemplate {
@@ -1216,6 +1223,17 @@ typedef struct MonoJumpInfoImtTramp {
 
 typedef struct MonoJumpInfoGSharedVtCall MonoJumpInfoGSharedVtCall;
 
+/*
+ * Represents the method which is called when a virtual call is made to METHOD
+ * on a receiver of type KLASS.
+ */
+typedef struct {
+       /* Receiver class */
+       MonoClass *klass;
+       /* Virtual method */
+       MonoMethod *method;
+} MonoJumpInfoVirtMethod;
+
 typedef struct MonoJumpInfo MonoJumpInfo;
 struct MonoJumpInfo {
        MonoJumpInfo *next;
@@ -1252,10 +1270,16 @@ struct MonoJumpInfo {
                MonoGSharedVtMethodInfo *gsharedvt_method;
                MonoMethodSignature *sig;
                MonoDelegateClassMethodPair *del_tramp;
+               /* MONO_PATCH_INFO_VIRT_METHOD */
+               MonoJumpInfoVirtMethod *virt_method;
        } data;
 };
  
-/* Contains information describing an rgctx entry */
+/*
+ * Contains information for computing the
+ * property given by INFO_TYPE of the runtime
+ * object described by DATA.
+ */
 struct MonoJumpInfoRgctxEntry {
        MonoMethod *method;
        gboolean in_mrgctx;
@@ -1518,7 +1542,7 @@ typedef struct {
        guint            keep_cil_nops : 1;
        guint            gen_seq_points : 1;
        /* Generate seq points for use by the debugger */
-       guint            gen_seq_points_debug_data : 1;
+       guint            gen_sdb_seq_points : 1;
        guint            explicit_null_checks : 1;
        guint            compute_gc_maps : 1;
        guint            soft_breakpoints : 1;
@@ -1541,6 +1565,8 @@ typedef struct {
        GHashTable       *token_info_hash;
        MonoCompileArch  arch;
        guint32          inline_depth;
+       /* Size of memory reserved for thunks */
+       int              thunk_area;
        guint32          exception_type;        /* MONO_EXCEPTION_* */
        guint32          exception_data;
        char*            exception_message;
@@ -1884,7 +1910,7 @@ typedef struct {
         * Whenever data such as next sequence points and flags is required.
         * Next sequence points and flags are required by the debugger agent.
         */
-       gboolean gen_seq_points_debug_data;
+       gboolean gen_sdb_seq_points;
        gboolean gen_seq_points_compact_data;
        gboolean explicit_null_checks;
        /*
@@ -2614,6 +2640,7 @@ void     mono_setup_altstack                    (MonoJitTlsData *tls);
 void     mono_free_altstack                     (MonoJitTlsData *tls);
 gpointer mono_altstack_restore_prot             (mgreg_t *regs, guint8 *code, gpointer *tramp_data, guint8* tramp);
 MonoJitInfo* mini_jit_info_table_find           (MonoDomain *domain, char *addr, MonoDomain **out_domain);
+MonoJitInfo* mini_jit_info_table_find_ext       (MonoDomain *domain, char *addr, gboolean allow_trampolines, MonoDomain **out_domain);
 void     mono_resume_unwind                     (MonoContext *ctx) MONO_LLVM_INTERNAL;
 
 MonoJitInfo * mono_find_jit_info                (MonoDomain *domain, MonoJitTlsData *jit_tls, MonoJitInfo *res, MonoJitInfo *prev_ji, MonoContext *ctx, MonoContext *new_ctx, char **trace, MonoLMF **lmf, int *native_offset, gboolean *managed);
@@ -2784,6 +2811,9 @@ mini_class_is_generic_sharable (MonoClass *klass);
 gboolean
 mono_is_partially_sharable_inst (MonoGenericInst *inst);
 
+gboolean
+mini_is_gsharedvt_gparam (MonoType *t);
+
 MonoGenericSharingContext* mono_get_generic_context_from_code (guint8 *code);
 
 MonoGenericContext* mini_method_get_context (MonoMethod *method);
diff --git a/mono/mini/mini.prj b/mono/mini/mini.prj
deleted file mode 100644 (file)
index b9bd7c2..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-;; -*- Prcs -*-
-(Created-By-Prcs-Version 1 3 2)
-(Project-Description "The mono SSA-based JIT.")
-(Project-Version mini 0 3)
-(Parent-Version mini 0 2)
-(Version-Log "")
-(New-Version-Log "")
-(Checkin-Time "Sat, 21 Sep 2002 12:11:29 +0200")
-(Checkin-Login lupus)
-(Populate-Ignore ())
-(Project-Keywords)
-(Files
-;; This is a comment.  Fill in files here.
-;; For example:  (prcs/checkout.cc ())
-
-;; Files added by populate at Sat, 08 Jun 2002 17:27:56 +0200,
-;; to version 0.0(w), by lupus:
-
-  (regalloc.c (mini/0_regalloc.c 1.1 664))
-  (cfold.c (mini/1_cfold.c 1.1 664))
-  (mini-x86.c (mini/2_mini-x86.c 1.2 664))
-  (mini.h (mini/3_mini.h 1.3 664))
-  (makefile (mini/4_makefile 1.3 664))
-  (test.cs (mini/5_test.cs 1.1 664))
-  (mini.c (mini/6_mini.c 1.3 664))
-)
-(Merge-Parents)
-(New-Merge-Parents)
index 063ebe7c7c1c403bc43defe0bbcff23113b647aa..4f31fd5bd360616ae6b7a38ef7aa2767fd9e0baf 100644 (file)
@@ -54,4 +54,6 @@ PATCH_INFO(OBJC_SELECTOR_REF, "objc_selector_ref")
 PATCH_INFO(METHOD_CODE_SLOT, "method_code_slot")
 PATCH_INFO(LDSTR_LIT, "ldstr_lit")
 PATCH_INFO(GC_NURSERY_START, "gc_nursery_start")
+PATCH_INFO(VIRT_METHOD, "virt_method")
+PATCH_INFO(GC_SAFE_POINT_FLAG, "gc_safe_point_flag")
 PATCH_INFO(NONE, "none")
index 26ac63986a36f6ee51ed94a7fa82a611b3d6ffe8..c0dcd6da7daabfcadb27011f09f7b51be9f9c60a 100644 (file)
@@ -49,7 +49,7 @@ mono_save_seq_point_info (MonoCompile *cfg)
        GSList **next = NULL;
        SeqPoint* seq_points;
        GByteArray* array;
-       gboolean has_debug_data = cfg->gen_seq_points_debug_data;
+       gboolean has_debug_data = cfg->gen_sdb_seq_points;
 
        if (!cfg->seq_points)
                return;
index bf1e37d31b1f489371ddfe15ebcfcd61cc011af1..0f484a98758ab2c15d81df374257df9e9eaabe59 100644 (file)
@@ -61,7 +61,16 @@ The advantage of this change is that it could have a _membase version and promot
 without a OP_LDADDR.
 */
 
-#ifdef MONO_ARCH_SIMD_INTRINSICS
+#if defined (MONO_ARCH_SIMD_INTRINSICS)
+
+#if defined (DISABLE_JIT)
+
+void
+mono_simd_intrinsics_init (void)
+{
+}
+
+#else
 
 //#define IS_DEBUG_ON(cfg) (0)
 
@@ -1673,4 +1682,5 @@ mono_emit_simd_intrinsics (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign
        return NULL;
 }
 
-#endif
+#endif /* DISABLE_JIT */
+#endif /* MONO_ARCH_SIMD_INTRINSICS */
index 6bf83070e3db311560bbe0092383a3a32ceb5518..22e66acb8029dbc845557ba325f56046a4d40d3e 100755 (executable)
@@ -701,11 +701,9 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf
        mono_arch_flush_icache (buf, code - buf);
        mono_profiler_code_buffer_new (buf, code - buf, MONO_PROFILER_CODE_BUFFER_HELPER, NULL);
 
-       if (info) {
-               tramp_name = mono_get_generic_trampoline_name (tramp_type);
-               *info = mono_tramp_info_create (tramp_name, buf, code - buf, ji, unwind_ops);
-               g_free (tramp_name);
-       }
+       tramp_name = mono_get_generic_trampoline_name (tramp_type);
+       *info = mono_tramp_info_create (tramp_name, buf, code - buf, ji, unwind_ops);
+       g_free (tramp_name);
 
        return buf;
 }
@@ -724,8 +722,7 @@ mono_arch_get_nullified_class_init_trampoline (MonoTrampInfo **info)
        mono_arch_flush_icache (buf, code - buf);
        mono_profiler_code_buffer_new (buf, code - buf, MONO_PROFILER_CODE_BUFFER_HELPER, NULL);
 
-       if (info)
-               *info = mono_tramp_info_create ("nullified_class_init_trampoline", buf, code - buf, NULL, NULL);
+       *info = mono_tramp_info_create ("nullified_class_init_trampoline", buf, code - buf, NULL, NULL);
 
        return buf;
 }
@@ -895,11 +892,9 @@ mono_arch_create_rgctx_lazy_fetch_trampoline (guint32 slot, MonoTrampInfo **info
 
        g_assert (code - buf <= tramp_size);
 
-       if (info) {
-               char *name = mono_get_rgctx_fetch_trampoline_name (slot);
-               *info = mono_tramp_info_create (name, buf, code - buf, ji, unwind_ops);
-               g_free (name);
-       }
+       char *name = mono_get_rgctx_fetch_trampoline_name (slot);
+       *info = mono_tramp_info_create (name, buf, code - buf, ji, unwind_ops);
+       g_free (name);
 
        return buf;
 }
@@ -948,8 +943,7 @@ mono_arch_create_generic_class_init_trampoline (MonoTrampInfo **info, gboolean a
 
        g_assert (code - buf <= tramp_size);
 
-       if (info)
-               *info = mono_tramp_info_create ("generic_class_init_trampoline", buf, code - buf, ji, unwind_ops);
+       *info = mono_tramp_info_create ("generic_class_init_trampoline", buf, code - buf, ji, unwind_ops);
 
        return buf;
 }
@@ -1105,12 +1099,10 @@ mono_arch_create_monitor_enter_trampoline (MonoTrampInfo **info, gboolean is_v4,
        mono_profiler_code_buffer_new (buf, code - buf, MONO_PROFILER_CODE_BUFFER_MONITOR, NULL);
        g_assert (code - buf <= tramp_size);
 
-       if (info) {
-               if (is_v4)
-                       *info = mono_tramp_info_create ("monitor_enter_v4_trampoline", buf, code - buf, ji, unwind_ops);
-               else
-                       *info = mono_tramp_info_create ("monitor_enter_trampoline", buf, code - buf, ji, unwind_ops);
-       }
+       if (is_v4)
+               *info = mono_tramp_info_create ("monitor_enter_v4_trampoline", buf, code - buf, ji, unwind_ops);
+       else
+               *info = mono_tramp_info_create ("monitor_enter_trampoline", buf, code - buf, ji, unwind_ops);
 
        return buf;
 }
@@ -1121,7 +1113,7 @@ mono_arch_create_monitor_exit_trampoline (MonoTrampInfo **info, gboolean aot)
        guint8 *tramp;
        guint8 *code, *buf;
        guint8 *jump_obj_null, *jump_have_waiters, *jump_sync_null, *jump_not_owned, *jump_cmpxchg_failed;
-       guint8 *jump_next;
+       guint8 *jump_next, *jump_sync_thin_hash = NULL;
        int tramp_size;
        int status_offset, nest_offset;
        MonoJumpInfo *ji = NULL;
@@ -1159,6 +1151,7 @@ mono_arch_create_monitor_exit_trampoline (MonoTrampInfo **info, gboolean aot)
                        /*if bit zero is set it's a thin hash*/
                        /*FIXME use testb encoding*/
                        amd64_test_reg_imm (code, sync_reg, 0x01);
+                       jump_sync_thin_hash = code;
                        amd64_branch8 (code, X86_CC_NE, -1, 1);
 
                        /*clear bits used by the gc*/
@@ -1216,6 +1209,8 @@ mono_arch_create_monitor_exit_trampoline (MonoTrampInfo **info, gboolean aot)
                amd64_dec_membase_size (code, sync_reg, nest_offset, 4);
                amd64_ret (code);
 
+               if (jump_sync_thin_hash)
+                       x86_patch (jump_sync_thin_hash, code);
                x86_patch (jump_obj_null, code);
                x86_patch (jump_have_waiters, code);
                x86_patch (jump_not_owned, code);
@@ -1241,8 +1236,7 @@ mono_arch_create_monitor_exit_trampoline (MonoTrampInfo **info, gboolean aot)
        mono_profiler_code_buffer_new (buf, code - buf, MONO_PROFILER_CODE_BUFFER_MONITOR, NULL);
        g_assert (code - buf <= tramp_size);
 
-       if (info)
-               *info = mono_tramp_info_create ("monitor_exit_trampoline", buf, code - buf, ji, unwind_ops);
+       *info = mono_tramp_info_create ("monitor_exit_trampoline", buf, code - buf, ji, unwind_ops);
 
        return buf;
 }
@@ -1321,8 +1315,7 @@ mono_arch_create_handler_block_trampoline (MonoTrampInfo **info, gboolean aot)
        mono_profiler_code_buffer_new (buf, code - buf, MONO_PROFILER_CODE_BUFFER_HELPER, NULL);
        g_assert (code - buf <= tramp_size);
 
-       if (info)
-               *info = mono_tramp_info_create ("handler_block_trampoline", buf, code - buf, ji, unwind_ops);
+       *info = mono_tramp_info_create ("handler_block_trampoline", buf, code - buf, ji, unwind_ops);
 
        return buf;
 }
@@ -1466,10 +1459,8 @@ mono_arch_create_sdb_trampoline (gboolean single_step, MonoTrampInfo **info, gbo
        mono_arch_flush_icache (code, code - buf);
        g_assert (code - buf <= tramp_size);
 
-       if (info) {
-               const char *tramp_name = single_step ? "sdb_single_step_trampoline" : "sdb_breakpoint_trampoline";
-               *info = mono_tramp_info_create (tramp_name, buf, code - buf, ji, unwind_ops);
-       }
+       const char *tramp_name = single_step ? "sdb_single_step_trampoline" : "sdb_breakpoint_trampoline";
+       *info = mono_tramp_info_create (tramp_name, buf, code - buf, ji, unwind_ops);
 
        return buf;
 }
index bbc70fc28a5d4b8887cdabc8ea26a609628ead3c..f0ff43749fbcf0712d300bfce56486022bf2c9c9 100644 (file)
@@ -467,11 +467,10 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf
        /* Sanity check */
        g_assert ((code - buf) <= buf_len);
 
-       if (info) {
-               tramp_name = mono_get_generic_trampoline_name (tramp_type);
-               *info = mono_tramp_info_create (tramp_name, buf, code - buf, ji, unwind_ops);
-               g_free (tramp_name);
-       }
+       g_assert (info);
+       tramp_name = mono_get_generic_trampoline_name (tramp_type);
+       *info = mono_tramp_info_create (tramp_name, buf, code - buf, ji, unwind_ops);
+       g_free (tramp_name);
 
        return buf;
 }
@@ -488,8 +487,7 @@ mono_arch_get_nullified_class_init_trampoline (MonoTrampInfo **info)
        mono_arch_flush_icache (buf, code - buf);
        mono_profiler_code_buffer_new (buf, code - buf, MONO_PROFILER_CODE_BUFFER_HELPER, NULL);
 
-       if (info)
-               *info = mono_tramp_info_create ("nullified_class_init_trampoline", buf, code - buf, NULL, NULL);
+       *info = mono_tramp_info_create ("nullified_class_init_trampoline", buf, code - buf, NULL, NULL);
 
        return buf;
 }
@@ -790,11 +788,9 @@ mono_arch_create_rgctx_lazy_fetch_trampoline (guint32 slot, MonoTrampInfo **info
 
        g_assert (code - buf <= tramp_size);
 
-       if (info) {
-               char *name = mono_get_rgctx_fetch_trampoline_name (slot);
-               *info = mono_tramp_info_create (name, buf, code - buf, ji, unwind_ops);
-               g_free (name);
-       }
+       char *name = mono_get_rgctx_fetch_trampoline_name (slot);
+       *info = mono_tramp_info_create (name, buf, code - buf, ji, unwind_ops);
+       g_free (name);
 
        return buf;
 }
@@ -827,8 +823,7 @@ mono_arch_create_general_rgctx_lazy_fetch_trampoline (MonoTrampInfo **info, gboo
 
        g_assert (code - buf <= tramp_size);
 
-       if (info)
-               *info = mono_tramp_info_create ("rgctx_fetch_trampoline_general", buf, code - buf, ji, unwind_ops);
+       *info = mono_tramp_info_create ("rgctx_fetch_trampoline_general", buf, code - buf, ji, unwind_ops);
 
        return buf;
 }
@@ -902,8 +897,7 @@ mono_arch_create_generic_class_init_trampoline (MonoTrampInfo **info, gboolean a
 
        g_assert (code - buf <= tramp_size);
 
-       if (info)
-               *info = mono_tramp_info_create ("generic_class_init_trampoline", buf, code - buf, ji, unwind_ops);
+       *info = mono_tramp_info_create ("generic_class_init_trampoline", buf, code - buf, ji, unwind_ops);
 
        return buf;
 }
@@ -956,8 +950,7 @@ mono_arch_create_handler_block_trampoline (MonoTrampInfo **info, gboolean aot)
        mono_profiler_code_buffer_new (buf, code - buf, MONO_PROFILER_CODE_BUFFER_HELPER, NULL);
        g_assert (code - buf <= tramp_size);
 
-       if (info)
-               *info = mono_tramp_info_create ("handler_block_trampoline", buf, code - buf, ji, unwind_ops);
+       *info = mono_tramp_info_create ("handler_block_trampoline", buf, code - buf, ji, unwind_ops);
 
        return buf;
 }
@@ -1165,8 +1158,7 @@ mono_arm_start_gsharedvt_call (GSharedVtCallInfo *info, gpointer *caller, gpoint
 gpointer
 mono_arch_get_gsharedvt_trampoline (MonoTrampInfo **info, gboolean aot)
 {
-       if (info)
-               *info = NULL;
+       *info = NULL;
        return NULL;
 }
 
index 8024cc0ca085cc8f31167ce48a92f9d5b189a6e3..c8f9754ec82552d563a53863db2225d5c9717b76 100644 (file)
@@ -181,8 +181,7 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf
        unw_dyn_region_info_t *r_pro;
 
        g_assert (!aot);
-       if (info)
-               *info = NULL;
+       *info = NULL;
 
        /* 
         * Since jump trampolines are not patched, this trampoline is executed every
index 9b80527ae790288c183d35d6511ce47a4d768751..fd8d426af74a028c4cea9449b695545a0603f173 100644 (file)
@@ -304,11 +304,10 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf
        /* Sanity check */
        g_assert ((code - buf) <= max_code_len);
 
-       if (info) {
-               tramp_name = mono_get_generic_trampoline_name (tramp_type);
-               *info = mono_tramp_info_create (tramp_name, buf, code - buf, ji, unwind_ops);
-               g_free (tramp_name);
-       }
+       g_assert (info);
+       tramp_name = mono_get_generic_trampoline_name (tramp_type);
+       *info = mono_tramp_info_create (tramp_name, buf, code - buf, ji, unwind_ops);
+       g_free (tramp_name);
 
        return buf;
 }
index 1b2cc1dfb91f0b043c62cfcef28161ddd6f8880b..721ad88cc6cb5506736882598983d0897a92d334 100644 (file)
@@ -432,11 +432,10 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf
        /* Sanity check */
        g_assert ((code - buf) <= size);
 
-       if (info) {
-               tramp_name = mono_get_generic_trampoline_name (tramp_type);
-               *info = mono_tramp_info_create (tramp_name, buf, code - buf, ji, unwind_ops);
-               g_free (tramp_name);
-       }
+       g_assert (info);
+       tramp_name = mono_get_generic_trampoline_name (tramp_type);
+       *info = mono_tramp_info_create (tramp_name, buf, code - buf, ji, unwind_ops);
+       g_free (tramp_name);
 
        return buf;
 }
@@ -607,11 +606,9 @@ mono_arch_create_rgctx_lazy_fetch_trampoline (guint32 slot, MonoTrampInfo **info
 
        g_assert (code - buf <= tramp_size);
 
-       if (info) {
-               char *name = mono_get_rgctx_fetch_trampoline_name (slot);
-               *info = mono_tramp_info_create (name, buf, code - buf, ji, unwind_ops);
-               g_free (name);
-       }
+       char *name = mono_get_rgctx_fetch_trampoline_name (slot);
+       *info = mono_tramp_info_create (name, buf, code - buf, ji, unwind_ops);
+       g_free (name);
 
        return buf;
 #else
@@ -669,8 +666,7 @@ mono_arch_create_generic_class_init_trampoline (MonoTrampInfo **info, gboolean a
 
        g_assert (code - buf <= tramp_size);
 
-       if (info)
-               *info = mono_tramp_info_create ("generic_class_init_trampoline", buf, code - buf, ji, unwind_ops);
+       *info = mono_tramp_info_create ("generic_class_init_trampoline", buf, code - buf, ji, unwind_ops);
 
        return buf;
 }
@@ -688,8 +684,7 @@ mono_arch_get_nullified_class_init_trampoline (MonoTrampInfo **info)
 
        g_assert (code - buf <= tramp_size);
 
-       if (info)
-               *info = mono_tramp_info_create ("nullified_class_init_trampoline", buf, code - buf, NULL, NULL);
+       *info = mono_tramp_info_create ("nullified_class_init_trampoline", buf, code - buf, NULL, NULL);
 
        return buf;
 }
index e6bbe8ccb7eea82ff0a57b974d5da42086ef6408..14a96653d67c2f7f1ffcd2398bf287d29589087e 100644 (file)
 
 #include <mono/metadata/abi-details.h>
 #include <mono/metadata/appdomain.h>
+#include <mono/metadata/gc-internal.h>
 #include <mono/metadata/marshal.h>
-#include <mono/metadata/tabledefs.h>
+#include <mono/metadata/monitor.h>
 #include <mono/metadata/profiler-private.h>
+#include <mono/metadata/tabledefs.h>
 #include <mono/arch/s390x/s390x-codegen.h>
 
 #include "mini.h"
@@ -202,9 +204,8 @@ mono_arch_get_nullified_class_init_trampoline (MonoTrampInfo **info)
        mono_arch_flush_icache (buf, code - buf);
        mono_profiler_code_buffer_new (buf, code - buf, MONO_PROFILER_CODE_BUFFER_HELPER, NULL);
 
-       if (info)
-               *info = mono_tramp_info_create ("nullified_class_init_trampoline", 
-                                               buf, code - buf, NULL, NULL);
+       *info = mono_tramp_info_create ("nullified_class_init_trampoline", 
+                                                                       buf, code - buf, NULL, NULL);
 
        return (buf);
 }
@@ -359,7 +360,8 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf
        else
                s390_lg (buf, s390_r4, 0, STK_BASE, METHOD_SAVE_OFFSET);
 
-       /* Arg 4: trampoline address. Ignore for now */
+       /* Arg 4: trampoline address. */
+       S390_SET (buf, s390_r5, buf);
                
        /* Calculate call address and call the C trampoline. Return value will be in r2 */
        tramp = (guint8*)mono_get_trampoline_func (tramp_type);
@@ -406,11 +408,10 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf
        mono_arch_flush_icache (code, buf - code);
        mono_profiler_code_buffer_new (buf, code - buf, MONO_PROFILER_CODE_BUFFER_GENERICS_TRAMPOLINE, NULL);
        
-       if (info) {
-               tramp_name = mono_get_generic_trampoline_name (tramp_type);
-               *info = mono_tramp_info_create (tramp_name, buf, buf - code, ji, unwind_ops);
-               g_free (tramp_name);
-       }
+       g_assert (info);
+       tramp_name = mono_get_generic_trampoline_name (tramp_type);
+       *info = mono_tramp_info_create (tramp_name, buf, buf - code, ji, unwind_ops);
+       g_free (tramp_name);
 
        /* Sanity check */
        g_assert ((buf - code) <= 512);
@@ -465,7 +466,18 @@ mono_arch_create_specific_trampoline (gpointer arg1, MonoTrampolineType tramp_ty
        /*----------------------------------------------------------*/
        code = buf = mono_domain_code_reserve (domain, SPECIFIC_TRAMPOLINE_SIZE);
 
-       S390_SET  (buf, s390_r1, arg1);
+       switch (tramp_type) {
+       /*
+        * Monitor tramps have the object in r2
+        */
+       case MONO_TRAMPOLINE_MONITOR_ENTER:
+       case MONO_TRAMPOLINE_MONITOR_ENTER_V4:
+       case MONO_TRAMPOLINE_MONITOR_EXIT:
+               s390_lgr (buf, s390_r1, s390_r2);
+               break;
+       default :
+               S390_SET  (buf, s390_r1, arg1);
+       }
        displace = (tramp - buf) / 2;
        s390_jg   (buf, displace);
 
@@ -592,11 +604,9 @@ mono_arch_create_rgctx_lazy_fetch_trampoline (guint32 slot, MonoTrampInfo **info
 
        g_assert (code - buf <= tramp_size);
 
-       if (info) {
-               char *name = mono_get_rgctx_fetch_trampoline_name (slot);
-               *info = mono_tramp_info_create (name, buf, code - buf, ji, unwind_ops);
-               g_free (name);
-       }
+       char *name = mono_get_rgctx_fetch_trampoline_name (slot);
+       *info = mono_tramp_info_create (name, buf, code - buf, ji, unwind_ops);
+       g_free (name);
 
        return(buf);
 #else
@@ -711,8 +721,7 @@ mono_arch_create_handler_block_trampoline (MonoTrampInfo **info, gboolean aot)
        mono_profiler_code_buffer_new (buf, code - buf, MONO_PROFILER_CODE_BUFFER_HELPER, NULL);
        g_assert (code - buf <= tramp_size);
 
-       if (info)
-               *info = mono_tramp_info_create ("handler_block_trampoline", buf, code - buf, ji, unwind_ops);
+       *info = mono_tramp_info_create ("handler_block_trampoline", buf, code - buf, ji, unwind_ops);
 
        return buf;
 }
@@ -763,10 +772,305 @@ mono_arch_create_generic_class_init_trampoline (MonoTrampInfo **info, gboolean a
 
        g_assert (code - buf <= tramp_size);
 
-       if (info)
-               *info = mono_tramp_info_create ("generic_class_init_trampoline", buf, code - buf, ji, unwind_ops);
+       *info = mono_tramp_info_create ("generic_class_init_trampoline", buf, code - buf, ji, unwind_ops);
 
        return(buf);
 }
 
 /*========================= End of Function ========================*/
+
+#ifdef MONO_ARCH_MONITOR_OBJECT_REG
+/*------------------------------------------------------------------*/
+/*                                                                  */
+/* Name                - mono_arch_create_monitor_enter_trampoline         */
+/*                                                                  */
+/* Function    -                                                   */
+/*                                                                  */
+/*------------------------------------------------------------------*/
+
+gpointer
+mono_arch_create_monitor_enter_trampoline (MonoTrampInfo **info, gboolean is_v4, gboolean aot)
+{
+       guint8  *tramp,
+               *code, *buf;
+       gint16  *jump_obj_null, 
+               *jump_sync_null, 
+               *jump_cs_failed, 
+               *jump_other_owner, 
+               *jump_tid, 
+               *jump_sync_thin_hash = NULL,
+               *jump_lock_taken_true = NULL;
+       int tramp_size,
+           status_reg = s390_r0,
+           lock_taken_reg = s390_r1,
+           obj_reg = s390_r2,
+           sync_reg = s390_r3,
+           tid_reg = s390_r4,
+           status_offset,
+           nest_offset;
+       MonoJumpInfo *ji = NULL;
+       GSList *unwind_ops = NULL;
+
+       g_assert (MONO_ARCH_MONITOR_OBJECT_REG == obj_reg);
+#ifdef MONO_ARCH_MONITOR_LOCK_TAKEN_REG
+       g_assert (MONO_ARCH_MONITOR_LOCK_TAKEN_REG == lock_taken_reg);
+#else
+       g_assert (!is_v4);
+#endif
+
+       mono_monitor_threads_sync_members_offset (&status_offset, &nest_offset);
+       g_assert (MONO_THREADS_SYNC_MEMBER_SIZE (status_offset) == sizeof (guint32));
+       g_assert (MONO_THREADS_SYNC_MEMBER_SIZE (nest_offset) == sizeof (guint32));
+       status_offset = MONO_THREADS_SYNC_MEMBER_OFFSET (status_offset);
+       nest_offset = MONO_THREADS_SYNC_MEMBER_OFFSET (nest_offset);
+
+       tramp_size = 160;
+
+       code = buf = mono_global_codeman_reserve (tramp_size);
+
+       unwind_ops = mono_arch_get_cie_program ();
+
+       if (mono_thread_get_tls_offset () != -1) {
+               /* MonoObject* obj is in obj_reg */
+               /* is obj null? */
+               s390_ltgr (code, obj_reg, obj_reg);
+               /* if yes, jump to actual trampoline */
+               s390_jz (code, 0); CODEPTR(code, jump_obj_null);
+
+               if (is_v4) {
+                       s390_cli (code, lock_taken_reg, 0, 1);
+                       /* if *lock_taken is 1, jump to actual trampoline */
+                       s390_je (code, 0); CODEPTR(code, jump_lock_taken_true);
+               }
+
+               /* load obj->synchronization to sync_reg */
+               s390_lg (code, sync_reg, 0, obj_reg, MONO_STRUCT_OFFSET (MonoObject, synchronisation));
+
+               if (mono_gc_is_moving ()) {
+                       /*if bit zero is set it's a thin hash*/
+                       s390_tmll (code, sync_reg, 1);
+                       s390_jo  (code, 0); CODEPTR(code, jump_sync_thin_hash);
+
+                       /* Clear bits used by the gc */
+                       s390_nill (code, sync_reg, ~0x3);
+               }
+
+               /* is synchronization null? */
+               s390_ltgr (code, sync_reg, sync_reg);
+               /* if yes, jump to actual trampoline */
+               s390_jz (code, 0); CODEPTR(code, jump_sync_null);
+
+               /* load MonoInternalThread* into tid_reg */
+               s390_ear (code, s390_r5, 0);
+               s390_sllg(code, s390_r5, s390_r5, 0, 32);
+               s390_ear (code, s390_r5, 1);
+               /* load tid */
+               s390_lg  (code, tid_reg, 0, s390_r5, mono_thread_get_tls_offset ());
+               s390_lgf (code, tid_reg, 0, tid_reg, MONO_STRUCT_OFFSET (MonoInternalThread, small_id));
+
+               /* is synchronization->owner free */
+               s390_lgf  (code, status_reg, 0, sync_reg, status_offset);
+               s390_nilf (code, status_reg, OWNER_MASK);
+               /* if not, jump to next case */
+               s390_jnz  (code, 0); CODEPTR(code, jump_tid);
+
+               /* if yes, try a compare-exchange with the TID */
+               /* Form new status in tid_reg */
+               s390_xr (code, tid_reg, status_reg);
+               /* compare and exchange */
+               s390_cs (code, status_reg, tid_reg, sync_reg, status_offset);
+               s390_jnz (code, 0); CODEPTR(code, jump_cs_failed);
+               /* if successful, return */
+               if (is_v4)
+                       s390_mvi (code, lock_taken_reg, 0, 1);
+               s390_br (code, s390_r14);
+
+               /* next case: synchronization->owner is not null */
+               PTRSLOT(code, jump_tid);
+               /* is synchronization->owner == TID? */
+               s390_nilf (code, status_reg, OWNER_MASK);
+               s390_cr (code, status_reg, tid_reg);
+               /* if not, jump to actual trampoline */
+               s390_jnz (code, 0); CODEPTR(code, jump_other_owner);
+               /* if yes, increment nest */
+               s390_lgf (code, s390_r5, 0, sync_reg, nest_offset);
+               s390_ahi (code, s390_r5, 1);
+               s390_st  (code, s390_r5, 0, sync_reg, nest_offset);
+               /* return */
+               if (is_v4)
+                       s390_mvi (code, lock_taken_reg, 0, 1);
+               s390_br (code, s390_r14);
+
+               PTRSLOT (code, jump_obj_null);
+               if (jump_sync_thin_hash)
+                       PTRSLOT (code, jump_sync_thin_hash);
+               PTRSLOT (code, jump_sync_null);
+               PTRSLOT (code, jump_cs_failed);
+               PTRSLOT (code, jump_other_owner);
+               if (is_v4)
+                       PTRSLOT (code, jump_lock_taken_true);
+       }
+
+       /* jump to the actual trampoline */
+       if (is_v4)
+               tramp = mono_arch_create_specific_trampoline (NULL, MONO_TRAMPOLINE_MONITOR_ENTER_V4, mono_get_root_domain (), NULL);
+       else
+               tramp = mono_arch_create_specific_trampoline (NULL, MONO_TRAMPOLINE_MONITOR_ENTER, mono_get_root_domain (), NULL);
+
+       /* jump to the actual trampoline */
+       S390_SET (code, s390_r1, tramp);
+       s390_br (code, s390_r1);
+
+       mono_arch_flush_icache (code, code - buf);
+       mono_profiler_code_buffer_new (buf, code - buf, MONO_PROFILER_CODE_BUFFER_MONITOR, NULL);
+       g_assert (code - buf <= tramp_size);
+
+       if (info) {
+               if (is_v4)
+                       *info = mono_tramp_info_create ("monitor_enter_v4_trampoline", buf, code - buf, ji, unwind_ops);
+               else
+                       *info = mono_tramp_info_create ("monitor_enter_trampoline", buf, code - buf, ji, unwind_ops);
+       }
+
+       return buf;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/*                                                                  */
+/* Name                - mono_arch_create_monitor_exit_trampoline          */
+/*                                                                  */
+/* Function    -                                                   */
+/*                                                                  */
+/*------------------------------------------------------------------*/
+
+gpointer
+mono_arch_create_monitor_exit_trampoline (MonoTrampInfo **info, gboolean aot)
+{
+       guint8  *tramp,
+               *code, *buf;
+       gint16  *jump_obj_null, 
+               *jump_have_waiters, 
+               *jump_sync_null, 
+               *jump_not_owned, 
+               *jump_cs_failed,
+               *jump_next,
+               *jump_sync_thin_hash = NULL;
+       int     tramp_size,
+               status_offset, nest_offset;
+       MonoJumpInfo *ji = NULL;
+       GSList *unwind_ops = NULL;
+       int     obj_reg = s390_r2,
+               sync_reg = s390_r3,
+               status_reg = s390_r4;
+
+       g_assert (obj_reg == MONO_ARCH_MONITOR_OBJECT_REG);
+
+       mono_monitor_threads_sync_members_offset (&status_offset, &nest_offset);
+       g_assert (MONO_THREADS_SYNC_MEMBER_SIZE (status_offset) == sizeof (guint32));
+       g_assert (MONO_THREADS_SYNC_MEMBER_SIZE (nest_offset) == sizeof (guint32));
+       status_offset = MONO_THREADS_SYNC_MEMBER_OFFSET (status_offset);
+       nest_offset = MONO_THREADS_SYNC_MEMBER_OFFSET (nest_offset);
+
+       tramp_size = 160;
+
+       code = buf = mono_global_codeman_reserve (tramp_size);
+
+       unwind_ops = mono_arch_get_cie_program ();
+
+       if (mono_thread_get_tls_offset () != -1) {
+               /* MonoObject* obj is in obj_reg */
+               /* is obj null? */
+               s390_ltgr (code, obj_reg, obj_reg);
+               /* if yes, jump to actual trampoline */
+               s390_jz (code, 0); CODEPTR(code, jump_obj_null);
+
+               /* load obj->synchronization to RCX */
+               s390_lg (code, sync_reg, 0, obj_reg, MONO_STRUCT_OFFSET (MonoObject, synchronisation));
+
+               if (mono_gc_is_moving ()) {
+                       /*if bit zero is set it's a thin hash*/
+                       s390_tmll (code, sync_reg, 1);
+                       s390_jo   (code, 0); CODEPTR(code, jump_sync_thin_hash);
+
+                       /* Clear bits used by the gc */
+                       s390_nill (code, sync_reg, ~0x3);
+               }
+
+               /* is synchronization null? */
+               s390_ltgr (code, sync_reg, sync_reg);
+               /* if yes, jump to actual trampoline */
+               s390_jz (code, 0); CODEPTR(code, jump_sync_null);
+
+               /* next case: synchronization is not null */
+               /* load MonoInternalThread* into r5 */
+               s390_ear (code, s390_r5, 0);
+               s390_sllg(code, s390_r5, s390_r5, 0, 32);
+               s390_ear (code, s390_r5, 1);
+               /* load TID into r1 */
+               s390_lg  (code, s390_r1, 0, s390_r5, mono_thread_get_tls_offset ());
+               s390_lgf (code, s390_r1, 0, s390_r1, MONO_STRUCT_OFFSET (MonoInternalThread, small_id));
+               /* is synchronization->owner == TID */
+               s390_lgf (code, status_reg, 0, sync_reg, status_offset);
+               s390_xr  (code, s390_r1, status_reg);
+               s390_tmlh (code, s390_r1, OWNER_MASK);
+               /* if not, jump to actual trampoline */
+               s390_jno (code, 0); CODEPTR(code, jump_not_owned);
+
+               /* next case: synchronization->owner == TID */
+               /* is synchronization->nest == 1 */
+               s390_lgf (code, s390_r0, 0, sync_reg, nest_offset);
+               s390_chi (code, s390_r0, 1);
+               /* if not, jump to next case */
+               s390_jne (code, 0); CODEPTR(code, jump_next);
+               /* if yes, is synchronization->entry_count greater than zero */
+               s390_cfi (code, status_reg, ENTRY_COUNT_WAITERS);
+               /* if not, jump to actual trampoline */
+               s390_jnz (code, 0); CODEPTR(code, jump_have_waiters);
+               /* if yes, try to set synchronization->owner to null and return */
+               /* old status in s390_r0 */
+               s390_lgfr (code, s390_r0, status_reg);
+               /* form new status */
+               s390_nilf (code, status_reg, ENTRY_COUNT_MASK);
+               /* compare and exchange */
+               s390_cs (code, s390_r0, status_reg, sync_reg, status_offset);
+               /* if not successful, jump to actual trampoline */
+               s390_jnz (code, 0); CODEPTR(code, jump_cs_failed);
+               s390_br  (code, s390_r14);
+
+               /* next case: synchronization->nest is not 1 */
+               PTRSLOT (code, jump_next);
+               /* decrease synchronization->nest and return */
+               s390_lgf (code, s390_r0, 0, sync_reg, nest_offset);
+               s390_ahi (code, s390_r0, -1);
+               s390_st  (code, s390_r0, 0, sync_reg, nest_offset);
+               s390_br  (code, s390_r14);
+
+               PTRSLOT (code, jump_obj_null);
+               if (jump_sync_thin_hash)
+                       PTRSLOT (code, jump_sync_thin_hash);
+               PTRSLOT (code, jump_have_waiters);
+               PTRSLOT (code, jump_not_owned);
+               PTRSLOT (code, jump_cs_failed);
+               PTRSLOT (code, jump_sync_null);
+       }
+
+       /* jump to the actual trampoline */
+       tramp = mono_arch_create_specific_trampoline (NULL, MONO_TRAMPOLINE_MONITOR_EXIT, mono_get_root_domain (), NULL);
+
+       S390_SET (code, s390_r1, tramp);
+       s390_br (code, s390_r1);
+
+       mono_arch_flush_icache (code, code - buf);
+       mono_profiler_code_buffer_new (buf, code - buf, MONO_PROFILER_CODE_BUFFER_MONITOR, NULL);
+       g_assert (code - buf <= tramp_size);
+
+       if (info)
+               *info = mono_tramp_info_create ("monitor_exit_trampoline", buf, code - buf, ji, unwind_ops);
+
+       return buf;
+}
+
+/*========================= End of Function ========================*/
+#endif
index 1288603235a8f34bb2584e1bed38223653d2bd37..56ace7a014f33976b60abd7bc364864ec97e03b1 100644 (file)
@@ -85,8 +85,7 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf
        gboolean has_caller;
 
        g_assert (!aot);
-       if (info)
-               *info = NULL;
+       *info = NULL;
 
        if (tramp_type == MONO_TRAMPOLINE_JUMP)
                has_caller = FALSE;
@@ -279,8 +278,7 @@ mono_arch_get_nullified_class_init_trampoline (MonoTrampInfo **info)
 
        mono_arch_flush_icache (buf, code - buf);
 
-       if (info)
-               *info = mono_tramp_info_create ("nullified_class_init_trampoline", buf, code - buf, NULL, NULL);
+       *info = mono_tramp_info_create ("nullified_class_init_trampoline", buf, code - buf, NULL, NULL);
 
        return buf;
 }
index 3b29b4d8ad30bcdef51c9e2aaa8667d0206a3d4f..4724abf8097e9c8ad11f6eae8dfbc6d05158e0b2 100644 (file)
@@ -495,11 +495,9 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf
        g_assert ((code - buf) <= 256);
        mono_profiler_code_buffer_new (buf, code - buf, MONO_PROFILER_CODE_BUFFER_HELPER, NULL);
 
-       if (info) {
-               tramp_name = mono_get_generic_trampoline_name (tramp_type);
-               *info = mono_tramp_info_create (tramp_name, buf, code - buf, ji, unwind_ops);
-               g_free (tramp_name);
-       }
+       tramp_name = mono_get_generic_trampoline_name (tramp_type);
+       *info = mono_tramp_info_create (tramp_name, buf, code - buf, ji, unwind_ops);
+       g_free (tramp_name);
 
        return buf;
 }
@@ -518,8 +516,7 @@ mono_arch_get_nullified_class_init_trampoline (MonoTrampInfo **info)
        mono_arch_flush_icache (buf, code - buf);
        mono_profiler_code_buffer_new (buf, code - buf, MONO_PROFILER_CODE_BUFFER_HELPER, NULL);
 
-       if (info)
-               *info = mono_tramp_info_create ("nullified_class_init_trampoline", buf, code - buf, NULL, NULL);
+       *info = mono_tramp_info_create ("nullified_class_init_trampoline", buf, code - buf, NULL, NULL);
 
        return buf;
 }
@@ -646,11 +643,9 @@ mono_arch_create_rgctx_lazy_fetch_trampoline (guint32 slot, MonoTrampInfo **info
 
        g_assert (code - buf <= tramp_size);
 
-       if (info) {
-               char *name = mono_get_rgctx_fetch_trampoline_name (slot);
-               *info = mono_tramp_info_create (name, buf, code - buf, ji, unwind_ops);
-               g_free (name);
-       }
+       char *name = mono_get_rgctx_fetch_trampoline_name (slot);
+       *info = mono_tramp_info_create (name, buf, code - buf, ji, unwind_ops);
+       g_free (name);
 
        return buf;
 }
@@ -692,8 +687,7 @@ mono_arch_create_general_rgctx_lazy_fetch_trampoline (MonoTrampInfo **info, gboo
 
        g_assert (code - buf <= tramp_size);
 
-       if (info)
-               *info = mono_tramp_info_create ("rgctx_fetch_trampoline_general", buf, code - buf, ji, unwind_ops);
+       *info = mono_tramp_info_create ("rgctx_fetch_trampoline_general", buf, code - buf, ji, unwind_ops);
 
        return buf;
 }
@@ -750,8 +744,7 @@ mono_arch_create_generic_class_init_trampoline (MonoTrampInfo **info, gboolean a
        nacl_global_codeman_validate (&buf, tramp_size, &code);
        mono_profiler_code_buffer_new (buf, code - buf, MONO_PROFILER_CODE_BUFFER_HELPER, NULL);
 
-       if (info)
-               *info = mono_tramp_info_create ("generic_class_init_trampoline", buf, code - buf, ji, unwind_ops);
+       *info = mono_tramp_info_create ("generic_class_init_trampoline", buf, code - buf, ji, unwind_ops);
 
        return buf;
 }
@@ -931,12 +924,10 @@ mono_arch_create_monitor_enter_trampoline (MonoTrampInfo **info, gboolean is_v4,
        nacl_global_codeman_validate (&buf, tramp_size, &code);
        mono_profiler_code_buffer_new (buf, code - buf, MONO_PROFILER_CODE_BUFFER_MONITOR, NULL);
 
-       if (info) {
-               if (is_v4)
-                       *info = mono_tramp_info_create ("monitor_enter_v4_trampoline", buf, code - buf, ji, unwind_ops);
-               else
-                       *info = mono_tramp_info_create ("monitor_enter_trampoline", buf, code - buf, ji, unwind_ops);
-       }
+       if (is_v4)
+               *info = mono_tramp_info_create ("monitor_enter_v4_trampoline", buf, code - buf, ji, unwind_ops);
+       else
+               *info = mono_tramp_info_create ("monitor_enter_trampoline", buf, code - buf, ji, unwind_ops);
 
        return buf;
 }
@@ -1071,8 +1062,7 @@ mono_arch_create_monitor_exit_trampoline (MonoTrampInfo **info, gboolean aot)
        g_assert (code - buf <= tramp_size);
        mono_profiler_code_buffer_new (buf, code - buf, MONO_PROFILER_CODE_BUFFER_MONITOR, NULL);
 
-       if (info)
-               *info = mono_tramp_info_create ("monitor_exit_trampoline", buf, code - buf, ji, unwind_ops);
+       *info = mono_tramp_info_create ("monitor_exit_trampoline", buf, code - buf, ji, unwind_ops);
 
        return buf;
 }
@@ -1155,8 +1145,7 @@ mono_arch_create_handler_block_trampoline (MonoTrampInfo **info, gboolean aot)
        mono_profiler_code_buffer_new (buf, code - buf, MONO_PROFILER_CODE_BUFFER_HELPER, NULL);
        g_assert (code - buf <= tramp_size);
 
-       if (info)
-               *info = mono_tramp_info_create ("handler_block_trampoline", buf, code - buf, ji, unwind_ops);
+       *info = mono_tramp_info_create ("handler_block_trampoline", buf, code - buf, ji, unwind_ops);
 
        return buf;
 }
@@ -1215,8 +1204,7 @@ mono_arch_get_gsharedvt_arg_trampoline (MonoDomain *domain, gpointer arg, gpoint
 gpointer
 mono_arch_get_gsharedvt_trampoline (MonoTrampInfo **info, gboolean aot)
 {
-       if (info)
-               *info = NULL;
+       *info = NULL;
        return NULL;
 }
 
index 6e95ad6e5d520f6d9b72d22106ca81f1c03d43aa..17bf3ad8962d35d90c07c8602049fe59a2b73a9b 100644 (file)
@@ -68,16 +68,11 @@ static int map_hw_reg_to_dwarf_reg [] = {
        72, 73, 74, 75, 76, 77, 78, 79,
 };
 #elif defined (TARGET_X86)
-#ifdef __APPLE__
 /*
- * LLVM seems to generate unwind info where esp is encoded as 5, and ebp as 4, ie see this line:
- *   def ESP : RegisterWithSubRegs<"esp", [SP]>, DwarfRegNum<[-2, 5, 4]>;
- * in lib/Target/X86/X86RegisterInfo.td in the llvm sources.
+ * ebp and esp are swapped:
+ * http://lists.cs.uiuc.edu/pipermail/lldb-dev/2014-January/003101.html
  */
 static int map_hw_reg_to_dwarf_reg [] = { 0, 1, 2, 3, 5, 4, 6, 7, 8 };
-#else
-static int map_hw_reg_to_dwarf_reg [] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 };
-#endif
 /* + 1 is for IP */
 #define NUM_REGS X86_NREG + 1
 #define DWARF_DATA_ALIGN (-4)
index 63c62f015b268c91ee1ded40ae302047c199e0b9..115232490c3930eef2241e06b2840690ca67e189 100644 (file)
@@ -18,11 +18,10 @@ if HAVE_VTUNE
 vtune_lib = libmono-profiler-vtune.la
 endif
 
-lib_LTLIBRARIES = libmono-profiler-cov.la libmono-profiler-aot.la libmono-profiler-iomap.la libmono-profiler-log.la $(vtune_lib)
+lib_LTLIBRARIES = libmono-profiler-aot.la libmono-profiler-iomap.la libmono-profiler-log.la $(vtune_lib)
 
 if PLATFORM_DARWIN
 libmono_profiler_log_la_LDFLAGS = -Wl,-undefined -Wl,suppress -Wl,-flat_namespace
-libmono_profiler_cov_la_LDFLAGS = -Wl,-undefined -Wl,suppress -Wl,-flat_namespace
 endif
 if PLATFORM_ANDROID
 libmono_profiler_log_la_LDFLAGS = -avoid-version
@@ -56,12 +55,8 @@ else
 LIBMONO=$(top_builddir)/mono/mini/libmonosgen-$(API_VER).la
 endif
 
-libmono_profiler_cov_la_SOURCES = mono-cov.c
-libmono_profiler_cov_la_LIBADD = $(LIBMONO) $(GLIB_LIBS) $(LIBICONV)
 libmono_profiler_aot_la_SOURCES = mono-profiler-aot.c
 libmono_profiler_aot_la_LIBADD = $(LIBMONO) $(GLIB_LIBS) $(LIBICONV)
-#libmono_profiler_logging_la_SOURCES = mono-profiler-logging.c
-#libmono_profiler_logging_la_LIBADD = $(LIBMONO) $(GLIB_LIBS) $(LIBICONV)
 libmono_profiler_iomap_la_SOURCES = mono-profiler-iomap.c
 libmono_profiler_iomap_la_LIBADD = $(LIBMONO) $(GLIB_LIBS) $(LIBICONV)
 libmono_profiler_log_la_SOURCES = proflog.c
@@ -96,5 +91,5 @@ else
 check-local: testlog
 endif
 
-EXTRA_DIST=utils.c utils.h proflog.h log-profiler.txt perf_event.h \
+EXTRA_DIST=utils.c utils.h proflog.h perf_event.h \
        $(PLOG_TESTS_SRC) ptestrunner.pl
diff --git a/mono/profiler/log-profiler.txt b/mono/profiler/log-profiler.txt
deleted file mode 100644 (file)
index 10140c6..0000000
+++ /dev/null
@@ -1,411 +0,0 @@
-# The Mono log profiler
-
-The Mono *log* profiler can be used to collect a lot of information about
-a program running in the Mono runtime. This data can be used (both while the process
-is running and later) to do analyses of the program behaviour, determine
-resource usage, performance issues or even look for particular execution patterns.
-
-This is accomplished by logging the events provided by the Mono runtime through the
-profiling interface and periodically writing them to a file which can be later
-inspected with the command line *mprof-report* program or with a GUI (not developed yet).
-
-The events collected include (among others):
-
-* method enter and leave
-* object allocation
-* garbage collection
-* JIT compilation
-* metadata loading
-* lock contention
-* exceptions
-
-In addition, the profiler can periodically collect info about all the objects
-present in the heap at the end of a garbage collection (this is called heap shot
-and currently implemented only for the sgen garbage collector).
-Another available profiler mode is the *sampling* or *statistical* mode:
-periodically the program is sampled and the information about what the program was
-busy with is saved. This allows to get information about the program behaviour
-without degrading its performance too much (usually less than 10%).
-
-## Basic profiler usage
-
-The simpler way to use the profiler is the following:
-
-`mono --profile=log program.exe`
-
-At the end of the execution the file *output.mlpd* will be found in the current
-directory. A summary report of the data can be printed by running:
-
-`mprof-report output.mlpd`
-
-With this invocation a huge amount of data is collected about the program execution
-and collecting and saving this data can significantly slow down program execution.
-If saving the profiling data is not needed, a report can be generated directly with:
-
-`mono --profile=log:report program.exe`
-
-If the information about allocations is not of interest, it can be excluded:
-
-`mono --profile=log:noalloc program.exe`
-
-On the other hand, if method call timing is not important, while allocations are,
-the needed info can be gathered with:
-
-`mono --profile=log:nocalls program.exe`
-
-You will still be able to inspect information about the sequence of calls that lead
-to each allocation because at each object allocation a stack trace is collected if
-full enter/leave information is not available.
-
-To periodically collect heap shots (and exclude method and allocation events) use the
-following options (making sure you run with the sgen garbage collector):
-
-`mono --gc=sgen --profile=log:heapshot program.exe`
-
-To perform a sampling profiler run, use the *sample* option:
-
-`mono --profile=log:sample program.exe`
-
-## Profiler option documentation
-
-By default the *log* profiler will gather all the events provided by the Mono runtime
-and write them to a file named *output.mlpd*. When no option is specified, it
-is equivalent to using:
-
-`--profile=log:calls,alloc,output=output.mlpd,maxframes=8,calldepth=100`
-
-The following options can be used to modify this default behaviour. Each option
-is separated from the next by a `,` character, with no spaces and all the options
-are included after the *log:* profile module specifier.
-
-* *help*: display concise help info about each available option
-
-* *[no]alloc*: *noalloc* disables collecting object allocation info, *alloc* enables
-it if it was disabled by another option like *heapshot*.
-
-* *[no]calls*: *nocalls* disables collecting method enter and leave events. When this
-option is used at each object allocation and at some other events (like lock contentions
-and exception throws) a stack trace is collected by default. See the *maxframes* option to
-control this behaviour. *calls* enables method enter/leave events if they were disabled
-by another option like *heapshot*.
-
-* *heapshot[=MODE]*: collect heap shot data at each major collection. The frequency of the
-heap shots can be changed with the *MODE* parameter. When this option is used
-allocation events and method enter/leave events are not recorded by default: if they
-are needed, they need to be enabled explicitly.
-The optional parameter *MODE* can modify the default heap shot frequency.
-heapshot can be used multiple times with different modes: in that case a heap shot is
-taken if either of the conditions are met.
-MODE can be one of:
-       * *NUM*ms: perform a heap shot if at least *NUM* milliseconds passed since
-       the last one.
-       * *NUM*gc: perform a heap shot every *NUM* major garbage collections
-       * *ondemand*: perform a heap shot when such a command is sent to the
-       control port
-
-* *sample[=TYPE[/FREQ]]*: collect statistical samples of the program behaviour. The
-default is to collect a 1000 times per second the instruction pointer. This is
-equivalent to the value "cycles/1000" for *TYPE*. On some systems, like with recent
-Linux kernels, it is possible to cause the sampling to happen for other events
-provided by the performance counters of the cpu. In this case, *TYPE* can be one of:
-       * *cycles*: processor cycles
-       * *instr*: executed instructions
-       * *cacherefs*: cache references
-       * *cachemiss*: cache misses
-       * *branches*: executed branches
-       * *branchmiss*: mispredicted branches
-
-* *time=TIMER*: use the TIMER timestamp mode. TIMER can have the following values:
-       * *fast*: a usually faster but possibly more inaccurate timer
-
-* *maxframes=NUM*: when a stack trace needs to be performed, collect *NUM* frames
-at the most. The default is 8.
-
-* *calldepth=NUM*: ignore method enter/leave events when the call chain depth is
-bigger than NUM.
-
-* *zip*: automatically compress the output data in gzip format.
-
-* *output=OUTSPEC*: instead of writing the profiling data to the output.mlpd file,
-substitute *%p* in *OUTSPEC* with the current process id and *%t* with the current
-date and time, then do according to *OUTSPEC*:
-       * if *OUTSPEC* begins with a *|* character, execute the rest as a program
-       and feed the data to its standard input
-       * if *OUTSPEC* begins with a *-* character, use the rest of OUTSPEC as
-       the filename, but force overwrite any existing file by that name
-       * if *OUTSPEC* begins with a *#* character, use the rest of OUTSPEC as a
-       file descriptor and feed the data to it.
-       * otherwise write the data the the named file: note that is a file by that
-       name already exists, a warning is issued and profiling is disabled.
-
-* *report*: the profiling data is sent to mprof-report, which will print a summary
-report. This is equivalent to the option: `output=mprof-report -`. If the *output*
-option is specified as well, the report will be written to the output file instead of
-the console.
-
-* *port=PORT*: specify the tcp/ip port to use for the listening command server.
-Currently not available for windows.
-This server is started for example when heapshot=ondemand is used: it will read
-commands line by line. The following commands are available:
-       * *heapshot*: perform a heapshot as soon as possible
-
-## Analyzing the profile data
-
-Currently there is a command line program (*mprof-report*) to analyze the
-data produced by the profiler. This is ran automatically when the *report*
-profiler option is used.
-Simply run:
-
-`mprof-report output.mlpd`
-
-to see a summary report of the data included in the file.
-
-### Trace information for events
-
-Often it is important for some events, like allocations, lock contention
-and exception throws to know where they happened. Or we may want to see
-what sequence of calls leads to a particular method invocation. To see this
-info invoke mprof-report as follows:
-
-`mprof-report --traces output.mlpd`
-
-The maximum number of methods in each stack trace can be specified with the 
-*--maxframes=NUM* option:
-
-`mprof-report --traces --maxframes=4 output.mlpd`
-
-The stack trace info will be available if method enter/leave events have been
-recorded or if stack trace collection wasn't explicitly disabled with the
-*maxframes=0* profiler option. Note that the profiler will collect up to 8
-frames by default at specific events when the *nocalls* option is used, so
-in that case, if more stack frames are required in mprof-report, a bigger
-value for maxframes when profiling must be used, too.
-
-The *--traces* option also controls the reverse reference feature in the heapshot
-report: for each class it reports how many references to objects of that class
-come from other classes.
-
-### Sort order for methods and allocations
-
-When a list of methods is printed the default sort order is based on the total time
-spent in the method. This time is wall clock time (that is, it includes the time
-spent, for example, in a sleep call, even if actual cpu time would be basically 0).
-Also, if the method has been ran on different threads, the time will be a sum
-of the time used in each thread.
-
-To change the sort order, use the option:
-
-`--method-sort=MODE`
-
-where *MODE* can be:
-
-* *self*: amount of time spent in the method itself and not in its callees
-* *calls*: the number of method invocations
-* *total*: the total time spent in the method.
-
-Object allocation lists are sorted by default depending on the total amount
-of bytes used by each type.
-
-To change the sort order of object allocations, use the option:
-
-`--alloc-sort=MODE`
-
-where *MODE* can be:
-
-* *count*: the number of allocated objects of the given type
-* *bytes*: the total number of bytes used by objects of the given type
-
-### Selecting what data to report
-
-The profiler by default collects data about many runtime subsystems and mprof-report
-prints a summary of all the subsystems that are found in the data file. It is possible
-to tell mprof-report to only show information about some of them with the following
-option:
-
-`--reports=R1[,R2...]`
-
-where the report names R1, R2 etc. can be:
-
-* *header*: information about program startup and profiler version
-* *jit*: JIT compiler information
-* *sample*: statistical sampling information
-* *gc*: garbage collection information
-* *alloc*: object allocation information
-* *call*: method profiling information
-* *metadata*: metadata events like image loads
-* *exception*: exception throw and handling information
-* *monitor*: lock contention information
-* *thread*: thread information
-* *heapshot*: live heap usage at heap shots
-
-It is possible to limit some of the data displayed to a timeframe of the
-program execution with the option:
-
-`--time=FROM-TO`
-
-where *FROM* and *TO* are seconds since application startup (they can be
-floating point numbers).
-
-Another interesting option is to consider only events happening on a particular
-thread with the following option:
-
-`--thread=THREADID`
-
-where *THREADID* is one of the numbers listed in the thread summary report
-(or a thread name when present).
-
-By default long lists of methods or other information like object allocations
-are limited to the most important data. To increase the amount of information
-printed you can use the option:
-
-`--verbose`
-
-### Track individual objects
-
-Instead of printing the usual reports from the profiler data, it is possible
-to track some interesting information about some specific object addresses.
-The objects are selected based on their address with the *--track* option as follows:
-
-`--track=0xaddr1[,0xaddr2,...]`
-
-The reported info (if available in the data file), will be class name, size,
-creation time, stack trace of creation (with the *--traces* option), etc.
-If heapshot data is available it will be possible to also track what other objects
-reference one of the listed addresses.
-
-The object addresses can be gathered either from the profiler report in some
-cases (like in the monitor lock report), from the live application or they can
-be selected with the *--find=FINDSPEC* option. FINDSPEC can be one of the
-following:
-
-* *S:SIZE*: where the object is selected if it's size is at least *SIZE* 
-* *T:NAME*: where the object is selected if *NAME* partially matches its class name
-
-This option can be specified multiple times with one of the different kinds
-of FINDSPEC. For example, the following:
-
-`--find=S:10000 --find=T:Byte[]`
-
-will find all the byte arrays that are at least 10000 bytes in size.
-
-Note that with a moving garbage collector the object address can change, so
-you may need to track the changed address manually. It can also happen that
-multiple objects are allocated at the same address, so the output from this
-option can become large.
-
-### Saving a profiler report
-
-By default mprof-report will print the summary data to the console.
-To print it to a file, instead, use the option:
-
-`--out=FILENAME`
-
-## Dealing with profiler slowness
-
-If the profiler needs to collect lots of data, the execution of the program will
-slow down significantly, usually 10 to 20 times slower. There are several
-ways to reduce the impact of the profiler on the program execution.
-
-### Use the statistical sampling mode
-
-Statistical sampling allows executing a program under the profiler with minimal
-performance overhead (usually less than 10%). This mode allows checking where
-the program is spending most of it's execution time without significantly
-perturbing its behaviour.
-
-### Collect less data
-
-Collecting method enter/leave events can be very expensive, especially in programs
-that perform many millions of tiny calls. The profiler option *nocalls* can be
-used to avoid collecting this data or it can be limited to only a few call levels
-with the *calldepth* option.
-
-Object allocation information is expensive as well, though much less than
-method enter/leave events. If it's not needed, it can be skipped with the
-*noalloc* profiler option. Note that when method enter/leave events are
-discarded, by default stack traces are collected at each allocation and this
-can be expensive as well. The impact of stack trace information can be reduced
-by setting a low value with the *maxframes* option or by eliminating them
-completely, by setting it to 0.
-
-The other major source of data is the heapshot profiler option: especially
-if the managed heap is big, since every object needs to be inspected. The *MODE*
-parameter of the *heapshot* option can be used to reduce the frequency of the heap
-shots.
-
-### Reduce the timestamp overhead
-
-On many operating systems or architectures what actually slows down profiling
-is the function provided by the system to get timestamp information.
-The *time=fast* profiler option can be usually used to speed up this operation,
-but, depending on the system, time accounting may have some level of approximation
-(though statistically the data should be still fairly valuable).
-
-## Dealing with the size of the data files
-
-When collecting a lot of information about a profiled program, huge data
-files can be generated. There are a few ways to minimize the amount of data,
-for example by not collecting some of the more space-consuming information
-or by compressing the information on the fly or by just generating a summary
-report.
-
-### Reducing the amount of data
-
-Method enter/leave events can be excluded completely with the *nocalls* option
-or they can be limited to just a few levels of calls with the *calldepth* option.
-For example, the option:
-
-`calldepth=10`
-
-will ignore the method events when there are more than 10 managed stack frames.
-This is very useful for programs that have deep recursion or for programs that
-perform many millions of tiny calls deep enough in the call stack. The optimal
-number for the calldepth option depends on the program and it needs to be balanced
-between providing enough profiling information and allowing fast execution speed.
-
-Note that by default, if method events are not recorded at all, the profiler will
-collect stack trace information at events like allocations. To avoid gathering this
-data, use the *maxframes=0* profiler option.
-
-Allocation events can be eliminated with the *noalloc* option.
-
-Heap shot data can also be huge: by default it is collected at each major collection.
-To reduce the frequency, you can specify a heapshot mode: for example to collect
-every 5 collections (including major and minor):
-
-`heapshot=5gc`
-
-or when at least 5 seconds passed since the last heap shot:
-
-`heapshot=5000ms`
-
-### Compressing the data
-
-To reduce the amout of disk space used by the data, the data can be compressed
-either after it has been generated with the gzip command:
-
-`gzip -9 output.mlpd`
-
-or it can be compressed automatically by using the *zip* profiler option. Note
-that in this case there could be a significant slowdown of the profiled program.
-
-The mprof-report program will tranparently deal with either compressed or
-uncompressed data files.
-
-### Generating only a summary report
-
-Often it's enough to look at the profiler summary report to diagnose an issue and in this
-case it's possible to avoid saving the profiler data file to disk. This can be
-accomplished with the *report* profiler option, which will basically send the data
-to the mprof-report program for display.
-
-To have more control of what summary information is reported (or to use a completely
-different program to decode the profiler data), the *output* profiler option can be
-used, with `|` as the first character: the rest of the output name will be
-executed as a program with the data fed in on the standard input.
-
-For example, to print only the Monitor summary with stack trace information, you
-could use it like this:
-
-`output=|mprof-report --reports=monitor --traces -`
-
diff --git a/mono/profiler/mono-cov.c b/mono/profiler/mono-cov.c
deleted file mode 100644 (file)
index 9860dd8..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * mono-co.c: Coverage profiler
- *
-
- * Copyright 2008-2009 Novell, Inc (http://www.novell.com)
- */
-#include <mono/metadata/profiler.h>
-#include <mono/metadata/tokentype.h>
-#include <mono/metadata/tabledefs.h>
-#include <mono/metadata/debug-helpers.h>
-#include <mono/metadata/assembly.h>
-#include <string.h>
-#include <glib.h>
-
-/*
- * Coverage profiler. Compile with:
- * gcc -Wall -shared -o mono-profiler-cov.so mono-cov.c `pkg-config --cflags --libs mono`
- * Install the binary where the dynamic loader can find it (/usr/local/lib, for example,
- * or set the env var LD_LIBRARY_PATH to the directory where the file is).
- * Then run mono with:
- * mono --profile=cov:yourassembly test_suite.exe
- * mono --profile=cov:yourassembly/namespace test_suite.exe
- */
-
-struct _MonoProfiler {
-       GHashTable *hash;
-       char* assembly_name;
-       char* class_name;
-       MonoAssembly *assembly;
-       GList *bb_coverage;
-};
-
-static void
-get_assembly (MonoAssembly* ass, MonoProfiler *prof)
-{
-       if (strcmp (prof->assembly_name, mono_image_get_name (mono_assembly_get_image (ass))) == 0)
-               prof->assembly = ass;
-}
-
-static void
-coverage_callback (MonoProfiler *prof, const MonoProfileCoverageEntry *entry)
-{
-       char* cmsg;
-
-       if (entry->counter)
-               return;
-
-       if (entry->filename) {
-               cmsg = g_strdup_printf ("offset 0x%04x (%s: line: %d, col: %d)", 
-                       entry->iloffset, entry->filename, entry->line, entry->col);
-       } else {
-               cmsg = g_strdup_printf ("offset 0x%04x", entry->iloffset);
-       }
-       prof->bb_coverage = g_list_append (prof->bb_coverage, cmsg);
-}
-
-static void
-check_partial_coverage (MonoProfiler *prof, MonoMethod *method)
-{
-       GList *tmp;
-       
-       mono_profiler_coverage_get (prof, method, coverage_callback);
-       if (prof->bb_coverage) {
-               char *name = mono_method_full_name (method, TRUE);
-               g_print ("Partial coverage: %s\n", name);
-               g_free (name);
-               for (tmp = prof->bb_coverage; tmp; tmp = tmp->next) {
-                       g_print ("\t%s\n", (char*)tmp->data);
-                       g_free (tmp->data);
-               }
-               g_list_free (prof->bb_coverage);
-               prof->bb_coverage = NULL;
-       }
-}
-
-/* called at the end of the program */
-static void
-cov_shutdown (MonoProfiler *prof)
-{
-       MonoImage *image;
-       MonoMethod *method;
-       int i;
-       char *name;
-
-       mono_assembly_foreach ((GFunc)get_assembly, prof);
-       if (!prof->assembly) {
-               g_print ("Assembly '%s' was not loaded\n", prof->assembly_name);
-               return;
-       }
-       image = mono_assembly_get_image (prof->assembly);
-       for (i = 1; i <= mono_image_get_table_rows (image, MONO_TABLE_METHOD); ++i) {
-               MonoClass *klass;
-               method = mono_get_method (image, i | MONO_TOKEN_METHOD_DEF, NULL);
-               if (!method)
-                       continue;
-               if ((mono_method_get_flags (method, NULL) & METHOD_ATTRIBUTE_ABSTRACT))
-                       continue;
-               /* FIXME: handle icalls, runtime calls and synchronized methods */
-               if (prof->class_name && *prof->class_name) {
-                       klass = mono_method_get_class (method);
-                       if (!strstr (mono_class_get_name (klass), prof->class_name) && !strstr (mono_class_get_namespace (klass), prof->class_name))
-                               continue;
-               }
-               /*g_print ("check %s::%s, %p\n", method->klass->name, method->name, method);*/
-               if (g_hash_table_lookup (prof->hash, method)) {
-                       /* the method was executed: check it was fully covered */
-                       check_partial_coverage (prof, method);
-                       continue;
-               }
-               name = mono_method_full_name (method, TRUE);
-               g_print ("Not covered: %s\n", name);
-               g_free (name);
-       }
-}
-
-static void
-cov_method_enter (MonoProfiler *prof, MonoMethod *method)
-{
-       /*g_print ("enter %s::%s, %p\n", method->klass->name, method->name, method);*/
-       g_hash_table_insert (prof->hash, method, GINT_TO_POINTER (1));
-}
-
-static void
-cov_method_leave (MonoProfiler *prof, MonoMethod *method)
-{
-}
-
-static gboolean
-cov_coverage_filter(MonoProfiler *prof, MonoMethod *method)
-{
-       return TRUE;
-}
-
-void
-mono_profiler_startup (const char *desc);
-
-/* the entry point */
-void
-mono_profiler_startup (const char *desc)
-{
-       MonoProfiler *prof;
-
-       prof = g_new0 (MonoProfiler, 1);
-       prof->hash = g_hash_table_new (NULL, NULL);
-       if (strncmp ("cov:", desc, 4) == 0 && desc [4]) {
-               char *cname;
-               prof->assembly_name = g_strdup (desc + 4);
-               cname = strchr (prof->assembly_name, '/');
-               if (cname) {
-                       *cname = 0;
-                       prof->class_name = cname + 1;
-               }
-       } else {
-               prof->assembly_name = g_strdup ("mscorlib");
-       }
-
-       mono_profiler_install (prof, cov_shutdown);
-       
-       mono_profiler_install_enter_leave (cov_method_enter, cov_method_leave);
-       mono_profiler_install_coverage_filter (cov_coverage_filter);
-       mono_profiler_set_events (MONO_PROFILE_ENTER_LEAVE | MONO_PROFILE_COVERAGE);
-}
-
-
diff --git a/mono/profiler/mono-profiler-logging.c b/mono/profiler/mono-profiler-logging.c
deleted file mode 100644 (file)
index 194bc93..0000000
+++ /dev/null
@@ -1,5883 +0,0 @@
-/*
- * mono-profiler-logging.c: Logging profiler for Mono.
- *
- * Author:
- *   Massimiliano Mantione (massi@ximian.com)
- *
- * Copyright 2008-2009 Novell, Inc (http://www.novell.com)
- */
-#include <config.h>
-#include <mono/metadata/profiler.h>
-#include <mono/metadata/class.h>
-#include <mono/metadata/metadata-internals.h>
-#include <mono/metadata/class-internals.h>
-#include <mono/metadata/assembly.h>
-#include <mono/metadata/loader.h>
-#include <mono/metadata/threads.h>
-#include <mono/metadata/debug-helpers.h>
-#include <mono/metadata/mono-gc.h>
-#include <mono/utils/mono-tls.h>
-#include <mono/io-layer/atomic.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <glib.h>
-
-#include <dlfcn.h>
-
-#include <sys/types.h> 
-#include <sys/socket.h>
-#include <netinet/in.h>
-
-#define HAS_OPROFILE 0
-
-#if (HAS_OPROFILE)
-#include <libopagent.h>
-#endif
-
-// Needed for heap analysis
-extern gboolean mono_object_is_alive (MonoObject* obj);
-
-typedef enum {
-       MONO_PROFILER_FILE_BLOCK_KIND_INTRO = 1,
-       MONO_PROFILER_FILE_BLOCK_KIND_END = 2,
-       MONO_PROFILER_FILE_BLOCK_KIND_MAPPING = 3,
-       MONO_PROFILER_FILE_BLOCK_KIND_LOADED = 4,
-       MONO_PROFILER_FILE_BLOCK_KIND_UNLOADED = 5,
-       MONO_PROFILER_FILE_BLOCK_KIND_EVENTS = 6,
-       MONO_PROFILER_FILE_BLOCK_KIND_STATISTICAL = 7,
-       MONO_PROFILER_FILE_BLOCK_KIND_HEAP_DATA = 8,
-       MONO_PROFILER_FILE_BLOCK_KIND_HEAP_SUMMARY = 9,
-       MONO_PROFILER_FILE_BLOCK_KIND_DIRECTIVES = 10
-} MonoProfilerFileBlockKind;
-
-typedef enum {
-       MONO_PROFILER_DIRECTIVE_END = 0,
-       MONO_PROFILER_DIRECTIVE_ALLOCATIONS_CARRY_CALLER = 1,
-       MONO_PROFILER_DIRECTIVE_ALLOCATIONS_HAVE_STACK = 2,
-       MONO_PROFILER_DIRECTIVE_ALLOCATIONS_CARRY_ID = 3,
-       MONO_PROFILER_DIRECTIVE_LOADED_ELEMENTS_CARRY_ID = 4,
-       MONO_PROFILER_DIRECTIVE_CLASSES_CARRY_ASSEMBLY_ID = 5,
-       MONO_PROFILER_DIRECTIVE_METHODS_CARRY_WRAPPER_FLAG = 6,
-       MONO_PROFILER_DIRECTIVE_LAST
-} MonoProfilerDirectives;
-
-
-#define MONO_PROFILER_LOADED_EVENT_MODULE     1
-#define MONO_PROFILER_LOADED_EVENT_ASSEMBLY   2
-#define MONO_PROFILER_LOADED_EVENT_APPDOMAIN  4
-#define MONO_PROFILER_LOADED_EVENT_SUCCESS    8
-#define MONO_PROFILER_LOADED_EVENT_FAILURE   16
-
-typedef enum {
-       MONO_PROFILER_EVENT_DATA_TYPE_OTHER = 0,
-       MONO_PROFILER_EVENT_DATA_TYPE_METHOD = 1,
-       MONO_PROFILER_EVENT_DATA_TYPE_CLASS = 2
-} MonoProfilerEventDataType;
-
-typedef struct _ProfilerEventData {
-       union {
-               gpointer address;
-               gsize number;
-       } data;
-       unsigned int data_type:2;
-       unsigned int code:4;
-       unsigned int kind:1;
-       unsigned int value:25;
-} ProfilerEventData;
-
-#define EVENT_VALUE_BITS (25)
-#define MAX_EVENT_VALUE ((1<<EVENT_VALUE_BITS)-1)
-
-typedef enum {
-       MONO_PROFILER_EVENT_METHOD_JIT = 0,
-       MONO_PROFILER_EVENT_METHOD_FREED = 1,
-       MONO_PROFILER_EVENT_METHOD_CALL = 2,
-       MONO_PROFILER_EVENT_METHOD_ALLOCATION_CALLER = 3,
-       MONO_PROFILER_EVENT_METHOD_ALLOCATION_JIT_TIME_CALLER = 4
-} MonoProfilerMethodEvents;
-typedef enum {
-       MONO_PROFILER_EVENT_CLASS_LOAD = 0,
-       MONO_PROFILER_EVENT_CLASS_UNLOAD = 1,
-       MONO_PROFILER_EVENT_CLASS_EXCEPTION = 2,
-       MONO_PROFILER_EVENT_CLASS_MONITOR = 3,
-       MONO_PROFILER_EVENT_CLASS_ALLOCATION = 4
-} MonoProfilerClassEvents;
-typedef enum {
-       MONO_PROFILER_EVENT_RESULT_SUCCESS = 0,
-       MONO_PROFILER_EVENT_RESULT_FAILURE = 4
-} MonoProfilerEventResult;
-#define MONO_PROFILER_EVENT_RESULT_MASK MONO_PROFILER_EVENT_RESULT_FAILURE
-typedef enum {
-       MONO_PROFILER_EVENT_THREAD = 1,
-       MONO_PROFILER_EVENT_GC_COLLECTION = 2,
-       MONO_PROFILER_EVENT_GC_MARK = 3,
-       MONO_PROFILER_EVENT_GC_SWEEP = 4,
-       MONO_PROFILER_EVENT_GC_RESIZE = 5,
-       MONO_PROFILER_EVENT_GC_STOP_WORLD = 6,
-       MONO_PROFILER_EVENT_GC_START_WORLD = 7,
-       MONO_PROFILER_EVENT_JIT_TIME_ALLOCATION = 8,
-       MONO_PROFILER_EVENT_STACK_SECTION = 9,
-       MONO_PROFILER_EVENT_ALLOCATION_OBJECT_ID = 10,
-       MONO_PROFILER_EVENT_OBJECT_MONITOR = 11
-} MonoProfilerEvents;
-typedef enum {
-       MONO_PROFILER_EVENT_KIND_START = 0,
-       MONO_PROFILER_EVENT_KIND_END = 1
-} MonoProfilerEventKind;
-
-#define MONO_PROFILER_GET_CURRENT_TIME(t) {\
-       struct timeval current_time;\
-       gettimeofday (&current_time, NULL);\
-       (t) = (((guint64)current_time.tv_sec) * 1000000) + current_time.tv_usec;\
-} while (0)
-
-static gboolean use_fast_timer = FALSE;
-
-#if (defined(__i386__) || defined(__x86_64__)) && ! defined(HOST_WIN32)
-
-#if defined(__i386__)
-static const guchar cpuid_impl [] = {
-       0x55,                           /* push   %ebp */
-       0x89, 0xe5,                     /* mov    %esp,%ebp */
-       0x53,                           /* push   %ebx */
-       0x8b, 0x45, 0x08,               /* mov    0x8(%ebp),%eax */
-       0x0f, 0xa2,                     /* cpuid   */
-       0x50,                           /* push   %eax */
-       0x8b, 0x45, 0x10,               /* mov    0x10(%ebp),%eax */
-       0x89, 0x18,                     /* mov    %ebx,(%eax) */
-       0x8b, 0x45, 0x14,               /* mov    0x14(%ebp),%eax */
-       0x89, 0x08,                     /* mov    %ecx,(%eax) */
-       0x8b, 0x45, 0x18,               /* mov    0x18(%ebp),%eax */
-       0x89, 0x10,                     /* mov    %edx,(%eax) */
-       0x58,                           /* pop    %eax */
-       0x8b, 0x55, 0x0c,               /* mov    0xc(%ebp),%edx */
-       0x89, 0x02,                     /* mov    %eax,(%edx) */
-       0x5b,                           /* pop    %ebx */
-       0xc9,                           /* leave   */
-       0xc3,                           /* ret     */
-};
-
-typedef void (*CpuidFunc) (int id, int* p_eax, int* p_ebx, int* p_ecx, int* p_edx);
-
-static int 
-cpuid (int id, int* p_eax, int* p_ebx, int* p_ecx, int* p_edx) {
-       int have_cpuid = 0;
-#ifndef _MSC_VER
-       __asm__  __volatile__ (
-               "pushfl\n"
-               "popl %%eax\n"
-               "movl %%eax, %%edx\n"
-               "xorl $0x200000, %%eax\n"
-               "pushl %%eax\n"
-               "popfl\n"
-               "pushfl\n"
-               "popl %%eax\n"
-               "xorl %%edx, %%eax\n"
-               "andl $0x200000, %%eax\n"
-               "movl %%eax, %0"
-               : "=r" (have_cpuid)
-               :
-               : "%eax", "%edx"
-       );
-#else
-       __asm {
-               pushfd
-               pop eax
-               mov edx, eax
-               xor eax, 0x200000
-               push eax
-               popfd
-               pushfd
-               pop eax
-               xor eax, edx
-               and eax, 0x200000
-               mov have_cpuid, eax
-       }
-#endif
-       if (have_cpuid) {
-               CpuidFunc func = (CpuidFunc) cpuid_impl;
-               func (id, p_eax, p_ebx, p_ecx, p_edx);
-               /*
-                * We use this approach because of issues with gcc and pic code, see:
-                * http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7329
-               __asm__ __volatile__ ("cpuid"
-                       : "=a" (*p_eax), "=b" (*p_ebx), "=c" (*p_ecx), "=d" (*p_edx)
-                       : "a" (id));
-               */
-               return 1;
-       }
-       return 0;
-}
-
-static void detect_fast_timer (void) {
-       int p_eax, p_ebx, p_ecx, p_edx;
-       
-       if (cpuid (0x1, &p_eax, &p_ebx, &p_ecx, &p_edx)) {
-               if (p_edx & 0x10) {
-                       use_fast_timer = TRUE;
-               } else {
-                       use_fast_timer = FALSE;
-               }
-       } else {
-               use_fast_timer = FALSE;
-       }
-}
-#endif
-
-#if defined(__x86_64__)
-static void detect_fast_timer (void) {
-       guint32 op = 0x1;
-       guint32 eax,ebx,ecx,edx;
-       __asm__ __volatile__ ("cpuid" : "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx) : "a"(op));
-       if (edx & 0x10) {
-               use_fast_timer = TRUE;
-       } else {
-               use_fast_timer = FALSE;
-       }
-}
-#endif
-
-static __inline__ guint64 rdtsc(void) {
-       guint32 hi, lo;
-       __asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi));
-       return ((guint64) lo) | (((guint64) hi) << 32);
-}
-#define MONO_PROFILER_GET_CURRENT_COUNTER(c) {\
-       if (use_fast_timer) {\
-               (c) = rdtsc ();\
-       } else {\
-               MONO_PROFILER_GET_CURRENT_TIME ((c));\
-       }\
-} while (0)
-#else
-static void detect_fast_timer (void) {
-       use_fast_timer = FALSE;
-}
-#define MONO_PROFILER_GET_CURRENT_COUNTER(c) MONO_PROFILER_GET_CURRENT_TIME ((c))
-#endif
-
-
-#define CLASS_LAYOUT_PACKED_BITMAP_SIZE 64
-#define CLASS_LAYOUT_NOT_INITIALIZED (0xFFFF)
-typedef enum {
-       HEAP_CODE_NONE = 0,
-       HEAP_CODE_OBJECT = 1,
-       HEAP_CODE_FREE_OBJECT_CLASS = 2,
-       HEAP_CODE_MASK = 3
-} HeapProfilerJobValueCode;
-typedef struct _MonoProfilerClassData {
-       union {
-               guint64 compact;
-               guint8 *extended;
-       } bitmap;
-       struct {
-               guint16 slots;
-               guint16 references;
-       } layout;
-} MonoProfilerClassData;
-
-typedef struct _MonoProfilerMethodData {
-       gpointer code_start;
-       guint32 code_size;
-} MonoProfilerMethodData;
-
-typedef struct _ClassIdMappingElement {
-       char *name;
-       guint32 id;
-       MonoClass *klass;
-       struct _ClassIdMappingElement *next_unwritten;
-       MonoProfilerClassData data;
-} ClassIdMappingElement;
-
-typedef struct _MethodIdMappingElement {
-       char *name;
-       guint32 id;
-       MonoMethod *method;
-       struct _MethodIdMappingElement *next_unwritten;
-       MonoProfilerMethodData data;
-} MethodIdMappingElement;
-
-typedef struct _ClassIdMapping {
-       GHashTable *table;
-       ClassIdMappingElement *unwritten;
-       guint32 next_id;
-} ClassIdMapping;
-
-typedef struct _MethodIdMapping {
-       GHashTable *table;
-       MethodIdMappingElement *unwritten;
-       guint32 next_id;
-} MethodIdMapping;
-
-typedef struct _LoadedElement {
-       char *name;
-       guint64 load_start_counter;
-       guint64 load_end_counter;
-       guint64 unload_start_counter;
-       guint64 unload_end_counter;
-       guint32 id;
-       guint8 loaded;
-       guint8 load_written;
-       guint8 unloaded;
-       guint8 unload_written;
-} LoadedElement;
-struct _ProfilerCodeBufferArray;
-typedef struct _ProfilerCodeBuffer {
-       gpointer start;
-       gpointer end;
-       struct {
-               union {
-                       MonoMethod *method;
-                       MonoClass *klass;
-                       void *data;
-                       struct _ProfilerCodeBufferArray *sub_buffers;
-               } data;
-               guint16 value;
-               guint16 type;
-       } info;
-} ProfilerCodeBuffer;
-
-#define PROFILER_CODE_BUFFER_ARRAY_SIZE 64
-typedef struct _ProfilerCodeBufferArray {
-       int level;
-       int number_of_buffers;
-       ProfilerCodeBuffer buffers [PROFILER_CODE_BUFFER_ARRAY_SIZE];
-} ProfilerCodeBufferArray;
-
-typedef struct _ProfilerCodeChunk {
-       gpointer start;
-       gpointer end;
-       gboolean destroyed;
-       ProfilerCodeBufferArray *buffers;
-} ProfilerCodeChunk;
-
-typedef struct _ProfilerCodeChunks {
-       int capacity;
-       int number_of_chunks;;
-       ProfilerCodeChunk *chunks;
-} ProfilerCodeChunks;
-
-
-#define PROFILER_HEAP_SHOT_OBJECT_BUFFER_SIZE 1024
-#define PROFILER_HEAP_SHOT_HEAP_BUFFER_SIZE 4096
-#define PROFILER_HEAP_SHOT_WRITE_BUFFER_SIZE 4096
-
-typedef struct _ProfilerHeapShotObjectBuffer {
-       struct _ProfilerHeapShotObjectBuffer *next;
-       MonoObject **next_free_slot;
-       MonoObject **end;
-       MonoObject **first_unprocessed_slot;
-       MonoObject *buffer [PROFILER_HEAP_SHOT_OBJECT_BUFFER_SIZE];
-} ProfilerHeapShotObjectBuffer;
-
-typedef struct _ProfilerHeapShotHeapBuffer {
-       struct _ProfilerHeapShotHeapBuffer *next;
-       struct _ProfilerHeapShotHeapBuffer *previous;
-       MonoObject **start_slot;
-       MonoObject **end_slot;
-       MonoObject *buffer [PROFILER_HEAP_SHOT_HEAP_BUFFER_SIZE];
-} ProfilerHeapShotHeapBuffer;
-
-typedef struct _ProfilerHeapShotHeapBuffers {
-       ProfilerHeapShotHeapBuffer *buffers;
-       ProfilerHeapShotHeapBuffer *last;
-       ProfilerHeapShotHeapBuffer *current;
-       MonoObject **first_free_slot;
-} ProfilerHeapShotHeapBuffers;
-
-
-typedef struct _ProfilerHeapShotWriteBuffer {
-       struct _ProfilerHeapShotWriteBuffer *next;
-       gpointer buffer [PROFILER_HEAP_SHOT_WRITE_BUFFER_SIZE];
-} ProfilerHeapShotWriteBuffer;
-
-typedef struct _ProfilerHeapShotClassSummary {
-       struct {
-               guint32 instances;
-               guint32 bytes;
-       } reachable;
-       struct {
-               guint32 instances;
-               guint32 bytes;
-       } unreachable;
-} ProfilerHeapShotClassSummary;
-
-typedef struct _ProfilerHeapShotCollectionSummary {
-       ProfilerHeapShotClassSummary *per_class_data;
-       guint32 capacity;
-} ProfilerHeapShotCollectionSummary;
-
-typedef struct _ProfilerHeapShotWriteJob {
-       struct _ProfilerHeapShotWriteJob *next;
-       struct _ProfilerHeapShotWriteJob *next_unwritten;
-       gpointer *start;
-       gpointer *cursor;
-       gpointer *end;
-       ProfilerHeapShotWriteBuffer *buffers;
-       ProfilerHeapShotWriteBuffer **last_next;
-       guint32 full_buffers;
-       gboolean heap_shot_was_requested;
-       guint64 start_counter;
-       guint64 start_time;
-       guint64 end_counter;
-       guint64 end_time;
-       guint32 collection;
-       ProfilerHeapShotCollectionSummary summary;
-       gboolean dump_heap_data;
-} ProfilerHeapShotWriteJob;
-
-typedef struct _ProfilerThreadStack {
-       guint32 capacity;
-       guint32 top;
-       guint32 last_saved_top;
-       guint32 last_written_frame;
-       MonoMethod **stack;
-       guint8 *method_is_jitted;
-       guint32 *written_frames;
-} ProfilerThreadStack;
-
-typedef struct _ProfilerPerThreadData {
-       ProfilerEventData *events;
-       ProfilerEventData *next_free_event;
-       ProfilerEventData *next_unreserved_event;
-       ProfilerEventData *end_event;
-       ProfilerEventData *first_unwritten_event;
-       ProfilerEventData *first_unmapped_event;
-       guint64 start_event_counter;
-       guint64 last_event_counter;
-       gsize thread_id;
-       ProfilerHeapShotObjectBuffer *heap_shot_object_buffers;
-       ProfilerThreadStack stack;
-       struct _ProfilerPerThreadData* next;
-} ProfilerPerThreadData;
-
-typedef struct _ProfilerStatisticalHit {
-       gpointer *address;
-       MonoDomain *domain;
-} ProfilerStatisticalHit;
-
-typedef struct _ProfilerStatisticalData {
-       ProfilerStatisticalHit *hits;
-       unsigned int next_free_index;
-       unsigned int end_index;
-       unsigned int first_unwritten_index;
-} ProfilerStatisticalData;
-
-typedef struct _ProfilerUnmanagedSymbol {
-       guint32 offset;
-       guint32 size;
-       guint32 id;
-       guint32 index;
-} ProfilerUnmanagedSymbol;
-
-struct _ProfilerExecutableFile;
-struct _ProfilerExecutableFileSectionRegion;
-
-typedef struct _ProfilerExecutableMemoryRegionData {
-       gpointer start;
-       gpointer end;
-       guint32 file_offset;
-       char *file_name;
-       guint32 id;
-       gboolean is_new;
-       
-       struct _ProfilerExecutableFile *file;
-       struct _ProfilerExecutableFileSectionRegion *file_region_reference;
-       guint32 symbols_count;
-       guint32 symbols_capacity;
-       ProfilerUnmanagedSymbol *symbols;
-} ProfilerExecutableMemoryRegionData;
-
-typedef struct _ProfilerExecutableMemoryRegions {
-       ProfilerExecutableMemoryRegionData **regions;
-       guint32 regions_capacity;
-       guint32 regions_count;
-       guint32 next_id;
-       guint32 next_unmanaged_function_id;
-} ProfilerExecutableMemoryRegions;
-
-/* Start of ELF definitions */
-#define EI_NIDENT 16
-typedef guint16 ElfHalf;
-typedef guint32 ElfWord;
-typedef gsize ElfAddr;
-typedef gsize ElfOff;
-
-typedef struct {
-       unsigned char e_ident[EI_NIDENT];
-       ElfHalf e_type;
-       ElfHalf e_machine;
-       ElfWord e_version;
-       ElfAddr e_entry;
-       ElfOff  e_phoff;
-       ElfOff  e_shoff; // Section header table
-       ElfWord e_flags;
-       ElfHalf e_ehsize; // Header size
-       ElfHalf e_phentsize;
-       ElfHalf e_phnum;
-       ElfHalf e_shentsize; // Section header entry size
-       ElfHalf e_shnum; // Section header entries number
-       ElfHalf e_shstrndx; // String table index
-} ElfHeader;
-
-#if (SIZEOF_VOID_P == 4)
-typedef struct {
-       ElfWord sh_name;
-       ElfWord sh_type;
-       ElfWord sh_flags;
-       ElfAddr sh_addr; // Address in memory
-       ElfOff  sh_offset; // Offset in file
-       ElfWord sh_size;
-       ElfWord sh_link;
-       ElfWord sh_info;
-       ElfWord sh_addralign;
-       ElfWord sh_entsize;
-} ElfSection;
-typedef struct {
-       ElfWord       st_name;
-       ElfAddr       st_value;
-       ElfWord       st_size;
-       unsigned char st_info; // Use ELF32_ST_TYPE to get symbol type
-       unsigned char st_other;
-       ElfHalf       st_shndx; // Or one of SHN_ABS, SHN_COMMON or SHN_UNDEF.
-} ElfSymbol;
-#elif (SIZEOF_VOID_P == 8)
-typedef struct {
-       ElfWord sh_name;
-       ElfWord sh_type;
-       ElfOff sh_flags;
-       ElfAddr sh_addr; // Address in memory
-       ElfOff  sh_offset; // Offset in file
-       ElfOff sh_size;
-       ElfWord sh_link;
-       ElfWord sh_info;
-       ElfOff sh_addralign;
-       ElfOff sh_entsize;
-} ElfSection;
-typedef struct {
-       ElfWord       st_name;
-       unsigned char st_info; // Use ELF_ST_TYPE to get symbol type
-       unsigned char st_other;
-       ElfHalf       st_shndx; // Or one of SHN_ABS, SHN_COMMON or SHN_UNDEF.
-       ElfAddr       st_value;
-       ElfAddr       st_size;
-} ElfSymbol;
-#else
-#error Bad size of void pointer
-#endif
-
-
-#define ELF_ST_BIND(i)   ((i)>>4)
-#define ELF_ST_TYPE(i)   ((i)&0xf)
-
-
-typedef enum {
-       EI_MAG0 = 0,
-       EI_MAG1 = 1,
-       EI_MAG2 = 2,
-       EI_MAG3 = 3,
-       EI_CLASS = 4,
-       EI_DATA = 5
-} ElfIdentFields;
-
-typedef enum {
-       ELF_FILE_TYPE_NONE = 0,
-       ELF_FILE_TYPE_REL = 1,
-       ELF_FILE_TYPE_EXEC = 2,
-       ELF_FILE_TYPE_DYN = 3,
-       ELF_FILE_TYPE_CORE = 4
-} ElfFileType;
-
-typedef enum {
-       ELF_CLASS_NONE = 0,
-       ELF_CLASS_32 = 1,
-       ELF_CLASS_64 = 2
-} ElfIdentClass;
-
-typedef enum {
-       ELF_DATA_NONE = 0,
-       ELF_DATA_LSB = 1,
-       ELF_DATA_MSB = 2
-} ElfIdentData;
-
-typedef enum {
-       ELF_SHT_NULL = 0,
-       ELF_SHT_PROGBITS = 1,
-       ELF_SHT_SYMTAB = 2,
-       ELF_SHT_STRTAB = 3,
-       ELF_SHT_RELA = 4,
-       ELF_SHT_HASH = 5,
-       ELF_SHT_DYNAMIC = 6,
-       ELF_SHT_NOTE = 7,
-       ELF_SHT_NOBITS = 8,
-       ELF_SHT_REL = 9,
-       ELF_SHT_SHLIB = 10,
-       ELF_SHT_DYNSYM = 11
-} ElfSectionType;
-
-typedef enum {
-       ELF_STT_NOTYPE = 0,
-       ELF_STT_OBJECT = 1,
-       ELF_STT_FUNC = 2,
-       ELF_STT_SECTION = 3,
-       ELF_STT_FILE = 4
-} ElfSymbolType;
-
-typedef enum {
-       ELF_SHF_WRITE = 1,
-       ELF_SHF_ALLOC = 2,
-       ELF_SHF_EXECINSTR = 4,
-} ElfSectionFlags;
-
-#define ELF_SHN_UNDEF       0
-#define ELF_SHN_LORESERVE   0xff00
-#define ELF_SHN_LOPROC      0xff00
-#define ELF_SHN_HIPROC      0xff1f
-#define ELF_SHN_ABS         0xfff1
-#define ELF_SHN_COMMON      0xfff2
-#define ELF_SHN_HIRESERVE   0xffff
-/* End of ELF definitions */
-
-typedef struct _ProfilerExecutableFileSectionRegion {
-       ProfilerExecutableMemoryRegionData *region;
-       guint8 *section_address;
-       gsize section_offset;
-} ProfilerExecutableFileSectionRegion;
-
-typedef struct _ProfilerExecutableFile {
-       guint32 reference_count;
-       
-       /* Used for mmap and munmap */
-       int fd;
-       guint8 *data;
-       size_t length;
-       
-       /* File data */
-       ElfHeader *header;
-       guint8 *symbols_start;
-       guint32 symbols_count;
-       guint32 symbol_size;
-       const char *symbols_string_table;
-       const char *main_string_table;
-       
-       ProfilerExecutableFileSectionRegion *section_regions;
-       
-       struct _ProfilerExecutableFile *next_new_file;
-} ProfilerExecutableFile;
-
-typedef struct _ProfilerExecutableFiles {
-       GHashTable *table;
-       ProfilerExecutableFile *new_files;
-} ProfilerExecutableFiles;
-
-
-#define CLEANUP_WRITER_THREAD() do {profiler->writer_thread_terminated = TRUE;} while (0)
-#define CHECK_WRITER_THREAD() (! profiler->writer_thread_terminated)
-
-#ifndef HOST_WIN32
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <pthread.h>
-#include <semaphore.h>
-
-#include <sys/mman.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <errno.h>
-
-#define MUTEX_TYPE pthread_mutex_t
-#define INITIALIZE_PROFILER_MUTEX() pthread_mutex_init (&(profiler->mutex), NULL)
-#define DELETE_PROFILER_MUTEX() pthread_mutex_destroy (&(profiler->mutex))
-#define LOCK_PROFILER() do {/*LOG_WRITER_THREAD ("LOCK_PROFILER");*/ pthread_mutex_lock (&(profiler->mutex));} while (0)
-#define UNLOCK_PROFILER() do {/*LOG_WRITER_THREAD ("UNLOCK_PROFILER");*/ pthread_mutex_unlock (&(profiler->mutex));} while (0)
-
-#define THREAD_TYPE pthread_t
-#define CREATE_WRITER_THREAD(f) pthread_create (&(profiler->data_writer_thread), NULL, ((void*(*)(void*))f), NULL)
-#define CREATE_USER_THREAD(f) pthread_create (&(profiler->user_thread), NULL, ((void*(*)(void*))f), NULL)
-#define EXIT_THREAD() pthread_exit (NULL);
-#define WAIT_WRITER_THREAD() do {\
-       if (CHECK_WRITER_THREAD ()) {\
-               pthread_join (profiler->data_writer_thread, NULL);\
-       }\
-} while (0)
-#define CURRENT_THREAD_ID() (gsize) pthread_self ()
-
-#ifndef HAVE_KW_THREAD
-static pthread_key_t pthread_profiler_key;
-static pthread_once_t profiler_pthread_once = PTHREAD_ONCE_INIT;
-static void
-make_pthread_profiler_key (void) {
-    (void) pthread_key_create (&pthread_profiler_key, NULL);
-}
-#define LOOKUP_PROFILER_THREAD_DATA() ((ProfilerPerThreadData*) pthread_getspecific (pthread_profiler_key))
-#define SET_PROFILER_THREAD_DATA(x) (void) pthread_setspecific (pthread_profiler_key, (x))
-#define ALLOCATE_PROFILER_THREAD_DATA() (void) pthread_once (&profiler_pthread_once, make_pthread_profiler_key)
-#define FREE_PROFILER_THREAD_DATA() (void) pthread_key_delete (pthread_profiler_key)
-#endif
-
-#define EVENT_TYPE sem_t
-#define WRITER_EVENT_INIT() do {\
-       sem_init (&(profiler->enable_data_writer_event), 0, 0);\
-       sem_init (&(profiler->wake_data_writer_event), 0, 0);\
-       sem_init (&(profiler->done_data_writer_event), 0, 0);\
-} while (0)
-#define WRITER_EVENT_DESTROY() do {\
-       sem_destroy (&(profiler->enable_data_writer_event));\
-       sem_destroy (&(profiler->wake_data_writer_event));\
-       sem_destroy (&(profiler->done_data_writer_event));\
-} while (0)
-#define WRITER_EVENT_WAIT() (void) sem_wait (&(profiler->wake_data_writer_event))
-#define WRITER_EVENT_RAISE() (void) sem_post (&(profiler->wake_data_writer_event))
-#define WRITER_EVENT_ENABLE_WAIT() (void) sem_wait (&(profiler->enable_data_writer_event))
-#define WRITER_EVENT_ENABLE_RAISE() (void) sem_post (&(profiler->enable_data_writer_event))
-#define WRITER_EVENT_DONE_WAIT() do {\
-       if (CHECK_WRITER_THREAD ()) {\
-               (void) sem_wait (&(profiler->done_data_writer_event));\
-       }\
-} while (0)
-#define WRITER_EVENT_DONE_RAISE() (void) sem_post (&(profiler->done_data_writer_event))
-
-#if 0
-#define FILE_HANDLE_TYPE FILE*
-#define OPEN_FILE() profiler->file = fopen (profiler->file_name, "wb");
-#define WRITE_BUFFER(b,s) fwrite ((b), 1, (s), profiler->file)
-#define FLUSH_FILE() fflush (profiler->file)
-#define CLOSE_FILE() fclose (profiler->file)
-#else
-#define FILE_HANDLE_TYPE int
-#define OPEN_FILE() profiler->file = open (profiler->file_name, O_WRONLY|O_CREAT|O_TRUNC, 0664);
-#define WRITE_BUFFER(b,s) write (profiler->file, (b), (s))
-#define FLUSH_FILE() fsync (profiler->file)
-#define CLOSE_FILE() close (profiler->file)
-#endif
-
-#else
-
-#include <windows.h>
-
-#define MUTEX_TYPE CRITICAL_SECTION
-#define INITIALIZE_PROFILER_MUTEX() InitializeCriticalSection (&(profiler->mutex))
-#define DELETE_PROFILER_MUTEX() DeleteCriticalSection (&(profiler->mutex))
-#define LOCK_PROFILER() EnterCriticalSection (&(profiler->mutex))
-#define UNLOCK_PROFILER() LeaveCriticalSection (&(profiler->mutex))
-
-#define THREAD_TYPE HANDLE
-#define CREATE_WRITER_THREAD(f) CreateThread (NULL, (1*1024*1024), (f), NULL, 0, NULL);
-#define EXIT_THREAD() ExitThread (0);
-#define WAIT_WRITER_THREAD() do {\
-       if (CHECK_WRITER_THREAD ()) {\
-                WaitForSingleObject (profiler->data_writer_thread, INFINITE);\
-       }\
-} while (0)
-#define CURRENT_THREAD_ID() (gsize) GetCurrentThreadId ()
-
-#ifndef HAVE_KW_THREAD
-static MonoNativeTlsKey profiler_thread_id;
-#define LOOKUP_PROFILER_THREAD_DATA() ((ProfilerPerThreadData*)mono_native_tls_get_value (profiler_thread_id))
-#define SET_PROFILER_THREAD_DATA(x) mono_native_tls_set_value (profiler_thread_id, (x));
-#define ALLOCATE_PROFILER_THREAD_DATA() mono_native_tls_alloc (profiler_thread_id, NULL)
-#define FREE_PROFILER_THREAD_DATA() mono_native_tls_free (profiler_thread_id)
-#endif
-
-#define EVENT_TYPE HANDLE
-#define WRITER_EVENT_INIT() (void) do {\
-       profiler->enable_data_writer_event = CreateEvent (NULL, FALSE, FALSE, NULL);\
-       profiler->wake_data_writer_event = CreateEvent (NULL, FALSE, FALSE, NULL);\
-       profiler->done_data_writer_event = CreateEvent (NULL, FALSE, FALSE, NULL);\
-} while (0)
-#define WRITER_EVENT_DESTROY() CloseHandle (profiler->statistical_data_writer_event)
-#define WRITER_EVENT_INIT() (void) do {\
-       CloseHandle (profiler->enable_data_writer_event);\
-       CloseHandle (profiler->wake_data_writer_event);\
-       CloseHandle (profiler->done_data_writer_event);\
-} while (0)
-#define WRITER_EVENT_WAIT() WaitForSingleObject (profiler->wake_data_writer_event, INFINITE)
-#define WRITER_EVENT_RAISE() SetEvent (profiler->wake_data_writer_event)
-#define WRITER_EVENT_ENABLE_WAIT() WaitForSingleObject (profiler->enable_data_writer_event, INFINITE)
-#define WRITER_EVENT_ENABLE_RAISE() SetEvent (profiler->enable_data_writer_event)
-#define WRITER_EVENT_DONE_WAIT() do {\
-       if (CHECK_WRITER_THREAD ()) {\
-               WaitForSingleObject (profiler->done_data_writer_event, INFINITE);\
-       }\
-} while (0)
-#define WRITER_EVENT_DONE_RAISE() SetEvent (profiler->done_data_writer_event)
-
-#define FILE_HANDLE_TYPE FILE*
-#define OPEN_FILE() profiler->file = fopen (profiler->file_name, "wb");
-#define WRITE_BUFFER(b,s) fwrite ((b), 1, (s), profiler->file)
-#define FLUSH_FILE() fflush (profiler->file)
-#define CLOSE_FILE() fclose (profiler->file);
-
-#endif
-
-#ifdef HAVE_KW_THREAD
-static __thread ProfilerPerThreadData * tls_profiler_per_thread_data;
-#define LOOKUP_PROFILER_THREAD_DATA() ((ProfilerPerThreadData*) tls_profiler_per_thread_data)
-#define SET_PROFILER_THREAD_DATA(x) tls_profiler_per_thread_data = (x)
-#define ALLOCATE_PROFILER_THREAD_DATA() /* nop */
-#define FREE_PROFILER_THREAD_DATA() /* nop */
-#endif
-
-#define GET_PROFILER_THREAD_DATA(data) do {\
-       ProfilerPerThreadData *_result = LOOKUP_PROFILER_THREAD_DATA ();\
-       if (!_result) {\
-               _result = profiler_per_thread_data_new (profiler->per_thread_buffer_size);\
-               LOCK_PROFILER ();\
-               _result->next = profiler->per_thread_data;\
-               profiler->per_thread_data = _result;\
-               UNLOCK_PROFILER ();\
-               SET_PROFILER_THREAD_DATA (_result);\
-       }\
-       (data) = _result;\
-} while (0)
-
-#define PROFILER_FILE_WRITE_BUFFER_SIZE (profiler->write_buffer_size)
-typedef struct _ProfilerFileWriteBuffer {
-       struct _ProfilerFileWriteBuffer *next;
-       guint8 buffer [MONO_ZERO_LEN_ARRAY];
-} ProfilerFileWriteBuffer;
-
-#define CHECK_PROFILER_ENABLED() do {\
-       if (! profiler->profiler_enabled)\
-               return;\
-} while (0)
-struct _MonoProfiler {
-       MUTEX_TYPE mutex;
-       
-       MonoProfileFlags flags;
-       gboolean profiler_enabled;
-       char *file_name;
-       char *file_name_suffix;
-       FILE_HANDLE_TYPE file;
-       
-       guint64 start_time;
-       guint64 start_counter;
-       guint64 end_time;
-       guint64 end_counter;
-       
-       guint64 last_header_counter;
-       
-       MethodIdMapping *methods;
-       ClassIdMapping *classes;
-       
-       guint32 loaded_element_next_free_id;
-       GHashTable *loaded_assemblies;
-       GHashTable *loaded_modules;
-       GHashTable *loaded_appdomains;
-       
-       guint32 per_thread_buffer_size;
-       guint32 statistical_buffer_size;
-       ProfilerPerThreadData* per_thread_data;
-       ProfilerStatisticalData *statistical_data;
-       ProfilerStatisticalData *statistical_data_ready;
-       ProfilerStatisticalData *statistical_data_second_buffer;
-       int statistical_call_chain_depth;
-       MonoProfilerCallChainStrategy statistical_call_chain_strategy;
-       
-       ProfilerCodeChunks code_chunks;
-       
-       THREAD_TYPE data_writer_thread;
-       THREAD_TYPE user_thread;
-       EVENT_TYPE enable_data_writer_event;
-       EVENT_TYPE wake_data_writer_event;
-       EVENT_TYPE done_data_writer_event;
-       gboolean terminate_writer_thread;
-       gboolean writer_thread_terminated;
-       
-       ProfilerFileWriteBuffer *write_buffers;
-       ProfilerFileWriteBuffer *current_write_buffer;
-       int write_buffer_size;
-       int current_write_position;
-       int full_write_buffers;
-       
-       ProfilerHeapShotWriteJob *heap_shot_write_jobs;
-       ProfilerHeapShotHeapBuffers heap;
-       
-       int command_port;
-       
-       int dump_next_heap_snapshots;
-       gboolean heap_shot_was_requested;
-       guint32 garbage_collection_counter;
-       
-       ProfilerExecutableMemoryRegions *executable_regions;
-       ProfilerExecutableFiles executable_files;
-       
-       struct {
-#if (HAS_OPROFILE)
-               gboolean oprofile;
-#endif
-               gboolean jit_time;
-               gboolean unreachable_objects;
-               gboolean collection_summary;
-               gboolean report_gc_events;
-               gboolean heap_shot;
-               gboolean track_stack;
-               gboolean track_calls;
-               gboolean save_allocation_caller;
-               gboolean save_allocation_stack;
-               gboolean allocations_carry_id;
-       } action_flags;
-};
-static MonoProfiler *profiler;
-
-static void
-enable_profiler (void) {
-       profiler->profiler_enabled = TRUE;
-}
-
-static void flush_everything (void);
-
-static void
-disable_profiler (void) {
-       profiler->profiler_enabled = FALSE;
-       flush_everything ();
-}
-
-static void
-request_heap_snapshot (void) {
-       profiler->heap_shot_was_requested = TRUE;
-       mono_gc_collect (mono_gc_max_generation ());
-}
-
-#define DEBUG_LOAD_EVENTS 0
-#define DEBUG_MAPPING_EVENTS 0
-#define DEBUG_LOGGING_PROFILER 0
-#define DEBUG_HEAP_PROFILER 0
-#define DEBUG_CLASS_BITMAPS 0
-#define DEBUG_STATISTICAL_PROFILER 0
-#define DEBUG_WRITER_THREAD 0
-#define DEBUG_USER_THREAD 0
-#define DEBUG_FILE_WRITES 0
-#if (DEBUG_LOGGING_PROFILER || DEBUG_STATISTICAL_PROFILER || DEBUG_HEAP_PROFILER || DEBUG_WRITER_THREAD || DEBUG_FILE_WRITES)
-#define LOG_WRITER_THREAD(m) printf ("WRITER-THREAD-LOG %s\n", m)
-#else
-#define LOG_WRITER_THREAD(m)
-#endif
-#if (DEBUG_LOGGING_PROFILER || DEBUG_STATISTICAL_PROFILER || DEBUG_HEAP_PROFILER || DEBUG_USER_THREAD || DEBUG_FILE_WRITES)
-#define LOG_USER_THREAD(m) printf ("USER-THREAD-LOG %s\n", m)
-#else
-#define LOG_USER_THREAD(m)
-#endif
-
-#if DEBUG_LOGGING_PROFILER
-static int event_counter = 0;
-#define EVENT_MARK() printf ("[EVENT:%d]", ++ event_counter)
-#endif
-
-static void
-thread_stack_initialize_empty (ProfilerThreadStack *stack) {
-       stack->capacity = 0;
-       stack->top = 0;
-       stack->last_saved_top = 0;
-       stack->last_written_frame = 0;
-       stack->stack = NULL;
-       stack->method_is_jitted = NULL;
-       stack->written_frames = NULL;
-}
-
-static void
-thread_stack_free (ProfilerThreadStack *stack) {
-       stack->capacity = 0;
-       stack->top = 0;
-       stack->last_saved_top = 0;
-       stack->last_written_frame = 0;
-       if (stack->stack != NULL) {
-               g_free (stack->stack);
-               stack->stack = NULL;
-       }
-       if (stack->method_is_jitted != NULL) {
-               g_free (stack->method_is_jitted);
-               stack->method_is_jitted = NULL;
-       }
-       if (stack->written_frames != NULL) {
-               g_free (stack->written_frames);
-               stack->written_frames = NULL;
-       }
-}
-
-static void
-thread_stack_initialize (ProfilerThreadStack *stack, guint32 capacity) {
-       stack->capacity = capacity;
-       stack->top = 0;
-       stack->last_saved_top = 0;
-       stack->last_written_frame = 0;
-       stack->stack = g_new0 (MonoMethod*, capacity);
-       stack->method_is_jitted = g_new0 (guint8, capacity);
-       stack->written_frames = g_new0 (guint32, capacity);
-}
-
-static void
-thread_stack_push_jitted (ProfilerThreadStack *stack, MonoMethod* method, gboolean method_is_jitted) {
-       if (stack->top >= stack->capacity) {
-               MonoMethod **old_stack = stack->stack;
-               guint8 *old_method_is_jitted = stack->method_is_jitted;
-               guint32 *old_written_frames = stack->written_frames;
-               guint32 top = stack->top;
-               guint32 last_saved_top = stack->last_saved_top;
-               guint32 last_written_frame = stack->last_written_frame;
-               thread_stack_initialize (stack, stack->capacity * 2);
-               memcpy (stack->stack, old_stack, top * sizeof (MonoMethod*));
-               memcpy (stack->method_is_jitted, old_method_is_jitted, top * sizeof (guint8));
-               memcpy (stack->written_frames, old_written_frames, top * sizeof (guint32));
-               g_free (old_stack);
-               g_free (old_method_is_jitted);
-               g_free (old_written_frames);
-               stack->top = top;
-               stack->last_saved_top = last_saved_top;
-               stack->last_written_frame = last_written_frame;
-       }
-       stack->stack [stack->top] = method;
-       stack->method_is_jitted [stack->top] = method_is_jitted;
-       stack->top ++;
-}
-
-static inline void
-thread_stack_push (ProfilerThreadStack *stack, MonoMethod* method) {
-       thread_stack_push_jitted (stack, method, FALSE);
-}
-
-static MonoMethod*
-thread_stack_pop (ProfilerThreadStack *stack) {
-       if (stack->top > 0) {
-               stack->top --;
-               if (stack->last_saved_top > stack->top) {
-                       stack->last_saved_top = stack->top;
-               }
-               return stack->stack [stack->top];
-       } else {
-               return NULL;
-       }
-}
-
-static MonoMethod*
-thread_stack_top (ProfilerThreadStack *stack) {
-       if (stack->top > 0) {
-               return stack->stack [stack->top - 1];
-       } else {
-               return NULL;
-       }
-}
-
-static gboolean
-thread_stack_top_is_jitted (ProfilerThreadStack *stack) {
-       if (stack->top > 0) {
-               return stack->method_is_jitted [stack->top - 1];
-       } else {
-               return FALSE;
-       }
-}
-
-static MonoMethod*
-thread_stack_index_from_top (ProfilerThreadStack *stack, int index) {
-       if (stack->top > index) {
-               return stack->stack [stack->top - (index + 1)];
-       } else {
-               return NULL;
-       }
-}
-
-static gboolean
-thread_stack_index_from_top_is_jitted (ProfilerThreadStack *stack, int index) {
-       if (stack->top > index) {
-               return stack->method_is_jitted [stack->top - (index + 1)];
-       } else {
-               return FALSE;
-       }
-}
-
-static inline void
-thread_stack_push_safely (ProfilerThreadStack *stack, MonoMethod* method) {
-       if (stack->stack != NULL) {
-               thread_stack_push (stack, method);
-       }
-}
-
-static inline void
-thread_stack_push_jitted_safely (ProfilerThreadStack *stack, MonoMethod* method, gboolean method_is_jitted) {
-       if (stack->stack != NULL) {
-               thread_stack_push_jitted (stack, method, method_is_jitted);
-       }
-}
-
-static inline int
-thread_stack_count_unsaved_frames (ProfilerThreadStack *stack) {
-       int result = stack->top - stack->last_saved_top;
-       return (result > 0) ? result : 0;
-}
-
-static inline int
-thread_stack_get_last_written_frame (ProfilerThreadStack *stack) {
-       return stack->last_written_frame;
-}
-
-static inline void
-thread_stack_set_last_written_frame (ProfilerThreadStack *stack, int last_written_frame) {
-       stack->last_written_frame = last_written_frame;
-}
-
-static inline guint32
-thread_stack_written_frame_at_index (ProfilerThreadStack *stack, int index) {
-       return stack->written_frames [index];
-}
-
-static inline void
-thread_stack_write_frame_at_index (ProfilerThreadStack *stack, int index, guint32 method_id_and_is_jitted) {
-       stack->written_frames [index] = method_id_and_is_jitted;
-}
-
-static ClassIdMappingElement*
-class_id_mapping_element_get (MonoClass *klass) {
-       return g_hash_table_lookup (profiler->classes->table, (gconstpointer) klass);
-}
-
-static MethodIdMappingElement*
-method_id_mapping_element_get (MonoMethod *method) {
-       return g_hash_table_lookup (profiler->methods->table, (gconstpointer) method);
-}
-
-#define BITS_TO_BYTES(v) do {\
-       (v) += 7;\
-       (v) &= ~7;\
-       (v) >>= 3;\
-} while (0)
-
-static ClassIdMappingElement*
-class_id_mapping_element_new (MonoClass *klass) {
-       ClassIdMappingElement *result = g_new (ClassIdMappingElement, 1);
-       
-       result->name = mono_type_full_name (mono_class_get_type (klass));
-       result->klass = klass;
-       result->next_unwritten = profiler->classes->unwritten;
-       profiler->classes->unwritten = result;
-       result->id = profiler->classes->next_id;
-       profiler->classes->next_id ++;
-       
-       result->data.bitmap.compact = 0;
-       result->data.layout.slots = CLASS_LAYOUT_NOT_INITIALIZED;
-       result->data.layout.references = CLASS_LAYOUT_NOT_INITIALIZED;
-       
-       g_hash_table_insert (profiler->classes->table, klass, result);
-       
-#if (DEBUG_MAPPING_EVENTS)
-       printf ("Created new CLASS mapping element \"%s\" (%p)[%d]\n", result->name, klass, result->id);
-#endif
-       return result;
-}
-
-static void
-class_id_mapping_element_build_layout_bitmap (MonoClass *klass, ClassIdMappingElement *klass_id) {
-       MonoClass *parent_class = mono_class_get_parent (klass);
-       int number_of_reference_fields = 0;
-       int max_offset_of_reference_fields = 0;
-       ClassIdMappingElement *parent_id;
-       gpointer iter;
-       MonoClassField *field;
-       
-#if (DEBUG_CLASS_BITMAPS)
-       printf ("class_id_mapping_element_build_layout_bitmap: building layout for class %s.%s: ", mono_class_get_namespace (klass), mono_class_get_name (klass));
-#endif
-       
-       if (parent_class != NULL) {
-               parent_id = class_id_mapping_element_get (parent_class);
-               g_assert (parent_id != NULL);
-               
-               if (parent_id->data.layout.slots == CLASS_LAYOUT_NOT_INITIALIZED) {
-#if (DEBUG_CLASS_BITMAPS)
-                       printf ("[recursively building bitmap for father class]\n");
-#endif
-                       class_id_mapping_element_build_layout_bitmap (parent_class, parent_id);
-               }
-       } else {
-               parent_id = NULL;
-       }
-       
-       iter = NULL;
-       while ((field = mono_class_get_fields (klass, &iter)) != NULL) {
-               MonoType* field_type = mono_field_get_type (field);
-               // For now, skip static fields
-               if (mono_field_get_flags (field) & 0x0010 /*FIELD_ATTRIBUTE_STATIC*/)
-                       continue;
-               
-               if (MONO_TYPE_IS_REFERENCE (field_type)) {
-                       int field_offset = mono_field_get_offset (field) - sizeof (MonoObject);
-                       if (field_offset > max_offset_of_reference_fields) {
-                               max_offset_of_reference_fields = field_offset;
-                       }
-                       number_of_reference_fields ++;
-               } else {
-                       MonoClass *field_class = mono_class_from_mono_type (field_type);
-                       if (field_class && mono_class_is_valuetype (field_class)) {
-                               ClassIdMappingElement *field_id = class_id_mapping_element_get (field_class);
-                               g_assert (field_id != NULL);
-                               
-                               if (field_id->data.layout.slots == CLASS_LAYOUT_NOT_INITIALIZED) {
-                                       if (field_id != klass_id) {
-#if (DEBUG_CLASS_BITMAPS)
-                                               printf ("[recursively building bitmap for field %s]\n", mono_field_get_name (field));
-#endif
-                                               class_id_mapping_element_build_layout_bitmap (field_class, field_id);
-                                       } else {
-#if (DEBUG_CLASS_BITMAPS)
-                                               printf ("[breaking recursive bitmap build for field %s]", mono_field_get_name (field));
-                                               
-#endif
-                                               klass_id->data.bitmap.compact = 0;
-                                               klass_id->data.layout.slots = 0;
-                                               klass_id->data.layout.references = 0;
-                                       }
-                               }
-                               
-                               if (field_id->data.layout.references > 0) {
-                                       int field_offset = mono_field_get_offset (field) - sizeof (MonoObject);
-                                       int max_offset_reference_in_field = (field_id->data.layout.slots - 1) * sizeof (gpointer);
-                                       
-                                       if ((field_offset + max_offset_reference_in_field) > max_offset_of_reference_fields) {
-                                               max_offset_of_reference_fields = field_offset + max_offset_reference_in_field;
-                                       }
-                                       
-                                       number_of_reference_fields += field_id->data.layout.references;
-                               }
-                       }
-               }
-       }
-       
-#if (DEBUG_CLASS_BITMAPS)
-       printf ("[allocating bitmap for class %s.%s (references %d, max offset %d, slots %d)]", mono_class_get_namespace (klass), mono_class_get_name (klass), number_of_reference_fields, max_offset_of_reference_fields, (int)(max_offset_of_reference_fields / sizeof (gpointer)) + 1);
-#endif
-       if ((number_of_reference_fields == 0) && ((parent_id == NULL) || (parent_id->data.layout.references == 0))) {
-#if (DEBUG_CLASS_BITMAPS)
-               printf ("[no references at all]");
-#endif
-               klass_id->data.bitmap.compact = 0;
-               klass_id->data.layout.slots = 0;
-               klass_id->data.layout.references = 0;
-       } else {
-               if ((parent_id != NULL) && (parent_id->data.layout.references > 0)) {
-#if (DEBUG_CLASS_BITMAPS)
-                       printf ("[parent %s.%s has %d references in %d slots]", mono_class_get_namespace (parent_class), mono_class_get_name (parent_class), parent_id->data.layout.references, parent_id->data.layout.slots);
-#endif
-                       klass_id->data.layout.slots = parent_id->data.layout.slots;
-                       klass_id->data.layout.references = parent_id->data.layout.references;
-               } else {
-#if (DEBUG_CLASS_BITMAPS)
-                       printf ("[no references from parent]");
-#endif
-                       klass_id->data.layout.slots = 0;
-                       klass_id->data.layout.references = 0;
-               }
-               
-               if (number_of_reference_fields > 0) {
-                       klass_id->data.layout.slots += ((max_offset_of_reference_fields / sizeof (gpointer)) + 1);
-                       klass_id->data.layout.references += number_of_reference_fields;
-#if (DEBUG_CLASS_BITMAPS)
-                       printf ("[adding data, going to %d references in %d slots]", klass_id->data.layout.references, klass_id->data.layout.slots);
-#endif
-               }
-               
-               if (klass_id->data.layout.slots <= CLASS_LAYOUT_PACKED_BITMAP_SIZE) {
-#if (DEBUG_CLASS_BITMAPS)
-                               printf ("[zeroing bitmap]");
-#endif
-                               klass_id->data.bitmap.compact = 0;
-                       if ((parent_id != NULL) && (parent_id->data.layout.references > 0)) {
-#if (DEBUG_CLASS_BITMAPS)
-                               printf ("[copying compact father bitmap]");
-#endif
-                               klass_id->data.bitmap.compact = parent_id->data.bitmap.compact;
-                       }
-               } else {
-                       int size_of_bitmap = klass_id->data.layout.slots;
-                       BITS_TO_BYTES (size_of_bitmap);
-#if (DEBUG_CLASS_BITMAPS)
-                       printf ("[allocating %d bytes for bitmap]", size_of_bitmap);
-#endif
-                       klass_id->data.bitmap.extended = g_malloc0 (size_of_bitmap);
-                       if ((parent_id != NULL) && (parent_id->data.layout.references > 0)) {
-                               int size_of_father_bitmap = parent_id->data.layout.slots;
-                               if (size_of_father_bitmap <= CLASS_LAYOUT_PACKED_BITMAP_SIZE) {
-                                       int father_slot;
-#if (DEBUG_CLASS_BITMAPS)
-                                       printf ("[copying %d bits from father bitmap]", size_of_father_bitmap);
-#endif
-                                       for (father_slot = 0; father_slot < size_of_father_bitmap; father_slot ++) {
-                                               if (parent_id->data.bitmap.compact & (((guint64)1) << father_slot)) {
-                                                       klass_id->data.bitmap.extended [father_slot >> 3] |= (1 << (father_slot & 7));
-                                               }
-                                       }
-                               } else {
-                                       BITS_TO_BYTES (size_of_father_bitmap);
-#if (DEBUG_CLASS_BITMAPS)
-                                       printf ("[copying %d bytes from father bitmap]", size_of_father_bitmap);
-#endif
-                                       memcpy (klass_id->data.bitmap.extended, parent_id->data.bitmap.extended, size_of_father_bitmap);
-                               }
-                       }
-               }
-       }
-       
-#if (DEBUG_CLASS_BITMAPS)
-       printf ("[starting filling iteration]\n");
-#endif
-       iter = NULL;
-       while ((field = mono_class_get_fields (klass, &iter)) != NULL) {
-               MonoType* field_type = mono_field_get_type (field);
-               // For now, skip static fields
-               if (mono_field_get_flags (field) & 0x0010 /*FIELD_ATTRIBUTE_STATIC*/)
-                       continue;
-               
-#if (DEBUG_CLASS_BITMAPS)
-               printf ("[Working on field %s]", mono_field_get_name (field));
-#endif
-               if (MONO_TYPE_IS_REFERENCE (field_type)) {
-                       int field_offset = mono_field_get_offset (field) - sizeof (MonoObject);
-                       int field_slot;
-                       g_assert ((field_offset % sizeof (gpointer)) == 0);
-                       field_slot = field_offset / sizeof (gpointer);
-                       if (klass_id->data.layout.slots <= CLASS_LAYOUT_PACKED_BITMAP_SIZE) {
-                               klass_id->data.bitmap.compact |= (((guint64)1) << field_slot);
-                       } else {
-                               klass_id->data.bitmap.extended [field_slot >> 3] |= (1 << (field_slot & 7));
-                       }
-#if (DEBUG_CLASS_BITMAPS)
-                       printf ("[reference at offset %d, slot %d]", field_offset, field_slot);
-#endif
-               } else {
-                       MonoClass *field_class = mono_class_from_mono_type (field_type);
-                       if (field_class && mono_class_is_valuetype (field_class)) {
-                               ClassIdMappingElement *field_id = class_id_mapping_element_get (field_class);
-                               int field_offset;
-                               int field_slot;
-                               
-                               g_assert (field_id != NULL);
-                               field_offset = mono_field_get_offset (field) - sizeof (MonoObject);
-                               g_assert ((field_id->data.layout.references == 0) || ((field_offset % sizeof (gpointer)) == 0));
-                               field_slot = field_offset / sizeof (gpointer);
-#if (DEBUG_CLASS_BITMAPS)
-                               printf ("[value type at offset %d, slot %d, with %d references in %d slots]", field_offset, field_slot, field_id->data.layout.references, field_id->data.layout.slots);
-#endif
-                               
-                               if (field_id->data.layout.references > 0) {
-                                       int sub_field_slot;
-                                       if (field_id->data.layout.slots <= CLASS_LAYOUT_PACKED_BITMAP_SIZE) {
-                                               for (sub_field_slot = 0; sub_field_slot < field_id->data.layout.slots; sub_field_slot ++) {
-                                                       if (field_id->data.bitmap.compact & (((guint64)1) << sub_field_slot)) {
-                                                               int actual_slot = field_slot + sub_field_slot;
-                                                               if (klass_id->data.layout.slots <= CLASS_LAYOUT_PACKED_BITMAP_SIZE) {
-                                                                       klass_id->data.bitmap.compact |= (((guint64)1) << actual_slot);
-                                                               } else {
-                                                                       klass_id->data.bitmap.extended [actual_slot >> 3] |= (1 << (actual_slot & 7));
-                                                               }
-                                                       }
-                                               }
-                                       } else {
-                                               for (sub_field_slot = 0; sub_field_slot < field_id->data.layout.slots; sub_field_slot ++) {
-                                                       if (field_id->data.bitmap.extended [sub_field_slot >> 3] & (1 << (sub_field_slot & 7))) {
-                                                               int actual_slot = field_slot + sub_field_slot;
-                                                               if (klass_id->data.layout.slots <= CLASS_LAYOUT_PACKED_BITMAP_SIZE) {
-                                                                       klass_id->data.bitmap.compact |= (((guint64)1) << actual_slot);
-                                                               } else {
-                                                                       klass_id->data.bitmap.extended [actual_slot >> 3] |= (1 << (actual_slot & 7));
-                                                               }
-                                                       }
-                                               }
-                                       }
-                               }
-                       }
-               }
-       }
-#if (DEBUG_CLASS_BITMAPS)
-       do {
-               int slot;
-               printf ("\nLayot of class \"%s.%s\": references %d, slots %d, bitmap {", mono_class_get_namespace (klass), mono_class_get_name (klass), klass_id->data.layout.references, klass_id->data.layout.slots);
-               for (slot = 0; slot < klass_id->data.layout.slots; slot ++) {
-                       if (klass_id->data.layout.slots <= CLASS_LAYOUT_PACKED_BITMAP_SIZE) {
-                               if (klass_id->data.bitmap.compact & (((guint64)1) << slot)) {
-                                       printf (" 1");
-                               } else {
-                                       printf (" 0");
-                               }
-                       } else {
-                               if (klass_id->data.bitmap.extended [slot >> 3] & (1 << (slot & 7))) {
-                                       printf (" 1");
-                               } else {
-                                       printf (" 0");
-                               }
-;                      }
-                       
-               }
-               printf (" }\n");
-               
-       } while (0);
-#endif
-}
-
-static MethodIdMappingElement*
-method_id_mapping_element_new (MonoMethod *method) {
-       MethodIdMappingElement *result = g_new (MethodIdMappingElement, 1);
-       char *signature = mono_signature_get_desc (mono_method_signature (method), TRUE);
-       
-       result->name = g_strdup_printf ("%s (%s)", mono_method_get_name (method), signature);
-       g_free (signature);
-       result->method = method;
-       result->next_unwritten = profiler->methods->unwritten;
-       profiler->methods->unwritten = result;
-       result->id = profiler->methods->next_id;
-       profiler->methods->next_id ++;
-       g_hash_table_insert (profiler->methods->table, method, result);
-       
-       result->data.code_start = NULL;
-       result->data.code_size = 0;
-       
-#if (DEBUG_MAPPING_EVENTS)
-       printf ("Created new METHOD mapping element \"%s\" (%p)[%d]\n", result->name, method, result->id);
-#endif
-       return result;
-}
-
-
-static void
-method_id_mapping_element_destroy (gpointer element) {
-       MethodIdMappingElement *e = (MethodIdMappingElement*) element;
-       if (e->name)
-               g_free (e->name);
-       g_free (element);
-}
-
-static void
-class_id_mapping_element_destroy (gpointer element) {
-       ClassIdMappingElement *e = (ClassIdMappingElement*) element;
-       if (e->name)
-               g_free (e->name);
-       if ((e->data.layout.slots != CLASS_LAYOUT_NOT_INITIALIZED) && (e->data.layout.slots > CLASS_LAYOUT_PACKED_BITMAP_SIZE))
-               g_free (e->data.bitmap.extended);
-       g_free (element);
-}
-
-static MethodIdMapping*
-method_id_mapping_new (void) {
-       MethodIdMapping *result = g_new (MethodIdMapping, 1);
-       //result->table = g_hash_table_new_full (mono_aligned_addr_hash, NULL, NULL, method_id_mapping_element_destroy);
-       result->table = g_hash_table_new_full (g_direct_hash, NULL, NULL, method_id_mapping_element_destroy);
-       result->unwritten = NULL;
-       result->next_id = 1;
-       return result;
-}
-
-static ClassIdMapping*
-class_id_mapping_new (void) {
-       ClassIdMapping *result = g_new (ClassIdMapping, 1);
-       //result->table = g_hash_table_new_full (mono_aligned_addr_hash, NULL, NULL, class_id_mapping_element_destroy);
-       result->table = g_hash_table_new_full (g_direct_hash, NULL, NULL, class_id_mapping_element_destroy);
-       result->unwritten = NULL;
-       result->next_id = 1;
-       return result;
-}
-
-static void
-method_id_mapping_destroy (MethodIdMapping *map) {
-       g_hash_table_destroy (map->table);
-       g_free (map);
-}
-
-static void
-class_id_mapping_destroy (ClassIdMapping *map) {
-       g_hash_table_destroy (map->table);
-       g_free (map);
-}
-
-#if (DEBUG_LOAD_EVENTS)
-static void
-print_load_event (const char *event_name, GHashTable *table, gpointer item, LoadedElement *element);
-#endif
-
-static LoadedElement*
-loaded_element_load_start (GHashTable *table, gpointer item) {
-       LoadedElement *element = g_new0 (LoadedElement, 1);
-       element->id = profiler->loaded_element_next_free_id;
-       profiler->loaded_element_next_free_id ++;
-#if (DEBUG_LOAD_EVENTS)
-       print_load_event ("LOAD START", table, item, element);
-#endif
-       MONO_PROFILER_GET_CURRENT_COUNTER (element->load_start_counter);
-       g_hash_table_insert (table, item, element);
-       return element;
-}
-
-static LoadedElement*
-loaded_element_load_end (GHashTable *table, gpointer item, char *name) {
-       LoadedElement *element = g_hash_table_lookup (table, item);
-#if (DEBUG_LOAD_EVENTS)
-       print_load_event ("LOAD END", table, item, element);
-#endif
-       g_assert (element != NULL);
-       MONO_PROFILER_GET_CURRENT_COUNTER (element->load_end_counter);
-       element->name = name;
-       element->loaded = TRUE;
-       return element;
-}
-
-static LoadedElement*
-loaded_element_unload_start (GHashTable *table, gpointer item) {
-       LoadedElement *element = g_hash_table_lookup (table, item);
-#if (DEBUG_LOAD_EVENTS)
-       print_load_event ("UNLOAD START", table, item, element);
-#endif
-       g_assert (element != NULL);
-       MONO_PROFILER_GET_CURRENT_COUNTER (element->unload_start_counter);
-       return element;
-}
-
-static LoadedElement*
-loaded_element_unload_end (GHashTable *table, gpointer item) {
-       LoadedElement *element = g_hash_table_lookup (table, item);
-#if (DEBUG_LOAD_EVENTS)
-       print_load_event ("UNLOAD END", table, item, element);
-#endif
-       g_assert (element != NULL);
-       MONO_PROFILER_GET_CURRENT_COUNTER (element->unload_end_counter);
-       element->unloaded = TRUE;
-       return element;
-}
-
-static LoadedElement*
-loaded_element_find (GHashTable *table, gpointer item) {
-       LoadedElement *element = g_hash_table_lookup (table, item);
-       return element;
-}
-
-static guint32
-loaded_element_get_id (GHashTable *table, gpointer item) {
-       LoadedElement *element = loaded_element_find (table, item);
-       if (element != NULL) {
-               return element->id;
-       } else {
-               return 0;
-       }
-}
-
-static void
-loaded_element_destroy (gpointer element) {
-       if (((LoadedElement*)element)->name)
-               g_free (((LoadedElement*)element)->name);
-       g_free (element);
-}
-
-#if (DEBUG_LOAD_EVENTS)
-static void
-print_load_event (const char *event_name, GHashTable *table, gpointer item, LoadedElement *element) {
-       const char* item_name;
-       char* item_info;
-       
-       if (table == profiler->loaded_assemblies) {
-               //item_info = g_strdup_printf("ASSEMBLY %p (dynamic %d)", item, mono_image_is_dynamic (mono_assembly_get_image((MonoAssembly*)item)));
-               item_info = g_strdup_printf("ASSEMBLY %p", item);
-       } else if (table == profiler->loaded_modules) {
-               //item_info = g_strdup_printf("MODULE %p (dynamic %d)", item, mono_image_is_dynamic ((MonoImage*)item));
-               item_info = g_strdup_printf("MODULE %p", item);
-       } else if (table == profiler->loaded_appdomains) {
-               item_info = g_strdup_printf("APPDOMAIN %p (id %d)", item, mono_domain_get_id ((MonoDomain*)item));
-       } else {
-               item_info = NULL;
-               g_assert_not_reached ();
-       }
-       
-       if (element != NULL) {
-               item_name = element->name;
-       } else {
-               item_name = "<NULL>";
-       }
-       
-       printf ("%s EVENT for %s (%s [id %d])\n", event_name, item_info, item_name, element->id);
-       g_free (item_info);
-}
-#endif
-
-static void
-profiler_heap_shot_object_buffers_destroy (ProfilerHeapShotObjectBuffer *buffer) {
-       while (buffer != NULL) {
-               ProfilerHeapShotObjectBuffer *next = buffer->next;
-#if DEBUG_HEAP_PROFILER
-               printf ("profiler_heap_shot_object_buffers_destroy: destroyed buffer %p (%p-%p)\n", buffer, & (buffer->buffer [0]), buffer->end);
-#endif
-               g_free (buffer);
-               buffer = next;
-       }
-}
-
-static ProfilerHeapShotObjectBuffer*
-profiler_heap_shot_object_buffer_new (ProfilerPerThreadData *data) {
-       ProfilerHeapShotObjectBuffer *buffer;
-       ProfilerHeapShotObjectBuffer *result = g_new (ProfilerHeapShotObjectBuffer, 1);
-       result->next_free_slot = & (result->buffer [0]);
-       result->end = & (result->buffer [PROFILER_HEAP_SHOT_OBJECT_BUFFER_SIZE]);
-       result->first_unprocessed_slot = & (result->buffer [0]);
-       result->next = data->heap_shot_object_buffers;
-       data->heap_shot_object_buffers = result;
-#if DEBUG_HEAP_PROFILER
-       printf ("profiler_heap_shot_object_buffer_new: created buffer %p (%p-%p)\n", result, result->next_free_slot, result->end);
-#endif
-       for (buffer = result; buffer != NULL; buffer = buffer->next) {
-               ProfilerHeapShotObjectBuffer *last = buffer->next;
-               if ((last != NULL) && (last->first_unprocessed_slot == last->end)) {
-                       buffer->next = NULL;
-                       profiler_heap_shot_object_buffers_destroy (last);
-               }
-       }
-       
-       return result;
-}
-
-static ProfilerHeapShotWriteJob*
-profiler_heap_shot_write_job_new (gboolean heap_shot_was_requested, gboolean dump_heap_data, guint32 collection) {
-       ProfilerHeapShotWriteJob *job = g_new (ProfilerHeapShotWriteJob, 1);
-       job->next = NULL;
-       job->next_unwritten = NULL;
-       
-       if (profiler->action_flags.unreachable_objects || dump_heap_data) {
-               job->buffers = g_new (ProfilerHeapShotWriteBuffer, 1);
-               job->buffers->next = NULL;
-               job->last_next = & (job->buffers->next);
-               job->start = & (job->buffers->buffer [0]);
-               job->cursor = job->start;
-               job->end = & (job->buffers->buffer [PROFILER_HEAP_SHOT_WRITE_BUFFER_SIZE]);
-       } else {
-               job->buffers = NULL;
-               job->last_next = NULL;
-               job->start = NULL;
-               job->cursor = NULL;
-               job->end = NULL;
-       }
-       job->full_buffers = 0;
-       
-       if (profiler->action_flags.collection_summary) {
-               job->summary.capacity = profiler->classes->next_id;
-               job->summary.per_class_data = g_new0 (ProfilerHeapShotClassSummary, job->summary.capacity);
-       } else {
-               job->summary.capacity = 0;
-               job->summary.per_class_data = NULL;
-       }
-
-       job->heap_shot_was_requested = heap_shot_was_requested;
-       job->collection = collection;
-       job->dump_heap_data = dump_heap_data;
-#if DEBUG_HEAP_PROFILER
-       printf ("profiler_heap_shot_write_job_new: created job %p with buffer %p(%p-%p) (collection %d, dump %d)\n", job, job->buffers, job->start, job->end, collection, dump_heap_data);
-#endif
-       return job;
-}
-
-static gboolean
-profiler_heap_shot_write_job_has_data (ProfilerHeapShotWriteJob *job) {
-       return ((job->buffers != NULL) || (job->summary.capacity > 0));
-}
-
-static void
-profiler_heap_shot_write_job_add_buffer (ProfilerHeapShotWriteJob *job, gpointer value) {
-       ProfilerHeapShotWriteBuffer *buffer = g_new (ProfilerHeapShotWriteBuffer, 1);
-       buffer->next = NULL;
-       *(job->last_next) = buffer;
-       job->last_next = & (buffer->next);
-       job->full_buffers ++;
-       buffer->buffer [0] = value;
-       job->start = & (buffer->buffer [0]);
-       job->cursor = & (buffer->buffer [1]);
-       job->end = & (buffer->buffer [PROFILER_HEAP_SHOT_WRITE_BUFFER_SIZE]);
-#if DEBUG_HEAP_PROFILER
-       printf ("profiler_heap_shot_write_job_add_buffer: in job %p, added buffer %p(%p-%p) with value %p at address %p (cursor now %p)\n", job, buffer, job->start, job->end, value, &(buffer->buffer [0]), job->cursor);
-       do {
-               ProfilerHeapShotWriteBuffer *current_buffer;
-               for (current_buffer = job->buffers; current_buffer != NULL; current_buffer = current_buffer->next) {
-                       printf ("profiler_heap_shot_write_job_add_buffer: now job %p has buffer %p\n", job, current_buffer);
-               }
-       } while (0);
-#endif
-}
-
-static void
-profiler_heap_shot_write_job_free_buffers (ProfilerHeapShotWriteJob *job) {
-       ProfilerHeapShotWriteBuffer *buffer = job->buffers;
-       
-       while (buffer != NULL) {
-               ProfilerHeapShotWriteBuffer *next = buffer->next;
-#if DEBUG_HEAP_PROFILER
-               printf ("profiler_heap_shot_write_job_free_buffers: in job %p, freeing buffer %p\n", job, buffer);
-#endif
-               g_free (buffer);
-               buffer = next;
-       }
-       
-       job->buffers = NULL;
-       
-       if (job->summary.per_class_data != NULL) {
-               g_free (job->summary.per_class_data);
-               job->summary.per_class_data = NULL;
-       }
-       job->summary.capacity = 0;
-}
-
-static void
-profiler_heap_shot_write_block (ProfilerHeapShotWriteJob *job);
-
-static void
-profiler_process_heap_shot_write_jobs (void) {
-       gboolean done = FALSE;
-       
-       while (!done) {
-               ProfilerHeapShotWriteJob *current_job = profiler->heap_shot_write_jobs;
-               ProfilerHeapShotWriteJob *previous_job = NULL;
-               ProfilerHeapShotWriteJob *next_job;
-               
-               done = TRUE;
-               while (current_job != NULL) {
-                       next_job = current_job->next_unwritten;
-                       
-                       if (next_job != NULL) {
-                               if (profiler_heap_shot_write_job_has_data (current_job)) {
-                                       done = FALSE;
-                               }
-                               if (! profiler_heap_shot_write_job_has_data (next_job)) {
-                                       current_job->next_unwritten = NULL;
-                                       next_job = NULL;
-                               }
-                       } else {
-                               if (profiler_heap_shot_write_job_has_data (current_job)) {
-                                       LOG_WRITER_THREAD ("profiler_process_heap_shot_write_jobs: writing...");
-                                       profiler_heap_shot_write_block (current_job);
-                                       LOG_WRITER_THREAD ("profiler_process_heap_shot_write_jobs: done");
-                                       if (previous_job != NULL) {
-                                               previous_job->next_unwritten = NULL;
-                                       }
-                               }
-                       }
-                       
-                       previous_job = current_job;
-                       current_job = next_job;
-               }
-       }
-}
-
-static void
-profiler_free_heap_shot_write_jobs (void) {
-       ProfilerHeapShotWriteJob *current_job = profiler->heap_shot_write_jobs;
-       ProfilerHeapShotWriteJob *next_job;
-       
-       if (current_job != NULL) {
-               while (current_job->next_unwritten != NULL) {
-#if DEBUG_HEAP_PROFILER
-                       printf ("profiler_free_heap_shot_write_jobs: job %p must not be freed\n", current_job);
-#endif
-                       current_job = current_job->next_unwritten;
-               }
-               
-               next_job = current_job->next;
-               current_job->next = NULL;
-               current_job = next_job;
-               
-               while (current_job != NULL) {
-#if DEBUG_HEAP_PROFILER
-                       printf ("profiler_free_heap_shot_write_jobs: job %p will be freed\n", current_job);
-#endif
-                       next_job = current_job->next;
-                       profiler_heap_shot_write_job_free_buffers (current_job);
-                       g_free (current_job);
-                       current_job = next_job;
-               }
-       }
-}
-
-static void
-profiler_destroy_heap_shot_write_jobs (void) {
-       ProfilerHeapShotWriteJob *current_job = profiler->heap_shot_write_jobs;
-       ProfilerHeapShotWriteJob *next_job;
-       
-       while (current_job != NULL) {
-               next_job = current_job->next;
-               profiler_heap_shot_write_job_free_buffers (current_job);
-               g_free (current_job);
-               current_job = next_job;
-       }
-}
-
-static void
-profiler_add_heap_shot_write_job (ProfilerHeapShotWriteJob *job) {
-       job->next = profiler->heap_shot_write_jobs;
-       job->next_unwritten = job->next;
-       profiler->heap_shot_write_jobs = job;
-#if DEBUG_HEAP_PROFILER
-       printf ("profiler_add_heap_shot_write_job: added job %p\n", job);
-#endif
-}
-
-#if DEBUG_HEAP_PROFILER
-#define STORE_ALLOCATED_OBJECT_MESSAGE1(d,o) printf ("STORE_ALLOCATED_OBJECT[TID %ld]: storing object %p at address %p\n", (d)->thread_id, (o), (d)->heap_shot_object_buffers->next_free_slot)
-#define STORE_ALLOCATED_OBJECT_MESSAGE2(d,o) printf ("STORE_ALLOCATED_OBJECT[TID %ld]: storing object %p at address %p in new buffer %p\n", (d)->thread_id, (o), buffer->next_free_slot, buffer)
-#else
-#define STORE_ALLOCATED_OBJECT_MESSAGE1(d,o)
-#define STORE_ALLOCATED_OBJECT_MESSAGE2(d,o)
-#endif
-#define STORE_ALLOCATED_OBJECT(d,o) do {\
-       if ((d)->heap_shot_object_buffers->next_free_slot < (d)->heap_shot_object_buffers->end) {\
-               STORE_ALLOCATED_OBJECT_MESSAGE1 ((d), (o));\
-               *((d)->heap_shot_object_buffers->next_free_slot) = (o);\
-               (d)->heap_shot_object_buffers->next_free_slot ++;\
-       } else {\
-               ProfilerHeapShotObjectBuffer *buffer = profiler_heap_shot_object_buffer_new (d);\
-               STORE_ALLOCATED_OBJECT_MESSAGE2 ((d), (o));\
-               *((buffer)->next_free_slot) = (o);\
-               (buffer)->next_free_slot ++;\
-       }\
-} while (0)
-
-static ProfilerPerThreadData*
-profiler_per_thread_data_new (guint32 buffer_size)
-{
-       ProfilerPerThreadData *data = g_new (ProfilerPerThreadData, 1);
-
-       data->events = g_new0 (ProfilerEventData, buffer_size);
-       data->next_free_event = data->events;
-       data->next_unreserved_event = data->events;
-       data->end_event = data->events + (buffer_size - 1);
-       data->first_unwritten_event = data->events;
-       data->first_unmapped_event = data->events;
-       MONO_PROFILER_GET_CURRENT_COUNTER (data->start_event_counter);
-       data->last_event_counter = data->start_event_counter;
-       data->thread_id = CURRENT_THREAD_ID ();
-       data->heap_shot_object_buffers = NULL;
-       if ((profiler->action_flags.unreachable_objects == TRUE) ||
-                       (profiler->action_flags.heap_shot == TRUE) ||
-                       (profiler->action_flags.collection_summary == TRUE)) {
-               profiler_heap_shot_object_buffer_new (data);
-       }
-       if (profiler->action_flags.track_stack) {
-               thread_stack_initialize (&(data->stack), 64);
-       } else {
-               thread_stack_initialize_empty (&(data->stack));
-       }
-       return data;
-}
-
-static void
-profiler_per_thread_data_destroy (ProfilerPerThreadData *data) {
-       g_free (data->events);
-       profiler_heap_shot_object_buffers_destroy (data->heap_shot_object_buffers);
-       thread_stack_free (&(data->stack));
-       g_free (data);
-}
-
-static ProfilerStatisticalData*
-profiler_statistical_data_new (MonoProfiler *profiler) {
-       int buffer_size = profiler->statistical_buffer_size * (profiler->statistical_call_chain_depth + 1);
-       ProfilerStatisticalData *data = g_new (ProfilerStatisticalData, 1);
-
-       data->hits = g_new0 (ProfilerStatisticalHit, buffer_size);
-       data->next_free_index = 0;
-       data->end_index = profiler->statistical_buffer_size;
-       data->first_unwritten_index = 0;
-       
-       return data;
-}
-
-static void
-profiler_statistical_data_destroy (ProfilerStatisticalData *data) {
-       g_free (data->hits);
-       g_free (data);
-}
-
-static ProfilerCodeBufferArray*
-profiler_code_buffer_array_new (ProfilerCodeBufferArray *child) {
-       ProfilerCodeBufferArray *result = g_new0 (ProfilerCodeBufferArray, 1);
-       if (child == NULL) {
-               result->level = 0;
-       } else {
-               result->level = child->level + 1;
-               result->number_of_buffers = 1;
-               result->buffers [0].info.data.sub_buffers = child;
-               result->buffers [0].start = child->buffers [0].start;
-               result->buffers [0].end = child->buffers [child->number_of_buffers - 1].end;
-       }
-       return result;
-}
-
-static void
-profiler_code_buffer_array_destroy (ProfilerCodeBufferArray *buffers) {
-       if (buffers->level > 0) {
-               int i;
-               for (i = 0; i < buffers->number_of_buffers; i++) {
-                       ProfilerCodeBufferArray *sub_buffers = buffers->buffers [i].info.data.sub_buffers;
-                       profiler_code_buffer_array_destroy (sub_buffers);
-               }
-       }
-       g_free (buffers);
-}
-
-static gboolean
-profiler_code_buffer_array_is_full (ProfilerCodeBufferArray *buffers) {
-       while (buffers->level > 0) {
-               ProfilerCodeBufferArray *next;
-               if (buffers->number_of_buffers < PROFILER_CODE_BUFFER_ARRAY_SIZE) {
-                       return FALSE;
-               }
-               next = buffers->buffers [PROFILER_CODE_BUFFER_ARRAY_SIZE - 1].info.data.sub_buffers;
-               if (next->level < (buffers->level - 1)) {
-                       return FALSE;
-               }
-               buffers = next;
-       }
-       return (buffers->number_of_buffers == PROFILER_CODE_BUFFER_ARRAY_SIZE);
-}
-
-static ProfilerCodeBufferArray*
-profiler_code_buffer_add (ProfilerCodeBufferArray *buffers, gpointer *buffer, int size, MonoProfilerCodeBufferType type, void *data) {
-       if (buffers == NULL) {
-               buffers = profiler_code_buffer_array_new (NULL);
-       }
-       
-       if (profiler_code_buffer_array_is_full (buffers)) {
-               ProfilerCodeBufferArray *new_slot = profiler_code_buffer_add (NULL, buffer, size, type, data);
-               buffers = profiler_code_buffer_array_new (buffers);
-               buffers->buffers [buffers->number_of_buffers].info.data.sub_buffers = new_slot;
-               buffers->buffers [buffers->number_of_buffers].start = new_slot->buffers [0].start;
-               buffers->buffers [buffers->number_of_buffers].end = new_slot->buffers [new_slot->number_of_buffers - 1].end;
-               buffers->number_of_buffers ++;
-       } else if (buffers->level > 0) {
-               ProfilerCodeBufferArray *new_slot = profiler_code_buffer_add (buffers->buffers [buffers->number_of_buffers - 1].info.data.sub_buffers, buffer, size, type, data);
-               buffers->buffers [buffers->number_of_buffers - 1].info.data.sub_buffers = new_slot;
-               buffers->buffers [buffers->number_of_buffers - 1].start = new_slot->buffers [0].start;
-               buffers->buffers [buffers->number_of_buffers - 1].end = new_slot->buffers [new_slot->number_of_buffers - 1].end;
-       } else {
-               buffers->buffers [buffers->number_of_buffers].start = buffer;
-               buffers->buffers [buffers->number_of_buffers].end = (((guint8*) buffer) + size);
-               buffers->buffers [buffers->number_of_buffers].info.type = type;
-               switch (type) {
-               case MONO_PROFILER_CODE_BUFFER_UNKNOWN:
-                       buffers->buffers [buffers->number_of_buffers].info.data.data = NULL;
-                       break;
-               case MONO_PROFILER_CODE_BUFFER_METHOD:
-                       buffers->buffers [buffers->number_of_buffers].info.data.method = data;
-                       break;
-               default:
-                       buffers->buffers [buffers->number_of_buffers].info.type = MONO_PROFILER_CODE_BUFFER_UNKNOWN;
-                       buffers->buffers [buffers->number_of_buffers].info.data.data = NULL;
-               }
-               buffers->number_of_buffers ++;
-       }
-       return buffers;
-}
-
-static ProfilerCodeBuffer*
-profiler_code_buffer_find (ProfilerCodeBufferArray *buffers, gpointer *address) {
-       if (buffers != NULL) {
-               ProfilerCodeBuffer *result = NULL;
-               do {
-                       int low = 0;
-                       int high = buffers->number_of_buffers - 1;
-                       
-                       while (high != low) {
-                               int middle = low + ((high - low) >> 1);
-                               
-                               if ((guint8*) address < (guint8*) buffers->buffers [low].start) {
-                                       return NULL;
-                               }
-                               if ((guint8*) address >= (guint8*) buffers->buffers [high].end) {
-                                       return NULL;
-                               }
-                               
-                               if ((guint8*) address < (guint8*) buffers->buffers [middle].start) {
-                                       high = middle - 1;
-                                       if (high < low) {
-                                               high = low;
-                                       }
-                               } else if ((guint8*) address >= (guint8*) buffers->buffers [middle].end) {
-                                       low = middle + 1;
-                                       if (low > high) {
-                                               low = high;
-                                       }
-                               } else {
-                                       high = middle;
-                                       low = middle;
-                               }
-                       }
-                       
-                       if (((guint8*) address >= (guint8*) buffers->buffers [low].start) && ((guint8*) address < (guint8*) buffers->buffers [low].end)) {
-                               if (buffers->level == 0) {
-                                       result = & (buffers->buffers [low]);
-                               } else {
-                                       buffers = buffers->buffers [low].info.data.sub_buffers;
-                               }
-                       } else {
-                               return NULL;
-                       }
-               } while (result == NULL);
-               return result;
-       } else {
-               return NULL;
-       }
-}
-
-static void
-profiler_code_chunk_initialize (ProfilerCodeChunk *chunk, gpointer memory, gsize size) {
-       chunk->buffers = profiler_code_buffer_array_new (NULL);
-       chunk->destroyed = FALSE;
-       chunk->start = memory;
-       chunk->end = ((guint8*)memory) + size;
-}
-
-static void
-profiler_code_chunk_cleanup (ProfilerCodeChunk *chunk) {
-       if (chunk->buffers != NULL) {
-               profiler_code_buffer_array_destroy (chunk->buffers);
-               chunk->buffers = NULL;
-       }
-       chunk->start = NULL;
-       chunk->end = NULL;
-}
-
-static void
-profiler_code_chunks_initialize (ProfilerCodeChunks *chunks) {
-       chunks->capacity = 32;
-       chunks->chunks = g_new0 (ProfilerCodeChunk, 32);
-       chunks->number_of_chunks = 0;
-}
-
-static void
-profiler_code_chunks_cleanup (ProfilerCodeChunks *chunks) {
-       int i;
-       for (i = 0; i < chunks->number_of_chunks; i++) {
-               profiler_code_chunk_cleanup (& (chunks->chunks [i]));
-       }
-       chunks->capacity = 0;
-       chunks->number_of_chunks = 0;
-       g_free (chunks->chunks);
-       chunks->chunks = NULL;
-}
-
-static int
-compare_code_chunks (const void* c1, const void* c2) {
-       ProfilerCodeChunk *chunk1 = (ProfilerCodeChunk*) c1;
-       ProfilerCodeChunk *chunk2 = (ProfilerCodeChunk*) c2;
-       return ((guint8*) chunk1->end < (guint8*) chunk2->start) ? -1 : (((guint8*) chunk1->start >= (guint8*) chunk2->end) ? 1 : 0);
-}
-
-static int
-compare_address_and_code_chunk (const void* a, const void* c) {
-       gpointer address = (gpointer) a;
-       ProfilerCodeChunk *chunk = (ProfilerCodeChunk*) c;
-       return ((guint8*) address < (guint8*) chunk->start) ? -1 : (((guint8*) address >= (guint8*) chunk->end) ? 1 : 0);
-}
-
-static void
-profiler_code_chunks_sort (ProfilerCodeChunks *chunks) {
-       qsort (chunks->chunks, chunks->number_of_chunks, sizeof (ProfilerCodeChunk), compare_code_chunks);
-}
-
-static ProfilerCodeChunk*
-profiler_code_chunk_find (ProfilerCodeChunks *chunks, gpointer address) {
-       return bsearch (address, chunks->chunks, chunks->number_of_chunks, sizeof (ProfilerCodeChunk), compare_address_and_code_chunk);
-}
-
-static ProfilerCodeChunk*
-profiler_code_chunk_new (ProfilerCodeChunks *chunks, gpointer memory, gsize size) {
-       ProfilerCodeChunk *result;
-       
-       if (chunks->number_of_chunks == chunks->capacity) {
-               ProfilerCodeChunk *new_chunks = g_new0 (ProfilerCodeChunk, chunks->capacity * 2);
-               memcpy (new_chunks, chunks->chunks, chunks->capacity * sizeof (ProfilerCodeChunk));
-               chunks->capacity *= 2;
-               g_free (chunks->chunks);
-               chunks->chunks = new_chunks;
-       }
-       
-       result = & (chunks->chunks [chunks->number_of_chunks]);
-       chunks->number_of_chunks ++;
-       profiler_code_chunk_initialize (result, memory, size);
-       profiler_code_chunks_sort (chunks);
-       return result;
-}
-
-static int
-profiler_code_chunk_to_index (ProfilerCodeChunks *chunks, ProfilerCodeChunk *chunk) {
-       return (int) (chunk - chunks->chunks);
-}
-
-static void
-profiler_code_chunk_remove (ProfilerCodeChunks *chunks, ProfilerCodeChunk *chunk) {
-       int index = profiler_code_chunk_to_index (chunks, chunk);
-       
-       profiler_code_chunk_cleanup (chunk);
-       if ((index >= 0) && (index < chunks->number_of_chunks)) {
-               memmove (chunk, chunk + 1, (chunks->number_of_chunks - index) * sizeof (ProfilerCodeChunk));
-       }
-}
-
-/* This assumes the profiler lock is held */
-static ProfilerCodeBuffer*
-profiler_code_buffer_from_address (MonoProfiler *prof, gpointer address) {
-       ProfilerCodeChunks *chunks = & (prof->code_chunks);
-       
-       ProfilerCodeChunk *chunk = profiler_code_chunk_find (chunks, address);
-       if (chunk != NULL) {
-               return profiler_code_buffer_find (chunk->buffers, address);
-       } else {
-               return NULL;
-       }
-}
-
-static void
-profiler_code_chunk_new_callback (MonoProfiler *prof, gpointer address, int size) {
-       ProfilerCodeChunks *chunks = & (prof->code_chunks);
-       
-       if (prof->code_chunks.chunks != NULL) {
-               LOCK_PROFILER ();
-               profiler_code_chunk_new (chunks, address, size);
-               UNLOCK_PROFILER ();
-       }
-}
-
-static void
-profiler_code_chunk_destroy_callback  (MonoProfiler *prof, gpointer address) {
-       ProfilerCodeChunks *chunks = & (prof->code_chunks);
-       ProfilerCodeChunk *chunk;
-       
-       if (prof->code_chunks.chunks != NULL) {
-               LOCK_PROFILER ();
-               chunk = profiler_code_chunk_find (chunks, address);
-               if (chunk != NULL) {
-                       profiler_code_chunk_remove (chunks, chunk);
-               }
-               UNLOCK_PROFILER ();
-       }
-}
-
-static void
-profiler_code_buffer_new_callback  (MonoProfiler *prof, gpointer address, int size, MonoProfilerCodeBufferType type, void *data) {
-       ProfilerCodeChunks *chunks = & (prof->code_chunks);
-       ProfilerCodeChunk *chunk;
-       
-       if (prof->code_chunks.chunks != NULL) {
-               LOCK_PROFILER ();
-               chunk = profiler_code_chunk_find (chunks, address);
-               if (chunk != NULL) {
-                       chunk->buffers = profiler_code_buffer_add (chunk->buffers, address, size, type, data);
-               }
-               UNLOCK_PROFILER ();
-       }
-}
-
-static void
-profiler_add_write_buffer (void) {
-       if (profiler->current_write_buffer->next == NULL) {
-               profiler->current_write_buffer->next = g_malloc (sizeof (ProfilerFileWriteBuffer) + PROFILER_FILE_WRITE_BUFFER_SIZE);
-               profiler->current_write_buffer->next->next = NULL;
-               
-               //printf ("Added next buffer %p, to buffer %p\n", profiler->current_write_buffer->next, profiler->current_write_buffer);
-               
-       }
-       profiler->current_write_buffer = profiler->current_write_buffer->next;
-       profiler->current_write_position = 0;
-       profiler->full_write_buffers ++;
-}
-
-static void
-profiler_free_write_buffers (void) {
-       ProfilerFileWriteBuffer *current_buffer = profiler->write_buffers;
-       while (current_buffer != NULL) {
-               ProfilerFileWriteBuffer *next_buffer = current_buffer->next;
-               
-               //printf ("Freeing write buffer %p, next is %p\n", current_buffer, next_buffer);
-               
-               g_free (current_buffer);
-               current_buffer = next_buffer;
-       }
-}
-
-#define WRITE_BYTE(b) do {\
-       if (profiler->current_write_position >= PROFILER_FILE_WRITE_BUFFER_SIZE) {\
-               profiler_add_write_buffer ();\
-       }\
-       profiler->current_write_buffer->buffer [profiler->current_write_position] = (b);\
-       profiler->current_write_position ++;\
-} while (0)
-
-#if (DEBUG_FILE_WRITES)
-static int bytes_written = 0;
-#endif
-
-static void
-write_current_block (guint16 code) {
-       guint32 size = (profiler->full_write_buffers * PROFILER_FILE_WRITE_BUFFER_SIZE) + profiler->current_write_position;
-       ProfilerFileWriteBuffer *current_buffer = profiler->write_buffers;
-       guint64 current_counter;
-       guint32 counter_delta;
-       guint8 header [10];
-       
-       MONO_PROFILER_GET_CURRENT_COUNTER (current_counter);
-       if (profiler->last_header_counter != 0) {
-               counter_delta = current_counter - profiler->last_header_counter;
-       } else {
-               counter_delta = 0;
-       }
-       profiler->last_header_counter = current_counter;
-       
-       header [0] = code & 0xff;
-       header [1] = (code >> 8) & 0xff;
-       header [2] = size & 0xff;
-       header [3] = (size >> 8) & 0xff;
-       header [4] = (size >> 16) & 0xff;
-       header [5] = (size >> 24) & 0xff;
-       header [6] = counter_delta & 0xff;
-       header [7] = (counter_delta >> 8) & 0xff;
-       header [8] = (counter_delta >> 16) & 0xff;
-       header [9] = (counter_delta >> 24) & 0xff;
-       
-#if (DEBUG_FILE_WRITES)
-       printf ("write_current_block: writing header (code %d) at offset %d\n", code, bytes_written);
-       bytes_written += 10;
-#endif
-       WRITE_BUFFER (& (header [0]), 10);
-       
-       while ((current_buffer != NULL) && (profiler->full_write_buffers > 0)) {
-#if (DEBUG_FILE_WRITES)
-               printf ("write_current_block: writing buffer (size %d)\n", PROFILER_FILE_WRITE_BUFFER_SIZE);
-               bytes_written += PROFILER_FILE_WRITE_BUFFER_SIZE;
-#endif
-               WRITE_BUFFER (& (current_buffer->buffer [0]), PROFILER_FILE_WRITE_BUFFER_SIZE);
-               profiler->full_write_buffers --;
-               current_buffer = current_buffer->next;
-       }
-       if (profiler->current_write_position > 0) {
-#if (DEBUG_FILE_WRITES)
-               printf ("write_current_block: writing last buffer (size %d)\n", profiler->current_write_position);
-               bytes_written += profiler->current_write_position;
-#endif
-               WRITE_BUFFER (& (current_buffer->buffer [0]), profiler->current_write_position);
-       }
-       FLUSH_FILE ();
-#if (DEBUG_FILE_WRITES)
-       printf ("write_current_block: buffers flushed (file size %d)\n", bytes_written);
-#endif
-       
-       profiler->current_write_buffer = profiler->write_buffers;
-       profiler->current_write_position = 0;
-       profiler->full_write_buffers = 0;
-}
-
-
-#define SEVEN_BITS_MASK (0x7f)
-#define EIGHT_BIT_MASK (0x80)
-
-static void
-write_uint32 (guint32 value) {
-       while (value > SEVEN_BITS_MASK) {
-               WRITE_BYTE (value & SEVEN_BITS_MASK);
-               value >>= 7;
-       }
-       WRITE_BYTE (value | EIGHT_BIT_MASK);
-}
-static void
-write_uint64 (guint64 value) {
-       while (value > SEVEN_BITS_MASK) {
-               WRITE_BYTE (value & SEVEN_BITS_MASK);
-               value >>= 7;
-       }
-       WRITE_BYTE (value | EIGHT_BIT_MASK);
-}
-static void
-write_string (const char *string) {
-       while (*string != 0) {
-               WRITE_BYTE (*string);
-               string ++;
-       }
-       WRITE_BYTE (0);
-}
-
-static void write_clock_data (void);
-static void
-write_directives_block (gboolean start) {
-       write_clock_data ();
-       
-       if (start) {
-               if (profiler->action_flags.save_allocation_caller) {
-                       write_uint32 (MONO_PROFILER_DIRECTIVE_ALLOCATIONS_CARRY_CALLER);
-               }
-               if (profiler->action_flags.save_allocation_stack || profiler->action_flags.track_calls) {
-                       write_uint32 (MONO_PROFILER_DIRECTIVE_ALLOCATIONS_HAVE_STACK);
-               }
-               if (profiler->action_flags.allocations_carry_id) {
-                       write_uint32 (MONO_PROFILER_DIRECTIVE_ALLOCATIONS_CARRY_ID);
-               }
-               write_uint32 (MONO_PROFILER_DIRECTIVE_LOADED_ELEMENTS_CARRY_ID);
-               write_uint32 (MONO_PROFILER_DIRECTIVE_CLASSES_CARRY_ASSEMBLY_ID);
-               write_uint32 (MONO_PROFILER_DIRECTIVE_METHODS_CARRY_WRAPPER_FLAG);
-       }
-       write_uint32 (MONO_PROFILER_DIRECTIVE_END);
-       
-       write_clock_data ();
-       write_current_block (MONO_PROFILER_FILE_BLOCK_KIND_DIRECTIVES);
-}
-
-#if DEBUG_HEAP_PROFILER
-#define WRITE_HEAP_SHOT_JOB_VALUE_MESSAGE(v,c) printf ("WRITE_HEAP_SHOT_JOB_VALUE: writing value %p at cursor %p\n", (v), (c))
-#else
-#define WRITE_HEAP_SHOT_JOB_VALUE_MESSAGE(v,c)
-#endif
-#define WRITE_HEAP_SHOT_JOB_VALUE(j,v) do {\
-       if ((j)->cursor < (j)->end) {\
-               WRITE_HEAP_SHOT_JOB_VALUE_MESSAGE ((v), ((j)->cursor));\
-               *((j)->cursor) = (v);\
-               (j)->cursor ++;\
-       } else {\
-               profiler_heap_shot_write_job_add_buffer (j, v);\
-       }\
-} while (0)
-
-
-#undef GUINT_TO_POINTER
-#undef GPOINTER_TO_UINT
-#if (SIZEOF_VOID_P == 4)
-#define GUINT_TO_POINTER(u) ((void*)(guint32)(u))
-#define GPOINTER_TO_UINT(p) ((guint32)(void*)(p))
-#elif (SIZEOF_VOID_P == 8)
-#define GUINT_TO_POINTER(u) ((void*)(guint64)(u))
-#define GPOINTER_TO_UINT(p) ((guint64)(void*)(p))
-#else
-#error Bad size of void pointer
-#endif
-
-#define WRITE_HEAP_SHOT_JOB_VALUE_WITH_CODE(j,v,c) WRITE_HEAP_SHOT_JOB_VALUE (j, GUINT_TO_POINTER (GPOINTER_TO_UINT (v)|(c)))
-
-#if DEBUG_HEAP_PROFILER
-#define UPDATE_JOB_BUFFER_CURSOR_MESSAGE() printf ("profiler_heap_shot_write_block[UPDATE_JOB_BUFFER_CURSOR]: in job %p, moving to buffer %p and cursor %p\n", job, buffer, cursor)
-#else
-#define UPDATE_JOB_BUFFER_CURSOR_MESSAGE()
-#endif
-#define UPDATE_JOB_BUFFER_CURSOR() do {\
-       cursor++;\
-       if (cursor >= end) {\
-               buffer = buffer->next;\
-               if (buffer != NULL) {\
-                       cursor = & (buffer->buffer [0]);\
-                       if (buffer->next != NULL) {\
-                               end = & (buffer->buffer [PROFILER_HEAP_SHOT_WRITE_BUFFER_SIZE]);\
-                       } else {\
-                               end = job->cursor;\
-                       }\
-               } else {\
-                       cursor = NULL;\
-               }\
-       }\
-       UPDATE_JOB_BUFFER_CURSOR_MESSAGE ();\
-} while (0)
-
-static void
-profiler_heap_shot_write_data_block (ProfilerHeapShotWriteJob *job) {
-       ProfilerHeapShotWriteBuffer *buffer;
-       gpointer* cursor;
-       gpointer* end;
-       guint64 start_counter;
-       guint64 start_time;
-       guint64 end_counter;
-       guint64 end_time;
-       
-       write_uint64 (job->start_counter);
-       write_uint64 (job->start_time);
-       write_uint64 (job->end_counter);
-       write_uint64 (job->end_time);
-       write_uint32 (job->collection);
-       MONO_PROFILER_GET_CURRENT_COUNTER (start_counter);
-       MONO_PROFILER_GET_CURRENT_TIME (start_time);
-       write_uint64 (start_counter);
-       write_uint64 (start_time);
-#if DEBUG_HEAP_PROFILER
-       printf ("profiler_heap_shot_write_data_block: start writing job %p (start %p, end %p)...\n", job, & (job->buffers->buffer [0]), job->cursor);
-#endif
-       buffer = job->buffers;
-       cursor = & (buffer->buffer [0]);
-       if (buffer->next != NULL) {
-               end = & (buffer->buffer [PROFILER_HEAP_SHOT_WRITE_BUFFER_SIZE]);
-       } else {
-               end = job->cursor;
-       }
-       if (cursor >= end) {
-               cursor = NULL;
-       }
-#if DEBUG_HEAP_PROFILER
-       printf ("profiler_heap_shot_write_data_block: in job %p, starting at buffer %p and cursor %p\n", job, buffer, cursor);
-#endif
-       while (cursor != NULL) {
-               gpointer value = *cursor;
-               HeapProfilerJobValueCode code = GPOINTER_TO_UINT (value) & HEAP_CODE_MASK;
-#if DEBUG_HEAP_PROFILER
-               printf ("profiler_heap_shot_write_data_block: got value %p and code %d\n", value, code);
-#endif
-               
-               UPDATE_JOB_BUFFER_CURSOR ();
-               if (code == HEAP_CODE_FREE_OBJECT_CLASS) {
-                       MonoClass *klass = GUINT_TO_POINTER (GPOINTER_TO_UINT (value) & (~ (guint64) HEAP_CODE_MASK));
-                       //MonoClass *klass = GUINT_TO_POINTER (GPOINTER_TO_UINT (value) % 4);
-                       ClassIdMappingElement *class_id;
-                       guint32 size;
-                       
-                       class_id = class_id_mapping_element_get (klass);
-                       if (class_id == NULL) {
-                               printf ("profiler_heap_shot_write_data_block: unknown class %p", klass);
-                       }
-                       g_assert (class_id != NULL);
-                       write_uint32 ((class_id->id << 2) | HEAP_CODE_FREE_OBJECT_CLASS);
-                       
-                       size = GPOINTER_TO_UINT (*cursor);
-                       UPDATE_JOB_BUFFER_CURSOR ();
-                       write_uint32 (size);
-#if DEBUG_HEAP_PROFILER
-                       printf ("profiler_heap_shot_write_data_block: wrote unreachable object of class %p (id %d, size %d)\n", klass, class_id->id, size);
-#endif
-               } else if (code == HEAP_CODE_OBJECT) {
-                       MonoObject *object = GUINT_TO_POINTER (GPOINTER_TO_UINT (value) & (~ (guint64) HEAP_CODE_MASK));
-                       MonoClass *klass = mono_object_get_class (object);
-                       ClassIdMappingElement *class_id = class_id_mapping_element_get (klass);
-                       guint32 size = mono_object_get_size (object);
-                       guint32 references = GPOINTER_TO_UINT (*cursor);
-                       UPDATE_JOB_BUFFER_CURSOR ();
-                       
-                       if (class_id == NULL) {
-                               printf ("profiler_heap_shot_write_data_block: unknown class %p", klass);
-                       }
-                       g_assert (class_id != NULL);
-                       
-                       write_uint64 (GPOINTER_TO_UINT (value));
-                       write_uint32 (class_id->id);
-                       write_uint32 (size);
-                       write_uint32 (references);
-#if DEBUG_HEAP_PROFILER
-                       printf ("profiler_heap_shot_write_data_block: writing object %p (references %d)\n", value, references);
-#endif
-                       
-                       while (references > 0) {
-                               gpointer reference = *cursor;
-                               write_uint64 (GPOINTER_TO_UINT (reference));
-                               UPDATE_JOB_BUFFER_CURSOR ();
-                               references --;
-#if DEBUG_HEAP_PROFILER
-                               printf ("profiler_heap_shot_write_data_block:   inside object %p, wrote reference %p)\n", value, reference);
-#endif
-                       }
-               } else {
-#if DEBUG_HEAP_PROFILER
-                       printf ("profiler_heap_shot_write_data_block: unknown code %d in value %p\n", code, value);
-#endif
-                       g_assert_not_reached ();
-               }
-       }
-       write_uint32 (0);
-       
-       MONO_PROFILER_GET_CURRENT_COUNTER (end_counter);
-       MONO_PROFILER_GET_CURRENT_TIME (end_time);
-       write_uint64 (end_counter);
-       write_uint64 (end_time);
-       
-       write_current_block (MONO_PROFILER_FILE_BLOCK_KIND_HEAP_DATA);
-#if DEBUG_HEAP_PROFILER
-       printf ("profiler_heap_shot_write_data_block: writing job %p done.\n", job);
-#endif
-}
-static void
-profiler_heap_shot_write_summary_block (ProfilerHeapShotWriteJob *job) {
-       guint64 start_counter;
-       guint64 start_time;
-       guint64 end_counter;
-       guint64 end_time;
-       int id;
-       
-#if DEBUG_HEAP_PROFILER
-       printf ("profiler_heap_shot_write_summary_block: start writing job %p...\n", job);
-#endif
-       MONO_PROFILER_GET_CURRENT_COUNTER (start_counter);
-       MONO_PROFILER_GET_CURRENT_TIME (start_time);
-       write_uint64 (start_counter);
-       write_uint64 (start_time);
-       
-       write_uint32 (job->collection);
-       
-       for (id = 0; id < job->summary.capacity; id ++) {
-               if ((job->summary.per_class_data [id].reachable.instances > 0) || (job->summary.per_class_data [id].unreachable.instances > 0)) {
-                       write_uint32 (id);
-                       write_uint32 (job->summary.per_class_data [id].reachable.instances);
-                       write_uint32 (job->summary.per_class_data [id].reachable.bytes);
-                       write_uint32 (job->summary.per_class_data [id].unreachable.instances);
-                       write_uint32 (job->summary.per_class_data [id].unreachable.bytes);
-               }
-       }
-       write_uint32 (0);
-       
-       MONO_PROFILER_GET_CURRENT_COUNTER (end_counter);
-       MONO_PROFILER_GET_CURRENT_TIME (end_time);
-       write_uint64 (end_counter);
-       write_uint64 (end_time);
-       
-       write_current_block (MONO_PROFILER_FILE_BLOCK_KIND_HEAP_SUMMARY);
-#if DEBUG_HEAP_PROFILER
-       printf ("profiler_heap_shot_write_summary_block: writing job %p done.\n", job);
-#endif
-}
-
-static void
-profiler_heap_shot_write_block (ProfilerHeapShotWriteJob *job) {
-#if DEBUG_HEAP_PROFILER
-       printf ("profiler_heap_shot_write_block: working on job %p...\n", job);
-#endif
-       
-       if (profiler->action_flags.collection_summary == TRUE) {
-               profiler_heap_shot_write_summary_block (job);
-       }
-       
-       if ((profiler->action_flags.unreachable_objects == TRUE) || (profiler->action_flags.heap_shot == TRUE)) {
-               profiler_heap_shot_write_data_block (job);
-       }
-       
-       profiler_heap_shot_write_job_free_buffers (job);
-#if DEBUG_HEAP_PROFILER
-       printf ("profiler_heap_shot_write_block: work on job %p done.\n", job);
-#endif
-}
-
-static void
-write_element_load_block (LoadedElement *element, guint8 kind, gsize thread_id, gpointer item) {
-       WRITE_BYTE (kind);
-       write_uint64 (element->load_start_counter);
-       write_uint64 (element->load_end_counter);
-       write_uint64 (thread_id);
-       write_uint32 (element->id);
-       write_string (element->name);
-       if (kind & MONO_PROFILER_LOADED_EVENT_ASSEMBLY) {
-               MonoImage *image = mono_assembly_get_image ((MonoAssembly*) item);
-               MonoAssemblyName aname;
-               if (mono_assembly_fill_assembly_name (image, &aname)) {
-                       write_string (aname.name);
-                       write_uint32 (aname.major);
-                       write_uint32 (aname.minor);
-                       write_uint32 (aname.build);
-                       write_uint32 (aname.revision);
-                       write_string (aname.culture && *aname.culture? aname.culture: "neutral");
-                       write_string (aname.public_key_token [0] ? (char *)aname.public_key_token : "null");
-                       /* Retargetable flag */
-                       write_uint32 ((aname.flags & 0x00000100) ? 1 : 0);
-               } else {
-                       write_string ("UNKNOWN");
-                       write_uint32 (0);
-                       write_uint32 (0);
-                       write_uint32 (0);
-                       write_uint32 (0);
-                       write_string ("neutral");
-                       write_string ("null");
-                       write_uint32 (0);
-               }
-       }
-       write_current_block (MONO_PROFILER_FILE_BLOCK_KIND_LOADED);
-       element->load_written = TRUE;
-}
-
-static void
-write_element_unload_block (LoadedElement *element, guint8 kind, gsize thread_id) {
-       WRITE_BYTE (kind);
-       write_uint64 (element->unload_start_counter);
-       write_uint64 (element->unload_end_counter);
-       write_uint64 (thread_id);
-       write_uint32 (element->id);
-       write_string (element->name);
-       write_current_block (MONO_PROFILER_FILE_BLOCK_KIND_UNLOADED);
-       element->unload_written = TRUE;
-}
-
-static void
-write_clock_data (void) {
-       guint64 counter;
-       guint64 time;
-       
-       MONO_PROFILER_GET_CURRENT_COUNTER (counter);
-       MONO_PROFILER_GET_CURRENT_TIME (time);
-       
-       write_uint64 (counter);
-       write_uint64 (time);
-}
-
-static void
-write_mapping_block (gsize thread_id) {
-       ClassIdMappingElement *current_class;
-       MethodIdMappingElement *current_method;
-       
-       if ((profiler->classes->unwritten == NULL) && (profiler->methods->unwritten == NULL))
-               return;
-       
-#if (DEBUG_MAPPING_EVENTS || DEBUG_FILE_WRITES)
-       printf ("[write_mapping_block][TID %ld] START\n", thread_id);
-#endif
-       
-       write_clock_data ();
-       write_uint64 (thread_id);
-       
-       for (current_class = profiler->classes->unwritten; current_class != NULL; current_class = current_class->next_unwritten) {
-               MonoImage *image = mono_class_get_image (current_class->klass);
-               MonoAssembly *assembly = mono_image_get_assembly (image);
-               guint32 assembly_id = loaded_element_get_id (profiler->loaded_assemblies, assembly);
-               write_uint32 (current_class->id);
-               write_uint32 (assembly_id);
-               write_string (current_class->name);
-#if (DEBUG_MAPPING_EVENTS)
-               printf ("mapping CLASS (%d => %s)\n", current_class->id, current_class->name);
-#endif
-               g_free (current_class->name);
-               current_class->name = NULL;
-       }
-       write_uint32 (0);
-       profiler->classes->unwritten = NULL;
-       
-       for (current_method = profiler->methods->unwritten; current_method != NULL; current_method = current_method->next_unwritten) {
-               MonoMethod *method = current_method->method;
-               MonoClass *klass = mono_method_get_class (method);
-               ClassIdMappingElement *class_element = class_id_mapping_element_get (klass);
-               g_assert (class_element != NULL);
-               write_uint32 (current_method->id);
-               write_uint32 (class_element->id);
-               if (method->wrapper_type != 0) {
-                       write_uint32 (1);
-               } else {
-                       write_uint32 (0);
-               }
-               write_string (current_method->name);
-#if (DEBUG_MAPPING_EVENTS)
-               printf ("mapping METHOD ([%d]%d => %s)\n", class_element?class_element->id:1, current_method->id, current_method->name);
-#endif
-               g_free (current_method->name);
-               current_method->name = NULL;
-       }
-       write_uint32 (0);
-       profiler->methods->unwritten = NULL;
-       
-       write_clock_data ();
-       write_current_block (MONO_PROFILER_FILE_BLOCK_KIND_MAPPING);
-       
-#if (DEBUG_MAPPING_EVENTS || DEBUG_FILE_WRITES)
-       printf ("[write_mapping_block][TID %ld] END\n", thread_id);
-#endif
-}
-
-typedef enum {
-       MONO_PROFILER_PACKED_EVENT_CODE_METHOD_ENTER = 1,
-       MONO_PROFILER_PACKED_EVENT_CODE_METHOD_EXIT_IMPLICIT = 2,
-       MONO_PROFILER_PACKED_EVENT_CODE_METHOD_EXIT_EXPLICIT = 3,
-       MONO_PROFILER_PACKED_EVENT_CODE_CLASS_ALLOCATION = 4,
-       MONO_PROFILER_PACKED_EVENT_CODE_METHOD_EVENT = 5,
-       MONO_PROFILER_PACKED_EVENT_CODE_CLASS_EVENT = 6,
-       MONO_PROFILER_PACKED_EVENT_CODE_OTHER_EVENT = 7
-} MonoProfilerPackedEventCode;
-#define MONO_PROFILER_PACKED_EVENT_CODE_BITS 3
-#define MONO_PROFILER_PACKED_EVENT_DATA_BITS (8-MONO_PROFILER_PACKED_EVENT_CODE_BITS)
-#define MONO_PROFILER_PACKED_EVENT_DATA_MASK ((1<<MONO_PROFILER_PACKED_EVENT_DATA_BITS)-1)
-
-#define MONO_PROFILER_EVENT_MAKE_PACKED_CODE(result,data,base) do {\
-       result = ((base)|((data & MONO_PROFILER_PACKED_EVENT_DATA_MASK) << MONO_PROFILER_PACKED_EVENT_CODE_BITS));\
-       data >>= MONO_PROFILER_PACKED_EVENT_DATA_BITS;\
-} while (0)
-#define MONO_PROFILER_EVENT_MAKE_FULL_CODE(result,code,kind,base) do {\
-       result = ((base)|((((kind)<<4) | (code)) << MONO_PROFILER_PACKED_EVENT_CODE_BITS));\
-} while (0)
-
-static void
-rewrite_last_written_stack (ProfilerThreadStack *stack) {
-       guint8 event_code;
-       int i = thread_stack_get_last_written_frame (stack);
-       
-       MONO_PROFILER_EVENT_MAKE_FULL_CODE (event_code, MONO_PROFILER_EVENT_STACK_SECTION, 0, MONO_PROFILER_PACKED_EVENT_CODE_OTHER_EVENT);
-       WRITE_BYTE (event_code);
-       write_uint32 (0);
-       write_uint32 (i);
-       
-       while (i > 0) {
-               i--;
-               write_uint32 (thread_stack_written_frame_at_index (stack, i));
-       }
-}
-
-
-static ProfilerEventData*
-write_stack_section_event (ProfilerEventData *events, ProfilerPerThreadData *data) {
-       int last_saved_frame = events->data.number;
-       int saved_frames = events->value;
-       guint8 event_code;
-       int i;
-       
-       MONO_PROFILER_EVENT_MAKE_FULL_CODE (event_code, MONO_PROFILER_EVENT_STACK_SECTION, 0, MONO_PROFILER_PACKED_EVENT_CODE_OTHER_EVENT);
-       WRITE_BYTE (event_code);
-       write_uint32 (last_saved_frame);
-       write_uint32 (saved_frames);
-       thread_stack_set_last_written_frame (&(data->stack), last_saved_frame + saved_frames);
-       events++;
-       
-       for (i = 0; i < saved_frames; i++) {
-               guint8 code = events->code;
-               guint32 jit_flag;
-               MethodIdMappingElement *method;
-               guint32 frame_value;
-               
-               if (code == MONO_PROFILER_EVENT_METHOD_ALLOCATION_CALLER) {
-                       jit_flag = 0;
-               } else if (code == MONO_PROFILER_EVENT_METHOD_ALLOCATION_JIT_TIME_CALLER) {
-                       jit_flag = 1;
-               } else {
-                       g_assert_not_reached ();
-                       jit_flag = 0;
-               }
-               
-               method = method_id_mapping_element_get (events->data.address);
-               g_assert (method != NULL);
-               frame_value = (method->id << 1) | jit_flag;
-               write_uint32 (frame_value);
-               thread_stack_write_frame_at_index (&(data->stack), last_saved_frame + saved_frames - (1 + i), frame_value);
-               events ++;
-       }
-       
-       return events;
-}
-
-static ProfilerEventData*
-write_event (ProfilerEventData *event, ProfilerPerThreadData *data) {
-       ProfilerEventData *next = event + 1;
-       gboolean write_event_value = TRUE;
-       guint8 event_code;
-       guint64 event_data;
-       guint64 event_value;
-       gboolean write_event_value_extension_1 = FALSE;
-       guint64 event_value_extension_1 = 0;
-       gboolean write_event_value_extension_2 = FALSE;
-       guint64 event_value_extension_2 = 0;
-
-       event_value = event->value;
-       if (event_value == MAX_EVENT_VALUE) {
-               event_value = *((guint64*)next);
-               next ++;
-       }
-       
-       if (event->data_type == MONO_PROFILER_EVENT_DATA_TYPE_METHOD) {
-               MethodIdMappingElement *element = method_id_mapping_element_get (event->data.address);
-               g_assert (element != NULL);
-               event_data = element->id;
-               
-               if (event->code == MONO_PROFILER_EVENT_METHOD_CALL) {
-                       if (event->kind == MONO_PROFILER_EVENT_KIND_START) {
-                               MONO_PROFILER_EVENT_MAKE_PACKED_CODE (event_code, event_data, MONO_PROFILER_PACKED_EVENT_CODE_METHOD_ENTER);
-                       } else {
-                               MONO_PROFILER_EVENT_MAKE_PACKED_CODE (event_code, event_data, MONO_PROFILER_PACKED_EVENT_CODE_METHOD_EXIT_EXPLICIT);
-                       }
-               } else {
-                       MONO_PROFILER_EVENT_MAKE_FULL_CODE (event_code, event->code, event->kind, MONO_PROFILER_PACKED_EVENT_CODE_METHOD_EVENT); 
-               }
-       } else if (event->data_type == MONO_PROFILER_EVENT_DATA_TYPE_CLASS) {
-               ClassIdMappingElement *element = class_id_mapping_element_get (event->data.address);
-               g_assert (element != NULL);
-               event_data = element->id;
-               
-               if (event->code == MONO_PROFILER_EVENT_CLASS_ALLOCATION) {
-                       if ((! profiler->action_flags.save_allocation_caller) || (! (next->code == MONO_PROFILER_EVENT_METHOD_ALLOCATION_JIT_TIME_CALLER))) {
-                               MONO_PROFILER_EVENT_MAKE_PACKED_CODE (event_code, event_data, MONO_PROFILER_PACKED_EVENT_CODE_CLASS_ALLOCATION);
-                       } else {
-                               MONO_PROFILER_EVENT_MAKE_FULL_CODE (event_code, MONO_PROFILER_EVENT_JIT_TIME_ALLOCATION, event->kind, MONO_PROFILER_PACKED_EVENT_CODE_OTHER_EVENT);
-                       }
-                       
-                       if (profiler->action_flags.save_allocation_caller) {
-                               MonoMethod *caller_method = next->data.address;
-                               
-                               if ((next->code != MONO_PROFILER_EVENT_METHOD_ALLOCATION_CALLER) && (next->code != MONO_PROFILER_EVENT_METHOD_ALLOCATION_JIT_TIME_CALLER)) {
-                                       g_assert_not_reached ();
-                               }
-                               
-                               if (caller_method != NULL) {
-                                       MethodIdMappingElement *caller = method_id_mapping_element_get (caller_method);
-                                       g_assert (caller != NULL);
-                                       event_value_extension_1 = caller->id;
-                               }
-
-                               write_event_value_extension_1 = TRUE;
-                               next ++;
-                       }
-                       
-                       if (profiler->action_flags.allocations_carry_id) {
-                               event_value_extension_2  = GPOINTER_TO_UINT (next->data.address);
-                               
-                               if (next->code != MONO_PROFILER_EVENT_ALLOCATION_OBJECT_ID) {
-                                       g_assert_not_reached ();
-                               }
-                               
-                               write_event_value_extension_2 = TRUE;
-                               next ++;
-                       }
-               } else if (event->code == MONO_PROFILER_EVENT_CLASS_MONITOR) {
-                       g_assert (next->code == MONO_PROFILER_EVENT_OBJECT_MONITOR);
-                       
-                       MONO_PROFILER_EVENT_MAKE_FULL_CODE (event_code, event->code, event->kind, MONO_PROFILER_PACKED_EVENT_CODE_CLASS_EVENT);
-                       event_value_extension_1 = next->value;
-                       write_event_value_extension_1 = TRUE;
-                       event_value_extension_2  = GPOINTER_TO_UINT (next->data.address);
-                       write_event_value_extension_2 = TRUE;
-                       next ++;
-               } else {
-                       MONO_PROFILER_EVENT_MAKE_FULL_CODE (event_code, event->code, event->kind, MONO_PROFILER_PACKED_EVENT_CODE_CLASS_EVENT);
-               }
-       } else {
-               if (event->code == MONO_PROFILER_EVENT_STACK_SECTION) {
-                       return write_stack_section_event (event, data);
-               } else {
-                       event_data = event->data.number;
-                       MONO_PROFILER_EVENT_MAKE_FULL_CODE (event_code, event->code, event->kind, MONO_PROFILER_PACKED_EVENT_CODE_OTHER_EVENT);
-               }
-       }
-       
-       /* Skip writing JIT events if the user did not ask for them */
-       if ((event->code == MONO_PROFILER_EVENT_METHOD_JIT) && ! profiler->action_flags.jit_time) {
-               return next;
-       }
-       
-#if (DEBUG_LOGGING_PROFILER)
-       EVENT_MARK ();
-       printf ("writing EVENT[%p] data_type:%d, kind:%d, code:%d (%d:%ld:%ld)\n", event,
-                       event->data_type, event->kind, event->code,
-                       event_code, event_data, event_value);
-#endif
-       
-       WRITE_BYTE (event_code);
-       write_uint64 (event_data);
-       if (write_event_value) {
-               write_uint64 (event_value);
-               if (write_event_value_extension_1) {
-                       write_uint64 (event_value_extension_1);
-               }
-               if (write_event_value_extension_2) {
-                       write_uint64 (event_value_extension_2);
-               }
-       }
-       
-       return next;
-}
-
-static void
-write_thread_data_block (ProfilerPerThreadData *data) {
-       ProfilerEventData *start = data->first_unwritten_event;
-       ProfilerEventData *end = data->first_unmapped_event;
-       
-       if (start == end)
-               return;
-#if (DEBUG_FILE_WRITES)
-       printf ("write_thread_data_block: preparing buffer for thread %ld\n", (guint64) data->thread_id);
-#endif
-       write_clock_data ();
-       write_uint64 (data->thread_id);
-       
-       write_uint64 (data->start_event_counter);
-       
-       /* If we are tracking the stack, make sure that stack sections */
-       /* can be fully reconstructed even reading only one block */
-       if (profiler->action_flags.track_stack) {
-               rewrite_last_written_stack (&(data->stack));
-       }
-       
-       while (start < end) {
-               start = write_event (start, data);
-       }
-       WRITE_BYTE (0);
-       data->first_unwritten_event = end;
-       
-       write_clock_data ();
-       write_current_block (MONO_PROFILER_FILE_BLOCK_KIND_EVENTS);
-#if (DEBUG_FILE_WRITES)
-       printf ("write_thread_data_block: buffer for thread %ld written\n", (guint64) data->thread_id);
-#endif
-}
-
-static ProfilerExecutableMemoryRegionData*
-profiler_executable_memory_region_new (gpointer *start, gpointer *end, guint32 file_offset, char *file_name, guint32 id) {
-       ProfilerExecutableMemoryRegionData *result = g_new (ProfilerExecutableMemoryRegionData, 1);
-       result->start = start;
-       result->end = end;
-       result->file_offset = file_offset;
-       result->file_name = g_strdup (file_name);
-       result->id = id;
-       result->is_new = TRUE;
-       
-       result->file = NULL;
-       result->file_region_reference = NULL;
-       result->symbols_capacity = id;
-       result->symbols_count = id;
-       result->symbols = NULL;
-       
-       return result;
-}
-
-static void
-executable_file_close (ProfilerExecutableMemoryRegionData *region);
-
-static void
-profiler_executable_memory_region_destroy (ProfilerExecutableMemoryRegionData *data) {
-       if (data->file != NULL) {
-               executable_file_close (data);
-               data->file = NULL;
-       }
-       if (data->symbols != NULL) {
-               g_free (data->symbols);
-               data->symbols = NULL;
-       }
-       if (data->file_name != NULL) {
-               g_free (data->file_name);
-               data->file_name = NULL;
-       }
-       g_free (data);
-}
-
-static ProfilerExecutableMemoryRegions*
-profiler_executable_memory_regions_new (int next_id, int next_unmanaged_function_id) {
-       ProfilerExecutableMemoryRegions *result = g_new (ProfilerExecutableMemoryRegions, 1);
-       result->regions = g_new0 (ProfilerExecutableMemoryRegionData*, 32);
-       result->regions_capacity = 32;
-       result->regions_count = 0;
-       result->next_id = next_id;
-       result->next_unmanaged_function_id = next_unmanaged_function_id;
-       return result;
-}
-
-static void
-profiler_executable_memory_regions_destroy (ProfilerExecutableMemoryRegions *regions) {
-       int i;
-       
-       for (i = 0; i < regions->regions_count; i++) {
-               profiler_executable_memory_region_destroy (regions->regions [i]);
-       }
-       g_free (regions->regions);
-       g_free (regions);
-}
-
-static ProfilerExecutableMemoryRegionData*
-find_address_region (ProfilerExecutableMemoryRegions *regions, gpointer address) {
-       int low_index = 0;
-       int high_index = regions->regions_count;
-       int middle_index = 0;
-       ProfilerExecutableMemoryRegionData *middle_region = regions->regions [0];
-       
-       if ((regions->regions_count == 0) || (regions->regions [low_index]->start > address) || (regions->regions [high_index - 1]->end < address)) {
-               return NULL;
-       }
-       
-       //printf ("find_address_region: Looking for address %p in %d regions (from %p to %p)\n", address, regions->regions_count, regions->regions [low_index]->start, regions->regions [high_index - 1]->end);
-       
-       while (low_index != high_index) {
-               middle_index = low_index + ((high_index - low_index) / 2);
-               middle_region = regions->regions [middle_index];
-               
-               //printf ("find_address_region: Looking for address %p, considering index %d[%p-%p] (%d-%d)\n", address, middle_index, middle_region->start, middle_region->end, low_index, high_index);
-               
-               if (middle_region->start > address) {
-                       if (middle_index > 0) {
-                               high_index = middle_index;
-                       } else {
-                               return NULL;
-                       }
-               } else if (middle_region->end < address) {
-                       if (middle_index < regions->regions_count - 1) {
-                               low_index = middle_index + 1;
-                       } else {
-                               return NULL;
-                       }
-               } else {
-                       return middle_region;
-               }
-       }
-       
-       if ((middle_region == NULL) || (middle_region->start > address) || (middle_region->end < address)) {
-               return NULL;
-       } else {
-               return middle_region;
-       }
-}
-
-static void
-append_region (ProfilerExecutableMemoryRegions *regions, gpointer *start, gpointer *end, guint32 file_offset, char *file_name) {
-       if (regions->regions_count >= regions->regions_capacity) {
-               ProfilerExecutableMemoryRegionData **new_regions = g_new0 (ProfilerExecutableMemoryRegionData*, regions->regions_capacity * 2);
-               memcpy (new_regions, regions->regions, regions->regions_capacity * sizeof (ProfilerExecutableMemoryRegionData*));
-               g_free (regions->regions);
-               regions->regions = new_regions;
-               regions->regions_capacity = regions->regions_capacity * 2;
-       }
-       regions->regions [regions->regions_count] = profiler_executable_memory_region_new (start, end, file_offset, file_name, regions->next_id);
-       regions->regions_count ++;
-       regions->next_id ++;
-}
-
-static gboolean
-regions_are_equivalent (ProfilerExecutableMemoryRegionData *region1, ProfilerExecutableMemoryRegionData *region2) {
-       if ((region1->start == region2->start) &&
-                       (region1->end == region2->end) &&
-                       (region1->file_offset == region2->file_offset) &&
-                       ! strcmp (region1->file_name, region2->file_name)) {
-               return TRUE;
-       } else {
-               return FALSE;
-       }
-}
-
-static int
-compare_regions (const void *a1, const void *a2) {
-       ProfilerExecutableMemoryRegionData *r1 = * (ProfilerExecutableMemoryRegionData**) a1;
-       ProfilerExecutableMemoryRegionData *r2 = * (ProfilerExecutableMemoryRegionData**) a2;
-       return (r1->start < r2->start)? -1 : ((r1->start > r2->start)? 1 : 0);
-}
-
-static void
-restore_old_regions (ProfilerExecutableMemoryRegions *old_regions, ProfilerExecutableMemoryRegions *new_regions) {
-       int old_i;
-       int new_i;
-       
-       for (new_i = 0; new_i < new_regions->regions_count; new_i++) {
-               ProfilerExecutableMemoryRegionData *new_region = new_regions->regions [new_i];
-               for (old_i = 0; old_i < old_regions->regions_count; old_i++) {
-                       ProfilerExecutableMemoryRegionData *old_region = old_regions->regions [old_i];
-                       if ( regions_are_equivalent (old_region, new_region)) {
-                               new_regions->regions [new_i] = old_region;
-                               old_regions->regions [old_i] = new_region;
-                               
-                               // FIXME (sanity check)
-                               g_assert (new_region->is_new && ! old_region->is_new);
-                       }
-               }
-       }
-}
-
-static void
-sort_regions (ProfilerExecutableMemoryRegions *regions) {
-       if (regions->regions_count > 1) {
-               int i;
-               
-               qsort (regions->regions, regions->regions_count, sizeof (ProfilerExecutableMemoryRegionData *), compare_regions);
-               
-               i = 1;
-               while (i < regions->regions_count) {
-                       ProfilerExecutableMemoryRegionData *current_region = regions->regions [i];
-                       ProfilerExecutableMemoryRegionData *previous_region = regions->regions [i - 1];
-                       
-                       if (regions_are_equivalent (previous_region, current_region)) {
-                               int j;
-                               
-                               if (! current_region->is_new) {
-                                       profiler_executable_memory_region_destroy (previous_region);
-                                       regions->regions [i - 1] = current_region;
-                               } else {
-                                       profiler_executable_memory_region_destroy (current_region);
-                               }
-                               
-                               for (j = i + 1; j < regions->regions_count; j++) {
-                                       regions->regions [j - 1] = regions->regions [j];
-                               }
-                               
-                               regions->regions_count --;
-                       } else {
-                               i++;
-                       }
-               }
-       }
-}
-
-static void
-fix_region_references (ProfilerExecutableMemoryRegions *regions) {
-       int i;
-       for (i = 0; i < regions->regions_count; i++) {
-               ProfilerExecutableMemoryRegionData *region = regions->regions [i];
-               if (region->file_region_reference != NULL) {
-                       region->file_region_reference->region = region;
-               }
-       }
-}
-
-static void
-executable_file_add_region_reference (ProfilerExecutableFile *file, ProfilerExecutableMemoryRegionData *region) {
-       guint8 *section_headers = file->data + file->header->e_shoff;
-       int section_index;
-       
-       for (section_index = 1; section_index < file->header->e_shnum; section_index ++) {
-               ElfSection *section_header = (ElfSection*) (section_headers + (file->header->e_shentsize * section_index));
-               
-               if ((section_header->sh_addr != 0) && (section_header->sh_flags & ELF_SHF_EXECINSTR) &&
-                               (region->file_offset <= section_header->sh_offset) && (region->file_offset + (((guint8*)region->end)-((guint8*)region->start)) >= (section_header->sh_offset + section_header->sh_size))) {
-                       ProfilerExecutableFileSectionRegion *section_region = & (file->section_regions [section_index]);
-                       section_region->region = region;
-                       section_region->section_address = (gpointer) section_header->sh_addr;
-                       section_region->section_offset = section_header->sh_offset;
-                       region->file_region_reference = section_region;
-               }
-       }
-}
-
-static gboolean check_elf_header (ElfHeader* header) {
-       guint16 test = 0x0102;
-       
-       if ((header->e_ident [EI_MAG0] != 0x7f) || (header->e_ident [EI_MAG1] != 'E') ||
-                       (header->e_ident [EI_MAG2] != 'L') || (header->e_ident [EI_MAG3] != 'F')) {
-               return FALSE;
-       }
-
-       if (sizeof (gsize) == 4) {
-               if (header->e_ident [EI_CLASS] != ELF_CLASS_32) {
-                       g_warning ("Class is not ELF_CLASS_32 with gsize size %d", (int) sizeof (gsize));
-                       return FALSE;
-               }
-       } else if (sizeof (gsize) == 8) {
-               if (header->e_ident [EI_CLASS] != ELF_CLASS_64) {
-                       g_warning ("Class is not ELF_CLASS_64 with gsize size %d", (int) sizeof (gsize));
-                       return FALSE;
-               }
-       } else {
-               g_warning ("Absurd gsize size %d", (int) sizeof (gsize));
-               return FALSE;
-       }
-
-       if ((*(guint8*)(&test)) == 0x01) {
-               if (header->e_ident [EI_DATA] != ELF_DATA_MSB) {
-                       g_warning ("Data is not ELF_DATA_MSB with first test byte 0x01");
-                       return FALSE;
-               }
-       } else if ((*(guint8*)(&test)) == 0x02) {
-               if (header->e_ident [EI_DATA] != ELF_DATA_LSB) {
-                       g_warning ("Data is not ELF_DATA_LSB with first test byte 0x02");
-                       return FALSE;
-               }
-       } else {
-               g_warning ("Absurd test byte value");
-               return FALSE;
-       }
-       
-       return TRUE;
-}
-
-static gboolean check_elf_file (int fd) {
-       void *header = malloc (sizeof (ElfHeader));
-       ssize_t read_result = read (fd, header, sizeof (ElfHeader));
-       gboolean result;
-       
-       if (read_result != sizeof (ElfHeader)) {
-               result = FALSE;
-       } else {
-               result = check_elf_header ((ElfHeader*) header);
-       }
-       
-       free (header);
-       return result;
-}
-
-static ProfilerExecutableFile*
-executable_file_open (ProfilerExecutableMemoryRegionData *region) {
-       ProfilerExecutableFiles *files = & (profiler->executable_files);
-       ProfilerExecutableFile *file = region->file;
-       
-       if (file == NULL) {
-               file = (ProfilerExecutableFile*) g_hash_table_lookup (files->table, region->file_name);
-               
-               if (file == NULL) {
-                       struct stat stat_buffer;
-                       int symtab_index = 0;
-                       int strtab_index = 0;
-                       int dynsym_index = 0;
-                       int dynstr_index = 0;
-                       ElfHeader *header;
-                       guint8 *section_headers;
-                       int section_index;
-                       int strings_index;
-                       
-                       file = g_new0 (ProfilerExecutableFile, 1);
-                       region->file = file;
-                       g_hash_table_insert (files->table, region->file_name, file);
-                       file->reference_count ++;
-                       file->next_new_file = files->new_files;
-                       files->new_files = file;
-                       
-                       file->fd = open (region->file_name, O_RDONLY);
-                       if (file->fd == -1) {
-                               //g_warning ("Cannot open file '%s': '%s'", region->file_name, strerror (errno));
-                               return file;
-                       } else {
-                               if (fstat (file->fd, &stat_buffer) != 0) {
-                                       //g_warning ("Cannot stat file '%s': '%s'", region->file_name, strerror (errno));
-                                       return file;
-                               } else if (! check_elf_file (file->fd)) {
-                                       return file;
-                               } else {
-                                       size_t region_length = ((guint8*)region->end) - ((guint8*)region->start);
-                                       file->length = stat_buffer.st_size;
-                                       
-                                       if (file->length == region_length) {
-                                               file->data = region->start;
-                                               close (file->fd);
-                                               file->fd = -1;
-                                       } else {
-                                               file->data = mmap (NULL, file->length, PROT_READ, MAP_PRIVATE, file->fd, 0);
-                                               
-                                               if (file->data == MAP_FAILED) {
-                                                       close (file->fd);
-                                                       //g_warning ("Cannot map file '%s': '%s'", region->file_name, strerror (errno));
-                                                       file->data = NULL;
-                                                       return file;
-                                               }
-                                       }
-                               }
-                       }
-                       
-                       /* OK, this is a usable elf file, and we mmapped it... */
-                       header = (ElfHeader*) file->data;
-                       file->header = header;
-                       section_headers = file->data + file->header->e_shoff;
-                       file->main_string_table = ((const char*) file->data) + (((ElfSection*) (section_headers + (header->e_shentsize * header->e_shstrndx)))->sh_offset);
-                       
-                       for (section_index = 0; section_index < header->e_shnum; section_index ++) {
-                               ElfSection *section_header = (ElfSection*) (section_headers + (header->e_shentsize * section_index));
-                               
-                               if (section_header->sh_type == ELF_SHT_SYMTAB) {
-                                       symtab_index = section_index;
-                               } else if (section_header->sh_type == ELF_SHT_DYNSYM) {
-                                       dynsym_index = section_index;
-                               } else if (section_header->sh_type == ELF_SHT_STRTAB) {
-                                       if (! strcmp (file->main_string_table + section_header->sh_name, ".strtab")) {
-                                               strtab_index = section_index;
-                                       } else if (! strcmp (file->main_string_table + section_header->sh_name, ".dynstr")) {
-                                               dynstr_index = section_index;
-                                       }
-                               }
-                       }
-                       
-                       if ((symtab_index != 0) && (strtab_index != 0)) {
-                               section_index = symtab_index;
-                               strings_index = strtab_index;
-                       } else if ((dynsym_index != 0) && (dynstr_index != 0)) {
-                               section_index = dynsym_index;
-                               strings_index = dynstr_index;
-                       } else {
-                               section_index = 0;
-                               strings_index = 0;
-                       }
-                       
-                       if (section_index != 0) {
-                               ElfSection *section_header = (ElfSection*) (section_headers + (header->e_shentsize * section_index));
-                               file->symbol_size = section_header->sh_entsize;
-                               file->symbols_count = (guint32) (section_header->sh_size / section_header->sh_entsize);
-                               file->symbols_start = file->data + section_header->sh_offset;
-                               file->symbols_string_table = ((const char*) file->data) + (((ElfSection*) (section_headers + (header->e_shentsize * strings_index)))->sh_offset);
-                       }
-                       
-                       file->section_regions = g_new0 (ProfilerExecutableFileSectionRegion, file->header->e_shnum);
-               } else {
-                       region->file = file;
-                       file->reference_count ++;
-               }
-       }
-       
-       if (file->header != NULL) {
-               executable_file_add_region_reference (file, region);
-       }
-       
-       return file;
-}
-
-static void
-executable_file_free (ProfilerExecutableFile* file) {
-       if (file->fd != -1) {
-               if (close (file->fd) != 0) {
-                       g_warning ("Cannot close file: '%s'", strerror (errno));
-               }
-               if (file->data != NULL) {
-                       if (munmap (file->data, file->length) != 0) {
-                               g_warning ("Cannot unmap file: '%s'", strerror (errno));
-                       }
-               }
-       }
-       if (file->section_regions != NULL) {
-               g_free (file->section_regions);
-               file->section_regions = NULL;
-       }
-       g_free (file);
-}
-
-static void
-executable_file_close (ProfilerExecutableMemoryRegionData *region) {
-       region->file->reference_count --;
-       
-       if ((region->file_region_reference != NULL) && (region->file_region_reference->region == region)) {
-               region->file_region_reference->region = NULL;
-               region->file_region_reference->section_address = 0;
-               region->file_region_reference->section_offset = 0;
-       }
-       
-       if (region->file->reference_count <= 0) {
-               ProfilerExecutableFiles *files = & (profiler->executable_files);
-               g_hash_table_remove (files->table, region->file_name);
-               executable_file_free (region->file);
-               region->file = NULL;
-       }
-}
-
-static void
-executable_file_count_symbols (ProfilerExecutableFile *file) {
-       int symbol_index;
-       
-       for (symbol_index = 0; symbol_index < file->symbols_count; symbol_index ++) {
-               ElfSymbol *symbol = (ElfSymbol*) (file->symbols_start + (symbol_index * file->symbol_size));
-               
-               if ((ELF_ST_TYPE (symbol->st_info) == ELF_STT_FUNC) &&
-                               (symbol->st_shndx > 0) &&
-                               (symbol->st_shndx < file->header->e_shnum)) {
-                       int symbol_section_index = symbol->st_shndx;
-                       ProfilerExecutableMemoryRegionData *region = file->section_regions [symbol_section_index].region;
-                       if ((region != NULL) && (region->symbols == NULL)) {
-                               region->symbols_count ++;
-                       }
-               }
-       }
-}
-
-static void
-executable_memory_regions_prepare_symbol_tables (ProfilerExecutableMemoryRegions *regions) {
-       int i;
-       for (i = 0; i < regions->regions_count; i++) {
-               ProfilerExecutableMemoryRegionData *region = regions->regions [i];
-               if ((region->symbols_count > 0) && (region->symbols == NULL)) {
-                       region->symbols = g_new (ProfilerUnmanagedSymbol, region->symbols_count);
-                       region->symbols_capacity = region->symbols_count;
-                       region->symbols_count = 0;
-               }
-       }
-}
-
-static const char*
-executable_region_symbol_get_name (ProfilerExecutableMemoryRegionData *region, ProfilerUnmanagedSymbol *symbol) {
-       ElfSymbol *elf_symbol = (ElfSymbol*) (region->file->symbols_start + (symbol->index * region->file->symbol_size));
-       return region->file->symbols_string_table + elf_symbol->st_name;
-}
-
-static void
-executable_file_build_symbol_tables (ProfilerExecutableFile *file) {
-       int symbol_index;
-       
-       for (symbol_index = 0; symbol_index < file->symbols_count; symbol_index ++) {
-               ElfSymbol *symbol = (ElfSymbol*) (file->symbols_start + (symbol_index * file->symbol_size));
-               
-               if ((ELF_ST_TYPE (symbol->st_info) == ELF_STT_FUNC) &&
-                               (symbol->st_shndx > 0) &&
-                               (symbol->st_shndx < file->header->e_shnum)) {
-                       int symbol_section_index = symbol->st_shndx;
-                       ProfilerExecutableFileSectionRegion *section_region = & (file->section_regions [symbol_section_index]);
-                       ProfilerExecutableMemoryRegionData *region = section_region->region;
-                       
-                       if (region != NULL) {
-                               ProfilerUnmanagedSymbol *new_symbol = & (region->symbols [region->symbols_count]);
-                               region->symbols_count ++;
-                               
-                               new_symbol->id = 0;
-                               new_symbol->index = symbol_index;
-                               new_symbol->size = symbol->st_size;
-                               new_symbol->offset = (((guint8*) symbol->st_value) - section_region->section_address) - (region->file_offset - section_region->section_offset);
-                       }
-               }
-       }
-}
-
-static int
-compare_region_symbols (const void *p1, const void *p2) {
-       const ProfilerUnmanagedSymbol *s1 = p1;
-       const ProfilerUnmanagedSymbol *s2 = p2;
-       return (s1->offset < s2->offset)? -1 : ((s1->offset > s2->offset)? 1 : 0);
-}
-
-static void
-executable_memory_regions_sort_symbol_tables (ProfilerExecutableMemoryRegions *regions) {
-       int i;
-       for (i = 0; i < regions->regions_count; i++) {
-               ProfilerExecutableMemoryRegionData *region = regions->regions [i];
-               if ((region->is_new) && (region->symbols != NULL)) {
-                       qsort (region->symbols, region->symbols_count, sizeof (ProfilerUnmanagedSymbol), compare_region_symbols);
-               }
-       }
-}
-
-static void
-build_symbol_tables (ProfilerExecutableMemoryRegions *regions, ProfilerExecutableFiles *files) {
-       int i;
-       ProfilerExecutableFile *file;
-       
-       for (i = 0; i < regions->regions_count; i++) {
-               ProfilerExecutableMemoryRegionData *region = regions->regions [i];
-               if ((region->is_new) && (region->file == NULL)) {
-                       executable_file_open (region);
-               }
-       }
-       
-       for (file = files->new_files; file != NULL; file = file->next_new_file) {
-               executable_file_count_symbols (file);
-       }
-       
-       executable_memory_regions_prepare_symbol_tables (regions);
-       
-       for (file = files->new_files; file != NULL; file = file->next_new_file) {
-               executable_file_build_symbol_tables (file);
-       }
-       
-       executable_memory_regions_sort_symbol_tables (regions);
-       
-       file = files->new_files;
-       while (file != NULL) {
-               ProfilerExecutableFile *next_file = file->next_new_file;
-               file->next_new_file = NULL;
-               file = next_file;
-       }
-       files->new_files = NULL;
-}
-
-static ProfilerUnmanagedSymbol*
-executable_memory_region_find_symbol (ProfilerExecutableMemoryRegionData *region, guint32 offset) {
-       if (region->symbols_count > 0) {
-               ProfilerUnmanagedSymbol *low = region->symbols;
-               ProfilerUnmanagedSymbol *high = region->symbols + (region->symbols_count - 1);
-               int step = region->symbols_count >> 1;
-               ProfilerUnmanagedSymbol *current = region->symbols + step;
-               
-               do {
-                       step = (high - low) >> 1;
-                       
-                       if (offset < current->offset) {
-                               high = current;
-                               current = high - step;
-                       } else if (offset >= current->offset) {
-                               if (offset >= (current->offset + current->size)) {
-                                       low = current;
-                                       current = low + step;
-                               } else {
-                                       return current;
-                               }
-                       }
-               } while (step > 0);
-               
-               if ((offset >= current->offset) && (offset < (current->offset + current->size))) {
-                       return current;
-               } else {
-                       return NULL;
-               }
-       } else {
-               return NULL;
-       }
-}
-
-//FIXME: make also Win32 and BSD variants
-#define MAPS_BUFFER_SIZE 4096
-#define MAPS_FILENAME_SIZE 2048
-
-static gboolean
-update_regions_buffer (int fd, char *buffer) {
-       ssize_t result = read (fd, buffer, MAPS_BUFFER_SIZE);
-       
-       if (result == MAPS_BUFFER_SIZE) {
-               return TRUE;
-       } else if (result >= 0) {
-               *(buffer + result) = 0;
-               return FALSE;
-       } else {
-               *buffer = 0;
-               return FALSE;
-       }
-}
-
-#define GOTO_NEXT_CHAR(c,b,fd) do {\
-       (c)++;\
-       if (((c) - (b) >= MAPS_BUFFER_SIZE) || ((*(c) == 0) && ((c) != (b)))) {\
-               update_regions_buffer ((fd), (b));\
-               (c) = (b);\
-       }\
-} while (0);
-
-static int hex_digit_value (char c) {
-       if ((c >= '0') && (c <= '9')) {
-               return c - '0';
-       } else if ((c >= 'a') && (c <= 'f')) {
-               return c - 'a' + 10;
-       } else if ((c >= 'A') && (c <= 'F')) {
-               return c - 'A' + 10;
-       } else {
-               return 0;
-       }
-}
-
-/*
- * Start address
- * -
- * End address
- * (space)
- * Permissions
- * Offset
- * (space)
- * Device
- * (space)
- * Inode
- * (space)
- * File
- * \n
- */
-typedef enum {
-       MAP_LINE_PARSER_STATE_INVALID,
-       MAP_LINE_PARSER_STATE_START_ADDRESS,
-       MAP_LINE_PARSER_STATE_END_ADDRESS,
-       MAP_LINE_PARSER_STATE_PERMISSIONS,
-       MAP_LINE_PARSER_STATE_OFFSET,
-       MAP_LINE_PARSER_STATE_DEVICE,
-       MAP_LINE_PARSER_STATE_INODE,
-       MAP_LINE_PARSER_STATE_BLANK_BEFORE_FILENAME,
-       MAP_LINE_PARSER_STATE_FILENAME,
-       MAP_LINE_PARSER_STATE_DONE
-} MapLineParserState;
-
-const char *map_line_parser_state [] = {
-       "INVALID",
-       "START_ADDRESS",
-       "END_ADDRESS",
-       "PERMISSIONS",
-       "OFFSET",
-       "DEVICE",
-       "INODE",
-       "BLANK_BEFORE_FILENAME",
-       "FILENAME",
-       "DONE"
-};
-
-static char*
-parse_map_line (ProfilerExecutableMemoryRegions *regions, int fd, char *buffer, char *filename, char *current) {
-       MapLineParserState state = MAP_LINE_PARSER_STATE_START_ADDRESS;
-       gsize start_address = 0;
-       gsize end_address = 0;
-       guint32 offset = 0;
-       int filename_index = 0;
-       gboolean is_executable = FALSE;
-       gboolean done = FALSE;
-       
-       char c = *current;
-       
-       while (1) {
-               switch (state) {
-               case MAP_LINE_PARSER_STATE_START_ADDRESS:
-                       if (isxdigit (c)) {
-                               start_address <<= 4;
-                               start_address |= hex_digit_value (c);
-                       } else if (c == '-') {
-                               state = MAP_LINE_PARSER_STATE_END_ADDRESS;
-                       } else {
-                               state = MAP_LINE_PARSER_STATE_INVALID;
-                       }
-                       break;
-               case MAP_LINE_PARSER_STATE_END_ADDRESS:
-                       if (isxdigit (c)) {
-                               end_address <<= 4;
-                               end_address |= hex_digit_value (c);
-                       } else if (isblank (c)) {
-                               state = MAP_LINE_PARSER_STATE_PERMISSIONS;
-                       } else {
-                               state = MAP_LINE_PARSER_STATE_INVALID;
-                       }
-                       break;
-               case MAP_LINE_PARSER_STATE_PERMISSIONS:
-                       if (c == 'x') {
-                               is_executable = TRUE;
-                       } else if (isblank (c)) {
-                               state = MAP_LINE_PARSER_STATE_OFFSET;
-                       } else if ((c != '-') && ! isalpha (c)) {
-                               state = MAP_LINE_PARSER_STATE_INVALID;
-                       }
-                       break;
-               case MAP_LINE_PARSER_STATE_OFFSET:
-                       if (isxdigit (c)) {
-                               offset <<= 4;
-                               offset |= hex_digit_value (c);
-                       } else if (isblank (c)) {
-                               state = MAP_LINE_PARSER_STATE_DEVICE;
-                       } else {
-                               state = MAP_LINE_PARSER_STATE_INVALID;
-                       }
-                       break;
-               case MAP_LINE_PARSER_STATE_DEVICE:
-                       if (isblank (c)) {
-                               state = MAP_LINE_PARSER_STATE_INODE;
-                       } else if ((c != ':') && ! isxdigit (c)) {
-                               state = MAP_LINE_PARSER_STATE_INVALID;
-                       }
-                       break;
-               case MAP_LINE_PARSER_STATE_INODE:
-                       if (isblank (c)) {
-                               state = MAP_LINE_PARSER_STATE_BLANK_BEFORE_FILENAME;
-                       } else if (! isdigit (c)) {
-                               state = MAP_LINE_PARSER_STATE_INVALID;
-                       }
-                       break;
-               case MAP_LINE_PARSER_STATE_BLANK_BEFORE_FILENAME:
-                       if ((c == '/') || (c == '[')) {
-                               state = MAP_LINE_PARSER_STATE_FILENAME;
-                               filename [filename_index] = *current;
-                               filename_index ++;
-                       } else if (! isblank (c)) {
-                               state = MAP_LINE_PARSER_STATE_INVALID;
-                       }
-                       break;
-               case MAP_LINE_PARSER_STATE_FILENAME:
-                       if (filename_index < MAPS_FILENAME_SIZE) {
-                               if (c == '\n') {
-                                       state = MAP_LINE_PARSER_STATE_DONE;
-                                       done = TRUE;
-                                       filename [filename_index] = 0;
-                               } else {
-                                       filename [filename_index] = *current;
-                                       filename_index ++;
-                               }
-                       } else {
-                               filename [filename_index] = 0;
-                               g_warning ("ELF filename too long: \"%s\"...\n", filename);
-                       }
-                       break;
-               case MAP_LINE_PARSER_STATE_DONE:
-                       if (done && is_executable) {
-                               filename [filename_index] = 0;
-                               append_region (regions, (gpointer) start_address, (gpointer) end_address, offset, filename);
-                       }
-                       return current;
-               case MAP_LINE_PARSER_STATE_INVALID:
-                       if (c == '\n') {
-                               state = MAP_LINE_PARSER_STATE_DONE;
-                       }
-                       break;
-               }
-               
-               if (c == 0) {
-                       return NULL;
-               } else if (c == '\n') {
-                       state = MAP_LINE_PARSER_STATE_DONE;
-               }
-               
-               GOTO_NEXT_CHAR(current, buffer, fd);
-               c = *current;
-       }
-}
-
-static gboolean
-scan_process_regions (ProfilerExecutableMemoryRegions *regions) {
-       char *buffer;
-       char *filename;
-       char *current;
-       int fd;
-       
-       fd = open ("/proc/self/maps", O_RDONLY);
-       if (fd == -1) {
-               return FALSE;
-       }
-       
-       buffer = malloc (MAPS_BUFFER_SIZE);
-       filename = malloc (MAPS_FILENAME_SIZE);
-       update_regions_buffer (fd, buffer);
-       current = buffer;
-       while (current != NULL) {
-               current = parse_map_line (regions, fd, buffer, filename, current);
-       }
-       
-       free (buffer);
-       free (filename);
-       
-       close (fd);
-       return TRUE;
-}
-//End of Linux code
-
-typedef enum {
-       MONO_PROFILER_STATISTICAL_CODE_END = 0,
-       MONO_PROFILER_STATISTICAL_CODE_METHOD = 1,
-       MONO_PROFILER_STATISTICAL_CODE_UNMANAGED_FUNCTION_ID = 2,
-       MONO_PROFILER_STATISTICAL_CODE_UNMANAGED_FUNCTION_NEW_ID = 3,
-       MONO_PROFILER_STATISTICAL_CODE_UNMANAGED_FUNCTION_OFFSET_IN_REGION = 4,
-       MONO_PROFILER_STATISTICAL_CODE_CALL_CHAIN = 5,
-       MONO_PROFILER_STATISTICAL_CODE_REGIONS = 7
-} MonoProfilerStatisticalCode;
-
-static void
-refresh_memory_regions (void) {
-       ProfilerExecutableMemoryRegions *old_regions = profiler->executable_regions;
-       ProfilerExecutableMemoryRegions *new_regions = profiler_executable_memory_regions_new (old_regions->next_id, old_regions->next_unmanaged_function_id);
-       int i;
-       
-       LOG_WRITER_THREAD ("Refreshing memory regions...");
-       scan_process_regions (new_regions);
-       sort_regions (new_regions);
-       restore_old_regions (old_regions, new_regions);
-       fix_region_references (new_regions);
-       LOG_WRITER_THREAD ("Refreshed memory regions.");
-       
-       LOG_WRITER_THREAD ("Building symbol tables...");
-       build_symbol_tables (new_regions, & (profiler->executable_files));
-#if 0
-       printf ("Symbol tables done!\n");
-       printf ("Region summary...\n");
-       for (i = 0; i < new_regions->regions_count; i++) {
-               ProfilerExecutableMemoryRegionData *region = new_regions->regions [i];
-               printf ("Region %d[%d][NEW:%d] (%p-%p) at %d in file %s\n", i, region->id, region->is_new,
-                               region->start, region->end, region->file_offset, region->file_name);
-       }
-       printf ("New symbol tables dump...\n");
-       for (i = 0; i < new_regions->regions_count; i++) {
-               ProfilerExecutableMemoryRegionData *region = new_regions->regions [i];
-               
-               if (region->is_new) {
-                       int symbol_index;
-                       
-                       printf ("Region %d[%d][NEW:%d] (%p-%p) at %d in file %s\n", i, region->id, region->is_new,
-                                       region->start, region->end, region->file_offset, region->file_name);
-                       for (symbol_index = 0; symbol_index < region->symbols_count; symbol_index ++) {
-                               ProfilerUnmanagedSymbol *symbol = & (region->symbols [symbol_index]);
-                               printf ("  [%d] Symbol %s (offset %d, size %d)\n", symbol_index,
-                                               executable_region_symbol_get_name (region, symbol),
-                                               symbol->offset, symbol->size);
-                       }
-               }
-       }
-#endif
-       LOG_WRITER_THREAD ("Built symbol tables.");
-       
-       // This marks the region "sub-block"
-       write_uint32 (MONO_PROFILER_STATISTICAL_CODE_REGIONS);
-       
-       // First write the "removed" regions 
-       for (i = 0; i < old_regions->regions_count; i++) {
-               ProfilerExecutableMemoryRegionData *region = old_regions->regions [i];
-               if (! region->is_new) {
-#if DEBUG_STATISTICAL_PROFILER
-                       printf ("[refresh_memory_regions] Invalidated region %d\n", region->id);
-#endif
-                       write_uint32 (region->id);
-               }
-       }
-       write_uint32 (0);
-       
-       // Then write the new ones
-       for (i = 0; i < new_regions->regions_count; i++) {
-               ProfilerExecutableMemoryRegionData *region = new_regions->regions [i];
-               if (region->is_new) {
-                       region->is_new = FALSE;
-                       
-#if DEBUG_STATISTICAL_PROFILER
-                       printf ("[refresh_memory_regions] Wrote region %d (%p-%p[%d] '%s')\n", region->id, region->start, region->end, region->file_offset, region->file_name);
-#endif
-                       write_uint32 (region->id);
-                       write_uint64 (GPOINTER_TO_UINT (region->start));
-                       write_uint32 (GPOINTER_TO_UINT (region->end) - GPOINTER_TO_UINT (region->start));
-                       write_uint32 (region->file_offset);
-                       write_string (region->file_name);
-               }
-       }
-       write_uint32 (0);
-       
-       // Finally, free the old ones, and replace them
-       profiler_executable_memory_regions_destroy (old_regions);
-       profiler->executable_regions = new_regions;
-}
-
-static gboolean
-write_statistical_hit (gpointer address, gboolean regions_refreshed) {
-       ProfilerCodeBuffer *code_buffer = profiler_code_buffer_from_address (profiler, address);
-       
-       if ((code_buffer != NULL) && (code_buffer->info.type == MONO_PROFILER_CODE_BUFFER_METHOD)) {
-               MonoMethod *method = code_buffer->info.data.method;
-               MethodIdMappingElement *element = method_id_mapping_element_get (method);
-               
-               if (element != NULL) {
-#if DEBUG_STATISTICAL_PROFILER
-                       printf ("[write_statistical_hit] Wrote method %d\n", element->id);
-#endif
-                       write_uint32 ((element->id << 3) | MONO_PROFILER_STATISTICAL_CODE_METHOD);
-               } else {
-#if DEBUG_STATISTICAL_PROFILER
-                       printf ("[write_statistical_hit] Wrote unknown method %p\n", method);
-#endif
-                       write_uint32 (MONO_PROFILER_STATISTICAL_CODE_METHOD);
-               }
-       } else {
-               ProfilerExecutableMemoryRegionData *region = find_address_region (profiler->executable_regions, address);
-               
-               if (region == NULL && ! regions_refreshed) {
-#if DEBUG_STATISTICAL_PROFILER
-                       printf ("[write_statistical_hit] Cannot find region for address %p, refreshing...\n", address);
-#endif
-                       refresh_memory_regions ();
-                       regions_refreshed = TRUE;
-                       region = find_address_region (profiler->executable_regions, address);
-               }
-               
-               if (region != NULL) {
-                       guint32 offset = ((guint8*)address) - ((guint8*)region->start);
-                       ProfilerUnmanagedSymbol *symbol = executable_memory_region_find_symbol (region, offset);
-                       
-                       if (symbol != NULL) {
-                               if (symbol->id > 0) {
-#if DEBUG_STATISTICAL_PROFILER
-                                       printf ("[write_statistical_hit] Wrote unmanaged symbol %d\n", symbol->id);
-#endif
-                                       write_uint32 ((symbol->id << 3) | MONO_PROFILER_STATISTICAL_CODE_UNMANAGED_FUNCTION_ID);
-                               } else {
-                                       ProfilerExecutableMemoryRegions *regions = profiler->executable_regions;
-                                       const char *symbol_name = executable_region_symbol_get_name (region, symbol);
-                                       symbol->id = regions->next_unmanaged_function_id;
-                                       regions->next_unmanaged_function_id ++;
-#if DEBUG_STATISTICAL_PROFILER
-                                       printf ("[write_statistical_hit] Wrote new unmanaged symbol in region %d[%d]\n", region->id, offset);
-#endif
-                                       write_uint32 ((region->id << 3) | MONO_PROFILER_STATISTICAL_CODE_UNMANAGED_FUNCTION_NEW_ID);
-                                       write_uint32 (symbol->id);
-                                       write_string (symbol_name);
-                               }
-                       } else {
-#if DEBUG_STATISTICAL_PROFILER
-                               printf ("[write_statistical_hit] Wrote unknown unmanaged hit in region %d[%d] (address %p)\n", region->id, offset, address);
-#endif
-                               write_uint32 ((region->id << 3) | MONO_PROFILER_STATISTICAL_CODE_UNMANAGED_FUNCTION_OFFSET_IN_REGION);
-                               write_uint32 (offset);
-                       }
-               } else {
-#if DEBUG_STATISTICAL_PROFILER
-                       printf ("[write_statistical_hit] Wrote unknown unmanaged hit %p\n", address);
-#endif
-                       write_uint32 (MONO_PROFILER_STATISTICAL_CODE_UNMANAGED_FUNCTION_OFFSET_IN_REGION);
-                       write_uint64 (GPOINTER_TO_UINT (address));
-               }
-       }
-       
-       return regions_refreshed;
-}
-
-static void
-flush_all_mappings (void);
-
-static void
-write_statistical_data_block (ProfilerStatisticalData *data) {
-       int start_index = data->first_unwritten_index;
-       int end_index = data->next_free_index;
-       gboolean regions_refreshed = FALSE;
-       int call_chain_depth = profiler->statistical_call_chain_depth;
-       int index;
-       
-       if (end_index > data->end_index)
-               end_index = data->end_index;
-       
-       if (start_index == end_index)
-               return;
-       
-       data->first_unwritten_index = end_index;
-       
-       write_clock_data ();
-       
-#if DEBUG_STATISTICAL_PROFILER
-       printf ("[write_statistical_data_block] Starting loop at index %d\n", start_index);
-#endif
-       
-       for (index = start_index; index < end_index; index ++) {
-               int base_index = index * (call_chain_depth + 1);
-               ProfilerStatisticalHit hit = data->hits [base_index];
-               int callers_count;
-               
-               regions_refreshed = write_statistical_hit (hit.address, regions_refreshed);
-               base_index ++;
-               
-               for (callers_count = 0; callers_count < call_chain_depth; callers_count ++) {
-                       hit = data->hits [base_index + callers_count];
-                       if (hit.address == NULL) {
-                               break;
-                       }
-               }
-               
-               if (callers_count > 0) {
-                       write_uint32 ((callers_count << 3) | MONO_PROFILER_STATISTICAL_CODE_CALL_CHAIN);
-                       
-                       for (callers_count = 0; callers_count < call_chain_depth; callers_count ++) {
-                               hit = data->hits [base_index + callers_count];
-                               if (hit.address != NULL) {
-                                       regions_refreshed = write_statistical_hit (hit.address, regions_refreshed);
-                               } else {
-                                       break;
-                               }
-                       }
-               }
-       }
-       write_uint32 (MONO_PROFILER_STATISTICAL_CODE_END);
-       
-#if DEBUG_STATISTICAL_PROFILER
-       printf ("[write_statistical_data_block] Ending loop at index %d\n", end_index);
-#endif
-       write_clock_data ();
-       
-       write_current_block (MONO_PROFILER_FILE_BLOCK_KIND_STATISTICAL);
-}
-
-static void
-write_intro_block (void) {
-       write_uint32 (1);
-       write_string ("mono");
-       write_uint32 (profiler->flags);
-       write_uint64 (profiler->start_counter);
-       write_uint64 (profiler->start_time);
-       write_current_block (MONO_PROFILER_FILE_BLOCK_KIND_INTRO);
-}
-
-static void
-write_end_block (void) {
-       write_uint32 (1);
-       write_uint64 (profiler->end_counter);
-       write_uint64 (profiler->end_time);
-       write_current_block (MONO_PROFILER_FILE_BLOCK_KIND_END);
-}
-
-static void
-update_mapping (ProfilerPerThreadData *data) {
-       ProfilerEventData *start = data->first_unmapped_event;
-       ProfilerEventData *end = data->next_free_event;
-       data->first_unmapped_event = end;
-       
-#if (DEBUG_LOGGING_PROFILER)
-       printf ("[update_mapping][TID %ld] START\n", data->thread_id);
-#endif
-       while (start < end) {
-#if DEBUG_LOGGING_PROFILER
-               printf ("Examining event %p[TID %ld] looking for a new mapping...\n", start, data->thread_id);
-#endif
-               if (start->data_type == MONO_PROFILER_EVENT_DATA_TYPE_CLASS) {
-                       ClassIdMappingElement *element = class_id_mapping_element_get (start->data.address);
-                       if (element == NULL) {
-                               MonoClass *klass = start->data.address;
-                               class_id_mapping_element_new (klass);
-                       }
-               } else if (start->data_type == MONO_PROFILER_EVENT_DATA_TYPE_METHOD) {
-                       MethodIdMappingElement *element = method_id_mapping_element_get (start->data.address);
-                       if (element == NULL) {
-                               MonoMethod *method = start->data.address;
-                               if (method != NULL) {
-                                       method_id_mapping_element_new (method);
-                               }
-                       }
-               }
-               
-               if (start->value == MAX_EVENT_VALUE) {
-                       start ++;
-               }
-               start ++;
-       }
-#if (DEBUG_LOGGING_PROFILER)
-       printf ("[update_mapping][TID %ld] END\n", data->thread_id);
-#endif
-}
-
-static void
-flush_all_mappings (void) {
-       ProfilerPerThreadData *data;
-       
-       for (data = profiler->per_thread_data; data != NULL; data = data->next) {
-               update_mapping (data);
-       }
-       for (data = profiler->per_thread_data; data != NULL; data = data->next) {
-               write_mapping_block (data->thread_id);
-       }
-}
-
-static void
-flush_full_event_data_buffer (ProfilerPerThreadData *data) {
-       LOCK_PROFILER ();
-       
-       // We flush all mappings because some id definitions could come
-       // from other threads
-       flush_all_mappings ();
-       g_assert (data->first_unmapped_event >= data->next_free_event);
-       
-       write_thread_data_block (data);
-       
-       data->next_free_event = data->events;
-       data->next_unreserved_event = data->events;
-       data->first_unwritten_event = data->events;
-       data->first_unmapped_event = data->events;
-       MONO_PROFILER_GET_CURRENT_COUNTER (data->start_event_counter);
-       data->last_event_counter = data->start_event_counter;
-       
-       UNLOCK_PROFILER ();
-}
-
-/* The ">=" operator is intentional, to leave one spare slot for "extended values" */
-#define RESERVE_EVENTS(d,e,count) do {\
-       if ((d)->next_unreserved_event >= ((d)->end_event - (count))) {\
-               flush_full_event_data_buffer (d);\
-       }\
-       (e) = (d)->next_unreserved_event;\
-       (d)->next_unreserved_event += (count);\
-} while (0)
-#define GET_NEXT_FREE_EVENT(d,e) RESERVE_EVENTS ((d),(e),1)
-#define COMMIT_RESERVED_EVENTS(d) do {\
-       data->next_free_event = data->next_unreserved_event;\
-} while (0)
-
-static void
-flush_everything (void) {
-       ProfilerPerThreadData *data;
-       
-       flush_all_mappings ();
-       for (data = profiler->per_thread_data; data != NULL; data = data->next) {
-               write_thread_data_block (data);
-       }
-       write_statistical_data_block (profiler->statistical_data);
-}
-
-#define RESULT_TO_LOAD_CODE(r) (((r)==MONO_PROFILE_OK)?MONO_PROFILER_LOADED_EVENT_SUCCESS:MONO_PROFILER_LOADED_EVENT_FAILURE)
-static void
-appdomain_start_load (MonoProfiler *profiler, MonoDomain *domain) {
-       LOCK_PROFILER ();
-       loaded_element_load_start (profiler->loaded_appdomains, domain);
-       UNLOCK_PROFILER ();
-}
-
-static void
-appdomain_end_load (MonoProfiler *profiler, MonoDomain *domain, int result) {
-       char *name;
-       LoadedElement *element;
-       
-       name = g_strdup_printf ("%d", mono_domain_get_id (domain));
-       LOCK_PROFILER ();
-       element = loaded_element_load_end (profiler->loaded_appdomains, domain, name);
-       write_element_load_block (element, MONO_PROFILER_LOADED_EVENT_APPDOMAIN | RESULT_TO_LOAD_CODE (result), CURRENT_THREAD_ID (), domain);
-       UNLOCK_PROFILER ();
-}
-
-static void
-appdomain_start_unload (MonoProfiler *profiler, MonoDomain *domain) {
-       LOCK_PROFILER ();
-       loaded_element_unload_start (profiler->loaded_appdomains, domain);
-       flush_everything ();
-       UNLOCK_PROFILER ();
-}
-
-static void
-appdomain_end_unload (MonoProfiler *profiler, MonoDomain *domain) {
-       LoadedElement *element;
-       
-       LOCK_PROFILER ();
-       element = loaded_element_unload_end (profiler->loaded_appdomains, domain);
-       write_element_unload_block (element, MONO_PROFILER_LOADED_EVENT_APPDOMAIN, CURRENT_THREAD_ID ());
-       UNLOCK_PROFILER ();
-}
-
-static void
-module_start_load (MonoProfiler *profiler, MonoImage *module) {
-       LOCK_PROFILER ();
-       loaded_element_load_start (profiler->loaded_modules, module);
-       UNLOCK_PROFILER ();
-}
-
-static void
-module_end_load (MonoProfiler *profiler, MonoImage *module, int result) {
-       char *name;
-       MonoAssemblyName aname;
-       LoadedElement *element;
-       
-       if (mono_assembly_fill_assembly_name (module, &aname)) {
-               name = mono_stringify_assembly_name (&aname);
-       } else {
-               name = g_strdup_printf ("Dynamic module \"%p\"", module);
-       }
-       LOCK_PROFILER ();
-       element = loaded_element_load_end (profiler->loaded_modules, module, name);
-       write_element_load_block (element, MONO_PROFILER_LOADED_EVENT_MODULE | RESULT_TO_LOAD_CODE (result), CURRENT_THREAD_ID (), module);
-       UNLOCK_PROFILER ();
-}
-
-static void
-module_start_unload (MonoProfiler *profiler, MonoImage *module) {
-       LOCK_PROFILER ();
-       loaded_element_unload_start (profiler->loaded_modules, module);
-       flush_everything ();
-       UNLOCK_PROFILER ();
-}
-
-static void
-module_end_unload (MonoProfiler *profiler, MonoImage *module) {
-       LoadedElement *element;
-       
-       LOCK_PROFILER ();
-       element = loaded_element_unload_end (profiler->loaded_modules, module);
-       write_element_unload_block (element, MONO_PROFILER_LOADED_EVENT_MODULE, CURRENT_THREAD_ID ());
-       UNLOCK_PROFILER ();
-}
-
-static void
-assembly_start_load (MonoProfiler *profiler, MonoAssembly *assembly) {
-       LOCK_PROFILER ();
-       loaded_element_load_start (profiler->loaded_assemblies, assembly);
-       UNLOCK_PROFILER ();
-}
-
-static void
-assembly_end_load (MonoProfiler *profiler, MonoAssembly *assembly, int result) {
-       char *name;
-       MonoAssemblyName aname;
-       LoadedElement *element;
-       
-       if (mono_assembly_fill_assembly_name (mono_assembly_get_image (assembly), &aname)) {
-               name = mono_stringify_assembly_name (&aname);
-       } else {
-               name = g_strdup_printf ("Dynamic assembly \"%p\"", assembly);
-       }
-       LOCK_PROFILER ();
-       element = loaded_element_load_end (profiler->loaded_assemblies, assembly, name);
-       write_element_load_block (element, MONO_PROFILER_LOADED_EVENT_ASSEMBLY | RESULT_TO_LOAD_CODE (result), CURRENT_THREAD_ID (), assembly);
-       UNLOCK_PROFILER ();
-}
-
-static void
-assembly_start_unload (MonoProfiler *profiler, MonoAssembly *assembly) {
-       LOCK_PROFILER ();
-       loaded_element_unload_start (profiler->loaded_assemblies, assembly);
-       flush_everything ();
-       UNLOCK_PROFILER ();
-}
-static void
-assembly_end_unload (MonoProfiler *profiler, MonoAssembly *assembly) {
-       LoadedElement *element;
-       
-       LOCK_PROFILER ();
-       element = loaded_element_unload_end (profiler->loaded_assemblies, assembly);
-       write_element_unload_block (element, MONO_PROFILER_LOADED_EVENT_ASSEMBLY, CURRENT_THREAD_ID ());
-       UNLOCK_PROFILER ();
-}
-
-#if (DEBUG_LOGGING_PROFILER)           
-static const char*
-class_event_code_to_string (MonoProfilerClassEvents code) {
-       switch (code) {
-       case MONO_PROFILER_EVENT_CLASS_LOAD: return "LOAD";
-       case MONO_PROFILER_EVENT_CLASS_UNLOAD: return "UNLOAD";
-       case MONO_PROFILER_EVENT_CLASS_ALLOCATION: return "ALLOCATION";
-       case MONO_PROFILER_EVENT_CLASS_EXCEPTION: return "EXCEPTION";
-       default: g_assert_not_reached (); return "";
-       }
-}
-static const char*
-method_event_code_to_string (MonoProfilerMethodEvents code) {
-       switch (code) {
-       case MONO_PROFILER_EVENT_METHOD_CALL: return "CALL";
-       case MONO_PROFILER_EVENT_METHOD_JIT: return "JIT";
-       case MONO_PROFILER_EVENT_METHOD_FREED: return "FREED";
-       case MONO_PROFILER_EVENT_METHOD_ALLOCATION_CALLER: return "ALLOCATION_CALLER";
-       case MONO_PROFILER_EVENT_METHOD_ALLOCATION_JIT_TIME_CALLER: return "ALLOCATION_JIT_TIME_CALLER";
-       case MONO_PROFILER_EVENT_ALLOCATION_OBJECT_ID: return "ALLOCATION_OBJECT_ID";
-       default: g_assert_not_reached (); return "";
-       }
-}
-static const char*
-number_event_code_to_string (MonoProfilerEvents code) {
-       switch (code) {
-       case MONO_PROFILER_EVENT_THREAD: return "THREAD";
-       case MONO_PROFILER_EVENT_GC_COLLECTION: return "GC_COLLECTION";
-       case MONO_PROFILER_EVENT_GC_MARK: return "GC_MARK";
-       case MONO_PROFILER_EVENT_GC_SWEEP: return "GC_SWEEP";
-       case MONO_PROFILER_EVENT_GC_RESIZE: return "GC_RESIZE";
-       case MONO_PROFILER_EVENT_GC_STOP_WORLD: return "GC_STOP_WORLD";
-       case MONO_PROFILER_EVENT_GC_START_WORLD: return "GC_START_WORLD";
-       case MONO_PROFILER_EVENT_JIT_TIME_ALLOCATION: return "JIT_TIME_ALLOCATION";
-       case MONO_PROFILER_EVENT_STACK_SECTION: return "STACK_SECTION";
-       case MONO_PROFILER_EVENT_ALLOCATION_OBJECT_ID: return "ALLOCATION_OBJECT_ID";
-       default: g_assert_not_reached (); return "";
-       }
-}
-static const char*
-event_result_to_string (MonoProfilerEventResult code) {
-       switch (code) {
-       case MONO_PROFILER_EVENT_RESULT_SUCCESS: return "SUCCESS";
-       case MONO_PROFILER_EVENT_RESULT_FAILURE: return "FAILURE";
-       default: g_assert_not_reached (); return "";
-       }
-}
-static const char*
-event_kind_to_string (MonoProfilerEventKind code) {
-       switch (code) {
-       case MONO_PROFILER_EVENT_KIND_START: return "START";
-       case MONO_PROFILER_EVENT_KIND_END: return "END";
-       default: g_assert_not_reached (); return "";
-       }
-}
-static void
-print_event_data (ProfilerPerThreadData *data, ProfilerEventData *event, guint64 value) {
-       if (event->data_type == MONO_PROFILER_EVENT_DATA_TYPE_CLASS) {
-               printf ("STORE EVENT [TID %ld][EVENT %ld] CLASS[%p] %s:%s:%s[%d-%d-%d] %ld (%s.%s)\n",
-                               data->thread_id,
-                               event - data->events,
-                               event->data.address,
-                               class_event_code_to_string (event->code & ~MONO_PROFILER_EVENT_RESULT_MASK),
-                               event_result_to_string (event->code & MONO_PROFILER_EVENT_RESULT_MASK),
-                               event_kind_to_string (event->kind),
-                               event->data_type,
-                               event->kind,
-                               event->code,
-                               value,
-                               mono_class_get_namespace ((MonoClass*) event->data.address),
-                               mono_class_get_name ((MonoClass*) event->data.address));
-       } else if (event->data_type == MONO_PROFILER_EVENT_DATA_TYPE_METHOD) {
-               printf ("STORE EVENT [TID %ld][EVENT %ld]  METHOD[%p] %s:%s:%s[%d-%d-%d] %ld (%s.%s:%s (?))\n",
-                               data->thread_id,
-                               event - data->events,
-                               event->data.address,
-                               method_event_code_to_string (event->code & ~MONO_PROFILER_EVENT_RESULT_MASK),
-                               event_result_to_string (event->code & MONO_PROFILER_EVENT_RESULT_MASK),
-                               event_kind_to_string (event->kind),
-                               event->data_type,
-                               event->kind,
-                               event->code,
-                               value,
-                               (event->data.address != NULL) ? mono_class_get_namespace (mono_method_get_class ((MonoMethod*) event->data.address)) : "<NULL>",
-                               (event->data.address != NULL) ? mono_class_get_name (mono_method_get_class ((MonoMethod*) event->data.address)) : "<NULL>",
-                               (event->data.address != NULL) ? mono_method_get_name ((MonoMethod*) event->data.address) : "<NULL>");
-       } else {
-               printf ("STORE EVENT [TID %ld][EVENT %ld]  NUMBER[%ld] %s:%s[%d-%d-%d] %ld\n",
-                               data->thread_id,
-                               event - data->events,
-                               (guint64) event->data.number,
-                               number_event_code_to_string (event->code),
-                               event_kind_to_string (event->kind),
-                               event->data_type,
-                               event->kind,
-                               event->code,
-                               value);
-       }
-}
-#define LOG_EVENT(data,ev,val) print_event_data ((data),(ev),(val))
-#else
-#define LOG_EVENT(data,ev,val)
-#endif
-
-#define RESULT_TO_EVENT_CODE(r) (((r)==MONO_PROFILE_OK)?MONO_PROFILER_EVENT_RESULT_SUCCESS:MONO_PROFILER_EVENT_RESULT_FAILURE)
-
-#define STORE_EVENT_ITEM_COUNTER(event,p,i,dt,c,k) do {\
-       guint64 counter;\
-       guint64 delta;\
-       MONO_PROFILER_GET_CURRENT_COUNTER (counter);\
-       (event)->data.address = (i);\
-       (event)->data_type = (dt);\
-       (event)->code = (c);\
-       (event)->kind = (k);\
-       delta = counter - data->last_event_counter;\
-       if (delta < MAX_EVENT_VALUE) {\
-               (event)->value = delta;\
-       } else {\
-               ProfilerEventData *extension = data->next_unreserved_event;\
-               data->next_unreserved_event ++;\
-               (event)->value = MAX_EVENT_VALUE;\
-               *(guint64*)extension = delta;\
-       }\
-       data->last_event_counter = counter;\
-       LOG_EVENT (data, (event), delta);\
-} while (0);
-#define STORE_EVENT_ITEM_VALUE(event,p,i,dt,c,k,v) do {\
-       (event)->data.address = (i);\
-       (event)->data_type = (dt);\
-       (event)->code = (c);\
-       (event)->kind = (k);\
-       if ((v) < MAX_EVENT_VALUE) {\
-               (event)->value = (v);\
-       } else {\
-               ProfilerEventData *extension = data->next_unreserved_event;\
-               data->next_unreserved_event ++;\
-               (event)->value = MAX_EVENT_VALUE;\
-               *(guint64*)extension = (v);\
-       }\
-       LOG_EVENT (data, (event), (v));\
-}while (0);
-#define STORE_EVENT_NUMBER_COUNTER(event,p,n,dt,c,k) do {\
-       guint64 counter;\
-       guint64 delta;\
-       MONO_PROFILER_GET_CURRENT_COUNTER (counter);\
-       (event)->data.number = (n);\
-       (event)->data_type = (dt);\
-       (event)->code = (c);\
-       (event)->kind = (k);\
-       delta = counter - data->last_event_counter;\
-       if (delta < MAX_EVENT_VALUE) {\
-               (event)->value = delta;\
-       } else {\
-               ProfilerEventData *extension = data->next_unreserved_event;\
-               data->next_unreserved_event ++;\
-               (event)->value = MAX_EVENT_VALUE;\
-               *(guint64*)extension = delta;\
-       }\
-       data->last_event_counter = counter;\
-       LOG_EVENT (data, (event), delta);\
-}while (0);
-#define STORE_EVENT_NUMBER_VALUE(event,p,n,dt,c,k,v) do {\
-       (event)->data.number = (n);\
-       (event)->data_type = (dt);\
-       (event)->code = (c);\
-       (event)->kind = (k);\
-       if ((v) < MAX_EVENT_VALUE) {\
-               (event)->value = (v);\
-       } else {\
-               ProfilerEventData *extension = data->next_unreserved_event;\
-               data->next_unreserved_event ++;\
-               (event)->value = MAX_EVENT_VALUE;\
-               *(guint64*)extension = (v);\
-       }\
-       LOG_EVENT (data, (event), (v));\
-}while (0);
-#define INCREMENT_EVENT(event) do {\
-       if ((event)->value != MAX_EVENT_VALUE) {\
-               (event) ++;\
-       } else {\
-               (event) += 2;\
-       }\
-}while (0);
-
-static void
-class_start_load (MonoProfiler *profiler, MonoClass *klass) {
-       ProfilerPerThreadData *data;
-       ProfilerEventData *event;
-       GET_PROFILER_THREAD_DATA (data);
-       GET_NEXT_FREE_EVENT (data, event);
-       STORE_EVENT_ITEM_COUNTER (event, profiler, klass, MONO_PROFILER_EVENT_DATA_TYPE_CLASS, MONO_PROFILER_EVENT_CLASS_LOAD, MONO_PROFILER_EVENT_KIND_START);
-       COMMIT_RESERVED_EVENTS (data);
-}
-static void
-class_end_load (MonoProfiler *profiler, MonoClass *klass, int result) {
-       ProfilerPerThreadData *data;
-       ProfilerEventData *event;
-       GET_PROFILER_THREAD_DATA (data);
-       GET_NEXT_FREE_EVENT (data, event);
-       STORE_EVENT_ITEM_COUNTER (event, profiler, klass, MONO_PROFILER_EVENT_DATA_TYPE_CLASS, MONO_PROFILER_EVENT_CLASS_LOAD | RESULT_TO_EVENT_CODE (result), MONO_PROFILER_EVENT_KIND_END);
-       COMMIT_RESERVED_EVENTS (data);
-}
-static void
-class_start_unload (MonoProfiler *profiler, MonoClass *klass) {
-       ProfilerPerThreadData *data;
-       ProfilerEventData *event;
-       GET_PROFILER_THREAD_DATA (data);
-       GET_NEXT_FREE_EVENT (data, event);
-       STORE_EVENT_ITEM_COUNTER (event, profiler, klass, MONO_PROFILER_EVENT_DATA_TYPE_CLASS, MONO_PROFILER_EVENT_CLASS_UNLOAD, MONO_PROFILER_EVENT_KIND_START);
-       COMMIT_RESERVED_EVENTS (data);
-}
-static void
-class_end_unload (MonoProfiler *profiler, MonoClass *klass) {
-       ProfilerPerThreadData *data;
-       ProfilerEventData *event;
-       GET_PROFILER_THREAD_DATA (data);
-       GET_NEXT_FREE_EVENT (data, event);
-       STORE_EVENT_ITEM_COUNTER (event, profiler, klass, MONO_PROFILER_EVENT_DATA_TYPE_CLASS, MONO_PROFILER_EVENT_CLASS_UNLOAD, MONO_PROFILER_EVENT_KIND_END);
-       COMMIT_RESERVED_EVENTS (data);
-}
-
-static void
-method_start_jit (MonoProfiler *profiler, MonoMethod *method) {
-       ProfilerPerThreadData *data;
-       ProfilerEventData *event;
-       GET_PROFILER_THREAD_DATA (data);
-       GET_NEXT_FREE_EVENT (data, event);
-       thread_stack_push_jitted_safely (&(data->stack), method, TRUE);
-       STORE_EVENT_ITEM_COUNTER (event, profiler, method, MONO_PROFILER_EVENT_DATA_TYPE_METHOD, MONO_PROFILER_EVENT_METHOD_JIT, MONO_PROFILER_EVENT_KIND_START);
-       COMMIT_RESERVED_EVENTS (data);
-}
-static void
-method_end_jit (MonoProfiler *profiler, MonoMethod *method, int result) {
-       ProfilerPerThreadData *data;
-       ProfilerEventData *event;
-       GET_PROFILER_THREAD_DATA (data);
-       GET_NEXT_FREE_EVENT (data, event);
-       STORE_EVENT_ITEM_COUNTER (event, profiler, method, MONO_PROFILER_EVENT_DATA_TYPE_METHOD, MONO_PROFILER_EVENT_METHOD_JIT | RESULT_TO_EVENT_CODE (result), MONO_PROFILER_EVENT_KIND_END);
-       thread_stack_pop (&(data->stack));
-       COMMIT_RESERVED_EVENTS (data);
-}
-
-#if (HAS_OPROFILE)
-static void
-method_jit_result (MonoProfiler *prof, MonoMethod *method, MonoJitInfo* jinfo, int result) {
-       if (profiler->action_flags.oprofile && (result == MONO_PROFILE_OK)) {
-               MonoClass *klass = mono_method_get_class (method);
-               char *signature = mono_signature_get_desc (mono_method_signature (method), TRUE);
-               char *name = g_strdup_printf ("%s.%s:%s (%s)", mono_class_get_namespace (klass), mono_class_get_name (klass), mono_method_get_name (method), signature);
-               gpointer code_start = mono_jit_info_get_code_start (jinfo);
-               int code_size = mono_jit_info_get_code_size (jinfo);
-               
-               if (op_write_native_code (name, code_start, code_size)) {
-                       g_warning ("Problem calling op_write_native_code\n");
-               }
-               
-               g_free (signature);
-               g_free (name);
-       }
-}
-#endif
-
-
-static void
-method_enter (MonoProfiler *profiler, MonoMethod *method) {
-       ProfilerPerThreadData *data;
-       
-       CHECK_PROFILER_ENABLED ();
-       GET_PROFILER_THREAD_DATA (data);
-       if (profiler->action_flags.track_calls) {
-               ProfilerEventData *event;
-               GET_NEXT_FREE_EVENT (data, event);
-               STORE_EVENT_ITEM_COUNTER (event, profiler, method, MONO_PROFILER_EVENT_DATA_TYPE_METHOD, MONO_PROFILER_EVENT_METHOD_CALL, MONO_PROFILER_EVENT_KIND_START);
-               COMMIT_RESERVED_EVENTS (data);
-       }
-       if (profiler->action_flags.track_stack) {
-               thread_stack_push_safely (&(data->stack), method);
-       }
-}
-static void
-method_leave (MonoProfiler *profiler, MonoMethod *method) {
-       ProfilerPerThreadData *data;
-       
-       CHECK_PROFILER_ENABLED ();
-       GET_PROFILER_THREAD_DATA (data);
-       if (profiler->action_flags.track_calls) {
-               ProfilerEventData *event;
-               GET_NEXT_FREE_EVENT (data, event);
-               STORE_EVENT_ITEM_COUNTER (event, profiler, method, MONO_PROFILER_EVENT_DATA_TYPE_METHOD, MONO_PROFILER_EVENT_METHOD_CALL, MONO_PROFILER_EVENT_KIND_END);
-               COMMIT_RESERVED_EVENTS (data);
-       }
-       if (profiler->action_flags.track_stack) {
-               thread_stack_pop (&(data->stack));
-       }
-}
-
-static void
-method_free (MonoProfiler *profiler, MonoMethod *method) {
-       ProfilerPerThreadData *data;
-       ProfilerEventData *event;
-       GET_PROFILER_THREAD_DATA (data);
-       GET_NEXT_FREE_EVENT (data, event);
-       STORE_EVENT_ITEM_COUNTER (event, profiler, method, MONO_PROFILER_EVENT_DATA_TYPE_METHOD, MONO_PROFILER_EVENT_METHOD_FREED, 0);
-       COMMIT_RESERVED_EVENTS (data);
-}
-
-static void
-thread_start (MonoProfiler *profiler, uintptr_t tid) {
-       ProfilerPerThreadData *data;
-       ProfilerEventData *event;
-       GET_PROFILER_THREAD_DATA (data);
-       GET_NEXT_FREE_EVENT (data, event);
-       STORE_EVENT_NUMBER_COUNTER (event, profiler, tid, MONO_PROFILER_EVENT_DATA_TYPE_OTHER, MONO_PROFILER_EVENT_THREAD, MONO_PROFILER_EVENT_KIND_START);
-       COMMIT_RESERVED_EVENTS (data);
-}
-static void
-thread_end (MonoProfiler *profiler, uintptr_t tid) {
-       ProfilerPerThreadData *data;
-       ProfilerEventData *event;
-       GET_PROFILER_THREAD_DATA (data);
-       GET_NEXT_FREE_EVENT (data, event);
-       STORE_EVENT_NUMBER_COUNTER (event, profiler, tid, MONO_PROFILER_EVENT_DATA_TYPE_OTHER, MONO_PROFILER_EVENT_THREAD, MONO_PROFILER_EVENT_KIND_END);
-       COMMIT_RESERVED_EVENTS (data);
-}
-
-static ProfilerEventData*
-save_stack_delta (MonoProfiler *profiler, ProfilerPerThreadData *data, ProfilerEventData *events, int unsaved_frames) {
-       int i;
-       
-       /* In this loop it is safe to simply increment "events" because MAX_EVENT_VALUE cannot be reached. */
-       STORE_EVENT_NUMBER_VALUE (events, profiler, data->stack.last_saved_top, MONO_PROFILER_EVENT_DATA_TYPE_OTHER, MONO_PROFILER_EVENT_STACK_SECTION, 0, unsaved_frames);
-       events++;
-       for (i = 0; i < unsaved_frames; i++) {
-               if (! thread_stack_index_from_top_is_jitted (&(data->stack), i)) {
-                       STORE_EVENT_ITEM_VALUE (events, profiler, thread_stack_index_from_top (&(data->stack), i), MONO_PROFILER_EVENT_DATA_TYPE_METHOD, MONO_PROFILER_EVENT_METHOD_ALLOCATION_CALLER, 0, 0);
-               } else {
-                       STORE_EVENT_ITEM_VALUE (events, profiler, thread_stack_index_from_top (&(data->stack), i), MONO_PROFILER_EVENT_DATA_TYPE_METHOD, MONO_PROFILER_EVENT_METHOD_ALLOCATION_JIT_TIME_CALLER, 0, 0);
-               }
-               events ++;
-       }
-       
-       data->stack.last_saved_top = data->stack.top;
-       
-       return events;
-}
-
-static void
-object_allocated (MonoProfiler *profiler, MonoObject *obj, MonoClass *klass) {
-       ProfilerPerThreadData *data;
-       ProfilerEventData *events;
-       int unsaved_frames;
-       int event_slot_count;
-       
-       GET_PROFILER_THREAD_DATA (data);
-       event_slot_count = 1;
-       if (profiler->action_flags.save_allocation_caller) {
-               event_slot_count ++;
-       }
-       if (profiler->action_flags.allocations_carry_id) {
-               event_slot_count ++;
-       }
-       if (profiler->action_flags.save_allocation_stack) {
-               unsaved_frames = thread_stack_count_unsaved_frames (&(data->stack));
-               event_slot_count += (unsaved_frames + 1);
-       } else {
-               unsaved_frames = 0;
-       }
-       RESERVE_EVENTS (data, events, event_slot_count);
-       
-       if (profiler->action_flags.save_allocation_stack) {
-               events = save_stack_delta (profiler, data, events, unsaved_frames);
-       }
-       
-       STORE_EVENT_ITEM_VALUE (events, profiler, klass, MONO_PROFILER_EVENT_DATA_TYPE_CLASS, MONO_PROFILER_EVENT_CLASS_ALLOCATION, 0, (guint64) mono_object_get_size (obj));
-       if (profiler->action_flags.unreachable_objects || profiler->action_flags.heap_shot || profiler->action_flags.collection_summary) {
-               STORE_ALLOCATED_OBJECT (data, obj);
-       }
-       
-       if (profiler->action_flags.save_allocation_caller) {
-               MonoMethod *caller = thread_stack_top (&(data->stack));
-               gboolean caller_is_jitted = thread_stack_top_is_jitted (&(data->stack));
-               int index = 1;
-               /* In this loop it is safe to simply increment "events" because MAX_EVENT_VALUE cannot be reached. */
-               events ++;
-               
-               while ((caller != NULL) && (caller->wrapper_type == MONO_WRAPPER_MANAGED_TO_NATIVE)) {
-                       caller = thread_stack_index_from_top (&(data->stack), index);
-                       caller_is_jitted = thread_stack_index_from_top_is_jitted (&(data->stack), index);
-                       index ++;
-               }
-               if (! caller_is_jitted) {
-                       STORE_EVENT_ITEM_VALUE (events, profiler, caller, MONO_PROFILER_EVENT_DATA_TYPE_METHOD, MONO_PROFILER_EVENT_METHOD_ALLOCATION_CALLER, 0, 0);
-               } else {
-                       STORE_EVENT_ITEM_VALUE (events, profiler, caller, MONO_PROFILER_EVENT_DATA_TYPE_METHOD, MONO_PROFILER_EVENT_METHOD_ALLOCATION_JIT_TIME_CALLER, 0, 0);
-               }
-       }
-       if (profiler->action_flags.allocations_carry_id) {
-               events ++;
-               STORE_EVENT_ITEM_VALUE (events, profiler, obj, MONO_PROFILER_EVENT_DATA_TYPE_OTHER, MONO_PROFILER_EVENT_ALLOCATION_OBJECT_ID, 0, 0);
-       }
-       
-       COMMIT_RESERVED_EVENTS (data);
-}
-
-static void
-monitor_event (MonoProfiler *profiler, MonoObject *obj, MonoProfilerMonitorEvent event) {
-       ProfilerPerThreadData *data;
-       ProfilerEventData *events;
-       MonoClass *klass;
-       int unsaved_frames;
-       int event_slot_count;
-       
-       CHECK_PROFILER_ENABLED ();
-       
-       GET_PROFILER_THREAD_DATA (data);
-       klass = mono_object_get_class (obj);
-       
-       unsaved_frames = thread_stack_count_unsaved_frames (&(data->stack));
-       if (unsaved_frames > 0) {
-               event_slot_count = unsaved_frames + 3;
-       } else {
-               event_slot_count = 2;
-       }
-       
-       RESERVE_EVENTS (data, events, event_slot_count);
-       if (unsaved_frames > 0) {
-               events = save_stack_delta (profiler, data, events, unsaved_frames);
-       }
-       STORE_EVENT_ITEM_COUNTER (events, profiler, klass, MONO_PROFILER_EVENT_DATA_TYPE_CLASS, MONO_PROFILER_EVENT_CLASS_MONITOR, MONO_PROFILER_EVENT_KIND_START);
-       INCREMENT_EVENT (events);
-       STORE_EVENT_ITEM_VALUE (events, profiler, obj, MONO_PROFILER_EVENT_DATA_TYPE_OTHER, MONO_PROFILER_EVENT_OBJECT_MONITOR, 0, event);
-       COMMIT_RESERVED_EVENTS (data);
-}
-
-static void
-statistical_call_chain (MonoProfiler *profiler, int call_chain_depth, guchar **ips, void *context) {
-       MonoDomain *domain = mono_domain_get ();
-       ProfilerStatisticalData *data;
-       unsigned int index;
-       
-       CHECK_PROFILER_ENABLED ();
-       do {
-               data = profiler->statistical_data;
-               index = InterlockedIncrement ((int*) &data->next_free_index);
-               
-               if (index <= data->end_index) {
-                       unsigned int base_index = (index - 1) * (profiler->statistical_call_chain_depth + 1);
-                       unsigned int call_chain_index = 0;
-                       
-                       //printf ("[statistical_call_chain] (%d)\n", call_chain_depth);
-                       while (call_chain_index < call_chain_depth) {
-                               ProfilerStatisticalHit *hit = & (data->hits [base_index + call_chain_index]);
-                               //printf ("[statistical_call_chain] [%d] = %p\n", base_index + call_chain_index, ips [call_chain_index]);
-                               hit->address = (gpointer) ips [call_chain_index];
-                               hit->domain = domain;
-                               call_chain_index ++;
-                       }
-                       while (call_chain_index <= profiler->statistical_call_chain_depth) {
-                               ProfilerStatisticalHit *hit = & (data->hits [base_index + call_chain_index]);
-                               //printf ("[statistical_call_chain] [%d] = NULL\n", base_index + call_chain_index);
-                               hit->address = NULL;
-                               hit->domain = NULL;
-                               call_chain_index ++;
-                       }
-               } else {
-                       /* Check if we are the one that must swap the buffers */
-                       if (index == data->end_index + 1) {
-                               ProfilerStatisticalData *new_data;
-
-                               /* In the *impossible* case that the writer thread has not finished yet, */
-                               /* loop waiting for it and meanwhile lose all statistical events... */
-                               do {
-                                       /* First, wait that it consumed the ready buffer */
-                                       while (profiler->statistical_data_ready != NULL);
-                                       /* Then, wait that it produced the free buffer */
-                                       new_data = profiler->statistical_data_second_buffer;
-                               } while (new_data == NULL);
-
-                               profiler->statistical_data_ready = data;
-                               profiler->statistical_data = new_data;
-                               profiler->statistical_data_second_buffer = NULL;
-                               WRITER_EVENT_RAISE ();
-                               /* Otherwise exit from the handler and drop the event... */
-                       } else {
-                               break;
-                       }
-                       
-                       /* Loop again, hoping to acquire a free slot this time (otherwise the event will be dropped) */
-                       data = NULL;
-               }
-       } while (data == NULL);
-}
-
-static void
-statistical_hit (MonoProfiler *profiler, guchar *ip, void *context) {
-       MonoDomain *domain = mono_domain_get ();
-       ProfilerStatisticalData *data;
-       unsigned int index;
-       
-       CHECK_PROFILER_ENABLED ();
-       do {
-               data = profiler->statistical_data;
-               index = InterlockedIncrement ((int*) &data->next_free_index);
-               
-               if (index <= data->end_index) {
-                       ProfilerStatisticalHit *hit = & (data->hits [index - 1]);
-                       hit->address = (gpointer) ip;
-                       hit->domain = domain;
-               } else {
-                       /* Check if we are the one that must swap the buffers */
-                       if (index == data->end_index + 1) {
-                               ProfilerStatisticalData *new_data;
-
-                               /* In the *impossible* case that the writer thread has not finished yet, */
-                               /* loop waiting for it and meanwhile lose all statistical events... */
-                               do {
-                                       /* First, wait that it consumed the ready buffer */
-                                       while (profiler->statistical_data_ready != NULL);
-                                       /* Then, wait that it produced the free buffer */
-                                       new_data = profiler->statistical_data_second_buffer;
-                               } while (new_data == NULL);
-                               
-                               profiler->statistical_data_ready = data;
-                               profiler->statistical_data = new_data;
-                               profiler->statistical_data_second_buffer = NULL;
-                               WRITER_EVENT_RAISE ();
-                       }
-                       
-                       /* Loop again, hoping to acquire a free slot this time */
-                       data = NULL;
-               }
-       } while (data == NULL);
-}
-
-static MonoProfilerEvents
-gc_event_code_from_profiler_event (MonoGCEvent event) {
-       switch (event) {
-       case MONO_GC_EVENT_START:
-       case MONO_GC_EVENT_END:
-               return MONO_PROFILER_EVENT_GC_COLLECTION;
-       case MONO_GC_EVENT_MARK_START:
-       case MONO_GC_EVENT_MARK_END:
-               return MONO_PROFILER_EVENT_GC_MARK;
-       case MONO_GC_EVENT_RECLAIM_START:
-       case MONO_GC_EVENT_RECLAIM_END:
-               return MONO_PROFILER_EVENT_GC_SWEEP;
-       case MONO_GC_EVENT_PRE_STOP_WORLD:
-       case MONO_GC_EVENT_POST_STOP_WORLD:
-               return MONO_PROFILER_EVENT_GC_STOP_WORLD;
-       case MONO_GC_EVENT_PRE_START_WORLD:
-       case MONO_GC_EVENT_POST_START_WORLD:
-               return MONO_PROFILER_EVENT_GC_START_WORLD;
-       default:
-               g_assert_not_reached ();
-               return 0;
-       }
-}
-
-static MonoProfilerEventKind
-gc_event_kind_from_profiler_event (MonoGCEvent event) {
-       switch (event) {
-       case MONO_GC_EVENT_START:
-       case MONO_GC_EVENT_MARK_START:
-       case MONO_GC_EVENT_RECLAIM_START:
-       case MONO_GC_EVENT_PRE_STOP_WORLD:
-       case MONO_GC_EVENT_PRE_START_WORLD:
-               return MONO_PROFILER_EVENT_KIND_START;
-       case MONO_GC_EVENT_END:
-       case MONO_GC_EVENT_MARK_END:
-       case MONO_GC_EVENT_RECLAIM_END:
-       case MONO_GC_EVENT_POST_START_WORLD:
-       case MONO_GC_EVENT_POST_STOP_WORLD:
-               return MONO_PROFILER_EVENT_KIND_END;
-       default:
-               g_assert_not_reached ();
-               return 0;
-       }
-}
-
-static gboolean
-dump_current_heap_snapshot (void) {
-       gboolean result;
-       
-       if (profiler->heap_shot_was_requested) {
-               result = TRUE;
-       } else {
-               if (profiler->dump_next_heap_snapshots > 0) {
-                       profiler->dump_next_heap_snapshots--;
-                       result = TRUE;
-               } else if (profiler->dump_next_heap_snapshots < 0) {
-                       result = TRUE;
-               } else {
-                       result = FALSE;
-               }
-       }
-       
-       return result;
-}
-
-static void
-profiler_heap_buffers_setup (ProfilerHeapShotHeapBuffers *heap) {
-       heap->buffers = g_new (ProfilerHeapShotHeapBuffer, 1);
-       heap->buffers->previous = NULL;
-       heap->buffers->next = NULL;
-       heap->buffers->start_slot = &(heap->buffers->buffer [0]);
-       heap->buffers->end_slot = &(heap->buffers->buffer [PROFILER_HEAP_SHOT_HEAP_BUFFER_SIZE]);
-       heap->last = heap->buffers;
-       heap->current = heap->buffers;
-       heap->first_free_slot = & (heap->buffers->buffer [0]);
-}
-static void
-profiler_heap_buffers_clear (ProfilerHeapShotHeapBuffers *heap) {
-       heap->buffers = NULL;
-       heap->last = NULL;
-       heap->current = NULL;
-       heap->first_free_slot = NULL;
-}
-static void
-profiler_heap_buffers_free (ProfilerHeapShotHeapBuffers *heap) {
-       ProfilerHeapShotHeapBuffer *current = heap->buffers;
-       while (current != NULL) {
-               ProfilerHeapShotHeapBuffer *next = current->next;
-               g_free (current);
-               current = next;
-       }
-       profiler_heap_buffers_clear (heap);
-}
-
-static int
-report_object_references (gpointer *start, ClassIdMappingElement *layout, ProfilerHeapShotWriteJob *job) {
-       int reported_references = 0;
-       int slot;
-       
-       for (slot = 0; slot < layout->data.layout.slots; slot ++) {
-               gboolean slot_has_reference;
-               if (layout->data.layout.slots <= CLASS_LAYOUT_PACKED_BITMAP_SIZE) {
-                       if (layout->data.bitmap.compact & (((guint64)1) << slot)) {
-                               slot_has_reference = TRUE;
-                       } else {
-                               slot_has_reference = FALSE;
-                       }
-               } else {
-                       if (layout->data.bitmap.extended [slot >> 3] & (1 << (slot & 7))) {
-                               slot_has_reference = TRUE;
-                       } else {
-                               slot_has_reference = FALSE;
-                       }
-               }
-               
-               if (slot_has_reference) {
-                       gpointer field = start [slot];
-                       
-                       if ((field != NULL) && mono_object_is_alive (field)) {
-                               reported_references ++;
-                               WRITE_HEAP_SHOT_JOB_VALUE (job, field);
-                       }
-               }
-       }
-       
-       return reported_references;
-}
-
-static void
-profiler_heap_report_object_reachable (ProfilerHeapShotWriteJob *job, MonoObject *obj) {
-       if (job != NULL) {
-               MonoClass *klass = mono_object_get_class (obj);
-               ClassIdMappingElement *class_id = class_id_mapping_element_get (klass);
-               if (class_id == NULL) {
-                       printf ("profiler_heap_report_object_reachable: class %p (%s.%s) has no id\n", klass, mono_class_get_namespace (klass), mono_class_get_name (klass));
-               }
-               g_assert (class_id != NULL);
-               
-               if (job->summary.capacity > 0) {
-                       guint32 id = class_id->id;
-                       g_assert (id < job->summary.capacity);
-                       
-                       job->summary.per_class_data [id].reachable.instances ++;
-                       job->summary.per_class_data [id].reachable.bytes += mono_object_get_size (obj);
-               }
-               if (profiler->action_flags.heap_shot && job->dump_heap_data) {
-                       int reference_counter = 0;
-                       gpointer *reference_counter_location;
-                       
-                       WRITE_HEAP_SHOT_JOB_VALUE_WITH_CODE (job, obj, HEAP_CODE_OBJECT);
-#if DEBUG_HEAP_PROFILER
-                       printf ("profiler_heap_report_object_reachable: reported object %p at cursor %p\n", obj, (job->cursor - 1));
-#endif
-                       WRITE_HEAP_SHOT_JOB_VALUE (job, NULL);
-                       reference_counter_location = job->cursor - 1;
-                       
-                       if (mono_class_get_rank (klass)) {
-                               MonoArray *array = (MonoArray *) obj;
-                               MonoClass *element_class = mono_class_get_element_class (klass);
-                               ClassIdMappingElement *element_id = class_id_mapping_element_get (element_class);
-                               
-                               g_assert (element_id != NULL);
-                               if (element_id->data.layout.slots == CLASS_LAYOUT_NOT_INITIALIZED) {
-                                       class_id_mapping_element_build_layout_bitmap (element_class, element_id);
-                               }
-                               if (! mono_class_is_valuetype (element_class)) {
-                                       int length = mono_array_length (array);
-                                       int i;
-                                       for (i = 0; i < length; i++) {
-                                               MonoObject *array_element = mono_array_get (array, MonoObject*, i);
-                                               if ((array_element != NULL) && mono_object_is_alive (array_element)) {
-                                                       reference_counter ++;
-                                                       WRITE_HEAP_SHOT_JOB_VALUE (job, array_element);
-                                               }
-                                       }
-                               } else if (element_id->data.layout.references > 0) {
-                                       int length = mono_array_length (array);
-                                       int array_element_size = mono_array_element_size (klass);
-                                       int i;
-                                       for (i = 0; i < length; i++) {
-                                               gpointer array_element_address = mono_array_addr_with_size (array, array_element_size, i);
-                                               reference_counter += report_object_references (array_element_address, element_id, job);
-                                       }
-                               }
-                       } else {
-                               if (class_id->data.layout.slots == CLASS_LAYOUT_NOT_INITIALIZED) {
-                                       class_id_mapping_element_build_layout_bitmap (klass, class_id);
-                               }
-                               if (class_id->data.layout.references > 0) {
-                                       reference_counter += report_object_references ((gpointer)(((char*)obj) + sizeof (MonoObject)), class_id, job);
-                               }
-                       }
-                       
-                       *reference_counter_location = GINT_TO_POINTER (reference_counter);
-#if DEBUG_HEAP_PROFILER
-                       printf ("profiler_heap_report_object_reachable: updated reference_counter_location %p with value %d\n", reference_counter_location, reference_counter);
-#endif
-               }
-       }
-}
-static void
-profiler_heap_report_object_unreachable (ProfilerHeapShotWriteJob *job, MonoObject *obj) {
-       if (job != NULL) {
-               MonoClass *klass = mono_object_get_class (obj);
-               guint32 size = mono_object_get_size (obj);
-               
-               if (job->summary.capacity > 0) {
-                       ClassIdMappingElement *class_id = class_id_mapping_element_get (klass);
-                       guint32 id;
-                       
-                       if (class_id == NULL) {
-                               printf ("profiler_heap_report_object_reachable: class %p (%s.%s) has no id\n", klass, mono_class_get_namespace (klass), mono_class_get_name (klass));
-                       }
-                       g_assert (class_id != NULL);
-                       id = class_id->id;
-                       g_assert (id < job->summary.capacity);
-                       
-                       job->summary.per_class_data [id].unreachable.instances ++;
-                       job->summary.per_class_data [id].unreachable.bytes += size;
-               }
-               if (profiler->action_flags.unreachable_objects && job->dump_heap_data) {
-#if DEBUG_HEAP_PROFILER
-                       printf ("profiler_heap_report_object_unreachable: at job %p writing klass %p\n", job, klass);
-#endif
-                       WRITE_HEAP_SHOT_JOB_VALUE_WITH_CODE (job, klass, HEAP_CODE_FREE_OBJECT_CLASS);
-       
-#if DEBUG_HEAP_PROFILER
-                       printf ("profiler_heap_report_object_unreachable: at job %p writing size %p\n", job, GUINT_TO_POINTER (size));
-#endif
-                       WRITE_HEAP_SHOT_JOB_VALUE (job, GUINT_TO_POINTER (size));
-               }
-       }
-}
-
-static void
-profiler_heap_add_object (ProfilerHeapShotHeapBuffers *heap, ProfilerHeapShotWriteJob *job, MonoObject *obj) {
-       if (heap->first_free_slot >= heap->current->end_slot) {
-               if (heap->current->next != NULL) {
-                       heap->current = heap->current->next;
-               } else {
-                       ProfilerHeapShotHeapBuffer *buffer = g_new (ProfilerHeapShotHeapBuffer, 1);
-                       buffer->previous = heap->last;
-                       buffer->next = NULL;
-                       buffer->start_slot = &(buffer->buffer [0]);
-                       buffer->end_slot = &(buffer->buffer [PROFILER_HEAP_SHOT_HEAP_BUFFER_SIZE]);
-                       heap->current = buffer;
-                       heap->last->next = buffer;
-                       heap->last = buffer;
-               }
-               heap->first_free_slot = &(heap->current->buffer [0]);
-       }
-       
-       *(heap->first_free_slot) = obj;
-       heap->first_free_slot ++;
-       profiler_heap_report_object_reachable (job, obj);
-}
-
-static MonoObject*
-profiler_heap_pop_object_from_end (ProfilerHeapShotHeapBuffers *heap, ProfilerHeapShotWriteJob *job, MonoObject** current_slot) {
-       while (heap->first_free_slot != current_slot) {
-               MonoObject* obj;
-               
-               if (heap->first_free_slot > heap->current->start_slot) {
-                       heap->first_free_slot --;
-               } else {
-                       heap->current = heap->current->previous;
-                       g_assert (heap->current != NULL);
-                       heap->first_free_slot = heap->current->end_slot - 1;
-               }
-               
-               obj = *(heap->first_free_slot);
-               
-               if (mono_object_is_alive (obj)) {
-                       profiler_heap_report_object_reachable (job, obj);
-                       return obj;
-               } else {
-                       profiler_heap_report_object_unreachable (job, obj);
-               }
-       }
-       return NULL;
-}
-
-static void
-profiler_heap_scan (ProfilerHeapShotHeapBuffers *heap, ProfilerHeapShotWriteJob *job) {
-       ProfilerHeapShotHeapBuffer *current_buffer = heap->buffers;
-       MonoObject** current_slot = current_buffer->start_slot;
-       
-       while (current_slot != heap->first_free_slot) {
-               MonoObject *obj = *current_slot;
-               if (mono_object_is_alive (obj)) {
-                       profiler_heap_report_object_reachable (job, obj);
-               } else {
-                       profiler_heap_report_object_unreachable (job, obj);
-                       *current_slot = profiler_heap_pop_object_from_end (heap, job, current_slot);
-               }
-               
-               if (*current_slot != NULL) {
-                       current_slot ++;
-                       
-                       if (current_slot == current_buffer->end_slot) {
-                               current_buffer = current_buffer->next;
-                               g_assert (current_buffer != NULL);
-                               current_slot = current_buffer->start_slot;
-                       }
-               }
-       }
-}
-
-static inline gboolean
-heap_shot_write_job_should_be_created (gboolean dump_heap_data) {
-       return dump_heap_data || profiler->action_flags.unreachable_objects || profiler->action_flags.collection_summary;
-}
-
-static void
-process_gc_event (MonoProfiler *profiler, gboolean do_heap_profiling, MonoGCEvent ev) {
-       static gboolean dump_heap_data;
-       
-       switch (ev) {
-       case MONO_GC_EVENT_PRE_STOP_WORLD:
-               // Get the lock, so we are sure nobody is flushing events during the collection,
-               // and we can update all mappings (building the class descriptors).
-               // This is necessary also during lock profiling (even if do_heap_profiling is FALSE).
-               LOCK_PROFILER ();
-               break;
-       case MONO_GC_EVENT_POST_STOP_WORLD:
-               if (do_heap_profiling) {
-                       dump_heap_data = dump_current_heap_snapshot ();
-                       if (heap_shot_write_job_should_be_created (dump_heap_data)) {
-                               ProfilerPerThreadData *data;
-                               // Update all mappings, so that we have built all the class descriptors.
-                               flush_all_mappings ();
-                               // Also write all event buffers, so that allocations are recorded.
-                               for (data = profiler->per_thread_data; data != NULL; data = data->next) {
-                                       write_thread_data_block (data);
-                               }
-                       }
-               } else {
-                       dump_heap_data = FALSE;
-               }
-               // Release lock...
-               UNLOCK_PROFILER ();
-               break;
-       case MONO_GC_EVENT_MARK_END: {
-               if (do_heap_profiling) {
-                       ProfilerHeapShotWriteJob *job;
-                       ProfilerPerThreadData *data;
-                       
-                       if (heap_shot_write_job_should_be_created (dump_heap_data)) {
-                               job = profiler_heap_shot_write_job_new (profiler->heap_shot_was_requested, dump_heap_data, profiler->garbage_collection_counter);
-                               profiler->heap_shot_was_requested = FALSE;
-                               MONO_PROFILER_GET_CURRENT_COUNTER (job->start_counter);
-                               MONO_PROFILER_GET_CURRENT_TIME (job->start_time);
-                       } else {
-                               job = NULL;
-                       }
-                       
-                       profiler_heap_scan (&(profiler->heap), job);
-                       
-                       for (data = profiler->per_thread_data; data != NULL; data = data->next) {
-                               ProfilerHeapShotObjectBuffer *buffer;
-                               for (buffer = data->heap_shot_object_buffers; buffer != NULL; buffer = buffer->next) {
-                                       MonoObject **cursor;
-                                       for (cursor = buffer->first_unprocessed_slot; cursor < buffer->next_free_slot; cursor ++) {
-                                               MonoObject *obj = *cursor;
-#if DEBUG_HEAP_PROFILER
-                                               printf ("gc_event: in object buffer %p(%p-%p) cursor at %p has object %p ", buffer, &(buffer->buffer [0]), buffer->end, cursor, obj);
-#endif
-                                               if (mono_object_is_alive (obj)) {
-#if DEBUG_HEAP_PROFILER
-                                                       printf ("(object is alive, adding to heap)\n");
-#endif
-                                                       profiler_heap_add_object (&(profiler->heap), job, obj);
-                                               } else {
-#if DEBUG_HEAP_PROFILER
-                                                       printf ("(object is unreachable, reporting in job)\n");
-#endif
-                                                       profiler_heap_report_object_unreachable (job, obj);
-                                               }
-                                       }
-                                       buffer->first_unprocessed_slot = cursor;
-                               }
-                       }
-                       
-                       if (job != NULL) {
-                               MONO_PROFILER_GET_CURRENT_COUNTER (job->end_counter);
-                               MONO_PROFILER_GET_CURRENT_TIME (job->end_time);
-                               
-                               profiler_add_heap_shot_write_job (job);
-                               profiler_free_heap_shot_write_jobs ();
-                               WRITER_EVENT_RAISE ();
-                       }
-               }
-               break;
-       }
-       default:
-               break;
-       }
-}
-
-static void
-gc_event (MonoProfiler *profiler, MonoGCEvent ev, int generation) {
-       ProfilerPerThreadData *data;
-       ProfilerEventData *event;
-       gboolean do_heap_profiling = profiler->action_flags.unreachable_objects || profiler->action_flags.heap_shot || profiler->action_flags.collection_summary;
-       guint32 event_value;
-       
-       if (ev == MONO_GC_EVENT_START) {
-               profiler->garbage_collection_counter ++;
-       }
-       
-       event_value = (profiler->garbage_collection_counter << 8) | generation;
-       
-       if (ev == MONO_GC_EVENT_POST_STOP_WORLD) {
-               process_gc_event (profiler, do_heap_profiling, ev);
-       }
-       
-       /* Check if the gc event should be recorded. */
-       if (profiler->action_flags.report_gc_events || do_heap_profiling) {
-               GET_PROFILER_THREAD_DATA (data);
-               GET_NEXT_FREE_EVENT (data, event);
-               STORE_EVENT_NUMBER_COUNTER (event, profiler, event_value, MONO_PROFILER_EVENT_DATA_TYPE_OTHER, gc_event_code_from_profiler_event (ev), gc_event_kind_from_profiler_event (ev));
-               COMMIT_RESERVED_EVENTS (data);
-       }
-       
-       if (ev != MONO_GC_EVENT_POST_STOP_WORLD) {
-               process_gc_event (profiler, do_heap_profiling, ev);
-       }
-}
-
-static void
-gc_resize (MonoProfiler *profiler, gint64 new_size) {
-       ProfilerPerThreadData *data;
-       ProfilerEventData *event;
-       GET_PROFILER_THREAD_DATA (data);
-       GET_NEXT_FREE_EVENT (data, event);
-       profiler->garbage_collection_counter ++;
-       STORE_EVENT_NUMBER_VALUE (event, profiler, new_size, MONO_PROFILER_EVENT_DATA_TYPE_OTHER, MONO_PROFILER_EVENT_GC_RESIZE, 0, profiler->garbage_collection_counter);
-       COMMIT_RESERVED_EVENTS (data);
-}
-
-static void
-runtime_initialized (MonoProfiler *profiler) {
-       LOG_WRITER_THREAD ("runtime_initialized: initializing internal calls.\n");
-       mono_add_internal_call ("Mono.Profiler.RuntimeControls::EnableProfiler", enable_profiler);
-       mono_add_internal_call ("Mono.Profiler.RuntimeControls::DisableProfiler", disable_profiler);
-       mono_add_internal_call ("Mono.Profiler.RuntimeControls::TakeHeapSnapshot", request_heap_snapshot);
-       LOG_WRITER_THREAD ("runtime_initialized: initialized internal calls.\n");
-}
-
-
-#define MAX_COMMAND_LENGTH (1024)
-static int server_socket;
-static int command_socket;
-
-static void
-write_user_response (const char *response) {
-       LOG_USER_THREAD ("write_user_response: writing response:");
-       LOG_USER_THREAD (response);
-       send (command_socket, response, strlen (response), 0);
-}
-
-static void
-execute_user_command (char *command) {
-       char *line_feed;
-       
-       LOG_USER_THREAD ("execute_user_command: executing command:");
-       LOG_USER_THREAD (command);
-       
-       /* Ignore leading and trailing '\r' */
-       line_feed = strchr (command, '\r');
-       if (line_feed == command) {
-               command ++;
-               line_feed = strchr (command, '\r');
-       }
-       if ((line_feed != NULL) && (* (line_feed + 1) == 0)) {
-               *line_feed = 0;
-       }
-       
-       if (strcmp (command, "enable") == 0) {
-               LOG_USER_THREAD ("execute_user_command: enabling profiler");
-               enable_profiler ();
-               write_user_response ("DONE\n");
-       } else if (strcmp (command, "disable") == 0) {
-               LOG_USER_THREAD ("execute_user_command: disabling profiler");
-               disable_profiler ();
-               write_user_response ("DONE\n");
-       } else if (strcmp (command, "heap-snapshot") == 0) {
-               LOG_USER_THREAD ("execute_user_command: taking heap snapshot");
-               profiler->heap_shot_was_requested = TRUE;
-               WRITER_EVENT_RAISE ();
-               write_user_response ("DONE\n");
-       } else if (strstr (command, "heap-snapshot-counter") == 0) {
-               char *equals; 
-               LOG_USER_THREAD ("execute_user_command: changing heap counter");
-               equals = strstr (command, "=");
-               if (equals != NULL) {
-                       equals ++;
-                       if (strcmp (equals, "all") == 0) {
-                               LOG_USER_THREAD ("execute_user_command: heap counter is \"all\"");
-                               profiler->garbage_collection_counter = -1;
-                       } else if (strcmp (equals, "none") == 0) {
-                               LOG_USER_THREAD ("execute_user_command: heap counter is \"none\"");
-                               profiler->garbage_collection_counter = 0;
-                       } else {
-                               profiler->garbage_collection_counter = atoi (equals);
-                       }
-                       write_user_response ("DONE\n");
-               } else {
-                       write_user_response ("ERROR\n");
-               }
-               profiler->heap_shot_was_requested = TRUE;
-       } else {
-               LOG_USER_THREAD ("execute_user_command: command not recognized");
-               write_user_response ("ERROR\n");
-       }
-}
-
-static gboolean
-process_user_commands (void) {
-       char *command_buffer = malloc (MAX_COMMAND_LENGTH);
-       int command_buffer_current_index = 0;
-       gboolean loop = TRUE;
-       gboolean result = TRUE;
-       
-       while (loop) {
-               int unprocessed_characters;
-               
-               LOG_USER_THREAD ("process_user_commands: reading from socket...");
-               unprocessed_characters = recv (command_socket, command_buffer + command_buffer_current_index, MAX_COMMAND_LENGTH - command_buffer_current_index, 0);
-               
-               if (unprocessed_characters > 0) {
-                       char *command_end = NULL;
-                       
-                       LOG_USER_THREAD ("process_user_commands: received characters.");
-                       
-                       do {
-                               if (command_end != NULL) {
-                                       *command_end = 0;
-                                       execute_user_command (command_buffer);
-                                       unprocessed_characters -= (((command_end - command_buffer) - command_buffer_current_index) + 1);
-                                       
-                                       if (unprocessed_characters > 0) {
-                                               memmove (command_buffer, command_end + 1, unprocessed_characters);
-                                       }
-                                       command_buffer_current_index = 0;
-                               }
-                               
-                               command_end = memchr (command_buffer, '\n', command_buffer_current_index + unprocessed_characters);
-                       } while (command_end != NULL);
-                       
-                       command_buffer_current_index += unprocessed_characters;
-                       
-               } else if (unprocessed_characters == 0) {
-                       LOG_USER_THREAD ("process_user_commands: received no character.");
-                       result = TRUE;
-                       loop = FALSE;
-               } else {
-                       LOG_USER_THREAD ("process_user_commands: received error.");
-                       result = FALSE;
-                       loop = FALSE;
-               }
-       }
-       
-       free (command_buffer);
-       return result;
-}
-
-static guint32
-user_thread (gpointer nothing) {
-       struct sockaddr_in server_address;
-       
-       server_socket = -1;
-       command_socket = -1;
-       
-       LOG_USER_THREAD ("user_thread: starting up...");
-       
-       server_socket = socket (AF_INET, SOCK_STREAM, 0);
-       if (server_socket < 0) {
-               LOG_USER_THREAD ("user_thread: error creating socket.");
-               return 0;
-       }
-       memset (& server_address, 0, sizeof (server_address));
-       
-       server_address.sin_family = AF_INET;
-       server_address.sin_addr.s_addr = INADDR_ANY;
-       if ((profiler->command_port < 1023) || (profiler->command_port > 65535)) {
-               LOG_USER_THREAD ("user_thread: invalid port number.");
-               return 0;
-       }
-       server_address.sin_port = htons (profiler->command_port);
-       
-       if (bind (server_socket, (struct sockaddr *) &server_address, sizeof(server_address)) < 0) {
-               LOG_USER_THREAD ("user_thread: error binding socket.");
-               close (server_socket);
-               return 0;
-       }
-       
-       LOG_USER_THREAD ("user_thread: listening...\n");
-       listen (server_socket, 1);
-       command_socket = accept (server_socket, NULL, NULL);
-       if (command_socket < 0) {
-               LOG_USER_THREAD ("user_thread: error accepting socket.");
-               close (server_socket);
-               return 0;
-       }
-       
-       LOG_USER_THREAD ("user_thread: processing user commands...");
-       process_user_commands ();
-       
-       LOG_USER_THREAD ("user_thread: exiting cleanly.");
-       close (server_socket);
-       close (command_socket);
-       return 0;
-}
-
-
-/* called at the end of the program */
-static void
-profiler_shutdown (MonoProfiler *prof)
-{
-       ProfilerPerThreadData* current_thread_data;
-       ProfilerPerThreadData* next_thread_data;
-       
-       LOG_WRITER_THREAD ("profiler_shutdown: zeroing relevant flags");
-       mono_profiler_set_events (0);
-       /* During shutdown searching for MonoJitInfo is not possible... */
-       if (profiler->statistical_call_chain_strategy == MONO_PROFILER_CALL_CHAIN_MANAGED) {
-               mono_profiler_install_statistical_call_chain (NULL, 0, MONO_PROFILER_CALL_CHAIN_NONE);
-       }
-       //profiler->flags = 0;
-       //profiler->action_flags.unreachable_objects = FALSE;
-       //profiler->action_flags.heap_shot = FALSE;
-       
-       LOG_WRITER_THREAD ("profiler_shutdown: asking stats thread to exit");
-       profiler->terminate_writer_thread = TRUE;
-       WRITER_EVENT_RAISE ();
-       LOG_WRITER_THREAD ("profiler_shutdown: waiting for stats thread to exit");
-       WAIT_WRITER_THREAD ();
-       LOG_WRITER_THREAD ("profiler_shutdown: stats thread should be dead now");
-       WRITER_EVENT_DESTROY ();
-       
-       LOCK_PROFILER ();
-       flush_everything ();
-       MONO_PROFILER_GET_CURRENT_TIME (profiler->end_time);
-       MONO_PROFILER_GET_CURRENT_COUNTER (profiler->end_counter);
-       write_end_block ();
-       FLUSH_FILE ();
-       CLOSE_FILE();
-       mono_profiler_install_code_chunk_new (NULL);
-       mono_profiler_install_code_chunk_destroy (NULL);
-       mono_profiler_install_code_buffer_new (NULL);
-       profiler_code_chunks_cleanup (& (profiler->code_chunks));
-       UNLOCK_PROFILER ();
-       
-       g_free (profiler->file_name);
-       if (profiler->file_name_suffix != NULL) {
-               g_free (profiler->file_name_suffix);
-       }
-       
-       method_id_mapping_destroy (profiler->methods);
-       class_id_mapping_destroy (profiler->classes);
-       g_hash_table_destroy (profiler->loaded_assemblies);
-       g_hash_table_destroy (profiler->loaded_modules);
-       g_hash_table_destroy (profiler->loaded_appdomains);
-       
-       FREE_PROFILER_THREAD_DATA ();
-       
-       for (current_thread_data = profiler->per_thread_data; current_thread_data != NULL; current_thread_data = next_thread_data) {
-               next_thread_data = current_thread_data->next;
-               profiler_per_thread_data_destroy (current_thread_data);
-       }
-       if (profiler->statistical_data != NULL) {
-               profiler_statistical_data_destroy (profiler->statistical_data);
-       }
-       if (profiler->statistical_data_ready != NULL) {
-               profiler_statistical_data_destroy (profiler->statistical_data_ready);
-       }
-       if (profiler->statistical_data_second_buffer != NULL) {
-               profiler_statistical_data_destroy (profiler->statistical_data_second_buffer);
-       }
-       if (profiler->executable_regions != NULL) {
-               profiler_executable_memory_regions_destroy (profiler->executable_regions);
-       }
-       
-       profiler_heap_buffers_free (&(profiler->heap));
-       
-       profiler_free_write_buffers ();
-       profiler_destroy_heap_shot_write_jobs ();
-       
-       DELETE_PROFILER_MUTEX ();
-       
-#if (HAS_OPROFILE)
-       if (profiler->action_flags.oprofile) {
-               op_close_agent ();
-       }
-#endif
-       
-       g_free (profiler);
-       profiler = NULL;
-}
-
-#define FAIL_ARGUMENT_CHECK(message) do {\
-       failure_message = (message);\
-       goto failure_handling;\
-} while (0)
-#define FAIL_PARSING_VALUED_ARGUMENT FAIL_ARGUMENT_CHECK("cannot parse valued argument %s")
-#define FAIL_PARSING_FLAG_ARGUMENT FAIL_ARGUMENT_CHECK("cannot parse flag argument %s")
-#define CHECK_CONDITION(condition,message) do {\
-       gboolean result = (condition);\
-       if (result) {\
-               FAIL_ARGUMENT_CHECK (message);\
-       }\
-} while (0)
-#define FAIL_IF_HAS_MINUS CHECK_CONDITION(has_minus,"minus ('-') modifier not allowed for argument %s")
-#define TRUE_IF_NOT_MINUS ((!has_minus)?TRUE:FALSE)
-
-#define DEFAULT_ARGUMENTS "s"
-static void
-setup_user_options (const char *arguments) {
-       gchar **arguments_array, **current_argument;
-       detect_fast_timer ();
-       
-       profiler->file_name = NULL;
-       profiler->file_name_suffix = NULL;
-       profiler->per_thread_buffer_size = 10000;
-       profiler->statistical_buffer_size = 10000;
-       profiler->statistical_call_chain_depth = 0;
-       profiler->statistical_call_chain_strategy = MONO_PROFILER_CALL_CHAIN_NATIVE;
-       profiler->write_buffer_size = 1024;
-       profiler->dump_next_heap_snapshots = 0;
-       profiler->heap_shot_was_requested = FALSE;
-       profiler->flags = MONO_PROFILE_APPDOMAIN_EVENTS|
-                       MONO_PROFILE_ASSEMBLY_EVENTS|
-                       MONO_PROFILE_MODULE_EVENTS|
-                       MONO_PROFILE_CLASS_EVENTS|
-                       MONO_PROFILE_METHOD_EVENTS|
-                       MONO_PROFILE_JIT_COMPILATION;
-       profiler->profiler_enabled = TRUE;
-       
-       if (arguments == NULL) {
-               arguments = DEFAULT_ARGUMENTS;
-       } else if (strstr (arguments, ":")) {
-               arguments = strstr (arguments, ":") + 1;
-               if (arguments [0] == 0) {
-                       arguments = DEFAULT_ARGUMENTS;
-               }
-       }
-       
-       arguments_array = g_strsplit (arguments, ",", -1);
-       
-       for (current_argument = arguments_array; ((current_argument != NULL) && (current_argument [0] != 0)); current_argument ++) {
-               char *argument = *current_argument;
-               char *equals = strstr (argument, "=");
-               const char *failure_message = NULL;
-               gboolean has_plus;
-               gboolean has_minus;
-               
-               if (*argument == '+') {
-                       has_plus = TRUE;
-                       has_minus = FALSE;
-                       argument ++;
-               } else if (*argument == '-') {
-                       has_plus = FALSE;
-                       has_minus = TRUE;
-                       argument ++;
-               } else {
-                       has_plus = FALSE;
-                       has_minus = FALSE;
-               }
-               
-               if (equals != NULL) {
-                       int equals_position = equals - argument;
-                       
-                       if (! (strncmp (argument, "per-thread-buffer-size", equals_position) && strncmp (argument, "tbs", equals_position))) {
-                               int value = atoi (equals + 1);
-                               FAIL_IF_HAS_MINUS;
-                               if (value > 0) {
-                                       profiler->per_thread_buffer_size = value;
-                               }
-                       } else if (! (strncmp (argument, "statistical", equals_position) && strncmp (argument, "stat", equals_position) && strncmp (argument, "s", equals_position))) {
-                               int value = atoi (equals + 1);
-                               FAIL_IF_HAS_MINUS;
-                               if (value > 0) {
-                                       if (value > MONO_PROFILER_MAX_STAT_CALL_CHAIN_DEPTH) {
-                                               value = MONO_PROFILER_MAX_STAT_CALL_CHAIN_DEPTH;
-                                       }
-                                       profiler->statistical_call_chain_depth = value;
-                                       profiler->flags |= MONO_PROFILE_STATISTICAL;
-                               }
-                       } else if (! (strncmp (argument, "call-chain-strategy", equals_position) && strncmp (argument, "ccs", equals_position))) {
-                               char *parameter = equals + 1;
-                               FAIL_IF_HAS_MINUS;
-                               if (! strcmp (parameter, "native")) {
-                                       profiler->statistical_call_chain_strategy = MONO_PROFILER_CALL_CHAIN_NATIVE;
-                               } else if (! strcmp (parameter, "glibc")) {
-                                       profiler->statistical_call_chain_strategy = MONO_PROFILER_CALL_CHAIN_GLIBC;
-                               } else if (! strcmp (parameter, "managed")) {
-                                       profiler->statistical_call_chain_strategy = MONO_PROFILER_CALL_CHAIN_MANAGED;
-                               } else {
-                                       failure_message = "invalid call chain strategy in argument %s";
-                                       goto failure_handling;
-                               }
-                       } else if (! (strncmp (argument, "statistical-thread-buffer-size", equals_position) && strncmp (argument, "sbs", equals_position))) {
-                               int value = atoi (equals + 1);
-                               FAIL_IF_HAS_MINUS;
-                               if (value > 0) {
-                                       profiler->statistical_buffer_size = value;
-                               }
-                       } else if (! (strncmp (argument, "write-buffer-size", equals_position) && strncmp (argument, "wbs", equals_position))) {
-                               int value = atoi (equals + 1);
-                               FAIL_IF_HAS_MINUS;
-                               if (value > 0) {
-                                       profiler->write_buffer_size = value;
-                               }
-                       } else if (! (strncmp (argument, "output", equals_position) && strncmp (argument, "out", equals_position) && strncmp (argument, "o", equals_position) && strncmp (argument, "O", equals_position))) {
-                               FAIL_IF_HAS_MINUS;
-                               if (strlen (equals + 1) > 0) {
-                                       profiler->file_name = g_strdup (equals + 1);
-                               }
-                       } else if (! (strncmp (argument, "output-suffix", equals_position) && strncmp (argument, "suffix", equals_position) && strncmp (argument, "os", equals_position) && strncmp (argument, "OS", equals_position))) {
-                               FAIL_IF_HAS_MINUS;
-                               if (strlen (equals + 1) > 0) {
-                                       profiler->file_name_suffix = g_strdup (equals + 1);
-                               }
-                       } else if (! (strncmp (argument, "heap-shot", equals_position) && strncmp (argument, "heap", equals_position) && strncmp (argument, "h", equals_position))) {
-                               char *parameter = equals + 1;
-                               if (! strcmp (parameter, "all")) {
-                                       profiler->dump_next_heap_snapshots = -1;
-                               } else {
-                                       profiler->dump_next_heap_snapshots = atoi (parameter);
-                               }
-                               FAIL_IF_HAS_MINUS;
-                               if (! has_plus) {
-                                       profiler->action_flags.save_allocation_caller = TRUE;
-                                       profiler->action_flags.save_allocation_stack = TRUE;
-                                       profiler->action_flags.allocations_carry_id = TRUE_IF_NOT_MINUS;
-                               }
-                               profiler->action_flags.heap_shot = TRUE_IF_NOT_MINUS;
-                       } else if (! (strncmp (argument, "gc-dumps", equals_position) && strncmp (argument, "gc-d", equals_position) && strncmp (argument, "gcd", equals_position))) {
-                               FAIL_IF_HAS_MINUS;
-                               if (strlen (equals + 1) > 0) {
-                                       profiler->dump_next_heap_snapshots = atoi (equals + 1);
-                               }
-                       } else if (! (strncmp (argument, "command-port", equals_position) && strncmp (argument, "cp", equals_position))) {
-                               FAIL_IF_HAS_MINUS;
-                               if (strlen (equals + 1) > 0) {
-                                       profiler->command_port = atoi (equals + 1);
-                               }
-                       } else {
-                               FAIL_PARSING_VALUED_ARGUMENT;
-                       }
-               } else {
-                       if (! (strcmp (argument, "jit") && strcmp (argument, "j"))) {
-                               profiler->action_flags.jit_time = TRUE_IF_NOT_MINUS;
-                       } else if (! (strcmp (argument, "allocations") && strcmp (argument, "alloc") && strcmp (argument, "a"))) {
-                               FAIL_IF_HAS_MINUS;
-                               if (! has_plus) {
-                                       profiler->action_flags.save_allocation_caller = TRUE;
-                                       profiler->action_flags.save_allocation_stack = TRUE;
-                               }
-                               if (! has_minus) {
-                                       profiler->flags |= MONO_PROFILE_ALLOCATIONS;
-                               } else {
-                                       profiler->flags &= ~MONO_PROFILE_ALLOCATIONS;
-                               }
-                       } else if (! (strcmp (argument, "monitor") && strcmp (argument, "locks") && strcmp (argument, "lock"))) {
-                               FAIL_IF_HAS_MINUS;
-                               profiler->action_flags.track_stack = TRUE;
-                               profiler->flags |= MONO_PROFILE_MONITOR_EVENTS;
-                               profiler->flags |= MONO_PROFILE_GC;
-                       } else if (! (strcmp (argument, "gc") && strcmp (argument, "g"))) {
-                               FAIL_IF_HAS_MINUS;
-                               profiler->action_flags.report_gc_events = TRUE;
-                               profiler->flags |= MONO_PROFILE_GC;
-                       } else if (! (strcmp (argument, "allocations-summary") && strcmp (argument, "as"))) {
-                               profiler->action_flags.collection_summary = TRUE_IF_NOT_MINUS;
-                       } else if (! (strcmp (argument, "heap-shot") && strcmp (argument, "heap") && strcmp (argument, "h"))) {
-                               FAIL_IF_HAS_MINUS;
-                               if (! has_plus) {
-                                       profiler->action_flags.save_allocation_caller = TRUE;
-                                       profiler->action_flags.save_allocation_stack = TRUE;
-                                       profiler->action_flags.allocations_carry_id = TRUE_IF_NOT_MINUS;
-                               }
-                               profiler->action_flags.heap_shot = TRUE_IF_NOT_MINUS;
-                       } else if (! (strcmp (argument, "unreachable") && strcmp (argument, "free") && strcmp (argument, "f"))) {
-                               profiler->action_flags.unreachable_objects = TRUE_IF_NOT_MINUS;
-                       } else if (! (strcmp (argument, "threads") && strcmp (argument, "t"))) {
-                               if (! has_minus) {
-                                       profiler->flags |= MONO_PROFILE_THREADS;
-                               } else {
-                                       profiler->flags &= ~MONO_PROFILE_THREADS;
-                               }
-                       } else if (! (strcmp (argument, "enter-leave") && strcmp (argument, "calls") && strcmp (argument, "c"))) {
-                               profiler->action_flags.track_calls = TRUE_IF_NOT_MINUS;
-                       } else if (! (strcmp (argument, "statistical") && strcmp (argument, "stat") && strcmp (argument, "s"))) {
-                               if (! has_minus) {
-                                       profiler->flags |= MONO_PROFILE_STATISTICAL;
-                               } else {
-                                       profiler->flags &= ~MONO_PROFILE_STATISTICAL;
-                               }
-                       } else if (! (strcmp (argument, "save-allocation-caller") && strcmp (argument, "sac"))) {
-                               profiler->action_flags.save_allocation_caller = TRUE_IF_NOT_MINUS;
-                       } else if (! (strcmp (argument, "save-allocation-stack") && strcmp (argument, "sas"))) {
-                               profiler->action_flags.save_allocation_stack = TRUE_IF_NOT_MINUS;
-                       } else if (! (strcmp (argument, "allocations-carry-id") && strcmp (argument, "aci"))) {
-                               profiler->action_flags.allocations_carry_id = TRUE_IF_NOT_MINUS;
-                       } else if (! (strcmp (argument, "start-enabled") && strcmp (argument, "se"))) {
-                               profiler->profiler_enabled = TRUE_IF_NOT_MINUS;
-                       } else if (! (strcmp (argument, "start-disabled") && strcmp (argument, "sd"))) {
-                               profiler->profiler_enabled = ! TRUE_IF_NOT_MINUS;
-                       } else if (! (strcmp (argument, "force-accurate-timer") && strcmp (argument, "fac"))) {
-                               use_fast_timer = TRUE_IF_NOT_MINUS;
-#if (HAS_OPROFILE)
-                       } else if (! (strcmp (argument, "oprofile") && strcmp (argument, "oprof"))) {
-                               profiler->flags |= MONO_PROFILE_JIT_COMPILATION;
-                               profiler->action_flags.oprofile = TRUE;
-                               if (op_open_agent ()) {
-                                       FAIL_ARGUMENT_CHECK ("problem calling op_open_agent");
-                               }
-#endif
-                       } else if (strcmp (argument, "logging")) {
-                               FAIL_PARSING_FLAG_ARGUMENT;
-                       }
-               }
-               
-failure_handling:
-               if (failure_message != NULL) {
-                       g_warning (failure_message, argument);
-                       failure_message = NULL;
-               }
-       }
-       
-       g_free (arguments_array);
-       
-       /* Ensure that the profiler flags needed to support required action flags are active */
-       if (profiler->action_flags.jit_time) {
-               profiler->flags |= MONO_PROFILE_JIT_COMPILATION;
-       }
-       if (profiler->action_flags.save_allocation_caller || profiler->action_flags.save_allocation_stack || profiler->action_flags.allocations_carry_id) {
-               profiler->flags |= MONO_PROFILE_ALLOCATIONS;
-       }
-       if (profiler->action_flags.collection_summary || profiler->action_flags.heap_shot || profiler->action_flags.unreachable_objects) {
-               profiler->flags |= MONO_PROFILE_ALLOCATIONS;
-               profiler->action_flags.report_gc_events = TRUE;
-       }
-       if (profiler->action_flags.track_calls) {
-               profiler->flags |= MONO_PROFILE_ENTER_LEAVE;
-               profiler->action_flags.jit_time = TRUE;
-       }
-       if (profiler->action_flags.save_allocation_caller || profiler->action_flags.save_allocation_stack) {
-               profiler->action_flags.track_stack = TRUE;
-               profiler->flags |= MONO_PROFILE_ENTER_LEAVE;
-       }
-       if (profiler->action_flags.track_stack) {
-               profiler->flags |= MONO_PROFILE_ENTER_LEAVE;
-       }
-       
-       /* Tracking call stacks is useless if we already emit all enter-exit events... */
-       if (profiler->action_flags.track_calls) {
-               profiler->action_flags.track_stack = FALSE;
-               profiler->action_flags.save_allocation_caller = FALSE;
-               profiler->action_flags.save_allocation_stack = FALSE;
-       }
-       
-       /* Without JIT events the stat profiler will not find method IDs... */
-       if (profiler->flags | MONO_PROFILE_STATISTICAL) {
-               profiler->flags |= MONO_PROFILE_JIT_COMPILATION;
-       }
-       /* Profiling allocations without knowing which gc we are doing is not nice... */
-       if (profiler->flags | MONO_PROFILE_ALLOCATIONS) {
-               profiler->flags |= MONO_PROFILE_GC;
-               profiler->action_flags.report_gc_events = TRUE;
-       }
-
-       
-       if (profiler->file_name == NULL) {
-               char *program_name = g_get_prgname ();
-               
-               if (program_name != NULL) {
-                       char *name_buffer = g_strdup (program_name);
-                       char *name_start = name_buffer;
-                       char *cursor;
-                       
-                       /* Jump over the last '/' */
-                       cursor = strrchr (name_buffer, '/');
-                       if (cursor == NULL) {
-                               cursor = name_buffer;
-                       } else {
-                               cursor ++;
-                       }
-                       name_start = cursor;
-                       
-                       /* Then jump over the last '\\' */
-                       cursor = strrchr (name_start, '\\');
-                       if (cursor == NULL) {
-                               cursor = name_start;
-                       } else {
-                               cursor ++;
-                       }
-                       name_start = cursor;
-                       
-                       /* Finally, find the last '.' */
-                       cursor = strrchr (name_start, '.');
-                       if (cursor != NULL) {
-                               *cursor = 0;
-                       }
-                       
-                       if (profiler->file_name_suffix == NULL) {
-                               profiler->file_name = g_strdup_printf ("%s.mprof", name_start);
-                       } else {
-                               profiler->file_name = g_strdup_printf ("%s-%s.mprof", name_start, profiler->file_name_suffix);
-                       }
-                       g_free (name_buffer);
-               } else {
-                       profiler->file_name = g_strdup_printf ("%s.mprof", "profiler-log");
-               }
-       }
-}
-
-static guint32
-data_writer_thread (gpointer nothing) {
-       for (;;) {
-               ProfilerStatisticalData *statistical_data;
-               gboolean done;
-               
-               LOG_WRITER_THREAD ("data_writer_thread: going to sleep");
-               WRITER_EVENT_WAIT ();
-               LOG_WRITER_THREAD ("data_writer_thread: just woke up");
-               
-               if (profiler->heap_shot_was_requested) {
-                       MonoDomain * root_domain = mono_get_root_domain ();
-                       
-                       if (root_domain != NULL) {
-                               MonoThread *this_thread;
-                               LOG_WRITER_THREAD ("data_writer_thread: attaching thread");
-                               this_thread = mono_thread_attach (root_domain);
-                       LOG_WRITER_THREAD ("data_writer_thread: starting requested collection");
-                       mono_gc_collect (mono_gc_max_generation ());
-                       LOG_WRITER_THREAD ("data_writer_thread: requested collection done");
-                               LOG_WRITER_THREAD ("data_writer_thread: detaching thread");
-                               mono_thread_detach (this_thread);
-                               this_thread = NULL;
-                               LOG_WRITER_THREAD ("data_writer_thread: collection sequence completed");
-                       } else {
-                               LOG_WRITER_THREAD ("data_writer_thread: cannot get root domain, collection sequence skipped");
-                       }
-                       
-               }
-               
-               statistical_data = profiler->statistical_data_ready;
-               done = (statistical_data == NULL) && (profiler->heap_shot_write_jobs == NULL);
-               
-               if (!done) {
-                       LOG_WRITER_THREAD ("data_writer_thread: acquiring lock and writing data");
-                       LOCK_PROFILER ();
-                       
-                       // This makes sure that all method ids are in place
-                       LOG_WRITER_THREAD ("data_writer_thread: writing mapping...");
-                       flush_all_mappings ();
-                       LOG_WRITER_THREAD ("data_writer_thread: wrote mapping");
-                       
-                       if (statistical_data != NULL) {
-                               LOG_WRITER_THREAD ("data_writer_thread: writing statistical data...");
-                               profiler->statistical_data_ready = NULL;
-                               write_statistical_data_block (statistical_data);
-                               statistical_data->next_free_index = 0;
-                               statistical_data->first_unwritten_index = 0;
-                               profiler->statistical_data_second_buffer = statistical_data;
-                               LOG_WRITER_THREAD ("data_writer_thread: wrote statistical data");
-                       }
-                       
-                       profiler_process_heap_shot_write_jobs ();
-                       
-                       UNLOCK_PROFILER ();
-                       LOG_WRITER_THREAD ("data_writer_thread: wrote data and released lock");
-               } else {
-                       LOG_WRITER_THREAD ("data_writer_thread: acquiring lock and flushing buffers");
-                       LOCK_PROFILER ();
-                       LOG_WRITER_THREAD ("data_writer_thread: lock acquired, flushing buffers");
-                       flush_everything ();
-                       UNLOCK_PROFILER ();
-                       LOG_WRITER_THREAD ("data_writer_thread: flushed buffers and released lock");
-               }
-               
-               if (profiler->terminate_writer_thread) {
-               LOG_WRITER_THREAD ("data_writer_thread: exiting thread");
-                       CLEANUP_WRITER_THREAD ();
-                       EXIT_THREAD ();
-               }
-       }
-       return 0;
-}
-
-void
-mono_profiler_startup (const char *desc);
-
-/* the entry point (mono_profiler_load?) */
-void
-mono_profiler_startup (const char *desc)
-{
-       profiler = g_new0 (MonoProfiler, 1);
-       
-       setup_user_options ((desc != NULL) ? desc : DEFAULT_ARGUMENTS);
-       
-       INITIALIZE_PROFILER_MUTEX ();
-       MONO_PROFILER_GET_CURRENT_TIME (profiler->start_time);
-       MONO_PROFILER_GET_CURRENT_COUNTER (profiler->start_counter);
-       profiler->last_header_counter = 0;
-       
-       profiler->methods = method_id_mapping_new ();
-       profiler->classes = class_id_mapping_new ();
-       profiler->loaded_element_next_free_id = 1;
-       profiler->loaded_assemblies = g_hash_table_new_full (g_direct_hash, NULL, NULL, loaded_element_destroy);
-       profiler->loaded_modules = g_hash_table_new_full (g_direct_hash, NULL, NULL, loaded_element_destroy);
-       profiler->loaded_appdomains = g_hash_table_new_full (g_direct_hash, NULL, NULL, loaded_element_destroy);
-       
-       profiler->statistical_data = profiler_statistical_data_new (profiler);
-       profiler->statistical_data_second_buffer = profiler_statistical_data_new (profiler);
-       
-       profiler->write_buffers = g_malloc (sizeof (ProfilerFileWriteBuffer) + PROFILER_FILE_WRITE_BUFFER_SIZE);
-       profiler->write_buffers->next = NULL;
-       profiler->current_write_buffer = profiler->write_buffers;
-       profiler->current_write_position = 0;
-       profiler->full_write_buffers = 0;
-       profiler_code_chunks_initialize (& (profiler->code_chunks));
-       
-       profiler->executable_regions = profiler_executable_memory_regions_new (1, 1);
-       
-       profiler->executable_files.table = g_hash_table_new (g_str_hash, g_str_equal); 
-       profiler->executable_files.new_files = NULL; 
-       
-       profiler->heap_shot_write_jobs = NULL;
-       if (profiler->action_flags.unreachable_objects || profiler->action_flags.heap_shot || profiler->action_flags.collection_summary) {
-               profiler_heap_buffers_setup (&(profiler->heap));
-       } else {
-               profiler_heap_buffers_clear (&(profiler->heap));
-       }
-       profiler->garbage_collection_counter = 0;
-       
-       WRITER_EVENT_INIT ();
-       LOG_WRITER_THREAD ("mono_profiler_startup: creating writer thread");
-       CREATE_WRITER_THREAD (data_writer_thread);
-       LOG_WRITER_THREAD ("mono_profiler_startup: created writer thread");
-       if ((profiler->command_port >= 1024) && (profiler->command_port <= 65535)) {
-               LOG_USER_THREAD ("mono_profiler_startup: creating user thread");
-               CREATE_USER_THREAD (user_thread);
-               LOG_USER_THREAD ("mono_profiler_startup: created user thread");
-       } else {
-               LOG_USER_THREAD ("mono_profiler_startup: skipping user thread creation");
-       }
-
-       ALLOCATE_PROFILER_THREAD_DATA ();
-       
-       OPEN_FILE ();
-       
-       write_intro_block ();
-       write_directives_block (TRUE);
-       
-       mono_profiler_install (profiler, profiler_shutdown);
-       
-       mono_profiler_install_appdomain (appdomain_start_load, appdomain_end_load,
-                       appdomain_start_unload, appdomain_end_unload);
-       mono_profiler_install_assembly (assembly_start_load, assembly_end_load,
-                       assembly_start_unload, assembly_end_unload);
-       mono_profiler_install_module (module_start_load, module_end_load,
-                       module_start_unload, module_end_unload);
-       mono_profiler_install_class (class_start_load, class_end_load,
-                       class_start_unload, class_end_unload);
-       mono_profiler_install_jit_compile (method_start_jit, method_end_jit);
-       mono_profiler_install_enter_leave (method_enter, method_leave);
-       mono_profiler_install_method_free (method_free);
-       mono_profiler_install_thread (thread_start, thread_end);
-       mono_profiler_install_allocation (object_allocated);
-       mono_profiler_install_monitor (monitor_event);
-       mono_profiler_install_statistical (statistical_hit);
-       mono_profiler_install_statistical_call_chain (statistical_call_chain, profiler->statistical_call_chain_depth, profiler->statistical_call_chain_strategy);
-       mono_profiler_install_gc (gc_event, gc_resize);
-       mono_profiler_install_runtime_initialized (runtime_initialized);
-#if (HAS_OPROFILE)
-       mono_profiler_install_jit_end (method_jit_result);
-#endif
-       if (profiler->flags | MONO_PROFILE_STATISTICAL) {
-               mono_profiler_install_code_chunk_new (profiler_code_chunk_new_callback);
-               mono_profiler_install_code_chunk_destroy (profiler_code_chunk_destroy_callback);
-               mono_profiler_install_code_buffer_new (profiler_code_buffer_new_callback);
-       }
-       
-       mono_profiler_set_events (profiler->flags);
-}
-
index c2108f2325238c06bd819f7370b338cfe941896d..d10c82a574d2923aa5d6da4b361af0cbe16aab4a 100644 (file)
@@ -427,6 +427,10 @@ struct _MethodInfo {
        MonoJitInfo *ji;
 };
 
+#ifdef TLS_INIT
+#undef TLS_INIT
+#endif
+
 #ifdef HOST_WIN32
 #define TLS_SET(x,y) (TlsSetValue (x, y))
 #define TLS_GET(t,x) ((t *) TlsGetValue (x))
index 3ea6a8d23822c82e70aeb50506628832e113099f..ea3b267dab327282843b4c1432e3b789737742b1 100644 (file)
@@ -5,7 +5,7 @@
 #define LOG_HEADER_ID 0x4D505A01
 #define LOG_VERSION_MAJOR 0
 #define LOG_VERSION_MINOR 4
-#define LOG_DATA_VERSION 8
+#define LOG_DATA_VERSION 9
 /*
  * Changes in data versions:
  * version 2: added offsets in heap walk
@@ -14,6 +14,7 @@
  * version 5: added counters sampling
  * version 6: added optional backtrace in sampling info
  * version 8: added TYPE_RUNTIME and JIT helpers/trampolines
+ * version 9: added MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING
  */
 
 enum {
index 4cb8ee8adfd89b1de340fac1a8dab3dfd7d31684..8908d2a2a9de3a7453d974d7590215e9a725a964 100644 (file)
@@ -178,6 +178,7 @@ BASE_TEST_CS_SRC=           \
        delegate7.cs            \
        delegate8.cs            \
        delegate9.cs            \
+       delegate10.cs           \
        remoting1.cs            \
        remoting2.cs            \
        remoting3.cs            \
@@ -307,6 +308,7 @@ BASE_TEST_CS_SRC=           \
        generic-typedef.2.cs    \
        generic-marshalbyref.2.cs       \
        generic-xdomain.2.cs    \
+       dynamic-generic-size.cs \
        bug-431413.2.cs \
        bug-459285.2.cs \
        generic-virtual-invoke.2.cs     \
@@ -668,7 +670,7 @@ TESTSI_IL=$(TEST_IL_SRC:.il=.exe)
 TESTBS=$(BENCHSRC:.cs=.exe)
 STRESS_TESTS=$(STRESS_TESTS_SRC:.cs=.exe)
 
-EXTRA_DIST=test-driver $(TEST_CS_SRC_DIST) $(TEST_IL_SRC) \
+EXTRA_DIST=test-driver test-runner.cs $(TEST_CS_SRC_DIST) $(TEST_IL_SRC) \
        $(BENCHSRC) $(STRESS_TESTS_SRC) stress-runner.pl $(PREREQ_IL_SRC) $(PREREQ_CS_SRC)
 
 %.exe: %.il
@@ -1289,7 +1291,7 @@ if NACL_CODEGEN
 test-generic-sharing:
 else
 test-generic-sharing:
-       @if test x$(M) != x; then $(MAKE) test-generic-sharing-managed; else $(MAKE) test-generic-sharing-normal; fi
+       @if test x$(M) != x0; then $(MAKE) test-generic-sharing-managed; else $(MAKE) test-generic-sharing-normal; fi
 endif
 
 EXTRA_DIST += async-exceptions.cs
diff --git a/mono/tests/delegate10.cs b/mono/tests/delegate10.cs
new file mode 100644 (file)
index 0000000..86f988d
--- /dev/null
@@ -0,0 +1,23 @@
+using System;
+using System.Reflection;
+
+public class Tests
+{
+       public struct Test {
+               public string MyProp {get; set;}
+       }
+
+       delegate string GetterDelegate (ref Test arg);
+
+       public static int Main (String[] args) {
+               var m = typeof (Tests.Test).GetProperty ("MyProp").GetMethod;
+
+               var d = (GetterDelegate)m.CreateDelegate (typeof (GetterDelegate));
+
+               var s = new Test () { MyProp = "A" };
+               if (d (ref s) == "A")
+                       return 0;
+               else
+                       return 1;
+       }
+}
diff --git a/mono/tests/dynamic-generic-size.cs b/mono/tests/dynamic-generic-size.cs
new file mode 100644 (file)
index 0000000..3a26f72
--- /dev/null
@@ -0,0 +1,61 @@
+using System;
+using System.Threading;
+using System.Reflection;
+using System.Reflection.Emit;
+using System.Collections.Generic;
+
+namespace GenericSize
+{
+    class GenericSize 
+    {
+    static int Iterations = 10000;
+               static AssemblyBuilder assembly;
+               static ModuleBuilder module;
+               static string ASSEMBLY_NAME = "MonoTests.System.Reflection.Emit.TypeBuilderTest";
+
+               static void SetUp ()
+               {
+                       AssemblyName assemblyName = new AssemblyName ();
+                       assemblyName.Name = ASSEMBLY_NAME;
+
+                       assembly =
+                               Thread.GetDomain ().DefineDynamicAssembly (assemblyName, AssemblyBuilderAccess.Run);
+
+                       module = assembly.DefineDynamicModule ("module1");
+               }
+
+               static int Main()
+               {
+                       SetUp ();
+
+                       TypeBuilder tb = module.DefineType ("Test", TypeAttributes.Public);
+                       tb.DefineGenericParameters ("T");
+                       var tb_ctor = tb.DefineDefaultConstructor (MethodAttributes.Public);
+
+                       var tb2 = module.DefineType ("Test2", TypeAttributes.Public);
+                       var g0 = tb2.DefineGenericParameters ("T");
+
+                       var mb = tb2.DefineMethod ("Foo", MethodAttributes.Public | MethodAttributes.Static, typeof (object), new Type [0]);
+
+                       var il = mb.GetILGenerator();
+                       il.Emit(OpCodes.Newobj, TypeBuilder.GetConstructor (tb.MakeGenericType (g0), tb_ctor));
+                       il.Emit(OpCodes.Ret);
+
+                       var t1 = tb.CreateType ();
+                       var t2 = tb2.CreateType ();
+
+                       var ginst = t2.MakeGenericType (typeof (string));
+                       var method = ginst.GetMethod ("Foo", BindingFlags.Public | BindingFlags.Static);
+
+                       var lst = new List<Object>();
+
+                       for (int i = 0; i < GenericSize.Iterations; i++) {
+                               lst.Add (method.Invoke (null, null));
+                               if (i % 15 == 0)
+                                       GC.Collect();
+                       }
+
+                       return 0;
+               }
+       }
+}
index 624feae80cd7822e0dfaddd6ae60013655f43385..a9f727f9296a779de712399b25b78862aecd9dc2 100644 (file)
@@ -249,4 +249,20 @@ class Tests
                        return 2;
                return 0;
        }
+
+       public static int test_0_multi_dim_array_ctor () {
+        var type1 = Type.GetType ("System.Char[,]").GetTypeInfo ();
+
+               ConstructorInfo ci = null;
+               foreach (var c in type1.DeclaredConstructors) {
+                       if (c.GetParameters ().Length == 4)
+                               ci = c;
+               }
+        var res = ci.Invoke (new object[] { 1, 5, -10, 7 });
+               var a = (Array)res;
+               if (a.GetLength (0) != 5 || a.GetLowerBound (0) != 1 || a.GetLength (1) != 7 || a.GetLowerBound (1) != -10)
+                       return 1;
+               return 0;
+       }
+
 }
index a662261270d47b94cce659c7f1ad317a89df065b..6890db2941ae5bd65f1b7758a67c2ba25432321d 100644 (file)
@@ -101,7 +101,7 @@ mono_thread_small_id_alloc (void)
                int num_pages = (hazard_table_size * sizeof (MonoThreadHazardPointers) + pagesize - 1) / pagesize;
 
                if (hazard_table == NULL) {
-                       hazard_table = mono_valloc (NULL,
+                       hazard_table = (MonoThreadHazardPointers *volatile) mono_valloc (NULL,
                                sizeof (MonoThreadHazardPointers) * HAZARD_TABLE_MAX_SIZE,
                                MONO_MMAP_NONE);
                }
index 33fed096ea4a159f6dadc96386fce36f8ba96986..3db9b45a92582ff2d897a3b574d70079d73eb72f 100644 (file)
@@ -182,7 +182,7 @@ desc_alloc (void)
        for (;;) {
                gboolean success;
 
-               desc = get_hazardous_pointer ((gpointer * volatile)&desc_avail, hp, 1);
+               desc = (Descriptor *) get_hazardous_pointer ((gpointer * volatile)&desc_avail, hp, 1);
                if (desc) {
                        Descriptor *next = desc->next;
                        success = (InterlockedCompareExchangePointer ((gpointer * volatile)&desc_avail, next, desc) == desc);
@@ -191,7 +191,7 @@ desc_alloc (void)
                        Descriptor *d;
                        int i;
 
-                       desc = mono_valloc (0, desc_size * NUM_DESC_BATCH, prot_flags_for_activate (TRUE));
+                       desc = (Descriptor *) mono_valloc (0, desc_size * NUM_DESC_BATCH, prot_flags_for_activate (TRUE));
 
                        /* Organize into linked list. */
                        d = desc;
@@ -225,7 +225,7 @@ desc_alloc (void)
 static void
 desc_enqueue_avail (gpointer _desc)
 {
-       Descriptor *desc = _desc;
+       Descriptor *desc = (Descriptor *) _desc;
        Descriptor *old_head;
 
        g_assert (desc->anchor.data.state == STATE_EMPTY);
@@ -285,7 +285,7 @@ list_get_partial (MonoLockFreeAllocSizeClass *sc)
 static void
 desc_put_partial (gpointer _desc)
 {
-       Descriptor *desc = _desc;
+       Descriptor *desc = (Descriptor *) _desc;
 
        g_assert (desc->anchor.data.state != STATE_FULL);
 
@@ -366,7 +366,6 @@ alloc_from_active_or_partial (MonoLockFreeAllocator *heap)
 
        do {
                unsigned int next;
-
                new_anchor = old_anchor = *(volatile Anchor*)&desc->anchor.value;
                if (old_anchor.data.state == STATE_EMPTY) {
                        /* We must free it because we own it. */
index be343caeb3e1b0246260f86a4680cdb47facd351..fd069a640e32739d44e42c8319c2acc2bb10b769 100644 (file)
@@ -37,7 +37,7 @@ alloc_chunk (MonoLockFreeArray *arr)
 {
        int size = mono_pagesize ();
        int num_entries = (size - (sizeof (Chunk) - arr->entry_size * MONO_ZERO_LEN_ARRAY)) / arr->entry_size;
-       Chunk *chunk = mono_valloc (0, size, MONO_MMAP_READ | MONO_MMAP_WRITE);
+       Chunk *chunk = (Chunk *) mono_valloc (0, size, MONO_MMAP_READ | MONO_MMAP_WRITE);
        g_assert (chunk);
        chunk->num_entries = num_entries;
        return chunk;
@@ -137,7 +137,7 @@ mono_lock_free_array_queue_push (MonoLockFreeArrayQueue *q, gpointer entry_data_
 
        do {
                index = InterlockedIncrement (&q->num_used_entries) - 1;
-               entry = mono_lock_free_array_nth (&q->array, index);
+               entry = (Entry *) mono_lock_free_array_nth (&q->array, index);
        } while (InterlockedCompareExchange (&entry->state, STATE_BUSY, STATE_FREE) != STATE_FREE);
 
        mono_memory_write_barrier ();
@@ -172,7 +172,7 @@ mono_lock_free_array_queue_pop (MonoLockFreeArrayQueue *q, gpointer entry_data_p
                                return FALSE;
                } while (InterlockedCompareExchange (&q->num_used_entries, index - 1, index) != index);
 
-               entry = mono_lock_free_array_nth (&q->array, index - 1);
+               entry = (Entry *) mono_lock_free_array_nth (&q->array, index - 1);
        } while (InterlockedCompareExchange (&entry->state, STATE_BUSY, STATE_USED) != STATE_USED);
 
        /* Reading the item must happen before CASing the state. */
index 9a84edfedf8809c442d1562a6ee3a9bfe46e4441..99cc8aaaf1622607d854923ca80a87e71218b663 100644 (file)
@@ -57,9 +57,9 @@
 
 #include <mono/utils/lock-free-queue.h>
 
-#define INVALID_NEXT   ((void*)-1)
-#define END_MARKER     ((void*)-2)
-#define FREE_NEXT      ((void*)-3)
+#define INVALID_NEXT   ((MonoLockFreeQueueNode *volatile)-1)
+#define END_MARKER     ((MonoLockFreeQueueNode *volatile)-2)
+#define FREE_NEXT      ((MonoLockFreeQueueNode *volatile)-3)
 
 void
 mono_lock_free_queue_init (MonoLockFreeQueue *q)
@@ -113,7 +113,7 @@ mono_lock_free_queue_enqueue (MonoLockFreeQueue *q, MonoLockFreeQueueNode *node)
        for (;;) {
                MonoLockFreeQueueNode *next;
 
-               tail = get_hazardous_pointer ((gpointer volatile*)&q->tail, hp, 0);
+               tail = (MonoLockFreeQueueNode *) get_hazardous_pointer ((gpointer volatile*)&q->tail, hp, 0);
                mono_memory_read_barrier ();
                /*
                 * We never dereference next so we don't need a
@@ -157,7 +157,7 @@ mono_lock_free_queue_enqueue (MonoLockFreeQueue *q, MonoLockFreeQueueNode *node)
 static void
 free_dummy (gpointer _dummy)
 {
-       MonoLockFreeQueueDummy *dummy = _dummy;
+       MonoLockFreeQueueDummy *dummy = (MonoLockFreeQueueDummy *) _dummy;
        mono_lock_free_queue_node_free (&dummy->node);
        g_assert (dummy->in_use);
        mono_memory_write_barrier ();
@@ -218,7 +218,7 @@ mono_lock_free_queue_dequeue (MonoLockFreeQueue *q)
        for (;;) {
                MonoLockFreeQueueNode *tail, *next;
 
-               head = get_hazardous_pointer ((gpointer volatile*)&q->head, hp, 0);
+               head = (MonoLockFreeQueueNode *) get_hazardous_pointer ((gpointer volatile*)&q->head, hp, 0);
                tail = (MonoLockFreeQueueNode*)q->tail;
                mono_memory_read_barrier ();
                next = head->next;
index 5c2a83b118965861560e3b60e89874c61c96e2e4..d4174e41bcc9dd2bc9758ec3e035a6909b0d6538 100644 (file)
@@ -96,6 +96,7 @@ struct _CodeChunck {
 struct _MonoCodeManager {
        int dynamic;
        int read_only;
+       int bind_size;
        CodeChunk *current;
        CodeChunk *full;
        CodeChunk *last;
@@ -251,7 +252,7 @@ codechunk_valloc (void *preferred, guint32 size)
         * Keep a small freelist of memory blocks to decrease pressure on the kernel memory subsystem to avoid #3321.
         */
        mono_mutex_lock (&valloc_mutex);
-       freelist = g_hash_table_lookup (valloc_freelists, GUINT_TO_POINTER (size));
+       freelist = (GSList *) g_hash_table_lookup (valloc_freelists, GUINT_TO_POINTER (size));
        if (freelist) {
                ptr = freelist->data;
                memset (ptr, 0, size);
@@ -272,7 +273,7 @@ codechunk_vfree (void *ptr, guint32 size)
        GSList *freelist;
 
        mono_mutex_lock (&valloc_mutex);
-       freelist = g_hash_table_lookup (valloc_freelists, GUINT_TO_POINTER (size));
+       freelist = (GSList *) g_hash_table_lookup (valloc_freelists, GUINT_TO_POINTER (size));
        if (!freelist || g_slist_length (freelist) < VALLOC_FREELIST_SIZE) {
                freelist = g_slist_prepend (freelist, ptr);
                g_hash_table_insert (valloc_freelists, GUINT_TO_POINTER (size), freelist);
@@ -292,7 +293,7 @@ codechunk_cleanup (void)
                return;
        g_hash_table_iter_init (&iter, valloc_freelists);
        while (g_hash_table_iter_next (&iter, &key, &value)) {
-               GSList *freelist = value;
+               GSList *freelist = (GSList *) value;
                GSList *l;
 
                for (l = freelist; l; l = l->next) {
@@ -331,7 +332,7 @@ mono_code_manager_cleanup (void)
 MonoCodeManager* 
 mono_code_manager_new (void)
 {
-       MonoCodeManager *cman = g_malloc0 (sizeof (MonoCodeManager));
+       MonoCodeManager *cman = (MonoCodeManager *) g_malloc0 (sizeof (MonoCodeManager));
        if (!cman)
                return NULL;
 #if defined(__native_client_codegen__) && defined(__native_client__)
@@ -365,14 +366,17 @@ mono_code_manager_new (void)
  * Creates a new code manager suitable for holding native code that can be
  * used for single or small methods that need to be deallocated independently
  * of other native code.
+ * BIND_SIZE is the amount of memory reserved for storing thunks. If its 0,
+ * the default size is used.
  *
  * Returns: the new code manager
  */
 MonoCodeManager* 
-mono_code_manager_new_dynamic (void)
+mono_code_manager_new_dynamic (int bind_size)
 {
        MonoCodeManager *cman = mono_code_manager_new ();
        cman->dynamic = 1;
+       cman->bind_size = bind_size;
        return cman;
 }
 
@@ -492,11 +496,11 @@ mono_code_manager_foreach (MonoCodeManager *cman, MonoCodeManagerFunc func, void
 #define BIND_ROOM 8
 #endif
 #if defined(TARGET_ARM64)
-#define BIND_ROOM 8
+#define BIND_ROOM 4
 #endif
 
 static CodeChunk*
-new_codechunk (CodeChunk *last, int dynamic, int size)
+new_codechunk (CodeChunk *last, int dynamic, int size, int bind_size)
 {
        int minsize, flags = CODE_FLAG_MMAP;
        int chunk_size, bsize = 0;
@@ -529,15 +533,25 @@ new_codechunk (CodeChunk *last, int dynamic, int size)
                }
        }
 #ifdef BIND_ROOM
-       bsize = chunk_size / BIND_ROOM;
+       if (bind_size) {
+               bsize = bind_size;
+       } else {
+               if (dynamic)
+                       /* Reserve more space since there are no other chunks we might use if this one gets full */
+                       bsize = (chunk_size * 2) / BIND_ROOM;
+               else
+                       bsize = chunk_size / BIND_ROOM;
+       }
        if (bsize < MIN_BSIZE)
                bsize = MIN_BSIZE;
        bsize += MIN_ALIGN -1;
        bsize &= ~ (MIN_ALIGN - 1);
        if (chunk_size - size < bsize) {
                chunk_size = size + bsize;
-               chunk_size += pagesize - 1;
-               chunk_size &= ~ (pagesize - 1);
+               if (!dynamic) {
+                       chunk_size += pagesize - 1;
+                       chunk_size &= ~ (pagesize - 1);
+               }
        }
 #endif
 
@@ -563,7 +577,7 @@ new_codechunk (CodeChunk *last, int dynamic, int size)
 #endif
        }
 
-       chunk = malloc (sizeof (CodeChunk));
+       chunk = (CodeChunk *) malloc (sizeof (CodeChunk));
        if (!chunk) {
                if (flags == CODE_FLAG_MALLOC)
                        dlfree (ptr);
@@ -573,7 +587,7 @@ new_codechunk (CodeChunk *last, int dynamic, int size)
        }
        chunk->next = NULL;
        chunk->size = chunk_size;
-       chunk->data = ptr;
+       chunk->data = (char *) ptr;
        chunk->flags = flags;
        chunk->pos = bsize;
        chunk->bsize = bsize;
@@ -616,7 +630,7 @@ mono_code_manager_reserve_align (MonoCodeManager *cman, int size, int alignment)
        }
 
        if (!cman->current) {
-               cman->current = new_codechunk (cman->last, cman->dynamic, size);
+               cman->current = new_codechunk (cman->last, cman->dynamic, size, cman->bind_size);
                if (!cman->current)
                        return NULL;
                cman->last = cman->current;
@@ -649,7 +663,7 @@ mono_code_manager_reserve_align (MonoCodeManager *cman, int size, int alignment)
                cman->full = chunk;
                break;
        }
-       chunk = new_codechunk (cman->last, cman->dynamic, size);
+       chunk = new_codechunk (cman->last, cman->dynamic, size, cman->bind_size);
        if (!chunk)
                return NULL;
        chunk->next = cman->current;
index 17d53b3b0328ab81161646b1e4fade010c367af2..fb3e5ea680370c849903bfd573ab461e56d93ea0 100644 (file)
@@ -6,7 +6,7 @@
 typedef struct _MonoCodeManager MonoCodeManager;
 
 MONO_API MonoCodeManager* mono_code_manager_new     (void);
-MONO_API MonoCodeManager* mono_code_manager_new_dynamic (void);
+MONO_API MonoCodeManager* mono_code_manager_new_dynamic (int bind_size);
 MONO_API void             mono_code_manager_destroy (MonoCodeManager *cman);
 MONO_API void             mono_code_manager_invalidate (MonoCodeManager *cman);
 MONO_API void             mono_code_manager_set_read_only (MonoCodeManager *cman);
index effc17c84f44ccc10353bfbc522eeeeb9be4d656..2c7dd19eb9fdbe645bd24c523eff158f5fa05048 100644 (file)
@@ -165,7 +165,7 @@ register_internal (const char *name, int type, void *addr, int size)
                }
        }
 
-       counter = malloc (sizeof (MonoCounter));
+       counter = (MonoCounter *) malloc (sizeof (MonoCounter));
        if (!counter) {
                mono_mutex_unlock (&counters_mutex);
                return;
@@ -292,7 +292,7 @@ mono_counters_on_register (MonoCounterRegisterCallback callback)
        }
 
        mono_mutex_lock (&counters_mutex);
-       register_callbacks = g_slist_append (register_callbacks, callback);
+       register_callbacks = g_slist_append (register_callbacks, (gpointer) callback);
        mono_mutex_unlock (&counters_mutex);
 }
 
@@ -406,16 +406,16 @@ cpu_load_15min (void)
 static void
 initialize_system_counters (void)
 {
-       register_internal ("User Time", SYSCOUNTER_TIME, &user_time, sizeof (gint64));
-       register_internal ("System Time", SYSCOUNTER_TIME, &system_time, sizeof (gint64));
-       register_internal ("Total Time", SYSCOUNTER_TIME, &total_time, sizeof (gint64));
-       register_internal ("Working Set", SYSCOUNTER_BYTES, &working_set, sizeof (gint64));
-       register_internal ("Private Bytes", SYSCOUNTER_BYTES, &private_bytes, sizeof (gint64));
-       register_internal ("Virtual Bytes", SYSCOUNTER_BYTES, &virtual_bytes, sizeof (gint64));
-       register_internal ("Page Faults", SYSCOUNTER_COUNT, &page_faults, sizeof (gint64));
-       register_internal ("CPU Load Average - 1min", SYSCOUNTER_LOAD, &cpu_load_1min, sizeof (double));
-       register_internal ("CPU Load Average - 5min", SYSCOUNTER_LOAD, &cpu_load_5min, sizeof (double));
-       register_internal ("CPU Load Average - 15min", SYSCOUNTER_LOAD, &cpu_load_15min, sizeof (double));
+       register_internal ("User Time", SYSCOUNTER_TIME, (gpointer) &user_time, sizeof (gint64));
+       register_internal ("System Time", SYSCOUNTER_TIME, (gpointer) &system_time, sizeof (gint64));
+       register_internal ("Total Time", SYSCOUNTER_TIME, (gpointer) &total_time, sizeof (gint64));
+       register_internal ("Working Set", SYSCOUNTER_BYTES, (gpointer) &working_set, sizeof (gint64));
+       register_internal ("Private Bytes", SYSCOUNTER_BYTES, (gpointer) &private_bytes, sizeof (gint64));
+       register_internal ("Virtual Bytes", SYSCOUNTER_BYTES, (gpointer) &virtual_bytes, sizeof (gint64));
+       register_internal ("Page Faults", SYSCOUNTER_COUNT, (gpointer) &page_faults, sizeof (gint64));
+       register_internal ("CPU Load Average - 1min", SYSCOUNTER_LOAD, (gpointer) &cpu_load_1min, sizeof (double));
+       register_internal ("CPU Load Average - 5min", SYSCOUNTER_LOAD, (gpointer) &cpu_load_5min, sizeof (double));
+       register_internal ("CPU Load Average - 15min", SYSCOUNTER_LOAD, (gpointer) &cpu_load_15min, sizeof (double));
 }
 
 /**
@@ -497,7 +497,7 @@ sample_internal (MonoCounter *counter, void *buffer, int buffer_size)
                                size = 0;
                        } else {
                                size = counter->size;
-                               strncpy (buffer, strval, size - 1);
+                               strncpy ((char *) buffer, strval, size - 1);
                                ((char*)buffer)[size - 1] = '\0';
                        }
                }
index 7adfa9dec798cd1e73288c04ad7f9e17aaa694ce..aa57e04a50ec92185fc5d54a045e518f4be98458 100644 (file)
@@ -55,7 +55,7 @@ read_string (char *p, FILE *file)
                if (!endp)
                        return NULL;
                *endp = 0;
-               return g_memdup (startp, (endp - startp) + 1);
+               return (char *) g_memdup (startp, (endp - startp) + 1);
        }
        if (*p == 0)
                return NULL;
@@ -63,7 +63,7 @@ read_string (char *p, FILE *file)
        while (*p && !isspace (*p))
                ++p;
        *p = 0;
-       return g_memdup (startp, (p - startp) + 1);
+       return (char *) g_memdup (startp, (p - startp) + 1);
 }
 
 /*
@@ -139,7 +139,7 @@ mono_dl_open (const char *name, int flags, char **error_msg)
        if (error_msg)
                *error_msg = NULL;
 
-       module = malloc (sizeof (MonoDl));
+       module = (MonoDl *) malloc (sizeof (MonoDl));
        if (!module) {
                if (error_msg)
                        *error_msg = g_strdup ("Out of memory");
index 36c7fd6df93abbdec09fb325c2957bad9dbe1e61..c559ad3185dddd98572144b757fe31e93459db52 100644 (file)
@@ -35,7 +35,10 @@ mono_file_map_open (const char* name)
        g_free (wname);
        return result;
 #else
-       return (MonoFileMap *)fopen (name, "rb");
+       int fd = open (name, O_RDONLY);
+       if (fd < 0)
+               return NULL;
+       return (MonoFileMap *)(size_t)fd;
 #endif
 }
 
@@ -43,7 +46,7 @@ guint64
 mono_file_map_size (MonoFileMap *fmap)
 {
        struct stat stat_buf;
-       if (fstat (fileno ((FILE*)fmap), &stat_buf) < 0)
+       if (fstat (mono_file_map_fd (fmap), &stat_buf) < 0)
                return 0;
        return stat_buf.st_size;
 }
@@ -51,13 +54,21 @@ mono_file_map_size (MonoFileMap *fmap)
 int
 mono_file_map_fd (MonoFileMap *fmap)
 {
+#ifdef WIN32
        return fileno ((FILE*)fmap);
+#else
+       return (int)(size_t)fmap;
+#endif
 }
 
 int 
 mono_file_map_close (MonoFileMap *fmap)
 {
+#ifdef WIN32
        return fclose ((FILE*)fmap);
+#else
+       return close (mono_file_map_fd (fmap));
+#endif
 }
 
 #if !defined (HOST_WIN32)
index b7391962eaae5d35ab1e704801f7d36e533224aa..95b3cad57b28cdc32a5e64d81293c91d98d592ce 100644 (file)
@@ -94,12 +94,12 @@ try_again:
         */
        mono_hazard_pointer_set (hp, 2, prev);
 
-       cur = get_hazardous_pointer_with_mask ((gpointer*)prev, hp, 1);
+       cur = (MonoLinkedListSetNode *) get_hazardous_pointer_with_mask ((gpointer*)prev, hp, 1);
 
        while (1) {
                if (cur == NULL)
                        return FALSE;
-               next = get_hazardous_pointer_with_mask ((gpointer*)&cur->next, hp, 0);
+               next = (MonoLinkedListSetNode *) get_hazardous_pointer_with_mask ((gpointer*)&cur->next, hp, 0);
                cur_key = cur->key;
 
                /*
@@ -119,7 +119,7 @@ try_again:
                        prev = &cur->next;
                        mono_hazard_pointer_set (hp, 2, cur);
                } else {
-                       next = mono_lls_pointer_unmask (next);
+                       next = (MonoLinkedListSetNode *) mono_lls_pointer_unmask (next);
                        if (InterlockedCompareExchangePointer ((volatile gpointer*)prev, next, cur) == cur) {
                                /* The hazard pointer must be cleared after the CAS. */
                                mono_memory_write_barrier ();
@@ -129,7 +129,7 @@ try_again:
                        } else
                                goto try_again;
                }
-               cur = mono_lls_pointer_unmask (next);
+               cur = (MonoLinkedListSetNode *) mono_lls_pointer_unmask (next);
                mono_hazard_pointer_set (hp, 1, cur);
        }
 }
@@ -152,8 +152,8 @@ mono_lls_insert (MonoLinkedListSet *list, MonoThreadHazardPointers *hp, MonoLink
        while (1) {
                if (mono_lls_find (list, hp, value->key))
                        return FALSE;
-               cur = mono_hazard_pointer_get_val (hp, 1);
-               prev = mono_hazard_pointer_get_val (hp, 2);
+               cur = (MonoLinkedListSetNode *) mono_hazard_pointer_get_val (hp, 1);
+               prev = (MonoLinkedListSetNode **) mono_hazard_pointer_get_val (hp, 2);
 
                value->next = cur;
                mono_hazard_pointer_set (hp, 0, value);
@@ -178,9 +178,9 @@ mono_lls_remove (MonoLinkedListSet *list, MonoThreadHazardPointers *hp, MonoLink
                if (!mono_lls_find (list, hp, value->key))
                        return FALSE;
 
-               next = mono_hazard_pointer_get_val (hp, 0);
-               cur = mono_hazard_pointer_get_val (hp, 1);
-               prev = mono_hazard_pointer_get_val (hp, 2);
+               next = (MonoLinkedListSetNode *) mono_hazard_pointer_get_val (hp, 0);
+               cur = (MonoLinkedListSetNode *) mono_hazard_pointer_get_val (hp, 1);
+               prev = (MonoLinkedListSetNode **) mono_hazard_pointer_get_val (hp, 2);
 
                g_assert (cur == value);
 
index c1d6d7a014a9bc1eac0c02db9d4070494964fce9..8f609d0e44d4e618e927e6b253902cd29a86449e 100644 (file)
@@ -81,7 +81,7 @@ Requires the world to be stoped
 static inline MonoLinkedListSetNode*
 mono_lls_info_step (MonoLinkedListSetNode *val, MonoThreadHazardPointers *hp)
 {
-       val = mono_lls_pointer_unmask (val);
+       val = (MonoLinkedListSetNode *) mono_lls_pointer_unmask (val);
        mono_hazard_pointer_set (hp, 1, val);
        return val;
 }
@@ -92,20 +92,20 @@ Provides snapshot iteration
 #define MONO_LLS_FOREACH_SAFE(list, element, type) {\
        MonoThreadHazardPointers *__hp = mono_hazard_pointer_get ();    \
        MonoLinkedListSetNode *__cur, *__next;  \
-       for (__cur = mono_lls_pointer_unmask (get_hazardous_pointer ((gpointer volatile*)&(list)->head, __hp, 1)); \
+       for (__cur = (MonoLinkedListSetNode *) mono_lls_pointer_unmask (get_hazardous_pointer ((gpointer volatile*)&(list)->head, __hp, 1)); \
                __cur;  \
-               __cur = mono_lls_info_step (__next, __hp)) {    \
-               __next = get_hazardous_pointer_with_mask ((gpointer volatile*)&__cur->next, __hp, 0);   \
+               __cur = (MonoLinkedListSetNode *) mono_lls_info_step (__next, __hp)) {  \
+               __next = (MonoLinkedListSetNode *) get_hazardous_pointer_with_mask ((gpointer volatile*)&__cur->next, __hp, 0); \
                if (!mono_lls_pointer_get_mark (__next)) {      \
                        (element) = (type)__cur;
 
 #define MONO_LLS_FOREACH_FILTERED_SAFE(list, element, filter_func, type) {\
        MonoThreadHazardPointers *__hp = mono_hazard_pointer_get ();    \
        MonoLinkedListSetNode *__cur, *__next;  \
-       for (__cur = mono_lls_pointer_unmask (get_hazardous_pointer ((gpointer volatile*)&(list)->head, __hp, 1)); \
+       for (__cur = (MonoLinkedListSetNode *) mono_lls_pointer_unmask (get_hazardous_pointer ((gpointer volatile*)&(list)->head, __hp, 1)); \
                __cur;  \
-               __cur = mono_lls_info_step (__next, __hp)) {    \
-               __next = get_hazardous_pointer_with_mask ((gpointer volatile*)&__cur->next, __hp, 0);   \
+               __cur = (MonoLinkedListSetNode *) mono_lls_info_step (__next, __hp)) {  \
+               __next = (MonoLinkedListSetNode *) get_hazardous_pointer_with_mask ((gpointer volatile*)&__cur->next, __hp, 0); \
                if (!mono_lls_pointer_get_mark (__next)) {      \
                        (element) = (type)__cur;        \
                        if (!filter_func (element)) continue;
index a6be2717e5832dd07bf50c881218d5c1b20def75..73c54f17993fee0e5cb6eb43300d85474c304ac0 100644 (file)
@@ -145,7 +145,7 @@ mono_trace_push (GLogLevelFlags level, MonoTraceMask mask)
        if(level_stack == NULL)
                g_error("%s: cannot use mono_trace_push without calling mono_trace_init first.", __func__);
        else {
-               MonoLogLevelEntry *entry = g_malloc(sizeof(MonoLogLevelEntry));
+               MonoLogLevelEntry *entry = (MonoLogLevelEntry *) g_malloc(sizeof(MonoLogLevelEntry));
                entry->level    = current_level;
                entry->mask             = current_mask;
 
@@ -242,7 +242,7 @@ mono_trace_set_mask_string (const char *value)
                }
        }
 
-       mono_trace_set_mask (flags);
+       mono_trace_set_mask ((MonoTraceMask) flags);
 }
 
 /*
index 799506684adf8a2c7a44def47e2e8fe33bcd7051..bc574bfe750a3e7854449da96ec774ba8908a076 100644 (file)
@@ -56,7 +56,7 @@ static void*
 malloc_shared_area (int pid)
 {
        int size = mono_pagesize ();
-       SAreaHeader *sarea = g_malloc0 (size);
+       SAreaHeader *sarea = (SAreaHeader *) g_malloc0 (size);
        sarea->size = size;
        sarea->pid = pid;
        sarea->stats_start = sizeof (SAreaHeader);
@@ -605,7 +605,7 @@ mono_shared_area (void)
        }
        /* we don't need the file descriptor anymore */
        close (fd);
-       header = res;
+       header = (SAreaHeader *) res;
        header->size = size;
        header->pid = pid;
        header->stats_start = sizeof (SAreaHeader);
@@ -716,7 +716,7 @@ void*
 mono_valloc_aligned (size_t size, size_t alignment, int flags)
 {
        /* Allocate twice the memory to be able to put the block on an aligned address */
-       char *mem = mono_valloc (NULL, size + alignment, flags);
+       char *mem = (char *) mono_valloc (NULL, size + alignment, flags);
        char *aligned;
 
        if (!mem)
@@ -741,13 +741,17 @@ mono_pages_not_faulted (void *addr, size_t size)
        gint64 count;
        int pagesize = mono_pagesize ();
        int npages = (size + pagesize - 1) / pagesize;
-       char *faulted = g_malloc0 (sizeof (char*) * npages);
+       char *faulted = (char *) g_malloc0 (sizeof (char*) * npages);
 
        /*
         * We cast `faulted` to void* because Linux wants an unsigned
         * char* while BSD wants a char*.
         */
-       if (mincore (addr, size, (void*)faulted) != 0) {
+#ifdef __linux__
+       if (mincore (addr, size, (unsigned char *)faulted) != 0) {
+#else
+       if (mincore (addr, size, (char *)faulted) != 0) {
+#endif
                count = -1;
        } else {
                count = 0;
index 6abad5756b0a8fea1204a675ec34425ded02cdb5..9f43b7cafe0392ee24034636efd5d898ce0522f8 100644 (file)
@@ -140,7 +140,7 @@ mono_mutex_init_suspend_safe (mono_mutex_t *mutex)
        static int (*setpolicy_np) (pthread_mutexattr_t *, int);
 
        if (!inited) {
-               setpolicy_np = dlsym (RTLD_NEXT, "pthread_mutexattr_setpolicy_np");
+               setpolicy_np = (int (*) (pthread_mutexattr_t *, int)) dlsym (RTLD_NEXT, "pthread_mutexattr_setpolicy_np");
                mono_atomic_store_release (&inited, TRUE);
        }
 
index 7a104bb782f742dc6b916af7ac436f05dfbe42ab..ef576aaee7067d42e33dcd9b0936950be30cc9d8 100644 (file)
@@ -92,8 +92,17 @@ typedef HANDLE mono_cond_t;
 
 
 #define mono_cond_init(cond,attr) do{*(cond) = CreateEvent(NULL,FALSE,FALSE,NULL); } while (0)
-#define mono_cond_wait(cond,mutex) WaitForSingleObject(*(cond),INFINITE)
-#define mono_cond_timedwait(cond,mutex,timeout) WaitForSingleObject(*(cond),timeout)
+
+static inline int mono_cond_timedwait(mono_cond_t *cond, mono_mutex_t *mutex, DWORD timeout)
+{
+       DWORD wait_result;
+       mono_mutex_unlock(mutex);
+       wait_result = WaitForSingleObject(*cond, timeout);
+       mono_mutex_lock(mutex);
+       return wait_result != WAIT_OBJECT_0;
+}
+
+#define mono_cond_wait(cond,mutex) mono_cond_timedwait(cond, mutex, INFINITE)
 #define mono_cond_signal(cond) SetEvent(*(cond))
 #define mono_cond_broadcast(cond) (!SetEvent(*(cond)))
 #define mono_cond_destroy(cond) CloseHandle(*(cond))
index da0f5de0046b9f12372474057a0cfd01003a6b6b..d253bd07b4a60b38f14f149a5f6ca77fde423154 100644 (file)
@@ -46,7 +46,7 @@ mono_networkinterface_list (int *size)
                                count *= 2;
                }
 
-               nilist = g_realloc (nilist, count * sizeof (void*));
+               nilist = (void **) g_realloc (nilist, count * sizeof (void*));
                nilist [i++] = g_strdup (name);
        }
 
@@ -56,7 +56,7 @@ mono_networkinterface_list (int *size)
                *size = i;
 
        if (!nilist)
-               nilist = g_malloc (sizeof (void*));
+               nilist = (void **) g_malloc (sizeof (void*));
        nilist [i] = NULL;
        return nilist;
 }
index 0a443aa41f76c1a977ac108b5e0a4a635651ae6e..f87c9f39bb3ea0764d1493166e5d9598d75a11ee 100644 (file)
@@ -95,7 +95,7 @@ mono_path_canonicalize (const char *path)
         * result */
        if (strchr (abspath, G_DIR_SEPARATOR) == NULL) {
                int len = strlen (abspath);
-               abspath = g_realloc (abspath, len + 2);
+               abspath = (gchar *) g_realloc (abspath, len + 2);
                abspath [len] = G_DIR_SEPARATOR;
                abspath [len+1] = 0;
        }
index 38dea0d5111190982f9e94f21d38772a33436e3c..749d98498717c2f59d1e4930f87a4924305a3481 100644 (file)
@@ -106,7 +106,7 @@ mono_process_list (int *size)
                res = sysctl (mib, 4, NULL, &data_len, NULL, 0);
                if (res)
                        return NULL;
-               processes = malloc (data_len);
+               processes = (struct kinfo_proc *) malloc (data_len);
                res = sysctl (mib, 4, processes, &data_len, NULL, 0);
                if (res < 0) {
                        free (processes);
@@ -124,7 +124,7 @@ mono_process_list (int *size)
 #else
        res = data_len/sizeof (struct kinfo_proc);
 #endif /* KERN_PROC2 */
-       buf = g_realloc (buf, res * sizeof (void*));
+       buf = (void **) g_realloc (buf, res * sizeof (void*));
        for (i = 0; i < res; ++i)
                buf [i] = GINT_TO_POINTER (processes [i].kinfo_pid_member);
        free (processes);
@@ -207,57 +207,67 @@ get_pid_status_item_buf (int pid, const char *item, char *rbuf, int blen, MonoPr
        return NULL;
 }
 
-/**
- * mono_process_get_name:
- * @pid: pid of the process
- * @buf: byte buffer where to store the name of the prcoess
- * @len: size of the buffer @buf
- *
- * Return the name of the process identified by @pid, storing it
- * inside @buf for a maximum of len bytes (including the terminating 0).
- */
-char*
-mono_process_get_name (gpointer pid, char *buf, int len)
-{
 #if USE_SYSCTL
-       int res;
+
 #ifdef KERN_PROC2
-       int mib [6];
-       size_t data_len = sizeof (struct kinfo_proc2);
-       struct kinfo_proc2 processi;
+#define KINFO_PROC struct kinfo_proc2
 #else
-       int mib [4];
-       size_t data_len = sizeof (struct kinfo_proc);
-       struct kinfo_proc processi;
-#endif /* KERN_PROC2 */
+#define KINFO_PROC struct kinfo_proc
+#endif
 
-       memset (buf, 0, len);
+static gboolean
+sysctl_kinfo_proc (gpointer pid, KINFO_PROC* processi)
+{
+       int res;
+       size_t data_len = sizeof (KINFO_PROC);
 
 #ifdef KERN_PROC2
+       int mib [6];
        mib [0] = CTL_KERN;
        mib [1] = KERN_PROC2;
        mib [2] = KERN_PROC_PID;
        mib [3] = GPOINTER_TO_UINT (pid);
-       mib [4] = sizeof(struct kinfo_proc2);
+       mib [4] = sizeof(KINFO_PROC);
        mib [5] = 400; /* XXX */
 
-       res = sysctl (mib, 6, &processi, &data_len, NULL, 0);
-
-       if (res < 0 || data_len != sizeof (struct kinfo_proc2)) {
-               return buf;
-       }
+       res = sysctl (mib, 6, processi, &data_len, NULL, 0);
 #else
+       int mib [4];
        mib [0] = CTL_KERN;
        mib [1] = KERN_PROC;
        mib [2] = KERN_PROC_PID;
        mib [3] = GPOINTER_TO_UINT (pid);
-       
-       res = sysctl (mib, 4, &processi, &data_len, NULL, 0);
-       if (res < 0 || data_len != sizeof (struct kinfo_proc)) {
-               return buf;
-       }
+
+       res = sysctl (mib, 4, processi, &data_len, NULL, 0);
 #endif /* KERN_PROC2 */
-       strncpy (buf, processi.kinfo_name_member, len - 1);
+
+       if (res < 0 || data_len != sizeof (KINFO_PROC))
+               return FALSE;
+
+       return TRUE;
+}
+#endif /* USE_SYSCTL */
+
+/**
+ * mono_process_get_name:
+ * @pid: pid of the process
+ * @buf: byte buffer where to store the name of the prcoess
+ * @len: size of the buffer @buf
+ *
+ * Return the name of the process identified by @pid, storing it
+ * inside @buf for a maximum of len bytes (including the terminating 0).
+ */
+char*
+mono_process_get_name (gpointer pid, char *buf, int len)
+{
+#if USE_SYSCTL
+       KINFO_PROC processi;
+
+       memset (buf, 0, len);
+
+       if (sysctl_kinfo_proc (pid, &processi))
+               strncpy (buf, processi.kinfo_name_member, len - 1);
+
        return buf;
 #else
        char fname [128];
@@ -282,11 +292,42 @@ mono_process_get_name (gpointer pid, char *buf, int len)
 #endif
 }
 
+void
+mono_process_get_times (gpointer pid, gint64 *start_time, gint64 *user_time, gint64 *kernel_time)
+{
+       if (user_time)
+               *user_time = mono_process_get_data (pid, MONO_PROCESS_USER_TIME);
+
+       if (kernel_time)
+               *kernel_time = mono_process_get_data (pid, MONO_PROCESS_SYSTEM_TIME);
+
+       if (start_time) {
+               *start_time = 0;
+
+#if USE_SYSCTL
+               {
+                       KINFO_PROC processi;
+
+                       if (sysctl_kinfo_proc (pid, &processi))
+                               *start_time = mono_100ns_datetime_from_timeval (processi.kp_proc.p_starttime);
+               }
+#endif
+
+               if (*start_time == 0) {
+                       static guint64 boot_time = 0;
+                       if (!boot_time)
+                               boot_time = mono_100ns_datetime () - ((guint64)mono_msec_ticks ()) * 10000;
+
+                       *start_time = boot_time + mono_process_get_data (pid, MONO_PROCESS_ELAPSED);
+               }
+       }
+}
+
 /*
  * /proc/pid/stat format:
  * pid (cmdname) S 
  *     [0] ppid pgid sid tty_nr tty_pgrp flags min_flt cmin_flt maj_flt cmaj_flt
- *     [10] utime stime cutime cstime prio nice threads 0 start_time vsize rss
+ *     [10] utime stime cutime cstime prio nice threads 0 start_time vsize
  *     [20] rss rsslim start_code end_code start_stack esp eip pending blocked sigign
  *     [30] sigcatch wchan 0 0 exit_signal cpu rt_prio policy
  */
@@ -307,11 +348,17 @@ get_process_stat_item (int pid, int pos, int sum, MonoProcessError *error)
        thread_array_t th_array;
        size_t i;
 
-       if (task_for_pid(mach_task_self(), pid, &task) != KERN_SUCCESS)
-               RET_ERROR (MONO_PROCESS_ERROR_NOT_FOUND);
+       if (pid == getpid ()) {
+               /* task_for_pid () doesn't work on ios, even for the current process */
+               task = mach_task_self ();
+       } else {
+               if (task_for_pid (mach_task_self (), pid, &task) != KERN_SUCCESS)
+                       RET_ERROR (MONO_PROCESS_ERROR_NOT_FOUND);
+       }
 
-       if (task_info(task, TASK_BASIC_INFO, (task_info_t)&t_info, &t_info_count) != KERN_SUCCESS) {
-               mach_port_deallocate (mach_task_self (), task);
+       if (task_info (task, TASK_BASIC_INFO, (task_info_t)&t_info, &t_info_count) != KERN_SUCCESS) {
+               if (pid != getpid ())
+                       mach_port_deallocate (mach_task_self (), task);
                RET_ERROR (MONO_PROCESS_ERROR_OTHER);
        }
        
@@ -521,7 +568,7 @@ mono_process_get_data_with_error (gpointer pid, MonoProcessData data, MonoProces
        case MONO_PROCESS_FAULTS:
                return get_process_stat_item (rpid, 6, TRUE, error);
        case MONO_PROCESS_ELAPSED:
-               return get_process_stat_item (rpid, 18, FALSE, error) / get_user_hz ();
+               return get_process_stat_time (rpid, 18, FALSE, error);
        case MONO_PROCESS_PPID:
                return get_process_stat_time (rpid, 0, FALSE, error);
        case MONO_PROCESS_PAGED_BYTES:
@@ -581,8 +628,8 @@ mono_cpu_count (void)
        if (count > 0)
                return count + 1;
 #endif
-#ifdef _SC_NPROCESSORS_ONLN
-       count = sysconf (_SC_NPROCESSORS_ONLN);
+#ifdef _SC_NPROCESSORS_CONF
+       count = sysconf (_SC_NPROCESSORS_CONF);
        if (count > 0)
                return count;
 #endif
index 48144a00613e3348b59be04b61b36b35cf31a4b5..67db3f3f31715e57ab0ca97e4dc5364a2d202e3a 100644 (file)
@@ -58,6 +58,8 @@ struct _MonoCpuUsageState {
 
 gpointer* mono_process_list     (int *size);
 
+void      mono_process_get_times (gpointer pid, gint64 *start_time, gint64 *user_time, gint64 *kernel_time);
+
 char*     mono_process_get_name (gpointer pid, char *buf, int len);
 
 gint64    mono_process_get_data (gpointer pid, MonoProcessData data);
index 04318f46894801d8265c97dcd091e83c2c5bdf29..0eaadf795758a2371b9f5eac026d75771ea7b3f3 100644 (file)
@@ -47,7 +47,7 @@ mono_property_hash_insert (MonoPropertyHash *hash, gpointer object, guint32 prop
 {
        GHashTable *prop_hash;
 
-       prop_hash = g_hash_table_lookup (hash->hashes, GUINT_TO_POINTER (property));
+       prop_hash = (GHashTable *) g_hash_table_lookup (hash->hashes, GUINT_TO_POINTER (property));
        if (!prop_hash) {
                // FIXME: Maybe use aligned_hash
                prop_hash = g_hash_table_new (NULL, NULL);
@@ -76,7 +76,7 @@ mono_property_hash_lookup (MonoPropertyHash *hash, gpointer object, guint32 prop
 {
        GHashTable *prop_hash;
 
-       prop_hash = g_hash_table_lookup (hash->hashes, GUINT_TO_POINTER (property));
+       prop_hash = (GHashTable *) g_hash_table_lookup (hash->hashes, GUINT_TO_POINTER (property));
        if (!prop_hash)
                return NULL;
        return g_hash_table_lookup (prop_hash, object);
index 29a3527711f5eb12df1d52832db8c89b8d4201f3..b44719109ffc277ad377942a4b219b21a92d8408 100644 (file)
@@ -19,6 +19,7 @@
 
 #ifdef USE_COOP_BACKEND
 
+volatile size_t mono_polling_required;
 
 void
 mono_threads_state_poll (void)
@@ -151,6 +152,41 @@ mono_threads_reset_blocking_end (void *cookie)
        mono_threads_prepare_blocking ();
 }
 
+void*
+mono_threads_try_prepare_blocking (void)
+{
+       MonoThreadInfo *info;
+
+       info = mono_thread_info_current_unchecked ();
+       /* If the thread is not attached, it doesn't make sense prepare for suspend. */
+       if (!info || !mono_thread_info_is_live (info) || mono_thread_info_current_state (info) == STATE_BLOCKING) {
+               THREADS_SUSPEND_DEBUG ("PREPARE-TRY-BLOCKING failed %p\n", mono_thread_info_get_tid (info));
+               return NULL;
+       }
+
+retry:
+       /*The JIT might not be able to save*/
+       if (!mono_threads_get_runtime_callbacks ()->thread_state_init_from_sigctx (&info->thread_saved_state [SELF_SUSPEND_STATE_INDEX], NULL)) {
+               THREADS_SUSPEND_DEBUG ("PREPARE-TRY-BLOCKING failed %p to save thread state\n", mono_thread_info_get_tid (info));
+               return NULL;
+       }
+
+       switch (mono_threads_transition_do_blocking (info)) {
+       case DoBlockingContinue:
+               break;
+       case DoBlockingPollAndRetry:
+               mono_threads_state_poll ();
+               goto retry;
+       }
+
+       return info;
+}
+
+void
+mono_threads_finish_try_blocking (void* cookie)
+{
+       mono_threads_finish_blocking (cookie);
+}
 
 void
 mono_threads_core_abort_syscall (MonoThreadInfo *info)
@@ -214,5 +250,17 @@ mono_threads_platform_register (MonoThreadInfo *info)
        //See the above for what's wrong here.
 }
 
+void
+mono_threads_core_begin_global_suspend (void)
+{
+       mono_polling_required = 1;
+}
+
+void
+mono_threads_core_end_global_suspend (void)
+{
+       mono_polling_required = 0;
+}
+
 
 #endif
\ No newline at end of file
index 6d90c2af1e080758344e03eb640e7a9967fed8c5..6eca0266dcfb897f4fbef80bdfd1bc58f9ecdb01 100644 (file)
 #define MONO_FINISH_RESET_BLOCKING \
        mono_threads_reset_blocking_end (__reset_cookie);       \
 }
+
+#define MONO_TRY_BLOCKING      \
+{      \
+       void *__try_block_cookie = mono_threads_try_prepare_blocking ();
+
+#define MONO_FINISH_TRY_BLOCKING \
+       mono_threads_finish_try_blocking (__try_block_cookie);  \
+}
+
 /* Internal API */
 
 extern volatile size_t mono_threads_polling_required;
@@ -46,6 +55,12 @@ void mono_threads_finish_blocking (void* cookie);
 void* mono_threads_reset_blocking_start (void);
 void mono_threads_reset_blocking_end (void* cookie);
 
+void* mono_threads_try_prepare_blocking (void);
+void mono_threads_finish_try_blocking (void* cookie);
+
+/* JIT specific interface */
+extern volatile size_t mono_polling_required ;
+
 #else
 
 #define MONO_SUSPEND_CHECK do {        } while (0);
@@ -53,6 +68,8 @@ void mono_threads_reset_blocking_end (void* cookie);
 #define MONO_FINISH_BLOCKING }
 #define MONO_PREPARE_RESET_BLOCKING {
 #define MONO_FINISH_RESET_BLOCKING }
+#define MONO_TRY_BLOCKING {
+#define MONO_FINISH_TRY_BLOCKING }
 
 #endif /* USE_COOP_GC */
 
index 14db1cc9550ab00c2e32ffda88c5f60ee64ec32d..fc884e7a05584787d813ff2b241012da9a61eaa1 100644 (file)
@@ -122,7 +122,8 @@ mono_threads_core_begin_async_resume (MonoThreadInfo *info)
                mcontext_t mctx;
 
                mono_threads_get_runtime_callbacks ()->setup_async_callback (&tmp, info->async_target, info->user_data);
-               info->async_target = info->user_data = NULL;
+               info->user_data = NULL;
+               info->async_target = (void (*)(void *)) info->user_data;
 
                state = (thread_state_t) alloca (mono_mach_arch_get_thread_state_size ());
                mctx = (mcontext_t) alloca (mono_mach_arch_get_mcontext_size ());
@@ -165,6 +166,16 @@ mono_threads_platform_free (MonoThreadInfo *info)
        mach_port_deallocate (current_task (), info->native_handle);
 }
 
+void
+mono_threads_core_begin_global_suspend (void)
+{
+}
+
+void
+mono_threads_core_end_global_suspend (void)
+{
+}
+
 #endif /* USE_MACH_BACKEND */
 
 #ifdef __MACH__
index 5fd929cfe3b33fa698fdbb1edda14f7fe58b612e..19fd8b7c12e75f7836cf00dba1251002b96dd3c5 100644 (file)
@@ -51,7 +51,7 @@ typedef struct {
 static void*
 inner_start_thread (void *arg)
 {
-       StartInfo *start_info = arg;
+       StartInfo *start_info = (StartInfo *) arg;
        void *t_arg = start_info->arg;
        int res;
        void *(*start_func)(void*) = start_info->start_routine;
@@ -146,7 +146,7 @@ mono_threads_core_create_thread (LPTHREAD_START_ROUTINE start_routine, gpointer
 #endif
 
        memset (&start_info, 0, sizeof (StartInfo));
-       start_info.start_routine = (gpointer)start_routine;
+       start_info.start_routine = (void *(*)(void *)) start_routine;
        start_info.arg = arg;
        start_info.flags = creation_flags;
        MONO_SEM_INIT (&(start_info.registered), 0);
@@ -312,7 +312,7 @@ mono_native_thread_id_equals (MonoNativeThreadId id1, MonoNativeThreadId id2)
 gboolean
 mono_native_thread_create (MonoNativeThreadId *tid, gpointer func, gpointer arg)
 {
-       return pthread_create (tid, NULL, func, arg) == 0;
+       return pthread_create (tid, NULL, (void *(*)(void *)) func, arg) == 0;
 }
 
 void
@@ -635,6 +635,16 @@ mono_threads_platform_free (MonoThreadInfo *info)
 {
 }
 
+void
+mono_threads_core_begin_global_suspend (void)
+{
+}
+
+void
+mono_threads_core_end_global_suspend (void)
+{
+}
+
 #endif /*defined (USE_POSIX_BACKEND)*/
 
 #endif
index c82ad1f9b195aaccd80a66986edda28cc8a580da..9f5792c1d9c1d1d6c9da640b2807920440729006 100644 (file)
@@ -250,7 +250,7 @@ STATE_ASYNC_SUSPEND_REQUESTED: Since there can only be one async suspend in prog
        default:
                g_error ("Cannot transition thread %p from %s with ASYNC_SUSPEND_REQUESTED", info, state_name (cur_state));
        }
-       return FALSE;
+       return (MonoRequestAsyncSuspendResult) FALSE;
 }
 
 /*
@@ -685,3 +685,9 @@ mono_thread_info_suspend_count (MonoThreadInfo *info)
 {
        return get_thread_suspend_count (info->thread_state);
 }
+
+int
+mono_thread_info_current_state (MonoThreadInfo *info)
+{
+       return get_thread_state (info->thread_state);
+}
index af7bee62097b4ba6b11f870e81fdf6ee41c251fb..b5008b4859eb3ae099d0e0631792b58934c525bb 100755 (executable)
@@ -407,4 +407,14 @@ mono_threads_core_clear_interruption (void)
 {
 }
 
+void
+mono_threads_core_begin_global_suspend (void)
+{
+}
+
+void
+mono_threads_core_end_global_suspend (void)
+{
+}
+
 #endif
index bdbd4b7f8f83f8411ac48894c21ad8445ec1c311..bb9acf9103c102e70de1ff1abfbe404476303961 100644 (file)
@@ -123,6 +123,7 @@ mono_threads_begin_global_suspend (void)
 {
        g_assert (pending_suspends == 0);
        THREADS_SUSPEND_DEBUG ("------ BEGIN GLOBAL OP sp %d rp %d wd %d po %d\n", suspend_posts, resume_posts, waits_done, pending_ops);
+       mono_threads_core_begin_global_suspend ();
 }
 
 void
@@ -130,6 +131,7 @@ mono_threads_end_global_suspend (void)
 {
        g_assert (pending_suspends == 0);
        THREADS_SUSPEND_DEBUG ("------ END GLOBAL OP sp %d rp %d wd %d po %d\n", suspend_posts, resume_posts, waits_done, pending_ops);
+       mono_threads_core_end_global_suspend ();
 }
 
 static void
@@ -217,7 +219,7 @@ mono_thread_info_lookup (MonoNativeThreadId id)
        } 
 
        mono_hazard_pointer_clear_all (hp, 1);
-       return mono_hazard_pointer_get_val (hp, 1);
+       return (MonoThreadInfo *) mono_hazard_pointer_get_val (hp, 1);
 }
 
 static gboolean
@@ -249,7 +251,7 @@ mono_thread_info_remove (MonoThreadInfo *info)
 static void
 free_thread_info (gpointer mem)
 {
-       MonoThreadInfo *info = mem;
+       MonoThreadInfo *info = (MonoThreadInfo *) mem;
 
        MONO_SEM_DESTROY (&info->resume_semaphore);
        mono_threads_platform_free (info);
@@ -320,7 +322,7 @@ register_thread (MonoThreadInfo *info, gpointer baseptr)
 static void
 unregister_thread (void *arg)
 {
-       MonoThreadInfo *info = arg;
+       MonoThreadInfo *info = (MonoThreadInfo *) arg;
        int small_id = info->small_id;
        g_assert (info);
 
@@ -490,9 +492,9 @@ mono_thread_info_attach (void *baseptr)
                THREADS_DEBUG ("mono_thread_info_attach called before mono_threads_init\n");
                return NULL;
        }
-       info = mono_native_tls_get_value (thread_info_key);
+       info = (MonoThreadInfo *) mono_native_tls_get_value (thread_info_key);
        if (!info) {
-               info = g_malloc0 (thread_info_size);
+               info = (MonoThreadInfo *) g_malloc0 (thread_info_size);
                THREADS_DEBUG ("attaching %p\n", info);
                if (!register_thread (info, baseptr))
                        return NULL;
@@ -513,7 +515,7 @@ mono_thread_info_detach (void)
                THREADS_DEBUG ("mono_thread_info_detach called before mono_threads_init\n");
                return;
        }
-       info = mono_native_tls_get_value (thread_info_key);
+       info = (MonoThreadInfo *) mono_native_tls_get_value (thread_info_key);
        if (info) {
                THREADS_DEBUG ("detaching %p\n", info);
                unregister_thread (info);
@@ -547,8 +549,8 @@ mono_threads_init (MonoThreadInfoCallbacks *callbacks, size_t info_size)
        res = mono_native_tls_alloc (&thread_info_key, NULL);
        res = mono_native_tls_alloc (&thread_exited_key, NULL);
 #else
-       res = mono_native_tls_alloc (&thread_info_key, unregister_thread);
-       res = mono_native_tls_alloc (&thread_exited_key, thread_exited_dtor);
+       res = mono_native_tls_alloc (&thread_info_key, (void *) unregister_thread);
+       res = mono_native_tls_alloc (&thread_exited_key, (void *) thread_exited_dtor);
 #endif
        g_assert (res);
 
@@ -798,8 +800,8 @@ is_thread_in_critical_region (MonoThreadInfo *info)
                return TRUE;
 
        ji = mono_jit_info_table_find (
-               state->unwind_data [MONO_UNWIND_DATA_DOMAIN],
-               MONO_CONTEXT_GET_IP (&state->ctx));
+               (MonoDomain *) state->unwind_data [MONO_UNWIND_DATA_DOMAIN],
+               (char *) MONO_CONTEXT_GET_IP (&state->ctx));
 
        if (!ji)
                return FALSE;
@@ -1205,7 +1207,7 @@ mono_threads_add_async_job (MonoThreadInfo *info, MonoAsyncJob job)
 {
        MonoAsyncJob old_job;
        do {
-               old_job = info->service_requests;
+               old_job = (MonoAsyncJob) info->service_requests;
                if (old_job & job)
                        return FALSE;
        } while (InterlockedCompareExchange (&info->service_requests, old_job | job, old_job) != old_job);
@@ -1218,7 +1220,7 @@ mono_threads_consume_async_jobs (void)
        MonoThreadInfo *info = (MonoThreadInfo*)mono_native_tls_get_value (thread_info_key);
 
        if (!info)
-               return 0;
+               return (MonoAsyncJob) 0;
 
-       return InterlockedExchange (&info->service_requests, 0);
+       return (MonoAsyncJob) InterlockedExchange (&info->service_requests, 0);
 }
index 17541149d623bc8771d56c67eb893acac7c93c0e..f04543cb4cf7ddffa4d8341048738930eb38d826 100644 (file)
@@ -483,6 +483,9 @@ HANDLE mono_threads_core_open_handle (void);
 HANDLE mono_threads_core_open_thread_handle (HANDLE handle, MonoNativeThreadId tid);
 void mono_threads_core_set_name (MonoNativeThreadId tid, const char *name);
 
+void mono_threads_core_begin_global_suspend (void);
+void mono_threads_core_end_global_suspend (void);
+
 /* Internal API between mono-threads and its backends. */
 
 /* Backend functions - a backend must implement all of the following */
@@ -621,6 +624,8 @@ void mono_thread_info_wait_for_resume (THREAD_INFO_TYPE *info);
 gboolean mono_thread_info_is_running (THREAD_INFO_TYPE *info);
 gboolean mono_thread_info_is_live (THREAD_INFO_TYPE *info);
 int mono_thread_info_suspend_count (THREAD_INFO_TYPE *info);
+int mono_thread_info_current_state (THREAD_INFO_TYPE *info);
+
 gboolean mono_thread_info_in_critical_location (THREAD_INFO_TYPE *info);
 gboolean mono_thread_info_begin_suspend (THREAD_INFO_TYPE *info, gboolean interrupt_kernel);
 gboolean mono_thread_info_begin_resume (THREAD_INFO_TYPE *info);
index cd347546c207d8b6e72590fcec8060960cd522fd..3c940e73ddfb85b82607dafd526cad6b388219aa 100644 (file)
@@ -4,10 +4,17 @@
  * Copyright (C) 2008 Novell, Inc.
  */
 
-#include <utils/mono-time.h>
+#include <config.h>
 #include <stdlib.h>
 #include <stdio.h>
 
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#include <utils/mono-time.h>
+
+
 #define MTICKS_PER_SEC 10000000
 
 #ifdef HOST_WIN32
@@ -56,9 +63,6 @@ mono_100ns_datetime (void)
 
 #else
 
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
 
 #if defined (HAVE_SYS_PARAM_H)
 #include <sys/param.h>
@@ -168,9 +172,15 @@ mono_100ns_datetime (void)
 {
        struct timeval tv;
        if (gettimeofday (&tv, NULL) == 0)
-               return (((gint64)tv.tv_sec + EPOCH_ADJUST) * 1000000 + tv.tv_usec) * 10;
+               return mono_100ns_datetime_from_timeval (tv);
        return 0;
 }
 
+gint64
+mono_100ns_datetime_from_timeval (struct timeval tv)
+{
+       return (((gint64)tv.tv_sec + EPOCH_ADJUST) * 1000000 + tv.tv_usec) * 10;
+}
+
 #endif
 
index 6961306c2906f07ddc7c41a26981d27e88994f89..95bda8e530979b740b5b7fa06a99b300031e7ede 100644 (file)
@@ -4,15 +4,23 @@
 #include <mono/utils/mono-compiler.h>
 #include <glib.h>
 
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
 /* Returns the number of milliseconds from boot time: this should be monotonic */
 guint32 mono_msec_ticks      (void);
 
 /* Returns the number of 100ns ticks from unspecified time: this should be monotonic */
 gint64  mono_100ns_ticks     (void);
 
-/* Returns the number of 100ns ticks since 1/1/1, UTC timezone */
+/* Returns the number of 100ns ticks since 1/1/1601, UTC timezone */
 gint64  mono_100ns_datetime  (void);
 
+#ifndef HOST_WIN32
+gint64 mono_100ns_datetime_from_timeval (struct timeval tv);
+#endif
+
 /* Stopwatch class for internal runtime use */
 typedef struct {
        gint64 start, stop;
index 485aea76f3a0f3e13bad9b2fb19e579c8e96dc27..0b6cd5a1a1c65ca11233639be85ac86b13c95715 100644 (file)
@@ -49,7 +49,7 @@ typedef enum {
 static inline int
 mono_native_tls_alloc (MonoNativeTlsKey *key, void *destructor)
 {
-       return pthread_key_create (key, destructor) == 0;
+       return pthread_key_create (key, (void (*)(void*)) destructor) == 0;
 }
 
 static inline void
index e113260d4a8dde077d498fdea9fd6d3d1cb2b7a1..b86ab331dbf7e2cab2180e69cef51ae5060c10a4 100644 (file)
@@ -35,7 +35,7 @@ mono_bitset_new (guint32 max_size, guint32 flags) {
        guint32 real_size = (max_size + BITS_PER_CHUNK - 1) / BITS_PER_CHUNK;
        MonoBitSet *result;
 
-       result = g_malloc0 (sizeof (MonoBitSet) + sizeof (gsize) * (real_size - MONO_ZERO_LEN_ARRAY));
+       result = (MonoBitSet *) g_malloc0 (sizeof (MonoBitSet) + sizeof (gsize) * (real_size - MONO_ZERO_LEN_ARRAY));
        result->size = real_size * BITS_PER_CHUNK;
        result->flags = flags;
        return result;
@@ -54,7 +54,7 @@ mono_bitset_new (guint32 max_size, guint32 flags) {
 MonoBitSet *
 mono_bitset_mem_new (gpointer mem, guint32 max_size, guint32 flags) {
        guint32 real_size = (max_size + BITS_PER_CHUNK - 1) / BITS_PER_CHUNK;
-       MonoBitSet *result = mem;
+       MonoBitSet *result = (MonoBitSet *) mem;
 
        result->size = real_size * BITS_PER_CHUNK;
        result->flags = flags | MONO_BITSET_DONT_FREE;
index 8f53741c5d7a0b5f138db978a163ecb7eaf1022c..55617d03c8c950de7433d1fc1b251725fe8286b8 100644 (file)
@@ -3,6 +3,14 @@
 
 #include "mono-compiler.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 double mono_strtod (const char *s00, char **se);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
diff --git a/notes/cil b/notes/cil
deleted file mode 100644 (file)
index 458aca5..0000000
--- a/notes/cil
+++ /dev/null
@@ -1,13 +0,0 @@
-Random collection of notes
-
-       * What is the point of having the InlineVar argument to
-         opcodes be a signed integer instead of unsigned?
-
-
-Storage
-
-       The CIL metadata is a very compressed file format, even the 
-       sizes of blobs and strings are recorded in a compressed form.
-       Still, all strings are encoded using 16-bit chars, instead of the
-       more efficient UTF-8.
-
index b021efeec4d64a4a7b2337f5821a281a0f68b0bc..415c21b1cb35101af9673996f481659e99eebdde 100644 (file)
@@ -34,7 +34,7 @@ else
 build_profiles = 
 
 if INSTALL_4_5
-build_profiles += net_4_0 net_4_5 xbuild_12 xbuild_14
+build_profiles += binary_reference_assemblies net_4_5 xbuild_12 xbuild_14
 al_profile = net_4_5
 endif
 
@@ -108,11 +108,11 @@ endif
 
 # Compile all assemblies with the verifier turned on. Code must be valid but not verifiable.
 # TODO it would be nice to split assemblies without unsafe code to use the verifier with verifiable mode.
-# Skip net 4.0 assemblies because they contain metadata only
+# Skip binary_reference_assemblies because they contain metadata only
 mcs-compileall: mono-wrapper etc/mono/config
        save_MONO_PATH=$$MONO_PATH; mcs_topdir=`cd $(mcs_topdir) && $(cur_dir_cmd)`; ok=:; \
        for profile in $(test_profiles); do \
-         if [ "net_4_0" = "$$profile" ]; then \
+         if [ "binary_reference_assemblies" = "$$profile" ]; then \
           continue; \
       fi; \
          if [ "xbuild_12" = "$$profile" ]; then \
index 49af781a55a1001be19f135c4a7e8bf24192f597..45c46da07d983742adb54409ac23b3aeea64e873 100644 (file)
@@ -2,10 +2,15 @@
 
 /*
  * Bare bones profiler. Compile with:
- * gcc -shared -o mono-profiler-sample.so sample.c `pkg-config --cflags --libs mono`
- * Install the binary where the dynamic loader can find it.
+ * 
+ * linux : gcc -shared -o mono-profiler-sample.so sample.c `pkg-config --cflags --libs mono`
+ * mac : gcc sample.c -o mono-profiler-sample.dylib -Dmono_free=free -lz `pkg-config --cflags mono-2` -undefined suppress -flat_namespace  
+ *
+ * Install the binary where the dynamic loader can find it. eg /usr/lib etc
  * Then run mono with:
  * mono --profile=sample your_application.exe
+ *
+ * Note if you name a profiler with more than 8 characters (eg sample6789) appears to not work
  */
 
 struct _MonoProfiler {
index c9210060c26e83fd628c11705e0147b8d2c02913..155690d75adad1c75ec255675b443167bc94089f 100644 (file)
@@ -33,7 +33,7 @@ fi
 # set LD_LIBRARY_PATH to ensure that libmono is found
 export LD_LIBRARY_PATH=$libdir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
 # and set MONO_PATH to ensure that mscorlib.dll can be found
-export MONO_PATH=$prefix/lib/mono/2.0
+export MONO_PATH=$prefix/lib/mono/4.5
 
 for i in "${monolist[@]}"; do
         ($bindir/monodis --assembly $i | awk '
index f0ad60bb8a2955b4b87e3433ae08fa0e470b196e..d7b6a325bc32e17394b502c8ec800400359442e1 100644 (file)
@@ -50,7 +50,7 @@ esac
 # set LD_LIBRARY_PATH to ensure that libmono is found
 export LD_LIBRARY_PATH=$libdir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
 # and set MONO_PATH to ensure that mscorlib.dll can be found
-export MONO_PATH=$prefix/lib/mono/2.0
+export MONO_PATH=$prefix/lib/mono/4.5
 
 REQUIRES=$(
        for i in "${monolist[@]}"; do
index 83455413b3647915ae8cc3cd0ac8e025cf5823be..38696260a092fb4b509f7eabc7f9fef96032b2b8 100644 (file)
@@ -90,6 +90,8 @@ CreateZStream (gint compress, guchar gzip, read_write_func func, void *gchandle)
        result->gchandle = gchandle;
        result->compress = compress;
        result->buffer = g_new (guchar, BUFFER_SIZE);
+       result->stream->next_out = result->buffer;
+       result->stream->avail_out = BUFFER_SIZE;
        return result;
 }
 
@@ -148,7 +150,7 @@ flush_internal (ZStream *stream, gboolean is_final)
        if (!stream->compress)
                return 0;
 
-       if (!is_final) {
+       if (!is_final && stream->stream->avail_in != 0) {
                status = deflate (stream->stream, Z_PARTIAL_FLUSH);
                if (status != Z_OK && status != Z_STREAM_END)
                        return status;