Merge pull request #681 from tritao/dll-api
authorRodrigo Kumpera <kumpera@gmail.com>
Fri, 2 Aug 2013 17:55:19 +0000 (10:55 -0700)
committerRodrigo Kumpera <kumpera@gmail.com>
Fri, 2 Aug 2013 17:55:19 +0000 (10:55 -0700)
Added public API visibility macros

469 files changed:
.gitignore
configure.in
libgc/include/private/gc_locks.h
man/mono.1
mcs/build/profiles/mobile_static.make [new file with mode: 0644]
mcs/build/rules.make
mcs/class/Facades/System.Linq.Expressions/TypeForwarders.cs
mcs/class/Makefile
mcs/class/Managed.Windows.Forms/build-csproj
mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/GetReferenceAssemblyPaths.cs
mcs/class/Mono.CSharp/Test/Evaluator/ExpressionsTest.cs
mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs
mcs/class/Mono.Debugger.Soft/Test/dtest.cs
mcs/class/Mono.Management/Mono.Attach/VirtualMachine.cs
mcs/class/Mono.Posix/Mono.Posix_test.dll.sources
mcs/class/Mono.Posix/Mono.Unix.Native/Syscall.cs
mcs/class/Mono.Posix/Mono.Unix/UnixPath.cs
mcs/class/Mono.Posix/Mono.Unix/UnixSymbolicLinkInfo.cs
mcs/class/Mono.Posix/Test/Mono.Unix/ReadlinkTest.cs [new file with mode: 0644]
mcs/class/System.ComponentModel.Composition.4.5/Makefile
mcs/class/System.ComponentModel.Composition.4.5/src/ComponentModel/Microsoft/Internal/GenerationServices.cs
mcs/class/System.ComponentModel.Composition.4.5/src/ComponentModel/System/ComponentModel/Composition/MetadataViewGenerator.cs
mcs/class/System.ComponentModel.Composition.4.5/src/ComponentModel/System/ComponentModel/Composition/MetadataViewProvider.cs
mcs/class/System.ComponentModel.Composition.4.5/src/ComponentModel/System/ComponentModel/Composition/Primitives/ExportedDelegate.cs
mcs/class/System.ComponentModel.DataAnnotations/Makefile
mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/AssociatedMetadataTypeTypeDescriptionProviderTests.cs
mcs/class/System.ComponentModel.DataAnnotations/mobile_static_System.ComponentModel.DataAnnotations.dll.sources [new file with mode: 0644]
mcs/class/System.Core/System.Linq.Expressions/BinaryExpression.cs
mcs/class/System.Core/System.Linq.Expressions/ConditionalExpression.cs
mcs/class/System.Core/System.Linq.Expressions/ConstantExpression.cs
mcs/class/System.Core/System.Linq.Expressions/ElementInit.cs
mcs/class/System.Core/System.Linq.Expressions/Expression.cs
mcs/class/System.Core/System.Linq.Expressions/ExpressionVisitor.cs
mcs/class/System.Core/System.Linq.Expressions/Extensions.cs
mcs/class/System.Core/System.Linq.Expressions/LambdaExpression.cs
mcs/class/System.Core/System.Linq.Expressions/MemberAssignment.cs
mcs/class/System.Core/System.Linq.Expressions/MemberBinding.cs
mcs/class/System.Core/System.Linq.Expressions/MemberExpression.cs
mcs/class/System.Core/System.Linq.Expressions/MemberListBinding.cs
mcs/class/System.Core/System.Linq.Expressions/MemberMemberBinding.cs
mcs/class/System.Core/System.Linq.Expressions/MethodCallExpression.cs
mcs/class/System.Core/System.Linq.Expressions/NewArrayExpression.cs
mcs/class/System.Core/System.Linq.Expressions/NewExpression.cs
mcs/class/System.Core/System.Linq.Expressions/ParameterExpression.cs
mcs/class/System.Core/System.Linq.Expressions/TypeBinaryExpression.cs
mcs/class/System.Core/System.Linq.Expressions/UnaryExpression.cs
mcs/class/System.Core/System/TimeZoneInfo.AdjustmentRule.cs
mcs/class/System.Core/System/TimeZoneInfo.TransitionTime.cs
mcs/class/System.Core/System/TimeZoneInfo.cs
mcs/class/System.Core/Test/System.Linq.Expressions/ExpressionTest_Coalesce.cs
mcs/class/System.Core/Test/System/TimeZoneInfo.AdjustmentRuleTest.cs
mcs/class/System.Core/Test/System/TimeZoneInfo.TransitionTimeTest.cs
mcs/class/System.Core/Test/System/TimeZoneInfoTest.cs
mcs/class/System.Core/mobile_static_System.Core.dll.sources [new file with mode: 0644]
mcs/class/System.Data.Services.Client/mobile_static_System.Data.Services.Client.dll.sources [new file with mode: 0644]
mcs/class/System.Data/Makefile
mcs/class/System.Data/System.Data.Common/DataContainer.cs
mcs/class/System.Data/System.Data/DataRowCollection.cs
mcs/class/System.Data/mobile_static_System.Data.dll.sources [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectoryOperationException.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectoryPartition.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectoryReplicationMetadata.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectoryRole.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectoryRoleCollection.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySchedule.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySchema.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySchemaClass.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySchemaClassCollection.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySchemaProperty.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySchemaPropertyCollection.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySecurity.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySite.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySiteCollection.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySiteLink.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySiteOptions.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySubnet.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySubnetCollection.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySyntax.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectoryTransportType.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ApplicationPartition.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ApplicationPartitionCollection.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/AttributeMetadata.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/AttributeMetadataCollection.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/DirectoryContext.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/DirectoryContextType.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/DirectoryServer.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/DirectoryServerCollection.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/Domain.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/DomainCollection.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/DomainController.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/DomainControllerCollection.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/DomainMode.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/Forest.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ForestMode.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ForestTrustDomainInfoCollection.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ForestTrustDomainInformation.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ForestTrustDomainStatus.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ForestTrustRelationshipInformation.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/GlobalCatalog.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/GlobalCatalogCollection.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/HourOfDay.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/LocatorOptions.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/MinuteOfHour.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/NotificationStatus.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/PropertyTypes.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReadOnlyActiveDirectorySchemaClassCollection.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReadOnlyActiveDirectorySchemaPropertyCollection.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReadOnlyDirectoryServerCollection.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReadOnlySiteCollection.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReadOnlySiteLinkCollection.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReadOnlyStringCollection.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationConnection.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationConnectionCollection.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationCursor.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationCursorCollection.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationFailure.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationFailureCollection.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationNeighbor.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationNeighborCollection.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationOperation.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationOperationCollection.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationOperationInformation.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationOperationType.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationSpan.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/SchemaClassType.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/SyncFromAllServersErrorCategory.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/SyncFromAllServersErrorInformation.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/SyncFromAllServersEvent.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/SyncFromAllServersOperationException.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/SyncFromAllServersOptions.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/SyncUpdateCallback.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/TopLevelName.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/TopLevelNameCollection.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/TopLevelNameStatus.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/TrustDirection.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/TrustRelationshipInformation.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/TrustRelationshipInformationCollection.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/TrustType.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.dll.sources
mcs/class/System.DirectoryServices/System.DirectoryServices/ActiveDirectoryAccessRule.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices/ActiveDirectoryAuditRule.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices/ActiveDirectoryRights.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices/ActiveDirectorySecurityInheritance.cs [new file with mode: 0644]
mcs/class/System.Net.Http/System.Net.Http.Headers/ContentDispositionHeaderValue.cs
mcs/class/System.Net.Http/System.Net.Http.Headers/HeaderInfo.cs
mcs/class/System.Net.Http/System.Net.Http.Headers/HttpHeaderValueCollection.cs
mcs/class/System.Net.Http/System.Net.Http.Headers/HttpHeaders.cs
mcs/class/System.Net.Http/System.Net.Http.Headers/MediaTypeHeaderValue.cs
mcs/class/System.Net.Http/System.Net.Http.Headers/NameValueHeaderValue.cs
mcs/class/System.Net.Http/System.Net.Http.Headers/NameValueWithParametersHeaderValue.cs
mcs/class/System.Net.Http/System.Net.Http.Headers/TransferCodingHeaderValue.cs
mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs
mcs/class/System.Net.Http/System.Net.Http/HttpContent.cs
mcs/class/System.Net.Http/Test/System.Net.Http/HttpRequestMessageTest.cs
mcs/class/System.Net/Assembly/TypeForwarders.cs
mcs/class/System.Net/System.Net.dll.sources
mcs/class/System.Net/System.Net/DnsPermission.cs [new file with mode: 0644]
mcs/class/System.Runtime.Serialization/mobile_static_System.Runtime.Serialization.dll.sources [new file with mode: 0644]
mcs/class/System.ServiceModel.Web/System.ServiceModel.Syndication/Atom10FeedFormatter.cs
mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Activation/WebScriptServiceHostFactoryTest.cs
mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Channels/WebMessageEncodingBindingElementTest.cs
mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Configuration/WebHttpBindingElementTest.cs
mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Description/WebHttpBehaviorTest.cs
mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Description/WebHttpEndpointTest.cs
mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Description/WebScriptEnablingBehaviorTest.cs
mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Dispatcher/WebHttpDispatchOperationSelectorTest.cs
mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Syndication/Atom10FeedFormatterTest.cs
mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Syndication/Atom10ItemFormatterTest.cs
mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Syndication/AtomPub10CategoriesDocumentFormatterTest.cs
mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Syndication/AtomPub10ServiceDocumentFormatterTest.cs
mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Syndication/Rss20FeedFormatterTest.cs
mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Syndication/Rss20ItemFormatterTest.cs
mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Syndication/ServiceDocumentTest.cs
mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Syndication/SyndicationElementExtensionTest.cs
mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Syndication/SyndicationFeedTest.cs
mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Syndication/SyndicationItemTest.cs
mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Syndication/SyndicationLinkTest.cs
mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Syndication/TextSyndicationContentTest.cs
mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Syndication/UrlSyndicationContentTest.cs
mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Syndication/XmlSyndicationContentTest.cs
mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/WebOperationContextTest.cs
mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/WebServiceHostTest.cs
mcs/class/System.ServiceModel.Web/Test/System.ServiceModel/WebHttpBindingTest.cs
mcs/class/System.ServiceModel.Web/Test/System/UriTemplateTest.cs
mcs/class/System.ServiceModel.Web/mobile_static_System.ServiceModel.Web.dll.sources [new file with mode: 0644]
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeAnd.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeArgument.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeArgumentReference.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeArithmeticOperation.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeArrayItem.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeArrayLength.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeAssignment.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeBinaryComparison.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeBinaryOperation.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeBlock.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeBuilder.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeCast.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeClass.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeCustomAttribute.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeDecrement.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeEquals.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeExpression.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeFieldReference.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeFor.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeForeach.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeGenerationHelper.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeIf.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeIncrement.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeIs.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeItem.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeLiteral.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeMethod.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeMethodCall.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeModule.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeNew.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeNewArray.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeNotEquals.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeOr.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeProperty.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodePropertyReference.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeReturn.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeSelect.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeSelfIncrement.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeTryBlock.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeUnaryOperation.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeValueReference.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeVariableDeclaration.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeVariableReference.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeWhen.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeWhile.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeWriter.cs
mcs/class/System.ServiceModel/Mono.CodeGeneration/Exp.cs
mcs/class/System.ServiceModel/System.ServiceModel.Description/ContractDescriptionGenerator.cs
mcs/class/System.ServiceModel/System.ServiceModel/ChannelFactory_1.cs
mcs/class/System.ServiceModel/System.ServiceModel/ClientProxyGenerator.cs
mcs/class/System.ServiceModel/System.ServiceModel/FaultException_1.cs
mcs/class/System.ServiceModel/mobile_static_System.ServiceModel.dll.sources [new file with mode: 0644]
mcs/class/System.Transactions/Makefile
mcs/class/System.Web.Services/Makefile
mcs/class/System.Web.Services/mobile_static_System.Web.Services.dll.sources [new file with mode: 0644]
mcs/class/System.Web/System.Web.Configuration_2.0/HttpRuntimeSection.cs
mcs/class/System.Web/System.Web.Util/HttpEncoder.cs
mcs/class/System.Web/System.Web/HttpRuntime.cs
mcs/class/System.XML/mobile_static_System.Xml.dll.sources [new file with mode: 0644]
mcs/class/System/Microsoft.CSharp/CSharpCodeGenerator.cs
mcs/class/System/System.CodeDom/CodeNamespace.cs
mcs/class/System/System.Collections.Generic/SortedList.cs
mcs/class/System/System.Collections.ObjectModel/ObservableCollection.cs
mcs/class/System/System.Net.Sockets/Socket_2_1.cs
mcs/class/System/System.Net/FtpWebRequest.cs
mcs/class/System/System.Net/WebRequest.cs
mcs/class/System/Test/Microsoft.CSharp/CodeGeneratorFromCompileUnitTest.cs
mcs/class/System/Test/System.Net/DnsTest.cs
mcs/class/System/Test/System.Net/FtpWebRequestTest.cs
mcs/class/System/mobile_static_System.dll.sources [new file with mode: 0644]
mcs/class/WindowsBase/System.Collections.ObjectModel/ObservableCollection.cs
mcs/class/corlib/Makefile
mcs/class/corlib/System.Collections/StructuralComparisons.cs
mcs/class/corlib/System.IO/FileStream.cs
mcs/class/corlib/System.Reflection.Emit/ConstructorBuilder.cs
mcs/class/corlib/System.Reflection.Emit/DynamicMethod.cs
mcs/class/corlib/System.Reflection.Emit/ILGenerator.cs
mcs/class/corlib/System.Reflection.Emit/MethodBuilder.cs
mcs/class/corlib/System.Reflection/MonoMethod.cs
mcs/class/corlib/System.Reflection/MonoProperty.cs
mcs/class/corlib/System.Reflection/ParameterInfo.cs
mcs/class/corlib/System.Threading.Tasks/Task.cs
mcs/class/corlib/System.Threading/Thread.cs
mcs/class/corlib/System.Threading/Timer.cs
mcs/class/corlib/System/Console.cs
mcs/class/corlib/System/Guid.cs
mcs/class/corlib/System/String.cs
mcs/class/corlib/System/Type.cs
mcs/class/corlib/System/Variant.cs
mcs/class/corlib/Test/System.Collections/StructuralComparisonsTest.cs [new file with mode: 0644]
mcs/class/corlib/Test/System.Globalization/CultureInfoTest.cs
mcs/class/corlib/Test/System.IO/FileStreamTest.cs
mcs/class/corlib/Test/System.Reflection/PropertyInfoTest.cs
mcs/class/corlib/Test/System.Threading.Tasks/TaskTest.cs
mcs/class/corlib/Test/System.Threading/ThreadTest.cs
mcs/class/corlib/Test/System.Threading/TimerTest.cs
mcs/class/corlib/Test/System/ConsoleTest.cs
mcs/class/corlib/corlib_test.dll.sources
mcs/class/corlib/mobile_static_corlib.dll.sources [new file with mode: 0644]
mcs/errors/CS0012-21-lib.il [new file with mode: 0644]
mcs/errors/Makefile
mcs/errors/cs0012-21.cs [new file with mode: 0644]
mcs/errors/cs0075.cs
mcs/errors/cs0118-11.cs [changed mode: 0644->0755]
mcs/errors/cs0118-12.cs [deleted file]
mcs/errors/cs0119-2.cs [new file with mode: 0644]
mcs/errors/cs0119-8.cs [changed mode: 0755->0644]
mcs/errors/cs0472-5.cs [new file with mode: 0644]
mcs/errors/cs0576-3.cs [new file with mode: 0644]
mcs/mcs/async.cs
mcs/mcs/class.cs
mcs/mcs/codegen.cs
mcs/mcs/complete.cs
mcs/mcs/const.cs
mcs/mcs/constant.cs
mcs/mcs/cs-parser.jay
mcs/mcs/decl.cs
mcs/mcs/delegate.cs
mcs/mcs/ecore.cs
mcs/mcs/eval.cs
mcs/mcs/expression.cs
mcs/mcs/field.cs
mcs/mcs/flowanalysis.cs
mcs/mcs/generic.cs
mcs/mcs/import.cs
mcs/mcs/method.cs
mcs/mcs/module.cs
mcs/mcs/namespace.cs
mcs/mcs/parameter.cs
mcs/mcs/property.cs
mcs/mcs/settings.cs
mcs/mcs/statement.cs
mcs/mcs/support.cs
mcs/mcs/typespec.cs
mcs/mcs/visit.cs
mcs/tests/gtest-589.cs [new file with mode: 0644]
mcs/tests/gtest-590.cs [new file with mode: 0644]
mcs/tests/gtest-591-lib.cs [new file with mode: 0644]
mcs/tests/gtest-591.cs [new file with mode: 0644]
mcs/tests/gtest-autoproperty-08.cs [new file with mode: 0644]
mcs/tests/gtest-etree-01.cs
mcs/tests/gtest-partial-07.cs [new file with mode: 0644]
mcs/tests/gtest-partial-08.cs [new file with mode: 0644]
mcs/tests/gtest-partial-09.cs [new file with mode: 0644]
mcs/tests/test-591.cs
mcs/tests/test-869.cs [new file with mode: 0644]
mcs/tests/test-async-13.cs
mcs/tests/test-async-22.cs
mcs/tests/test-debug-10-ref.xml
mcs/tests/test-debug-11-ref.xml
mcs/tests/test-debug-14-ref.xml
mcs/tests/test-debug-15-ref.xml
mcs/tests/test-debug-16-ref.xml
mcs/tests/test-debug-17-ref.xml
mcs/tests/test-debug-18-ref.xml
mcs/tests/test-debug-19-ref.xml
mcs/tests/test-debug-21-ref.xml
mcs/tests/test-debug-22-ref.xml
mcs/tests/test-debug-23-ref.xml
mcs/tests/test-debug-24-ref.xml
mcs/tests/test-debug-27-ref.xml [new file with mode: 0644]
mcs/tests/test-debug-27.cs [new file with mode: 0644]
mcs/tests/test-named-08.cs [new file with mode: 0644]
mcs/tests/ver-il-net_4_5.xml
mcs/tools/csharp/repl.cs
mono-core.spec.in
mono/dis/main.c
mono/io-layer/messages.c
mono/metadata/Makefile.am.in
mono/metadata/appdomain.c
mono/metadata/assembly.c
mono/metadata/class.c
mono/metadata/console-win32.c
mono/metadata/debug-mono-symfile.c
mono/metadata/file-io.c
mono/metadata/icall.c
mono/metadata/image.c
mono/metadata/locales.c
mono/metadata/marshal.c
mono/metadata/marshal.h
mono/metadata/metadata-internals.h
mono/metadata/metadata-verify.c
mono/metadata/metadata.c
mono/metadata/method-builder.c
mono/metadata/object-internals.h
mono/metadata/reflection.c
mono/metadata/sgen-alloc.c
mono/metadata/sgen-fin-weak-hash.c
mono/metadata/sgen-gc.c
mono/metadata/sgen-gc.h
mono/metadata/sgen-protocol.c
mono/metadata/sgen-protocol.h
mono/metadata/socket-io.c
mono/metadata/threadpool.c
mono/metadata/threads.c
mono/metadata/tpool-epoll.c
mono/metadata/tpool-kqueue.c
mono/metadata/tpool-poll.c
mono/mini/.gitignore
mono/mini/Makefile.am.in
mono/mini/aot-compiler.c
mono/mini/aot-runtime.c
mono/mini/arrays.cs
mono/mini/cpu-mips.md
mono/mini/debugger-agent.c
mono/mini/decompose.c
mono/mini/driver.c
mono/mini/dwarfwriter.c
mono/mini/dwarfwriter.h
mono/mini/exceptions-amd64.c
mono/mini/exceptions-arm.c
mono/mini/exceptions-ppc.c
mono/mini/exceptions-s390x.c
mono/mini/exceptions-x86.c
mono/mini/generics.cs
mono/mini/gshared.cs
mono/mini/ir-emit.h
mono/mini/jit-icalls.c
mono/mini/jit-icalls.h
mono/mini/method-to-ir.c
mono/mini/mini-amd64.c
mono/mini/mini-arm.c
mono/mini/mini-arm.h
mono/mini/mini-gc.c
mono/mini/mini-generic-sharing.c
mono/mini/mini-ia64.c
mono/mini/mini-llvm-cpp.cpp
mono/mini/mini-llvm.c
mono/mini/mini-mips.c
mono/mini/mini-ppc.c
mono/mini/mini-s390x.c
mono/mini/mini-sparc.c
mono/mini/mini-trampolines.c
mono/mini/mini-x86.c
mono/mini/mini.c
mono/mini/mini.h
mono/mini/objects.cs
mono/mini/simd-intrinsics.c
mono/mini/trace.c
mono/mini/tramp-amd64.c
mono/mini/tramp-arm.c
mono/mini/tramp-mips.c
mono/mini/tramp-ppc.c
mono/mini/tramp-s390x.c
mono/mini/tramp-x86.c
mono/mini/xdebug.c
mono/tests/Makefile.am
mono/tests/debug-casts.cs [new file with mode: 0644]
mono/tests/finalizer-exception.cs
mono/tests/marshal2.cs
mono/tests/runtime-invoke.cs
mono/utils/Makefile.am
mono/utils/atomic.c
mono/utils/atomic.h
mono/utils/bsearch.c [new file with mode: 0644]
mono/utils/bsearch.h [new file with mode: 0644]
mono/utils/mach-support-arm.c
mono/utils/mono-compiler.h
mono/utils/mono-hwcap-arm.c [new file with mode: 0644]
mono/utils/mono-hwcap-arm.h [new file with mode: 0644]
mono/utils/mono-hwcap-ia64.c [new file with mode: 0644]
mono/utils/mono-hwcap-ia64.h [new file with mode: 0644]
mono/utils/mono-hwcap-mips.c [new file with mode: 0644]
mono/utils/mono-hwcap-mips.h [new file with mode: 0644]
mono/utils/mono-hwcap-ppc.c [new file with mode: 0644]
mono/utils/mono-hwcap-ppc.h [new file with mode: 0644]
mono/utils/mono-hwcap-s390x.c [new file with mode: 0644]
mono/utils/mono-hwcap-s390x.h [new file with mode: 0644]
mono/utils/mono-hwcap-sparc.c [new file with mode: 0644]
mono/utils/mono-hwcap-sparc.h [new file with mode: 0644]
mono/utils/mono-hwcap-x86.c [new file with mode: 0644]
mono/utils/mono-hwcap-x86.h [new file with mode: 0644]
mono/utils/mono-hwcap.c [new file with mode: 0644]
mono/utils/mono-hwcap.h [new file with mode: 0644]
mono/utils/mono-membar.h
mono/utils/mono-memory-model.h
mono/utils/mono-mutex.c
mono/utils/mono-threads-posix.c
mono/utils/mono-threads.h
msvc/libmonoruntime.vcxproj
msvc/libmonoutils.vcxproj
support/map.h
support/unistd.c
tools/sgen/sgen-grep-binprot.c

index bce6a59c239936f3a08e5b804742f0a7dbbc78bd..8c899ab014b01789ccfab56844f2bf821b7e9f0d 100644 (file)
@@ -55,7 +55,7 @@ _ReSharper*/
 ~$*
 
 # Autotools-generated files
-Makefile
+/Makefile
 Makefile.in
 aclocal.m4
 autom4te.cache
index e6a64719df53e03a6abed179354a329a1a7363c6..60aee64a178ca4e2cd0c839ba8f2a659891c096a 100644 (file)
@@ -1,7 +1,7 @@
 # Process this file with autoconf to produce a configure script.
 #AC_PREREQ([2.62])
 
-AC_INIT(mono, [3.1.0],
+AC_INIT(mono, [3.3.0],
         [http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])
 
 AC_CONFIG_SRCDIR([README])
@@ -1150,6 +1150,8 @@ if test x$target_win32 = xno; then
 
        AC_CHECK_HEADERS(execinfo.h)
 
+       AC_CHECK_HEADERS(sys/auxv.h)
+
        AC_CHECK_FUNCS(getgrgid_r)
        AC_CHECK_FUNCS(getgrnam_r)
        AC_CHECK_FUNCS(getpwnam_r)
@@ -2375,14 +2377,18 @@ if test "x$enable_llvm" = "xyes"; then
                ;;
    esac
 
-
    # The output of --cflags seems to include optimizations flags too
    LLVM_CFLAGS=`$LLVM_CONFIG --cflags | sed -e 's/-O2//g' | sed -e 's/-O0//g' | sed -e 's/-fomit-frame-pointer//g' | sed -e 's/-fPIC//g'`
    # LLVM is compiled with -fno-rtti, so we need this too, since our classes inherit
    # from LLVM classes.
    LLVM_CXXFLAGS="`$LLVM_CONFIG --cxxflags` -fno-rtti"
    LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
-   LLVM_LIBS=`$LLVM_CONFIG --libs core bitwriter jit mcjit $llvm_codegen`
+   if test "x$host" != "x$target"; then
+      # No need for jit libs
+      LLVM_LIBS=`$LLVM_CONFIG --libs core bitwriter`
+   else
+      LLVM_LIBS=`$LLVM_CONFIG --libs core bitwriter jit mcjit $llvm_codegen`
+   fi
    LLVM_LIBS="$LLVM_LDFLAGS $LLVM_LIBS -lstdc++"
 
    # Should be something like '2.6' or '2.7svn'
@@ -2592,9 +2598,9 @@ case "$host" in
                arch_target=arm;
                ACCESS_UNALIGNED="no"
                JIT_SUPPORTED=yes
-               CPPFLAGS="$CPPFLAGS -D__ARM_EABI__ -DHAVE_ARMV6=1"
+               CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
                # libgc's gc_locks.h depends on this
-           CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DHAVE_ARMV6"
+           CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC"
                sgen_supported=true
                ;;
        arm*-linux*)
@@ -2616,7 +2622,7 @@ case "$host" in
 #              AOT_SUPPORTED="no"
 #              ;;
        s390x-*-linux*)
-               TARGET=S390x;
+               TARGET=S390X;
                arch_target=s390x;
                ACCESS_UNALIGNED="yes"
                JIT_SUPPORTED=yes
@@ -2636,7 +2642,7 @@ if test "x$host" != "x$target"; then
                arch_target=arm;
                ACCESS_UNALIGNED="no"
                JIT_SUPPORTED=yes
-               CPPFLAGS="$CPPFLAGS -D__ARM_EABI__ -DHAVE_ARMV6=1"
+               CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
                jit_wanted=true
                # Can't use tls, since it depends on the runtime detection of tls offsets
                # in mono-compiler.h
@@ -2725,7 +2731,6 @@ if test "x$host" != "x$target"; then
        esac
 fi
 
-# FIXME: Define the others as well
 case "$TARGET" in
 X86)
        AC_DEFINE(TARGET_X86, 1, [...])
@@ -2743,14 +2748,32 @@ POWERPC64)
        AC_DEFINE(TARGET_POWERPC, 1, [...])
        AC_DEFINE(TARGET_POWERPC64, 1, [...])
        ;;
-S390x)
+S390X)
        AC_DEFINE(TARGET_S390X, 1, [...])
        ;;
 MIPS)
        AC_DEFINE(TARGET_MIPS, 1, [...])
        ;;
+IA64)
+       AC_DEFINE(TARGET_IA64, 1, [...])
+       ;;
+SPARC)
+       AC_DEFINE(TARGET_SPARC, 1, [...])
+       ;;
+SPARC64)
+       AC_DEFINE(TARGET_SPARC64, 1, [...])
+       ;;
 esac
 
+dnl Use GCC atomic ops if they work on the target.
+if test x$GCC = "xyes"; then
+       case $TARGET in
+       X86 | AMD64 | ARM | POWERPC | POWERPC64 | MIPS)
+               AC_DEFINE(USE_GCC_ATOMIC_OPS, 1, [...])
+               ;;
+       esac
+fi
+
 if test "x$target_mach" = "xyes"; then
    if test "x$TARGET" = "xARM"; then
          AC_DEFINE(TARGET_IOS,1,[The JIT/AOT targets iOS])
@@ -3035,18 +3058,54 @@ if test ${TARGET} = ARM; then
        CPPFLAGS="$CPPFLAGS -DARM_FPU_$fpu=1"
        unset fpu
 
-       if test x$cross_compiling = xno; then
-               AC_MSG_CHECKING(for ARMV6)
-               AC_TRY_RUN([
-                       int main () { __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r" (0) : "memory"); return 0; }
-                               ], armv6=yes, armv6=no)
-
-               AC_MSG_RESULT($armv6)
-               if test ${armv6} = yes; then
-                  AC_DEFINE(HAVE_ARMV6, 1, "Host supports ARMV6 instructions")
-                  # libgc's gc_locks.h depends on this
-                  CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DHAVE_ARMV6"
-               fi
+       dnl *********************************************
+       dnl *** Check which ARM version(s) we can use ***
+       dnl *********************************************
+       AC_MSG_CHECKING(which ARM version to use)
+
+       AC_TRY_COMPILE([], [
+               #if !defined(__ARM_ARCH_5T__) && !defined(__ARM_ARCH_5TE__) && !defined(__ARM_ARCH_5TEJ__)
+               #error Not on ARM v5.
+               #endif
+               return 0;
+       ], [
+               arm_v5=yes
+       ], [])
+
+       AC_TRY_COMPILE([], [
+               #if !defined(__ARM_ARCH_6J__) && !defined(__ARM_ARCH_6ZK__) && !defined(__ARM_ARCH_6K__) && !defined(__ARM_ARCH_6T2__) && !defined(__ARM_ARCH_6M__)
+               #error Not on ARM v6.
+               #endif
+               return 0;
+       ], [
+               arm_v5=yes
+               arm_v6=yes
+       ], [])
+
+       AC_TRY_COMPILE([], [
+               #if !defined(__ARM_ARCH_7A__) && !defined(__ARM_ARCH_7R__) && !defined(__ARM_ARCH_7EM__) && !defined(__ARM_ARCH_7M__) && !defined(__ARM_ARCH_7S__)
+               #error Not on ARM v7.
+               #endif
+               return 0;
+       ], [
+               arm_v5=yes
+               arm_v6=yes
+               arm_v7=yes
+       ], [])
+
+       if test x$arm_v5 = xyes; then
+               AC_DEFINE(HAVE_ARMV5, 1, [ARM v5])
+               CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DHAVE_ARMV5=1"
+       fi
+
+       if test x$arm_v6 = xyes; then
+               AC_DEFINE(HAVE_ARMV6, 1, [ARM v6])
+               CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DHAVE_ARMV6=1"
+       fi
+
+       if test x$arm_v7 = xyes; then
+               AC_DEFINE(HAVE_ARMV7, 1, [ARM v7])
+               CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DHAVE_ARMV7=1"
        fi
 fi
 
@@ -3217,12 +3276,11 @@ AM_CONDITIONAL(SPARC64, test x$TARGET = xSPARC64)
 AM_CONDITIONAL(X86, test x$TARGET = xX86)
 AM_CONDITIONAL(AMD64, test x$TARGET = xAMD64)
 AM_CONDITIONAL(IA64, test x$TARGET = xIA64)
-AM_CONDITIONAL(M68K, test x$TARGET = xM68K)
 AM_CONDITIONAL(MIPS, test x$TARGET = xMIPS)
 AM_CONDITIONAL(POWERPC, test x$TARGET = xPOWERPC)
 AM_CONDITIONAL(POWERPC64, test x$TARGET = xPOWERPC64)
 AM_CONDITIONAL(ARM, test x$TARGET = xARM)
-AM_CONDITIONAL(S390x, test x$TARGET = xS390x)
+AM_CONDITIONAL(S390X, test x$TARGET = xS390X)
 AM_CONDITIONAL(HOST_X86, test x$HOST = xX86)
 AM_CONDITIONAL(HOST_AMD64, test x$HOST = xAMD64)
 AM_CONDITIONAL(HOST_ARM, test x$HOST = xARM)
index e95cec0b4c1b0d8424f9d4038d0d4f3db1558eef..ba4fd185b9b743770a49c102a69748908bf97470 100644 (file)
 #          define NACL_ALIGN()
 #       endif
         inline static int GC_test_and_set(volatile unsigned int *addr) {
-#if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7__)
-          int ret, tmp;
-          __asm__ __volatile__ (
-                                 "1:\n"
-                                 NACL_ALIGN()
-                                 MASK_REGISTER("%3", "al")
-                                 "ldrex %0, [%3]\n"
-                                 MASK_REGISTER("%3", "al")
-                                 "strex %1, %2, [%3]\n" 
-                                 "teq %1, #0\n"
-                                 "bne 1b\n"
-                                 : "=&r" (ret), "=&r" (tmp)
-                                 : "r" (1), "r" (addr)
-                                 : "memory", "cc");
-          return ret;
-#else
-          int oldval;
-          /* SWP on ARM is very similar to XCHG on x86.  Doesn't lock the
-           * bus because there are no SMP ARM machines.  If/when there are,
-           * this code will likely need to be updated. */
-          /* See linuxthreads/sysdeps/arm/pt-machine.h in glibc-2.1 */
-          __asm__ __volatile__(MASK_REGISTER("%2", "al")
-                               "swp %0, %1, [%2]"
-                            : "=&r"(oldval)
-                            : "r"(1), "r"(addr)
-                            : "memory");
-          return oldval;
-#endif
+                 return (int) __sync_lock_test_and_set (addr, 1);
         }
 #       define GC_TEST_AND_SET_DEFINED
       inline static void GC_clear(volatile unsigned int *addr) {
-#ifdef HAVE_ARMV6
-                 /* Memory barrier */
-#ifdef __native_client__
-                 /* NaCl requires ARMv7 CPUs. */
-                 __asm__ __volatile__("dsb" : : : "memory");
-#else
-                 __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r" (0) : "memory");
-#endif
-#endif
+                 __sync_synchronize ();
+
                  *(addr) = 0;
       }
 #     define GC_CLEAR_DEFINED
index bbb2e5025338947a70db0e2406d9d67271da066f..bd784cd85e86a4cd8bdff624ead49b66bac4f369 100644 (file)
@@ -1628,6 +1628,10 @@ for example, to see managed frame names on gdb backtraces.
 Enables the maximum JIT verbosity for the specified method. This is
 very helpfull to diagnose a miscompilation problems of a specific
 method.
+.TP
+\fBMONO_VERBOSE_HWCAP\fR
+If set, makes the JIT output information about detected CPU features
+(such as SSE, CMOV, FCMOV, etc) to stdout.
 .SH VALGRIND
 If you want to use Valgrind, you will find the file `mono.supp'
 useful, it contains the suppressions for the GC which trigger
diff --git a/mcs/build/profiles/mobile_static.make b/mcs/build/profiles/mobile_static.make
new file mode 100644 (file)
index 0000000..5950566
--- /dev/null
@@ -0,0 +1,20 @@
+#! -*- makefile -*-
+
+BOOTSTRAP_PROFILE = build
+
+BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
+MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
+
+# Use system resgen as we don't want local System.Windows.Forms dependency
+RESGEN = resgen2
+
+profile-check:
+       @:
+
+DEFAULT_REFERENCES = -r:mscorlib.dll
+PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE -d:FULL_AOT_RUNTIME -d:DISABLE_REMOTING -d:DISABLE_COM -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS)
+FRAMEWORK_VERSION = 2.1
+NO_TEST = yes
+
+# the tuner takes care of the install
+NO_INSTALL = yes
index d1d2832be4df8cb35e793f000d2bfc86761bbdf1..7c7a36c353e4bb00cebc57d6dbd04f2c853cae8b 100644 (file)
@@ -80,9 +80,12 @@ include $(topdir)/build/config-default.make
 # Default PLATFORM and PROFILE if they're not already defined.
 
 ifndef PLATFORM
+$(info *** PLATFORM is not defined.)
 ifeq ($(OS),Windows_NT)
+$(info *** Assuming PLATFORM is 'win32'.)
 PLATFORM = win32
 else
+$(info *** Assuming PLATFORM is 'linux'.)
 PLATFORM = linux
 endif
 endif
index 2be7a106adb4f0e2af8bc4043ce037229d10bb26..1f5818bde9bcb24d4348a8259aebb0d27954de57 100644 (file)
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.IQueryable<>))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.IOrderedQueryable<>))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.IQueryProvider))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.Expression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.BinaryExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.ConditionalExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.ConstantExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.ElementInit))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.LambdaExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.Expression<>))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.ExpressionType))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.ExpressionVisitor))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.InvocationExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.ListInitExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.MemberBinding))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.MemberAssignment))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.MemberBindingType))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.MemberExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.MemberInitExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.MemberListBinding))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.MemberMemberBinding))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.MethodCallExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.NewArrayExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.NewExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.ParameterExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.TypeBinaryExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.UnaryExpression))]
 
+#if !FULL_AOT_RUNTIME
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.BlockExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.CatchBlock))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.DebugInfoExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.DefaultExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.GotoExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.GotoExpressionKind))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.IndexExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.LabelExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.LabelTarget))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.LoopExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.RuntimeVariablesExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.SwitchCase))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.SwitchExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.SymbolDocumentInfo))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.TryExpression))]
+#endif
index 67eeae47cbf2bc4486ef9fd79f608a13408aaae6..f69e216295ee99f789f3614d1899408176717fea 100644 (file)
@@ -257,6 +257,7 @@ net_2_0_SUBDIRS := $(common_dirs) $(net_2_0_dirs) $(net_2_0_only_dirs) aot-compi
 monodroid_SUBDIRS := $(mobile_dirs) $(monodroid_dirs)
 monotouch_SUBDIRS := $(mobile_dirs)
 monotouch_runtime_SUBDIRS := $(monotouch_runtime_dirs)
+mobile_static_SUBDIRS := $(mobile_dirs)
 mobile_SUBDIRS := $(mobile_dirs)
 net_3_5_SUBDIRS := $(net_3_5_only_dirs)
 net_4_0_SUBDIRS := $(common_dirs) $(net_2_0_dirs) $(net_4_0_dirs) $(net_4_0_only_dirs)
index abfee61e41859dd36716d41e1ecfca9d441540dd..8479a337f0b0a8b9ee7d225ebf1b8c5c213c7f4e 100755 (executable)
@@ -177,7 +177,7 @@ SWFresourcelist()
 {
 cat $Resource | while read SRC; do
 SRC=`echo $SRC | $tr '/' '\\\\'`
-SRC=`echo $SRC | sed 's/-resource://' | gawk -F , '{print "                    RelPath = \"" $1 "\"\n                    CustomToolNameSpace = \"" $2 "\""}' | fgrep -v \"\"`
+SRC=`echo $SRC | sed 's/-resource://' | awk -F , '{print "                    RelPath = \"" $1 "\"\n                    CustomToolNameSpace = \"" $2 "\""}' | fgrep -v \"\"`
 
 cat << EOT
                 <File
index b590d2dacba1e807323aac015a7f7116b2cdc37e..e78b92dc8fc71eca8c96569864682b6ba2c997da 100644 (file)
@@ -60,6 +60,8 @@ namespace Microsoft.Build.Tasks
                                Log.LogWarning ("Unable to find framework corresponding to the target framework moniker '{0}'. " +
                                                "Framework assembly references will be resolved from the GAC, which might not be " +
                                                "the intended behavior.", TargetFrameworkMoniker);
+                               if (moniker.Identifier.Equals (".NETPortable"))
+                                       return CheckPclReferenceAssemblies (moniker);
                                return true;
                        }
 
@@ -69,6 +71,17 @@ namespace Microsoft.Build.Tasks
                        return true;
                }
 
+               bool CheckPclReferenceAssemblies (FrameworkMoniker moniker)
+               {
+                       // Check for a supported profile
+                       var check = new FrameworkMoniker (".NETPortable", "v4.0", "Profile24");
+                       if (GetFrameworkDirectoriesForMoniker (check) != null)
+                               Log.LogError ("Unsupported PCL Profile '{0}'.", moniker);
+                       else
+                               Log.LogError ("PCL Reference Assemblies not installed.");
+                       return false;
+               }
+
                Framework GetFrameworkDirectoriesForMoniker (FrameworkMoniker moniker)
                {
                        string dirs = String.Join (PathSeparatorAsString, new string [] {
index 977e9a5aa4ef059ecb4924eb89911be0bc6ae21d..9732b655d2031f5b893cdcb96da04b6cce4b85b4 100644 (file)
@@ -139,5 +139,16 @@ namespace MonoTests.EvaluatorTest
                        Evaluator.Run ("d.GetType ();");
                }
 #endif
+
+#if NET_4_5
+               [Test]
+               public void AwaitExpression ()
+               {
+                       Evaluator.WaitOnTask = true;
+                       var res = Evaluator.Evaluate("var res = await System.Threading.Tasks.Task.FromResult (1) + await System.Threading.Tasks.Task.FromResult (2);");
+                       res = Evaluator.Evaluate ("res;");
+                       Assert.AreEqual (3, res, "#1");
+               }
+#endif
        }
 }
\ No newline at end of file
index 26c45e10d5b800b874b5f6aafcf5f62f1e1937a2..241f7d070e3de2c38d0c4ba98fa520c1edf7a72e 100644 (file)
@@ -193,6 +193,7 @@ public class Tests : TestsBase
        public AStruct field_struct;
        public object field_boxed_struct;
        public GStruct<int> generic_field_struct;
+       public KeyValuePair<int, object> boxed_struct_field;
        [ThreadStatic]
        public static int tls_i;
        public static bool is_attached = Debugger.IsAttached;
@@ -498,7 +499,7 @@ public class Tests : TestsBase
        }
 
        public static void vtypes () {
-               Tests t = new Tests () { field_struct = new AStruct () { i = 42, s = "S", k = 43 }, generic_field_struct = new GStruct<int> () { i = 42 }, field_boxed_struct = new AStruct () { i = 42 }};
+               Tests t = new Tests () { field_struct = new AStruct () { i = 42, s = "S", k = 43 }, generic_field_struct = new GStruct<int> () { i = 42 }, field_boxed_struct = new AStruct () { i = 42 }, boxed_struct_field = new KeyValuePair<int, object> (1, (long)42 ) };
                AStruct s = new AStruct { i = 44, s = "T", k = 45 };
                AStruct[] arr = new AStruct[] { 
                        new AStruct () { i = 1, s = "S1" },
index 5d3f8794c7a28243c1a306a1c0c184371df5a490..d549c0ba6faf0e7cab4c4124d1d432356bb7ff20 100644 (file)
@@ -135,6 +135,16 @@ public class DebuggerTests
                return e;
        }
 
+       Event step_until (ThreadMirror t, string method_name) {
+               Event e;
+               while (true) {
+                       e = single_step (t);
+                       if ((e as StepEvent).Method.Name == method_name)
+                               break;
+               }
+               return e;
+       }
+
        void check_arg_val (StackFrame frame, int pos, Type type, object eval) {
                object val = frame.GetArgument (pos);
                Assert.IsTrue (val is PrimitiveValue);
@@ -1325,6 +1335,17 @@ public class DebuggerTests
                Assert.AreEqual ("AStruct", s.Type.Name);
                AssertValue (42, s ["i"]);
 
+               // Check round tripping of boxed struct fields (#12354)
+               obj = o.GetValue (o.Type.GetField ("boxed_struct_field"));
+               o.SetValue (o.Type.GetField ("boxed_struct_field"), obj);
+               obj = o.GetValue (o.Type.GetField ("boxed_struct_field"));
+               s = obj as StructMirror;
+               AssertValue (1, s ["key"]);
+               obj = s ["value"];
+               Assert.IsTrue (obj is StructMirror);
+               s = obj as StructMirror;
+               AssertValue (42, s ["m_value"]);
+
                // vtypes as arguments
                s = frame.GetArgument (0) as StructMirror;
                AssertValue (44, s ["i"]);
@@ -1361,11 +1382,7 @@ public class DebuggerTests
 
                // this on vtype methods
                e = run_until ("vtypes2");
-               
-               // Skip nop
-               e = single_step (e.Thread);
-
-               e = single_step (e.Thread);
+               e = step_until (e.Thread, "foo");
 
                frame = e.Thread.GetFrames () [0];
 
@@ -1380,11 +1397,7 @@ public class DebuggerTests
 
                // this on static vtype methods
                e = run_until ("vtypes3");
-
-               // Skip nop
-               e = single_step (e.Thread);
-
-               e = single_step (e.Thread);
+               e = step_until (e.Thread, "static_foo");
 
                frame = e.Thread.GetFrames () [0];
 
@@ -1691,13 +1704,26 @@ public class DebuggerTests
 
                Location l;
                
-               vm.Resume ();
+               while (true) {
+                       vm.Resume ();
+
+                       e = GetNextEvent ();
+                       Assert.IsTrue (e is StepEvent);
+                       if (e.Thread.GetFrames ()[0].Method.Name == "ln1")
+                               break;
+               }
 
+               // Do an additional step over so we are not on the beginning line of the method
+               step_req.Disable ();
+               step_req.Depth = StepDepth.Over;
+               step_req.Enable ();
+               vm.Resume ();
                e = GetNextEvent ();
-               Assert.IsTrue (e is StepEvent);
+               Assert.IsTrue (e is StepEvent);         
 
                l = e.Thread.GetFrames ()[0].Location;
 
+               Console.WriteLine (l);
                Assert.AreEqual (3, l.ColumnNumber);
 
                step_req.Disable ();
index d6205a2d4d14f4f1a9f53a695f27a26cdfd5a3a5..7e57265a62a5bc3202dc3f36df7ddb1fcd40f25d 100644 (file)
@@ -42,20 +42,7 @@ namespace Mono.Attach
                }
 
                public string GetWorkingDirectory () {
-                       int len = 256;
-
-                       while (true) {
-                               StringBuilder sb = new StringBuilder (len);
-
-                               int res = Syscall.readlink ("/proc/" + pid + "/cwd", sb);
-                               if (res == -1)
-                                       throw new IOException ("Syscall.readlink () failed with error " + res + ".");
-                               else if (res == len) {
-                                       len = len * 2;
-                               } else {
-                                       return sb.ToString ();
-                               }
-                       }
+                       return UnixPath.ReadLink ("/proc/" + pid + "/cwd");
                }
 
                /*
index b0c430596b21d5d9457befdeb3815cea9e9e1a2d..270b0b6aee680cb64332b06638110b58a6eda18b 100644 (file)
@@ -1,3 +1,4 @@
+Mono.Unix/ReadlinkTest.cs
 Mono.Unix/StdioFileStreamTest.cs
 Mono.Unix/UnixEncodingTest.cs
 Mono.Unix/UnixGroupTest.cs
index 27d241539d5a7e3a35ea4d74436ff211bdfd4afb..7488f79b56f2217deecc2832d1f13822ee9bfc40 100644 (file)
@@ -3937,17 +3937,51 @@ namespace Mono.Unix.Native {
                                [MarshalAs (UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(FileNameMarshaler))]
                                string newpath);
 
+               delegate long DoReadlinkFun (byte[] target);
+
+               // Helper function for readlink(string, StringBuilder) and readlinkat (int, string, StringBuilder)
+               static int ReadlinkIntoStringBuilder (DoReadlinkFun doReadlink, [Out] StringBuilder buf, ulong bufsiz)
+               {
+                       // bufsiz > int.MaxValue can't work because StringBuilder can store only int.MaxValue chars
+                       int bufsizInt = checked ((int) bufsiz);
+                       var target = new byte [bufsizInt];
+
+                       var r = doReadlink (target);
+                       if (r < 0)
+                               return checked ((int) r);
+
+                       buf.Length = 0;
+                       var chars = UnixEncoding.Instance.GetChars (target, 0, checked ((int) r));
+                       // Make sure that at more bufsiz chars are written
+                       buf.Append (chars, 0, System.Math.Min (bufsizInt, chars.Length));
+                       if (r == bufsizInt) {
+                               // may not have read full contents; fill 'buf' so that caller can properly check
+                               buf.Append (new string ('\x00', bufsizInt - buf.Length));
+                       }
+                       return buf.Length;
+               }
+
                // readlink(2)
-               //    int readlink(const char *path, char *buf, size_t bufsize);
+               //    ssize_t readlink(const char *path, char *buf, size_t bufsize);
+               public static int readlink (string path, [Out] StringBuilder buf, ulong bufsiz)
+               {
+                       return ReadlinkIntoStringBuilder (target => readlink (path, target), buf, bufsiz);
+               }
+
+               public static int readlink (string path, [Out] StringBuilder buf)
+               {
+                       return readlink (path, buf, (ulong) buf.Capacity);
+               }
+
                [DllImport (MPH, SetLastError=true,
                                EntryPoint="Mono_Posix_Syscall_readlink")]
-               public static extern int readlink (
+               private static extern long readlink (
                                [MarshalAs (UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(FileNameMarshaler))]
-                               string path, [Out] StringBuilder buf, ulong bufsiz);
+                               string path, byte[] buf, ulong bufsiz);
 
-               public static int readlink (string path, [Out] StringBuilder buf)
+               public static long readlink (string path, byte[] buf)
                {
-                       return readlink (path, buf, (ulong) buf.Capacity);
+                       return readlink (path, buf, (ulong) buf.LongLength);
                }
 
                [DllImport (LIBC, SetLastError=true)]
@@ -4226,16 +4260,26 @@ namespace Mono.Unix.Native {
                }
 
                // readlinkat(2)
-               //    int readlinkat(int dirfd, const char *pathname, char *buf, size_t bufsize);
+               //    ssize_t readlinkat(int dirfd, const char *pathname, char *buf, size_t bufsize);
+               public static int readlinkat (int dirfd, string pathname, [Out] StringBuilder buf, ulong bufsiz)
+               {
+                       return ReadlinkIntoStringBuilder (target => readlinkat (dirfd, pathname, target), buf, bufsiz);
+               }
+
+               public static int readlinkat (int dirfd, string pathname, [Out] StringBuilder buf)
+               {
+                       return readlinkat (dirfd, pathname, buf, (ulong) buf.Capacity);
+               }
+
                [DllImport (MPH, SetLastError=true,
                                EntryPoint="Mono_Posix_Syscall_readlinkat")]
-               public static extern int readlinkat (int dirfd,
+               private static extern long readlinkat (int dirfd,
                                [MarshalAs (UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(FileNameMarshaler))]
-                               string pathname, [Out] StringBuilder buf, ulong bufsiz);
+                               string pathname, byte[] buf, ulong bufsiz);
 
-               public static int readlinkat (int dirfd, string pathname, [Out] StringBuilder buf)
+               public static long readlinkat (int dirfd, string pathname, byte[] buf)
                {
-                       return readlinkat (dirfd, pathname, buf, (ulong) buf.Capacity);
+                       return readlinkat (dirfd, pathname, buf, (ulong) buf.LongLength);
                }
 
                [DllImport (LIBC, SetLastError=true)]
index 659e0bd6d50ad7059b57aedad352a1741a210c65..e577edb74d4508f668dcc99a7bf282508160f843 100644 (file)
@@ -209,69 +209,59 @@ namespace Mono.Unix {
 
                // Read the specified symbolic link.  If the file isn't a symbolic link,
                // return null; otherwise, return the contents of the symbolic link.
-               //
-               // readlink(2) is horribly evil, as there is no way to query how big the
-               // symlink contents are.  Consequently, it's trial and error...
                internal static string ReadSymbolicLink (string path)
                {
-                       StringBuilder buf = new StringBuilder (256);
+                       string target = TryReadLink (path);
+                       if (target == null) {
+                               Native.Errno errno = Native.Stdlib.GetLastError ();
+                               if (errno != Native.Errno.EINVAL)
+                                       UnixMarshal.ThrowExceptionForError (errno);
+                       }
+                       return target;
+               }
+
+               public static string TryReadLink (string path)
+               {
+                       byte[] buf = new byte[256];
                        do {
-                               int r = Native.Syscall.readlink (path, buf);
-                               if (r < 0) {
-                                       Native.Errno e;
-                                       switch (e = Native.Stdlib.GetLastError()) {
-                                       case Native.Errno.EINVAL:
-                                               // path isn't a symbolic link
-                                               return null;
-                                       default:
-                                               UnixMarshal.ThrowExceptionForError (e);
-                                               break;
-                                       }
-                               }
-                               else if (r == buf.Capacity) {
-                                       buf.Capacity *= 2;
-                               }
+                               long r = Native.Syscall.readlink (path, buf);
+                               if (r < 0)
+                                       return null;
+                               else if (r == buf.Length)
+                                       buf = new byte[checked (buf.LongLength * 2)];
                                else
-                                       return buf.ToString (0, r);
+                                       return UnixEncoding.Instance.GetString (buf, 0, checked ((int) r));
                        } while (true);
                }
 
-               // Read the specified symbolic link.  If the file isn't a symbolic link,
-               // return null; otherwise, return the contents of the symbolic link.
-               //
-               // readlink(2) is horribly evil, as there is no way to query how big the
-               // symlink contents are.  Consequently, it's trial and error...
-               private static string ReadSymbolicLink (string path, out Native.Errno errno)
+               public static string TryReadLinkAt (int dirfd, string path)
                {
-                       errno = (Native.Errno) 0;
-                       StringBuilder buf = new StringBuilder (256);
+                       byte[] buf = new byte[256];
                        do {
-                               int r = Native.Syscall.readlink (path, buf);
-                               if (r < 0) {
-                                       errno = Native.Stdlib.GetLastError ();
+                               long r = Native.Syscall.readlinkat (dirfd, path, buf);
+                               if (r < 0)
                                        return null;
-                               }
-                               else if (r == buf.Capacity) {
-                                       buf.Capacity *= 2;
-                               }
+                               else if (r == buf.Length)
+                                       buf = new byte[checked (buf.LongLength * 2)];
                                else
-                                       return buf.ToString (0, r);
+                                       return UnixEncoding.Instance.GetString (buf, 0, checked ((int) r));
                        } while (true);
                }
 
-               public static string TryReadLink (string path)
+               public static string ReadLink (string path)
                {
-                       Native.Errno errno;
-                       return ReadSymbolicLink (path, out errno);
+                       string target = TryReadLink (path);
+                       if (target == null)
+                               UnixMarshal.ThrowExceptionForLastError (); 
+                       return target;
                }
 
-               public static string ReadLink (string path)
+               public static string ReadLinkAt (int dirfd, string path)
                {
-                       Native.Errno errno;
-                       path = ReadSymbolicLink (path, out errno);
-                       if (errno != 0)
-                               UnixMarshal.ThrowExceptionForError (errno);
-                       return path;
+                       string target = TryReadLinkAt (dirfd, path);
+                       if (target == null)
+                               UnixMarshal.ThrowExceptionForLastError (); 
+                       return target;
                }
 
                public static bool IsPathRooted (string path)
index d0026d2b46ab8333b4cd8562f5057f825879f9db..242a294a2a1a1cb970126dcc436437fb61e35b9a 100644 (file)
@@ -56,19 +56,18 @@ namespace Mono.Unix {
 
                public string ContentsPath {
                        get {
-                               return ReadLink ();
+                               return UnixPath.ReadLink (FullPath);
                        }
                }
 
                public bool HasContents {
                        get {
-                               return TryReadLink () != null;
+                               return UnixPath.TryReadLink (FullPath) != null;
                        }
                }
 
                public UnixFileSystemInfo GetContents ()
                {
-                       ReadLink ();
                        return UnixFileSystemInfo.GetFileSystemEntry (
                                                UnixPath.Combine (UnixPath.GetDirectoryName (FullPath), 
                                                        ContentsPath));
@@ -103,23 +102,6 @@ namespace Mono.Unix {
                {
                        return Native.Syscall.lstat (path, out stat) == 0;
                }
-
-               private string ReadLink ()
-               {
-                       string r = TryReadLink ();
-                       if (r == null)
-                               UnixMarshal.ThrowExceptionForLastError ();
-                       return r;
-               }
-
-               private string TryReadLink ()
-               {
-                       StringBuilder sb = new StringBuilder ((int) base.Length+1);
-                       int r = Native.Syscall.readlink (FullPath, sb);
-                       if (r == -1)
-                               return null;
-                       return sb.ToString (0, r);
-               }
        }
 }
 
diff --git a/mcs/class/Mono.Posix/Test/Mono.Unix/ReadlinkTest.cs b/mcs/class/Mono.Posix/Test/Mono.Unix/ReadlinkTest.cs
new file mode 100644 (file)
index 0000000..2dd8161
--- /dev/null
@@ -0,0 +1,288 @@
+//
+// readlink() / readlinkat() Test Cases
+//
+// Authors:
+//  Steffen Kiess (s-kiess@web.de)
+//
+// Copyright (C) 2013 Steffen Kiess
+//
+
+using System;
+using System.IO;
+using System.Text;
+
+using Mono.Unix;
+using Mono.Unix.Native;
+
+using NUnit.Framework;
+
+namespace MonoTests.Mono.Unix
+{
+       [TestFixture, Category ("NotDotNet")]
+       public class ReadlinkTest {
+
+               static string[] Targets = {
+                       // Simple test cases
+                       "a",
+                       "test",
+                       // With non-ASCII characters
+                       "ä",
+                       "test Ã¶ test",
+                       // With non-UTF8 bytes
+                       UnixEncoding.Instance.GetString (new byte[] {0xff, 0x80, 0x41, 0x80}),
+                       // Size is roughly initial size of buffer
+                       new string ('a', 255),
+                       new string ('a', 256),
+                       new string ('a', 257),
+                       // With non-ASCII characters, size is roughly initial size of buffer
+                       "ä" + new string ('a', 253), // 254 chars, 255 bytes
+                       "ä" + new string ('a', 254), // 255 chars, 256 bytes
+                       "ä" + new string ('a', 255), // 256 chars, 257 bytes
+                       "ä" + new string ('a', 256), // 257 chars, 258 bytes
+                       new string ('a', 253) + "ä", // 254 chars, 255 bytes
+                       new string ('a', 254) + "ä", // 255 chars, 256 bytes
+                       new string ('a', 255) + "ä", // 256 chars, 257 bytes
+                       new string ('a', 256) + "ä", // 257 chars, 258 bytes
+                       // With non-UTF8 bytes, size is roughly initial size of buffer
+                       "\0\u00ff" + new string ('a', 253), // 255 chars, 254 bytes
+                       "\0\u00ff" + new string ('a', 254), // 256 chars, 255 bytes
+                       "\0\u00ff" + new string ('a', 255), // 257 chars, 256 bytes
+                       "\0\u00ff" + new string ('a', 256), // 258 chars, 257 bytes
+                       new string ('a', 253) + "\0\u00ff", // 255 chars, 254 bytes
+                       new string ('a', 254) + "\0\u00ff", // 256 chars, 255 bytes
+                       new string ('a', 255) + "\0\u00ff", // 257 chars, 256 bytes
+                       new string ('a', 256) + "\0\u00ff", // 258 chars, 257 bytes
+               };
+
+               bool HaveReadlinkAt;
+               string TempFolder;
+               int TempFD;
+
+               [SetUp]
+               public void SetUp ()
+               {
+                       HaveReadlinkAt = false;
+                       try {
+                               Syscall.readlinkat (-1, "", new byte[1]);
+                               HaveReadlinkAt = true;
+                       } catch (EntryPointNotFoundException) {
+                       }
+
+
+                       TempFolder = Path.Combine (Path.GetTempPath (), this.GetType ().FullName);
+
+                       if (Directory.Exists (TempFolder))
+                               //Directory.Delete (TempFolder, true); // Fails for long link target paths
+                               new UnixDirectoryInfo (TempFolder).Delete (true);
+
+                       Directory.CreateDirectory (TempFolder);
+
+                       TempFD = Syscall.open (TempFolder, OpenFlags.O_RDONLY | OpenFlags.O_DIRECTORY);
+                       if (TempFD < 0)
+                               UnixMarshal.ThrowExceptionForLastError ();
+               }
+
+               [TearDown]
+               public void TearDown()
+               {
+                       if (Syscall.close (TempFD) < 0)
+                               UnixMarshal.ThrowExceptionForLastError ();
+
+                       if (Directory.Exists (TempFolder))
+                               //Directory.Delete (TempFolder, true); // Fails for long link target paths
+                               new UnixDirectoryInfo (TempFolder).Delete (true);
+               }
+
+               void CreateLink (string s)
+               {
+                               string link = UnixPath.Combine (TempFolder, "link");
+
+                               //File.Delete (link); // Fails for long link target paths
+                               if (Syscall.unlink (link) < 0 && Stdlib.GetLastError () != Errno.ENOENT)
+                                       UnixMarshal.ThrowExceptionForLastError ();
+
+                               if (Syscall.symlink (s, link) < 0)
+                                       UnixMarshal.ThrowExceptionForLastError ();
+               }
+
+               [Test]
+               public void ReadLink ()
+               {
+                       foreach (string s in Targets) {
+                               string link = UnixPath.Combine (TempFolder, "link");
+
+                               CreateLink (s);
+
+                               var target = UnixPath.ReadLink (link);
+                               Assert.AreEqual (s, target);
+                       }
+               }
+
+               [Test]
+               public void ReadLinkAt ()
+               {
+                       if (!HaveReadlinkAt)
+                               return;
+
+                       foreach (string s in Targets) {
+                               CreateLink (s);
+
+                               var target = UnixPath.ReadLinkAt (TempFD, "link");
+                               Assert.AreEqual (s, target);
+                       }
+               }
+
+               [Test]
+               public void TryReadLink ()
+               {
+                       foreach (string s in Targets) {
+                               string link = UnixPath.Combine (TempFolder, "link");
+
+                               CreateLink (s);
+
+                               var target = UnixPath.TryReadLink (link);
+                               Assert.AreEqual (s, target);
+                       }
+               }
+
+               [Test]
+               public void TryReadLinkAt ()
+               {
+                       if (!HaveReadlinkAt)
+                               return;
+
+                       foreach (string s in Targets) {
+                               CreateLink (s);
+
+                               var target = UnixPath.TryReadLinkAt (TempFD, "link");
+                               Assert.AreEqual (s, target);
+                       }
+               }
+
+               [Test]
+               public void readlink_byte ()
+               {
+                       foreach (string s in Targets) {
+                               string link = UnixPath.Combine (TempFolder, "link");
+
+                               CreateLink (s);
+
+                               string target = null;
+                               byte[] buf = new byte[256];
+                               do {
+                                       long r = Syscall.readlink (link, buf);
+                                       if (r < 0)
+                                               UnixMarshal.ThrowExceptionForLastError ();
+                                       Assert.GreaterOrEqual (buf.Length, r);
+                                       if (r == buf.Length)
+                                               buf = new byte[checked (buf.Length * 2)];
+                                       else
+                                               target = UnixEncoding.Instance.GetString (buf, 0, checked ((int) r));
+                               } while (target == null);
+
+                               Assert.AreEqual (s, target);
+                       }
+               }
+
+               [Test]
+               public void readlinkat_byte ()
+               {
+                       if (!HaveReadlinkAt)
+                               return;
+
+                       foreach (string s in Targets) {
+                               CreateLink (s);
+
+                               string target = null;
+                               byte[] buf = new byte[256];
+                               do {
+                                       long r = Syscall.readlinkat (TempFD, "link", buf);
+                                       if (r < 0)
+                                               UnixMarshal.ThrowExceptionForLastError ();
+                                       Assert.GreaterOrEqual (buf.Length, r);
+                                       if (r == buf.Length)
+                                               buf = new byte[checked (buf.Length * 2)];
+                                       else
+                                               target = UnixEncoding.Instance.GetString (buf, 0, checked ((int) r));
+                               } while (target == null);
+
+                               Assert.AreEqual (s, target);
+                       }
+               }
+
+               [Test]
+               public void readlink_char ()
+               {
+                       foreach (string s in Targets) {
+                               string link = UnixPath.Combine (TempFolder, "link");
+
+                               CreateLink (s);
+
+                               var sb = new StringBuilder (256);
+                               do {
+                                       int oldCapacity = sb.Capacity;
+                                       int r = Syscall.readlink (link, sb);
+                                       Assert.AreEqual (oldCapacity, sb.Capacity);
+                                       if (r < 0)
+                                               UnixMarshal.ThrowExceptionForLastError ();
+                                       Assert.AreEqual (r, sb.Length);
+                                       Assert.GreaterOrEqual (sb.Capacity, r);
+                                       if (r == sb.Capacity)
+                                               checked { sb.Capacity *= 2; }
+                                       else
+                                               break;
+                               } while (true);
+                               var target = sb.ToString ();
+
+                               Assert.AreEqual (s, target);
+                       }
+               }
+
+               [Test]
+               public void readlinkat_char ()
+               {
+                       if (!HaveReadlinkAt)
+                               return;
+
+                       foreach (string s in Targets) {
+                               CreateLink (s);
+
+                               var sb = new StringBuilder (256);
+                               do {
+                                       int oldCapacity = sb.Capacity;
+                                       int r = Syscall.readlinkat (TempFD, "link", sb);
+                                       Assert.AreEqual (oldCapacity, sb.Capacity);
+                                       if (r < 0)
+                                               UnixMarshal.ThrowExceptionForLastError ();
+                                       Assert.AreEqual (r, sb.Length);
+                                       Assert.GreaterOrEqual (sb.Capacity, r);
+                                       if (r == sb.Capacity)
+                                               checked { sb.Capacity *= 2; }
+                                       else
+                                               break;
+                               } while (true);
+                               var target = sb.ToString ();
+
+                               Assert.AreEqual (s, target);
+                       }
+               }
+
+               [Test]
+               public void ReadlinkMultiByteChar ()
+               {
+                       string link = UnixPath.Combine (TempFolder, "link");
+
+                       CreateLink ("á");
+
+                       var sb = new StringBuilder (2);
+                       int res = Syscall.readlink (link, sb);
+                       if (res < 0)
+                               UnixMarshal.ThrowExceptionForLastError ();
+
+                       Assert.AreEqual (res, 2);
+                       Assert.AreEqual (sb.Length, 2);
+                       Assert.AreEqual (sb.Capacity, 2);
+                       Assert.AreEqual (sb.ToString (), "á\u0000");
+               }
+       }
+}
index 947cdc7973dd197d34c47d5dc8814977c2fdf524..6c5d3683ba48a5bff957bec5a83978ef0de8fe4a 100644 (file)
@@ -12,7 +12,7 @@ CLEAN_FILES += $(STRING_MESSAGES)
 EXTRA_DISTFILES = \
        src/ComponentModel/Strings.resx
        
-VALID_PROFILE := $(filter net_4_0 net_4_5 monotouch monodroid, $(PROFILE))
+VALID_PROFILE := $(filter net_4_0 net_4_5 monotouch monodroid mobile_static, $(PROFILE))
 ifndef VALID_PROFILE
 LIBRARY_NAME = dummy-System.ComponentModel.Composition.dll
 NO_INSTALL = yes
index b6ac428a3c86c489c18e30e91a549bd7fb9e782c..c7451bf98fcbc8db42583189263512695e929690 100644 (file)
@@ -1,4 +1,4 @@
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 // -----------------------------------------------------------------------
 // Copyright (c) Microsoft Corporation.  All rights reserved.
 // -----------------------------------------------------------------------
index 9199e0ede3e7e668208f52f954843912789600dd..28c8a94840bfaf9186d44d132c66d289836290d7 100644 (file)
@@ -1,4 +1,4 @@
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 // -----------------------------------------------------------------------
 // Copyright (c) Microsoft Corporation.  All rights reserved.
 // -----------------------------------------------------------------------
index 3ac6fd6859822b45da8ef5d88711090308aa2eb1..e1e7dd5692ec3f302cb6db9de9e73332f1c42e8c 100644 (file)
@@ -32,7 +32,7 @@ namespace System.ComponentModel.Composition
                 {
                     if(!metadataViewType.IsAttributeDefined<MetadataViewImplementationAttribute>())
                     {
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
                         try
                         {
                             proxyType = MetadataViewGenerator.GenerateView(metadataViewType);
@@ -87,7 +87,7 @@ namespace System.ComponentModel.Composition
                 }
                 catch (TargetInvocationException ex)
                 {
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
                     //Unwrap known failures that we want to present as CompositionContractMismatchException
                     if(metadataViewType.IsInterface)
                     {
index 18d81e994bbbafcb3f72deef2e983b23de5b9035..799406c57d7588ba92e7d1ab05e51c7509aeb92c 100644 (file)
@@ -42,7 +42,7 @@ namespace System.ComponentModel.Composition.Primitives
 
         private Type CreateStandardDelegateType()
         {
-#if MONOTOUCH
+#if FULL_AOT_RUNTIME
             throw new NotImplementedException ();
 #else
             ParameterInfo[] parameters = this._method.GetParameters();
index f0f90784e4237aa6f124e821356c9e2de89cdcff..9564b81d88b0fcf436e732a151e8deb00ac5aa09 100644 (file)
@@ -18,7 +18,7 @@ endif
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
 
 # This is a .NET 3.5+ assembly
-VALID_PROFILE := $(filter net_2_0 net_4_0 net_4_5 monotouch monodroid, $(PROFILE))
+VALID_PROFILE := $(filter net_2_0 net_4_0 net_4_5 monotouch monodroid mobile_static, $(PROFILE))
 ifndef VALID_PROFILE
 LIBRARY_NAME = dummy-System.ComponentModel.DataAnnotations.dll
 NO_INSTALL = yes
index 340cde8c78b3db2edd6b31d43d16b15db1ec9f6c..d0d39e121d444721db2ed294526a0a965e530e0d 100644 (file)
@@ -27,6 +27,8 @@
 // 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 !MOBILE
 using System;
 using System.ComponentModel;
 using System.ComponentModel.DataAnnotations;
@@ -77,3 +79,4 @@ namespace MonoTests.System.ComponentModel.DataAnnotations
                }
        }
 }
+#endif
\ No newline at end of file
diff --git a/mcs/class/System.ComponentModel.DataAnnotations/mobile_static_System.ComponentModel.DataAnnotations.dll.sources b/mcs/class/System.ComponentModel.DataAnnotations/mobile_static_System.ComponentModel.DataAnnotations.dll.sources
new file mode 100644 (file)
index 0000000..3de14f5
--- /dev/null
@@ -0,0 +1 @@
+#include net_4_5_System.ComponentModel.DataAnnotations.dll.sources
index 143f57513f47f7ba7c38307bf8729162d48b5d95..03f5f5ee492870bb104c560872620fffbc2e7fe6 100644 (file)
@@ -35,7 +35,9 @@
 
 using System;
 using System.Reflection;
+#if !FULL_AOT_RUNTIME
 using System.Reflection.Emit;
+#endif
 
 namespace System.Linq.Expressions {
 
index 6d6d5dd60eca27dfa7da896d430566048555c914..6b1ba6ced51d3d444726d3f9f10a420398d7a773 100644 (file)
@@ -27,7 +27,9 @@
 //
 
 using System;
+#if !FULL_AOT_RUNTIME
 using System.Reflection.Emit;
+#endif
 
 namespace System.Linq.Expressions {
 
index 38a7b3cab66116f54649681a2016c64a5b4de9af..10dd69ce8f6aaacf4768b62328749ca99a09fad4 100644 (file)
@@ -33,7 +33,9 @@
 
 using System;
 using System.Reflection;
+#if !FULL_AOT_RUNTIME
 using System.Reflection.Emit;
+#endif
 
 namespace System.Linq.Expressions {
 
index 2069927b3066aed4119802c8272b32e1ee243406..b0013419f66ac34c66c551c325d47af42db2054f 100644 (file)
@@ -29,7 +29,9 @@
 using System;
 using System.Collections.ObjectModel;
 using System.Reflection;
+#if !FULL_AOT_RUNTIME
 using System.Reflection.Emit;
+#endif
 
 namespace System.Linq.Expressions {
 
index 8106c60f47d2607cc8ef501c40d95438fc5e6deb..f79156284c2ef6e037613f1117aa09b5d698b815 100644 (file)
@@ -34,7 +34,9 @@ using System.Collections.ObjectModel;
 using System.Globalization;
 using System.Linq;
 using System.Reflection;
+#if !FULL_AOT_RUNTIME
 using System.Reflection.Emit;
+#endif
 
 namespace System.Linq.Expressions {
 
index f8e81498d15d0c104cbea8693d488fafb4d23802..3a44b594c9a7acb0860198da976179c4cec22cfe 100644 (file)
@@ -31,7 +31,7 @@ using System.Collections.ObjectModel;
 
 namespace System.Linq.Expressions {
 
-#if MONOTOUCH
+#if FULL_AOT_RUNTIME
        public
 #endif
        abstract class ExpressionVisitor {
index 0f4eadfd3428136e3ac4df8660c88a9f3a9d6967..3b76fe170e0eb2174e929f59ea3df6ec37f13822 100644 (file)
@@ -29,7 +29,9 @@
 using System;
 using System.Collections.Generic;
 using System.Reflection;
+#if !FULL_AOT_RUNTIME
 using System.Reflection.Emit;
+#endif
 using System.Runtime.CompilerServices;
 
 namespace System.Linq.Expressions {
index 92a40c6d4b7f220bf1591ba48ff3b976b833fd00..6e873b0c9b2d8b12c37a7362b4e0aaa9ff7e6620 100644 (file)
@@ -31,7 +31,10 @@ using System;
 using System.Collections.ObjectModel;
 using System.Collections.Generic;
 using System.Reflection;
+#if !FULL_AOT_RUNTIME
 using System.Reflection.Emit;
+#endif
+
 
 namespace System.Linq.Expressions {
 
@@ -82,7 +85,7 @@ namespace System.Linq.Expressions {
 
                public Delegate Compile ()
                {
-#if TARGET_JVM || MONOTOUCH
+#if FULL_AOT_RUNTIME
                        return new System.Linq.jvm.Runner (this).CreateDelegate ();
 #else
                        var context = new CompilationContext ();
@@ -91,7 +94,7 @@ namespace System.Linq.Expressions {
 #endif
                }
 
-#if TARGET_JVM || MONOTOUCH
+#if FULL_AOT_RUNTIME
                internal Delegate Compile (System.Linq.jvm.ExpressionInterpreter interpreter)
                {
                        return new System.Linq.jvm.Runner (this, interpreter).CreateDelegate ();
index cf58105456810d348056be60d01d7f53ee5c1221..87329224dc215e059fc62116fac6c8b49ed2c34e 100644 (file)
@@ -28,7 +28,9 @@
 
 using System;
 using System.Reflection;
+#if !FULL_AOT_RUNTIME
 using System.Reflection.Emit;
+#endif
 using System.Text;
 
 namespace System.Linq.Expressions {
index bf0c6835c3fb9c351301af610b557d0881cbb1eb..8f6e026eee1d2b042d6c3af2256a72e394515e33 100644 (file)
@@ -28,7 +28,9 @@
 
 using System;
 using System.Reflection;
+#if !FULL_AOT_RUNTIME
 using System.Reflection.Emit;
+#endif
 
 namespace System.Linq.Expressions {
 
index 1a0255f4ea776b9f1fc36d7fc4d2a95919a1cab6..b7483d4fdc4b5db0810c44470e2059b748657f8d 100644 (file)
@@ -28,7 +28,9 @@
 
 using System;
 using System.Reflection;
+#if !FULL_AOT_RUNTIME
 using System.Reflection.Emit;
+#endif
 
 namespace System.Linq.Expressions {
 
index 3c320e63e30a2c4e375287fb3b633507d40caebc..51d16028b4304875e0480773efde79fd46870c2c 100644 (file)
@@ -29,7 +29,9 @@
 using System;
 using System.Collections.ObjectModel;
 using System.Reflection;
+#if !FULL_AOT_RUNTIME
 using System.Reflection.Emit;
+#endif
 
 namespace System.Linq.Expressions {
 
index ec10de5c5266d8fb05bb1d76e9ac076f85b0a61e..414acf3aa6592422b6a37f374491b62dd8ba206d 100644 (file)
@@ -29,7 +29,9 @@
 using System;
 using System.Collections.ObjectModel;
 using System.Reflection;
+#if !FULL_AOT_RUNTIME
 using System.Reflection.Emit;
+#endif
 
 namespace System.Linq.Expressions {
 
index 7f898689c0a796adb10d6fd09d2bab77d2683f2c..0e1e7d7d467e09caf59333b29b0e5b9f1cb8a664 100644 (file)
@@ -29,7 +29,9 @@
 using System;
 using System.Collections.ObjectModel;
 using System.Reflection;
+#if !FULL_AOT_RUNTIME
 using System.Reflection.Emit;
+#endif
 
 namespace System.Linq.Expressions {
 
index c30bec70537a335bae16f82adc8511281d05fd10..68ac8b6d770f16a2b07304030e54ea58a305c0a5 100644 (file)
@@ -30,7 +30,9 @@ using System;
 using System.Collections.ObjectModel;
 using System.Linq;
 using System.Reflection;
+#if !FULL_AOT_RUNTIME
 using System.Reflection.Emit;
+#endif
 
 namespace System.Linq.Expressions {
 
index 005d17569ec8d9c4943cd897e927b59b4bb0973d..48499f3d2e2af27db4b80f7e04ed4c8f675707ef 100644 (file)
@@ -29,7 +29,9 @@
 using System;
 using System.Collections.ObjectModel;
 using System.Reflection;
+#if !FULL_AOT_RUNTIME
 using System.Reflection.Emit;
+#endif
 
 namespace System.Linq.Expressions {
 
index 94bd0ea4475dd02c125aa06473877b73481f9300..3fce527e11cabd51063be272b508c88cc9f6316d 100644 (file)
@@ -28,7 +28,9 @@
 //
 
 using System;
+#if !FULL_AOT_RUNTIME
 using System.Reflection.Emit;
+#endif
 
 namespace System.Linq.Expressions {
 
index 2629c96c4f20e9c94d7198cfd29edbf4434f81a9..77f91e044d49a37e4f9d5b5a06f9aa5d58ea9b75 100644 (file)
@@ -27,7 +27,9 @@
 //
 
 using System;
+#if !FULL_AOT_RUNTIME
 using System.Reflection.Emit;
+#endif
 
 namespace System.Linq.Expressions {
 
index 4f6f9cb890d679651918e0c48e23a76d984df4d8..13a1a5a9b3c372e9a836ab9b4e82e504c1ae0d94 100644 (file)
@@ -28,7 +28,9 @@
 
 using System;
 using System.Reflection;
+#if !FULL_AOT_RUNTIME
 using System.Reflection.Emit;
+#endif
 
 namespace System.Linq.Expressions {
 
index d3c16f4fdef29d289cf79bfbd500806458d9f9c6..637d0c400dffd8384193b9dd29ed72f867654d6c 100644 (file)
@@ -74,6 +74,17 @@ namespace System
                                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,
@@ -130,7 +141,13 @@ namespace System
                        public void GetObjectData (SerializationInfo info, StreamingContext context)
 #endif
                        {
-                               throw new NotImplementedException ();
+                               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);
                        }
 #if NET_4_0
                        void IDeserializationCallback.OnDeserialization (object sender)
@@ -138,7 +155,38 @@ namespace System
                        public void OnDeserialization (object sender)
 #endif
                        {
-                               throw new NotImplementedException ();
+                               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");
                        }
                }
        }
index a914ed19b3d2649b69b83215207bdf3fc1d842a0..d57df150f0554bb1d318dd787d2b71225cc726f6 100644 (file)
@@ -108,6 +108,26 @@ namespace System
                                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,
@@ -190,8 +210,24 @@ namespace System
                        public void GetObjectData (SerializationInfo info, StreamingContext context)
 #endif
                        {
-                               throw new NotImplementedException ();
-                       }
+                               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)
                        {
@@ -216,7 +252,47 @@ namespace System
                        public void OnDeserialization (object sender)
 #endif
                        {
-                               throw new NotImplementedException ();
+                               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 ee440a4bd51daa99e02153f2e065e79b31adc04c..feb1c3e27ce758deb4b70c784e038bfe2f58f8c6 100644 (file)
@@ -598,7 +598,15 @@ namespace System
                public void GetObjectData (SerializationInfo info, StreamingContext context)
 #endif
                {
-                       throw new NotImplementedException ();
+                       if (info == null)
+                               throw new ArgumentNullException ("info");
+                       info.AddValue ("Id", id);
+                       info.AddValue ("DisplayName", displayName);
+                       info.AddValue ("StandardName", standardDisplayName);
+                       info.AddValue ("DaylightName", daylightDisplayName);
+                       info.AddValue ("BaseUtcOffset", baseUtcOffset);
+                       info.AddValue ("AdjustmentRules", adjustmentRules);
+                       info.AddValue ("SupportsDaylightSavingTime", SupportsDaylightSavingTime);
                }
 
                //FIXME: change this to a generic Dictionary and allow caching for FindSystemTimeZoneById
@@ -786,7 +794,54 @@ namespace System
                public void OnDeserialization (object sender)
 #endif
                {
-                       throw new NotImplementedException ();
+                       try {
+                                       TimeZoneInfo.Validate (id, baseUtcOffset, adjustmentRules);
+                               } catch (ArgumentException ex) {
+                                       throw new SerializationException ("invalid serialization data", ex);
+                               }
+               }
+
+               private static void Validate (string id, TimeSpan baseUtcOffset, AdjustmentRule [] adjustmentRules)
+               {
+                       if (id == null)
+                               throw new ArgumentNullException ("id");
+
+                       if (id == String.Empty)
+                               throw new ArgumentException ("id parameter is an empty string");
+
+                       if (baseUtcOffset.Ticks % TimeSpan.TicksPerMinute != 0)
+                               throw new ArgumentException ("baseUtcOffset parameter does not represent a whole number of minutes");
+
+                       if (baseUtcOffset > new TimeSpan (14, 0, 0) || baseUtcOffset < new TimeSpan (-14, 0, 0))
+                               throw new ArgumentOutOfRangeException ("baseUtcOffset parameter is greater than 14 hours or less than -14 hours");
+
+#if STRICT
+                       if (id.Length > 32)
+                               throw new ArgumentException ("id parameter shouldn't be longer than 32 characters");
+#endif
+
+                       if (adjustmentRules != null && adjustmentRules.Length != 0) {
+                               AdjustmentRule prev = null;
+                               foreach (AdjustmentRule current in adjustmentRules) {
+                                       if (current == null)
+                                               throw new InvalidTimeZoneException ("one or more elements in adjustmentRules are null");
+
+                                       if ((baseUtcOffset + current.DaylightDelta < new TimeSpan (-14, 0, 0)) ||
+                                                       (baseUtcOffset + current.DaylightDelta > new TimeSpan (14, 0, 0)))
+                                               throw new InvalidTimeZoneException ("Sum of baseUtcOffset and DaylightDelta of one or more object in adjustmentRules array is greater than 14 or less than -14 hours;");
+
+                                       if (prev != null && prev.DateStart > current.DateStart)
+                                               throw new InvalidTimeZoneException ("adjustment rules specified in adjustmentRules parameter are not in chronological order");
+                                       
+                                       if (prev != null && prev.DateEnd > current.DateStart)
+                                               throw new InvalidTimeZoneException ("some adjustment rules in the adjustmentRules parameter overlap");
+
+                                       if (prev != null && prev.DateEnd == current.DateStart)
+                                               throw new InvalidTimeZoneException ("a date can have multiple adjustment rules applied to it");
+
+                                       prev = current;
+                               }
+                       }
                }
                
                public string ToSerializedString ()
@@ -799,6 +854,19 @@ namespace System
                        return DisplayName;
                }
 
+               private TimeZoneInfo (SerializationInfo info, StreamingContext context)
+               {
+                       if (info == null)
+                               throw new ArgumentNullException ("info");
+                       id = (string) info.GetValue ("Id", typeof (string));
+                       displayName = (string) info.GetValue ("DisplayName", typeof (string));
+                       standardDisplayName = (string) info.GetValue ("StandardName", typeof (string));
+                       daylightDisplayName = (string) info.GetValue ("DaylightName", typeof (string));
+                       baseUtcOffset = (TimeSpan) info.GetValue ("BaseUtcOffset", typeof (TimeSpan));
+                       adjustmentRules = (TimeZoneInfo.AdjustmentRule []) info.GetValue ("AdjustmentRules", typeof (TimeZoneInfo.AdjustmentRule []));
+                       supportsDaylightSavingTime = (bool) info.GetValue ("SupportsDaylightSavingTime", typeof (bool));
+               }
+
                private TimeZoneInfo (string id, TimeSpan baseUtcOffset, string displayName, string standardDisplayName, string daylightDisplayName, TimeZoneInfo.AdjustmentRule [] adjustmentRules, bool disableDaylightSavingTime)
                {
                        if (id == null)
index 2ab978d51876f4e468d375dc9b74b98bd0a4188e..0fe89ea671075b2d1b4cc916ba211cc5bc61f49b 100644 (file)
@@ -163,6 +163,8 @@ namespace MonoTests.System.Linq.Expressions
                }
 
                [Test]
+               // #12987
+               [Category ("MobileNotWorking")]
                public void CoalesceNullableSlotIntoInteger ()
                {
                        var s = Expression.Parameter (typeof (Slot?), "s");
index 6fd2412f9678039dbe10a9fd17437b2989abae87..e9b0d6f1a8e3e8b503c867112e25aa9f028c1bea 100644 (file)
@@ -1,4 +1,6 @@
 using System;
+using System.IO;
+using System.Runtime.Serialization.Formatters.Binary;
 using NUnit.Framework;
 
 #if NET_2_0
@@ -89,7 +91,28 @@ namespace MonoTests.System
                                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);
                        }
-               }       
+               }
+       
+               [TestFixture]
+               public class NonExceptional
+               {
+                       [Test]
+                       public void Serialization_Deserialization ()
+                       {
+                               TimeZoneInfo.TransitionTime start = TimeZoneInfo.TransitionTime.CreateFloatingDateRule (new DateTime (1,1,1,1,0,0), 3, 5, DayOfWeek.Sunday);
+                               TimeZoneInfo.TransitionTime end = TimeZoneInfo.TransitionTime.CreateFloatingDateRule (new DateTime (1,1,1,2,0,0), 10, 5, DayOfWeek.Sunday);
+                               TimeZoneInfo.AdjustmentRule rule = TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (DateTime.MinValue.Date, DateTime.MaxValue.Date, new TimeSpan (1,0,0), start, end);
+                               MemoryStream stream = new MemoryStream ();
+                               BinaryFormatter formatter = new BinaryFormatter ();
+                               formatter.Serialize (stream, rule);
+                               stream.Position = 0;
+                               TimeZoneInfo.AdjustmentRule deserialized = (TimeZoneInfo.AdjustmentRule) formatter.Deserialize (stream);
+                               stream.Close ();
+                               stream.Dispose ();
+
+                               Assert.IsTrue (rule.Equals (deserialized));
+                       }
+               }
        }       
 }
 #endif
index 8dd8263fd223fb82fdb01679173c6c948460538e..38fdac701451664a1f9a7aa9408ab7a82c9d8c51 100644 (file)
@@ -1,5 +1,7 @@
 
 using System;
+using System.IO;
+using System.Runtime.Serialization.Formatters.Binary;
 using NUnit.Framework;
 
 #if NET_2_0
@@ -106,6 +108,34 @@ namespace MonoTests.System
                                Assert.IsFalse (tt2.Equals (tt1), "1!=2");
                                Assert.IsFalse (tt1.Equals (tt2), "2!=1");
                        }
+                       
+                       [Test]
+                       public void Serialize_Deserialize_FloatingDateRule ()
+                       {
+                               TimeZoneInfo.TransitionTime floatingDateRule = TimeZoneInfo.TransitionTime.CreateFloatingDateRule(new DateTime(1, 1, 1, 1, 0, 0), 3, 5, DayOfWeek.Sunday);
+                               MemoryStream stream = new MemoryStream ();
+                               BinaryFormatter formatter = new BinaryFormatter ();
+                               formatter.Serialize (stream, floatingDateRule);
+                               stream.Position = 0;
+                               TimeZoneInfo.TransitionTime deserialized = (TimeZoneInfo.TransitionTime) formatter.Deserialize (stream);
+                               stream.Close ();
+                               stream.Dispose ();
+                               Assert.AreEqual (floatingDateRule, deserialized);
+                       }
+
+                       [Test]
+                       public void Serialize_Deserialize_FixedDateRule ()
+                       {
+                               TimeZoneInfo.TransitionTime fixedDateRule = TimeZoneInfo.TransitionTime.CreateFixedDateRule(new DateTime(1, 1, 1, 1, 0, 0), 3, 12);
+                               MemoryStream stream = new MemoryStream ();
+                               BinaryFormatter formatter = new BinaryFormatter ();
+                               formatter.Serialize (stream, fixedDateRule);
+                               stream.Position = 0;
+                               TimeZoneInfo.TransitionTime deserialized = (TimeZoneInfo.TransitionTime) formatter.Deserialize (stream);
+                               stream.Close ();
+                               stream.Dispose ();
+                               Assert.AreEqual (fixedDateRule, deserialized);
+                       }
                }
        }
 }
index 06de33e9ab7262167833ebc8d6cf178b04c4713f..da26842ead4a0ababb1a9f219cad8fc1e52bb928 100644 (file)
@@ -27,6 +27,8 @@
  */
 
 using System;
+using System.IO;
+using System.Runtime.Serialization.Formatters.Binary;
 using System.Collections;
 
 using NUnit.Framework;
@@ -657,6 +659,27 @@ namespace MonoTests.System
                                Assert.IsTrue (utc.HasSameRules (custom));
                        }
                }
+
+               [TestFixture]
+               public class SerializationTests
+               {
+                       [Test]
+                       public void Serialization_Deserialization ()
+                       {
+                               TimeZoneInfo.TransitionTime start = TimeZoneInfo.TransitionTime.CreateFloatingDateRule (new DateTime (1,1,1,1,0,0), 3, 5, DayOfWeek.Sunday);
+                               TimeZoneInfo.TransitionTime end = TimeZoneInfo.TransitionTime.CreateFloatingDateRule (new DateTime (1,1,1,2,0,0), 10, 5, DayOfWeek.Sunday);
+                               TimeZoneInfo.AdjustmentRule rule = TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (DateTime.MinValue.Date, DateTime.MaxValue.Date, new TimeSpan (1,0,0), start, end);
+                               TimeZoneInfo london = TimeZoneInfo.CreateCustomTimeZone ("Europe/London", new TimeSpan (0), "Europe/London", "British Standard Time", "British Summer Time", new TimeZoneInfo.AdjustmentRule [] {rule});
+                               MemoryStream stream = new MemoryStream ();
+                               BinaryFormatter formatter = new BinaryFormatter ();
+                               formatter.Serialize (stream, london);
+                               stream.Position = 0;
+                               TimeZoneInfo deserialized = (TimeZoneInfo) formatter.Deserialize (stream);
+                               stream.Close ();
+                               stream.Dispose ();
+                               Assert.AreEqual (london, deserialized);
+                       }
+               }
        }
 }
 #endif
diff --git a/mcs/class/System.Core/mobile_static_System.Core.dll.sources b/mcs/class/System.Core/mobile_static_System.Core.dll.sources
new file mode 100644 (file)
index 0000000..55e204a
--- /dev/null
@@ -0,0 +1,7 @@
+#include mobile_System.Core.dll.sources
+#include static_System.Core.dll.sources
+System.Linq.jvm/Conversion.cs
+System.Linq.jvm/ExpressionInterpreter.cs
+System.Linq.jvm/Runner.cs
+System.Linq.jvm/Math.cs
+System/TimeZoneInfo.MonoTouch.cs
diff --git a/mcs/class/System.Data.Services.Client/mobile_static_System.Data.Services.Client.dll.sources b/mcs/class/System.Data.Services.Client/mobile_static_System.Data.Services.Client.dll.sources
new file mode 100644 (file)
index 0000000..37dc299
--- /dev/null
@@ -0,0 +1 @@
+#include net_4_5_System.Data.Services.Client.dll.sources
index b015667e2a174c0be56c1ea56add35aedde74eae..8255e6456d6a582e6f87ddf5142663675f4fa80d 100644 (file)
@@ -31,7 +31,7 @@ LIB_MCS_FLAGS +=      \
        -r:J2SE.Helpers.dll                     \
        $(OTHER_LIB_MCS_FLAGS)
 else 
-MOBILE := $(filter monotouch monodroid mobile, $(PROFILE))
+MOBILE := $(filter monotouch monodroid mobile mobile_static, $(PROFILE))
 ifdef MOBILE
 LIB_MCS_FLAGS += \
        -r:Mono.Data.Tds.dll \
index 29e7b11efc1e3f05e274a1dbc8136a0681672a67..4beb429284e81a5fc21211781e10810a2a121754 100644 (file)
@@ -23,7 +23,9 @@
 using System;
 using System.Collections;
 using System.Reflection;
+#if !FULL_AOT_RUNTIME
 using System.Reflection.Emit;
+#endif
 
 namespace System.Data.Common
 {
index abd8126d092b33d4bda8548c7df89b137dced674..ece2e96518dda786e68703345c8b0c573d1cb355 100644 (file)
@@ -287,7 +287,7 @@ namespace System.Data
                {
                        if (row == null)
                                throw new IndexOutOfRangeException ("The given datarow is not in the current DataRowCollection.");
-                       int index = List.IndexOf (row);
+                       int index = this.IndexOf (row);
                        if (index < 0)
                                throw new IndexOutOfRangeException ("The given datarow is not in the current DataRowCollection.");
                        List.RemoveAt (index);
diff --git a/mcs/class/System.Data/mobile_static_System.Data.dll.sources b/mcs/class/System.Data/mobile_static_System.Data.dll.sources
new file mode 100644 (file)
index 0000000..bbc860b
--- /dev/null
@@ -0,0 +1 @@
+#include mobile_System.Data.dll.sources
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectoryOperationException.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectoryOperationException.cs
new file mode 100644 (file)
index 0000000..915b1ce
--- /dev/null
@@ -0,0 +1,73 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       [Serializable]
+       public class ActiveDirectoryOperationException : Exception, ISerializable
+       {
+               public int ErrorCode {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ActiveDirectoryOperationException (string message, Exception inner, int errorCode) : base(message, inner)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public ActiveDirectoryOperationException (string message, int errorCode) : base(message)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public ActiveDirectoryOperationException (string message, Exception inner) : base(message, inner)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public ActiveDirectoryOperationException (string message) : base(message)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public ActiveDirectoryOperationException () : base("DSUnknownFailure")
+               {
+                       throw new NotImplementedException ();
+               }
+
+               protected ActiveDirectoryOperationException (SerializationInfo info, StreamingContext context) : base(info, context)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)]
+               public override void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)
+               {
+                       throw new NotImplementedException ();
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectoryPartition.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectoryPartition.cs
new file mode 100644 (file)
index 0000000..4b75854
--- /dev/null
@@ -0,0 +1,56 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       public abstract class ActiveDirectoryPartition : IDisposable
+       {
+               public string Name {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               protected ActiveDirectoryPartition ()
+               {
+               }
+
+               public void Dispose ()
+               {
+               }
+
+               protected virtual void Dispose (bool disposing)
+               {
+
+               }
+
+               public override string ToString ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true)]
+               public abstract DirectoryEntry GetDirectoryEntry ();
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectoryReplicationMetadata.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectoryReplicationMetadata.cs
new file mode 100644 (file)
index 0000000..9444827
--- /dev/null
@@ -0,0 +1,58 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       public class ActiveDirectoryReplicationMetadata : DictionaryBase
+       {
+               public AttributeMetadata this [string name] {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ReadOnlyStringCollection AttributeNames {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public AttributeMetadataCollection Values {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool Contains (string attributeName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void CopyTo (AttributeMetadata[] array, int index)
+               {
+                       throw new NotImplementedException ();
+               }
+
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectoryRole.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectoryRole.cs
new file mode 100644 (file)
index 0000000..7ab5c60
--- /dev/null
@@ -0,0 +1,34 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.DirectoryServices.ActiveDirectory
+{
+       public enum ActiveDirectoryRole
+       {
+               SchemaRole,
+               NamingRole,
+               PdcRole,
+               RidRole,
+               InfrastructureRole
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectoryRoleCollection.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectoryRoleCollection.cs
new file mode 100644 (file)
index 0000000..37e35b3
--- /dev/null
@@ -0,0 +1,50 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       public class ActiveDirectoryRoleCollection : ReadOnlyCollectionBase
+       {
+               public ActiveDirectoryRole this [int index] {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool Contains (ActiveDirectoryRole role)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public int IndexOf (ActiveDirectoryRole role)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void CopyTo (ActiveDirectoryRole[] roles, int index)
+               {
+                       throw new NotImplementedException ();
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySchedule.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySchedule.cs
new file mode 100644 (file)
index 0000000..22a38e9
--- /dev/null
@@ -0,0 +1,69 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.DirectoryServices.ActiveDirectory
+{
+       public class ActiveDirectorySchedule
+       {
+               public bool[,,] RawSchedule {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ActiveDirectorySchedule ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public ActiveDirectorySchedule (ActiveDirectorySchedule schedule) : this()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void SetSchedule (DayOfWeek day, HourOfDay fromHour, MinuteOfHour fromMinute, HourOfDay toHour, MinuteOfHour toMinute)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void SetSchedule (DayOfWeek[] days, HourOfDay fromHour, MinuteOfHour fromMinute, HourOfDay toHour, MinuteOfHour toMinute)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void SetDailySchedule (HourOfDay fromHour, MinuteOfHour fromMinute, HourOfDay toHour, MinuteOfHour toMinute)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void ResetSchedule ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySchema.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySchema.cs
new file mode 100644 (file)
index 0000000..a2fdc83
--- /dev/null
@@ -0,0 +1,112 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true)]
+       public class ActiveDirectorySchema : ActiveDirectoryPartition
+       {
+               public DirectoryServer SchemaRoleOwner {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               protected override void Dispose (bool disposing)
+               {
+
+               }
+
+               public static ActiveDirectorySchema GetSchema (DirectoryContext context)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void RefreshSchema ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public ActiveDirectorySchemaClass FindClass (string ldapDisplayName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public ActiveDirectorySchemaClass FindDefunctClass (string commonName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public ReadOnlyActiveDirectorySchemaClassCollection FindAllClasses ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public ReadOnlyActiveDirectorySchemaClassCollection FindAllClasses (SchemaClassType type)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public ReadOnlyActiveDirectorySchemaClassCollection FindAllDefunctClasses ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public ActiveDirectorySchemaProperty FindProperty (string ldapDisplayName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public ActiveDirectorySchemaProperty FindDefunctProperty (string commonName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public ReadOnlyActiveDirectorySchemaPropertyCollection FindAllProperties ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public ReadOnlyActiveDirectorySchemaPropertyCollection FindAllProperties (PropertyTypes type)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public ReadOnlyActiveDirectorySchemaPropertyCollection FindAllDefunctProperties ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+               public override DirectoryEntry GetDirectoryEntry ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public static ActiveDirectorySchema GetCurrentSchema ()
+               {
+                       throw new NotImplementedException ();
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySchemaClass.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySchemaClass.cs
new file mode 100644 (file)
index 0000000..6af613f
--- /dev/null
@@ -0,0 +1,179 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true)]
+       public class ActiveDirectorySchemaClass : IDisposable
+       {
+               public string Name {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public string CommonName {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public string Oid {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public string Description {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool IsDefunct {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ActiveDirectorySchemaClassCollection PossibleSuperiors {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ReadOnlyActiveDirectorySchemaClassCollection PossibleInferiors {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ActiveDirectorySchemaPropertyCollection MandatoryProperties {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ActiveDirectorySchemaPropertyCollection OptionalProperties {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ActiveDirectorySchemaClassCollection AuxiliaryClasses {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ActiveDirectorySchemaClass SubClassOf {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public SchemaClassType Type {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public Guid SchemaGuid {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ActiveDirectorySecurity DefaultObjectSecurityDescriptor {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ActiveDirectorySchemaClass (DirectoryContext context, string ldapDisplayName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void Dispose ()
+               {
+
+               }
+
+               protected virtual void Dispose (bool disposing)
+               {
+
+               }
+
+               public static ActiveDirectorySchemaClass FindByName (DirectoryContext context, string ldapDisplayName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public ReadOnlyActiveDirectorySchemaPropertyCollection GetAllProperties ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void Save ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public override string ToString ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public DirectoryEntry GetDirectoryEntry ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySchemaClassCollection.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySchemaClassCollection.cs
new file mode 100644 (file)
index 0000000..fb30942
--- /dev/null
@@ -0,0 +1,108 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       public class ActiveDirectorySchemaClassCollection : CollectionBase
+       {
+               public ActiveDirectorySchemaClass this [int index] {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public int Add (ActiveDirectorySchemaClass schemaClass)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void AddRange (ActiveDirectorySchemaClass[] schemaClasses)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void AddRange (ActiveDirectorySchemaClassCollection schemaClasses)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void AddRange (ReadOnlyActiveDirectorySchemaClassCollection schemaClasses)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void Remove (ActiveDirectorySchemaClass schemaClass)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void Insert (int index, ActiveDirectorySchemaClass schemaClass)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public bool Contains (ActiveDirectorySchemaClass schemaClass)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void CopyTo (ActiveDirectorySchemaClass[] schemaClasses, int index)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public int IndexOf (ActiveDirectorySchemaClass schemaClass)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               protected override void OnClearComplete ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               protected override void OnInsertComplete (int index, object value)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               protected override void OnRemoveComplete (int index, object value)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               protected override void OnSetComplete (int index, object oldValue, object newValue)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               protected override void OnValidate (object value)
+               {
+                       throw new NotImplementedException ();
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySchemaProperty.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySchemaProperty.cs
new file mode 100644 (file)
index 0000000..8819ec5
--- /dev/null
@@ -0,0 +1,220 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true)]
+       public class ActiveDirectorySchemaProperty : IDisposable
+       {
+               public string Name {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public string CommonName {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public string Oid {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ActiveDirectorySyntax Syntax {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public string Description {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool IsSingleValued {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool IsIndexed {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool IsIndexedOverContainer {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool IsInAnr {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool IsOnTombstonedObject {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool IsTupleIndexed {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool IsInGlobalCatalog {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public int RangeLower {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public int RangeUpper {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool IsDefunct {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ActiveDirectorySchemaProperty Link {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public int? LinkId {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public Guid SchemaGuid {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ActiveDirectorySchemaProperty (DirectoryContext context, string ldapDisplayName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void Dispose ()
+               {
+               }
+
+               protected virtual void Dispose (bool disposing)
+               {
+
+               }
+
+               public static ActiveDirectorySchemaProperty FindByName (DirectoryContext context, string ldapDisplayName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void Save ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public override string ToString ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public DirectoryEntry GetDirectoryEntry ()
+               {
+                       throw new NotImplementedException ();
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySchemaPropertyCollection.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySchemaPropertyCollection.cs
new file mode 100644 (file)
index 0000000..b8721b4
--- /dev/null
@@ -0,0 +1,108 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       public class ActiveDirectorySchemaPropertyCollection : CollectionBase
+       {
+               public ActiveDirectorySchemaProperty this [int index] {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public int Add (ActiveDirectorySchemaProperty schemaProperty)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void AddRange (ActiveDirectorySchemaProperty[] properties)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void AddRange (ActiveDirectorySchemaPropertyCollection properties)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void AddRange (ReadOnlyActiveDirectorySchemaPropertyCollection properties)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void Remove (ActiveDirectorySchemaProperty schemaProperty)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void Insert (int index, ActiveDirectorySchemaProperty schemaProperty)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public bool Contains (ActiveDirectorySchemaProperty schemaProperty)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void CopyTo (ActiveDirectorySchemaProperty[] properties, int index)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public int IndexOf (ActiveDirectorySchemaProperty schemaProperty)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               protected override void OnClearComplete ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               protected override void OnInsertComplete (int index, object value)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               protected override void OnRemoveComplete (int index, object value)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               protected override void OnSetComplete (int index, object oldValue, object newValue)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               protected override void OnValidate (object value)
+               {
+                       throw new NotImplementedException ();
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySecurity.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySecurity.cs
new file mode 100644 (file)
index 0000000..d921144
--- /dev/null
@@ -0,0 +1,147 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.Security.AccessControl;
+using System.Security.Principal;
+
+namespace System.DirectoryServices
+{
+       public class ActiveDirectorySecurity : DirectoryObjectSecurity
+       {
+               public override Type AccessRightType {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public override Type AccessRuleType {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public override Type AuditRuleType {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ActiveDirectorySecurity ()
+               {
+               }
+
+               public void AddAccessRule (ActiveDirectoryAccessRule rule)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void SetAccessRule (ActiveDirectoryAccessRule rule)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void ResetAccessRule (ActiveDirectoryAccessRule rule)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void RemoveAccess (IdentityReference identity, AccessControlType type)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public bool RemoveAccessRule (ActiveDirectoryAccessRule rule)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void RemoveAccessRuleSpecific (ActiveDirectoryAccessRule rule)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public override bool ModifyAccessRule (AccessControlModification modification, AccessRule rule, out bool modified)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public override void PurgeAccessRules (IdentityReference identity)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void AddAuditRule (ActiveDirectoryAuditRule rule)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void SetAuditRule (ActiveDirectoryAuditRule rule)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void RemoveAudit (IdentityReference identity)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public bool RemoveAuditRule (ActiveDirectoryAuditRule rule)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void RemoveAuditRuleSpecific (ActiveDirectoryAuditRule rule)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public override bool ModifyAuditRule (AccessControlModification modification, AuditRule rule, out bool modified)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public override void PurgeAuditRules (IdentityReference identity)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public sealed override AccessRule AccessRuleFactory (IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public sealed override AccessRule AccessRuleFactory (IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type, Guid objectGuid, Guid inheritedObjectGuid)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public sealed override AuditRule AuditRuleFactory (IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public sealed override AuditRule AuditRuleFactory (IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags, Guid objectGuid, Guid inheritedObjectGuid)
+               {
+                       throw new NotImplementedException ();
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySite.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySite.cs
new file mode 100644 (file)
index 0000000..1c03b05
--- /dev/null
@@ -0,0 +1,166 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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;
+using System.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true)]
+       public class ActiveDirectorySite : IDisposable
+       {
+               public string Name {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public DomainCollection Domains {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ActiveDirectorySubnetCollection Subnets {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ReadOnlyDirectoryServerCollection Servers {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ReadOnlySiteCollection AdjacentSites {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ReadOnlySiteLinkCollection SiteLinks {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public DirectoryServer InterSiteTopologyGenerator {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ActiveDirectorySiteOptions Options {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public string Location {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ReadOnlyDirectoryServerCollection BridgeheadServers {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public DirectoryServerCollection PreferredSmtpBridgeheadServers {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public DirectoryServerCollection PreferredRpcBridgeheadServers {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ActiveDirectorySchedule IntraSiteReplicationSchedule {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public static ActiveDirectorySite FindByName (DirectoryContext context, string siteName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public ActiveDirectorySite (DirectoryContext context, string siteName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public static ActiveDirectorySite GetComputerSite ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void Save ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void Delete ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public override string ToString ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public DirectoryEntry GetDirectoryEntry ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void Dispose ()
+               {
+
+               }
+
+               protected virtual void Dispose (bool disposing)
+               {
+
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySiteCollection.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySiteCollection.cs
new file mode 100644 (file)
index 0000000..4df5579
--- /dev/null
@@ -0,0 +1,103 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       public class ActiveDirectorySiteCollection : CollectionBase
+       {
+               public ActiveDirectorySite this [int index] {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public int Add (ActiveDirectorySite site)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void AddRange (ActiveDirectorySite[] sites)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void AddRange (ActiveDirectorySiteCollection sites)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public bool Contains (ActiveDirectorySite site)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void CopyTo (ActiveDirectorySite[] array, int index)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public int IndexOf (ActiveDirectorySite site)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void Insert (int index, ActiveDirectorySite site)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void Remove (ActiveDirectorySite site)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               protected override void OnClearComplete ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               protected override void OnInsertComplete (int index, object value)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               protected override void OnRemoveComplete (int index, object value)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               protected override void OnSetComplete (int index, object oldValue, object newValue)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               protected override void OnValidate (object value)
+               {
+                       throw new NotImplementedException ();
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySiteLink.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySiteLink.cs
new file mode 100644 (file)
index 0000000..0a230d5
--- /dev/null
@@ -0,0 +1,153 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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;
+using System.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true)]
+       public class ActiveDirectorySiteLink : IDisposable
+       {
+               public string Name {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ActiveDirectoryTransportType TransportType {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ActiveDirectorySiteCollection Sites {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public int Cost {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public TimeSpan ReplicationInterval {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool ReciprocalReplicationEnabled {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool NotificationEnabled {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool DataCompressionEnabled {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ActiveDirectorySchedule InterSiteReplicationSchedule {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ActiveDirectorySiteLink (DirectoryContext context, string siteLinkName) : this(context, siteLinkName, ActiveDirectoryTransportType.Rpc, null)
+               {
+               }
+
+               public ActiveDirectorySiteLink (DirectoryContext context, string siteLinkName, ActiveDirectoryTransportType transport) : this(context, siteLinkName, transport, null)
+               {
+               }
+
+               public ActiveDirectorySiteLink (DirectoryContext context, string siteLinkName, ActiveDirectoryTransportType transport, ActiveDirectorySchedule schedule)
+               {
+               }
+
+               public static ActiveDirectorySiteLink FindByName (DirectoryContext context, string siteLinkName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public static ActiveDirectorySiteLink FindByName (DirectoryContext context, string siteLinkName, ActiveDirectoryTransportType transport)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void Save ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void Delete ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public override string ToString ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public DirectoryEntry GetDirectoryEntry ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void Dispose ()
+               {
+               }
+
+               protected virtual void Dispose (bool disposing)
+               {
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySiteOptions.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySiteOptions.cs
new file mode 100644 (file)
index 0000000..4fe9da5
--- /dev/null
@@ -0,0 +1,43 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.DirectoryServices.ActiveDirectory
+{
+       [Flags]
+       public enum ActiveDirectorySiteOptions
+       {
+               None = 0,
+               AutoTopologyDisabled = 1,
+               TopologyCleanupDisabled = 2,
+               AutoMinimumHopDisabled = 4,
+               StaleServerDetectDisabled = 8,
+               AutoInterSiteTopologyDisabled = 16,
+               GroupMembershipCachingEnabled = 32,
+               ForceKccWindows2003Behavior = 64,
+               UseWindows2000IstgElection = 128,
+               RandomBridgeHeaderServerSelectionDisabled = 256,
+               UseHashingForReplicationSchedule = 512,
+               RedundantServerTopologyEnabled = 1024
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySubnet.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySubnet.cs
new file mode 100644 (file)
index 0000000..674aeb5
--- /dev/null
@@ -0,0 +1,98 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true)]
+       public class ActiveDirectorySubnet : IDisposable
+       {
+               public string Name {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ActiveDirectorySite Site {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public string Location {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public static ActiveDirectorySubnet FindByName (DirectoryContext context, string subnetName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public ActiveDirectorySubnet (DirectoryContext context, string subnetName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public ActiveDirectorySubnet (DirectoryContext context, string subnetName, string siteName) : this(context, subnetName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void Save ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void Delete ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public override string ToString ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public DirectoryEntry GetDirectoryEntry ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void Dispose ()
+               {
+
+               }
+
+               protected virtual void Dispose (bool disposing)
+               {
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySubnetCollection.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySubnetCollection.cs
new file mode 100644 (file)
index 0000000..70ed679
--- /dev/null
@@ -0,0 +1,108 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       public class ActiveDirectorySubnetCollection : CollectionBase
+       {
+               public ActiveDirectorySubnet this [int index] {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public int Add (ActiveDirectorySubnet subnet)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void AddRange (ActiveDirectorySubnet[] subnets)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void AddRange (ActiveDirectorySubnetCollection subnets)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public bool Contains (ActiveDirectorySubnet subnet)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void CopyTo (ActiveDirectorySubnet[] array, int index)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public int IndexOf (ActiveDirectorySubnet subnet)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void Insert (int index, ActiveDirectorySubnet subnet)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void Remove (ActiveDirectorySubnet subnet)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               protected override void OnClear ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               protected override void OnClearComplete ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               protected override void OnInsertComplete (int index, object value)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               protected override void OnRemoveComplete (int index, object value)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               protected override void OnSetComplete (int index, object oldValue, object newValue)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               protected override void OnValidate (object value)
+               {
+                       throw new NotImplementedException ();
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySyntax.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectorySyntax.cs
new file mode 100644 (file)
index 0000000..da09d51
--- /dev/null
@@ -0,0 +1,53 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.DirectoryServices.ActiveDirectory
+{
+       public enum ActiveDirectorySyntax
+       {
+               CaseExactString,
+               CaseIgnoreString,
+               NumericString,
+               DirectoryString,
+               OctetString,
+               SecurityDescriptor,
+               Int,
+               Int64,
+               Bool,
+               Oid,
+               GeneralizedTime,
+               UtcTime,
+               DN,
+               DNWithBinary,
+               DNWithString,
+               Enumeration,
+               IA5String,
+               PrintableString,
+               Sid,
+               AccessPointDN,
+               ORName,
+               PresentationAddress,
+               ReplicaLink
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectoryTransportType.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectoryTransportType.cs
new file mode 100644 (file)
index 0000000..a87d384
--- /dev/null
@@ -0,0 +1,31 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.DirectoryServices.ActiveDirectory
+{
+       public enum ActiveDirectoryTransportType
+       {
+               Rpc,
+               Smtp
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ApplicationPartition.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ApplicationPartition.cs
new file mode 100644 (file)
index 0000000..c8910b9
--- /dev/null
@@ -0,0 +1,126 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true)]
+       public class ApplicationPartition : ActiveDirectoryPartition
+       {
+               public DirectoryServerCollection DirectoryServers {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public string SecurityReferenceDomain {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ApplicationPartition (DirectoryContext context, string distinguishedName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public ApplicationPartition (DirectoryContext context, string distinguishedName, string objectClass)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               protected override void Dispose (bool disposing)
+               {
+
+               }
+
+               public static ApplicationPartition GetApplicationPartition (DirectoryContext context)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public static ApplicationPartition FindByName (DirectoryContext context, string distinguishedName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public DirectoryServer FindDirectoryServer ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public DirectoryServer FindDirectoryServer (string siteName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public DirectoryServer FindDirectoryServer (bool forceRediscovery)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public DirectoryServer FindDirectoryServer (string siteName, bool forceRediscovery)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public ReadOnlyDirectoryServerCollection FindAllDirectoryServers ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public ReadOnlyDirectoryServerCollection FindAllDirectoryServers (string siteName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public ReadOnlyDirectoryServerCollection FindAllDiscoverableDirectoryServers ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public ReadOnlyDirectoryServerCollection FindAllDiscoverableDirectoryServers (string siteName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void Delete ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void Save ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+               public override DirectoryEntry GetDirectoryEntry ()
+               {
+                       throw new NotImplementedException ();
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ApplicationPartitionCollection.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ApplicationPartitionCollection.cs
new file mode 100644 (file)
index 0000000..78cae10
--- /dev/null
@@ -0,0 +1,50 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       public class ApplicationPartitionCollection : ReadOnlyCollectionBase
+       {
+               public ApplicationPartition this [int index] {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool Contains (ApplicationPartition applicationPartition)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public int IndexOf (ApplicationPartition applicationPartition)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void CopyTo (ApplicationPartition[] applicationPartitions, int index)
+               {
+                       throw new NotImplementedException ();
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/AttributeMetadata.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/AttributeMetadata.cs
new file mode 100644 (file)
index 0000000..c71b0e4
--- /dev/null
@@ -0,0 +1,73 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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;
+using System.Runtime.InteropServices;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       public class AttributeMetadata
+       {
+               public string Name {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public int Version {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public DateTime LastOriginatingChangeTime {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public Guid LastOriginatingInvocationId {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public long OriginatingChangeUsn {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public long LocalChangeUsn {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public string OriginatingServer {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+               
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/AttributeMetadataCollection.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/AttributeMetadataCollection.cs
new file mode 100644 (file)
index 0000000..d08fd3c
--- /dev/null
@@ -0,0 +1,50 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       public class AttributeMetadataCollection : ReadOnlyCollectionBase
+       {
+               public AttributeMetadata this [int index] {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool Contains (AttributeMetadata metadata)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public int IndexOf (AttributeMetadata metadata)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void CopyTo (AttributeMetadata[] metadata, int index)
+               {
+                       throw new NotImplementedException ();
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/DirectoryContext.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/DirectoryContext.cs
new file mode 100644 (file)
index 0000000..b9129c0
--- /dev/null
@@ -0,0 +1,74 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       [EnvironmentPermission(SecurityAction.Assert, Unrestricted = true)]
+       public class DirectoryContext
+       {
+               public string Name {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public string UserName {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public DirectoryContextType ContextType {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               [DirectoryServicesPermission(SecurityAction.Demand, Unrestricted = true)]
+               public DirectoryContext (DirectoryContextType contextType)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [DirectoryServicesPermission(SecurityAction.Demand, Unrestricted = true)]
+               public DirectoryContext (DirectoryContextType contextType, string name)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [DirectoryServicesPermission(SecurityAction.Demand, Unrestricted = true)]
+               public DirectoryContext (DirectoryContextType contextType, string username, string password)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [DirectoryServicesPermission(SecurityAction.Demand, Unrestricted = true)]
+               public DirectoryContext (DirectoryContextType contextType, string name, string username, string password)
+               {
+                       throw new NotImplementedException ();
+               }
+
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/DirectoryContextType.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/DirectoryContextType.cs
new file mode 100644 (file)
index 0000000..dc25ab9
--- /dev/null
@@ -0,0 +1,34 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.DirectoryServices.ActiveDirectory
+{
+       public enum DirectoryContextType
+       {
+               Domain,
+               Forest,
+               DirectoryServer,
+               ConfigurationSet,
+               ApplicationPartition
+       }
+}
\ No newline at end of file
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/DirectoryServer.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/DirectoryServer.cs
new file mode 100644 (file)
index 0000000..c32a7cd
--- /dev/null
@@ -0,0 +1,131 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true)]
+       public abstract class DirectoryServer : IDisposable
+       {
+               public string Name {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ReadOnlyStringCollection Partitions {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public abstract string IPAddress {
+                       [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+                       get;
+               }
+
+               public abstract string SiteName {
+                       [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+                       get;
+               }
+
+               public abstract SyncUpdateCallback SyncFromAllServersCallback {
+                       [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+                       get;
+                       [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+                       set;
+               }
+
+               public abstract ReplicationConnectionCollection InboundConnections {
+                       [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+                       get;
+               }
+
+               public abstract ReplicationConnectionCollection OutboundConnections {
+                       [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+                       get;
+               }
+
+               internal DirectoryContext Context {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public void Dispose ()
+               {
+
+               }
+
+               protected virtual void Dispose (bool disposing)
+               {
+
+               }
+
+               public override string ToString ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void MoveToAnotherSite (string siteName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public DirectoryEntry GetDirectoryEntry ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+               public abstract void CheckReplicationConsistency ();
+
+               [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+               public abstract ReplicationCursorCollection GetReplicationCursors (string partition);
+
+               [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+               public abstract ReplicationOperationInformation GetReplicationOperationInformation ();
+
+               [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+               public abstract ReplicationNeighborCollection GetReplicationNeighbors (string partition);
+
+               [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+               public abstract ReplicationNeighborCollection GetAllReplicationNeighbors ();
+
+               [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+               public abstract ReplicationFailureCollection GetReplicationConnectionFailures ();
+
+               [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+               public abstract ActiveDirectoryReplicationMetadata GetReplicationMetadata (string objectPath);
+
+               [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+               public abstract void SyncReplicaFromServer (string partition, string sourceServer);
+
+               [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+               public abstract void TriggerSyncReplicaFromNeighbors (string partition);
+
+               [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+               public abstract void SyncReplicaFromAllServers (string partition, SyncFromAllServersOptions options);
+       }
+
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/DirectoryServerCollection.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/DirectoryServerCollection.cs
new file mode 100644 (file)
index 0000000..d5b2fa8
--- /dev/null
@@ -0,0 +1,103 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       public class DirectoryServerCollection : CollectionBase
+       {
+               public DirectoryServer this [int index] {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public int Add (DirectoryServer server)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void AddRange (DirectoryServer[] servers)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public bool Contains (DirectoryServer server)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void CopyTo (DirectoryServer[] array, int index)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public int IndexOf (DirectoryServer server)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void Insert (int index, DirectoryServer server)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void Remove (DirectoryServer server)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               protected override void OnClear ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               protected override void OnClearComplete ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               protected override void OnInsertComplete (int index, object value)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               protected override void OnRemoveComplete (int index, object value)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               protected override void OnSetComplete (int index, object oldValue, object newValue)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               protected override void OnValidate (object value)
+               {
+                       throw new NotImplementedException ();
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/Domain.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/Domain.cs
new file mode 100644 (file)
index 0000000..c35a8f9
--- /dev/null
@@ -0,0 +1,224 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true)]
+       public class Domain : ActiveDirectoryPartition
+       {
+               public Forest Forest {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public DomainControllerCollection DomainControllers {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public DomainCollection Children {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public DomainMode DomainMode {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public Domain Parent {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public DomainController PdcRoleOwner {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public DomainController RidRoleOwner {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public DomainController InfrastructureRoleOwner {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public static Domain GetDomain (DirectoryContext context)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public static Domain GetComputerDomain ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void RaiseDomainFunctionality (DomainMode domainMode)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public DomainController FindDomainController ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public DomainController FindDomainController (string siteName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public DomainController FindDomainController (LocatorOptions flag)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public DomainController FindDomainController (string siteName, LocatorOptions flag)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public DomainControllerCollection FindAllDomainControllers ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public DomainControllerCollection FindAllDomainControllers (string siteName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public DomainControllerCollection FindAllDiscoverableDomainControllers ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public DomainControllerCollection FindAllDiscoverableDomainControllers (string siteName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+               public override DirectoryEntry GetDirectoryEntry ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public TrustRelationshipInformationCollection GetAllTrustRelationships ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public TrustRelationshipInformation GetTrustRelationship (string targetDomainName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public bool GetSelectiveAuthenticationStatus (string targetDomainName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void SetSelectiveAuthenticationStatus (string targetDomainName, bool enable)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public bool GetSidFilteringStatus (string targetDomainName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void SetSidFilteringStatus (string targetDomainName, bool enable)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void DeleteLocalSideOfTrustRelationship (string targetDomainName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void DeleteTrustRelationship (Domain targetDomain)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void VerifyOutboundTrustRelationship (string targetDomainName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void VerifyTrustRelationship (Domain targetDomain, TrustDirection direction)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void CreateLocalSideOfTrustRelationship (string targetDomainName, TrustDirection direction, string trustPassword)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void CreateTrustRelationship (Domain targetDomain, TrustDirection direction)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void UpdateLocalSideOfTrustRelationship (string targetDomainName, string newTrustPassword)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void UpdateLocalSideOfTrustRelationship (string targetDomainName, TrustDirection newTrustDirection, string newTrustPassword)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void UpdateTrustRelationship (Domain targetDomain, TrustDirection newTrustDirection)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void RepairTrustRelationship (Domain targetDomain)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public static Domain GetCurrentDomain ()
+               {
+                       throw new NotImplementedException ();
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/DomainCollection.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/DomainCollection.cs
new file mode 100644 (file)
index 0000000..d6108c9
--- /dev/null
@@ -0,0 +1,50 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       public class DomainCollection : ReadOnlyCollectionBase
+       {
+               public Domain this [int index] {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool Contains (Domain domain)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public int IndexOf (Domain domain)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void CopyTo (Domain[] domains, int index)
+               {
+                       throw new NotImplementedException ();
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/DomainController.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/DomainController.cs
new file mode 100644 (file)
index 0000000..5279b34
--- /dev/null
@@ -0,0 +1,240 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true)]
+       public class DomainController : DirectoryServer
+       {
+               public Forest Forest {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public DateTime CurrentTime {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public long HighestCommittedUsn {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public string OSVersion {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ActiveDirectoryRoleCollection Roles {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public Domain Domain {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public override string IPAddress {
+                       [DnsPermission(SecurityAction.Assert, Unrestricted = true), DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public override string SiteName {
+                       [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public override SyncUpdateCallback SyncFromAllServersCallback {
+                       [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public override ReplicationConnectionCollection InboundConnections {
+                       [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public override ReplicationConnectionCollection OutboundConnections {
+                       [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               protected DomainController ()
+               {
+               }
+
+               protected override void Dispose (bool disposing)
+               {
+                       base.Dispose ();
+
+               }
+
+               public static DomainController GetDomainController (DirectoryContext context)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public static DomainController FindOne (DirectoryContext context)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public static DomainController FindOne (DirectoryContext context, string siteName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public static DomainController FindOne (DirectoryContext context, LocatorOptions flag)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public static DomainController FindOne (DirectoryContext context, string siteName, LocatorOptions flag)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public static DomainControllerCollection FindAll (DirectoryContext context)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public static DomainControllerCollection FindAll (DirectoryContext context, string siteName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+               public virtual GlobalCatalog EnableGlobalCatalog ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+               public virtual bool IsGlobalCatalog ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void TransferRoleOwnership (ActiveDirectoryRole role)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void SeizeRoleOwnership (ActiveDirectoryRole role)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+               public virtual DirectorySearcher GetDirectorySearcher ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+               public override void CheckReplicationConsistency ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+               public override ReplicationCursorCollection GetReplicationCursors (string partition)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+               public override ReplicationOperationInformation GetReplicationOperationInformation ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+               public override ReplicationNeighborCollection GetReplicationNeighbors (string partition)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+               public override ReplicationNeighborCollection GetAllReplicationNeighbors ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+               public override ReplicationFailureCollection GetReplicationConnectionFailures ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+               public override ActiveDirectoryReplicationMetadata GetReplicationMetadata (string objectPath)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+               public override void SyncReplicaFromServer (string partition, string sourceServer)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+               public override void TriggerSyncReplicaFromNeighbors (string partition)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+               public override void SyncReplicaFromAllServers (string partition, SyncFromAllServersOptions options)
+               {
+                       throw new NotImplementedException ();
+               }
+
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/DomainControllerCollection.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/DomainControllerCollection.cs
new file mode 100644 (file)
index 0000000..309854b
--- /dev/null
@@ -0,0 +1,50 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       public class DomainControllerCollection : ReadOnlyCollectionBase
+       {
+               public DomainController this [int index] {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool Contains (DomainController domainController)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public int IndexOf (DomainController domainController)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void CopyTo (DomainController[] domainControllers, int index)
+               {
+                       throw new NotImplementedException ();
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/DomainMode.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/DomainMode.cs
new file mode 100644 (file)
index 0000000..3320386
--- /dev/null
@@ -0,0 +1,35 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.DirectoryServices.ActiveDirectory
+{
+       public enum DomainMode
+       {
+               Windows2000MixedDomain,
+               Windows2000NativeDomain,
+               Windows2003InterimDomain,
+               Windows2003Domain,
+               Windows2008Domain,
+               Windows2008R2Domain
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/Forest.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/Forest.cs
new file mode 100644 (file)
index 0000000..d8ff1f9
--- /dev/null
@@ -0,0 +1,240 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true)]
+       public class Forest : IDisposable
+       {
+               public string Name {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ReadOnlySiteCollection Sites {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public DomainCollection Domains {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public GlobalCatalogCollection GlobalCatalogs {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ApplicationPartitionCollection ApplicationPartitions {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ForestMode ForestMode {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public Domain RootDomain {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ActiveDirectorySchema Schema {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public DomainController SchemaRoleOwner {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public DomainController NamingRoleOwner {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public void Dispose ()
+               {
+                       this.Dispose (true);
+               }
+
+               protected void Dispose (bool disposing)
+               {
+
+               }
+
+               public static Forest GetForest (DirectoryContext context)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void RaiseForestFunctionality (ForestMode forestMode)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public override string ToString ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public GlobalCatalog FindGlobalCatalog ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public GlobalCatalog FindGlobalCatalog (string siteName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public GlobalCatalog FindGlobalCatalog (LocatorOptions flag)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public GlobalCatalog FindGlobalCatalog (string siteName, LocatorOptions flag)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public GlobalCatalogCollection FindAllGlobalCatalogs ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public GlobalCatalogCollection FindAllGlobalCatalogs (string siteName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public GlobalCatalogCollection FindAllDiscoverableGlobalCatalogs ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public GlobalCatalogCollection FindAllDiscoverableGlobalCatalogs (string siteName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public TrustRelationshipInformationCollection GetAllTrustRelationships ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public ForestTrustRelationshipInformation GetTrustRelationship (string targetForestName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public bool GetSelectiveAuthenticationStatus (string targetForestName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void SetSelectiveAuthenticationStatus (string targetForestName, bool enable)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public bool GetSidFilteringStatus (string targetForestName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void SetSidFilteringStatus (string targetForestName, bool enable)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void DeleteLocalSideOfTrustRelationship (string targetForestName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void DeleteTrustRelationship (Forest targetForest)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void VerifyOutboundTrustRelationship (string targetForestName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void VerifyTrustRelationship (Forest targetForest, TrustDirection direction)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void CreateLocalSideOfTrustRelationship (string targetForestName, TrustDirection direction, string trustPassword)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void CreateTrustRelationship (Forest targetForest, TrustDirection direction)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void UpdateLocalSideOfTrustRelationship (string targetForestName, string newTrustPassword)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void UpdateLocalSideOfTrustRelationship (string targetForestName, TrustDirection newTrustDirection, string newTrustPassword)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void UpdateTrustRelationship (Forest targetForest, TrustDirection newTrustDirection)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void RepairTrustRelationship (Forest targetForest)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public static Forest GetCurrentForest ()
+               {
+                       throw new NotImplementedException ();
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ForestMode.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ForestMode.cs
new file mode 100644 (file)
index 0000000..1e1ebeb
--- /dev/null
@@ -0,0 +1,34 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.DirectoryServices.ActiveDirectory
+{
+       public enum ForestMode
+       {
+               Windows2000Forest,
+               Windows2003InterimForest,
+               Windows2003Forest,
+               Windows2008Forest,
+               Windows2008R2Forest
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ForestTrustDomainInfoCollection.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ForestTrustDomainInfoCollection.cs
new file mode 100644 (file)
index 0000000..2761323
--- /dev/null
@@ -0,0 +1,51 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       public class ForestTrustDomainInfoCollection : ReadOnlyCollectionBase
+       {
+               public ForestTrustDomainInformation this [int index] {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool Contains (ForestTrustDomainInformation information)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public int IndexOf (ForestTrustDomainInformation information)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void CopyTo (ForestTrustDomainInformation[] array, int index)
+               {
+                       throw new NotImplementedException ();
+               }
+
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ForestTrustDomainInformation.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ForestTrustDomainInformation.cs
new file mode 100644 (file)
index 0000000..a5cd4b7
--- /dev/null
@@ -0,0 +1,55 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.DirectoryServices.ActiveDirectory
+{
+       public class ForestTrustDomainInformation
+       {
+               public string DnsName {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public string NetBiosName {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public string DomainSid {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ForestTrustDomainStatus Status {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ForestTrustDomainStatus.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ForestTrustDomainStatus.cs
new file mode 100644 (file)
index 0000000..0e0ddad
--- /dev/null
@@ -0,0 +1,35 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.DirectoryServices.ActiveDirectory
+{
+       public enum ForestTrustDomainStatus
+       {
+               Enabled,
+               SidAdminDisabled,
+               SidConflictDisabled,
+               NetBiosNameAdminDisabled = 4,
+               NetBiosNameConflictDisabled = 8
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ForestTrustRelationshipInformation.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ForestTrustRelationshipInformation.cs
new file mode 100644 (file)
index 0000000..e6c72b9
--- /dev/null
@@ -0,0 +1,54 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.Specialized;
+using System.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true)]
+       public class ForestTrustRelationshipInformation : TrustRelationshipInformation
+       {
+               public TopLevelNameCollection TopLevelNames {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public StringCollection ExcludedTopLevelNames {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ForestTrustDomainInfoCollection TrustedDomainInformation {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public void Save ()
+               {
+                       throw new NotImplementedException ();
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/GlobalCatalog.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/GlobalCatalog.cs
new file mode 100644 (file)
index 0000000..c3d816b
--- /dev/null
@@ -0,0 +1,95 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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;
+using System.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true)]
+       public class GlobalCatalog : DomainController
+       {
+               public static GlobalCatalog GetGlobalCatalog (DirectoryContext context)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public new static GlobalCatalog FindOne (DirectoryContext context)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public new static GlobalCatalog FindOne (DirectoryContext context, string siteName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public new static GlobalCatalog FindOne (DirectoryContext context, LocatorOptions flag)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public new static GlobalCatalog FindOne (DirectoryContext context, string siteName, LocatorOptions flag)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public new static GlobalCatalogCollection FindAll (DirectoryContext context)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public new static GlobalCatalogCollection FindAll (DirectoryContext context, string siteName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+               public override GlobalCatalog EnableGlobalCatalog ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public DomainController DisableGlobalCatalog ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+               public override bool IsGlobalCatalog ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public ReadOnlyActiveDirectorySchemaPropertyCollection FindAllProperties ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+               public override DirectorySearcher GetDirectorySearcher ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/GlobalCatalogCollection.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/GlobalCatalogCollection.cs
new file mode 100644 (file)
index 0000000..9725e7e
--- /dev/null
@@ -0,0 +1,51 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       public class GlobalCatalogCollection : ReadOnlyCollectionBase
+       {
+               public GlobalCatalog this [int index] {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool Contains (GlobalCatalog globalCatalog)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public int IndexOf (GlobalCatalog globalCatalog)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void CopyTo (GlobalCatalog[] globalCatalogs, int index)
+               {
+                       throw new NotImplementedException ();
+               }
+
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/HourOfDay.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/HourOfDay.cs
new file mode 100644 (file)
index 0000000..1e1825a
--- /dev/null
@@ -0,0 +1,53 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.DirectoryServices.ActiveDirectory
+{
+       public enum HourOfDay
+       {
+               Zero,    // midnight
+               One,
+               Two,
+               Three,
+               Four,
+               Five,
+               Six,
+               Seven,
+               Eight,
+               Nine,
+               Ten,
+               Eleven,
+               Twelve,
+               Thirteen,
+               Fourteen,
+               Fifteen,
+               Sixteen,
+               Seventeen,
+               Eighteen,
+               Nineteen,
+               Twenty,
+               TwentyOne,
+               TwentyTwo,
+               TwentyThree
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/LocatorOptions.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/LocatorOptions.cs
new file mode 100644 (file)
index 0000000..e4e31dd
--- /dev/null
@@ -0,0 +1,35 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.DirectoryServices.ActiveDirectory
+{
+       [Flags]
+       public enum LocatorOptions : long
+       {
+               ForceRediscovery   =     1L,
+               KdcRequired        =  1024L,
+               TimeServerRequired =  2048L,
+               WriteableRequired  =  4096L,
+               AvoidSelf          = 16384L
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/MinuteOfHour.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/MinuteOfHour.cs
new file mode 100644 (file)
index 0000000..67c3806
--- /dev/null
@@ -0,0 +1,33 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.DirectoryServices.ActiveDirectory
+{
+       public enum MinuteOfHour
+       {
+               Zero,
+               Fifteen = 15,
+               Thirty = 30,
+               FortyFive = 45
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/NotificationStatus.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/NotificationStatus.cs
new file mode 100644 (file)
index 0000000..6bf2c2e
--- /dev/null
@@ -0,0 +1,32 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.DirectoryServices.ActiveDirectory
+{
+       public enum NotificationStatus
+       {
+               NoNotification,
+               IntraSiteOnly,
+               NotificationAlways
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/PropertyTypes.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/PropertyTypes.cs
new file mode 100644 (file)
index 0000000..179075c
--- /dev/null
@@ -0,0 +1,33 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.DirectoryServices.ActiveDirectory
+{
+       [Flags]
+       public enum PropertyTypes
+       {
+               Indexed = 2,
+               InGlobalCatalog = 4
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReadOnlyActiveDirectorySchemaClassCollection.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReadOnlyActiveDirectorySchemaClassCollection.cs
new file mode 100644 (file)
index 0000000..5690994
--- /dev/null
@@ -0,0 +1,50 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       public class ReadOnlyActiveDirectorySchemaClassCollection : ReadOnlyCollectionBase
+       {
+               public ActiveDirectorySchemaClass this [int index] {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool Contains (ActiveDirectorySchemaClass schemaClass)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public int IndexOf (ActiveDirectorySchemaClass schemaClass)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void CopyTo (ActiveDirectorySchemaClass[] classes, int index)
+               {
+                       throw new NotImplementedException ();
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReadOnlyActiveDirectorySchemaPropertyCollection.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReadOnlyActiveDirectorySchemaPropertyCollection.cs
new file mode 100644 (file)
index 0000000..e7ecf7e
--- /dev/null
@@ -0,0 +1,50 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       public class ReadOnlyActiveDirectorySchemaPropertyCollection : ReadOnlyCollectionBase
+       {
+               public ActiveDirectorySchemaProperty this [int index] {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool Contains (ActiveDirectorySchemaProperty schemaProperty)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public int IndexOf (ActiveDirectorySchemaProperty schemaProperty)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void CopyTo (ActiveDirectorySchemaProperty[] properties, int index)
+               {
+                       throw new NotImplementedException ();
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReadOnlyDirectoryServerCollection.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReadOnlyDirectoryServerCollection.cs
new file mode 100644 (file)
index 0000000..a30a4a9
--- /dev/null
@@ -0,0 +1,50 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       public class ReadOnlyDirectoryServerCollection : ReadOnlyCollectionBase
+       {
+               public DirectoryServer this [int index] {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool Contains (DirectoryServer directoryServer)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public int IndexOf (DirectoryServer directoryServer)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void CopyTo (DirectoryServer[] directoryServers, int index)
+               {
+                       throw new NotImplementedException ();
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReadOnlySiteCollection.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReadOnlySiteCollection.cs
new file mode 100644 (file)
index 0000000..52e8e9b
--- /dev/null
@@ -0,0 +1,50 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       public class ReadOnlySiteCollection : ReadOnlyCollectionBase
+       {
+               public ActiveDirectorySite this [int index] {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool Contains (ActiveDirectorySite site)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public int IndexOf (ActiveDirectorySite site)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void CopyTo (ActiveDirectorySite[] sites, int index)
+               {
+                       throw new NotImplementedException ();
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReadOnlySiteLinkCollection.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReadOnlySiteLinkCollection.cs
new file mode 100644 (file)
index 0000000..cef4f67
--- /dev/null
@@ -0,0 +1,50 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       public class ReadOnlySiteLinkCollection : ReadOnlyCollectionBase
+       {
+               public ActiveDirectorySiteLink this [int index] {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool Contains (ActiveDirectorySiteLink link)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public int IndexOf (ActiveDirectorySiteLink link)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void CopyTo (ActiveDirectorySiteLink[] links, int index)
+               {
+                       base.InnerList.CopyTo (links, index);
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReadOnlyStringCollection.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReadOnlyStringCollection.cs
new file mode 100644 (file)
index 0000000..9edd14e
--- /dev/null
@@ -0,0 +1,48 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       public class ReadOnlyStringCollection : ReadOnlyCollectionBase
+       {
+               public string this [int index] {
+                       get { throw new NotImplementedException (); }
+               }
+
+               public bool Contains (string value)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public int IndexOf (string value)
+               {
+                       throw new NotImplementedException ();
+               }
+        
+               public void CopyTo (string[] values, int index)
+               {
+                       throw new NotImplementedException ();
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationConnection.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationConnection.cs
new file mode 100644 (file)
index 0000000..1976330
--- /dev/null
@@ -0,0 +1,181 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.ComponentModel;
+using System.Runtime.InteropServices;
+using System.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true)]
+       public class ReplicationConnection : IDisposable
+       {
+               public string Name {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public string SourceServer {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public string DestinationServer {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool Enabled {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ActiveDirectoryTransportType TransportType {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool GeneratedByKcc {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool ReciprocalReplicationEnabled {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public NotificationStatus ChangeNotificationStatus {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool DataCompressionEnabled {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool ReplicationScheduleOwnedByUser {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ReplicationSpan ReplicationSpan {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ActiveDirectorySchedule ReplicationSchedule {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public static ReplicationConnection FindByName (DirectoryContext context, string name)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public ReplicationConnection (DirectoryContext context, string name, DirectoryServer sourceServer) : this(context, name, sourceServer, null, ActiveDirectoryTransportType.Rpc)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public ReplicationConnection (DirectoryContext context, string name, DirectoryServer sourceServer, ActiveDirectorySchedule schedule) : this(context, name, sourceServer, schedule, ActiveDirectoryTransportType.Rpc)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public ReplicationConnection (DirectoryContext context, string name, DirectoryServer sourceServer, ActiveDirectoryTransportType transport) : this(context, name, sourceServer, null, transport)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public ReplicationConnection (DirectoryContext context, string name, DirectoryServer sourceServer, ActiveDirectorySchedule schedule, ActiveDirectoryTransportType transport)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void Dispose ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               protected virtual void Dispose (bool disposing)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void Delete ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void Save ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public override string ToString ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public DirectoryEntry GetDirectoryEntry ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationConnectionCollection.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationConnectionCollection.cs
new file mode 100644 (file)
index 0000000..b46a2b4
--- /dev/null
@@ -0,0 +1,51 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       public class ReplicationConnectionCollection : ReadOnlyCollectionBase
+       {
+               public ReplicationConnection this [int index] {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool Contains (ReplicationConnection connection)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public int IndexOf (ReplicationConnection connection)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void CopyTo (ReplicationConnection[] connections, int index)
+               {
+                       throw new NotImplementedException ();
+               }
+
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationCursor.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationCursor.cs
new file mode 100644 (file)
index 0000000..7a50391
--- /dev/null
@@ -0,0 +1,60 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.DirectoryServices.ActiveDirectory
+{
+       public class ReplicationCursor
+       {
+               public string PartitionName {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public Guid SourceInvocationId {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public long UpToDatenessUsn {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public string SourceServer {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public DateTime LastSuccessfulSyncTime {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+       }
+}
\ No newline at end of file
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationCursorCollection.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationCursorCollection.cs
new file mode 100644 (file)
index 0000000..d14e35b
--- /dev/null
@@ -0,0 +1,48 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       public class ReplicationCursorCollection : ReadOnlyCollectionBase
+       {
+               public ReplicationCursor this [int index] {
+                       get { throw new NotImplementedException (); }
+               }
+
+               public bool Contains (ReplicationCursor cursor)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public int IndexOf (ReplicationCursor cursor)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void CopyTo (ReplicationCursor[] values, int index)
+               {
+                       throw new NotImplementedException ();
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationFailure.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationFailure.cs
new file mode 100644 (file)
index 0000000..39291b7
--- /dev/null
@@ -0,0 +1,59 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       public class ReplicationFailure
+       {
+               public string SourceServer {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public DateTime FirstFailureTime {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public int ConsecutiveFailureCount {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public int LastErrorCode {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public string LastErrorMessage {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationFailureCollection.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationFailureCollection.cs
new file mode 100644 (file)
index 0000000..4b55b86
--- /dev/null
@@ -0,0 +1,53 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       public class ReplicationFailureCollection : ReadOnlyCollectionBase
+       {
+               public ReplicationFailure this[int index]
+               {
+                       get
+                       {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool Contains(ReplicationFailure failure)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public int IndexOf(ReplicationFailure failure)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void CopyTo(ReplicationFailure[] failures, int index)
+               {
+                       throw new NotImplementedException ();
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationNeighbor.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationNeighbor.cs
new file mode 100644 (file)
index 0000000..a134caa
--- /dev/null
@@ -0,0 +1,122 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       public class ReplicationNeighbor
+       {
+               [Flags]
+               public enum ReplicationNeighborOptions : long
+               {
+                       Writeable = 16L,
+                       SyncOnStartup = 32L,
+                       ScheduledSync = 64L,
+                       UseInterSiteTransport = 128L,
+                       TwoWaySync = 512L,
+                       ReturnObjectParent = 2048L,
+                       FullSyncInProgress = 65536L,
+                       FullSyncNextPacket = 131072L,
+                       NeverSynced = 2097152L,
+                       Preempted = 16777216L,
+                       IgnoreChangeNotifications = 67108864L,
+                       DisableScheduledSync = 134217728L,
+                       CompressChanges = 268435456L,
+                       NoChangeNotifications = 536870912L,
+                       PartialAttributeSet = 1073741824L
+               }
+
+               public string PartitionName {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public string SourceServer {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ActiveDirectoryTransportType TransportType {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ReplicationNeighbor.ReplicationNeighborOptions ReplicationNeighborOption {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public Guid SourceInvocationId {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+               
+               public long UsnLastObjectChangeSynced {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+               
+               public long UsnAttributeFilter {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+               
+               public DateTime LastSuccessfulSync {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+               
+               public DateTime LastAttemptedSync {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+               
+               public int LastSyncResult {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+               
+               public string LastSyncMessage {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public int ConsecutiveFailureCount {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+               
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationNeighborCollection.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationNeighborCollection.cs
new file mode 100644 (file)
index 0000000..aac4f9a
--- /dev/null
@@ -0,0 +1,50 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       public class ReplicationNeighborCollection : ReadOnlyCollectionBase
+       {
+               public ReplicationNeighbor this [int index] {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool Contains (ReplicationNeighbor neighbor)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public int IndexOf (ReplicationNeighbor neighbor)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void CopyTo (ReplicationNeighbor[] neighbors, int index)
+               {
+                       throw new NotImplementedException ();
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationOperation.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationOperation.cs
new file mode 100644 (file)
index 0000000..b5af673
--- /dev/null
@@ -0,0 +1,65 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       public class ReplicationOperation
+       {
+               public DateTime TimeEnqueued {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public int OperationNumber {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public int Priority {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ReplicationOperationType OperationType {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public string PartitionName {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public string SourceServer {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationOperationCollection.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationOperationCollection.cs
new file mode 100644 (file)
index 0000000..a8a1326
--- /dev/null
@@ -0,0 +1,56 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       public class ReplicationOperationCollection : ReadOnlyCollectionBase
+       {
+               public ReplicationOperation this [int index] {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool Contains (ReplicationOperation operation)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public int IndexOf (ReplicationOperation operation)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void CopyTo (ReplicationOperation[] operations, int index)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               private int Add (ReplicationOperation operation)
+               {
+                       throw new NotImplementedException ();
+               }
+
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationOperationInformation.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationOperationInformation.cs
new file mode 100644 (file)
index 0000000..50325a0
--- /dev/null
@@ -0,0 +1,46 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.DirectoryServices.ActiveDirectory
+{
+       public class ReplicationOperationInformation
+       {
+               public DateTime OperationStartTime {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ReplicationOperation CurrentOperation {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ReplicationOperationCollection PendingOperations {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationOperationType.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationOperationType.cs
new file mode 100644 (file)
index 0000000..52c3790
--- /dev/null
@@ -0,0 +1,34 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.DirectoryServices.ActiveDirectory
+{
+       public enum ReplicationOperationType
+       {
+               Sync,
+               Add,
+               Delete,
+               Modify,
+               UpdateReference
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationSpan.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ReplicationSpan.cs
new file mode 100644 (file)
index 0000000..fb59672
--- /dev/null
@@ -0,0 +1,31 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.DirectoryServices.ActiveDirectory
+{
+       public enum ReplicationSpan
+       {
+               IntraSite,
+               InterSite
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/SchemaClassType.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/SchemaClassType.cs
new file mode 100644 (file)
index 0000000..0583790
--- /dev/null
@@ -0,0 +1,33 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.DirectoryServices.ActiveDirectory
+{
+       public enum SchemaClassType
+       {
+               Type88,
+               Structural,
+               Abstract,
+               Auxiliary
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/SyncFromAllServersErrorCategory.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/SyncFromAllServersErrorCategory.cs
new file mode 100644 (file)
index 0000000..cc1c762
--- /dev/null
@@ -0,0 +1,32 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.DirectoryServices.ActiveDirectory
+{
+       public enum SyncFromAllServersErrorCategory
+       {
+               ErrorContactingServer,
+               ErrorReplicating,
+               ServerUnreachable
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/SyncFromAllServersErrorInformation.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/SyncFromAllServersErrorInformation.cs
new file mode 100644 (file)
index 0000000..4d97002
--- /dev/null
@@ -0,0 +1,59 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.DirectoryServices.ActiveDirectory
+{
+       public class SyncFromAllServersErrorInformation
+       {
+               public SyncFromAllServersErrorCategory ErrorCategory {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public int ErrorCode {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public string ErrorMessage {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public string TargetServer {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public string SourceServer {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/SyncFromAllServersEvent.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/SyncFromAllServersEvent.cs
new file mode 100644 (file)
index 0000000..0369dcb
--- /dev/null
@@ -0,0 +1,33 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.DirectoryServices.ActiveDirectory
+{
+       public enum SyncFromAllServersEvent
+       {
+               Error,
+               SyncStarted,
+               SyncCompleted,
+               Finished
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/SyncFromAllServersOperationException.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/SyncFromAllServersOperationException.cs
new file mode 100644 (file)
index 0000000..16d2544
--- /dev/null
@@ -0,0 +1,68 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       [Serializable]
+       public class SyncFromAllServersOperationException : ActiveDirectoryOperationException, ISerializable
+       {
+               public SyncFromAllServersErrorInformation[] ErrorInformation {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public SyncFromAllServersOperationException (string message, Exception inner, SyncFromAllServersErrorInformation[] errors) : base(message, inner)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public SyncFromAllServersOperationException (string message, Exception inner) : base(message, inner)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public SyncFromAllServersOperationException (string message) : base(message)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public SyncFromAllServersOperationException () : base("DSSyncAllFailure")
+               {
+                       throw new NotImplementedException ();
+               }
+
+               protected SyncFromAllServersOperationException (SerializationInfo info, StreamingContext context) : base(info, context)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)]
+               public override void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)
+               {
+                       throw new NotImplementedException ();
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/SyncFromAllServersOptions.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/SyncFromAllServersOptions.cs
new file mode 100644 (file)
index 0000000..e00ef1a
--- /dev/null
@@ -0,0 +1,37 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.DirectoryServices.ActiveDirectory
+{
+       [Flags]
+       public enum SyncFromAllServersOptions
+       {
+               None = 0,
+               AbortIfServerUnavailable = 1,
+               SyncAdjacentServerOnly = 2,
+               CheckServerAlivenessOnly = 8,
+               SkipInitialCheck = 16,
+               PushChangeOutward = 32, 
+               CrossSite = 64
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/SyncUpdateCallback.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/SyncUpdateCallback.cs
new file mode 100644 (file)
index 0000000..a9546fe
--- /dev/null
@@ -0,0 +1,28 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.DirectoryServices.ActiveDirectory
+{
+       public delegate bool SyncUpdateCallback(SyncFromAllServersEvent eventType, string targetServer, string sourceServer, SyncFromAllServersOperationException exception);
+}
\ No newline at end of file
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/TopLevelName.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/TopLevelName.cs
new file mode 100644 (file)
index 0000000..f3e9663
--- /dev/null
@@ -0,0 +1,43 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.DirectoryServices.ActiveDirectory
+{
+       public class TopLevelName
+       {
+               public string Name {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public TopLevelNameStatus Status {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/TopLevelNameCollection.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/TopLevelNameCollection.cs
new file mode 100644 (file)
index 0000000..709212a
--- /dev/null
@@ -0,0 +1,50 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       public class TopLevelNameCollection : ReadOnlyCollectionBase
+       {
+               public TopLevelName this [int index] {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool Contains (TopLevelName name)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public int IndexOf (TopLevelName name)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void CopyTo (TopLevelName[] names, int index)
+               {
+                       throw new NotImplementedException ();
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/TopLevelNameStatus.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/TopLevelNameStatus.cs
new file mode 100644 (file)
index 0000000..36cf61d
--- /dev/null
@@ -0,0 +1,34 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.DirectoryServices.ActiveDirectory
+{
+       public enum TopLevelNameStatus
+       {
+               Enabled,
+               NewlyCreated,
+               AdminDisabled,
+               ConflictDisabled = 4
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/TrustDirection.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/TrustDirection.cs
new file mode 100644 (file)
index 0000000..ca67864
--- /dev/null
@@ -0,0 +1,33 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.DirectoryServices.ActiveDirectory
+{
+       public enum TrustDirection
+       {
+               Inbound = 1,
+               Outbound,
+               Bidirectional
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/TrustRelationshipInformation.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/TrustRelationshipInformation.cs
new file mode 100644 (file)
index 0000000..4dfcbb2
--- /dev/null
@@ -0,0 +1,52 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.DirectoryServices.ActiveDirectory
+{
+       public class TrustRelationshipInformation
+       {
+               public string SourceName {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public string TargetName {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public TrustType TrustType {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public TrustDirection TrustDirection {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/TrustRelationshipInformationCollection.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/TrustRelationshipInformationCollection.cs
new file mode 100644 (file)
index 0000000..39dfff9
--- /dev/null
@@ -0,0 +1,50 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       public class TrustRelationshipInformationCollection : ReadOnlyCollectionBase
+       {
+               public TrustRelationshipInformation this [int index] {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool Contains (TrustRelationshipInformation information)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public int IndexOf (TrustRelationshipInformation information)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void CopyTo (TrustRelationshipInformation[] array, int index)
+               {
+                       throw new NotImplementedException ();
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/TrustType.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/TrustType.cs
new file mode 100644 (file)
index 0000000..659733a
--- /dev/null
@@ -0,0 +1,37 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.DirectoryServices.ActiveDirectory
+{
+       public enum TrustType
+       {
+               TreeRoot,
+               ParentChild,
+               CrossLink,
+               External,
+               Forest,
+               Kerberos,
+               Unknown
+       }
+}
index 6dfe68caae189aa2d734dd2a589636940b6449bb..85bb6ec9965a9059c85cbd80bb87f2bf40f9370e 100644 (file)
@@ -1,6 +1,10 @@
 Assembly/AssemblyInfo.cs
 ../../build/common/Consts.cs.in
 ../../build/common/Locale.cs
+System.DirectoryServices/ActiveDirectoryAccessRule.cs
+System.DirectoryServices/ActiveDirectoryAuditRule.cs
+System.DirectoryServices/ActiveDirectoryRights.cs
+System.DirectoryServices/ActiveDirectorySecurityInheritance.cs
 System.DirectoryServices/AuthenticationTypes.cs
 System.DirectoryServices/DirectoryEntries.cs
 System.DirectoryServices/DirectoryEntry.cs
@@ -24,3 +28,82 @@ System.DirectoryServices/SortDirection.cs
 System.DirectoryServices/SortOption.cs
 ../../build/common/MonoTODOAttribute.cs
 System.DirectoryServices.Design/DirectoryEntryConverter.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectoryOperationException.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectoryPartition.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectoryReplicationMetadata.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectoryRole.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectoryRoleCollection.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectorySchedule.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectorySchema.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectorySchemaClass.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectorySchemaClassCollection.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectorySchemaProperty.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectorySchemaPropertyCollection.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectorySecurity.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectorySite.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectorySiteCollection.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectorySiteLink.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectorySiteOptions.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectorySubnet.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectorySubnetCollection.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectorySyntax.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectoryTransportType.cs
+System.DirectoryServices.ActiveDirectory/ApplicationPartition.cs
+System.DirectoryServices.ActiveDirectory/ApplicationPartitionCollection.cs
+System.DirectoryServices.ActiveDirectory/AttributeMetadata.cs
+System.DirectoryServices.ActiveDirectory/AttributeMetadataCollection.cs
+System.DirectoryServices.ActiveDirectory/DirectoryContext.cs
+System.DirectoryServices.ActiveDirectory/DirectoryContextType.cs
+System.DirectoryServices.ActiveDirectory/DirectoryServer.cs
+System.DirectoryServices.ActiveDirectory/DirectoryServerCollection.cs
+System.DirectoryServices.ActiveDirectory/Domain.cs
+System.DirectoryServices.ActiveDirectory/DomainCollection.cs
+System.DirectoryServices.ActiveDirectory/DomainController.cs
+System.DirectoryServices.ActiveDirectory/DomainControllerCollection.cs
+System.DirectoryServices.ActiveDirectory/DomainMode.cs
+System.DirectoryServices.ActiveDirectory/Forest.cs
+System.DirectoryServices.ActiveDirectory/ForestMode.cs
+System.DirectoryServices.ActiveDirectory/ForestTrustDomainInformation.cs
+System.DirectoryServices.ActiveDirectory/ForestTrustDomainInfoCollection.cs
+System.DirectoryServices.ActiveDirectory/ForestTrustDomainStatus.cs
+System.DirectoryServices.ActiveDirectory/ForestTrustRelationshipInformation.cs
+System.DirectoryServices.ActiveDirectory/GlobalCatalog.cs
+System.DirectoryServices.ActiveDirectory/GlobalCatalogCollection.cs
+System.DirectoryServices.ActiveDirectory/HourOfDay.cs
+System.DirectoryServices.ActiveDirectory/LocatorOptions.cs
+System.DirectoryServices.ActiveDirectory/MinuteOfHour.cs
+System.DirectoryServices.ActiveDirectory/NotificationStatus.cs
+System.DirectoryServices.ActiveDirectory/PropertyTypes.cs
+System.DirectoryServices.ActiveDirectory/ReadOnlyActiveDirectorySchemaClassCollection.cs
+System.DirectoryServices.ActiveDirectory/ReadOnlyActiveDirectorySchemaPropertyCollection.cs
+System.DirectoryServices.ActiveDirectory/ReadOnlyDirectoryServerCollection.cs
+System.DirectoryServices.ActiveDirectory/ReadOnlySiteCollection.cs
+System.DirectoryServices.ActiveDirectory/ReadOnlySiteLinkCollection.cs
+System.DirectoryServices.ActiveDirectory/ReadOnlyStringCollection.cs
+System.DirectoryServices.ActiveDirectory/ReplicationConnection.cs
+System.DirectoryServices.ActiveDirectory/ReplicationConnectionCollection.cs
+System.DirectoryServices.ActiveDirectory/ReplicationCursor.cs
+System.DirectoryServices.ActiveDirectory/ReplicationCursorCollection.cs
+System.DirectoryServices.ActiveDirectory/ReplicationFailure.cs
+System.DirectoryServices.ActiveDirectory/ReplicationFailureCollection.cs
+System.DirectoryServices.ActiveDirectory/ReplicationNeighbor.cs
+System.DirectoryServices.ActiveDirectory/ReplicationNeighborCollection.cs
+System.DirectoryServices.ActiveDirectory/ReplicationOperation.cs
+System.DirectoryServices.ActiveDirectory/ReplicationOperationCollection.cs
+System.DirectoryServices.ActiveDirectory/ReplicationOperationInformation.cs
+System.DirectoryServices.ActiveDirectory/ReplicationOperationType.cs
+System.DirectoryServices.ActiveDirectory/ReplicationSpan.cs
+System.DirectoryServices.ActiveDirectory/SchemaClassType.cs
+System.DirectoryServices.ActiveDirectory/SyncFromAllServersErrorCategory.cs
+System.DirectoryServices.ActiveDirectory/SyncFromAllServersErrorInformation.cs
+System.DirectoryServices.ActiveDirectory/SyncFromAllServersEvent.cs
+System.DirectoryServices.ActiveDirectory/SyncFromAllServersOperationException.cs
+System.DirectoryServices.ActiveDirectory/SyncFromAllServersOptions.cs
+System.DirectoryServices.ActiveDirectory/SyncUpdateCallback.cs
+System.DirectoryServices.ActiveDirectory/TopLevelName.cs
+System.DirectoryServices.ActiveDirectory/TopLevelNameCollection.cs
+System.DirectoryServices.ActiveDirectory/TopLevelNameStatus.cs
+System.DirectoryServices.ActiveDirectory/TrustDirection.cs
+System.DirectoryServices.ActiveDirectory/TrustRelationshipInformation.cs
+System.DirectoryServices.ActiveDirectory/TrustRelationshipInformationCollection.cs
+System.DirectoryServices.ActiveDirectory/TrustType.cs
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices/ActiveDirectoryAccessRule.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices/ActiveDirectoryAccessRule.cs
new file mode 100644 (file)
index 0000000..9c85473
--- /dev/null
@@ -0,0 +1,75 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.Security.AccessControl;
+using System.Security.Principal;
+
+namespace System.DirectoryServices
+{
+       public class ActiveDirectoryAccessRule : ObjectAccessRule
+       {
+               public ActiveDirectoryRights ActiveDirectoryRights
+               {
+                       get
+                       {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ActiveDirectorySecurityInheritance InheritanceType
+               {
+                       get
+                       {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ActiveDirectoryAccessRule(IdentityReference identity, ActiveDirectoryRights adRights, AccessControlType type) : this(identity, (int)adRights, type, Guid.Empty, false, InheritanceFlags.None, PropagationFlags.None, Guid.Empty)
+               {
+               }
+
+               public ActiveDirectoryAccessRule(IdentityReference identity, ActiveDirectoryRights adRights, AccessControlType type, Guid objectType) : this(identity, (int)adRights, type, objectType, false, InheritanceFlags.None, PropagationFlags.None, Guid.Empty)
+               {
+               }
+
+               public ActiveDirectoryAccessRule(IdentityReference identity, ActiveDirectoryRights adRights, AccessControlType type, ActiveDirectorySecurityInheritance inheritanceType) : this(identity, (int)adRights, type, Guid.Empty, false, InheritanceFlags.None, PropagationFlags.None, Guid.Empty)
+               {
+               }
+
+               public ActiveDirectoryAccessRule(IdentityReference identity, ActiveDirectoryRights adRights, AccessControlType type, Guid objectType, ActiveDirectorySecurityInheritance inheritanceType) : this(identity, (int)adRights, type, objectType, false, InheritanceFlags.None, PropagationFlags.None, Guid.Empty)
+               {
+               }
+
+               public ActiveDirectoryAccessRule(IdentityReference identity, ActiveDirectoryRights adRights, AccessControlType type, ActiveDirectorySecurityInheritance inheritanceType, Guid inheritedObjectType) : this(identity, (int)adRights, type, Guid.Empty, false, InheritanceFlags.None, PropagationFlags.None, inheritedObjectType)
+               {
+               }
+
+               public ActiveDirectoryAccessRule(IdentityReference identity, ActiveDirectoryRights adRights, AccessControlType type, Guid objectType, ActiveDirectorySecurityInheritance inheritanceType, Guid inheritedObjectType) : this(identity, (int)adRights, type, objectType, false, InheritanceFlags.None, PropagationFlags.None, inheritedObjectType)
+               {
+               }
+
+               internal ActiveDirectoryAccessRule(IdentityReference identity, int accessMask, AccessControlType type, Guid objectType, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, Guid inheritedObjectType) : base(identity, accessMask, isInherited, inheritanceFlags, propagationFlags, objectType, inheritedObjectType, type)
+               {
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices/ActiveDirectoryAuditRule.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices/ActiveDirectoryAuditRule.cs
new file mode 100644 (file)
index 0000000..879ed08
--- /dev/null
@@ -0,0 +1,75 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.Security.AccessControl;
+using System.Security.Principal;
+
+namespace System.DirectoryServices
+{
+       public class ActiveDirectoryAuditRule : ObjectAuditRule
+       {
+               public ActiveDirectoryRights ActiveDirectoryRights
+               {
+                       get
+                       {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ActiveDirectorySecurityInheritance InheritanceType
+               {
+                       get
+                       {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public ActiveDirectoryAuditRule(IdentityReference identity, ActiveDirectoryRights adRights, AuditFlags auditFlags) : this(identity, (int)adRights, auditFlags, Guid.Empty, false, InheritanceFlags.None, PropagationFlags.None, Guid.Empty)
+               {
+               }
+
+               public ActiveDirectoryAuditRule(IdentityReference identity, ActiveDirectoryRights adRights, AuditFlags auditFlags, Guid objectType) : this(identity, (int)adRights, auditFlags, objectType, false, InheritanceFlags.None, PropagationFlags.None, Guid.Empty)
+               {
+               }
+
+               public ActiveDirectoryAuditRule(IdentityReference identity, ActiveDirectoryRights adRights, AuditFlags auditFlags, ActiveDirectorySecurityInheritance inheritanceType) : this(identity, (int)adRights, auditFlags, Guid.Empty, false, InheritanceFlags.None, PropagationFlags.None, Guid.Empty)
+               {
+               }
+
+               public ActiveDirectoryAuditRule(IdentityReference identity, ActiveDirectoryRights adRights, AuditFlags auditFlags, Guid objectType, ActiveDirectorySecurityInheritance inheritanceType) : this(identity, (int)adRights, auditFlags, objectType, false, InheritanceFlags.None, PropagationFlags.None, Guid.Empty)
+               {
+               }
+
+               public ActiveDirectoryAuditRule(IdentityReference identity, ActiveDirectoryRights adRights, AuditFlags auditFlags, ActiveDirectorySecurityInheritance inheritanceType, Guid inheritedObjectType) : this(identity, (int)adRights, auditFlags, Guid.Empty, false, InheritanceFlags.None, PropagationFlags.None, inheritedObjectType)
+               {
+               }
+
+               public ActiveDirectoryAuditRule(IdentityReference identity, ActiveDirectoryRights adRights, AuditFlags auditFlags, Guid objectType, ActiveDirectorySecurityInheritance inheritanceType, Guid inheritedObjectType) : this(identity, (int)adRights, auditFlags, objectType, false, InheritanceFlags.None, PropagationFlags.None, inheritedObjectType)
+               {
+               }
+
+               internal ActiveDirectoryAuditRule(IdentityReference identity, int accessMask, AuditFlags auditFlags, Guid objectGuid, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, Guid inheritedObjectType) : base(identity, accessMask, isInherited, inheritanceFlags, propagationFlags, objectGuid, inheritedObjectType, auditFlags)
+               {
+               }
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices/ActiveDirectoryRights.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices/ActiveDirectoryRights.cs
new file mode 100644 (file)
index 0000000..d8c994e
--- /dev/null
@@ -0,0 +1,50 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.DirectoryServices
+{
+       [Flags]
+       public enum ActiveDirectoryRights
+       {
+               Delete = 65536,
+               ReadControl = 131072,
+               WriteDacl = 262144,
+               WriteOwner = 524288,
+               Synchronize = 1048576,
+               AccessSystemSecurity = 16777216,
+               GenericRead = 131220,
+               GenericWrite = 131112,
+               GenericExecute = 131076,
+               GenericAll = 983551,
+               CreateChild = 1,
+               DeleteChild = 2,
+               ListChildren = 4,
+               Self = 8,
+               ReadProperty = 16,
+               WriteProperty = 32,
+               DeleteTree = 64,
+               ListObject = 128,
+               ExtendedRight = 256
+       }
+}
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices/ActiveDirectorySecurityInheritance.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices/ActiveDirectorySecurityInheritance.cs
new file mode 100644 (file)
index 0000000..6853871
--- /dev/null
@@ -0,0 +1,35 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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.DirectoryServices
+{
+       public enum ActiveDirectorySecurityInheritance
+       {
+               None,
+               All,
+               Descendents,
+               SelfAndChildren,
+               Children
+       }
+}
index 98225b9818991dad733f8a84b95010b276e5a385..a4d1ae275b478decfcf16103b66b7d4819a6e461 100644 (file)
@@ -394,7 +394,7 @@ namespace System.Net.Http.Headers
 
                        switch (t.Kind) {
                        case Token.Type.SeparatorSemicolon:
-                               if (!NameValueHeaderValue.ParseParameters (lexer, out parameters))
+                               if (!NameValueHeaderValue.TryParseParameters (lexer, out parameters))
                                        return false;
                                break;
                        case Token.Type.End:
index abbd7464f2ff9c12d1c6d3597f1a414f7c94700e..3772180e52bc0ea9f617d6c522cf4df995bac762 100644 (file)
@@ -50,7 +50,12 @@ namespace System.Net.Http.Headers
                                Debug.Assert (AllowsMany);
 
                                var c = (HttpHeaderValueCollection<U>) collection;
-                               c.Add ((U) value);
+
+                               var list = value as List<U>;
+                               if (list != null)
+                                       c.AddRange (list);
+                               else
+                                       c.Add ((U) value);
                        }
 
                        protected override object CreateCollection (HttpHeaders headers, HeaderInfo headerInfo)
@@ -106,6 +111,13 @@ namespace System.Net.Http.Headers
                        };
                }
 
+               public static HeaderInfo CreateMultiList<T> (string name, TryParseDelegate<List<T>> parser, HttpHeaderKind headerKind) where T : class
+               {
+                       return new HeaderTypeInfo<List<T>, T> (name, parser, headerKind) {
+                               AllowsMany = true,
+                       };
+               }
+
                public object CreateCollection (HttpHeaders headers)
                {
                        return CreateCollection (headers, this);
index e929c599a77cdeffe3dc24daaea2892773e18ba9..fb024ed81b89be2390499ed354e46600abad63bc 100644 (file)
@@ -61,6 +61,11 @@ namespace System.Net.Http.Headers
                        list.Add (item);
                }
 
+               internal void AddRange (List<T> values)
+               {
+                       list.AddRange (values);
+               }
+
                public void Clear ()
                {
                        list.Clear ();
index 55ef3c7fa8bd566e34d3abc513096939f79c0a6c..567638e56dd46ed8251ec00157123860fc1ebd93 100644 (file)
@@ -117,7 +117,7 @@ namespace System.Net.Http.Headers
                                HeaderInfo.CreateSingle<DateTimeOffset> ("Last-Modified", Parser.DateTime.TryParse, HttpHeaderKind.Content),
                                HeaderInfo.CreateSingle<Uri> ("Location", Parser.Uri.TryParse, HttpHeaderKind.Response),
                                HeaderInfo.CreateSingle<int> ("Max-Forwards", Parser.Int.TryParse, HttpHeaderKind.Request),
-                               HeaderInfo.CreateMulti<NameValueHeaderValue> ("Pragma", NameValueHeaderValue.TryParse, HttpHeaderKind.Request | HttpHeaderKind.Response),
+                               HeaderInfo.CreateMultiList<NameValueHeaderValue> ("Pragma", NameValueHeaderValue.TryParsePragma, HttpHeaderKind.Request | HttpHeaderKind.Response),
                                HeaderInfo.CreateMulti<AuthenticationHeaderValue> ("Proxy-Authenticate", AuthenticationHeaderValue.TryParse, HttpHeaderKind.Response),
                                HeaderInfo.CreateSingle<AuthenticationHeaderValue> ("Proxy-Authorization", AuthenticationHeaderValue.TryParse, HttpHeaderKind.Request),
                                HeaderInfo.CreateSingle<RangeHeaderValue> ("Range", RangeHeaderValue.TryParse, HttpHeaderKind.Request),
index 042fa7cd2dca2c1e6046f1912e890c4078a8a655..5379a6099f19716205de8555eef03b4b1723c293 100644 (file)
@@ -150,7 +150,7 @@ namespace System.Net.Http.Headers
 
                        switch (token.Value.Kind) {
                        case Token.Type.SeparatorSemicolon:
-                               if (!NameValueHeaderValue.ParseParameters (lexer, out parameters))
+                               if (!NameValueHeaderValue.TryParseParameters (lexer, out parameters))
                                        return false;
                                break;
                        case Token.Type.End:
@@ -181,7 +181,7 @@ namespace System.Net.Http.Headers
 
                        switch (token.Value.Kind) {
                        case Token.Type.SeparatorSemicolon:
-                               if (!NameValueHeaderValue.ParseParameters (lexer, out parameters))
+                               if (!NameValueHeaderValue.TryParseParameters (lexer, out parameters))
                                        return false;
                                break;
                        case Token.Type.End:
index 03bcab48c9dc5b3c0063e219bcbfbac410a96444..906ab3aa657fac2845c31f92c377980b68d8299c 100644 (file)
@@ -121,8 +121,18 @@ namespace System.Net.Http.Headers
                        throw new FormatException (input);
                }
 
-               internal static bool ParseParameters (Lexer lexer, out List<NameValueHeaderValue> result)
+               internal static bool TryParseParameters (Lexer lexer, out List<NameValueHeaderValue> result)
                {
+                       return TryParseCollection (lexer, out result, Token.Type.SeparatorSemicolon);
+               }
+
+               internal static bool TryParsePragma (string input, out List<NameValueHeaderValue> result)
+               {                       
+                       return TryParseCollection (new Lexer (input), out result, Token.Type.SeparatorComma);
+               }
+
+               static bool TryParseCollection (Lexer lexer, out List<NameValueHeaderValue> result, Token.Type separator)
+               {               
                        var list = new List<NameValueHeaderValue> ();
                        result = null;
 
@@ -146,7 +156,7 @@ namespace System.Net.Http.Headers
                                        t = lexer.Scan ();
                                }
 
-                               if (t == Token.Type.SeparatorSemicolon || t == Token.Type.End) {
+                               if (t == separator|| t == Token.Type.End) {
                                        list.Add (new NameValueHeaderValue () {
                                                Name = lexer.GetStringValue (attr),
                                                value = value
@@ -155,7 +165,7 @@ namespace System.Net.Http.Headers
                                        return false;
                                }
 
-                       } while (t == Token.Type.SeparatorSemicolon);
+                       } while (t == separator);
 
                        result = list;
                        return true;
index e9c1e1e1e0cce71eba4ba1e45af4254eb38eccb6..81d7bb089c1317259d51a4bec1992d405a776e0d 100644 (file)
@@ -103,7 +103,7 @@ namespace System.Net.Http.Headers
                public static bool TryParse (string input, out NameValueWithParametersHeaderValue parsedValue)
                {
                        List<NameValueHeaderValue> values;
-                       if (!ParseParameters (new Lexer (input), out values)) {
+                       if (!TryParseParameters (new Lexer (input), out values)) {
                                parsedValue = null;
                                return false;
                        }
index ef2cd18254584c4e8f0ae16b516e7c56263b8ef5..8f0db592831379f6c38f4bfe07d0f75dec0e8576 100644 (file)
@@ -125,7 +125,7 @@ namespace System.Net.Http.Headers
 
                        // Parameters parsing
                        if (t == Token.Type.SeparatorSemicolon) {
-                               if (!NameValueHeaderValue.ParseParameters (lexer, out result.parameters))
+                               if (!NameValueHeaderValue.TryParseParameters (lexer, out result.parameters))
                                        return false;
                        } else if (t != Token.Type.End) {
                                return false;
index 720fc6812a678f156118c326c70056744dd58525..656911ee0e2e0ef8caf9b5cd5ebc4f18434c62c6 100644 (file)
@@ -312,8 +312,22 @@ namespace System.Net.Http
                                await request.Content.CopyToAsync (stream).ConfigureAwait (false);
                        }
 
-                       // FIXME: GetResponseAsync does not accept cancellationToken
-                       var wresponse = (HttpWebResponse) await wrequest.GetResponseAsync ().ConfigureAwait (false);
+                       HttpWebResponse wresponse = null;
+                       using (cancellationToken.Register (l => ((HttpWebRequest) l).Abort (), wrequest)) {
+                               try {
+                                       wresponse = (HttpWebResponse) await wrequest.GetResponseAsync ().ConfigureAwait (false);
+                               } catch (WebException we) {
+                                       if (we.Status != WebExceptionStatus.RequestCanceled)
+                                               throw;
+                               }
+
+                               if (cancellationToken.IsCancellationRequested) {
+                                       var cancelled = new TaskCompletionSource<HttpResponseMessage> ();
+                                       cancelled.SetCanceled ();
+                                       return await cancelled.Task;
+                               }
+                       }
+                       
                        return CreateResponseMessage (wresponse, request);
                }
        }
index 40cbde3a6abf0ecb6a553adca54834b4e94b267d..021f2e9b0d9f8edac15ac185d2ccff6c6091090c 100644 (file)
@@ -119,7 +119,7 @@ namespace System.Net.Http
 
                public Task LoadIntoBufferAsync ()
                {
-                       return LoadIntoBufferAsync (65536);
+                       return LoadIntoBufferAsync (int.MaxValue);
                }
 
                public async Task LoadIntoBufferAsync (long maxBufferSize)
index 21692ed3b0daf99c86a11c8f46ae8c09e9e73b9f..e63f34d72d39c76916e9ca3c658b55f7e068a471 100644 (file)
@@ -219,6 +219,12 @@ namespace MonoTests.System.Net.Http
                        } catch (FormatException) {
                        }
 
+                       try {
+                               headers.Add ("pragma", "nocache,RequestID=1,g=");
+                               Assert.Fail ("pragma");
+                       } catch (FormatException) {                             
+                       }
+
                        headers.Add ("accept", "audio/y");
                        headers.Add ("accept-charset", "achs");
                        headers.Add ("accept-encoding", "aenc");
@@ -226,7 +232,6 @@ namespace MonoTests.System.Net.Http
                        headers.Add ("expect", "exp");
                        headers.Add ("if-match", "\"v\"");
                        headers.Add ("if-none-match", "\"v2\"");
-                       headers.Add ("pragma", "p");
                        headers.Add ("TE", "0.8");
                        headers.Add ("trailer", "value2");
                        headers.Add ("transfer-encoding", "ttt");
@@ -234,6 +239,7 @@ namespace MonoTests.System.Net.Http
                        headers.Add ("user-agent", "uaua");
                        headers.Add ("via", "prot v");
                        headers.Add ("warning", "4 ww \"t\"");
+                       headers.Add ("pragma", "nocache,R=1,g");
 
                        Assert.IsTrue (headers.Accept.SequenceEqual (
                                new[] {
@@ -296,7 +302,6 @@ namespace MonoTests.System.Net.Http
                        Assert.IsTrue (headers.IfNoneMatch.SequenceEqual (new EntityTagHeaderValue[] { new EntityTagHeaderValue ("\"tag2\"", true), new EntityTagHeaderValue ("\"v2\"", false) }));
                        Assert.AreEqual (new DateTimeOffset (DateTime.Today), headers.IfRange.Date);
                        Assert.AreEqual (headers.MaxForwards, 0x15b3);
-                       Assert.IsTrue (headers.Pragma.SequenceEqual (new NameValueHeaderValue[] { new NameValueHeaderValue ("name", "value"), new NameValueHeaderValue ("p", null) }));
                        Assert.AreEqual ("p", headers.ProxyAuthorization.Parameter);
                        Assert.AreEqual ("s", headers.ProxyAuthorization.Scheme);
                        Assert.AreEqual (5, headers.Range.Ranges.First ().From);
@@ -345,6 +350,14 @@ namespace MonoTests.System.Net.Http
                                }
                        ));
 
+                       Assert.IsTrue (headers.Pragma.SequenceEqual (
+                               new[] {
+                                       new NameValueHeaderValue ("name", "value"),
+                                       new NameValueHeaderValue ("nocache", null),
+                                       new NameValueHeaderValue ("R", "1"),
+                                       new NameValueHeaderValue ("g", null)
+                               }
+                       ));                     
                }
 
                [Test]
index 2511171a23a93392781c2bdb4ffbfda39961545a..6dd6ee510dd7b8531f0511785aca1cd9a32dc990 100644 (file)
@@ -24,6 +24,8 @@
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
 
+#if NET_4_0
+
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Cookie))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.CookieCollection))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.CookieContainer))]
@@ -45,3 +47,4 @@
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.NetworkInformation.NetworkChange))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.NetworkInformation.NetworkInterface))]
 
+#endif
\ No newline at end of file
index dea18bab3b1e479006a36dc2f5399739a4a4ea34..b04f9ff96640d02e4b1af3ca70733e43d223e352 100644 (file)
@@ -2,4 +2,5 @@ Assembly/AssemblyInfo.cs
 Assembly/TypeForwarders.cs
 ../../build/common/Consts.cs
 ../../build/common/MonoTODOAttribute.cs
+System.Net/DnsPermission.cs
 System.Net/IPEndPointCollection.cs
diff --git a/mcs/class/System.Net/System.Net/DnsPermission.cs b/mcs/class/System.Net/System.Net/DnsPermission.cs
new file mode 100644 (file)
index 0000000..16a2006
--- /dev/null
@@ -0,0 +1,72 @@
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining  a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including  without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to  permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION 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;
+using System.Security;
+using System.Security.Permissions;
+
+namespace System.Net
+{
+       [Serializable]
+       public sealed class DnsPermission : CodeAccessPermission, IUnrestrictedPermission
+       {
+               public DnsPermission (PermissionState state)
+               {
+
+               }
+
+               public bool IsUnrestricted ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public override IPermission Copy ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public override IPermission Union (IPermission target)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public override IPermission Intersect (IPermission target)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public override bool IsSubsetOf (IPermission target)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public override void FromXml (SecurityElement securityElement)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public override SecurityElement ToXml ()
+               {
+                       throw new NotImplementedException ();
+               }
+       }
+}
diff --git a/mcs/class/System.Runtime.Serialization/mobile_static_System.Runtime.Serialization.dll.sources b/mcs/class/System.Runtime.Serialization/mobile_static_System.Runtime.Serialization.dll.sources
new file mode 100644 (file)
index 0000000..6caafd4
--- /dev/null
@@ -0,0 +1 @@
+#include mobile_System.Runtime.Serialization.dll.sources
index 99072bee908b680b1104e639d172a2fc202b3b2c..5cf086e73b8cba9a2d6cd3e2e6bf7828c2b938b1 100644 (file)
@@ -476,7 +476,7 @@ namespace System.ServiceModel.Syndication
                                }
 
                        if (Feed.Description != null)
-                               Feed.Description.WriteTo (writer, "description", AtomNamespace);
+                               Feed.Description.WriteTo (writer, "subtitle", AtomNamespace);
 
                        if (Feed.ImageUrl != null)
                                writer.WriteElementString ("logo", AtomNamespace, Feed.ImageUrl.ToString ());
index e0174b9ee83f1cfe3971f679de8f8f2084860762..d5c40ddd4e7a857389cbbdedc034d43c45424e7a 100644 (file)
@@ -1,3 +1,5 @@
+#if !MOBILE
+
 using System;
 using System.ServiceModel;
 using System.ServiceModel.Activation;
@@ -87,3 +89,5 @@ namespace MonoTests.System.ServiceModel.Activation
                }
        }
 }
+
+#endif
\ No newline at end of file
index 3e98dfc0ed17c75cbf563e9764cefa3577032399..d7af674eab67c47ef7444b8b59681aa47ecf6ad5 100644 (file)
@@ -1,3 +1,4 @@
+#if !MOBILE
 using System;
 using System.IO;
 using System.ServiceModel;
@@ -167,3 +168,4 @@ namespace MonoTests.System.ServiceModel
                }
        }
 }
+#endif
\ No newline at end of file
index 45d766be1564c4d28e8bf0f95d67304eb91001f4..1ab1b89b1a5a2788ab6a9ac876affc6f28310f60 100755 (executable)
@@ -1,4 +1,4 @@
-
+#if !MOBILE
 using System;
 using System.ServiceModel.Configuration;
 using NUnit.Framework;
@@ -65,3 +65,4 @@ namespace MonoTests.System.ServiceModel.Configuration
                }
        }
 }
+#endif
\ No newline at end of file
index bba9cb3553db4669e3657c94eb8151d837df22be..84c076d475b7d85541f7e0470646049c2b504617 100644 (file)
@@ -22,7 +22,7 @@ namespace MonoTests.System.ServiceModel.Description
                {
                        return GetRequestClientFormatter (operationDescription, endpoint);
                }
-
+#if !MOBILE
                public IDispatchMessageFormatter DoGetReplyDispatchFormatter (OperationDescription operationDescription, ServiceEndpoint endpoint)
                {
                        return GetReplyDispatchFormatter (operationDescription, endpoint);
@@ -32,7 +32,7 @@ namespace MonoTests.System.ServiceModel.Description
                {
                        return GetRequestDispatchFormatter (operationDescription, endpoint);
                }
-
+#endif
                public event Action<ServiceEndpoint, ClientRuntime> ApplyClientBehaviorInvoked;
 
                public override void ApplyClientBehavior (ServiceEndpoint endpoint, ClientRuntime client)
@@ -76,6 +76,7 @@ namespace MonoTests.System.ServiceModel.Description
                        Assert.AreEqual (0, pl.Count, "#1");
                }
 
+#if !MOBILE
                [Test]
                public void ApplyDispatchBehavior ()
                {
@@ -120,6 +121,7 @@ namespace MonoTests.System.ServiceModel.Description
 
                        Assert.AreEqual (0, ed.DispatchRuntime.Operations.Count, "#4-0"); // hmm... really?
                }
+#endif
 
                [Test]
                public void GetMessageFormatters ()
@@ -129,8 +131,10 @@ namespace MonoTests.System.ServiceModel.Description
                        var b = new WebHttpBehaviorExt ();
                        Assert.IsNotNull (b.DoGetRequestClientFormatter (od, se), "#1");
                        Assert.IsNotNull (b.DoGetReplyClientFormatter (od, se), "#2");
+#if !MOBILE
                        Assert.IsNotNull (b.DoGetRequestDispatchFormatter (od, se), "#3");
                        Assert.IsNotNull (b.DoGetReplyDispatchFormatter (od, se), "#4");
+#endif
                }
 
                [Test]
@@ -153,6 +157,7 @@ namespace MonoTests.System.ServiceModel.Description
                        }
                }
 
+#if !MOBILE
                [Test]
                public void RequestClientFormatter2 ()
                {
@@ -174,6 +179,7 @@ namespace MonoTests.System.ServiceModel.Description
 
                        // TODO: test DeserializeReply too (it is supported unlike above).
                }
+#endif
 
                [ServiceContract]
                public interface IMyService
@@ -189,7 +195,9 @@ namespace MonoTests.System.ServiceModel.Description
 
                public class MyService: IMyService
                {
+#if !MOBILE
                        [OperationBehavior]
+#endif
                        public string Echo (string input)
                        {
                                return input;
@@ -204,6 +212,7 @@ namespace MonoTests.System.ServiceModel.Description
                        Assert.IsTrue (od.Behaviors.Contains (typeof (WebGetAttribute)), "Operation is recognized as WebGet");
                }
 
+#if !MOBILE
                [Test]
                public void MessageFormatterSupportsRaw ()
                {
@@ -247,7 +256,7 @@ namespace MonoTests.System.ServiceModel.Description
                        formatter.DeserializeRequest (msg, pars);
                        Assert.IsTrue (pars [0] is Stream, "ret");
                }
-
+#endif
                [ServiceContract]
                public interface IMultipleParametersGet
                {
index a3a64b516e5680c4d4eac2982ded64da33e02019..401f1a1f20d9b05ed8c26135a6ed7a12f8ec667b 100644 (file)
@@ -1,4 +1,4 @@
-#if NET_4_0
+#if NET_4_0 && !MOBILE
 using System;
 using System.IO;
 using System.Runtime.Serialization;
index 5e7b44557e8a09ccfdcefb3f6e41aabc2ca4ee01..d735c2ebb702ba28999c3cd9a6ee9653856419a9 100644 (file)
@@ -25,6 +25,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 !MOBILE
 using System;
 using System.Net;
 using System.Runtime.Serialization;
@@ -111,3 +112,4 @@ namespace MonoTests.System.ServiceModel.Description
                }
        }
 }
+#endif
\ No newline at end of file
index 907f37389886b4635a69a08b15cfd968aeaecf26..bb4593ac99e17df7673ff885f44be428c02be00e 100644 (file)
@@ -26,6 +26,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 !MOBILE
 using System;
 using System.Globalization;
 using System.Runtime.Serialization;
@@ -276,3 +277,4 @@ namespace MonoTests.System.ServiceModel.Dispatcher
                #endregion
        }
 }
+#endif
\ No newline at end of file
index 85d402a1dc58cc4759b586260f9e80682302c768..c15d1ec5825c779a033079072f6da38d5dbf9fdf 100644 (file)
@@ -25,6 +25,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 !MOBILE
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
@@ -160,6 +161,7 @@ namespace MonoTests.System.ServiceModel.Syndication
                        SyndicationFeed feed = new SyndicationFeed ();
                        feed.BaseUri = new Uri ("http://mono-project.com");
                        feed.Copyright = new TextSyndicationContent ("No rights reserved");
+                       feed.Description = new TextSyndicationContent ("A sample feed for unit testing");
                        feed.Generator = "mono test generator";
                        // .NET bug: it ignores this value.
                        feed.Id = "urn:myid";
@@ -169,7 +171,7 @@ namespace MonoTests.System.ServiceModel.Syndication
                        StringWriter sw = new StringWriter ();
                        using (XmlWriter w = CreateWriter (sw))
                                new Atom10FeedFormatter (feed).WriteTo (w);
-                       Assert.AreEqual ("<feed xml:base=\"http://mono-project.com/\" xmlns=\"http://www.w3.org/2005/Atom\"><title type=\"text\"></title><id>XXX</id><rights type=\"text\">No rights reserved</rights><updated>2008-01-01T00:00:00Z</updated><logo>http://mono-project.com/images/mono.png</logo><generator>mono test generator</generator></feed>", DummyId (sw.ToString ()));
+                       Assert.AreEqual ("<feed xml:base=\"http://mono-project.com/\" xmlns=\"http://www.w3.org/2005/Atom\"><title type=\"text\"></title><id>XXX</id><rights type=\"text\">No rights reserved</rights><updated>2008-01-01T00:00:00Z</updated><subtitle type=\"text\">A sample feed for unit testing</subtitle><logo>http://mono-project.com/images/mono.png</logo><generator>mono test generator</generator></feed>", DummyId (sw.ToString ()));
                }
 
                [Test]
@@ -384,3 +386,4 @@ namespace MonoTests.System.ServiceModel.Syndication
                }
        }
 }
+#endif
\ No newline at end of file
index 3ed55740c350ec9e0bf034df5d33d2bcdef11869..3930ec5b0b6ace5546370d5184d5380d2f0a65e9 100644 (file)
@@ -25,6 +25,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 !MOBILE
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
@@ -374,3 +375,4 @@ namespace MonoTests.System.ServiceModel.Syndication
                }
        }
 }
+#endif
\ No newline at end of file
index b73dd7feb0a8236b18039d73f5dd08f41caf92e0..453895dceb2a0c8e2c512d88d127ce5dc90721b2 100644 (file)
@@ -25,6 +25,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 !MOBILE
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
@@ -125,3 +126,4 @@ namespace MonoTests.System.ServiceModel.Syndication
                }
        }
 }
+#endif
\ No newline at end of file
index cfc9dfabc4df70ca808ae710ac599bb4f4e9ba1a..5f303095fa85e336bc5e86722ee6c04454c1a4eb 100644 (file)
@@ -25,6 +25,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 !MOBILE
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
@@ -137,3 +138,4 @@ namespace MonoTests.System.ServiceModel.Syndication
                }
        }
 }
+#endif
\ No newline at end of file
index 4a65897670434c7ceb36713d4bf2645011b52e65..6efdc398cca33f57898a38b24902fc3c163f66fb 100644 (file)
@@ -25,6 +25,8 @@
 // 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 !MOBILE
+
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
@@ -355,3 +357,4 @@ namespace MonoTests.System.ServiceModel.Syndication
                }
        }
 }
+#endif
\ No newline at end of file
index 9fc3a64194213830f55e94318b28eb31458a559b..3b83d230cb4ebfabc7d023a589db06785ef46c7a 100644 (file)
@@ -25,6 +25,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 !MOBILE
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
@@ -352,3 +353,4 @@ namespace MonoTests.System.ServiceModel.Syndication
                }
        }
 }
+#endif
\ No newline at end of file
index d6d938089ca83d0f59aa6e6dd5d8a8b6dbadc0ac..b9f43186c08bd22d9d2bb76216b38d785987f76f 100644 (file)
@@ -25,6 +25,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 !MOBILE
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
@@ -70,3 +71,4 @@ namespace MonoTests.System.ServiceModel.Syndication
                }
        }
 }
+#endif
\ No newline at end of file
index 1a2898e75311f4095cf6b7e29680003cd23fd419..292335af736f1d9abe556a33dcafb8e6449dc4fa 100644 (file)
@@ -25,6 +25,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 !MOBILE
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
@@ -224,3 +225,4 @@ namespace MonoTests.System.ServiceModel.Syndication
                }
        }
 }
+#endif
\ No newline at end of file
index 77950c152172e303bc1b947238f3355324f62e07..4f424fbb54b5351d855c72dd3879bbf70de2cf63 100644 (file)
@@ -25,6 +25,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 !MOBILE
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
@@ -102,3 +103,4 @@ namespace MonoTests.System.ServiceModel.Syndication
                }
        }
 }
+#endif
\ No newline at end of file
index c0a67b7b3725fc0a5692e400831d43950e5818ac..2a6b6afe7cd38f889cd8d0d0207a5a46d12a4bc3 100644 (file)
@@ -25,6 +25,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 !MOBILE
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
@@ -144,3 +145,4 @@ namespace MonoTests.System.ServiceModel.Syndication
                }
        }
 }
+#endif
\ No newline at end of file
index 55950031ce916638a7f9210d70c230720d2ceb0e..fd537556132235fbb01e85d51afc74f1bbeb9956 100644 (file)
@@ -25,6 +25,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 !MOBILE
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
@@ -215,3 +216,4 @@ namespace MonoTests.System.ServiceModel.Syndication
                }
        }
 }
+#endif
\ No newline at end of file
index 6bafef7604c00b24b2d9e67552e8e8312d29424b..c49be5ba36273e89923f8d9a941270d2c2e7073b 100644 (file)
@@ -25,6 +25,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 !MOBILE
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
@@ -97,3 +98,4 @@ namespace MonoTests.System.ServiceModel.Syndication
                }
        }
 }
+#endif
\ No newline at end of file
index 4174b4c585112bf23c05402217507e21a677f2cd..cd336072352494246fe30fbed1d5977b9eeaf21b 100644 (file)
@@ -25,6 +25,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 !MOBILE
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
@@ -96,3 +97,4 @@ namespace MonoTests.System.ServiceModel.Syndication
                }
        }
 }
+#endif
\ No newline at end of file
index 4e8a1720d94c76b8875e609b264409e8e1e8fdc9..80264bd9dabc4f8e0599cb51f4ec57abcd9b3bfd 100644 (file)
@@ -25,6 +25,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 !MOBILE
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
@@ -137,3 +138,4 @@ namespace MonoTests.System.ServiceModel.Syndication
                }
        }
 }
+#endif
\ No newline at end of file
index 69f05ec217a0ca92ecb7c4718e7ea655109ea5ac..d1e8ea5ff58df3d3a1a3336a09c14a23bd31475a 100644 (file)
@@ -31,7 +31,9 @@ using System.Runtime.Serialization;
 using System.ServiceModel;
 using System.ServiceModel.Channels;
 using System.ServiceModel.Description;
+#if !MOBILE
 using System.ServiceModel.Syndication;
+#endif
 using System.ServiceModel.Web;
 using System.Xml;
 using NUnit.Framework;
@@ -46,21 +48,25 @@ namespace MonoTests.System.ServiceModel.Web
                [Test]
                public void Current ()
                {
+#if !MOBILE
                        Assert.IsNull (WebOperationContext.Current, "#1");
+#endif
                        var binding = new WebHttpBinding ();
                        var address = new EndpointAddress ("http://localhost:37564");
                        var ch = (IContextChannel) WebChannelFactory<IHogeService>.CreateChannel (binding, address);
                        using (var ocs = new OperationContextScope (ch)) {
+#if !MOBILE
                                Assert.IsNotNull (WebOperationContext.Current, "#2");
                                Assert.IsNotNull (WebOperationContext.Current.OutgoingRequest, "#3");
                                Assert.IsNotNull (WebOperationContext.Current.IncomingRequest, "#4");
                                Assert.IsNotNull (WebOperationContext.Current.IncomingResponse, "#5");
                                Assert.IsNotNull (WebOperationContext.Current.OutgoingResponse, "#6"); // pointless though.
+#endif
                        }
                        ch.Close ();
                }
 
-#if NET_4_0
+#if NET_4_0 && !MOBILE
                [Test]
                public void CreateAtom10Response ()
                {
@@ -126,7 +132,7 @@ namespace MonoTests.System.ServiceModel.Web
                string TestJson3 (string s1, string s2);
        }
 
-#if NET_4_0
+#if NET_4_0 && !MOBILE
        public class HogeService : IHogeService
        {
                static XmlWriterSettings settings = new XmlWriterSettings () { OmitXmlDeclaration = true };
index 48a0b103b2fb2c36836b5a7eb2427fb64c166948..cf1038dac22e3e1be442878d3d1b5205c5cd0848 100644 (file)
@@ -25,6 +25,7 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
 //\r
+#if !MOBILE\r
 using System;\r
 using System.Collections.Generic;\r
 using System.Linq;\r
@@ -135,3 +136,4 @@ namespace MonoTests.System.ServiceModel.Web
 \r
        }\r
 }\r
+#endif
\ No newline at end of file
index 37932c14f7ae10ce3e414fb46dae766d0246b5e0..1c0c0077ce8073d0cce0ac4d2406772a11d00c9b 100644 (file)
@@ -16,7 +16,9 @@ namespace MonoTests.System.ServiceModel
                        Assert.AreEqual ("http", b.Scheme, "#1");
                        Assert.AreEqual (Encoding.UTF8, b.WriteEncoding, "#2");
                        Assert.AreEqual (0x10000, b.MaxBufferSize, "#3");
+#if !MOBILE
                        Assert.AreEqual (0x80000, b.MaxBufferPoolSize, "#4");
+#endif
                        Assert.AreEqual (0x10000, b.MaxReceivedMessageSize, "#5");
                        Assert.IsFalse (((IBindingRuntimePreferences) b).ReceiveSynchronously, "#6");
                }
index a41802469eb092bff030f7b736004a7c361e0978..24ec92861d82a1bc9d6f8e4a8202a6f6dd9ec5b0 100644 (file)
@@ -441,7 +441,7 @@ namespace MonoTests.System
                        var t = new UriTemplate ("*");
                        var m = t.Match (new Uri ("http://localhost"), new Uri ("http://localhost/hoge/ppp"));
                        Assert.IsNotNull (m, "#0");
-                       Assert.IsEmpty (m.QueryParameters, "#1.0");
+                       Assert.AreEqual (0, m.QueryParameters.Count, "#1.0");
                        Assert.AreEqual ("hoge", m.WildcardPathSegments [0], "#2");
                        Assert.AreEqual ("ppp", m.WildcardPathSegments [1], "#3");
                }
diff --git a/mcs/class/System.ServiceModel.Web/mobile_static_System.ServiceModel.Web.dll.sources b/mcs/class/System.ServiceModel.Web/mobile_static_System.ServiceModel.Web.dll.sources
new file mode 100644 (file)
index 0000000..cbea0fa
--- /dev/null
@@ -0,0 +1 @@
+#include mobile_System.ServiceModel.Web.dll.sources
index 128c5b9712c03058ed57dbb798915160e384a299..283389d59b1e1b2384ef8e9754f6f1460c82dcb1 100644 (file)
@@ -22,7 +22,7 @@
 //
 
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Reflection;
 using System.Reflection.Emit;
index c06d2478b6ee1f2703c416e576e876a2576f930e..e2eea5cfa38c289ee7a61fafd2d4824f8533449e 100644 (file)
@@ -1,6 +1,6 @@
 // created on 28/08/2004 at 17:07
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Reflection;
 using System.Reflection.Emit;
index d25686496588d416adb9a377a7ddfbb313e1092a..4bfcdec9d91efb470ed9b75d340bf818eecd9dec 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Reflection;
 using System.Reflection.Emit;
index 92ddb5e954e19350cd489f2813e833f239d63b43..dac3d4efcb5e951f6525f69ad290a51966e1660c 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Reflection;
 using System.Reflection.Emit;
index b521345a869f08720fcf5f435917fc5f116fbe51..7ef31fb03e1c85a7202668031dc94ffdfadee503 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Reflection;
 using System.Reflection.Emit;
index 489004e3c01318ab5fe6ec27a3835d866541a67d..2b3fdd7c2c5f59577ebd2960ce9b07ed2e265519 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Reflection;
 using System.Reflection.Emit;
index 49dcb1173245b883ebad5f3f96b7791bd11f4635..be22efc420f802c281e126f69bf17cf762ae07ed 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Reflection;
 using System.Reflection.Emit;
index c60f58afe179bd4287ea451d18a126b6eb854ecd..60ad69d629837061939ffce7a9231b3d0594aae1 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Reflection;
 using System.Reflection.Emit;
index dc6d5ef364e149e7754f603024436c6216d29ef8..3cd60037c82670dda741e6142910bc94aa8a0b35 100644 (file)
@@ -1,6 +1,6 @@
 // created on 28/08/2004 at 17:30
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Reflection;
 using System.Reflection.Emit;
index 4dfa1d0e4cae438879b9ad34003169dcfe954d7b..47f0dd18445393d77a9393ad04e17218d892f7ca 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Collections;
 using System.Reflection;
index 58de364d19fc25ce3ee377783538e8f86e0eaab6..7c4456c6d6bbbdb008a06c28a09c7eaa1fb5f51e 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.IO;
 using System.Collections;
index 4610f4b008f85f8045c72e1d956be84708ee3073..7370b3b033e168a2e6bb9679dceab43edac26007 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Reflection;
 using System.Reflection.Emit;
index 1327d5c2c7e39e517bddfb13be0dec632687ec2c..e34884a9b5608bcff6c8f0b964db56e850244480 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.IO;
 using System.Collections;
index b2c0519f4ad20f03014369c81792ba22b07d3397..f75bc8be193a3a5542cd0633e8385b6064263109 100644 (file)
@@ -18,7 +18,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 !FULL_AOT_RUNTIME
 using System;
 using System.IO;
 using System.Collections;
index d7f488b91044a7907614e535981a4830b308e44a..eddce1600b912efc54347ea1559013ed40028db1 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Reflection;
 using System.Reflection.Emit;
index b9ea6dd694545b2005a9664659c33b26cbbb8869..41410e83717ca083f50ca0795732a809f0ad08f0 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Reflection;
 using System.Reflection.Emit;
index 066b27930d43de95f0e9adb89a95e0b4995632d6..b090c4f1f5823c542f8261ea398ab9a72b192700 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Reflection;
 using System.Reflection.Emit;
index 7beeffe455da32436543578790ef175aa29cb194..84f01b87cbba98a51b2ce47f186dcd391dc97a6b 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Reflection;
 using System.Reflection.Emit;
index 123e556db631286f3511d32064f0e866d63714c1..c871b5bb518ea5eb9a04a0ee2534de9e6a317d0d 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Reflection;
 using System.Reflection.Emit;
index 8f7f6bfdef6da8391170eae5a7be775cb63449ad..5d7baa343c1d45315fa9a130882056ee2a2c5cdc 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Collections;
 using System.Reflection;
index d0defd95dc8848195262e6fbae20bc31ebe7a99b..d753a6666882df96b2ec10d898b09b6b8daf36c1 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Collections;
 using System.Reflection.Emit;
index e860fd8620dcd4ebb307af2a2bc56764ce1d4de6..7355c5a94f629d7addfe0ef08fbe99fa6182369a 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Reflection;
 using System.Reflection.Emit;
index 5967954dca511a28f73ce69b27f6797b5b65f72c..e2863463e53a647ff541472c388e5166fe1ca79b 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Reflection;
 using System.Reflection.Emit;
index c8f682b4e6db63e4f21dd12d5c7e91478c88f28e..356b35ba45971e94be38ca5d95d1a0245fbd7631 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Reflection;
 using System.Reflection.Emit;
index 6e2586cc2ff727e11ac673edf3577a51f4406b89..f6808840d95beefc3714fbe26c0a2720fb09cdaf 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Reflection;
 using System.Reflection.Emit;
index 152d7f8b9f64b1719495d87bef9416ec2099a887..90c46fe6de72316152faf2c3b024329c5f82aa19 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Globalization;
 using System.Reflection;
index 2bde317409836a89ec7d5d67af69de2d4ce52a0f..68f477ff01bb318abd44128f202b776b1d080647 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Collections;
 using System.IO;
index fc882c4c1552facbd9510d378ef2f4ee00d25daa..aa378d766d5254fa8510894f036bab7dce600cc3 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Reflection;
 using System.Reflection.Emit;
index bf9b4bd3b60c169561186fae444ac612ca862760..ff8251f18158475d04de5c4707eb0a6fa5a389de 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.IO;
 using System.Collections;
index 2e97c843f663a54f3bf0084731034ed007e7d51b..8c5a860586e09c24ac18cfe0aeacd03443ac3634 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Reflection;
 using System.Reflection.Emit;
index a7dd963c8da6e597723ce6cde0560c40f39cc225..618d0ffcc2c3e42a05537db1993e61c2ad3b5df9 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Reflection;
 using System.Reflection.Emit;
index dcf9b3d03060650ff653af9470e341725bfae669..16dc05e3f870353a68a48f15686a98d7cff35095 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Reflection;
 using System.Reflection.Emit;
index 32b0ce2fb498a146ddbfe34389ab0a45090f2654..bdce56d6e9ec252911d452d259cc82551671cf4d 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Reflection;
 using System.Reflection.Emit;
index 0e79378a5ce84eb72415a0c9c4716d2f64370aaa..338e37038d5823290b8f54027c7500036b294c0f 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Collections;
 using System.IO;
index b268e835c492dfa979fa342433540162ee944521..b496749e3f38be75052d5eebf5cdc6d8cff34953 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Reflection;
 using System.Reflection.Emit;
index ca9ecb3f4cf5f441470bdcb54fc8f675ed34fa9c..c2c5e8480fc19bfdb839ae0a594924e1f261e894 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Reflection;
 using System.Reflection.Emit;
index ea83af5d6f9c75bef802f33caa53a42f5e36e017..dfb268174b4d6b10c78676320272784e6f02be13 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Collections;
 using System.Reflection;
index 90dd7010d8b058cbc90934acdd22bffa1a2d59ae..082fbabfbb168575fbed464a54c99919a48cfe2f 100644 (file)
@@ -1,6 +1,6 @@
 // created on 28/08/2004 at 17:30
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Reflection;
 using System.Reflection.Emit;
index b917e14fde5f080ad2c68eae14b30d97ea8ca78a..c2330c4249941307760a1d44894775e680b3d5f9 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) 2009 Novell, Inc
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Collections;
 #if NET_2_0
index b66493a558941235c7f4003e97f988bbf936eeb2..413131b2f6fc00318dae2419f4588a1512de2266 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Reflection;
 using System.Reflection.Emit;
index 52dd50b496e1798096e9ca0fd2a33dcdd32b2e43..6cb27ea36d35072dac00f04def3b24153c446eab 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Reflection;
 using System.Reflection.Emit;
index 93f8394b1a95f16b5089f29d580898ee47ad4cb0..fb270b24ad773d557f38f770f1ab39c1cefdd401 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Reflection;
 using System.Reflection.Emit;
index af682fb2b92144dc592daaf28ec14eefb57cf48c..5fb248e4630f63c0c88ba6921614d14e757af91f 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Reflection;
 using System.Reflection.Emit;
index 41fa2b1fe5f737d7337984209bc0468c97f4b31e..3ae85a3be360dc003e1a53b72219e618e1fac2a6 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Reflection;
 using System.Reflection.Emit;
index d691cfef73903f84b46d3b24f319aeadf724efaf..ffd90b45d3bbf258e21f8145a96b7babbdadf6ab 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Reflection;
 using System.Reflection.Emit;
index ee9ff61616a4564e9f11c1ba997b18a2e6b35517..b34341d90488450dae181d9b263f1ad1ff1b735a 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.IO;
 
index e67107ad89490f8ab2197106d3148f11f84411ff..a01f4f21a1f3e8255e0cbe8f71e1b5953ee4dbb6 100644 (file)
@@ -21,7 +21,7 @@
 // Copyright (C) Lluis Sanchez Gual, 2004
 //
 
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Reflection;
 using System.Reflection.Emit;
index 7e4823f1819676a446ac81f466e4b8a5b9c81fc2..929a450d22be5df1083bdfb0cc77f5210478985f 100644 (file)
@@ -263,7 +263,7 @@ namespace System.ServiceModel.Description
                {
                        var l = new List<MethodInfo> ();
                        foreach (var t in GetAllInterfaceTypes (type)) {
-#if MONOTOUCH
+#if FULL_AOT_RUNTIME
                                // The MethodBase[] from t.GetMethods () is cast to a IEnumerable <MethodInfo>
                                // when passed to List<MethodInfo>.AddRange, which in turn casts it to 
                                // ICollection <MethodInfo>.  The full-aot compiler has no idea of this, so
index 81529cb5fd255a2bdb640364d98afd290547a304..1af7625027ecea7470b966e0a0c214edbdb31571 100644 (file)
@@ -137,7 +137,7 @@ namespace System.ServiceModel
 
                public virtual TChannel CreateChannel (EndpointAddress address, Uri via)
                {
-#if MONOTOUCH
+#if FULL_AOT_RUNTIME
                        throw new InvalidOperationException ("MonoTouch does not support dynamic proxy code generation. Override this method or its caller to return specific client proxy instance");
 #else
                        var existing = Endpoint.Address;
index 576e4a8a877abd40447f2d771897e2b30eae9ce6..a7b5587abf84f9809a24c4dae57b31ee730ae139 100644 (file)
@@ -26,7 +26,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 !FULL_AOT_RUNTIME
 using System;
 using System.Collections.Generic;
 using System.Reflection;
index 7c647a77dc8c860a0dc2e76e9682754f1df2757e..b656c1d1d2ef2209906f827f56bc75c5d8c4ea0b 100644 (file)
@@ -37,7 +37,7 @@ namespace System.ServiceModel
        {
                TDetail detail;
 
-#if MONOTOUCH
+#if FULL_AOT_RUNTIME
                // WCF creates FaultExceptions using reflection, so unless we reference
                // the corresponding ctor, it will not be possible to use FaultExceptions
                // in MonoTouch. This ctor reference will work as long as TDetail
diff --git a/mcs/class/System.ServiceModel/mobile_static_System.ServiceModel.dll.sources b/mcs/class/System.ServiceModel/mobile_static_System.ServiceModel.dll.sources
new file mode 100644 (file)
index 0000000..22ece5c
--- /dev/null
@@ -0,0 +1 @@
+#include mobile_System.ServiceModel.dll.sources
index e65451c85ed94ea59f8008399abcc88c26a9e127..a89f1d4c83fda4af45556e48f0ba1f1b86412a45 100644 (file)
@@ -2,7 +2,7 @@ thisdir = class/System.Transactions
 SUBDIRS = 
 include ../../build/rules.make
 
-MOBILE_PROFILE := $(filter monotouch monodroid mobile, $(PROFILE))
+MOBILE_PROFILE := $(filter monotouch monodroid mobile mobile_static, $(PROFILE))
 
 LIBRARY = System.Transactions.dll
 ifdef MOBILE_PROFILE
index 5a13d8ec0214e6d50ecf03b2ca9d6455e0a08bb6..9a4d1cfed1fb46646aabccb6626032881d8d53f6 100644 (file)
@@ -3,7 +3,7 @@ SUBDIRS =
 include ../../build/rules.make
 
 LIBRARY = System.Web.Services.dll
-MOBILE := $(filter monotouch monodroid mobile, $(PROFILE))
+MOBILE := $(filter monotouch monodroid mobile mobile_static, $(PROFILE))
 ifdef MOBILE
 LIB_MCS_FLAGS = \
        -nowarn:649 -nowarn:169                 \
diff --git a/mcs/class/System.Web.Services/mobile_static_System.Web.Services.dll.sources b/mcs/class/System.Web.Services/mobile_static_System.Web.Services.dll.sources
new file mode 100644 (file)
index 0000000..9e39dcc
--- /dev/null
@@ -0,0 +1 @@
+#include mobile_System.Web.Services.dll.sources
index 46c8b0a44d55a165ed7743543955839f3c005d11..308560a45f2a0da5f6d341d1a86b826d9c1c7287 100644 (file)
@@ -64,6 +64,9 @@ namespace System.Web.Configuration
                static ConfigurationProperty maxUrlLengthProp;
                static ConfigurationProperty encoderTypeProp;
                static ConfigurationProperty relaxedUrlToFileSystemMappingProp;
+#endif
+#if NET_4_5
+               static ConfigurationProperty targetFrameworkProp;
 #endif
                static ConfigurationPropertyCollection properties;
 
@@ -141,6 +144,12 @@ namespace System.Web.Configuration
                                                                     ConfigurationPropertyOptions.None);
                        relaxedUrlToFileSystemMappingProp = new ConfigurationProperty ("relaxedUrlToFileSystemMapping", typeof (bool), false);
 #endif
+#if NET_4_5
+                       targetFrameworkProp = new ConfigurationProperty ("targetFramework", typeof (Version), new Version (4, 0),
+                                                                               PropertyHelper.VersionConverter,
+                                                                               PropertyHelper.DefaultValidator,
+                                                                               ConfigurationPropertyOptions.None);
+#endif
                        
                        properties = new ConfigurationPropertyCollection();
                        properties.Add (apartmentThreadingProp);
@@ -169,6 +178,9 @@ namespace System.Web.Configuration
                        properties.Add (maxUrlLengthProp);
                        properties.Add (encoderTypeProp);
                        properties.Add (relaxedUrlToFileSystemMappingProp);
+#endif
+#if NET_4_5
+                       properties.Add (targetFrameworkProp);
 #endif
                }
 
@@ -342,6 +354,14 @@ namespace System.Web.Configuration
                        get { return (bool) base [relaxedUrlToFileSystemMappingProp]; }
                        set { base [relaxedUrlToFileSystemMappingProp] = value; }
                }
+#endif
+#if NET_4_5
+               [ConfigurationProperty ("targetFramework", DefaultValue = "4.0")]
+               [TypeConverter ("System.Web.Configuration.VersionConverter")]
+               public Version TargetFramework {
+                       get { return (Version) base [targetFrameworkProp]; }
+                       set { base [targetFrameworkProp] = value; }
+               }
 #endif
                protected internal override ConfigurationPropertyCollection Properties {
                        get { return properties; }
index ddda8757888cd472296fa40f7c1e3ed562796f38..68da3951f2f300b88f8d48a82759c91f6131d0f1 100644 (file)
@@ -138,10 +138,9 @@ namespace System.Web.Util
                static string EncodeHeaderString (string input)
                {
                        StringBuilder sb = null;
-                       char ch;
                        
                        for (int i = 0; i < input.Length; i++) {
-                               ch = input [i];
+                               char ch = input [i];
 
                                if ((ch < 32 && ch != 9) || ch == 127)
                                        StringBuilderAppend (String.Format ("%{0:x2}", (int)ch), ref sb);
@@ -276,11 +275,11 @@ namespace System.Web.Util
                                return s;
 
                        StringBuilder output = new StringBuilder ();
-                       char ch;
                        int len = s.Length;
                        
                        for (int i = 0; i < len; i++) {
-                               switch (s [i]) {
+                               char ch = s [i];
+                               switch (ch) {
                                        case '&' :
                                                output.Append ("&amp;");
                                                break;
@@ -307,7 +306,6 @@ namespace System.Web.Util
                                                break;
                                                
                                        default:
-                                               ch = s [i];
                                                if (ch > 159 && ch < 256) {
                                                        output.Append ("&#");
                                                        output.Append (((int) ch).ToString (Helpers.InvariantCulture));
@@ -351,27 +349,30 @@ namespace System.Web.Util
 
                        StringBuilder output = new StringBuilder ();
                        int len = s.Length;
-                       for (int i = 0; i < len; i++)
-                               switch (s [i]) {
-                               case '&' : 
-                                       output.Append ("&amp;");
-                                       break;
-                               case '"' :
-                                       output.Append ("&quot;");
-                                       break;
-                               case '<':
-                                       output.Append ("&lt;");
-                                       break;
+
+                       for (int i = 0; i < len; i++) {
+                               char ch = s [i];
+                               switch (ch) {
+                                       case '&' : 
+                                               output.Append ("&amp;");
+                                               break;
+                                       case '"' :
+                                               output.Append ("&quot;");
+                                               break;
+                                       case '<':
+                                               output.Append ("&lt;");
+                                               break;
 #if NET_4_0
-                               case '\'':
-                                       output.Append ("&#39;");
-                                       break;
+                                       case '\'':
+                                               output.Append ("&#39;");
+                                               break;
 #endif
-                               default:
-                                       output.Append (s [i]);
-                                       break;
+                                       default:
+                                               output.Append (ch);
+                                               break;
                                }
-       
+                       }
+
                        return output.ToString();
                }
                
index cbb1746bdb06cab76b2daa6ff1321c2c2985677d..2e68a21a852dfd90b51c9520f2d8890f0362cb51 100644 (file)
@@ -329,6 +329,21 @@ namespace System.Web
                internal static HttpRuntimeSection Section { get { return runtime_section; } }
 
                public static bool UsingIntegratedPipeline { get { return false; } }
+
+#if NET_4_5
+               public static Version IISVersion {
+                       get {
+                               // Null means not hosted by IIS
+                               return null;
+                       }
+               }
+               
+               public static Version TargetFramework {
+                       get {
+                               return runtime_section.TargetFramework;
+                       }
+               }
+#endif
                
                [SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
                public static void Close ()
diff --git a/mcs/class/System.XML/mobile_static_System.Xml.dll.sources b/mcs/class/System.XML/mobile_static_System.Xml.dll.sources
new file mode 100644 (file)
index 0000000..b663093
--- /dev/null
@@ -0,0 +1 @@
+#include mobile_System.Xml.dll.sources
index 0f8322efc76c4d28f3d0d3573a5448059b630a1e..de0f569d5c5d57a002c307b612d0f9e9f10d64b3 100644 (file)
@@ -172,7 +172,28 @@ namespace Mono.CSharp
                {
                        GenerateCompileUnitStart (compileUnit);
 
-                       GenerateGlobalNamespace (compileUnit);
+                       List<CodeNamespaceImport> imports = null;
+                       foreach (CodeNamespace codeNamespace in compileUnit.Namespaces) {
+                               if (!string.IsNullOrEmpty (codeNamespace.Name))
+                                       continue;
+
+                               if (codeNamespace.Imports.Count == 0)
+                                       continue;
+
+                               if (imports == null)
+                                       imports = new List<CodeNamespaceImport> ();
+
+                               foreach (CodeNamespaceImport i in codeNamespace.Imports)
+                                       imports.Add (i);
+                       }
+
+                       if (imports != null) {
+                               imports.Sort ((a, b) => a.Namespace.CompareTo (b.Namespace));
+                               foreach (var import in imports)
+                                       GenerateNamespaceImport (import);
+
+                               Output.WriteLine ();
+                       }
 
                        if (compileUnit.AssemblyCustomAttributes.Count > 0) {
                                OutputAttributes (compileUnit.AssemblyCustomAttributes, 
@@ -180,26 +201,22 @@ namespace Mono.CSharp
                                Output.WriteLine ("");
                        }
 
-                       GenerateLocalNamespaces (compileUnit);
-
-                       GenerateCompileUnitEnd (compileUnit);
-               }
+                       CodeNamespaceImportCollection global_imports = null;
+                       foreach (CodeNamespace codeNamespace in compileUnit.Namespaces) {
+                               if (string.IsNullOrEmpty (codeNamespace.Name)) {
+                                       global_imports = codeNamespace.Imports;
+                                       codeNamespace.Imports = new CodeNamespaceImportCollection ();
+                               }
 
-               private void GenerateGlobalNamespace (CodeCompileUnit compileUnit) {
-                       CodeNamespace globalNamespace = null;
+                               GenerateNamespace (codeNamespace);
 
-                       foreach (CodeNamespace codeNamespace in compileUnit.Namespaces)
-                               if (string.IsNullOrEmpty (codeNamespace.Name)) 
-                                       globalNamespace = codeNamespace;
-  
-                       if (globalNamespace != null)
-                               GenerateNamespace (globalNamespace);
-               }
+                               if (global_imports != null) {
+                                       codeNamespace.Imports = global_imports;
+                                       global_imports = null;
+                               }
+                       }
 
-               private void GenerateLocalNamespaces (CodeCompileUnit compileUnit) {
-                       foreach (CodeNamespace codeNamespace in compileUnit.Namespaces)
-                               if (!string.IsNullOrEmpty (codeNamespace.Name))
-                                       GenerateNamespace (codeNamespace);
+                       GenerateCompileUnitEnd (compileUnit);
                }
 
                protected override void GenerateDefaultValueExpression (CodeDefaultValueExpression e)
index 8a709865b4149519aa388fe7ba56963d8346188e..7940975eb21a6c7ce09b6f8f7728a31a106d0c05 100644 (file)
@@ -80,6 +80,9 @@ namespace System.CodeDom
                                }
                                return imports;
                        }
+                       internal set {
+                               imports = value;
+                       }
                }
 
                public string Name {
index c1190b2ad26d67daeeecc6c79191814e56db3879..2eaec862bda11b699875eb110f37849fb71b1134 100644 (file)
@@ -629,7 +629,7 @@ namespace System.Collections.Generic
                        int right = len-1;
 
                        while (left <= right) {
-                               int guess = (left + right) >> 1;
+                               int guess = left + ((right - left) >> 1);
 
                                int cmp = Compare (table[guess].Key, key);
                                if (cmp == 0) return guess;
index 6c26e8795f62cf037c1eddafeec9a8dd8ce73aa3..339e63c9aa2079d44290b9a939defd982c23c329 100644 (file)
@@ -40,30 +40,33 @@ namespace System.Collections.ObjectModel
 #endif
        public class ObservableCollection<T> : Collection<T>, INotifyCollectionChanged, INotifyPropertyChanged {
                [Serializable]
-               sealed class Reentrant : IDisposable {
-                       private int count = 0;
+#if !MOBILE
+               [TypeForwardedFrom (Consts.WindowsBase_3_0)]
+#endif
+               sealed class SimpleMonitor : IDisposable {
+                       private int _busyCount;
 
-                       public Reentrant()
+                       public SimpleMonitor()
                        {
                        }
 
                        public void Enter()
                        {
-                               count++;
+                               _busyCount++;
                        }
 
                        public void Dispose()
                        {
-                               count--;
+                               _busyCount--;
                        }
 
                        public bool Busy
                        {
-                               get { return count > 0; }
+                               get { return _busyCount > 0; }
                        }
                }
 
-               private Reentrant reentrant = new Reentrant ();
+               private SimpleMonitor _monitor = new SimpleMonitor ();
 
                public ObservableCollection ()
                {
@@ -83,7 +86,9 @@ namespace System.Collections.ObjectModel
                {
                }
 
+               [field:NonSerialized]
                public virtual event NotifyCollectionChangedEventHandler CollectionChanged;
+               [field:NonSerialized]
                protected virtual event PropertyChangedEventHandler PropertyChanged;
 
                event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged {
@@ -93,8 +98,8 @@ namespace System.Collections.ObjectModel
 
                protected IDisposable BlockReentrancy ()
                {
-                       reentrant.Enter ();
-                       return reentrant;
+                       _monitor.Enter ();
+                       return _monitor;
                }
 
                protected void CheckReentrancy ()
@@ -102,7 +107,7 @@ namespace System.Collections.ObjectModel
                        NotifyCollectionChangedEventHandler eh = CollectionChanged;
 
                        // Only have a problem if we have more than one event listener.
-                       if (reentrant.Busy && eh != null && eh.GetInvocationList ().Length > 1)
+                       if (_monitor.Busy && eh != null && eh.GetInvocationList ().Length > 1)
                                throw new InvalidOperationException ("Cannot modify the collection while reentrancy is blocked.");
                }
 
index 05b1ff31f54e49d09bb893fcd86a6f893e35eb58..11a7eda8a45ee9b9ae8631201dcf2a76a9313f9a 100644 (file)
@@ -752,16 +752,33 @@ namespace System.Net.Sockets {
                        }
 
                        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
-                               SettingsSection config;
-                               config = (SettingsSection) System.Configuration.ConfigurationManager.GetSection ("system.net/settings");
-                               if (config != null)
-                                       ipv6Supported = config.Ipv6.Enabled ? -1 : 0;
+                               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
-                               NetConfig config = System.Configuration.ConfigurationSettings.GetConfig("system.net/settings") as NetConfig;
-                               if (config != null)
-                                       ipv6Supported = config.ipv6Enabled ? -1 : 0;
+                               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) {
index edb0441b7231147d9296f8786e07a2846136363a..3354b2a8097d8b3117974c127b8b7bfab707e983 100644 (file)
@@ -549,7 +549,12 @@ namespace System.Net
                                if (local_path [0] == '/')
                                        local_path = local_path.Substring (1);
 
-                               Uri initial = new Uri ("ftp://dummy-host" + initial_path);
+                               UriBuilder initialBuilder = new UriBuilder () {
+                                       Scheme  = "ftp",
+                                       Host    = "dummy-host",
+                                       Path    = initial_path,
+                               };
+                               Uri initial = initialBuilder.Uri;
                                result = new Uri (initial, local_path).LocalPath;
                        }
 
index 5b0cd421c1d2b9022a3ddef10d260a55790a87ce..c6b4ca6ae3ed8130e527eb3e9789818d51a7b604 100644 (file)
@@ -58,24 +58,17 @@ namespace System.Net
                static HybridDictionary prefixes = new HybridDictionary ();
                static bool isDefaultWebProxySet;
                static IWebProxy defaultWebProxy;
-
-#if !NET_2_1           
                static RequestCachePolicy defaultCachePolicy;
-#endif         
-               // Constructors
-               
+
                static WebRequest ()
                {
-#if NET_2_1
+#if MOBILE
                        IWebRequestCreate http = new HttpRequestCreator ();
                        RegisterPrefix ("http", http);
                        RegisterPrefix ("https", http);
-       #if MOBILE
                        RegisterPrefix ("file", new FileWebRequestCreator ());
                        RegisterPrefix ("ftp", new FtpRequestCreator ());
-       #endif
 #else
-                       defaultCachePolicy = new HttpRequestCachePolicy (HttpRequestCacheLevel.NoCacheNoStore);
        #if CONFIGURATION_DEP
                        object cfg = ConfigurationManager.GetSection ("system.net/webRequestModules");
                        WebRequestModulesSection s = cfg as WebRequestModulesSection;
@@ -137,7 +130,6 @@ namespace System.Net
                        set { throw GetMustImplement (); }
                }
 
-#if !NET_2_1
                [MonoTODO ("Implement the caching system. Currently always returns a policy with the NoCacheNoStore level")]
                public virtual RequestCachePolicy CachePolicy
                {
@@ -146,14 +138,14 @@ namespace System.Net
                        }
                }
                
-               public static RequestCachePolicy DefaultCachePolicy
-               {
-                       get { return defaultCachePolicy; }
+               public static RequestCachePolicy DefaultCachePolicy {
+                       get {
+                               return defaultCachePolicy ?? (defaultCachePolicy = new HttpRequestCachePolicy (HttpRequestCacheLevel.NoCacheNoStore));
+                       }
                        set {
                                throw GetMustImplement ();
                        }
                }
-#endif
                
                public virtual WebHeaderCollection Headers { 
                        get { throw GetMustImplement (); }
index c9eea9c165b380e9e9477f48729589ac7a55ca6f..02e3dc71c0e1764351ba339c28a7fa9bc3250cc7 100644 (file)
@@ -181,24 +181,45 @@ namespace MonoTests.Microsoft.CSharp
                [Test]
                public void AttributeAndGlobalNamespaceWithImportTest ()
                {
-                       var import = new CodeNamespaceImport ("Z");
-                       AddGlobalNamespaceWithImport (codeUnit, import);
-                       AddAssemblyAttribute (codeUnit, "A");
-
-                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
-                               "using Z;{0}{0}[assembly: A()]{0}{0}", NewLine), Generate ());
-               }
-
-               private static void AddGlobalNamespaceWithImport (CodeCompileUnit codeUnit, CodeNamespaceImport import) {
                        CodeNamespace ns = new CodeNamespace ();
-                       ns.Imports.Add (import);
+                       ns.Imports.Add (new CodeNamespaceImport ("Z"));
+                       ns.Imports.Add (new CodeNamespaceImport ("A"));
                        codeUnit.Namespaces.Add (ns);
-               }
 
-               private static void AddAssemblyAttribute (CodeCompileUnit codeUnit, string attributeName) {
                        CodeAttributeDeclaration attrDec = new CodeAttributeDeclaration ();
-                       attrDec.Name = attributeName;
+                       attrDec.Name = "A";
                        codeUnit.AssemblyCustomAttributes.Add (attrDec);
+
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "using A;{0}using Z;{0}{0}[assembly: A()]{0}{0}{0}", NewLine), Generate ());
+               }
+
+               [Test]
+               public void GlobalAttributeBeforeType ()
+               {
+                       StringWriter writer = new StringWriter ();
+                       writer.NewLine = NewLine;
+
+                       codeUnit = new CodeCompileUnit () {
+                               AssemblyCustomAttributes = {
+                                       new CodeAttributeDeclaration (
+                                               new CodeTypeReference (typeof (CLSCompliantAttribute)),
+                                               new CodeAttributeArgument (new CodePrimitiveExpression (false))),
+                               },
+                               Namespaces = {
+                                       new CodeNamespace () {
+                                               Types = {
+                                                       new CodeTypeDeclaration ("Resources"),
+                                               },
+                                       }
+                               },
+                       };
+
+                       generator.GenerateCodeFromCompileUnit (codeUnit, writer, options);
+                       writer.Close ();
+
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "[assembly: System.CLSCompliantAttribute(false)]{0}{0}{0}{0}public class Resources {{{0}}}{0}", NewLine), Generate ());
                }
        }
 }
index 611df7bf51450b09604ce05414ece68ad2b705e9..44797640651c31745e21743823130c9c33b91ec3 100644 (file)
@@ -32,7 +32,7 @@ namespace MonoTests.System.Net
                        site1Dot = "96.126.105.110",\r
                        site2Name = "info.diku.dk",\r
                        site2Dot = "130.225.96.4",\r
-                       noneExistingSite = "www.unlikely.novell.com";\r
+                       noneExistingSite = "unlikely.xamarin.com";\r
                private uint site1IP = 1852407392, site2IP = 2195808260; // Big-Endian\r
 \r
                [Test]\r
index 7c05b4224d0b4a10ab36b3428ba49fab975ec88c..2fc05090ef4253afc62cc57d7f9936a64063c807 100644 (file)
@@ -203,7 +203,11 @@ namespace MonoTests.System.Net
                [Test]
                public void DownloadFile1 ()
                {
-                       ServerDownload sp = new ServerDownload ();
+                       DownloadFile (new ServerDownload ());
+               }
+
+               void DownloadFile (ServerDownload sp)
+               {
                        sp.Start ();
                        string uri = String.Format ("ftp://{0}:{1}/file.txt", sp.IPAddress, sp.Port);
                        try {
@@ -228,6 +232,14 @@ namespace MonoTests.System.Net
                        }
                }
 
+               [Test]
+               public void DownloadFile2 ()
+               {
+                       // Some embedded FTP servers in Industrial Automation Hardware report
+                       // the PWD using backslashes, but allow forward slashes for CWD.
+                       DownloadFile (new ServerDownload (@"\Users\someuser", "/Users/someuser/"));
+               }
+
                [Test]
                public void DeleteFile1 ()
                {
@@ -377,6 +389,20 @@ namespace MonoTests.System.Net
                }
 
                class ServerDownload : FtpServer {
+
+                       string Pwd, Cwd;
+
+                       public ServerDownload ()
+                               : this (null, null)
+                       {
+                       }
+
+                       public ServerDownload (string pwd, string cwd)
+                       {
+                               Pwd = pwd ?? "/home/someuser";
+                               Cwd = cwd ?? "/home/someuser/";
+                       }
+
                        protected override void Run ()
                        {
                                Socket client = control.Accept ();
@@ -388,7 +414,7 @@ namespace MonoTests.System.Net
                                        return;
                                }
 
-                               if (!DoInitialDialog (writer, reader, "/home/someuser", "/home/someuser/")) {
+                               if (!DoInitialDialog (writer, reader, Pwd, Cwd)) {
                                        client.Close ();
                                        return;
                                }
diff --git a/mcs/class/System/mobile_static_System.dll.sources b/mcs/class/System/mobile_static_System.dll.sources
new file mode 100644 (file)
index 0000000..7bb9316
--- /dev/null
@@ -0,0 +1,76 @@
+#include mobile_System.dll.sources
+MonoTouch/MonoPInvokeCallbackAttribute.cs
+../Mono.Security/Mono.Security.Authenticode/PrivateKey.cs
+../Mono.Security/Mono.Security.Cryptography/MD5SHA1.cs
+../Mono.Security/Mono.Security.Cryptography/TlsHMAC.cs
+../Mono.Security/Mono.Security.Protocol.Ntlm/ChallengeResponse.cs
+../Mono.Security/Mono.Security.Protocol.Ntlm/ChallengeResponse2.cs
+../Mono.Security/Mono.Security.Protocol.Ntlm/MessageBase.cs
+../Mono.Security/Mono.Security.Protocol.Ntlm/NtlmAuthLevel.cs
+../Mono.Security/Mono.Security.Protocol.Ntlm/NtlmFlags.cs
+../Mono.Security/Mono.Security.Protocol.Ntlm/Type1Message.cs
+../Mono.Security/Mono.Security.Protocol.Ntlm/Type2Message.cs
+../Mono.Security/Mono.Security.Protocol.Ntlm/Type3Message.cs
+../Mono.Security/Mono.Security.Protocol.Tls/Alert.cs
+../Mono.Security/Mono.Security.Protocol.Tls/CipherAlgorithmType.cs
+../Mono.Security/Mono.Security.Protocol.Tls/CipherSuite.cs
+../Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteCollection.cs
+../Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteFactory.cs
+../Mono.Security/Mono.Security.Protocol.Tls/ClientContext.cs
+../Mono.Security/Mono.Security.Protocol.Tls/ClientRecordProtocol.cs
+../Mono.Security/Mono.Security.Protocol.Tls/ClientSessionCache.cs
+../Mono.Security/Mono.Security.Protocol.Tls/ContentType.cs
+../Mono.Security/Mono.Security.Protocol.Tls/Context.cs
+../Mono.Security/Mono.Security.Protocol.Tls/DebugHelper.cs
+../Mono.Security/Mono.Security.Protocol.Tls/ExchangeAlgorithmType.cs
+../Mono.Security/Mono.Security.Protocol.Tls/HandshakeState.cs
+../Mono.Security/Mono.Security.Protocol.Tls/HashAlgorithmType.cs
+../Mono.Security/Mono.Security.Protocol.Tls/HttpsClientStream.cs
+../Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs
+../Mono.Security/Mono.Security.Protocol.Tls/RSASslSignatureDeformatter.cs
+../Mono.Security/Mono.Security.Protocol.Tls/RSASslSignatureFormatter.cs
+../Mono.Security/Mono.Security.Protocol.Tls/SecurityCompressionType.cs
+../Mono.Security/Mono.Security.Protocol.Tls/SecurityParameters.cs
+../Mono.Security/Mono.Security.Protocol.Tls/SecurityProtocolType.cs
+../Mono.Security/Mono.Security.Protocol.Tls/ServerContext.cs
+../Mono.Security/Mono.Security.Protocol.Tls/ServerRecordProtocol.cs
+../Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs
+../Mono.Security/Mono.Security.Protocol.Tls/SslCipherSuite.cs
+../Mono.Security/Mono.Security.Protocol.Tls/SslHandshakeHash.cs
+../Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs
+../Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs
+../Mono.Security/Mono.Security.Protocol.Tls/TlsCipherSuite.cs
+../Mono.Security/Mono.Security.Protocol.Tls/TlsClientSettings.cs
+../Mono.Security/Mono.Security.Protocol.Tls/TlsException.cs
+../Mono.Security/Mono.Security.Protocol.Tls/TlsServerSettings.cs
+../Mono.Security/Mono.Security.Protocol.Tls/TlsStream.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake/ClientCertificateType.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeMessage.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeType.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientHello.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificateRequest.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHelloDone.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificate.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificateVerify.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientFinished.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientKeyExchange.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificate.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificateRequest.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerFinished.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHello.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHelloDone.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerKeyExchange.cs
+../Mono.Security/Mono.Security.X509.Extensions/AuthorityKeyIdentifierExtension.cs
+../Mono.Security/Mono.Security.X509.Extensions/ExtendedKeyUsageExtension.cs
+../Mono.Security/Mono.Security.X509.Extensions/GeneralNames.cs
+../Mono.Security/Mono.Security.X509.Extensions/NetscapeCertTypeExtension.cs
+../Mono.Security/Mono.Security.X509.Extensions/SubjectAltNameExtension.cs
index 1ea166cd9ac3134a1165f5513852e53a8112fb9d..2ec5f3be0b489652f82eb7d21ab39be1c4241b0c 100644 (file)
@@ -42,31 +42,31 @@ namespace System.Collections.ObjectModel
 {
        [Serializable]
        public class ObservableCollection<T> : Collection<T>, INotifyCollectionChanged, INotifyPropertyChanged {
-               
-               private class Reentrant : IDisposable {
-                       private int count = 0;
+               [Serializable]
+               sealed class SimpleMonitor : IDisposable {
+                       private int _busyCount;
 
-                       public Reentrant()
+                       public SimpleMonitor()
                        {
                        }
 
                        public void Enter()
                        {
-                               count++;
+                               _busyCount++;
                        }
 
                        public void Dispose()
                        {
-                               count--;
+                               _busyCount--;
                        }
 
                        public bool Busy
                        {
-                               get { return count > 0; }
+                               get { return _busyCount > 0; }
                        }
                }
 
-               private Reentrant reentrant = new Reentrant ();
+               private SimpleMonitor _monitor = new SimpleMonitor ();
 
                public ObservableCollection()
                {
@@ -86,7 +86,9 @@ namespace System.Collections.ObjectModel
                {
                }
 
+               [field:NonSerialized]
                public virtual event NotifyCollectionChangedEventHandler CollectionChanged;
+               [field:NonSerialized]
                protected virtual event PropertyChangedEventHandler PropertyChanged;
 
                event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged {
@@ -96,8 +98,8 @@ namespace System.Collections.ObjectModel
 
                protected IDisposable BlockReentrancy ()
                {
-                       reentrant.Enter ();
-                       return reentrant;
+                       _monitor.Enter ();
+                       return _monitor;
                }
 
                protected void CheckReentrancy ()
@@ -105,7 +107,7 @@ namespace System.Collections.ObjectModel
                        NotifyCollectionChangedEventHandler eh = CollectionChanged;
 
                        // Only have a problem if we have more than one event listener.
-                       if (reentrant.Busy && eh != null && eh.GetInvocationList ().Length > 1)
+                       if (_monitor.Busy && eh != null && eh.GetInvocationList ().Length > 1)
                                throw new InvalidOperationException ("Cannot modify the collection while reentrancy is blocked.");
                }
 
index dd231d584799095a03a99e00321c9ef6e340e00b..0cf61b786f3b642c727451ce5baa00ddd8afdeee 100644 (file)
@@ -106,13 +106,18 @@ $(TEST_RESX_RESOURCES) $(TEST_RESX_RESOURCES_SATELITE): %.resources: %.resx
 
 TEST_RESOURCES = $(TEST_RESX_RESOURCES) $(TEST_RESX_RESOURCES_SATELITE)
 
-$(test_lib): $(TEST_RESOURCES) satellite-assemblies
+satellite_assembly1 = es-ES/$(patsubst %.dll,%.Resources.dll,$(test_lib))
+satellite_assembly2 = nn-NO/$(patsubst %.dll,%.Resources.dll,$(test_lib))
 
-satellite-assemblies:
+$(test_lib): $(TEST_RESOURCES) $(satellite_assembly1) $(satellite_assembly2) 
+
+$(satellite_assembly1): Test/resources/culture-es-ES.cs Test/resources/Resources.es-ES.resources
        @mkdir -p es-ES
-       $(CSCOMPILE) -target:library -r:$(corlib) Test/resources/culture-es-ES.cs -resource:Test/resources/Resources.es-ES.resources -out:es-ES/$(patsubst %.dll,%.Resources.dll,$(test_lib))
+       $(CSCOMPILE) -target:library -r:$(corlib) Test/resources/culture-es-ES.cs -resource:Test/resources/Resources.es-ES.resources -out:$@
+
+$(satellite_assembly2): Test/resources/culture-nn-NO.cs Test/resources/Resources.nn-NO.resources
        @mkdir -p nn-NO
-       $(CSCOMPILE) -target:library -r:$(corlib) Test/resources/culture-nn-NO.cs -resource:Test/resources/Resources.nn-NO.resources -out:nn-NO/$(patsubst %.dll,%.Resources.dll,$(test_lib))
+       $(CSCOMPILE) -target:library -r:$(corlib) Test/resources/culture-nn-NO.cs -resource:Test/resources/Resources.nn-NO.resources -out:$@
 
 vtsdir = Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization
 vtslibs = \
index d738574dc41d1319412ed6f43e725b2d5203b11b..9ce2574ebb18bb71eae8d5c98784f15f7d537702 100644 (file)
@@ -45,7 +45,7 @@ namespace System.Collections
 
                        int IEqualityComparer.GetHashCode (object obj)
                        {
-                               var comparer = obj as IEqualityComparer;
+                               var comparer = obj as IStructuralEquatable;
                                if (comparer != null)
                                        return comparer.GetHashCode (this);
 
@@ -54,7 +54,7 @@ namespace System.Collections
 
                        bool IEqualityComparer.Equals (object x, object y)
                        {
-                               var comparer = x as IEqualityComparer;
+                               var comparer = x as IStructuralEquatable;
                                if (comparer != null)
                                        return comparer.Equals (y, this);
 
index 98416dfa82f875a06a564fa7251b9d484c3c80df..62be3c834f4b45562475d9c863997efec66fbf76 100644 (file)
@@ -699,11 +699,14 @@ namespace System.IO
                                MemoryStream ms = new MemoryStream ();
                                FlushBuffer (ms);
                                ms.Write (array, offset, numBytes);
+
+                               // Set arguments to new compounded buffer 
                                offset = 0;
-                               numBytes = (int) ms.Length;
+                               array = ms.ToArray ();
+                               numBytes = array.Length;
                        }
 
-                       WriteDelegate w = new WriteDelegate (WriteInternal);
+                       WriteDelegate w = WriteInternal;
                        return w.BeginInvoke (array, offset, numBytes, userCallback, stateObject);                      
                }
                
index b0e6747bedfb9c6b0fbc0b6d5adfe86683fbcb3a..f9222cf88f210eceb921f7255b4bf33418e01f58 100644 (file)
@@ -351,7 +351,7 @@ namespace System.Reflection.Emit {
                                throw new InvalidOperationException ("Method '" + Name + "' does not have a method body.");
                        }
                        if (ilgen != null)
-                               ilgen.label_fixup ();
+                               ilgen.label_fixup (this);
                }
                
                internal void GenerateDebugInfo (ISymbolWriter symbolWriter)
index 5805c00c31df77d87aeacf23ed517c1f777c0fc4..b4915cced0454f49d01a199c18d40c1de134a084 100644 (file)
@@ -138,7 +138,7 @@ namespace System.Reflection.Emit {
                                if (ilgen == null || ilgen.ILOffset == 0)
                                        throw new InvalidOperationException ("Method '" + name + "' does not have a method body.");
 
-                               ilgen.label_fixup ();
+                               ilgen.label_fixup (this);
 
                                // Have to create all DynamicMethods referenced by this one
                                try {
index 1c9c3f4c3d16840e8c7dc1fd7d48788961204aa6..b939ab6cffeba64c1c1cd0188b2dbf493841631d 100644 (file)
@@ -988,11 +988,11 @@ namespace System.Reflection.Emit {
                        throw new NotImplementedException ();
                }
 
-               internal void label_fixup ()
+               internal void label_fixup (MethodBase mb)
                {
                        for (int i = 0; i < num_fixups; ++i) {
                                if (labels [fixups [i].label_idx].addr < 0)
-                                       throw new ArgumentException ("Label not marked");
+                                       throw new ArgumentException (string.Format ("Label #{0} is not marked in method `{1}'", fixups [i].label_idx + 1, mb.Name));
                                // Diff is the offset from the end of the jump instruction to the address of the label
                                int diff = labels [fixups [i].label_idx].addr - (fixups [i].pos + fixups [i].offset);
                                if (fixups [i].offset == 1) {
index f898bce399eb886a6b859be14904151e1e607c7a..2ea94ea525373b6bf179a3b623cfb462e071a136 100644 (file)
@@ -354,7 +354,7 @@ namespace System.Reflection.Emit
                                                                                            DeclaringType.FullName, Name));
                        }
                        if (ilgen != null)
-                               ilgen.label_fixup ();
+                               ilgen.label_fixup (this);
                }
                
                internal void GenerateDebugInfo (ISymbolWriter symbolWriter)
index 0b0cd4c6fb48ecaab882e42b1743cdc0f2856e30..f069ecbcc908ed1f440cc64ac4e9d5673a222028 100644 (file)
@@ -322,15 +322,10 @@ namespace System.Reflection {
                        return attrs;
                }
 
-               static bool ShouldPrintFullName (Type type) {
-                       return type.IsGenericType || (type.IsClass && (!type.IsPointer ||
-                               (!type.GetElementType ().IsPrimitive && !type.GetElementType ().IsNested)));
-               }
-
                public override string ToString () {
                        StringBuilder sb = new StringBuilder ();
                        Type retType = ReturnType;
-                       if (ShouldPrintFullName (retType))
+                       if (Type.ShouldPrintFullName (retType))
                                sb.Append (retType.ToString ());
                        else
                                sb.Append (retType.Name);
@@ -347,21 +342,10 @@ namespace System.Reflection {
                                sb.Append ("]");
                        }
                        sb.Append ("(");
-                       ParameterInfo[] p = GetParametersInternal ();
-                       for (int i = 0; i < p.Length; ++i) {
-                               if (i > 0)
-                                       sb.Append (", ");
-                               Type pt = p[i].ParameterType;
-                               bool byref = pt.IsByRef;
-                               if (byref)
-                                       pt = pt.GetElementType ();
-                               if (ShouldPrintFullName (pt))
-                                       sb.Append (pt.ToString ());
-                               else
-                                       sb.Append (pt.Name);
-                               if (byref)
-                                       sb.Append (" ByRef");
-                       }
+
+                       var p = GetParametersInternal ();
+                       ParameterInfo.FormatParameters (sb, p);
+
                        if ((CallingConvention & CallingConventions.VarArgs) != 0) {
                                if (p.Length > 0)
                                        sb.Append (", ");
index 9760c197006acd4dc2517510a8ed403b93e708a4..4b9962e3eed43be436c014652a2743c5c559d99b 100644 (file)
@@ -1,13 +1,14 @@
 //
-// System.Reflection/MonoProperty.cs
-// The class used to represent Properties from the mono runtime.
+// MonoProperty.cs: The class used to represent Properties from the mono runtime.
 //
-// Author:
+// Authors:
 //   Paolo Molaro (lupus@ximian.com)
 //   Patrik Torstensson (patrik.torstensson@labs2.com)
+//   Marek Safar (marek.safar@gmail.com)
 //
 // (C) 2001 Ximian, Inc.  http://www.ximian.com
 // Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
+// Copyright 2013 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
@@ -35,6 +36,7 @@ using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 using System.Runtime.Serialization;
 using System.Security;
+using System.Text;
 
 namespace System.Reflection {
        
@@ -177,24 +179,25 @@ namespace System.Reflection {
                                return null;
                }
 
-               public override ParameterInfo[] GetIndexParameters()
+               public override ParameterInfo[] GetIndexParameters ()
                {
                        CachePropertyInfo (PInfo.GetMethod | PInfo.SetMethod);
-                       ParameterInfo[] res;
+                       ParameterInfo[] src;
+                       int length;
                        if (info.get_method != null) {
-                               res = info.get_method.GetParameters ();
+                               src = info.get_method.GetParametersInternal ();
+                               length = src.Length;
                        } else if (info.set_method != null) {
-                               ParameterInfo[] src = info.set_method.GetParametersInternal ();
-                               res = new ParameterInfo [src.Length - 1];
-                               Array.Copy (src, res, res.Length);
+                               src = info.set_method.GetParametersInternal ();
+                               length = src.Length - 1;
                        } else
                                return EmptyArray<ParameterInfo>.Value;
 
-                       for (int i = 0; i < res.Length; ++i) {
-                               ParameterInfo pinfo = res [i];
-                               res [i] = new ParameterInfo (pinfo, this);
+                       var dest = new ParameterInfo [length];
+                       for (int i = 0; i < length; ++i) {
+                               dest [i] = new ParameterInfo (src [i], this);
                        }
-                       return res;     
+                       return dest;    
                }
                
                public override MethodInfo GetSetMethod (bool nonPublic)
@@ -363,8 +366,27 @@ namespace System.Reflection {
                        method.Invoke (obj, invokeAttr, binder, parms, culture);
                }
 
-               public override string ToString () {
-                       return PropertyType.ToString () + " " + Name;
+               public override string ToString ()
+               {
+                       var sb = new StringBuilder ();
+
+                       Type retType = PropertyType;
+                       if (Type.ShouldPrintFullName (retType))
+                               sb.Append (retType.ToString ());
+                       else
+                               sb.Append (retType.Name);
+
+                       sb.Append (" ");
+                       sb.Append (Name);
+
+                       var pi = GetIndexParameters ();
+                       if (pi.Length > 0) {
+                               sb.Append (" [");
+                               ParameterInfo.FormatParameters (sb, pi);
+                               sb.Append ("]");
+                       }
+
+                       return sb.ToString ();
                }
 
                public override Type[] GetOptionalCustomModifiers () {
index f62ef54f19ee6a715e08c3f441353515b7efa93c..cbefc3ac27710d380be4edce0c1a5710f3676a8d 100644 (file)
@@ -1,9 +1,12 @@
 // System.Reflection.ParameterInfo
 //
-// Sean MacIsaac (macisaac@ximian.com)
+// Authors:
+//   Sean MacIsaac (macisaac@ximian.com)
+//   Marek Safar (marek.safar@gmail.com)
 //
 // (C) 2001 Ximian, Inc.
 // Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
+// Copyright 2013 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
@@ -31,6 +34,7 @@ using System.Reflection.Emit;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 using System.Collections.Generic;
+using System.Text;
 
 namespace System.Reflection
 {
@@ -93,6 +97,7 @@ namespace System.Reflection
                        this.NameImpl = pinfo.Name;
                        this.PositionImpl = pinfo.Position;
                        this.AttrsImpl = pinfo.Attributes;
+                       this.DefaultValueImpl = pinfo.DefaultValueImpl;
                        //this.parent = pinfo;
                }
 
@@ -124,6 +129,27 @@ namespace System.Reflection
                        return result;
                }
 
+               internal static void FormatParameters (StringBuilder sb, ParameterInfo[] p)
+               {
+                       for (int i = 0; i < p.Length; ++i) {
+                               if (i > 0)
+                                       sb.Append (", ");
+
+                               Type pt = p[i].ParameterType;
+                               bool byref = pt.IsByRef;
+                               if (byref)
+                                       pt = pt.GetElementType ();
+
+                               if (Type.ShouldPrintFullName (pt))
+                                       sb.Append (pt.ToString ());
+                               else
+                                       sb.Append (pt.Name);
+
+                               if (byref)
+                                       sb.Append (" ByRef");
+                       }
+               }
+
                public virtual Type ParameterType {
                        get {return ClassImpl;}
                }
index 5133e20351d14bafb5dad9755472cee980f7d942..62aa14fddc4c24f58a2cd2ba249805979417c1a1 100644 (file)
@@ -214,7 +214,6 @@ namespace System.Threading.Tasks
                internal void RunSynchronouslyCore (TaskScheduler scheduler)
                {
                        SetupScheduler (scheduler);
-                       var saveStatus = status;
                        Status = TaskStatus.WaitingToRun;
 
                        try {
@@ -224,8 +223,7 @@ namespace System.Threading.Tasks
                                throw new TaskSchedulerException (inner);
                        }
 
-                       Status = saveStatus;
-                       Start (scheduler);
+                       Schedule ();
                        Wait ();
                }
                #endregion
@@ -960,7 +958,7 @@ namespace System.Threading.Tasks
                                throw new ArgumentOutOfRangeException ("millisecondsDelay");
 
                        var task = new Task (TaskActionInvoker.Delay, millisecondsDelay, cancellationToken, TaskCreationOptions.None, null, TaskConstants.Finished);
-                       task.SetupScheduler (TaskScheduler.Current);
+                       task.SetupScheduler (TaskScheduler.Default);
                        
                        if (millisecondsDelay != Timeout.Infinite)
                                task.scheduler.QueueTask (task);
index 8fd3dfd96b6764b70d651f14aafa97e8b42d36d0..813c458f94934936e1ef7054b9de7f1200db2028 100644 (file)
@@ -903,14 +903,11 @@ namespace System.Threading {
 
                public bool TrySetApartmentState (ApartmentState state) 
                {
-                       /* Only throw this exception when changing the
-                        * state of another thread.  See bug 324338
-                        */
-                       if ((this != CurrentThread) &&
-                           (ThreadState & ThreadState.Unstarted) == 0)
+                       if ((ThreadState & ThreadState.Unstarted) == 0)
                                throw new ThreadStateException ("Thread was in an invalid state for the operation being executed.");
 
-                       if ((ApartmentState)Internal.apartment_state != ApartmentState.Unknown)
+                       if ((ApartmentState)Internal.apartment_state != ApartmentState.Unknown && 
+                           (ApartmentState)Internal.apartment_state != state)
                                return false;
 
                        Internal.apartment_state = (byte)state;
index 22786f6588110e200e7f0d68be9cecc9bdcab734..63358776056a619725b9684e8ad5935200d1efc2 100644 (file)
@@ -311,13 +311,10 @@ namespace System.Threading
                                return idx;
                        }
 
-                       static WaitCallback TimerCaller = new WaitCallback (TimerCB);
                        static void TimerCB (object o)
                        {
                                Timer timer = (Timer) o;
-                               try {
-                                       timer.callback (timer.state);
-                               } catch {}
+                               timer.callback (timer.state);
                        }
 
                        void SchedulerThread ()
@@ -340,7 +337,7 @@ namespace System.Threading
                                                        list.RemoveAt (i);
                                                        count--;
                                                        i--;
-                                                       ThreadPool.UnsafeQueueUserWorkItem (TimerCaller, timer);
+                                                       ThreadPool.UnsafeQueueUserWorkItem (TimerCB, timer);
                                                        long period = timer.period_ms;
                                                        long due_time = timer.due_time_ms;
                                                        bool no_more = (period == -1 || ((period == 0 || period == Timeout.Infinite) && due_time != Timeout.Infinite));
index 9eba75f6ed50085d8b3c6d6b0312506aeb0a8f71..08f8a4c1da1bfe92ecd879883d42b60b86374e1e 100644 (file)
@@ -94,12 +94,6 @@ namespace System
                private static TextWriter stderr;
                private static TextReader stdin;
 
-#if NET_4_5 && !MOBILE
-               static TextWriter console_stdout;
-               static TextWriter console_stderr;
-               static TextReader console_stdin;
-#endif
-
                static Console ()
                {
 #if NET_2_1
@@ -161,7 +155,7 @@ namespace System
 // FULL_AOT_RUNTIME is used (instead of MONOTOUCH) since we only want this code when running on 
 // iOS (simulator or devices) and *not* when running tools (e.g. btouch #12179) that needs to use 
 // the mscorlib.dll shipped with Xamarin.iOS
-#if FULL_AOT_RUNTIME
+#if MONOTOUCH && FULL_AOT_RUNTIME
                                stdout = new NSLogWriter ();
 #else
                                stdout = new UnexceptionalStreamWriter (OpenStandardOutput (0), outputEncoding);
@@ -169,7 +163,7 @@ namespace System
 #endif
                                stdout = TextWriter.Synchronized (stdout, true);
 
-#if FULL_AOT_RUNTIME
+#if MONOTOUCH && FULL_AOT_RUNTIME
                                stderr = new NSLogWriter ();
 #else
                                stderr = new UnexceptionalStreamWriter (OpenStandardError (0), outputEncoding); 
@@ -183,12 +177,6 @@ namespace System
                        }
 #endif
 
-#if NET_4_5 && !MOBILE
-                       console_stderr = stderr;
-                       console_stdout = stdout;
-                       console_stdin = stdin;
-#endif
-
 #if MONODROID
                        if (LogcatTextWriter.IsRunningOnAndroid ()) {
                                stdout = TextWriter.Synchronized (new LogcatTextWriter ("mono-stdout", stdout));
@@ -676,19 +664,19 @@ namespace System
 #if NET_4_5
                public static bool IsErrorRedirected {
                        get {
-                               return stderr != console_stderr || ConsoleDriver.IsErrorRedirected;
+                               return ConsoleDriver.IsErrorRedirected;
                        }
                }
 
                public static bool IsOutputRedirected {
                        get {
-                               return stdout != console_stdout || ConsoleDriver.IsOutputRedirected;
+                               return ConsoleDriver.IsOutputRedirected;
                        }
                }
 
                public static bool IsInputRedirected {
                        get {
-                               return stdin != console_stdin || ConsoleDriver.IsInputRedirected;
+                               return ConsoleDriver.IsInputRedirected;
                        }
                }
 #endif
index 42ff390b6d74f46bcc977c0a2acffeef1a74b9ed..cc461c2913981cd117b8507ada4ec01794ec6c08 100644 (file)
@@ -38,7 +38,7 @@
 using System.Runtime.InteropServices;
 using System.Security.Cryptography;
 using System.Text;
-#if FULL_AOT_RUNTIME
+#if MONOTOUCH
 using Crimson.CommonCrypto;
 #endif
 
@@ -48,7 +48,7 @@ namespace System {
        [StructLayout (LayoutKind.Sequential)]
        [ComVisible (true)]
        public struct Guid : IFormattable, IComparable, IComparable<Guid>, IEquatable<Guid> {
-#if FULL_AOT_RUNTIME
+#if MONOTOUCH
                static Guid () {
                        if (MonoTouchAOTHelper.FalseFlag) {
                                var comparer = new System.Collections.Generic.GenericComparer <Guid> ();
@@ -472,6 +472,15 @@ namespace System {
                private static RandomNumberGenerator _fastRng;
 #endif
 
+#if FULL_AOT_RUNTIME && !MONOTOUCH
+               // NSA approved random generator.
+               static void LameRandom (byte [] b)
+               {
+                       var r = new Random ();
+                       r.NextBytes (b);
+               }
+#endif
+               
                // generated as per section 3.4 of the specification
                public static Guid NewGuid ()
                {
@@ -483,8 +492,10 @@ namespace System {
                                        _rng = RandomNumberGenerator.Create ();
                                _rng.GetBytes (b);
                        }
-#else
+#elif MONOTOUCH
                        Cryptor.GetRandom (b);
+#else
+                       LameRandom (b);
 #endif
 
                        Guid res = new Guid (b);
index 4c8ea8d7481cd4f1a3b6d8f140f2aff79fe1d7f2..d30735f9bdbad34a0239933209a4997f4609a14d 100644 (file)
@@ -1694,9 +1694,9 @@ namespace System
                        case StringComparison.InvariantCultureIgnoreCase:
                                return CultureInfo.InvariantCulture.CompareInfo.IsSuffix (this, value, CompareOptions.IgnoreCase);
                        case StringComparison.Ordinal:
-                               return CultureInfo.CurrentCulture.CompareInfo.IsSuffix (this, value, CompareOptions.Ordinal);
+                               return CultureInfo.InvariantCulture.CompareInfo.IsSuffix (this, value, CompareOptions.Ordinal);
                        case StringComparison.OrdinalIgnoreCase:
-                               return CultureInfo.CurrentCulture.CompareInfo.IsSuffix (this, value, CompareOptions.OrdinalIgnoreCase);
+                               return CultureInfo.InvariantCulture.CompareInfo.IsSuffix (this, value, CompareOptions.OrdinalIgnoreCase);
                        default:
                                string msg = Locale.GetText ("Invalid value '{0}' for StringComparison", comparisonType);
                                throw new ArgumentException (msg, "comparisonType");
index a45c3948878e5cf5c9cfc0ff2d04c3bc7ef6a8e3..1b6a28b7541ad9945bba7dfa3b227d7419e0211c 100644 (file)
@@ -1431,6 +1431,12 @@ namespace System {
                        return FullName;
                }
 
+               internal static bool ShouldPrintFullName (Type type)
+               {
+                       return type.IsGenericType || (type.IsClass && (!type.IsPointer ||
+                               (!type.GetElementType ().IsPrimitive && !type.GetElementType ().IsNested)));
+               }
+
                internal virtual Type InternalResolve ()
                {
                        return UnderlyingSystemType;
index 3cc7b18dfb8c1bbc02016ba4254fb2e24759db9c..8ac242b346e64ac4cfc6b37d96b88765f6c9470a 100644 (file)
@@ -247,7 +247,7 @@ namespace System
                                obj = Marshal.PtrToStringBSTR(Marshal.ReadIntPtr(addr));
                                break;
 // GetObjectForIUnknown is excluded from Marshal using FULL_AOT_RUNTIME
-#if !MONOTOUCH
+#if !DISABLE_COM
                        case VarEnum.VT_UNKNOWN:
                        case VarEnum.VT_DISPATCH:
                        {
diff --git a/mcs/class/corlib/Test/System.Collections/StructuralComparisonsTest.cs b/mcs/class/corlib/Test/System.Collections/StructuralComparisonsTest.cs
new file mode 100644 (file)
index 0000000..38c9ace
--- /dev/null
@@ -0,0 +1,55 @@
+//
+// StructuralComparisonsTest.cs
+//
+// Authors:
+//     Marek Safar  <marek.safar@gmail.com>
+//
+// Copyright (C) 2013 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.
+//
+
+#if NET_4_0
+
+using System.Collections;
+using NUnit.Framework;
+
+namespace MonoTests.System.Collections
+{
+       [TestFixture]
+       public class StructuralComparisonsTest
+       {
+               [Test]
+               public void EqualsTest ()
+               {
+                       int[] a1 = new[] { 9, 1, 3, 4 };
+                       int[] a2 = new[] { 9, 1, 3, 4 };
+
+                       Assert.IsTrue (StructuralComparisons.StructuralEqualityComparer.Equals (a1, a2), "#1");
+                       Assert.IsFalse (StructuralComparisons.StructuralEqualityComparer.Equals (null, a2), "#2");
+                       Assert.IsFalse (StructuralComparisons.StructuralEqualityComparer.Equals (a1, null), "#3");
+                       Assert.IsTrue (StructuralComparisons.StructuralEqualityComparer.Equals (null, null), "#4");
+                       Assert.IsTrue (StructuralComparisons.StructuralEqualityComparer.Equals (4, 4), "#5");
+                       Assert.IsFalse (StructuralComparisons.StructuralEqualityComparer.Equals (4, 5), "#6");
+               }
+       }
+}
+
+#endif
\ No newline at end of file
index 4a6ac7db8a086cc2b23c5206f3044aabf1d2d212..7714f53ab3251892b0f2e34cb38ca2f20cbcacb3 100644 (file)
@@ -571,6 +571,14 @@ namespace MonoTests.System.Globalization
                        Assert.AreEqual (31748, new CultureInfo ("zh-CHT").LCID);
                        Assert.AreEqual (31748, new CultureInfo ("zh-CHT").Parent.LCID);
                }
+
+               [Test]
+               [SetCulture ("zh-TW")]
+               public void ParentOfZh ()
+               {
+                       Assert.AreEqual (31748, CultureInfo.CurrentCulture.Parent.LCID);
+                       Assert.AreEqual (31748, CultureInfo.CurrentCulture.Parent.Parent.LCID);
+               }
                
                [Test]
                public void CurrentCulture ()
index a56c4f820c0f32c3622484ce75a828e201c37db7..51d352d0dd8a944b63eed2820537967feb06acad 100644 (file)
@@ -15,6 +15,7 @@ using System;
 using System.IO;
 using System.Runtime.InteropServices;
 using System.Text;
+using System.Threading;
 
 namespace MonoTests.System.IO
 {
@@ -1515,6 +1516,35 @@ namespace MonoTests.System.IO
                        stream.EndWrite (stream.BeginWrite (new byte[8], 0, 8, null, null));
                }
 
+               static IAsyncResult DoBeginWrite(Stream stream, ManualResetEvent mre, byte[] RandomBuffer)
+               {
+                       return stream.BeginWrite (RandomBuffer, 0, RandomBuffer.Length, ar => {
+                               stream.EndWrite (ar);
+
+                               // we don't supply an ManualResetEvent so this will throw an NRE on the second run
+                               // which nunit-console will ignore (but other test runners don't like that)
+                               if (mre == null)
+                                       return;
+
+                               DoBeginWrite (stream, null, RandomBuffer).AsyncWaitHandle.WaitOne ();
+                               mre.Set ();
+                       }, null);
+               }
+
+               [Test]
+               public void BeginWrite_Recursive ()
+               {
+                       string path = TempFolder + Path.DirectorySeparatorChar + "temp";
+                       DeleteFile (path);
+       
+                       using (FileStream stream = new FileStream (path, FileMode.OpenOrCreate, FileAccess.Write)) {
+                               var mre = new ManualResetEvent (false); 
+                               var RandomBuffer = new byte[1024];                      
+                               DoBeginWrite (stream, mre, RandomBuffer);
+                               Assert.IsTrue (mre.WaitOne (5000), "#1");
+                       }
+               }
+
                [Test]
                [Category("TargetJvmNotSupported")] // File locking not supported for TARGET_JVM
                [ExpectedException (typeof (ObjectDisposedException))]
index 54368c6cd45df8b8e18fefc43b3b4cb40848f0f5..67da2d7b5c864238748b83fe2fad23328acbc57e 100644 (file)
@@ -402,7 +402,7 @@ namespace MonoTests.System.Reflection
                        }
                }
 #endif
-#if NET_2_0
+
                public class A<T>
                {
                        public string Property {
@@ -438,8 +438,13 @@ namespace MonoTests.System.Reflection
                        PropertyInfo property = type.GetProperty ("Property");
                        Assert.AreEqual (typeof (string).FullName, property.GetValue (instance, null));
                }
-#endif
 
+               [Test]
+               public void ToStringTest ()
+               {
+                       var pa = typeof (TestC).GetProperty ("Item");
+                       Assert.AreEqual ("Int32 Item [System.Double[]]", pa.ToString ());
+               }
 
                static bool HasAttribute (object [] attrs, Type attributeType)
                {
@@ -523,5 +528,23 @@ namespace MonoTests.System.Reflection
                                Assert.IsTrue (ex.InnerException is ObjectDisposedException);
                        }
                }
+
+               public class DefaultValueTest
+               {
+                       public string this[int val, string param = "test"]
+                       {
+                               get{ return val + param; }
+                       }
+               }
+
+
+               [Test]
+               public void PropertyWithDefaultValue ()
+               {
+                       var parameters = typeof (DefaultValueTest).GetProperty ("Item").GetIndexParameters ();
+                       var defaultParam = parameters[parameters.Length - 1];
+                       Assert.AreEqual ("param", defaultParam.Name, "#1");
+                       Assert.AreEqual ("test", defaultParam.DefaultValue, "#2");
+               }
        }
 }
index 8c134680dc335c75399664066851b13b733ae0c1..d9811306fba9c568247bbfbbf888c2c5c636b4fd 100644 (file)
@@ -67,6 +67,25 @@ namespace MonoTests.System.Threading.Tasks
                        }
                }
 
+               class NonInlineableScheduler : TaskScheduler
+               {
+                       protected override IEnumerable<Task> GetScheduledTasks ()
+                       {
+                               throw new NotImplementedException ();
+                       }
+
+                       protected override void QueueTask (Task task)
+                       {
+                               if (!base.TryExecuteTask (task))
+                                       throw new ApplicationException ();
+                       }
+
+                       protected override bool TryExecuteTaskInline (Task task, bool taskWasPreviouslyQueued)
+                       {
+                               return false;
+                       }
+               }
+
 
                Task[] tasks;
                const int max = 6;
@@ -1638,6 +1657,16 @@ namespace MonoTests.System.Threading.Tasks
                        Assert.AreEqual ('d', d.Result, "#3r");
                }
 
+               [Test]
+               public void ContinueWith_CustomScheduleRejected ()
+               {
+                       var scheduler = new NonInlineableScheduler ();
+                       var t = Task.Factory.StartNew (delegate { }).
+                               ContinueWith (r => {}, CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, scheduler);
+                       
+                       Assert.IsTrue (t.Wait (5000));
+               }
+
                [Test]
                public void FromResult ()
                {
index 1c22314ccf171386036ecac4363a6a126ac9a471..7d483e6703458ba8b5c7642d063b6089b5551289 100644 (file)
@@ -1122,6 +1122,60 @@ namespace MonoTests.System.Threading
                        Assert.IsTrue (exception_occured, "Thread1 Started Invalid Exception Occured");
                }
 
+               [Test]
+               public void TestSetApartmentStateSameState ()
+               {
+                       Thread t1 = new Thread (new ThreadStart (Start));
+                       t1.SetApartmentState (ApartmentState.STA);
+                       Assert.AreEqual (ApartmentState.STA, t1.ApartmentState, "Thread1 Set Once");
+
+                       t1.SetApartmentState (ApartmentState.STA);
+                       Assert.AreEqual (ApartmentState.STA, t1.ApartmentState, "Thread1 Set twice");
+               }
+
+               [Test]
+               [ExpectedException(typeof(InvalidOperationException))]
+               public void TestSetApartmentStateDiffState ()
+               {
+                       Thread t1 = new Thread (new ThreadStart (Start));
+                       t1.SetApartmentState (ApartmentState.STA);
+                       Assert.AreEqual (ApartmentState.STA, t1.ApartmentState, "Thread1 Set Once");
+
+                       t1.SetApartmentState (ApartmentState.MTA);
+               }
+
+               [Test]
+               public void TestTrySetApartmentState ()
+               {
+                       Thread t1 = new Thread (new ThreadStart (Start));
+                       t1.SetApartmentState (ApartmentState.STA);
+                       Assert.AreEqual (ApartmentState.STA, t1.ApartmentState, "#1");
+
+                       bool result = t1.TrySetApartmentState (ApartmentState.MTA);
+                       Assert.IsFalse (result, "#2");
+
+                       result = t1.TrySetApartmentState (ApartmentState.STA);
+                       Assert.IsTrue (result, "#3");
+               }
+
+               [Test]
+               public void TestTrySetApartmentStateRunning ()
+               {
+                       Thread t1 = new Thread (new ThreadStart (Start));
+                       t1.SetApartmentState (ApartmentState.STA);
+                       Assert.AreEqual (ApartmentState.STA, t1.ApartmentState, "#1");
+
+                       t1.Start ();
+
+                       try {
+                               t1.TrySetApartmentState (ApartmentState.STA);
+                               Assert.Fail ("#2");
+                       } catch (ThreadStateException) {
+                       }
+
+                       t1.Join ();
+               }
+
                [Test]
                public void Volatile () {
                        double v3 = 55667;
index 67737cbef0f7dbd51622aea789f61b762c849aad..dc6d4e50dac2c0961c4ee17f1878b5efabd2aed1 100644 (file)
@@ -197,9 +197,13 @@ namespace MonoTests.System.Threading {
                        
                }
 
+#if !MONOTOUCH
                [Test]
                public void TestDisposeOnCallback ()
                {
+                       // this test is bad, as the provided `state` (t1) is null and will throw an NRE inside the callback
+                       // that was ignored before 238785a3e3d510528228fc551625975bc508c2f3 and most unit test runner won't
+                       // report it since the NRE will not happen on the main thread (but Touch.Unit will)
                        Timer t1 = null;
                        t1 = new Timer (new TimerCallback (CallbackTestDisposeOnCallback), t1, 0, 10);
                        Thread.Sleep (200);
@@ -211,7 +215,8 @@ namespace MonoTests.System.Threading {
                {
                        ((Timer) foo).Dispose ();
                }
-               
+#endif
+
                private void Callback (object foo)
                {
                        Bucket b = foo as Bucket;
index 25562126ee9f151c50c4eb67f945b54662408ba3..98a0d1aa26639fa1fbe83e8c8bad415863e711d6 100644 (file)
@@ -331,6 +331,21 @@ public class ConsoleTest
        }
 
 #if !MOBILE
+
+#if NET_4_5
+       [Test]
+       public void RedirectedTest ()
+       {
+               if (Console.IsErrorRedirected) {
+                       // Assert.Inconclusive ();
+                       return;
+               }
+
+               Console.SetError (TextWriter.Null);
+               Assert.IsFalse (Console.IsErrorRedirected);
+       }
+#endif
+
        // Bug 678357
        [Test]
        public void EncodingTest ()
index ed7f3c7bf26c66a5fc594baabb6807a5962b5ab6..0ac74a6812b2a68db0826ae48e9781eb80bb29ac 100644 (file)
@@ -39,6 +39,7 @@ System.Collections/QueueTest.cs
 System.Collections/ReadOnlyCollectionBaseTest.cs
 System.Collections/SortedListTest.cs
 System.Collections/StackTest.cs
+System.Collections/StructuralComparisonsTest.cs
 System.Collections.Generic/ComparerTest.cs
 System.Collections.Generic/DictionaryTest.cs
 System.Collections.Generic/EqualityComparerTest.cs
diff --git a/mcs/class/corlib/mobile_static_corlib.dll.sources b/mcs/class/corlib/mobile_static_corlib.dll.sources
new file mode 100644 (file)
index 0000000..da77893
--- /dev/null
@@ -0,0 +1 @@
+#include corlib.dll.sources
diff --git a/mcs/errors/CS0012-21-lib.il b/mcs/errors/CS0012-21-lib.il
new file mode 100644 (file)
index 0000000..b01f464
--- /dev/null
@@ -0,0 +1,31 @@
+.assembly extern mscorlib
+{
+}
+
+.assembly extern 'CS0012-lib-missing'
+{
+}
+
+.assembly 'CS0012-21-lib'
+{
+  .hash algorithm 0x00008004
+  .ver 0:0:0:0
+}
+
+.module 'CS0012-21-lib.dll'
+
+
+.class public auto ansi beforefieldinit B
+       extends class ['CS0012-lib-missing']X`1/Y/Z/W<int32>
+{
+  .method public hidebysig specialname rtspecialname 
+          instance void  .ctor() cil managed
+  {
+    // Code size       7 (0x7)
+    .maxstack  8
+    IL_0000:  ldarg.0
+    IL_0001:  call       instance void class ['CS0012-lib-missing']X`1/Y/Z/W<int32>::.ctor()
+    IL_0006:  ret
+  }
+
+}
index fccf2d93aa3d1102d3899a2e6e020c1c72acf50e..756d130359a64a00c933e61a0301bee7edac65d2 100644 (file)
@@ -21,7 +21,7 @@ DISTFILES = \
        $(wildcard dlls/second/*.cs)
 
 TEST_SUPPORT_FILES = \
-       CS0012-lib.dll CS0012-2-lib.dll CS0012-3-lib.dll CS0012-4-lib.dll CS0012-5-lib.dll CS0012-6-lib.dll CS0012-9-lib.dll CS0012-10-lib.dll CS0012-11-lib.dll CS0012-12-lib.dll CS0012-13-lib.dll CS0012-14-lib.dll CS0012-15-lib.dll CS0012-16-lib.dll CS0012-17-lib.dll CS0012-18-lib.dll CS0029-26-lib.dll \
+       CS0012-lib.dll CS0012-2-lib.dll CS0012-3-lib.dll CS0012-4-lib.dll CS0012-5-lib.dll CS0012-6-lib.dll CS0012-9-lib.dll CS0012-10-lib.dll CS0012-11-lib.dll CS0012-12-lib.dll CS0012-13-lib.dll CS0012-14-lib.dll CS0012-15-lib.dll CS0012-16-lib.dll CS0012-17-lib.dll CS0012-18-lib.dll CS0012-21-lib.dll CS0029-26-lib.dll \
        CS0103-2-lib.dll CS0118-2-lib.dll CS0122-8-lib.dll CS0122-10-lib.dll CS0122-14-lib.dll CS0122-15-lib.dll CS0122-19-lib.dll CS0122-35-lib.dll CS0122-36-lib.dll CS0143-lib.dll CS0144-3-lib.dll CS0165-19-lib.dll \
        CS0205-3-lib.dll CS0229-3-lib.dll CS0229-4-lib.dll CS0266-25-lib.dll \
        CS0315-2-lib.dll \
diff --git a/mcs/errors/cs0012-21.cs b/mcs/errors/cs0012-21.cs
new file mode 100644 (file)
index 0000000..f313e2a
--- /dev/null
@@ -0,0 +1,11 @@
+// CS0012: The type `X`1.Y.Z.W' is defined in an assembly that is not referenced. Consider adding a reference to assembly `CS0012-lib-missing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
+// Line: 9
+// Compiler options: -r:CS0012-21-lib.dll
+
+public class C
+{
+       public static void Main ()
+       {
+               new B ();
+       }
+}
\ No newline at end of file
index a774362dfea122dd3bb6f89f0dfccbe73aa8c4db..367cfc7d579693d1bbbfde6238d3cdc87e27ce31 100644 (file)
@@ -17,7 +17,7 @@ class X
        public static void Main ()
        {
                int a = 4, b = 5;
-               X x = (X) -a;
+X x = (X) -a;
                System.Console.WriteLine (x.i);
        }
 }
old mode 100644 (file)
new mode 100755 (executable)
index df639d2..18d4263
@@ -1,17 +1,10 @@
-// CS0118: `Test.SomeDel' is a `type' but a `variable' was expected
-// Line: 14
+// CS0118: `C' is a `type' but a `variable' was expected
+// Line: 8
 
-using System;
-
-namespace Test
+class C
 {
-       public delegate void SomeDel (Action a);
-
-       public class TestClass
+       public static void Main ()
        {
-               public void TestMethod ()
-               {
-                       SomeDel (() => { });
-               }
+               int i = (C) +1;
        }
-}
\ No newline at end of file
+}
diff --git a/mcs/errors/cs0118-12.cs b/mcs/errors/cs0118-12.cs
deleted file mode 100644 (file)
index c8d6203..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-// CS0118: `A.Test' is a `type' but a `variable' was expected
-// Line: 10
-
-class A
-{
-       delegate string Test (string t);
-
-       public static void Main ()
-       {
-               Test ("t");
-       }
-}
diff --git a/mcs/errors/cs0119-2.cs b/mcs/errors/cs0119-2.cs
new file mode 100644 (file)
index 0000000..e3fc7da
--- /dev/null
@@ -0,0 +1,17 @@
+// CS0119: Expression denotes a `type', where a `variable', `value' or `method group' was expected
+// Line: 14
+
+using System;
+
+namespace Test
+{
+       public delegate void SomeDel (Action a);
+
+       public class TestClass
+       {
+               public void TestMethod ()
+               {
+                       SomeDel (() => { });
+               }
+       }
+}
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
index 2ee3844..7b7f14b
@@ -1,10 +1,12 @@
 // CS0119: Expression denotes a `type', where a `variable', `value' or `method group' was expected
-// Line: 8
+// Line: 10
 
-class C
+class A
 {
+       delegate string Test (string t);
+
        public static void Main ()
        {
-               int i = (C) +1;
+               Test ("t");
        }
 }
diff --git a/mcs/errors/cs0472-5.cs b/mcs/errors/cs0472-5.cs
new file mode 100644 (file)
index 0000000..f699d71
--- /dev/null
@@ -0,0 +1,14 @@
+// CS0472: The result of comparing value type `byte' with null is always `false'
+// Line: 9
+// Compiler options: -warnaserror -warn:2
+
+class C
+{
+       public static bool Test (byte value)
+       {
+               if (value == null)
+                       return false;
+
+               return true;
+       }
+}
diff --git a/mcs/errors/cs0576-3.cs b/mcs/errors/cs0576-3.cs
new file mode 100644 (file)
index 0000000..2d18df0
--- /dev/null
@@ -0,0 +1,15 @@
+// CS0576: Namespace `global::' contains a definition with same name as alias `A'
+// Line: 12
+
+using A = System;
+
+namespace A.Foo
+{
+       class X
+       {
+               public static void Main ()
+               {
+                       A.GG ();
+               }
+       }
+}
\ No newline at end of file
index 6997d7ca85042729b61b8a0204ee01dc54ae584a..bb3f0f6608d36a173ebfe814db75b74d7b04af28 100644 (file)
@@ -195,7 +195,9 @@ namespace Mono.CSharp
 
                protected override void DoEmit (EmitContext ec)
                {
-                       GetResultExpression (ec).Emit (ec);
+                       using (ec.With (BuilderContext.Options.OmitDebugInfo, true)) {
+                               GetResultExpression (ec).Emit (ec);
+                       }
                }
 
                public Expression GetResultExpression (EmitContext ec)
@@ -224,34 +226,34 @@ namespace Mono.CSharp
                        var fe_awaiter = new FieldExpr (awaiter, loc);
                        fe_awaiter.InstanceExpression = new CompilerGeneratedThis (ec.CurrentType, loc);
 
-                       //
-                       // awaiter = expr.GetAwaiter ();
-                       //
+                               Label skip_continuation = ec.DefineLabel ();
+
                        using (ec.With (BuilderContext.Options.OmitDebugInfo, true)) {
+                               //
+                               // awaiter = expr.GetAwaiter ();
+                               //
                                fe_awaiter.EmitAssign (ec, expr, false, false);
-                       }
 
-                       Label skip_continuation = ec.DefineLabel ();
+                               Expression completed_expr;
+                               if (IsDynamic) {
+                                       var rc = new ResolveContext (ec.MemberContext);
 
-                       Expression completed_expr;
-                       if (IsDynamic) {
-                               var rc = new ResolveContext (ec.MemberContext);
+                                       Arguments dargs = new Arguments (1);
+                                       dargs.Add (new Argument (fe_awaiter));
+                                       completed_expr = new DynamicMemberBinder ("IsCompleted", dargs, loc).Resolve (rc);
 
-                               Arguments dargs = new Arguments (1);
-                               dargs.Add (new Argument (fe_awaiter));
-                               completed_expr = new DynamicMemberBinder ("IsCompleted", dargs, loc).Resolve (rc);
+                                       dargs = new Arguments (1);
+                                       dargs.Add (new Argument (completed_expr));
+                                       completed_expr = new DynamicConversion (ec.Module.Compiler.BuiltinTypes.Bool, 0, dargs, loc).Resolve (rc);
+                               } else {
+                                       var pe = PropertyExpr.CreatePredefined (awaiter_definition.IsCompleted, loc);
+                                       pe.InstanceExpression = fe_awaiter;
+                                       completed_expr = pe;
+                               }
 
-                               dargs = new Arguments (1);
-                               dargs.Add (new Argument (completed_expr));
-                               completed_expr = new DynamicConversion (ec.Module.Compiler.BuiltinTypes.Bool, 0, dargs, loc).Resolve (rc);
-                       } else {
-                               var pe = PropertyExpr.CreatePredefined (awaiter_definition.IsCompleted, loc);
-                               pe.InstanceExpression = fe_awaiter;
-                               completed_expr = pe;
+                               completed_expr.EmitBranchable (ec, skip_continuation, true);
                        }
 
-                       completed_expr.EmitBranchable (ec, skip_continuation, true);
-
                        base.DoEmit (ec);
 
                        //
@@ -741,7 +743,9 @@ namespace Mono.CSharp
                        var args = new Arguments (2);
                        args.Add (new Argument (awaiter, Argument.AType.Ref));
                        args.Add (new Argument (new CompilerGeneratedThis (CurrentType, Location), Argument.AType.Ref));
-                       mg.EmitCall (ec, args);
+                       using (ec.With (BuilderContext.Options.OmitDebugInfo, true)) {
+                               mg.EmitCall (ec, args);
+                       }
                }
 
                public void EmitInitializer (EmitContext ec)
@@ -817,7 +821,9 @@ namespace Mono.CSharp
                        Arguments args = new Arguments (1);
                        args.Add (new Argument (exceptionVariable));
 
-                       mg.EmitCall (ec, args);
+                       using (ec.With (BuilderContext.Options.OmitDebugInfo, true)) {
+                               mg.EmitCall (ec, args);
+                       }
                }
 
                public void EmitSetResult (EmitContext ec)
@@ -839,7 +845,9 @@ namespace Mono.CSharp
                                args.Add (new Argument (new LocalVariableReference (hoisted_return, Location)));
                        }
 
-                       mg.EmitCall (ec, args);
+                       using (ec.With (BuilderContext.Options.OmitDebugInfo, true)) {
+                               mg.EmitCall (ec, args);
+                       }
                }
 
                protected override TypeSpec[] ResolveBaseTypes (out FullNamedExpression base_class)
index a3f25539cfad5c860c55cb48815f3c39b17a566e..09a22ef66dff9fd6867ed0ef2d9640ab691383ad 100644 (file)
@@ -98,9 +98,9 @@ namespace Mono.CSharp
                        get; set;
                }
 
-               public virtual void AddCompilerGeneratedClass (CompilerGeneratedContainer c)
+               public void AddCompilerGeneratedClass (CompilerGeneratedContainer c)
                {
-                       containers.Add (c);
+                       AddTypeContainerMember (c);
                }
 
                public virtual void AddPartial (TypeDefinition next_part)
@@ -187,15 +187,12 @@ namespace Mono.CSharp
 
                        next_part.PartialContainer = existing;
 
-                       if (containers == null)
-                               containers = new List<TypeContainer> ();
-
-                       containers.Add (next_part);
+                       AddTypeContainerMember (next_part);
                }
 
                public virtual void AddTypeContainer (TypeContainer tc)
                {
-                       containers.Add (tc);
+                       AddTypeContainerMember (tc);
 
                        var tparams = tc.MemberName.TypeParameters;
                        if (tparams != null && tc.PartialContainer != null) {
@@ -210,6 +207,11 @@ namespace Mono.CSharp
                        }
                }
 
+               protected virtual void AddTypeContainerMember (TypeContainer tc)
+               {
+                       containers.Add (tc);
+               }
+
                public virtual void CloseContainer ()
                {
                        if (containers != null) {
@@ -356,7 +358,6 @@ namespace Mono.CSharp
 
                public string GetSignatureForMetadata ()
                {
-#if STATIC
                        if (Parent is TypeDefinition) {
                                return Parent.GetSignatureForMetadata () + "+" + TypeNameParser.Escape (MemberName.Basename);
                        }
@@ -364,9 +365,6 @@ namespace Mono.CSharp
                        var sb = new StringBuilder ();
                        CreateMetadataName (sb);
                        return sb.ToString ();
-#else
-                       throw new NotImplementedException ();
-#endif
                }
 
                public virtual void RemoveContainer (TypeContainer cont)
@@ -753,21 +751,17 @@ namespace Mono.CSharp
                {
                        AddNameToContainer (tc, tc.Basename);
 
-                       if (containers == null)
-                               containers = new List<TypeContainer> ();
-
-                       members.Add (tc);
                        base.AddTypeContainer (tc);
                }
 
-               public override void AddCompilerGeneratedClass (CompilerGeneratedContainer c)
+               protected override void AddTypeContainerMember (TypeContainer tc)
                {
-                       members.Add (c);
+                       members.Add (tc);
 
                        if (containers == null)
                                containers = new List<TypeContainer> ();
 
-                       base.AddCompilerGeneratedClass (c);
+                       base.AddTypeContainerMember (tc);
                }
 
                //
@@ -1521,19 +1515,31 @@ namespace Mono.CSharp
                        }
 
                        if (set_base_type) {
-                               if (base_type != null) {
-                                       spec.BaseType = base_type;
-
-                                       // Set base type after type creation
-                                       TypeBuilder.SetParent (base_type.GetMetaInfo ());
-                               } else {
-                                       TypeBuilder.SetParent (null);
-                               }
+                               SetBaseType ();
                        }
 
                        return true;
                }
 
+               void SetBaseType ()
+               {
+                       if (base_type == null) {
+                               TypeBuilder.SetParent (null);
+                               return;
+                       }
+
+                       if (spec.BaseType == base_type)
+                               return;
+
+                       spec.BaseType = base_type;
+
+                       if (IsPartialPart)
+                               spec.UpdateInflatedInstancesBaseType ();
+
+                       // Set base type after type creation
+                       TypeBuilder.SetParent (base_type.GetMetaInfo ());
+               }
+
                public override void ExpandBaseInterfaces ()
                {
                        if (!IsPartialPart)
@@ -1778,7 +1784,7 @@ namespace Mono.CSharp
 
                                        if (iface_type.Arity > 0) {
                                                // TODO: passing `this' is wrong, should be base type iface instead
-                                               TypeManager.CheckTypeVariance (iface_type, Variance.Covariant, this);
+                                               VarianceDecl.CheckTypeVariance (iface_type, Variance.Covariant, this);
 
                                                if (((InflatedTypeSpec) iface_type).HasDynamicArgument () && !IsCompilerGenerated) {
                                                        Report.Error (1966, Location,
@@ -2085,8 +2091,13 @@ namespace Mono.CSharp
 
                        base.Emit ();
 
-                       for (int i = 0; i < members.Count; i++)
-                               members[i].Emit ();
+                       for (int i = 0; i < members.Count; i++) {
+                               var m = members[i];
+                               if ((m.caching_flags & Flags.CloseTypeCreated) != 0)
+                                       continue;
+
+                               m.Emit ();
+                       }
 
                        EmitIndexerName ();
                        CheckAttributeClsCompliance ();
@@ -3334,7 +3345,11 @@ namespace Mono.CSharp
                                        Parent.PartialContainer.VerifyImplements (this);
                                }
 
-                               ModifiersExtensions.Check (Modifiers.AllowedExplicitImplFlags, explicit_mod_flags, 0, Location, Report);
+                               Modifiers allowed_explicit = Modifiers.AllowedExplicitImplFlags;
+                               if (this is Method)
+                                       allowed_explicit |= Modifiers.ASYNC;
+
+                               ModifiersExtensions.Check (allowed_explicit, explicit_mod_flags, 0, Location, Report);
                        }
 
                        return base.Define ();
@@ -3378,7 +3393,7 @@ namespace Mono.CSharp
                {
                        base.DoMemberTypeDependentChecks ();
 
-                       TypeManager.CheckTypeVariance (MemberType, ExpectedMemberTypeVariance, this);
+                       VarianceDecl.CheckTypeVariance (MemberType, ExpectedMemberTypeVariance, this);
                }
 
                public override void Emit()
index f2b22b9547c4e85127c34298560ba2a87a2fe58d..f190cc941cd1d64ad42cc2b9875e0d86108e379c 100644 (file)
@@ -248,6 +248,21 @@ namespace Mono.CSharp
                        return true;
                }
 
+               public void MarkCallEntry (Location loc)
+               {
+                       if (!EmitAccurateDebugInfo)
+                               return;
+
+                       //
+                       // TODO: This should emit different kind of sequence point to make
+                       // step-over work for statement over multiple lines
+                       //
+                       // Debugging experience for Foo (A () + B ()) where A and B are
+                       // on separate lines is not great
+                       //
+                       Mark (loc);
+               }
+
                public void DefineLocalVariable (string name, LocalBuilder builder)
                {
                        if ((flags & Options.OmitDebugInfo) != 0)
@@ -1014,11 +1029,7 @@ namespace Mono.CSharp
                                // Emit explicit sequence point for expressions like Foo.Bar () to help debugger to
                                // break at right place when LHS expression can be stepped-into
                                //
-                               // TODO: The list is probably not comprehensive, need to do more testing
-                               //
-                               if (InstanceExpression is PropertyExpr || InstanceExpression is Invocation || InstanceExpression is IndexerExpr ||
-                                       InstanceExpression is New || InstanceExpression is DelegateInvocation)
-                                       ec.Mark (loc.Value);
+                               ec.MarkCallEntry (loc.Value);
                        }
 
                        //
index a1bb8ec00f48c249eebd4ec1928ab0110c9dce1e..6eb42cddada0a51de2f96f54fe9c35b0b6cd294e 100644 (file)
@@ -109,28 +109,56 @@ namespace Mono.CSharp {
                        this.targs = targs;
                }
                
-               protected override Expression DoResolve (ResolveContext ec)
+               protected override Expression DoResolve (ResolveContext rc)
                {
-                       Expression expr_resolved = expr.Resolve (ec,
-                               ResolveFlags.VariableOrValue | ResolveFlags.Type);
+                       var sn = expr as SimpleName;
+                       const ResolveFlags flags = ResolveFlags.VariableOrValue | ResolveFlags.Type;
+
+                       //
+                       // Resolve the expression with flow analysis turned off, we'll do the definite
+                       // assignment checks later.  This is because we don't know yet what the expression
+                       // will resolve to - it may resolve to a FieldExpr and in this case we must do the
+                       // definite assignment check on the actual field and not on the whole struct.
+                       //
+                       using (rc.Set (ResolveContext.Options.OmitStructFlowAnalysis)) {
+                               if (sn != null) {
+                                       expr = sn.LookupNameExpression (rc, MemberLookupRestrictions.ReadAccess | MemberLookupRestrictions.ExactArity);
+
+                                       //
+                                       // Resolve expression which does have type set as we need expression type
+                                       // with disable flow analysis as we don't know whether left side expression
+                                       // is used as variable or type
+                                       //
+                                       if (expr is VariableReference || expr is ConstantExpr || expr is Linq.TransparentMemberAccess) {
+                                               using (rc.With (ResolveContext.Options.DoFlowAnalysis, false)) {
+                                                       expr = expr.Resolve (rc);
+                                               }
+                                       } else if (expr is TypeParameterExpr) {
+                                               expr.Error_UnexpectedKind (rc, flags, sn.Location);
+                                               expr = null;
+                                       }
+                               } else {
+                                       expr = expr.Resolve (rc, flags);
+                               }
+                       }
 
-                       if (expr_resolved == null)
+                       if (expr == null)
                                return null;
 
-                       TypeSpec expr_type = expr_resolved.Type;
+                       TypeSpec expr_type = expr.Type;
                        if (expr_type.IsPointer || expr_type.Kind == MemberKind.Void || expr_type == InternalType.NullLiteral || expr_type == InternalType.AnonymousMethod) {
-                               expr_resolved.Error_OperatorCannotBeApplied (ec, loc, ".", expr_type);
+                               expr.Error_OperatorCannotBeApplied (rc, loc, ".", expr_type);
                                return null;
                        }
 
                        if (targs != null) {
-                               if (!targs.Resolve (ec))
+                               if (!targs.Resolve (rc))
                                        return null;
                        }
 
                        var results = new List<string> ();
-                       if (expr_resolved is Namespace){
-                               Namespace nexpr = expr_resolved as Namespace;
+                       if (expr is Namespace) {
+                               Namespace nexpr = expr as Namespace;
                                string namespaced_partial;
 
                                if (partial_name == null)
@@ -138,11 +166,11 @@ namespace Mono.CSharp {
                                else
                                        namespaced_partial = nexpr.Name + "." + partial_name;
 
-                               ec.CurrentMemberDefinition.GetCompletionStartingWith (namespaced_partial, results);
+                               rc.CurrentMemberDefinition.GetCompletionStartingWith (namespaced_partial, results);
                                if (partial_name != null)
                                        results = results.Select (l => l.Substring (partial_name.Length)).ToList ();
                        } else {
-                               var r = MemberCache.GetCompletitionMembers (ec, expr_type, partial_name).Select (l => l.Name);
+                               var r = MemberCache.GetCompletitionMembers (rc, expr_type, partial_name).Select (l => l.Name);
                                AppendResults (results, partial_name, r);
                        }
 
index da41e1ebad5eac2ad2df972d889cca45b8ecbdf6..eef90b34603c80175df19f75373cc6c0502e6b62 100644 (file)
@@ -106,6 +106,11 @@ namespace Mono.CSharp {
                                        "The type `{0}' cannot be declared const", t.GetSignatureForError ());
                        }
                }
+
+               public override void Accept (StructuralVisitor visitor)
+               {
+                       visitor.Visit (this);
+               }
        }
 
        public class ConstSpec : FieldSpec
index 397d72c9a4ae7653be65733999a337aaf1567695..1a70f55d8f83fdfece957397b44f6b02edefb7fb 100644 (file)
@@ -89,7 +89,7 @@ namespace Mono.CSharp {
                        if (this.type == type)
                                return this;
 
-                       if (!Convert.ImplicitNumericConversionExists (this.type, type)) 
+                       if (!Convert.ImplicitNumericConversionExists (this.type, type))
                                return null;
 
                        bool fail;                      
@@ -2019,6 +2019,14 @@ namespace Mono.CSharp {
                {
                        return null;
                }
+
+               public override Constant ConvertImplicitly (TypeSpec type)
+               {
+                       if (IsDefaultValue && type.BuiltinType == BuiltinTypeSpec.Type.Object)
+                               return new NullConstant (type, loc);
+
+                       return base.ConvertImplicitly (type);
+               }
        }
 
        //
index 45b95d40aae601c8682f0b4b38fedb5dd082352e..2d2d60d3cf3766c686c6b74b8d88361b30a54fca 100644 (file)
@@ -116,6 +116,8 @@ namespace Mono.CSharp
                // Keeps track of global data changes to undo on parser error
                //
                public Undo undo;
+
+               bool? interactive_async;
                
                Stack<Linq.QueryBlock> linq_clause_blocks;
 
@@ -562,6 +564,7 @@ namespace_name
          {
                var lt = (LocatedToken) $3;
                $$ = new MemberName ((MemberName) $1, lt.Value, lt.Location);           
+               lbag.AddLocation ($$, GetLocation ($2));
          }
        | error
          {
@@ -970,7 +973,11 @@ struct_declaration
          }
          opt_semicolon
          {
-               lbag.AppendToMember (current_container, GetLocation ($11), GetLocation ($14), GetLocation ($16));
+               if ($16 == null) {
+                       lbag.AppendToMember (current_container, GetLocation ($11), GetLocation ($14));
+               } else {
+                       lbag.AppendToMember (current_container, GetLocation ($11), GetLocation ($14), GetLocation ($16));
+               }
                $$ = pop_current_class ();
          }
        | opt_attributes opt_modifiers opt_partial STRUCT error
@@ -1138,6 +1145,7 @@ opt_field_initializer
          {
                --lexer.parsing_block;
                current_field.Initializer = (Expression) $3;
+               lbag.AppendToMember (current_field, GetLocation ($1));
                end_block (lexer.Location);
                current_local_parameters = null;
          }
@@ -1938,7 +1946,11 @@ interface_declaration
          }
          opt_semicolon 
          {
-           lbag.AppendToMember (current_container, GetLocation ($11), GetLocation ($13));
+               if ($15 == null) {
+                       lbag.AppendToMember (current_container, GetLocation ($11), GetLocation ($13));
+               } else {
+                       lbag.AppendToMember (current_container, GetLocation ($11), GetLocation ($13), GetLocation ($15));
+               }
                $$ = pop_current_class ();
          }
        | opt_attributes opt_modifiers opt_partial INTERFACE error
@@ -2921,7 +2933,7 @@ type_parameter
        : opt_attributes opt_type_parameter_variance IDENTIFIER
          {
                var lt = (LocatedToken)$3;
-               $$ = new TypeParameter (new MemberName (lt.Value, lt.Location), (Attributes)$1, (Variance) $2);
+               $$ = new TypeParameter (new MemberName (lt.Value, lt.Location), (Attributes)$1, (VarianceDecl) $2);
          }
        | error
          {
@@ -2930,7 +2942,7 @@ type_parameter
                else
                        Error_SyntaxError (yyToken);
                        
-               $$ = new TypeParameter (MemberName.Null, null, Variance.None);
+               $$ = new TypeParameter (MemberName.Null, null, null);
          }
        ;
 
@@ -3300,14 +3312,17 @@ member_initializer
        | OPEN_BRACE expression_list CLOSE_BRACE
          {
                if ($2 == null)
-                       $$ = null;
+                       $$ = new CollectionElementInitializer (GetLocation ($1));
                else
                        $$ = new CollectionElementInitializer ((List<Expression>)$2, GetLocation ($1));
+
+               lbag.AddLocation ($$, GetLocation ($2));
          }
        | OPEN_BRACE CLOSE_BRACE
          {
                report.Error (1920, GetLocation ($1), "An element initializer cannot be empty");
-               $$ = null;
+               $$ = new CollectionElementInitializer (GetLocation ($1));
+               lbag.AddLocation ($$, GetLocation ($2));
          }
        ;
 
@@ -3926,6 +3941,9 @@ unary_expression
                        } else if (current_anonymous_method is AnonymousMethodExpression) {
                                report.Error (4035, GetLocation ($1),
                                        "The `await' operator can only be used when its containing anonymous method is marked with the `async' modifier");
+                       } else if (interactive_async != null) {
+                               current_block.Explicit.RegisterAsyncAwait ();
+                               interactive_async = true;
                        } else {
                                report.Error (4033, GetLocation ($1),
                                        "The `await' operator can only be used when its containing method is marked with the `async' modifier");
@@ -4647,7 +4665,11 @@ class_declaration
          }
          opt_semicolon 
          {
-               lbag.AppendToMember (current_container, GetLocation ($11), GetLocation ($13), GetLocation ($15));
+               if ($15 == null) {
+                       lbag.AppendToMember (current_container, GetLocation ($11), GetLocation ($13));
+               } else {
+                       lbag.AppendToMember (current_container, GetLocation ($11), GetLocation ($13), GetLocation ($15));
+               }
                $$ = pop_current_class ();
          }
        ;       
@@ -4896,7 +4918,7 @@ type_parameter_constraint
 opt_type_parameter_variance
        : /* empty */
          {
-               $$ = Variance.None;
+               $$ = null;
          }
        | type_parameter_variance
          {
@@ -4910,11 +4932,11 @@ opt_type_parameter_variance
 type_parameter_variance
        : OUT
          {
-               $$ = Variance.Covariant;
+               $$ = new VarianceDecl (Variance.Covariant, GetLocation ($1));
          }
        | IN
          {
-               $$ = Variance.Contravariant;
+               $$ = new VarianceDecl (Variance.Contravariant, GetLocation ($1));
          }
        ;
 
@@ -5377,10 +5399,7 @@ interactive_statement_expression
        : expression
          {
                Expression expr = (Expression) $1;
-               ExpressionStatement s;
-
-               s = new OptionalAssign (new SimpleName ("$retval", lexer.Location), expr, lexer.Location);
-               $$ = new StatementExpression (s);
+               $$ = new StatementExpression (new OptionalAssign (expr, lexer.Location));
          }
        | error
          {
@@ -6043,6 +6062,7 @@ fixed_statement
          
                Fixed f = new Fixed ((Fixed.VariableDeclaration) $9, (Statement) $10, GetLocation ($1));
                current_block.AddStatement (f);
+               lbag.AddStatement (f, GetLocation ($2), GetLocation ($8));
                $$ = end_block (GetLocation ($8));
          }
        ;
@@ -6159,7 +6179,9 @@ first_from_clause
          
                var lt = (LocatedToken) $2;
                var rv = new Linq.RangeVariable (lt.Value, lt.Location);
-               $$ = new Linq.QueryExpression (new Linq.QueryStartClause ((Linq.QueryBlock)current_block, (Expression)$4, rv, GetLocation ($1)));
+               var clause = new Linq.QueryStartClause ((Linq.QueryBlock)current_block, (Expression)$4, rv, GetLocation ($1));
+               lbag.AddLocation (clause, GetLocation ($3));
+               $$ = new Linq.QueryExpression (clause);
          }
        | FROM_FIRST type identifier_inside_body IN expression
          {
@@ -6167,11 +6189,11 @@ first_from_clause
          
                var lt = (LocatedToken) $3;
                var rv = new Linq.RangeVariable (lt.Value, lt.Location);
-               $$ = new Linq.QueryExpression (
-                       new Linq.QueryStartClause ((Linq.QueryBlock)current_block, (Expression)$5, rv, GetLocation ($1)) {
+               var clause = new Linq.QueryStartClause ((Linq.QueryBlock)current_block, (Expression)$5, rv, GetLocation ($1)) {
                                IdentifierType = (FullNamedExpression)$2
-                       }
-               );
+               };
+               lbag.AddLocation (clause, GetLocation ($4));
+               $$ = new Linq.QueryExpression (clause);
          }
        ;
 
@@ -6182,7 +6204,9 @@ nested_from_clause
          
                var lt = (LocatedToken) $2;
                var rv = new Linq.RangeVariable (lt.Value, lt.Location);
-               $$ = new Linq.QueryExpression (new Linq.QueryStartClause ((Linq.QueryBlock)current_block, (Expression)$4, rv, GetLocation ($1)));
+               var clause = new Linq.QueryStartClause ((Linq.QueryBlock)current_block, (Expression)$4, rv, GetLocation ($1));
+               lbag.AddLocation (clause, GetLocation ($3));
+               $$ = new Linq.QueryExpression (clause);
          }
        | FROM type identifier_inside_body IN expression
          {
@@ -6190,11 +6214,11 @@ nested_from_clause
          
                var lt = (LocatedToken) $3;
                var rv = new Linq.RangeVariable (lt.Value, lt.Location);
-               $$ = new Linq.QueryExpression (
-                       new Linq.QueryStartClause ((Linq.QueryBlock)current_block, (Expression)$5, rv, GetLocation ($1)) {
+               var clause = new Linq.QueryStartClause ((Linq.QueryBlock)current_block, (Expression)$5, rv, GetLocation ($1)) {
                                IdentifierType = (FullNamedExpression)$2
-                       }
-               );
+               };
+               lbag.AddLocation (clause, GetLocation ($4));
+               $$ = new Linq.QueryExpression (clause);
          }
        ;
        
@@ -6213,6 +6237,7 @@ from_clause
                current_block = current_block.Parent;
                
                ((Linq.QueryBlock)current_block).AddRangeVariable (sn);
+               lbag.AddLocation ($$, GetLocation ($3));
          }       
        | FROM type identifier_inside_body IN
          {
@@ -6231,6 +6256,8 @@ from_clause
                current_block = current_block.Parent;
                
                ((Linq.QueryBlock)current_block).AddRangeVariable (sn);
+               
+               lbag.AddLocation ($$, GetLocation ($4));
          }
        ;       
 
@@ -6480,6 +6507,7 @@ join_clause
                        $$ = new Linq.Join (block, sn, (Expression)$6, outer_selector, (Linq.QueryBlock) current_block, GetLocation ($1)) {
                                IdentifierType = (FullNamedExpression)$2
                        };
+                       lbag.AddLocation ($$, GetLocation ($3), GetLocation ($6), GetLocation ($9));
                } else {
                        //
                        // Set equals right side parent to beginning of linq query, it is not accessible therefore cannot cause name collisions
@@ -6653,27 +6681,30 @@ interactive_parsing
                        mods |= Modifiers.UNSAFE;
 
                current_local_parameters = pars;
-               Method method = new Method (
+               var method = new InteractiveMethod (
                        current_type,
                        new TypeExpression (compiler.BuiltinTypes.Void, Location.Null),
                        mods,
-                       new MemberName ("Host"),
-                       pars,
-                       null /* attributes */);
+                       pars);
                        
                current_type.AddMember (method);                        
-
                oob_stack.Push (method);
+
+               interactive_async = false;
+
                ++lexer.parsing_block;
                start_block (lexer.Location);
          }             
          interactive_statement_list opt_COMPLETE_COMPLETION
          {
                --lexer.parsing_block;
-               Method method = (Method) oob_stack.Pop ();
-
+               var method = (InteractiveMethod) oob_stack.Pop ();
                method.Block = (ToplevelBlock) end_block(lexer.Location);
 
+               if (interactive_async == true) {
+                       method.ChangeToAsync ();
+               }
+
                InteractiveResult = (Class) pop_current_class ();
                current_local_parameters = null;
          } 
index e7f27aa7d626a32151675707335df0dc6312ff5f..f9cbcfe1e5e703c41272344f86c9c9b1926e15ff 100644 (file)
@@ -1085,7 +1085,12 @@ namespace Mono.CSharp {
                // will contain types only but it can have numerous values for members
                // like methods where both return type and all parameters are checked
                //
-               public List<TypeSpec> GetMissingDependencies ()
+               public List<MissingTypeSpecReference> GetMissingDependencies ()
+               {
+                       return GetMissingDependencies (this);
+               }
+
+               public List<MissingTypeSpecReference> GetMissingDependencies (MemberSpec caller)
                {
                        if ((state & (StateFlags.MissingDependency | StateFlags.MissingDependency_Undetected)) == 0)
                                return null;
@@ -1093,11 +1098,11 @@ namespace Mono.CSharp {
                        state &= ~StateFlags.MissingDependency_Undetected;
 
                        var imported = definition as ImportedDefinition;
-                       List<TypeSpec> missing;
+                       List<MissingTypeSpecReference> missing;
                        if (imported != null) {
-                               missing = ResolveMissingDependencies ();
+                               missing = ResolveMissingDependencies (caller);
                        } else if (this is ElementTypeSpec) {
-                               missing = ((ElementTypeSpec) this).Element.GetMissingDependencies ();
+                               missing = ((ElementTypeSpec) this).Element.GetMissingDependencies (caller);
                        } else {
                                missing = null;
                        }
@@ -1109,7 +1114,7 @@ namespace Mono.CSharp {
                        return missing;
                }
 
-               public abstract List<TypeSpec> ResolveMissingDependencies ();
+               public abstract List<MissingTypeSpecReference> ResolveMissingDependencies (MemberSpec caller);
 
                protected virtual bool IsNotCLSCompliant (out bool attrValue)
                {
@@ -1161,7 +1166,7 @@ namespace Mono.CSharp {
                        var ctype = ctx.CurrentType;
 
                        if (ma == Modifiers.PRIVATE) {
-                               if (ctype == null)
+                               if (ctype == null || parentType == null)
                                        return false;
                                //
                                // It's only accessible to the current class or children
index 329e04eec3c7f8108a6add06ce6240163e5feaf6..e5a317ffe49a01f80e4dc7cd538fcebba0037a34 100644 (file)
@@ -181,7 +181,7 @@ namespace Mono.CSharp {
                                return false;
                        }
 
-                       TypeManager.CheckTypeVariance (ret_type, Variance.Covariant, this);
+                       VarianceDecl.CheckTypeVariance (ret_type, Variance.Covariant, this);
 
                        var resolved_rt = new TypeExpression (ret_type, Location);
                        InvokeBuilder = new Method (this, resolved_rt, MethodModifiers, new MemberName (InvokeMethodName), p, null);
@@ -857,7 +857,7 @@ namespace Mono.CSharp {
                        //
                        var call = new CallEmitter ();
                        call.InstanceExpression = InstanceExpr;
-                       call.EmitPredefined (ec, method, arguments);
+                       call.EmitPredefined (ec, method, arguments, loc);
                }
 
                public override void EmitStatement (EmitContext ec)
index e24e008e809c128af043cac0196ca28d7fb2f787..099d2e94771f38f0888680022d8c5459a86315f7 100644 (file)
@@ -435,8 +435,14 @@ namespace Mono.CSharp {
                /// </remarks>
                public Expression Resolve (ResolveContext ec, ResolveFlags flags)
                {
-                       if (eclass != ExprClass.Unresolved)
+                       if (eclass != ExprClass.Unresolved) {
+                               if ((flags & ExprClassToResolveFlags) == 0) {
+                                       Error_UnexpectedKind (ec, flags, loc);
+                                       return null;
+                               }
+
                                return this;
+                       }
                        
                        Expression e;
                        try {
@@ -455,7 +461,8 @@ namespace Mono.CSharp {
 
                                return e;
                        } catch (Exception ex) {
-                               if (loc.IsNull || ec.Module.Compiler.Settings.DebugFlags > 0 || ex is CompletionResult || ec.Report.IsDisabled || ex is FatalException)
+                               if (loc.IsNull || ec.Module.Compiler.Settings.DebugFlags > 0 || ex is CompletionResult || ec.Report.IsDisabled || ex is FatalException ||
+                                       ec.Report.Printer is NullReportPrinter)
                                        throw;
 
                                ec.Report.Error (584, loc, "Internal compiler error: {0}", ex.Message);
@@ -778,8 +785,18 @@ namespace Mono.CSharp {
                                        }
 
                                        if ((restrictions & MemberLookupRestrictions.InvocableOnly) != 0) {
-                                               if (member is MethodSpec)
+                                               if (member is MethodSpec) {
+                                                       //
+                                                       // Interface members that are hidden by class members are removed from the set. This
+                                                       // step only has an effect if T is a type parameter and T has both an effective base 
+                                                       // class other than object and a non-empty effective interface set
+                                                       //
+                                                       var tps = queried_type as TypeParameterSpec;
+                                                       if (tps != null && tps.HasTypeConstraint)
+                                                               members = RemoveHiddenTypeParameterMethods (members);
+
                                                        return new MethodGroupExpr (members, queried_type, loc);
+                                               }
 
                                                if (!Invocation.IsMemberInvocable (member))
                                                        continue;
@@ -834,6 +851,54 @@ namespace Mono.CSharp {
                        return null;
                }
 
+               static IList<MemberSpec> RemoveHiddenTypeParameterMethods (IList<MemberSpec> members)
+               {
+                       if (members.Count < 2)
+                               return members;
+
+                       //
+                       // If M is a method, then all non-method members declared in an interface declaration
+                       // are removed from the set, and all methods with the same signature as M declared in
+                       // an interface declaration are removed from the set
+                       //
+
+                       bool copied = false;
+                       for (int i = 0; i < members.Count; ++i) {
+                               var method = members[i] as MethodSpec;
+                               if (method == null) {
+                                       if (!copied) {
+                                               copied = true;
+                                               members = new List<MemberSpec> (members);
+                                       } 
+                                       
+                                       members.RemoveAt (i--);
+                                       continue;
+                               }
+
+                               if (!method.DeclaringType.IsInterface)
+                                       continue;
+
+                               for (int ii = 0; ii < members.Count; ++ii) {
+                                       var candidate = members[ii] as MethodSpec;
+                                       if (candidate == null || !candidate.DeclaringType.IsClass)
+                                               continue;
+
+                                       if (!TypeSpecComparer.Override.IsEqual (candidate.Parameters, method.Parameters))
+                                               continue;
+
+                                       if (!copied) {
+                                               copied = true;
+                                               members = new List<MemberSpec> (members);
+                                       }
+
+                                       members.RemoveAt (i--);
+                                       break;
+                               }
+                       }
+
+                       return members;
+               }
+
                protected virtual void Error_NegativeArrayIndex (ResolveContext ec, Location loc)
                {
                        throw new NotImplementedException ();
@@ -2394,7 +2459,7 @@ namespace Mono.CSharp {
 
                protected override Expression DoResolve (ResolveContext rc)
                {
-                       var e = SimpleNameResolve (rc, null, false);
+                       var e = SimpleNameResolve (rc, null);
 
                        var fe = e as FieldExpr;
                        if (fe != null) {
@@ -2406,7 +2471,7 @@ namespace Mono.CSharp {
 
                public override Expression DoResolveLValue (ResolveContext ec, Expression right_side)
                {
-                       return SimpleNameResolve (ec, right_side, false);
+                       return SimpleNameResolve (ec, right_side);
                }
 
                protected virtual void Error_TypeOrNamespaceNotFound (IMemberContext ctx)
@@ -2672,7 +2737,10 @@ namespace Mono.CSharp {
                                                        }
 
                                                        if (e is TypeExpr) {
-                                                               e.Error_UnexpectedKind (rc, e, "variable", e.ExprClassName, loc);
+                                                               // TypeExpression does not have correct location
+                                                               if (e is TypeExpression)
+                                                                       e = new TypeExpression (e.Type, loc);
+
                                                                return e;
                                                        }
                                                }
@@ -2694,19 +2762,19 @@ namespace Mono.CSharp {
                        }
                }
                
-               Expression SimpleNameResolve (ResolveContext ec, Expression right_side, bool intermediate)
+               Expression SimpleNameResolve (ResolveContext ec, Expression right_side)
                {
                        Expression e = LookupNameExpression (ec, right_side == null ? MemberLookupRestrictions.ReadAccess : MemberLookupRestrictions.None);
 
                        if (e == null)
                                return null;
 
-                       if (right_side != null) {
-                               if (e is FullNamedExpression && e.eclass != ExprClass.Unresolved) {
-                                       e.Error_UnexpectedKind (ec, e, "variable", e.ExprClassName, loc);
-                                   return null;
-                               }
+                       if (e is FullNamedExpression && e.eclass != ExprClass.Unresolved) {
+                               e.Error_UnexpectedKind (ec, e, "variable", e.ExprClassName, loc);
+                               return e;
+                       }
 
+                       if (right_side != null) {
                                e = e.ResolveLValue (ec, right_side);
                        } else {
                                e = e.Resolve (ec);
@@ -3602,7 +3670,7 @@ namespace Mono.CSharp {
                                                        InstanceExpression = ProbeIdenticalTypeName (ec, InstanceExpression, simple_name);
                                                }
 
-                                               InstanceExpression.Resolve (ec);
+                                               InstanceExpression.Resolve (ec, ResolveFlags.VariableOrValue | ResolveFlags.MethodGroup | ResolveFlags.Type);
                                        }
                                }
 
@@ -3676,7 +3744,7 @@ namespace Mono.CSharp {
                //
                public virtual MethodGroupExpr LookupExtensionMethod (ResolveContext rc)
                {
-                       if (InstanceExpression == null)
+                       if (InstanceExpression == null || InstanceExpression.eclass == ExprClass.Type)
                                return null;
 
                        InstanceExpression = InstanceExpression.Resolve (rc);
@@ -4397,6 +4465,11 @@ namespace Mono.CSharp {
                                                                arg_moved = true;
                                                        }
 
+                                                       if (arguments == orig_args) {
+                                                               arguments = new Arguments (orig_args.Count);
+                                                               arguments.AddRange (orig_args);
+                                                       }
+
                                                        arguments[index] = arguments[i];
                                                        arguments[i] = temp;
 
index 7e1857cc087a44c90d374f670463efb7b186a216..9607ffd8b7945c0535fe516305dca14b20b2059d 100644 (file)
@@ -131,6 +131,12 @@ namespace Mono.CSharp
                        Location.Initialize (ctx.SourceFiles);
                }
 
+               /// <summary>
+               /// When set evaluator will automatically wait on Task of async methods. When not
+               /// set it's called responsibility to handle Task execution
+               /// </summary>
+               public bool WaitOnTask { get; set; }
+
                /// <summary>
                ///   If true, turns type expressions into valid expressions
                ///   and calls the describe method on it
@@ -429,7 +435,7 @@ namespace Mono.CSharp
                                throw new ArgumentException ("Syntax error on input: partial input");
                        
                        if (result_set == false)
-                               throw new ArgumentException ("The expression did not set a result");
+                               throw new ArgumentException ("The expression failed to resolve");
 
                        return result;
                }
@@ -657,11 +663,47 @@ namespace Mono.CSharp
 
                                host.SetBaseTypes (baseclass_list);
 
-                               host.CreateContainer ();
-                               host.DefineContainer ();
-                               host.Define ();
-
                                expression_method = (Method) host.Members[0];
+
+                               if ((expression_method.ModFlags & Modifiers.ASYNC) != 0) {
+                                       //
+                                       // Host method is async. When WaitOnTask is set we wrap it with wait
+                                       //
+                                       // void AsyncWait (ref object $retval) {
+                                       //      $retval = Host();
+                                       //      ((Task)$retval).Wait();  // When WaitOnTask is set
+                                       // }
+                                       //
+                                       var p = new ParametersCompiled (
+                                               new Parameter (new TypeExpression (module.Compiler.BuiltinTypes.Object, Location.Null), "$retval", Parameter.Modifier.REF, null, Location.Null)
+                                       );
+
+                                       var method = new Method(host, new TypeExpression(module.Compiler.BuiltinTypes.Void, Location.Null),
+                                               Modifiers.PUBLIC | Modifiers.STATIC, new MemberName("AsyncWait"), p, null);
+
+                                       method.Block = new ToplevelBlock(method.Compiler, p, Location.Null);
+                                       method.Block.AddStatement(new StatementExpression (new SimpleAssign(
+                                               new SimpleName(p [0].Name, Location.Null),
+                                               new Invocation(new SimpleName(expression_method.MemberName.Name, Location.Null), new Arguments(0)),
+                                               Location.Null), Location.Null));
+
+                                       if (WaitOnTask) {
+                                               var task = new Cast (expression_method.TypeExpression, new SimpleName (p [0].Name, Location.Null), Location.Null);
+
+                                               method.Block.AddStatement (new StatementExpression (new Invocation (
+                                                               new MemberAccess (task, "Wait", Location.Null),
+                                                       new Arguments (0)), Location.Null));
+                                       }
+
+                                       host.AddMember(method);
+
+                                       expression_method = method;
+                               }
+
+                               host.CreateContainer();
+                               host.DefineContainer();
+                               host.Define();
+
                        } else {
                                expression_method = null;
                        }
@@ -1056,6 +1098,27 @@ namespace Mono.CSharp
 #endif
        }
 
+       class InteractiveMethod : Method
+       {
+               public InteractiveMethod(TypeDefinition parent, FullNamedExpression returnType, Modifiers mod, ParametersCompiled parameters)
+                       : base(parent, returnType, mod, new MemberName("Host"), parameters, null)
+               {
+               }
+
+               public void ChangeToAsync ()
+               {
+                       ModFlags |= Modifiers.ASYNC;
+                       ModFlags &= ~Modifiers.UNSAFE;
+                       type_expr = new TypeExpression(Module.PredefinedTypes.Task.TypeSpec, Location);
+                       parameters = ParametersCompiled.EmptyReadOnlyParameters;
+               }
+
+               public override string GetSignatureForError()
+               {
+                       return "InteractiveHost";
+               }
+       }
+
        class HoistedEvaluatorVariable : HoistedVariable
        {
                public HoistedEvaluatorVariable (Field field)
@@ -1076,11 +1139,17 @@ namespace Mono.CSharp
        ///    the return value for an invocation.
        /// </summary>
        class OptionalAssign : SimpleAssign {
-               public OptionalAssign (Expression t, Expression s, Location loc)
-                       : base (t, s, loc)
+               public OptionalAssign (Expression s, Location loc)
+                       : base (null, s, loc)
                {
                }
 
+               public override Location StartLocation {
+                       get {
+                               return Location.Null;
+                       }
+               }
+
                protected override Expression DoResolve (ResolveContext ec)
                {
                        Expression clone = source.Clone (new CloneContext ());
@@ -1093,7 +1162,7 @@ namespace Mono.CSharp
                        // A useful feature for the REPL: if we can resolve the expression
                        // as a type, Describe the type;
                        //
-                       if (ec.Module.Evaluator.DescribeTypeExpressions){
+                       if (ec.Module.Evaluator.DescribeTypeExpressions && !(ec.CurrentAnonymousMethod is AsyncInitializer)) {
                                var old_printer = ec.Report.SetPrinter (new SessionReportPrinter ());
                                Expression tclone;
                                try {
@@ -1119,8 +1188,29 @@ namespace Mono.CSharp
                        }
 
                        source = clone;
+
+                       var host = (Method) ec.MemberContext.CurrentMemberDefinition;
+
+                       if (host.ParameterInfo.IsEmpty) {
+                               eclass = ExprClass.Value;
+                               type = InternalType.FakeInternalType;
+                               return this;
+                       }
+
+                       target = new SimpleName (host.ParameterInfo[0].Name, Location);
+
                        return base.DoResolve (ec);
                }
+
+               public override void EmitStatement(EmitContext ec)
+               {
+                       if (target == null) {
+                               source.Emit (ec);
+                               return;
+                       }
+
+                       base.EmitStatement(ec);
+               }
        }
 
        public class Undo
index 14776484844ffafb07da563b3be88b150e706349..d02603f90f2f399ae00741ee76ad519ffd692e01 100644 (file)
@@ -80,7 +80,7 @@ namespace Mono.CSharp
                public override void Emit (EmitContext ec)
                {
                        var call = new CallEmitter ();
-                       call.EmitPredefined (ec, oper, arguments);
+                       call.EmitPredefined (ec, oper, arguments, loc);
                }
 
                public override SLE.Expression MakeExpression (BuilderContext ctx)
@@ -1662,8 +1662,10 @@ namespace Mono.CSharp
                                return this;
                        }
 
-                       ec.Report.Error (39, loc, "Cannot convert type `{0}' to `{1}' via a built-in conversion",
-                               etype.GetSignatureForError (), type.GetSignatureForError ());
+                       if (etype != InternalType.ErrorType) {
+                               ec.Report.Error (39, loc, "Cannot convert type `{0}' to `{1}' via a built-in conversion",
+                                       etype.GetSignatureForError (), type.GetSignatureForError ());
+                       }
 
                        return null;
                }
@@ -1930,8 +1932,8 @@ namespace Mono.CSharp
 
                                        if (right_expr.IsNull) {
                                                if ((b.oper & Operator.EqualityMask) != 0) {
-                                                       if (!left_expr.Type.IsNullableType && left_expr.Type == left_unwrap)
-                                                               return b.CreateLiftedValueTypeResult (rc, left_unwrap);
+                                                       if (!left_expr.Type.IsNullableType && BuiltinTypeSpec.IsPrimitiveType (left_expr.Type))
+                                                               return b.CreateLiftedValueTypeResult (rc, left_expr.Type);
                                                } else if ((b.oper & Operator.BitwiseMask) != 0) {
                                                        if (left_unwrap.BuiltinType != BuiltinTypeSpec.Type.Bool)
                                                                return Nullable.LiftedNull.CreateFromExpression (rc, b);
@@ -1946,8 +1948,8 @@ namespace Mono.CSharp
                                                }
                                        } else if (left_expr.IsNull) {
                                                if ((b.oper & Operator.EqualityMask) != 0) {
-                                                       if (!right_expr.Type.IsNullableType && right_expr.Type == right_unwrap)
-                                                               return b.CreateLiftedValueTypeResult (rc, right_unwrap);
+                                                       if (!right_expr.Type.IsNullableType && BuiltinTypeSpec.IsPrimitiveType (right_expr.Type))
+                                                               return b.CreateLiftedValueTypeResult (rc, right_expr.Type);
                                                } else if ((b.oper & Operator.BitwiseMask) != 0) {
                                                        if (right_unwrap.BuiltinType != BuiltinTypeSpec.Type.Bool)
                                                                return Nullable.LiftedNull.CreateFromExpression (rc, b);
@@ -2752,6 +2754,12 @@ namespace Mono.CSharp
                                if (l.IsPointer || r.IsPointer)
                                        return ResolveOperatorPointer (rc, l, r);
 
+                               // User operators
+                               expr = ResolveUserOperator (rc, left, right);
+                               if (expr != null)
+                                       return expr;
+
+
                                bool lenum = l.IsEnum;
                                bool renum = r.IsEnum;
                                if ((oper & (Operator.ComparisonMask | Operator.BitwiseMask)) != 0) {
@@ -2805,11 +2813,6 @@ namespace Mono.CSharp
                                                        return expr;
                                        }
                                }
-
-                               // User operators
-                               expr = ResolveUserOperator (rc, left, right);
-                               if (expr != null)
-                                       return expr;
                        }
                        
                        //
@@ -3718,10 +3721,15 @@ namespace Mono.CSharp
                                                Nullable.NullableInfo.GetEnumUnderlyingType (rc.Module, left.Type) :
                                                EnumSpec.GetUnderlyingType (left.Type);
                                }
-                       } else if (IsEnumOrNullableEnum (left.Type)) {
-                               result_type = left.Type;
                        } else {
-                               result_type = right.Type;
+                               if (IsEnumOrNullableEnum (left.Type)) {
+                                       result_type = left.Type;
+                               } else {
+                                       result_type = right.Type;
+                               }
+
+                               if (expr is Nullable.LiftedBinaryOperator && !result_type.IsNullableType)
+                                       result_type = rc.Module.PredefinedTypes.Nullable.TypeSpec.MakeGenericType (rc.Module, new[] { result_type });
                        }
 
                        return EmptyCast.Create (expr, result_type);
@@ -3865,9 +3873,15 @@ namespace Mono.CSharp
                                //
                                // Now try lifted version of predefined operators
                                //
-                               result = ResolveOperatorPredefined (ec, ec.Module.OperatorsBinaryEqualityLifted, no_arg_conv);
-                               if (result != null)
-                                       return result;
+                               if (no_arg_conv && !l.IsNullableType) {
+                                       //
+                                       // Optimizes cases which won't match
+                                       //
+                               } else {
+                                       result = ResolveOperatorPredefined (ec, ec.Module.OperatorsBinaryEqualityLifted, no_arg_conv);
+                                       if (result != null)
+                                               return result;
+                               }
 
                                //
                                // The == and != operators permit one operand to be a value of a nullable
@@ -4330,6 +4344,14 @@ namespace Mono.CSharp
                /// </remarks>
                public override void EmitBranchable (EmitContext ec, Label target, bool on_true)
                {
+                       if (ec.HasSet (BuilderContext.Options.AsyncBody) && right.ContainsEmitWithAwait ()) {
+                               left = left.EmitToField (ec);
+
+                               if ((oper & Operator.LogicalMask) == 0) {
+                                       right = right.EmitToField (ec);
+                               }
+                       }
+
                        //
                        // This is more complicated than it looks, but its just to avoid
                        // duplicated tests: basically, we allow ==, !=, >, <, >= and <=
@@ -6015,7 +6037,7 @@ namespace Mono.CSharp
                                if (member_expr != null)
                                        member_expr = member_expr.Resolve (ec);
                        } else {
-                               member_expr = expr.Resolve (ec, ResolveFlags.VariableOrValue | ResolveFlags.MethodGroup);
+                               member_expr = expr.Resolve (ec);
                        }
 
                        if (member_expr == null)
@@ -6533,14 +6555,16 @@ namespace Mono.CSharp
                                }
 
                                if (vr != null) {
+                                       ec.MarkCallEntry (loc);
                                        ec.Emit (OpCodes.Call, method);
                                        return false;
                                }
                        }
                        
                        if (type is TypeParameterSpec)
-                               return DoEmitTypeParameter (ec);                        
+                               return DoEmitTypeParameter (ec);
 
+                       ec.MarkCallEntry (loc);
                        ec.Emit (OpCodes.Newobj, method);
                        return true;
                }
@@ -8598,7 +8622,7 @@ namespace Mono.CSharp
 
                                e = e.ResolveLValue (rc, right_side);
                        } else {
-                               e = e.Resolve (rc, ResolveFlags.VariableOrValue | ResolveFlags.Type);
+                               e = e.Resolve (rc, ResolveFlags.VariableOrValue | ResolveFlags.Type | ResolveFlags.MethodGroup);
                        }
 
                        return e;
@@ -10037,6 +10061,7 @@ namespace Mono.CSharp
                public override void Emit (EmitContext ec)
                {
                        source.Emit (ec);
+                       ec.MarkCallEntry (loc);
                        ec.Emit (OpCodes.Call, method);
                }
 
@@ -10553,6 +10578,12 @@ namespace Mono.CSharp
                        this.loc = loc;
                }
 
+               public CollectionElementInitializer (Location loc)
+                       : base (null, null)
+               {
+                       this.loc = loc;
+               }
+
                public override Expression CreateExpressionTree (ResolveContext ec)
                {
                        Arguments args = new Arguments (2);
index 95c561980abe079514c970b633f938c634e139f8..f5603b4fae4ebecd7daa335c60ed08f4bf131d4f 100644 (file)
@@ -358,9 +358,9 @@ namespace Mono.CSharp
                        return fs;
                }
 
-               public override List<TypeSpec> ResolveMissingDependencies ()
+               public override List<MissingTypeSpecReference> ResolveMissingDependencies (MemberSpec caller)
                {
-                       return memberType.ResolveMissingDependencies ();
+                       return memberType.ResolveMissingDependencies (this);
                }
        }
 
index e71051994e0e07af7d8519fb2fa50c28471bdcd7..4fee5a1f707ac72a1ed102aabc7701f259be7778 100644 (file)
@@ -800,7 +800,7 @@ namespace Mono.CSharp
                }
        }
 
-       public  class FlowBranchingAsync : FlowBranchingBlock
+       public class FlowBranchingAsync : FlowBranchingBlock
        {
                readonly AsyncInitializer async_init;
 
index 88771a8d4e196e74d8917da5157a27aead7b88a5..31b69fbeb86f5ff247936fde0b3b329c0416257e 100644 (file)
@@ -28,6 +28,50 @@ using System.Reflection.Emit;
 #endif
 
 namespace Mono.CSharp {
+       public class VarianceDecl
+       {
+               public VarianceDecl (Variance variance, Location loc)
+               {
+                       this.Variance = variance;
+                       this.Location = loc;
+               }
+
+               public Variance Variance { get; private set; }
+               public Location Location { get; private set; }
+
+               public static Variance CheckTypeVariance (TypeSpec t, Variance expected, IMemberContext member)
+               {
+                       var tp = t as TypeParameterSpec;
+                       if (tp != null) {
+                               var v = tp.Variance;
+                               if (expected == Variance.None && v != expected ||
+                                       expected == Variance.Covariant && v == Variance.Contravariant ||
+                                       expected == Variance.Contravariant && v == Variance.Covariant) {
+                                       ((TypeParameter) tp.MemberDefinition).ErrorInvalidVariance (member, expected);
+                               }
+
+                               return expected;
+                       }
+
+                       if (t.TypeArguments.Length > 0) {
+                               var targs_definition = t.MemberDefinition.TypeParameters;
+                               TypeSpec[] targs = TypeManager.GetTypeArguments (t);
+                               for (int i = 0; i < targs.Length; ++i) {
+                                       var v = targs_definition[i].Variance;
+                                       CheckTypeVariance (targs[i], (Variance) ((int) v * (int) expected), member);
+                               }
+
+                               return expected;
+                       }
+
+                       var ac = t as ArrayContainer;
+                       if (ac != null)
+                               return CheckTypeVariance (ac.Element, expected, member);
+
+                       return Variance.None;
+               }
+       }
+
        public enum Variance
        {
                //
@@ -235,7 +279,7 @@ namespace Mono.CSharp {
                                        // is valid with respect to T
                                        //
                                        if (tp.IsMethodTypeParameter) {
-                                               TypeManager.CheckTypeVariance (type, Variance.Contravariant, context);
+                                               VarianceDecl.CheckTypeVariance (type, Variance.Contravariant, context);
                                        }
 
                                        var tp_def = constraint_tp.MemberDefinition as TypeParameter;
@@ -360,20 +404,22 @@ namespace Mono.CSharp {
                GenericTypeParameterBuilder builder;
                readonly TypeParameterSpec spec;
 
-               public TypeParameter (int index, MemberName name, Constraints constraints, Attributes attrs, Variance variance)
+               public TypeParameter (int index, MemberName name, Constraints constraints, Attributes attrs, Variance Variance)
                        : base (null, name, attrs)
                {
                        this.constraints = constraints;
-                       this.spec = new TypeParameterSpec (null, index, this, SpecialConstraint.None, variance, null);
+                       this.spec = new TypeParameterSpec (null, index, this, SpecialConstraint.None, Variance, null);
                }
 
                //
                // Used by parser
                //
-               public TypeParameter (MemberName name, Attributes attrs, Variance variance)
+               public TypeParameter (MemberName name, Attributes attrs, VarianceDecl variance)
                        : base (null, name, attrs)
                {
-                       this.spec = new TypeParameterSpec (null, -1, this, SpecialConstraint.None, variance, null);
+                       var var = variance == null ? Variance.None : variance.Variance;
+                       this.spec = new TypeParameterSpec (null, -1, this, SpecialConstraint.None, var, null);
+                       this.VarianceDecl = variance;
                }
                
                public TypeParameter (TypeParameterSpec spec, TypeSpec parentSpec, MemberName name, Attributes attrs)
@@ -482,6 +528,8 @@ namespace Mono.CSharp {
                        }
                }
 
+               public VarianceDecl VarianceDecl { get; private set; }
+
                #endregion
 
                //
@@ -511,7 +559,7 @@ namespace Mono.CSharp {
 
                        // Copy constraint from resolved part to partial container
                        spec.SpecialConstraint = tp.spec.SpecialConstraint;
-                       spec.Interfaces = tp.spec.Interfaces;
+                       spec.InterfacesDefined = tp.spec.InterfacesDefined;
                        spec.TypeArguments = tp.spec.TypeArguments;
                        spec.BaseType = tp.spec.BaseType;
                        
@@ -2494,8 +2542,8 @@ namespace Mono.CSharp {
                        //
                        // Check the interfaces constraints
                        //
-                       if (tparam.Interfaces != null) {
-                               foreach (TypeSpec iface in tparam.Interfaces) {
+                       if (tparam.InterfacesDefined != null) {
+                               foreach (TypeSpec iface in tparam.InterfacesDefined) {
                                        if (!CheckConversion (mc, context, atype, tparam, iface, loc)) {
                                                if (mc == null)
                                                        return false;
@@ -2638,40 +2686,6 @@ namespace Mono.CSharp {
                }
        }
 
-       public partial class TypeManager
-       {
-               public static Variance CheckTypeVariance (TypeSpec t, Variance expected, IMemberContext member)
-               {
-                       var tp = t as TypeParameterSpec;
-                       if (tp != null) {
-                               Variance v = tp.Variance;
-                               if (expected == Variance.None && v != expected ||
-                                       expected == Variance.Covariant && v == Variance.Contravariant ||
-                                       expected == Variance.Contravariant && v == Variance.Covariant) {
-                                       ((TypeParameter)tp.MemberDefinition).ErrorInvalidVariance (member, expected);
-                               }
-
-                               return expected;
-                       }
-
-                       if (t.TypeArguments.Length > 0) {
-                               var targs_definition = t.MemberDefinition.TypeParameters;
-                               TypeSpec[] targs = GetTypeArguments (t);
-                               for (int i = 0; i < targs.Length; ++i) {
-                                       Variance v = targs_definition[i].Variance;
-                                       CheckTypeVariance (targs[i], (Variance) ((int)v * (int)expected), member);
-                               }
-
-                               return expected;
-                       }
-
-                       if (t.IsArray)
-                               return CheckTypeVariance (GetElementType (t), expected, member);
-
-                       return Variance.None;
-               }
-       }
-
        //
        // Implements C# type inference
        //
index 35d32c1d11643fd948721584b4d95282174cf297..2d787dd4e3095c4746c71e22abd13b0480568ba0 100644 (file)
@@ -324,10 +324,9 @@ namespace Mono.CSharp
                                        //    IFoo<A<T>> foo;   // A<T> is definition in this case
                                        // }
                                        //
-                                       // TODO: Is full logic from CreateType needed here as well?
-                                       //
                                        if (!IsMissingType (type) && type.IsGenericTypeDefinition) {
-                                               var targs = CreateGenericArguments (0, type.GetGenericArguments (), dtype);
+                                               var start_pos = spec.DeclaringType == null ? 0 : spec.DeclaringType.MemberDefinition.TypeParametersCount;
+                                               var targs = CreateGenericArguments (start_pos, type.GetGenericArguments (), dtype);
                                                spec = spec.MakeGenericType (module, targs);
                                        }
                                }
@@ -774,24 +773,34 @@ namespace Mono.CSharp
 
                                        for (int i = nested_hierarchy.Count; i != 0; --i) {
                                                var t = nested_hierarchy [i - 1];
-                                               spec = MemberCache.FindNestedType (spec, t.Name, t.Arity);
+                                               if (t.Kind == MemberKind.MissingType)
+                                                       spec = t;
+                                               else
+                                                       spec = MemberCache.FindNestedType (spec, t.Name, t.Arity);
+
                                                if (t.Arity > 0) {
                                                        spec = spec.MakeGenericType (module, targs.Skip (targs_pos).Take (spec.Arity).ToArray ());
                                                        targs_pos += t.Arity;
                                                }
                                        }
 
-                                       string name = type.Name;
-                                       int index = name.IndexOf ('`');
-                                       if (index > 0)
-                                               name = name.Substring (0, index);
+                                       if (spec.Kind == MemberKind.MissingType) {
+                                               spec = new TypeSpec (MemberKind.MissingType, spec, new ImportedTypeDefinition (type_def, this), type_def, Modifiers.PUBLIC);
+                                               spec.MemberCache = MemberCache.Empty;
+                                       } else {
+                                               if ((type_def.Attributes & TypeAttributes.VisibilityMask) == TypeAttributes.NestedPrivate && IgnorePrivateMembers)
+                                                       return null;
 
-                                       spec = MemberCache.FindNestedType (spec, name, targs.Length - targs_pos);
-                                       if (spec == null)
-                                               return null;
+                                               string name = type.Name;
+                                               int index = name.IndexOf ('`');
+                                               if (index > 0)
+                                                       name = name.Substring (0, index);
 
-                                       if (spec.Arity > 0) {
-                                               spec = spec.MakeGenericType (module, targs.Skip (targs_pos).ToArray ());
+                                               spec = MemberCache.FindNestedType (spec, name, targs.Length - targs_pos);
+
+                                               if (spec.Arity > 0) {
+                                                       spec = spec.MakeGenericType (module, targs.Skip (targs_pos).ToArray ());
+                                               }
                                        }
                                }
 
@@ -1883,7 +1892,7 @@ namespace Mono.CSharp
 
                }
 
-               public static void Error_MissingDependency (IMemberContext ctx, List<TypeSpec> types, Location loc)
+               public static void Error_MissingDependency (IMemberContext ctx, List<MissingTypeSpecReference> missing, Location loc)
                {
                        // 
                        // Report details about missing type and most likely cause of the problem.
@@ -1894,8 +1903,8 @@ namespace Mono.CSharp
 
                        var report = ctx.Module.Compiler.Report;
 
-                       for (int i = 0; i < types.Count; ++i) {
-                               var t = types [i];
+                       for (int i = 0; i < missing.Count; ++i) {
+                               var t = missing [i].Type;
 
                                //
                                // Report missing types only once
@@ -1905,6 +1914,10 @@ namespace Mono.CSharp
 
                                string name = t.GetSignatureForError ();
 
+                               var caller = missing[i].Caller;
+                               if (caller.Kind != MemberKind.MissingType)
+                                       report.SymbolRelatedToPreviousError (caller);
+
                                if (t.MemberDefinition.DeclaringAssembly == ctx.Module.DeclaringAssembly) {
                                        report.Error (1683, loc,
                                                "Reference to type `{0}' claims it is defined in this assembly, but it is not defined in source or any added modules",
@@ -2097,7 +2110,13 @@ namespace Mono.CSharp
                                                if (get == null && set == null)
                                                        continue;
 
-                                               imported = importer.CreateProperty (p, declaringType, get, set);
+                                               try {
+                                                       imported = importer.CreateProperty (p, declaringType, get, set);
+                                               } catch (Exception ex) {
+                                                       throw new InternalErrorException (ex, "Could not import property `{0}' inside `{1}'",
+                                                               p.Name, declaringType.GetSignatureForError ());
+                                               }
+
                                                if (imported == null)
                                                        continue;
 
index bda1909d2d6330b9e20e1210212a05926a512bec..5f6cc0ef335632ccebbe97c32c629a52c94394d4 100644 (file)
@@ -493,29 +493,29 @@ namespace Mono.CSharp {
                        return ms;
                }
 
-               public override List<TypeSpec> ResolveMissingDependencies ()
+               public override List<MissingTypeSpecReference> ResolveMissingDependencies (MemberSpec caller)
                {
-                       var missing = returnType.ResolveMissingDependencies ();
+                       var missing = returnType.ResolveMissingDependencies (this);
                        foreach (var pt in parameters.Types) {
-                               var m = pt.GetMissingDependencies ();
+                               var m = pt.GetMissingDependencies (this);
                                if (m == null)
                                        continue;
 
                                if (missing == null)
-                                       missing = new List<TypeSpec> ();
+                                       missing = new List<MissingTypeSpecReference> ();
 
                                missing.AddRange (m);
                        }
 
                        if (Arity > 0) {
                                foreach (var tp in GenericDefinition.TypeParameters) {
-                                       var m = tp.GetMissingDependencies ();
+                                       var m = tp.GetMissingDependencies (this);
 
                                        if (m == null)
                                                continue;
 
                                        if (missing == null)
-                                               missing = new List<TypeSpec> ();
+                                               missing = new List<MissingTypeSpecReference> ();
 
                                        missing.AddRange (m);
                                }
index 4eeb37d59fa723b135ab002a8072ca581a640446..ceb73afc743f3fade798f311f549721e88ef43fe 100644 (file)
@@ -314,7 +314,7 @@ namespace Mono.CSharp
 
                public override void AddTypeContainer (TypeContainer tc)
                {
-                       containers.Add (tc);
+                       AddTypeContainerMember (tc);
                }
 
                public override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)
index 7103f8df2cb8eb6b50ac9e6b86526121985846ee..f454b93498665cd1da1c66d74f2f4d03f96d42e9 100644 (file)
@@ -754,6 +754,11 @@ namespace Mono.CSharp {
 
                        return Compiler.Settings.IsConditionalSymbolDefined (value);
                }
+
+               public override void Accept (StructuralVisitor visitor)
+               {
+                       visitor.Visit (this);
+               }
        }
 
 
@@ -887,7 +892,7 @@ namespace Mono.CSharp {
                        MemberCore mc;
                        if (names_container.DefinedNames.TryGetValue (name, out mc)) {
                                if (tc is NamespaceContainer && mc is NamespaceContainer) {
-                                       containers.Add (tc);
+                                       AddTypeContainerMember (tc);
                                        return;
                                }
 
@@ -1057,6 +1062,9 @@ namespace Mono.CSharp {
 
                public override void GetCompletionStartingWith (string prefix, List<string> results)
                {
+                       if (Usings == null)
+                               return;
+
                        foreach (var un in Usings) {
                                if (un.Alias != null)
                                        continue;
@@ -1132,7 +1140,7 @@ namespace Mono.CSharp {
                        if (aliases != null && arity == 0) {
                                UsingAliasNamespace uan;
                                if (aliases.TryGetValue (name, out uan)) {
-                                       if (fne != null) {
+                                       if (fne != null && mode != LookupMode.Probing) {
                                                // TODO: Namespace has broken location
                                                //Report.SymbolRelatedToPreviousError (fne.Location, null);
                                                Compiler.Report.SymbolRelatedToPreviousError (uan.Location, null);
@@ -1325,6 +1333,11 @@ namespace Mono.CSharp {
 
                        return false;
                }
+
+               public override void Accept (StructuralVisitor visitor)
+               {
+                       visitor.Visit (this);
+               }
        }
 
        public class UsingNamespace
index 69ae1cf839f2a8da9cd5352f0b2fa11521f27a8f..62ee7ab5aa8d6417ef00f8db80335abef0e570e7 100644 (file)
@@ -394,7 +394,7 @@ namespace Mono.CSharp {
                                return null;
                        }
 
-                       TypeManager.CheckTypeVariance (parameter_type,
+                       VarianceDecl.CheckTypeVariance (parameter_type,
                                (modFlags & Parameter.Modifier.RefOutMask) != 0 ? Variance.None : Variance.Contravariant,
                                rc);
 
index 06ffb0df7a442445586fee47023cb2e5f1af939d..435dac630f6cd4d480ab9a683fbacb18110dd3e0 100644 (file)
@@ -174,9 +174,9 @@ namespace Mono.CSharp
                        return ps;
                }
 
-               public override List<TypeSpec> ResolveMissingDependencies ()
+               public override List<MissingTypeSpecReference> ResolveMissingDependencies (MemberSpec caller)
                {
-                       return memberType.ResolveMissingDependencies ();
+                       return memberType.ResolveMissingDependencies (this);
                }
        }
 
@@ -735,6 +735,10 @@ namespace Mono.CSharp
                        }
                }
 
+               static readonly string[] attribute_target_auto = new string[] { "property", "field" };
+
+               Field backing_field;
+
                public Property (TypeDefinition parent, FullNamedExpression type, Modifiers mod,
                                 MemberName name, Attributes attrs)
                        : base (parent, type, mod,
@@ -749,19 +753,28 @@ namespace Mono.CSharp
                {
                        visitor.Visit (this);
                }
-               
+
+               public override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)
+               {
+                       if (a.Target == AttributeTargets.Field) {
+                               backing_field.ApplyAttributeBuilder (a, ctor, cdata, pa);
+                               return;
+                       }
+
+                       base.ApplyAttributeBuilder (a, ctor, cdata, pa);
+               }
 
                void CreateAutomaticProperty ()
                {
                        // Create backing field
-                       Field field = new BackingField (this);
-                       if (!field.Define ())
+                       backing_field = new BackingField (this);
+                       if (!backing_field.Define ())
                                return;
 
-                       Parent.PartialContainer.Members.Add (field);
+                       Parent.PartialContainer.Members.Add (backing_field);
 
-                       FieldExpr fe = new FieldExpr (field, Location);
-                       if ((field.ModFlags & Modifiers.STATIC) == 0)
+                       FieldExpr fe = new FieldExpr (backing_field, Location);
+                       if ((backing_field.ModFlags & Modifiers.STATIC) == 0)
                                fe.InstanceExpression = new CompilerGeneratedThis (Parent.CurrentType, Location);
 
                        //
@@ -826,6 +839,13 @@ namespace Mono.CSharp
 
                        base.Emit ();
                }
+
+               public override string[] ValidAttributeTargets {
+                       get {
+                               return Get != null && ((Get.ModFlags & Modifiers.COMPILER_GENERATED) != 0) ?
+                                       attribute_target_auto : base.ValidAttributeTargets;
+                       }
+               }
        }
 
        /// <summary>
@@ -1427,9 +1447,9 @@ namespace Mono.CSharp
                        return es;
                }
 
-               public override List<TypeSpec> ResolveMissingDependencies ()
+               public override List<MissingTypeSpecReference> ResolveMissingDependencies (MemberSpec caller)
                {
-                       return MemberType.ResolveMissingDependencies ();
+                       return MemberType.ResolveMissingDependencies (this);
                }
        }
  
@@ -1701,16 +1721,17 @@ namespace Mono.CSharp
                        return spec;
                }
 
-               public override List<TypeSpec> ResolveMissingDependencies ()
+               public override List<MissingTypeSpecReference> ResolveMissingDependencies (MemberSpec caller)
                {
-                       var missing = base.ResolveMissingDependencies ();
+                       var missing = base.ResolveMissingDependencies (caller);
+
                        foreach (var pt in parameters.Types) {
-                               var m = pt.GetMissingDependencies ();
+                               var m = pt.GetMissingDependencies (caller);
                                if (m == null)
                                        continue;
 
                                if (missing == null)
-                                       missing = new List<TypeSpec> ();
+                                       missing = new List<MissingTypeSpecReference> ();
 
                                missing.AddRange (m);
                        }
index fa15cad9be6fad207d5bc87ea52262bbc92dc2fe..c1b0a32e01bb2a564012bff43f63f5f68c924521 100644 (file)
@@ -576,7 +576,7 @@ namespace Mono.CSharp {
                public bool ProcessWarningsList (string text, Action<int> action)
                {
                        bool valid = true;
-                       foreach (string wid in text.Split (numeric_value_separator)) {
+                       foreach (string wid in text.Split (numeric_value_separator, StringSplitOptions.RemoveEmptyEntries)) {
                                int id;
                                if (!int.TryParse (wid, NumberStyles.AllowLeadingWhite, CultureInfo.InvariantCulture, out id)) {
                                        report.Error (1904, "`{0}' is not a valid warning number", wid);
index 4bd207aa00f0f72729c019c4458dfeec50794d6a..64d205081d5f023b4bd8636eececc9465376dd0e 100644 (file)
@@ -702,7 +702,7 @@ namespace Mono.CSharp {
 
        public class StatementErrorExpression : Statement
        {
-               readonly Expression expr;
+               Expression expr;
 
                public StatementErrorExpression (Expression expr)
                {
@@ -729,7 +729,9 @@ namespace Mono.CSharp {
 
                protected override void CloneTo (CloneContext clonectx, Statement target)
                {
-                       throw new NotImplementedException ();
+                       var t = (StatementErrorExpression) target;
+
+                       t.expr = expr.Clone (clonectx);
                }
                
                public override object Accept (StructuralVisitor visitor)
@@ -3075,7 +3077,7 @@ namespace Mono.CSharp {
                                        unreachable = top_level.End ();
                                }
                        } catch (Exception e) {
-                               if (e is CompletionResult || rc.Report.IsDisabled || e is FatalException)
+                               if (e is CompletionResult || rc.Report.IsDisabled || e is FatalException || rc.Report.Printer is NullReportPrinter)
                                        throw;
 
                                if (rc.CurrentBlock != null) {
index d4e018c32594ad118a57c80cd32f675943c470d3..8cbbc14680557a301ba3dcb59834d1b2f8c09012 100644 (file)
@@ -322,4 +322,38 @@ namespace Mono.CSharp {
                        }
                }
        }
+
+       struct TypeNameParser
+       {
+               internal static string Escape(string name)
+               {
+                       if (name == null) {
+                               return null;
+                       }
+                       StringBuilder sb = null;
+                       for (int pos = 0; pos < name.Length; pos++) {
+                               char c = name[pos];
+                               switch (c) {
+                                       case '\\':
+                                       case '+':
+                                       case ',':
+                                       case '[':
+                                       case ']':
+                                       case '*':
+                                       case '&':
+                                               if (sb == null) {
+                                                       sb = new StringBuilder(name, 0, pos, name.Length + 3);
+                                               }
+                                               sb.Append("\\").Append(c);
+                                               break;
+                                       default:
+                                               if (sb != null) {
+                                                       sb.Append(c);
+                                               }
+                                               break;
+                               }
+                       }
+                       return sb != null ? sb.ToString() : name;
+               }
+       }
 }
index f9e623971a7eae404d3dd59a6bdee4ed2af5d711..fd727a4a80c9a2f0b7179e39f1195ce68bef122b 100644 (file)
@@ -738,22 +738,22 @@ namespace Mono.CSharp
                        return this;
                }
 
-               public override List<TypeSpec> ResolveMissingDependencies ()
+               public override List<MissingTypeSpecReference> ResolveMissingDependencies (MemberSpec caller)
                {
-                       List<TypeSpec> missing = null;
+                       List<MissingTypeSpecReference> missing = null;
 
                        if (Kind == MemberKind.MissingType) {
-                               missing = new List<TypeSpec> ();
-                               missing.Add (this);
+                               missing = new List<MissingTypeSpecReference> ();
+                               missing.Add (new MissingTypeSpecReference (this, caller));
                                return missing;
                        }
 
                        foreach (var targ in TypeArguments) {
                                if (targ.Kind == MemberKind.MissingType) {
                                        if (missing == null)
-                                               missing = new List<TypeSpec> ();
+                                               missing = new List<MissingTypeSpecReference> ();
 
-                                       missing.Add (targ);
+                                       missing.Add (new MissingTypeSpecReference (targ, caller));
                                }
                        }
 
@@ -761,19 +761,19 @@ namespace Mono.CSharp
                                foreach (var iface in Interfaces) {
                                        if (iface.Kind == MemberKind.MissingType) {
                                                if (missing == null)
-                                                       missing = new List<TypeSpec> ();
+                                                       missing = new List<MissingTypeSpecReference> ();
 
-                                               missing.Add (iface);
+                                               missing.Add (new MissingTypeSpecReference (iface, caller));
                                        }
                                }
                        }
 
                        if (MemberDefinition.TypeParametersCount > 0) {
                                foreach (var tp in MemberDefinition.TypeParameters) {
-                                       var tp_missing = tp.GetMissingDependencies ();
+                                       var tp_missing = tp.GetMissingDependencies (this);
                                        if (tp_missing != null) {
                                                if (missing == null)
-                                                       missing = new List<TypeSpec> ();
+                                                       missing = new List<MissingTypeSpecReference> ();
 
                                                missing.AddRange (tp_missing);
                                        }
@@ -783,7 +783,7 @@ namespace Mono.CSharp
                        if (missing != null || BaseType == null)
                                return missing;
 
-                       return BaseType.ResolveMissingDependencies ();
+                       return BaseType.ResolveMissingDependencies (this);
                }
 
                public void SetMetaInfo (MetaType info)
@@ -798,6 +798,31 @@ namespace Mono.CSharp
                {
                        modifiers |= Modifiers.METHOD_EXTENSION;
                }
+
+               public void UpdateInflatedInstancesBaseType ()
+               {
+                       //
+                       // When nested class has a partial part the situation where parent type
+                       // is inflated before its base type is defined can occur. In such case
+                       // all inflated (should be only 1) instansted need to be updated
+                       //
+                       // partial class A<T> {
+                       //   partial class B : A<int> { }
+                       // }
+                       //
+                       // partial class A<T> : X {}
+                       //
+                       if (inflated_instances == null)
+                               return;
+
+                       foreach (var inflated in inflated_instances) {
+                               //
+                               // Don't need to inflate possible generic type because for now the method
+                               // is always used from within the nested type
+                               //
+                               inflated.Value.BaseType = base_type;
+                       }
+               }
        }
 
        //
@@ -1950,4 +1975,16 @@ namespace Mono.CSharp
                        return pc;
                }
        }
+
+       public class MissingTypeSpecReference
+       {
+               public MissingTypeSpecReference (TypeSpec type, MemberSpec caller)
+               {
+                       Type = type;
+                       Caller = caller;
+               }
+
+               public TypeSpec Type { get; private set; }
+               public MemberSpec Caller { get; private set; }
+       }
 }
index 4d4ca0fd035d5d369955db47ec3d332a1c963d48..fc2aa5e62b830cb238aba7b2308d53e3afbe4d85 100644 (file)
@@ -58,6 +58,11 @@ namespace Mono.CSharp
                        VisitTypeContainer (ns);
                }
 
+               public virtual void Visit (CompilationSourceFile csf)
+               {
+                       VisitTypeContainer (csf);
+               }
+
                public virtual void Visit (Class c)
                {
                        VisitTypeContainer (c);
diff --git a/mcs/tests/gtest-589.cs b/mcs/tests/gtest-589.cs
new file mode 100644 (file)
index 0000000..4599fe2
--- /dev/null
@@ -0,0 +1,40 @@
+using System;
+
+public class Z : IGenericInterface<Z>
+{
+       public Z Start ()
+       {
+               return this;
+       }
+
+       Z IGenericInterface<Z>.Start ()
+       {
+               throw new ApplicationException ();
+       }
+}
+
+public interface IGenericInterface<T>
+{
+       T Start ();
+}
+
+public class A<T> where T : Z, IGenericInterface<int> 
+{
+       public void SomeOperation (T t)
+       {
+               t.Start ();
+       }
+}
+
+public class C : Z, IGenericInterface<int> 
+{
+       int IGenericInterface<int>.Start ()
+       {
+               throw new NotImplementedException ();
+       }
+
+       public static void Main ()
+       {
+               new A<C> ().SomeOperation (new C ());
+       }
+}
\ No newline at end of file
diff --git a/mcs/tests/gtest-590.cs b/mcs/tests/gtest-590.cs
new file mode 100644 (file)
index 0000000..96c276a
--- /dev/null
@@ -0,0 +1,21 @@
+using System;
+
+enum E
+{
+       V
+}
+
+class C
+{
+       public static void Main ()
+       {
+               byte? foo = 0;
+               E e = 0;
+               var res = foo - e;
+               Console.WriteLine (res);
+               var res2 = e - foo;
+               Console.WriteLine (res2);
+               res = null;
+               res2 = null;
+       }
+}
\ No newline at end of file
diff --git a/mcs/tests/gtest-591-lib.cs b/mcs/tests/gtest-591-lib.cs
new file mode 100644 (file)
index 0000000..6f43ae7
--- /dev/null
@@ -0,0 +1,14 @@
+// Compiler options: -target:library
+
+using System;
+
+namespace A
+{
+       public class B<T>
+       {
+               public abstract class C : System.IEquatable<C>
+               {
+                       public abstract bool Equals (C other);
+               }
+       }
+}
diff --git a/mcs/tests/gtest-591.cs b/mcs/tests/gtest-591.cs
new file mode 100644 (file)
index 0000000..fd0bae0
--- /dev/null
@@ -0,0 +1,13 @@
+// Compiler options: -r:gtest-591-lib.dll
+
+using System;
+
+public class E
+{
+       public System.Collections.Generic.Dictionary<int, A.B<int>.C> F;
+       public static void Main ()
+       {
+               var e = new E ();
+               Console.WriteLine (e.F);
+       }
+}
diff --git a/mcs/tests/gtest-autoproperty-08.cs b/mcs/tests/gtest-autoproperty-08.cs
new file mode 100644 (file)
index 0000000..3aeeb7a
--- /dev/null
@@ -0,0 +1,22 @@
+using System;
+using System.Reflection;
+
+class AAttribute : Attribute
+{
+}
+
+class Program
+{
+       [field: A]
+       public int Prop { get; set; }
+
+       public static int Main ()
+       {
+               var f = typeof (Program).GetFields (BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly);
+               if (f[0].GetCustomAttribute<AAttribute> () == null)
+                       return 1;
+
+               return 0;
+       }
+}
+
index c511e8580617eb6c0a8312dd2109422878ec9267..248d1452d2bb949b8639d8fa3ddee3f21cf09b80 100644 (file)
@@ -2600,7 +2600,6 @@ class Tester
                Assert (1, e9.Compile ().Invoke (MyEnum.Value_2, MyEnum.Value_1));
        }
 
-       // CSC bug
        void SubtractTest_10 ()
        {
                Expression<Func<MyEnum?, byte?, MyEnum?>> e10 = (a, b) => a - b;
diff --git a/mcs/tests/gtest-partial-07.cs b/mcs/tests/gtest-partial-07.cs
new file mode 100644 (file)
index 0000000..d3b0319
--- /dev/null
@@ -0,0 +1,30 @@
+partial class A<T>
+{
+       internal partial class B : A<int>
+       {
+               public void Test ()
+               {
+                       Foo (3);
+               }
+       }
+}
+
+partial class A<T> : X<T>
+{
+
+}
+
+class X<U>
+{
+       public void Foo (U arg)
+       {
+       }
+}
+
+class M
+{
+       public static void Main ()
+       {
+               new A<string>.B ().Test ();
+       }
+}
\ No newline at end of file
diff --git a/mcs/tests/gtest-partial-08.cs b/mcs/tests/gtest-partial-08.cs
new file mode 100644 (file)
index 0000000..fcc96be
--- /dev/null
@@ -0,0 +1,58 @@
+namespace N
+{
+       public partial class A<T1, T2>
+       {
+               public partial class D
+               {
+                       public class C : D
+                       {
+                               public void Test ()
+                               {
+                                       Foo ();
+                               }
+                       }
+               }
+
+               public partial class D2<U>
+               {
+                       public class C2 : D2<int>
+                       {
+                               public void Test ()
+                               {
+                                       Foo (2);
+                               }
+                       }
+               }
+       }
+
+       public partial class A<T1, T2>
+       {
+               public partial class D : X
+               {
+               }
+
+               public partial class D2<U> : X2<U>
+               {
+               }
+       }
+
+       public class X2<W>
+       {
+               public void Foo (W arg)
+               {
+               }
+       }
+
+       public class X
+       {
+               public void Foo ()
+               {
+               }
+
+               public static void Main ()
+               {
+                       new A<int, long>.D.C ().Test ();
+                       new A<int, long>.D2<string>.C2 ().Test ();
+               }
+       }
+}
diff --git a/mcs/tests/gtest-partial-09.cs b/mcs/tests/gtest-partial-09.cs
new file mode 100644 (file)
index 0000000..2dbb116
--- /dev/null
@@ -0,0 +1,57 @@
+namespace A
+{
+       public partial class B<T>
+       {
+               public partial class C
+               {
+                       public class A { }
+               }
+       }
+}
+
+namespace A
+{
+       public abstract partial class B<T> where T : B<T>.C
+       {
+       }
+}
+
+namespace A
+{
+       public partial class B<T>
+       {
+               public partial class C : I
+               {
+               }
+       }
+}
+
+namespace A
+{
+       public interface Ibase
+       {
+       }
+
+       public partial class B<T>
+       {
+               public interface I : Ibase
+               {
+               }
+       }
+}
+
+namespace A
+{
+       class Bar : B<Bar>.C
+       {
+       }
+
+       public class Test
+       {
+               public static void Main ()
+               {
+                       Ibase b = new Bar ();
+                       System.Console.WriteLine (b != null);
+               }
+       }
+}
index 51508f7299358bc9287e9a297bbe8eb063b97b78..22f10ac7d205d6d2aaf99691294bbb6e8d5d3e6d 100644 (file)
@@ -15,10 +15,12 @@ class C1
 
 class C2
 {
+       const object o2 = c2;
+       const string c2 = null;
+       
        public static void Main ()
        {
-               // BUG compatibility for now
-               //const object o = null;
-               //const string s = (string) o;
+               const object o = null;
+               const string s = (string) o;
        }
 }
diff --git a/mcs/tests/test-869.cs b/mcs/tests/test-869.cs
new file mode 100644 (file)
index 0000000..e0f0167
--- /dev/null
@@ -0,0 +1,39 @@
+using System;
+
+public class C
+{
+       public static readonly C Token = new C ();
+
+       public static C operator & (C set, E value)
+       {
+               return Token;
+       }
+
+       public static implicit operator E (C c)
+       {
+               throw new ApplicationException ();
+       }
+}
+
+public enum E
+{
+       Item = 2
+}
+
+class FooClass
+{
+       public static int Main ()
+       {
+               C m = new C ();
+               var x = E.Item;
+               var res = m & x;
+               if (res != C.Token)
+                       return 1;
+
+               res = m & E.Item;
+               if (res != C.Token)
+                       return 2;
+
+               return 0;       
+       }
+}
\ No newline at end of file
index 54aabc3f37b478ce6e1137a45cbb8080fc779ea7..ea7fd528df15dfb3db2fb69a6ec14748ea40bda7 100644 (file)
@@ -353,6 +353,15 @@ class Tester : Base
                return 0;
        }
 
+       async Task<bool> BinaryTest_6 ()
+       {
+               var t = Task.Delay (1);
+               if (t == await Task.WhenAny(new [] { t }))
+                       return true;
+
+               return false;
+       }
+
        async Task<int> CallTest_1 ()
        {
                return Call (
index e2a361403c7ea8f95a872e5cdb11a220df44649d..3e0350012b945ee2c7bd643e1288139012fe8b19 100644 (file)
@@ -2,8 +2,7 @@ using System;
 using System.Threading.Tasks;
 
 // contextual async, parser tests
-
-class A
+class A : Iasync
 {
        async Task<int> async ()
        {
@@ -21,6 +20,10 @@ class A
                var res = (int) await async ();
                var res2 = (Int32) await async ();
        }
+       
+       async void Iasync.async ()
+       {
+       }
 
        public static int Main ()
        {
@@ -28,6 +31,11 @@ class A
        }
 }
 
+interface Iasync
+{
+       void async ();
+}
+
 class B
 {
        class async
index 4181816941a75c39217ec50e9ec9d9a3258856df..031aecb8fac8acf6605b520e591afba5e32cc72c 100644 (file)
@@ -44,6 +44,7 @@
       <sequencepoints>
         <entry il="0x0" row="4" col="2" file_ref="1" hidden="false" />
         <entry il="0x1" row="5" col="3" file_ref="1" hidden="false" />
+        <entry il="0x2" row="5" col="3" file_ref="1" hidden="false" />
         <entry il="0x7" row="6" col="2" file_ref="1" hidden="false" />
       </sequencepoints>
       <locals />
index e524e16c29691075f28efacba9c305eb0e41f7ba..60ce461555d9ed94b2b6e91924ca8a336b443ba7 100644 (file)
@@ -15,7 +15,7 @@
     <method token="0x6000002">
       <sequencepoints>
         <entry il="0x0" row="12" col="2" file_ref="1" hidden="false" />
-        <entry il="0x1" row="13" col="3" file_ref="1" hidden="false" />
+        <entry il="0x1" row="13" col="10" file_ref="1" hidden="false" />
         <entry il="0x6" row="13" col="26" file_ref="1" hidden="false" />
         <entry il="0x16" row="14" col="2" file_ref="1" hidden="false" />
       </sequencepoints>
@@ -41,6 +41,7 @@
         <entry il="0x1" row="25" col="10" file_ref="1" hidden="false" />
         <entry il="0x9" row="26" col="3" file_ref="1" hidden="false" />
         <entry il="0xa" row="27" col="3" file_ref="1" hidden="false" />
+        <entry il="0x18" row="25" col="14" file_ref="1" hidden="false" />
         <entry il="0x1e" row="28" col="2" file_ref="1" hidden="false" />
       </sequencepoints>
       <locals>
@@ -58,6 +59,8 @@
         <entry il="0x9" row="32" col="26" file_ref="1" hidden="false" />
         <entry il="0x11" row="33" col="3" file_ref="1" hidden="false" />
         <entry il="0x12" row="34" col="3" file_ref="1" hidden="false" />
+        <entry il="0x20" row="32" col="26" file_ref="1" hidden="false" />
+        <entry il="0x33" row="32" col="12" file_ref="1" hidden="false" />
         <entry il="0x39" row="35" col="2" file_ref="1" hidden="false" />
       </sequencepoints>
       <locals>
@@ -75,6 +78,7 @@
         <entry il="0x1" row="39" col="10" file_ref="1" hidden="false" />
         <entry il="0x10" row="40" col="3" file_ref="1" hidden="false" />
         <entry il="0x11" row="41" col="3" file_ref="1" hidden="false" />
+        <entry il="0x2e" row="39" col="13" file_ref="1" hidden="false" />
         <entry il="0x34" row="42" col="2" file_ref="1" hidden="false" />
       </sequencepoints>
       <locals>
     <method token="0x6000008">
       <sequencepoints>
         <entry il="0x0" row="45" col="2" file_ref="1" hidden="false" />
-        <entry il="0x1" row="46" col="10" file_ref="1" hidden="false" />
+        <entry il="0x1" row="46" col="19" file_ref="1" hidden="false" />
         <entry il="0x7" row="47" col="3" file_ref="1" hidden="false" />
         <entry il="0x8" row="48" col="4" file_ref="1" hidden="false" />
+        <entry il="0xd" row="48" col="12" file_ref="1" hidden="false" />
         <entry il="0x12" row="49" col="3" file_ref="1" hidden="false" />
+        <entry il="0x1f" row="46" col="14" file_ref="1" hidden="false" />
         <entry il="0x25" row="50" col="2" file_ref="1" hidden="false" />
       </sequencepoints>
       <locals>
       <sequencepoints>
         <entry il="0x0" row="103" col="2" file_ref="1" hidden="false" />
         <entry il="0x1" row="105" col="3" file_ref="1" hidden="false" />
+        <entry il="0x86" row="104" col="3" file_ref="1" hidden="false" />
         <entry il="0xb3" row="107" col="5" file_ref="1" hidden="false" />
         <entry il="0xb8" row="109" col="4" file_ref="1" hidden="false" />
         <entry il="0xb9" row="110" col="5" file_ref="1" hidden="false" />
         <entry il="0x1" row="175" col="3" file_ref="1" hidden="false" />
         <entry il="0x2" row="176" col="3" file_ref="1" hidden="false" />
         <entry il="0x3" row="177" col="4" file_ref="1" hidden="false" />
+        <entry il="0x8" row="177" col="12" file_ref="1" hidden="false" />
         <entry il="0xd" row="178" col="3" file_ref="1" hidden="false" />
       </sequencepoints>
       <locals />
       <sequencepoints>
         <entry il="0x0" row="182" col="2" file_ref="1" hidden="false" />
         <entry il="0x1" row="183" col="3" file_ref="1" hidden="false" />
+        <entry il="0x7" row="183" col="7" file_ref="1" hidden="false" />
         <entry il="0x11" row="184" col="3" file_ref="1" hidden="false" />
         <entry il="0x12" row="185" col="3" file_ref="1" hidden="false" />
         <entry il="0x18" row="187" col="3" file_ref="1" hidden="false" />
       <sequencepoints>
         <entry il="0x0" row="192" col="2" file_ref="1" hidden="false" />
         <entry il="0x1" row="193" col="3" file_ref="1" hidden="false" />
+        <entry il="0x7" row="193" col="7" file_ref="1" hidden="false" />
         <entry il="0x11" row="194" col="3" file_ref="1" hidden="false" />
         <entry il="0x12" row="195" col="3" file_ref="1" hidden="false" />
         <entry il="0x18" row="196" col="8" file_ref="1" hidden="false" />
+        <entry il="0x1e" row="196" col="12" file_ref="1" hidden="false" />
         <entry il="0x28" row="197" col="3" file_ref="1" hidden="false" />
         <entry il="0x29" row="198" col="3" file_ref="1" hidden="false" />
         <entry il="0x2f" row="200" col="3" file_ref="1" hidden="false" />
         <entry il="0x0" row="246" col="2" file_ref="1" hidden="false" />
         <entry il="0x1" row="247" col="3" file_ref="1" hidden="false" />
         <entry il="0x2" row="250" col="3" file_ref="1" hidden="false" />
+        <entry il="0x3" row="250" col="3" file_ref="1" hidden="false" />
         <entry il="0xe" row="248" col="4" file_ref="1" hidden="false" />
+        <entry il="0x10" row="250" col="3" file_ref="1" hidden="false" />
         <entry il="0x16" row="251" col="3" file_ref="1" hidden="false" />
         <entry il="0x17" row="252" col="3" file_ref="1" hidden="false" />
+        <entry il="0x1a" row="250" col="3" file_ref="1" hidden="false" />
+        <entry il="0x31" row="250" col="3" file_ref="1" hidden="false" />
         <entry il="0x37" row="253" col="2" file_ref="1" hidden="false" />
       </sequencepoints>
       <locals>
         <entry il="0x0" row="256" col="2" file_ref="1" hidden="false" />
         <entry il="0x1" row="257" col="3" file_ref="1" hidden="false" />
         <entry il="0x2" row="260" col="3" file_ref="1" hidden="false" />
+        <entry il="0x4" row="260" col="3" file_ref="1" hidden="false" />
         <entry il="0xf" row="258" col="4" file_ref="1" hidden="false" />
+        <entry il="0x10" row="260" col="3" file_ref="1" hidden="false" />
         <entry il="0x16" row="261" col="3" file_ref="1" hidden="false" />
         <entry il="0x17" row="262" col="3" file_ref="1" hidden="false" />
+        <entry il="0x19" row="260" col="3" file_ref="1" hidden="false" />
         <entry il="0x3c" row="263" col="2" file_ref="1" hidden="false" />
       </sequencepoints>
       <locals>
         <entry il="0x0" row="266" col="2" file_ref="1" hidden="false" />
         <entry il="0x1" row="267" col="3" file_ref="1" hidden="false" />
         <entry il="0x2" row="269" col="6" file_ref="1" hidden="false" />
+        <entry il="0x6" row="269" col="6" file_ref="1" hidden="false" />
+        <entry il="0xe" row="269" col="6" file_ref="1" hidden="false" />
         <entry il="0x24" row="268" col="3" file_ref="1" hidden="false" />
         <entry il="0x2f" row="270" col="3" file_ref="1" hidden="false" />
         <entry il="0x30" row="271" col="3" file_ref="1" hidden="false" />
index e9d76ccc3802a75944049c24de92d7fed31e966f..9bae89796d0373e1f1a8574ec2b53c561712f9ee 100644 (file)
@@ -52,6 +52,7 @@
     </method>
     <method token="0x6000006">
       <sequencepoints>
+        <entry il="0x0" row="34" col="2" file_ref="1" hidden="false" />
         <entry il="0xd" row="34" col="2" file_ref="1" hidden="false" />
         <entry il="0xe" row="35" col="3" file_ref="1" hidden="false" />
         <entry il="0x1b" row="37" col="2" file_ref="1" hidden="false" />
@@ -63,7 +64,7 @@
     </method>
     <method token="0x6000007">
       <sequencepoints>
-        <entry il="0x0" row="13" col="3" file_ref="1" hidden="false" />
+        <entry il="0x0" row="13" col="11" file_ref="1" hidden="false" />
       </sequencepoints>
       <locals />
       <scopes />
@@ -71,7 +72,7 @@
     <method token="0x6000008">
       <sequencepoints>
         <entry il="0x0" row="20" col="3" file_ref="1" hidden="false" />
-        <entry il="0x1" row="21" col="4" file_ref="1" hidden="false" />
+        <entry il="0x1" row="21" col="12" file_ref="1" hidden="false" />
         <entry il="0x6" row="22" col="3" file_ref="1" hidden="false" />
       </sequencepoints>
       <locals />
@@ -80,7 +81,7 @@
     <method token="0x6000009">
       <sequencepoints>
         <entry il="0x0" row="28" col="3" file_ref="1" hidden="false" />
-        <entry il="0x1" row="29" col="4" file_ref="1" hidden="false" />
+        <entry il="0x1" row="29" col="12" file_ref="1" hidden="false" />
         <entry il="0x6" row="30" col="3" file_ref="1" hidden="false" />
       </sequencepoints>
       <locals />
index 48404440a0df1051b5f348b13cb33e64e8223e6b..323939003d52a24bae3878e753ad28fe9e899b67 100644 (file)
@@ -13,6 +13,8 @@
       <sequencepoints>
         <entry il="0x0" row="6" col="2" file_ref="1" hidden="false" />
         <entry il="0x1" row="7" col="3" file_ref="1" hidden="false" />
+        <entry il="0xb" row="7" col="21" file_ref="1" hidden="false" />
+        <entry il="0x16" row="5" col="6" file_ref="1" hidden="false" />
         <entry il="0x1c" row="8" col="5" file_ref="1" hidden="false" />
       </sequencepoints>
       <locals />
index 6c9c492e40a4b920591dd347e71f0a742ed521d3..083ef56c2c0b9fff32c79c828a440e78e72e9a83 100644 (file)
     <method token="0x6000003">
       <sequencepoints>
         <entry il="0x0" row="14" col="2" file_ref="1" hidden="false" />
-        <entry il="0x1" row="15" col="3" file_ref="1" hidden="false" />
+        <entry il="0x1" row="15" col="11" file_ref="1" hidden="false" />
         <entry il="0x7" row="17" col="4" file_ref="1" hidden="false" />
+        <entry il="0xe" row="17" col="4" file_ref="1" hidden="false" />
         <entry il="0x13" row="20" col="4" file_ref="1" hidden="false" />
+        <entry il="0x1a" row="20" col="4" file_ref="1" hidden="false" />
         <entry il="0x21" row="24" col="2" file_ref="1" hidden="false" />
       </sequencepoints>
       <locals>
@@ -33,7 +35,7 @@
     <method token="0x6000004">
       <sequencepoints>
         <entry il="0x0" row="27" col="2" file_ref="1" hidden="false" />
-        <entry il="0x1" row="28" col="3" file_ref="1" hidden="false" />
+        <entry il="0x1" row="28" col="14" file_ref="1" hidden="false" />
         <entry il="0x7" row="30" col="4" file_ref="1" hidden="false" />
         <entry il="0x12" row="31" col="4" file_ref="1" hidden="false" />
         <entry il="0x1b" row="33" col="2" file_ref="1" hidden="false" />
index cf51ed208c79b7d0f899c2edcac1385ce9f16cd7..8c966ef91e8f63f76b24bf0f422a520846f0427b 100644 (file)
     </method>
     <method token="0x6000003">
       <sequencepoints>
+        <entry il="0xf" row="13" col="5" file_ref="1" hidden="false" />
+        <entry il="0x24" row="13" col="8" file_ref="1" hidden="false" />
         <entry il="0x2a" row="11" col="2" file_ref="1" hidden="false" />
         <entry il="0x2b" row="12" col="3" file_ref="1" hidden="false" />
+        <entry il="0x2d" row="14" col="4" file_ref="1" hidden="false" />
+        <entry il="0x40" row="13" col="4" file_ref="1" hidden="false" />
         <entry il="0x46" row="16" col="3" file_ref="1" hidden="false" />
         <entry il="0x4b" row="17" col="2" file_ref="1" hidden="false" />
       </sequencepoints>
@@ -33,6 +37,9 @@
       <sequencepoints>
         <entry il="0x0" row="20" col="2" file_ref="1" hidden="false" />
         <entry il="0x1" row="21" col="3" file_ref="1" hidden="false" />
+        <entry il="0x11" row="21" col="59" file_ref="1" hidden="false" />
+        <entry il="0x1c" row="21" col="53" file_ref="1" hidden="false" />
+        <entry il="0x2c" row="21" col="47" file_ref="1" hidden="false" />
         <entry il="0x32" row="22" col="2" file_ref="1" hidden="false" />
       </sequencepoints>
       <locals>
index 7961bca8a067fb15475cddf89c9f191b9978e31d..df5bd3c1056b17ed31ac2bef3ff4e5136eddb894 100644 (file)
@@ -67,7 +67,7 @@
         <entry il="0x0" row="30" col="2" file_ref="1" hidden="false" />
         <entry il="0x1" row="31" col="3" file_ref="1" hidden="false" />
         <entry il="0x7" row="32" col="3" file_ref="1" hidden="false" />
-        <entry il="0xe" row="33" col="3" file_ref="1" hidden="false" />
+        <entry il="0xe" row="33" col="15" file_ref="1" hidden="false" />
         <entry il="0x14" row="34" col="3" file_ref="1" hidden="false" />
         <entry il="0x81" row="35" col="2" file_ref="1" hidden="false" />
       </sequencepoints>
@@ -81,7 +81,7 @@
     <method token="0x6000009">
       <sequencepoints>
         <entry il="0x0" row="38" col="2" file_ref="1" hidden="false" />
-        <entry il="0x1" row="39" col="3" file_ref="1" hidden="false" />
+        <entry il="0x1" row="39" col="15" file_ref="1" hidden="false" />
         <entry il="0x7" row="40" col="3" file_ref="1" hidden="false" />
         <entry il="0x1e4" row="41" col="2" file_ref="1" hidden="false" />
       </sequencepoints>
index 9e557b6733fdffb4ad0f8e468057c9ace70a8047..5c426ff09e890e4bfd053b7a1b20523b2751db35 100644 (file)
@@ -25,7 +25,7 @@
     <method token="0x6000004">
       <sequencepoints>
         <entry il="0x0" row="16" col="2" file_ref="1" hidden="false" />
-        <entry il="0x1" row="17" col="3" file_ref="1" hidden="false" />
+        <entry il="0x1" row="17" col="15" file_ref="1" hidden="false" />
         <entry il="0x23" row="17" col="23" file_ref="1" hidden="false" />
         <entry il="0x2e" row="21" col="2" file_ref="1" hidden="false" />
       </sequencepoints>
@@ -40,7 +40,7 @@
     <method token="0x6000006">
       <sequencepoints>
         <entry il="0x0" row="29" col="2" file_ref="1" hidden="false" />
-        <entry il="0x1" row="30" col="3" file_ref="1" hidden="false" />
+        <entry il="0x1" row="30" col="15" file_ref="1" hidden="false" />
         <entry il="0x23" row="30" col="23" file_ref="1" hidden="false" />
         <entry il="0x2e" row="31" col="2" file_ref="1" hidden="false" />
       </sequencepoints>
@@ -99,6 +99,7 @@
       <sequencepoints>
         <entry il="0x21" row="34" col="2" file_ref="1" hidden="false" />
         <entry il="0x22" row="35" col="3" file_ref="1" hidden="false" />
+        <entry il="0x23" row="35" col="15" file_ref="1" hidden="false" />
         <entry il="0x2d" row="36" col="3" file_ref="1" hidden="false" />
         <entry il="0x8b" row="37" col="3" file_ref="1" hidden="false" />
         <entry il="0x3ab" row="38" col="3" file_ref="1" hidden="false" />
index a6af337137c7da45c8d30df948875f53239721e1..287791e7eb28203960a0b2699023ef6fa949b6ba 100644 (file)
@@ -41,6 +41,7 @@
       <sequencepoints>
         <entry il="0x27" row="7" col="2" file_ref="1" hidden="false" />
         <entry il="0x28" row="8" col="3" file_ref="1" hidden="false" />
+        <entry il="0x2d" row="8" col="11" file_ref="1" hidden="false" />
         <entry il="0x32" row="9" col="3" file_ref="1" hidden="false" />
         <entry il="0x41" row="10" col="3" file_ref="1" hidden="false" />
         <entry il="0x42" row="11" col="4" file_ref="1" hidden="false" />
@@ -77,6 +78,7 @@
       <sequencepoints>
         <entry il="0x0" row="14" col="3" file_ref="1" hidden="false" />
         <entry il="0x1" row="15" col="4" file_ref="1" hidden="false" />
+        <entry il="0x6" row="15" col="12" file_ref="1" hidden="false" />
         <entry il="0xb" row="16" col="3" file_ref="1" hidden="false" />
       </sequencepoints>
       <locals />
index 75fe231b6a569b382719c9a5fc2a72be14ca9d3f..c380f599bb1c66f931447c41d71fca1a9c3ebd7f 100644 (file)
@@ -31,7 +31,7 @@
     <method token="0x6000005">
       <sequencepoints>
         <entry il="0x0" row="20" col="2" file_ref="1" hidden="false" />
-        <entry il="0x1" row="21" col="3" file_ref="1" hidden="false" />
+        <entry il="0x1" row="21" col="9" file_ref="1" hidden="false" />
       </sequencepoints>
       <locals />
       <scopes />
@@ -68,6 +68,7 @@
       <sequencepoints>
         <entry il="0x21" row="15" col="2" file_ref="1" hidden="false" />
         <entry il="0x22" row="16" col="3" file_ref="1" hidden="false" />
+        <entry il="0x29" row="16" col="21" file_ref="1" hidden="false" />
         <entry il="0x47" row="17" col="2" file_ref="1" hidden="false" />
       </sequencepoints>
       <locals />
index c1fba7edd1a4f91de7f0cd44349f810370f80b75..5c15ce75a8098c82d1b0d0882983cdb2c7b34281 100644 (file)
@@ -22,6 +22,7 @@
       <sequencepoints>
         <entry il="0x0" row="8" col="2" file_ref="1" hidden="false" />
         <entry il="0x1" row="9" col="3" file_ref="1" hidden="false" />
+        <entry il="0x2" row="9" col="3" file_ref="1" hidden="false" />
         <entry il="0x7" row="9" col="8" file_ref="1" hidden="false" />
         <entry il="0xd" row="10" col="2" file_ref="1" hidden="false" />
       </sequencepoints>
@@ -32,6 +33,7 @@
       <sequencepoints>
         <entry il="0x0" row="13" col="2" file_ref="1" hidden="false" />
         <entry il="0x1" row="14" col="3" file_ref="1" hidden="false" />
+        <entry il="0x2" row="14" col="3" file_ref="1" hidden="false" />
         <entry il="0x7" row="14" col="11" file_ref="1" hidden="false" />
         <entry il="0xd" row="15" col="2" file_ref="1" hidden="false" />
       </sequencepoints>
@@ -53,6 +55,7 @@
         <entry il="0x0" row="23" col="2" file_ref="1" hidden="false" />
         <entry il="0x1" row="24" col="3" file_ref="1" hidden="false" />
         <entry il="0x1f" row="25" col="3" file_ref="1" hidden="false" />
+        <entry il="0x20" row="25" col="3" file_ref="1" hidden="false" />
         <entry il="0x25" row="25" col="8" file_ref="1" hidden="false" />
         <entry il="0x2b" row="26" col="2" file_ref="1" hidden="false" />
       </sequencepoints>
index 6a0622205d9f95b36a5e8672784ad22c9264032e..11ff400fed595a2f322d60fd1c11bdc61d13087d 100644 (file)
@@ -12,8 +12,8 @@
     <method token="0x6000002">
       <sequencepoints>
         <entry il="0x0" row="6" col="2" file_ref="1" hidden="false" />
-        <entry il="0x1" row="7" col="3" file_ref="1" hidden="false" />
-        <entry il="0x7" row="7" col="30" file_ref="1" hidden="false" />
+        <entry il="0x1" row="7" col="14" file_ref="1" hidden="false" />
+        <entry il="0x7" row="7" col="34" file_ref="1" hidden="false" />
         <entry il="0xd" row="8" col="2" file_ref="1" hidden="false" />
       </sequencepoints>
       <locals>
diff --git a/mcs/tests/test-debug-27-ref.xml b/mcs/tests/test-debug-27-ref.xml
new file mode 100644 (file)
index 0000000..5509d00
--- /dev/null
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="utf-8"?>
+<symbols>
+  <files>
+    <file id="1" name="test-debug-27.cs" checksum="4a2fa40aa27e1d498f61d664c985ddf2" />
+  </files>
+  <methods>
+    <method token="0x6000001">
+      <sequencepoints>
+        <entry il="0x0" row="8" col="2" file_ref="1" hidden="false" />
+        <entry il="0x1" row="10" col="2" file_ref="1" hidden="false" />
+      </sequencepoints>
+      <locals />
+      <scopes />
+    </method>
+    <method token="0x6000002">
+      <sequencepoints>
+        <entry il="0x0" row="13" col="2" file_ref="1" hidden="false" />
+        <entry il="0x1" row="14" col="3" file_ref="1" hidden="false" />
+        <entry il="0x8" row="15" col="2" file_ref="1" hidden="false" />
+      </sequencepoints>
+      <locals />
+      <scopes />
+    </method>
+    <method token="0x6000003">
+      <sequencepoints />
+      <locals />
+      <scopes />
+    </method>
+    <method token="0x6000004">
+      <sequencepoints>
+        <entry il="0x0" row="21" col="2" file_ref="1" hidden="false" />
+        <entry il="0x1" row="22" col="3" file_ref="1" hidden="false" />
+        <entry il="0x8" row="23" col="2" file_ref="1" hidden="false" />
+      </sequencepoints>
+      <locals />
+      <scopes />
+    </method>
+    <method token="0x6000005">
+      <sequencepoints>
+        <entry il="0x0" row="26" col="2" file_ref="1" hidden="false" />
+        <entry il="0x1" row="27" col="3" file_ref="1" hidden="false" />
+        <entry il="0x8" row="28" col="2" file_ref="1" hidden="false" />
+      </sequencepoints>
+      <locals />
+      <scopes />
+    </method>
+    <method token="0x6000006">
+      <sequencepoints>
+        <entry il="0x0" row="31" col="2" file_ref="1" hidden="false" />
+        <entry il="0x1" row="32" col="10" file_ref="1" hidden="false" />
+        <entry il="0xc" row="33" col="2" file_ref="1" hidden="false" />
+      </sequencepoints>
+      <locals />
+      <scopes />
+    </method>
+    <method token="0x6000007">
+      <sequencepoints>
+        <entry il="0x0" row="36" col="2" file_ref="1" hidden="false" />
+        <entry il="0x1" row="37" col="3" file_ref="1" hidden="false" />
+        <entry il="0x8" row="38" col="2" file_ref="1" hidden="false" />
+      </sequencepoints>
+      <locals />
+      <scopes />
+    </method>
+    <method token="0x6000008">
+      <sequencepoints>
+        <entry il="0x0" row="41" col="2" file_ref="1" hidden="false" />
+        <entry il="0x1" row="42" col="3" file_ref="1" hidden="false" />
+        <entry il="0x1f" row="44" col="3" file_ref="1" hidden="false" />
+        <entry il="0x20" row="44" col="13" file_ref="1" hidden="false" />
+        <entry il="0x26" row="44" col="20" file_ref="1" hidden="false" />
+        <entry il="0x2d" row="45" col="2" file_ref="1" hidden="false" />
+      </sequencepoints>
+      <locals>
+        <entry name="f" il_index="0" scope_ref="0" />
+        <entry name="res" il_index="1" scope_ref="0" />
+      </locals>
+      <scopes />
+    </method>
+    <method token="0x6000009">
+      <sequencepoints>
+        <entry il="0x0" row="48" col="2" file_ref="1" hidden="false" />
+        <entry il="0x1" row="49" col="3" file_ref="1" hidden="false" />
+        <entry il="0x4" row="49" col="11" file_ref="1" hidden="false" />
+        <entry il="0x9" row="50" col="2" file_ref="1" hidden="false" />
+      </sequencepoints>
+      <locals>
+        <entry name="s" il_index="0" scope_ref="0" />
+      </locals>
+      <scopes />
+    </method>
+    <method token="0x600000a">
+      <sequencepoints>
+        <entry il="0x0" row="53" col="2" file_ref="1" hidden="false" />
+        <entry il="0x1" row="54" col="3" file_ref="1" hidden="false" />
+        <entry il="0xa" row="54" col="11" file_ref="1" hidden="false" />
+        <entry il="0x18" row="54" col="22" file_ref="1" hidden="false" />
+        <entry il="0x1f" row="55" col="2" file_ref="1" hidden="false" />
+      </sequencepoints>
+      <locals>
+        <entry name="i" il_index="0" scope_ref="0" />
+      </locals>
+      <scopes />
+    </method>
+    <method token="0x600000b">
+      <sequencepoints>
+        <entry il="0x0" row="58" col="2" file_ref="1" hidden="false" />
+        <entry il="0x1" row="59" col="3" file_ref="1" hidden="false" />
+        <entry il="0x6" row="59" col="11" file_ref="1" hidden="false" />
+        <entry il="0xc" row="60" col="2" file_ref="1" hidden="false" />
+      </sequencepoints>
+      <locals />
+      <scopes />
+    </method>
+    <method token="0x600000c">
+      <sequencepoints>
+        <entry il="0x0" row="63" col="2" file_ref="1" hidden="false" />
+        <entry il="0x1" row="64" col="3" file_ref="1" hidden="false" />
+        <entry il="0x8" row="65" col="2" file_ref="1" hidden="false" />
+      </sequencepoints>
+      <locals />
+      <scopes />
+    </method>
+  </methods>
+</symbols>
\ No newline at end of file
diff --git a/mcs/tests/test-debug-27.cs b/mcs/tests/test-debug-27.cs
new file mode 100644 (file)
index 0000000..982b42c
--- /dev/null
@@ -0,0 +1,68 @@
+using System;
+
+// Tests for explicit call sequence point
+
+struct S
+{
+       public S (int i)
+       {
+
+       }
+
+       public static implicit operator int (S s)
+       {
+               return 1;
+       }
+}
+
+class C
+{
+       public static int A ()
+       {
+               return 1;
+       }
+
+       public static int B (C c)
+       {
+               return 2;
+       }
+
+       public static C Test ()
+       {
+               return new C ();
+       }
+
+       public string Foo ()
+       {
+               return null;
+       }
+
+       void Test_1 ()
+       {
+               Func<int> f = A;
+
+               var res = f () + f ();
+       }
+
+       void Test_2 ()
+       {
+               var s = new S (0);
+       }
+
+       void Test_3 ()
+       {
+               int i = new S () + new S ();
+       }
+
+       void Test_4 ()
+       {
+               Test ().Foo ();
+       }
+
+       static int Main ()
+       {
+               return 0;
+       }
+}
+
+
diff --git a/mcs/tests/test-named-08.cs b/mcs/tests/test-named-08.cs
new file mode 100644 (file)
index 0000000..6d25be4
--- /dev/null
@@ -0,0 +1,28 @@
+using System;
+
+
+class C
+{
+       static int Foo (string packageId, int version)
+       {
+               return Foo (packageId, version, ignoreDependencies: false, allowPrereleaseVersions: false);
+       }
+
+       static int Foo (string packageId, int version, bool ignoreDependencies, bool allowPrereleaseVersions)
+       {
+               return 1;
+       }
+
+       static int Foo (double package, bool ignoreDependencies, bool allowPrereleaseVersions, bool ignoreWalkInfo)
+       {
+               return 2;
+       }
+
+       public static int Main ()
+       {
+               if (Foo ("", 1) != 1)
+                       return 1;
+
+               return 0;
+       }
+}
\ No newline at end of file
index 7ed9370e03d42cf8096ee9e63f7cf0e87e99cdff..51201065dbcbfe7363db906cef98fd6dd2842997 100644 (file)
       </method>\r
     </type>\r
   </test>\r
+  <test name="gtest-589.cs">\r
+    <type name="Z">\r
+      <method name="Z Start()" attrs="134">\r
+        <size>10</size>\r
+      </method>\r
+      <method name="Z IGenericInterface&lt;Z&gt;.Start()" attrs="481">\r
+        <size>7</size>\r
+      </method>\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+    <type name="A`1[T]">\r
+      <method name="Void SomeOperation(T)" attrs="134">\r
+        <size>16</size>\r
+      </method>\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+    <type name="C">\r
+      <method name="Int32 IGenericInterface&lt;int&gt;.Start()" attrs="481">\r
+        <size>7</size>\r
+      </method>\r
+      <method name="Void Main()" attrs="150">\r
+        <size>17</size>\r
+      </method>\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+  </test>\r
+  <test name="gtest-590.cs">\r
+    <type name="C">\r
+      <method name="Void Main()" attrs="150">\r
+        <size>132</size>\r
+      </method>\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+  </test>\r
+  <test name="gtest-591.cs">\r
+    <type name="E">\r
+      <method name="Void Main()" attrs="150">\r
+        <size>19</size>\r
+      </method>\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+  </test>\r
   <test name="gtest-anontype-01.cs">\r
     <type name="Test">\r
       <method name="Int32 Main()" attrs="150">\r
       </method>\r
     </type>\r
   </test>\r
+  <test name="gtest-autoproperty-08.cs">\r
+    <type name="AAttribute">\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+    <type name="Program">\r
+      <method name="Int32 get_Prop()" attrs="2182">\r
+        <size>14</size>\r
+      </method>\r
+      <method name="Void set_Prop(Int32)" attrs="2182">\r
+        <size>8</size>\r
+      </method>\r
+      <method name="Int32 Main()" attrs="150">\r
+        <size>48</size>\r
+      </method>\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+  </test>\r
   <test name="gtest-collectioninit-01.cs">\r
     <type name="Test">\r
       <method name="Void TestList(System.Collections.Generic.List`1[System.Int32], Int32)" attrs="145">\r
       </method>\r
     </type>\r
   </test>\r
+  <test name="gtest-partial-07.cs">\r
+    <type name="A`1[T]">\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+    <type name="A`1+B[T]">\r
+      <method name="Void Test()" attrs="134">\r
+        <size>9</size>\r
+      </method>\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+    <type name="X`1[U]">\r
+      <method name="Void Foo(U)" attrs="134">\r
+        <size>2</size>\r
+      </method>\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+    <type name="M">\r
+      <method name="Void Main()" attrs="150">\r
+        <size>12</size>\r
+      </method>\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+  </test>\r
+  <test name="gtest-partial-08.cs">\r
+    <type name="N.A`2[T1,T2]">\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+    <type name="N.A`2+D[T1,T2]">\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+    <type name="N.A`2+D+C[T1,T2]">\r
+      <method name="Void Test()" attrs="134">\r
+        <size>8</size>\r
+      </method>\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+    <type name="N.A`2+D2`1[T1,T2,U]">\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+    <type name="N.A`2+D2`1+C2[T1,T2,U]">\r
+      <method name="Void Test()" attrs="134">\r
+        <size>9</size>\r
+      </method>\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+    <type name="N.X2`1[W]">\r
+      <method name="Void Foo(W)" attrs="134">\r
+        <size>2</size>\r
+      </method>\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+    <type name="N.X">\r
+      <method name="Void Foo()" attrs="134">\r
+        <size>2</size>\r
+      </method>\r
+      <method name="Void Main()" attrs="150">\r
+        <size>22</size>\r
+      </method>\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+  </test>\r
+  <test name="gtest-partial-09.cs">\r
+    <type name="A.B`1[T]">\r
+      <method name="Void .ctor()" attrs="6276">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+    <type name="A.B`1+C[T]">\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+    <type name="A.B`1+C+A[T]">\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+    <type name="A.Bar">\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+    <type name="A.Test">\r
+      <method name="Void Main()" attrs="150">\r
+        <size>20</size>\r
+      </method>\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+  </test>\r
   <test name="gtest-var-04.cs">\r
     <type name="Test">\r
       <method name="Int32 Main()" attrs="150">\r
       </method>\r
     </type>\r
   </test>\r
+  <test name="test-869.cs">\r
+    <type name="C">\r
+      <method name="C op_BitwiseAnd(C, E)" attrs="2198">\r
+        <size>14</size>\r
+      </method>\r
+      <method name="E op_Implicit(C)" attrs="2198">\r
+        <size>7</size>\r
+      </method>\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
+      <method name="Void .cctor()" attrs="6289">\r
+        <size>11</size>\r
+      </method>\r
+    </type>\r
+    <type name="FooClass">\r
+      <method name="Int32 Main()" attrs="150">\r
+        <size>70</size>\r
+      </method>\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+  </test>\r
   <test name="test-87.cs">\r
     <type name="Top">\r
       <method name="Int32 Main()" attrs="150">\r
         <size>13</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;CallTest_1&gt;c__async11">\r
+    <type name="Tester">\r
+      <method name="Tester &lt;CastTest_2&gt;m__3A()" attrs="129">\r
+        <size>9</size>\r
+      </method>\r
+    </type>\r
+    <type name="Tester+&lt;AssignTest_2&gt;c__asyncA">\r
+      <method name="System.Nullable`1[System.SByte] &lt;&gt;m__1F()" attrs="145">\r
+        <size>17</size>\r
+      </method>\r
+    </type>\r
+    <type name="Tester+&lt;BinaryTest_3&gt;c__asyncE">\r
+      <method name="System.Nullable`1[System.Boolean] &lt;&gt;m__28()" attrs="145">\r
+        <size>14</size>\r
+      </method>\r
+      <method name="System.Nullable`1[System.Boolean] &lt;&gt;m__29()" attrs="145">\r
+        <size>17</size>\r
+      </method>\r
+      <method name="System.Nullable`1[System.Boolean] &lt;&gt;m__2A()" attrs="145">\r
+        <size>17</size>\r
+      </method>\r
+      <method name="System.Nullable`1[System.Boolean] &lt;&gt;m__2B()" attrs="145">\r
+        <size>14</size>\r
+      </method>\r
+      <method name="System.Nullable`1[System.Boolean] &lt;&gt;m__2C()" attrs="145">\r
+        <size>17</size>\r
+      </method>\r
+      <method name="System.Nullable`1[System.Boolean] &lt;&gt;m__2D()" attrs="145">\r
+        <size>14</size>\r
+      </method>\r
+    </type>\r
+    <type name="Tester+&lt;BinaryTest_4&gt;c__asyncF">\r
+      <method name="System.Nullable`1[System.Int16] &lt;&gt;m__2E()" attrs="145">\r
+        <size>14</size>\r
+      </method>\r
+      <method name="System.Nullable`1[System.Byte] &lt;&gt;m__2F()" attrs="145">\r
+        <size>17</size>\r
+      </method>\r
+      <method name="System.Nullable`1[System.Decimal] &lt;&gt;m__30()" attrs="145">\r
+        <size>20</size>\r
+      </method>\r
+      <method name="System.Nullable`1[System.Decimal] &lt;&gt;m__31()" attrs="145">\r
+        <size>17</size>\r
+      </method>\r
+    </type>\r
+    <type name="Tester">\r
+      <method name="System.Threading.Tasks.Task`1[System.Boolean] BinaryTest_6()" attrs="129">\r
+        <size>33</size>\r
+      </method>\r
+    </type>\r
+    <type name="Tester+&lt;BinaryTest_6&gt;c__async11">\r
+      <method name="Void MoveNext()" attrs="486">\r
+        <size>209</size>\r
+      </method>\r
+      <method name="Void SetStateMachine(IAsyncStateMachine)" attrs="486">\r
+        <size>13</size>\r
+      </method>\r
+    </type>\r
+    <type name="Tester+&lt;CallTest_1&gt;c__async12">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>430</size>\r
       </method>\r
         <size>9</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;CallTest_2&gt;c__async12">\r
+    <type name="Tester+&lt;CallTest_2&gt;c__async13">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>267</size>\r
       </method>\r
         <size>17</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;CallTest_3&gt;c__async13">\r
+    <type name="Tester+&lt;CallTest_3&gt;c__async14">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>237</size>\r
       </method>\r
         <size>10</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;CallTest_4&gt;c__async14">\r
+    <type name="Tester+&lt;CallTest_4&gt;c__async15">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>234</size>\r
       </method>\r
         <size>9</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;CallTest_5&gt;c__async15">\r
+    <type name="Tester+&lt;CallTest_5&gt;c__async16">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>250</size>\r
       </method>\r
         <size>13</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;CastTest_1&gt;c__async16">\r
+    <type name="Tester+&lt;CastTest_1&gt;c__async17">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>246</size>\r
       </method>\r
         <size>15</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;CastTest_2&gt;c__async17">\r
+    <type name="Tester+&lt;CastTest_2&gt;c__async18">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>233</size>\r
       </method>\r
         <size>13</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;CoalescingTest_1&gt;c__async18">\r
+    <type name="Tester+&lt;CoalescingTest_1&gt;c__async19">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>358</size>\r
       </method>\r
         <size>13</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;CoalescingTest_2&gt;c__async19">\r
+    <type name="Tester+&lt;CoalescingTest_2&gt;c__async1A">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>364</size>\r
       </method>\r
       <method name="Void SetStateMachine(IAsyncStateMachine)" attrs="486">\r
         <size>13</size>\r
       </method>\r
+      <method name="System.Nullable`1[System.Int16] &lt;&gt;m__3D()" attrs="145">\r
+        <size>17</size>\r
+      </method>\r
       <method name="Byte &lt;&gt;m__3E()" attrs="145">\r
         <size>9</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;ConditionalTest_1&gt;c__async1A">\r
+    <type name="Tester+&lt;ConditionalTest_1&gt;c__async1B">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>197</size>\r
       </method>\r
         <size>9</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;ConditionalTest_2&gt;c__async1B">\r
+    <type name="Tester+&lt;ConditionalTest_2&gt;c__async1C">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>329</size>\r
       </method>\r
         <size>9</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;ConditionalTest_3&gt;c__async1C">\r
+    <type name="Tester+&lt;ConditionalTest_3&gt;c__async1D">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>347</size>\r
       </method>\r
         <size>9</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;ConditionalTest_4&gt;c__async1D">\r
+    <type name="Tester+&lt;ConditionalTest_4&gt;c__async1E">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>243</size>\r
       </method>\r
         <size>9</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;DelegateInvoke_4&gt;c__async1E">\r
+    <type name="Tester+&lt;DelegateInvoke_4&gt;c__async1F">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>271</size>\r
       </method>\r
         <size>9</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;EventInvoke_1&gt;c__async1F">\r
+    <type name="Tester+&lt;EventInvoke_1&gt;c__async20">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>260</size>\r
       </method>\r
         <size>13</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;FieldTest_1&gt;c__async20">\r
+    <type name="Tester+&lt;FieldTest_1&gt;c__async21">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>535</size>\r
       </method>\r
         <size>9</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;IndexerTest_1&gt;c__async21">\r
+    <type name="Tester+&lt;IndexerTest_1&gt;c__async22">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>225</size>\r
       </method>\r
         <size>9</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;IndexerTest_2&gt;c__async22">\r
+    <type name="Tester+&lt;IndexerTest_2&gt;c__async23">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>335</size>\r
       </method>\r
         <size>9</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;IndexerTest_3&gt;c__async23">\r
+    <type name="Tester+&lt;IndexerTest_3&gt;c__async24">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>402</size>\r
       </method>\r
         <size>9</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;IndexerTest_4&gt;c__async24">\r
+    <type name="Tester+&lt;IndexerTest_4&gt;c__async25">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>442</size>\r
       </method>\r
         <size>10</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;IndexerTest_5&gt;c__async25">\r
+    <type name="Tester+&lt;IndexerTest_5&gt;c__async26">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>548</size>\r
       </method>\r
         <size>10</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;IndexerTest_6&gt;c__async26">\r
+    <type name="Tester+&lt;IndexerTest_6&gt;c__async27">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>544</size>\r
       </method>\r
         <size>10</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;IndexerTest_7&gt;c__async27">\r
+    <type name="Tester+&lt;IndexerTest_7&gt;c__async28">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>295</size>\r
       </method>\r
         <size>13</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;IsTest_1&gt;c__async28">\r
+    <type name="Tester+&lt;IsTest_1&gt;c__async29">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>233</size>\r
       </method>\r
         <size>13</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;IsTest_2&gt;c__async29">\r
+    <type name="Tester+&lt;IsTest_2&gt;c__async2A">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>233</size>\r
       </method>\r
       <method name="Void SetStateMachine(IAsyncStateMachine)" attrs="486">\r
         <size>13</size>\r
       </method>\r
+      <method name="System.Nullable`1[System.UInt32] &lt;&gt;m__59()" attrs="145">\r
+        <size>14</size>\r
+      </method>\r
     </type>\r
-    <type name="Tester+&lt;LogicalUserOperator_1&gt;c__async2A">\r
+    <type name="Tester+&lt;LogicalUserOperator_1&gt;c__async2B">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>391</size>\r
       </method>\r
         <size>13</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;LogicalUserOperator_2&gt;c__async2B">\r
+    <type name="Tester+&lt;LogicalUserOperator_2&gt;c__async2C">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>299</size>\r
       </method>\r
         <size>13</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;LogicalUserOperator_3&gt;c__async2C">\r
+    <type name="Tester+&lt;LogicalUserOperator_3&gt;c__async2D">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>390</size>\r
       </method>\r
         <size>13</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;NewTest_1&gt;c__async2D">\r
+    <type name="Tester+&lt;NewTest_1&gt;c__async2E">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>260</size>\r
       </method>\r
         <size>10</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;NewTest_2&gt;c__async2E">\r
+    <type name="Tester+&lt;NewTest_2&gt;c__async2F">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>348</size>\r
       </method>\r
         <size>13</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;NewInitTest_1&gt;c__async2F">\r
+    <type name="Tester+&lt;NewInitTest_1&gt;c__async30">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>1026</size>\r
       </method>\r
         <size>10</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;NewInitTest_2&gt;c__async30">\r
+    <type name="Tester+&lt;NewInitTest_2&gt;c__async31">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>739</size>\r
       </method>\r
         <size>10</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;NewArrayInitTest_1&gt;c__async31">\r
+    <type name="Tester+&lt;NewArrayInitTest_1&gt;c__async32">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>240</size>\r
       </method>\r
         <size>9</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;NewArrayInitTest_2&gt;c__async32">\r
+    <type name="Tester+&lt;NewArrayInitTest_2&gt;c__async33">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>355</size>\r
       </method>\r
         <size>9</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;NewArrayInitTest_3&gt;c__async33">\r
+    <type name="Tester+&lt;NewArrayInitTest_3&gt;c__async34">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>246</size>\r
       </method>\r
         <size>9</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;NewArrayInitTest_4&gt;c__async34">\r
+    <type name="Tester+&lt;NewArrayInitTest_4&gt;c__async35">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>427</size>\r
       </method>\r
         <size>9</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;NewArrayInitTest_5&gt;c__async35">\r
+    <type name="Tester+&lt;NewArrayInitTest_5&gt;c__async36">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>264</size>\r
       </method>\r
         <size>25</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;NewArrayInitTest_6&gt;c__async36">\r
+    <type name="Tester+&lt;NewArrayInitTest_6&gt;c__async37">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>266</size>\r
       </method>\r
         <size>9</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;PropertyTest_1&gt;c__async37">\r
+    <type name="Tester+&lt;PropertyTest_1&gt;c__async38">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>222</size>\r
       </method>\r
         <size>9</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;PropertyTest_2&gt;c__async38">\r
+    <type name="Tester+&lt;PropertyTest_2&gt;c__async39">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>295</size>\r
       </method>\r
         <size>9</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;PropertyTest_3&gt;c__async39">\r
+    <type name="Tester+&lt;PropertyTest_3&gt;c__async3A">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>645</size>\r
       </method>\r
         <size>9</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;StringConcatTest_1&gt;c__async3A">\r
+    <type name="Tester+&lt;StringConcatTest_1&gt;c__async3B">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>455</size>\r
       </method>\r
         <size>9</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;UnaryTest_1&gt;c__async3B">\r
+    <type name="Tester+&lt;UnaryTest_1&gt;c__async3C">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>233</size>\r
       </method>\r
         <size>9</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;UnaryTest_2&gt;c__async3C">\r
+    <type name="Tester+&lt;UnaryTest_2&gt;c__async3D">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>339</size>\r
       </method>\r
         <size>13</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;UnaryTest_3&gt;c__async3D">\r
+    <type name="Tester+&lt;UnaryTest_3&gt;c__async3E">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>372</size>\r
       </method>\r
         <size>9</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;VariableInitializer_1&gt;c__async3E">\r
+    <type name="Tester+&lt;VariableInitializer_1&gt;c__async3F">\r
       <method name="Void MoveNext()" attrs="486">\r
         <size>348</size>\r
       </method>\r
         <size>9</size>\r
       </method>\r
     </type>\r
-    <type name="Tester">\r
-      <method name="Tester &lt;CastTest_2&gt;m__3A()" attrs="129">\r
-        <size>9</size>\r
-      </method>\r
-    </type>\r
-    <type name="Tester+&lt;ArrayAccessTest_5&gt;c__async4+&lt;ArrayAccessTest_5&gt;c__AnonStorey3F">\r
+    <type name="Tester+&lt;ArrayAccessTest_5&gt;c__async4+&lt;ArrayAccessTest_5&gt;c__AnonStorey40">\r
       <method name="Int32 &lt;&gt;m__12()" attrs="131">\r
         <size>25</size>\r
       </method>\r
         <size>7</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;BinaryTest_2&gt;c__asyncD+&lt;BinaryTest_2&gt;c__AnonStorey40">\r
+    <type name="Tester+&lt;BinaryTest_2&gt;c__asyncD+&lt;BinaryTest_2&gt;c__AnonStorey41">\r
       <method name="Boolean &lt;&gt;m__25()" attrs="131">\r
         <size>24</size>\r
       </method>\r
         <size>7</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;CallTest_5&gt;c__async15+&lt;CallTest_5&gt;c__AnonStorey41">\r
+    <type name="Tester+&lt;CallTest_5&gt;c__async16+&lt;CallTest_5&gt;c__AnonStorey42">\r
       <method name="Int32 &lt;&gt;m__38()" attrs="131">\r
         <size>25</size>\r
       </method>\r
         <size>7</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;EventInvoke_1&gt;c__async1F+&lt;EventInvoke_1&gt;c__AnonStorey42">\r
+    <type name="Tester+&lt;EventInvoke_1&gt;c__async20+&lt;EventInvoke_1&gt;c__AnonStorey43">\r
       <method name="System.Action &lt;&gt;m__47()" attrs="131">\r
         <size>23</size>\r
       </method>\r
         <size>7</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;IndexerTest_3&gt;c__async23+&lt;IndexerTest_3&gt;c__AnonStorey43">\r
+    <type name="Tester+&lt;IndexerTest_3&gt;c__async24+&lt;IndexerTest_3&gt;c__AnonStorey44">\r
       <method name="Int32 &lt;&gt;m__4E()" attrs="131">\r
         <size>25</size>\r
       </method>\r
         <size>7</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;IndexerTest_4&gt;c__async24+&lt;IndexerTest_4&gt;c__AnonStorey44">\r
+    <type name="Tester+&lt;IndexerTest_4&gt;c__async25+&lt;IndexerTest_4&gt;c__AnonStorey45">\r
       <method name="Int32 &lt;&gt;m__50()" attrs="131">\r
         <size>25</size>\r
       </method>\r
         <size>7</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;IndexerTest_5&gt;c__async25+&lt;IndexerTest_5&gt;c__AnonStorey45">\r
+    <type name="Tester+&lt;IndexerTest_5&gt;c__async26+&lt;IndexerTest_5&gt;c__AnonStorey46">\r
       <method name="Int32 &lt;&gt;m__52()" attrs="131">\r
         <size>25</size>\r
       </method>\r
         <size>7</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;IndexerTest_7&gt;c__async27+&lt;IndexerTest_7&gt;c__AnonStorey46">\r
+    <type name="Tester+&lt;IndexerTest_7&gt;c__async28+&lt;IndexerTest_7&gt;c__AnonStorey47">\r
       <method name="Int32 &lt;&gt;m__57()" attrs="131">\r
         <size>25</size>\r
       </method>\r
         <size>7</size>\r
       </method>\r
     </type>\r
-    <type name="Tester+&lt;UnaryTest_2&gt;c__async3C+&lt;UnaryTest_2&gt;c__AnonStorey47">\r
-      <method name="Void .ctor()" attrs="6278">\r
-        <size>7</size>\r
-      </method>\r
-    </type>\r
-    <type name="Tester+&lt;AssignTest_2&gt;c__asyncA">\r
-      <method name="System.Nullable`1[System.SByte] &lt;&gt;m__1F()" attrs="145">\r
-        <size>17</size>\r
-      </method>\r
-    </type>\r
-    <type name="Tester+&lt;BinaryTest_3&gt;c__asyncE">\r
-      <method name="System.Nullable`1[System.Boolean] &lt;&gt;m__28()" attrs="145">\r
-        <size>14</size>\r
-      </method>\r
-      <method name="System.Nullable`1[System.Boolean] &lt;&gt;m__29()" attrs="145">\r
-        <size>17</size>\r
-      </method>\r
-      <method name="System.Nullable`1[System.Boolean] &lt;&gt;m__2A()" attrs="145">\r
-        <size>17</size>\r
-      </method>\r
-      <method name="System.Nullable`1[System.Boolean] &lt;&gt;m__2B()" attrs="145">\r
-        <size>14</size>\r
-      </method>\r
-      <method name="System.Nullable`1[System.Boolean] &lt;&gt;m__2C()" attrs="145">\r
-        <size>17</size>\r
-      </method>\r
-      <method name="System.Nullable`1[System.Boolean] &lt;&gt;m__2D()" attrs="145">\r
-        <size>14</size>\r
-      </method>\r
-    </type>\r
-    <type name="Tester+&lt;BinaryTest_4&gt;c__asyncF">\r
-      <method name="System.Nullable`1[System.Int16] &lt;&gt;m__2E()" attrs="145">\r
-        <size>14</size>\r
-      </method>\r
-      <method name="System.Nullable`1[System.Byte] &lt;&gt;m__2F()" attrs="145">\r
-        <size>17</size>\r
-      </method>\r
-      <method name="System.Nullable`1[System.Decimal] &lt;&gt;m__30()" attrs="145">\r
-        <size>20</size>\r
-      </method>\r
-      <method name="System.Nullable`1[System.Decimal] &lt;&gt;m__31()" attrs="145">\r
-        <size>17</size>\r
-      </method>\r
-    </type>\r
-    <type name="Tester+&lt;CoalescingTest_2&gt;c__async19">\r
-      <method name="System.Nullable`1[System.Int16] &lt;&gt;m__3D()" attrs="145">\r
-        <size>17</size>\r
-      </method>\r
-    </type>\r
-    <type name="Tester+&lt;IsTest_2&gt;c__async29">\r
-      <method name="System.Nullable`1[System.UInt32] &lt;&gt;m__59()" attrs="145">\r
-        <size>14</size>\r
-      </method>\r
-    </type>\r
-    <type name="Tester+&lt;UnaryTest_2&gt;c__async3C+&lt;UnaryTest_2&gt;c__AnonStorey47">\r
+    <type name="Tester+&lt;UnaryTest_2&gt;c__async3D+&lt;UnaryTest_2&gt;c__AnonStorey48">\r
       <method name="System.Nullable`1[System.Int16] &lt;&gt;m__7D()" attrs="131">\r
         <size>14</size>\r
       </method>\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
     </type>\r
   </test>\r
   <test name="test-async-14.cs">\r
         <size>0</size>\r
       </method>\r
     </type>\r
-    <type name="A+&lt;async&gt;c__async0">\r
-      <method name="Void MoveNext()" attrs="486">\r
-        <size>38</size>\r
-      </method>\r
-    </type>\r
     <type name="A+&lt;async&gt;c__async1">\r
       <method name="Void MoveNext()" attrs="486">\r
-        <size>37</size>\r
+        <size>38</size>\r
       </method>\r
     </type>\r
     <type name="A">\r
         <size>35</size>\r
       </method>\r
     </type>\r
-    <type name="A+&lt;CastTest&gt;c__async2">\r
-      <method name="Void MoveNext()" attrs="486">\r
-        <size>285</size>\r
-      </method>\r
-    </type>\r
-    <type name="A+&lt;async&gt;c__async0">\r
-      <method name="Void SetStateMachine(IAsyncStateMachine)" attrs="486">\r
-        <size>13</size>\r
-      </method>\r
-    </type>\r
     <type name="A+&lt;async&gt;c__async1">\r
       <method name="Void SetStateMachine(IAsyncStateMachine)" attrs="486">\r
         <size>13</size>\r
       </method>\r
     </type>\r
-    <type name="A+&lt;CastTest&gt;c__async2">\r
-      <method name="Void SetStateMachine(IAsyncStateMachine)" attrs="486">\r
-        <size>13</size>\r
-      </method>\r
-    </type>\r
     <type name="C">\r
       <method name="Void Test(Boolean)" attrs="145">\r
         <size>20</size>\r
         <size>14</size>\r
       </method>\r
     </type>\r
+    <type name="A">\r
+      <method name="Void Iasync.async()" attrs="481">\r
+        <size>27</size>\r
+      </method>\r
+    </type>\r
+    <type name="A+&lt;async&gt;c__async2">\r
+      <method name="Void MoveNext()" attrs="486">\r
+        <size>37</size>\r
+      </method>\r
+      <method name="Void SetStateMachine(IAsyncStateMachine)" attrs="486">\r
+        <size>13</size>\r
+      </method>\r
+    </type>\r
+    <type name="A+&lt;CastTest&gt;c__async3">\r
+      <method name="Void MoveNext()" attrs="486">\r
+        <size>285</size>\r
+      </method>\r
+      <method name="Void SetStateMachine(IAsyncStateMachine)" attrs="486">\r
+        <size>13</size>\r
+      </method>\r
+    </type>\r
+    <type name="A+async&gt;c__async0">\r
+      <method name="Void MoveNext()" attrs="486">\r
+        <size>31</size>\r
+      </method>\r
+      <method name="Void SetStateMachine(IAsyncStateMachine)" attrs="486">\r
+        <size>13</size>\r
+      </method>\r
+    </type>\r
   </test>\r
   <test name="test-async-23.cs">\r
     <type name="MyContext">\r
       </method>\r
     </type>\r
   </test>\r
+  <test name="test-debug-27.cs">\r
+    <type name="S">\r
+      <method name="Int32 op_Implicit(S)" attrs="2198">\r
+        <size>10</size>\r
+      </method>\r
+      <method name="Void .ctor(Int32)" attrs="6278">\r
+        <size>2</size>\r
+      </method>\r
+    </type>\r
+    <type name="C">\r
+      <method name="Int32 A()" attrs="150">\r
+        <size>10</size>\r
+      </method>\r
+      <method name="Int32 B(C)" attrs="150">\r
+        <size>10</size>\r
+      </method>\r
+      <method name="C Test()" attrs="150">\r
+        <size>14</size>\r
+      </method>\r
+      <method name="System.String Foo()" attrs="134">\r
+        <size>10</size>\r
+      </method>\r
+      <method name="Void Test_1()" attrs="129">\r
+        <size>46</size>\r
+      </method>\r
+      <method name="Void Test_2()" attrs="129">\r
+        <size>10</size>\r
+      </method>\r
+      <method name="Void Test_3()" attrs="129">\r
+        <size>32</size>\r
+      </method>\r
+      <method name="Void Test_4()" attrs="129">\r
+        <size>13</size>\r
+      </method>\r
+      <method name="Int32 Main()" attrs="145">\r
+        <size>10</size>\r
+      </method>\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+  </test>\r
   <test name="test-externalias-01.cs">\r
     <type name="Test">\r
       <method name="Int32 Main()" attrs="150">\r
       </method>\r
     </type>\r
   </test>\r
+  <test name="test-named-08.cs">\r
+    <type name="C">\r
+      <method name="Int32 Foo(System.String, Int32)" attrs="145">\r
+        <size>18</size>\r
+      </method>\r
+      <method name="Int32 Foo(System.String, Int32, Boolean, Boolean)" attrs="145">\r
+        <size>10</size>\r
+      </method>\r
+      <method name="Int32 Foo(Double, Boolean, Boolean, Boolean)" attrs="145">\r
+        <size>10</size>\r
+      </method>\r
+      <method name="Int32 Main()" attrs="150">\r
+        <size>34</size>\r
+      </method>\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+  </test>\r
   <test name="test-partial-01.cs">\r
     <type name="Foo.Hello">\r
       <method name="Void .ctor()" attrs="6278">\r
index 2544964d01f38eb6688a2a3e04a85c8bc6e77c27..abdaed2d135dfacb23760b91f23414e075e00228 100644 (file)
@@ -68,6 +68,7 @@ namespace Mono {
 
                        eval.InteractiveBaseClass = typeof (InteractiveBaseShell);
                        eval.DescribeTypeExpressions = true;
+                       eval.WaitOnTask = true;
 
                        CSharpShell shell;
 #if !ON_DOTNET
index d14e2cbbfd9ab5b7b1ed6335543ecf7ee1f0ce6d..1d0c4c235733cdbb5329e14e102a60b6aa1cd847 100644 (file)
@@ -174,6 +174,7 @@ rm -rf %buildroot
 %if %sgen == yes
 %_bindir/mono-sgen
 %endif
+%_bindir/mono-boehm
 %_bindir/mono-test-install
 %_bindir/mozroots
 %_bindir/peverify
@@ -309,7 +310,6 @@ rm -rf %buildroot
 %_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/4.5/Facades/*.dll.mdb
 %_prefix/lib/mono/compat-2.0/ICSharpCode.SharpZipLib.dll
 %_prefix/lib/mono/gac/Commons.Xml.Relaxng
 %_prefix/lib/mono/gac/CustomMarshalers
@@ -399,12 +399,12 @@ Development files for libmono.
 %_libdir/pkgconfig/mono-2.pc
 
 %if %sgen == yes
-%package -n libmonosgen-2_0-0
+%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-0
+%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
@@ -413,13 +413,13 @@ 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-0
+%files -n libmonosgen-2_0-1
 %defattr(-, root, root)
-%_libdir/libmonosgen-2.0.so.0*
+%_libdir/libmonosgen-2.0.so.1*
 
-%post -n libmonosgen-2_0-0 -p /sbin/ldconfig
+%post -n libmonosgen-2_0-1 -p /sbin/ldconfig
 
-%postun -n libmonosgen-2_0-0 -p /sbin/ldconfig
+%postun -n libmonosgen-2_0-1 -p /sbin/ldconfig
 
 %package -n libmonosgen-2_0-devel
 License:        LGPL v2.1 only
@@ -445,6 +445,49 @@ Development files for libmonosgen.
 %_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
@@ -1358,8 +1401,6 @@ Mono development tools.
 %_prefix/lib/mono/gac/Mono.Debugger.Soft
 %_prefix/lib/mono/gac/PEAPI
 %_prefix/lib/mono/xbuild
-%_prefix/lib/mono/xbuild/Microsoft/Portable/v4.0/Microsoft.Portable.CSharp.targets
-%_prefix/lib/mono/xbuild/Microsoft/Portable/v4.5/Microsoft.Portable.CSharp.targets
 %_prefix/lib/mono/xbuild-frameworks
 
 %package -n monodoc-core
@@ -1420,7 +1461,7 @@ Requires:       libmono-2_0-devel = %version-%release
 Requires:       libmono-llvm0 = %version-%release
 %endif
 %if %sgen == yes
-Requires:       libmonosgen-2_0-0 = %version-%release
+Requires:       libmonosgen-2_0-1 = %version-%release
 Requires:       libmonosgen-2_0-devel = %version-%release
 %endif
 Requires:       mono-data = %version-%release
index d4719cac40c0592b98bbef8dcbf4c5dce0af19a1..42d735b0f751ed7780406a0b3448bb0ebac2048d 100644 (file)
@@ -30,6 +30,7 @@
 #include <mono/metadata/loader.h>
 #include <mono/metadata/assembly.h>
 #include <mono/metadata/appdomain.h>
+#include <mono/utils/bsearch.h>
 
 static void     setup_filter          (MonoImage *image);
 static gboolean should_include_type   (int idx);
@@ -1109,7 +1110,7 @@ dis_interfaces (MonoImage *m, guint32 typedef_row, MonoGenericContainer *contain
        loc.col_idx = MONO_INTERFACEIMPL_CLASS;
        loc.idx = typedef_row;
 
-       if (!bsearch (&loc, table->base, table->rows, table->row_size, table_locator))
+       if (!mono_binary_search (&loc, table->base, table->rows, table->row_size, table_locator))
                return;
 
        start = loc.result;
@@ -1680,7 +1681,7 @@ table_includes (TableFilter *tf, int idx)
 {
        if (!tf->count)
                return FALSE;
-       return bsearch (&idx, tf->elems, tf->count, sizeof (int), int_cmp) != NULL;
+       return mono_binary_search (&idx, tf->elems, tf->count, sizeof (int), int_cmp) != NULL;
 }
 
 static gboolean 
index 26a5d4292bddf2fe1dc7e87ba004f3f454cb67e8..a8a7db80ffd6a6b48ce453e11608be748949ee78 100644 (file)
@@ -17,6 +17,7 @@
 #include <mono/io-layer/wapi-private.h>
 #include <mono/io-layer/misc-private.h>
 #include <mono/io-layer/messages.h>
+#include <mono/utils/bsearch.h>
 
 #undef DEBUG
 
@@ -1830,7 +1831,7 @@ find_msg (guint32 id, ErrorDesc *base, int n)
        ErrorDesc d, *result;
        d.id = id;
        
-       result = bsearch (&d, base, n, sizeof (ErrorDesc), msg_compare);
+       result = mono_binary_search (&d, base, n, sizeof (ErrorDesc), msg_compare);
        if (result == NULL)
                return NULL;
        return result->txt;
index fdf0a99143a8cd4191f1b8ccea8b084ae4dc1c2d..0b5cfe5ffe1fdaf3c3bee441d4824af18c0694bd 100644 (file)
@@ -343,3 +343,8 @@ endif
 EXTRA_DIST = make-bundle.pl sample-bundle $(win32_sources) $(unix_sources) $(null_sources) runtime.h \
                tpool-poll.c tpool-epoll.c tpool-kqueue.c Makefile.am.in
 
+if HAS_EXTENSION_MODULE
+else
+Makefile.am: Makefile.am.in
+       cp $< $@
+endif
index 69571dff8b5609e32deab60298efe5b44384d1eb..20ccd0c489885fa478f8f2204b174f68f11e47db 100644 (file)
@@ -1459,19 +1459,29 @@ static gboolean
 private_file_needs_copying (const char *src, struct stat *sbuf_src, char *dest)
 {
        struct stat sbuf_dest;
+       gchar *stat_src;
        gchar *real_src = mono_portability_find_file (src, TRUE);
 
        if (!real_src)
-               real_src = (gchar*)src;
-       
-       if (stat (real_src, sbuf_src) == -1) {
+               stat_src = (gchar*)src;
+       else
+               stat_src = real_src;
+
+       if (stat (stat_src, sbuf_src) == -1) {
                time_t tnow = time (NULL);
+
+               if (real_src)
+                       g_free (real_src);
+
                memset (sbuf_src, 0, sizeof (*sbuf_src));
                sbuf_src->st_mtime = tnow;
                sbuf_src->st_atime = tnow;
                return TRUE;
        }
 
+       if (real_src)
+               g_free (real_src);
+
        if (stat (dest, &sbuf_dest) == -1)
                return TRUE;
        
@@ -2181,7 +2191,7 @@ unload_data_unref (unload_data *data)
 {
        gint32 count;
        do {
-               count = mono_atomic_load_acquire (&data->refcount);
+               mono_atomic_load_acquire (count, gint32, &data->refcount);
                g_assert (count >= 1 && count <= 2);
                if (count == 1) {
                        g_free (data);
index 607dde5037b1c2a01d5007d50316c9cb17759310..c93fc82c1c280c945c0e6b7276fd2710679db5ba 100644 (file)
@@ -107,6 +107,8 @@ static const AssemblyVersionMap framework_assemblies [] = {
        {"System.Data", 0},
        {"System.Data.Linq", 2},
        {"System.Data.OracleClient", 0},
+       {"System.Data.Services", 2},
+       {"System.Data.Services.Client", 2},
        {"System.Data.SqlXml", 0},
        {"System.Design", 0},
        {"System.DirectoryServices", 0},
@@ -115,19 +117,25 @@ static const AssemblyVersionMap framework_assemblies [] = {
        {"System.EnterpriseServices", 0},
        {"System.Management", 0},
        {"System.Messaging", 0},
+       {"System.Net", 2},
        {"System.Runtime.Remoting", 0},
        {"System.Runtime.Serialization", 3},
        {"System.Runtime.Serialization.Formatters.Soap", 0},
        {"System.Security", 0},
+       {"System.ServiceModel.Web", 2},
        {"System.ServiceProcess", 0},
        {"System.Transactions", 0},
        {"System.Web", 0},
        {"System.Web.Abstractions", 2},
+       {"System.Web.DynamicData", 2},
+       {"System.Web.Extensions", 2},
        {"System.Web.Mobile", 0},
        {"System.Web.Routing", 2},
        {"System.Web.Services", 0},
        {"System.Windows.Forms", 0},
        {"System.Xml", 0},
+       {"System.Xml.Linq", 2},
+       {"WindowsBase", 3},
        {"mscorlib", 0}
 };
 #endif
index 514ea77e46640267760f3cb789cde644a5c9bb3d..167e449705a63f596a1819e9f1e535f480354aad 100644 (file)
@@ -42,6 +42,8 @@
 #include <mono/utils/mono-logger-internal.h>
 #include <mono/utils/mono-memory-model.h>
 #include <mono/utils/atomic.h>
+#include <mono/utils/bsearch.h>
+
 MonoStats mono_stats;
 
 gboolean mono_print_vtable = FALSE;
@@ -1426,6 +1428,52 @@ mono_class_setup_fields (MonoClass *class)
        MonoGenericContainer *container = NULL;
        MonoClass *gtd = class->generic_class ? mono_class_get_generic_type_definition (class) : NULL;
 
+       /*
+        * FIXME: We have a race condition here.  It's possible that this function returns
+        * to its caller with `instance_size` set to `0` instead of the actual size.  This
+        * is not a problem when the function is called recursively on the same class,
+        * because the size will be initialized by the outer invocation.  What follows is a
+        * description of how it can occur in other cases, too.  There it is a problem,
+        * because it can lead to the GC being asked to allocate an object of size `0`,
+        * which SGen chokes on.  The race condition is triggered infrequently by
+        * `tests/sgen-suspend.cs`.
+        *
+        * This function is called for a class whenever one of its subclasses is inited.
+        * For example, it's called for every subclass of Object.  What it does is this:
+        *
+        *     if (class->setup_fields_called)
+        *         return;
+        *     ...
+        *     class->instance_size = 0;
+        *     ...
+        *     class->setup_fields_called = 1;
+        *     ... critical point
+        *     class->instance_size = actual_instance_size;
+        *
+        * The last two steps are sometimes reversed, but that only changes the way in which
+        * the race condition works.
+        *
+        * Assume thread A goes through this function and makes it to the critical point.
+        * Now thread B runs the function and, since `setup_fields_called` is set, returns
+        * immediately, but `instance_size` is incorrect.
+        *
+        * The other case looks like this:
+        *
+        *     if (class->setup_fields_called)
+        *         return;
+        *     ... critical point X
+        *     class->instance_size = 0;
+        *     ... critical point Y
+        *     class->instance_size = actual_instance_size;
+        *     ...
+        *     class->setup_fields_called = 1;
+        *
+        * Assume thread A goes through the function and makes it to critical point X.  Now
+        * thread B runs through the whole of the function, returning, assuming
+        * `instance_size` is set.  At that point thread A gets to run and makes it to
+        * critical point Y, at which time `instance_size` is `0` again, invalidating thread
+        * B's assumption.
+        */
        if (class->setup_fields_called)
                return;
 
@@ -1503,6 +1551,7 @@ mono_class_setup_fields (MonoClass *class)
                mono_memory_barrier ();
                class->size_inited = 1;
                class->fields_inited = 1;
+               class->setup_fields_called = 1;
                return;
        }
 
@@ -2645,7 +2694,7 @@ compare_interface_ids (const void *p_key, const void *p_element) {
 /*FIXME verify all callers if they should switch to mono_class_interface_offset_with_variance*/
 int
 mono_class_interface_offset (MonoClass *klass, MonoClass *itf) {
-       MonoClass **result = bsearch (
+       MonoClass **result = mono_binary_search (
                        itf,
                        klass->interfaces_packed,
                        klass->interface_offsets_count,
index 6b940f3edfb4e85920a526d0cc56a6fa868e273f..7e0d598a2820635795a691bd69ca99f0869e5264 100644 (file)
@@ -46,7 +46,8 @@ ves_icall_System_ConsoleDriver_Isatty (HANDLE handle)
 {
        MONO_ARCH_SAVE_REGS;
 
-       return (GetFileType (handle) == FILE_TYPE_CHAR);
+       DWORD mode;
+       return GetConsoleMode (handle, &mode) != 0;
 }
 
 MonoBoolean
index d4c1241478fd78613d559e6ded90896ecd3017e9..9832418bec12990296a243288a4958fdba0f801b 100644 (file)
@@ -30,6 +30,7 @@
 #include <mono/metadata/metadata-internals.h>
 #include <mono/metadata/class-internals.h>
 #include <mono/utils/mono-mmap.h>
+#include <mono/utils/bsearch.h>
 
 #include <fcntl.h>
 #ifdef HAVE_UNISTD_H
@@ -731,7 +732,7 @@ mono_debug_symfile_lookup_method (MonoDebugHandle *handle, MonoMethod *method)
        first_ie = (MonoSymbolFileMethodEntry *)
                (symfile->raw_contents + read32(&(symfile->offset_table->_method_table_offset)));
 
-       ie = bsearch (GUINT_TO_POINTER (mono_method_get_token (method)), first_ie,
+       ie = mono_binary_search (GUINT_TO_POINTER (mono_method_get_token (method)), first_ie,
                                   read32(&(symfile->offset_table->_method_count)),
                                   sizeof (MonoSymbolFileMethodEntry), compare_method);
 
index ac7b0c41cc3f4bac4f2aa4e50c6bf68ef12d9c7b..c0ed5de44936919449bbcde49d1450bf97972e1f 100644 (file)
@@ -824,9 +824,9 @@ ves_icall_System_IO_MonoIO_Read (HANDLE handle, MonoArray *dest,
        *error=ERROR_SUCCESS;
 
        MONO_CHECK_ARG_NULL (dest);
-       
-       if (dest_offset + count > mono_array_length (dest))
-               return 0;
+
+       if (dest_offset > mono_array_length (dest) - count)
+               mono_raise_exception (mono_get_exception_argument ("array", "array too small. numBytes/offset wrong."));
 
        buffer = mono_array_addr (dest, guchar, dest_offset);
        result = ReadFile (handle, buffer, count, &n, NULL);
@@ -854,8 +854,8 @@ ves_icall_System_IO_MonoIO_Write (HANDLE handle, MonoArray *src,
 
        MONO_CHECK_ARG_NULL (src);
        
-       if (src_offset + count > mono_array_length (src))
-               return 0;
+       if (src_offset > mono_array_length (src) - count)
+               mono_raise_exception (mono_get_exception_argument ("array", "array too small. numBytes/offset wrong."));
        
        buffer = mono_array_addr (src, guchar, src_offset);
        result = WriteFile (handle, buffer, count, &n, NULL);
index 317f894fc4392f739403411b3d445e2c88946afd..faf8485c528df7b7f1d97d5eae71c59d3f4bfa81 100644 (file)
@@ -84,6 +84,7 @@
 #include <mono/utils/mono-mmap.h>
 #include <mono/utils/mono-io-portability.h>
 #include <mono/utils/mono-digest.h>
+#include <mono/utils/bsearch.h>
 
 #if defined (HOST_WIN32)
 #include <windows.h>
@@ -7947,7 +7948,7 @@ compare_method_imap (const void *key, const void *elem)
 static gpointer
 find_method_icall (const IcallTypeDesc *imap, const char *name)
 {
-       const guint16 *nameslot = bsearch (name, icall_names_idx + imap->first_icall, icall_desc_num_icalls (imap), sizeof (icall_names_idx [0]), compare_method_imap);
+       const guint16 *nameslot = mono_binary_search (name, icall_names_idx + imap->first_icall, icall_desc_num_icalls (imap), sizeof (icall_names_idx [0]), compare_method_imap);
        if (!nameslot)
                return NULL;
        return (gpointer)icall_functions [(nameslot - &icall_names_idx [0])];
@@ -7963,7 +7964,7 @@ compare_class_imap (const void *key, const void *elem)
 static const IcallTypeDesc*
 find_class_icalls (const char *name)
 {
-       const guint16 *nameslot = bsearch (name, icall_type_names_idx, Icall_type_num, sizeof (icall_type_names_idx [0]), compare_class_imap);
+       const guint16 *nameslot = mono_binary_search (name, icall_type_names_idx, Icall_type_num, sizeof (icall_type_names_idx [0]), compare_class_imap);
        if (!nameslot)
                return NULL;
        return &icall_type_descs [nameslot - &icall_type_names_idx [0]];
@@ -7981,7 +7982,7 @@ compare_method_imap (const void *key, const void *elem)
 static gpointer
 find_method_icall (const IcallTypeDesc *imap, const char *name)
 {
-       const char **nameslot = bsearch (name, icall_names + imap->first_icall, icall_desc_num_icalls (imap), sizeof (icall_names [0]), compare_method_imap);
+       const char **nameslot = mono_binary_search (name, icall_names + imap->first_icall, icall_desc_num_icalls (imap), sizeof (icall_names [0]), compare_method_imap);
        if (!nameslot)
                return NULL;
        return (gpointer)icall_functions [(nameslot - icall_names)];
@@ -7997,7 +7998,7 @@ compare_class_imap (const void *key, const void *elem)
 static const IcallTypeDesc*
 find_class_icalls (const char *name)
 {
-       const char **nameslot = bsearch (name, icall_type_names, Icall_type_num, sizeof (icall_type_names [0]), compare_class_imap);
+       const char **nameslot = mono_binary_search (name, icall_type_names, Icall_type_num, sizeof (icall_type_names [0]), compare_class_imap);
        if (!nameslot)
                return NULL;
        return &icall_type_descs [nameslot - icall_type_names];
@@ -8208,7 +8209,7 @@ mono_lookup_icall_symbol (MonoMethod *m)
        func = mono_lookup_internal_call (m);
        if (!func)
                return NULL;
-       slot = bsearch (func, functions_sorted, G_N_ELEMENTS (icall_functions), sizeof (gpointer), func_cmp);
+       slot = mono_binary_search (func, functions_sorted, G_N_ELEMENTS (icall_functions), sizeof (gpointer), func_cmp);
        if (!slot)
                return NULL;
        g_assert (slot);
index d161ba63a734070eba361a3cdb3e1f826f6b97aa..430af42c0cf90c9147866f834a83fdb8b975a07f 100644 (file)
@@ -1622,6 +1622,7 @@ mono_image_close_except_pools (MonoImage *image)
        free_hash (image->delegate_invoke_generic_cache);
        free_hash (image->delegate_begin_invoke_generic_cache);
        free_hash (image->delegate_end_invoke_generic_cache);
+       free_hash (image->synchronized_generic_cache);
        free_hash (image->remoting_invoke_cache);
        free_hash (image->runtime_invoke_cache);
        free_hash (image->runtime_invoke_direct_cache);
index 23e63c5e733e20ae7d0b240391d7bff9a16b570c..1b8be8ade966d7f3dfd329fc13158f6fd0cac35a 100644 (file)
@@ -24,6 +24,7 @@
 #include <mono/metadata/locales.h>
 #include <mono/metadata/culture-info.h>
 #include <mono/metadata/culture-info-tables.h>
+#include <mono/utils/bsearch.h>
 
 #ifndef DISABLE_NORMALIZATION
 #include <mono/metadata/normalization-tables.h>
@@ -313,7 +314,7 @@ construct_culture_from_specific_name (MonoCultureInfo *ci, gchar *name)
 
        MONO_ARCH_SAVE_REGS;
 
-       ne = bsearch (name, culture_name_entries, NUM_CULTURE_ENTRIES,
+       ne = mono_binary_search (name, culture_name_entries, NUM_CULTURE_ENTRIES,
                        sizeof (CultureInfoNameEntry), culture_name_locator);
 
        if (ne == NULL)
@@ -332,7 +333,7 @@ culture_info_entry_from_lcid (int lcid)
 {
        const CultureInfoEntry *ci;
 
-       ci = bsearch (&lcid, culture_entries, NUM_CULTURE_ENTRIES, sizeof (CultureInfoEntry), culture_lcid_locator);
+       ci = mono_binary_search (&lcid, culture_entries, NUM_CULTURE_ENTRIES, sizeof (CultureInfoEntry), culture_lcid_locator);
 
        return ci;
 }
@@ -345,7 +346,7 @@ region_info_entry_from_lcid (int lcid)
 
        MONO_ARCH_SAVE_REGS;
 
-       ne = bsearch (&lcid, culture_entries, NUM_CULTURE_ENTRIES, sizeof (CultureInfoEntry), culture_lcid_locator);
+       ne = mono_binary_search (&lcid, culture_entries, NUM_CULTURE_ENTRIES, sizeof (CultureInfoEntry), culture_lcid_locator);
 
        if (ne == NULL)
                return FALSE;
@@ -537,7 +538,7 @@ ves_icall_System_Globalization_CultureInfo_construct_internal_locale_from_name (
        MONO_ARCH_SAVE_REGS;
 
        n = mono_string_to_utf8 (name);
-       ne = bsearch (n, culture_name_entries, NUM_CULTURE_ENTRIES,
+       ne = mono_binary_search (n, culture_name_entries, NUM_CULTURE_ENTRIES,
                        sizeof (CultureInfoNameEntry), culture_name_locator);
 
        if (ne == NULL) {
@@ -591,7 +592,7 @@ ves_icall_System_Globalization_RegionInfo_construct_internal_region_from_name (M
        MONO_ARCH_SAVE_REGS;
 
        n = mono_string_to_utf8 (name);
-       ne = bsearch (n, region_name_entries, NUM_REGION_ENTRIES,
+       ne = mono_binary_search (n, region_name_entries, NUM_REGION_ENTRIES,
                sizeof (RegionInfoNameEntry), region_name_locator);
 
        if (ne == NULL) {
index 475745d261de92092378705680267e9a096cf1c8..301a1f7bae16e7ca926e9fbc611a8c9d60039156 100644 (file)
@@ -122,9 +122,14 @@ mono_string_from_byvalwstr (gunichar2 *data, int len);
 static void
 mono_byvalarray_to_array (MonoArray *arr, gpointer native_arr, MonoClass *eltype, guint32 elnum);
 
+static void
+mono_byvalarray_to_byte_array (MonoArray *arr, gpointer native_arr, guint32 elnum);
+
 static void
 mono_array_to_byvalarray (gpointer native_arr, MonoArray *arr, MonoClass *eltype, guint32 elnum);
 
+static void
+mono_array_to_byte_byvalarray (gpointer native_arr, MonoArray *arr, guint32 elnum);
 
 static MonoAsyncResult *
 mono_delegate_begin_invoke (MonoDelegate *delegate, gpointer *params);
@@ -239,7 +244,9 @@ mono_marshal_init (void)
                register_icall (mono_array_to_lparray, "mono_array_to_lparray", "ptr object", FALSE);
                register_icall (mono_free_lparray, "mono_free_lparray", "void object ptr", FALSE);
                register_icall (mono_byvalarray_to_array, "mono_byvalarray_to_array", "void object ptr ptr int32", FALSE);
+               register_icall (mono_byvalarray_to_byte_array, "mono_byvalarray_to_byte_array", "void object ptr int32", FALSE);
                register_icall (mono_array_to_byvalarray, "mono_array_to_byvalarray", "void ptr object ptr int32", FALSE);
+               register_icall (mono_array_to_byte_byvalarray, "mono_array_to_byte_byvalarray", "void ptr object int32", FALSE);
                register_icall (mono_delegate_to_ftnptr, "mono_delegate_to_ftnptr", "ptr object", FALSE);
                register_icall (mono_ftnptr_to_delegate, "mono_ftnptr_to_delegate", "object ptr ptr", FALSE);
                register_icall (mono_marshal_asany, "mono_marshal_asany", "ptr object int32 int32", FALSE);
@@ -692,6 +699,12 @@ mono_byvalarray_to_array (MonoArray *arr, gpointer native_arr, MonoClass *elclas
                g_assert_not_reached ();
 }
 
+static void
+mono_byvalarray_to_byte_array (MonoArray *arr, gpointer native_arr, guint32 elnum)
+{
+       mono_byvalarray_to_array (arr, native_arr, mono_defaults.byte_class, elnum);
+}
+
 static void
 mono_array_to_byvalarray (gpointer native_arr, MonoArray *arr, MonoClass *elclass, guint32 elnum)
 {
@@ -715,6 +728,12 @@ mono_array_to_byvalarray (gpointer native_arr, MonoArray *arr, MonoClass *elclas
        }
 }
 
+static void
+mono_array_to_byte_byvalarray (gpointer native_arr, MonoArray *arr, guint32 elnum)
+{
+       mono_array_to_byvalarray (native_arr, arr, mono_defaults.byte_class, elnum);
+}
+
 void
 mono_string_utf8_to_builder (MonoStringBuilder *sb, char *text)
 {
@@ -1346,9 +1365,8 @@ emit_ptr_to_object_conv (MonoMethodBuilder *mb, MonoType *type, MonoMarshalConv
                mono_mb_emit_ldloc (mb, 1);
                mono_mb_emit_byte (mb, CEE_LDIND_REF);
                mono_mb_emit_ldloc (mb, 0);
-               mono_mb_emit_ptr (mb, mono_defaults.byte_class);
                mono_mb_emit_icon (mb, mspec->data.array_data.num_elem);
-               mono_mb_emit_icall (mb, mono_byvalarray_to_array);
+               mono_mb_emit_icall (mb, mono_byvalarray_to_byte_array);
                break;
        }
        case MONO_MARSHAL_CONV_STR_BYVALSTR: 
@@ -1721,9 +1739,8 @@ emit_object_to_ptr_conv (MonoMethodBuilder *mb, MonoType *type, MonoMarshalConv
                mono_mb_emit_ldloc (mb, 1);
                mono_mb_emit_ldloc (mb, 0);     
                mono_mb_emit_byte (mb, CEE_LDIND_REF);
-               mono_mb_emit_ptr (mb, mono_defaults.byte_class);
                mono_mb_emit_icon (mb, mspec->data.array_data.num_elem);
-               mono_mb_emit_icall (mb, mono_array_to_byvalarray);
+               mono_mb_emit_icall (mb, mono_array_to_byte_byvalarray);
                mono_mb_patch_short_branch (mb, pos);
                break;
        }
@@ -2575,7 +2592,14 @@ mono_marshal_method_from_wrapper (MonoMethod *wrapper)
                res = mono_marshal_get_wrapper_info (wrapper);
                if (res == NULL)
                        return wrapper;
-               return res;
+               if (wrapper->is_inflated)
+                       /*
+                        * A method cannot be inflated and a wrapper at the same time, so the wrapper info
+                        * contains an uninflated method.
+                        */
+                       return mono_class_inflate_generic_method (res, mono_method_get_context (wrapper));
+               else
+                       return res;
        case MONO_WRAPPER_MANAGED_TO_NATIVE:
                info = mono_marshal_get_wrapper_info (wrapper);
                if (info && (info->subtype == WRAPPER_SUBTYPE_NONE || info->subtype == WRAPPER_SUBTYPE_NATIVE_FUNC_AOT))
@@ -2669,6 +2693,77 @@ get_wrapper_target_class (MonoImage *image)
        return klass;
 }
 
+/*
+ * Wrappers for generic methods should be instances of generic wrapper methods, i.e .the wrapper for Sort<int> should be
+ * an instance of the wrapper for Sort<T>. This is required for full-aot to work.
+ */
+
+/*
+ * check_generic_wrapper_cache:
+ *
+ *   Check CACHE for the wrapper of the generic instance ORIG_METHOD, and return it if it is found.
+ * KEY should be the key for ORIG_METHOD in the cache, while DEF_KEY should be the key of its
+ * generic method definition.
+ */
+static MonoMethod*
+check_generic_wrapper_cache (GHashTable *cache, MonoMethod *orig_method, gpointer key, gpointer def_key)
+{
+       MonoMethod *res;
+       MonoMethod *inst, *def;
+       MonoGenericContext *ctx;
+       MonoMethod *def_method;
+
+       g_assert (orig_method->is_inflated);
+       def_method = ((MonoMethodInflated*)orig_method)->declaring;
+       ctx = mono_method_get_context (orig_method);
+
+       /*
+        * Look for the instance
+        */
+       res = mono_marshal_find_in_cache (cache, key);
+       if (res)
+               return res;
+
+       /*
+        * Look for the definition
+        */
+       def = mono_marshal_find_in_cache (cache, def_key);
+       if (def) {
+               inst = mono_class_inflate_generic_method (def, ctx);
+               /* Cache it */
+               mono_memory_barrier ();
+               mono_marshal_lock ();
+               res = g_hash_table_lookup (cache, key);
+               if (!res) {
+                       g_hash_table_insert (cache, key, inst);
+                       res = inst;
+               }
+               mono_marshal_unlock ();
+               return res;
+       }
+       return NULL;
+}
+
+static MonoMethod*
+cache_generic_wrapper (GHashTable *cache, MonoMethod *orig_method, MonoMethod *def, MonoGenericContext *ctx, gpointer key)
+{
+       MonoMethod *inst, *res;
+
+       /*
+        * We use the same cache for the generic definition and the instances.
+        */
+       inst = mono_class_inflate_generic_method (def, ctx);
+       mono_memory_barrier ();
+       mono_marshal_lock ();
+       res = g_hash_table_lookup (cache, key);
+       if (!res) {
+               g_hash_table_insert (cache, key, inst);
+               res = inst;
+       }
+       mono_marshal_unlock ();
+       return res;
+}
+
 static MonoMethod*
 check_generic_delegate_wrapper_cache (GHashTable *cache, MonoMethod *orig_method, MonoMethod *def_method, MonoGenericContext *ctx)
 {
@@ -4425,9 +4520,12 @@ mono_marshal_get_string_ctor_signature (MonoMethod *method)
 static MonoType*
 get_runtime_invoke_type (MonoType *t, gboolean ret)
 {
-       if (t->byref)
+       if (t->byref) {
+               if (t->type == MONO_TYPE_GENERICINST && mono_class_is_nullable (mono_class_from_mono_type (t)))
+                       return t;
                /* Can't share this with 'I' as that needs another indirection */
-               return t;
+               return &mono_defaults.int_class->this_arg;
+       }
 
        if (MONO_TYPE_IS_REFERENCE (t))
                return &mono_defaults.object_class->byval_arg;
@@ -4846,20 +4944,10 @@ mono_marshal_get_runtime_invoke (MonoMethod *method, gboolean virtual)
                /* Can't share this as we push a string as this */
                need_direct_wrapper = TRUE;
        } else {
-               if (method->klass->valuetype && mono_method_signature (method)->hasthis) {
-                       /* 
-                        * Valuetype methods receive a managed pointer as the this argument.
-                        * Create a new signature to reflect this.
-                        */
-                       callsig = signature_dup_add_this (method->klass->image, mono_method_signature (method), method->klass);
-                       /* Can't share this as it would be shared with static methods taking an IntPtr argument */
-                       need_direct_wrapper = TRUE;
-               } else {
-                       if (method->dynamic)
-                               callsig = signature_dup (method->klass->image, mono_method_signature (method));
-                       else
-                               callsig = mono_method_signature (method);
-               }
+               if (method->dynamic)
+                       callsig = signature_dup (method->klass->image, mono_method_signature (method));
+               else
+                       callsig = mono_method_signature (method);
        }
 
        target_klass = get_wrapper_target_class (method->klass->image);
@@ -4906,7 +4994,7 @@ mono_marshal_get_runtime_invoke (MonoMethod *method, gboolean virtual)
 
        csig->ret = &mono_defaults.object_class->byval_arg;
        if (method->klass->valuetype && mono_method_signature (method)->hasthis)
-               csig->params [0] = callsig->params [0];
+               csig->params [0] = get_runtime_invoke_type (&method->klass->this_arg, FALSE);
        else
                csig->params [0] = &mono_defaults.object_class->byval_arg;
        csig->params [1] = &mono_defaults.int_class->byval_arg;
@@ -9388,9 +9476,10 @@ mono_marshal_get_managed_wrapper (MonoMethod *method, MonoClass *delegate_klass,
                        MonoBoolean set_last_error = 0;
                        MonoBoolean best_fit_mapping = 0;
                        MonoBoolean throw_on_unmappable = 0;
+                       MonoError error;
 
-                       mono_reflection_create_custom_attr_data_args (mono_defaults.corlib, attr->ctor, attr->data, attr->data_size, &typed_args, &named_args, &arginfo);
-
+                       mono_reflection_create_custom_attr_data_args (mono_defaults.corlib, attr->ctor, attr->data, attr->data_size, &typed_args, &named_args, &arginfo, &error);
+                       g_assert (mono_error_ok (&error));
                        g_assert (mono_array_length (typed_args) == 1);
 
                        /* typed args */
@@ -10209,6 +10298,19 @@ mono_marshal_get_synchronized_inner_wrapper (MonoMethod *method)
        WrapperInfo *info;
        MonoMethodSignature *sig;
        MonoMethod *res;
+       MonoGenericContext *ctx = NULL;
+       MonoMethod *orig_method = NULL;
+       MonoGenericContainer *container = NULL;
+
+       if (method->is_inflated && !mono_method_get_context (method)->method_inst) {
+               orig_method = method;
+               ctx = &((MonoMethodInflated*)method)->context;
+               method = ((MonoMethodInflated*)method)->declaring;
+               container = mono_method_get_generic_container (method);
+               if (!container)
+                       container = method->klass->generic_container;
+               g_assert (container);
+       }
 
        mb = mono_mb_new (method->klass, method->name, MONO_WRAPPER_UNKNOWN);
 #ifndef DISABLE_JIT
@@ -10221,6 +10323,8 @@ mono_marshal_get_synchronized_inner_wrapper (MonoMethod *method)
        info = mono_wrapper_info_create (res, WRAPPER_SUBTYPE_SYNCHRONIZED_INNER);
        info->d.synchronized_inner.method = method;
        mono_marshal_set_wrapper_info (res, info);
+       if (ctx)
+               res = mono_class_inflate_generic_method (res, ctx);
        return res;
 }
 
@@ -10238,15 +10342,39 @@ mono_marshal_get_synchronized_wrapper (MonoMethod *method)
        MonoMethod *res;
        GHashTable *cache;
        int i, pos, this_local, ret_local = 0;
+       MonoGenericContext *ctx = NULL;
+       MonoMethod *orig_method = NULL;
+       MonoGenericContainer *container = NULL;
 
        g_assert (method);
 
        if (method->wrapper_type == MONO_WRAPPER_SYNCHRONIZED)
                return method;
 
-       cache = get_cache (&method->klass->image->synchronized_cache, mono_aligned_addr_hash, NULL);
-       if ((res = mono_marshal_find_in_cache (cache, method)))
-               return res;
+       /* FIXME: Support generic methods too */
+       if (method->is_inflated && !mono_method_get_context (method)->method_inst) {
+               orig_method = method;
+               ctx = &((MonoMethodInflated*)method)->context;
+               method = ((MonoMethodInflated*)method)->declaring;
+               container = mono_method_get_generic_container (method);
+               if (!container)
+                       container = method->klass->generic_container;
+               g_assert (container);
+       }
+
+       /*
+        * Check cache
+        */
+       if (ctx) {
+               cache = get_cache (&method->klass->image->synchronized_generic_cache, mono_aligned_addr_hash, NULL);
+               res = check_generic_wrapper_cache (cache, orig_method, orig_method, method);
+               if (res)
+                       return res;
+       } else {
+               cache = get_cache (&method->klass->image->synchronized_cache, mono_aligned_addr_hash, NULL);
+               if ((res = mono_marshal_find_in_cache (cache, method)))
+                       return res;
+       }
 
        sig = signature_dup (method->klass->image, mono_method_signature (method));
        sig->pinvoke = 0;
@@ -10337,7 +10465,10 @@ mono_marshal_get_synchronized_wrapper (MonoMethod *method)
        for (i = 0; i < sig->param_count; i++)
                mono_mb_emit_ldarg (mb, i + (sig->hasthis == TRUE));
 
-       mono_mb_emit_managed_call (mb, method, NULL);
+       if (ctx)
+               mono_mb_emit_managed_call (mb, mono_class_inflate_generic_method (method, &container->context), NULL);
+       else
+               mono_mb_emit_managed_call (mb, method, NULL);
 
        if (!MONO_TYPE_IS_VOID (sig->ret))
                mono_mb_emit_stloc (mb, ret_local);
@@ -10362,8 +10493,14 @@ mono_marshal_get_synchronized_wrapper (MonoMethod *method)
        mono_mb_set_clauses (mb, 1, clause);
 #endif
 
-       res = mono_mb_create_and_cache (cache, method,
-                                                                       mb, sig, sig->param_count + 16);
+       if (ctx) {
+               MonoMethod *def;
+               def = mono_mb_create_and_cache (cache, method, mb, sig, sig->param_count + 16);
+               res = cache_generic_wrapper (cache, orig_method, def, ctx, orig_method);
+       } else {
+               res = mono_mb_create_and_cache (cache, method,
+                                                                               mb, sig, sig->param_count + 16);
+       }
        mono_mb_free (mb);
 
        return res;     
@@ -11321,6 +11458,76 @@ mono_marshal_get_array_address (int rank, int elem_size)
        return ret;
 }
 
+/*
+ * mono_marshal_get_array_accessor_wrapper:
+ *
+ *   Return a wrapper which just calls METHOD, which should be an Array Get/Set/Address method.
+ */
+MonoMethod *
+mono_marshal_get_array_accessor_wrapper (MonoMethod *method)
+{
+       MonoMethodSignature *sig;
+       MonoMethodBuilder *mb;
+       MonoMethod *res;
+       GHashTable *cache;
+       int i;
+       MonoGenericContext *ctx = NULL;
+       MonoMethod *orig_method = NULL;
+       MonoGenericContainer *container = NULL;
+       WrapperInfo *info;
+
+       /*
+        * These wrappers are needed to avoid the JIT replacing the calls to these methods with intrinsics
+        * inside runtime invoke wrappers, thereby making the wrappers not unshareable.
+        * FIXME: Use generic methods.
+        */
+       /*
+        * Check cache
+        */
+       if (ctx) {
+               cache = NULL;
+               g_assert_not_reached ();
+       } else {
+               cache = get_cache (&method->klass->image->array_accessor_cache, mono_aligned_addr_hash, NULL);
+               if ((res = mono_marshal_find_in_cache (cache, method)))
+                       return res;
+       }
+
+       sig = signature_dup (method->klass->image, mono_method_signature (method));
+       sig->pinvoke = 0;
+
+       mb = mono_mb_new (method->klass, method->name, MONO_WRAPPER_UNKNOWN);
+
+#ifndef DISABLE_JIT
+       /* Call the method */
+       if (sig->hasthis)
+               mono_mb_emit_ldarg (mb, 0);
+       for (i = 0; i < sig->param_count; i++)
+               mono_mb_emit_ldarg (mb, i + (sig->hasthis == TRUE));
+
+       if (ctx)
+               mono_mb_emit_managed_call (mb, mono_class_inflate_generic_method (method, &container->context), NULL);
+       else
+               mono_mb_emit_managed_call (mb, method, NULL);
+       mono_mb_emit_byte (mb, CEE_RET);
+#endif
+
+       if (ctx) {
+               MonoMethod *def;
+               def = mono_mb_create_and_cache (cache, method, mb, sig, sig->param_count + 16);
+               res = cache_generic_wrapper (cache, orig_method, def, ctx, orig_method);
+       } else {
+               res = mono_mb_create_and_cache (cache, method,
+                                                                               mb, sig, sig->param_count + 16);
+               info = mono_wrapper_info_create (res, WRAPPER_SUBTYPE_ARRAY_ACCESSOR);
+               info->d.array_accessor.method = method;
+               mono_marshal_set_wrapper_info (res, info);
+       }
+       mono_mb_free (mb);
+
+       return res;     
+}
+
 void*
 mono_marshal_alloc (gulong size)
 {
index 80ffdbd4cfa42cb6384a2b4b0bfe2f115ae150b4..22db7a6b330d99e3f068e5cc47dc9d213bc35b70 100644 (file)
@@ -108,6 +108,7 @@ typedef enum {
        WRAPPER_SUBTYPE_SYNCHRONIZED_INNER,
        WRAPPER_SUBTYPE_GSHAREDVT_IN,
        WRAPPER_SUBTYPE_GSHAREDVT_OUT,
+       WRAPPER_SUBTYPE_ARRAY_ACCESSOR,
        /* Subtypes of MONO_WRAPPER_MANAGED_TO_MANAGED */
        WRAPPER_SUBTYPE_GENERIC_ARRAY_HELPER
 } WrapperSubtype;
@@ -151,6 +152,10 @@ typedef struct {
        gpointer func;
 } ICallWrapperInfo;
 
+typedef struct {
+       MonoMethod *method;
+} ArrayAccessorWrapperInfo;
+
 /*
  * This structure contains additional information to uniquely identify a given wrapper
  * method. It can be retrieved by mono_marshal_get_wrapper_info () for certain types
@@ -177,6 +182,8 @@ typedef struct {
                GenericArrayHelperWrapperInfo generic_array_helper;
                /* ICALL_WRAPPER */
                ICallWrapperInfo icall;
+               /* ARRAY_ACCESSOR */
+               ArrayAccessorWrapperInfo array_accessor;
        } d;
 } WrapperInfo;
 
@@ -353,6 +360,9 @@ mono_marshal_get_virtual_stelemref_wrappers (int *nwrappers) MONO_INTERNAL;
 MonoMethod*
 mono_marshal_get_array_address (int rank, int elem_size) MONO_INTERNAL;
 
+MonoMethod *
+mono_marshal_get_array_accessor_wrapper (MonoMethod *method) MONO_INTERNAL;
+
 MonoMethod *
 mono_marshal_get_generic_array_helper (MonoClass *class, MonoClass *iface,
                                       gchar *name, MonoMethod *method) MONO_INTERNAL;
index 808b59cf0dad410c4ab5dabe1de71b15a71b353f..072f62153023ad0c6d0afbfc4891122c05818a1e 100644 (file)
@@ -282,6 +282,8 @@ struct _MonoImage {
        GHashTable *cominterop_wrapper_cache; /* LOCKING: marshal lock */
        GHashTable *thunk_invoke_cache;
        GHashTable *wrapper_param_names;
+       GHashTable *synchronized_generic_cache;
+       GHashTable *array_accessor_cache;
 
        /*
         * indexed by MonoClass pointers
index 94780bb0d5a469511d2ed0cb47b8f35996197f7e..adbe7a516216191a48abc935be7d87026464ed0b 100644 (file)
@@ -24,6 +24,7 @@
 #include <mono/metadata/attrdefs.h>
 #include <mono/utils/strenc.h>
 #include <mono/utils/mono-error-internals.h>
+#include <mono/utils/bsearch.h>
 #include <string.h>
 //#include <signal.h>
 #include <ctype.h>
@@ -1069,7 +1070,7 @@ search_sorted_table (VerifyContext *ctx, int table, int column, guint32 coded_to
        base = tinfo->base;
 
        VERIFIER_DEBUG ( printf ("looking token %x table %d col %d rsize %d roff %d\n", coded_token, table, column, locator.col_size, locator.col_offset) );
-       res = bsearch (&locator, base, tinfo->rows, tinfo->row_size, token_locator);
+       res = mono_binary_search (&locator, base, tinfo->rows, tinfo->row_size, token_locator);
        if (!res)
                return -1;
 
index a8db2e2d8939bb0f7026b100270316850f1137fb..eea4a8cd39213bb6ce18399f61e55a056722f5f0 100644 (file)
@@ -26,7 +26,8 @@
 #include "marshal.h"
 #include "debug-helpers.h"
 #include <mono/utils/mono-error-internals.h>
+#include <mono/utils/bsearch.h>
+
 /* Auxiliary structure used for caching inflated signatures */
 typedef struct {
        MonoMethodSignature *sig;
@@ -3917,7 +3918,7 @@ mono_metadata_typedef_from_field (MonoImage *meta, guint32 index)
        if (meta->uncompressed_metadata)
                loc.idx = search_ptr_table (meta, MONO_TABLE_FIELD_POINTER, loc.idx);
 
-       if (!bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, typedef_locator))
+       if (!mono_binary_search (&loc, tdef->base, tdef->rows, tdef->row_size, typedef_locator))
                return 0;
 
        /* loc_result is 0..1, needs to be mapped to table index (that is +1) */
@@ -3948,7 +3949,7 @@ mono_metadata_typedef_from_method (MonoImage *meta, guint32 index)
        if (meta->uncompressed_metadata)
                loc.idx = search_ptr_table (meta, MONO_TABLE_METHOD_POINTER, loc.idx);
 
-       if (!bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, typedef_locator))
+       if (!mono_binary_search (&loc, tdef->base, tdef->rows, tdef->row_size, typedef_locator))
                return 0;
 
        /* loc_result is 0..1, needs to be mapped to table index (that is +1) */
@@ -3990,7 +3991,7 @@ mono_metadata_interfaces_from_typedef_full (MonoImage *meta, guint32 index, Mono
        loc.col_idx = MONO_INTERFACEIMPL_CLASS;
        loc.t = tdef;
 
-       if (!bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
+       if (!mono_binary_search (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
                return TRUE;
 
        start = loc.result;
@@ -4086,7 +4087,7 @@ mono_metadata_nested_in_typedef (MonoImage *meta, guint32 index)
        loc.col_idx = MONO_NESTED_CLASS_NESTED;
        loc.t = tdef;
 
-       if (!bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
+       if (!mono_binary_search (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
                return 0;
 
        /* loc_result is 0..1, needs to be mapped to table index (that is +1) */
@@ -4150,7 +4151,7 @@ mono_metadata_packing_from_typedef (MonoImage *meta, guint32 index, guint32 *pac
        loc.col_idx = MONO_CLASS_LAYOUT_PARENT;
        loc.t = tdef;
 
-       if (!bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
+       if (!mono_binary_search (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
                return 0;
 
        mono_metadata_decode_row (tdef, loc.result, cols, MONO_CLASS_LAYOUT_SIZE);
@@ -4187,7 +4188,7 @@ mono_metadata_custom_attrs_from_index (MonoImage *meta, guint32 index)
 
        /* FIXME: Index translation */
 
-       if (!bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
+       if (!mono_binary_search (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
                return 0;
 
        /* Find the first entry by searching backwards */
@@ -4220,7 +4221,7 @@ mono_metadata_declsec_from_index (MonoImage *meta, guint32 index)
        loc.col_idx = MONO_DECL_SECURITY_PARENT;
        loc.t = tdef;
 
-       if (!bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, declsec_locator))
+       if (!mono_binary_search (&loc, tdef->base, tdef->rows, tdef->row_size, declsec_locator))
                return -1;
 
        /* Find the first entry by searching backwards */
@@ -4934,7 +4935,7 @@ mono_metadata_field_info_full (MonoImage *meta, guint32 index, guint32 *offset,
                loc.col_idx = MONO_FIELD_LAYOUT_FIELD;
                loc.t = tdef;
 
-               if (tdef->base && bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator)) {
+               if (tdef->base && mono_binary_search (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator)) {
                        *offset = mono_metadata_decode_row_col (tdef, loc.result, MONO_FIELD_LAYOUT_OFFSET);
                } else {
                        *offset = (guint32)-1;
@@ -4946,7 +4947,7 @@ mono_metadata_field_info_full (MonoImage *meta, guint32 index, guint32 *offset,
                loc.col_idx = MONO_FIELD_RVA_FIELD;
                loc.t = tdef;
                
-               if (tdef->base && bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator)) {
+               if (tdef->base && mono_binary_search (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator)) {
                        /*
                         * LAMESPEC: There is no signature, no nothing, just the raw data.
                         */
@@ -5007,7 +5008,7 @@ mono_metadata_get_constant_index (MonoImage *meta, guint32 token, guint32 hint)
        if ((hint > 0) && (hint < tdef->rows) && (mono_metadata_decode_row_col (tdef, hint - 1, MONO_CONSTANT_PARENT) == index))
                return hint;
 
-       if (tdef->base && bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator)) {
+       if (tdef->base && mono_binary_search (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator)) {
                return loc.result + 1;
        }
        return 0;
@@ -5038,7 +5039,7 @@ mono_metadata_events_from_typedef (MonoImage *meta, guint32 index, guint *end_id
        loc.col_idx = MONO_EVENT_MAP_PARENT;
        loc.idx = index + 1;
 
-       if (!bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
+       if (!mono_binary_search (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
                return 0;
        
        start = mono_metadata_decode_row_col (tdef, loc.result, MONO_EVENT_MAP_EVENTLIST);
@@ -5080,7 +5081,7 @@ mono_metadata_methods_from_event   (MonoImage *meta, guint32 index, guint *end_i
        loc.col_idx = MONO_METHOD_SEMA_ASSOCIATION;
        loc.idx = ((index + 1) << MONO_HAS_SEMANTICS_BITS) | MONO_HAS_SEMANTICS_EVENT; /* Method association coded index */
 
-       if (!bsearch (&loc, msemt->base, msemt->rows, msemt->row_size, table_locator))
+       if (!mono_binary_search (&loc, msemt->base, msemt->rows, msemt->row_size, table_locator))
                return 0;
 
        start = loc.result;
@@ -5129,7 +5130,7 @@ mono_metadata_properties_from_typedef (MonoImage *meta, guint32 index, guint *en
        loc.col_idx = MONO_PROPERTY_MAP_PARENT;
        loc.idx = index + 1;
 
-       if (!bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
+       if (!mono_binary_search (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
                return 0;
        
        start = mono_metadata_decode_row_col (tdef, loc.result, MONO_PROPERTY_MAP_PROPERTY_LIST);
@@ -5171,7 +5172,7 @@ mono_metadata_methods_from_property   (MonoImage *meta, guint32 index, guint *en
        loc.col_idx = MONO_METHOD_SEMA_ASSOCIATION;
        loc.idx = ((index + 1) << MONO_HAS_SEMANTICS_BITS) | MONO_HAS_SEMANTICS_PROPERTY; /* Method association coded index */
 
-       if (!bsearch (&loc, msemt->base, msemt->rows, msemt->row_size, table_locator))
+       if (!mono_binary_search (&loc, msemt->base, msemt->rows, msemt->row_size, table_locator))
                return 0;
 
        start = loc.result;
@@ -5210,7 +5211,7 @@ mono_metadata_implmap_from_method (MonoImage *meta, guint32 method_idx)
        loc.col_idx = MONO_IMPLMAP_MEMBER;
        loc.idx = ((method_idx + 1) << MONO_MEMBERFORWD_BITS) | MONO_MEMBERFORWD_METHODDEF;
 
-       if (!bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
+       if (!mono_binary_search (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
                return 0;
 
        return loc.result + 1;
@@ -5594,7 +5595,7 @@ mono_metadata_get_marshal_info (MonoImage *meta, guint32 idx, gboolean is_field)
 
        /* FIXME: Index translation */
 
-       if (!bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
+       if (!mono_binary_search (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
                return NULL;
 
        return mono_metadata_blob_heap (meta, mono_metadata_decode_row_col (tdef, loc.result, MONO_FIELD_MARSHAL_NATIVE_TYPE));
@@ -5647,7 +5648,7 @@ mono_class_get_overrides_full (MonoImage *image, guint32 type_token, MonoMethod
        loc.col_idx = MONO_METHODIMPL_CLASS;
        loc.idx = mono_metadata_token_index (type_token);
 
-       if (!bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
+       if (!mono_binary_search (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
                return TRUE;
 
        start = loc.result;
@@ -5787,7 +5788,7 @@ mono_metadata_get_generic_param_row (MonoImage *image, guint32 token, guint32 *o
        loc.col_idx = MONO_GENERICPARAM_OWNER;
        loc.t = tdef;
 
-       if (!bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
+       if (!mono_binary_search (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
                return 0;
 
        /* Find the first entry by searching backwards */
index 5a1edeb210fc2d57ab3132e44a3896e54f1f24c5..43a5e83933cb4202383cc99ac07da7eb688f482a 100644 (file)
@@ -179,6 +179,8 @@ mono_mb_create_method (MonoMethodBuilder *mb, MonoMethodSignature *signature, in
        }
 
        method->signature = signature;
+       if (!signature->hasthis)
+               method->flags |= METHOD_ATTRIBUTE_STATIC;
 
 #ifndef DISABLE_JIT
        if (max_stack < 8)
index 98201e3429ac91b7fb2d7f60162a610e324698d1..a856c1cfa6d4da274df5dddbe1bdb0b468cf1363 100644 (file)
@@ -1391,7 +1391,7 @@ void        mono_reflection_initialize_generic_parameter (MonoReflectionGenericP
 void        mono_reflection_create_unmanaged_type (MonoReflectionType *type) MONO_INTERNAL;
 void        mono_reflection_register_with_runtime (MonoReflectionType *type) MONO_INTERNAL;
 
-void        mono_reflection_create_custom_attr_data_args (MonoImage *image, MonoMethod *method, const guchar *data, guint32 len, MonoArray **typed_args, MonoArray **named_args, CattrNamedArg **named_arg_info) MONO_INTERNAL;
+void        mono_reflection_create_custom_attr_data_args (MonoImage *image, MonoMethod *method, const guchar *data, guint32 len, MonoArray **typed_args, MonoArray **named_args, CattrNamedArg **named_arg_info, MonoError *error) MONO_INTERNAL;
 MonoMethodSignature * mono_reflection_lookup_signature (MonoImage *image, MonoMethod *method, guint32 token) MONO_INTERNAL;
 
 MonoArray* mono_param_get_objects_internal  (MonoDomain *domain, MonoMethod *method, MonoClass *refclass) MONO_INTERNAL;
index c2ff521e3b055736c0d79f2a541d025f12de4b6e..1ddcb7fe33b5703e573f662612b1fca99afa476a 100644 (file)
@@ -8233,7 +8233,7 @@ create_custom_attr (MonoImage *image, MonoMethod *method, const guchar *data, gu
  * NAMED_ARG_INFO will contain information about the named arguments.
  */
 void
-mono_reflection_create_custom_attr_data_args (MonoImage *image, MonoMethod *method, const guchar *data, guint32 len, MonoArray **typed_args, MonoArray **named_args, CattrNamedArg **named_arg_info)
+mono_reflection_create_custom_attr_data_args (MonoImage *image, MonoMethod *method, const guchar *data, guint32 len, MonoArray **typed_args, MonoArray **named_args, CattrNamedArg **named_arg_info, MonoError *error)
 {
        MonoArray *typedargs, *namedargs;
        MonoClass *attrklass;
@@ -8243,14 +8243,18 @@ mono_reflection_create_custom_attr_data_args (MonoImage *image, MonoMethod *meth
        guint32 i, j, num_named;
        CattrNamedArg *arginfo = NULL;
 
-       if (!mono_verifier_verify_cattr_content (image, method, data, len, NULL))
-               return;
-
-       mono_class_init (method->klass);
-
        *typed_args = NULL;
        *named_args = NULL;
        *named_arg_info = NULL;
+
+       mono_error_init (error);
+
+       if (!mono_verifier_verify_cattr_content (image, method, data, len, NULL)) {
+               mono_error_set_generic_error (error, "System.Reflection", "CustomAttributeFormatException", "Binary format of the specified custom attribute was invalid.");
+               return;
+       }
+
+       mono_class_init (method->klass);
        
        domain = mono_domain_get ();
 
@@ -8352,6 +8356,7 @@ mono_reflection_resolve_custom_attribute_data (MonoReflectionMethod *ref_method,
        MonoImage *image;
        MonoMethod *method;
        CattrNamedArg *arginfo;
+       MonoError error;
        int i;
 
        *ctor_args = NULL;
@@ -8367,7 +8372,9 @@ mono_reflection_resolve_custom_attribute_data (MonoReflectionMethod *ref_method,
        if (!mono_class_init (method->klass))
                mono_raise_exception (mono_class_get_exception_for_failure (method->klass));
 
-       mono_reflection_create_custom_attr_data_args (image, method, data, len, &typedargs, &namedargs, &arginfo);
+       mono_reflection_create_custom_attr_data_args (image, method, data, len, &typedargs, &namedargs, &arginfo, &error);
+       if (!mono_error_ok (&error))
+               mono_error_raise_exception (&error);
        if (mono_loader_get_last_error ())
                mono_raise_exception (mono_loader_error_prepare_exception (mono_loader_get_last_error ()));
 
index 61222e2d57e96260d9961c3367e5ceed79c56765..4f4ffb18e6e00ab10ea9dd1c545a9d2dd65a3ff5 100644 (file)
@@ -347,6 +347,7 @@ mono_gc_try_alloc_obj_nolock (MonoVTable *vtable, size_t size)
        TLAB_ACCESS_INIT;
 
        size = ALIGN_UP (size);
+       SGEN_ASSERT (9, size >= sizeof (MonoObject), "Object too small");
 
        g_assert (vtable->gc_descr);
        if (size > SGEN_MAX_SMALL_OBJ_SIZE)
@@ -434,6 +435,24 @@ mono_gc_alloc_obj (MonoVTable *vtable, size_t size)
        void *res;
 #ifndef DISABLE_CRITICAL_REGION
        TLAB_ACCESS_INIT;
+
+       if (G_UNLIKELY (has_per_allocation_action)) {
+               static int alloc_count;
+               int current_alloc = InterlockedIncrement (&alloc_count);
+
+               if (verify_before_allocs) {
+                       if ((current_alloc % verify_before_allocs) == 0)
+                               sgen_check_whole_heap_stw ();
+               }
+               if (collect_before_allocs) {
+                       if (((current_alloc % collect_before_allocs) == 0) && nursery_section) {
+                               LOCK_GC;
+                               sgen_perform_collection (0, GENERATION_NURSERY, "collect-before-alloc-triggered", TRUE);
+                               UNLOCK_GC;
+                       }
+               }
+       }
+
        ENTER_CRITICAL_REGION;
        res = mono_gc_try_alloc_obj_nolock (vtable, size);
        if (res) {
@@ -967,7 +986,8 @@ mono_gc_get_managed_allocator (MonoClass *klass, gboolean for_box)
        if (tlab_next_offset == -1 || tlab_temp_end_offset == -1)
                return NULL;
 #endif
-
+       if (collect_before_allocs)
+               return NULL;
        if (!mono_runtime_has_tls_get ())
                return NULL;
        if (klass->instance_size > tlab_size)
@@ -979,8 +999,6 @@ mono_gc_get_managed_allocator (MonoClass *klass, gboolean for_box)
                return NULL;
        if (klass->byval_arg.type == MONO_TYPE_STRING)
                return mono_gc_get_managed_allocator_by_type (ATYPE_STRING);
-       if (collect_before_allocs)
-               return NULL;
        /* Generic classes have dynamic field and can go above MAX_SMALL_OBJ_SIZE. */
        if (ALIGN_TO (klass->instance_size, ALLOC_ALIGN) < MAX_SMALL_OBJ_SIZE && !mono_class_is_open_constructed_type (&klass->byval_arg))
                return mono_gc_get_managed_allocator_by_type (ATYPE_SMALL);
index b6983fb908f1746d941f7678ac8a8d071b9e6114..bb350a9e91ffbde1a81bc6a46ab1d8c2f6de801c 100644 (file)
@@ -31,6 +31,7 @@
 #include "metadata/sgen-gray.h"
 #include "metadata/sgen-protocol.h"
 #include "utils/dtrace.h"
+#include "utils/mono-counters.h"
 
 #define ptr_in_nursery sgen_ptr_in_nursery
 
@@ -230,12 +231,66 @@ register_for_finalization (MonoObject *obj, void *user_data, int generation)
        }
 }
 
+/*
+ * We're using (mostly) non-locking staging queues for finalizers and weak links to speed
+ * up registering them.  Otherwise we'd have to take the GC lock.
+ *
+ * The queues are arrays of `StageEntry`, plus a `next_entry` index.  Threads add entries to
+ * the queue via `add_stage_entry()` in a linear fashion until it fills up, in which case
+ * `process_stage_entries()` is called to drain it.  A garbage collection will also drain
+ * the queues via the same function.  That implies that `add_stage_entry()`, since it
+ * doesn't take a lock, must be able to run concurrently with `process_stage_entries()`,
+ * though it doesn't have to make progress while the queue is drained.  In fact, once it
+ * detects that the queue is being drained, it blocks until the draining is done.
+ *
+ * The protocol must guarantee that entries in the queue are causally ordered, otherwise two
+ * entries for the same location might get switched, resulting in the earlier one being
+ * committed and the later one ignored.
+ *
+ * `next_entry` is the index of the next entry to be filled, or `-1` if the queue is
+ * currently being drained.  Each entry has a state:
+ *
+ * `STAGE_ENTRY_FREE`: The entry is free.  Its data fields must be `NULL`.
+ *
+ * `STAGE_ENTRY_BUSY`: The entry is currently being filled in.
+ *
+ * `STAGE_ENTRY_USED`: The entry is completely filled in and must be processed in the next
+ * draining round.
+ *
+ * `STAGE_ENTRY_INVALID`: The entry was busy during queue draining and therefore
+ * invalidated.  Entries that are `BUSY` can obviously not be processed during a drain, but
+ * we can't leave them in place because new entries might be inserted before them, including
+ * from the same thread, violating causality.  An alternative would be not to reset
+ * `next_entry` to `0` after a drain, but to the index of the last `BUSY` entry plus one,
+ * but that can potentially waste the whole queue.
+ *
+ * State transitions:
+ *
+ * | from    | to      | filler? | drainer? |
+ * +---------+---------+---------+----------+
+ * | FREE    | BUSY    | X       |          |
+ * | BUSY    | FREE    | X       |          |
+ * | BUSY    | USED    | X       |          |
+ * | BUSY    | INVALID |         | X        |
+ * | USED    | FREE    |         | X        |
+ * | INVALID | FREE    | X       |          |
+ *
+ * `next_entry` can be incremented either by the filler thread that set the corresponding
+ * entry to `BUSY`, or by another filler thread that's trying to get a `FREE` slot.  If that
+ * other thread wasn't allowed to increment, it would block on the first filler thread.
+ *
+ * An entry's state, once it's set from `FREE` to `BUSY` by a filler thread, can only be
+ * changed by that same thread or by the drained.  The drainer can only set a `BUSY` thread
+ * to `INVALID`, so it needs to be set to `FREE` again by the original filler thread.
+ */
+
 #define STAGE_ENTRY_FREE       0
 #define STAGE_ENTRY_BUSY       1
 #define STAGE_ENTRY_USED       2
+#define STAGE_ENTRY_INVALID    3
 
 typedef struct {
-       gint32 state;
+       volatile gint32 state;
        MonoObject *obj;
        void *user_data;
 } StageEntry;
@@ -245,75 +300,217 @@ typedef struct {
 static volatile gint32 next_fin_stage_entry = 0;
 static StageEntry fin_stage_entries [NUM_FIN_STAGE_ENTRIES];
 
+/*
+ * This is used to lock the stage when processing is forced, i.e. when it's triggered by a
+ * garbage collection.  In that case, the world is already stopped and there's only one
+ * thread operating on the queue.
+ */
+static void
+lock_stage_for_processing (volatile gint32 *next_entry)
+{
+       *next_entry = -1;
+}
+
+/*
+ * When processing is triggered by an overflow, we don't want to take the GC lock
+ * immediately, and then set `next_index` to `-1`, because another thread might have drained
+ * the queue in the mean time.  Instead, we make sure the overflow is still there, we
+ * atomically set `next_index`, and only once that happened do we take the GC lock.
+ */
+static gboolean
+try_lock_stage_for_processing (int num_entries, volatile gint32 *next_entry)
+{
+       gint32 old = *next_entry;
+       if (old < num_entries)
+               return FALSE;
+       return InterlockedCompareExchange (next_entry, -1, old) == old;
+}
+
 /* LOCKING: requires that the GC lock is held */
 static void
-process_stage_entries (int num_entries, volatile gint32 *next_entry, StageEntry *entries, void (*process_func) (MonoObject*, void*))
+process_stage_entries (int num_entries, volatile gint32 *next_entry, StageEntry *entries, void (*process_func) (MonoObject*, void*, int))
 {
        int i;
-       int num_registered = 0;
-       int num_busy = 0;
+
+       /*
+        * This can happen if after setting `next_index` to `-1` in
+        * `try_lock_stage_for_processing()`, a GC was triggered, which then drained the
+        * queue and reset `next_entry`.
+        *
+        * We have the GC lock now, so if it's still `-1`, we can't be interrupted by a GC.
+        */
+       if (*next_entry != -1)
+               return;
 
        for (i = 0; i < num_entries; ++i) {
-               gint32 state = entries [i].state;
+               gint32 state;
 
-               if (state == STAGE_ENTRY_BUSY)
-                       ++num_busy;
+       retry:
+               state = entries [i].state;
 
-               if (state != STAGE_ENTRY_USED ||
-                               InterlockedCompareExchange (&entries [i].state, STAGE_ENTRY_BUSY, STAGE_ENTRY_USED) != STAGE_ENTRY_USED) {
+               switch (state) {
+               case STAGE_ENTRY_FREE:
+               case STAGE_ENTRY_INVALID:
+                       continue;
+               case STAGE_ENTRY_BUSY:
+                       /* BUSY -> INVALID */
+                       /*
+                        * This must be done atomically, because the filler thread can set
+                        * the entry to `USED`, in which case we must process it, so we must
+                        * detect that eventuality.
+                        */
+                       if (InterlockedCompareExchange (&entries [i].state, STAGE_ENTRY_INVALID, STAGE_ENTRY_BUSY) != STAGE_ENTRY_BUSY)
+                               goto retry;
                        continue;
+               case STAGE_ENTRY_USED:
+                       break;
+               default:
+                       SGEN_ASSERT (0, FALSE, "Invalid stage entry state");
+                       break;
                }
 
-               process_func (entries [i].obj, entries [i].user_data);
+               /* state is USED */
+
+               process_func (entries [i].obj, entries [i].user_data, i);
 
                entries [i].obj = NULL;
                entries [i].user_data = NULL;
 
                mono_memory_write_barrier ();
 
+               /* USED -> FREE */
+               /*
+                * This transition only happens here, so we don't have to do it atomically.
+                */
                entries [i].state = STAGE_ENTRY_FREE;
-
-               ++num_registered;
        }
 
-       *next_entry = 0;
+       mono_memory_write_barrier ();
 
-       /* g_print ("stage busy %d reg %d\n", num_busy, num_registered); */
+       *next_entry = 0;
 }
 
-static gboolean
+#ifdef HEAVY_STATISTICS
+static long long stat_overflow_abort = 0;
+static long long stat_wait_for_processing = 0;
+static long long stat_increment_other_thread = 0;
+static long long stat_index_decremented = 0;
+static long long stat_entry_invalidated = 0;
+static long long stat_success = 0;
+#endif
+
+static int
 add_stage_entry (int num_entries, volatile gint32 *next_entry, StageEntry *entries, MonoObject *obj, void *user_data)
 {
-       gint32 index;
-
-       do {
-               do {
-                       index = *next_entry;
-                       if (index >= num_entries)
-                               return FALSE;
-               } while (InterlockedCompareExchange (next_entry, index + 1, index) != index);
-
+       gint32 index, new_next_entry, old_next_entry;
+       gint32 previous_state;
+
+ retry:
+       for (;;) {
+               index = *next_entry;
+               if (index >= num_entries) {
+                       HEAVY_STAT (++stat_overflow_abort);
+                       return -1;
+               }
+               if (index < 0) {
+                       /*
+                        * Backed-off waiting is way more efficient than even using a
+                        * dedicated lock for this.
+                        */
+                       while ((index = *next_entry) < 0) {
+                               /*
+                                * This seems like a good value.  Determined by timing
+                                * sgen-weakref-stress.exe.
+                                */
+                               g_usleep (200);
+                               HEAVY_STAT (++stat_wait_for_processing);
+                       }
+                       continue;
+               }
+               /* FREE -> BUSY */
+               if (entries [index].state != STAGE_ENTRY_FREE ||
+                               InterlockedCompareExchange (&entries [index].state, STAGE_ENTRY_BUSY, STAGE_ENTRY_FREE) != STAGE_ENTRY_FREE) {
+                       /*
+                        * If we can't get the entry it must be because another thread got
+                        * it first.  We don't want to wait for that thread to increment
+                        * `next_entry`, so we try to do it ourselves.  Whether we succeed
+                        * or not, we start over.
+                        */
+                       if (*next_entry == index) {
+                               InterlockedCompareExchange (next_entry, index + 1, index);
+                               //g_print ("tried increment for other thread\n");
+                               HEAVY_STAT (++stat_increment_other_thread);
+                       }
+                       continue;
+               }
+               /* state is BUSY now */
+               mono_memory_write_barrier ();
                /*
-                * We don't need a write barrier here.  *next_entry is just a
-                * help for finding an index, its value is irrelevant for
-                * correctness.
+                * Incrementing `next_entry` must happen after setting the state to `BUSY`.
+                * If it were the other way around, it would be possible that after a filler
+                * incremented the index, other threads fill up the queue, the queue is
+                * drained, the original filler finally fills in the slot, but `next_entry`
+                * ends up at the start of the queue, and new entries are written in the
+                * queue in front of, not behind, the original filler's entry.
+                *
+                * We don't actually require that the CAS succeeds, but we do require that
+                * the value of `next_entry` is not lower than our index.  Since the drainer
+                * sets it to `-1`, that also takes care of the case that the drainer is
+                * currently running.
                 */
-       } while (entries [index].state != STAGE_ENTRY_FREE ||
-                       InterlockedCompareExchange (&entries [index].state, STAGE_ENTRY_BUSY, STAGE_ENTRY_FREE) != STAGE_ENTRY_FREE);
+               old_next_entry = InterlockedCompareExchange (next_entry, index + 1, index);
+               if (old_next_entry < index) {
+                       /* BUSY -> FREE */
+                       /* INVALID -> FREE */
+                       /*
+                        * The state might still be `BUSY`, or the drainer could have set it
+                        * to `INVALID`.  In either case, there's no point in CASing.  Set
+                        * it to `FREE` and start over.
+                        */
+                       entries [index].state = STAGE_ENTRY_FREE;
+                       HEAVY_STAT (++stat_index_decremented);
+                       continue;
+               }
+               break;
+       }
+
+       SGEN_ASSERT (0, index >= 0 && index < num_entries, "Invalid index");
 
        entries [index].obj = obj;
        entries [index].user_data = user_data;
 
        mono_memory_write_barrier ();
 
-       entries [index].state = STAGE_ENTRY_USED;
+       new_next_entry = *next_entry;
+       mono_memory_read_barrier ();
+       /* BUSY -> USED */
+       /*
+        * A `BUSY` entry will either still be `BUSY` or the drainer will have set it to
+        * `INVALID`.  In the former case, we set it to `USED` and we're finished.  In the
+        * latter case, we reset it to `FREE` and start over.
+        */
+       previous_state = InterlockedCompareExchange (&entries [index].state, STAGE_ENTRY_USED, STAGE_ENTRY_BUSY);
+       if (previous_state == STAGE_ENTRY_BUSY) {
+               SGEN_ASSERT (0, new_next_entry >= index || new_next_entry < 0, "Invalid next entry index - as long as we're busy, other thread can only increment or invalidate it");
+               HEAVY_STAT (++stat_success);
+               return index;
+       }
+
+       SGEN_ASSERT (0, previous_state == STAGE_ENTRY_INVALID, "Invalid state transition - other thread can only make busy state invalid");
+       entries [index].obj = NULL;
+       entries [index].user_data = NULL;
+       mono_memory_write_barrier ();
+       /* INVALID -> FREE */
+       entries [index].state = STAGE_ENTRY_FREE;
 
-       return TRUE;
+       HEAVY_STAT (++stat_entry_invalidated);
+
+       goto retry;
 }
 
 /* LOCKING: requires that the GC lock is held */
 static void
-process_fin_stage_entry (MonoObject *obj, void *user_data)
+process_fin_stage_entry (MonoObject *obj, void *user_data, int index)
 {
        if (ptr_in_nursery (obj))
                register_for_finalization (obj, user_data, GENERATION_NURSERY);
@@ -325,16 +522,19 @@ process_fin_stage_entry (MonoObject *obj, void *user_data)
 void
 sgen_process_fin_stage_entries (void)
 {
+       lock_stage_for_processing (&next_fin_stage_entry);
        process_stage_entries (NUM_FIN_STAGE_ENTRIES, &next_fin_stage_entry, fin_stage_entries, process_fin_stage_entry);
 }
 
 void
 mono_gc_register_for_finalization (MonoObject *obj, void *user_data)
 {
-       while (!add_stage_entry (NUM_FIN_STAGE_ENTRIES, &next_fin_stage_entry, fin_stage_entries, obj, user_data)) {
-               LOCK_GC;
-               sgen_process_fin_stage_entries ();
-               UNLOCK_GC;
+       while (add_stage_entry (NUM_FIN_STAGE_ENTRIES, &next_fin_stage_entry, fin_stage_entries, obj, user_data) == -1) {
+               if (try_lock_stage_for_processing (NUM_FIN_STAGE_ENTRIES, &next_fin_stage_entry)) {
+                       LOCK_GC;
+                       process_stage_entries (NUM_FIN_STAGE_ENTRIES, &next_fin_stage_entry, fin_stage_entries, process_fin_stage_entry);
+                       UNLOCK_GC;
+               }
        }
 }
 
@@ -478,7 +678,7 @@ sgen_null_link_in_range (int generation, gboolean before_finalization, ScanCopyC
                        if (!major_collector.is_object_live (object)) {
                                if (sgen_gc_is_object_ready_for_finalization (object)) {
                                        *link = NULL;
-                                       binary_protocol_dislink_update (link, NULL, 0);
+                                       binary_protocol_dislink_update (link, NULL, 0, 0);
                                        SGEN_LOG (5, "Dislink nullified at %p to GCed object %p", link, object);
                                        SGEN_HASH_TABLE_FOREACH_REMOVE (TRUE);
                                        continue;
@@ -500,14 +700,14 @@ sgen_null_link_in_range (int generation, gboolean before_finalization, ScanCopyC
                                                g_assert (copy);
                                                *link = HIDE_POINTER (copy, track);
                                                add_or_remove_disappearing_link ((MonoObject*)copy, link, GENERATION_OLD);
-                                               binary_protocol_dislink_update (link, copy, track);
+                                               binary_protocol_dislink_update (link, copy, track, 0);
 
                                                SGEN_LOG (5, "Upgraded dislink at %p to major because object %p moved to %p", link, object, copy);
 
                                                continue;
                                        } else {
                                                *link = HIDE_POINTER (copy, track);
-                                               binary_protocol_dislink_update (link, copy, track);
+                                               binary_protocol_dislink_update (link, copy, track, 0);
                                                SGEN_LOG (5, "Updated dislink at %p to %p", link, DISLINK_OBJECT (link));
                                        }
                                }
@@ -530,7 +730,7 @@ sgen_null_links_for_domain (MonoDomain *domain, int generation)
 
                        if (*link) {
                                *link = NULL;
-                               binary_protocol_dislink_update (link, NULL, 0);
+                               binary_protocol_dislink_update (link, NULL, 0, 0);
                                free = FALSE;
                                /*
                                 * This can happen if finalizers are not ran, i.e. Environment.Exit ()
@@ -563,7 +763,7 @@ sgen_null_links_with_predicate (int generation, WeakLinkAlivePredicateFunc predi
 
                if (!is_alive) {
                        *link = NULL;
-                       binary_protocol_dislink_update (link, NULL, 0);
+                       binary_protocol_dislink_update (link, NULL, 0, 0);
                        SGEN_LOG (5, "Dislink nullified by predicate at %p to GCed object %p", link, object);
                        SGEN_HASH_TABLE_FOREACH_REMOVE (TRUE);
                        continue;
@@ -592,10 +792,13 @@ sgen_remove_finalizers_for_domain (MonoDomain *domain, int generation)
 
 /* LOCKING: requires that the GC lock is held */
 static void
-process_dislink_stage_entry (MonoObject *obj, void *_link)
+process_dislink_stage_entry (MonoObject *obj, void *_link, int index)
 {
        void **link = _link;
 
+       if (index >= 0)
+               binary_protocol_dislink_process_staged (link, obj, index);
+
        add_or_remove_disappearing_link (NULL, link, GENERATION_NURSERY);
        add_or_remove_disappearing_link (NULL, link, GENERATION_OLD);
        if (obj) {
@@ -615,6 +818,7 @@ static StageEntry dislink_stage_entries [NUM_DISLINK_STAGE_ENTRIES];
 void
 sgen_process_dislink_stage_entries (void)
 {
+       lock_stage_for_processing (&next_dislink_stage_entry);
        process_stage_entries (NUM_DISLINK_STAGE_ENTRIES, &next_dislink_stage_entry, dislink_stage_entries, process_dislink_stage_entry);
 }
 
@@ -640,25 +844,43 @@ sgen_register_disappearing_link (MonoObject *obj, void **link, gboolean track, g
        else
                *link = NULL;
 
-       binary_protocol_dislink_update (link, obj, track);
-
 #if 1
        if (in_gc) {
-               process_dislink_stage_entry (obj, link);
+               binary_protocol_dislink_update (link, obj, track, 0);
+               process_dislink_stage_entry (obj, link, -1);
        } else {
-               while (!add_stage_entry (NUM_DISLINK_STAGE_ENTRIES, &next_dislink_stage_entry, dislink_stage_entries, obj, link)) {
-                       LOCK_GC;
-                       sgen_process_dislink_stage_entries ();
-                       UNLOCK_GC;
+               int index;
+               binary_protocol_dislink_update (link, obj, track, 1);
+               while ((index = add_stage_entry (NUM_DISLINK_STAGE_ENTRIES, &next_dislink_stage_entry, dislink_stage_entries, obj, link)) == -1) {
+                       if (try_lock_stage_for_processing (NUM_DISLINK_STAGE_ENTRIES, &next_dislink_stage_entry)) {
+                               LOCK_GC;
+                               process_stage_entries (NUM_DISLINK_STAGE_ENTRIES, &next_dislink_stage_entry, dislink_stage_entries, process_dislink_stage_entry);
+                               UNLOCK_GC;
+                       }
                }
+               binary_protocol_dislink_update_staged (link, obj, track, index);
        }
 #else
        if (!in_gc)
                LOCK_GC;
-       process_dislink_stage_entry (obj, link);
+       binary_protocol_dislink_update (link, obj, track, 0);
+       process_dislink_stage_entry (obj, link, -1);
        if (!in_gc)
                UNLOCK_GC;
 #endif
 }
 
+void
+sgen_init_fin_weak_hash (void)
+{
+#ifdef HEAVY_STATISTICS
+       mono_counters_register ("FinWeak Successes", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_success);
+       mono_counters_register ("FinWeak Overflow aborts", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_overflow_abort);
+       mono_counters_register ("FinWeak Wait for processing", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_wait_for_processing);
+       mono_counters_register ("FinWeak Increment other thread", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_increment_other_thread);
+       mono_counters_register ("FinWeak Index decremented", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_index_decremented);
+       mono_counters_register ("FinWeak Entry invalidated", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_entry_invalidated);
+#endif
+}
+
 #endif /* HAVE_SGEN_GC */
index 6012b34713222efbabd09694c756626c6985cef3..f19977ec37b64cb19dd5982ce2ac680d53e9a5c9 100644 (file)
@@ -1048,6 +1048,8 @@ mono_gc_clear_domain (MonoDomain * domain)
 
        LOCK_GC;
 
+       binary_protocol_domain_unload_begin (domain);
+
        sgen_stop_world (0);
 
        if (concurrent_collection_in_progress)
@@ -1116,6 +1118,8 @@ mono_gc_clear_domain (MonoDomain * domain)
 
        sgen_restart_world (0, NULL);
 
+       binary_protocol_domain_unload_end (domain);
+
        UNLOCK_GC;
 }
 
@@ -3259,6 +3263,9 @@ major_do_collection (const char *reason)
        TV_DECLARE (all_btv);
        int old_next_pin_slot;
 
+       if (disable_major_collections)
+               return FALSE;
+
        if (major_collector.get_and_reset_num_major_objects_marked) {
                long long num_marked = major_collector.get_and_reset_num_major_objects_marked ();
                g_assert (!num_marked);
@@ -3280,13 +3287,15 @@ major_do_collection (const char *reason)
        return bytes_pinned_from_failed_allocation > 0;
 }
 
-static gboolean major_do_collection (const char *reason);
-
 static void
 major_start_concurrent_collection (const char *reason)
 {
-       long long num_objects_marked = major_collector.get_and_reset_num_major_objects_marked ();
+       long long num_objects_marked;
 
+       if (disable_major_collections)
+               return;
+
+       num_objects_marked = major_collector.get_and_reset_num_major_objects_marked ();
        g_assert (num_objects_marked == 0);
 
        MONO_GC_CONCURRENT_START_BEGIN (GENERATION_OLD);
@@ -3386,6 +3395,9 @@ sgen_ensure_free_space (size_t size)
        sgen_perform_collection (size, generation_to_collect, reason, FALSE);
 }
 
+/*
+ * LOCKING: Assumes the GC lock is held.
+ */
 void
 sgen_perform_collection (size_t requested_size, int generation_to_collect, const char *reason, gboolean wait_to_finish)
 {
@@ -4869,6 +4881,7 @@ mono_gc_base_init (void)
        init_stats ();
        sgen_init_internal_allocator ();
        sgen_init_nursery_allocator ();
+       sgen_init_fin_weak_hash ();
 
        sgen_register_fixed_internal_mem_type (INTERNAL_MEM_SECTION, SGEN_SIZEOF_GC_MEM_SECTION);
        sgen_register_fixed_internal_mem_type (INTERNAL_MEM_FINALIZE_READY_ENTRY, sizeof (FinalizeReadyEntry));
index 8628764ac3871419274b237351615df733e3c341..deba1d93aefe4dc1736cf8192065855098c6389d 100644 (file)
@@ -768,6 +768,8 @@ const char* sgen_safe_name (void* obj) MONO_INTERNAL;
 
 gboolean sgen_object_is_live (void *obj) MONO_INTERNAL;
 
+void  sgen_init_fin_weak_hash (void) MONO_INTERNAL;
+
 gboolean sgen_need_bridge_processing (void) MONO_INTERNAL;
 void sgen_bridge_reset_data (void) MONO_INTERNAL;
 void sgen_bridge_processing_stw_step (void) MONO_INTERNAL;
index 51a9ccf3c9863f77f573a215829bc17ed64fada3..611d6f6bef8ff0d2142cc1d47572189a6ea97710 100644 (file)
@@ -368,12 +368,40 @@ binary_protocol_cement_reset (void)
 }
 
 void
-binary_protocol_dislink_update (gpointer link, gpointer obj, int track)
+binary_protocol_dislink_update (gpointer link, gpointer obj, int track, int staged)
 {
-       SGenProtocolDislinkUpdate entry = { link, obj, track };
+       SGenProtocolDislinkUpdate entry = { link, obj, track, staged };
        protocol_entry (SGEN_PROTOCOL_DISLINK_UPDATE, &entry, sizeof (SGenProtocolDislinkUpdate));
 }
 
+void
+binary_protocol_dislink_update_staged (gpointer link, gpointer obj, int track, int index)
+{
+       SGenProtocolDislinkUpdateStaged entry = { link, obj, track, index };
+       protocol_entry (SGEN_PROTOCOL_DISLINK_UPDATE_STAGED, &entry, sizeof (SGenProtocolDislinkUpdateStaged));
+}
+
+void
+binary_protocol_dislink_process_staged (gpointer link, gpointer obj, int index)
+{
+       SGenProtocolDislinkProcessStaged entry = { link, obj, index };
+       protocol_entry (SGEN_PROTOCOL_DISLINK_PROCESS_STAGED, &entry, sizeof (SGenProtocolDislinkProcessStaged));
+}
+
+void
+binary_protocol_domain_unload_begin (gpointer domain)
+{
+       SGenProtocolDomainUnload entry = { domain };
+       protocol_entry (SGEN_PROTOCOL_DOMAIN_UNLOAD_BEGIN, &entry, sizeof (SGenProtocolDomainUnload));
+}
+
+void
+binary_protocol_domain_unload_end (gpointer domain)
+{
+       SGenProtocolDomainUnload entry = { domain };
+       protocol_entry (SGEN_PROTOCOL_DOMAIN_UNLOAD_END, &entry, sizeof (SGenProtocolDomainUnload));
+}
+
 #endif
 
 #endif /* HAVE_SGEN_GC */
index 7b9dff67965e2b53183f9a6d20cfd18dad3aafef..18355075cbf4c34c0ada8769957c4a88046ddfea 100644 (file)
@@ -49,7 +49,11 @@ enum {
        SGEN_PROTOCOL_CARD_SCAN,
        SGEN_PROTOCOL_CEMENT,
        SGEN_PROTOCOL_CEMENT_RESET,
-       SGEN_PROTOCOL_DISLINK_UPDATE
+       SGEN_PROTOCOL_DISLINK_UPDATE,
+       SGEN_PROTOCOL_DISLINK_UPDATE_STAGED,
+       SGEN_PROTOCOL_DISLINK_PROCESS_STAGED,
+       SGEN_PROTOCOL_DOMAIN_UNLOAD_BEGIN,
+       SGEN_PROTOCOL_DOMAIN_UNLOAD_END
 };
 
 typedef struct {
@@ -167,8 +171,26 @@ typedef struct {
        gpointer link;
        gpointer obj;
        int track;
+       int staged;
 } SGenProtocolDislinkUpdate;
 
+typedef struct {
+       gpointer link;
+       gpointer obj;
+       int track;
+       int index;
+} SGenProtocolDislinkUpdateStaged;
+
+typedef struct {
+       gpointer link;
+       gpointer obj;
+       int index;
+} SGenProtocolDislinkProcessStaged;
+
+typedef struct {
+       gpointer domain;
+} SGenProtocolDomainUnload;
+
 /* missing: finalizers, dislinks, roots, non-store wbarriers */
 
 void binary_protocol_init (const char *filename) MONO_INTERNAL;
@@ -201,7 +223,11 @@ void binary_protocol_missing_remset (gpointer obj, gpointer obj_vtable, int offs
 void binary_protocol_card_scan (gpointer start, int size) MONO_INTERNAL;
 void binary_protocol_cement (gpointer ptr, gpointer vtable, int size) MONO_INTERNAL;
 void binary_protocol_cement_reset (void) MONO_INTERNAL;
-void binary_protocol_dislink_update (gpointer link, gpointer obj, int track) MONO_INTERNAL;
+void binary_protocol_dislink_update (gpointer link, gpointer obj, int track, int staged) MONO_INTERNAL;
+void binary_protocol_dislink_update_staged (gpointer link, gpointer obj, int track, int index) MONO_INTERNAL;
+void binary_protocol_dislink_process_staged (gpointer link, gpointer obj, int index) MONO_INTERNAL;
+void binary_protocol_domain_unload_begin (gpointer domain) MONO_INTERNAL;
+void binary_protocol_domain_unload_end (gpointer domain) MONO_INTERNAL;
 
 #else
 
@@ -232,6 +258,10 @@ void binary_protocol_dislink_update (gpointer link, gpointer obj, int track) MON
 #define binary_protocol_card_scan(start, size)
 #define binary_protocol_cement(ptr, vtable, size)
 #define binary_protocol_cement_reset()
-#define binary_protocol_dislink_update(link,obj,track)
+#define binary_protocol_dislink_update(link,obj,track,staged)
+#define binary_protocol_dislink_update_staged(link,obj,track,index)
+#define binary_protocol_dislink_process_staged(link,obj,index)
+#define binary_protocol_domain_unload_begin(domain)
+#define binary_protocol_domain_unload_end(domain)
 
 #endif
index 750ff2caccc4a0253dd40dfd24aba492575d749d..8723cf6187c52b5cb7fb9b7675e8a605e762906b 100644 (file)
@@ -26,7 +26,9 @@
 #include <errno.h>
 
 #include <sys/types.h>
-#ifndef HOST_WIN32 
+#ifdef HOST_WIN32
+#include <ws2tcpip.h>
+#else
 #include <sys/socket.h>
 #include <sys/ioctl.h>
 #include <netinet/in.h>
@@ -3137,7 +3139,7 @@ extern MonoBoolean ves_icall_System_Net_Dns_GetHostByAddr_internal(MonoString *a
        struct sockaddr_in6 saddr6;
        struct addrinfo *info = NULL, hints;
        gint32 family;
-       char hostname[1024] = {0};
+       char hostname[NI_MAXHOST] = {0};
        int flags = 0;
 #else
        struct in_addr inaddr;
index 811c2852045508e0e56656b8287d9b27b2a79d71..ccbcc6a7cbd5e361a5f531294f934f56a4a0f84d 100644 (file)
@@ -89,7 +89,7 @@ typedef struct {
 
        gint event_system;
        gpointer event_data;
-       void (*modify) (gpointer event_data, int fd, int operation, int events, gboolean is_new);
+       void (*modify) (gpointer p, int fd, int operation, int events, gboolean is_new);
        void (*wait) (gpointer sock_data);
        void (*shutdown) (gpointer event_data);
 } SocketIOData;
@@ -557,8 +557,7 @@ socket_io_add (MonoAsyncResult *ares, MonoSocketAsyncResult *state)
 
        mono_g_hash_table_replace (data->sock_to_state, state->handle, list);
        ievt = get_events_from_list (list);
-       LeaveCriticalSection (&data->io_lock);
-       data->modify (data->event_data, fd, state->operation, ievt, is_new);
+       data->modify (data, fd, state->operation, ievt, is_new);
 }
 
 #ifndef DISABLE_SOCKETS
index 172b5ddfeac3eb300afd6b9c91c60eda24b73684..2f7e36584a90ca2f1dab88a27a8040ff76696878 100644 (file)
@@ -831,16 +831,8 @@ __readfsdword (unsigned long long offset)
 void
 mono_thread_get_stack_bounds (guint8 **staddr, size_t *stsize)
 {
-#if defined(HAVE_PTHREAD_GET_STACKSIZE_NP) && defined(HAVE_PTHREAD_GET_STACKADDR_NP)
-       *staddr = (guint8*)pthread_get_stackaddr_np (pthread_self ());
-       *stsize = pthread_get_stacksize_np (pthread_self ());
-
-       /* staddr points to the start of the stack, not the end */
-       *staddr -= *stsize;
-       *staddr = (guint8*)((gssize)*staddr & ~(mono_pagesize () - 1));
-       return;
-       /* FIXME: simplify the mess below */
-#elif defined(HOST_WIN32)
+#if defined(HOST_WIN32)
+       /* Windows */
        /* http://en.wikipedia.org/wiki/Win32_Thread_Information_Block */
        void* tib = (void*)__readfsdword(0x18);
        guint8 *stackTop = (guint8*)*(int*)((char*)tib + 4);
@@ -849,7 +841,22 @@ mono_thread_get_stack_bounds (guint8 **staddr, size_t *stsize)
        *staddr = stackBottom;
        *stsize = stackTop - stackBottom;
        return;
-#else
+
+#elif defined(HAVE_PTHREAD_GET_STACKSIZE_NP) && defined(HAVE_PTHREAD_GET_STACKADDR_NP)
+       /* Mac OS X */
+       *staddr = (guint8*)pthread_get_stackaddr_np (pthread_self());
+       *stsize = pthread_get_stacksize_np (pthread_self());
+
+       /* staddr points to the start of the stack, not the end */
+       *staddr -= *stsize;
+
+       /* When running under emacs, sometimes staddr is not aligned to a page size */
+       *staddr = (guint8*)((gssize)*staddr & ~(mono_pagesize() - 1));
+       return;
+
+#elif (defined(HAVE_PTHREAD_GETATTR_NP) || defined(HAVE_PTHREAD_ATTR_GET_NP)) && defined(HAVE_PTHREAD_ATTR_GETSTACK)
+       /* Linux, BSD */
+
        pthread_attr_t attr;
        guint8 *current = (guint8*)&attr;
 
@@ -857,15 +864,41 @@ mono_thread_get_stack_bounds (guint8 **staddr, size_t *stsize)
        *stsize = (size_t)-1;
 
        pthread_attr_init (&attr);
-#  ifdef HAVE_PTHREAD_GETATTR_NP
+
+#if     defined(HAVE_PTHREAD_GETATTR_NP)
+       /* Linux */
        pthread_getattr_np (pthread_self(), &attr);
-#  else
-#    ifdef HAVE_PTHREAD_ATTR_GET_NP
+
+#elif   defined(HAVE_PTHREAD_ATTR_GET_NP)
+       /* BSD */
        pthread_attr_get_np (pthread_self(), &attr);
-#    elif defined(sun)
+
+#else
+#error         Cannot determine which API is needed to retrieve pthread attributes.
+#endif
+
+       pthread_attr_getstack (&attr, (void**)staddr, stsize);
+       pthread_attr_destroy (&attr);
+
+       if (*staddr)
+               g_assert ((current > *staddr) && (current < *staddr + *stsize));
+
+       /* When running under emacs, sometimes staddr is not aligned to a page size */
+       *staddr = (guint8*)((gssize)*staddr & ~(mono_pagesize () - 1));
+       return;
+
+#elif defined(__OpenBSD__)
+       /* OpenBSD */
+       /* TODO :   Determine if this code is actually still needed. It may already be covered by the case above. */
+
+       pthread_attr_t attr;
+       guint8 *current = (guint8*)&attr;
+
        *staddr = NULL;
-       pthread_attr_getstacksize (&attr, &stsize);
-#    elif defined(__OpenBSD__)
+       *stsize = (size_t)-1;
+
+       pthread_attr_init (&attr);
+
        stack_t ss;
        int rslt;
 
@@ -874,29 +907,33 @@ mono_thread_get_stack_bounds (guint8 **staddr, size_t *stsize)
 
        *staddr = (guint8*)((size_t)ss.ss_sp - ss.ss_size);
        *stsize = ss.ss_size;
-#    else
-       *staddr = NULL;
-       *stsize = 0;
-       return;
-#    endif
-#  endif
 
-#  if !defined(sun)
-#    if defined(__native_client__)
-       *staddr = NULL;
-       pthread_attr_getstacksize (&attr, &stsize);
-#    elif !defined(__OpenBSD__)
-       pthread_attr_getstack (&attr, (void**)staddr, stsize);
-#    endif
+       pthread_attr_destroy (&attr);
+
        if (*staddr)
                g_assert ((current > *staddr) && (current < *staddr + *stsize));
-#  endif
-
-       pthread_attr_destroy (&attr);
-#endif
 
        /* When running under emacs, sometimes staddr is not aligned to a page size */
        *staddr = (guint8*)((gssize)*staddr & ~(mono_pagesize () - 1));
+       return;
+
+#elif defined(sun) || defined(__native_client__)
+       /* Solaris/Illumos, NaCl */
+       pthread_attr_t attr;
+       pthread_attr_init (&attr);
+       pthread_attr_getstacksize (&attr, &stsize);
+       pthread_attr_destroy (&attr);
+       *staddr = NULL;
+       return;
+
+#else
+       /* FIXME:   It'd be better to use the 'error' preprocessor macro here so we know
+                   at compile-time if the target platform isn't supported. */
+#warning "Unable to determine how to retrieve a thread's stack-bounds for this platform in 'mono_thread_get_stack_bounds()'."
+       *staddr = NULL;
+       *stsize = 0;
+       return;
+#endif
 }
 
 MonoThread *
index a82afefadf1521df3f9763cb665dd299681d8fd9..82e0bfe8a353c4834440cc37c7916aaa60c732fb 100644 (file)
@@ -15,7 +15,7 @@ struct _tp_epoll_data {
 };
 
 typedef struct _tp_epoll_data tp_epoll_data;
-static void tp_epoll_modify (gpointer event_data, int fd, int operation, int events, gboolean is_new);
+static void tp_epoll_modify (gpointer p, int fd, int operation, int events, gboolean is_new);
 static void tp_epoll_shutdown (gpointer event_data);
 static void tp_epoll_wait (gpointer event_data);
 
@@ -51,9 +51,11 @@ tp_epoll_init (SocketIOData *data)
 }
 
 static void
-tp_epoll_modify (gpointer event_data, int fd, int operation, int events, gboolean is_new)
+tp_epoll_modify (gpointer p, int fd, int operation, int events, gboolean is_new)
 {
-       tp_epoll_data *data = event_data;
+       SocketIOData *socket_io_data;
+       socket_io_data = p;
+       tp_epoll_data *data = socket_io_data->event_data;
        struct epoll_event evt;
        int epoll_op;
 
@@ -74,6 +76,7 @@ tp_epoll_modify (gpointer event_data, int fd, int operation, int events, gboolea
                        }
                }
        }
+       LeaveCriticalSection (&socket_io_data->io_lock);
 }
 
 static void
index 22d21a37a7bdebb59340cb1f967d1f16b9043d67..cb86774400c7c8ab284c012dc4557ba15c176825 100644 (file)
@@ -12,7 +12,7 @@ struct _tp_kqueue_data {
 };
 
 typedef struct _tp_kqueue_data tp_kqueue_data;
-static void tp_kqueue_modify (gpointer event_data, int fd, int operation, int events, gboolean is_new);
+static void tp_kqueue_modify (gpointer p, int fd, int operation, int events, gboolean is_new);
 static void tp_kqueue_shutdown (gpointer event_data);
 static void tp_kqueue_wait (gpointer event_data);
 
@@ -42,9 +42,11 @@ kevent_change (int kfd, struct kevent *evt, const char *error_str)
 }
 
 static void
-tp_kqueue_modify (gpointer event_data, int fd, int operation, int events, gboolean is_new)
+tp_kqueue_modify (gpointer p, int fd, int operation, int events, gboolean is_new)
 {
-       tp_kqueue_data *data = event_data;
+       SocketIOData *socket_io_data;
+       socket_io_data = p;
+       tp_kqueue_data *data = socket_io_data->event_data;
        struct kevent evt;
 
        memset (&evt, 0, sizeof (evt));
@@ -57,6 +59,7 @@ tp_kqueue_modify (gpointer event_data, int fd, int operation, int events, gboole
                EV_SET (&evt, fd, EVFILT_WRITE, EV_ADD | EV_ENABLE | EV_ONESHOT, 0, 0, 0);
                kevent_change (data->fd, &evt, "ADD write");
        }
+       LeaveCriticalSection (&socket_io_data->io_lock);
 }
 
 static void
index e03eca5248cc4c4a0f36bb374064bf2eebab1258..7bc9b27f64af6d2e7b1477726a5926fc18413e55 100644 (file)
@@ -19,7 +19,7 @@ struct _tp_poll_data {
 typedef struct _tp_poll_data tp_poll_data;
 
 static void tp_poll_shutdown (gpointer event_data);
-static void tp_poll_modify (gpointer event_data, int fd, int operation, int events, gboolean is_new);
+static void tp_poll_modify (gpointer p, int fd, int operation, int events, gboolean is_new);
 static void tp_poll_wait (gpointer p);
 
 static gpointer
@@ -74,12 +74,18 @@ tp_poll_init (SocketIOData *data)
 }
 
 static void
-tp_poll_modify (gpointer event_data, int fd, int operation, int events, gboolean is_new)
+tp_poll_modify (gpointer p, int fd, int operation, int events, gboolean is_new)
 {
-       tp_poll_data *data = event_data;
+       SocketIOData *socket_io_data;
+       tp_poll_data *data;
        char msg [1];
        int unused;
 
+       socket_io_data = p;
+       data = socket_io_data->event_data;
+
+       LeaveCriticalSection (&socket_io_data->io_lock);
+       
        MONO_SEM_WAIT (&data->new_sem);
        INIT_POLLFD (&data->newpfd, GPOINTER_TO_INT (fd), events);
        *msg = (char) operation;
index 8a85f25bc9b19d25653135832d532e6448c10491..6d694bc2957dfc692be3108bf3c3aeb5b2c53528 100644 (file)
@@ -28,5 +28,6 @@
 /buildver.h
 /TAGS
 /mono-sgen
+/mono-boehm
 /buildver-sgen.h
-
+/buildver-boehm.h
index 53128de3c30e8165b1115186789c4b9aebcedbd9..eb34e4e7024ae49f542950d73e3057e5d5dd8d89 100644 (file)
@@ -118,7 +118,7 @@ mono: mono-$(mono_bin_suffix)
        ln -sf $< $@
 
 install-exec-hook:
-       ln -sf $(DESTDIR)$(bindir)/mono-$(libmono_suffix) $(DESTDIR)$(bindir)/mono
+       (cd $(DESTDIR)$(bindir) && ln -sf mono-$(mono_bin_suffix) mono)
        (cd $(DESTDIR)$(libdir); for i in libmono$(libmono_suffix)*; do ln -sf $$i `echo $$i | sed s/$(libmono_suffix)//` ; done)
 endif
 
@@ -524,7 +524,7 @@ arch_built=cpu-sparc.h
 arch_define=__sparc__
 endif
 
-if S390x
+if S390X
 arch_sources = $(s390x_sources)
 arch_built=cpu-s390x.h
 arch_define=__s390__
@@ -787,3 +787,9 @@ patch-automake:
 
 tags:
        etags -o TAGS `find .. -name "*.h" -o -name "*.c"`
+
+if HAS_EXTENSION_MODULE
+else
+Makefile.am: Makefile.am.in
+       cp $< $@
+endif
index 032f344e4a8395bf62e7654716e03676c732ca38..c01aaf49b0b79eddd5704b82f68ede87577dab5b 100644 (file)
@@ -2596,6 +2596,8 @@ encode_method_ref (MonoAotCompile *acfg, MonoMethod *method, guint8 *buf, guint8
                                encode_klass_ref (acfg, method->klass, p, &p);
                        else if (info->subtype == WRAPPER_SUBTYPE_SYNCHRONIZED_INNER)
                                encode_method_ref (acfg, info->d.synchronized_inner.method, p, &p);
+                       else if (info->subtype == WRAPPER_SUBTYPE_ARRAY_ACCESSOR)
+                               encode_method_ref (acfg, info->d.array_accessor.method, p, &p);
                        break;
                }
                case MONO_WRAPPER_MANAGED_TO_NATIVE: {
@@ -3160,6 +3162,8 @@ create_gsharedvt_inst (MonoAotCompile *acfg, MonoMethod *method, MonoGenericCont
        }
 }
 
+#define MONO_TYPE_IS_PRIMITIVE(t) ((!(t)->byref && ((((t)->type >= MONO_TYPE_BOOLEAN && (t)->type <= MONO_TYPE_R8) || ((t)->type >= MONO_TYPE_I && (t)->type <= MONO_TYPE_U)))))
+
 static void
 add_wrappers (MonoAotCompile *acfg)
 {
@@ -3479,13 +3483,62 @@ add_wrappers (MonoAotCompile *acfg)
                }
        }
 
+       /* array access wrappers */
+       for (i = 0; i < acfg->image->tables [MONO_TABLE_TYPESPEC].rows; ++i) {
+               MonoClass *klass;
+               
+               token = MONO_TOKEN_TYPE_SPEC | (i + 1);
+               klass = mono_class_get (acfg->image, token);
+
+               if (!klass) {
+                       mono_loader_clear_error ();
+                       continue;
+               }
+
+               if (klass->rank && MONO_TYPE_IS_PRIMITIVE (&klass->element_class->byval_arg)) {
+                       MonoMethod *m, *wrapper;
+
+                       /* Add runtime-invoke wrappers too */
+
+                       m = mono_class_get_method_from_name (klass, "Get", -1);
+                       g_assert (m);
+                       wrapper = mono_marshal_get_array_accessor_wrapper (m);
+                       add_extra_method (acfg, wrapper);
+                       add_extra_method (acfg, mono_marshal_get_runtime_invoke (wrapper, FALSE));
+
+                       m = mono_class_get_method_from_name (klass, "Set", -1);
+                       g_assert (m);
+                       wrapper = mono_marshal_get_array_accessor_wrapper (m);
+                       add_extra_method (acfg, wrapper);
+                       add_extra_method (acfg, mono_marshal_get_runtime_invoke (wrapper, FALSE));
+               }
+       }
+
        /* Synchronized wrappers */
        for (i = 0; i < acfg->image->tables [MONO_TABLE_METHOD].rows; ++i) {
                token = MONO_TOKEN_METHOD_DEF | (i + 1);
                method = mono_get_method (acfg->image, token, NULL);
 
-               if (method->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED && !method->is_generic)
-                       add_method (acfg, mono_marshal_get_synchronized_wrapper (method));
+               if (method->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED) {
+                       if (method->is_generic) {
+                               // FIXME:
+                       } else if (method->klass->generic_container) {
+                               MonoGenericContext ctx;
+                               MonoMethod *inst, *gshared, *m;
+
+                               /*
+                                * Create a generic wrapper for a generic instance, and AOT that.
+                                */
+                               create_gsharedvt_inst (acfg, method, &ctx);
+                               inst = mono_class_inflate_generic_method (method, &ctx);        
+                               m = mono_marshal_get_synchronized_wrapper (inst);
+                               g_assert (m->is_inflated);
+                               gshared = mini_get_shared_method_full (m, FALSE, TRUE);
+                               add_method (acfg, gshared);
+                       } else {
+                               add_method (acfg, mono_marshal_get_synchronized_wrapper (method));
+                       }
+               }
        }
 
        /* pinvoke wrappers */
@@ -4365,7 +4418,7 @@ get_file_index (MonoAotCompile *acfg, const char *source_file)
                findex = g_hash_table_size (acfg->dwarf_ln_filenames) + 1;
                g_hash_table_insert (acfg->dwarf_ln_filenames, g_strdup (source_file), GINT_TO_POINTER (findex));
                emit_unset_mode (acfg);
-               fprintf (acfg->fp, ".file %d \"%s\"\n", findex, source_file);
+               fprintf (acfg->fp, ".file %d \"%s\"\n", findex, mono_dwarf_escape_path (source_file));
        }
        return findex;
 }
@@ -5713,6 +5766,14 @@ emit_trampolines (MonoAotCompile *acfg)
                 */
                for (tramp_type = 0; tramp_type < MONO_TRAMPOLINE_NUM; ++tramp_type) {
                        /* we overload the boolean here to indicate the slightly different trampoline needed, see mono_arch_create_generic_trampoline() */
+#ifdef DISABLE_REMOTING
+                       if (tramp_type == MONO_TRAMPOLINE_GENERIC_VIRTUAL_REMOTING)
+                               continue;
+#endif
+#ifndef MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD
+                       if (tramp_type == MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD)
+                               continue;
+#endif
                        mono_arch_create_generic_trampoline (tramp_type, &info, acfg->aot_opts.use_trampolines_page? 2: TRUE);
                        emit_trampoline (acfg, acfg->got_offset, info);
                }
@@ -6165,6 +6226,7 @@ can_encode_method (MonoAotCompile *acfg, MonoMethod *method)
                        case MONO_WRAPPER_DELEGATE_INVOKE:
                        case MONO_WRAPPER_DELEGATE_BEGIN_INVOKE:
                        case MONO_WRAPPER_DELEGATE_END_INVOKE:
+                       case MONO_WRAPPER_SYNCHRONIZED:
                                break;
                        case MONO_WRAPPER_MANAGED_TO_MANAGED:
                        case MONO_WRAPPER_CASTCLASS: {
@@ -6775,7 +6837,7 @@ emit_llvm_file (MonoAotCompile *acfg)
        opts = g_strdup ("-instcombine -simplifycfg");
        opts = g_strdup ("-simplifycfg -domtree -domfrontier -scalarrepl -instcombine -simplifycfg -domtree -domfrontier -scalarrepl -simplify-libcalls -instcombine -simplifycfg -instcombine -simplifycfg -reassociate -domtree -loops -loop-simplify -domfrontier -loop-simplify -lcssa -loop-rotate -licm -lcssa -loop-unswitch -instcombine -scalar-evolution -loop-simplify -lcssa -iv-users -indvars -loop-deletion -loop-simplify -lcssa -loop-unroll -instcombine -memdep -gvn -memdep -memcpyopt -sccp -instcombine -domtree -memdep -dse -adce -simplifycfg -preverify -domtree -verify");
 #if 1
-       command = g_strdup_printf ("%sopt -f %s -o %s.opt.bc %s.bc", acfg->aot_opts.llvm_path, opts, acfg->tmpfname, acfg->tmpfname);
+       command = g_strdup_printf ("%sopt -f %s -o \"%s.opt.bc\" \"%s.bc\"", acfg->aot_opts.llvm_path, opts, acfg->tmpfname, acfg->tmpfname);
        printf ("Executing opt: %s\n", command);
        if (system (command) != 0) {
                exit (1);
@@ -6803,7 +6865,7 @@ emit_llvm_file (MonoAotCompile *acfg)
 #endif
        unlink (acfg->tmpfname);
 
-       command = g_strdup_printf ("%sllc %s -disable-gnu-eh-frame -enable-mono-eh-frame -o %s %s.opt.bc", acfg->aot_opts.llvm_path, acfg->llc_args->str, acfg->tmpfname, acfg->tmpfname);
+       command = g_strdup_printf ("%sllc %s -disable-gnu-eh-frame -enable-mono-eh-frame -o \"%s\" \"%s.opt.bc\"", acfg->aot_opts.llvm_path, acfg->llc_args->str, acfg->tmpfname, acfg->tmpfname);
 
        printf ("Executing llc: %s\n", command);
 
@@ -6938,7 +7000,7 @@ emit_code (MonoAotCompile *acfg)
                 * This is PIE code, and the linker can update it if needed.
                 */
                sprintf (symbol, "method_addresses");
-               emit_section_change (acfg, RODATA_SECT, 1);
+               emit_section_change (acfg, ".text", 1);
                emit_alignment (acfg, 8);
                emit_label (acfg, symbol);
                emit_local_symbol (acfg, symbol, "method_addresses_end", TRUE);
@@ -7004,7 +7066,10 @@ emit_code (MonoAotCompile *acfg)
 
        /* Emit a sorted table mapping methods to their unbox trampolines */
        sprintf (symbol, "unbox_trampolines");
-       emit_section_change (acfg, RODATA_SECT, 1);
+       if (acfg->direct_method_addresses)
+               emit_section_change (acfg, ".text", 0);
+       else
+               emit_section_change (acfg, RODATA_SECT, 0);
        emit_alignment (acfg, 8);
        emit_label (acfg, symbol);
 
@@ -7325,6 +7390,7 @@ emit_extra_methods (MonoAotCompile *acfg)
                value = get_method_index (acfg, method);
 
                hash = mono_aot_method_hash (method) % table_size;
+               //printf ("X: %s %d\n", mono_method_full_name (method, 1), hash);
 
                chain_lengths [hash] ++;
                max_chain_length = MAX (max_chain_length, chain_lengths [hash]);
@@ -7962,6 +8028,7 @@ emit_file_info (MonoAotCompile *acfg)
        emit_int32 (acfg, __alignof__ (double));
        emit_int32 (acfg, __alignof__ (gint64));
 #endif
+       emit_int32 (acfg, MONO_TRAMPOLINE_NUM);
 
        if (acfg->aot_opts.static_link) {
                char *p;
index 6d93b6ce3037aae57a48c85a54ae9b72e4301d35..03876f10107caa0226764bdcdd26ae93a5aa55bf 100644 (file)
@@ -908,6 +908,12 @@ decode_method_ref_with_target (MonoAotModule *module, MethodRef *ref, MonoMethod
                                if (!m)
                                        return FALSE;
                                ref->method = mono_marshal_get_synchronized_inner_wrapper (m);
+                       } else if (subtype == WRAPPER_SUBTYPE_ARRAY_ACCESSOR) {
+                               MonoMethod *m = decode_resolve_method_ref (module, p, &p);
+
+                               if (!m)
+                                       return FALSE;
+                               ref->method = mono_marshal_get_array_accessor_wrapper (m);
                        } else if (subtype == WRAPPER_SUBTYPE_GSHAREDVT_IN) {
                                ref->method = mono_marshal_get_gsharedvt_in_wrapper ();
                        } else if (subtype == WRAPPER_SUBTYPE_GSHAREDVT_OUT) {
@@ -1640,6 +1646,7 @@ load_aot_module (MonoAssembly *assembly, gpointer user_data)
        /* Sanity check */
        g_assert (info->double_align == align_double);
        g_assert (info->long_align == align_int64);
+       g_assert (info->generic_tramp_num == MONO_TRAMPOLINE_NUM);
 
        blob = info->blob;
 
@@ -2186,11 +2193,13 @@ decode_llvm_mono_eh_frame (MonoAotModule *amodule, MonoDomain *domain,
        }
 
        code_start = amodule->code + amodule->code_offsets [table [(pos * 2)]];
-       if (pos + 1 == fde_count)
-               /* End of table */
-               code_end = amodule->code_end;
-       else
+       if (pos + 1 == fde_count) {
+               /* The +1 entry in the table contains the length of the last method */
+               int len = table [(pos + 1) * 2];
+               code_end = code_start + len;
+       } else {
                code_end = amodule->code + amodule->code_offsets [table [(pos + 1) * 2]];
+       }
        code_len = code_end - code_start;
 
        g_assert (code >= code_start && code < code_end);
index 9598aa735cb3f18b51138b53a1e4b028c811b285..f38d05319b2492b431dc551529aeadee3af821f7 100644 (file)
@@ -766,7 +766,31 @@ class Tests
             test[x+100,y+100] = true;
         }
                return 0;
-       }               
+       }
+
+       static bool alloc_long (long l) {
+               try {
+                       var arr = new byte[l];
+                       return false;
+               } catch (Exception e) {
+                       return true;
+               }
+       }
+
+       // #13544
+       public static int test_0_newarr_ovf () {
+               if (!alloc_long (5000000000))
+                       return 1;
+               if (!alloc_long (4000000000))
+                       return 2;
+               if (!alloc_long (-1))
+                       return 3;
+               if (!alloc_long (-4000000000))
+                       return 4;
+               if (!alloc_long (-6000000000))
+                       return 5;
+               return 0;
+       }
 }
 
 
index 968822a88ce5987e9fd315e4ec6322934fa1c9d8..41c1b5840c2fbac384d03e8b5360888cb1ae1571 100644 (file)
@@ -177,7 +177,7 @@ not_null: src1:i len:0
 # 32 bit opcodes
 int_add: dest:i src1:i src2:i len:4
 int_sub: dest:i src1:i src2:i len:4
-int_mul: dest:i src1:i src2:i len:4
+int_mul: dest:i src1:i src2:i len:16
 int_div: dest:i src1:i src2:i len:84
 int_div_un: dest:i src1:i src2:i len:40
 int_rem: dest:i src1:i src2:i len:84
@@ -278,7 +278,7 @@ icompare_imm: src1:i len:12
 # 64 bit opcodes
 long_add: dest:i src1:i src2:i len:4
 long_sub: dest:i src1:i src2:i len:4
-long_mul: dest:i src1:i src2:i len:8
+long_mul: dest:i src1:i src2:i len:32
 long_mul_imm: dest:i src1:i len:4
 long_div: dest:i src1:i src2:i len:40
 long_div_un: dest:i src1:i src2:i len:16
index 42c415e0e1064e2243c5dce4fb2140f30c8c6ae7..778b7c51830b8df9929427c550b4b6e379a34382 100644 (file)
@@ -2207,7 +2207,17 @@ buffer_add_ptr_id (Buffer *buf, MonoDomain *domain, IdType type, gpointer val)
 static inline MonoClass*
 decode_typeid (guint8 *buf, guint8 **endbuf, guint8 *limit, MonoDomain **domain, int *err)
 {
-       return decode_ptr_id (buf, endbuf, limit, ID_TYPE, domain, err);
+       MonoClass *klass;
+
+       klass = decode_ptr_id (buf, endbuf, limit, ID_TYPE, domain, err);
+       if (G_UNLIKELY (log_level >= 2) && klass) {
+               char *s;
+
+               s = mono_type_full_name (&klass->byval_arg);
+               DEBUG(2, fprintf (log_file, "[dbg]   recv class [%s]\n", s));
+               g_free (s);
+       }
+       return klass;
 }
 
 static inline MonoAssembly*
@@ -2250,12 +2260,29 @@ static inline void
 buffer_add_typeid (Buffer *buf, MonoDomain *domain, MonoClass *klass)
 {
        buffer_add_ptr_id (buf, domain, ID_TYPE, klass);
+       if (G_UNLIKELY (log_level >= 2) && klass) {
+               char *s;
+
+               s = mono_type_full_name (&klass->byval_arg);
+               if (GetCurrentThreadId () == debugger_thread_id)
+                       DEBUG(2, fprintf (log_file, "[dbg]   send class [%s]\n", s));
+               else
+                       DEBUG(2, fprintf (log_file, "[%p]   send class [%s]\n", (gpointer)GetCurrentThreadId (), s));
+               g_free (s);
+       }
 }
 
 static inline void
 buffer_add_methodid (Buffer *buf, MonoDomain *domain, MonoMethod *method)
 {
        buffer_add_ptr_id (buf, domain, ID_METHOD, method);
+       if (G_UNLIKELY (log_level >= 2) && method) {
+               char *s;
+
+               s = mono_method_full_name (method, 1);
+               DEBUG(2, fprintf (log_file, "[dbg]   send method [%s]\n", s));
+               g_free (s);
+       }
 }
 
 static inline void
@@ -4383,6 +4410,45 @@ clear_breakpoints_for_domain (MonoDomain *domain)
        mono_loader_unlock ();
 }
 
+/*
+ * ss_update:
+ *
+ * Return FALSE if single stepping needs to continue because we are at the same line.
+ */
+static gboolean
+ss_update (SingleStepReq *req, MonoJitInfo *ji, SeqPoint *sp)
+{
+       MonoDebugMethodInfo *minfo;
+       MonoDebugSourceLocation *loc = NULL;
+       gboolean hit = TRUE;
+
+       if (req->size != STEP_SIZE_LINE)
+               return TRUE;
+
+       /* Have to check whenever a different source line was reached */
+       minfo = mono_debug_lookup_method (ji->method);
+
+       if (minfo)
+               loc = mono_debug_symfile_lookup_location (minfo, sp->il_offset);
+
+       if (!loc || (loc && ji->method == ss_req->last_method && loc->row == ss_req->last_line)) {
+               /* Have to continue single stepping */
+               if (!loc)
+                       DEBUG(1, fprintf (log_file, "[%p] No line number info for il offset %x, continuing single stepping.\n", (gpointer)GetCurrentThreadId (), sp->il_offset));
+               else
+                       DEBUG(1, fprintf (log_file, "[%p] Same source line (%d), continuing single stepping.\n", (gpointer)GetCurrentThreadId (), loc->row));
+               hit = FALSE;
+       }
+                               
+       if (loc) {
+               ss_req->last_method = ji->method;
+               ss_req->last_line = loc->row;
+               mono_debug_free_source_location (loc);
+       }
+
+       return hit;
+}
+
 static gboolean
 breakpoint_matches_assembly (MonoBreakpoint *bp, MonoAssembly *assembly)
 {
@@ -4470,31 +4536,9 @@ process_breakpoint_inner (DebuggerTlsData *tls)
        for (i = 0; i < ss_reqs_orig->len; ++i) {
                EventRequest *req = g_ptr_array_index (ss_reqs_orig, i);
                SingleStepReq *ss_req = req->info;
-               gboolean hit = TRUE;
-
-               if (ss_req->size == STEP_SIZE_LINE) {
-                       /* Have to check whenever a different source line was reached */
-                       MonoDebugMethodInfo *minfo;
-                       MonoDebugSourceLocation *loc = NULL;
-
-                       minfo = mono_debug_lookup_method (ji->method);
-
-                       if (minfo)
-                               loc = mono_debug_symfile_lookup_location (minfo, sp->il_offset);
-
-                       if (!loc || (loc && ji->method == ss_req->last_method && loc->row == ss_req->last_line)) {
-                               /* Have to continue single stepping */
-                               DEBUG(1, fprintf (log_file, "[%p] Same source line, continuing single stepping.\n", (gpointer)GetCurrentThreadId ()));
-                               hit = FALSE;
-                       }
-                               
-                       if (loc) {
-                               ss_req->last_method = ji->method;
-                               ss_req->last_line = loc->row;
-                               mono_debug_free_source_location (loc);
-                       }
-               }
+               gboolean hit;
 
+               hit = ss_update (ss_req, ji, sp);
                if (hit)
                        g_ptr_array_add (ss_reqs, req);
 
@@ -4713,41 +4757,8 @@ process_single_step_inner (DebuggerTlsData *tls)
                return;
        il_offset = sp->il_offset;
 
-       // FIXME: No tests fail if this is disabled
-#if 0
-       if (ss_req->size == STEP_SIZE_LINE) {
-               // FIXME:
-               NOT_IMPLEMENTED;
-
-               /* Step until a different source line is reached */
-               MonoDebugMethodInfo *minfo;
-
-               minfo = mono_debug_lookup_method (ji->method);
-
-               if (minfo) {
-                       MonoDebugSourceLocation *loc = mono_debug_symfile_lookup_location (minfo, il_offset);
-
-                       if (loc && ji->method == ss_req->last_method && loc->row == ss_req->last_line) {
-                               mono_debug_free_source_location (loc);
-                               return;
-                       }
-                       if (!loc)
-                               /*
-                                * Step until we reach a location with line number info, 
-                                * otherwise the client can't show a location.
-                                * This can happen for example with statics initialized inline
-                                * outside of a cctor.
-                                */
-                               return;
-
-                       if (loc) {
-                               ss_req->last_method = ji->method;
-                               ss_req->last_line = loc->row;
-                               mono_debug_free_source_location (loc);
-                       }
-               }
-       }
-#endif
+       if (!ss_update (ss_req, ji, sp))
+               return;
 
        /* Start single stepping again from the current sequence point */
        ss_start (ss_req, ji->method, sp, info, ctx, tls, FALSE);
@@ -5581,6 +5592,49 @@ obj_is_of_type (MonoObject *obj, MonoType *t)
 static ErrorCode
 decode_value (MonoType *t, MonoDomain *domain, guint8 *addr, guint8 *buf, guint8 **endbuf, guint8 *limit);
 
+static ErrorCode
+decode_vtype (MonoType *t, MonoDomain *domain, guint8 *addr, guint8 *buf, guint8 **endbuf, guint8 *limit)
+{
+       gboolean is_enum;
+       MonoClass *klass;
+       MonoClassField *f;
+       int nfields;
+       gpointer iter = NULL;
+       MonoDomain *d;
+       int err;
+
+       is_enum = decode_byte (buf, &buf, limit);
+       /* Enums are sent as a normal vtype */
+       if (is_enum)
+               return ERR_NOT_IMPLEMENTED;
+       klass = decode_typeid (buf, &buf, limit, &d, &err);
+       if (err)
+               return err;
+
+       if (t && klass != mono_class_from_mono_type (t)) {
+               char *name = mono_type_full_name (t);
+               char *name2 = mono_type_full_name (&klass->byval_arg);
+               DEBUG(1, fprintf (log_file, "[%p] Expected value of type %s, got %s.\n", (gpointer)GetCurrentThreadId (), name, name2));
+               g_free (name);
+               g_free (name2);
+               return ERR_INVALID_ARGUMENT;
+       }
+
+       nfields = decode_int (buf, &buf, limit);
+       while ((f = mono_class_get_fields (klass, &iter))) {
+               if (f->type->attrs & FIELD_ATTRIBUTE_STATIC)
+                       continue;
+               if (mono_field_is_deleted (f))
+                       continue;
+               err = decode_value (f->type, domain, (guint8*)addr + f->offset - sizeof (MonoObject), buf, &buf, limit);
+               if (err)
+                       return err;
+               nfields --;
+       }
+       g_assert (nfields == 0);
+       return 0;
+}
+
 static ErrorCode
 decode_value_internal (MonoType *t, int type, MonoDomain *domain, guint8 *addr, guint8 *buf, guint8 **endbuf, guint8 *limit)
 {
@@ -5653,38 +5707,11 @@ decode_value_internal (MonoType *t, int type, MonoDomain *domain, guint8 *addr,
                g_assert (type == MONO_TYPE_VALUETYPE);
                /* Fall through */
                handle_vtype:
-       case MONO_TYPE_VALUETYPE: {
-               gboolean is_enum = decode_byte (buf, &buf, limit);
-               MonoClass *klass;
-               MonoClassField *f;
-               int nfields;
-               gpointer iter = NULL;
-               MonoDomain *d;
-
-               /* Enums are sent as a normal vtype */
-               if (is_enum)
-                       return ERR_NOT_IMPLEMENTED;
-               klass = decode_typeid (buf, &buf, limit, &d, &err);
+       case MONO_TYPE_VALUETYPE:
+               err = decode_vtype (t, domain, addr,buf, &buf, limit);
                if (err)
                        return err;
-
-               if (klass != mono_class_from_mono_type (t))
-                       return ERR_INVALID_ARGUMENT;
-
-               nfields = decode_int (buf, &buf, limit);
-               while ((f = mono_class_get_fields (klass, &iter))) {
-                       if (f->type->attrs & FIELD_ATTRIBUTE_STATIC)
-                               continue;
-                       if (mono_field_is_deleted (f))
-                               continue;
-                       err = decode_value (f->type, domain, (guint8*)addr + f->offset - sizeof (MonoObject), buf, &buf, limit);
-                       if (err)
-                               return err;
-                       nfields --;
-               }
-               g_assert (nfields == 0);
                break;
-       }
        handle_ref:
        default:
                if (MONO_TYPE_IS_REFERENCE (t)) {
@@ -5709,7 +5736,44 @@ decode_value_internal (MonoType *t, int type, MonoDomain *domain, guint8 *addr,
                                mono_gc_wbarrier_generic_store (addr, obj);
                        } else if (type == VALUE_TYPE_ID_NULL) {
                                *(MonoObject**)addr = NULL;
+                       } else if (type == MONO_TYPE_VALUETYPE) {
+                               guint8 *buf2;
+                               gboolean is_enum;
+                               MonoClass *klass;
+                               MonoDomain *d;
+                               guint8 *vtype_buf;
+                               int vtype_buf_size;
+
+                               /* This can happen when round-tripping boxed vtypes */
+                               /*
+                                * Obtain vtype class.
+                                * Same as the beginning of the handle_vtype case above.
+                                */
+                               buf2 = buf;
+                               is_enum = decode_byte (buf, &buf, limit);
+                               if (is_enum)
+                                       return ERR_NOT_IMPLEMENTED;
+                               klass = decode_typeid (buf, &buf, limit, &d, &err);
+                               if (err)
+                                       return err;
+
+                               /* Decode the vtype into a temporary buffer, then box it. */
+                               vtype_buf_size = mono_class_value_size (klass, NULL);
+                               vtype_buf = g_malloc0 (vtype_buf_size);
+                               g_assert (vtype_buf);
+
+                               buf = buf2;
+                               err = decode_vtype (NULL, domain, vtype_buf, buf, &buf, limit);
+                               if (err) {
+                                       g_free (vtype_buf);
+                                       return err;
+                               }
+                               *(MonoObject**)addr = mono_value_box (d, klass, vtype_buf);
+                               g_free (vtype_buf);
                        } else {
+                               char *name = mono_type_full_name (t);
+                               DEBUG(1, fprintf (log_file, "[%p] Expected value of type %s, got 0x%0x.\n", (gpointer)GetCurrentThreadId (), name, type));
+                               g_free (name);
                                return ERR_INVALID_ARGUMENT;
                        }
                } else {
@@ -6101,8 +6165,10 @@ do_invoke_method (DebuggerTlsData *tls, Buffer *buf, InvokeData *invoke, guint8
        if (m->klass->valuetype && (m->flags & METHOD_ATTRIBUTE_STATIC)) {
                /* Should be null */
                int type = decode_byte (p, &p, end);
-               if (type != VALUE_TYPE_ID_NULL)
+               if (type != VALUE_TYPE_ID_NULL) {
+                       DEBUG (1, fprintf (log_file, "[%p] Error: Static vtype method invoked with this argument.\n", (gpointer)GetCurrentThreadId ()));
                        return ERR_INVALID_ARGUMENT;
+               }
                memset (this_buf, 0, mono_class_instance_size (m->klass));
        } else {
                err = decode_value (&m->klass->byval_arg, domain, this_buf, p, &p, end);
@@ -6346,7 +6412,7 @@ invoke_method (void)
                tls->resume_count -= invoke->suspend_count;
        }
 
-       DEBUG (1, fprintf (log_file, "[%p] Invoke finished, resume_count = %d.\n", (gpointer)GetCurrentThreadId (), tls->resume_count));
+       DEBUG (1, fprintf (log_file, "[%p] Invoke finished (%d), resume_count = %d.\n", (gpointer)GetCurrentThreadId (), err, tls->resume_count));
 
        /*
         * Take the loader lock to avoid race conditions with CMD_VM_ABORT_INVOKE:
@@ -7305,8 +7371,10 @@ buffer_add_cattrs (Buffer *buf, MonoDomain *domain, MonoImage *image, MonoClass
                        MonoArray *typed_args, *named_args;
                        MonoType *t;
                        CattrNamedArg *arginfo;
+                       MonoError error;
 
-                       mono_reflection_create_custom_attr_data_args (image, attr->ctor, attr->data, attr->data_size, &typed_args, &named_args, &arginfo);
+                       mono_reflection_create_custom_attr_data_args (image, attr->ctor, attr->data, attr->data_size, &typed_args, &named_args, &arginfo, &error);
+                       g_assert (mono_error_ok (&error));
 
                        buffer_add_methodid (buf, domain, attr->ctor);
 
@@ -8744,41 +8812,188 @@ command_set_to_string (CommandSet command_set)
        }
 }
 
+static const char* vm_cmds_str [] = {
+       "VERSION",
+       "ALL_THREADS",
+       "SUSPEND",
+       "RESUME",
+       "EXIT",
+       "DISPOSE",
+       "INVOKE_METHOD",
+       "SET_PROTOCOL_VERSION",
+       "ABORT_INVOKE",
+       "SET_KEEPALIVE"
+       "GET_TYPES_FOR_SOURCE_FILE",
+       "GET_TYPES",
+       "INVOKE_METHODS"
+};
+
+static const char* thread_cmds_str[] = {
+       "GET_FRAME_INFO",
+       "GET_NAME",
+       "GET_STATE",
+       "GET_INFO",
+       "GET_ID",
+       "GET_TID"
+};
+
+static const char* event_cmds_str[] = {
+       "REQUEST_SET",
+       "REQUEST_CLEAR",
+       "REQUEST_CLEAR_ALL_BREAKPOINTS"
+};
+
+static const char* appdomain_cmds_str[] = {
+       "GET_ROOT_DOMAIN",
+       "GET_FRIENDLY_NAME",
+       "GET_ASSEMBLIES",
+       "GET_ENTRY_ASSEMBLY",
+       "CREATE_STRING",
+       "GET_CORLIB",
+       "CREATE_BOXED_VALUE"
+};
+
+static const char* assembly_cmds_str[] = {
+       "GET_LOCATION",
+       "GET_ENTRY_POINT",
+       "GET_MANIFEST_MODULE",
+       "GET_OBJECT",
+       "GET_TYPE",
+       "GET_NAME"
+};
+
+static const char* module_cmds_str[] = {
+       "GET_INFO",
+};
+
+static const char* method_cmds_str[] = {
+       "GET_NAME",
+       "GET_DECLARING_TYPE",
+       "GET_DEBUG_INFO",
+       "GET_PARAM_INFO",
+       "GET_LOCALS_INFO",
+       "GET_INFO",
+       "GET_BODY",
+       "RESOLVE_TOKEN",
+       "GET_CATTRS ",
+       "MAKE_GENERIC_METHOD"
+};
+
+static const char* type_cmds_str[] = {
+       "GET_INFO",
+       "GET_METHODS",
+       "GET_FIELDS",
+       "GET_VALUES",
+       "GET_OBJECT",
+       "GET_SOURCE_FILES",
+       "SET_VALUES",
+       "IS_ASSIGNABLE_FROM",
+       "GET_PROPERTIES ",
+       "GET_CATTRS",
+       "GET_FIELD_CATTRS",
+       "GET_PROPERTY_CATTRS",
+       "GET_SOURCE_FILES_2",
+       "GET_VALUES_2",
+       "GET_METHODS_BY_NAME_FLAGS",
+       "GET_INTERFACES",
+       "GET_INTERFACE_MAP",
+       "IS_INITIALIZED"
+};
+
+static const char* stack_frame_cmds_str[] = {
+       "GET_VALUES",
+       "GET_THIS",
+       "SET_VALUES"
+};
+
+static const char* array_cmds_str[] = {
+       "GET_LENGTH",
+       "GET_VALUES",
+       "SET_VALUES",
+};
+
+static const char* string_cmds_str[] = {
+       "GET_VALUE",
+       "GET_LENGTH",
+       "GET_CHARS"
+};
+
+static const char* object_cmds_str[] = {
+       "GET_TYPE",
+       "GET_VALUES",
+       "IS_COLLECTED",
+       "GET_ADDRESS",
+       "GET_DOMAIN",
+       "SET_VALUES",
+       "GET_INFO",
+};
+
 static const char*
 cmd_to_string (CommandSet set, int command)
 {
+       const char **cmds;
+       int cmds_len = 0;
+
        switch (set) {
-       case CMD_SET_VM: {
-               switch (command) {
-               case CMD_VM_VERSION:
-                       return "VERSION";
-               case CMD_VM_ALL_THREADS:
-                       return "ALL_THREADS";
-               case CMD_VM_SUSPEND:
-                       return "SUSPEND";
-               case CMD_VM_RESUME:
-                       return "RESUME";
-               case CMD_VM_EXIT:
-                       return "EXIT";
-               case CMD_VM_DISPOSE:
-                       return "DISPOSE";
-               case CMD_VM_INVOKE_METHOD:
-                       return "INVOKE_METHOD";
-               case CMD_VM_SET_PROTOCOL_VERSION:
-                       return "SET_PROTOCOL_VERSION";
-               case CMD_VM_ABORT_INVOKE:
-                       return "ABORT_INVOKE";
-               case CMD_VM_SET_KEEPALIVE:
-                       return "SET_KEEPALIVE";
-               default:
-                       break;
-               }
+       case CMD_SET_VM:
+               cmds = vm_cmds_str;
+               cmds_len = G_N_ELEMENTS (vm_cmds_str);
+               break;
+       case CMD_SET_OBJECT_REF:
+               cmds = object_cmds_str;
+               cmds_len = G_N_ELEMENTS (object_cmds_str);
+               break;
+       case CMD_SET_STRING_REF:
+               cmds = string_cmds_str;
+               cmds_len = G_N_ELEMENTS (string_cmds_str);
+               break;
+       case CMD_SET_THREAD:
+               cmds = thread_cmds_str;
+               cmds_len = G_N_ELEMENTS (thread_cmds_str);
+               break;
+       case CMD_SET_ARRAY_REF:
+               cmds = array_cmds_str;
+               cmds_len = G_N_ELEMENTS (array_cmds_str);
+               break;
+       case CMD_SET_EVENT_REQUEST:
+               cmds = event_cmds_str;
+               cmds_len = G_N_ELEMENTS (event_cmds_str);
+               break;
+       case CMD_SET_STACK_FRAME:
+               cmds = stack_frame_cmds_str;
+               cmds_len = G_N_ELEMENTS (stack_frame_cmds_str);
+               break;
+       case CMD_SET_APPDOMAIN:
+               cmds = appdomain_cmds_str;
+               cmds_len = G_N_ELEMENTS (appdomain_cmds_str);
+               break;
+       case CMD_SET_ASSEMBLY:
+               cmds = assembly_cmds_str;
+               cmds_len = G_N_ELEMENTS (assembly_cmds_str);
+               break;
+       case CMD_SET_METHOD:
+               cmds = method_cmds_str;
+               cmds_len = G_N_ELEMENTS (method_cmds_str);
+               break;
+       case CMD_SET_TYPE:
+               cmds = type_cmds_str;
+               cmds_len = G_N_ELEMENTS (type_cmds_str);
+               break;
+       case CMD_SET_MODULE:
+               cmds = module_cmds_str;
+               cmds_len = G_N_ELEMENTS (module_cmds_str);
+               break;
+       case CMD_SET_EVENT:
+               cmds = event_cmds_str;
+               cmds_len = G_N_ELEMENTS (event_cmds_str);
                break;
-       }
        default:
                break;
        }
-       return NULL;
+       if (command > 0 && command <= cmds_len)
+               return cmds [command - 1];
+       else
+               return NULL;
 }
 
 static gboolean
@@ -8878,7 +9093,7 @@ debugger_thread (void *arg)
                                cmd_str = cmd_num;
                        }
                        
-                       DEBUG (1, fprintf (log_file, "[dbg] Received command %s(%s), id=%d.\n", command_set_to_string (command_set), cmd_str, id));
+                       DEBUG (1, fprintf (log_file, "[dbg] Command %s(%s) [%d].\n", command_set_to_string (command_set), cmd_str, id));
                }
 
                data = g_malloc (len - HEADER_LENGTH);
index 83838900e8bb36816e086032711961027c2d5340..1bbdedb4307d9a26c657231173b7417f68be828c 100644 (file)
@@ -1483,7 +1483,7 @@ typedef union {
        double vald;
 } DVal;
 
-#ifdef MONO_ARCH_SOFT_FLOAT
+#ifdef MONO_ARCH_SOFT_FLOAT_FALLBACK
 
 /**
  * mono_decompose_soft_float:
index fc2cb65ff87f606b9b18c181925b397295c66a49..aa783d593a9a8bb339fa712f75ebb9e7ce15a2b9 100644 (file)
@@ -47,6 +47,7 @@
 #include <mono/metadata/coree.h>
 #include <mono/metadata/attach.h>
 #include "mono/utils/mono-counters.h"
+#include "mono/utils/mono-hwcap.h"
 
 #include "mini.h"
 #include "jit.h"
@@ -149,6 +150,9 @@ parse_optimizations (const char* p)
        const char *n;
        int i, invert, len;
 
+       /* Initialize the hwcap module if necessary. */
+       mono_hwcap_init ();
+
        /* call out to cpu detection code here that sets the defaults ... */
        opt |= mono_arch_cpu_optimizations (&exclude);
        opt &= ~exclude;
@@ -351,6 +355,7 @@ mini_regression (MonoImage *image, int verbose, int *total_run)
        MonoDomain *domain = mono_domain_get ();
        guint32 exclude = 0;
 
+       /* Note: mono_hwcap_init () called in mono_init () before we get here. */
        mono_arch_cpu_optimizations (&exclude);
 
        if (mini_stats_fd) {
index ae72268f8d85d3870460532186f262c540e4e113..e912519cdc5179066322d0ed87dd3eed43679165 100644 (file)
@@ -742,14 +742,15 @@ emit_line_number_info_begin (MonoDwarfWriter *w)
        emit_label (w, ".Ldebug_line_end");
 }
 
-static char *
-escape_path (char *name)
+char *
+mono_dwarf_escape_path (const char *name)
 {
        if (strchr (name, '\\')) {
-               char *s = g_malloc (strlen (name) * 2);
+               char *s;
                int len, i, j;
 
                len = strlen (name);
+               s = g_malloc0 ((len + 1) * 2);
                j = 0;
                for (i = 0; i < len; ++i) {
                        if (name [i] == '\\') {
@@ -761,7 +762,7 @@ escape_path (char *name)
                }
                return s;
        }
-       return name;
+       return g_strdup (name);
 }
 
 static void
@@ -852,7 +853,7 @@ emit_all_line_number_info (MonoDwarfWriter *w)
        for (i = 0; i < w->line_number_dir_index; ++i) {
                char *dir = g_hash_table_lookup (index_to_dir, GUINT_TO_POINTER (i + 1));
 
-               emit_string (w, escape_path (dir));
+               emit_string (w, mono_dwarf_escape_path (dir));
        }
        /* End of Includes */
        emit_byte (w, 0);
@@ -873,7 +874,7 @@ emit_all_line_number_info (MonoDwarfWriter *w)
                if (basename)
                        emit_string (w, basename);
                else
-                       emit_string (w, escape_path (name));
+                       emit_string (w, mono_dwarf_escape_path (name));
                emit_uleb128 (w, dir_index);
                emit_byte (w, 0);
                emit_byte (w, 0);
index 37927826dad9305977991164d50382756123a7ae..490f821fb7962a7fab679ea03dea9aeff395ee57 100644 (file)
@@ -35,4 +35,7 @@ void mono_dwarf_writer_emit_trampoline (MonoDwarfWriter *w, const char *tramp_na
 void
 mono_dwarf_writer_emit_method (MonoDwarfWriter *w, MonoCompile *cfg, MonoMethod *method, char *start_symbol, char *end_symbol, guint8 *code, guint32 code_size, MonoInst **args, MonoInst **locals, GSList *unwind_info, MonoDebugMethodJitInfo *debug_info) MONO_INTERNAL;
 
+char *
+mono_dwarf_escape_path (const char *name);
+
 #endif
index e5bee78641eba585aedfb69484cfa5fb62ee664b..2e686747ada0abecb95f34205288fdf0180727aa 100644 (file)
@@ -209,7 +209,7 @@ mono_arch_get_restore_context (MonoTrampInfo **info, gboolean aot)
        mono_arch_flush_icache (start, code - start);
 
        if (info)
-               *info = mono_tramp_info_create (g_strdup_printf ("restore_context"), start, code - start, ji, unwind_ops);
+               *info = mono_tramp_info_create ("restore_context", start, code - start, ji, unwind_ops);
 
        return start;
 }
@@ -296,7 +296,7 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot)
        mono_arch_flush_icache (start, code - start);
 
        if (info)
-               *info = mono_tramp_info_create (g_strdup_printf ("call_filter"), start, code - start, ji, unwind_ops);
+               *info = mono_tramp_info_create ("call_filter", start, code - start, ji, unwind_ops);
 
        return start;
 }
@@ -508,7 +508,7 @@ get_throw_trampoline (MonoTrampInfo **info, gboolean rethrow, gboolean corlib, g
        nacl_global_codeman_validate(&start, kMaxCodeSize, &code);
 
        if (info)
-               *info = mono_tramp_info_create (g_strdup (tramp_name), start, code - start, ji, unwind_ops);
+               *info = mono_tramp_info_create (tramp_name, start, code - start, ji, unwind_ops);
 
        return start;
 }
@@ -1042,7 +1042,7 @@ mono_arch_get_throw_pending_exception (MonoTrampInfo **info, gboolean aot)
        nacl_global_codeman_validate(&start, kMaxCodeSize, &code);
 
        if (info)
-               *info = mono_tramp_info_create (g_strdup_printf ("throw_pending_exception"), start, code - start, ji, unwind_ops);
+               *info = mono_tramp_info_create ("throw_pending_exception", start, code - start, ji, unwind_ops);
 
        return start;
 }
index 575654b67e3ca63724d4f5f70b7201fd356a9277..8931dd8467e20dd0a7c77486a25ffdfac78112d7 100644 (file)
@@ -81,7 +81,7 @@ mono_arch_get_restore_context (MonoTrampInfo **info, gboolean aot)
        mono_arch_flush_icache (start, code - start);
 
        if (info)
-               *info = mono_tramp_info_create (g_strdup_printf ("restore_context"), start, code - start, ji, unwind_ops);
+               *info = mono_tramp_info_create ("restore_context", start, code - start, ji, unwind_ops);
 
        return start;
 }
@@ -127,7 +127,7 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot)
        mono_arch_flush_icache (start, code - start);
 
        if (info)
-               *info = mono_tramp_info_create (g_strdup_printf ("call_filter"), start, code - start, ji, unwind_ops);
+               *info = mono_tramp_info_create ("call_filter", start, code - start, ji, unwind_ops);
 
        return start;
 }
@@ -279,7 +279,7 @@ get_throw_trampoline (int size, gboolean corlib, gboolean rethrow, gboolean llvm
        mono_arch_flush_icache (start, code - start);
 
        if (info)
-               *info = mono_tramp_info_create (g_strdup_printf (tramp_name), start, code - start, ji, unwind_ops);
+               *info = mono_tramp_info_create (tramp_name, start, code - start, ji, unwind_ops);
 
        return start;
 }
index 7f786d99a3906ba0ad943c0c801d5145e362294a..d439b26c94b896cc19f86397d3d7f75d3702c969 100644 (file)
@@ -220,7 +220,7 @@ mono_arch_get_restore_context (MonoTrampInfo **info, gboolean aot)
        mono_arch_flush_icache (start, code - start);
 
        if (info)
-               *info = mono_tramp_info_create (g_strdup_printf ("restore_context"), start, code - start, ji, unwind_ops);
+               *info = mono_tramp_info_create ("restore_context", start, code - start, ji, unwind_ops);
 
        return start;
 }
@@ -308,7 +308,7 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot)
        mono_arch_flush_icache (start, code - start);
 
        if (info)
-               *info = mono_tramp_info_create (g_strdup_printf ("call_filter"), start, code - start, ji, unwind_ops);
+               *info = mono_tramp_info_create ("call_filter", start, code - start, ji, unwind_ops);
 
        return start;
 }
@@ -440,7 +440,7 @@ mono_arch_get_throw_exception_generic (int size, MonoTrampInfo **info, int corli
        mono_arch_flush_icache (start, code - start);
 
        if (info)
-               *info = mono_tramp_info_create (g_strdup_printf (corlib ? "throw_corlib_exception" : (rethrow ? "rethrow_exception" : "throw_exception")), start, code - start, ji, unwind_ops);
+               *info = mono_tramp_info_create (corlib ? "throw_corlib_exception" : (rethrow ? "rethrow_exception" : "throw_exception"), start, code - start, ji, unwind_ops);
 
        return start;
 }
index c46265b7fe45818adcf2a739abf8958b35d5ea70..b95c6ed30185eb0e26916800ce2cc4b14352b60c 100644 (file)
@@ -213,7 +213,7 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot)
        g_assert ((code - start) < SZ_THROW); 
 
        if (info)
-               *info = mono_tramp_info_create (g_strdup_printf("call_filter"),
+               *info = mono_tramp_info_create ("call_filter",
                                                start, code - start, ji,
                                                unwind_ops);
 
@@ -364,9 +364,9 @@ mono_arch_get_throw_exception_generic (int size, MonoTrampInfo **info,
        g_assert ((code - start) < size);
 
        if (info)
-               *info = mono_tramp_info_create (g_strdup_printf(corlib ? "throw_corlib_exception" 
+               *info = mono_tramp_info_create (corlib ? "throw_corlib_exception" 
                                                                       : (rethrow ? "rethrow_exception" 
-                                                                      : "throw_exception"))
+                                                                      : "throw_exception"), 
                                                start, code - start, ji, unwind_ops);
 
        return start;
index a8c8c0f2bd4c94c129c7645923f4a0668af3a874..c97f28f39f49a7e2ea7fc0f23d6a5601855fa399 100644 (file)
@@ -316,7 +316,7 @@ mono_arch_get_restore_context (MonoTrampInfo **info, gboolean aot)
        nacl_global_codeman_validate(&start, 128, &code);
 
        if (info)
-               *info = mono_tramp_info_create (g_strdup_printf ("restore_context"), start, code - start, ji, unwind_ops);
+               *info = mono_tramp_info_create ("restore_context", start, code - start, ji, unwind_ops);
        else {
                GSList *l;
 
@@ -393,7 +393,7 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot)
        nacl_global_codeman_validate(&start, kMaxCodeSize, &code);
 
        if (info)
-               *info = mono_tramp_info_create (g_strdup_printf ("call_filter"), start, code - start, ji, unwind_ops);
+               *info = mono_tramp_info_create ("call_filter", start, code - start, ji, unwind_ops);
        else {
                GSList *l;
 
@@ -636,7 +636,7 @@ get_throw_trampoline (const char *name, gboolean rethrow, gboolean llvm, gboolea
        g_assert ((code - start) < kMaxCodeSize);
 
        if (info)
-               *info = mono_tramp_info_create (g_strdup (name), start, code - start, ji, unwind_ops);
+               *info = mono_tramp_info_create (name, start, code - start, ji, unwind_ops);
        else {
                GSList *l;
 
@@ -981,7 +981,7 @@ mono_x86_get_signal_exception_trampoline (MonoTrampInfo **info, gboolean aot)
        g_assert ((code - start) < 128);
 
        if (info)
-               *info = mono_tramp_info_create (g_strdup ("x86_signal_exception_trampoline"), start, code - start, ji, unwind_ops);
+               *info = mono_tramp_info_create ("x86_signal_exception_trampoline", start, code - start, ji, unwind_ops);
        else {
                GSList *l;
 
index 17a70af71b8e3324bbfe69eb4b15f3a1d7694cd0..fcf05c0653eae370bd8b6de8e1774c6eea9aad7e 100644 (file)
@@ -906,6 +906,20 @@ class Tests
                return result;
        }
 
+       class SyncClass<T> {
+               [MethodImpl(MethodImplOptions.Synchronized)]
+               public Type getInstance() {
+                       return typeof (T);
+               }
+       }
+
+       static int test_0_synchronized_gshared () {
+               var c = new SyncClass<string> ();
+               if (c.getInstance () != typeof (string))
+                       return 1;
+               return 0;
+       }
+
        class Response {
        }
 
index 300965b5b2fd8687664140b4df092e5ad2ae4565..b45afd85b6efd22463e760c088215fc531ae1bc9 100644 (file)
@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Runtime.CompilerServices;
+using System.Threading.Tasks;
 
 struct Foo {
        public int i, j, k, l, m, n;
@@ -211,6 +212,12 @@ public class Tests
                return 0;
        }
 
+       public static int test_0_unbox_any_enum () {
+               IFaceUnbox iface = new ClassUnbox ();
+               AnEnum res = iface.Unbox<AnEnum, int> (AnEnum.One, 0, 1);
+               return res == AnEnum.Two ? 0 : 1;
+       }
+
        [MethodImplAttribute (MethodImplOptions.NoInlining)]
        static void ldfld_nongeneric<T> (GFoo<T>[] foo, int[] arr) {
                arr [0] = foo [0].i;
@@ -913,7 +920,8 @@ public class Tests
        }
 
        enum AnEnum {
-               One
+               One,
+               Two
        };
 
        public static int test_0_constrained_tostring () {
@@ -1211,6 +1219,95 @@ public class Tests
                        return 2;
                return 0;
        }
+
+       interface IConstrained {
+               void foo ();
+               void foo_ref_arg (string s);
+       }
+
+       static object constrained_res;
+
+       struct ConsStruct : IConstrained {
+               public int i;
+
+               public void foo () {
+                       constrained_res = i;
+               }
+
+               public void foo_ref_arg (string s) {
+                       constrained_res = s == "A" ? 42 : 0;
+               }
+       }
+
+       class ConsClass : IConstrained {
+               public int i;
+
+               public void foo () {
+                       constrained_res = i;
+               }
+
+               public void foo_ref_arg (string s) {
+                       constrained_res = s == "A" ? 43 : 0;
+               }
+       }
+
+       interface IFaceConstrained {
+               void constrained_void_iface_call<T, T2>(T t, T2 t2) where T2 : IConstrained;
+               void constrained_void_iface_call_ref_arg<T, T2>(T t, T2 t2) where T2 : IConstrained;
+       }
+
+       class ClassConstrained : IFaceConstrained {
+               [MethodImplAttribute (MethodImplOptions.NoInlining)]
+               public void constrained_void_iface_call<T, T2>(T t, T2 t2) where T2 : IConstrained {
+                       t2.foo ();
+               }
+
+               [MethodImplAttribute (MethodImplOptions.NoInlining)]
+               public void constrained_void_iface_call_ref_arg<T, T2>(T t, T2 t2) where T2 : IConstrained {
+                       t2.foo_ref_arg ("A");
+               }
+       }
+
+       public static int test_0_constrained_void_iface_call () {
+               IFaceConstrained c = new ClassConstrained ();
+               var s = new ConsStruct () { i = 42 };
+               constrained_res = null;
+               c.constrained_void_iface_call<int, ConsStruct> (1, s);
+               if (!(constrained_res is int) || ((int)constrained_res) != 42)
+                       return 1;
+               constrained_res = null;
+               c.constrained_void_iface_call_ref_arg<int, ConsStruct> (1, s);
+               if (!(constrained_res is int) || ((int)constrained_res) != 42)
+                       return 2;
+               var s2 = new ConsClass () { i = 43 };
+               constrained_res = null;
+               c.constrained_void_iface_call<int, ConsClass> (1, s2);
+               if (!(constrained_res is int) || ((int)constrained_res) != 43)
+                       return 3;
+               constrained_res = null;
+               c.constrained_void_iface_call_ref_arg<int, ConsClass> (1, s2);
+               if (!(constrained_res is int) || ((int)constrained_res) != 43)
+                       return 4;
+               return 0;
+       }
+
+       public static async Task<T> FooAsync<T> (int i, int j) {
+               Task<int> t = new Task<int> (delegate () { return 42; });
+               var response = await t;
+               return default(T);
+       }
+
+       [MethodImplAttribute (MethodImplOptions.NoInlining)]
+       public static void call_async<T> (int i, int j) {
+               Task<T> t = FooAsync<T> (1, 2);
+               t.RunSynchronously ();
+       }
+
+       // In AOT mode, the async infrastructure depends on gsharedvt methods
+       public static int test_0_async_call_from_generic () {
+               call_async<string> (1, 2);
+               return 0;
+       }
 }
 
 #if !MOBILE
index b90c5a536a9cd0d2a38b8e590c81233b23ce8a8e..75f582a3bf59846850130072c988124006423111 100644 (file)
@@ -44,13 +44,13 @@ alloc_lreg (MonoCompile *cfg)
 static inline guint32
 alloc_freg (MonoCompile *cfg)
 {
-#ifdef MONO_ARCH_SOFT_FLOAT
-       /* Allocate an lvreg so float ops can be decomposed into long ops */
-       return alloc_lreg (cfg);
-#else
-       /* Allocate these from the same pool as the int regs */
-       return cfg->next_vreg ++;
-#endif
+       if (mono_arch_is_soft_float ()) {
+               /* Allocate an lvreg so float ops can be decomposed into long ops */
+               return alloc_lreg (cfg);
+       } else {
+               /* Allocate these from the same pool as the int regs */
+               return cfg->next_vreg ++;
+       }
 }
 
 static inline guint32
@@ -314,11 +314,7 @@ alloc_dreg (MonoCompile *cfg, MonoStackType stack_type)
         if ((dest)->opcode == OP_VMOVE) (dest)->klass = mono_class_from_mono_type ((vartype)); \
        } while (0)
 
-#ifdef MONO_ARCH_SOFT_FLOAT
-#define DECOMPOSE_INTO_REGPAIR(stack_type) ((stack_type) == STACK_I8 || (stack_type) == STACK_R8)
-#else
-#define DECOMPOSE_INTO_REGPAIR(stack_type) ((stack_type) == STACK_I8)
-#endif
+#define DECOMPOSE_INTO_REGPAIR(stack_type) (mono_arch_is_soft_float () ? ((stack_type) == STACK_I8 || (stack_type) == STACK_R8) : ((stack_type) == STACK_I8))
 
 static inline void
 handle_gsharedvt_ldaddr (MonoCompile *cfg)
@@ -468,7 +464,7 @@ handle_gsharedvt_ldaddr (MonoCompile *cfg)
 
 #define EMIT_NEW_VARLOADA(cfg,dest,var,vartype) do { NEW_VARLOADA ((cfg), (dest), (var), (vartype)); MONO_ADD_INS ((cfg)->cbb, (dest)); } while (0)
 
-#ifdef MONO_ARCH_SOFT_FLOAT
+#ifdef MONO_ARCH_SOFT_FLOAT_FALLBACK
 
 /*
  * Since the IL stack (and our vregs) contain double values, we have to do a conversion
@@ -476,33 +472,61 @@ handle_gsharedvt_ldaddr (MonoCompile *cfg)
  */
 
 #define EMIT_NEW_VARLOAD_SFLOAT(cfg,dest,var,vartype) do { \
-               if (COMPILE_SOFT_FLOAT ((cfg)) && !(vartype)->byref && (vartype)->type == MONO_TYPE_R4) { \
-             MonoInst *iargs [1]; \
-             EMIT_NEW_VARLOADA (cfg, iargs [0], (var), (vartype)); \
-             (dest) = mono_emit_jit_icall (cfg, mono_fload_r4, iargs); \
-        } else { \
-             EMIT_NEW_VARLOAD ((cfg), (dest), (var), (vartype)); \
-        } \
-    } while (0)
+               if (!COMPILE_LLVM ((cfg)) && !(vartype)->byref && (vartype)->type == MONO_TYPE_R4) { \
+                       MonoInst *iargs [1]; \
+                       EMIT_NEW_VARLOADA (cfg, iargs [0], (var), (vartype)); \
+                       (dest) = mono_emit_jit_icall (cfg, mono_fload_r4, iargs); \
+               } else { \
+                       EMIT_NEW_VARLOAD ((cfg), (dest), (var), (vartype)); \
+               } \
+       } while (0)
 
 #define EMIT_NEW_VARSTORE_SFLOAT(cfg,dest,var,vartype,inst) do {       \
                if (COMPILE_SOFT_FLOAT ((cfg)) && !(vartype)->byref && (vartype)->type == MONO_TYPE_R4) { \
-             MonoInst *iargs [2]; \
-             iargs [0] = (inst); \
-             EMIT_NEW_VARLOADA (cfg, iargs [1], (var), (vartype)); \
-             mono_emit_jit_icall (cfg, mono_fstore_r4, iargs); \
-        } else { \
-             EMIT_NEW_VARSTORE ((cfg), (dest), (var), (vartype), (inst)); \
-        } \
-    } while (0)
+                       MonoInst *iargs [2]; \
+                       iargs [0] = (inst); \
+                       EMIT_NEW_VARLOADA (cfg, iargs [1], (var), (vartype)); \
+                       mono_emit_jit_icall (cfg, mono_fstore_r4, iargs); \
+               } else { \
+                       EMIT_NEW_VARSTORE ((cfg), (dest), (var), (vartype), (inst)); \
+               } \
+       } while (0)
 
-#define EMIT_NEW_ARGLOAD(cfg,dest,num) EMIT_NEW_VARLOAD_SFLOAT ((cfg), (dest), cfg->args [(num)], cfg->arg_types [(num)])
+#define EMIT_NEW_ARGLOAD(cfg,dest,num) do {    \
+               if (mono_arch_is_soft_float ()) {       \
+                       EMIT_NEW_VARLOAD_SFLOAT ((cfg), (dest), cfg->args [(num)], cfg->arg_types [(num)]);     \
+               } else {        \
+                       NEW_ARGLOAD ((cfg), (dest), (num));     \
+                       MONO_ADD_INS ((cfg)->cbb, (dest));      \
+               }       \
+       } while (0)
 
-#define EMIT_NEW_LOCLOAD(cfg,dest,num) EMIT_NEW_VARLOAD_SFLOAT ((cfg), (dest), cfg->locals [(num)], header->locals [(num)])
+#define EMIT_NEW_LOCLOAD(cfg,dest,num) do {    \
+               if (mono_arch_is_soft_float ()) {       \
+                       EMIT_NEW_VARLOAD_SFLOAT ((cfg), (dest), cfg->locals [(num)], header->locals [(num)]);   \
+               } else {        \
+                       NEW_LOCLOAD ((cfg), (dest), (num));     \
+                       MONO_ADD_INS ((cfg)->cbb, (dest));      \
+               }       \
+       } while (0)
 
-#define EMIT_NEW_LOCSTORE(cfg,dest,num,inst) EMIT_NEW_VARSTORE_SFLOAT ((cfg), (dest), (cfg)->locals [(num)], (cfg)->locals [(num)]->inst_vtype, (inst))
+#define EMIT_NEW_LOCSTORE(cfg,dest,num,inst) do {      \
+               if (mono_arch_is_soft_float ()) {       \
+                       EMIT_NEW_VARSTORE_SFLOAT ((cfg), (dest), (cfg)->locals [(num)], (cfg)->locals [(num)]->inst_vtype, (inst));     \
+               } else {        \
+                       NEW_LOCSTORE ((cfg), (dest), (num), (inst));    \
+                       MONO_ADD_INS ((cfg)->cbb, (dest));      \
+               }       \
+       } while (0)
 
-#define EMIT_NEW_ARGSTORE(cfg,dest,num,inst) EMIT_NEW_VARSTORE_SFLOAT ((cfg), (dest), cfg->args [(num)], cfg->arg_types [(num)], (inst))
+#define EMIT_NEW_ARGSTORE(cfg,dest,num,inst) do {      \
+               if (mono_arch_is_soft_float ()) {       \
+                       EMIT_NEW_VARSTORE_SFLOAT ((cfg), (dest), cfg->args [(num)], cfg->arg_types [(num)], (inst));    \
+               } else {        \
+                       NEW_ARGSTORE ((cfg), (dest), (num), (inst));    \
+                       MONO_ADD_INS ((cfg)->cbb, (dest));      \
+               }       \
+       } while (0)
 
 #else
 
index 78db84f7fd30d03c011f17c5c2a892dd2a1c044b..06e5df4184fadb1b2d762e394a4b3972c2108764 100644 (file)
@@ -429,7 +429,7 @@ mono_imul_ovf_un (guint32 a, guint32 b)
 }
 #endif
 
-#if defined(MONO_ARCH_EMULATE_MUL_DIV) || defined(MONO_ARCH_SOFT_FLOAT)
+#if defined(MONO_ARCH_EMULATE_MUL_DIV) || defined(MONO_ARCH_SOFT_FLOAT_FALLBACK)
 double
 mono_fdiv (double a, double b)
 {
@@ -439,7 +439,7 @@ mono_fdiv (double a, double b)
 }
 #endif
 
-#ifdef MONO_ARCH_SOFT_FLOAT
+#ifdef MONO_ARCH_SOFT_FLOAT_FALLBACK
 
 double
 mono_fsub (double a, double b)
@@ -915,7 +915,7 @@ mono_fconv_ovf_u8 (double v)
  * 
  * To work around this issue we test for value boundaries instead. 
  */
-#if defined(__arm__) && MONO_ARCH_SOFT_FLOAT 
+#if defined(__arm__) && defined(MONO_ARCH_SOFT_FLOAT_FALLBACK)
        if (isnan (v) || !(v >= -0.5 && v <= ULLONG_MAX+0.5)) {
                mono_raise_exception (mono_get_exception_overflow ());
        }
@@ -1052,7 +1052,7 @@ mono_create_corlib_exception_2 (guint32 token, MonoString *arg1, MonoString *arg
 }
 
 MonoObject*
-mono_object_castclass (MonoObject *obj, MonoClass *klass)
+mono_object_castclass_unbox (MonoObject *obj, MonoClass *klass)
 {
        MonoJitTlsData *jit_tls = NULL;
 
@@ -1064,8 +1064,12 @@ mono_object_castclass (MonoObject *obj, MonoClass *klass)
        if (!obj)
                return NULL;
 
-       if (mono_object_isinst (obj, klass))
+       if (klass->enumtype) {
+               if (obj->vtable->klass == klass->element_class)
+                       return obj;
+       } else if (mono_object_isinst (obj, klass)) {
                return obj;
+       }
 
        if (mini_get_debug_options ()->better_cast_details) {
                jit_tls->class_cast_from = obj->vtable->klass;
@@ -1164,6 +1168,13 @@ constrained_gsharedvt_call_setup (gpointer mp, MonoMethod *cmethod, MonoClass *k
        mono_class_setup_vtable (klass);
        g_assert (klass->vtable);
        vt_slot = mono_method_get_vtable_slot (cmethod);
+       if (cmethod->klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
+               int iface_offset;
+
+               iface_offset = mono_class_interface_offset (klass, cmethod->klass);
+               g_assert (iface_offset != -1);
+               vt_slot += iface_offset;
+       }
        m = klass->vtable [vt_slot];
        if (klass->valuetype && (m->klass == mono_defaults.object_class || m->klass == mono_defaults.enum_class->parent || m->klass == mono_defaults.enum_class))
                /*
@@ -1183,46 +1194,20 @@ constrained_gsharedvt_call_setup (gpointer mp, MonoMethod *cmethod, MonoClass *k
        return m;
 }
 
+/*
+ * mono_gsharedvt_constrained_call:
+ *
+ *   Make a call to CMETHOD using the receiver MP, which is assumed to be of type KLASS. ARGS contains
+ * the arguments to the method in the format used by mono_runtime_invoke ().
+ */
 MonoObject*
-mono_object_tostring_gsharedvt (gpointer mp, MonoMethod *cmethod, MonoClass *klass)
-{
-       MonoMethod *m;
-       gpointer this_arg;
-
-       m = constrained_gsharedvt_call_setup (mp, cmethod, klass, &this_arg);
-       return mono_runtime_invoke (m, this_arg, NULL, NULL);
-}
-
-int
-mono_object_gethashcode_gsharedvt (gpointer mp, MonoMethod *cmethod, MonoClass *klass)
-{
-       MonoMethod *m;
-       gpointer this_arg;
-       MonoObject *res;
-       gpointer p;
-
-       m = constrained_gsharedvt_call_setup (mp, cmethod, klass, &this_arg);
-       // FIXME: This boxes the result
-       res = mono_runtime_invoke (m, this_arg, NULL, NULL);
-       p = mono_object_unbox (res);
-       return *(int*)p;
-}
-
-MonoBoolean
-mono_object_equals_gsharedvt (gpointer mp, MonoMethod *cmethod, MonoClass *klass, MonoObject *arg)
+mono_gsharedvt_constrained_call (gpointer mp, MonoMethod *cmethod, MonoClass *klass, gpointer *args)
 {
        MonoMethod *m;
        gpointer this_arg;
-       MonoObject *res;
-       gpointer p;
-       void **args;
 
        m = constrained_gsharedvt_call_setup (mp, cmethod, klass, &this_arg);
-       // FIXME: This boxes the result
-       args = (void**)&arg;
-       res = mono_runtime_invoke (m, this_arg, args, NULL);
-       p = mono_object_unbox (res);
-       return *(MonoBoolean*)p;
+       return mono_runtime_invoke (m, this_arg, args, NULL);
 }
 
 void
index 29dc8e516fcaafcb065b05695e8483ebf1822aaf..bf04ae68196db80eb8f94c2ed4bdf4743b221a23 100644 (file)
@@ -165,7 +165,7 @@ MonoException *mono_create_corlib_exception_1 (guint32 token, MonoString *arg) M
 
 MonoException *mono_create_corlib_exception_2 (guint32 token, MonoString *arg1, MonoString *arg2) MONO_INTERNAL;
 
-MonoObject* mono_object_castclass (MonoObject *obj, MonoClass *klass) MONO_INTERNAL;
+MonoObject* mono_object_castclass_unbox (MonoObject *obj, MonoClass *klass) MONO_INTERNAL;
 
 gpointer mono_get_native_calli_wrapper (MonoImage *image, MonoMethodSignature *sig, gpointer func) MONO_INTERNAL;
 
@@ -175,11 +175,8 @@ mono_object_isinst_with_cache (MonoObject *obj, MonoClass *klass, gpointer *cach
 MonoObject*
 mono_object_castclass_with_cache (MonoObject *obj, MonoClass *klass, gpointer *cache);
 
-MonoObject* mono_object_tostring_gsharedvt (gpointer mp, MonoMethod *cmethod, MonoClass *klass) MONO_INTERNAL;
-
-int mono_object_gethashcode_gsharedvt (gpointer mp, MonoMethod *cmethod, MonoClass *klass) MONO_INTERNAL;
-
-MonoBoolean mono_object_equals_gsharedvt (gpointer mp, MonoMethod *cmethod, MonoClass *klass, MonoObject *arg) MONO_INTERNAL;
+MonoObject*
+mono_gsharedvt_constrained_call (gpointer mp, MonoMethod *cmethod, MonoClass *klass, gpointer *args) MONO_INTERNAL;
 
 void mono_gsharedvt_value_copy (gpointer dest, gpointer src, MonoClass *klass) MONO_INTERNAL;
 
index d025a3063dd286e133f985325f6db9c11d9a8534..a8a0fd3d60480a3e18d55b0d190459b5345aeb83 100644 (file)
@@ -2337,7 +2337,7 @@ mono_emit_call_args (MonoCompile *cfg, MonoMethodSignature *sig,
                                         MonoInst **args, int calli, int virtual, int tail, int rgctx, int unbox_trampoline)
 {
        MonoCallInst *call;
-#ifdef MONO_ARCH_SOFT_FLOAT
+#ifdef MONO_ARCH_SOFT_FLOAT_FALLBACK
        int i;
 #endif
 
@@ -2384,7 +2384,7 @@ mono_emit_call_args (MonoCompile *cfg, MonoMethodSignature *sig,
        } else if (!MONO_TYPE_IS_VOID (sig->ret))
                call->inst.dreg = alloc_dreg (cfg, call->inst.type);
 
-#ifdef MONO_ARCH_SOFT_FLOAT
+#ifdef MONO_ARCH_SOFT_FLOAT_FALLBACK
        if (COMPILE_SOFT_FLOAT (cfg)) {
                /* 
                 * If the call has a float argument, we would need to do an r8->r4 conversion using 
@@ -2790,7 +2790,7 @@ create_write_barrier_bitmap (MonoCompile *cfg, MonoClass *klass, unsigned *wb_bi
 }
 
 static void
-emit_write_barrier (MonoCompile *cfg, MonoInst *ptr, MonoInst *value, int value_reg)
+emit_write_barrier (MonoCompile *cfg, MonoInst *ptr, MonoInst *value)
 {
        int card_table_shift_bits;
        gpointer card_table_mask;
@@ -2816,10 +2816,7 @@ emit_write_barrier (MonoCompile *cfg, MonoInst *ptr, MonoInst *value, int value_
 
                MONO_INST_NEW (cfg, wbarrier, OP_CARD_TABLE_WBARRIER);
                wbarrier->sreg1 = ptr->dreg;
-               if (value)
-                       wbarrier->sreg2 = value->dreg;
-               else
-                       wbarrier->sreg2 = value_reg;
+               wbarrier->sreg2 = value->dreg;
                MONO_ADD_INS (cfg->cbb, wbarrier);
        } else if (card_table) {
                int offset_reg = alloc_preg (cfg);
@@ -2849,13 +2846,7 @@ emit_write_barrier (MonoCompile *cfg, MonoInst *ptr, MonoInst *value, int value_
                mono_emit_method_call (cfg, write_barrier, &ptr, NULL);
        }
 
-       if (value) {
-               EMIT_NEW_DUMMY_USE (cfg, dummy_use, value);
-       } else {
-               MONO_INST_NEW (cfg, dummy_use, OP_DUMMY_USE);
-               dummy_use->sreg1 = value_reg;
-               MONO_ADD_INS (cfg->cbb, dummy_use);
-       }
+       EMIT_NEW_DUMMY_USE (cfg, dummy_use, value);
 }
 
 static gboolean
@@ -2900,11 +2891,17 @@ mono_emit_wb_aware_memcpy (MonoCompile *cfg, MonoClass *klass, MonoInst *iargs[4
        EMIT_NEW_UNALU (cfg, iargs [0], OP_MOVE, dest_ptr_reg, destreg);
 
        while (size >= SIZEOF_VOID_P) {
-               MONO_EMIT_NEW_LOAD_MEMBASE_OP (cfg, OP_LOAD_MEMBASE, tmp_reg, srcreg, offset);
+               MonoInst *load_inst;
+               MONO_INST_NEW (cfg, load_inst, OP_LOAD_MEMBASE);
+               load_inst->dreg = tmp_reg;
+               load_inst->inst_basereg = srcreg;
+               load_inst->inst_offset = offset;
+               MONO_ADD_INS (cfg->cbb, load_inst);
+
                MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STOREP_MEMBASE_REG, dest_ptr_reg, 0, tmp_reg);
 
                if (need_wb & 0x1)
-                       emit_write_barrier (cfg, iargs [0], NULL, tmp_reg);
+                       emit_write_barrier (cfg, iargs [0], load_inst);
 
                offset += SIZEOF_VOID_P;
                size -= SIZEOF_VOID_P;
@@ -3536,7 +3533,7 @@ handle_unbox_gsharedvt (MonoCompile *cfg, int context_used, MonoClass *klass, Mo
        args [1] = klass_inst;
 
        /* CASTCLASS */
-       obj = mono_emit_jit_icall (cfg, mono_object_castclass, args);
+       obj = mono_emit_jit_icall (cfg, mono_object_castclass_unbox, args);
 
        NEW_BBLOCK (cfg, is_ref_bb);
        NEW_BBLOCK (cfg, is_nullable_bb);
@@ -4286,7 +4283,7 @@ handle_delegate_ctor (MonoCompile *cfg, MonoClass *klass, MonoInst *target, Mono
                if (cfg->gen_write_barriers) {
                        dreg = alloc_preg (cfg);
                        EMIT_NEW_BIALU_IMM (cfg, ptr, OP_PADD_IMM, dreg, obj->dreg, G_STRUCT_OFFSET (MonoDelegate, target));
-                       emit_write_barrier (cfg, ptr, target, 0);
+                       emit_write_barrier (cfg, ptr, target);
                }
        }
 
@@ -4296,7 +4293,7 @@ handle_delegate_ctor (MonoCompile *cfg, MonoClass *klass, MonoInst *target, Mono
        if (cfg->gen_write_barriers) {
                dreg = alloc_preg (cfg);
                EMIT_NEW_BIALU_IMM (cfg, ptr, OP_PADD_IMM, dreg, obj->dreg, G_STRUCT_OFFSET (MonoDelegate, method));
-               emit_write_barrier (cfg, ptr, method_ins, 0);
+               emit_write_barrier (cfg, ptr, method_ins);
        }
        /* 
         * To avoid looking up the compiled code belonging to the target method
@@ -4399,7 +4396,7 @@ mono_method_check_inlining (MonoCompile *cfg, MonoMethod *method)
 {
        MonoMethodHeaderSummary header;
        MonoVTable *vtable;
-#ifdef MONO_ARCH_SOFT_FLOAT
+#ifdef MONO_ARCH_SOFT_FLOAT_FALLBACK
        MonoMethodSignature *sig = mono_method_signature (method);
        int i;
 #endif
@@ -4490,13 +4487,15 @@ mono_method_check_inlining (MonoCompile *cfg, MonoMethod *method)
        if (mono_security_method_has_declsec (method))
                return FALSE;
 
-#ifdef MONO_ARCH_SOFT_FLOAT
-       /* FIXME: */
-       if (sig->ret && sig->ret->type == MONO_TYPE_R4)
-               return FALSE;
-       for (i = 0; i < sig->param_count; ++i)
-               if (!sig->params [i]->byref && sig->params [i]->type == MONO_TYPE_R4)
+#ifdef MONO_ARCH_SOFT_FLOAT_FALLBACK
+       if (mono_arch_is_soft_float ()) {
+               /* FIXME: */
+               if (sig->ret && sig->ret->type == MONO_TYPE_R4)
                        return FALSE;
+               for (i = 0; i < sig->param_count; ++i)
+                       if (!sig->params [i]->byref && sig->params [i]->type == MONO_TYPE_R4)
+                               return FALSE;
+       }
 #endif
 
        return TRUE;
@@ -4759,7 +4758,7 @@ emit_array_generic_access (MonoCompile *cfg, MonoMethodSignature *fsig, MonoInst
                EMIT_NEW_LOAD_MEMBASE_TYPE (cfg, load, &eklass->byval_arg, args [2]->dreg, 0);
                EMIT_NEW_STORE_MEMBASE_TYPE (cfg, store, &eklass->byval_arg, addr->dreg, 0, load->dreg);
                if (mini_type_is_reference (cfg, fsig->params [2]))
-                       emit_write_barrier (cfg, addr, load, -1);
+                       emit_write_barrier (cfg, addr, load);
        } else {
                EMIT_NEW_LOAD_MEMBASE_TYPE (cfg, load, &eklass->byval_arg, addr->dreg, 0);
                EMIT_NEW_STORE_MEMBASE_TYPE (cfg, store, &eklass->byval_arg, args [2]->dreg, 0, load->dreg);
@@ -4819,7 +4818,7 @@ emit_array_store (MonoCompile *cfg, MonoClass *klass, MonoInst **sp, gboolean sa
                        MonoInst *addr = mini_emit_ldelema_1_ins (cfg, klass, sp [0], sp [1], safety_checks);
                        EMIT_NEW_STORE_MEMBASE_TYPE (cfg, ins, &klass->byval_arg, addr->dreg, 0, sp [2]->dreg);
                        if (generic_class_is_reference_type (cfg, klass))
-                               emit_write_barrier (cfg, addr, sp [2], -1);
+                               emit_write_barrier (cfg, addr, sp [2]);
                }
                return ins;
        }
@@ -5316,7 +5315,7 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign
                        }
 
                        if (cfg->gen_write_barriers && is_ref)
-                               emit_write_barrier (cfg, args [0], args [1], -1);
+                               emit_write_barrier (cfg, args [0], args [1]);
                }
 #endif /* MONO_ARCH_HAVE_ATOMIC_EXCHANGE */
  
@@ -5350,7 +5349,7 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign
                                /* g_assert_not_reached (); */
                        }
                        if (cfg->gen_write_barriers && is_ref)
-                               emit_write_barrier (cfg, args [0], args [1], -1);
+                               emit_write_barrier (cfg, args [0], args [1]);
                }
 #endif /* MONO_ARCH_HAVE_ATOMIC_CAS */
 
@@ -7599,27 +7598,55 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                        /*
                                         * Constrained calls need to behave differently at runtime dependending on whenever the receiver is instantiated as ref type or as a vtype.
                                         */
-                                       /* Special case Object methods as they are easy to implement */
-                                       if (cmethod->klass == mono_defaults.object_class) {
+                                       if ((cmethod->klass != mono_defaults.object_class) && constrained_call->valuetype && cmethod->klass->valuetype) {
+                                               /* The 'Own method' case below */
+                                       } else if (((cmethod->klass == mono_defaults.object_class) || (cmethod->klass->flags & TYPE_ATTRIBUTE_INTERFACE)) &&
+                                                          (MONO_TYPE_IS_VOID (fsig->ret) || fsig->ret->type == MONO_TYPE_I4 || fsig->ret->type == MONO_TYPE_BOOLEAN || fsig->ret->type == MONO_TYPE_STRING) &&
+                                                          (fsig->param_count == 0 || (fsig->param_count == 1 && MONO_TYPE_IS_REFERENCE (fsig->params [0])))) {
                                                MonoInst *args [16];
 
+                                               /*
+                                                * This case handles calls to object:ToString()/Equals()/GetHashCode(), plus some simple interface calls enough to support
+                                                * AsyncTaskMethodBuilder.
+                                                */
+
                                                args [0] = sp [0];
                                                EMIT_NEW_METHODCONST (cfg, args [1], cmethod);
                                                args [2] = emit_get_rgctx_klass (cfg, mono_class_check_context_used (constrained_call), constrained_call, MONO_RGCTX_INFO_KLASS);
 
-                                               if (!strcmp (cmethod->name, "ToString")) {
-                                                       ins = mono_emit_jit_icall (cfg, mono_object_tostring_gsharedvt, args);
-                                               } else if (!strcmp (cmethod->name, "Equals")) {
-                                                       args [3] = sp [1];
-                                                       ins = mono_emit_jit_icall (cfg, mono_object_equals_gsharedvt, args);
-                                               } else if (!strcmp (cmethod->name, "GetHashCode")) {
-                                                       ins = mono_emit_jit_icall (cfg, mono_object_gethashcode_gsharedvt, args);
+                                               if (fsig->param_count) {
+                                                       /* Pass the arguments using a localloc-ed array using the format expected by runtime_invoke () */
+                                                       MONO_INST_NEW (cfg, ins, OP_LOCALLOC_IMM);
+                                                       ins->dreg = alloc_preg (cfg);
+                                                       ins->inst_imm = fsig->param_count * sizeof (mgreg_t);
+                                                       MONO_ADD_INS (cfg->cbb, ins);
+                                                       args [3] = ins;
+
+                                                       EMIT_NEW_STORE_MEMBASE (cfg, ins, OP_STORE_MEMBASE_REG, args [3]->dreg, 0, sp [1]->dreg);
                                                } else {
-                                                       GSHAREDVT_FAILURE (*ip);
+                                                       EMIT_NEW_ICONST (cfg, args [3], 0);
                                                }
+                                               ins = mono_emit_jit_icall (cfg, mono_gsharedvt_constrained_call, args);
+                                               emit_widen = FALSE;
+
+                                               if (fsig->ret->type == MONO_TYPE_I4 || fsig->ret->type == MONO_TYPE_BOOLEAN) {
+                                                       MonoInst *add;
+                                                       int dreg;
+
+                                                       /* Unbox */
+                                                       NEW_BIALU_IMM (cfg, add, OP_ADD_IMM, alloc_dreg (cfg, STACK_MP), ins->dreg, sizeof (MonoObject));
+                                                       MONO_ADD_INS (cfg->cbb, add);
+                                                       dreg = alloc_ireg (cfg);
+                                                       /* Load value */
+                                                       if (fsig->ret->type == MONO_TYPE_BOOLEAN)
+                                                               NEW_LOAD_MEMBASE (cfg, ins, OP_LOADU1_MEMBASE, dreg, add->dreg, 0);
+                                                       else
+                                                               NEW_LOAD_MEMBASE (cfg, ins, OP_LOADI4_MEMBASE, dreg, add->dreg, 0);
+                                                       MONO_ADD_INS (cfg->cbb, ins);
+                                                       /* ins represents the call result */
+                                               }
+
                                                goto call_end;
-                                       } else if (constrained_call->valuetype && cmethod->klass->valuetype) {
-                                               /* The 'Own method' case below */
                                        } else {
                                                GSHAREDVT_FAILURE (*ip);
                                        }
@@ -8084,7 +8111,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                        addr = mini_emit_ldelema_ins (cfg, cmethod, sp, ip, TRUE);
                                        EMIT_NEW_STORE_MEMBASE_TYPE (cfg, ins, fsig->params [fsig->param_count - 1], addr->dreg, 0, val->dreg);
                                        if (cfg->gen_write_barriers && val->type == STACK_OBJ && !(val->opcode == OP_PCONST && val->inst_c0 == 0))
-                                               emit_write_barrier (cfg, addr, val, 0);
+                                               emit_write_barrier (cfg, addr, val);
                                } else if (strcmp (cmethod->name, "Get") == 0) { /* array Get */
                                        addr = mini_emit_ldelema_ins (cfg, cmethod, sp, ip, FALSE);
 
@@ -8178,8 +8205,11 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                         * change the called method to a dummy wrapper, and resolve that wrapper
                         * to the real method in mono_jit_compile_method ().
                         */
-                       if (cfg->method->wrapper_type == MONO_WRAPPER_SYNCHRONIZED && mono_marshal_method_from_wrapper (cfg->method) == cmethod)
-                               cmethod = mono_marshal_get_synchronized_inner_wrapper (cmethod);
+                       if (cfg->method->wrapper_type == MONO_WRAPPER_SYNCHRONIZED) {
+                               MonoMethod *orig = mono_marshal_method_from_wrapper (cfg->method);
+                               if (cmethod == orig || (cmethod->is_inflated && mono_method_get_declaring_generic_method (cmethod) == orig))
+                                       cmethod = mono_marshal_get_synchronized_inner_wrapper (cmethod);
+                       }
 
                        /* Common call */
                        INLINE_FAILURE ("call");
@@ -8294,7 +8324,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                                        ins->klass = mono_class_from_mono_type (ret_type);
                                                }
                                        } else {
-#ifdef MONO_ARCH_SOFT_FLOAT
+#ifdef MONO_ARCH_SOFT_FLOAT_FALLBACK
                                                if (COMPILE_SOFT_FLOAT (cfg) && !ret_type->byref && ret_type->type == MONO_TYPE_R4) {
                                                        MonoInst *iargs [1];
                                                        MonoInst *conv;
@@ -8640,7 +8670,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                        MONO_ADD_INS (bblock, ins);
 
                        if (cfg->gen_write_barriers && *ip == CEE_STIND_REF && method->wrapper_type != MONO_WRAPPER_WRITE_BARRIER && !((sp [1]->opcode == OP_PCONST) && (sp [1]->inst_p0 == 0)))
-                               emit_write_barrier (cfg, sp [0], sp [1], -1);
+                               emit_write_barrier (cfg, sp [0], sp [1]);
 
                        inline_costs += 1;
                        ++ip;
@@ -8851,7 +8881,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                MONO_ADD_INS (cfg->cbb, store);
 
                                if (cfg->gen_write_barriers && cfg->method->wrapper_type != MONO_WRAPPER_WRITE_BARRIER)
-                                       emit_write_barrier (cfg, sp [0], sp [1], -1);
+                                       emit_write_barrier (cfg, sp [0], sp [1]);
                        } else {
                                mini_emit_stobj (cfg, sp [0], sp [1], klass, FALSE);
                        }
@@ -9265,7 +9295,9 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                        EMIT_NEW_PCONST (cfg, args [2], mono_domain_alloc0 (cfg->domain, sizeof (gpointer)));
 
                                /*The wrapper doesn't inline well so the bloat of inlining doesn't pay off.*/
+                               save_cast_details (cfg, klass, sp [0]->dreg);
                                *sp++ = mono_emit_method_call (cfg, mono_castclass, args, NULL);
+                               reset_cast_details (cfg);
                                ip += 5;
                                inline_costs += 2;
                        } else if (!context_used && (mono_class_is_marshalbyref (klass) || klass->flags & TYPE_ATTRIBUTE_INTERFACE)) {
@@ -9276,8 +9308,10 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                mono_castclass = mono_marshal_get_castclass (klass); 
                                iargs [0] = sp [0];
                                
+                               save_cast_details (cfg, klass, sp [0]->dreg);
                                costs = inline_method (cfg, mono_castclass, mono_method_signature (mono_castclass), 
                                                           iargs, ip, cfg->real_offset, dont_inline, TRUE);
+                               reset_cast_details (cfg);
                                CHECK_CFG_EXCEPTION;
                                g_assert (costs > 0);
                                
@@ -9739,7 +9773,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
 
                                        dreg = alloc_ireg_mp (cfg);
                                        EMIT_NEW_BIALU_IMM (cfg, ptr, OP_PADD_IMM, dreg, sp [0]->dreg, foffset);
-                                       emit_write_barrier (cfg, ptr, sp [1], -1);
+                                       emit_write_barrier (cfg, ptr, sp [1]);
                                }
 
                                        store->flags |= ins_flag;
@@ -10145,7 +10179,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                        if (cfg->gen_write_barriers && cfg->method->wrapper_type != MONO_WRAPPER_WRITE_BARRIER &&
                                        generic_class_is_reference_type (cfg, klass)) {
                                /* insert call to write barrier */
-                               emit_write_barrier (cfg, sp [0], sp [1], -1);
+                               emit_write_barrier (cfg, sp [0], sp [1]);
                        }
                        ins_flag = 0;
                        ip += 5;
@@ -10173,7 +10207,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                        context_used = mini_class_check_context_used (cfg, klass);
 
                        if (sp [0]->type == STACK_I8 || (SIZEOF_VOID_P == 8 && sp [0]->type == STACK_PTR)) {
-                               MONO_INST_NEW (cfg, ins, OP_LCONV_TO_I4);
+                               MONO_INST_NEW (cfg, ins, OP_LCONV_TO_OVF_U4);
                                ins->sreg1 = sp [0]->dreg;
                                ins->type = STACK_I4;
                                ins->dreg = alloc_ireg (cfg);
@@ -12405,10 +12439,13 @@ mono_handle_global_vregs (MonoCompile *cfg)
 #if SIZEOF_REGISTER == 8
                case STACK_I8:
 #endif
-#if !defined(TARGET_X86) && !defined(MONO_ARCH_SOFT_FLOAT)
+#if !defined(TARGET_X86)
                /* Enabling this screws up the fp stack on x86 */
                case STACK_R8:
 #endif
+                       if (mono_arch_is_soft_float ())
+                               break;
+
                        /* Arguments are implicitly global */
                        /* Putting R4 vars into registers doesn't work currently */
                        /* The gsharedvt vars are implicitly referenced by ldaddr opcodes, but those opcodes are only generated later */
index eb60841a81f5c9daf065e66511d20aa94dd7df17..73ca5168a3af7aa5f9bf3c453059c314669e4b58 100644 (file)
@@ -30,6 +30,7 @@
 #include <mono/utils/mono-mmap.h>
 #include <mono/utils/mono-memory-model.h>
 #include <mono/utils/mono-tls.h>
+#include <mono/utils/mono-hwcap-x86.h>
 
 #include "trace.h"
 #include "ir-emit.h"
@@ -1221,28 +1222,6 @@ mono_amd64_tail_call_supported (MonoMethodSignature *caller_sig, MonoMethodSigna
        return res;
 }
 
-static int 
-cpuid (int id, int* p_eax, int* p_ebx, int* p_ecx, int* p_edx)
-{
-#if defined(MONO_CROSS_COMPILE)
-       return 0;
-#else
-#ifndef _MSC_VER
-       __asm__ __volatile__ ("cpuid"
-               : "=a" (*p_eax), "=b" (*p_ebx), "=c" (*p_ecx), "=d" (*p_edx)
-               : "a" (id));
-#else
-       int info[4];
-       __cpuid(info, id);
-       *p_eax = info[0];
-       *p_ebx = info[1];
-       *p_ecx = info[2];
-       *p_edx = info[3];
-#endif
-       return 1;
-#endif
-}
-
 /*
  * Initialize the cpu to execute managed code.
  */
@@ -1325,20 +1304,19 @@ mono_arch_cleanup (void)
 guint32
 mono_arch_cpu_optimizations (guint32 *exclude_mask)
 {
-       int eax, ebx, ecx, edx;
        guint32 opts = 0;
 
        *exclude_mask = 0;
-       /* Feature Flags function, flags returned in EDX. */
-       if (cpuid (1, &eax, &ebx, &ecx, &edx)) {
-               if (edx & (1 << 15)) {
-                       opts |= MONO_OPT_CMOV;
-                       if (edx & 1)
-                               opts |= MONO_OPT_FCMOV;
-                       else
-                               *exclude_mask |= MONO_OPT_FCMOV;
-               } else
-                       *exclude_mask |= MONO_OPT_CMOV;
+
+       if (mono_hwcap_x86_has_cmov) {
+               opts |= MONO_OPT_CMOV;
+
+               if (mono_hwcap_x86_has_fcmov)
+                       opts |= MONO_OPT_FCMOV;
+               else
+                       *exclude_mask |= MONO_OPT_FCMOV;
+       } else {
+               *exclude_mask |= MONO_OPT_CMOV;
        }
 
        return opts;
@@ -1353,37 +1331,30 @@ mono_arch_cpu_optimizations (guint32 *exclude_mask)
 guint32
 mono_arch_cpu_enumerate_simd_versions (void)
 {
-       int eax, ebx, ecx, edx;
        guint32 sse_opts = 0;
 
-       if (cpuid (1, &eax, &ebx, &ecx, &edx)) {
-               if (edx & (1 << 25))
-                       sse_opts |= SIMD_VERSION_SSE1;
-               if (edx & (1 << 26))
-                       sse_opts |= SIMD_VERSION_SSE2;
-               if (ecx & (1 << 0))
-                       sse_opts |= SIMD_VERSION_SSE3;
-               if (ecx & (1 << 9))
-                       sse_opts |= SIMD_VERSION_SSSE3;
-               if (ecx & (1 << 19))
-                       sse_opts |= SIMD_VERSION_SSE41;
-               if (ecx & (1 << 20))
-                       sse_opts |= SIMD_VERSION_SSE42;
-       }
-
-       /* Yes, all this needs to be done to check for sse4a.
-          See: "Amd: CPUID Specification"
-        */
-       if (cpuid (0x80000000, &eax, &ebx, &ecx, &edx)) {
-               /* eax greater or equal than 0x80000001, ebx = 'htuA', ecx = DMAc', edx = 'itne'*/
-               if ((((unsigned int) eax) >= 0x80000001) && (ebx == 0x68747541) && (ecx == 0x444D4163) && (edx == 0x69746E65)) {
-                       cpuid (0x80000001, &eax, &ebx, &ecx, &edx);
-                       if (ecx & (1 << 6))
-                               sse_opts |= SIMD_VERSION_SSE4a;
-               }
-       }
+       if (mono_hwcap_x86_has_sse1)
+               sse_opts |= SIMD_VERSION_SSE1;
+
+       if (mono_hwcap_x86_has_sse2)
+               sse_opts |= SIMD_VERSION_SSE2;
+
+       if (mono_hwcap_x86_has_sse3)
+               sse_opts |= SIMD_VERSION_SSE3;
+
+       if (mono_hwcap_x86_has_ssse3)
+               sse_opts |= SIMD_VERSION_SSSE3;
+
+       if (mono_hwcap_x86_has_sse41)
+               sse_opts |= SIMD_VERSION_SSE41;
+
+       if (mono_hwcap_x86_has_sse42)
+               sse_opts |= SIMD_VERSION_SSE42;
+
+       if (mono_hwcap_x86_has_sse4a)
+               sse_opts |= SIMD_VERSION_SSE4a;
 
-       return sse_opts;        
+       return sse_opts;
 }
 
 #ifndef DISABLE_JIT
@@ -7956,13 +7927,16 @@ mono_arch_get_delegate_invoke_impls (void)
        guint8 *code;
        guint32 code_len;
        int i;
+       char *tramp_name;
 
        code = get_delegate_invoke_impl (TRUE, 0, &code_len);
-       res = g_slist_prepend (res, mono_tramp_info_create (g_strdup ("delegate_invoke_impl_has_target"), code, code_len, NULL, NULL));
+       res = g_slist_prepend (res, mono_tramp_info_create ("delegate_invoke_impl_has_target", code, code_len, NULL, NULL));
 
        for (i = 0; i < MAX_ARCH_DELEGATE_PARAMS; ++i) {
                code = get_delegate_invoke_impl (FALSE, i, &code_len);
-               res = g_slist_prepend (res, mono_tramp_info_create (g_strdup_printf ("delegate_invoke_impl_target_%d", i), code, code_len, NULL, NULL));
+               tramp_name = g_strdup_printf ("delegate_invoke_impl_target_%d", i);
+               res = g_slist_prepend (res, mono_tramp_info_create (tramp_name, code, code_len, NULL, NULL));
+               g_free (tramp_name);
        }
 
        return res;
index 00953df72456985a5c8b3ef412ff08cc964c291b..770f801a719f908544a8b8d60996e7dc0b1dbcfe 100644 (file)
 #include "mini.h"
 #include <string.h>
 
-#if !defined(__APPLE__) && !defined(PLATFORM_ANDROID)
-#include <sys/auxv.h>
-#endif
-
 #include <mono/metadata/appdomain.h>
 #include <mono/metadata/debug-helpers.h>
 #include <mono/utils/mono-mmap.h>
+#include <mono/utils/mono-hwcap-arm.h>
 
 #include "mini-arm.h"
 #include "cpu-arm.h"
 #error "ARM_FPU_NONE is defined while one of ARM_FPU_VFP/ARM_FPU_VFP_HARD is defined"
 #endif
 
-#if defined(__ARM_EABI__) && defined(__linux__) && !defined(PLATFORM_ANDROID) && !defined(__native_client__)
-#define HAVE_AEABI_READ_TP 1
-#endif
-
-#ifdef ARM_FPU_VFP_HARD
-#define ARM_FPU_VFP 1
-#endif
-
-#ifdef ARM_FPU_VFP
-#define IS_VFP 1
+#if defined(MONO_ARCH_SOFT_FLOAT_FALLBACK)
+#define IS_SOFT_FLOAT (mono_arch_is_soft_float ())
+#define IS_VFP (!mono_arch_is_soft_float ())
 #else
-#define IS_VFP 0
+#define IS_SOFT_FLOAT (FALSE)
+#define IS_VFP (TRUE)
 #endif
 
-#ifdef MONO_ARCH_SOFT_FLOAT
-#define IS_SOFT_FLOAT 1
-#else
-#define IS_SOFT_FLOAT 0
+#if defined(__ARM_EABI__) && defined(__linux__) && !defined(PLATFORM_ANDROID) && !defined(__native_client__)
+#define HAVE_AEABI_READ_TP 1
 #endif
 
 #ifdef __native_client_codegen__
@@ -101,10 +90,6 @@ static gboolean thumb2_supported = FALSE;
  */
 static gboolean eabi_supported = FALSE;
 
-/*
- * Whenever we are on arm/darwin aka the iphone.
- */
-static gboolean darwin = FALSE;
 /* 
  * Whenever to use the iphone ABI extensions:
  * http://developer.apple.com/library/ios/documentation/Xcode/Conceptual/iPhoneOSABIReference/index.html
@@ -623,13 +608,16 @@ mono_arch_get_delegate_invoke_impls (void)
        guint8 *code;
        guint32 code_len;
        int i;
+       char *tramp_name;
 
        code = get_delegate_invoke_impl (TRUE, 0, &code_len);
-       res = g_slist_prepend (res, mono_tramp_info_create (g_strdup ("delegate_invoke_impl_has_target"), code, code_len, NULL, NULL));
+       res = g_slist_prepend (res, mono_tramp_info_create ("delegate_invoke_impl_has_target", code, code_len, NULL, NULL));
 
        for (i = 0; i <= MAX_ARCH_DELEGATE_PARAMS; ++i) {
                code = get_delegate_invoke_impl (FALSE, i, &code_len);
-               res = g_slist_prepend (res, mono_tramp_info_create (g_strdup_printf ("delegate_invoke_impl_target_%d", i), code, code_len, NULL, NULL));
+               tramp_name = g_strdup_printf ("delegate_invoke_impl_target_%d", i);
+               res = g_slist_prepend (res, mono_tramp_info_create (tramp_name, code, code_len, NULL, NULL));
+               g_free (tramp_name);
        }
 
        return res;
@@ -703,13 +691,10 @@ mono_arch_get_this_arg_from_call (mgreg_t *regs, guint8 *code)
 void
 mono_arch_cpu_init (void)
 {
-#if defined(__ARM_EABI__)
-       eabi_supported = TRUE;
-#endif
 #if defined(__APPLE__)
-               i8_align = 4;
+       i8_align = 4;
 #else
-               i8_align = __alignof__ (gint64);
+       i8_align = __alignof__ (gint64);
 #endif
 }
 
@@ -785,6 +770,8 @@ create_function_wrapper (gpointer function)
 void
 mono_arch_init (void)
 {
+       const char *cpu_arch;
+
        InitializeCriticalSection (&mini_arch_mutex);
 #ifdef MONO_ARCH_SOFT_DEBUG_SUPPORTED
        if (mini_get_debug_options ()->soft_breakpoints) {
@@ -806,13 +793,55 @@ mono_arch_init (void)
        mono_aot_register_jit_icall ("mono_arm_start_gsharedvt_call", mono_arm_start_gsharedvt_call);
 #endif
 
+#if defined(__ARM_EABI__)
+       eabi_supported = TRUE;
+#endif
+
 #if defined(ARM_FPU_VFP_HARD)
        arm_fpu = MONO_ARM_FPU_VFP_HARD;
-#elif defined(ARM_FPU_VFP)
+#else
        arm_fpu = MONO_ARM_FPU_VFP;
+
+#if defined(ARM_FPU_NONE) && !defined(__APPLE__)
+       /* If we're compiling with a soft float fallback and it
+          turns out that no VFP unit is available, we need to
+          switch to soft float. We don't do this for iOS, since
+          iOS devices always have a VFP unit. */
+       if (!mono_hwcap_arm_has_vfp)
+               arm_fpu = MONO_ARM_FPU_NONE;
+#endif
+#endif
+
+       v5_supported = mono_hwcap_arm_is_v5;
+       v6_supported = mono_hwcap_arm_is_v6;
+       v7_supported = mono_hwcap_arm_is_v7;
+       v7s_supported = mono_hwcap_arm_is_v7s;
+
+#if defined(__APPLE__)
+       /* iOS is special-cased here because we don't yet
+          have a way to properly detect CPU features on it. */
+       thumb_supported = TRUE;
+       iphone_abi = TRUE;
 #else
-       arm_fpu = MONO_ARM_FPU_NONE;
+       thumb_supported = mono_hwcap_arm_has_thumb;
+       thumb2_supported = mono_hwcap_arm_has_thumb2;
 #endif
+
+       /* Format: armv(5|6|7[s])[-thumb[2]] */
+       cpu_arch = getenv ("MONO_CPU_ARCH");
+
+       /* Do this here so it overrides any detection. */
+       if (cpu_arch) {
+               if (strncmp (cpu_arch, "armv", 4) == 0) {
+                       v5_supported = cpu_arch [4] >= '5';
+                       v6_supported = cpu_arch [4] >= '6';
+                       v7_supported = cpu_arch [4] >= '7';
+                       v7s_supported = strncmp (cpu_arch, "armv7s", 6) == 0;
+               }
+
+               thumb_supported = strstr (cpu_arch, "thumb") != NULL;
+               thumb2_supported = strstr (cpu_arch, "thumb2") != NULL;
+       }
 }
 
 /*
@@ -829,115 +858,9 @@ mono_arch_cleanup (void)
 guint32
 mono_arch_cpu_optimizations (guint32 *exclude_mask)
 {
-       guint32 opts = 0;
-
-       /* Format: armv(5|6|7[s])[-thumb[2]] */
-       const char *cpu_arch = getenv ("MONO_CPU_ARCH");
-       if (cpu_arch != NULL) {
-               if (strncmp (cpu_arch, "armv", 4) == 0) {
-                       v5_supported = cpu_arch [4] >= '5';
-                       v6_supported = cpu_arch [4] >= '6';
-                       v7_supported = cpu_arch [4] >= '7';
-                       v7s_supported = strncmp (cpu_arch, "armv7s", 6) == 0;
-               }
-               thumb_supported = strstr (cpu_arch, "thumb") != NULL;
-               thumb2_supported = strstr (cpu_arch, "thumb2") != NULL;
-       } else {
-#if __APPLE__
-       thumb_supported = TRUE;
-       v5_supported = TRUE;
-       darwin = TRUE;
-       iphone_abi = TRUE;
-#elif defined(PLATFORM_ANDROID)
-       /* Android is awesome and doesn't make most of /proc (including
-        * /proc/self/auxv) available to regular processes. So we use
-        * /proc/cpuinfo instead.... */
-       char buf [512];
-       char *line;
-       FILE *file = fopen ("/proc/cpuinfo", "r");
-       if (file) {
-               while ((line = fgets (buf, 512, file))) {
-                       if (strncmp (line, "Processor", 9) == 0) {
-                               char *ver = strstr (line, "(v");
-                               if (ver) {
-                                       if (ver [2] >= '5')
-                                               v5_supported = TRUE;
-                                       if (ver [2] >= '6')
-                                               v6_supported = TRUE;
-                                       if (ver [2] >= '7')
-                                               v7_supported = TRUE;
-                                       /* TODO: Find a way to detect v7s. */
-                               }
-                               continue;
-                       }
-                       if (strncmp (line, "Features", 8) == 0) {
-                               /* TODO: Find a way to detect Thumb 2. */
-                               char *th = strstr (line, "thumb");
-                               if (th) {
-                                       thumb_supported = TRUE;
-                                       if (v5_supported)
-                                               break;
-                               }
-                               continue;
-                       }
-               }
-
-               fclose (file);
-               /*printf ("features: v5: %d, thumb: %d\n", v5_supported, thumb_supported);*/
-       }
-#else
-       /* This solution is neat because it uses the dynamic linker
-        * instead of the kernel. Thus, it works in QEMU chroots. */
-       unsigned long int hwcap;
-       unsigned long int platform;
-
-       if ((hwcap = getauxval(AT_HWCAP))) {
-               /* We use hardcoded values to avoid depending on a
-                * specific version of the hwcap.h header. */
-
-               /* HWCAP_ARM_THUMB */
-               if ((hwcap & 4) != 0)
-                       /* TODO: Find a way to detect Thumb 2. */
-                       thumb_supported = TRUE;
-       }
-
-       if ((platform = getauxval(AT_PLATFORM))) {
-               /* Actually a pointer to the platform string. */
-               const char *str = (const char *) platform;
-
-               /* Possible CPU name values (from kernel sources):
-                *
-                * - v4
-                * - v5
-                * - v5t
-                * - v6
-                * - v7
-                *
-                * Value is suffixed with the endianness ('b' or 'l').
-                * We only support little endian anyway.
-               */
-
-               if (str [1] >= '5')
-                       v5_supported = TRUE;
-
-               if (str [1] >= '6')
-                       v6_supported = TRUE;
-
-               if (str [1] >= '7')
-                       v7_supported = TRUE;
-
-               /* TODO: Find a way to detect v7s. */
-       }
-
-       /*printf ("hwcap = %i, platform = %s\n", (int) hwcap, (const char *) platform);
-       printf ("thumb = %i, thumb2 = %i, v5 = %i, v6 = %i, v7 = %i, v7s = %i\n",
-               thumb_supported, thumb2_supported, v5_supported, v6_supported, v7_supported, v7s_supported);*/
-#endif
-       }
-
        /* no arm-specific optimizations yet */
        *exclude_mask = 0;
-       return opts;
+       return 0;
 }
 
 /*
@@ -973,6 +896,14 @@ mono_arch_opcode_needs_emulation (MonoCompile *cfg, int opcode)
        return TRUE;
 }
 
+#ifdef MONO_ARCH_SOFT_FLOAT_FALLBACK
+gboolean
+mono_arch_is_soft_float (void)
+{
+       return arm_fpu == MONO_ARM_FPU_NONE;
+}
+#endif
+
 static gboolean
 is_regsize_var (MonoGenericSharingContext *gsctx, MonoType *t) {
        if (t->byref)
@@ -1052,7 +983,7 @@ mono_arch_get_global_int_regs (MonoCompile *cfg)
        regs = g_list_prepend (regs, GUINT_TO_POINTER (ARMREG_V1));
        regs = g_list_prepend (regs, GUINT_TO_POINTER (ARMREG_V2));
        regs = g_list_prepend (regs, GUINT_TO_POINTER (ARMREG_V3));
-       if (darwin)
+       if (iphone_abi)
                /* V4=R7 is used as a frame pointer, but V7=R10 is preserved */
                regs = g_list_prepend (regs, GUINT_TO_POINTER (ARMREG_V7));
        else
@@ -4780,8 +4711,6 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                        break;
 
                /* floating point opcodes */
-#if defined(ARM_FPU_VFP)
-
                case OP_R8CONST:
                        if (cfg->compile_aot) {
                                ARM_FLDD (code, ins->dreg, ARMREG_PC, 0);
@@ -4863,9 +4792,6 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                                ARM_FMRRD (code, ARMREG_R0, ARMREG_R1, ins->sreg1);
                        }
                        break;
-
-#endif
-
                case OP_FCONV_TO_I1:
                        code = emit_float_to_int (cfg, code, ins->dreg, ins->sreg1, 1, TRUE);
                        break;
@@ -4927,7 +4853,6 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                                ARM_MOV_REG_REG (code, ins->dreg, ins->sreg1);
                        break;
                }
-#if defined(ARM_FPU_VFP)
                case OP_FADD:
                        ARM_VFP_ADDD (code, ins->dreg, ins->sreg1, ins->sreg2);
                        break;
@@ -4943,7 +4868,6 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                case OP_FNEG:
                        ARM_NEGD (code, ins->dreg, ins->sreg1);
                        break;
-#endif
                case OP_FREM:
                        /* emulated */
                        g_assert_not_reached ();
@@ -5258,7 +5182,6 @@ mono_arch_emit_prolog (MonoCompile *cfg)
                 * the frame, so we keep using our own frame pointer.
                 * FIXME: Optimize this.
                 */
-               g_assert (darwin);
                ARM_PUSH (code, (1 << ARMREG_R7) | (1 << ARMREG_LR));
                ARM_MOV_REG_REG (code, ARMREG_R7, ARMREG_SP);
                prev_sp_offset += 8; /* r7 and lr */
@@ -6651,23 +6574,29 @@ mono_arch_set_target (char *mtriple)
 {
        /* The GNU target triple format is not very well documented */
        if (strstr (mtriple, "armv7")) {
+               v5_supported = TRUE;
                v6_supported = TRUE;
                v7_supported = TRUE;
        }
        if (strstr (mtriple, "armv6")) {
+               v5_supported = TRUE;
                v6_supported = TRUE;
        }
        if (strstr (mtriple, "armv7s")) {
                v7s_supported = TRUE;
        }
        if (strstr (mtriple, "thumbv7s")) {
+               v5_supported = TRUE;
+               v6_supported = TRUE;
+               v7_supported = TRUE;
                v7s_supported = TRUE;
+               thumb_supported = TRUE;
                thumb2_supported = TRUE;
        }
        if (strstr (mtriple, "darwin") || strstr (mtriple, "ios")) {
                v5_supported = TRUE;
+               v6_supported = TRUE;
                thumb_supported = TRUE;
-               darwin = TRUE;
                iphone_abi = TRUE;
        }
        if (strstr (mtriple, "gnueabi"))
index 86859aaf37b1e3252ec964d53460d308610afd40..913dafc5e0d7480dcd205ad9dd931b965cd5058d 100644 (file)
@@ -15,8 +15,8 @@
 #define kNaClLengthOfCallImm 4
 #endif
 
-#if defined(ARM_FPU_NONE) || (defined(__ARM_EABI__) && !defined(ARM_FPU_VFP) && !defined(ARM_FPU_VFP_HARD))
-#define MONO_ARCH_SOFT_FLOAT 1
+#if defined(ARM_FPU_NONE)
+#define MONO_ARCH_SOFT_FLOAT_FALLBACK 1
 #endif
 
 #ifdef ARM_FPU_VFP_HARD
@@ -36,9 +36,9 @@
 #if defined(ARM_FPU_VFP)
 #define ARM_FP_MODEL "vfp"
 #elif defined(ARM_FPU_NONE)
-#define ARM_FP_MODEL "soft-float"
+#define ARM_FP_MODEL "vfp+fallback"
 #elif defined(ARM_FPU_VFP_HARD)
-#define ARM_FP_MODEL "vfp(hardfp-abi)"
+#define ARM_FP_MODEL "vfp+hard"
 #else
 #error "At least one of ARM_FPU_NONE, ARM_FPU_VFP or ARM_FPU_VFP_HARD must be defined."
 #endif
 #define MONO_ARCH_CALLEE_REGS ((1<<ARMREG_R0) | (1<<ARMREG_R1) | (1<<ARMREG_R2) | (1<<ARMREG_R3) | (1<<ARMREG_IP))
 #define MONO_ARCH_CALLEE_SAVED_REGS ((1<<ARMREG_V1) | (1<<ARMREG_V2) | (1<<ARMREG_V3) | (1<<ARMREG_V4) | (1<<ARMREG_V5) | (1<<ARMREG_V6) | (1<<ARMREG_V7))
 
-#if defined(ARM_FPU_VFP) || defined(ARM_FPU_VFP_HARD)
 /* Every double precision vfp register, d0/d1 is reserved for a scratch reg */
 #define MONO_ARCH_CALLEE_FREGS 0x55555550
-#else
-#define MONO_ARCH_CALLEE_FREGS 0xf
-#endif
 #define MONO_ARCH_CALLEE_SAVED_FREGS 0
 
 #define MONO_ARCH_USE_FPSTACK FALSE
 
 #define MONO_ARCH_INST_SREG2_MASK(ins) (0)
 
-#ifdef MONO_ARCH_SOFT_FLOAT
-#define MONO_ARCH_INST_FIXED_REG(desc) (((desc) == 'l' || (desc == 'f') || (desc == 'g')) ? ARM_LSW_REG: (((desc) == 'a') ? ARMREG_R0 : -1))
-#define MONO_ARCH_INST_IS_REGPAIR(desc) ((desc) == 'l' || (desc) == 'L' || (desc) == 'f' || (desc) == 'g')
-#define MONO_ARCH_INST_IS_FLOAT(desc) (FALSE)
-#else
-#define MONO_ARCH_INST_FIXED_REG(desc) (((desc) == 'l')? ARM_LSW_REG: (((desc) == 'a') ? ARMREG_R0 : -1))
-#define MONO_ARCH_INST_IS_REGPAIR(desc) (desc == 'l' || desc == 'L')
-#define MONO_ARCH_INST_IS_FLOAT(desc) ((desc == 'f') || (desc == 'g'))
-#endif
-#define MONO_ARCH_INST_REGPAIR_REG2(desc,hreg1) (desc == 'l'  || (desc == 'f') || (desc == 'g')? ARM_MSW_REG : -1)
+#define MONO_ARCH_INST_FIXED_REG(desc) \
+       (mono_arch_is_soft_float () ? \
+       ((desc) == 'l' || (desc) == 'f' || (desc) == 'g' ? ARM_LSW_REG : (desc) == 'a' ? ARMREG_R0 : -1) : \
+       ((desc) == 'l' ? ARM_LSW_REG : (desc) == 'a' ? ARMREG_R0 : -1))
+
+#define MONO_ARCH_INST_IS_REGPAIR(desc) \
+       (mono_arch_is_soft_float () ? \
+       ((desc) == 'l' || (desc) == 'L' || (desc) == 'f' || (desc) == 'g') : \
+       ((desc) == 'l' || (desc) == 'L'))
+
+#define MONO_ARCH_INST_IS_FLOAT(desc) \
+       (mono_arch_is_soft_float () ? \
+       (FALSE) : \
+       ((desc) == 'f' || (desc) == 'g'))
+
+#define MONO_ARCH_INST_REGPAIR_REG2(desc,hreg1) ((desc) == 'l' || (desc) == 'f' || (desc) == 'g' ? ARM_MSW_REG : -1)
 
 #define MONO_ARCH_FRAME_ALIGNMENT 8
 
index 0d439acc63618b64b2c2904b25cab84699fa8ef2..9088322bbfdbe773066b2ec870123f396141d90a 100644 (file)
@@ -590,7 +590,6 @@ thread_suspend_func (gpointer user_data, void *sigctx, MonoContext *ctx)
 
        if (!tls) {
                /* Happens during startup */
-               tls->unwind_state.valid = FALSE;
                return;
        }
 
index f025ec723c9cf67f09b4b362e21833f3df221ca3..6965524c90976a68efaeaea3e192bc5063592b1f 100644 (file)
@@ -2125,6 +2125,8 @@ is_async_state_machine_class (MonoClass *klass)
        static MonoClass *iclass;
        static gboolean iclass_set;
 
+       return FALSE;
+
        if (!iclass_set) {
                iclass = mono_class_from_name (mono_defaults.corlib, "System.Runtime.CompilerServices", "IAsyncStateMachine");
                mono_memory_barrier ();
@@ -2145,6 +2147,8 @@ is_async_method (MonoMethod *method)
        static MonoClass *attr_class;
        static gboolean attr_class_set;
 
+       return FALSE;
+
        if (!attr_class_set) {
                attr_class = mono_class_from_name (mono_defaults.corlib, "System.Runtime.CompilerServices", "AsyncStateMachineAttribute");
                mono_memory_barrier ();
index c45305e2668a99e960a45797daec97f6011df4a3..113d4a1fcdea9cd25f29667375cddf72e1ea3922 100644 (file)
@@ -21,6 +21,7 @@
 #include <mono/metadata/threads.h>
 #include <mono/metadata/profiler-private.h>
 #include <mono/utils/mono-math.h>
+#include <mono/utils/mono-hwcap-ia64.h>
 
 #include "trace.h"
 #include "mini-ia64.h"
index a03e94fbebf4abac5e6241ad7909b03e93ce3649..956a64a5c388b1bd911ac278570ccde722875c80 100644 (file)
@@ -67,6 +67,8 @@
 
 using namespace llvm;
 
+#ifndef MONO_CROSS_COMPILE
+
 class MonoJITMemoryManager : public JITMemoryManager
 {
 private:
@@ -234,6 +236,8 @@ MonoJITMemoryManager::endExceptionTable(const Function *F, unsigned char *TableS
 {
 }
 
+#endif /* !MONO_CROSS_COMPILE */
+
 class MonoJITEventListener : public JITEventListener {
 
 public:
@@ -273,7 +277,9 @@ public:
        }
 };
 
+#ifndef MONO_CROSS_COMPILE
 static MonoJITMemoryManager *mono_mm;
+#endif
 static MonoJITEventListener *mono_event_listener;
 
 static FunctionPassManager *fpm;
@@ -518,6 +524,8 @@ force_pass_linking (void)
       (void) llvm::createSinkingPass();
 }
 
+#ifndef MONO_CROSS_COMPILE
+
 LLVMExecutionEngineRef
 mono_llvm_create_ee (LLVMModuleProviderRef MP, AllocCodeMemoryCb *alloc_cb, FunctionEmittedCb *emitted_cb, ExceptionTableCb *exception_cb, DlSymCb *dlsym_cb)
 {
@@ -640,3 +648,35 @@ mono_llvm_dispose_ee (LLVMExecutionEngineRef ee)
 
        delete fpm;
 }
+
+#else
+
+LLVMExecutionEngineRef
+mono_llvm_create_ee (LLVMModuleProviderRef MP, AllocCodeMemoryCb *alloc_cb, FunctionEmittedCb *emitted_cb, ExceptionTableCb *exception_cb, DlSymCb *dlsym_cb)
+{
+       g_assert_not_reached ();
+       return NULL;
+}
+
+void
+mono_llvm_dispose_ee (LLVMExecutionEngineRef ee)
+{
+       g_assert_not_reached ();
+}
+
+/* Not linked in */
+void
+LLVMAddGlobalMapping(LLVMExecutionEngineRef EE, LLVMValueRef Global,
+                                        void* Addr)
+{
+       g_assert_not_reached ();
+}
+
+void*
+LLVMGetPointerToGlobal(LLVMExecutionEngineRef EE, LLVMValueRef Global)
+{
+       g_assert_not_reached ();
+       return NULL;
+}
+
+#endif /* !MONO_CROSS_COMPILE */
index dcfaf366102cdb815e0d2d98c0c519c4d7bac3fe..3474e0d7bbc0c7a4950b1d438da9b59021d215bd 100644 (file)
@@ -934,12 +934,12 @@ convert_full (EmitContext *ctx, LLVMValueRef v, LLVMTypeRef dtype, gboolean is_u
                if (LLVMGetTypeKind (stype) == LLVMPointerTypeKind)
                        return LLVMBuildPtrToInt (ctx->builder, v, dtype, "");
 
-#ifdef MONO_ARCH_SOFT_FLOAT
-               if (stype == LLVMInt32Type () && dtype == LLVMFloatType ())
-                       return LLVMBuildBitCast (ctx->builder, v, dtype, "");
-               if (stype == LLVMInt32Type () && dtype == LLVMDoubleType ())
-                       return LLVMBuildBitCast (ctx->builder, LLVMBuildZExt (ctx->builder, v, LLVMInt64Type (), ""), dtype, "");
-#endif
+               if (mono_arch_is_soft_float ()) {
+                       if (stype == LLVMInt32Type () && dtype == LLVMFloatType ())
+                               return LLVMBuildBitCast (ctx->builder, v, dtype, "");
+                       if (stype == LLVMInt32Type () && dtype == LLVMDoubleType ())
+                               return LLVMBuildBitCast (ctx->builder, LLVMBuildZExt (ctx->builder, v, LLVMInt64Type (), ""), dtype, "");
+               }
 
                if (LLVMGetTypeKind (stype) == LLVMVectorTypeKind && LLVMGetTypeKind (dtype) == LLVMVectorTypeKind)
                        return LLVMBuildBitCast (ctx->builder, v, dtype, "");
index 12d17c399a1fd074d5aa99079e52cc79c50c349f..c219458d67983c591a23d7465fff81b7857ea083 100644 (file)
@@ -18,6 +18,7 @@
 #include <mono/metadata/appdomain.h>
 #include <mono/metadata/debug-helpers.h>
 #include <mono/utils/mono-mmap.h>
+#include <mono/utils/mono-hwcap-mips.h>
 
 #include <mono/arch/mips/mips-codegen.h>
 
@@ -31,7 +32,8 @@
 #define ALWAYS_SAVE_RA         1       /* call-handler & switch currently clobber ra */
 
 #define PROMOTE_R4_TO_R8       1       /* promote single values in registers to doubles */
-#define USE_MUL                        1       /* use mul instead of mult/mflo for multiply */
+#define USE_MUL                        0       /* use mul instead of mult/mflo for multiply
+                                                          remember to update cpu-mips.md if you change this */
 
 /* Emit a call sequence to 'v', using 'D' as a scratch register if necessary */
 #define mips_call(c,D,v) do {  \
@@ -596,13 +598,16 @@ mono_arch_get_delegate_invoke_impls (void)
        guint8 *code;
        guint32 code_len;
        int i;
+       char *tramp_name;
 
        code = get_delegate_invoke_impl (TRUE, 0, &code_len);
-       res = g_slist_prepend (res, mono_tramp_info_create (g_strdup ("delegate_invoke_impl_has_target"), code, code_len, NULL, NULL));
+       res = g_slist_prepend (res, mono_tramp_info_create ("delegate_invoke_impl_has_target", code, code_len, NULL, NULL));
 
        for (i = 0; i <= MAX_ARCH_DELEGATE_PARAMS; ++i) {
                code = get_delegate_invoke_impl (FALSE, i, &code_len);
-               res = g_slist_prepend (res, mono_tramp_info_create (g_strdup_printf ("delegate_invoke_impl_target_%d", i), code, code_len, NULL, NULL));
+               tramp_name = g_strdup_printf ("delegate_invoke_impl_target_%d", i);
+               res = g_slist_prepend (res, mono_tramp_info_create (tramp_name, code, code_len, NULL, NULL));
+               g_free (tramp_name);
        }
 
        return res;
index 13ea174f78debb8dae960233da586852e66e5b94..d8c3367214f7c232b6af94d10c0adcedb3ec8b71 100644 (file)
@@ -16,6 +16,7 @@
 #include <mono/metadata/debug-helpers.h>
 #include <mono/utils/mono-proclib.h>
 #include <mono/utils/mono-mmap.h>
+#include <mono/utils/mono-hwcap-ppc.h>
 
 #include "mini-ppc.h"
 #ifdef TARGET_POWERPC64
@@ -442,13 +443,16 @@ mono_arch_get_delegate_invoke_impls (void)
        guint8 *code;
        guint32 code_len;
        int i;
+       char *tramp_name;
 
        code = get_delegate_invoke_impl (TRUE, 0, &code_len, TRUE);
-       res = g_slist_prepend (res, mono_tramp_info_create (g_strdup ("delegate_invoke_impl_has_target"), code, code_len, NULL, NULL));
+       res = g_slist_prepend (res, mono_tramp_info_create ("delegate_invoke_impl_has_target", code, code_len, NULL, NULL));
 
        for (i = 0; i < MAX_ARCH_DELEGATE_PARAMS; ++i) {
                code = get_delegate_invoke_impl (FALSE, i, &code_len, TRUE);
-               res = g_slist_prepend (res, mono_tramp_info_create (g_strdup_printf ("delegate_invoke_impl_target_%d", i), code, code_len, NULL, NULL));
+               tramp_name = g_strdup_printf ("delegate_invoke_impl_target_%d", i);
+               res = g_slist_prepend (res, mono_tramp_info_create (tramp_name, code, code_len, NULL, NULL));
+               g_free (tramp_name);
        }
 
        return res;
@@ -520,32 +524,6 @@ typedef struct {
        long int value;
 } AuxVec;
 
-#ifdef USE_ENVIRON_HACK
-static AuxVec*
-linux_find_auxv (int *count)
-{
-       AuxVec *vec;
-       int c = 0;
-       char **result = __environ;
-       /* Scan over the env vector looking for the ending NULL */
-       for (; *result != NULL; ++result) {
-       }
-       /* Bump the pointer one more step, which should be the auxv. */
-       ++result;
-       vec = (AuxVec *)result;
-       if (vec->type != 22 /*AT_IGNOREPPC*/) {
-               *count = 0;
-               return NULL;
-       }
-       while (vec->type != 0 /*AT_NULL*/) {
-               vec++;
-               c++;
-       }
-       *count = c;
-       return (AuxVec *)result;
-}
-#endif
-
 #define MAX_AUX_ENTRIES 128
 /* 
  * PPC_FEATURE_POWER4, PPC_FEATURE_POWER5, PPC_FEATURE_POWER5_PLUS, PPC_FEATURE_CELL,
@@ -575,11 +553,12 @@ mono_arch_init (void)
 #if defined(MONO_CROSS_COMPILE)
 #elif defined(__APPLE__)
        int mib [3];
-       size_t len;
+       size_t len = sizeof (cachelinesize);
+
        mib [0] = CTL_HW;
        mib [1] = HW_CACHELINE;
-       len = sizeof (cachelinesize);
-       if (sysctl (mib, 2, &cachelinesize, (size_t*)&len, NULL, 0) == -1) {
+
+       if (sysctl (mib, 2, &cachelinesize, &len, NULL, 0) == -1) {
                perror ("sysctl");
                cachelinesize = 128;
        } else {
@@ -590,38 +569,18 @@ mono_arch_init (void)
        int i, vec_entries = 0;
        /* sadly this will work only with 2.6 kernels... */
        FILE* f = fopen ("/proc/self/auxv", "rb");
+
        if (f) {
                vec_entries = fread (&vec, sizeof (AuxVec), MAX_AUX_ENTRIES, f);
                fclose (f);
-#ifdef USE_ENVIRON_HACK
-       } else {
-               AuxVec *evec = linux_find_auxv (&vec_entries);
-               if (vec_entries)
-                       memcpy (&vec, evec, sizeof (AuxVec) * MIN (vec_entries, MAX_AUX_ENTRIES));
-#endif
        }
+
        for (i = 0; i < vec_entries; i++) {
                int type = vec [i].type;
+
                if (type == 19) { /* AT_DCACHEBSIZE */
                        cachelinesize = vec [i].value;
                        continue;
-               } else if (type == 16) { /* AT_HWCAP */
-                       if (vec [i].value & 0x00002000 /*PPC_FEATURE_ICACHE_SNOOP*/)
-                               cpu_hw_caps |= PPC_ICACHE_SNOOP;
-                       if (vec [i].value & ISA_2X)
-                               cpu_hw_caps |= PPC_ISA_2X;
-                       if (vec [i].value & ISA_64)
-                               cpu_hw_caps |= PPC_ISA_64;
-                       if (vec [i].value & ISA_MOVE_FPR_GPR)
-                               cpu_hw_caps |= PPC_MOVE_FPR_GPR;
-                       continue;
-               } else if (type == 15) { /* AT_PLATFORM */
-                       const char *arch = (char*)vec [i].value;
-                       if (strcmp (arch, "ppc970") == 0 ||
-                                       (strncmp (arch, "power", 5) == 0 && arch [5] >= '4' && arch [5] <= '7'))
-                               cpu_hw_caps |= PPC_MULTIPLE_LS_UNITS;
-                       /*printf ("cpu: %s\n", (char*)vec [i].value);*/
-                       continue;
                }
        }
 #elif defined(G_COMPILER_CODEWARRIOR)
@@ -630,13 +589,31 @@ mono_arch_init (void)
 #else
 //#error Need a way to get cache line size
 #endif
+
+       if (mono_hwcap_ppc_has_icache_snoop)
+               cpu_hw_caps |= PPC_ICACHE_SNOOP;
+
+       if (mono_hwcap_ppc_is_isa_2x)
+               cpu_hw_caps |= PPC_ISA_2X;
+
+       if (mono_hwcap_ppc_is_isa_64)
+               cpu_hw_caps |= PPC_ISA_64;
+
+       if (mono_hwcap_ppc_has_move_fpr_gpr)
+               cpu_hw_caps |= PPC_MOVE_FPR_GPR;
+
+       if (mono_hwcap_ppc_has_multiple_ls_units)
+               cpu_hw_caps |= PPC_MULTIPLE_LS_UNITS;
+
        if (!cachelinesize)
                cachelinesize = 32;
+
        if (!cachelineinc)
                cachelineinc = cachelinesize;
 
        if (mono_cpu_count () > 1)
                cpu_hw_caps |= PPC_SMP_CAPABLE;
+
        InitializeCriticalSection (&mini_arch_mutex);
 
        ss_trigger_page = mono_valloc (NULL, mono_pagesize (), MONO_MMAP_READ|MONO_MMAP_32BIT);
index 43677fc3ec9af85edfff546a6ef25c921c73a99e..c405aeb1d2ac6c022d87f6f27c9fc79fea88faf5 100644 (file)
@@ -263,6 +263,7 @@ if (ins->inst_target_bb->native_offset) {                                   \
 #include <mono/metadata/profiler-private.h>
 #include <mono/utils/mono-math.h>
 #include <mono/utils/mono-mmap.h>
+#include <mono/utils/mono-hwcap-s390x.h>
 
 #include "mini-s390x.h"
 #include "cpu-s390x.h"
@@ -384,8 +385,6 @@ int mono_exc_esp_offset = 0;
 
 static int indent_level = 0;
 
-int has_ld = 0;
-
 static gint appdomain_tls_offset = -1,
            lmf_tls_offset = -1,
            lmf_addr_tls_offset = -1;
@@ -1241,24 +1240,6 @@ handle_enum:
 
 /*========================= End of Function ========================*/
 
-/*------------------------------------------------------------------*/
-/*                                                                  */
-/* Name                - catch_SIGILL                                      */
-/*                                                                  */
-/* Function    - Catch SIGILL as a result of testing for long      */
-/*               displacement facility.                            */
-/*                                                                 */
-/*------------------------------------------------------------------*/
-
-void
-catch_SIGILL(int sigNo, siginfo_t *info, void *act) {
-
-       has_ld = 0;
-
-}
-
-/*========================= End of Function ========================*/
-
 /*------------------------------------------------------------------*/
 /*                                                                  */
 /* Name                - mono_arch_cpu_init                                */
@@ -1271,35 +1252,6 @@ catch_SIGILL(int sigNo, siginfo_t *info, void *act) {
 void
 mono_arch_cpu_init (void)
 {
-       struct sigaction sa,
-                        *oldSa = NULL;
-       guint mode = 1;
-
-       /*--------------------------------------*/      
-       /* Set default rounding mode for FP     */
-       /*--------------------------------------*/      
-       __asm__ ("SRNM\t%0\n\t"
-               : : "m" (mode));
-
-       /*--------------------------------------*/      
-       /* Determine if we have long displace-  */
-       /* ment facility on this processor      */
-       /*--------------------------------------*/      
-       sa.sa_sigaction = catch_SIGILL;
-       sigemptyset (&sa.sa_mask);
-       sa.sa_flags = SA_SIGINFO;
-
-       sigaction (SIGILL, &sa, oldSa);
-
-       /*--------------------------------------*/
-       /* We test by executing the STY inst    */
-       /*--------------------------------------*/
-       __asm__ ("LGHI\t0,1\n\t"
-                "LA\t1,%0\n\t"
-                ".byte\t0xe3,0x00,0x10,0x00,0x00,0x50\n\t"
-               : "=m" (has_ld) : : "0", "1");
-
-       sigaction (SIGILL, oldSa, NULL);
 }
 
 /*========================= End of Function ========================*/
@@ -2697,7 +2649,7 @@ mono_arch_instrument_prolog (MonoCompile *cfg, void *func, void *p,
        if (cfg->method->save_lmf)
                parmOffset -= sizeof(MonoLMF);
        fpOffset   = parmOffset + (5*sizeof(gpointer));
-       if ((!has_ld) && (fpOffset > 4096)) {
+       if ((!mono_hwcap_s390x_has_ld) && (fpOffset > 4096)) {
                s390_lgr (code, s390_r12, STK_BASE);
                baseReg = s390_r12;
                while (fpOffset > 4096) {
@@ -2710,7 +2662,7 @@ mono_arch_instrument_prolog (MonoCompile *cfg, void *func, void *p,
        }       
 
        s390_stmg (code, s390_r2, s390_r6, STK_BASE, parmOffset);
-       if (has_ld) {
+       if (mono_hwcap_s390x_has_ld) {
                s390_stdy (code, s390_f0, 0, STK_BASE, fpOffset);
                s390_stdy (code, s390_f2, 0, STK_BASE, fpOffset+sizeof(gdouble));
                s390_stdy (code, s390_f4, 0, STK_BASE, fpOffset+2*sizeof(gdouble));
@@ -2726,7 +2678,7 @@ mono_arch_instrument_prolog (MonoCompile *cfg, void *func, void *p,
        s390_llong(code, cfg->method);
        s390_llong(code, func);
        s390_lg   (code, s390_r2, 0, s390_r13, 4);
-       if (has_ld)
+       if (mono_hwcap_s390x_has_ld)
                s390_lay  (code, s390_r3, 0, STK_BASE, parmOffset);
        else
                s390_la   (code, s390_r3, 0, baseReg, parmOffset);
@@ -2734,7 +2686,7 @@ mono_arch_instrument_prolog (MonoCompile *cfg, void *func, void *p,
        s390_aghi (code, s390_r4, cfg->stack_usage);
        s390_lg   (code, s390_r1, 0, s390_r13, 12);
        s390_basr (code, s390_r14, s390_r1);
-       if (has_ld) {
+       if (mono_hwcap_s390x_has_ld) {
                s390_ldy  (code, s390_f6, 0, STK_BASE, fpOffset+3*sizeof(gdouble));
                s390_ldy  (code, s390_f4, 0, STK_BASE, fpOffset+2*sizeof(gdouble));
                s390_ldy  (code, s390_f2, 0, STK_BASE, fpOffset+sizeof(gdouble));
@@ -5999,13 +5951,16 @@ mono_arch_get_delegate_invoke_impls (void)
        guint8 *code;
        guint32 code_len;
        int i;
+       char *tramp_name;
 
        code = get_delegate_invoke_impl (TRUE, 0, &code_len, TRUE);
-       res = g_slist_prepend (res, mono_tramp_info_create (g_strdup ("delegate_invoke_impl_has_target"), code, code_len, NULL, NULL));
+       res = g_slist_prepend (res, mono_tramp_info_create ("delegate_invoke_impl_has_target", code, code_len, NULL, NULL));
 
        for (i = 0; i < MAX_ARCH_DELEGATE_PARAMS; ++i) {
                code = get_delegate_invoke_impl (FALSE, i, &code_len, TRUE);
-               res = g_slist_prepend (res, mono_tramp_info_create (g_strdup_printf ("delegate_invoke_impl_target_%d", i), code, code_len, NULL, NULL));
+               tramp_name = g_strdup_printf ("delegate_invoke_impl_target_%d", i);
+               res = g_slist_prepend (res, mono_tramp_info_create (tramp_name, code, code_len, NULL, NULL));
+               g_free (tramp_name);
        }
 
        return res;
index 2300f39c74ae25372174e6f9ef049cb6f7a1051b..9a0e4ec1508d9cccd85f6678f7387f2870833132 100644 (file)
@@ -18,7 +18,6 @@
 #include <unistd.h>
 
 #ifndef __linux__
-#include <sys/systeminfo.h>
 #include <thread.h>
 #endif
 
@@ -29,6 +28,7 @@
 #include <mono/metadata/debug-helpers.h>
 #include <mono/metadata/tokentype.h>
 #include <mono/utils/mono-math.h>
+#include <mono/utils/mono-hwcap-sparc.h>
 
 #include "mini-sparc.h"
 #include "trace.h"
 
 #endif
 
-/* Whenever the CPU supports v9 instructions */
-static gboolean sparcv9 = FALSE;
-
 /* Whenever this is a 64bit executable */
 #if SPARCV9
 static gboolean v64 = TRUE;
@@ -202,9 +199,6 @@ mono_arch_fregname (int reg) {
 void
 mono_arch_cpu_init (void)
 {
-       guint32 dummy;
-       /* make sure sparcv9 is initialized for embedded use */
-       mono_arch_cpu_optimizations(&dummy);
 }
 
 /*
@@ -229,35 +223,16 @@ mono_arch_cleanup (void)
 guint32
 mono_arch_cpu_optimizations (guint32 *exclude_mask)
 {
-       char buf [1024];
        guint32 opts = 0;
 
        *exclude_mask = 0;
 
-#ifndef __linux__
-       if (!sysinfo (SI_ISALIST, buf, 1024))
-               g_assert_not_reached ();
-#else
-       /* From glibc.  If the getpagesize is 8192, we're on sparc64, which
-        * (in)directly implies that we're a v9 or better.
-        * Improvements to this are greatly accepted...
-        * Also, we don't differentiate between v7 and v8.  I sense SIGILL
-        * sniffing in my future.  
-        */
-       if (getpagesize() == 8192)
-               strcpy (buf, "sparcv9");
-       else
-               strcpy (buf, "sparcv8");
-#endif
-
-       /* 
+       /*
         * On some processors, the cmov instructions are even slower than the
         * normal ones...
         */
-       if (strstr (buf, "sparcv9")) {
+       if (mono_hwcap_sparc_is_v9)
                opts |= MONO_OPT_CMOV | MONO_OPT_FCMOV;
-               sparcv9 = TRUE;
-       }
        else
                *exclude_mask |= MONO_OPT_CMOV | MONO_OPT_FCMOV;
 
@@ -306,7 +281,7 @@ mono_arch_flush_icache (guint8 *code, gint size)
         *
         * Sparcv8 needs a flush every 8 bytes.
         */
-       align = (sparcv9 ? 32 : 8);
+       align = (mono_hwcap_sparc_is_v9 ? 32 : 8);
 
        start &= ~(align - 1);
        end = (end + (align - 1)) & ~(align - 1);
@@ -370,7 +345,7 @@ mono_arch_is_inst_imm (gint64 imm)
 
 gboolean 
 mono_sparc_is_v9 (void) {
-       return sparcv9;
+       return mono_hwcap_sparc_is_v9;
 }
 
 gboolean 
@@ -1510,7 +1485,7 @@ else { \
 #define EMIT_COND_SYSTEM_EXCEPTION_GENERAL(ins,cond,sexc_name,filldelay,icc) do {     \
                mono_add_patch_info (cfg, (guint8*)(code) - (cfg)->native_code,   \
                                    MONO_PATCH_INFO_EXC, sexc_name);  \
-        if (sparcv9 && ((icc) != sparc_icc_short)) {          \
+        if (mono_hwcap_sparc_is_v9 && ((icc) != sparc_icc_short)) {          \
            sparc_branchp (code, 0, (cond), (icc), 0, 0); \
         } \
         else { \
@@ -1741,7 +1716,7 @@ mono_arch_peephole_pass_2 (MonoCompile *cfg, MonoBasicBlock *bb)
                                ((ins->inst_offset == last_ins->inst_offset - 4)) &&
                                (ins->inst_imm == 0) &&
                                (last_ins->inst_imm == 0)) {
-                               if (sparcv9) {
+                               if (mono_hwcap_sparc_is_v9) {
                                        last_ins->opcode = OP_STOREI8_MEMBASE_IMM;
                                        last_ins->inst_offset = ins->inst_offset;
                                        MONO_DELETE_INS (bb, ins);
@@ -3020,10 +2995,10 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                                sparc_branch (code, 0, sparc_be, 0);
                                /* delay slot */
                                sparc_set (code, 0, sparc_o7);
-                               sparc_sub_imm (code, 0, size_reg, sparcv9 ? 8 : 4, size_reg);
+                               sparc_sub_imm (code, 0, size_reg, mono_hwcap_sparc_is_v9 ? 8 : 4, size_reg);
                                /* start of loop */
                                br [1] = code;
-                               if (sparcv9)
+                               if (mono_hwcap_sparc_is_v9)
                                        sparc_stx (code, sparc_g0, ins->dreg, sparc_o7);
                                else
                                        sparc_st (code, sparc_g0, ins->dreg, sparc_o7);
@@ -3032,7 +3007,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                                sparc_branch (code, 0, sparc_bl, 0);
                                sparc_patch (br [2], br [1]);
                                /* delay slot */
-                               sparc_add_imm (code, 0, sparc_o7, sparcv9 ? 8 : 4, sparc_o7);
+                               sparc_add_imm (code, 0, sparc_o7, mono_hwcap_sparc_is_v9 ? 8 : 4, sparc_o7);
                                sparc_patch (br [0], code);
                        }
                        break;
@@ -3066,7 +3041,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                                if (offset <= 16) {
                                        i = 0;
                                        while (i < offset) {
-                                               if (sparcv9) {
+                                               if (mono_hwcap_sparc_is_v9) {
                                                        sparc_stx_imm (code, sparc_g0, ins->dreg, i);
                                                        i += 8;
                                                }
@@ -3078,10 +3053,10 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                                }
                                else {
                                        sparc_set (code, offset, sparc_o7);
-                                       sparc_sub_imm (code, 0, sparc_o7, sparcv9 ? 8 : 4, sparc_o7);
+                                       sparc_sub_imm (code, 0, sparc_o7, mono_hwcap_sparc_is_v9 ? 8 : 4, sparc_o7);
                                        /* beginning of loop */
                                        br [0] = code;
-                                       if (sparcv9)
+                                       if (mono_hwcap_sparc_is_v9)
                                                sparc_stx (code, sparc_g0, ins->dreg, sparc_o7);
                                        else
                                                sparc_st (code, sparc_g0, ins->dreg, sparc_o7);
@@ -3089,7 +3064,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                                        br [1] = code;
                                        sparc_branch (code, 0, sparc_bne, 0);
                                        /* delay slot */
-                                       sparc_sub_imm (code, 0, sparc_o7, sparcv9 ? 8 : 4, sparc_o7);
+                                       sparc_sub_imm (code, 0, sparc_o7, mono_hwcap_sparc_is_v9 ? 8 : 4, sparc_o7);
                                        sparc_patch (br [1], br [0]);
                                }
                        }
@@ -3284,7 +3259,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                case OP_IBGE_UN:
                case OP_IBLE:
                case OP_IBLE_UN: {
-                       if (sparcv9)
+                       if (mono_hwcap_sparc_is_v9)
                                EMIT_COND_BRANCH_PREDICTED (ins, opcode_to_sparc_cond (ins->opcode), 1, 1);
                        else
                                EMIT_COND_BRANCH (ins, opcode_to_sparc_cond (ins->opcode), 1, 1);
index 0e48c3580655eb980208740d73432c596fa3eca6..c3f07f16d8a546c7467cf4e5ecae0ccd117cc27a 100644 (file)
@@ -525,7 +525,7 @@ common_call_trampoline (mgreg_t *regs, guint8 *code, MonoMethod *m, guint8* tram
                        actual_method = vt->klass->vtable [displacement];
                }
 
-               if (method_inst) {
+               if (method_inst || m->wrapper_type) {
                        MonoGenericContext context = { NULL, NULL };
 
                        if (m->is_inflated)
@@ -1675,15 +1675,11 @@ static const char*tramp_names [MONO_TRAMPOLINE_NUM] = {
        "aot_plt",
        "delegate",
        "restore_stack_prot",
-#ifndef DISABLE_REMOTING
        "generic_virtual_remoting",
-#endif
        "monitor_enter",
        "monitor_exit",
        "vcall",
-#ifdef MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD
        "handler_block_guard"
-#endif
 };
 
 /*
index 141cc6b4f13a64bd48b305d8ce673c8bf62167df..c16b1039422b6df0543ea12391e2186394bd72fe 100644 (file)
@@ -27,6 +27,7 @@
 #include <mono/utils/mono-counters.h>
 #include <mono/utils/mono-mmap.h>
 #include <mono/utils/mono-memory-model.h>
+#include <mono/utils/mono-hwcap-x86.h>
 
 #include "trace.h"
 #include "mini-x86.h"
@@ -698,129 +699,6 @@ mono_x86_tail_call_supported (MonoMethodSignature *caller_sig, MonoMethodSignatu
        return res;
 }
 
-#if !defined(__native_client__)
-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     */
-};
-#else
-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   */
-       0x59, 0x83, 0xe1, 0xe0, 0xff, 0xe1,     /* naclret */
-       0xf4, 0xf4, 0xf4, 0xf4, 0xf4, 0xf4,     /* padding, to provide bundle aligned version */
-       0xf4, 0xf4, 0xf4, 0xf4, 0xf4, 0xf4,
-       0xf4, 0xf4, 0xf4, 0xf4, 0xf4, 0xf4,
-       0xf4, 0xf4, 0xf4, 0xf4, 0xf4, 0xf4,
-       0xf4
-};
-#endif
-
-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)
-{
-#if defined(__native_client__)
-       static CpuidFunc func = NULL;
-       void *ptr, *end_ptr;
-       if (!func) {
-               ptr = mono_global_codeman_reserve (sizeof (cpuid_impl));
-               memcpy(ptr, cpuid_impl, sizeof(cpuid_impl));
-               end_ptr = ptr + sizeof(cpuid_impl);
-               nacl_global_codeman_validate (&ptr, sizeof(cpuid_impl), &end_ptr);
-               func = (CpuidFunc)ptr;
-       }
-       func (id, p_eax, p_ebx, p_ecx, p_edx);
-#else
-       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) {
-               /* Have to use the code manager to get around WinXP DEP */
-               static CpuidFunc func = NULL;
-               void *ptr;
-               if (!func) {
-                       ptr = mono_global_codeman_reserve (sizeof (cpuid_impl));
-                       memcpy (ptr, cpuid_impl, sizeof (cpuid_impl));
-                       func = (CpuidFunc)ptr;
-               }
-               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;
-#endif
-}
-
 /*
  * Initialize the cpu to execute managed code.
  */
@@ -880,36 +758,32 @@ guint32
 mono_arch_cpu_optimizations (guint32 *exclude_mask)
 {
 #if !defined(__native_client__)
-       int eax, ebx, ecx, edx;
        guint32 opts = 0;
-       
+
        *exclude_mask = 0;
 
-       if (mono_aot_only)
-               /* The cpuid function allocates from the global codeman */
-               return opts;
+       if (mono_hwcap_x86_has_cmov) {
+               opts |= MONO_OPT_CMOV;
 
-       /* Feature Flags function, flags returned in EDX. */
-       if (cpuid (1, &eax, &ebx, &ecx, &edx)) {
-               if (edx & (1 << 15)) {
-                       opts |= MONO_OPT_CMOV;
-                       if (edx & 1)
-                               opts |= MONO_OPT_FCMOV;
-                       else
-                               *exclude_mask |= MONO_OPT_FCMOV;
-               } else
-                       *exclude_mask |= MONO_OPT_CMOV;
-               if (edx & (1 << 26))
-                       opts |= MONO_OPT_SSE2;
+               if (mono_hwcap_x86_has_fcmov)
+                       opts |= MONO_OPT_FCMOV;
                else
-                       *exclude_mask |= MONO_OPT_SSE2;
+                       *exclude_mask |= MONO_OPT_FCMOV;
+       } else {
+               *exclude_mask |= MONO_OPT_CMOV;
+       }
+
+       if (mono_hwcap_x86_has_sse2)
+               opts |= MONO_OPT_SSE2;
+       else
+               *exclude_mask |= MONO_OPT_SSE2;
 
 #ifdef MONO_ARCH_SIMD_INTRINSICS
                /*SIMD intrinsics require at least SSE2.*/
-               if (!(opts & MONO_OPT_SSE2))
+               if (!mono_hwcap_x86_has_sse2)
                        *exclude_mask |= MONO_OPT_SIMD;
 #endif
-       }
+
        return opts;
 #else
        return MONO_OPT_CMOV | MONO_OPT_FCMOV | MONO_OPT_SSE2;
@@ -925,42 +799,30 @@ mono_arch_cpu_optimizations (guint32 *exclude_mask)
 guint32
 mono_arch_cpu_enumerate_simd_versions (void)
 {
-       int eax, ebx, ecx, edx;
        guint32 sse_opts = 0;
 
-       if (mono_aot_only)
-               /* The cpuid function allocates from the global codeman */
-               return sse_opts;
-
-       if (cpuid (1, &eax, &ebx, &ecx, &edx)) {
-               if (edx & (1 << 25))
-                       sse_opts |= SIMD_VERSION_SSE1;
-               if (edx & (1 << 26))
-                       sse_opts |= SIMD_VERSION_SSE2;
-               if (ecx & (1 << 0))
-                       sse_opts |= SIMD_VERSION_SSE3;
-               if (ecx & (1 << 9))
-                       sse_opts |= SIMD_VERSION_SSSE3;
-               if (ecx & (1 << 19))
-                       sse_opts |= SIMD_VERSION_SSE41;
-               if (ecx & (1 << 20))
-                       sse_opts |= SIMD_VERSION_SSE42;
-       }
+       if (mono_hwcap_x86_has_sse1)
+               sse_opts |= SIMD_VERSION_SSE1;
 
-       /* Yes, all this needs to be done to check for sse4a.
-          See: "Amd: CPUID Specification"
-        */
-       if (cpuid (0x80000000, &eax, &ebx, &ecx, &edx)) {
-               /* eax greater or equal than 0x80000001, ebx = 'htuA', ecx = DMAc', edx = 'itne'*/
-               if ((((unsigned int) eax) >= 0x80000001) && (ebx == 0x68747541) && (ecx == 0x444D4163) && (edx == 0x69746E65)) {
-                       cpuid (0x80000001, &eax, &ebx, &ecx, &edx);
-                       if (ecx & (1 << 6))
-                               sse_opts |= SIMD_VERSION_SSE4a;
-               }
-       }
+       if (mono_hwcap_x86_has_sse2)
+               sse_opts |= SIMD_VERSION_SSE2;
+
+       if (mono_hwcap_x86_has_sse3)
+               sse_opts |= SIMD_VERSION_SSE3;
+
+       if (mono_hwcap_x86_has_ssse3)
+               sse_opts |= SIMD_VERSION_SSSE3;
+
+       if (mono_hwcap_x86_has_sse41)
+               sse_opts |= SIMD_VERSION_SSE41;
+
+       if (mono_hwcap_x86_has_sse42)
+               sse_opts |= SIMD_VERSION_SSE42;
 
+       if (mono_hwcap_x86_has_sse4a)
+               sse_opts |= SIMD_VERSION_SSE4a;
 
-       return sse_opts;        
+       return sse_opts;
 }
 
 /*
@@ -6273,13 +6135,16 @@ mono_arch_get_delegate_invoke_impls (void)
        guint8 *code;
        guint32 code_len;
        int i;
+       char *tramp_name;
 
        code = get_delegate_invoke_impl (TRUE, 0, &code_len);
-       res = g_slist_prepend (res, mono_tramp_info_create (g_strdup ("delegate_invoke_impl_has_target"), code, code_len, NULL, NULL));
+       res = g_slist_prepend (res, mono_tramp_info_create ("delegate_invoke_impl_has_target", code, code_len, NULL, NULL));
 
        for (i = 0; i < MAX_ARCH_DELEGATE_PARAMS; ++i) {
                code = get_delegate_invoke_impl (FALSE, i, &code_len);
-               res = g_slist_prepend (res, mono_tramp_info_create (g_strdup_printf ("delegate_invoke_impl_target_%d", i), code, code_len, NULL, NULL));
+               tramp_name = g_strdup_printf ("delegate_invoke_impl_target_%d", i);
+               res = g_slist_prepend (res, mono_tramp_info_create (tramp_name, code, code_len, NULL, NULL));
+               g_free (tramp_name);
        }
 
        return res;
index 34c5810b662bc25d96756f79f609f4026bb01075..4cc9e152323e63b4f43597de1b670084a6c934ee 100644 (file)
@@ -56,6 +56,7 @@
 #include <mono/utils/mono-mmap.h>
 #include <mono/utils/mono-path.h>
 #include <mono/utils/mono-tls.h>
+#include <mono/utils/mono-hwcap.h>
 #include <mono/utils/dtrace.h>
 
 #include "mini.h"
 #include "mini-gc.h"
 #include "debugger-agent.h"
 
+/* this macro is used for a runtime check done in mini_init () */
+#ifdef MONO_ARCH_EMULATE_MUL_DIV
+#define EMUL_MUL_DIV 1
+#else
+#define EMUL_MUL_DIV 0
+#endif
+
 static gpointer mono_jit_compile_method_with_opt (MonoMethod *method, guint32 opt, MonoException **ex);
 
 
@@ -1202,11 +1210,11 @@ mono_compile_create_var_for_vreg (MonoCompile *cfg, MonoType *type, int opcode,
                set_vreg_to_inst (cfg, vreg, inst);
 
 #if SIZEOF_REGISTER == 4
-#ifdef MONO_ARCH_SOFT_FLOAT
-       regpair = mono_type_is_long (type) || mono_type_is_float (type);
-#else
-       regpair = mono_type_is_long (type);
-#endif
+       if (mono_arch_is_soft_float ()) {
+               regpair = mono_type_is_long (type) || mono_type_is_float (type);
+       } else {
+               regpair = mono_type_is_long (type);
+       }
 #else
        regpair = FALSE;
 #endif
@@ -1227,12 +1235,10 @@ mono_compile_create_var_for_vreg (MonoCompile *cfg, MonoType *type, int opcode,
                        printf ("  Create LVAR R%d (R%d, R%d)\n", inst->dreg, inst->dreg + 1, inst->dreg + 2);
                }
 
-#ifdef MONO_ARCH_SOFT_FLOAT
-               if (cfg->opt & MONO_OPT_SSA) {
+               if (mono_arch_is_soft_float () && cfg->opt & MONO_OPT_SSA) {
                        if (mono_type_is_float (type))
                                inst->flags = MONO_INST_VOLATILE;
                }
-#endif
 
                /* Allocate a dummy MonoInst for the first vreg */
                MONO_INST_NEW (cfg, tree, OP_LOCAL);
@@ -1272,10 +1278,8 @@ mono_compile_create_var (MonoCompile *cfg, MonoType *type, int opcode)
 
        if (mono_type_is_long (type))
                dreg = mono_alloc_dreg (cfg, STACK_I8);
-#ifdef MONO_ARCH_SOFT_FLOAT
-       else if (mono_type_is_float (type))
+       else if (mono_arch_is_soft_float () && mono_type_is_float (type))
                dreg = mono_alloc_dreg (cfg, STACK_R8);
-#endif
        else
                /* All the others are unified */
                dreg = mono_alloc_preg (cfg);
@@ -3755,7 +3759,7 @@ mono_save_seq_point_info (MonoCompile *cfg)
        if (!cfg->seq_points)
                return;
 
-       info = g_malloc0 (sizeof (MonoSeqPointInfo) + (cfg->seq_points->len - MONO_ZERO_LEN_ARRAY) * sizeof (SeqPoint));
+       info = g_malloc0 (sizeof (MonoSeqPointInfo) + (cfg->seq_points->len * sizeof (SeqPoint)));
        info->len = cfg->seq_points->len;
        for (i = 0; i < cfg->seq_points->len; ++i) {
                SeqPoint *sp = &info->seq_points [i];
@@ -3796,7 +3800,7 @@ mono_save_seq_point_info (MonoCompile *cfg)
                        last = ins;
                }
 
-               if (bb->last_ins && bb->last_ins->opcode == OP_ENDFINALLY) {
+               if (bb->last_ins && bb->last_ins->opcode == OP_ENDFINALLY && bb->seq_points) {
                        MonoBasicBlock *bb2;
                        MonoInst *endfinally_seq_point = NULL;
 
@@ -3804,17 +3808,18 @@ mono_save_seq_point_info (MonoCompile *cfg)
                         * The ENDFINALLY branches are not represented in the cfg, so link it with all seq points starting bbs.
                         */
                        l = g_slist_last (bb->seq_points);
-                       g_assert (l);
-                       endfinally_seq_point = l->data;
+                       if (l) {
+                               endfinally_seq_point = l->data;
 
-                       for (bb2 = cfg->bb_entry; bb2; bb2 = bb2->next_bb) {
-                               GSList *l = g_slist_last (bb2->seq_points);
+                               for (bb2 = cfg->bb_entry; bb2; bb2 = bb2->next_bb) {
+                                       GSList *l = g_slist_last (bb2->seq_points);
 
-                               if (l) {
-                                       MonoInst *ins = l->data;
+                                       if (l) {
+                                               MonoInst *ins = l->data;
 
-                                       if (!(ins->inst_imm == METHOD_ENTRY_IL_OFFSET || ins->inst_imm == METHOD_EXIT_IL_OFFSET) && ins != endfinally_seq_point)
-                                               next [endfinally_seq_point->backend.size] = g_slist_append (next [endfinally_seq_point->backend.size], GUINT_TO_POINTER (ins->backend.size));
+                                               if (!(ins->inst_imm == METHOD_ENTRY_IL_OFFSET || ins->inst_imm == METHOD_EXIT_IL_OFFSET) && ins != endfinally_seq_point)
+                                                       next [endfinally_seq_point->backend.size] = g_slist_append (next [endfinally_seq_point->backend.size], GUINT_TO_POINTER (ins->backend.size));
+                                       }
                                }
                        }
                }
@@ -4511,26 +4516,6 @@ is_open_method (MonoMethod *method)
        return FALSE;
 }
 
-static gboolean
-has_ref_constraint (MonoGenericParamInfo *info)
-{
-       MonoClass **constraints;
-
-       //return FALSE;
-
-       if (info && info->constraints) {
-               constraints = info->constraints;
-
-               while (*constraints) {
-                       MonoClass *cklass = *constraints;
-                       if (!(cklass == mono_defaults.object_class || (cklass->image == mono_defaults.corlib && !strcmp (cklass->name, "ValueType")) || MONO_CLASS_IS_INTERFACE (cklass)))
-                               return TRUE;
-                       constraints ++;
-               }
-       }
-       return FALSE;
-}
-
 static MonoGenericInst*
 get_shared_inst (MonoGenericInst *inst, MonoGenericInst *shared_inst, MonoGenericContainer *container, gboolean all_vt, gboolean gsharedvt)
 {
@@ -4543,10 +4528,7 @@ get_shared_inst (MonoGenericInst *inst, MonoGenericInst *shared_inst, MonoGeneri
                if (!all_vt && (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] = shared_inst->type_argv [i];
                } else if (all_vt) {
-                       if (container && has_ref_constraint (&container->type_params [i].info))
-                               type_argv [i] = shared_inst->type_argv [i];
-                       else
-                               type_argv [i] = get_gsharedvt_type (shared_inst->type_argv [i]);
+                       type_argv [i] = get_gsharedvt_type (shared_inst->type_argv [i]);
                } else if (gsharedvt) {
                        type_argv [i] = get_gsharedvt_type (shared_inst->type_argv [i]);
                } else {
@@ -5284,8 +5266,8 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, gbool
                return cfg;
        }
 
-#ifdef MONO_ARCH_SOFT_FLOAT
-       if (!COMPILE_LLVM (cfg))
+#ifdef MONO_ARCH_SOFT_FLOAT_FALLBACK
+       if (COMPILE_SOFT_FLOAT (cfg))
                mono_decompose_soft_float (cfg);
 #endif
        if (!COMPILE_LLVM (cfg))
@@ -6023,8 +6005,14 @@ mono_jit_compile_method_with_opt (MonoMethod *method, guint32 opt, MonoException
                WrapperInfo *info = mono_marshal_get_wrapper_info (method);
 
                g_assert (info);
-               if (info->subtype == WRAPPER_SUBTYPE_SYNCHRONIZED_INNER)
+               if (info->subtype == WRAPPER_SUBTYPE_SYNCHRONIZED_INNER) {
+                       MonoGenericContext *ctx = NULL;
+                       if (method->is_inflated)
+                               ctx = mono_method_get_context (method);
                        method = info->d.synchronized_inner.method;
+                       if (ctx)
+                               method = mono_class_inflate_generic_method (method, ctx);
+               }
        }
 
        info = lookup_method (target_domain, method);
@@ -6222,7 +6210,7 @@ typedef struct {
 static MonoObject*
 mono_jit_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject **exc)
 {
-       MonoMethod *invoke;
+       MonoMethod *invoke, *callee;
        MonoObject *(*runtime_invoke) (MonoObject *this, void **params, MonoObject **exc, void* compiled_method);
        MonoDomain *domain = mono_domain_get ();
        MonoJitDomainInfo *domain_info;
@@ -6261,17 +6249,31 @@ mono_jit_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObjec
                info->vtable = mono_class_vtable_full (domain, method->klass, TRUE);
                g_assert (info->vtable);
 
+               callee = method;
                if (method->klass->rank && (method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) &&
                        (method->iflags & METHOD_IMPL_ATTRIBUTE_NATIVE)) {
                        /* 
                         * Array Get/Set/Address methods. The JIT implements them using inline code 
                         * inside the runtime invoke wrappers, so no need to compile them.
                         */
-                       info->compiled_method = NULL;
-               } else {
+                       if (mono_aot_only) {
+                               /*
+                                * Call a wrapper, since the runtime invoke wrapper was not generated.
+                                */
+                               MonoMethod *wrapper;
+
+                               wrapper = mono_marshal_get_array_accessor_wrapper (method);
+                               invoke = mono_marshal_get_runtime_invoke (wrapper, FALSE);
+                               callee = wrapper;
+                       } else {
+                               callee = NULL;
+                       }
+               }
+
+               if (callee) {
                        MonoException *jit_ex = NULL;
 
-                       info->compiled_method = mono_jit_compile_method_with_opt (method, default_opt, &jit_ex);
+                       info->compiled_method = mono_jit_compile_method_with_opt (callee, default_opt, &jit_ex);
                        if (!info->compiled_method) {
                                g_free (info);
                                g_assert (jit_ex);
@@ -6283,7 +6285,9 @@ mono_jit_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObjec
                                }
                        }
 
-                       info->compiled_method = mini_add_method_trampoline (NULL, method, info->compiled_method, mono_method_needs_static_rgctx_invoke (method, FALSE), FALSE);
+                       info->compiled_method = mini_add_method_trampoline (NULL, callee, info->compiled_method, mono_method_needs_static_rgctx_invoke (callee, FALSE), FALSE);
+               } else {
+                       info->compiled_method = NULL;
                }
 
                /*
@@ -6935,6 +6939,8 @@ mini_init (const char *filename, const char *runtime_version)
 
        mono_code_manager_init ();
 
+       mono_hwcap_init ();
+
        mono_arch_cpu_init ();
 
        mono_arch_init ();
@@ -7141,8 +7147,10 @@ mini_init (const char *filename, const char *runtime_version)
        register_opcode_emulation (OP_IMUL_OVF_UN, "__emul_op_imul_ovf_un", "int32 int32 int32", mono_imul_ovf_un, "mono_imul_ovf_un", FALSE);
 #endif
 
-#if defined(MONO_ARCH_EMULATE_MUL_DIV) || defined(MONO_ARCH_SOFT_FLOAT)
-       register_opcode_emulation (OP_FDIV, "__emul_fdiv", "double double double", mono_fdiv, "mono_fdiv", FALSE);
+#if defined(MONO_ARCH_EMULATE_MUL_DIV) || defined(MONO_ARCH_SOFT_FLOAT_FALLBACK)
+       if (EMUL_MUL_DIV || mono_arch_is_soft_float ()) {
+               register_opcode_emulation (OP_FDIV, "__emul_fdiv", "double double double", mono_fdiv, "mono_fdiv", FALSE);
+       }
 #endif
 
        register_opcode_emulation (OP_FCONV_TO_U8, "__emul_fconv_to_u8", "ulong double", mono_fconv_u8, "mono_fconv_u8", FALSE);
@@ -7173,44 +7181,47 @@ mini_init (const char *filename, const char *runtime_version)
 #endif
 #endif
 
-#ifdef MONO_ARCH_SOFT_FLOAT
-       register_opcode_emulation (OP_FSUB, "__emul_fsub", "double double double", mono_fsub, "mono_fsub", FALSE);
-       register_opcode_emulation (OP_FADD, "__emul_fadd", "double double double", mono_fadd, "mono_fadd", FALSE);
-       register_opcode_emulation (OP_FMUL, "__emul_fmul", "double double double", mono_fmul, "mono_fmul", FALSE);
-       register_opcode_emulation (OP_FNEG, "__emul_fneg", "double double", mono_fneg, "mono_fneg", FALSE);
-       register_opcode_emulation (OP_ICONV_TO_R8, "__emul_iconv_to_r8", "double int32", mono_conv_to_r8, "mono_conv_to_r8", FALSE);
-       register_opcode_emulation (OP_ICONV_TO_R4, "__emul_iconv_to_r4", "double int32", mono_conv_to_r4, "mono_conv_to_r4", FALSE);
-       register_opcode_emulation (OP_FCONV_TO_R4, "__emul_fconv_to_r4", "double double", mono_fconv_r4, "mono_fconv_r4", FALSE);
-       register_opcode_emulation (OP_FCONV_TO_I1, "__emul_fconv_to_i1", "int8 double", mono_fconv_i1, "mono_fconv_i1", FALSE);
-       register_opcode_emulation (OP_FCONV_TO_I2, "__emul_fconv_to_i2", "int16 double", mono_fconv_i2, "mono_fconv_i2", FALSE);
-       register_opcode_emulation (OP_FCONV_TO_I4, "__emul_fconv_to_i4", "int32 double", mono_fconv_i4, "mono_fconv_i4", FALSE);
-       register_opcode_emulation (OP_FCONV_TO_U1, "__emul_fconv_to_u1", "uint8 double", mono_fconv_u1, "mono_fconv_u1", FALSE);
-       register_opcode_emulation (OP_FCONV_TO_U2, "__emul_fconv_to_u2", "uint16 double", mono_fconv_u2, "mono_fconv_u2", FALSE);
+#ifdef MONO_ARCH_SOFT_FLOAT_FALLBACK
+       if (mono_arch_is_soft_float ()) {
+               register_opcode_emulation (OP_FSUB, "__emul_fsub", "double double double", mono_fsub, "mono_fsub", FALSE);
+               register_opcode_emulation (OP_FADD, "__emul_fadd", "double double double", mono_fadd, "mono_fadd", FALSE);
+               register_opcode_emulation (OP_FMUL, "__emul_fmul", "double double double", mono_fmul, "mono_fmul", FALSE);
+               register_opcode_emulation (OP_FNEG, "__emul_fneg", "double double", mono_fneg, "mono_fneg", FALSE);
+               register_opcode_emulation (OP_ICONV_TO_R8, "__emul_iconv_to_r8", "double int32", mono_conv_to_r8, "mono_conv_to_r8", FALSE);
+               register_opcode_emulation (OP_ICONV_TO_R4, "__emul_iconv_to_r4", "double int32", mono_conv_to_r4, "mono_conv_to_r4", FALSE);
+               register_opcode_emulation (OP_FCONV_TO_R4, "__emul_fconv_to_r4", "double double", mono_fconv_r4, "mono_fconv_r4", FALSE);
+               register_opcode_emulation (OP_FCONV_TO_I1, "__emul_fconv_to_i1", "int8 double", mono_fconv_i1, "mono_fconv_i1", FALSE);
+               register_opcode_emulation (OP_FCONV_TO_I2, "__emul_fconv_to_i2", "int16 double", mono_fconv_i2, "mono_fconv_i2", FALSE);
+               register_opcode_emulation (OP_FCONV_TO_I4, "__emul_fconv_to_i4", "int32 double", mono_fconv_i4, "mono_fconv_i4", FALSE);
+               register_opcode_emulation (OP_FCONV_TO_U1, "__emul_fconv_to_u1", "uint8 double", mono_fconv_u1, "mono_fconv_u1", FALSE);
+               register_opcode_emulation (OP_FCONV_TO_U2, "__emul_fconv_to_u2", "uint16 double", mono_fconv_u2, "mono_fconv_u2", FALSE);
+
 #if SIZEOF_VOID_P == 4
-       register_opcode_emulation (OP_FCONV_TO_I, "__emul_fconv_to_i", "int32 double", mono_fconv_i4, "mono_fconv_i4", FALSE);
+               register_opcode_emulation (OP_FCONV_TO_I, "__emul_fconv_to_i", "int32 double", mono_fconv_i4, "mono_fconv_i4", FALSE);
 #endif
 
-       register_opcode_emulation (OP_FBEQ, "__emul_fcmp_eq", "uint32 double double", mono_fcmp_eq, "mono_fcmp_eq", FALSE);
-       register_opcode_emulation (OP_FBLT, "__emul_fcmp_lt", "uint32 double double", mono_fcmp_lt, "mono_fcmp_lt", FALSE);
-       register_opcode_emulation (OP_FBGT, "__emul_fcmp_gt", "uint32 double double", mono_fcmp_gt, "mono_fcmp_gt", FALSE);
-       register_opcode_emulation (OP_FBLE, "__emul_fcmp_le", "uint32 double double", mono_fcmp_le, "mono_fcmp_le", FALSE);
-       register_opcode_emulation (OP_FBGE, "__emul_fcmp_ge", "uint32 double double", mono_fcmp_ge, "mono_fcmp_ge", FALSE);
-       register_opcode_emulation (OP_FBNE_UN, "__emul_fcmp_ne_un", "uint32 double double", mono_fcmp_ne_un, "mono_fcmp_ne_un", FALSE);
-       register_opcode_emulation (OP_FBLT_UN, "__emul_fcmp_lt_un", "uint32 double double", mono_fcmp_lt_un, "mono_fcmp_lt_un", FALSE);
-       register_opcode_emulation (OP_FBGT_UN, "__emul_fcmp_gt_un", "uint32 double double", mono_fcmp_gt_un, "mono_fcmp_gt_un", FALSE);
-       register_opcode_emulation (OP_FBLE_UN, "__emul_fcmp_le_un", "uint32 double double", mono_fcmp_le_un, "mono_fcmp_le_un", FALSE);
-       register_opcode_emulation (OP_FBGE_UN, "__emul_fcmp_ge_un", "uint32 double double", mono_fcmp_ge_un, "mono_fcmp_ge_un", FALSE);
+               register_opcode_emulation (OP_FBEQ, "__emul_fcmp_eq", "uint32 double double", mono_fcmp_eq, "mono_fcmp_eq", FALSE);
+               register_opcode_emulation (OP_FBLT, "__emul_fcmp_lt", "uint32 double double", mono_fcmp_lt, "mono_fcmp_lt", FALSE);
+               register_opcode_emulation (OP_FBGT, "__emul_fcmp_gt", "uint32 double double", mono_fcmp_gt, "mono_fcmp_gt", FALSE);
+               register_opcode_emulation (OP_FBLE, "__emul_fcmp_le", "uint32 double double", mono_fcmp_le, "mono_fcmp_le", FALSE);
+               register_opcode_emulation (OP_FBGE, "__emul_fcmp_ge", "uint32 double double", mono_fcmp_ge, "mono_fcmp_ge", FALSE);
+               register_opcode_emulation (OP_FBNE_UN, "__emul_fcmp_ne_un", "uint32 double double", mono_fcmp_ne_un, "mono_fcmp_ne_un", FALSE);
+               register_opcode_emulation (OP_FBLT_UN, "__emul_fcmp_lt_un", "uint32 double double", mono_fcmp_lt_un, "mono_fcmp_lt_un", FALSE);
+               register_opcode_emulation (OP_FBGT_UN, "__emul_fcmp_gt_un", "uint32 double double", mono_fcmp_gt_un, "mono_fcmp_gt_un", FALSE);
+               register_opcode_emulation (OP_FBLE_UN, "__emul_fcmp_le_un", "uint32 double double", mono_fcmp_le_un, "mono_fcmp_le_un", FALSE);
+               register_opcode_emulation (OP_FBGE_UN, "__emul_fcmp_ge_un", "uint32 double double", mono_fcmp_ge_un, "mono_fcmp_ge_un", FALSE);
 
-       register_opcode_emulation (OP_FCEQ, "__emul_fcmp_ceq", "uint32 double double", mono_fceq, "mono_fceq", FALSE);
-       register_opcode_emulation (OP_FCGT, "__emul_fcmp_cgt", "uint32 double double", mono_fcgt, "mono_fcgt", FALSE);
-       register_opcode_emulation (OP_FCGT_UN, "__emul_fcmp_cgt_un", "uint32 double double", mono_fcgt_un, "mono_fcgt_un", FALSE);
-       register_opcode_emulation (OP_FCLT, "__emul_fcmp_clt", "uint32 double double", mono_fclt, "mono_fclt", FALSE);
-       register_opcode_emulation (OP_FCLT_UN, "__emul_fcmp_clt_un", "uint32 double double", mono_fclt_un, "mono_fclt_un", FALSE);
+               register_opcode_emulation (OP_FCEQ, "__emul_fcmp_ceq", "uint32 double double", mono_fceq, "mono_fceq", FALSE);
+               register_opcode_emulation (OP_FCGT, "__emul_fcmp_cgt", "uint32 double double", mono_fcgt, "mono_fcgt", FALSE);
+               register_opcode_emulation (OP_FCGT_UN, "__emul_fcmp_cgt_un", "uint32 double double", mono_fcgt_un, "mono_fcgt_un", FALSE);
+               register_opcode_emulation (OP_FCLT, "__emul_fcmp_clt", "uint32 double double", mono_fclt, "mono_fclt", FALSE);
+               register_opcode_emulation (OP_FCLT_UN, "__emul_fcmp_clt_un", "uint32 double double", mono_fclt_un, "mono_fclt_un", FALSE);
 
-       register_icall (mono_fload_r4, "mono_fload_r4", "double ptr", FALSE);
-       register_icall (mono_fstore_r4, "mono_fstore_r4", "void double ptr", FALSE);
-       register_icall (mono_fload_r4_arg, "mono_fload_r4_arg", "uint32 double", FALSE);
-       register_icall (mono_isfinite, "mono_isfinite", "uint32 double", FALSE);
+               register_icall (mono_fload_r4, "mono_fload_r4", "double ptr", FALSE);
+               register_icall (mono_fstore_r4, "mono_fstore_r4", "void double ptr", FALSE);
+               register_icall (mono_fload_r4_arg, "mono_fload_r4_arg", "uint32 double", FALSE);
+               register_icall (mono_isfinite, "mono_isfinite", "uint32 double", FALSE);
+       }
 #endif
 
 #ifdef COMPRESSED_INTERFACE_BITMAP
@@ -7244,7 +7255,7 @@ mini_init (const char *filename, const char *runtime_version)
        register_icall (mono_helper_ldstr_mscorlib, "mono_helper_ldstr_mscorlib", "object int", FALSE);
        register_icall (mono_helper_newobj_mscorlib, "mono_helper_newobj_mscorlib", "object int", FALSE);
        register_icall (mono_value_copy, "mono_value_copy", "void ptr ptr ptr", FALSE);
-       register_icall (mono_object_castclass, "mono_object_castclass", "object object ptr", FALSE);
+       register_icall (mono_object_castclass_unbox, "mono_object_castclass_unbox", "object object ptr", FALSE);
        register_icall (mono_break, "mono_break", NULL, TRUE);
        register_icall (mono_create_corlib_exception_0, "mono_create_corlib_exception_0", "object int", TRUE);
        register_icall (mono_create_corlib_exception_1, "mono_create_corlib_exception_1", "object int object", TRUE);
@@ -7255,9 +7266,7 @@ mini_init (const char *filename, const char *runtime_version)
        register_icall (mono_array_new_4, "mono_array_new_4", "object ptr int int int int", FALSE);
        register_icall (mono_get_native_calli_wrapper, "mono_get_native_calli_wrapper", "ptr ptr ptr ptr", FALSE);
        register_icall (mono_resume_unwind, "mono_resume_unwind", "void", TRUE);
-       register_icall (mono_object_tostring_gsharedvt, "mono_object_tostring_gsharedvt", "object ptr ptr ptr", TRUE);
-       register_icall (mono_object_gethashcode_gsharedvt, "mono_object_gethashcode_gsharedvt", "int ptr ptr ptr", TRUE);
-       register_icall (mono_object_equals_gsharedvt, "mono_object_equals_gsharedvt", "int ptr ptr ptr object", TRUE);
+       register_icall (mono_gsharedvt_constrained_call, "mono_gsharedvt_constrained_call", "object ptr ptr ptr ptr", TRUE);
        register_icall (mono_gsharedvt_value_copy, "mono_gsharedvt_value_copy", "void ptr ptr ptr", TRUE);
 
        register_icall (mono_gc_wbarrier_value_copy_bitmap, "mono_gc_wbarrier_value_copy_bitmap", "void ptr ptr int int", FALSE);
@@ -7399,7 +7408,9 @@ mini_cleanup (MonoDomain *domain)
 
        mono_runtime_cleanup_handlers ();
 
+#ifndef MONO_CROSS_COMPILE
        mono_domain_free (domain, TRUE);
+#endif
 
        mono_debugger_cleanup ();
 
index 950b7f2fb78aa87fc5db83b5d145e4bdf95b3a74..7102b276fb90e5e8bdae9c63a1d246ddabd455fb 100644 (file)
 #define LLVM_ENABLED FALSE
 #endif
 
-#ifdef MONO_ARCH_SOFT_FLOAT
-#define COMPILE_SOFT_FLOAT(cfg) (!COMPILE_LLVM ((cfg)))
+#ifdef MONO_ARCH_SOFT_FLOAT_FALLBACK
+#define COMPILE_SOFT_FLOAT(cfg) (!COMPILE_LLVM ((cfg)) && mono_arch_is_soft_float ())
 #else
-#define COMPILE_SOFT_FLOAT(cfg) 0
+#define COMPILE_SOFT_FLOAT(cfg) (0)
 #endif
 
 #ifdef ENABLE_LLVM
 #endif
 
 /* Version number of the AOT file format */
-#define MONO_AOT_FILE_VERSION 90
+#define MONO_AOT_FILE_VERSION 92
 
 //TODO: This is x86/amd64 specific.
 #define mono_simd_shuffle_mask(a,b,c,d) ((a) | ((b) << 2) | ((c) << 4) | ((d) << 6))
@@ -281,7 +281,7 @@ typedef struct MonoAotFileInfo
        guint32 num_rgctx_fetch_trampolines;
 
        /* These are used for sanity checking object layout problems when cross-compiling */
-       guint32 double_align, long_align;
+       guint32 double_align, long_align, generic_tramp_num;
 } MonoAotFileInfo;
 
 /* Per-domain information maintained by the JIT */
@@ -1244,15 +1244,11 @@ typedef enum {
        MONO_TRAMPOLINE_AOT_PLT,
        MONO_TRAMPOLINE_DELEGATE,
        MONO_TRAMPOLINE_RESTORE_STACK_PROT,
-#ifndef DISABLE_REMOTING
        MONO_TRAMPOLINE_GENERIC_VIRTUAL_REMOTING,
-#endif
        MONO_TRAMPOLINE_MONITOR_ENTER,
        MONO_TRAMPOLINE_MONITOR_EXIT,
        MONO_TRAMPOLINE_VCALL,
-#ifdef MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD
        MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD,
-#endif
        MONO_TRAMPOLINE_NUM
 } MonoTrampolineType;
 
@@ -2262,6 +2258,16 @@ gpointer  mono_arch_get_gsharedvt_trampoline    (MonoTrampInfo **info, gboolean
 gpointer  mono_arch_get_gsharedvt_call_info     (gpointer addr, MonoMethodSignature *normal_sig, MonoMethodSignature *gsharedvt_sig, MonoGenericSharingContext *gsctx, gboolean gsharedvt_in, gint32 vcall_offset, gboolean calli) MONO_INTERNAL;
 gboolean  mono_arch_opcode_needs_emulation      (MonoCompile *cfg, int opcode) MONO_INTERNAL;
 
+#ifdef MONO_ARCH_SOFT_FLOAT_FALLBACK
+gboolean  mono_arch_is_soft_float               (void) MONO_INTERNAL;
+#else
+static inline MONO_ALWAYS_INLINE gboolean
+mono_arch_is_soft_float (void)
+{
+       return FALSE;
+}
+#endif
+
 /* Soft Debug support */
 #ifdef MONO_ARCH_SOFT_DEBUG_SUPPORTED
 void      mono_arch_set_breakpoint              (MonoJitInfo *ji, guint8 *ip) MONO_INTERNAL;
index a16871b226c11a4b0c8f148328e4a6dafffd529f..ae3e724f36706f47d71ff354bbbdd2cf3a64f0cc 100644 (file)
@@ -1589,7 +1589,7 @@ ncells ) {
        public static int test_0_llvm_inline_throw () {
                try {
                        empty ();
-               } catch (Exception ex) {
+               } catch (Exception) {
                        do_throw ();
                }
 
index 24334ce1b73326ac705d3b115d5123f7544324de..ff737bbe9347a7b0f5d2fce3e44832386bd9c356 100644 (file)
@@ -12,6 +12,7 @@
 
 #include "mini.h"
 #include "ir-emit.h"
+#include "mono/utils/bsearch.h"
 
 /*
 General notes on SIMD intrinsics
@@ -1477,7 +1478,7 @@ simd_version_name (guint32 version)
 static MonoInst*
 emit_intrinsics (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoInst **args, const SimdIntrinsc *intrinsics, guint32 size)
 {
-       const SimdIntrinsc * result = bsearch (cmethod->name, intrinsics, size, sizeof (SimdIntrinsc), &simd_intrinsic_compare_by_name);
+       const SimdIntrinsc * result = mono_binary_search (cmethod->name, intrinsics, size, sizeof (SimdIntrinsc), &simd_intrinsic_compare_by_name);
        if (!result) {
                DEBUG (printf ("function doesn't have a simd intrinsic %s::%s/%d\n", cmethod->klass->name, cmethod->name, fsig->param_count));
                return NULL;
index 024ddaf20eeb4d58867fd192e6f13bba711a0659..f67b704c362727b2e9f80e000e3fda8b85849779 100644 (file)
@@ -661,7 +661,7 @@ handle_enum:
        case MONO_TYPE_R4:
        case MONO_TYPE_R8: {
                double f = va_arg (ap, double);
-               printf ("FP=%f\n", f);
+               printf ("FP=%f", f);
                break;
        }
        case MONO_TYPE_VALUETYPE: 
index 071175a440ec54dddc8e7637d1bd9259e25b3b40..f81bd33e48303205a5a9a2e3b035c859da3690ae 100644 (file)
@@ -29,7 +29,7 @@
 
 #if defined(__native_client_codegen__) && defined(__native_client__)
 #include <malloc.h>
-#include <sys/nacl_syscalls.h>
+#include <nacl/nacl_dyncode.h>
 #endif
 
 #define IS_REX(inst) (((inst) >= 0x40) && ((inst) <= 0x4f))
@@ -412,6 +412,7 @@ stack_unaligned (MonoTrampolineType tramp_type)
 guchar*
 mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInfo **info, gboolean aot)
 {
+       char *tramp_name;
        guint8 *buf, *code, *tramp, *br [2], *r11_save_code, *after_r11_save_code;
        int i, lmf_offset, offset, res_offset, arg_offset, rax_offset, tramp_offset, saved_regs_offset;
        int saved_fpregs_offset, rbp_offset, framesize, orig_rsp_to_rbp_offset, cfa_offset;
@@ -724,8 +725,11 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf
                nullified_class_init_trampoline = mono_arch_get_nullified_class_init_trampoline (NULL);
        }
 
-       if (info)
-               *info = mono_tramp_info_create (mono_get_generic_trampoline_name (tramp_type), buf, code - buf, ji, unwind_ops);
+       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);
+       }
 
        return buf;
 }
index 44ef52d89ea5b792707d0c5a7cd4c6970bda5638..39070e676082c334b01c9a290e9878c65d48eca0 100644 (file)
@@ -192,6 +192,7 @@ emit_bx (guint8* code, int reg)
 guchar*
 mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInfo **info, gboolean aot)
 {
+       char *tramp_name;
        guint8 *buf, *code = NULL;
 #ifdef USE_JUMP_TABLES
        gpointer *load_get_lmf_addr = NULL, *load_trampoline = NULL;
@@ -455,8 +456,11 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf
                /* Initialize the nullified class init trampoline used in the AOT case */
                nullified_class_init_trampoline = mono_arch_get_nullified_class_init_trampoline (NULL);
 
-       if (info)
-               *info = mono_tramp_info_create (mono_get_generic_trampoline_name (tramp_type), buf, code - buf, ji, unwind_ops);
+       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);
+       }
 
        return buf;
 }
index c1ff0204d5009e12b3d023e50651aac1a4e9a94a..ca6752fa7dd12e6685d01eb71e655b985743411b 100644 (file)
@@ -176,6 +176,7 @@ mono_arch_get_nullified_class_init_trampoline (MonoTrampInfo **info)
 guchar*
 mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInfo **info, gboolean aot)
 {
+       char *tramp_name;
        guint8 *buf, *tramp, *code = NULL;
        int i, lmf;
        GSList *unwind_ops = NULL;
@@ -317,8 +318,11 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf
                /* Initialize the nullified class init trampoline used in the AOT case */
                nullified_class_init_trampoline = mono_arch_get_nullified_class_init_trampoline (NULL);
 
-       if (info)
-               *info = mono_tramp_info_create (mono_get_generic_trampoline_name (tramp_type), buf, code - buf, ji, unwind_ops);
+       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);
+       }
 
        return buf;
 }
index 7e719be329d451ea09b97c2415e7f3574e6688a0..7391809975f55188e747518e2f13b3e69a7bfa70 100644 (file)
@@ -248,7 +248,7 @@ mono_arch_nullify_plt_entry (guint8 *code, mgreg_t *regs)
 guchar*
 mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInfo **info, gboolean aot)
 {
-
+       char *tramp_name;
        guint8 *buf, *code = NULL;
        int i, offset;
        gconstpointer tramp_handler;
@@ -445,8 +445,11 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf
                nullified_class_init_trampoline = mono_ppc_create_ftnptr (mono_arch_get_nullified_class_init_trampoline (NULL));
        }
 
-       if (info)
-               *info = mono_tramp_info_create (mono_get_generic_trampoline_name (tramp_type), buf, code - buf, ji, unwind_ops);
+       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);
+       }
 
        return buf;
 }
index 7c6d914ebe2fe52f3fea2f72189c37605e6b726f..fe25878f14756bb2b14c4a65d32c84fcfd6e0786 100644 (file)
@@ -219,6 +219,7 @@ mono_arch_nullify_plt_entry (guint8 *code, mgreg_t *regs)
 guchar*
 mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInfo **info, gboolean aot)
 {
+       char *tramp_name;
        guint8 *buf, *tramp, *code;
        int i, offset, lmfOffset;
        GSList *unwind_ops = NULL;
@@ -401,9 +402,11 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf
        /* Flush instruction cache, since we've generated code */
        mono_arch_flush_icache (code, buf - code);
        
-       if (info)
-               *info = mono_tramp_info_create (mono_get_generic_trampoline_name(tramp_type),
-                                               buf, buf - code, ji, unwind_ops);
+       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);
+       }
 
        /* Sanity check */
        g_assert ((buf - code) <= 512);
index 592d0c603d1cab714ce3f56520092360435da702..f9964799473d2abce509645308b5e44084270ad7 100644 (file)
@@ -305,6 +305,7 @@ mono_arch_nullify_plt_entry (guint8 *code, mgreg_t *regs)
 guchar*
 mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInfo **info, gboolean aot)
 {
+       char *tramp_name;
        guint8 *buf, *code, *tramp;
        int pushed_args, pushed_args_caller_saved;
        GSList *unwind_ops = NULL;
@@ -529,8 +530,11 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf
        nacl_global_codeman_validate (&buf, 256, &code);
        g_assert ((code - buf) <= 256);
 
-       if (info)
-               *info = mono_tramp_info_create (mono_get_generic_trampoline_name (tramp_type), buf, code - buf, ji, unwind_ops);
+       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);
+       }
 
        if (tramp_type == MONO_TRAMPOLINE_CLASS_INIT) {
                /* Initialize the nullified class init trampoline used in the AOT case */
index 9081b6f191a444435654128465cd312e5a6d9dbd..fed0218324b07f19708515503d1793793570b3c6 100644 (file)
@@ -105,7 +105,7 @@ struct jit_descriptor
 /* GDB puts a breakpoint in this function.  */
 void MONO_NOINLINE __jit_debug_register_code(void);
 
-#if !defined(MONO_LLVM_LOADED) && defined(ENABLE_LLVM)
+#if !defined(MONO_LLVM_LOADED) && defined(ENABLE_LLVM) && !defined(MONO_CROSS_COMPILE)
 
 /* LLVM already defines these */
 
index a4c89ed9d3d09f07bea6be9f9690544802c3dae7..c19e95b279f49cd7fbbe417d699975e4be3d331e 100644 (file)
@@ -442,7 +442,7 @@ if MIPS
 PLATFORM_DISABLED_TESTS=filter-stack.exe monitor.exe
 endif
 
-if S390x
+if S390X
 PLATFORM_DISABLED_TESTS=dynamic-method-resurrection.exe
 #PLATFORM_DISABLED_TESTS=dynamic-method-resurrection.exe exception17.exe
 endif
@@ -716,14 +716,14 @@ else
 if ARM
 test-sgen : sgen-tests
 else
-if S390x
+if S390X
 test-sgen : sgen-regular-tests
 endif
 endif
 endif
 endif
 
-test: assemblyresolve/test/asm.dll testjit test-generic-sharing test-type-load test_platform test_2_1 test-process-exit test-sgen test-messages rm-empty-logs
+test: assemblyresolve/test/asm.dll testjit test-generic-sharing test-type-load test_platform test_2_1 test-process-exit test-messages rm-empty-logs
 test-wrench: assemblyresolve/test/asm.dll testjit-wrench test-generic-sharing test-type-load test_platform test_2_1 test-process-exit test-sgen test-messages rm-empty-logs
 
 # Remove empty .stdout and .stderr files for wrench
@@ -875,6 +875,11 @@ test-type-load: TestDriver.dll
        @echo "Testing load-exception.exe..."
        @$(RUNTIME) load-exceptions.exe > load-exceptions.exe.stdout 2> load-exceptions.exe.stderr
 
+EXTRA_DIST += debug-casts.cs
+# This depends on TLS, so its not ran by default
+debug-casts:
+       @$(MCS) -r:TestDriver.dll $(srcdir)/debug-casts.cs
+       @$(RUNTIME) --debug=casts debug-casts.exe
 
 EXTRA_DIST += sgen-bridge.cs sgen-descriptors.cs sgen-gshared-vtype.cs sgen-bridge-major-fragmentation.cs sgen-domain-unload.cs sgen-weakref-stress.cs sgen-cementing-stress.cs sgen-case-23400.cs     finalizer-wait.cs critical-finalizers.cs sgen-domain-unload-2.cs sgen-suspend.cs
 
diff --git a/mono/tests/debug-casts.cs b/mono/tests/debug-casts.cs
new file mode 100644 (file)
index 0000000..fafa7ef
--- /dev/null
@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+
+public class Tests
+{
+       public static int Main (string[] args) {
+               return TestDriver.RunTests (typeof (Tests), args);
+       }
+
+       public static int test_0_simple () {
+               object o = new object ();
+               try {
+                       string s = (string)o;
+                       return 1;
+               } catch (InvalidCastException ex) {
+                       if (!ex.Message.Contains ("System.Object") || !ex.Message.Contains ("System.String"))
+                               return 2;
+               }
+               return 0;
+       }
+
+       public static int test_0_complex_1 () {
+               object o = new object ();
+               try {
+                       IEnumerable<object> ie = (IEnumerable<object>)o;
+                       return 1;
+               } catch (InvalidCastException ex) {
+                       if (!ex.Message.Contains ("System.Object") || !ex.Message.Contains ("System.Collections.Generic.IEnumerable`1[System.Object]"))
+                               return 2;
+               }
+               return 0;
+       }
+}
index 1496dc54b476a8d1e9b3bfe11895500e59a79ea6..f11a1dcdeffd2ce3eb23d16d088a431977b999aa 100644 (file)
@@ -10,7 +10,9 @@ public class FinalizerException {
         * We allocate the exception object deep down the stack so
         * that it doesn't get pinned.
         */
-       public static void MakeException (int depth) {
+       public static unsafe void MakeException (int depth) {
+               // Avoid tail calls
+               int* values = stackalloc int [20];
                if (depth <= 0) {
                        new FinalizerException ();
                        return;
@@ -24,7 +26,7 @@ public class FinalizerException {
                        Environment.Exit (0);
                };
 
-               MakeException (100);
+               MakeException (1024);
 
                GC.Collect ();
                GC.WaitForPendingFinalizers ();
index 7ca7bb6275996f29f42a4881dcd2113aa591efe9..a4d02ab1431b7cf04c9fa9ef8aacc2532ea461f6 100644 (file)
@@ -42,6 +42,17 @@ public class Tests {
                [MarshalAs (UnmanagedType.ByValTStr, SizeConst=4)] public string s1;
                public int i;
        }
+
+       [StructLayout (LayoutKind.Sequential, Pack=1)]
+       public struct PackStruct1 {
+               float f;
+       }
+
+       [StructLayout (LayoutKind.Sequential)]
+       public struct PackStruct2 {
+               byte b;
+               PackStruct1 s;
+       }
        
        public unsafe static int Main (String[] args) {
                if (TestDriver.RunTests (typeof (Tests), args) != 0)
@@ -214,4 +225,11 @@ public class Tests {
                        return 3;
                return 0;
        }
+
+       // Check that the 'Pack' directive on a struct changes the min alignment of the struct as well (#12110)
+       public static int test_0_struct_pack () {
+               if (Marshal.OffsetOf (typeof (PackStruct2), "s") != new IntPtr (1))
+                       return 1;
+               return 0;
+       }
 }
index b340cd13065c4eb7a00d1940f03a36a5d728d446..624feae80cd7822e0dfaddd6ae60013655f43385 100644 (file)
@@ -215,4 +215,38 @@ class Tests
                var res = typeof (Tests).GetMethod ("pack_i1").Invoke (null, new object [] { (sbyte)-0x40 });
                return (bool)res ? 0 : 1;
        }
+
+       struct Point {
+               public int x, y;
+       }
+
+       struct Foo2 {
+               public Point Location {
+                       get {
+                               return new Point () { x = 10, y = 20 };
+                       }
+               }
+       }
+
+       public static int test_0_vtype_method_vtype_ret () {
+               var f = new Foo2 ();
+               var p = (Point)typeof (Foo2).GetMethod ("get_Location").Invoke (f, null);
+               if (p.x != 10 || p.y != 20)
+                       return 1;
+               return 0;
+       }
+
+       public static int test_0_array_get_set () {
+               int[,,] arr = new int [10, 10, 10];
+               arr [0, 1, 2] = 42;
+               var gm = arr.GetType ().GetMethod ("Get");
+               int i = (int) gm.Invoke (arr, new object [] { 0, 1, 2 });
+               if (i != 42)
+                       return 1;
+               var sm = arr.GetType ().GetMethod ("Set");
+               sm.Invoke (arr, new object [] { 0, 1, 2, 33 });
+               if (arr [0, 1, 2] != 33)
+                       return 2;
+               return 0;
+       }
 }
index b97e103362116cc78fdb2d4ca99fd152581080b7..8eefcda5ca5498bc7414f6f58863d1e1e28451b8 100644 (file)
@@ -103,7 +103,11 @@ monoutils_sources = \
        linux_magic.h   \
        mono-memory-model.h     \
        atomic.h        \
-       atomic.c
+       atomic.c        \
+       mono-hwcap.h    \
+       mono-hwcap.c    \
+       bsearch.h       \
+       bsearch.c
 
 arch_sources = 
 
@@ -127,6 +131,46 @@ arch_sources += mach-support-unknown.c
 
 endif
 
+if X86
+arch_sources += mono-hwcap-x86.c mono-hwcap-x86.h
+endif
+
+if AMD64
+arch_sources += mono-hwcap-x86.c mono-hwcap-x86.h
+endif
+
+if ARM
+arch_sources += mono-hwcap-arm.c mono-hwcap-arm.h
+endif
+
+if MIPS
+arch_sources += mono-hwcap-mips.c mono-hwcap-mips.h
+endif
+
+if POWERPC
+arch_sources += mono-hwcap-ppc.c mono-hwcap-ppc.h
+endif
+
+if POWERPC64
+arch_sources += mono-hwcap-ppc.c mono-hwcap-ppc.h
+endif
+
+if SPARC
+arch_sources += mono-hwcap-sparc.c mono-hwcap-sparc.h
+endif
+
+if SPARC64
+arch_sources += mono-hwcap-sparc.c mono-hwcap-sparc.h
+endif
+
+if IA64
+arch_sources += mono-hwcap-ia64.c mono-hwcap-ia64.h
+endif
+
+if S390X
+arch_sources += mono-hwcap-s390x.c mono-hwcap-s390x.h
+endif
+
 libmonoutils_la_SOURCES = $(monoutils_sources) $(arch_sources)
 libmonoutilsincludedir = $(includedir)/mono-$(API_VER)/mono/utils
 
index 8141bfd39c105161683bde9ef3eb3d8815df0b1c..1b0745d7365e4e78d7d7fb7c6fcea7236c4ad1d9 100644 (file)
 
 #include <config.h>
 #include <glib.h>
-#include <pthread.h>
 
 #include <mono/utils/atomic.h>
 
 #ifdef WAPI_NO_ATOMIC_ASM
 
+#include <pthread.h>
+
 static pthread_mutex_t spin = PTHREAD_MUTEX_INITIALIZER;
 static mono_once_t spin_once=MONO_ONCE_INIT;
 
index 9b18f9bf62d18a1f08c1f5827790d6b54611b6be..6f02f8f8709008c5fd1261275008e9a0895e8459 100644 (file)
 
 #endif
 
+#include "config.h"
 #include <glib.h>
 
+/* On Windows, we always use the functions provided by the Windows API. */
 #if defined(__WIN32__) || defined(_WIN32)
 
 #include <windows.h>
 
-#elif defined(__NetBSD__) && defined(HAVE_ATOMIC_OPS)
+/* Prefer GCC atomic ops if the target supports it (see configure.in). */
+#elif defined(USE_GCC_ATOMIC_OPS)
 
 static inline gint32 InterlockedCompareExchange(volatile gint32 *dest,
-       gint32 exch, gint32 comp)
+                                               gint32 exch, gint32 comp)
 {
-       return atomic_cas_32((uint32_t*)dest, comp, exch);
+       return __sync_val_compare_and_swap (dest, comp, exch);
 }
 
 static inline gpointer InterlockedCompareExchangePointer(volatile gpointer *dest, gpointer exch, gpointer comp)
 {
-       return atomic_cas_ptr(dest, comp, exch);
+       return __sync_val_compare_and_swap (dest, comp, exch);
 }
 
 static inline gint32 InterlockedIncrement(volatile gint32 *val)
 {
-       return atomic_inc_32_nv((uint32_t*)val);
+       return __sync_add_and_fetch (val, 1);
 }
 
 static inline gint32 InterlockedDecrement(volatile gint32 *val)
 {
-       return atomic_dec_32_nv((uint32_t*)val);
+       return __sync_add_and_fetch (val, -1);
 }
 
 static inline gint32 InterlockedExchange(volatile gint32 *val, gint32 new_val)
 {
-       return atomic_swap_32((uint32_t*)val, new_val);
+       gint32 old_val;
+       do {
+               old_val = *val;
+       } while (__sync_val_compare_and_swap (val, old_val, new_val) != old_val);
+       return old_val;
 }
 
 static inline gpointer InterlockedExchangePointer(volatile gpointer *val,
-               gpointer new_val)
+                                                 gpointer new_val)
 {
-       return atomic_swap_ptr(val, new_val);
+       gpointer old_val;
+       do {
+               old_val = *val;
+       } while (__sync_val_compare_and_swap (val, old_val, new_val) != old_val);
+       return old_val;
 }
 
 static inline gint32 InterlockedExchangeAdd(volatile gint32 *val, gint32 add)
 {
-       return atomic_add_32_nv((uint32_t*)val, add) - add;
+       return __sync_fetch_and_add (val, add);
 }
 
-#elif defined(__i386__) || defined(__x86_64__)
-
-/*
- * NB: The *Pointer() functions here assume that
- * sizeof(pointer)==sizeof(gint32)
- *
- * NB2: These asm functions assume 486+ (some of the opcodes dont
- * exist on 386).  If this becomes an issue, we can get configure to
- * fall back to the non-atomic C versions of these calls.
- */
+#elif defined(__NetBSD__) && defined(HAVE_ATOMIC_OPS)
 
 static inline gint32 InterlockedCompareExchange(volatile gint32 *dest,
-                                               gint32 exch, gint32 comp)
+       gint32 exch, gint32 comp)
 {
-       gint32 old;
-
-       __asm__ __volatile__ ("lock; cmpxchgl %2, %0"
-                             : "=m" (*dest), "=a" (old)
-                             : "r" (exch), "m" (*dest), "a" (comp));   
-       return(old);
+       return atomic_cas_32((uint32_t*)dest, comp, exch);
 }
 
 static inline gpointer InterlockedCompareExchangePointer(volatile gpointer *dest, gpointer exch, gpointer comp)
 {
-       gpointer old;
-
-       __asm__ __volatile__ ("lock; "
-#if defined(__x86_64__)  && !defined(__native_client__)
-                             "cmpxchgq"
-#else
-                             "cmpxchgl"
-#endif
-                             " %2, %0"
-                             : "=m" (*dest), "=a" (old)
-                             : "r" (exch), "m" (*dest), "a" (comp));   
-
-       return(old);
+       return atomic_cas_ptr(dest, comp, exch);
 }
 
 static inline gint32 InterlockedIncrement(volatile gint32 *val)
 {
-       gint32 tmp;
-       
-       __asm__ __volatile__ ("lock; xaddl %0, %1"
-                             : "=r" (tmp), "=m" (*val)
-                             : "0" (1), "m" (*val));
-
-       return(tmp+1);
+       return atomic_inc_32_nv((uint32_t*)val);
 }
 
 static inline gint32 InterlockedDecrement(volatile gint32 *val)
 {
-       gint32 tmp;
-       
-       __asm__ __volatile__ ("lock; xaddl %0, %1"
-                             : "=r" (tmp), "=m" (*val)
-                             : "0" (-1), "m" (*val));
-
-       return(tmp-1);
+       return atomic_dec_32_nv((uint32_t*)val);
 }
 
-/*
- * See
- * http://msdn.microsoft.com/msdnmag/issues/0700/Win32/
- * for the reasons for using cmpxchg and a loop here.
- */
 static inline gint32 InterlockedExchange(volatile gint32 *val, gint32 new_val)
 {
-       gint32 ret;
-
-       __asm__ __volatile__ ("1:; lock; cmpxchgl %2, %0; jne 1b"
-                             : "=m" (*val), "=a" (ret)
-                             : "r" (new_val), "m" (*val), "a" (*val));
-       return(ret);
+       return atomic_swap_32((uint32_t*)val, new_val);
 }
 
 static inline gpointer InterlockedExchangePointer(volatile gpointer *val,
-                                                 gpointer new_val)
+               gpointer new_val)
 {
-       gpointer ret;
-       
-       __asm__ __volatile__ ("1:; lock; "
-#if defined(__x86_64__)  && !defined(__native_client__)
-                             "cmpxchgq"
-#else
-                             "cmpxchgl"
-#endif
-                             " %2, %0; jne 1b"
-                             : "=m" (*val), "=a" (ret)
-                             : "r" (new_val), "m" (*val), "a" (*val));
-
-       return(ret);
+       return atomic_swap_ptr(val, new_val);
 }
 
 static inline gint32 InterlockedExchangeAdd(volatile gint32 *val, gint32 add)
 {
-       gint32 ret;
-       
-       __asm__ __volatile__ ("lock; xaddl %0, %1"
-                             : "=r" (ret), "=m" (*val)
-                             : "0" (add), "m" (*val));
-       
-       return(ret);
+       return atomic_add_32_nv((uint32_t*)val, add) - add;
 }
 
 #elif (defined(sparc) || defined (__sparc__)) && defined(__GNUC__)
@@ -451,516 +396,6 @@ InterlockedExchangeAdd(volatile gint32 *val, gint32 add)
        return(ret);
 }
 
-#elif defined(__mono_ppc__)
-
-#ifdef G_COMPILER_CODEWARRIOR
-static inline gint32 InterlockedIncrement(volatile register gint32 *val)
-{
-       gint32 result = 0, tmp;
-       register gint32 result = 0;
-       register gint32 tmp;
-
-       asm
-       {
-               @1:
-                       lwarx   tmp, 0, val
-                       addi    result, tmp, 1
-                       stwcx.  result, 0, val
-                       bne-    @1
-       }
-       return result;
-}
-
-static inline gint32 InterlockedDecrement(register volatile gint32 *val)
-{
-       register gint32 result = 0;
-       register gint32 tmp;
-
-       asm
-       {
-               @1:
-                       lwarx   tmp, 0, val
-                       addi    result, tmp, -1
-                       stwcx.  result, 0, val
-                       bne-    @1
-       }
-
-       return result;
-}
-#define InterlockedCompareExchangePointer(dest,exch,comp) (void*)InterlockedCompareExchange((volatile gint32 *)(dest), (gint32)(exch), (gint32)(comp))
-
-static inline gint32 InterlockedCompareExchange(volatile register gint32 *dest, register gint32 exch, register gint32 comp)
-{
-       register gint32 tmp = 0;
-
-       asm
-       {
-               @1:
-                       lwarx   tmp, 0, dest
-                       cmpw    tmp, comp
-                       bne-    @2
-                       stwcx.  exch, 0, dest
-                       bne-    @1
-               @2:
-       }
-
-       return tmp;
-}
-static inline gint32 InterlockedExchange(register volatile gint32 *dest, register gint32 exch)
-{
-       register gint32 tmp = 0;
-
-       asm
-       {
-               @1:
-                       lwarx   tmp, 0, dest
-                       stwcx.  exch, 0, dest
-                       bne-    @1
-       }
-
-       return tmp;
-}
-#define InterlockedExchangePointer(dest,exch) (void*)InterlockedExchange((volatile gint32 *)(dest), (gint32)(exch))
-#else
-
-#if defined(__mono_ppc64__) && !defined(__mono_ilp32__)
-#define LDREGX "ldarx"
-#define STREGCXD "stdcx."
-#define CMPREG "cmpd"
-#else
-#define LDREGX "lwarx"
-#define STREGCXD "stwcx."
-#define CMPREG "cmpw"
-#endif
-
-static inline gint32 InterlockedIncrement(volatile gint32 *val)
-{
-       gint32 result = 0, tmp;
-
-       __asm__ __volatile__ ("\n1:\n\t"
-                             "lwarx  %0, 0, %2\n\t"
-                             "addi   %1, %0, 1\n\t"
-                              "stwcx. %1, 0, %2\n\t"
-                             "bne-   1b"
-                             : "=&b" (result), "=&b" (tmp): "r" (val): "cc", "memory");
-       return result + 1;
-}
-
-static inline gint32 InterlockedDecrement(volatile gint32 *val)
-{
-       gint32 result = 0, tmp;
-
-       __asm__ __volatile__ ("\n1:\n\t"
-                             "lwarx  %0, 0, %2\n\t"
-                             "addi   %1, %0, -1\n\t"
-                              "stwcx. %1, 0, %2\n\t"
-                             "bne-   1b"
-                             : "=&b" (result), "=&b" (tmp): "r" (val): "cc", "memory");
-       return result - 1;
-}
-
-static inline gpointer InterlockedCompareExchangePointer (volatile gpointer *dest,
-                                               gpointer exch, gpointer comp)
-{
-       gpointer tmp = NULL;
-
-       __asm__ __volatile__ ("\n1:\n\t"
-                            LDREGX " %0, 0, %1\n\t"
-                            CMPREG " %0, %2\n\t" 
-                            "bne-    2f\n\t"
-                            STREGCXD " %3, 0, %1\n\t"
-                            "bne-    1b\n"
-                            "2:"
-                            : "=&r" (tmp)
-                            : "b" (dest), "r" (comp), "r" (exch): "cc", "memory");
-       return(tmp);
-}
-
-static inline gint32 InterlockedCompareExchange(volatile gint32 *dest,
-                                               gint32 exch, gint32 comp) {
-       gint32 tmp = 0;
-
-       __asm__ __volatile__ ("\n1:\n\t"
-                            "lwarx   %0, 0, %1\n\t"
-                            "cmpw    %0, %2\n\t" 
-                            "bne-    2f\n\t"
-                            "stwcx.  %3, 0, %1\n\t"
-                            "bne-    1b\n"
-                            "2:"
-                            : "=&r" (tmp)
-                            : "b" (dest), "r" (comp), "r" (exch): "cc", "memory");
-       return(tmp);
-}
-
-static inline gint32 InterlockedExchange(volatile gint32 *dest, gint32 exch)
-{
-       gint32 tmp = 0;
-
-       __asm__ __volatile__ ("\n1:\n\t"
-                             "lwarx  %0, 0, %2\n\t"
-                             "stwcx. %3, 0, %2\n\t"
-                             "bne    1b"
-                             : "=r" (tmp) : "0" (tmp), "b" (dest), "r" (exch): "cc", "memory");
-       return(tmp);
-}
-
-static inline gpointer InterlockedExchangePointer (volatile gpointer *dest, gpointer exch)
-{
-       gpointer tmp = NULL;
-
-       __asm__ __volatile__ ("\n1:\n\t"
-                             LDREGX " %0, 0, %2\n\t"
-                             STREGCXD " %3, 0, %2\n\t"
-                             "bne    1b"
-                             : "=r" (tmp) : "0" (tmp), "b" (dest), "r" (exch): "cc", "memory");
-       return(tmp);
-}
-
-static inline gint32 InterlockedExchangeAdd(volatile gint32 *dest, gint32 add)
-{
-        gint32 result, tmp;
-        __asm__ __volatile__ ("\n1:\n\t"
-                              "lwarx  %0, 0, %2\n\t"
-                              "add    %1, %0, %3\n\t"
-                              "stwcx. %1, 0, %2\n\t"
-                              "bne    1b"
-                              : "=&r" (result), "=&r" (tmp)
-                              : "r" (dest), "r" (add) : "cc", "memory");
-        return(result);
-}
-
-#undef LDREGX
-#undef STREGCXD
-#undef CMPREG
-
-#endif /* !G_COMPILER_CODEWARRIOR */
-
-#elif defined(__arm__)
-
-#ifdef __native_client__
-#define MASK_REGISTER(reg, cond) "bic" cond " " reg ", " reg ", #0xc0000000\n"
-#define NACL_ALIGN() ".align 4\n"
-#else
-#define MASK_REGISTER(reg, cond)
-#define NACL_ALIGN()
-#endif
-
-/*
- * Atomic operations on ARM doesn't contain memory barriers, and the runtime code
- * depends on this, so we add them explicitly.
- */
-
-static inline gint32 InterlockedCompareExchange(volatile gint32 *dest, gint32 exch, gint32 comp)
-{
-#if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7S__)
-       gint32 ret, tmp;
-       __asm__ __volatile__ (  "1:\n"
-                               NACL_ALIGN()
-                               "dmb\n"
-                               "mov    %0, #0\n"
-                               NACL_ALIGN()
-                               MASK_REGISTER("%2", "al")
-                               "ldrex %1, [%2]\n"
-                               "teq    %1, %3\n"
-                               "it eq\n"
-                               NACL_ALIGN()
-                               MASK_REGISTER("%2", "eq")
-                               "strexeq %0, %4, [%2]\n"
-                               "teq %0, #0\n"
-                               "bne 1b\n"
-                               "dmb\n"
-                               : "=&r" (tmp), "=&r" (ret)
-                               : "r" (dest), "r" (comp), "r" (exch)
-                               : "memory", "cc");
-
-       return ret;
-#else
-       gint32 a, b;
-
-       __asm__ __volatile__ (    "0:\n\t"
-                                 NACL_ALIGN()
-                                 MASK_REGISTER("%2", "al")
-                                 "ldr %1, [%2]\n\t"
-                                 "cmp %1, %4\n\t"
-                                 "mov %0, %1\n\t"
-                                 "bne 1f\n\t"
-                                 NACL_ALIGN()
-                                 MASK_REGISTER("%2", "al")
-                                 "swp %0, %3, [%2]\n\t"
-                                 "cmp %0, %1\n\t"
-                                 NACL_ALIGN()
-                                 MASK_REGISTER("%2", "ne")
-                                 "swpne %3, %0, [%2]\n\t"
-                                 "bne 0b\n\t"
-                                 "1:"
-                                 : "=&r" (a), "=&r" (b)
-                                 : "r" (dest), "r" (exch), "r" (comp)
-                                 : "cc", "memory");
-
-       return a;
-#endif
-}
-
-static inline gpointer InterlockedCompareExchangePointer(volatile gpointer *dest, gpointer exch, gpointer comp)
-{
-#if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7S__)
-       gpointer ret, tmp;
-       __asm__ __volatile__ (
-                               "dmb\n"
-                               "1:\n"
-                               NACL_ALIGN()
-                               "mov    %0, #0\n"
-                               NACL_ALIGN()
-                               MASK_REGISTER("%2", "al")
-                               "ldrex %1, [%2]\n"
-                               "teq    %1, %3\n"
-                               "it eq\n"
-                               NACL_ALIGN()
-                               MASK_REGISTER("%2", "eq")
-                               "strexeq %0, %4, [%2]\n"
-                               "teq %0, #0\n"
-                               "bne 1b\n"
-                               "dmb\n"
-                               : "=&r" (tmp), "=&r" (ret)
-                               : "r" (dest), "r" (comp), "r" (exch)
-                               : "memory", "cc");
-
-       return ret;
-#else
-       gpointer a, b;
-
-       __asm__ __volatile__ (    "0:\n\t"
-                                 NACL_ALIGN()
-                                 MASK_REGISTER("%2", "al")
-                                 "ldr %1, [%2]\n\t"
-                                 "cmp %1, %4\n\t"
-                                 "mov %0, %1\n\t"
-                                 "bne 1f\n\t"
-                                 NACL_ALIGN()
-                                 MASK_REGISTER("%2", "eq")
-                                 "swpeq %0, %3, [%2]\n\t"
-                                 "cmp %0, %1\n\t"
-                                 NACL_ALIGN()
-                                 MASK_REGISTER("%2", "ne")
-                                 "swpne %3, %0, [%2]\n\t"
-                                 "bne 0b\n\t"
-                                 "1:"
-                                 : "=&r" (a), "=&r" (b)
-                                 : "r" (dest), "r" (exch), "r" (comp)
-                                 : "cc", "memory");
-
-       return a;
-#endif
-}
-
-static inline gint32 InterlockedIncrement(volatile gint32 *dest)
-{
-#if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7S__)
-       gint32 ret, flag;
-       __asm__ __volatile__ (
-                               "dmb\n"
-                               "1:\n"
-                               NACL_ALIGN()
-                               MASK_REGISTER("%2", "al")
-                               "ldrex %0, [%2]\n"
-                               "add %0, %0, %3\n"
-                               NACL_ALIGN()
-                               MASK_REGISTER("%2", "al")
-                               "strex %1, %0, [%2]\n"
-                               "teq %1, #0\n"
-                               "bne 1b\n"
-                               "dmb\n"
-                               : "=&r" (ret), "=&r" (flag)
-                               : "r" (dest), "r" (1)
-                               : "memory", "cc");
-
-       return ret;
-#else
-       gint32 a, b, c;
-
-       __asm__ __volatile__ (  "0:\n\t"
-                               NACL_ALIGN()
-                               MASK_REGISTER("%3", "al")
-                               "ldr %0, [%3]\n\t"
-                               "add %1, %0, %4\n\t"
-                               NACL_ALIGN()
-                               MASK_REGISTER("%3", "al")
-                               "swp %2, %1, [%3]\n\t"
-                               "cmp %0, %2\n\t"
-                               NACL_ALIGN()
-                               MASK_REGISTER("%3", "ne")
-                               "swpne %1, %2, [%3]\n\t"
-                               "bne 0b"
-                               : "=&r" (a), "=&r" (b), "=&r" (c)
-                               : "r" (dest), "r" (1)
-                               : "cc", "memory");
-
-       return b;
-#endif
-}
-
-static inline gint32 InterlockedDecrement(volatile gint32 *dest)
-{
-#if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7S__)
-       gint32 ret, flag;
-       __asm__ __volatile__ (
-                               "dmb\n"
-                               "1:\n"
-                               NACL_ALIGN()
-                               MASK_REGISTER("%2", "al")
-                               "ldrex %0, [%2]\n"
-                               "sub %0, %0, %3\n"
-                               NACL_ALIGN()
-                               MASK_REGISTER("%2", "al")
-                               "strex %1, %0, [%2]\n"
-                               "teq %1, #0\n"
-                               "bne 1b\n"
-                               "dmb\n"
-                               : "=&r" (ret), "=&r" (flag)
-                               : "r" (dest), "r" (1)
-                               : "memory", "cc");
-
-       return ret;
-#else
-       gint32 a, b, c;
-
-       __asm__ __volatile__ (  "0:\n\t"
-                               NACL_ALIGN()
-                               MASK_REGISTER("%3", "al")
-                               "ldr %0, [%3]\n\t"
-                               "add %1, %0, %4\n\t"
-                               NACL_ALIGN()
-                               MASK_REGISTER("%3", "al")
-                               "swp %2, %1, [%3]\n\t"
-                               "cmp %0, %2\n\t"
-                               NACL_ALIGN()
-                               MASK_REGISTER("%3", "ne")
-                               "swpne %1, %2, [%3]\n\t"
-                               "bne 0b"
-                               : "=&r" (a), "=&r" (b), "=&r" (c)
-                               : "r" (dest), "r" (-1)
-                               : "cc", "memory");
-
-       return b;
-#endif
-}
-
-static inline gint32 InterlockedExchange(volatile gint32 *dest, gint32 exch)
-{
-#if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7S__)
-       gint32 ret, flag;
-       __asm__ __volatile__ (
-                                 "dmb\n"
-                             "1:\n"
-                             NACL_ALIGN()
-                             MASK_REGISTER("%3", "al")
-                             "ldrex %0, [%3]\n"
-                             NACL_ALIGN()
-                             MASK_REGISTER("%3", "al")
-                             "strex %1, %2, [%3]\n"
-                             "teq %1, #0\n"
-                             "bne 1b\n"
-                                 "dmb\n"
-                             : "=&r" (ret), "=&r" (flag)
-                             : "r" (exch), "r" (dest)
-                             : "memory", "cc");
-       return ret;
-#else
-       gint32 a;
-
-       __asm__ __volatile__ (  NACL_ALIGN()
-                               MASK_REGISTER("%1", "al")
-                                "swp %0, %2, [%1]"
-                               : "=&r" (a)
-                               : "r" (dest), "r" (exch));
-
-       return a;
-#endif
-}
-
-static inline gpointer InterlockedExchangePointer(volatile gpointer *dest, gpointer exch)
-{
-#if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7S__)
-       gpointer ret, flag;
-       __asm__ __volatile__ (
-                                 "dmb\n"
-                             "1:\n"
-                             NACL_ALIGN()
-                             MASK_REGISTER("%3", "al")
-                             "ldrex %0, [%3]\n"
-                             NACL_ALIGN()
-                             MASK_REGISTER("%3", "al")
-                             "strex %1, %2, [%3]\n"
-                             "teq %1, #0\n"
-                             "bne 1b\n"
-                                 "dmb\n"
-                             : "=&r" (ret), "=&r" (flag)
-                             : "r" (exch), "r" (dest)
-                             : "memory", "cc");
-       return ret;
-#else
-       gpointer a;
-
-       __asm__ __volatile__ (  NACL_ALIGN()
-                               MASK_REGISTER("%1", "al")
-                                "swp %0, %2, [%1]"
-                               : "=&r" (a)
-                               : "r" (dest), "r" (exch));
-
-       return a;
-#endif
-}
-
-static inline gint32 InterlockedExchangeAdd(volatile gint32 *dest, gint32 add)
-{
-#if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7S__)
-       gint32 ret, tmp, flag;
-       __asm__ __volatile__ (
-                               "dmb\n"
-                               "1:\n"
-                               NACL_ALIGN()
-                               MASK_REGISTER("%3", "al")
-                               "ldrex %0, [%3]\n"
-                               "add %1, %0, %4\n"
-                               NACL_ALIGN()
-                               MASK_REGISTER("%3", "al")
-                               "strex %2, %1, [%3]\n"
-                               "teq %2, #0\n"
-                               "bne 1b\n"
-                               "dmb\n"
-                               : "=&r" (ret), "=&r" (tmp), "=&r" (flag)
-                               : "r" (dest), "r" (add)
-                               : "memory", "cc");
-
-       return ret;
-#else
-       int a, b, c;
-
-       __asm__ __volatile__ (  "0:\n\t"
-                               NACL_ALIGN()
-                               MASK_REGISTER("%3", "al")
-                               "ldr %0, [%3]\n\t"
-                               "add %1, %0, %4\n\t"
-                               NACL_ALIGN()
-                               MASK_REGISTER("%3", "al")
-                               "swp %2, %1, [%3]\n\t"
-                               "cmp %0, %2\n\t"
-                               NACL_ALIGN()
-                               MASK_REGISTER("%3", "ne")
-                               "swpne %1, %2, [%3]\n\t"
-                               "bne 0b"
-                               : "=&r" (a), "=&r" (b), "=&r" (c)
-                               : "r" (dest), "r" (add)
-                               : "cc", "memory");
-
-       return a;
-#endif
-}
-
-#undef NACL_ALIGN
-#undef MASK_REGISTER
-
 #elif defined(__ia64__)
 
 #ifdef __INTEL_COMPILER
@@ -1077,98 +512,6 @@ static inline gint32 InterlockedExchangeAdd(gint32 volatile *val, gint32 add)
 #endif
 }
 
-#elif defined(__mips__)
-
-#if SIZEOF_REGISTER == 8
-#error "Not implemented."
-#endif
-
-static inline gint32 InterlockedIncrement(volatile gint32 *val)
-{
-       gint32 tmp, result = 0;
-
-       __asm__ __volatile__ ("    .set    mips32\n"
-                             "1:  ll      %0, %2\n"
-                             "    addu    %1, %0, 1\n"
-                              "    sc      %1, %2\n"
-                             "    beqz    %1, 1b\n"
-                             "    .set    mips0\n"
-                             : "=&r" (result), "=&r" (tmp), "=m" (*val)
-                             : "m" (*val));
-       return result + 1;
-}
-
-static inline gint32 InterlockedDecrement(volatile gint32 *val)
-{
-       gint32 tmp, result = 0;
-
-       __asm__ __volatile__ ("    .set    mips32\n"
-                             "1:  ll      %0, %2\n"
-                             "    subu    %1, %0, 1\n"
-                              "    sc      %1, %2\n"
-                             "    beqz    %1, 1b\n"
-                             "    .set    mips0\n"
-                             : "=&r" (result), "=&r" (tmp), "=m" (*val)
-                             : "m" (*val));
-       return result - 1;
-}
-
-static inline gint32 InterlockedCompareExchange(volatile gint32 *dest,
-                                               gint32 exch, gint32 comp) {
-       gint32 old, tmp;
-
-       __asm__ __volatile__ ("    .set    mips32\n"
-                             "1:  ll      %0, %2\n"
-                             "    bne     %0, %5, 2f\n"
-                             "    move    %1, %4\n"
-                              "    sc      %1, %2\n"
-                             "    beqz    %1, 1b\n"
-                             "2:  .set    mips0\n"
-                             : "=&r" (old), "=&r" (tmp), "=m" (*dest)
-                             : "m" (*dest), "r" (exch), "r" (comp));
-       return(old);
-}
-
-static inline gpointer InterlockedCompareExchangePointer(volatile gpointer *dest, gpointer exch, gpointer comp)
-{
-       return (gpointer)(InterlockedCompareExchange((volatile gint32 *)(dest), (gint32)(exch), (gint32)(comp)));
-}
-
-static inline gint32 InterlockedExchange(volatile gint32 *dest, gint32 exch)
-{
-       gint32 result, tmp;
-
-       __asm__ __volatile__ ("    .set    mips32\n"
-                             "1:  ll      %0, %2\n"
-                             "    move    %1, %4\n"
-                              "    sc      %1, %2\n"
-                             "    beqz    %1, 1b\n"
-                             "    .set    mips0\n"
-                             : "=&r" (result), "=&r" (tmp), "=m" (*dest)
-                             : "m" (*dest), "r" (exch));
-       return(result);
-}
-
-static inline gpointer InterlockedExchangePointer(volatile gpointer *dest, gpointer exch)
-{
-       return (gpointer)InterlockedExchange((volatile gint32 *)(dest), (gint32)(exch));
-}
-
-static inline gint32 InterlockedExchangeAdd(volatile gint32 *dest, gint32 add)
-{
-        gint32 result, tmp;
-
-       __asm__ __volatile__ ("    .set    mips32\n"
-                             "1:  ll      %0, %2\n"
-                             "    addu    %1, %0, %4\n"
-                              "    sc      %1, %2\n"
-                             "    beqz    %1, 1b\n"
-                             "    .set    mips0\n"
-                             : "=&r" (result), "=&r" (tmp), "=m" (*dest)
-                             : "m" (*dest), "r" (add));
-        return result;
-}
-
 #else
 
 #define WAPI_NO_ATOMIC_ASM
@@ -1183,53 +526,4 @@ extern gint32 InterlockedExchangeAdd(volatile gint32 *dest, gint32 add);
 
 #endif
 
-/* Not yet used */
-#ifdef USE_GCC_ATOMIC_OPS
-
-static inline gint32 InterlockedCompareExchange(volatile gint32 *dest,
-                                               gint32 exch, gint32 comp)
-{
-       return __sync_val_compare_and_swap (dest, comp, exch);
-}
-
-static inline gpointer InterlockedCompareExchangePointer(volatile gpointer *dest, gpointer exch, gpointer comp)
-{
-       return __sync_val_compare_and_swap (dest, comp, exch);
-}
-
-static inline gint32 InterlockedIncrement(volatile gint32 *val)
-{
-       return __sync_add_and_fetch (val, 1);
-}
-
-static inline gint32 InterlockedDecrement(volatile gint32 *val)
-{
-       return __sync_add_and_fetch (val, -1);
-}
-
-static inline gint32 InterlockedExchange(volatile gint32 *val, gint32 new_val)
-{
-       gint32 old_val;
-       do {
-               old_val = *val;
-       } while (__sync_val_compare_and_swap (val, old_val, new_val) != old_val);
-       return old_val;
-}
-
-static inline gpointer InterlockedExchangePointer(volatile gpointer *val,
-                                                 gpointer new_val)
-{
-       gpointer old_val;
-       do {
-               old_val = *val;
-       } while (__sync_val_compare_and_swap (val, old_val, new_val) != old_val);
-       return old_val;
-}
-
-static inline gint32 InterlockedExchangeAdd(volatile gint32 *val, gint32 add)
-{
-       return __sync_fetch_and_add (val, add);
-}
-#endif
-
 #endif /* _WAPI_ATOMIC_H_ */
diff --git a/mono/utils/bsearch.c b/mono/utils/bsearch.c
new file mode 100644 (file)
index 0000000..47be444
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * bsearch () implementation. Needed because some broken platforms
+ * have implementations that have unreasonable, non-standard
+ * requirements (e.g. "key must not be null"). Taken from NetBSD
+ * with some minor modifications.
+ *
+ * Copyright (c) 1990, 1993
+ *     The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include "mono/utils/bsearch.h"
+
+void *
+mono_binary_search (
+       const void *key,
+       const void *array,
+       size_t array_length,
+       size_t member_size,
+       BinarySearchComparer comparer)
+{
+       const char *base = array;
+       size_t lim;
+       int cmp;
+       const void *p;
+
+       for (lim = array_length; lim; lim >>= 1) {
+               p = base + (lim >> 1) * member_size;
+               cmp = (* comparer) (key, p);
+
+               if (!cmp)
+                       return (void *) p;
+               else if (cmp > 0) {
+                       base = (const char *) p + member_size;
+                       lim--;
+               }
+       }
+
+       return NULL;
+}
diff --git a/mono/utils/bsearch.h b/mono/utils/bsearch.h
new file mode 100644 (file)
index 0000000..82137ef
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef __MONO_BSEARCH_H__
+#define __MONO_BSEARCH_H__
+
+#include <stdlib.h>
+
+#include "mono/utils/mono-compiler.h"
+
+typedef int (* BinarySearchComparer) (const void *key, const void *member);
+
+void *
+mono_binary_search (
+       const void *key,
+       const void *array,
+       size_t array_length,
+       size_t member_size,
+       BinarySearchComparer comparer);
+
+#endif
index 0aaf76c220c549dcbd9f64f1a629586b6da1806f..eb5fd603514ef8a6d9c716858ad6d3dc9255d58c 100644 (file)
 #include <glib.h>
 #include <pthread.h>
 #include "utils/mono-sigcontext.h"
+#include "utils/mono-compiler.h"
 #include "mach-support.h"
 
 /* Known offsets used for TLS storage*/
 
-/*Found on iOS 6 */
-#define TLS_VECTOR_OFFSET_0 0x48
-#define TLS_VECTOR_OFFSET_1 0xA8
+
+static const int known_tls_offsets[] = {
+       0x48, /*Found on iOS 6 */
+       0xA4,
+       0xA8,
+};
+
+#define TLS_PROBE_COUNT (sizeof (known_tls_offsets) / sizeof (int))
+
+/* This is 2 slots less than the known low */
+#define TLS_PROBE_LOW_WATERMARK 0x40
+/* This is 24 slots above the know high, which is the same diff as the knowns high-low*/
+#define TLS_PROBE_HIGH_WATERMARK 0x108
 
 static int tls_vector_offset;
 
@@ -113,6 +124,7 @@ mono_mach_arch_get_tls_value_from_thread (pthread_t thread, guint32 key)
 void
 mono_mach_init (pthread_key_t key)
 {
+       int i;
        void *old_value = pthread_getspecific (key);
        void *canary = (void*)0xDEADBEEFu;
 
@@ -122,13 +134,20 @@ mono_mach_init (pthread_key_t key)
        pthread_setspecific (key, canary);
 
        /*First we probe for cats*/
-       tls_vector_offset = TLS_VECTOR_OFFSET_0;
-       if (mono_mach_arch_get_tls_value_from_thread (pthread_self (), key) == canary)
-               goto ok;
-
-       tls_vector_offset = TLS_VECTOR_OFFSET_1;
-       if (mono_mach_arch_get_tls_value_from_thread (pthread_self (), key) == canary)
-               goto ok;
+       for (i = 0; i < TLS_PROBE_COUNT; ++i) {
+               tls_vector_offset = known_tls_offsets [i];
+               if (mono_mach_arch_get_tls_value_from_thread (pthread_self (), key) == canary)
+                       goto ok;
+       }
+
+       /*Fallback to scanning a large range of offsets*/
+       for (i = TLS_PROBE_LOW_WATERMARK; i <= TLS_PROBE_HIGH_WATERMARK; i += 4) {
+               tls_vector_offset = i;
+               if (mono_mach_arch_get_tls_value_from_thread (pthread_self (), key) == canary) {
+                       g_warning ("Found new TLS offset at %d", i);
+                       goto ok;
+               }
+       }
 
        g_error ("could not discover the mach TLS offset");
 ok:
index 52e8215d5775b0439945154b8bfc56466402eb66..56f5ea90addbdf83bfe8f6a4440d71a568b23b8e 100644 (file)
 
 #ifdef __GNUC__
 #define MONO_ALWAYS_INLINE __attribute__((always_inline))
+#elif defined(_MSC_VER)
+#define MONO_ALWAYS_INLINE __forceinline
 #else
 #define MONO_ALWAYS_INLINE
 #endif
diff --git a/mono/utils/mono-hwcap-arm.c b/mono/utils/mono-hwcap-arm.c
new file mode 100644 (file)
index 0000000..d5d5f00
--- /dev/null
@@ -0,0 +1,159 @@
+/*
+ * mono-hwcap-arm.c: ARM hardware feature detection
+ *
+ * Authors:
+ *    Alex Rønne Petersen (alexrp@xamarin.com)
+ *    Elijah Taylor (elijahtaylor@google.com)
+ *    Miguel de Icaza (miguel@xamarin.com)
+ *    Neale Ferguson (Neale.Ferguson@SoftwareAG-usa.com)
+ *    Paolo Molaro (lupus@xamarin.com)
+ *    Rodrigo Kumpera (kumpera@gmail.com)
+ *    Sebastien Pouliot (sebastien@xamarin.com)
+ *    Zoltan Varga (vargaz@xamarin.com)
+ *
+ * Copyright 2003 Ximian, Inc.
+ * Copyright 2003-2011 Novell, Inc
+ * Copyright 2006 Broadcom
+ * Copyright 2007-2008 Andreas Faerber
+ * Copyright 2011-2013 Xamarin Inc
+ */
+
+#include "mono/utils/mono-hwcap-arm.h"
+
+#if defined(HAVE_SYS_AUXV_H) && !defined(PLATFORM_ANDROID)
+#include <sys/auxv.h>
+#elif defined(__APPLE__)
+#include <mach/machine.h>
+#include <sys/sysctl.h>
+#include <sys/types.h>
+#else
+#include <stdio.h>
+#endif
+
+gboolean mono_hwcap_arm_is_v5 = FALSE;
+gboolean mono_hwcap_arm_is_v6 = FALSE;
+gboolean mono_hwcap_arm_is_v7 = FALSE;
+gboolean mono_hwcap_arm_is_v7s = FALSE;
+gboolean mono_hwcap_arm_has_vfp = FALSE;
+gboolean mono_hwcap_arm_has_thumb = FALSE;
+gboolean mono_hwcap_arm_has_thumb2 = FALSE;
+
+#if defined(MONO_CROSS_COMPILE)
+void
+mono_hwcap_arch_init (void)
+{
+}
+#else
+void
+mono_hwcap_arch_init (void)
+{
+#if defined(HAVE_SYS_AUXV_H) && !defined(PLATFORM_ANDROID)
+       unsigned long hwcap;
+       unsigned long platform;
+
+       if ((hwcap = getauxval(AT_HWCAP))) {
+               /* HWCAP_ARM_THUMB */
+               if (hwcap & 0x00000004)
+                       mono_hwcap_arm_has_thumb = TRUE;
+
+               /* HWCAP_ARM_VFP */
+               if (hwcap & 0x00000064)
+                       mono_hwcap_arm_has_vfp = TRUE;
+
+               /* TODO: Find a way to detect Thumb 2. */
+       }
+
+       if ((platform = getauxval(AT_PLATFORM))) {
+               const char *str = (const char *) platform;
+
+               if (str [1] >= '5')
+                       mono_hwcap_arm_is_v5 = TRUE;
+
+               if (str [1] >= '6')
+                       mono_hwcap_arm_is_v6 = TRUE;
+
+               if (str [1] >= '7')
+                       mono_hwcap_arm_is_v7 = TRUE;
+
+               /* TODO: Find a way to detect v7s. */
+       }
+#elif defined(__APPLE__)
+       cpu_subtype_t sub_type;
+       size_t length = sizeof (sub_type);
+
+       sysctlbyname ("hw.cpusubtype", &sub_type, &length, NULL, 0);
+
+       if (sub_type == CPU_SUBTYPE_ARM_V5TEJ || sub_type == CPU_SUBTYPE_ARM_XSCALE) {
+               mono_hwcap_arm_is_v5 = TRUE;
+       } else if (sub_type == CPU_SUBTYPE_ARM_V6) {
+               mono_hwcap_arm_is_v5 = TRUE;
+               mono_hwcap_arm_is_v6 = TRUE;
+       } else if (sub_type == CPU_SUBTYPE_ARM_V7 || sub_type == CPU_SUBTYPE_ARM_V7F || sub_type == CPU_SUBTYPE_ARM_V7K) {
+               mono_hwcap_arm_is_v5 = TRUE;
+               mono_hwcap_arm_is_v6 = TRUE;
+               mono_hwcap_arm_is_v7 = TRUE;
+       }
+
+       /* TODO: Find a way to detect features like Thumb and VFP. */
+#else
+       /* We can't use the auxiliary vector on Android due to
+        * permissions, so fall back to /proc/cpuinfo. We also
+        * hit this path if the target doesn't have sys/auxv.h.
+        */
+
+       char buf [512];
+       char *line;
+
+       FILE *file = fopen ("/proc/cpuinfo", "r");
+
+       if (file) {
+               while ((line = fgets (buf, 512, file))) {
+                       if (!strncmp (line, "Processor", 9)) {
+                               char *ver = strstr (line, "(v");
+
+                               if (ver) {
+                                       if (ver [2] >= '5')
+                                               mono_hwcap_arm_is_v5 = TRUE;
+
+                                       if (ver [2] >= '6')
+                                               mono_hwcap_arm_is_v6 = TRUE;
+
+                                       if (ver [2] >= '7')
+                                               mono_hwcap_arm_is_v7 = TRUE;
+
+                                       /* TODO: Find a way to detect v7s. */
+                               }
+
+                               continue;
+                       }
+
+                       if (!strncmp (line, "Features", 8)) {
+                               if (strstr (line, "thumb"))
+                                       mono_hwcap_arm_has_thumb = TRUE;
+
+                               /* TODO: Find a way to detect Thumb 2. */
+
+                               if (strstr (line, "vfp"))
+                                       mono_hwcap_arm_has_vfp = TRUE;
+
+                               continue;
+                       }
+               }
+
+               fclose (file);
+       }
+#endif
+}
+#endif
+
+void
+mono_hwcap_print(FILE *f)
+{
+       g_fprintf (f, "mono_hwcap_arm_is_v5 = %i\n", mono_hwcap_arm_is_v5);
+       g_fprintf (f, "mono_hwcap_arm_is_v6 = %i\n", mono_hwcap_arm_is_v6);
+       g_fprintf (f, "mono_hwcap_arm_is_v7 = %i\n", mono_hwcap_arm_is_v7);
+       g_fprintf (f, "mono_hwcap_arm_is_v7s = %i\n", mono_hwcap_arm_is_v7s);
+       g_fprintf (f, "mono_hwcap_arm_has_vfp = %i\n", mono_hwcap_arm_has_vfp);
+       g_fprintf (f, "mono_hwcap_arm_has_thumb = %i\n", mono_hwcap_arm_has_thumb);
+       g_fprintf (f, "mono_hwcap_arm_has_thumb2 = %i\n", mono_hwcap_arm_has_thumb2);
+}
diff --git a/mono/utils/mono-hwcap-arm.h b/mono/utils/mono-hwcap-arm.h
new file mode 100644 (file)
index 0000000..6bc9c3b
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef __MONO_UTILS_HWCAP_ARM_H__
+#define __MONO_UTILS_HWCAP_ARM_H__
+
+#include "mono/utils/mono-hwcap.h"
+
+extern gboolean mono_hwcap_arm_is_v5;
+extern gboolean mono_hwcap_arm_is_v6;
+extern gboolean mono_hwcap_arm_is_v7;
+extern gboolean mono_hwcap_arm_is_v7s;
+extern gboolean mono_hwcap_arm_has_vfp;
+extern gboolean mono_hwcap_arm_has_thumb;
+extern gboolean mono_hwcap_arm_has_thumb2;
+
+#endif /* __MONO_UTILS_HWCAP_ARM_H__ */
diff --git a/mono/utils/mono-hwcap-ia64.c b/mono/utils/mono-hwcap-ia64.c
new file mode 100644 (file)
index 0000000..30590d7
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * mono-hwcap-ia64.c: Itanium hardware feature detection
+ *
+ * Authors:
+ *    Alex Rønne Petersen (alexrp@xamarin.com)
+ *    Elijah Taylor (elijahtaylor@google.com)
+ *    Miguel de Icaza (miguel@xamarin.com)
+ *    Neale Ferguson (Neale.Ferguson@SoftwareAG-usa.com)
+ *    Paolo Molaro (lupus@xamarin.com)
+ *    Rodrigo Kumpera (kumpera@gmail.com)
+ *    Sebastien Pouliot (sebastien@xamarin.com)
+ *    Zoltan Varga (vargaz@xamarin.com)
+ *
+ * Copyright 2003 Ximian, Inc.
+ * Copyright 2003-2011 Novell, Inc
+ * Copyright 2006 Broadcom
+ * Copyright 2007-2008 Andreas Faerber
+ * Copyright 2011-2013 Xamarin Inc
+ */
+
+#include "mono/utils/mono-hwcap-ia64.h"
+
+#if defined(MONO_CROSS_COMPILE)
+void
+mono_hwcap_arch_init (void)
+{
+}
+#else
+void
+mono_hwcap_arch_init (void)
+{
+       /* Nothing needed here yet. */
+}
+#endif
+
+void
+mono_hwcap_print (FILE *f)
+{
+}
diff --git a/mono/utils/mono-hwcap-ia64.h b/mono/utils/mono-hwcap-ia64.h
new file mode 100644 (file)
index 0000000..15b64a8
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef __MONO_UTILS_HWCAP_IA64_H__
+#define __MONO_UTILS_HWCAP_IA64_H__
+
+#include "mono/utils/mono-hwcap.h"
+
+/* Nothing needed here yet. */
+
+#endif /* __MONO_UTILS_HWCAP_IA64_H__ */
diff --git a/mono/utils/mono-hwcap-mips.c b/mono/utils/mono-hwcap-mips.c
new file mode 100644 (file)
index 0000000..c99b648
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * mono-hwcap-mips.c: MIPS hardware feature detection
+ *
+ * Authors:
+ *    Alex Rønne Petersen (alexrp@xamarin.com)
+ *    Elijah Taylor (elijahtaylor@google.com)
+ *    Miguel de Icaza (miguel@xamarin.com)
+ *    Neale Ferguson (Neale.Ferguson@SoftwareAG-usa.com)
+ *    Paolo Molaro (lupus@xamarin.com)
+ *    Rodrigo Kumpera (kumpera@gmail.com)
+ *    Sebastien Pouliot (sebastien@xamarin.com)
+ *    Zoltan Varga (vargaz@xamarin.com)
+ *
+ * Copyright 2003 Ximian, Inc.
+ * Copyright 2003-2011 Novell, Inc
+ * Copyright 2006 Broadcom
+ * Copyright 2007-2008 Andreas Faerber
+ * Copyright 2011-2013 Xamarin Inc
+ */
+
+#include "mono/utils/mono-hwcap-mips.h"
+
+#if defined(MONO_CROSS_COMPILE)
+void
+mono_hwcap_arch_init (void)
+{
+}
+#else
+void
+mono_hwcap_arch_init (void)
+{
+       /* Nothing needed here yet. */
+}
+#endif
+
+void
+mono_hwcap_print (FILE *f)
+{
+}
diff --git a/mono/utils/mono-hwcap-mips.h b/mono/utils/mono-hwcap-mips.h
new file mode 100644 (file)
index 0000000..dd0622a
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef __MONO_UTILS_HWCAP_MIPS_H__
+#define __MONO_UTILS_HWCAP_MIPS_H__
+
+#include "mono/utils/mono-hwcap.h"
+
+/* Nothing needed here yet. */
+
+#endif /* __MONO_UTILS_HWCAP_MIPS_H__ */
diff --git a/mono/utils/mono-hwcap-ppc.c b/mono/utils/mono-hwcap-ppc.c
new file mode 100644 (file)
index 0000000..1293d80
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * mono-hwcap-ppc.c: PowerPC hardware feature detection
+ *
+ * Authors:
+ *    Alex Rønne Petersen (alexrp@xamarin.com)
+ *    Elijah Taylor (elijahtaylor@google.com)
+ *    Miguel de Icaza (miguel@xamarin.com)
+ *    Neale Ferguson (Neale.Ferguson@SoftwareAG-usa.com)
+ *    Paolo Molaro (lupus@xamarin.com)
+ *    Rodrigo Kumpera (kumpera@gmail.com)
+ *    Sebastien Pouliot (sebastien@xamarin.com)
+ *    Zoltan Varga (vargaz@xamarin.com)
+ *
+ * Copyright 2003 Ximian, Inc.
+ * Copyright 2003-2011 Novell, Inc
+ * Copyright 2006 Broadcom
+ * Copyright 2007-2008 Andreas Faerber
+ * Copyright 2011-2013 Xamarin Inc
+ */
+
+#include "mono/utils/mono-hwcap-ppc.h"
+
+#if defined(__linux__) && defined(HAVE_SYS_AUXV_H)
+#include <string.h>
+#include <sys/auxv.h>
+#endif
+
+gboolean mono_hwcap_ppc_has_icache_snoop = FALSE;
+gboolean mono_hwcap_ppc_is_isa_2x = FALSE;
+gboolean mono_hwcap_ppc_is_isa_64 = FALSE;
+gboolean mono_hwcap_ppc_has_move_fpr_gpr = FALSE;
+gboolean mono_hwcap_ppc_has_multiple_ls_units = FALSE;
+
+#if defined(MONO_CROSS_COMPILE)
+void
+mono_hwcap_arch_init (void)
+{
+}
+#else
+void
+mono_hwcap_arch_init (void)
+{
+#if defined(__linux__) && defined(HAVE_SYS_AUXV_H)
+       unsigned long hwcap;
+       unsigned long platform;
+
+       if ((hwcap = getauxval(AT_HWCAP))) {
+               /* PPC_FEATURE_ICACHE_SNOOP */
+               if (hwcap & 0x00002000)
+                       mono_hwcap_ppc_has_icache_snoop = TRUE;
+
+               /* PPC_FEATURE_POWER4, PPC_FEATURE_POWER5, PPC_FEATURE_POWER5_PLUS,
+                  PPC_FEATURE_CELL_BE, PPC_FEATURE_PA6T, PPC_FEATURE_ARCH_2_05 */
+               if (hwcap & (0x00080000 | 0x00040000 | 0x00020000 | 0x00010000 | 0x00000800 | 0x00001000))
+                       mono_hwcap_ppc_is_isa_2x = TRUE;
+
+               /* PPC_FEATURE_64 */
+               if (hwcap & 0x40000000)
+                       mono_hwcap_ppc_is_isa_64 = TRUE;
+
+               /* PPC_FEATURE_POWER6_EXT */
+               if (hwcap & 0x00000200)
+                       mono_hwcap_ppc_has_move_fpr_gpr = TRUE;
+       }
+
+       if ((platform = getauxval(AT_PLATFORM))) {
+               const char *str = (const char *) platform;
+
+               if (!strcmp (str, "ppc970") || (!strncmp (str, "power", 5) && str [5] >= '4' && str [5] <= '7'))
+                       mono_hwcap_ppc_has_multiple_ls_units = TRUE;
+       }
+#endif
+}
+#endif
+
+void
+mono_hwcap_print (FILE* f)
+{
+       g_fprintf (f, "mono_hwcap_ppc_has_icache_snoop = %i\n", mono_hwcap_ppc_has_icache_snoop);
+       g_fprintf (f, "mono_hwcap_ppc_is_isa_2x = %i\n", mono_hwcap_ppc_is_isa_2x);
+       g_fprintf (f, "mono_hwcap_ppc_is_isa_64 = %i\n", mono_hwcap_ppc_is_isa_64);
+       g_fprintf (f, "mono_hwcap_ppc_has_move_fpr_gpr = %i\n", mono_hwcap_ppc_has_move_fpr_gpr);
+       g_fprintf (f, "mono_hwcap_ppc_has_multiple_ls_units = %i\n", mono_hwcap_ppc_has_multiple_ls_units);
+}
diff --git a/mono/utils/mono-hwcap-ppc.h b/mono/utils/mono-hwcap-ppc.h
new file mode 100644 (file)
index 0000000..0ae2578
--- /dev/null
@@ -0,0 +1,12 @@
+#ifndef __MONO_UTILS_HWCAP_PPC_H__
+#define __MONO_UTILS_HWCAP_PPC_H__
+
+#include "mono/utils/mono-hwcap.h"
+
+extern gboolean mono_hwcap_ppc_has_icache_snoop;
+extern gboolean mono_hwcap_ppc_is_isa_2x;
+extern gboolean mono_hwcap_ppc_is_isa_64;
+extern gboolean mono_hwcap_ppc_has_move_fpr_gpr;
+extern gboolean mono_hwcap_ppc_has_multiple_ls_units;
+
+#endif /* __MONO_UTILS_HWCAP_PPC_H__ */
diff --git a/mono/utils/mono-hwcap-s390x.c b/mono/utils/mono-hwcap-s390x.c
new file mode 100644 (file)
index 0000000..889df8a
--- /dev/null
@@ -0,0 +1,73 @@
+/*
+ * mono-hwcap-s390x.c: S/390x hardware feature detection
+ *
+ * Authors:
+ *    Alex Rønne Petersen (alexrp@xamarin.com)
+ *    Elijah Taylor (elijahtaylor@google.com)
+ *    Miguel de Icaza (miguel@xamarin.com)
+ *    Neale Ferguson (Neale.Ferguson@SoftwareAG-usa.com)
+ *    Paolo Molaro (lupus@xamarin.com)
+ *    Rodrigo Kumpera (kumpera@gmail.com)
+ *    Sebastien Pouliot (sebastien@xamarin.com)
+ *    Zoltan Varga (vargaz@xamarin.com)
+ *
+ * Copyright 2003 Ximian, Inc.
+ * Copyright 2003-2011 Novell, Inc
+ * Copyright 2006 Broadcom
+ * Copyright 2007-2008 Andreas Faerber
+ * Copyright 2011-2013 Xamarin Inc
+ */
+
+#include "mono/utils/mono-hwcap-s390x.h"
+
+#include <signal.h>
+
+gboolean mono_hwcap_s390x_has_ld = FALSE;
+
+#if defined(MONO_CROSS_COMPILE)
+void
+mono_hwcap_arch_init (void)
+{
+}
+#else
+static void
+catch_sigill (int sig_no, siginfo_t *info, gpointer act)
+{
+       mono_hwcap_s390x_has_ld = FALSE;
+}
+
+void
+mono_hwcap_arch_init (void)
+{
+       mono_hwcap_s390x_has_ld = TRUE;
+
+       struct sigaction sa, *old_sa;
+
+       /* Determine if we have a long displacement facility
+        * by executing the STY instruction. If it fails, we
+        * catch the SIGILL and assume the answer is no.
+        */
+       sa.sa_sigaction = catch_sigill;
+       sigemptyset (&sa.sa_mask);
+       sa.sa_flags = SA_SIGINFO;
+
+       sigaction (SIGILL, &sa, old_sa);
+
+       __asm__ __volatile__ (
+               "LGHI\t0,1\n\t"
+               "LA\t1,%0\n\t"
+               ".byte\t0xe3,0x00,0x10,0x00,0x00,0x50\n\t"
+               : "=m" (mono_hwcap_s390x_has_ld)
+               :
+               : "0", "1"
+       );
+
+       sigaction (SIGILL, old_sa, NULL);
+}
+#endif
+
+void
+mono_hwcap_print (FILE *f)
+{
+       g_fprintf (f, "mono_hwcap_s390x_has_ld = %i\n", mono_hwcap_s390x_has_ld);
+}
diff --git a/mono/utils/mono-hwcap-s390x.h b/mono/utils/mono-hwcap-s390x.h
new file mode 100644 (file)
index 0000000..24c76a2
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef __MONO_UTILS_HWCAP_S390X_H__
+#define __MONO_UTILS_HWCAP_S390X_H__
+
+#include "mono/utils/mono-hwcap.h"
+
+extern gboolean mono_hwcap_s390x_has_ld;
+
+#endif /* __MONO_UTILS_HWCAP_S390X_H__ */
diff --git a/mono/utils/mono-hwcap-sparc.c b/mono/utils/mono-hwcap-sparc.c
new file mode 100644 (file)
index 0000000..87bf9ca
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * mono-hwcap-sparc.c: SPARC hardware feature detection
+ *
+ * Authors:
+ *    Alex Rønne Petersen (alexrp@xamarin.com)
+ *    Elijah Taylor (elijahtaylor@google.com)
+ *    Miguel de Icaza (miguel@xamarin.com)
+ *    Neale Ferguson (Neale.Ferguson@SoftwareAG-usa.com)
+ *    Paolo Molaro (lupus@xamarin.com)
+ *    Rodrigo Kumpera (kumpera@gmail.com)
+ *    Sebastien Pouliot (sebastien@xamarin.com)
+ *    Zoltan Varga (vargaz@xamarin.com)
+ *
+ * Copyright 2003 Ximian, Inc.
+ * Copyright 2003-2011 Novell, Inc
+ * Copyright 2006 Broadcom
+ * Copyright 2007-2008 Andreas Faerber
+ * Copyright 2011-2013 Xamarin Inc
+ */
+
+#include "mono/utils/mono-hwcap-sparc.h"
+
+#include <string.h>
+
+#if !defined(__linux__)
+#include <sys/systeminfo.h>
+#else
+#include <unistd.h>
+#endif
+
+gboolean mono_hwcap_sparc_is_v9 = FALSE;
+
+#if defined(MONO_CROSS_COMPILE)
+void
+mono_hwcap_arch_init (void)
+{
+}
+#else
+void
+mono_hwcap_arch_init (void)
+{
+       char buf [1024];
+
+#if !defined(__linux__)
+       if (!sysinfo (SI_ISALIST, buf, 1024))
+               g_assert_not_reached ();
+#else
+       /* If the page size is 8192, we're on a 64-bit SPARC, which
+        * in turn means a v9 or better.
+        */
+       if (getpagesize () == 8192)
+               strcpy (buf, "sparcv9")
+       else
+               strcpy (buf, "sparcv8")
+#endif
+
+       mono_hwcap_sparc_is_v9 = strstr (buf, "sparcv9");
+}
+#endif
+
+void
+mono_hwcap_print (FILE *f)
+{
+       g_fprintf (f, "mono_hwcap_sparc_is_v9 = %i\n", mono_hwcap_sparc_is_v9);
+}
diff --git a/mono/utils/mono-hwcap-sparc.h b/mono/utils/mono-hwcap-sparc.h
new file mode 100644 (file)
index 0000000..98bcf8e
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef __MONO_UTILS_HWCAP_SPARC_H__
+#define __MONO_UTILS_HWCAP_SPARC_H__
+
+#include "mono/utils/mono-hwcap.h"
+
+extern gboolean mono_hwcap_sparc_is_v9;
+
+#endif /* __MONO_UTILS_HWCAP_SPARC_H__ */
diff --git a/mono/utils/mono-hwcap-x86.c b/mono/utils/mono-hwcap-x86.c
new file mode 100644 (file)
index 0000000..3a8df6b
--- /dev/null
@@ -0,0 +1,185 @@
+/*
+ * mono-hwcap-x86.c: x86 hardware feature detection
+ *
+ * Authors:
+ *    Alex Rønne Petersen (alexrp@xamarin.com)
+ *    Elijah Taylor (elijahtaylor@google.com)
+ *    Miguel de Icaza (miguel@xamarin.com)
+ *    Neale Ferguson (Neale.Ferguson@SoftwareAG-usa.com)
+ *    Paolo Molaro (lupus@xamarin.com)
+ *    Rodrigo Kumpera (kumpera@gmail.com)
+ *    Sebastien Pouliot (sebastien@xamarin.com)
+ *    Zoltan Varga (vargaz@xamarin.com)
+ *
+ * Copyright 2003 Ximian, Inc.
+ * Copyright 2003-2011 Novell, Inc
+ * Copyright 2006 Broadcom
+ * Copyright 2007-2008 Andreas Faerber
+ * Copyright 2011-2013 Xamarin Inc
+ */
+
+#include "mono/utils/mono-hwcap-x86.h"
+
+#if defined(HAVE_UNISTD_H)
+#include <unistd.h>
+#endif
+
+#if defined(_MSC_VER)
+#include <intrin.h>
+#endif
+
+gboolean mono_hwcap_x86_is_xen = FALSE;
+gboolean mono_hwcap_x86_has_cmov = FALSE;
+gboolean mono_hwcap_x86_has_fcmov = FALSE;
+gboolean mono_hwcap_x86_has_sse1 = FALSE;
+gboolean mono_hwcap_x86_has_sse2 = FALSE;
+gboolean mono_hwcap_x86_has_sse3 = FALSE;
+gboolean mono_hwcap_x86_has_ssse3 = FALSE;
+gboolean mono_hwcap_x86_has_sse41 = FALSE;
+gboolean mono_hwcap_x86_has_sse42 = FALSE;
+gboolean mono_hwcap_x86_has_sse4a = FALSE;
+
+#if defined(MONO_CROSS_COMPILE)
+void
+mono_hwcap_arch_init (void)
+{
+}
+#else
+static gboolean
+cpuid (int id, int *p_eax, int *p_ebx, int *p_ecx, int *p_edx)
+{
+#if defined(_MSC_VER)
+       int info [4];
+#endif
+
+       /* First, make sure we can use cpuid if we're on 32-bit. */
+#if defined(TARGET_X86)
+       gboolean have_cpuid = FALSE;
+
+#if defined(_MSC_VER)
+       __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
+       }
+#else
+       __asm__ __volatile__ (
+               "pushfl\n\t"
+               "popl\t%%eax\n\t"
+               "movl\t%%eax, %%edx\n\t"
+               "xorl\t$0x200000, %%eax\n\t"
+               "pushl\t%%eax\n\t"
+               "popfl\n\t"
+               "pushfl\n\t"
+               "popl\t%%eax\n\t"
+               "xorl\t%%edx, %%eax\n\t"
+               "andl\t$0x200000, %%eax\n\t"
+               "movl\t%%eax, %0\n\t"
+               : "=r" (have_cpuid)
+               :
+               : "%eax", "%edx"
+       );
+#endif
+
+       if (!have_cpuid)
+               return FALSE;
+#endif
+
+       /* Now issue the actual cpuid instruction. We can use
+          MSVC's __cpuid on both 32-bit and 64-bit. */
+#if defined(_MSC_VER)
+       __cpuid (info, id);
+       *p_eax = info [0];
+       *p_ebx = info [1];
+       *p_ecx = info [2];
+       *p_edx = info [3];
+#elif defined(TARGET_X86)
+       /* This complicated stuff is necessary because EBX
+          may be used by the compiler in PIC mode. */
+       __asm__ __volatile__ (
+               "xchgl\t%%ebx, %k1\n\t"
+               "cpuid\n\t"
+               "xchgl\t%%ebx, %k1\n\t"
+               : "=a" (*p_eax), "=&r" (*p_ebx), "=c" (*p_ecx), "=d" (*p_edx)
+               : "0" (id)
+       );
+#else
+       __asm__ __volatile__ (
+               "cpuid\n\t"
+               : "=a" (*p_eax), "=b" (*p_ebx), "=c" (*p_ecx), "=d" (*p_edx)
+               : "a" (id)
+       );
+#endif
+
+       return TRUE;
+}
+
+void
+mono_hwcap_arch_init (void)
+{
+       int eax, ebx, ecx, edx;
+
+       if (cpuid (1, &eax, &ebx, &ecx, &edx)) {
+               if (edx & (1 << 15)) {
+                       mono_hwcap_x86_has_cmov = TRUE;
+
+                       if (edx & 1)
+                               mono_hwcap_x86_has_fcmov = TRUE;
+               }
+
+               if (edx & (1 << 25))
+                       mono_hwcap_x86_has_sse1 = TRUE;
+
+               if (edx & (1 << 26))
+                       mono_hwcap_x86_has_sse2 = TRUE;
+
+               if (ecx & (1 << 0))
+                       mono_hwcap_x86_has_sse3 = TRUE;
+
+               if (ecx & (1 << 9))
+                       mono_hwcap_x86_has_ssse3 = TRUE;
+
+               if (ecx & (1 << 19))
+                       mono_hwcap_x86_has_sse41 = TRUE;
+
+               if (ecx & (1 << 20))
+                       mono_hwcap_x86_has_sse42 = TRUE;
+       }
+
+       if (cpuid (0x80000000, &eax, &ebx, &ecx, &edx)) {
+               if ((unsigned int) eax >= 0x80000001 && ebx == 0x68747541 && ecx == 0x444D4163 && edx == 0x69746E65) {
+                       if (cpuid (0x80000001, &eax, &ebx, &ecx, &edx)) {
+                               if (ecx & (1 << 6))
+                                       mono_hwcap_x86_has_sse4a = TRUE;
+                       }
+               }
+       }
+
+#if defined(HAVE_UNISTD_H)
+       mono_hwcap_x86_is_xen = !access ("/proc/xen", F_OK);
+#endif
+}
+#endif
+
+void
+mono_hwcap_print (FILE *f)
+{
+       g_fprintf (f, "mono_hwcap_x86_is_xen = %i\n", mono_hwcap_x86_is_xen);
+       g_fprintf (f, "mono_hwcap_x86_has_cmov = %i\n", mono_hwcap_x86_has_cmov);
+       g_fprintf (f, "mono_hwcap_x86_has_fcmov = %i\n", mono_hwcap_x86_has_fcmov);
+       g_fprintf (f, "mono_hwcap_x86_has_sse1 = %i\n", mono_hwcap_x86_has_sse1);
+       g_fprintf (f, "mono_hwcap_x86_has_sse2 = %i\n", mono_hwcap_x86_has_sse2);
+       g_fprintf (f, "mono_hwcap_x86_has_sse3 = %i\n", mono_hwcap_x86_has_sse3);
+       g_fprintf (f, "mono_hwcap_x86_has_ssse3 = %i\n", mono_hwcap_x86_has_ssse3);
+       g_fprintf (f, "mono_hwcap_x86_has_sse41 = %i\n", mono_hwcap_x86_has_sse41);
+       g_fprintf (f, "mono_hwcap_x86_has_sse42 = %i\n", mono_hwcap_x86_has_sse42);
+       g_fprintf (f, "mono_hwcap_x86_has_sse4a = %i\n", mono_hwcap_x86_has_sse4a);
+}
diff --git a/mono/utils/mono-hwcap-x86.h b/mono/utils/mono-hwcap-x86.h
new file mode 100644 (file)
index 0000000..5e1f4f7
--- /dev/null
@@ -0,0 +1,17 @@
+#ifndef __MONO_UTILS_HWCAP_X86_H__
+#define __MONO_UTILS_HWCAP_X86_H__
+
+#include "mono/utils/mono-hwcap.h"
+
+extern gboolean mono_hwcap_x86_is_xen;
+extern gboolean mono_hwcap_x86_has_cmov;
+extern gboolean mono_hwcap_x86_has_fcmov;
+extern gboolean mono_hwcap_x86_has_sse1;
+extern gboolean mono_hwcap_x86_has_sse2;
+extern gboolean mono_hwcap_x86_has_sse3;
+extern gboolean mono_hwcap_x86_has_ssse3;
+extern gboolean mono_hwcap_x86_has_sse41;
+extern gboolean mono_hwcap_x86_has_sse42;
+extern gboolean mono_hwcap_x86_has_sse4a;
+
+#endif /* __MONO_UTILS_HWCAP_X86_H__ */
diff --git a/mono/utils/mono-hwcap.c b/mono/utils/mono-hwcap.c
new file mode 100644 (file)
index 0000000..67787af
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * mono-hwcap.c: Hardware feature detection
+ *
+ * Authors:
+ *    Alex Rønne Petersen (alexrp@xamarin.com)
+ *    Elijah Taylor (elijahtaylor@google.com)
+ *    Miguel de Icaza (miguel@xamarin.com)
+ *    Neale Ferguson (Neale.Ferguson@SoftwareAG-usa.com)
+ *    Paolo Molaro (lupus@xamarin.com)
+ *    Rodrigo Kumpera (kumpera@gmail.com)
+ *    Sebastien Pouliot (sebastien@xamarin.com)
+ *    Zoltan Varga (vargaz@xamarin.com)
+ *
+ * Copyright 2003 Ximian, Inc.
+ * Copyright 2003-2011 Novell, Inc
+ * Copyright 2006 Broadcom
+ * Copyright 2007-2008 Andreas Faerber
+ * Copyright 2011-2013 Xamarin Inc
+ */
+
+#include <stdlib.h>
+
+#include "mono/utils/mono-hwcap.h"
+
+static gboolean hwcap_inited = FALSE;
+
+void
+mono_hwcap_init (void)
+{
+       const char *verbose = getenv ("MONO_VERBOSE_HWCAP");
+
+       if (hwcap_inited)
+               return;
+
+       mono_hwcap_arch_init ();
+
+       if (verbose)
+               mono_hwcap_print (stdout);
+}
diff --git a/mono/utils/mono-hwcap.h b/mono/utils/mono-hwcap.h
new file mode 100644 (file)
index 0000000..159701b
--- /dev/null
@@ -0,0 +1,50 @@
+#ifndef __MONO_UTILS_HWCAP_H__
+#define __MONO_UTILS_HWCAP_H__
+
+#include <stdio.h>
+#include <glib.h>
+
+#include "config.h"
+
+#include "mono/utils/mono-compiler.h"
+
+/* Call this function to perform hardware feature detection. Until
+ * this function has been called, all feature variables will be
+ * FALSE as a default.
+ *
+ * While this function can be called multiple times, doing so from
+ * several threads at the same time is not supported as it will
+ * result in an inconsistent state of the variables. Further,
+ * feature variables should not be read *while* this function is
+ * executing.
+ *
+ * To get at feature variables, include the appropriate header,
+ * e.g. mono-hwcap-x86.h for x86(-64).
+ */
+void mono_hwcap_init (void) MONO_INTERNAL;
+
+/* Implemented in mono-hwcap-$TARGET.c. Do not call. */
+void mono_hwcap_arch_init (void) MONO_INTERNAL;
+
+/* Print detected features to the given file. */
+void mono_hwcap_print (FILE *f) MONO_INTERNAL;
+
+/* Please note: If you're going to use the Linux auxiliary vector
+ * to detect CPU features, don't use any of the constant names in
+ * the hwcap.h header. This ties us to a particular version of the
+ * header, and since the values are guaranteed to be stable, hard-
+ * coding them is not that terrible.
+ *
+ * Also, please do not add assumptions to mono-hwcap. The code here
+ * is meant to *discover* facts about the hardware, not assume that
+ * some feature exists because of $arbitrary_preprocessor_define.
+ * If you have to make assumptions, do so elsewhere, e.g. in the
+ * Mini back end you're modifying.
+ *
+ * Finally, be conservative. If you can't determine precisely if a
+ * feature is present, assume that it isn't. In the rare cases where
+ * the hardware or operating system are lying, work around that in
+ * a different place, as with the rule above.
+ */
+
+#endif /* __MONO_UTILS_HWCAP_H__ */
index d49f12d184aa9af01a51ab31132831c01d3d4e71..d454ed067e5c1fbe36a0e85eb1f3237cb1105346 100644 (file)
 
 #include <glib.h>
 
-#if defined(__x86_64__) || defined(TARGET_AMD64)
-#ifndef _MSC_VER
-static inline void mono_memory_barrier (void)
-{
-       __asm__ __volatile__ ("mfence" : : : "memory");
-}
-
-static inline void mono_memory_read_barrier (void)
-{
-       __asm__ __volatile__ ("lfence" : : : "memory");
-}
-
-static inline void mono_memory_write_barrier (void)
-{
-       __asm__ __volatile__ ("sfence" : : : "memory");
-}
-#else
+#ifdef _MSC_VER
+#include <Windows.h>
 #include <intrin.h>
 
 static inline void mono_memory_barrier (void)
 {
+       /* NOTE: _ReadWriteBarrier and friends only prevent the
+          compiler from reordering loads and stores. To prevent
+          the CPU from doing the same, we have to use the
+          MemoryBarrier macro which expands to e.g. a serializing
+          XCHG instruction on x86. Also note that the MemoryBarrier
+          macro does *not* imply _ReadWriteBarrier, so that call
+          cannot be eliminated. */
        _ReadWriteBarrier ();
+       MemoryBarrier ();
 }
 
 static inline void mono_memory_read_barrier (void)
 {
        _ReadBarrier ();
+       MemoryBarrier ();
 }
 
 static inline void mono_memory_write_barrier (void)
 {
        _WriteBarrier ();
+       MemoryBarrier ();
 }
-#endif
-#elif defined(__i386__) || defined(TARGET_X86)
-#ifndef _MSC_VER
+#elif defined(__WIN32__) || defined(_WIN32)
+#include <Windows.h>
+
+/* Since we only support GCC 3.x in Cygwin for
+   some arcane reason, we have to use inline
+   assembly to get fences (__sync_synchronize
+   is not available). */
+
 static inline void mono_memory_barrier (void)
 {
-       __asm__ __volatile__ ("lock; addl $0,0(%%esp)" : : : "memory");
+       __asm__ __volatile__ (
+               "lock\n\t"
+               "addl\t$0,0(%%esp)\n\t"
+               :
+               :
+               : "memory"
+       );
 }
 
 static inline void mono_memory_read_barrier (void)
@@ -64,24 +70,21 @@ static inline void mono_memory_write_barrier (void)
 {
        mono_memory_barrier ();
 }
-#else
-#include <intrin.h>
-
+#elif defined(USE_GCC_ATOMIC_OPS)
 static inline void mono_memory_barrier (void)
 {
-       _ReadWriteBarrier ();
+       __sync_synchronize ();
 }
 
 static inline void mono_memory_read_barrier (void)
 {
-       _ReadBarrier ();
+       mono_memory_barrier ();
 }
 
 static inline void mono_memory_write_barrier (void)
 {
-       _WriteBarrier ();
+       mono_memory_barrier ();
 }
-#endif
 #elif defined(sparc) || defined(__sparc__)
 static inline void mono_memory_barrier (void)
 {
@@ -108,44 +111,6 @@ static inline void mono_memory_read_barrier (void)
        mono_memory_barrier ();
 }
 
-static inline void mono_memory_write_barrier (void)
-{
-       mono_memory_barrier ();
-}
-#elif defined(__ppc__) || defined(__powerpc__) || defined(__ppc64__)
-static inline void mono_memory_barrier (void)
-{
-       __asm__ __volatile__ ("sync" : : : "memory");
-}
-
-static inline void mono_memory_read_barrier (void)
-{
-       mono_memory_barrier ();
-}
-
-static inline void mono_memory_write_barrier (void)
-{
-       __asm__ __volatile__ ("eieio" : : : "memory");
-}
-
-#elif defined(__arm__)
-static inline void mono_memory_barrier (void)
-{
-#ifdef HAVE_ARMV6
-#ifdef __native_client__
-       /* NaCl requires ARMv7 CPUs. */
-       __asm__ __volatile__("dsb" : : : "memory");
-#else
-       __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r" (0) : "memory");
-#endif
-#endif
-}
-
-static inline void mono_memory_read_barrier (void)
-{
-       mono_memory_barrier ();
-}
-
 static inline void mono_memory_write_barrier (void)
 {
        mono_memory_barrier ();
@@ -165,21 +130,6 @@ static inline void mono_memory_write_barrier (void)
 {
        mono_memory_barrier ();
 }
-#elif defined(__mips__)
-static inline void mono_memory_barrier (void)
-{
-        __asm__ __volatile__ ("" : : : "memory");
-}
-
-static inline void mono_memory_read_barrier (void)
-{
-        mono_memory_barrier ();
-}
-
-static inline void mono_memory_write_barrier (void)
-{
-        mono_memory_barrier ();
-}
 #elif defined(MONO_CROSS_COMPILE)
 static inline void mono_memory_barrier (void)
 {
index 3fd7bc4c75c839339ff334b4ddc63e4503c4ead3..a97a7cc16b213dcd170ee94ab7032a69450d5aad 100644 (file)
@@ -152,16 +152,17 @@ Acquire/release semantics macros.
        *(target) = (value);    \
 } while (0)
 
-#define mono_atomic_load_release(target) ({    \
-       typeof (*target) __tmp; \
+#define mono_atomic_load_release(_type,target) ({      \
+       _type __tmp;    \
        LOAD_RELEASE_FENCE;     \
        __tmp = *target;        \
        __tmp; })
 
-#define mono_atomic_load_acquire(target) ({    \
-       typeof (*target) __tmp = *target;       \
+#define mono_atomic_load_acquire(var,_type,target) do {        \
+       _type __tmp = *target;  \
        LOAD_ACQUIRE_FENCE;     \
-       __tmp; })
+       (var) = __tmp; \
+} while (0)
 
 #define mono_atomic_store_acquire(target,value) {      \
        *target = value;        \
index 39fbca64f93c7596b4259ce337d05b13beec0ecb..6abad5756b0a8fea1204a675ec34425ded02cdb5 100644 (file)
 #include <string.h>
 #include <errno.h>
 #include <assert.h>
-#include <sys/time.h>
 #include <mono/utils/mono-memory-model.h>
 
+#ifndef HOST_WIN32
+#include <sys/time.h>
+#endif
+
 #include "mono-mutex.h"
 
 #ifndef HOST_WIN32
index d94c42c25166c9217ef7c5df90e65db9943d2c17..8dba68fe7fba6b44855283f4fedaa16d2d49e013 100644 (file)
@@ -97,7 +97,7 @@ suspend_signal_handler (int _dummy, siginfo_t *info, void *context)
        /* thread_state_init_from_sigctx return FALSE if the current thread is detaching and suspend can't continue. */
        current->suspend_can_continue = ret;
 
-       MONO_SEM_POST (&current->suspend_semaphore);
+       MONO_SEM_POST (&current->begin_suspend_semaphore);
 
        /* This thread is doomed, all we can do is give up and let the suspender recover. */
        if (!ret)
@@ -201,7 +201,7 @@ mono_threads_core_suspend (MonoThreadInfo *info)
 {
        /*FIXME, check return value*/
        mono_threads_pthread_kill (info, mono_thread_get_abort_signal ());
-       while (MONO_SEM_WAIT (&info->suspend_semaphore) != 0) {
+       while (MONO_SEM_WAIT (&info->begin_suspend_semaphore) != 0) {
                /* g_assert (errno == EINTR); */
        }
        return info->suspend_can_continue;
@@ -221,7 +221,7 @@ mono_threads_core_resume (MonoThreadInfo *info)
 void
 mono_threads_platform_register (MonoThreadInfo *info)
 {
-       MONO_SEM_INIT (&info->suspend_semaphore, 0);
+       MONO_SEM_INIT (&info->begin_suspend_semaphore, 0);
 
 #if defined (PLATFORM_ANDROID)
        info->native_handle = (gpointer) gettid ();
@@ -231,7 +231,7 @@ mono_threads_platform_register (MonoThreadInfo *info)
 void
 mono_threads_platform_free (MonoThreadInfo *info)
 {
-       MONO_SEM_DESTROY (&info->suspend_semaphore);
+       MONO_SEM_DESTROY (&info->begin_suspend_semaphore);
 }
 
 MonoNativeThreadId
index 9826b8210cebbe9804222f5d878c6652c3a529a5..0004e55c967954e437d6fcda1ec5e020bee49212 100644 (file)
@@ -108,7 +108,7 @@ typedef struct {
 
        /* only needed by the posix backend */ 
 #if (defined(_POSIX_VERSION) || defined(__native_client__)) && !defined (__MACH__)
-       MonoSemType suspend_semaphore;
+       MonoSemType begin_suspend_semaphore;
        gboolean syscall_break_signal;
        gboolean suspend_can_continue;
 #endif
index 3965534b31db930f13e72c210bdf359fb9058c62..1eea09750cbb4f67dd683aeb148562025bb9493b 100644 (file)
     <ClCompile Include="..\mono\metadata\sgen-split-nursery.c" />\r
     <ClCompile Include="..\mono\metadata\sgen-toggleref.c" />\r
     <ClCompile Include="..\mono\metadata\sgen-workers.c" />\r
+    <ClCompile Include="..\mono\metadata\sgen-fin-weak-hash.c" />\r
+    <ClCompile Include="..\mono\metadata\sgen-bridge.c" />\r
+    <ClCompile Include="..\mono\metadata\sgen-stw.c" />\r
     <ClCompile Include="..\mono\metadata\socket-io.c" />\r
     <ClCompile Include="..\mono\metadata\string-icalls.c" />\r
     <ClCompile Include="..\mono\metadata\sysmath.c" />\r
index 7fd05c936bd43cfe4d622aa458333a4211dc5096..4a98808419078f1c076815c55e53613ef62cdb2f 100644 (file)
@@ -42,6 +42,7 @@
     <ClCompile Include="..\mono\utils\mono-math.c" />\r
     <ClCompile Include="..\mono\utils\mono-md5.c" />\r
     <ClCompile Include="..\mono\utils\mono-mmap.c" />\r
+    <ClCompile Include="..\mono\utils\mono-mutex.c" />\r
     <ClCompile Include="..\mono\utils\mono-networkinterfaces.c" />\r
     <ClCompile Include="..\mono\utils\mono-path.c" />\r
     <ClCompile Include="..\mono\utils\mono-poll.c" />\r
     <ClCompile Include="..\mono\utils\monobitset.c" />\r
     <ClCompile Include="..\mono\utils\strenc.c" />\r
     <ClCompile Include="..\mono\utils\strtod.c" />\r
+    <ClCompile Include="..\mono\utils\atomic.c" />\r
+    <ClCompile Include="..\mono\utils\mono-hwcap.c" />\r
+    <ClCompile Include="..\mono\utils\mono-hwcap-x86.c" />\r
+    <ClCompile Include="..\mono\utils\bsearch.c" />\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClInclude Include="..\mono\utils\dlmalloc.h" />\r
     <ClInclude Include="..\mono\utils\mono-membar.h" />\r
     <ClInclude Include="..\mono\utils\mono-memory-model.h" />\r
     <ClInclude Include="..\mono\utils\mono-mmap.h" />\r
+    <ClInclude Include="..\mono\utils\mono-mutex.h" />\r
     <ClInclude Include="..\mono\utils\mono-networkinterfaces.h" />\r
     <ClInclude Include="..\mono\utils\mono-path.h" />\r
     <ClInclude Include="..\mono\utils\mono-poll.h" />\r
     <ClInclude Include="..\mono\utils\strenc.h" />\r
     <ClInclude Include="..\mono\utils\strtod.h" />\r
     <ClInclude Include="..\mono\utils\valgrind.h" />\r
+    <ClInclude Include="..\mono\utils\atomic.h" />\r
+    <ClInclude Include="..\mono\utils\mono-hwcap.h" />\r
+    <ClInclude Include="..\mono\utils\mono-hwcap-x86.h" />\r
+    <ClInclude Include="..\mono\utils\bsearch.h" />\r
   </ItemGroup>\r
   <PropertyGroup Label="Globals">\r
     <ProjectGuid>{8FC2B0C8-51AD-49DF-851F-5D01A77A75E4}</ProjectGuid>\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
   <ImportGroup Label="ExtensionTargets">\r
   </ImportGroup>\r
-</Project>
\ No newline at end of file
+</Project>\r
index a78caf0ef9e478cc30e1f40e3a8afa6b90f73aa2..233c2b113148075a1a03e3ebf5dc99a4d3723801 100644 (file)
@@ -1780,8 +1780,8 @@ gint64 Mono_Posix_Syscall_pwritev (int fd, struct Mono_Posix_Iovec* iov, int iov
 gint64 Mono_Posix_Syscall_read (int fd, void* buf, guint64 count);
 int Mono_Posix_Syscall_readdir (void* dir, struct Mono_Posix_Syscall__Dirent* dentry);
 int Mono_Posix_Syscall_readdir_r (void* dirp, struct Mono_Posix_Syscall__Dirent* entry, void** result);
-int Mono_Posix_Syscall_readlink (const char* path, char* buf, guint64 bufsiz);
-int Mono_Posix_Syscall_readlinkat (int dirfd, const char* pathname, char* buf, guint64 bufsiz);
+gint64 Mono_Posix_Syscall_readlink (const char* path, unsigned char* buf, guint64 bufsiz);
+gint64 Mono_Posix_Syscall_readlinkat (int dirfd, const char* pathname, unsigned char* buf, guint64 bufsiz);
 gint64 Mono_Posix_Syscall_readv (int fd, struct Mono_Posix_Iovec* iov, int iovcnt);
 int Mono_Posix_Syscall_remap_file_pages (void* start, guint64 size, int prot, gint64 pgoff, int flags);
 int Mono_Posix_Syscall_removexattr (const char* path, const char* name);
index 7fe7dac836324121782e1bb80d7878a7fce1b55b..1123f2bc0fac9112b60e8f398e11b685eb59783c 100644 (file)
@@ -138,24 +138,24 @@ Mono_Posix_Syscall_ttyname_r (int fd, char *buf, mph_size_t len)
 }
 #endif /* ndef HAVE_TTYNAME_R */
 
-gint32
-Mono_Posix_Syscall_readlink (const char *path, char *buf, mph_size_t len)
+gint64
+Mono_Posix_Syscall_readlink (const char *path, unsigned char *buf, mph_size_t len)
 {
-       int r;
+       gint64 r;
        mph_return_if_size_t_overflow (len);
-       r = readlink (path, buf, (size_t) len);
+       r = readlink (path, (char*) buf, (size_t) len);
        if (r >= 0 && r < len)
                buf [r] = '\0';
        return r;
 }
 
 #ifdef HAVE_READLINKAT
-gint32
-Mono_Posix_Syscall_readlinkat (int dirfd, const char *path, char *buf, mph_size_t len)
+gint64
+Mono_Posix_Syscall_readlinkat (int dirfd, const char *path, unsigned char *buf, mph_size_t len)
 {
-       int r;
+       gint64 r;
        mph_return_if_size_t_overflow (len);
-       r = readlinkat (dirfd, path, buf, (size_t) len);
+       r = readlinkat (dirfd, path, (char*) buf, (size_t) len);
        if (r >= 0 && r < len)
                buf [r] = '\0';
        return r;
index 3dfda20fa21b18e249a2f34a8b6ef0de1515d47a..32b3777d85aadfb0b62d5397ef7601106cff3d0e 100644 (file)
@@ -44,6 +44,10 @@ read_entry (FILE *in, void **data)
        case SGEN_PROTOCOL_CEMENT: size = sizeof (SGenProtocolCement); break;
        case SGEN_PROTOCOL_CEMENT_RESET: size = 0; break;
        case SGEN_PROTOCOL_DISLINK_UPDATE: size = sizeof (SGenProtocolDislinkUpdate); break;
+       case SGEN_PROTOCOL_DISLINK_UPDATE_STAGED: size = sizeof (SGenProtocolDislinkUpdateStaged); break;
+       case SGEN_PROTOCOL_DISLINK_PROCESS_STAGED: size = sizeof (SGenProtocolDislinkProcessStaged); break;
+       case SGEN_PROTOCOL_DOMAIN_UNLOAD_BEGIN: size = sizeof (SGenProtocolDomainUnload); break;
+       case SGEN_PROTOCOL_DOMAIN_UNLOAD_END: size = sizeof (SGenProtocolDomainUnload); break;
        default: assert (0);
        }
 
@@ -185,13 +189,37 @@ print_entry (int type, void *data)
        }
        case SGEN_PROTOCOL_DISLINK_UPDATE: {
                SGenProtocolDislinkUpdate *entry = data;
-               printf ("dislink_update link %p obj %p", entry->link, entry->obj);
+               printf ("dislink_update link %p obj %p staged %d", entry->link, entry->obj, entry->staged);
                if (entry->obj)
                        printf (" track %d\n", entry->track);
                else
                        printf ("\n");
                break;
        }
+       case SGEN_PROTOCOL_DISLINK_UPDATE_STAGED: {
+               SGenProtocolDislinkUpdateStaged *entry = data;
+               printf ("dislink_update_staged link %p obj %p index %d", entry->link, entry->obj, entry->index);
+               if (entry->obj)
+                       printf (" track %d\n", entry->track);
+               else
+                       printf ("\n");
+               break;
+       }
+       case SGEN_PROTOCOL_DISLINK_PROCESS_STAGED: {
+               SGenProtocolDislinkProcessStaged *entry = data;
+               printf ("dislink_process_staged link %p obj %p index %d\n", entry->link, entry->obj, entry->index);
+               break;
+       }
+       case SGEN_PROTOCOL_DOMAIN_UNLOAD_BEGIN: {
+               SGenProtocolDomainUnload *entry = data;
+               printf ("dislink_unload_begin domain %p\n", entry->domain);
+               break;
+       }
+       case SGEN_PROTOCOL_DOMAIN_UNLOAD_END: {
+               SGenProtocolDomainUnload *entry = data;
+               printf ("dislink_unload_end domain %p\n", entry->domain);
+               break;
+       }
        default:
                assert (0);
        }
@@ -215,6 +243,8 @@ is_match (gpointer ptr, int type, void *data)
        case SGEN_PROTOCOL_THREAD_REGISTER:
        case SGEN_PROTOCOL_THREAD_UNREGISTER:
        case SGEN_PROTOCOL_CEMENT_RESET:
+       case SGEN_PROTOCOL_DOMAIN_UNLOAD_BEGIN:
+       case SGEN_PROTOCOL_DOMAIN_UNLOAD_END:
                return TRUE;
        case SGEN_PROTOCOL_ALLOC:
        case SGEN_PROTOCOL_ALLOC_PINNED:
@@ -280,11 +310,70 @@ is_match (gpointer ptr, int type, void *data)
                SGenProtocolDislinkUpdate *entry = data;
                return ptr == entry->obj || ptr == entry->link;
        }
+       case SGEN_PROTOCOL_DISLINK_UPDATE_STAGED: {
+               SGenProtocolDislinkUpdateStaged *entry = data;
+               return ptr == entry->obj || ptr == entry->link;
+       }
+       case SGEN_PROTOCOL_DISLINK_PROCESS_STAGED: {
+               SGenProtocolDislinkProcessStaged *entry = data;
+               return ptr == entry->obj || ptr == entry->link;
+       }
        default:
                assert (0);
        }
 }
 
+static gboolean
+is_vtable_match (gpointer ptr, int type, void *data)
+{
+       switch (type) {
+       case SGEN_PROTOCOL_ALLOC:
+       case SGEN_PROTOCOL_ALLOC_PINNED:
+       case SGEN_PROTOCOL_ALLOC_DEGRADED: {
+               SGenProtocolAlloc *entry = data;
+               return ptr == entry->vtable;
+       }
+       case SGEN_PROTOCOL_COPY: {
+               SGenProtocolCopy *entry = data;
+               return ptr == entry->vtable;
+       }
+       case SGEN_PROTOCOL_PIN: {
+               SGenProtocolPin *entry = data;
+               return ptr == entry->vtable;
+       }
+       case SGEN_PROTOCOL_SCAN_BEGIN: {
+               SGenProtocolScanBegin *entry = data;
+               return ptr == entry->vtable;
+       }
+       case SGEN_PROTOCOL_WBARRIER: {
+               SGenProtocolWBarrier *entry = data;
+               return ptr == entry->value_vtable;
+       }
+       case SGEN_PROTOCOL_GLOBAL_REMSET: {
+               SGenProtocolGlobalRemset *entry = data;
+               return ptr == entry->value_vtable;
+       }
+       case SGEN_PROTOCOL_PTR_UPDATE: {
+               SGenProtocolPtrUpdate *entry = data;
+               return ptr == entry->vtable;
+       }
+       case SGEN_PROTOCOL_CLEANUP: {
+               SGenProtocolCleanup *entry = data;
+               return ptr == entry->vtable;
+       }
+       case SGEN_PROTOCOL_MISSING_REMSET: {
+               SGenProtocolMissingRemset *entry = data;
+               return ptr == entry->obj_vtable || ptr == entry->value_vtable;
+       }
+       case SGEN_PROTOCOL_CEMENT: {
+               SGenProtocolCement *entry = data;
+               return ptr == entry->vtable;
+       }
+       default:
+               return FALSE;
+       }
+}
+
 static gboolean dump_all = FALSE;
 
 int
@@ -294,13 +383,19 @@ main (int argc, char *argv[])
        void *data;
        int num_args = argc - 1;
        int num_nums = 0;
+       int num_vtables = 0;
        int i;
        long nums [num_args];
+       long vtables [num_args];
 
        for (i = 0; i < num_args; ++i) {
                char *arg = argv [i + 1];
+               char *next_arg = argv [i + 2];
                if (!strcmp (arg, "--all")) {
                        dump_all = TRUE;
+               } else if (!strcmp (arg, "-v") || !strcmp (arg, "--vtable")) {
+                       vtables [num_vtables++] = strtoul (next_arg, NULL, 16);
+                       ++i;
                } else {
                        nums [num_nums++] = strtoul (arg, NULL, 16);
                }
@@ -314,6 +409,14 @@ main (int argc, char *argv[])
                                break;
                        }
                }
+               if (!match) {
+                       for (i = 0; i < num_vtables; ++i) {
+                               if (is_vtable_match ((gpointer) vtables [i], type, data)) {
+                                       match = TRUE;
+                                       break;
+                               }
+                       }
+               }
                if (dump_all)
                        printf (match ? "* " : "  ");
                if (match || dump_all)