[Rr]elease*/
Ankh.NoLoad
*.gpState
+.vscode/
# Tooling
_ReSharper*/
[submodule "external/nunit-lite"]
path = external/nunit-lite
url = git://github.com/mono/NUnitLite.git
+[submodule "external/nuget-buildtasks"]
+ path = external/nuget-buildtasks
+ url = git://github.com/mono/NuGet.BuildTasks
+[submodule "external/buildtools"]
+ path = external/buildtools
+ url = git://github.com/mono/buildtools.git
.PHONY: validate-versions reset-versions
+SUBMODULES_CONFIG_FILE = $(top_srcdir)/acceptance-tests/SUBMODULES.json
include $(top_srcdir)/scripts/submodules/versions.mk
$(eval $(call ValidateVersionTemplate,roslyn,ROSLYN))
AM_CONDITIONAL(PLATFORM_SIGPOSIX, test x$use_sigposix = xyes)
AM_CONDITIONAL(PLATFORM_ANDROID, test x$platform_android = xyes)
+if test -z "$PLATFORM_DARWIN_TRUE"; then :
+PLATFORM_AOT_SUFFIX=.dylib
+fi
+
+if test -z "$PLATFORM_LINUX_TRUE"; then :
+PLATFORM_AOT_SUFFIX=.so
+fi
+
+AC_SUBST(PLATFORM_AOT_SUFFIX)
+
+## PLATFORM_AOT_SUFFIX not so simple for windows :-)
+
AC_CHECK_TOOL(CC, gcc, gcc)
AC_PROG_CC
AC_CHECK_TOOL(CXX, g++, g++)
TEST_PROFILE=default
enable_llvm_default=no
+INVARIANT_AOT_OPTIONS=nimt-trampolines=900,ntrampolines=8000,nrgctx-fetch-trampolines=256,ngsharedvt-trampolines=2800
+
if test x$cross_compiling = xyes -o x$enable_mcs_build = xno; then
DISABLE_MCS_DOCS_default=yes
with_profile4_x_default=no
with_monotouch_watch_default=yes
with_monotouch_tv_default=yes
with_xammac_default=yes
- with_mobile_static_default=yes
+ with_mobile_static_default=no
with_bitcode_default=no
elif test x$with_runtime_preset = xmobile_static; then
DISABLE_MCS_DOCS_default=yes
with_bitcode_default=no
with_cooperative_gc_default=no
TEST_PROFILE=mobile_static
+
+ mono_feature_disable_com='yes'
+ mono_feature_disable_remoting='yes'
+ mono_feature_disable_reflection_emit_save='yes'
+ mono_feature_disable_reflection_emit='yes'
+ mono_feature_disable_appdomains='yes'
+
+ AOT_BUILD_FLAGS="-O=gsharedvt --aot=full,$INVARIANT_AOT_OPTIONS"
+ AOT_RUN_FLAGS="--full-aot"
elif test x$with_runtime_preset = xbitcode_mobile_static; then
DISABLE_MCS_DOCS_default=yes
with_profile4_x_default=no
with_cooperative_gc_default=yes
TEST_PROFILE=mobile_static
enable_llvm_default=yes
- MONO_LLVMONLY=yes
+
+ mono_feature_disable_com='yes'
+ mono_feature_disable_remoting='yes'
+ mono_feature_disable_reflection_emit_save='yes'
+ mono_feature_disable_reflection_emit='yes'
+ mono_feature_disable_appdomains='yes'
+
+ AOT_BUILD_FLAGS="--aot=llvmonly,$INVARIANT_AOT_OPTIONS"
+ AOT_RUN_FLAGS="--llvmonly"
else
with_profile4_x_default=yes
with_monodroid_default=no
with_cooperative_gc_default=no
fi
+if test "x$AOT_BUILD_FLAGS" != "x"; then :
+ AC_SUBST(AOT_BUILD_FLAGS)
+ AC_SUBST(AOT_RUN_FLAGS)
+fi
+
AC_SUBST(TEST_PROFILE)
if test "x$with_profile4_x" = "xdefault"; then
AM_CONDITIONAL(INSTALL_XAMMAC, [test "x$with_xammac" != "xno"])
AM_CONDITIONAL(INSTALL_MOBILE_STATIC, [test "x$with_mobile_static" != "xno"])
-AC_SUBST(MONO_LLVMONLY)
+AC_SUBST(INSTALL_MOBILE_STATIC)
AC_SUBST(BITCODE)
echo "PLATFORM = darwin" >> $mcs_topdir/build/config.make
fi
+ if test "x$PLATFORM_AOT_SUFFIX" != "x"; then
+ echo "PLATFORM_AOT_SUFFIX = $PLATFORM_AOT_SUFFIX" >> $mcs_topdir/build/config.make
+ fi
+
if test x$AOT_SUPPORTED = xyes -a x$enable_system_aot = xdefault; then
enable_system_aot=yes
fi
echo "BCL_OPTIMIZE = 1" >> $srcdir/$mcsdir/build/config.make
fi
- if test "x$MONO_LLVMONLY" = "xyes" ; then
- echo "MONO_LLVMONLY = 1" >> $srcdir/$mcsdir/build/config.make
+ if test "x$AOT_BUILD_FLAGS" != "x" ; then
+ echo "AOT_RUN_FLAGS=$AOT_RUN_FLAGS" >> $srcdir/$mcsdir/build/config.make
+ echo "AOT_BUILD_FLAGS=$AOT_BUILD_FLAGS" >> $srcdir/$mcsdir/build/config.make
fi
fi
--- /dev/null
+Subproject commit a7dbffc17d029f2d66f56ddc9f50349a1bc0dcfe
--- /dev/null
+Subproject commit 04bdab55d8de9edcf628694cfd2001561e8f8e60
LLVM_PATH=llvm
+SUBMODULES_CONFIG_FILE = $(top_srcdir)/llvm/SUBMODULES.json
include $(top_srcdir)/scripts/submodules/versions.mk
$(eval $(call ValidateVersionTemplate,llvm,LLVM))
mono-symbolicate \- Mono Symbolicate Tool
.SH SYNOPSIS
.PP
-.B mono-symbolicate exefile stacktracesfile [directories...]
+.B mono-symbolicate <msym dir> <input file>
+.PP
+.B mono-symbolicate store-symbols <msym dir> [<dir>]+
.SH DESCRIPTION
mono-symbolicate is a tool that converts a stack trace with <filename unknown>:0
into one with file names and line numbers.
.PP
-The output of calling this tool will be the provided
-.I stacktracesfile
-where <filename unknown>:0 parts are replaced by
-a file name and a line number.
+When mono-symbolicate is called with a symbol directory and a file containing a stacktrace:
+.P
+.B mono-symbolicate <msym dir> <input file>
.PP
-For the tool to work it needs to load referenced assemblies, it will first look
-in the same folder as
-.I exefile
-then from one of the provided
-.I directories.
+The tool writes into stdout the file contents while adding file location to stack frames when
+it is possible to symbolicate with the symbols available on the symbol directory.
.PP
-The tool assumes that the folder with a referenced assembly called for example
-name.dll will also include name.dll.mdb,
-if the referenced assembly is AOT compiled then the tool is also expecting to find
-name.dll.msym.
+Managed symbols .exe/.dll can be added to the symbol directory by doing:
+.P
+.B mono-symbolicate store-symbols <msym dir> [<dir>]+
.SH AUTHOR
Written by Marcos Henrich
.SH COPYRIGHT
monotouch_tv_runtime_SUBDIRS := build class
xammac_SUBDIRS := build class
mobile_SUBDIRS := build class
-mobile_static_SUBDIRS := build class
+mobile_static_SUBDIRS := build class ilasm
binary_reference_assemblies_SUBDIRS := build class
net_4_x_SUBDIRS := build mcs class nunit24 ilasm tools tests errors docs
xammac_net_4_5_SUBDIRS := build class
# This is for changing / to \ on windows
PLATFORM_CHANGE_SEPARATOR_CMD = cat
-PLATFORM_AOT_SUFFIX = .dylib
-
hidden_prefix = .
hidden_suffix =
# This is for changing / to \ on windows
PLATFORM_CHANGE_SEPARATOR_CMD = cat
-PLATFORM_AOT_SUFFIX = .so
-
hidden_prefix = .
hidden_suffix =
override CURDIR:=$(shell cygpath -m $(CURDIR))
-## not so simple :-)
-#PLATFORM_AOT_SUFFIX = .dll
-
hidden_prefix =
hidden_suffix = .tmp
# Note need for trailing comma. If you add, keep it
PROFILE_TEST_HARNESS_EXCLUDES = MobileNotWorking,PKITS,
-ifndef MONO_DISABLE_GSHAREDVT
-GSHAREDVT_FLAG = -O=gsharedvt
-endif
-
-ifneq ($(MONO_LLVMONLY),)
-AOT_BUILD_FLAGS_PREFIX = --aot=llvmonly,
-AOT_RUN_FLAGS = --llvmonly
-else
-AOT_BUILD_FLAGS_PREFIX = $(GSHAREDVT_FLAG) --aot=full,
-AOT_RUN_FLAGS = --full-aot
-endif
-
ALWAYS_AOT = yes
DEFAULT_REFERENCES = -r:$(topdir)/class/lib/net_4_x/mscorlib.dll
PROFILE_MCS_FLAGS := $(PROFILE_MCS_FLAGS) -d:XBUILD_12
-RESGEN_EXE = $(topdir)/class/lib/net_4_x/resgen.exe
-
XBUILD_VERSION = 12.0
INTERNAL_ILASM = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/ilasm.exe
INTERNAL_CSC = $(RUNTIME) $(RUNTIME_FLAGS) $(CSC_LOCATION)
-RESGEN_EXE = $(topdir)/class/lib/$(PROFILE)/resgen.exe
+RESGEN_EXE = $(topdir)/class/lib/$(PROFILE)/$(PARENT_PROFILE)resgen.exe
INTERNAL_RESGEN = $(RUNTIME) $(RUNTIME_FLAGS) $(RESGEN_EXE)
-RESGEN = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_RESGEN)
+RESGEN = MONO_PATH="$(topdir)/class/lib/$(PROFILE)/$(PARENT_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_RESGEN)
STRING_REPLACER = MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/cil-stringreplacer.exe
depsdir = $(topdir)/build/deps
# Make sure propagates
export TEST_HARNESS
-# start aot config
-
-# We set the prefix of the aot build flags
-# in the profile. This determines the aot type,
-# whether it be llvmonly or full. To this we append the
-# options which do not change between them, the INVARIANT_AOT_OPTIONS
-ifndef AOT_BUILD_FLAGS_PREFIX
-AOT_BUILD_FLAGS_PREFIX = --aot=
-endif
-
-# Set the options for building and running AOT
-# The trampoline numbers are provisional, they are what is required
-# to run the mcs/class test suites. They should be considered a lower bound.
-INVARIANT_AOT_OPTIONS=nimt-trampolines=900,ntrampolines=8000,nrgctx-fetch-trampolines=256
-
-ifndef MONO_DISABLE_GSHAREDVT
-INVARIANT_AOT_OPTIONS:=$(INVARIANT_AOT_OPTIONS),ngsharedvt-trampolines=2800
-endif
-
-AOT_BUILD_FLAGS = $(AOT_BUILD_FLAGS_PREFIX)$(INVARIANT_AOT_OPTIONS)
-
-# end AOT config
-
ifdef BCL_OPTIMIZE
PROFILE_MCS_FLAGS += -optimize
endif
$(topdir)/class/lib/$(PROFILE)/%$(PLATFORM_AOT_SUFFIX): $(topdir)/class/lib/$(PROFILE)/%
@ mkdir -p $(topdir)/class/lib/$(PROFILE)/$*_bitcode_tmp
- @echo "AOT [$(PROFILE)] AOT $* " && cd $(topdir)/class/lib/$(PROFILE)/ && MONO_PATH="." $(RUNTIME) $(RUNTIME_FLAGS) $(AOT_BUILD_FLAGS),temp-path=$*_bitcode $* >> $(PROFILE)-aot.log
+ @echo "AOT [$(PROFILE)] AOT $* " && cd $(topdir)/class/lib/$(PROFILE)/ && MONO_PATH="." $(RUNTIME) $(RUNTIME_FLAGS) $(AOT_BUILD_FLAGS),temp-path=$*_bitcode_tmp $* >> $(PROFILE)-aot.log
@ rm -rf $(topdir)/class/lib/$(PROFILE)/$*_bitcode_tmp
endif #ifneq ("$(wildcard $(topdir)/class/lib/$(PROFILE))","")
dist-local: dist-default
-DIST_SUBDIRS = $(net_4_x_PARALLEL_SUBDIRS)
+DIST_SUBDIRS = $(net_4_x_PARALLEL_SUBDIRS) $(net_4_x_SUBDIRS) $(mobile_only_SUBDIRS)
DISTFILES=subdirs.make
doc-update-local:
System System.Core System.ComponentModel.DataAnnotations System.Numerics System.Runtime.Serialization System.XML \
System.ComponentModel.Composition System.ServiceModel System.Xml.Linq System.Data System.IO.Compression.FileSystem \
-System.ServiceProcess System.Security System.Net.Http.WebRequest System.Net.Http:
+System.ServiceProcess System.Security System.Net.Http.WebRequest System.Net.Http System.ServiceProcess:
all-local-aot:
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS)
+LIB_MCS_FLAGS = $(SIGN_FLAGS) $(EXTRA_LIB_MCS_FLAGS)
ifneq (2.1, $(FRAMEWORK_VERSION))
ifndef XAMMAC_4_5
--- /dev/null
+AssemblyInfo.cs
+
+../../System.Drawing/System.Drawing/Point.cs
+../../System.Drawing/System.Drawing/PointF.cs
+../../System.Drawing/System.Drawing/Rectangle.cs
+../../System.Drawing/System.Drawing/RectangleF.cs
+../../System.Drawing/System.Drawing/Size.cs
+../../System.Drawing/System.Drawing/SizeF.cs
+++ /dev/null
-AssemblyInfo.cs
-
-../../System.Drawing/System.Drawing/Point.cs
-../../System.Drawing/System.Drawing/PointF.cs
-../../System.Drawing/System.Drawing/Rectangle.cs
-../../System.Drawing/System.Drawing/RectangleF.cs
-../../System.Drawing/System.Drawing/Size.cs
-../../System.Drawing/System.Drawing/SizeF.cs
+++ /dev/null
-#include mobile_System.Drawing.Primitives.dll.sources
+++ /dev/null
-#include mobile_System.Drawing.Primitives.dll.sources
+++ /dev/null
-#include mobile_System.Drawing.Primitives.dll.sources
+++ /dev/null
-#include mobile_System.Drawing.Primitives.dll.sources
-#include mobile_System.Drawing.Primitives.dll.sources
+#include embedded_System.Drawing.Primitives.dll.sources
+++ /dev/null
-#include mobile_System.Drawing.Primitives.dll.sources
-#include mobile_System.Drawing.Primitives.dll.sources
+#include embedded_System.Drawing.Primitives.dll.sources
+++ /dev/null
-//
-// Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-[assembly: AssemblyTitle ("System.Private.CoreLib.Threading.dll")]
-[assembly: AssemblyDescription ("System.Private.CoreLib.Threading.dll")]
-[assembly: AssemblyDefaultAlias ("System.Private.CoreLib.Threading.dll")]
-[assembly: AssemblyCompany ("Xamarin, Inc.")]
-[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
-[assembly: AssemblyCopyright ("Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)")]
-[assembly: AssemblyVersion ("4.0.0.0")]
-[assembly: AssemblyInformationalVersion ("4.0.0.0")]
-[assembly: AssemblyFileVersion ("4.0.0.0")]
-[assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../../msfinal.pub")]
-
-[assembly: ReferenceAssembly]
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.30729</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{642A1B9E-1A2F-4C55-B184-E22F8C2E95B5}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <NoWarn>1699,1616,1699</NoWarn>\r
- <OutputPath>./../../../class/lib/net_4_x/Facades</OutputPath>\r
- <IntermediateOutputPath>obj-Facades</IntermediateOutputPath>\r
- <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>\r
- <NoStdLib>True</NoStdLib>\r
- \r
- <NoConfig>True</NoConfig>\r
- \r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>\r
- </RootNamespace>\r
- <AssemblyName>System.Private.CoreLib.Threading</AssemblyName>\r
- <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
- <FileAlignment>512</FileAlignment>\r
- </PropertyGroup>\r
- <PropertyGroup>\r
- <SignAssembly>true</SignAssembly>\r
- <DelaySign>true</DelaySign>\r
- </PropertyGroup>\r
- <PropertyGroup>\r
- <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <NoWarn>1699,1616,1699</NoWarn>\r
- <Optimize>false</Optimize>\r
- <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <NoWarn>1699,1616,1699</NoWarn>\r
- <Optimize>true</Optimize>\r
- <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <!-- Set AddAdditionalExplicitAssemblyReferences to false, otherwise if targetting .NET4.0, \r
- Microsoft.NETFramework.props will force a dependency on the assembly System.Core. This\r
- is a problem to compile the Mono mscorlib.dll -->\r
- <PropertyGroup>\r
- <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>\r
- </PropertyGroup>\r
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
- <ItemGroup>\r
- <Compile Include="AssemblyInfo.cs" />\r
- <Compile Include="TypeForwarders.cs" />\r </ItemGroup>\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <PropertyGroup>\r
- <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
-
- </PreBuildEvent>\r
- <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">\r
-\r
- </PreBuildEvent>\r
- <PostBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
-
- </PostBuildEvent>\r
- <PostBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">\r
-\r
- </PostBuildEvent>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="../../corlib/corlib-net_4_x.csproj">\r
- <Project>{2CA6026B-2DC8-4C4C-A12C-1E8234049DB7}</Project>\r
- <Name>corlib-net_4_x</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="../../System/System-net_4_x.csproj">\r
- <Project>{2762E921-91A8-4C87-91E9-BA628013F753}</Project>\r
- <Name>System-net_4_x</Name>\r
- </ProjectReference>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
-</Project>\r
-
+++ /dev/null
-MCS_BUILD_DIR = ../../../build
-
-thisdir = class/Facades/System.Private.CoreLib.Threading
-SUBDIRS =
-include $(MCS_BUILD_DIR)/rules.make
-
-LIBRARY_SUBDIR = Facades
-LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
-
-LIBRARY = System.Private.CoreLib.Threading.dll
-
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS)
-
-PLATFORM_DEBUG_FLAGS =
-
-NO_TEST = yes
-
-include $(MCS_BUILD_DIR)/library.make
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.30729</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{A577B5A0-5038-4D8E-8C80-18ED9FEC8686}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <NoWarn>1699,1616,1699</NoWarn>\r
- <OutputPath>./../../../class/lib/net_4_x/Facades</OutputPath>\r
- <NoStdLib>True</NoStdLib>\r
- <NoConfig>True</NoConfig>\r
- \r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>\r
- </RootNamespace>\r
- <AssemblyName>System.Private.CoreLib.Threading</AssemblyName>\r
- <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
- <FileAlignment>512</FileAlignment>\r
- </PropertyGroup>\r
- <PropertyGroup>\r
- <SignAssembly>true</SignAssembly>\r
- <DelaySign>true</DelaySign>\r
- </PropertyGroup>\r
- <PropertyGroup>\r
- <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <NoWarn>1699,1616,1699</NoWarn>\r
- <Optimize>false</Optimize>\r
- <DefineConstants>DEBUG;TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <NoWarn>1699,1616,1699</NoWarn>\r
- <Optimize>true</Optimize>\r
- <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <!-- Set AddAdditionalExplicitAssemblyReferences to false, otherwise if targetting .NET4.0, \r
- Microsoft.NETFramework.props will force a dependency on the assembly System.Core. This\r
- is a problem to compile the Mono mscorlib.dll -->\r
- <PropertyGroup>\r
- <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>\r
- </PropertyGroup>\r
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
- <ItemGroup>\r
- <Compile Include="AssemblyInfo.cs" />\r
- <Compile Include="TypeForwarders.cs" />\r </ItemGroup>\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <PropertyGroup>\r
- <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">\r
-\r
- </PreBuildEvent>\r
- <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">\r
-\r
- </PreBuildEvent>\r
-\r
- <PostBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">\r
-\r
- </PostBuildEvent>\r
- <PostBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">\r
-\r
- </PostBuildEvent>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="../../corlib/corlib-net_4_x.csproj">\r
- <Project>{2CA6026B-2DC8-4C4C-A12C-1E8234049DB7}</Project>\r
- <Name>corlib-net_4_x</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="../../corlib/corlib-net_4_x.csproj">\r
- <Project>{2CA6026B-2DC8-4C4C-A12C-1E8234049DB7}</Project>\r
- <Name>corlib-net_4_x</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="../../System/System-net_4_x.csproj">\r
- <Project>{2762E921-91A8-4C87-91E9-BA628013F753}</Project>\r
- <Name>System-net_4_x</Name>\r
- </ProjectReference>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
-</Project>\r
-
+++ /dev/null
-TypeForwarders.cs
-AssemblyInfo.cs
-
+++ /dev/null
-//
-// Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.AbandonedMutexException))]
-[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.AutoResetEvent))]
-[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.EventResetMode))]
-[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.EventWaitHandle))]
-[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Interlocked))]
-[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.LazyInitializer))]
-[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.ManualResetEvent))]
-[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Monitor))]
-[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Mutex))]
-[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Semaphore))]
-[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.SemaphoreFullException))]
-[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.SpinWait))]
-[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.SynchronizationLockException))]
-[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Volatile))]
-[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.WaitHandleCannotBeOpenedException))]
-
-//Missing: [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Condition))]
-//Missing: [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Lock))]
System.Security.Cryptography.Hashing.Algorithms System.Security.Cryptography.RSA System.Security.Cryptography.RandomNumberGenerator \
System.Security.Principal.Windows System.Threading.Thread System.Threading.ThreadPool \
System.Xml.XPath System.Xml.XmlDocument System.Xml.Xsl.Primitives Microsoft.Win32.Registry.AccessControl System.Diagnostics.StackTrace System.Globalization.Extensions \
-System.IO.FileSystem.AccessControl System.Private.CoreLib.InteropServices System.Private.CoreLib.Threading System.Reflection.TypeExtensions \
+System.IO.FileSystem.AccessControl System.Private.CoreLib.InteropServices System.Reflection.TypeExtensions \
System.Security.SecureString System.Threading.AccessControl System.Threading.Overlapped System.Xml.XPath.XDocument System.IO.Compression \
System.Security.Cryptography.Algorithms System.Security.Cryptography.Primitives System.Text.Encoding.CodePages System.IO.FileSystem.Watcher \
System.Security.Cryptography.ProtectedData System.ServiceProcess.ServiceController System.IO.Pipes
# common_SUBDIRS dependencies
-common_DEPS_SUBDIRS = System.Security.Cryptography.X509Certificates System.ServiceModel.Primitives System.Runtime.Serialization.Primitives System.Runtime.Serialization.Xml \
-System.Drawing.Primitives
+common_DEPS_SUBDIRS = System.Security.Cryptography.X509Certificates System.ServiceModel.Primitives System.Runtime.Serialization.Primitives System.Runtime.Serialization.Xml
+
+drawing_DEPS_SUBDIRS = System.Drawing.Primitives
reflection_PARALLEL_SUBDIRS = System.Reflection.Emit.ILGeneration System.Reflection.Emit.Lightweight System.Reflection.Emit
mobile_static_SUBDIRS = $(monotouch_SUBDIRS)
mobile_static_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS)
-net_4_x_SUBDIRS = $(common_DEPS_SUBDIRS)
+net_4_x_SUBDIRS = $(common_DEPS_SUBDIRS) $(drawing_DEPS_SUBDIRS)
net_4_x_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(reflection_PARALLEL_SUBDIRS) System.Diagnostics.PerformanceCounter \
System.Net.Http.WebRequestHandler
xammac_net_4_5_SUBDIRS = $(net_4_x_SUBDIRS)
xammac_net_4_5_PARALLEL_SUBDIRS = $(net_4_x_PARALLEL_SUBDIRS)
-monotouch_watch_SUBDIRS = $(monotouch_SUBDIRS)
+monotouch_watch_SUBDIRS = $(monotouch_SUBDIRS) $(drawing_DEPS_SUBDIRS)
monotouch_watch_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS)
monotouch_tv_SUBDIRS = $(monotouch_SUBDIRS)
System.ComponentModel.Composition.4.5 \
System.Net \
System.Net.Http \
- System.Net.Http.WebRequest \
System.Windows \
System.Xml.Serialization \
Mono.CSharp \
mobile_static_dirs := \
$(mobile_common_dirs) \
Mono.Dynamic.Interpreter \
+ PEAPI \
+ Mono.CompilerServices.SymbolWriter \
+ Mono.Simd \
$(pcl_facade_dirs)
mobile_dynamic_dirs := \
net_4_x_SUBDIRS := $(net_4_x_dirs) $(xbuild_4_0_dirs)
net_4_x_PARALLEL_SUBDIRS := $(net_4_x_parallel_dirs) aot-compiler
xbuild_12_SUBDIRS := $(xbuild_4_0_dirs)
-xbuild_14_SUBDIRS := $(xbuild_4_0_dirs)
+xbuild_14_SUBDIRS := $(xbuild_4_0_dirs) Microsoft.NuGet.Build.Tasks
include ../build/rules.make
SUBDIRS = $(mobile_static_dirs) $(mobile_dynamic_dirs) $(monotouch_dirs) $(monodroid_dirs) $(xammac_dirs) $(net_4_x_dirs) $(net_4_x_parallel_dirs) $(xammac_net_4_5_SUBDIRS)
-DIST_ONLY_SUBDIRS = dlr aot-compiler reference-assemblies $(xbuild_4_0_dirs)
+DIST_ONLY_SUBDIRS = dlr aot-compiler reference-assemblies $(xbuild_4_0_dirs) Microsoft.NuGet.Build.Tasks
# No new makefiles for: System.Messaging, System.Web.Mobile,
# System.ServiceProcess
framework_dir = Path.Combine (redistlist_dir, framework_dir);
var directories = new List<string> ();
- directories.Add (MSBuildUtils.FromMSBuildPath (framework_dir));
+
+ //MSBuild has a trailing slash on this value
+ directories.Add (MSBuildUtils.FromMSBuildPath (framework_dir) + Path.DirectorySeparatorChar);
string include = xr.GetAttribute ("IncludeFramework");
if (!String.IsNullOrEmpty (include)) {
else
return String.Empty;
case "identity":
- return Path.Combine (Path.GetDirectoryName (itemSpec), Path.GetFileName (itemSpec));
+ return itemSpec;
case "modifiedtime":
if (File.Exists (itemSpec))
return File.GetLastWriteTime (itemSpec).ToString ();
--- /dev/null
+thisdir = class/Microsoft.NuGet.Build.Tasks
+SUBDIRS =
+include ../../build/rules.make
+
+XBUILD_DIR=$(topdir)/tools/xbuild
+include $(XBUILD_DIR)/xbuild.make
+
+NUGET_BUILDTASKS_REPO_DIR=$(topdir)/../external/nuget-buildtasks
+NUGET_BUILDTASKS_TARGETS_DIR = $(mono_libdir)/mono/xbuild/Microsoft/NuGet
+
+LIBRARY = Microsoft.NuGet.Build.Tasks.dll
+LIBRARY_INSTALL_DIR = $(NUGET_BUILDTASKS_TARGETS_DIR)
+
+KEY_FILE = $(NUGET_BUILDTASKS_REPO_DIR)/build/PublicKey.snk
+SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE)
+
+RESOURCE_DEFS = Microsoft.NuGet.Build.Tasks.Strings,$(NUGET_BUILDTASKS_REPO_DIR)/src/Microsoft.NuGet.Build.Tasks/Strings.resx
+
+LIB_REFS = $(PARENT_PROFILE)System \
+ $(PARENT_PROFILE)System.Core \
+ $(PARENT_PROFILE)System.Data \
+ $(PARENT_PROFILE)System.Xml \
+ $(PARENT_PROFILE)System.Xml.Linq \
+ $(PARENT_PROFILE)System.Runtime.Serialization \
+ $(XBUILD_UTILITIES) \
+ $(XBUILD_FRAMEWORK)
+
+LIB_MCS_FLAGS = \
+ -nowarn:3021 \
+ $(SIGN_FLAGS)
+
+EXTRA_DISTFILES = \
+ $(NUGET_BUILDTASKS_REPO_DIR)/build/PublicKey.snk
+
+include ../../build/library.make
--- /dev/null
+../../../external/nuget-buildtasks/src/Microsoft.NuGet.Build.Tasks/Delegates.cs
+../../../external/nuget-buildtasks/src/Microsoft.NuGet.Build.Tasks/ExceptionFromResource.cs
+../../../external/nuget-buildtasks/src/Microsoft.NuGet.Build.Tasks/InternalsVisibleTo.cs
+../../../external/nuget-buildtasks/src/Microsoft.NuGet.Build.Tasks/NativeMethods.cs
+../../../external/nuget-buildtasks/src/Microsoft.NuGet.Build.Tasks/NuGetPackageObject.cs
+../../../external/nuget-buildtasks/src/Microsoft.NuGet.Build.Tasks/Preprocessor.cs
+../../../external/nuget-buildtasks/src/Microsoft.NuGet.Build.Tasks/ResolveNuGetPackageAssets.cs
+../../../external/nuget-buildtasks/src/Microsoft.NuGet.Build.Tasks/Strings.Designer.cs
+
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Bson/BsonBinaryType.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Bson/BsonBinaryWriter.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Bson/BsonReader.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Bson/BsonToken.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Bson/BsonType.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Bson/BsonWriter.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Bson/BsonObjectId.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/BinaryConverter.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/DataSetConverter.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/DataTableConverter.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/CustomCreationConverter.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/DateTimeConverterBase.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/EntityKeyMemberConverter.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/ExpandoObjectConverter.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/KeyValuePairConverter.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/BsonObjectIdConverter.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/RegexConverter.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/StringEnumConverter.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/ConstructorHandling.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/VersionConverter.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/DateFormatHandling.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/DateTimeZoneHandling.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Formatting.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonConstructorAttribute.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonPosition.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JPropertyKeyedCollection.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/DynamicProxy.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JPath.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JRaw.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Required.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonDynamicContract.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonFormatterConverter.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonISerializableContract.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonLinqContract.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonPrimitiveContract.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/DynamicValueProvider.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/ErrorEventArgs.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JPropertyDescriptor.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/DefaultReferenceResolver.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/PreserveReferencesHandling.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/IJsonLineInfo.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonArrayAttribute.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonContainerAttribute.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/DefaultValueHandling.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonConverterAttribute.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonObjectAttribute.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonSerializerSettings.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonValidatingReader.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/IJEnumerable.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JTokenEqualityComparer.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/MemberSerialization.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/ObjectCreationHandling.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/IsoDateTimeConverter.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/JavaScriptDateTimeConverter.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/XmlNodeConverter.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonTextReader.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonPropertyAttribute.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonIgnoreAttribute.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonTextWriter.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonWriterException.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonReaderException.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonConverter.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonConverterCollection.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonReader.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonConvert.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonSerializationException.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonSerializer.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/Extensions.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JConstructor.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JContainer.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JEnumerable.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JObject.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JArray.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JTokenReader.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JTokenWriter.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JToken.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JProperty.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JTokenType.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JValue.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/Extensions.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaException.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaModel.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaModelBuilder.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaNodeCollection.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaNode.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaResolver.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaWriter.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/UndefinedSchemaIdHandling.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/ValidationEventArgs.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/ValidationEventHandler.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/CamelCasePropertyNamesContractResolver.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/DefaultContractResolver.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/DefaultSerializationBinder.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/ErrorContext.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/IContractResolver.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/IValueProvider.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonArrayContract.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonContract.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonDictionaryContract.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonProperty.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonPropertyCollection.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/MissingMemberHandling.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/NullValueHandling.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/ReferenceLoopHandling.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchema.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaBuilder.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaConstants.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaGenerator.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/IReferenceResolver.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaType.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonObjectContract.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalBase.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonSerializerProxy.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonStringContract.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonTypeReflector.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/CachedAttributeGetter.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/LateBoundMetadataTypeAttribute.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/ReflectionValueProvider.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/OnErrorAttribute.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/Base64Encoder.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/DynamicProxyMetaObject.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/DynamicUtils.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/DynamicWrapper.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/DynamicReflectionDelegateFactory.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/ObjectConstructor.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/ILGeneratorExtensions.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/ReflectionDelegateFactory.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/LateBoundReflectionDelegateFactory.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/MethodCall.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/StringReference.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/ThreadSafeStore.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/TypeNameHandling.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/BidirectionalDictionary.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/ConvertUtils.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/CollectionWrapper.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/DateTimeUtils.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/DictionaryWrapper.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/EnumUtils.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/EnumValue.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/EnumValues.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/JavaScriptUtils.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonToken.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonWriter.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/StringBuffer.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/CollectionUtils.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/ListWrapper.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/MathUtils.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/MiscellaneousUtils.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/ReflectionUtils.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/StringUtils.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/TypeExtensions.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/ValidationUtils.cs
+../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/WriteState.cs
Hashtable documents = new Hashtable ();
-#if !CECIL
+#if !CECIL && !MOBILE
ModuleBuilder mb;
delegate Guid GetGuidFunc (ModuleBuilder mb);
GetGuidFunc get_guid_func;
NUnitMoonHelper.cs
-../../test-helpers/NetworkHelpers.cs
FeatureBased/Features.Client/AsyncCallTesterProxy.cs
FeatureBased/Features.Client/AsyncPatternServer.cs
FeatureBased/Features.Client/DataContractTesterProxy.cs
byte [] bytes = null;
MemoryStream ms = GetHeaders (true);
bool chunked = response.SendChunked;
- if (ms != null) {
- long start = ms.Position;
- if (chunked && !trailer_sent) {
- bytes = GetChunkSizeBytes (0, true);
- ms.Position = ms.Length;
- ms.Write (bytes, 0, bytes.Length);
+ if (stream.CanWrite) {
+ try {
+ if (ms != null) {
+ long start = ms.Position;
+ if (chunked && !trailer_sent) {
+ bytes = GetChunkSizeBytes (0, true);
+ ms.Position = ms.Length;
+ ms.Write (bytes, 0, bytes.Length);
+ }
+ InternalWrite (ms.GetBuffer (), (int) start, (int) (ms.Length - start));
+ trailer_sent = true;
+ } else if (chunked && !trailer_sent) {
+ bytes = GetChunkSizeBytes (0, true);
+ InternalWrite (bytes, 0, bytes.Length);
+ trailer_sent = true;
+ }
+ } catch (IOException ex) {
+ // Ignore error due to connection reset by peer
}
- InternalWrite (ms.GetBuffer (), (int) start, (int) (ms.Length - start));
- trailer_sent = true;
- } else if (chunked && !trailer_sent) {
- bytes = GetChunkSizeBytes (0, true);
- InternalWrite (bytes, 0, bytes.Length);
- trailer_sent = true;
}
response.Close ();
}
return i;
}
}
+
+ internal struct RuntimeEventHandle {
+ IntPtr value;
+
+ internal RuntimeEventHandle (IntPtr v)
+ {
+ value = v;
+ }
+
+ public IntPtr Value {
+ get {
+ return value;
+ }
+ }
+
+ public override bool Equals (object obj)
+ {
+ if (obj == null || GetType () != obj.GetType ())
+ return false;
+
+ return value == ((RuntimeEventHandle)obj).Value;
+ }
+
+ public bool Equals (RuntimeEventHandle handle)
+ {
+ return value == handle.Value;
+ }
+
+ public override int GetHashCode ()
+ {
+ return value.GetHashCode ();
+ }
+
+ public static bool operator == (RuntimeEventHandle left, RuntimeEventHandle right)
+ {
+ return left.Equals (right);
+ }
+
+ public static bool operator != (RuntimeEventHandle left, RuntimeEventHandle right)
+ {
+ return !left.Equals (right);
+ }
+ }
+
+ internal struct RuntimePropertyHandle {
+ IntPtr value;
+
+ internal RuntimePropertyHandle (IntPtr v)
+ {
+ value = v;
+ }
+
+ public IntPtr Value {
+ get {
+ return value;
+ }
+ }
+
+ public override bool Equals (object obj)
+ {
+ if (obj == null || GetType () != obj.GetType ())
+ return false;
+
+ return value == ((RuntimePropertyHandle)obj).Value;
+ }
+
+ public bool Equals (RuntimePropertyHandle handle)
+ {
+ return value == handle.Value;
+ }
+
+ public override int GetHashCode ()
+ {
+ return value.GetHashCode ();
+ }
+
+ public static bool operator == (RuntimePropertyHandle left, RuntimePropertyHandle right)
+ {
+ return left.Equals (right);
+ }
+
+ public static bool operator != (RuntimePropertyHandle left, RuntimePropertyHandle right)
+ {
+ return !left.Equals (right);
+ }
+ }
+
+ internal struct RuntimeGPtrArrayHandle {
+ unsafe RuntimeStructs.GPtrArray* value;
+
+ internal unsafe RuntimeGPtrArrayHandle (RuntimeStructs.GPtrArray* value)
+ {
+ this.value = value;
+ }
+
+ internal unsafe RuntimeGPtrArrayHandle (IntPtr ptr)
+ {
+ this.value = (RuntimeStructs.GPtrArray*) ptr;
+ }
+
+ internal int Length {
+ get {
+ unsafe {
+ return value->len;
+ }
+ }
+ }
+
+ internal IntPtr this[int i] => Lookup (i);
+
+ internal IntPtr Lookup (int i)
+ {
+ if (i >= 0 && i < Length) {
+ unsafe {
+ return value->data[i];
+ }
+ } else
+ throw new IndexOutOfRangeException ();
+ }
+
+ [MethodImpl(MethodImplOptions.InternalCall)]
+ unsafe extern static void GPtrArrayFree (RuntimeStructs.GPtrArray* value, bool freeSeg);
+
+ internal static void DestroyAndFree (ref RuntimeGPtrArrayHandle h, bool freeSeg) {
+ unsafe {
+ GPtrArrayFree (h.value, freeSeg);
+ h.value = null;
+ }
+ }
+ }
}
internal uint token;
internal MonoClass** constraints; /* NULL terminated */
}
+
+ // glib.h GPtrArray
+ internal unsafe struct GPtrArray {
+ internal IntPtr* data;
+ internal int len;
+ }
}
}
--- /dev/null
+//
+// Safe handle class for Mono.RuntimeGPtrArrayHandle
+//
+// Authors:
+// Aleksey Kliger <aleksey@xamarin.com>
+// Rodrigo Kumpera <kumpera@xamarin.com>
+//
+// Copyright 2016 Dot net foundation.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+using System;
+using System.Runtime.CompilerServices;
+
+namespace Mono {
+ internal sealed class SafeGPtrArrayHandle : IDisposable {
+ RuntimeGPtrArrayHandle handle;
+ bool freeSeg;
+
+ internal SafeGPtrArrayHandle (IntPtr ptr, bool freeSeg)
+ {
+ handle = new RuntimeGPtrArrayHandle (ptr);
+ this.freeSeg = freeSeg;
+ }
+
+ ~SafeGPtrArrayHandle ()
+ {
+ Dispose (false);
+ }
+
+ void Dispose (bool disposing)
+ {
+ RuntimeGPtrArrayHandle.DestroyAndFree (ref handle, freeSeg);
+ }
+
+ public void Dispose () {
+ Dispose (true);
+ GC.SuppressFinalize (this);
+ }
+
+ internal int Length {
+ get {
+ return handle.Length;
+ }
+ }
+
+ internal IntPtr this[int i] => handle[i];
+ }
+
+
+}
internal static MethodBase GetMethodFromHandleNoGenericCheck (RuntimeMethodHandle handle)
{
- return GetMethodFromHandleInternalType (handle.Value, IntPtr.Zero);
+ return GetMethodFromHandleInternalType_native (handle.Value, IntPtr.Zero, false);
+ }
+
+ internal static MethodBase GetMethodFromHandleNoGenericCheck (RuntimeMethodHandle handle, RuntimeTypeHandle reflectedType)
+ {
+ return GetMethodFromHandleInternalType_native (handle.Value, reflectedType.Value, false);
}
[MethodImplAttribute (MethodImplOptions.InternalCall)]
return GetMethodBodyInternal (handle);
}
+ static MethodBase GetMethodFromHandleInternalType (IntPtr method_handle, IntPtr type_handle) {
+ return GetMethodFromHandleInternalType_native (method_handle, type_handle, true);
+ }
+
[MethodImplAttribute (MethodImplOptions.InternalCall)]
- extern static MethodBase GetMethodFromHandleInternalType (IntPtr method_handle, IntPtr type_handle);
+ internal extern static MethodBase GetMethodFromHandleInternalType_native (IntPtr method_handle, IntPtr type_handle, bool genericCheck);
+
}
-}
\ No newline at end of file
+}
static extern Type MakeGenericType (Type gt, Type [] types);
[MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal extern RuntimeMethodInfo[] GetMethodsByName (string name, BindingFlags bindingAttr, bool ignoreCase, Type reflected_type);
+ internal extern IntPtr GetMethodsByName_native (string name, BindingFlags bindingAttr, bool ignoreCase);
+
+ internal RuntimeMethodInfo[] GetMethodsByName (string name, BindingFlags bindingAttr, bool ignoreCase, RuntimeType reflectedType)
+ {
+ var refh = new RuntimeTypeHandle (reflectedType);
+ using (var h = new Mono.SafeGPtrArrayHandle (GetMethodsByName_native (name, bindingAttr, ignoreCase), false)) {
+ var n = h.Length;
+ var a = new RuntimeMethodInfo [n];
+ for (int i = 0; i < n; i++) {
+ var mh = new RuntimeMethodHandle (h[i]);
+ a[i] = (RuntimeMethodInfo) MethodBase.GetMethodFromHandleNoGenericCheck (mh, refh);
+ }
+ return a;
+ }
+ }
[MethodImplAttribute(MethodImplOptions.InternalCall)]
- extern RuntimePropertyInfo[] GetPropertiesByName (string name, BindingFlags bindingAttr, bool icase, Type reflected_type);
+ extern IntPtr GetPropertiesByName_native (string name, BindingFlags bindingAttr, bool icase);
[MethodImplAttribute(MethodImplOptions.InternalCall)]
- extern RuntimeConstructorInfo[] GetConstructors_internal (BindingFlags bindingAttr, Type reflected_type);
+ extern IntPtr GetConstructors_native (BindingFlags bindingAttr);
+
+ RuntimeConstructorInfo[] GetConstructors_internal (BindingFlags bindingAttr, RuntimeType reflectedType)
+ {
+ var refh = new RuntimeTypeHandle (reflectedType);
+ using (var h = new Mono.SafeGPtrArrayHandle (GetConstructors_native (bindingAttr), false)) {
+ var n = h.Length;
+ var a = new RuntimeConstructorInfo [n];
+ for (int i = 0; i < n; i++) {
+ var mh = new RuntimeMethodHandle (h[i]);
+ a[i] = (RuntimeConstructorInfo) MethodBase.GetMethodFromHandleNoGenericCheck (mh, refh);
+ }
+ return a;
+ }
+ }
+
+ RuntimePropertyInfo[] GetPropertiesByName (string name, BindingFlags bindingAttr, bool icase, RuntimeType reflectedType)
+ {
+ var refh = new RuntimeTypeHandle (reflectedType);
+ using (var h = new Mono.SafeGPtrArrayHandle (GetPropertiesByName_native (name, bindingAttr, icase), false)) {
+ var n = h.Length;
+ var a = new RuntimePropertyInfo [n];
+ for (int i = 0; i < n; i++) {
+ var ph = new Mono.RuntimePropertyHandle (h[i]);
+ a[i] = (RuntimePropertyInfo) PropertyInfo.GetPropertyFromHandle (ph, refh);
+ }
+ return a;
+ }
+ }
public override InterfaceMapping GetInterfaceMap (Type ifaceType)
{
extern int GetGenericParameterPosition ();
[MethodImplAttribute(MethodImplOptions.InternalCall)]
- extern RuntimeEventInfo[] GetEvents_internal (string name, BindingFlags bindingAttr, Type reflected_type);
+ extern IntPtr GetEvents_native (string name, BindingFlags bindingAttr);
[MethodImplAttribute(MethodImplOptions.InternalCall)]
- extern RuntimeFieldInfo[] GetFields_internal (string name, BindingFlags bindingAttr, Type reflected_type);
+ extern IntPtr GetFields_native (string name, BindingFlags bindingAttr);
+
+ RuntimeFieldInfo[] GetFields_internal (string name, BindingFlags bindingAttr, RuntimeType reflectedType)
+ {
+ var refh = new RuntimeTypeHandle (reflectedType);
+ using (var h = new Mono.SafeGPtrArrayHandle (GetFields_native (name, bindingAttr), false)) {
+ int n = h.Length;
+ var a = new RuntimeFieldInfo[n];
+ for (int i = 0; i < n; i++) {
+ var fh = new RuntimeFieldHandle (h[i]);
+ a[i] = (RuntimeFieldInfo) FieldInfo.GetFieldFromHandle (fh, refh);
+ }
+ return a;
+ }
+ }
+
+ RuntimeEventInfo[] GetEvents_internal (string name, BindingFlags bindingAttr, RuntimeType reflectedType)
+ {
+ var refh = new RuntimeTypeHandle (reflectedType);
+ using (var h = new Mono.SafeGPtrArrayHandle (GetEvents_native (name, bindingAttr), false)) {
+ int n = h.Length;
+ var a = new RuntimeEventInfo[n];
+ for (int i = 0; i < n; i++) {
+ var eh = new Mono.RuntimeEventHandle (h[i]);
+ a[i] = (RuntimeEventInfo) EventInfo.GetEventFromHandle (eh, refh);
+ }
+ return a;
+ }
+ }
[MethodImplAttribute(MethodImplOptions.InternalCall)]
public extern override Type[] GetInterfaces();
internal static string WindowsDriveAdjustment (string path)
{
- // two special cases to consider when a drive is specified
- if (path.Length < 2)
+ // three special cases to consider when a drive is specified
+ if (path.Length < 2) {
+ if (path.Length == 1 && (path[0] == '\\' || path[0] == '/'))
+ return Path.GetPathRoot(Directory.GetCurrentDirectory());
return path;
+ }
if ((path [1] != ':') || !Char.IsLetter (path [0]))
return path;
//
using System.Diagnostics;
+using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace System.Reflection {
public virtual MethodInfo RemoveMethod {
get { return GetRemoveMethod (true); }
}
+
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ private static extern EventInfo internal_from_handle_type (IntPtr event_handle, IntPtr type_handle);
+
+ internal static EventInfo GetEventFromHandle (Mono.RuntimeEventHandle handle)
+ {
+ if (handle.Value == IntPtr.Zero)
+ throw new ArgumentException ("The handle is invalid.");
+ return internal_from_handle_type (handle.Value, IntPtr.Zero);
+ }
+
+ internal static EventInfo GetEventFromHandle (Mono.RuntimeEventHandle handle, RuntimeTypeHandle reflectedType)
+ {
+ if (handle.Value == IntPtr.Zero)
+ throw new ArgumentException ("The handle is invalid.");
+ EventInfo ei = internal_from_handle_type (handle.Value, reflectedType.Value);
+ if (ei == null)
+ throw new ArgumentException ("The event handle and the type handle are incompatible.");
+ return ei;
+ }
}
}
throw new NotImplementedException ();
}
#endif
+
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ private static extern PropertyInfo internal_from_handle_type (IntPtr event_handle, IntPtr type_handle);
+
+ internal static PropertyInfo GetPropertyFromHandle (Mono.RuntimePropertyHandle handle, RuntimeTypeHandle reflectedType)
+ {
+ if (handle.Value == IntPtr.Zero)
+ throw new ArgumentException ("The handle is invalid.");
+ PropertyInfo pi = internal_from_handle_type (handle.Value, reflectedType.Value);
+ if (pi == null)
+ throw new ArgumentException ("The property handle and the type handle are incompatible.");
+ return pi;
+ }
}
}
+++ /dev/null
-using System;
-using System.Runtime.InteropServices;
-
-namespace Microsoft.Win32.SafeHandles
-{
- public sealed class SafeAccessTokenHandle : SafeHandle
- {
- public override bool IsInvalid {
- get {
- return handle == IntPtr.Zero;
- }
- }
-
- public SafeAccessTokenHandle ()
- : base (IntPtr.Zero, true)
- {
-
- }
-
- protected override bool ReleaseHandle()
- {
- return true;
- }
- }
-}
public bool IsDaylightSavingTime (DateTimeOffset dateTimeOffset)
{
- throw new NotImplementedException ();
+ return IsDaylightSavingTime (dateTimeOffset.DateTime);
}
internal DaylightTime GetDaylightChanges (int year)
i, root + test [i, 0], ex.GetType ()));
}
}
+
+ // These cases require that we don't pass a root to GetFullPath - it should return the proper drive root.
+ string root4 = Path.GetPathRoot(Directory.GetCurrentDirectory());
+ Assert.AreEqual(root4, Path.GetFullPath(@"\"));
+ Assert.AreEqual(root4, Path.GetFullPath("/"));
}
[Test]
using System.Security.Permissions;
using System.Collections.Generic;
using System.Threading;
+using MonoTests.Helpers;
namespace MonoTests.System.Runtime.CompilerServices {
var cwt = new ConditionalWeakTable <object,object> ();
List<object> keepAlive = null;
List<WeakReference> keys = null;
- Thread t = new Thread (delegate () {
+ FinalizerHelpers.PerformNoPinAction (delegate () {
FillStuff (cwt, out keepAlive, out keys);
});
- t.Start ();
- t.Join ();
GC.Collect ();
cwt.Add (b, new object ());
List<WeakReference> res = null;
- ThreadStart dele = () => { res = FillWithNetwork (cwt); };
- var th = new Thread(dele);
- th.Start ();
- th.Join ();
+ FinalizerHelpers.PerformNoPinAction (() => { res = FillWithNetwork (cwt); });
GC.Collect ();
GC.Collect ();
List<WeakReference> res, res2;
res = res2 = null;
- ThreadStart dele = () => {
+ FinalizerHelpers.PerformNoPinAction (() => {
res = FillWithNetwork2 (cwt);
ForcePromotion ();
k = FillReachable (cwt);
res2 = FillWithNetwork2 (cwt);
- };
-
- var th = new Thread(dele);
- th.Start ();
- th.Join ();
+ });
GC.Collect ();
Assert.Ignore ("Not working on Boehm.");
lock (_lock1) {
var cwt = new ConditionalWeakTable <object,object> ();
- ThreadStart dele = () => { FillWithFinalizable (cwt); };
- var th = new Thread(dele);
- th.Start ();
- th.Join ();
+ FinalizerHelpers.PerformNoPinAction (() => { FillWithFinalizable (cwt); });
GC.Collect ();
GC.Collect ();
Assert.IsFalse (tzi.IsDaylightSavingTime (date));
Assert.AreEqual (new TimeSpan (2,0,0), tzi.GetUtcOffset (date));
}
+
+ [Test] //Covers #41349
+ public void TestIsDST_DateTimeOffset ()
+ {
+ TimeZoneInfo tzi = TimeZoneInfo.FindSystemTimeZoneById ("Europe/Athens");
+ var date = new DateTime (2014, 3, 30 , 2, 0, 0);
+ var offset = tzi.GetUtcOffset (date);
+ var dateOffset = new DateTimeOffset (date, offset);
+ Assert.IsFalse (tzi.IsDaylightSavingTime (dateOffset));
+
+ date = new DateTime (2014, 3, 30 , 3, 0, 0);
+ offset = tzi.GetUtcOffset (date);
+ dateOffset = new DateTimeOffset (date, offset);
+ Assert.IsTrue (tzi.IsDaylightSavingTime (dateOffset));
+ }
}
[TestFixture]
Mono/Runtime.cs
Mono/RuntimeStructs.cs
Mono/RuntimeHandles.cs
+Mono/SafeGPtrArrayHandle.cs
Mono/DataConverter.cs
Mono.Interop/ComInteropProxy.cs
Mono.Interop/IDispatch.cs
System.Security/PermissionBuilder.cs
System.Security/PermissionSet.cs
System.Security/PolicyLevelType.cs
-System.Security/SafeAccessTokenHandle.cs
System.Security/SecureString.cs
System.Security/SecurityElement.cs
System.Security/SecurityFrame.cs
../referencesource/mscorlib/system/security/attributes.cs
../referencesource/mscorlib/system/security/securitycontext.cs
../referencesource/mscorlib/system/security/securitydocument.cs
+../referencesource/mscorlib/system/security/safesecurityhandles.cs
../referencesource/mscorlib/system/security/claims/Claim.cs
../referencesource/mscorlib/system/security/claims/ClaimsIdentity.cs
System/AggregateExceptionTests.cs
System.Threading/ThreadLocalTests.cs
System.Threading/SpinLockTests.cs
-
+../../test-helpers/TestHelpers.cs
[SecurityCritical]
protected override bool ReleaseHandle()
{
+#if MONO
+ return true;
+#else
return Win32Native.CloseHandle(handle);
+#endif
}
}
--- /dev/null
+../../../mono/mini/TestHelpers.cs
\ No newline at end of file
// InstrToken.cs\r
// Author: Sergey Chaban (serge@wildwestsoftware.com)\r
\r
+#if !MOBILE\r
+\r
using System;\r
using System.Reflection.Emit;\r
\r
}\r
\r
}\r
+\r
+#endif\r
Builder.Save (module.Builder.ScopeName, pekind, machine);
}
} catch (ArgumentOutOfRangeException) {
- Report.Error (16, "Output file `{0}' exceeds the 4GB limit");
+ Report.Error (16, "Output file `{0}' exceeds the 4GB limit", name);
} catch (Exception e) {
Report.Error (16, "Could not write to file `{0}'. {1}", name, e.Message);
}
class AssemblyLocationProvider
{
AssemblyDefinition assembly;
+ Logger logger;
- public AssemblyLocationProvider (string assemblyPath)
+ public AssemblyLocationProvider (string assemblyPath, Logger logger)
{
assemblyPath = Path.GetFullPath (assemblyPath);
+ this.logger = logger;
if (!File.Exists (assemblyPath))
throw new ArgumentException ("assemblyPath does not exist: "+ assemblyPath);
var nested = sfData.TypeFullName.Split ('+');
var types = assembly.MainModule.Types;
foreach (var ntype in nested) {
- type = types.FirstOrDefault (t => t.Name == ntype);
- if (type == null)
+ if (type == null) {
+ // Use namespace first time.
+ type = types.FirstOrDefault (t => t.FullName == ntype);
+ } else {
+ type = types.FirstOrDefault (t => t.Name == ntype);
+ }
+
+ if (type == null) {
+ logger.LogWarning ("Could not find type: {0}", ntype);
return false;
+ }
types = type.NestedTypes;
}
var methodName = sfData.MethodSignature.Substring (0, parensStart).TrimEnd ();
var methodParameters = sfData.MethodSignature.Substring (parensStart);
var method = type.Methods.FirstOrDefault (m => CompareName (m, methodName) && CompareParameters (m.Parameters, methodParameters));
- if (method == null)
+ if (method == null) {
+ logger.LogWarning ("Could not find method: {0}", methodName);
return false;
+ }
int ilOffset;
if (sfData.IsILOffset) {
--- /dev/null
+using System;
+
+namespace Mono
+{
+ public class Logger
+ {
+ public enum Level
+ {
+ Debug = 1,
+ Warning = 2,
+ Error = 3,
+ None = 4,
+ }
+
+ Level level;
+ Action<string> logAction;
+
+ public Logger (Level level, Action<string> logAction)
+ {
+ this.level = level;
+ this.logAction = logAction;
+ }
+
+ public void LogDebug (string str, params string[] vals)
+ {
+ Log (Level.Debug, "Debug: " + str, vals);
+ }
+
+ public void LogWarning (string str, params string[] vals)
+ {
+ Log (Level.Warning, "Warning: " + str, vals);
+ }
+
+ public void LogError (string str, params string[] vals)
+ {
+ Log (Level.Error, "Error: " + str, vals);
+ }
+
+ private void Log (Level msgLevel, string str, params string[] vals)
+ {
+ if ((int) level > (int) msgLevel)
+ return;
+
+ logAction (string.Format (str, vals));
+ }
+ }
+}
+
CHECK_DIFF = @\
$(MONO) $(TEST_EXE) > $(STACKTRACE_FILE); \
$(MONO) $(LIB_PATH)/$(PROGRAM) $(MSYM_DIR) $(STACKTRACE_FILE) > $(SYMBOLICATE_RAW_FILE); \
- sed "s/).*Test\//) in /" $(SYMBOLICATE_RAW_FILE) | sed '/\[MVID\]/d' | sed '/\[AOTID\]/d' > $(SYMBOLICATE_RESULT_FILE); \
+ sed "s/) .* in .*\/mcs\//) in mcs\//" $(SYMBOLICATE_RAW_FILE) | sed '/\[MVID\]/d' | sed '/\[AOTID\]/d' > $(SYMBOLICATE_RESULT_FILE); \
DIFF=$$(diff $(SYMBOLICATE_RESULT_FILE) $(SYMBOLICATE_EXPECTED_FILE)); \
if [ ! -z "$$DIFF" ]; then \
echo "Symbolicate tests failed."; \
COMPILE = \
$(CSCOMPILE) $(TEST_CS) -out:$(TEST_EXE); \
- $(MONO) $(LIB_PATH)/$(PROGRAM) store-symbols $(MSYM_DIR) $(OUT_DIR)
+ $(MONO) $(LIB_PATH)/$(PROGRAM) store-symbols $(MSYM_DIR) $(OUT_DIR); \
+ $(MONO) $(LIB_PATH)/$(PROGRAM) store-symbols $(MSYM_DIR) $(LIB_PATH);
check: test-local
+++ /dev/null
-Mono Symbolicate Tool - README
-
-Usage
------------------------------
-
-mono-symbolicate exefile stacktracesfile [directories...]
-
-Description
------------------------------
-
-mono-symbolicate is a tool that converts a stack trace with `<filename unknown>:0`
-into one with file names and line numbers.
-
-The output of calling this tool will be the provided stacktracesfile where
-`<filename unknown>:0` parts are replaced by a file name and a line number.
-
-For the tool to work it needs to load referenced assemblies, it will first look
-in the same folder as exefile then from one of the provided directories.
-
-The tool assumes that the folder with a referenced assembly called for example
-name.dll will also include name.dll.mdb, if the referenced assembly is AOT
-compiled then the tool is also expecting to find name.dll.msym.
\ No newline at end of file
--- /dev/null
+Mono Symbolicate Tool - README
+
+Usage
+-----------------------------
+
+```
+mono-symbolicate <msym dir> <input file>
+mono-symbolicate store-symbols <msym dir> [<dir>]+
+```
+
+Description
+-----------------------------
+
+`mono-symbolicate` is a tool that converts a stack trace with `<filename unknown>:0`
+into one with file names and line numbers.
+
+The output of calling this tool will be the provided stacktracesfile where
+`<filename unknown>:0` parts are replaced by a file name and a line number.
+
+The tool uses the AOTID and MVID metadata contained at the end of the stacktraces,
+to retrieve the symbols mapping code into line numbers from a provided symbol directory.
+
+When `mono-symbolicate` is called with a symbol directory and a file containing a stacktrace:
+``` mono-symbolicate <msym dir> <input file> ```
+The tool writes into stdout the file contents while adding file location to stack frames when
+it is possible to symbolicate with the symbols available on the symbol directory.
+
+## Symbol directory
+The symbol directory contains subfolder named as a MVID or AOTID.
+ - MVID subfolders contain .dll/.exe and .mdb files.
+ - AOTID subfolder contain .msym files.
+
+Managed assemblies can be added by calling `mono-symbolicate` with the command `store-symbols`:
+```
+mono-symbolicate store-symbols <msym dir> [<dir>]+
+```
+
+.msym are generated and stored automatically in an AOTID subfolder at the same time the assembly
+is compiled ahead of time, by running a command such as:
+```
+mono --aot=msym-dir=<msym dir>
+```
+
+## Practical example
+
+If you do not have `mono-symbolicate` installed on your system you can set it to the built one by doing:
+```
+alias mono="MONO_PATH=../../class/lib/net_4_x ../../../runtime/mono-wrapper"
+alias mono-symbolicate="mono ../../class/lib/net_4_x/mono-symbolicate.exe"
+```
+
+For the example we will use the csharp file `Test/StackTraceDumper.cs` which contains a program that
+outputs a larger number of stacktraces.
+
+The first step is to compile our program with debug data.
+```
+mkdir example
+mcs -debug -out:example/Program.exe Test/StackTraceDumper.cs
+```
+
+Next we need to create the symbol directory and store all the symbols we might need while symbolicating.
+```
+mkdir example/msym-dir
+mono-symbolicate store-symbols example/msym-dir example
+```
+
+After running `mono-symbolicate store-symbols` command the directory `example/msym-dir` should have a subdirectory
+named as a minified GUID containing the Program.exe and Program.mdb.
+
+If we want to symbolicate the stacktraces containing BCL stack frames we need to add those symbols too.
+```
+mono-symbolicate store-symbols example/msym-dir ../../class/lib/net_4_x
+```
+
+We delete the mdb file so on our next step the generated stack trace won't have line numbers.
+```
+rm example/*.mdb
+```
+
+Now we can run our program and dump its output to `example/out`.
+```
+mono example/Program.exe > example/out
+```
+
+Doing `cat example/out` shows us a large number of stacktraces without any line number.
+
+We can finally run `mono-symbolicate` to replace all the `<filename unknown>:0` with actually useful file names and line numbers.
+```
+mono-symbolicate example/msym-dir example/out
+```
+The previous command should display the same as `cat example/out` but this time with file names and line numbers.
+
+using System;
using System.Text.RegularExpressions;
using System.Globalization;
public readonly uint MethodIndex;
public readonly string Line;
+ public readonly bool IsValid;
+
public string File { get; private set; }
public int LineNumber { get; private set; }
Offset = offset;
IsILOffset = isILOffset;
MethodIndex = methodIndex;
+
+ IsValid = true;
+ }
+
+ private StackFrameData (string line)
+ {
+ LineNumber = -1;
+
+ Line = line;
}
public static bool TryParse (string line, out StackFrameData stackFrame)
stackFrame = null;
var match = regex.Match (line);
- if (!match.Success)
+ if (!match.Success) {
+ if (line.Trim ().StartsWith ("at ", StringComparison.InvariantCulture)) {
+ stackFrame = new StackFrameData (line);
+ return true;
+ }
return false;
+ }
string typeFullName, methodSignature;
var methodStr = match.Groups ["Method"].Value.Trim ();
public class SymbolManager
{
string msymDir;
+ Logger logger;
- public SymbolManager (string msymDir) {
+ public SymbolManager (string msymDir, Logger logger) {
this.msymDir = msymDir;
+ this.logger = logger;
}
internal bool TryResolveLocation (StackFrameData sfData, string mvid, string aotid)
{
+ if (mvid == null)
+ return false;
+
var assemblyLocProvider = GetOrCreateAssemblyLocationProvider (mvid);
+ if (assemblyLocProvider == null)
+ return false;
SeqPointInfo seqPointInfo = null;
if (!sfData.IsILOffset && aotid != null)
return assemblies[mvid];
var mvidDir = Path.Combine (msymDir, mvid);
- if (!Directory.Exists (mvidDir))
- throw new Exception (string.Format("MVID directory does not exist: {0}", mvidDir));
+ if (!Directory.Exists (mvidDir)) {
+ logger.LogWarning ("MVID directory does not exist: {0}", mvidDir);
+ return null;
+ }
string assemblyPath = null;
var exeFiles = Directory.GetFiles (mvidDir, "*.exe");
var dllFiles = Directory.GetFiles (mvidDir, "*.dll");
- if (exeFiles.Length + dllFiles.Length != 1)
- throw new Exception (string.Format ("MVID directory should include one assembly: {0}", mvidDir));
+ if (exeFiles.Length + dllFiles.Length != 1) {
+ logger.LogError ("MVID directory should include one assembly: {0}", mvidDir);
+ return null;
+ }
assemblyPath = (exeFiles.Length > 0)? exeFiles[0] : dllFiles[0];
- var locProvider = new AssemblyLocationProvider (assemblyPath);
+ var locProvider = new AssemblyLocationProvider (assemblyPath, logger);
assemblies.Add (mvid, locProvider);
return seqPointInfos[aotid];
var aotidDir = Path.Combine (msymDir, aotid);
- if (!Directory.Exists (aotidDir))
- throw new Exception (string.Format("AOTID directory does not exist: {0}", aotidDir));
+ if (!Directory.Exists (aotidDir)) {
+ logger.LogError ("AOTID directory does not exist: {0}", aotidDir);
+ return null;
+ }
string msymFile = null;
var msymFiles = Directory.GetFiles(aotidDir, "*.msym");
foreach (var assemblyPath in assemblies) {
var mdbPath = assemblyPath + ".mdb";
if (!File.Exists (mdbPath)) {
+ logger.LogWarning ("Directory {0} contains {1} but no mdb {2}.", dir, Path.GetFileName (assemblyPath), Path.GetFileName (mdbPath));
// assemblies without mdb files are useless
continue;
}
var mvid = assembly.MainModule.Mvid.ToString ("N");
var mvidDir = Path.Combine (msymDir, mvid);
+ if (Directory.Exists (mvidDir)) {
+ try {
+ Directory.Delete (mvidDir, true);
+ } catch (DirectoryNotFoundException e) {}
+ }
+
Directory.CreateDirectory (mvidDir);
var mvidAssemblyPath = Path.Combine (mvidDir, Path.GetFileName (assemblyPath));
Catch (() => InnerGenericClass<string>.InnerInnerGenericClass<int>.ThrowException ("Stack trace with 2 inner generic class and generic overload"));
Catch (() => InnerGenericClass<int>.InnerInnerGenericClass<string>.ThrowException ("Stack trace with 2 inner generic class and generic overload"));
+
+ Catch (() => {
+ var d = new Dictionary<string, string> ();
+ d.ContainsKey (null); // ArgumentNullException
+ });
}
public static void Catch (Action action)
System.Exception: Stacktrace with 1 frame
- at StackTraceDumper.Main () in StackTraceDumper.cs:9
+ at StackTraceDumper.Main () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:9
Stacktrace:
- at StackTraceDumper.Main () in StackTraceDumper.cs:9
+ at StackTraceDumper.Main () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:9
System.Exception: Stacktrace with 2 frames
- at StackTraceDumper.<Main>m__0 () in StackTraceDumper.cs:16
- at StackTraceDumper.Catch (System.Action action) in StackTraceDumper.cs:54
+ at StackTraceDumper.<Main>m__0 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:16
+ at StackTraceDumper.Catch (System.Action action) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:59
Stacktrace:
- at StackTraceDumper.<Main>m__0 () in StackTraceDumper.cs:16
- at StackTraceDumper.Catch (System.Action action) in StackTraceDumper.cs:54
+ at StackTraceDumper.<Main>m__0 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:16
+ at StackTraceDumper.Catch (System.Action action) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:59
System.Exception: Stacktrace with 3 frames
- at StackTraceDumper.ThrowException (System.String message, System.Int32 i) in StackTraceDumper.cs:78
- at StackTraceDumper.<Main>m__1 () in StackTraceDumper.cs:18
- at StackTraceDumper.Catch (System.Action action) in StackTraceDumper.cs:54
+ at StackTraceDumper.ThrowException (System.String message, System.Int32 i) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:83
+ at StackTraceDumper.<Main>m__1 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:18
+ at StackTraceDumper.Catch (System.Action action) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:59
Stacktrace:
- at StackTraceDumper.ThrowException (System.String message, System.Int32 i) in StackTraceDumper.cs:78
- at StackTraceDumper.<Main>m__1 () in StackTraceDumper.cs:18
- at StackTraceDumper.Catch (System.Action action) in StackTraceDumper.cs:54
+ at StackTraceDumper.ThrowException (System.String message, System.Int32 i) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:83
+ at StackTraceDumper.<Main>m__1 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:18
+ at StackTraceDumper.Catch (System.Action action) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:59
System.Exception: Stacktrace with 4 frames
- at StackTraceDumper.ThrowException (System.String message, System.Int32 i) in StackTraceDumper.cs:78
- at StackTraceDumper.ThrowException (System.String message, System.Int32 i) in StackTraceDumper.cs:76
- at StackTraceDumper.<Main>m__2 () in StackTraceDumper.cs:20
- at StackTraceDumper.Catch (System.Action action) in StackTraceDumper.cs:54
-Stacktrace:
- at StackTraceDumper.ThrowException (System.String message, System.Int32 i) in StackTraceDumper.cs:78
- at StackTraceDumper.ThrowException (System.String message, System.Int32 i) in StackTraceDumper.cs:76
- at StackTraceDumper.<Main>m__2 () in StackTraceDumper.cs:20
- at StackTraceDumper.Catch (System.Action action) in StackTraceDumper.cs:54
+ at StackTraceDumper.ThrowException (System.String message, System.Int32 i) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:83
+ at StackTraceDumper.ThrowException (System.String message, System.Int32 i) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:81
+ at StackTraceDumper.<Main>m__2 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:20
+ at StackTraceDumper.Catch (System.Action action) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:59
+Stacktrace:
+ at StackTraceDumper.ThrowException (System.String message, System.Int32 i) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:83
+ at StackTraceDumper.ThrowException (System.String message, System.Int32 i) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:81
+ at StackTraceDumper.<Main>m__2 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:20
+ at StackTraceDumper.Catch (System.Action action) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:59
System.Exception: Stack frame with method overload using ref parameter
- at StackTraceDumper.ThrowException (System.String& message) in StackTraceDumper.cs:70
- at StackTraceDumper.<Main>m__3 () in StackTraceDumper.cs:24
- at StackTraceDumper.Catch (System.Action action) in StackTraceDumper.cs:54
+ at StackTraceDumper.ThrowException (System.String& message) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:75
+ at StackTraceDumper.<Main>m__3 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:24
+ at StackTraceDumper.Catch (System.Action action) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:59
Stacktrace:
- at StackTraceDumper.ThrowException (System.String& message) in StackTraceDumper.cs:70
- at StackTraceDumper.<Main>m__3 () in StackTraceDumper.cs:24
- at StackTraceDumper.Catch (System.Action action) in StackTraceDumper.cs:54
+ at StackTraceDumper.ThrowException (System.String& message) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:75
+ at StackTraceDumper.<Main>m__3 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:24
+ at StackTraceDumper.Catch (System.Action action) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:59
System.Exception: Stack frame with method overload using out parameter
- at StackTraceDumper.ThrowException (System.String message, System.Int32& o) in StackTraceDumper.cs:83
- at StackTraceDumper.<Main>m__4 () in StackTraceDumper.cs:29
- at StackTraceDumper.Catch (System.Action action) in StackTraceDumper.cs:54
+ at StackTraceDumper.ThrowException (System.String message, System.Int32& o) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:88
+ at StackTraceDumper.<Main>m__4 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:29
+ at StackTraceDumper.Catch (System.Action action) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:59
Stacktrace:
- at StackTraceDumper.ThrowException (System.String message, System.Int32& o) in StackTraceDumper.cs:83
- at StackTraceDumper.<Main>m__4 () in StackTraceDumper.cs:29
- at StackTraceDumper.Catch (System.Action action) in StackTraceDumper.cs:54
+ at StackTraceDumper.ThrowException (System.String message, System.Int32& o) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:88
+ at StackTraceDumper.<Main>m__4 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:29
+ at StackTraceDumper.Catch (System.Action action) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:59
System.Exception: Stack frame with 1 generic parameter
- at StackTraceDumper.ThrowExceptionGeneric[T] (System.String message) in StackTraceDumper.cs:88
- at StackTraceDumper.<Main>m__5 () in StackTraceDumper.cs:32
- at StackTraceDumper.Catch (System.Action action) in StackTraceDumper.cs:54
+ at StackTraceDumper.ThrowExceptionGeneric[T] (System.String message) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:93
+ at StackTraceDumper.<Main>m__5 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:32
+ at StackTraceDumper.Catch (System.Action action) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:59
Stacktrace:
- at StackTraceDumper.ThrowExceptionGeneric[T] (System.String message) in StackTraceDumper.cs:88
- at StackTraceDumper.<Main>m__5 () in StackTraceDumper.cs:32
- at StackTraceDumper.Catch (System.Action action) in StackTraceDumper.cs:54
+ at StackTraceDumper.ThrowExceptionGeneric[T] (System.String message) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:93
+ at StackTraceDumper.<Main>m__5 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:32
+ at StackTraceDumper.Catch (System.Action action) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:59
System.Exception: Stack frame with 2 generic parameters
- at StackTraceDumper.ThrowExceptionGeneric[T1,T2] (System.String message) in StackTraceDumper.cs:108
- at StackTraceDumper.<Main>m__6 () in StackTraceDumper.cs:34
- at StackTraceDumper.Catch (System.Action action) in StackTraceDumper.cs:54
+ at StackTraceDumper.ThrowExceptionGeneric[T1,T2] (System.String message) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:113
+ at StackTraceDumper.<Main>m__6 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:34
+ at StackTraceDumper.Catch (System.Action action) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:59
Stacktrace:
- at StackTraceDumper.ThrowExceptionGeneric[T1,T2] (System.String message) in StackTraceDumper.cs:108
- at StackTraceDumper.<Main>m__6 () in StackTraceDumper.cs:34
- at StackTraceDumper.Catch (System.Action action) in StackTraceDumper.cs:54
+ at StackTraceDumper.ThrowExceptionGeneric[T1,T2] (System.String message) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:113
+ at StackTraceDumper.<Main>m__6 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:34
+ at StackTraceDumper.Catch (System.Action action) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:59
System.Exception: Stack frame with generic method overload
- at StackTraceDumper.ThrowExceptionGeneric[T] (T a1) in StackTraceDumper.cs:93
- at StackTraceDumper.<Main>m__7 () in StackTraceDumper.cs:36
- at StackTraceDumper.Catch (System.Action action) in StackTraceDumper.cs:54
+ at StackTraceDumper.ThrowExceptionGeneric[T] (T a1) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:98
+ at StackTraceDumper.<Main>m__7 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:36
+ at StackTraceDumper.Catch (System.Action action) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:59
Stacktrace:
- at StackTraceDumper.ThrowExceptionGeneric[T] (T a1) in StackTraceDumper.cs:93
- at StackTraceDumper.<Main>m__7 () in StackTraceDumper.cs:36
- at StackTraceDumper.Catch (System.Action action) in StackTraceDumper.cs:54
+ at StackTraceDumper.ThrowExceptionGeneric[T] (T a1) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:98
+ at StackTraceDumper.<Main>m__7 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:36
+ at StackTraceDumper.Catch (System.Action action) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:59
System.Exception: Stack trace with inner class
- at StackTraceDumper+InnerClass.ThrowException (System.String message) in StackTraceDumper.cs:114
- at StackTraceDumper.<Main>m__8 () in StackTraceDumper.cs:38
- at StackTraceDumper.Catch (System.Action action) in StackTraceDumper.cs:54
+ at StackTraceDumper+InnerClass.ThrowException (System.String message) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:119
+ at StackTraceDumper.<Main>m__8 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:38
+ at StackTraceDumper.Catch (System.Action action) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:59
Stacktrace:
- at StackTraceDumper+InnerClass.ThrowException (System.String message) in StackTraceDumper.cs:114
- at StackTraceDumper.<Main>m__8 () in StackTraceDumper.cs:38
- at StackTraceDumper.Catch (System.Action action) in StackTraceDumper.cs:54
+ at StackTraceDumper+InnerClass.ThrowException (System.String message) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:119
+ at StackTraceDumper.<Main>m__8 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:38
+ at StackTraceDumper.Catch (System.Action action) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:59
System.Exception: Stack trace with inner generic class
- at StackTraceDumper+InnerGenericClass`1[T].ThrowException (System.String message) in StackTraceDumper.cs:121
- at StackTraceDumper.<Main>m__9 () in StackTraceDumper.cs:40
- at StackTraceDumper.Catch (System.Action action) in StackTraceDumper.cs:54
+ at StackTraceDumper+InnerGenericClass`1[T].ThrowException (System.String message) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:126
+ at StackTraceDumper.<Main>m__9 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:40
+ at StackTraceDumper.Catch (System.Action action) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:59
Stacktrace:
- at StackTraceDumper+InnerGenericClass`1[T].ThrowException (System.String message) in StackTraceDumper.cs:121
- at StackTraceDumper.<Main>m__9 () in StackTraceDumper.cs:40
- at StackTraceDumper.Catch (System.Action action) in StackTraceDumper.cs:54
+ at StackTraceDumper+InnerGenericClass`1[T].ThrowException (System.String message) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:126
+ at StackTraceDumper.<Main>m__9 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:40
+ at StackTraceDumper.Catch (System.Action action) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:59
Generic to string:string
System.Exception: Stack trace with inner generic class and method generic parameter
- at StackTraceDumper+InnerGenericClass`1[T].ThrowException (System.String message, T arg) in StackTraceDumper.cs:127
- at StackTraceDumper.<Main>m__A () in StackTraceDumper.cs:42
- at StackTraceDumper.Catch (System.Action action) in StackTraceDumper.cs:54
+ at StackTraceDumper+InnerGenericClass`1[T].ThrowException (System.String message, T arg) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:132
+ at StackTraceDumper.<Main>m__A () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:42
+ at StackTraceDumper.Catch (System.Action action) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:59
Stacktrace:
- at StackTraceDumper+InnerGenericClass`1[T].ThrowException (System.String message, T arg) in StackTraceDumper.cs:127
- at StackTraceDumper.<Main>m__A () in StackTraceDumper.cs:42
- at StackTraceDumper.Catch (System.Action action) in StackTraceDumper.cs:54
+ at StackTraceDumper+InnerGenericClass`1[T].ThrowException (System.String message, T arg) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:132
+ at StackTraceDumper.<Main>m__A () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:42
+ at StackTraceDumper.Catch (System.Action action) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:59
System.Exception: Stack trace with inner generic class and generic overload
- at StackTraceDumper+InnerGenericClass`1[T].ThrowException[T1] (System.String message, T1 arg) in StackTraceDumper.cs:132
- at StackTraceDumper.<Main>m__B () in StackTraceDumper.cs:44
- at StackTraceDumper.Catch (System.Action action) in StackTraceDumper.cs:54
+ at StackTraceDumper+InnerGenericClass`1[T].ThrowException[T1] (System.String message, T1 arg) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:137
+ at StackTraceDumper.<Main>m__B () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:44
+ at StackTraceDumper.Catch (System.Action action) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:59
Stacktrace:
- at StackTraceDumper+InnerGenericClass`1[T].ThrowException[T1] (System.String message, T1 arg) in StackTraceDumper.cs:132
- at StackTraceDumper.<Main>m__B () in StackTraceDumper.cs:44
- at StackTraceDumper.Catch (System.Action action) in StackTraceDumper.cs:54
+ at StackTraceDumper+InnerGenericClass`1[T].ThrowException[T1] (System.String message, T1 arg) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:137
+ at StackTraceDumper.<Main>m__B () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:44
+ at StackTraceDumper.Catch (System.Action action) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:59
System.Exception: Stack trace with 2 inner generic class and generic overload
- at StackTraceDumper+InnerGenericClass`1+InnerInnerGenericClass`1[T,T2].ThrowException (T message) in StackTraceDumper.cs:138
- at StackTraceDumper.<Main>m__C () in StackTraceDumper.cs:46
- at StackTraceDumper.Catch (System.Action action) in StackTraceDumper.cs:54
+ at StackTraceDumper+InnerGenericClass`1+InnerInnerGenericClass`1[T,T2].ThrowException (T message) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:143
+ at StackTraceDumper.<Main>m__C () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:46
+ at StackTraceDumper.Catch (System.Action action) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:59
Stacktrace:
- at StackTraceDumper+InnerGenericClass`1+InnerInnerGenericClass`1[T,T2].ThrowException (T message) in StackTraceDumper.cs:138
- at StackTraceDumper.<Main>m__C () in StackTraceDumper.cs:46
- at StackTraceDumper.Catch (System.Action action) in StackTraceDumper.cs:54
+ at StackTraceDumper+InnerGenericClass`1+InnerInnerGenericClass`1[T,T2].ThrowException (T message) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:143
+ at StackTraceDumper.<Main>m__C () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:46
+ at StackTraceDumper.Catch (System.Action action) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:59
System.Exception: Stack trace with 2 inner generic class and generic overload
- at StackTraceDumper+InnerGenericClass`1+InnerInnerGenericClass`1[T,T2].ThrowException (T2 message) in StackTraceDumper.cs:143
- at StackTraceDumper.<Main>m__D () in StackTraceDumper.cs:48
- at StackTraceDumper.Catch (System.Action action) in StackTraceDumper.cs:54
+ at StackTraceDumper+InnerGenericClass`1+InnerInnerGenericClass`1[T,T2].ThrowException (T2 message) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:148
+ at StackTraceDumper.<Main>m__D () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:48
+ at StackTraceDumper.Catch (System.Action action) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:59
+Stacktrace:
+ at StackTraceDumper+InnerGenericClass`1+InnerInnerGenericClass`1[T,T2].ThrowException (T2 message) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:148
+ at StackTraceDumper.<Main>m__D () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:48
+ at StackTraceDumper.Catch (System.Action action) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:59
+
+System.ArgumentNullException: Value cannot be null.
+Parameter name: key
+ at System.ThrowHelper.ThrowArgumentNullException (System.ExceptionArgument argument) in mcs/class/referencesource/mscorlib/system/throwhelper.cs:80
+ at System.Collections.Generic.Dictionary`2[TKey,TValue].FindEntry (TKey key) in mcs/class/referencesource/mscorlib/system/collections/generic/dictionary.cs:299
+ at System.Collections.Generic.Dictionary`2[TKey,TValue].ContainsKey (TKey key) in mcs/class/referencesource/mscorlib/system/collections/generic/dictionary.cs:228
+ at StackTraceDumper.<Main>m__E () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:52
+ at StackTraceDumper.Catch (System.Action action) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:59
Stacktrace:
- at StackTraceDumper+InnerGenericClass`1+InnerInnerGenericClass`1[T,T2].ThrowException (T2 message) in StackTraceDumper.cs:143
- at StackTraceDumper.<Main>m__D () in StackTraceDumper.cs:48
- at StackTraceDumper.Catch (System.Action action) in StackTraceDumper.cs:54
+ at System.ThrowHelper.ThrowArgumentNullException (System.ExceptionArgument argument) in mcs/class/referencesource/mscorlib/system/throwhelper.cs:80
+ at System.Collections.Generic.Dictionary`2[TKey,TValue].FindEntry (TKey key) in mcs/class/referencesource/mscorlib/system/collections/generic/dictionary.cs:299
+ at System.Collections.Generic.Dictionary`2[TKey,TValue].ContainsKey (TKey key) in mcs/class/referencesource/mscorlib/system/collections/generic/dictionary.cs:228
+ at StackTraceDumper.<Main>m__E () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:52
+ at StackTraceDumper.Catch (System.Action action) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:59
StackFrameData.cs
StackTraceMetadata.cs
SymbolManager.cs
+Logger.cs
../../class/Mono.Options/Mono.Options/Options.cs
}
}
+ static Logger logger;
+
public static int Main (String[] args)
{
var showHelp = false;
Command cmd = null;
- if (args[0] == "store-symbols")
- cmd = new Command (StoreSymbolsAction, 2);
-
- if (cmd != null) {
- args = args.Skip (1).ToArray ();
- } else {
- cmd = new Command (SymbolicateAction, 2, 2);
- }
+ var logLevel = Logger.Level.Warning;
var options = new OptionSet {
{ "h|help", "Show this help", v => showHelp = true },
+ { "q", "Quiet, warnings are not displayed", v => logLevel = Logger.Level.Error },
+ { "v", "Verbose, log debug messages", v => logLevel = Logger.Level.Debug },
};
try {
showHelp = true;
}
+ if (extra.Count > 0 && extra[0] == "store-symbols")
+ cmd = new Command (StoreSymbolsAction, 2);
+
+ if (cmd != null) {
+ extra.RemoveAt (0);
+ } else {
+ cmd = new Command (SymbolicateAction, 2, 2);
+ }
+
if (showHelp || extra == null || extra.Count < cmd.MinArgCount || extra.Count > cmd.MaxArgCount) {
- Console.Error.WriteLine ("Usage: symbolicate <msym dir> <input file>");
- Console.Error.WriteLine (" symbolicate store-symbols <msym dir> [<dir>]+");
+ Console.Error.WriteLine ("Usage: symbolicate [options] <msym dir> <input file>");
+ Console.Error.WriteLine (" symbolicate [options] store-symbols <msym dir> [<dir>]+");
Console.WriteLine ();
Console.WriteLine ("Available options:");
options.WriteOptionDescriptions (Console.Out);
return 1;
}
+ logger = new Logger (logLevel, msg => Console.Error.WriteLine (msg));
+
cmd.Action (extra);
return 0;
var msymDir = args [0];
var inputFile = args [1];
- var symbolManager = new SymbolManager (msymDir);
+ var symbolManager = new SymbolManager (msymDir, logger);
using (StreamReader r = new StreamReader (inputFile)) {
var sb = Process (r, symbolManager);
var msymDir = args[0];
var lookupDirs = args.Skip (1).ToArray ();
- var symbolManager = new SymbolManager (msymDir);
+ var symbolManager = new SymbolManager (msymDir, logger);
symbolManager.StoreSymbols (lookupDirs);
}
aotid = aotidMetadata.Value;
var linesMvid = ProcessLinesMVID (metadata);
- var lineNumber = 0;
+ var lineNumber = -1;
foreach (var sfData in stackFrames) {
string mvid = null;
+ lineNumber++;
+ if (!sfData.IsValid)
+ continue;
if (linesMvid.ContainsKey (lineNumber))
- mvid = linesMvid [lineNumber++];
+ mvid = linesMvid [lineNumber];
symbolManager.TryResolveLocation (sfData, mvid, aotid);
install-local: install-extras
endif
+PORTABLE_TARGETS_SRC=../../../external/buildtools/src/Portable/Targets
+PCL5_FX_SRC=../../../external/buildtools/src/Portable/Frameworks/v5.0
+
NETFRAMEWORK_DIR=$(mono_libdir)/mono/xbuild-frameworks/.NETFramework
+PCL5_FX_DIR=$(mono_libdir)/mono/xbuild-frameworks/.NETPortable/v5.0
VS_TARGETS_DIR = $(mono_libdir)/mono/xbuild/Microsoft/VisualStudio
PORTABLE_TARGETS_DIR = $(mono_libdir)/mono/xbuild/Microsoft/Portable
+NUGET_BUILDTASKS_TARGETS_DIR = $(mono_libdir)/mono/xbuild/Microsoft/NuGet
+
+ifeq (14.0, $(XBUILD_VERSION))
+install-extras: install-versioned-files install-global-files
+else
+install-extras: install-versioned-files
+endif
+#install files into xbuild's versioned locations
+install-versioned-files: install-bin-data install-nuget-imports
-install-extras: install-bin-data install-frameworks install-pcl-targets install-web-targets
+#install files that are only installed once across all xbuild versions
+install-global-files: install-frameworks install-web-targets install-pcl-targets install-pcl5-framework install-nuget-targets
install-bin-data:
$(MKINSTALLDIRS) $(DESTDIR)$(XBUILD_BIN_DIR)/MSBuild
$(INSTALL_DATA) data/xbuild.rsp $(DESTDIR)$(XBUILD_BIN_DIR)
$(INSTALL_DATA) data/$(XBUILD_VERSION)/Microsoft.Common.tasks $(DESTDIR)$(XBUILD_BIN_DIR)
$(INSTALL_DATA) data/$(XBUILD_VERSION)/Microsoft.Common.targets $(DESTDIR)$(XBUILD_BIN_DIR)
+ifeq (14.0, $(XBUILD_VERSION))
+ $(INSTALL_DATA) data/$(XBUILD_VERSION)/Microsoft.Common.props $(DESTDIR)$(XBUILD_BIN_DIR)/../
+endif
$(INSTALL_DATA) data/$(XBUILD_VERSION)/Microsoft.CSharp.targets $(DESTDIR)$(XBUILD_BIN_DIR)
$(INSTALL_DATA) data/Microsoft.Build.xsd $(DESTDIR)$(XBUILD_BIN_DIR)
$(INSTALL_DATA) data/Microsoft.VisualBasic.targets $(DESTDIR)$(XBUILD_BIN_DIR)
$(INSTALL_DATA) frameworks/net_4.6.1.xml $(DESTDIR)$(NETFRAMEWORK_DIR)/v4.6.1/RedistList/FrameworkList.xml
install-pcl-targets:
- $(MKINSTALLDIRS) $(DESTDIR)$(PORTABLE_TARGETS_DIR)/v4.0
- $(INSTALL_DATA) targets/Microsoft.Portable.Common.targets $(DESTDIR)$(PORTABLE_TARGETS_DIR)/v4.0/Microsoft.Portable.Common.targets
- $(INSTALL_DATA) targets/Microsoft.Portable.CSharp_4.0.targets $(DESTDIR)$(PORTABLE_TARGETS_DIR)/v4.0/Microsoft.Portable.CSharp.targets
- $(INSTALL_DATA) targets/Microsoft.Portable.VisualBasic_4.0.targets $(DESTDIR)$(PORTABLE_TARGETS_DIR)/v4.0/Microsoft.Portable.VisualBasic.targets
- $(MKINSTALLDIRS) $(DESTDIR)$(PORTABLE_TARGETS_DIR)/v4.5
- $(INSTALL_DATA) targets/Microsoft.Portable.Common.targets $(DESTDIR)$(PORTABLE_TARGETS_DIR)/v4.5/Microsoft.Portable.Common.targets
- $(INSTALL_DATA) targets/Microsoft.Portable.CSharp_4.5.targets $(DESTDIR)$(PORTABLE_TARGETS_DIR)/v4.5/Microsoft.Portable.CSharp.targets
- $(INSTALL_DATA) targets/Microsoft.Portable.VisualBasic_4.5.targets $(DESTDIR)$(PORTABLE_TARGETS_DIR)/v4.5/Microsoft.Portable.VisualBasic.targets
- $(INSTALL_DATA) targets/Microsoft.Portable.Core.targets $(DESTDIR)$(PORTABLE_TARGETS_DIR)/Microsoft.Portable.Core.targets
- $(INSTALL_DATA) targets/Microsoft.Portable.Core.props $(DESTDIR)$(PORTABLE_TARGETS_DIR)/Microsoft.Portable.Core.props
- $(MKINSTALLDIRS) $(DESTDIR)$(PORTABLE_TARGETS_DIR)/v4.6
- $(INSTALL_DATA) targets/Microsoft.Portable.Common.targets $(DESTDIR)$(PORTABLE_TARGETS_DIR)/v4.6/Microsoft.Portable.Common.targets
- $(INSTALL_DATA) targets/Microsoft.Portable.CSharp_4.5.targets $(DESTDIR)$(PORTABLE_TARGETS_DIR)/v4.6/Microsoft.Portable.CSharp.targets
- $(INSTALL_DATA) targets/Microsoft.Portable.VisualBasic_4.5.targets $(DESTDIR)$(PORTABLE_TARGETS_DIR)/v4.6/Microsoft.Portable.VisualBasic.targets
+ $(MKINSTALLDIRS) $(DESTDIR)$(PORTABLE_TARGETS_DIR)
+ $(INSTALL_DATA) $(PORTABLE_TARGETS_SRC)/Microsoft.Portable.Core.props $(DESTDIR)$(PORTABLE_TARGETS_DIR)/Microsoft.Portable.Core.props
+ $(INSTALL_DATA) $(PORTABLE_TARGETS_SRC)/Microsoft.Portable.Core.targets $(DESTDIR)$(PORTABLE_TARGETS_DIR)/Microsoft.Portable.Core.targets
+
+ for VERSION in v4.0 v4.5 v4.6 v5.0; do \
+ $(MKINSTALLDIRS) $(DESTDIR)$(PORTABLE_TARGETS_DIR)/$$VERSION; \
+ $(INSTALL_DATA) $(PORTABLE_TARGETS_SRC)/$$VERSION/Microsoft.Portable.Common.targets $(DESTDIR)$(PORTABLE_TARGETS_DIR)/$$VERSION/Microsoft.Portable.Common.targets; \
+ $(INSTALL_DATA) $(PORTABLE_TARGETS_SRC)/$$VERSION/Microsoft.Portable.CSharp.targets $(DESTDIR)$(PORTABLE_TARGETS_DIR)/$$VERSION/Microsoft.Portable.CSharp.targets; \
+ $(INSTALL_DATA) $(PORTABLE_TARGETS_SRC)/$$VERSION/Microsoft.Portable.VisualBasic.targets $(DESTDIR)$(PORTABLE_TARGETS_DIR)/$$VERSION/Microsoft.Portable.VisualBasic.targets; \
+ done
install-web-targets:
$(MKINSTALLDIRS) $(DESTDIR)$(VS_TARGETS_DIR)/v9.0/WebApplications
$(MKINSTALLDIRS) $(DESTDIR)$(VS_TARGETS_DIR)/v14.0/WebApplications
$(INSTALL_DATA) targets/Microsoft.WebApplication.targets $(DESTDIR)$(VS_TARGETS_DIR)/v14.0/WebApplications
+NUGET_BUILDTASKS_REPO_DIR=$(topdir)/../external/nuget-buildtasks
+
+install-nuget-targets:
+ $(MKINSTALLDIRS) $(DESTDIR)$(NUGET_BUILDTASKS_TARGETS_DIR)
+ $(INSTALL_DATA) $(NUGET_BUILDTASKS_REPO_DIR)/src/Microsoft.NuGet.Build.Tasks/Microsoft.NuGet.targets $(DESTDIR)$(NUGET_BUILDTASKS_TARGETS_DIR)
+ $(INSTALL_DATA) $(NUGET_BUILDTASKS_REPO_DIR)/src/Microsoft.NuGet.Build.Tasks/Microsoft.NuGet.props $(DESTDIR)$(NUGET_BUILDTASKS_TARGETS_DIR)
+
+install-nuget-imports:
+ifeq (14.0, $(XBUILD_VERSION))
+ $(MKINSTALLDIRS) $(DESTDIR)$(XBUILD_BIN_DIR)/../Imports/Microsoft.Common.props/ImportBefore
+ $(MKINSTALLDIRS) $(DESTDIR)$(XBUILD_BIN_DIR)/../Microsoft.Common.targets/ImportAfter
+ $(INSTALL_DATA) $(NUGET_BUILDTASKS_REPO_DIR)/src/Microsoft.NuGet.Build.Tasks/ImportBeforeAfter/Microsoft.NuGet.ImportBefore.props $(DESTDIR)$(XBUILD_BIN_DIR)/../Imports/Microsoft.Common.props/ImportBefore
+ $(INSTALL_DATA) $(NUGET_BUILDTASKS_REPO_DIR)/src/Microsoft.NuGet.Build.Tasks/ImportBeforeAfter/Microsoft.NuGet.ImportAfter.targets $(DESTDIR)$(XBUILD_BIN_DIR)/../Microsoft.Common.targets/ImportAfter
+endif
+
+# The .NETPortable,Version=v5.0 framework contains no assemblies, and essentially just fills the requirement
+# for a framework moniker. When using it, assemblies are provided by NuGet packages such as .NETStandard.Library
+install-pcl5-framework:
+ $(MKINSTALLDIRS) $(DESTDIR)$(PCL5_FX_DIR)/RedistList
+ $(INSTALL_DATA) $(PCL5_FX_SRC)/FrameworkList.xml $(DESTDIR)$(PCL5_FX_DIR)/RedistList/FrameworkList.xml
+
+ $(MKINSTALLDIRS) $(DESTDIR)$(PCL5_FX_DIR)/SupportedFrameworks
+ $(INSTALL_DATA) "$(PCL5_FX_SRC)/.NET Framework 4.6.xml" "$(DESTDIR)$(PCL5_FX_DIR)/SupportedFrameworks/.NET Framework 4.6.xml"
+ $(INSTALL_DATA) "$(PCL5_FX_SRC)/ASP.NET Core 1.0.xml" "$(DESTDIR)$(PCL5_FX_DIR)/SupportedFrameworks/ASP.NET Core 1.0.xml"
+ $(INSTALL_DATA) "$(PCL5_FX_SRC)/Windows Universal 10.0.xml" "$(DESTDIR)$(PCL5_FX_DIR)/SupportedFrameworks/Windows Universal 10.0.xml"
EXTRA_DISTFILES = \
data/xbuild.rsp \
data/4.0/Microsoft.Common.targets \
data/12.0/Microsoft.Common.targets \
data/14.0/Microsoft.Common.targets \
+ data/14.0/Microsoft.Common.props \
data/2.0/Microsoft.CSharp.targets \
data/3.5/Microsoft.CSharp.targets \
data/4.0/Microsoft.CSharp.targets \
frameworks/net_4.5.2.xml \
frameworks/net_4.6.xml \
frameworks/net_4.6.1.xml \
- targets/Microsoft.Portable.CSharp_4.0.targets \
- targets/Microsoft.Portable.CSharp_4.5.targets \
- targets/Microsoft.Portable.VisualBasic_4.0.targets \
- targets/Microsoft.Portable.VisualBasic_4.5.targets \
- targets/Microsoft.Portable.Common.targets \
- targets/Microsoft.Portable.Core.targets \
- targets/Microsoft.Portable.Core.props \
- targets/Microsoft.WebApplication.targets \
+ targets/Microsoft.WebApplication.targets \
+ $(NUGET_BUILDTASKS_REPO_DIR)/src/Microsoft.NuGet.Build.Tasks/ImportBeforeAfter/Microsoft.NuGet.ImportBefore.props \
+ $(NUGET_BUILDTASKS_REPO_DIR)/src/Microsoft.NuGet.Build.Tasks/ImportBeforeAfter/Microsoft.NuGet.ImportAfter.targets \
+ $(NUGET_BUILDTASKS_REPO_DIR)/src/Microsoft.NuGet.Build.Tasks/Microsoft.NuGet.targets \
+ $(NUGET_BUILDTASKS_REPO_DIR)/src/Microsoft.NuGet.Build.Tasks/Microsoft.NuGet.props \
xbuild.make \
xbuild_test.make
-<Project DefaultTargets="Build" InitialTargets="_ValidateEssentialProperties" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project DefaultTargets="Build" InitialTargets="_CheckForInvalidConfigurationAndPlatform" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ImportByWildcardBeforeMicrosoftCommonTargets Condition="'$(ImportByWildcardBeforeMicrosoftCommonTargets)' == ''">true</ImportByWildcardBeforeMicrosoftCommonTargets>
<ImportByWildcardAfterMicrosoftCommonTargets Condition="'$(ImportByWildcardAfterMicrosoftCommonTargets)' == ''">true</ImportByWildcardAfterMicrosoftCommonTargets>
<_OriginalPlatform>$(Platform)</_OriginalPlatform>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<PlatformName Condition="'$(PlatformName)' == ''">$(Platform)</PlatformName>
+ </PropertyGroup>
+ <!-- in MSBuild, these properties are set in a separate file that is only imported for .NETFramework -->
+ <PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
<AddAdditionalExplicitAssemblyReferences Condition="'$(AddAdditionalExplicitAssemblyReferences)' == ''">true</AddAdditionalExplicitAssemblyReferences>
<AdditionalExplicitAssemblyReferences Condition="'$(AddAdditionalExplicitAssemblyReferences)' == 'true' and '$(TargetFrameworkVersion)' != 'v2.0' and '$(TargetFrameworkVersion)' != 'v3.0'">System.Core;$(AdditionalExplicitAssemblyReferences)</AdditionalExplicitAssemblyReferences>
</PropertyGroup>
<TargetingClr2Framework Condition="('$(TargetFrameworkIdentifier)' == '.NETFramework') and ('$(TargetFrameworkVersion)' == 'v2.0' or '$(TargetFrameworkVersion)' == 'v3.0' or '$(TargetFrameworkVersion)' == 'v3.5')">true</TargetingClr2Framework>
</PropertyGroup>
- <Target Name="_ValidateEssentialProperties">
+ <Target Name="_CheckForInvalidConfigurationAndPlatform">
<Error Condition=" '$(OutputPath)' == '' and '$(SkipInvalidConfigurations)' != 'true'"
Text="'OutputPath' property is not set for this project. Usually this is caused by invalid Configuration/Platform combination. Original values: Configuration: $(_OriginalConfiguration) Platform: $(_OriginalPlatform)."/>
--- /dev/null
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <ImportByWildcardBeforeMicrosoftCommonProps Condition="'$(ImportByWildcardBeforeMicrosoftCommonProps)' == ''">true</ImportByWildcardBeforeMicrosoftCommonProps>
+ <ImportByWildcardAfterMicrosoftCommonProps Condition="'$(ImportByWildcardAfterMicrosoftCommonProps)' == ''">true</ImportByWildcardAfterMicrosoftCommonProps>
+ </PropertyGroup>
+
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Imports\Microsoft.Common.props\ImportBefore\*"
+ Condition="'$(ImportByWildcardBeforeMicrosoftCommonProps)' == 'true' and Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Imports\Microsoft.Common.props\ImportBefore')"/>
+
+ <PropertyGroup>
+ <MicrosoftCommonPropsHasBeenImported>true</MicrosoftCommonPropsHasBeenImported>
+ </PropertyGroup>
+
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Imports\Microsoft.Common.props\ImportAfter\*"
+ Condition="'$(ImportByWildcardAfterMicrosoftCommonProps)' == 'true' and Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Imports\Microsoft.Common.props\ImportAfter')"/>
+</Project>
-<Project DefaultTargets="Build" InitialTargets="_ValidateEssentialProperties" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project DefaultTargets="Build" InitialTargets="_CheckForInvalidConfigurationAndPlatform" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="'$(MicrosoftCommonPropsHasBeenImported)' != 'true' and Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+
<PropertyGroup>
<ImportByWildcardBeforeMicrosoftCommonTargets Condition="'$(ImportByWildcardBeforeMicrosoftCommonTargets)' == ''">true</ImportByWildcardBeforeMicrosoftCommonTargets>
<ImportByWildcardAfterMicrosoftCommonTargets Condition="'$(ImportByWildcardAfterMicrosoftCommonTargets)' == ''">true</ImportByWildcardAfterMicrosoftCommonTargets>
<_OriginalPlatform>$(Platform)</_OriginalPlatform>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<PlatformName Condition="'$(PlatformName)' == ''">$(Platform)</PlatformName>
+ </PropertyGroup>
+ <!-- in MSBuild, these properties are set in a separate file that is only imported for .NETFramework -->
+ <PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
<AddAdditionalExplicitAssemblyReferences Condition="'$(AddAdditionalExplicitAssemblyReferences)' == ''">true</AddAdditionalExplicitAssemblyReferences>
<AdditionalExplicitAssemblyReferences Condition="'$(AddAdditionalExplicitAssemblyReferences)' == 'true' and '$(TargetFrameworkVersion)' != 'v2.0' and '$(TargetFrameworkVersion)' != 'v3.0'">System.Core;$(AdditionalExplicitAssemblyReferences)</AdditionalExplicitAssemblyReferences>
</PropertyGroup>
<TargetingClr2Framework Condition="('$(TargetFrameworkIdentifier)' == '.NETFramework') and ('$(TargetFrameworkVersion)' == 'v2.0' or '$(TargetFrameworkVersion)' == 'v3.0' or '$(TargetFrameworkVersion)' == 'v3.5')">true</TargetingClr2Framework>
</PropertyGroup>
- <Target Name="_ValidateEssentialProperties">
+ <Target Name="_CheckForInvalidConfigurationAndPlatform">
<Error Condition=" '$(OutputPath)' == '' and '$(SkipInvalidConfigurations)' != 'true'"
Text="'OutputPath' property is not set for this project. Usually this is caused by invalid Configuration/Platform combination. Original values: Configuration: $(_OriginalConfiguration) Platform: $(_OriginalPlatform)."/>
-<Project DefaultTargets="Build" InitialTargets="_ValidateEssentialProperties" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project DefaultTargets="Build" InitialTargets="_CheckForInvalidConfigurationAndPlatform" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ImportByWildcardBeforeMicrosoftCommonTargets Condition="'$(ImportByWildcardBeforeMicrosoftCommonTargets)' == ''">true</ImportByWildcardBeforeMicrosoftCommonTargets>
<ImportByWildcardAfterMicrosoftCommonTargets Condition="'$(ImportByWildcardAfterMicrosoftCommonTargets)' == ''">true</ImportByWildcardAfterMicrosoftCommonTargets>
<_OriginalPlatform>$(Platform)</_OriginalPlatform>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<PlatformName Condition="'$(PlatformName)' == ''">$(Platform)</PlatformName>
+ </PropertyGroup>
+ <!-- in MSBuild, these properties are set in a separate file that is only imported for .NETFramework -->
+ <PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
<AddAdditionalExplicitAssemblyReferences Condition="'$(AddAdditionalExplicitAssemblyReferences)' == ''">true</AddAdditionalExplicitAssemblyReferences>
<AdditionalExplicitAssemblyReferences Condition="'$(AddAdditionalExplicitAssemblyReferences)' == 'true' and '$(TargetFrameworkVersion)' != 'v2.0' and '$(TargetFrameworkVersion)' != 'v3.0'">System.Core;$(AdditionalExplicitAssemblyReferences)</AdditionalExplicitAssemblyReferences>
</PropertyGroup>
<TargetingClr2Framework Condition="('$(TargetFrameworkIdentifier)' == '.NETFramework') and ('$(TargetFrameworkVersion)' == 'v2.0' or '$(TargetFrameworkVersion)' == 'v3.0' or '$(TargetFrameworkVersion)' == 'v3.5')">true</TargetingClr2Framework>
</PropertyGroup>
- <Target Name="_ValidateEssentialProperties">
+ <Target Name="_CheckForInvalidConfigurationAndPlatform">
<Error Condition=" '$(OutputPath)' == '' and '$(SkipInvalidConfigurations)' != 'true'"
Text="'OutputPath' property is not set for this project. Usually this is caused by invalid Configuration/Platform combination. Original values: Configuration: $(_OriginalConfiguration) Platform: $(_OriginalPlatform)."/>
+++ /dev/null
-<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="..\Microsoft.Portable.Core.props" />
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <Import Project="..\Microsoft.Portable.Core.targets" />
-</Project>
+++ /dev/null
-<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="..\Microsoft.Portable.Core.props" />
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <Import Project="..\Microsoft.Portable.Core.targets" />
-</Project>
+++ /dev/null
-<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="..\Microsoft.Portable.Core.props" />
- <Import Project="..\Microsoft.Portable.Core.targets" />
-</Project>
+++ /dev/null
-<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <AvailablePlatforms>Any CPU</AvailablePlatforms>
-
- <TargetPlatformIdentifier>Portable</TargetPlatformIdentifier>
- <TargetFrameworkIdentifier>.NETPortable</TargetFrameworkIdentifier>
- <TargetFrameworkMonikerDisplayName>.NET Portable Subset</TargetFrameworkMonikerDisplayName>
-
- <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
- <NoStdLib>true</NoStdLib>
-
- <ImplicitlyExpandTargetFramework Condition="'$(ImplicitlyExpandTargetFramework)' == '' ">true</ImplicitlyExpandTargetFramework>
- </PropertyGroup>
-</Project>
+++ /dev/null
-<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <ResolveReferencesDependsOn>
- $(ResolveReferencesDependsOn);
- ImplicitlyExpandTargetFramework;
- </ResolveReferencesDependsOn>
-
- <ImplicitlyExpandTargetFrameworkDependsOn>
- $(ImplicitlyExpandTargetFrameworkDependsOn);
- GetReferenceAssemblyPaths
- </ImplicitlyExpandTargetFrameworkDependsOn>
- </PropertyGroup>
-
- <Target Name="ImplicitlyExpandTargetFramework"
- Condition="'$(ImplicitlyExpandTargetFramework)' == 'true'"
- DependsOnTargets="$(ImplicitlyExpandTargetFrameworkDependsOn)">
-
- <ItemGroup>
- <ReferenceAssemblyPaths Include="$(_TargetFrameworkDirectories)"/>
- <ReferencePath Include="%(ReferenceAssemblyPaths.Identity)\*.dll">
- <CopyLocal>false</CopyLocal>
- <ResolvedFrom>ImplicitlyExpandTargetFramework</ResolvedFrom>
- <IsSystemReference>True</IsSystemReference>
- </ReferencePath>
- </ItemGroup>
- </Target>
-
-</Project>
+++ /dev/null
-<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="..\Microsoft.Portable.Core.props" />
- <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
- <Import Project="..\Microsoft.Portable.Core.targets" />
-</Project>
+++ /dev/null
-<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="..\Microsoft.Portable.Core.props" />
- <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
- <Import Project="..\Microsoft.Portable.Core.targets" />
-</Project>
<opcode name="mono_calli_extra_arg" input="VarPop" output="VarPush" args="InlineSig" o1="0xF0" o2="0x18" flow="call" />
<opcode name="mono_lddomain" input="Pop0" output="PushI" args="InlineNone" o1="0xF0" o2="0x19" flow="next" />
<opcode name="mono_atomic_store_i4" input="PopI+PopI" output="Push0" args="InlineI" o1="0xF0" o2="0x1A" flow="next" />
+<opcode name="mono_get_last_error" input="Pop0" output="PushI" args="InlineNone" o1="0xF0" o2="0x1B" flow="next" />
</opdesc>
OPDEF(CEE_MONO_CALLI_EXTRA_ARG, "mono_calli_extra_arg", VarPop, VarPush, InlineSig, X, 2, 0xF0, 0x18, CALL)
OPDEF(CEE_MONO_LDDOMAIN, "mono_lddomain", Pop0, PushI, InlineNone, X, 2, 0xF0, 0x19, NEXT)
OPDEF(CEE_MONO_ATOMIC_STORE_I4, "mono_atomic_store_i4", PopI+PopI, Push0, InlineI, X, 2, 0xF0, 0x1A, NEXT)
+OPDEF(CEE_MONO_GET_LAST_ERROR, "mono_get_last_error", Pop0, PushI, InlineNone, X, 2, 0xF0, 0x1B, NEXT)
#ifndef OPALIAS
#define _MONO_CIL_OPALIAS_DEFINED_
#define OPALIAS(a,s,r)
int thr_ret;
gboolean apc_pending = FALSE;
gpointer current_thread = wapi_get_current_thread_handle ();
- gint64 now, end;
+ gint64 wait_start, timeout_in_ticks;
if (current_thread == NULL) {
SetLastError (ERROR_INVALID_HANDLE);
goto done;
}
- if (timeout != INFINITE)
- end = mono_100ns_ticks () + timeout * 1000 * 10;
+ if (timeout != INFINITE) {
+ wait_start = mono_100ns_ticks ();
+ timeout_in_ticks = (gint64)timeout * 10 * 1000; //can't overflow as timeout is 32bits
+ }
do {
/* Check before waiting on the condition, just in case
if (timeout == INFINITE) {
waited = mono_w32handle_timedwait_signal_handle (handle, INFINITE, FALSE, alertable ? &apc_pending : NULL);
} else {
- now = mono_100ns_ticks ();
- if (end < now) {
+ gint64 elapsed = mono_100ns_ticks () - wait_start;
+ if (elapsed >= timeout_in_ticks) {
ret = WAIT_TIMEOUT;
goto done;
}
- waited = mono_w32handle_timedwait_signal_handle (handle, (end - now) / 10 / 1000, FALSE, alertable ? &apc_pending : NULL);
+ waited = mono_w32handle_timedwait_signal_handle (handle, (timeout_in_ticks - elapsed) / 10 / 1000, FALSE, alertable ? &apc_pending : NULL);
}
if(waited==0 && !apc_pending) {
int thr_ret;
gboolean apc_pending = FALSE;
gpointer current_thread = wapi_get_current_thread_handle ();
- gint64 now, end;
+ gint64 wait_start, timeout_in_ticks;
if (current_thread == NULL) {
SetLastError (ERROR_INVALID_HANDLE);
goto done;
}
- if (timeout != INFINITE)
- end = mono_100ns_ticks () + timeout * 1000 * 10;
-
+ if (timeout != INFINITE) {
+ wait_start = mono_100ns_ticks ();
+ timeout_in_ticks = (gint64)timeout * 10 * 1000; //can't overflow as timeout is 32bits
+ }
do {
/* Check before waiting on the condition, just in case
*/
if (timeout == INFINITE) {
waited = mono_w32handle_timedwait_signal_handle (wait, INFINITE, FALSE, alertable ? &apc_pending : NULL);
} else {
- now = mono_100ns_ticks ();
- if (end < now) {
+ gint64 elapsed = mono_100ns_ticks () - wait_start;
+ if (elapsed >= timeout_in_ticks) {
ret = WAIT_TIMEOUT;
goto done;
}
- waited = mono_w32handle_timedwait_signal_handle (wait, (end - now) / 10 / 1000, FALSE, alertable ? &apc_pending : NULL);
+ waited = mono_w32handle_timedwait_signal_handle (wait, (timeout_in_ticks - elapsed) / 10 / 1000, FALSE, alertable ? &apc_pending : NULL);
}
if (waited==0 && !apc_pending) {
gboolean poll;
gpointer sorted_handles [MAXIMUM_WAIT_OBJECTS];
gboolean apc_pending = FALSE;
- gint64 now, end;
+ gint64 wait_start, timeout_in_ticks;
if (current_thread == NULL) {
SetLastError (ERROR_INVALID_HANDLE);
return WAIT_TIMEOUT;
}
- if (timeout != INFINITE)
- end = mono_100ns_ticks () + timeout * 1000 * 10;
+ if (timeout != INFINITE) {
+ wait_start = mono_100ns_ticks ();
+ timeout_in_ticks = (gint64)timeout * 10 * 1000; //can't overflow as timeout is 32bits
+ }
/* Have to wait for some or all handles to become signalled
*/
if (timeout == INFINITE) {
ret = mono_w32handle_timedwait_signal (INFINITE, poll, &apc_pending);
} else {
- now = mono_100ns_ticks ();
- if (end < now) {
+ gint64 elapsed = mono_100ns_ticks () - wait_start;
+ if (elapsed >= timeout_in_ticks) {
ret = WAIT_TIMEOUT;
} else {
- ret = mono_w32handle_timedwait_signal ((end - now) / 10 / 1000, poll, &apc_pending);
+ ret = mono_w32handle_timedwait_signal ((timeout_in_ticks - elapsed) / 10 / 1000, poll, &apc_pending);
}
}
} else {
{
MonoError error;
MonoAppDomain *ad = NULL;
+
#ifdef DISABLE_APPDOMAINS
+ mono_error_init (&error);
mono_error_set_not_supported (&error, "AppDomain creation is not supported on this runtime.");
#else
char *fname;
sibling_target_len = strlen (sibling_target);
copy_result = shadow_copy_sibling (sibling_source, sibling_source_len, ".mdb", sibling_target, sibling_target_len, 7);
- if (copy_result == TRUE)
+ if (copy_result)
copy_result = shadow_copy_sibling (sibling_source, sibling_source_len, ".config", sibling_target, sibling_target_len, 7);
g_free (sibling_source);
g_free (sibling_target);
- if (copy_result == FALSE) {
+ if (!copy_result) {
g_free (shadow);
mono_error_set_execution_engine (oerror, "Failed to create shadow copy of sibling data (CopyFile).");
return NULL;
mono_unload_interface_id (MonoClass *klass);
GPtrArray*
-mono_class_get_methods_by_name (MonoClass *klass, const char *name, guint32 bflags, gboolean ignore_case, gboolean allow_ctors, MonoException **ex);
+mono_class_get_methods_by_name (MonoClass *klass, const char *name, guint32 bflags, gboolean ignore_case, gboolean allow_ctors, MonoError *error);
char*
mono_class_full_name (MonoClass *klass);
klass = search_modules (image, name_space, name, error);
if (klass || !is_ok (error))
return klass;
- }
-
- if (!token)
return NULL;
+ }
if (mono_metadata_token_table (token) == MONO_TABLE_EXPORTEDTYPE) {
MonoTableInfo *t = &image->tables [MONO_TABLE_EXPORTEDTYPE];
c = next;
}
g_free (c);
+ g_free (stack);
}
void
ICALL_TYPE(RTCLASS, "Mono.RuntimeClassHandle", RTCLASS_1)
ICALL(RTCLASS_1, "GetTypeFromClass", ves_icall_Mono_RuntimeClassHandle_GetTypeFromClass)
+ICALL_TYPE(RTPTRARRAY, "Mono.RuntimeGPtrArrayHandle", RTPTRARRAY_1)
+ICALL(RTPTRARRAY_1, "GPtrArrayFree", ves_icall_Mono_RuntimeGPtrArrayHandle_GPtrArrayFree)
+
#ifndef PLATFORM_RO_FS
ICALL_TYPE(KPAIR, "Mono.Security.Cryptography.KeyPairPersistence", KPAIR_1)
ICALL(KPAIR_1, "_CanSecure", ves_icall_Mono_Security_Cryptography_KeyPairPersistence_CanSecure)
ICALL(TYPEB_6, "setup_generic_class", mono_reflection_setup_generic_class)
ICALL(TYPEB_7, "setup_internal_class", mono_reflection_setup_internal_class)
+ICALL_TYPE(EVENTI, "System.Reflection.EventInfo", EVENTI_1)
+ICALL(EVENTI_1, "internal_from_handle_type", ves_icall_System_Reflection_EventInfo_internal_from_handle_type)
+
ICALL_TYPE(FIELDI, "System.Reflection.FieldInfo", FILEDI_1)
ICALL(FILEDI_1, "GetTypeModifiers", ves_icall_System_Reflection_FieldInfo_GetTypeModifiers)
ICALL(FILEDI_2, "get_marshal_info", ves_icall_System_Reflection_FieldInfo_get_marshal_info)
ICALL_TYPE(MBASE, "System.Reflection.MethodBase", MBASE_1)
ICALL(MBASE_1, "GetCurrentMethod", ves_icall_GetCurrentMethod)
ICALL(MBASE_2, "GetMethodBodyInternal", ves_icall_System_Reflection_MethodBase_GetMethodBodyInternal)
-ICALL(MBASE_4, "GetMethodFromHandleInternalType", ves_icall_System_Reflection_MethodBase_GetMethodFromHandleInternalType)
+ICALL(MBASE_4, "GetMethodFromHandleInternalType_native", ves_icall_System_Reflection_MethodBase_GetMethodFromHandleInternalType_native)
ICALL_TYPE(MODULE, "System.Reflection.Module", MODULE_1)
ICALL(MODULE_1, "Close", ves_icall_System_Reflection_Module_Close)
ICALL(PARAMI_1, "GetMetadataToken", ves_icall_reflection_get_token)
ICALL(PARAMI_2, "GetTypeModifiers", ves_icall_ParameterInfo_GetTypeModifiers)
+ICALL_TYPE(PROPI, "System.Reflection.PropertyInfo", PROPI_1)
+ICALL(PROPI_1, "internal_from_handle_type", ves_icall_System_Reflection_PropertyInfo_internal_from_handle_type)
+
ICALL_TYPE(RTFIELD, "System.Reflection.RtFieldInfo", RTFIELD_1)
ICALL(RTFIELD_1, "UnsafeGetValue", ves_icall_MonoField_GetValueInternal)
ICALL_TYPE(RT, "System.RuntimeType", RT_1)
ICALL(RT_1, "CreateInstanceInternal", ves_icall_System_Activator_CreateInstanceInternal)
-ICALL(RT_2, "GetConstructors_internal", ves_icall_RuntimeType_GetConstructors_internal)
+ICALL(RT_2, "GetConstructors_native", ves_icall_RuntimeType_GetConstructors_native)
ICALL(RT_30, "GetCorrespondingInflatedConstructor", ves_icall_RuntimeType_GetCorrespondingInflatedMethod)
ICALL(RT_31, "GetCorrespondingInflatedMethod", ves_icall_RuntimeType_GetCorrespondingInflatedMethod)
-ICALL(RT_3, "GetEvents_internal", ves_icall_RuntimeType_GetEvents_internal)
-ICALL(RT_5, "GetFields_internal", ves_icall_RuntimeType_GetFields_internal)
+ICALL(RT_3, "GetEvents_native", ves_icall_RuntimeType_GetEvents_native)
+ICALL(RT_5, "GetFields_native", ves_icall_RuntimeType_GetFields_native)
ICALL(RT_6, "GetGenericArgumentsInternal", ves_icall_RuntimeType_GetGenericArguments)
ICALL(RT_9, "GetGenericParameterPosition", ves_icall_RuntimeType_GetGenericParameterPosition)
ICALL(RT_10, "GetInterfaceMapData", ves_icall_RuntimeType_GetInterfaceMapData)
ICALL(RT_11, "GetInterfaces", ves_icall_RuntimeType_GetInterfaces)
-ICALL(RT_12, "GetMethodsByName", ves_icall_RuntimeType_GetMethodsByName)
+ICALL(RT_12, "GetMethodsByName_native", ves_icall_RuntimeType_GetMethodsByName_native)
ICALL(RT_13, "GetNestedTypes_internal", ves_icall_RuntimeType_GetNestedTypes)
ICALL(RT_14, "GetPacking", ves_icall_RuntimeType_GetPacking)
-ICALL(RT_15, "GetPropertiesByName", ves_icall_RuntimeType_GetPropertiesByName)
+ICALL(RT_15, "GetPropertiesByName_native", ves_icall_RuntimeType_GetPropertiesByName_native)
ICALL(RT_16, "GetTypeCodeImplInternal", ves_icall_type_GetTypeCodeInternal)
ICALL(RT_28, "IsTypeExportedToWindowsRuntime", ves_icall_System_RuntimeType_IsTypeExportedToWindowsRuntime)
ICALL(RT_29, "IsWindowsRuntimeObjectType", ves_icall_System_RuntimeType_IsWindowsRuntimeObjectType)
return mono_class_get_type (klass);
}
+ICALL_EXPORT void
+ves_icall_Mono_RuntimeGPtrArrayHandle_GPtrArrayFree (GPtrArray *ptr_array, MonoBoolean freeSeg)
+{
+ g_ptr_array_free (ptr_array, freeSeg);
+}
+
/* System.TypeCode */
typedef enum {
TYPECODE_EMPTY,
MonoError error;
gboolean found = FALSE;
MonoClass *klass;
- MonoClass *k;
g_assert (handle);
} else {
klass = mono_class_from_mono_type (type);
- /* Check that the field belongs to the class */
- for (k = klass; k; k = k->parent) {
- if (k == handle->parent) {
- found = TRUE;
- break;
- }
- }
+ found = klass == handle->parent || mono_class_has_parent (klass, handle->parent);
if (!found)
/* The managed code will throw the exception */
return result;
}
+ICALL_EXPORT MonoReflectionEvent*
+ves_icall_System_Reflection_EventInfo_internal_from_handle_type (MonoEvent *handle, MonoType *type)
+{
+ MonoError error;
+ MonoClass *klass;
+
+ g_assert (handle);
+
+ if (!type) {
+ klass = handle->parent;
+ } else {
+ klass = mono_class_from_mono_type (type);
+
+ gboolean found = klass == handle->parent || mono_class_has_parent (klass, handle->parent);
+ if (!found)
+ /* Managed code will throw an exception */
+ return NULL;
+ }
+
+ MonoReflectionEvent *result = mono_event_get_object_checked (mono_domain_get (), klass, handle, &error);
+ mono_error_set_pending_exception (&error);
+ return result;
+}
+
+
+ICALL_EXPORT MonoReflectionProperty*
+ves_icall_System_Reflection_PropertyInfo_internal_from_handle_type (MonoProperty *handle, MonoType *type)
+{
+ MonoError error;
+ MonoClass *klass;
+
+ g_assert (handle);
+
+ if (!type) {
+ klass = handle->parent;
+ } else {
+ klass = mono_class_from_mono_type (type);
+
+ gboolean found = klass == handle->parent || mono_class_has_parent (klass, handle->parent);
+ if (!found)
+ /* Managed code will throw an exception */
+ return NULL;
+ }
+
+ MonoReflectionProperty *result = mono_property_get_object_checked (mono_domain_get (), klass, handle, &error);
+ mono_error_set_pending_exception (&error);
+ return result;
+}
+
ICALL_EXPORT MonoArray*
ves_icall_System_Reflection_FieldInfo_GetTypeModifiers (MonoReflectionField *field, MonoBoolean optional)
{
BFLAGS_OptionalParamBinding = 0x40000
};
-ICALL_EXPORT MonoArray*
-ves_icall_RuntimeType_GetFields_internal (MonoReflectionType *type, MonoString *name, guint32 bflags, MonoReflectionType *reftype)
+ICALL_EXPORT GPtrArray*
+ves_icall_RuntimeType_GetFields_native (MonoReflectionType *type, MonoString *name, guint32 bflags)
{
MonoError error;
MonoDomain *domain;
- MonoClass *startklass, *klass, *refklass;
- MonoArray *res;
- MonoObject *member;
- int i, match;
+ MonoClass *startklass, *klass;
+ int match;
gpointer iter;
char *utf8_name = NULL;
int (*compare_func) (const char *s1, const char *s2) = NULL;
MonoClassField *field;
- MonoPtrArray tmp_array;
domain = ((MonoObject *)type)->vtable->domain;
if (type->type->byref) {
- MonoArray *result = mono_array_new_checked (domain, mono_defaults.field_info_class, 0, &error);
- mono_error_set_pending_exception (&error);
- return result;
+ return g_ptr_array_new ();
}
klass = startklass = mono_class_from_mono_type (type->type);
- refklass = mono_class_from_mono_type (reftype->type);
- mono_ptr_array_init (tmp_array, 2, MONO_ROOT_SOURCE_REFLECTION, "temporary reflection fields list");
+ GPtrArray *ptr_array = g_ptr_array_sized_new (16);
handle_parent:
if (mono_class_has_failure (klass)) {
- mono_ptr_array_destroy (tmp_array);
- mono_set_pending_exception (mono_class_get_exception_for_failure (klass));
- return NULL;
+ mono_error_init (&error);
+ mono_error_set_for_class_failure (&error, klass);
+ goto fail;
}
iter = NULL;
continue;
}
- member = (MonoObject*)mono_field_get_object_checked (domain, refklass, field, &error);
- if (!mono_error_ok (&error))
- goto fail;
- mono_ptr_array_append (tmp_array, member);
+ g_ptr_array_add (ptr_array, field);
}
if (!(bflags & BFLAGS_DeclaredOnly) && (klass = klass->parent))
goto handle_parent;
- res = mono_array_new_cached (domain, mono_defaults.field_info_class, mono_ptr_array_size (tmp_array), &error);
- if (!is_ok (&error))
- goto fail;
-
- for (i = 0; i < mono_ptr_array_size (tmp_array); ++i)
- mono_array_setref (res, i, mono_ptr_array_get (tmp_array, i));
-
- mono_ptr_array_destroy (tmp_array);
-
if (utf8_name != NULL)
g_free (utf8_name);
+ return ptr_array;
- return res;
fail:
- mono_ptr_array_destroy (tmp_array);
+ g_ptr_array_free (ptr_array, FALSE);
mono_error_set_pending_exception (&error);
return NULL;
}
}
GPtrArray*
-mono_class_get_methods_by_name (MonoClass *klass, const char *name, guint32 bflags, gboolean ignore_case, gboolean allow_ctors, MonoException **ex)
+mono_class_get_methods_by_name (MonoClass *klass, const char *name, guint32 bflags, gboolean ignore_case, gboolean allow_ctors, MonoError *error)
{
GPtrArray *array;
MonoClass *startklass;
array = g_ptr_array_new ();
startklass = klass;
- *ex = NULL;
+ mono_error_init (error);
if (name != NULL)
compare_func = (ignore_case) ? mono_utf8_strcasecmp : strcmp;
g_free (method_slots);
g_ptr_array_free (array, TRUE);
- if (mono_class_has_failure (klass)) {
- *ex = mono_class_get_exception_for_failure (klass);
- } else {
- *ex = mono_get_exception_execution_engine ("Unknown error");
- }
+ g_assert (mono_class_has_failure (klass));
+ mono_error_set_for_class_failure (error, klass);
return NULL;
}
-ICALL_EXPORT MonoArray*
-ves_icall_RuntimeType_GetMethodsByName (MonoReflectionType *type, MonoString *name, guint32 bflags, MonoBoolean ignore_case, MonoReflectionType *reftype)
+ICALL_EXPORT GPtrArray*
+ves_icall_RuntimeType_GetMethodsByName_native (MonoReflectionType *type, MonoString *name, guint32 bflags, MonoBoolean ignore_case)
{
- static MonoClass *MethodInfo_array;
MonoError error;
MonoDomain *domain;
- MonoArray *res;
- MonoVTable *array_vtable;
- MonoException *ex = NULL;
const char *mname = NULL;
GPtrArray *method_array;
- MonoClass *klass, *refklass;
- int i;
-
- mono_error_init (&error);
-
- if (!MethodInfo_array) {
- MonoClass *klass = mono_array_class_get (mono_defaults.method_info_class, 1);
- mono_memory_barrier ();
- MethodInfo_array = klass;
- }
+ MonoClass *klass;
klass = mono_class_from_mono_type (type->type);
- refklass = mono_class_from_mono_type (reftype->type);
domain = ((MonoObject *)type)->vtable->domain;
- array_vtable = mono_class_vtable_full (domain, MethodInfo_array, &error);
- if (!is_ok (&error)) {
- mono_error_set_pending_exception (&error);
- return NULL;
- }
if (type->type->byref) {
- res = mono_array_new_specific_checked (array_vtable, 0, &error);
- mono_error_set_pending_exception (&error);
-
- return res;
+ return g_ptr_array_new ();
}
if (name) {
return NULL;
}
- method_array = mono_class_get_methods_by_name (klass, mname, bflags, ignore_case, FALSE, &ex);
+ method_array = mono_class_get_methods_by_name (klass, mname, bflags, ignore_case, FALSE, &error);
g_free ((char*)mname);
- if (ex) {
- mono_set_pending_exception (ex);
- return NULL;
- }
-
- res = mono_array_new_specific_checked (array_vtable, method_array->len, &error);
- if (!mono_error_ok (&error)) {
- mono_error_set_pending_exception (&error);
- return NULL;
- }
-
- for (i = 0; i < method_array->len; ++i) {
- MonoMethod *method = (MonoMethod *)g_ptr_array_index (method_array, i);
- MonoReflectionMethod *rm = mono_method_get_object_checked (domain, method, refklass, &error);
- if (!mono_error_ok (&error))
- goto failure;
- mono_array_setref (res, i, rm);
- }
-
-failure:
- g_ptr_array_free (method_array, TRUE);
- if (!mono_error_ok (&error))
- mono_set_pending_exception (mono_error_convert_to_exception (&error));
- return res;
+ mono_error_set_pending_exception (&error);
+ return method_array;
}
-ICALL_EXPORT MonoArray*
-ves_icall_RuntimeType_GetConstructors_internal (MonoReflectionType *type, guint32 bflags, MonoReflectionType *reftype)
+ICALL_EXPORT GPtrArray*
+ves_icall_RuntimeType_GetConstructors_native (MonoReflectionType *type, guint32 bflags)
{
- MonoDomain *domain;
- MonoClass *startklass, *klass, *refklass;
- MonoArray *res = NULL;
+ MonoClass *startklass, *klass;
MonoMethod *method;
- MonoObject *member;
- int i, match;
+ int match;
gpointer iter = NULL;
- MonoPtrArray tmp_array;
+ GPtrArray *res_array;
MonoError error;
- domain = ((MonoObject *)type)->vtable->domain;
if (type->type->byref) {
- res = mono_array_new_cached (domain, mono_defaults.method_info_class, 0, &error);
- mono_error_set_pending_exception (&error);
- return res;
+ return g_ptr_array_new ();
}
- mono_ptr_array_init (tmp_array, 4, MONO_ROOT_SOURCE_REFLECTION, "temporary reflection constructors list"); /*FIXME, guestimating*/
-
-
klass = startklass = mono_class_from_mono_type (type->type);
- refklass = mono_class_from_mono_type (reftype->type);
mono_class_setup_methods (klass);
if (mono_class_has_failure (klass)) {
- mono_set_pending_exception (mono_class_get_exception_for_failure (klass));
- goto leave;
+ mono_error_init (&error);
+ mono_error_set_for_class_failure (&error, klass);
+ mono_error_set_pending_exception (&error);
+ return NULL;
}
+ res_array = g_ptr_array_sized_new (4); /* FIXME, guestimating */
+
iter = NULL;
while ((method = mono_class_get_methods (klass, &iter))) {
match = 0;
if (!match)
continue;
- member = (MonoObject*)mono_method_get_object_checked (domain, method, refklass, &error);
- if (mono_error_set_pending_exception (&error))
- goto leave;
-
- mono_ptr_array_append (tmp_array, member);
+ g_ptr_array_add (res_array, method);
}
- res = mono_array_new_cached (domain, mono_class_get_constructor_info_class (), mono_ptr_array_size (tmp_array), &error);
- if (mono_error_set_pending_exception (&error))
- goto leave;
-
- for (i = 0; i < mono_ptr_array_size (tmp_array); ++i)
- mono_array_setref (res, i, mono_ptr_array_get (tmp_array, i));
-
-leave:
- mono_ptr_array_destroy (tmp_array);
-
- return res;
+ return res_array;
}
static guint
return method_nonpublic (accessor, start_klass);
}
-ICALL_EXPORT MonoArray*
-ves_icall_RuntimeType_GetPropertiesByName (MonoReflectionType *type, MonoString *name, guint32 bflags, MonoBoolean ignore_case, MonoReflectionType *reftype)
+ICALL_EXPORT GPtrArray*
+ves_icall_RuntimeType_GetPropertiesByName_native (MonoReflectionType *type, MonoString *name, guint32 bflags, MonoBoolean ignore_case)
{
MonoError error;
- MonoDomain *domain;
MonoClass *startklass, *klass;
- MonoArray *res;
MonoMethod *method;
MonoProperty *prop;
- int i, match;
+ int match;
guint32 flags;
gchar *propname = NULL;
int (*compare_func) (const char *s1, const char *s2) = NULL;
gpointer iter;
GHashTable *properties = NULL;
- MonoPtrArray tmp_array;
+ GPtrArray *res_array;
- mono_error_init (&error);
-
- domain = ((MonoObject *)type)->vtable->domain;
if (type->type->byref) {
- res = mono_array_new_cached (domain, mono_class_get_property_info_class (), 0, &error);
- mono_error_set_pending_exception (&error);
- return res;
+ return g_ptr_array_new ();
}
- mono_ptr_array_init (tmp_array, 8, MONO_ROOT_SOURCE_REFLECTION, "temporary reflection properties list"); /*This the average for ASP.NET types*/
-
+ mono_error_init (&error);
+
klass = startklass = mono_class_from_mono_type (type->type);
if (name != NULL) {
compare_func = (ignore_case) ? mono_utf8_strcasecmp : strcmp;
}
+ res_array = g_ptr_array_sized_new (8); /*This the average for ASP.NET types*/
+
properties = g_hash_table_new (property_hash, (GEqualFunc)property_equal);
handle_parent:
mono_class_setup_methods (klass);
if (g_hash_table_lookup (properties, prop))
continue;
- MonoReflectionProperty *pr = mono_property_get_object_checked (domain, startklass, prop, &error);
- if (!pr)
- goto failure;
- mono_ptr_array_append (tmp_array, pr);
+ g_ptr_array_add (res_array, prop);
g_hash_table_insert (properties, prop, prop);
}
- if ((!(bflags & BFLAGS_DeclaredOnly) && (klass = klass->parent)))
+ if (!(bflags & BFLAGS_DeclaredOnly) && (klass = klass->parent))
goto handle_parent;
g_hash_table_destroy (properties);
g_free (propname);
- res = mono_array_new_cached (domain, mono_class_get_property_info_class (), mono_ptr_array_size (tmp_array), &error);
- if (!is_ok (&error))
- goto failure;
- for (i = 0; i < mono_ptr_array_size (tmp_array); ++i)
- mono_array_setref (res, i, mono_ptr_array_get (tmp_array, i));
-
- mono_ptr_array_destroy (tmp_array);
-
- return res;
-
+ return res_array;
loader_error:
if (mono_class_has_failure (klass))
mono_error_set_for_class_failure (&error, klass);
-failure:
if (properties)
g_hash_table_destroy (properties);
if (name)
g_free (propname);
- mono_ptr_array_destroy (tmp_array);
+ g_ptr_array_free (res_array, FALSE);
mono_error_set_pending_exception (&error);
return g_str_equal (event1->name, event2->name);
}
-ICALL_EXPORT MonoArray*
-ves_icall_RuntimeType_GetEvents_internal (MonoReflectionType *type, MonoString *name, guint32 bflags, MonoReflectionType *reftype)
+ICALL_EXPORT GPtrArray*
+ves_icall_RuntimeType_GetEvents_native (MonoReflectionType *type, MonoString *name, guint32 bflags)
{
MonoError error;
- MonoDomain *domain;
MonoClass *startklass, *klass;
- MonoArray *res;
MonoMethod *method;
MonoEvent *event;
- int i, match;
+ int match;
gpointer iter;
char *utf8_name = NULL;
int (*compare_func) (const char *s1, const char *s2) = NULL;
GHashTable *events = NULL;
- MonoPtrArray tmp_array;
+ GPtrArray *res_array;
- mono_error_init (&error);
-
- domain = mono_object_domain (type);
if (type->type->byref) {
- res = mono_array_new_cached (domain, mono_class_get_event_info_class (), 0, &error);
- mono_error_set_pending_exception (&error);
- return res;
+ return g_ptr_array_new ();
}
- mono_ptr_array_init (tmp_array, 4, MONO_ROOT_SOURCE_REFLECTION, "temporary reflection events list");
+ mono_error_init (&error);
+
+ res_array = g_ptr_array_sized_new (4);
klass = startklass = mono_class_from_mono_type (type->type);
if (g_hash_table_lookup (events, event))
continue;
- MonoReflectionEvent *ev_obj;
- ev_obj = mono_event_get_object_checked (domain, startklass, event, &error);
- if (!ev_obj)
- goto failure;
- mono_ptr_array_append (tmp_array, ev_obj);
+ g_ptr_array_add (res_array, event);
g_hash_table_insert (events, event, event);
}
g_hash_table_destroy (events);
- res = mono_array_new_cached (domain, mono_class_get_event_info_class (), mono_ptr_array_size (tmp_array), &error);
- if (!is_ok (&error))
- goto failure;
-
- for (i = 0; i < mono_ptr_array_size (tmp_array); ++i)
- mono_array_setref (res, i, mono_ptr_array_get (tmp_array, i));
-
- mono_ptr_array_destroy (tmp_array);
-
if (utf8_name != NULL)
g_free (utf8_name);
- return res;
+ return res_array;
loader_error:
if (mono_class_has_failure (klass))
if (utf8_name != NULL)
g_free (utf8_name);
- mono_ptr_array_destroy (tmp_array);
+ g_ptr_array_free (res_array, FALSE);
mono_error_set_pending_exception (&error);
return NULL;
mono_metadata_decode_row (table, i - 1, file_cols, MONO_FILE_SIZE);
val = mono_metadata_string_heap (assembly->assembly->image, file_cols [MONO_FILE_NAME]);
MONO_OBJECT_SETREF (info, filename, mono_string_new (mono_object_domain (assembly), val));
- if (file_cols [MONO_FILE_FLAGS] && FILE_CONTAINS_NO_METADATA)
+ if (file_cols [MONO_FILE_FLAGS] & FILE_CONTAINS_NO_METADATA)
info->location = 0;
else
info->location = RESOURCE_LOCATION_EMBEDDED;
for (i = 0; i < file_count; ++i, ++j) {
mono_metadata_decode_row (table, i, cols, MONO_FILE_SIZE);
- if (cols [MONO_FILE_FLAGS] && FILE_CONTAINS_NO_METADATA) {
+ if (cols [MONO_FILE_FLAGS] & FILE_CONTAINS_NO_METADATA) {
MonoReflectionModule *rm = mono_module_file_get_object_checked (domain, image, i, &error);
if (mono_error_set_pending_exception (&error))
return NULL;
}
ICALL_EXPORT MonoReflectionMethod*
-ves_icall_System_Reflection_MethodBase_GetMethodFromHandleInternalType (MonoMethod *method, MonoType *type)
+ves_icall_System_Reflection_MethodBase_GetMethodFromHandleInternalType_native (MonoMethod *method, MonoType *type, MonoBoolean generic_check)
{
MonoReflectionMethod *res = NULL;
MonoError error;
MonoClass *klass;
- if (type) {
+ if (type && generic_check) {
klass = mono_class_from_mono_type (type);
- if (mono_class_get_generic_type_definition (method->klass) != mono_class_get_generic_type_definition (klass))
+ if (mono_class_get_generic_type_definition (method->klass) != mono_class_get_generic_type_definition (klass))
return NULL;
+
if (method->klass != klass) {
method = mono_method_get_equivalent_method (method, klass);
if (!method)
return NULL;
}
- } else
+ } else if (type)
+ klass = mono_class_from_mono_type (type);
+ else
klass = method->klass;
res = mono_method_get_object_checked (mono_domain_get (), method, klass, &error);
mono_error_set_pending_exception (&error);
}
#endif
} else if (level==2) {
- if (is_string == TRUE || (is_string == FALSE && lang_id != 0 && name_offset != lang_id))
+ if (is_string || (lang_id != 0 && name_offset != lang_id))
return NULL;
} else {
g_assert_not_reached ();
}
- if(is_dir==TRUE) {
+ if (is_dir) {
MonoPEResourceDir *res_dir=(MonoPEResourceDir *)(((char *)root)+dir_offset);
MonoPEResourceDirEntry *sub_entries=(MonoPEResourceDirEntry *)(res_dir+1);
guint32 entries, i;
return delegate->delegate_trampoline;
fail:
- mono_gchandle_free (target_handle);
+ if (target_handle != 0)
+ mono_gchandle_free (target_handle);
mono_error_set_pending_exception (&error);
return NULL;
}
/* Set LastError if needed */
if (piinfo->piflags & PINVOKE_ATTRIBUTE_SUPPORTS_LAST_ERROR) {
#ifdef TARGET_WIN32
- static MonoMethodSignature *get_last_error_sig = NULL;
- if (!get_last_error_sig) {
- get_last_error_sig = mono_metadata_signature_alloc (mono_defaults.corlib, 0);
- get_last_error_sig->ret = &mono_defaults.int_class->byval_arg;
- get_last_error_sig->pinvoke = 1;
- }
+ if (!aot) {
+ static MonoMethodSignature *get_last_error_sig = NULL;
+ if (!get_last_error_sig) {
+ get_last_error_sig = mono_metadata_signature_alloc (mono_defaults.corlib, 0);
+ get_last_error_sig->ret = &mono_defaults.int_class->byval_arg;
+ get_last_error_sig->pinvoke = 1;
+ }
- /*
- * Have to call GetLastError () early and without a wrapper, since various runtime components could
- * clobber its value.
- */
- mono_mb_emit_native_call (mb, get_last_error_sig, GetLastError);
- mono_mb_emit_icall (mb, mono_marshal_set_last_error_windows);
+ /*
+ * Have to call GetLastError () early and without a wrapper, since various runtime components could
+ * clobber its value.
+ */
+ mono_mb_emit_native_call (mb, get_last_error_sig, GetLastError);
+ mono_mb_emit_icall (mb, mono_marshal_set_last_error_windows);
+ } else {
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_GET_LAST_ERROR);
+ mono_mb_emit_icall (mb, mono_marshal_set_last_error_windows);
+ }
#else
mono_mb_emit_icall (mb, mono_marshal_set_last_error);
#endif
MonoMethod *res;
char *name;
const char *param_names [16];
- guint32 b1, b2, b3;
+ guint32 b1, b2, b3, b4;
int aklass, vklass, vtable, uiid;
int array_slot_addr;
WrapperInfo *info;
mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoClass, idepth));
mono_mb_emit_byte (mb, CEE_LDIND_U2);
- b2 = mono_mb_emit_branch (mb, CEE_BLT_UN);
+ b3 = mono_mb_emit_branch (mb, CEE_BLT_UN);
/* if (vklass->supertypes [aklass->idepth - 1] != aklass) goto failure */
mono_mb_emit_ldloc (mb, vklass);
mono_mb_emit_byte (mb, CEE_LDIND_I);
mono_mb_emit_ldloc (mb, aklass);
- b3 = mono_mb_emit_branch (mb, CEE_BNE_UN);
+ b4 = mono_mb_emit_branch (mb, CEE_BNE_UN);
/* do_store: */
mono_mb_patch_branch (mb, b1);
/* do_exception: */
mono_mb_patch_branch (mb, b2);
mono_mb_patch_branch (mb, b3);
+ mono_mb_patch_branch (mb, b4);
mono_mb_emit_exception (mb, "ArrayTypeMismatchException", NULL);
break;
MonoException *exc;
gpointer stackdata;
- g_assert (gchandle >= 0);
-
mono_threads_enter_gc_unsafe_region_unbalanced (&stackdata);
exc = (MonoException*) mono_gchandle_get_target (gchandle);
{
MonoMemPool *p;
int count = 0;
- guint32 still_free = pool->end - pool->pos;
+ guint32 still_free;
p = pool;
while (p) {
count++;
}
if (pool) {
+ still_free = pool->end - pool->pos;
g_print ("Mempool %p stats:\n", pool);
g_print ("Total mem allocated: %d\n", pool->d.allocated);
g_print ("Num chunks: %d\n", count);
return FALSE;
if (original_sig->explicit_this != signature->explicit_this)
return FALSE;
- if (original_sig->call_convention != signature->call_convention)
- return FALSE;
if (original_sig->pinvoke != signature->pinvoke)
return FALSE;
if (original_sig->sentinelpos != signature->sentinelpos)
memset (&info->old_version_bottom, 0, sizeof (info->old_version_bottom));
memset (&info->old_version_top, 0, sizeof (info->old_version_top));
memset (&info->new_version, 0, sizeof (info->new_version));
- } if (!strcmp (element_name, "assemblyIdentity")) {
+ } else if (!strcmp (element_name, "assemblyIdentity")) {
for (n = 0; attribute_names [n]; n++) {
const gchar *attribute_name = attribute_names [n];
MONO_OBJECT_SETREF (res, fqname, mono_string_new (domain, name));
MONO_OBJECT_SETREF (res, name, mono_string_new (domain, name));
MONO_OBJECT_SETREF (res, scopename, mono_string_new (domain, name));
- res->is_resource = cols [MONO_FILE_FLAGS] && FILE_CONTAINS_NO_METADATA;
+ res->is_resource = cols [MONO_FILE_FLAGS] & FILE_CONTAINS_NO_METADATA;
res->token = mono_metadata_make_token (MONO_TABLE_FILE, table_index + 1);
return res;
MonoReflectionEvent *res;
MonoReflectionMonoEvent *mono_event;
+ mono_error_init (error);
CHECK_OBJECT (MonoReflectionEvent *, event, klass);
mono_event = (MonoReflectionMonoEvent *)mono_object_new_checked (domain, mono_class_get_mono_event_class (), error);
if (!mono_event)
klass = mono_defaults.array_class;
} else if (type->type == MONO_TYPE_VALUETYPE) {
klass = type->data.klass;
- } else if (t == MONO_TYPE_OBJECT || t == MONO_TYPE_CLASS || t == MONO_TYPE_STRING ||
- t == MONO_TYPE_CLASS) {
+ } else if (t == MONO_TYPE_OBJECT || t == MONO_TYPE_CLASS || t == MONO_TYPE_STRING) {
klass = mono_defaults.object_class;
} else if (t == MONO_TYPE_PTR || t == MONO_TYPE_FNPTR) {
klass = mono_defaults.int_class;
void sgen_tarjan_bridge_init (SgenBridgeProcessor *collector);
void sgen_set_bridge_implementation (const char *name);
void sgen_bridge_set_dump_prefix (const char *prefix);
-void sgen_init_bridge_processor();
+void sgen_init_bridge (void);
#endif
#include "sgen/sgen-qsort.h"
#include "utils/mono-logger-internals.h"
+typedef enum {
+ BRIDGE_PROCESSOR_INVALID,
+ BRIDGE_PROCESSOR_OLD,
+ BRIDGE_PROCESSOR_NEW,
+ BRIDGE_PROCESSOR_TARJAN,
+ BRIDGE_PROCESSOR_DEFAULT = BRIDGE_PROCESSOR_TARJAN
+} BridgeProcessorSelection;
+
+// Bridge processor type pending / in use
+static BridgeProcessorSelection bridge_processor_selection = BRIDGE_PROCESSOR_DEFAULT;
+// Most recently requested callbacks
+static MonoGCBridgeCallbacks pending_bridge_callbacks;
+// Currently-in-use callbacks
MonoGCBridgeCallbacks bridge_callbacks;
+
+// Bridge processor state
static SgenBridgeProcessor bridge_processor;
+// This is used for a special debug feature
static SgenBridgeProcessor compare_to_bridge_processor;
volatile gboolean bridge_processing_in_progress = FALSE;
+// FIXME: The current usage pattern for this function is unsafe. Bridge processing could start immediately after unlock
void
mono_gc_wait_for_bridge_processing (void)
{
if (callbacks->bridge_version != SGEN_BRIDGE_VERSION)
g_error ("Invalid bridge callback version. Expected %d but got %d\n", SGEN_BRIDGE_VERSION, callbacks->bridge_version);
- bridge_callbacks = *callbacks;
+ // Defer assigning to bridge_callbacks until we have the gc lock.
+ // Note: This line is unsafe if we are on a separate thread from the one the runtime was initialized on.
+ pending_bridge_callbacks = *callbacks;
+
+ // If sgen has started, will assign bridge callbacks and init bridge
+ sgen_init_bridge ();
}
-static gboolean
-init_bridge_processor_by_name (SgenBridgeProcessor *processor, const char *name)
+static BridgeProcessorSelection
+bridge_processor_name (const char *name)
{
if (!strcmp ("old", name)) {
- memset (processor, 0, sizeof (SgenBridgeProcessor));
- sgen_old_bridge_init (processor);
+ return BRIDGE_PROCESSOR_OLD;
} else if (!strcmp ("new", name)) {
- memset (processor, 0, sizeof (SgenBridgeProcessor));
- sgen_new_bridge_init (processor);
+ return BRIDGE_PROCESSOR_NEW;
} else if (!strcmp ("tarjan", name)) {
- memset (processor, 0, sizeof (SgenBridgeProcessor));
- sgen_tarjan_bridge_init (processor);
+ return BRIDGE_PROCESSOR_TARJAN;
} else {
- return FALSE;
+ return BRIDGE_PROCESSOR_INVALID;
+ }
+}
+
+// Initialize a single bridge processor
+static void
+init_bridge_processor (SgenBridgeProcessor *processor, BridgeProcessorSelection selection)
+{
+ memset (processor, 0, sizeof (SgenBridgeProcessor));
+
+ switch (selection) {
+ case BRIDGE_PROCESSOR_OLD:
+ sgen_old_bridge_init (processor);
+ break;
+ case BRIDGE_PROCESSOR_NEW:
+ sgen_new_bridge_init (processor);
+ break;
+ case BRIDGE_PROCESSOR_TARJAN:
+ sgen_tarjan_bridge_init (processor);
+ break;
+ default:
+ g_assert_not_reached ();
}
- return TRUE;
}
+/*
+ * Initializing the sgen bridge consists of setting the bridge callbacks,
+ * and initializing the bridge processor. Init should follow these rules:
+ *
+ * - Init happens only after sgen is initialized (because we don't
+ * know which bridge processor to initialize until then, and also
+ * to allow bridge processor init to interact with sgen if it wants)
+ *
+ * - Init happens only after mono_gc_register_bridge_callbacks is called
+ *
+ * - Init should not happen concurrently with a GC (because a GC will
+ * call sgen_need_bridge_processing at various times)
+ *
+ * - Initializing the bridge processor should happen only once
+ *
+ * We call sgen_init_bridge when the callbacks are set, and also when sgen
+ * is done initing. Actual initialization then only occurs if it is ready.
+ */
void
-sgen_init_bridge_processor()
+sgen_init_bridge ()
{
- // If a bridge was registered but there is no bridge processor yet, init defaults
- if (bridge_callbacks.cross_references && !bridge_processor.reset_data)
- sgen_tarjan_bridge_init (&bridge_processor);
+ if (sgen_gc_initialized ()) {
+ // This lock is not initialized until the GC is
+ sgen_gc_lock ();
+
+ bridge_callbacks = pending_bridge_callbacks;
+
+ // If a bridge was registered but there is no bridge processor yet
+ if (bridge_callbacks.cross_references && !bridge_processor.reset_data)
+ init_bridge_processor (&bridge_processor, bridge_processor_selection);
+
+ sgen_gc_unlock ();
+ }
}
void
sgen_set_bridge_implementation (const char *name)
{
- if (!init_bridge_processor_by_name (&bridge_processor, name))
- g_warning ("Invalid value for bridge implementation, valid values are: 'new', 'old' and 'tarjan'.");
+ BridgeProcessorSelection selection = bridge_processor_name (name);
+
+ if (selection == BRIDGE_PROCESSOR_INVALID)
+ g_warning ("Invalid value for bridge processor implementation, valid values are: 'new', 'old' and 'tarjan'.");
+ else if (bridge_processor.reset_data)
+ g_warning ("Cannot set bridge processor implementation once bridge has already started");
+ else
+ bridge_processor_selection = selection;
}
gboolean
set_dump_prefix (prefix);
} else if (g_str_has_prefix (opt, "bridge-compare-to=")) {
const char *name = strchr (opt, '=') + 1;
- if (init_bridge_processor_by_name (&compare_to_bridge_processor, name)) {
- if (compare_to_bridge_processor.reset_data == bridge_processor.reset_data) {
- g_warning ("Cannot compare bridge implementation to itself - ignoring.");
- memset (&compare_to_bridge_processor, 0, sizeof (SgenBridgeProcessor));
- }
+ BridgeProcessorSelection selection = bridge_processor_name (name);
+
+ if (selection != BRIDGE_PROCESSOR_INVALID) {
+ init_bridge_processor (&compare_to_bridge_processor, selection);
} else {
g_warning ("Invalid bridge implementation to compare against - ignoring.");
}
void (*cross_references) (int num_sccs, MonoGCBridgeSCC **sccs, int num_xrefs, MonoGCBridgeXRef *xrefs);
} MonoGCBridgeCallbacks;
-// Clients should call before initializing runtime.
+/*
+ * Note: This may be called at any time, but cannot be called concurrently
+ * with (during and on a separate thread from) sgen init. Callers are
+ * responsible for enforcing this.
+ */
MONO_API void mono_gc_register_bridge_callbacks (MonoGCBridgeCallbacks *callbacks);
MONO_API void mono_gc_wait_for_bridge_processing (void);
gpointer stack_start;
info->client_info.stopped_domain = mono_domain_get ();
+ info->client_info.stack_start = NULL;
info->client_info.signal = 0;
stop_count = sgen_global_stop_count;
/* duplicate signal */
mono_gc_set_skip_thread (TRUE);
+ MONO_ENTER_GC_SAFE;
ready = epoll_wait (epoll_fd, epoll_events, EPOLL_NEVENTS, -1);
+ MONO_EXIT_GC_SAFE;
mono_gc_set_skip_thread (FALSE);
mono_gc_set_skip_thread (TRUE);
+ MONO_ENTER_GC_SAFE;
ready = kevent (kqueue_fd, NULL, 0, kqueue_events, KQUEUE_NEVENTS, NULL);
+ MONO_EXIT_GC_SAFE;
mono_gc_set_skip_thread (FALSE);
mono_gc_set_skip_thread (TRUE);
+ MONO_ENTER_GC_SAFE;
ready = mono_poll (poll_fds, poll_fds_size, -1);
+ MONO_EXIT_GC_SAFE;
mono_gc_set_skip_thread (FALSE);
{
ThreadPoolIOUpdate *update;
- g_assert (handle >= 0);
+ g_assert (handle);
g_assert ((job->operation == EVENT_IN) ^ (job->operation == EVENT_OUT));
g_assert (job->callback);
break;
}
}
- g_assert (current_idx >= 0);
+ g_assert (current_idx != (guint)-1);
}
for (i = current_idx + 1; i < len + current_idx + 1; ++i) {
ThreadPoolDomain *tmp = (ThreadPoolDomain *)g_ptr_array_index (threadpool->domains, i % len);
CODE_NOT_VERIFIABLE (ctx, g_strdup_printf ("This object not compatible with function pointer for delegate creation at 0x%04x", ctx->ip_offset));
} else {
if (method->flags & METHOD_ATTRIBUTE_STATIC) {
- if (!stack_slot_is_null_literal (value) && !is_first_arg_bound)
+ if (!stack_slot_is_null_literal (value))
CODE_NOT_VERIFIABLE (ctx, g_strdup_printf ("Non-null this args used with static function for delegate creation at 0x%04x", ctx->ip_offset));
} else {
if (!verify_stack_type_compatibility_full (ctx, &method->klass->byval_arg, value, FALSE, TRUE) && !stack_slot_is_null_literal (value))
gc-test.cs \
gshared.cs
-regtests=basic.exe basic-float.exe basic-long.exe basic-calls.exe objects.exe arrays.exe basic-math.exe exceptions.exe iltests.exe devirtualization.exe generics.exe basic-simd.exe
+
+regtests_UNIVERSAL=basic.exe basic-float.exe basic-long.exe basic-calls.exe objects.exe arrays.exe basic-math.exe exceptions.exe iltests.exe devirtualization.exe generics.exe basic-simd.exe
+
+if INSTALL_MOBILE_STATIC
+regtests= \
+ $(regtests_UNIVERSAL)
+
if NACL_CODEGEN
test_sources += nacl.cs
regtests += nacl.exe
endif
+else
+regtests= \
+ $(regtests_UNIVERSAL) \
+ $(regtests_MOBILE_STATIC_BLACKLIST)
+endif
+
if X86
arch_sources = $(x86_sources)
arch_built=cpu-x86.h
libmonoboehm_2_0_la_SOURCES =
libmonoboehm_2_0_la_CFLAGS = $(mono_boehm_CFLAGS)
libmonoboehm_2_0_la_LIBADD = libmini.la $(boehm_libs) $(LIBMONO_DTRACE_OBJECT) $(LLVMMONOF)
-libmonoboehm_2_0_la_LDFLAGS = $(libmonoldflags)
+libmonoboehm_2_0_la_LDFLAGS = $(libmonoldflags) $(monobin_platform_ldflags)
libmonosgen_2_0_la_SOURCES =
libmonosgen_2_0_la_CFLAGS = $(mono_sgen_CFLAGS)
libmonosgen_2_0_la_LIBADD = libmini.la $(sgen_libs) $(LIBMONO_DTRACE_OBJECT) $(LLVMMONOF)
-libmonosgen_2_0_la_LDFLAGS = $(libmonoldflags)
+libmonosgen_2_0_la_LDFLAGS = $(libmonoldflags) $(monobin_platform_ldflags)
#
# This library is shared between mono and mono-sgen, since the code in mini/ doesn't contain
%.exe: %.il
$(ILASM) -output=$@ $<
-TestDriver.dll: $(srcdir)/TestDriver.cs
- $(MCS) -out:$@ -target:library $<
+TestDriver.dll: $(srcdir)/TestDriver.cs $(srcdir)/TestHelpers.cs
+ $(MCS) -out:$@ -target:library $^
generics-variant-types.dll: generics-variant-types.il
$(ILASM) -dll -output=$@ $<
checktests: $(regtests)
for i in $(regtests); do $(MINI_RUNTIME) $$i; done
-rcheck: mono $(regtests)
+rcheck-ci: mono $(regtests)
if NACL_CODEGEN
for i in $(regtests); do echo "running test $$i"; $(MINI_RUNTIME) $$i --exclude 'NaClDisable' || exit 1; done
else
exit $$(cat regressionexitcode.out)
endif
-rcheck2: mono $(regtests)
+rcheck-normal: mono $(regtests)
$(MINI_RUNTIME) --regression $(regtests)
if ARM
fullaot_regtests = $(regtests) aot-tests.exe $(if $(GSHAREDVT),gshared.exe)
-FULLAOT_LIBS = \
+# Skip aoting the tests that aren't compiled
+# on the mobile_static profile because they're skipped
+# on mobile profiles
+FULLAOT_LIBS_MOBILE_STATIC_BLACKLIST = \
+ Mono.Posix.dll \
+ System.Configuration.dll \
+ Mono.Simd.dll
+
+FULLAOT_LIBS_UNIVERSAL = \
mscorlib.dll \
System.Core.dll \
System.dll \
- Mono.Posix.dll \
- System.Configuration.dll \
- System.Security.dll \
System.Xml.dll \
- Mono.Security.dll \
- Mono.Simd.dll
+ System.Security.dll \
+ Mono.Security.dll
+
+if INSTALL_MOBILE_STATIC
+FULLAOT_LIBS= \
+ Mono.Dynamic.Interpreter.dll \
+ $(FULLAOT_LIBS_UNIVERSAL)
+else
+FULLAOT_LIBS= \
+ $(FULLAOT_LIBS_UNIVERSAL) \
+ $(FULLAOT_LIBS_MOBILE_STATIC_BLACKLIST)
+endif
+
+FULLAOT_TMP_DIR=$(top_builddir)/mono/mini/fullaot-tmp
# This currently only works on amd64/arm
fullaotcheck: $(mono) $(fullaot_regtests)
- rm -rf fullaot-tmp
- mkdir fullaot-tmp
+ rm -rf $(FULLAOT_TMP_DIR)
+ mkdir $(FULLAOT_TMP_DIR)
$(MAKE) fullaot-libs AOT_FLAGS="full,$(MONO_FULLAOT_ADDITIONAL_ARGS)" GSHAREDVT=$(GSHAREDVT)
- cp $(regtests) $(fullaot_regtests) generics-variant-types.dll TestDriver.dll fullaot-tmp/
- MONO_PATH=fullaot-tmp $(top_builddir)/runtime/mono-wrapper $(LLVM_AOT_RUNTIME_OPTS) $(GSHAREDVT_RUNTIME_OPTS) --aot="full,$(MONO_FULLAOT_ADDITIONAL_ARGS)" fullaot-tmp/{generics-variant-types.dll,TestDriver.dll,*.exe} || exit 1
- ln -s $(if $(MONO_EXECUTABLE),$(MONO_EXECUTABLE),$$PWD/mono) fullaot-tmp/
- for i in $(fullaot_regtests); do echo $$i; MONO_PATH=fullaot-tmp $(top_builddir)/runtime/mono-wrapper --full-aot fullaot-tmp/$$i --exclude '!FULLAOT' $(ARCH_FULLAOT_EXCLUDE) || exit 1; done
+ cp $(regtests) $(fullaot_regtests) generics-variant-types.dll TestDriver.dll $(FULLAOT_TMP_DIR)/
+ MONO_PATH=$(FULLAOT_TMP_DIR) $(top_builddir)/runtime/mono-wrapper $(LLVM_AOT_RUNTIME_OPTS) $(GSHAREDVT_RUNTIME_OPTS) --aot="full,$(MONO_FULLAOT_ADDITIONAL_ARGS)" $(FULLAOT_TMP_DIR)/{generics-variant-types.dll,TestDriver.dll,*.exe} || exit 1
+ ln -s $(if $(MONO_EXECUTABLE),$(MONO_EXECUTABLE),$$PWD/mono) $(FULLAOT_TMP_DIR)/
+ for i in $(fullaot_regtests); do echo $$i; MONO_PATH=$(FULLAOT_TMP_DIR) $(top_builddir)/runtime/mono-wrapper --full-aot $(FULLAOT_TMP_DIR)/$$i --exclude '!FULLAOT' $(ARCH_FULLAOT_EXCLUDE) || exit 1; done
# This can run in parallel
fullaot-libs: $(patsubst %,fullaot-tmp/%.dylib,$(FULLAOT_LIBS))
docu: mini.sgm
docbook2txt mini.sgm
-check-local: rcheck check-seq-points
+# CI - Wrench
+# BUILD_URL = Jenkins
+RUNNING_ON_CI = $(CI)$(BUILD_URL)
+
+# We need these because automake can't process normal make conditionals
+check_local_targets = $(if $(RUNNING_ON_CI), rcheck-ci check-seq-points, rcheck-normal)
+
+check-local: $(check_local_targets)
clean-local:
rm -f mono a.out gmon.out *.o buildver-boehm.h buildver-sgen.h test.exe regressionexitcode.out TestResult-op_il_seq_point.xml*
CLEANFILES= $(BUILT_SOURCES) *.exe *.dll
EXTRA_DIST = TestDriver.cs \
+ TestHelpers.cs \
genmdesc.pl \
emitnunit.pl \
$(test_sources) \
--- /dev/null
+using System;
+using System.Threading;
+
+namespace MonoTests.Helpers {
+
+ public static class FinalizerHelpers {
+ private static IntPtr aptr;
+
+ private static unsafe void NoPinActionHelper (int depth, Action act)
+ {
+ // Avoid tail calls
+ int* values = stackalloc int [20];
+ aptr = new IntPtr (values);
+
+ if (depth <= 0)
+ act ();
+ else
+ NoPinActionHelper (depth - 1, act);
+ }
+
+ public static void PerformNoPinAction (Action act)
+ {
+ Thread thr = new Thread (() => NoPinActionHelper (1024, act));
+ thr.Start ();
+ thr.Join ();
+ }
+ }
+}
+
mb = mono_mb_new (mono_defaults.object_class, "FOO", MONO_WRAPPER_NONE);
m = mono_mb_create_method (mb, sig, 16);
- return mono_marshal_get_runtime_invoke (m, FALSE);
+ MonoMethod *invoke = mono_marshal_get_runtime_invoke (m, FALSE);
+ mono_mb_free (mb);
+ return invoke;
}
static MonoMethod*
if (export_name)
g_hash_table_insert (acfg->export_names, wrapper, export_name);
}
+ g_free (cattr);
}
if ((method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) ||
for (j = 0; j < header->num_locals; ++j)
if (header->locals [j]->type == MONO_TYPE_GENERICINST)
add_generic_class_with_depth (acfg, mono_class_from_mono_type (header->locals [j]), depth + 1, "local");
+ mono_metadata_free_mh (header);
} else {
mono_error_cleanup (&error); /* FIXME report the error */
}
+
}
/*
}
}
+ g_ptr_array_free (patches, TRUE);
g_free (locs);
}
encode_patch_list (acfg, patches, n_patches, cfg->compile_llvm, first_got_offset, p, &p);
+ g_ptr_array_free (patches, TRUE);
+
acfg->stats.info_size += p - buf;
g_assert (p - buf < buf_size);
unwind_desc = get_unwind_info_offset (acfg, encoded, encoded_len);
encode_value (unwind_desc, p, &p);
+
+ g_free (encoded);
} else {
encode_value (jinfo->unwind_info, p, &p);
}
encode_patch_list (acfg, patches, patches->len, FALSE, got_offset, p, &p);
g_assert (p - buf < buf_size);
+ g_ptr_array_free (patches, TRUE);
sprintf (symbol, "%s%s_p", acfg->user_symbol_prefix, name);
if (acfg->dwarf)
mono_dwarf_writer_emit_trampoline (acfg->dwarf, symbol, symbol2, NULL, NULL, code_size, unwind_ops);
}
+
+ g_free (buf);
}
static G_GNUC_UNUSED void
offset = MONO_RGCTX_SLOT_MAKE_RGCTX (i);
mono_arch_create_rgctx_lazy_fetch_trampoline (offset, &info, TRUE);
emit_trampoline (acfg, acfg->got_offset, info);
+ g_free (info);
offset = MONO_RGCTX_SLOT_MAKE_MRGCTX (i);
mono_arch_create_rgctx_lazy_fetch_trampoline (offset, &info, TRUE);
emit_trampoline (acfg, acfg->got_offset, info);
+ g_free (info);
}
#ifdef MONO_ARCH_HAVE_GENERAL_RGCTX_LAZY_FETCH_TRAMPOLINE
}
}
+#ifdef MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD_AOT
+ mono_arch_create_handler_block_trampoline (&info, TRUE);
+ emit_trampoline (acfg, acfg->got_offset, info);
+#endif
+
#endif /* #ifdef MONO_ARCH_HAVE_FULL_AOT_TRAMPOLINES */
/* Emit trampolines which are numerous */
opts->soft_debug = TRUE;
} else if (str_begins_with (arg, "gen-seq-points-file=")) {
fprintf (stderr, "Mono Warning: aot option gen-seq-points-file= is deprecated.\n");
+ } else if (str_begins_with (arg, "gen-seq-points-file")) {
+ fprintf (stderr, "Mono Warning: aot option gen-seq-points-file is deprecated.\n");
} else if (str_begins_with (arg, "msym-dir=")) {
debug_options.no_seq_points_compact_data = FALSE;
opts->gen_msym_dir = TRUE;
if (acfg->aot_opts.print_skipped_methods)
printf ("Skip (disabled): %s\n", mono_method_get_full_name (method));
InterlockedIncrement (&acfg->stats.ocount);
- mono_destroy_compile (cfg);
return;
}
cfg->method_index = index;
if (acfg->aot_opts.print_skipped_methods)
printf ("Skip (abs call): %s\n", mono_method_get_full_name (method));
InterlockedIncrement (&acfg->stats.abscount);
- mono_destroy_compile (cfg);
return;
}
if (acfg->aot_opts.print_skipped_methods)
printf ("Skip (patches): %s\n", mono_method_get_full_name (method));
acfg->stats.ocount++;
- mono_destroy_compile (cfg);
mono_acfg_unlock (acfg);
return;
}
locals [i] = (MonoInst *)mono_mempool_alloc (acfg->mempool, sizeof (MonoInst));
memcpy (locals [i], cfg->locals [i], sizeof (MonoInst));
}
+ mono_metadata_free_mh (header);
cfg->locals = locals;
}
/* Free some fields used by cfg to conserve memory */
- mono_mempool_destroy (cfg->mempool);
- cfg->mempool = NULL;
- g_free (cfg->varinfo);
- cfg->varinfo = NULL;
- g_free (cfg->vars);
- cfg->vars = NULL;
- if (cfg->rs) {
- mono_regstate_free (cfg->rs);
- cfg->rs = NULL;
- }
+ mono_empty_compile (cfg);
//printf ("Compile: %s\n", mono_method_full_name (method, TRUE));
opts = g_strdup ("");
else
#if LLVM_API_VERSION > 100
- opts = g_strdup ("-O2");
+ opts = g_strdup ("-O2 -disable-tail-calls");
#else
opts = g_strdup ("-targetlibinfo -no-aa -basicaa -notti -instcombine -simplifycfg -inline-cost -inline -sroa -domtree -early-cse -lazy-value-info -correlated-propagation -simplifycfg -instcombine -simplifycfg -reassociate -domtree -loops -loop-simplify -lcssa -loop-rotate -licm -lcssa -loop-unswitch -instcombine -scalar-evolution -loop-simplify -lcssa -indvars -loop-idiom -loop-deletion -loop-unroll -memdep -gvn -memdep -memcpyopt -sccp -instcombine -lazy-value-info -correlated-propagation -domtree -memdep -adce -simplifycfg -instcombine -strip-dead-prototypes -domtree -verify");
#endif
if (acfg->aot_opts.llvm_only) {
/* Use the stock clang from xcode */
// FIXME: arch
- command = g_strdup_printf ("clang -march=x86-64 -fpic -msse -msse2 -msse3 -msse4 -O2 -fno-optimize-sibling-calls -Wno-override-module -c -o \"%s\" \"%s.opt.bc\"", acfg->llvm_ofile, acfg->tmpbasename);
+ command = g_strdup_printf ("clang++ -fexceptions -march=x86-64 -fpic -msse -msse2 -msse3 -msse4 -O2 -fno-optimize-sibling-calls -Wno-override-module -c -o \"%s\" \"%s.opt.bc\"", acfg->llvm_ofile, acfg->tmpbasename);
aot_printf (acfg, "Executing clang: %s\n", command);
if (execute_system (command) != 0)
g_ptr_array_add (table, new_entry);
}
}
+ g_free (chain_lengths);
//printf ("MAX: %d\n", max_chain_length);
/* Emit the table */
emit_aot_data (acfg, MONO_AOT_TABLE_EXTRA_METHOD_TABLE, "extra_method_table", buf, p - buf);
+ g_free (buf);
+
/*
* Emit a table reverse mapping method indexes to their index in extra_method_info.
* This is used by mono_aot_find_jit_info ().
encode_int (info_offsets [i], p, &p);
}
emit_aot_data (acfg, MONO_AOT_TABLE_EXTRA_METHOD_INFO_OFFSETS, "extra_method_info_offsets", buf, p - buf);
+
+ g_free (buf);
+ g_free (info_offsets);
+ g_ptr_array_free (table, TRUE);
}
static void
else
encode_int16 (0, p, &p);
}
+ g_free (entry);
}
g_assert (p - buf <= buf_size);
+ g_ptr_array_free (table, TRUE);
emit_aot_data (acfg, MONO_AOT_TABLE_CLASS_NAME, "class_name_table", buf, p - buf);
+
+ g_free (buf);
}
static void
wrap_path (g_strdup_printf ("%s.o", acfg->tmpfname)), ld_flags);
#else
// Default (linux)
- command = g_strdup_printf ("\"%sld\" %s -shared -o %s %s %s %s", tool_prefix, LD_OPTIONS,
+ char *args = g_strdup_printf ("%s %s -shared -o %s %s %s %s", tool_prefix, LD_OPTIONS,
wrap_path (tmp_outfile_name), wrap_path (llvm_ofile),
wrap_path (g_strdup_printf ("%s.o", acfg->tmpfname)), ld_flags);
+
+ if (acfg->llvm) {
+ command = g_strdup_printf ("clang++ %s", args);
+ } else {
+ command = g_strdup_printf ("\"%sld\" %s", tool_prefix, args);
+ }
+ g_free (args);
+
#endif
aot_printf (acfg, "Executing the native linker: %s\n", command);
if (execute_system (command) != 0) {
mono_img_writer_destroy (acfg->w);
for (i = 0; i < acfg->nmethods; ++i)
if (acfg->cfgs [i])
- g_free (acfg->cfgs [i]);
+ mono_destroy_compile (acfg->cfgs [i]);
+
g_free (acfg->cfgs);
+
g_free (acfg->static_linking_symbol);
g_free (acfg->got_symbol);
g_free (acfg->plt_symbol);
gpointer
mono_aot_get_method_checked (MonoDomain *domain,
- MonoMethod *method, MonoError *error);
+ MonoMethod *method, MonoError *error)
{
mono_error_init (error);
return NULL;
gc_param_slot_liveness_def: len:0
generic_class_init: src1:A len:32 clob:c
+get_last_error: dest:i len:32
case CMD_TYPE_GET_METHODS_BY_NAME_FLAGS: {
char *name = decode_string (p, &p, end);
int i, flags = decode_int (p, &p, end);
- MonoException *ex = NULL;
- GPtrArray *array = mono_class_get_methods_by_name (klass, name, flags & ~BINDING_FLAGS_IGNORE_CASE, (flags & BINDING_FLAGS_IGNORE_CASE) != 0, TRUE, &ex);
+ MonoError error;
+ GPtrArray *array;
- if (!array)
+ mono_error_init (&error);
+ array = mono_class_get_methods_by_name (klass, name, flags & ~BINDING_FLAGS_IGNORE_CASE, (flags & BINDING_FLAGS_IGNORE_CASE) != 0, TRUE, &error);
+ if (!is_ok (&error)) {
+ mono_error_cleanup (&error);
return ERR_LOADER_ERROR;
+ }
buffer_add_int (buf, array->len);
for (i = 0; i < array->len; ++i) {
MonoMethod *method = (MonoMethod *)g_ptr_array_index (array, i);
gboolean cost_driven;
if (!cfg->disable_reuse_registers && vars && (((MonoMethodVar*)vars->data)->interval != NULL)) {
- mono_linear_scan2 (cfg, vars, regs, used_mask);
- return;
- }
+ mono_linear_scan2 (cfg, vars, regs, used_mask);
+ g_list_free (regs);
+ g_list_free (vars);
+ return;
+ }
cost_driven = TRUE;
g_assert_not_reached ();
}
+gpointer
+mono_llvm_compile_method (MonoEERef mono_ee, LLVMValueRef method, int nvars, LLVMValueRef *callee_vars, gpointer *callee_addrs, gpointer *eh_frame)
+{
+ g_assert_not_reached ();
+ return NULL;
+}
+
void
mono_llvm_dispose_ee (MonoEERef *eeref)
{
GHashTable *prev_cbb_hash;
MonoBasicBlock **prev_cil_offset_to_bb;
MonoBasicBlock *prev_cbb;
- unsigned char* prev_cil_start;
+ const unsigned char *prev_ip;
+ unsigned char *prev_cil_start;
guint32 prev_cil_offset_to_bb_len;
MonoMethod *prev_current_method;
MonoGenericContext *prev_generic_context;
prev_cil_offset_to_bb = cfg->cil_offset_to_bb;
prev_cil_offset_to_bb_len = cfg->cil_offset_to_bb_len;
prev_cil_start = cfg->cil_start;
+ prev_ip = cfg->ip;
prev_cbb = cfg->cbb;
prev_current_method = cfg->current_method;
prev_generic_context = cfg->generic_context;
cfg->cil_offset_to_bb = prev_cil_offset_to_bb;
cfg->cil_offset_to_bb_len = prev_cil_offset_to_bb_len;
cfg->cil_start = prev_cil_start;
+ cfg->ip = prev_ip;
cfg->locals = prev_locals;
cfg->args = prev_args;
cfg->arg_types = prev_arg_types;
if (!header) {
mono_cfg_set_exception (cfg, MONO_EXCEPTION_MONO_ERROR);
goto exception_exit;
+ } else {
+ cfg->headers_to_free = g_slist_prepend_mempool (cfg->mempool, cfg->headers_to_free, header);
}
+
generic_container = mono_method_get_generic_container (method);
sig = mono_method_signature (method);
num_args = sig->hasthis + sig->param_count;
}
case CEE_THROW:
CHECK_STACK (1);
+ if (sp [-1]->type != STACK_OBJ)
+ UNVERIFIED;
+
MONO_INST_NEW (cfg, ins, OP_THROW);
--sp;
ins->sreg1 = sp [0]->dreg;
case CEE_MONO_LDDOMAIN:
CHECK_STACK_OVF (1);
EMIT_NEW_PCONST (cfg, ins, cfg->compile_aot ? NULL : cfg->domain);
+ ip += 2;
+ *sp++ = ins;
+ break;
+ case CEE_MONO_GET_LAST_ERROR:
+ CHECK_OPSIZE (2);
+ CHECK_STACK_OVF (1);
+
+ MONO_INST_NEW (cfg, ins, OP_GET_LAST_ERROR);
+ ins->dreg = alloc_dreg (cfg, STACK_I4);
+ ins->type = STACK_I4;
+ MONO_ADD_INS (cfg->cbb, ins);
+
ip += 2;
*sp++ = ins;
break;
g_slist_free (class_inits);
mono_basic_block_free (original_bb);
cfg->dont_inline = g_list_remove (cfg->dont_inline, method);
- cfg->headers_to_free = g_slist_prepend_mempool (cfg->mempool, cfg->headers_to_free, header);
if (cfg->exception_type)
return -1;
else
case ArgOnStack: return "ArgOnStack";
case ArgValuetypeInReg: return "ArgValuetypeInReg";
case ArgValuetypeAddrInIReg: return "ArgValuetypeAddrInIReg";
+ case ArgValuetypeAddrOnStack: return "ArgValuetypeAddrOnStack";
case ArgGSharedVtInReg: return "ArgGSharedVtInReg";
case ArgGSharedVtOnStack: return "ArgGSharedVtOnStack";
case ArgNone: return "ArgNone";
src = g_malloc (nsrc * sizeof (int));
src [0] = map_freg (sreg);
break;
+ case ArgValuetypeAddrInIReg:
+ nsrc = 1;
+ src = g_malloc (nsrc * sizeof (int));
+ src [0] = map_reg (ainfo->pair_regs [0]);
+ break;
+ case ArgValuetypeAddrOnStack:
+ nsrc = 1;
+ src = g_malloc (nsrc * sizeof (int));
+ // is_source_argument adds 2 because we're skipping over the old BBP and the return address
+ // XXX this is a very fragile setup as changes in alignment for the caller reg array can cause the magic number be 3
+ src [0] = map_stack_slot (sslot + (is_source_argument ? 2 : 0));
+ break;
default:
NOT_IMPLEMENTED;
break;
*arg_marshal = GSHAREDVT_ARG_BYREF_TO_BYVAL;
*arg_slots = dst_info->nregs;
break;
+ case ArgValuetypeAddrInIReg:
+ case ArgValuetypeAddrOnStack:
+ *arg_marshal = GSHAREDVT_ARG_NONE;
+ *arg_slots = dst_info->nregs;
+ break;
default:
NOT_IMPLEMENTED; // Inappropriate value: if dst and src are gsharedvt at once, we shouldn't be here
break;
case ArgOnStack:
*arg_marshal = GSHAREDVT_ARG_BYVAL_TO_BYREF;
break;
+ case ArgValuetypeAddrInIReg:
+ case ArgValuetypeAddrOnStack:
+ *arg_marshal = GSHAREDVT_ARG_NONE;
+ break;
default:
NOT_IMPLEMENTED; // See above
break;
handle_marshal_when_src_gsharedvt (dst_info, &arg_marshal, &arg_slots);
handle_map_when_gsharedvt_on_stack (src_info, &nsrc, &src, TRUE);
break;
+ case ArgValuetypeAddrInIReg:
+ case ArgValuetypeAddrOnStack:
+ nsrc = get_arg_slots (src_info, &src, TRUE);
+ break;
default:
g_error ("Gsharedvt can't handle source arg type %d", (int)src_info->storage); // Inappropriate value: ArgValuetypeAddrInIReg is for returns only
}
handle_marshal_when_dst_gsharedvt (src_info, &arg_marshal);
handle_map_when_gsharedvt_on_stack (dst_info, &ndst, &dst, FALSE);
break;
+ case ArgValuetypeAddrInIReg:
+ case ArgValuetypeAddrOnStack:
+ ndst = get_arg_slots (dst_info, &dst, FALSE);
+ break;
default:
g_error ("Gsharedvt can't handle dest arg type %d", (int)dst_info->storage); // See above
}
info->stack_usage = ALIGN_TO (info->stack_usage, MONO_ARCH_FRAME_ALIGNMENT);
+ g_free (callee_cinfo);
+ g_free (caller_cinfo);
+
DEBUG_AMD64_GSHAREDVT_PRINT ("allocated an info at %p stack usage %d\n", info, info->stack_usage);
return info;
}
* Dietmar Maurer (dietmar@ximian.com)
* Patrik Torstensson
* Zoltan Varga (vargaz@gmail.com)
+ * Johan Lorensson (lateralusx.github@gmail.com)
*
* (C) 2003 Ximian, Inc.
* Copyright 2003-2011 Novell, Inc (http://www.novell.com)
}
#ifdef TARGET_WIN32
-static void
-add_valuetype_win64 (MonoMethodSignature *sig, ArgInfo *ainfo, MonoType *type,
- gboolean is_return,
- guint32 *gr, guint32 *fr, guint32 *stack_size)
-{
- guint32 size, i, nfields;
- guint32 argsize = 8;
- ArgumentClass arg_class;
- MonoMarshalType *info = NULL;
- StructFieldInfo *fields = NULL;
- MonoClass *klass;
- gboolean pass_on_stack = FALSE;
- klass = mono_class_from_mono_type (type);
- size = mini_type_stack_size_full (&klass->byval_arg, NULL, sig->pinvoke);
+/* Windows x64 ABI can pass/return value types in register of size 1,2,4,8 bytes. */
+#define MONO_WIN64_VALUE_TYPE_FITS_REG(arg_size) (arg_size <= SIZEOF_REGISTER && (arg_size == 1 || arg_size == 2 || arg_size == 4 || arg_size == 8))
- /*
- * Standard C and C++ doesn't allow empty structs, empty structs will always have a size of 1 byte.
- * GCC have an extension to allow empty structs, https://gcc.gnu.org/onlinedocs/gcc/Empty-Structures.html.
- * This cause a little dilemma since runtime build using none GCC compiler will not be compatible with
- * GCC build C libraries and the other way around. On platforms where empty structs has size of 1 byte
- * it must be represented in call and cannot be dropped.
- */
- if (0 == size && MONO_TYPE_ISSTRUCT (type) && sig->pinvoke)
- ainfo->pass_empty_struct = TRUE;
-
- if (!sig->pinvoke)
- pass_on_stack = TRUE;
+static gboolean
+allocate_register_for_valuetype_win64 (ArgInfo *arg_info, ArgumentClass arg_class, guint32 arg_size, AMD64_Reg_No int_regs [], int int_reg_count, AMD64_Reg_No float_regs [], int float_reg_count, guint32 *current_int_reg, guint32 *current_float_reg)
+{
+ gboolean result = FALSE;
- /* If this struct can't be split up naturally into 8-byte */
- /* chunks (registers), pass it on the stack. */
- if (sig->pinvoke && !pass_on_stack) {
- guint32 align;
- guint32 field_size;
+ assert (arg_info != NULL && int_regs != NULL && float_regs != NULL && current_int_reg != NULL && current_float_reg != NULL);
+ assert (arg_info->storage == ArgValuetypeInReg || arg_info->storage == ArgValuetypeAddrInIReg);
- info = mono_marshal_load_type_info (klass);
- g_assert (info);
+ arg_info->pair_storage [0] = arg_info->pair_storage [1] = ArgNone;
+ arg_info->pair_regs [0] = arg_info->pair_regs [1] = ArgNone;
+ arg_info->pair_size [0] = 0;
+ arg_info->pair_size [1] = 0;
+ arg_info->nregs = 0;
- /*
- * Collect field information recursively to be able to
- * handle nested structures.
- */
- nfields = count_fields_nested (klass, sig->pinvoke);
- fields = g_new0 (StructFieldInfo, nfields);
- collect_field_info_nested (klass, fields, 0, 0, sig->pinvoke, klass->unicode);
+ if (arg_class == ARG_CLASS_INTEGER && *current_int_reg < int_reg_count) {
+ /* Pass parameter in integer register. */
+ arg_info->pair_storage [0] = ArgInIReg;
+ arg_info->pair_regs [0] = int_regs [*current_int_reg];
+ (*current_int_reg) ++;
+ result = TRUE;
+ } else if (arg_class == ARG_CLASS_SSE && *current_float_reg < float_reg_count) {
+ /* Pass parameter in float register. */
+ arg_info->pair_storage [0] = (arg_size <= sizeof (gfloat)) ? ArgInFloatSSEReg : ArgInDoubleSSEReg;
+ arg_info->pair_regs [0] = float_regs [*current_float_reg];
+ (*current_float_reg) ++;
+ result = TRUE;
+ }
- for (i = 0; i < nfields; ++i) {
- if ((fields [i].offset < 8) && (fields [i].offset + fields [i].size) > 8) {
- pass_on_stack = TRUE;
- break;
- }
- }
+ if (result == TRUE) {
+ arg_info->pair_size [0] = arg_size;
+ arg_info->nregs = 1;
}
- if (pass_on_stack) {
- /* Allways pass in memory */
- ainfo->offset = *stack_size;
- *stack_size += ALIGN_TO (size, 8);
- ainfo->storage = is_return ? ArgValuetypeAddrInIReg : ArgOnStack;
- if (!is_return)
- ainfo->arg_size = ALIGN_TO (size, 8);
+ return result;
+}
- g_free (fields);
- return;
- }
+inline gboolean
+allocate_parameter_register_for_valuetype_win64 (ArgInfo *arg_info, ArgumentClass arg_class, guint32 arg_size, guint32 *current_int_reg, guint32 *current_float_reg)
+{
+ return allocate_register_for_valuetype_win64 (arg_info, arg_class, arg_size, param_regs, PARAM_REGS, float_param_regs, FLOAT_PARAM_REGS, current_int_reg, current_float_reg);
+}
- if (!sig->pinvoke) {
- int n = mono_class_value_size (klass, NULL);
+inline gboolean
+allocate_return_register_for_valuetype_win64 (ArgInfo *arg_info, ArgumentClass arg_class, guint32 arg_size, guint32 *current_int_reg, guint32 *current_float_reg)
+{
+ return allocate_register_for_valuetype_win64 (arg_info, arg_class, arg_size, return_regs, RETURN_REGS, float_return_regs, FLOAT_RETURN_REGS, current_int_reg, current_float_reg);
+}
- argsize = n;
+static void
+allocate_storage_for_valuetype_win64 (ArgInfo *arg_info, MonoType *type, gboolean is_return, ArgumentClass arg_class,
+ guint32 arg_size, guint32 *current_int_reg, guint32 *current_float_reg, guint32 *stack_size)
+{
+ /* Windows x64 value type ABI.
+ *
+ * Parameters: https://msdn.microsoft.com/en-us/library/zthk2dkh.aspx
+ *
+ * Integer/Float types smaller than or equals to 8 bytes or porperly sized struct/union (1,2,4,8)
+ * Try pass in register using ArgValuetypeInReg/(ArgInIReg|ArgInFloatSSEReg|ArgInDoubleSSEReg) as storage and size of parameter(1,2,4,8), if no more registers, pass on stack using ArgOnStack as storage and size of parameter(1,2,4,8).
+ * Integer/Float types bigger than 8 bytes or struct/unions larger than 8 bytes or (3,5,6,7).
+ * Try to pass pointer in register using ArgValuetypeAddrInIReg, if no more registers, pass pointer on stack using ArgValuetypeAddrOnStack as storage and parameter size of register (8 bytes).
+ *
+ * Return values: https://msdn.microsoft.com/en-us/library/7572ztz4.aspx.
+ *
+ * Integers/Float types smaller than or equal to 8 bytes
+ * Return in corresponding register RAX/XMM0 using ArgValuetypeInReg/(ArgInIReg|ArgInFloatSSEReg|ArgInDoubleSSEReg) as storage and size of parameter(1,2,4,8).
+ * Properly sized struct/unions (1,2,4,8)
+ * Return in register RAX using ArgValuetypeInReg as storage and size of parameter(1,2,4,8).
+ * Types bigger than 8 bytes or struct/unions larger than 8 bytes or (3,5,6,7).
+ * Return pointer to allocated stack space (allocated by caller) using ArgValuetypeAddrInIReg as storage and parameter size.
+ */
- if (n > 8)
- arg_class = ARG_CLASS_MEMORY;
- else
- /* Always pass in 1 integer register */
- arg_class = ARG_CLASS_INTEGER;
- } else {
- g_assert (info);
+ assert (arg_info != NULL && type != NULL && current_int_reg != NULL && current_float_reg != NULL && stack_size != NULL);
- /*Only drop value type if its not an empty struct as input that must be represented in call*/
- if ((!fields && !ainfo->pass_empty_struct) || (!fields && ainfo->pass_empty_struct && is_return)) {
- ainfo->storage = ArgValuetypeInReg;
- ainfo->pair_storage [0] = ainfo->pair_storage [1] = ArgNone;
- return;
- }
+ if (!is_return) {
- switch (info->native_size) {
- case 0:
- g_assert (!fields && MONO_TYPE_ISSTRUCT (type) && !is_return);
- break;
- case 1: case 2: case 4: case 8:
- break;
- default:
- if (is_return) {
- ainfo->storage = ArgValuetypeAddrInIReg;
- ainfo->offset = *stack_size;
- *stack_size += ALIGN_TO (info->native_size, 8);
- }
- else {
- ainfo->storage = ArgValuetypeAddrInIReg;
+ /* Parameter cases. */
+ if (arg_class != ARG_CLASS_MEMORY && MONO_WIN64_VALUE_TYPE_FITS_REG (arg_size)) {
+ assert (arg_size == 1 || arg_size == 2 || arg_size == 4 || arg_size == 8);
- if (*gr < PARAM_REGS) {
- ainfo->pair_storage [0] = ArgInIReg;
- ainfo->pair_regs [0] = param_regs [*gr];
- (*gr) ++;
- }
- else {
- ainfo->pair_storage [0] = ArgOnStack;
- ainfo->offset = *stack_size;
- ainfo->arg_size = sizeof (mgreg_t);
- *stack_size += 8;
- }
+ /* First, try to use registers for parameter. If type is struct it can only be passed by value in integer register. */
+ arg_info->storage = ArgValuetypeInReg;
+ if (!allocate_parameter_register_for_valuetype_win64 (arg_info, !MONO_TYPE_ISSTRUCT (type) ? arg_class : ARG_CLASS_INTEGER, arg_size, current_int_reg, current_float_reg)) {
+ /* No more registers, fallback passing parameter on stack as value. */
+ assert (arg_info->pair_storage [0] == ArgNone && arg_info->pair_storage [1] == ArgNone && arg_info->pair_size [0] == 0 && arg_info->pair_size [1] == 0 && arg_info->nregs == 0);
+
+ /* Passing value directly on stack, so use size of value. */
+ arg_info->storage = ArgOnStack;
+ arg_size = ALIGN_TO (arg_size, sizeof (mgreg_t));
+ arg_info->offset = *stack_size;
+ arg_info->arg_size = arg_size;
+ *stack_size += arg_size;
+ }
+ } else {
+ /* Fallback to stack, try to pass address to parameter in register. Always use integer register to represent stack address. */
+ arg_info->storage = ArgValuetypeAddrInIReg;
+ if (!allocate_parameter_register_for_valuetype_win64 (arg_info, ARG_CLASS_INTEGER, arg_size, current_int_reg, current_float_reg)) {
+ /* No more registers, fallback passing address to parameter on stack. */
+ assert (arg_info->pair_storage [0] == ArgNone && arg_info->pair_storage [1] == ArgNone && arg_info->pair_size [0] == 0 && arg_info->pair_size [1] == 0 && arg_info->nregs == 0);
+
+ /* Passing an address to value on stack, so use size of register as argument size. */
+ arg_info->storage = ArgValuetypeAddrOnStack;
+ arg_size = sizeof (mgreg_t);
+ arg_info->offset = *stack_size;
+ arg_info->arg_size = arg_size;
+ *stack_size += arg_size;
}
-
- g_free (fields);
- return;
}
+ } else {
+ /* Return value cases. */
+ if (arg_class != ARG_CLASS_MEMORY && MONO_WIN64_VALUE_TYPE_FITS_REG (arg_size)) {
+ assert (arg_size == 1 || arg_size == 2 || arg_size == 4 || arg_size == 8);
- int size;
- guint32 align;
- ArgumentClass class1;
+ /* Return value fits into return registers. If type is struct it can only be returned by value in integer register. */
+ arg_info->storage = ArgValuetypeInReg;
+ allocate_return_register_for_valuetype_win64 (arg_info, !MONO_TYPE_ISSTRUCT (type) ? arg_class : ARG_CLASS_INTEGER, arg_size, current_int_reg, current_float_reg);
- if (nfields == 0 && ainfo->pass_empty_struct) {
- g_assert (!fields && !is_return);
- class1 = ARG_CLASS_INTEGER;
- }
- else if (nfields == 0)
- class1 = ARG_CLASS_MEMORY;
- else
- class1 = ARG_CLASS_NO_CLASS;
- for (i = 0; i < nfields; ++i) {
- /* How far into this quad this data extends.*/
- /* (8 is size of quad) */
- argsize = fields [i].offset + fields [i].size;
+ /* Only RAX/XMM0 should be used to return valuetype. */
+ assert ((arg_info->pair_regs[0] == AMD64_RAX && arg_info->pair_regs[1] == ArgNone) || (arg_info->pair_regs[0] == AMD64_XMM0 && arg_info->pair_regs[1] == ArgNone));
+ } else {
+ /* Return value doesn't fit into return register, return address to allocated stack space (allocated by caller and passed as input). */
+ arg_info->storage = ArgValuetypeAddrInIReg;
+ allocate_return_register_for_valuetype_win64 (arg_info, ARG_CLASS_INTEGER, arg_size, current_int_reg, current_float_reg);
+
+ /* Only RAX should be used to return valuetype address. */
+ assert (arg_info->pair_regs[0] == AMD64_RAX && arg_info->pair_regs[1] == ArgNone);
- class1 = merge_argument_class_from_type (fields [i].type, class1);
+ arg_size = ALIGN_TO (arg_size, sizeof (mgreg_t));
+ arg_info->offset = *stack_size;
+ *stack_size += arg_size;
}
- g_assert (class1 != ARG_CLASS_NO_CLASS);
- arg_class = class1;
}
+}
- g_free (fields);
+static void
+get_valuetype_size_win64 (MonoClass *klass, gboolean pinvoke, ArgInfo *arg_info, MonoType *type, ArgumentClass *arg_class, guint32 *arg_size)
+{
+ *arg_size = 0;
+ *arg_class = ARG_CLASS_NO_CLASS;
- /* Allocate registers */
- {
- int orig_gr = *gr;
- int orig_fr = *fr;
+ assert (klass != NULL && arg_info != NULL && type != NULL && arg_class != NULL && arg_size != NULL);
+
+ if (pinvoke) {
+ /* Calculate argument class type and size of marshalled type. */
+ MonoMarshalType *info = mono_marshal_load_type_info (klass);
+ *arg_size = info->native_size;
+ } else {
+ /* Calculate argument class type and size of managed type. */
+ *arg_size = mono_class_value_size (klass, NULL);
+ }
- while (argsize != 1 && argsize != 2 && argsize != 4 && argsize != 8)
- argsize ++;
+ /* Windows ABI only handle value types on stack or passed in integer register (if it fits register size). */
+ *arg_class = MONO_WIN64_VALUE_TYPE_FITS_REG (*arg_size) ? ARG_CLASS_INTEGER : ARG_CLASS_MEMORY;
- ainfo->storage = ArgValuetypeInReg;
- ainfo->pair_storage [0] = ainfo->pair_storage [1] = ArgNone;
- ainfo->pair_size [0] = argsize;
- ainfo->pair_size [1] = 0;
- ainfo->nregs = 1;
- switch (arg_class) {
- case ARG_CLASS_INTEGER:
- if (*gr >= PARAM_REGS)
- arg_class = ARG_CLASS_MEMORY;
- else {
- ainfo->pair_storage [0] = ArgInIReg;
- if (is_return)
- ainfo->pair_regs [0] = return_regs [*gr];
- else
- ainfo->pair_regs [0] = param_regs [*gr];
- (*gr) ++;
- }
- break;
- case ARG_CLASS_SSE:
- if (*fr >= FLOAT_PARAM_REGS)
- arg_class = ARG_CLASS_MEMORY;
- else {
- if (argsize <= 4)
- ainfo->pair_storage [0] = ArgInFloatSSEReg;
- else
- ainfo->pair_storage [0] = ArgInDoubleSSEReg;
- ainfo->pair_regs [0] = *fr;
- (*fr) ++;
- }
- break;
- case ARG_CLASS_MEMORY:
- break;
- default:
- g_assert_not_reached ();
- }
+ if (*arg_class == ARG_CLASS_MEMORY) {
+ /* Value type has a size that doesn't seem to fit register according to ABI. Try to used full stack size of type. */
+ *arg_size = mini_type_stack_size_full (&klass->byval_arg, NULL, pinvoke);
+ }
- if (arg_class == ARG_CLASS_MEMORY) {
- /* Revert possible register assignments */
- *gr = orig_gr;
- *fr = orig_fr;
+ /*
+ * Standard C and C++ doesn't allow empty structs, empty structs will always have a size of 1 byte.
+ * GCC have an extension to allow empty structs, https://gcc.gnu.org/onlinedocs/gcc/Empty-Structures.html.
+ * This cause a little dilemma since runtime build using none GCC compiler will not be compatible with
+ * GCC build C libraries and the other way around. On platforms where empty structs has size of 1 byte
+ * it must be represented in call and cannot be dropped.
+ */
+ if (*arg_size == 0 && MONO_TYPE_ISSTRUCT (type)) {
+ arg_info->pass_empty_struct = TRUE;
+ *arg_size = SIZEOF_REGISTER;
+ *arg_class = ARG_CLASS_INTEGER;
+ }
- ainfo->offset = *stack_size;
- *stack_size += sizeof (mgreg_t);
- ainfo->storage = is_return ? ArgValuetypeAddrInIReg : ArgOnStack;
- if (!is_return)
- ainfo->arg_size = sizeof (mgreg_t);
- }
+ assert (*arg_class != ARG_CLASS_NO_CLASS);
+}
+
+static void
+add_valuetype_win64 (MonoMethodSignature *signature, ArgInfo *arg_info, MonoType *type,
+ gboolean is_return, guint32 *current_int_reg, guint32 *current_float_reg, guint32 *stack_size)
+{
+ guint32 arg_size = SIZEOF_REGISTER;
+ MonoClass *klass = NULL;
+ ArgumentClass arg_class;
+
+ assert (signature != NULL && arg_info != NULL && type != NULL && current_int_reg != NULL && current_float_reg != NULL && stack_size != NULL);
+
+ klass = mono_class_from_mono_type (type);
+ get_valuetype_size_win64 (klass, signature->pinvoke, arg_info, type, &arg_class, &arg_size);
+
+ /* Only drop value type if its not an empty struct as input that must be represented in call */
+ if ((arg_size == 0 && !arg_info->pass_empty_struct) || (arg_size == 0 && arg_info->pass_empty_struct && is_return)) {
+ arg_info->storage = ArgValuetypeInReg;
+ arg_info->pair_storage [0] = arg_info->pair_storage [1] = ArgNone;
+ } else {
+ /* Alocate storage for value type. */
+ allocate_storage_for_valuetype_win64 (arg_info, type, is_return, arg_class, arg_size, current_int_reg, current_float_reg, stack_size);
}
}
+
#endif /* TARGET_WIN32 */
static void
mono_aot_register_jit_icall ("mono_amd64_throw_corlib_exception", mono_amd64_throw_corlib_exception);
mono_aot_register_jit_icall ("mono_amd64_resume_unwind", mono_amd64_resume_unwind);
mono_aot_register_jit_icall ("mono_amd64_get_original_ip", mono_amd64_get_original_ip);
+ mono_aot_register_jit_icall ("mono_amd64_handler_block_trampoline_helper", mono_amd64_handler_block_trampoline_helper);
+
#if defined(MONO_ARCH_GSHAREDVT_SUPPORTED)
mono_aot_register_jit_icall ("mono_amd64_start_gsharedvt_call", mono_amd64_start_gsharedvt_call);
#endif
*exclude_mask |= MONO_OPT_CMOV;
}
+#ifdef TARGET_WIN32
+ /* The current SIMD doesn't support the argument used by a LD_ADDR to be of type OP_VTARG_ADDR. */
+ /* This will now be used for value types > 8 or of size 3,5,6,7 as dictated by windows x64 value type ABI. */
+ /* Since OP_VTARG_ADDR needs to be resolved in mono_spill_global_vars and the SIMD implementation optimize */
+ /* away the LD_ADDR in load_simd_vreg, that will cause an error in mono_spill_global_vars since incorrect opcode */
+ /* will now have a reference to an argument that won't be fully decomposed. */
+ *exclude_mask |= MONO_OPT_SIMD;
+#endif
+
return opts;
}
for (i = 0; i < sig->param_count + sig->hasthis; ++i) {
ArgInfo *ainfo = &cinfo->args [i];
- if (ainfo->storage == ArgOnStack) {
+ if (ainfo->storage == ArgOnStack || ainfo->storage == ArgValuetypeAddrInIReg || ainfo->storage == ArgValuetypeAddrOnStack) {
/*
* The stack offset can only be determined when the frame
* size is known.
break;
case ArgValuetypeInReg:
break;
- case ArgValuetypeAddrInIReg: {
+ case ArgValuetypeAddrInIReg:
+ case ArgValuetypeAddrOnStack: {
MonoInst *indir;
g_assert (!cfg->arch.omit_fp);
-
+ g_assert (ainfo->storage == ArgValuetypeAddrInIReg || (ainfo->storage == ArgValuetypeAddrOnStack && ainfo->pair_storage [0] == ArgNone));
MONO_INST_NEW (cfg, indir, 0);
+
indir->opcode = OP_REGOFFSET;
if (ainfo->pair_storage [0] == ArgInIReg) {
indir->inst_basereg = cfg->frame_reg;
NOT_IMPLEMENTED;
}
- if (!inreg && (ainfo->storage != ArgOnStack) && (ainfo->storage != ArgValuetypeAddrInIReg) && (ainfo->storage != ArgGSharedVtOnStack)) {
+ if (!inreg && (ainfo->storage != ArgOnStack) && (ainfo->storage != ArgValuetypeAddrInIReg) && (ainfo->storage != ArgValuetypeAddrOnStack) && (ainfo->storage != ArgGSharedVtOnStack)) {
ins->opcode = OP_REGOFFSET;
ins->inst_basereg = cfg->frame_reg;
/* These arguments are saved to the stack in the prolog */
case ArgOnStack:
case ArgValuetypeInReg:
case ArgValuetypeAddrInIReg:
+ case ArgValuetypeAddrOnStack:
case ArgGSharedVtInReg:
case ArgGSharedVtOnStack: {
if (ainfo->storage == ArgOnStack && !MONO_TYPE_ISSTRUCT (t) && !call->tail_call)
}
break;
}
- case ArgValuetypeAddrInIReg: {
+ case ArgValuetypeAddrInIReg:
+ case ArgValuetypeAddrOnStack: {
MonoInst *vtaddr, *load;
+
+ g_assert (ainfo->storage == ArgValuetypeAddrInIReg || (ainfo->storage == ArgValuetypeAddrOnStack && ainfo->pair_storage [0] == ArgNone));
+
vtaddr = mono_compile_create_var (cfg, &ins->klass->byval_arg, OP_LOCAL);
MONO_INST_NEW (cfg, load, OP_LDADDR);
return code;
}
+#ifdef TARGET_WIN32
+
+#define TEB_LAST_ERROR_OFFSET 0x068
+
+static guint8*
+emit_get_last_error (guint8* code, int dreg)
+{
+ /* Threads last error value is located in TEB_LAST_ERROR_OFFSET. */
+ x86_prefix (code, X86_GS_PREFIX);
+ amd64_mov_reg_membase (code, dreg, TEB_LAST_ERROR_OFFSET, 0, sizeof (guint32));
+
+ return code;
+}
+
+#else
+
+static guint8*
+emit_get_last_error (guint8* code, int dreg)
+{
+ g_assert_not_reached ();
+}
+
+#endif
+
/* benchmark and set based on cpu */
#define LOOP_ALIGNMENT 8
#define bb_is_loop_start(bb) ((bb)->loop_body_start && (bb)->nesting)
ins->backend.pc_offset = code - cfg->native_code;
bb->spill_slot_defs = g_slist_prepend_mempool (cfg->mempool, bb->spill_slot_defs, ins);
break;
+ case OP_GET_LAST_ERROR:
+ emit_get_last_error(code, ins->dreg);
+ break;
default:
g_warning ("unknown opcode %s in %s()\n", mono_inst_name (ins->opcode), __FUNCTION__);
g_assert_not_reached ();
if (ainfo->pair_storage [0] == ArgInIReg)
amd64_mov_membase_reg (code, ins->inst_left->inst_basereg, ins->inst_left->inst_offset, ainfo->pair_regs [0], sizeof (gpointer));
break;
+ case ArgValuetypeAddrOnStack:
+ break;
case ArgGSharedVtInReg:
amd64_mov_membase_reg (code, ins->inst_basereg, ins->inst_offset, ainfo->reg, 8);
break;
amd64_jump_membase (code, AMD64_RAX, offset);
mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_DELEGATE_INVOKE, NULL);
- if (load_imt_reg)
- tramp_name = g_strdup_printf ("delegate_virtual_invoke_imt_%d", - offset / sizeof (gpointer));
- else
- tramp_name = g_strdup_printf ("delegate_virtual_invoke_%d", offset / sizeof (gpointer));
+ tramp_name = mono_get_delegate_virtual_invoke_impl_name (load_imt_reg, offset);
*info = mono_tramp_info_create (tramp_name, start, code - start, NULL, unwind_ops);
g_free (tramp_name);
res = g_slist_prepend (res, info);
}
- for (i = 0; i <= MAX_VIRTUAL_DELEGATE_OFFSET; ++i) {
+ for (i = 1; i <= MONO_IMT_SIZE; ++i) {
get_delegate_virtual_invoke_impl (&info, TRUE, - i * SIZEOF_VOID_P);
res = g_slist_prepend (res, info);
+ }
+ for (i = 0; i <= MAX_VIRTUAL_DELEGATE_OFFSET; ++i) {
get_delegate_virtual_invoke_impl (&info, FALSE, i * SIZEOF_VOID_P);
res = g_slist_prepend (res, info);
+ get_delegate_virtual_invoke_impl (&info, TRUE, i * SIZEOF_VOID_P);
+ res = g_slist_prepend (res, info);
}
return res;
} MonoCompileArch;
#ifdef TARGET_WIN32
-#define PARAM_REGS 4
-#define FLOAT_PARAM_REGS 4
static AMD64_Reg_No param_regs [] = { AMD64_RCX, AMD64_RDX, AMD64_R8, AMD64_R9 };
-static AMD64_Reg_No return_regs [] = { AMD64_RAX, AMD64_RDX };
+static AMD64_Reg_No float_param_regs [] = { AMD64_XMM0, AMD64_XMM1, AMD64_XMM2, AMD64_XMM3 };
+
+static AMD64_Reg_No return_regs [] = { AMD64_RAX };
+
+static AMD64_Reg_No float_return_regs [] = { AMD64_XMM0 };
+
+#define PARAM_REGS G_N_ELEMENTS(param_regs)
+#define FLOAT_PARAM_REGS G_N_ELEMENTS(float_param_regs)
+#define RETURN_REGS G_N_ELEMENTS(return_regs)
+#define FLOAT_RETURN_REGS G_N_ELEMENTS(float_return_regs)
+
#else
#define PARAM_REGS 6
#define FLOAT_PARAM_REGS 8
ArgOnStack,
ArgValuetypeInReg,
ArgValuetypeAddrInIReg,
+ ArgValuetypeAddrOnStack,
/* gsharedvt argument passed by addr */
ArgGSharedVtInReg,
ArgGSharedVtOnStack,
#define MONO_ARCH_LLVM_SUPPORTED 1
#define MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD 1
+#define MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD_AOT 1
#define MONO_ARCH_HAVE_CARD_TABLE_WBARRIER 1
#define MONO_ARCH_HAVE_SETUP_RESUME_FROM_SIGNAL_HANDLER_CTX 1
#define MONO_ARCH_GC_MAPS_SUPPORTED 1
int
mono_amd64_get_tls_gs_offset (void) MONO_LLVM_INTERNAL;
+gpointer
+mono_amd64_handler_block_trampoline_helper (void);
+
#ifdef TARGET_WIN32
void mono_arch_unwindinfo_add_push_nonvol (gpointer* monoui, gpointer codebegin, gpointer nextip, guchar reg );
/*
* Finds the bottom handler block running and install a block guard if needed.
- * FIXME add full-aot support.
*/
gboolean
mono_install_handler_block_guard (MonoThreadUnwindState *ctx)
MonoJitTlsData *jit_tls = (MonoJitTlsData *)ctx->unwind_data [MONO_UNWIND_DATA_JIT_TLS];
gpointer resume_ip;
- /* FIXME */
+#ifndef MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD_AOT
if (mono_aot_only)
return FALSE;
+#endif
/* Guard against a null MonoJitTlsData. This can happens if the thread receives the
* interrupt signal before the JIT has time to initialize its TLS data for the given thread.
unwrap<CallInst>(func)->setCallingConv (CallingConv::PreserveAll);
}
+void
+mono_llvm_set_call_notail (LLVMValueRef func)
+{
+#if LLVM_API_VERSION > 100
+ //unwrap<CallInst>(func)->setTailCallKind (CallInst::TailCallKind::TCK_NoTail);
+#endif
+}
+
#if LLVM_API_VERSION > 100
void*
}
void*
-mono_llvm_di_create_function (void *di_builder, void *cu, const char *name, const char *mangled_name, const char *dir, const char *file, int line)
+mono_llvm_di_create_function (void *di_builder, void *cu, LLVMValueRef func, const char *name, const char *mangled_name, const char *dir, const char *file, int line)
{
DIBuilder *builder = (DIBuilder*)di_builder;
DIFile *di_file;
DISubroutineType *type;
+ DISubprogram *di_func;
// FIXME: Share DIFile
di_file = builder->createFile (file, dir);
type = builder->createSubroutineType (builder->getOrCreateTypeArray (ArrayRef<Metadata*> ()));
- return builder->createFunction (di_file, name, mangled_name, di_file, line, type, true, true, 0);
+ di_func = builder->createFunction (di_file, name, mangled_name, di_file, line, type, true, true, 0);
+
+ unwrap<Function>(func)->setMetadata ("dbg", di_func);
+
+ return di_func;
}
void*
void
mono_llvm_set_call_preserveall_cc (LLVMValueRef call);
+void
+mono_llvm_set_call_notail (LLVMValueRef call);
+
_Unwind_Reason_Code
mono_debug_personality (int a, _Unwind_Action b,
uint64_t c, struct _Unwind_Exception *d, struct _Unwind_Context *e);
mono_llvm_create_di_builder (LLVMModuleRef module);
void*
-mono_llvm_di_create_function (void *di_builder, void *cu, const char *name, const char *mangled_name, const char *dir, const char *file, int line);
+mono_llvm_di_create_function (void *di_builder, void *cu, LLVMValueRef func, const char *name, const char *mangled_name, const char *dir, const char *file, int line);
void*
mono_llvm_di_create_compile_unit (void *di_builder, const char *cu_name, const char *dir, const char *producer);
return "llvm.x86.sse2.min.pd";
case OP_MINPS:
return "llvm.x86.sse.min.ps";
- case OP_PMIND_UN:
- return "llvm.x86.sse41.pminud";
- case OP_PMINW_UN:
- return "llvm.x86.sse41.pminuw";
- case OP_PMINB_UN:
- return "llvm.x86.sse2.pminu.b";
- case OP_PMINW:
- return "llvm.x86.sse2.pmins.w";
case OP_MAXPD:
return "llvm.x86.sse2.max.pd";
case OP_MAXPS:
return "llvm.x86.sse3.hsub.pd";
case OP_HSUBPS:
return "llvm.x86.sse3.hsub.ps";
- case OP_PMAXD_UN:
- return "llvm.x86.sse41.pmaxud";
- case OP_PMAXW_UN:
- return "llvm.x86.sse41.pmaxuw";
- case OP_PMAXB_UN:
- return "llvm.x86.sse2.pmaxu.b";
case OP_ADDSUBPS:
return "llvm.x86.sse3.addsub.ps";
case OP_ADDSUBPD:
return "llvm.x86.sse2.cvttpd2dq";
case OP_CVTTPS2DQ:
return "llvm.x86.sse2.cvttps2dq";
- case OP_COMPPS:
- return "llvm.x86.sse.cmp.ps";
- case OP_COMPPD:
- return "llvm.x86.sse2.cmp.pd";
case OP_PACKW:
return "llvm.x86.sse2.packsswb.128";
case OP_PACKD:
emit_volatile_load (EmitContext *ctx, int vreg)
{
MonoType *t;
+ LLVMValueRef v;
- LLVMValueRef v = LLVMBuildLoad (ctx->builder, ctx->addresses [vreg], "");
+#ifdef TARGET_ARM64
+ // FIXME: This hack is required because we pass the rgctx in a callee saved
+ // register on arm64 (x15), and llvm might keep the value in that register
+ // even through the register is marked as 'reserved' inside llvm.
+ if (ctx->cfg->rgctx_var && ctx->cfg->rgctx_var->dreg == vreg)
+ v = mono_llvm_build_load (ctx->builder, ctx->addresses [vreg], "", TRUE);
+ else
+ v = LLVMBuildLoad (ctx->builder, ctx->addresses [vreg], "");
+#else
+ v = LLVMBuildLoad (ctx->builder, ctx->addresses [vreg], "");
+#endif
t = ctx->vreg_cli_types [vreg];
if (t && !t->byref) {
/*
MonoCompile *cfg;
guint32 got_offset;
LLVMValueRef indexes [2];
- MonoJumpInfo *ji;
LLVMValueRef got_entry_addr, load;
LLVMBuilderRef builder = ctx->builder;
char *name = NULL;
cfg = ctx->cfg;
- ji = g_new0 (MonoJumpInfo, 1);
- ji->type = type;
- ji->data.target = data;
+ MonoJumpInfo tmp_ji;
+ tmp_ji.type = type;
+ tmp_ji.data.target = data;
- ji = mono_aot_patch_info_dup (ji);
+ MonoJumpInfo *ji = mono_aot_patch_info_dup (&tmp_ji);
ji->next = cfg->patch_info;
cfg->patch_info = ji;
LLVMBasicBlockRef entry_bb, fail_bb, bb, code_start_bb, code_end_bb;
LLVMBasicBlockRef *bbs;
LLVMTypeRef rtype;
- LLVMBuilderRef builder;
+ LLVMBuilderRef builder = LLVMCreateBuilder ();
char *name;
int i;
name = g_strdup_printf ("BB_CODE_START");
code_start_bb = LLVMAppendBasicBlock (func, name);
g_free (name);
- builder = LLVMCreateBuilder ();
LLVMPositionBuilderAtEnd (builder, code_start_bb);
LLVMBuildRet (builder, LLVMBuildBitCast (builder, module->code_start, rtype, ""));
name = g_strdup_printf ("BB_CODE_END");
code_end_bb = LLVMAppendBasicBlock (func, name);
g_free (name);
- builder = LLVMCreateBuilder ();
LLVMPositionBuilderAtEnd (builder, code_end_bb);
LLVMBuildRet (builder, LLVMBuildBitCast (builder, module->code_end, rtype, ""));
g_free (name);
bbs [i] = bb;
- builder = LLVMCreateBuilder ();
LLVMPositionBuilderAtEnd (builder, bb);
m = (LLVMValueRef)g_hash_table_lookup (module->idx_to_lmethod, GINT_TO_POINTER (i));
}
fail_bb = LLVMAppendBasicBlock (func, "FAIL");
- builder = LLVMCreateBuilder ();
LLVMPositionBuilderAtEnd (builder, fail_bb);
LLVMBuildRet (builder, LLVMConstNull (rtype));
- builder = LLVMCreateBuilder ();
LLVMPositionBuilderAtEnd (builder, entry_bb);
switch_ins = LLVMBuildSwitch (builder, LLVMGetParam (func, 0), fail_bb, 0);
}
mark_as_used (module, func);
+
+ LLVMDisposeBuilder (builder);
}
/*
LLVMBasicBlockRef entry_bb, fail_bb, bb;
LLVMBasicBlockRef *bbs;
LLVMTypeRef rtype;
- LLVMBuilderRef builder;
+ LLVMBuilderRef builder = LLVMCreateBuilder ();
char *name;
int i;
g_free (name);
bbs [i] = bb;
- builder = LLVMCreateBuilder ();
LLVMPositionBuilderAtEnd (builder, bb);
LLVMBuildRet (builder, LLVMBuildBitCast (builder, m, rtype, ""));
}
fail_bb = LLVMAppendBasicBlock (func, "FAIL");
- builder = LLVMCreateBuilder ();
LLVMPositionBuilderAtEnd (builder, fail_bb);
LLVMBuildRet (builder, LLVMConstNull (rtype));
- builder = LLVMCreateBuilder ();
LLVMPositionBuilderAtEnd (builder, entry_bb);
switch_ins = LLVMBuildSwitch (builder, LLVMGetParam (func, 0), fail_bb, 0);
}
mark_as_used (module, func);
+ LLVMDisposeBuilder (builder);
}
/* Add a function to mark the beginning of LLVM code */
builder = LLVMCreateBuilder ();
LLVMPositionBuilderAtEnd (builder, entry_bb);
LLVMBuildRetVoid (builder);
+ LLVMDisposeBuilder (builder);
}
static LLVMValueRef
LLVMBuildRetVoid (builder);
LLVMVerifyFunction(func, LLVMAbortProcessAction);
+ LLVMDisposeBuilder (builder);
return func;
}
builder = LLVMCreateBuilder ();
LLVMPositionBuilderAtEnd (builder, entry_bb);
LLVMBuildRetVoid (builder);
+ LLVMDisposeBuilder (builder);
}
static void
LLVMBuildRet (builder, call);
g_hash_table_insert (ctx->module->idx_to_unbox_tramp, GINT_TO_POINTER (method_index), tramp);
+ LLVMDisposeBuilder (builder);
}
/*
LLVMPositionBuilderAtEnd (builder2, entry_bb);
LLVMBuildRet (builder2, LLVMConstInt (LLVMInt32Type (), 0, FALSE));
ctx->module->personality = personality;
+ LLVMDisposeBuilder (builder2);
}
#else
static gint32 mapping_inited;
if (!var) {
LLVMValueRef indexes [16];
- LLVMValueRef name_var = LLVMAddGlobal (ctx->lmodule, LLVMArrayType (LLVMInt8Type (), strlen (name) + 1), "@OBJC_METH_VAR_NAME");
+ LLVMValueRef name_var = LLVMAddGlobal (ctx->lmodule, LLVMArrayType (LLVMInt8Type (), strlen (name) + 1), "@OBJC_METH_VAR_NAME_");
LLVMSetInitializer (name_var, mono_llvm_create_constant_data_array ((const uint8_t*)name, strlen (name) + 1));
LLVMSetLinkage (name_var, LLVMPrivateLinkage);
LLVMSetSection (name_var, "__TEXT,__objc_methname,cstring_literals");
+ mark_as_used (ctx->module, name_var);
- LLVMValueRef ref_var = LLVMAddGlobal (ctx->lmodule, LLVMPointerType (LLVMInt8Type (), 0), "@OBJC_SELECTOR_REFERENCES");
+ LLVMValueRef ref_var = LLVMAddGlobal (ctx->lmodule, LLVMPointerType (LLVMInt8Type (), 0), "@OBJC_SELECTOR_REFERENCES_");
indexes [0] = LLVMConstInt (LLVMInt32Type (), 0, 0);
indexes [1] = LLVMConstInt (LLVMInt32Type (), 0, 0);
LLVMSetExternallyInitialized (ref_var, TRUE);
LLVMSetSection (ref_var, "__DATA, __objc_selrefs, literal_pointers, no_dead_strip");
LLVMSetAlignment (ref_var, sizeof (mgreg_t));
+ mark_as_used (ctx->module, ref_var);
g_hash_table_insert (ctx->module->objc_selector_to_var, g_strdup (name), ref_var);
var = ref_var;
values [ins->dreg] = LLVMBuildBitCast (builder, v, rt, "");
break;
}
+ case OP_PMIND_UN:
+ case OP_PMINW_UN:
+ case OP_PMINB_UN: {
+ LLVMValueRef cmp = LLVMBuildICmp (builder, LLVMIntULT, lhs, rhs, "");
+ values [ins->dreg] = LLVMBuildSelect (builder, cmp, lhs, rhs, "");
+ break;
+ }
+ case OP_PMAXD_UN:
+ case OP_PMAXW_UN:
+ case OP_PMAXB_UN: {
+ LLVMValueRef cmp = LLVMBuildICmp (builder, LLVMIntUGT, lhs, rhs, "");
+ values [ins->dreg] = LLVMBuildSelect (builder, cmp, lhs, rhs, "");
+ break;
+ }
+ case OP_PMINW: {
+ LLVMValueRef cmp = LLVMBuildICmp (builder, LLVMIntSLT, lhs, rhs, "");
+ values [ins->dreg] = LLVMBuildSelect (builder, cmp, lhs, rhs, "");
+ break;
+ }
case OP_MINPD:
case OP_MINPS:
case OP_MAXPD:
case OP_MAXPS:
case OP_ADDSUBPD:
case OP_ADDSUBPS:
- case OP_PMIND_UN:
- case OP_PMINW_UN:
- case OP_PMINB_UN:
- case OP_PMINW:
- case OP_PMAXD_UN:
- case OP_PMAXW_UN:
- case OP_PMAXB_UN:
case OP_HADDPD:
case OP_HADDPS:
case OP_HSUBPD:
values [ins->dreg] = LLVMBuildInsertElement (builder, values [ins->sreg1], convert (ctx, values [ins->sreg2], LLVMDoubleType ()), LLVMConstInt (LLVMInt32Type (), ins->inst_c0, FALSE), dname);
break;
+#if 0
+ // Requires a later llvm version
+ case OP_CVTDQ2PD: {
+ LLVMValueRef indexes [16];
+
+ indexes [0] = LLVMConstInt (LLVMInt32Type (), 0, FALSE);
+ indexes [1] = LLVMConstInt (LLVMInt32Type (), 1, FALSE);
+ LLVMValueRef mask = LLVMConstVector (indexes, 2);
+ LLVMValueRef shuffle = LLVMBuildShuffleVector (builder, lhs, LLVMConstNull (LLVMTypeOf (lhs)), mask, "");
+ values [ins->dreg] = LLVMBuildSIToFP (builder, shuffle, LLVMVectorType (LLVMDoubleType (), 2), dname);
+ break;
+ }
+ case OP_CVTPS2PD: {
+ LLVMValueRef indexes [16];
+
+ indexes [0] = LLVMConstInt (LLVMInt32Type (), 0, FALSE);
+ indexes [1] = LLVMConstInt (LLVMInt32Type (), 1, FALSE);
+ LLVMValueRef mask = LLVMConstVector (indexes, 2);
+ LLVMValueRef shuffle = LLVMBuildShuffleVector (builder, lhs, LLVMConstNull (LLVMTypeOf (lhs)), mask, "");
+ values [ins->dreg] = LLVMBuildFPExt (builder, shuffle, LLVMVectorType (LLVMDoubleType (), 2), dname);
+ break;
+ }
+ case OP_CVTTPS2DQ:
+ values [ins->dreg] = LLVMBuildFPToSI (builder, lhs, LLVMVectorType (LLVMInt32Type (), 4), dname);
+ break;
+#endif
+
case OP_CVTDQ2PD:
case OP_CVTDQ2PS:
case OP_CVTPD2DQ:
values [ins->dreg] = LLVMBuildCall (builder, get_intrinsic (ctx, simd_op_to_intrins (ins->opcode)), &v, 1, dname);
break;
}
-
case OP_COMPPS:
case OP_COMPPD: {
- LLVMValueRef args [3];
+ LLVMRealPredicate op;
- args [0] = lhs;
- args [1] = rhs;
- args [2] = LLVMConstInt (LLVMInt8Type (), ins->inst_c0, FALSE);
+ switch (ins->inst_c0) {
+ case SIMD_COMP_EQ:
+ op = LLVMRealOEQ;
+ break;
+ case SIMD_COMP_LT:
+ op = LLVMRealOLT;
+ break;
+ case SIMD_COMP_LE:
+ op = LLVMRealOLE;
+ break;
+ case SIMD_COMP_UNORD:
+ op = LLVMRealUNO;
+ break;
+ case SIMD_COMP_NEQ:
+ op = LLVMRealUNE;
+ break;
+ case SIMD_COMP_NLT:
+ op = LLVMRealUGE;
+ break;
+ case SIMD_COMP_NLE:
+ op = LLVMRealUGT;
+ break;
+ case SIMD_COMP_ORD:
+ op = LLVMRealORD;
+ break;
+ default:
+ g_assert_not_reached ();
+ }
- values [ins->dreg] = LLVMBuildCall (builder, get_intrinsic (ctx, simd_op_to_intrins (ins->opcode)), args, 3, dname);
+ LLVMValueRef cmp = LLVMBuildFCmp (builder, op, lhs, rhs, "");
+ if (ins->opcode == OP_COMPPD)
+ values [ins->dreg] = LLVMBuildBitCast (builder, LLVMBuildSExt (builder, cmp, LLVMVectorType (LLVMInt64Type (), 2), ""), LLVMTypeOf (lhs), "");
+ else
+ values [ins->dreg] = LLVMBuildBitCast (builder, LLVMBuildSExt (builder, cmp, LLVMVectorType (LLVMInt32Type (), 4), ""), LLVMTypeOf (lhs), "");
break;
}
-
case OP_ICONV_TO_X:
/* This is only used for implementing shifts by non-immediate */
values [ins->dreg] = lhs;
g_hash_table_destroy (ctx->region_to_handler);
g_hash_table_destroy (ctx->clause_to_handler);
g_hash_table_destroy (ctx->jit_callees);
+
+ GHashTableIter iter;
+ g_hash_table_iter_init (&iter, ctx->method_to_callers);
+ while (g_hash_table_iter_next (&iter, NULL, (gpointer)&l))
+ g_slist_free (l);
+
+ g_hash_table_destroy (ctx->method_to_callers);
+
g_free (ctx->method_name);
g_ptr_array_free (ctx->bblock_list, TRUE);
INTRINS_SSE_HADDPD,
INTRINS_SSE_HSUBPD,
INTRINS_SSE_ADDSUBPD,
- INTRINS_SSE_PMINUD,
- INTRINS_SSE_PMAXUD,
- INTRINS_SSE_PMINUW,
- INTRINS_SSE_PMINSW,
- INTRINS_SSE_PMAXUW,
INTRINS_SSE_PADDSW,
INTRINS_SSE_PSUBSW,
INTRINS_SSE_PADDUSW,
INTRINS_SSE_PAVGW,
INTRINS_SSE_PMULHW,
INTRINS_SSE_PMULHU,
- INTRINS_SSE_PMINUB,
- INTRINS_SSE_PMAXUB,
INTRINS_SE_PADDSB,
INTRINS_SSE_PSUBSB,
INTRINS_SSE_PADDUSB,
{INTRINS_SSE_HADDPD, "llvm.x86.sse3.hadd.pd"},
{INTRINS_SSE_HSUBPD, "llvm.x86.sse3.hsub.pd"},
{INTRINS_SSE_ADDSUBPD, "llvm.x86.sse3.addsub.pd"},
- {INTRINS_SSE_PMINUD, "llvm.x86.sse41.pminud"},
- {INTRINS_SSE_PMAXUD, "llvm.x86.sse41.pmaxud"},
- {INTRINS_SSE_PMINUW, "llvm.x86.sse41.pminuw"},
- {INTRINS_SSE_PMINSW, "llvm.x86.sse2.pmins.w"},
- {INTRINS_SSE_PMAXUW, "llvm.x86.sse41.pmaxuw"},
{INTRINS_SSE_PADDSW, "llvm.x86.sse2.padds.w"},
{INTRINS_SSE_PSUBSW, "llvm.x86.sse2.psubs.w"},
{INTRINS_SSE_PADDUSW, "llvm.x86.sse2.paddus.w"},
{INTRINS_SSE_PAVGW, "llvm.x86.sse2.pavg.w"},
{INTRINS_SSE_PMULHW, "llvm.x86.sse2.pmulh.w"},
{INTRINS_SSE_PMULHU, "llvm.x86.sse2.pmulhu.w"},
- {INTRINS_SSE_PMINUB, "llvm.x86.sse2.pminu.b"},
- {INTRINS_SSE_PMAXUB, "llvm.x86.sse2.pmaxu.b"},
{INTRINS_SE_PADDSB, "llvm.x86.sse2.padds.b"},
{INTRINS_SSE_PSUBSB, "llvm.x86.sse2.psubs.b"},
{INTRINS_SSE_PADDUSB, "llvm.x86.sse2.paddus.b"},
AddFunc (module, name, ret_type, arg_types, 2);
break;
/* SSE Binary ops */
- case INTRINS_SSE_PMINUD:
- case INTRINS_SSE_PMAXUD:
- add_sse_binary (module, name, MONO_TYPE_I4);
- break;
- case INTRINS_SSE_PMINUW:
- case INTRINS_SSE_PMINSW:
- case INTRINS_SSE_PMAXUW:
case INTRINS_SSE_PADDSW:
case INTRINS_SSE_PSUBSW:
case INTRINS_SSE_PADDUSW:
case INTRINS_SSE_ADDSUBPD:
add_sse_binary (module, name, MONO_TYPE_R8);
break;
- case INTRINS_SSE_PMINUB:
- case INTRINS_SSE_PMAXUB:
case INTRINS_SE_PADDSB:
case INTRINS_SSE_PSUBSB:
case INTRINS_SSE_PADDUSB:
AddFunc (module, "llvm_resume_unwind_trampoline", LLVMVoidType (), NULL, 0);
}
- /* SSE intrinsics */
-#if defined(TARGET_X86) || defined(TARGET_AMD64)
-
-#endif
-
/* Load/Store intrinsics */
{
LLVMTypeRef arg_types [5];
/* clang ignores our debug info because it has an invalid version */
module->emit_dwarf = FALSE;
-#if LLVM_API_VERSION > 100
- module->emit_dwarf = FALSE;
-#endif
-
add_intrinsics (module->lmodule);
add_types (module);
filename = g_path_get_basename (source_file);
#if LLVM_API_VERSION > 100
- return mono_llvm_di_create_function (module->di_builder, module->cu, cfg->method->name, name, dir, filename, n_seq_points ? sym_seq_points [0].line : 1);
+ return mono_llvm_di_create_function (module->di_builder, module->cu, method, cfg->method->name, name, dir, filename, n_seq_points ? sym_seq_points [0].line : 1);
#endif
ctx_args [0] = LLVMConstInt (LLVMInt32Type (), 0x29, FALSE);
MINI_OP(OP_GET_SP, "get_sp", IREG, NONE, NONE)
MINI_OP(OP_SET_SP, "set_sp", NONE, IREG, NONE)
+MINI_OP(OP_GET_LAST_ERROR, "get_last_error", IREG, NONE, NONE)
handle = mono_ldtoken_checked (patch_info->data.token->image,
patch_info->data.token->token, &handle_class, patch_info->data.token->has_context ? &patch_info->data.token->context : NULL, error);
if (!mono_error_ok (error))
- g_error ("Could not patch ldtoken due to %s", mono_error_get_message (error));
+ return NULL;
mono_class_init (handle_class);
mono_class_init (mono_class_from_mono_type ((MonoType *)handle));
MonoException *exc;
MONO_SIG_HANDLER_GET_CONTEXT;
+ if (mono_runtime_get_no_exec ())
+ exit (1);
+
MONO_ENTER_GC_UNSAFE_UNBALANCED;
exc = mono_get_exception_execution_engine ("SIGILL");
del->extra_arg = mini_get_delegate_arg (del->method, del->method_ptr);
}
+char*
+mono_get_delegate_virtual_invoke_impl_name (gboolean load_imt_reg, int offset)
+{
+ int abs_offset;
+
+ abs_offset = offset;
+ if (abs_offset < 0)
+ abs_offset = - abs_offset;
+ return g_strdup_printf ("delegate_virtual_invoke%s_%s%d", load_imt_reg ? "_imt" : "", offset < 0 ? "m_" : "", abs_offset / SIZEOF_VOID_P);
+}
+
gpointer
mono_get_delegate_virtual_invoke_impl (MonoMethodSignature *sig, MonoMethod *method)
{
/* FIXME Support more cases */
if (mono_aot_only) {
- char tramp_name [256];
- const char *imt = load_imt_reg ? "_imt" : "";
- int ind = (load_imt_reg ? (-offset) : offset) / SIZEOF_VOID_P;
-
- sprintf (tramp_name, "delegate_virtual_invoke%s_%d", imt, ind);
- cache [idx] = (guint8 *)mono_aot_get_trampoline (tramp_name);
+ cache [idx] = (guint8 *)mono_aot_get_trampoline (mono_get_delegate_virtual_invoke_impl_name (load_imt_reg, offset));
g_assert (cache [idx]);
} else {
cache [idx] = (guint8 *)mono_arch_get_delegate_virtual_invoke_impl (sig, method, offset, load_imt_reg);
mono_create_handler_block_trampoline (void)
{
static gpointer code;
- if (code) {
+
+ if (code)
+ return code;
+
+ if (mono_aot_only) {
+ gpointer tmp = mono_aot_get_trampoline ("handler_block_trampoline");
+ g_assert (tmp);
mono_memory_barrier ();
+ code = tmp;
return code;
}
- g_assert (!mono_aot_only);
-
mono_trampolines_lock ();
-
if (!code) {
MonoTrampInfo *info;
gpointer tmp;
x86_jump_membase (code, X86_EAX, offset);
mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_DELEGATE_INVOKE, NULL);
- if (load_imt_reg)
- tramp_name = g_strdup_printf ("delegate_virtual_invoke_imt_%d", - offset / sizeof (gpointer));
- else
- tramp_name = g_strdup_printf ("delegate_virtual_invoke_%d", offset / sizeof (gpointer));
+ tramp_name = mono_get_delegate_virtual_invoke_impl_name (load_imt_reg, offset);
*info = mono_tramp_info_create (tramp_name, start, code - start, NULL, unwind_ops);
g_free (tramp_name);
vars = g_list_prepend (vars, vmv);
}
- vars = g_list_sort (g_list_copy (vars), compare_by_interval_start_pos_func);
+ vars = g_list_sort (vars, compare_by_interval_start_pos_func);
/* Sanity check */
/*
mono_verify_bblock (bb);
}
+// This will free many fields in cfg to save
+// memory. Note that this must be safe to call
+// multiple times. It must be idempotent.
+void
+mono_empty_compile (MonoCompile *cfg)
+{
+ mono_free_loop_info (cfg);
+
+ // These live in the mempool, and so must be freed
+ // first
+ for (GSList *l = cfg->headers_to_free; l; l = l->next) {
+ mono_metadata_free_mh ((MonoMethodHeader *)l->data);
+ }
+ cfg->headers_to_free = NULL;
+
+ if (cfg->mempool) {
+ //mono_mempool_stats (cfg->mempool);
+ mono_mempool_destroy (cfg->mempool);
+ cfg->mempool = NULL;
+ }
+
+ g_free (cfg->varinfo);
+ cfg->varinfo = NULL;
+
+ g_free (cfg->vars);
+ cfg->vars = NULL;
+
+ if (cfg->rs) {
+ mono_regstate_free (cfg->rs);
+ cfg->rs = NULL;
+ }
+}
+
void
mono_destroy_compile (MonoCompile *cfg)
{
- GSList *l;
+ mono_empty_compile (cfg);
if (cfg->header)
mono_metadata_free_mh (cfg->header);
- //mono_mempool_stats (cfg->mempool);
- mono_free_loop_info (cfg);
- if (cfg->rs)
- mono_regstate_free (cfg->rs);
+
if (cfg->spvars)
g_hash_table_destroy (cfg->spvars);
if (cfg->exvars)
g_hash_table_destroy (cfg->exvars);
- for (l = cfg->headers_to_free; l; l = l->next)
- mono_metadata_free_mh ((MonoMethodHeader *)l->data);
+
g_list_free (cfg->ldstr_list);
- g_hash_table_destroy (cfg->token_info_hash);
+
+ if (cfg->token_info_hash)
+ g_hash_table_destroy (cfg->token_info_hash);
+
if (cfg->abs_patches)
g_hash_table_destroy (cfg->abs_patches);
- mono_mempool_destroy (cfg->mempool);
mono_debug_free_method (cfg);
//g_free (nm);
}
if (cfg->llvm_only) {
+ g_free (cfg->exception_message);
cfg->disable_aot = TRUE;
return cfg;
}
void mono_create_jump_table (MonoCompile *cfg, MonoInst *label, MonoBasicBlock **bbs, int num_blocks);
MonoCompile *mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFlags flags, int parts, int aot_method_index);
void mono_destroy_compile (MonoCompile *cfg);
+void mono_empty_compile (MonoCompile *cfg);
MonoJitICallInfo *mono_find_jit_opcode_emulation (int opcode);
void mono_print_ins_index (int i, MonoInst *ins);
void mono_print_ins (MonoInst *ins);
/* Delegates */
gpointer mini_get_delegate_arg (MonoMethod *method, gpointer method_ptr);
void mini_init_delegate (MonoDelegate *del);
+char* mono_get_delegate_virtual_invoke_impl_name (gboolean load_imt_reg, int offset);
gpointer mono_get_delegate_virtual_invoke_impl (MonoMethodSignature *sig, MonoMethod *method);
/* methods that must be provided by the arch-specific port */
#!/bin/bash
-TEST_FILE=$1
-USE_AOT=$2
+DEFAULT_PROFILE=$1
+TEST_FILE=$2
+USE_AOT=$3
TMP_FILE_PREFIX=$(basename $0).tmp
BASEDIR=$(dirname $0)
*) PLATFORM_PATH_SEPARATOR=':';;
esac
-MONO_PATH=$BASEDIR/../../mcs/class/lib/net_4_x$PLATFORM_PATH_SEPARATOR$BASEDIR
+MONO_PATH=$BASEDIR/../../mcs/class/lib/$DEFAULT_PROFILE$PLATFORM_PATH_SEPARATOR$BASEDIR
RUNTIME=$BASEDIR/../../runtime/mono-wrapper
trap "rm -rf ${TMP_FILE_PREFIX}*" EXIT
amd64_call_reg (code, AMD64_R11);
}
-
-static void
-handler_block_trampoline_helper (gpointer *ptr)
+gpointer
+mono_amd64_handler_block_trampoline_helper (void)
{
MonoJitTlsData *jit_tls = (MonoJitTlsData *)mono_native_tls_get_value (mono_jit_tls_id);
- *ptr = jit_tls->handler_block_return_address;
+ return jit_tls->handler_block_return_address;
}
gpointer
MonoJumpInfo *ji = NULL;
GSList *unwind_ops;
- g_assert (!aot);
-
code = buf = (guint8 *)mono_global_codeman_reserve (tramp_size);
unwind_ops = mono_arch_get_cie_program ();
/*
This trampoline restore the call chain of the handler block then jumps into the code that deals with it.
*/
- if (mono_get_jit_tls_offset () != -1) {
+ if (!aot && mono_get_jit_tls_offset () != -1) {
code = mono_amd64_emit_tls_get (code, MONO_AMD64_ARG_REG1, mono_get_jit_tls_offset ());
amd64_mov_reg_membase (code, MONO_AMD64_ARG_REG1, MONO_AMD64_ARG_REG1, MONO_STRUCT_OFFSET (MonoJitTlsData, handler_block_return_address), 8);
/* Simulate a call */
mono_add_unwind_op_def_cfa_offset (unwind_ops, code, buf, 16);
amd64_jump_code (code, tramp);
} else {
- /*Slow path uses a c helper*/
- amd64_mov_reg_reg (code, MONO_AMD64_ARG_REG1, AMD64_RSP, 8);
- amd64_mov_reg_imm (code, AMD64_RAX, tramp);
- amd64_push_reg (code, AMD64_RAX);
- mono_add_unwind_op_def_cfa_offset (unwind_ops, code, buf, 16);
+ /*
+ * We get here from the ret emitted by CEE_ENDFINALLY.
+ * The stack is misaligned.
+ */
+ /* Align the stack before the call */
+ amd64_alu_reg_imm (code, X86_SUB, AMD64_RSP, 8);
+ if (aot) {
+ code = mono_arch_emit_load_aotconst (buf, code, &ji, MONO_PATCH_INFO_JIT_ICALL_ADDR, "mono_amd64_handler_block_trampoline_helper");
+ amd64_call_reg (code, AMD64_R11);
+ } else {
+ amd64_call_code (code, mono_amd64_handler_block_trampoline_helper);
+ }
+ /* Undo stack alignment */
+ amd64_alu_reg_imm (code, X86_ADD, AMD64_RSP, 8);
+ /* Save the result to the stack */
amd64_push_reg (code, AMD64_RAX);
- mono_add_unwind_op_def_cfa_offset (unwind_ops, code, buf, 24);
- amd64_jump_code (code, handler_block_trampoline_helper);
+ if (aot) {
+ char *name = g_strdup_printf ("trampoline_func_%d", MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD);
+ code = mono_arch_emit_load_aotconst (buf, code, &ji, MONO_PATCH_INFO_JIT_ICALL_ADDR, name);
+ amd64_mov_reg_reg (code, AMD64_RAX, AMD64_R11, 8);
+ } else {
+ amd64_mov_reg_imm (code, AMD64_RAX, tramp);
+ }
+ /* The stack is aligned */
+ amd64_call_reg (code, AMD64_RAX);
+ /* Load return address */
+ amd64_pop_reg (code, AMD64_RAX);
+ /* The stack is misaligned, thats what the code we branch to expects */
+ amd64_jump_reg (code, AMD64_RAX);
}
mono_arch_flush_icache (buf, code - buf);
while (op->when > loc) {
if (op->when - loc > 65536) {
*p ++ = DW_CFA_advance_loc4;
- *(guint32*)p = (guint32)(op->when - loc);
+ guint32 v = (guint32)(op->when - loc);
+ memcpy (p, &v, 4);
g_assert (read32 (p) == (guint32)(op->when - loc));
p += 4;
loc = op->when;
} else if (op->when - loc > 256) {
*p ++ = DW_CFA_advance_loc2;
- *(guint16*)p = (guint16)(op->when - loc);
+ guint16 v = (guint16)(op->when - loc);
+ memcpy (p, &v, 2);
g_assert (read16 (p) == (guint32)(op->when - loc));
p += 2;
loc = op->when;
sgen_register_root (NULL, 0, sgen_make_user_root_descriptor (sgen_mark_normal_gc_handles), ROOT_TYPE_NORMAL, MONO_ROOT_SOURCE_GC_HANDLE, "normal gc handles");
- sgen_init_bridge_processor();
-
gc_initialized = 1;
+
+ sgen_init_bridge ();
+}
+
+gboolean
+sgen_gc_initialized ()
+{
+ return gc_initialized > 0;
}
NurseryClearPolicy
void sgen_conservatively_pin_objects_from (void **start, void **end, void *start_nursery, void *end_nursery, int pin_type);
+gboolean sgen_gc_initialized (void);
+
/* Keep in sync with description_for_type() in sgen-internal.c! */
enum {
INTERNAL_MEM_PIN_QUEUE,
}
done:
+ /*
+ * Once the block is written back without the checking bit other threads are
+ * free to access it. Make sure the block state is visible before we write it
+ * back.
+ */
+ mono_memory_write_barrier ();
*block_slot = tagged_block;
return !!tagged_block;
}
SUBDIRS = assemblyresolve gc-descriptors
+if INSTALL_MOBILE_STATIC
+FEATUREFUL_RUNTIME_TEST =
+else
+FEATUREFUL_RUNTIME_TEST = test-appdomain-unload
+endif
+
check-local: assemblyresolve/test/asm.dll testjit test-generic-sharing test-type-load test-cattr-type-load test-reflection-load-with-context test_platform \
- test-console-output test-messages test-env-options test-unhandled-exception-2 test-appdomain-unload test-process-stress rm-empty-logs
+ test-console-output test-messages test-env-options test-unhandled-exception-2 $(FEATUREFUL_RUNTIME_TEST) test-process-stress rm-empty-logs
check-full: test-sgen check-local
check-parallel: compile-tests check-full
aotcheck: testaot gshared-aot
+# Whenever running under CI
+# Can't use make conditionals since
+# automake doesn't support them
+# CI - Wrench
+# BUILD_URL = Jenkins
+RUNNING_ON_CI = $(CI)$(BUILD_URL)
+
TEST_PROG = ../interpreter/mint
JITTEST_PROG = $(if $(VALGRIND), valgrind $(VALGRIND_ARGS),) $(if $(SGEN),$(top_builddir)/mono/mini/mono-sgen,$(top_builddir)/mono/mini/mono)
TEST_RUNNER_ARGS=--config tests-config --runtime $(if $(MONO_EXECUTABLE),$(MONO_EXECUTABLE),mono)
endif
+TEST_RUNNER_ARGS += $(if $(RUNNING_ON_CI), --verbose,)
+TEST_RUNNER_ARGS += $(if $(V), --verbose,)
+
CLASS=$(mcs_topdir)/class/lib/$(DEFAULT_PROFILE)
with_mono_path = MONO_PATH=$(CLASS)
PKG_CONFIG_PATH=$(top_builddir):$(PKG_CONFIG_PATH) \
$(RUNTIME) $(CLASS)/mkbundle.exe
+if INSTALL_MOBILE_STATIC
+PROFILE_MCS_FLAGS = -d:MOBILE,MOBILE_STATIC,MOBILE_LEGACY
+endif
+
MCS_NO_LIB = $(RUNTIME) $(mcs_topdir)/class/lib/build/mcs.exe -unsafe -debug \
-noconfig -nologo \
-nowarn:0162 -nowarn:0168 -nowarn:0219 -nowarn:0414 -nowarn:0618 \
-nowarn:0169 -nowarn:1690 -nowarn:0649 -nowarn:0612 -nowarn:3021 \
- -nowarn:0197
+ -nowarn:0197 $(PROFILE_MCS_FLAGS)
MCS = $(MCS_NO_LIB) -lib:$(CLASS)
ILASM = $(RUNTIME) $(CLASS)/ilasm.exe
+if INSTALL_MOBILE_STATIC
+TEST_RUNNER = ./test-runner.exe --runtime $(top_builddir)/runtime/mono-wrapper --mono-path "$(CLASS)" --aot-run-flags "$(AOT_RUN_FLAGS)" --aot-build-flags "$(AOT_BUILD_FLAGS)"
+else
+TEST_RUNNER = ./test-runner.exe --runtime $(top_builddir)/runtime/mono-wrapper --mono-path "$(CLASS)"
+endif
+
+
BENCHSRC=fib.cs random.cs nested-loops.cs ackermann.cs tight-loop.cs sieve.cs
STRESS_TESTS_SRC= \
process-stress.cs \
assembly-load-stress.cs
+BASE_TEST_MOBILE_STATIC_NOT_SUPPORTED= \
+ remoting4.cs # Needs remoting support \
+ remoting1.cs # Needs remoting support \
+ remoting2.cs # Needs remoting support \
+ remoting3.cs # Needs remoting support \
+ remoting5.cs # Needs remoting support \
+ appdomain.cs # Needs appdomain support \
+ appdomain-client.cs # Needs appdomain support \
+ appdomain-unload.cs # Needs appdomain support \
+ appdomain-async-invoke.cs # Needs appdomain support \
+ appdomain-thread-abort.cs # Needs appdomain support \
+ appdomain1.cs # Needs appdomain support \
+ appdomain2.cs # Needs appdomain support \
+ appdomain-exit.cs # Needs appdomain support \
+ assemblyresolve_event2.2.cs # Needs appdomain support \
+ appdomain-unload-callback.cs # Needs appdomain support \
+ appdomain-unload-doesnot-raise-pending-events.cs # Needs appdomain support \
+ unload-appdomain-on-shutdown.cs # Needs appdomain support \
+ bug-47295.cs # Needs SRE \
+ loader.cs # Needs SRE \
+ pinvoke2.cs # Needs SRE \
+ generic-type-builder.2.cs # Needs SRE \
+ dynamic-generic-size.cs # Needs SRE \
+ cominterop.cs # Needs COM \
+ dynamic-method-access.2.cs # Need SRE \
+ dynamic-method-finalize.2.cs # Need SRE \
+ dynamic-method-stack-traces.cs # Need SRE\
+ generic_type_definition.2.cs # Need SRE \
+ bug-333798-tb.2.cs # Need SRE \
+ bug-335131.2.cs # Need SRE \
+ bug-322722_patch_bx.2.cs # Need SRE\
+ bug-322722_dyn_method_throw.2.cs # Need SRE \
+ bug-389886-2.cs # Need SRE \
+ bug-349190.2.cs # Need SRE \
+ bug-389886-sre-generic-interface-instances.cs # Need SRE \
+ bug-462592.cs # Need SRE \
+ bug-575941.cs # Need SRE \
+ bug-389886-3.cs # Need SRE \
+ dynamic-method-resurrection.cs # Need SRE \
+ bug-80307.cs # Need System.Web \
+ assembly_append_ordering.cs # Need SRE \
+ bug-544446.cs # Needs AppDomains / TranparentProxy \
+ bug-36848.cs # Needs AppDomains / TranparentProxy \
+ generic-marshalbyref.2.cs # Needs AppDomains \
+ stackframes-async.2.cs # Needs AppDomains \
+ transparentproxy.cs # Needs AppDomains / TranparentProxy \
+ bug-48015.cs # Needs AppDomains / TranparentProxy \
+ delegate9.cs # Needs AppDomains \
+ marshal-valuetypes.cs # Needs AppDomains \
+ xdomain-threads.cs # Needs AppDomains \
+ monitor.cs # Needs AppDomains \
+ generic-xdomain.2.cs # Needs AppDomains \
+ threadpool-exceptions7.cs # Needs AppDomains \
+ cross-domain.cs # Needs AppDomains \
+ generic-unloading.2.cs # Needs AppDomains \
+ thread6.cs # On MOBILE, ThreadAbortException doesn't have necessary field for this test
+
# Disabled until ?mcs is fixed
# bug-331958.cs
-BASE_TEST_CS_SRC= \
+BASE_TEST_CS_SRC_UNIVERSAL= \
+ generic-unloading-sub.2.cs \
+ create-instance.cs \
bug-2907.cs \
array-init.cs \
arraylist.cs \
assemblyresolve_event4.cs \
checked.cs \
char-isnumber.cs \
- create-instance.cs \
field-layout.cs \
pack-layout.cs \
pack-bug.cs \
typeof-ptr.cs \
static-constructor.cs \
pinvoke.cs \
- pinvoke2.cs \
pinvoke3.cs \
pinvoke11.cs \
pinvoke13.cs \
jit-float.cs \
pop.cs \
time.cs \
- appdomain.cs \
- appdomain1.cs \
- appdomain2.cs \
- appdomain-client.cs \
- appdomain-unload.cs \
- appdomain-async-invoke.cs \
- loader.cs \
pointer.cs \
hashcode.cs \
delegate1.cs \
delegate6.cs \
delegate7.cs \
delegate8.cs \
- delegate9.cs \
delegate10.cs \
delegate11.cs \
delegate12.cs \
delegate13.cs \
- remoting1.cs \
- remoting2.cs \
- remoting3.cs \
- remoting4.cs \
- remoting5.cs \
largeexp.cs \
largeexp2.cs \
marshalbyref1.cs \
marshal8.cs \
marshal9.cs \
marshalbool.cs \
- marshal-valuetypes.cs \
test-byval-in-struct.cs \
thread.cs \
thread5.cs \
- thread6.cs \
thread-static.cs \
thread-static-init.cs \
context-static.cs \
threadpool-exceptions4.cs \
threadpool-exceptions5.cs \
threadpool-exceptions6.cs \
- threadpool-exceptions7.cs \
base-definition.cs \
bug-27420.cs \
- bug-47295.cs \
bug-46781.cs \
- bug-48015.cs \
bug-42136.cs \
bug-59286.cs \
bug-70561.cs \
bug-323114.cs \
bug-Xamarin-5278.cs \
interlocked.cs \
- cross-domain.cs \
- appdomain-exit.cs \
delegate-async-exit.cs \
delegate-delegate-exit.cs \
delegate-exit.cs \
main-returns.cs \
subthread-exit.cs \
desweak.cs \
- cominterop.cs \
exists.cs \
handleref.cs \
- transparentproxy.cs \
dbnull-missing.cs \
test-type-ctor.cs \
soft-float-tests.cs \
thread-exit.cs \
finalize-parent.cs \
- assemblyresolve_event2.2.cs \
interlocked-2.2.cs \
pinvoke-2.2.cs \
bug-78431.2.cs \
catch-generics.2.cs \
event-get.2.cs \
safehandle.2.cs \
- stackframes-async.2.cs \
module-cctor-loader.2.cs \
generics-invoke-byref.2.cs \
generic-signature-compare.2.cs \
generic-virtual2.2.cs \
generic-valuetype-interface.2.cs \
generic-getgenericarguments.2.cs \
- generic-type-builder.2.cs \
generic-synchronized.2.cs \
generic-delegate-ctor.2.cs \
generic-array-iface-set.2.cs \
generic-typedef.2.cs \
- generic-marshalbyref.2.cs \
- generic-xdomain.2.cs \
- dynamic-generic-size.cs \
bug-431413.2.cs \
bug-459285.2.cs \
generic-virtual-invoke.2.cs \
bug-479763.2.cs \
bug-616463.cs \
bug-80392.2.cs \
- dynamic-method-access.2.cs \
- dynamic-method-finalize.2.cs \
- dynamic-method-stack-traces.cs \
bug-82194.2.cs \
anonarray.2.cs \
ienumerator-interfaces.2.cs \
array-enumerator-ifaces.2.cs \
generic_type_definition_encoding.2.cs \
- generic_type_definition.2.cs \
bug-333798.2.cs \
- bug-333798-tb.2.cs \
- bug-335131.2.cs \
- bug-322722_patch_bx.2.cs \
bug-348522.2.cs \
bug-340662_bug.cs \
- bug-322722_dyn_method_throw.2.cs \
- bug-389886-2.cs \
bug-325283.2.cs \
thunks.cs \
winx64structs.cs \
- bug-349190.2.cs \
nullable_boxing.2.cs \
valuetype-equals.cs \
custom-modifiers.2.cs \
bug-324535.cs \
modules.cs \
bug-81673.cs \
- bug-36848.cs \
bug-81691.cs \
- bug-80307.cs \
bug-415577.cs \
filter-stack.cs \
vararg2.cs \
- bug-389886-sre-generic-interface-instances.cs \
bug-461867.cs \
bug-461941.cs \
bug-461261.cs \
bug-400716.cs \
- bug-462592.cs \
bug-459094.cs \
- generic-unloading.2.cs \
- generic-unloading-sub.2.cs \
bug-467456.cs \
- appdomain-unload-callback.cs \
bug-508538.cs \
bug-472692.2.cs \
gchandles.cs \
interlocked-3.cs \
interlocked-4.2.cs \
- appdomain-thread-abort.cs \
- xdomain-threads.cs \
w32message.cs \
- bug-544446.cs \
gc-altstack.cs \
large-gc-bitmap.cs \
bug-561239.cs \
bug-562150.cs \
- bug-575941.cs \
bug-599469.cs \
- bug-389886-3.cs \
- monitor.cs \
monitor-resurrection.cs \
monitor-wait-abort.cs \
monitor-abort.cs \
- dynamic-method-resurrection.cs \
bug-666008.cs \
bug-685908.cs \
sgen-long-vtype.cs \
bug-bxc-795.cs \
bug-3903.cs \
async-with-cb-throws.cs \
- appdomain-unload-doesnot-raise-pending-events.cs \
bug-6148.cs \
- assembly_append_ordering.cs \
bug-10127.cs \
bug-18026.cs \
allow-synchronous-major.cs \
- unload-appdomain-on-shutdown.cs \
block_guard_restore_aligment_on_exit.cs \
thread_static_gc_layout.cs \
sleep.cs \
bug-29585.cs \
priority.cs
+if INSTALL_MOBILE_STATIC
+BASE_TEST_CS_SRC= \
+ $(BASE_TEST_CS_SRC_UNIVERSAL)
+else
+BASE_TEST_CS_SRC= \
+ $(BASE_TEST_MOBILE_STATIC_NOT_SUPPORTED) \
+ $(BASE_TEST_CS_SRC_UNIVERSAL)
+endif
+
TEST_CS_SRC_DIST= \
$(BASE_TEST_CS_SRC) \
async-exc-compilation.cs \
COOP_DISABLED_TESTS=
endif
+if INSTALL_MOBILE_STATIC
+# Tests which rely on TypeLoadExceptions
+# In full-aot mode, these cause the relevant methods to be not AOTed.
+PROFILE_DISABLED_TESTS = \
+ typeload-unaligned.exe \
+ field-access.exe \
+ invalid_generic_instantiation.exe \
+ bug-481403.exe \
+ array_ldelema.exe \
+ array_load_exception.exe \
+ bug445361.exe \
+ generic-type-load-exception.2.exe \
+ invalid-token.exe \
+ call_missing_method.exe \
+ call_missing_class.exe \
+ ldfld_missing_field.exe \
+ ldfld_missing_class.exe \
+ vt-sync-method.exe
+
+# Tests which rely on remoting
+PROFILE_DISABLED_TESTS += \
+ context-static.exe \
+ bug-415577.exe \
+ generic-marshalbyref.2.exe \
+ unhandled-exception-7.exe
+
+# Tests which use unsupported pinvoke+full aot
+# functionality
+PROFILE_DISABLED_TESTS += \
+ marshal.exe \
+ marshal2.exe \
+ marshal6.exe \
+ marshal7.exe \
+ marshal8.exe \
+ pinvoke-2.2.exe \
+ pinvoke3.exe \
+ thunks.exe
+
+# Tests which load assemblies which are not
+# in the mobile_static profile
+PROFILE_DISABLED_TESTS += \
+ assembly-load-remap.exe
+else
+PROFILE_DISABLED_TESTS=
+endif
+
# The two finalizer tests only work under sgen
# gc-altstack.exe fails under boehm because it has no support for altstack
# bug-459094.exe creates an extremely deep directory tree
bug-Xamarin-5278.exe \
$(PLATFORM_DISABLED_TESTS) \
$(EXTRA_DISABLED_TESTS) \
- $(COOP_DISABLED_TESTS)
+ $(COOP_DISABLED_TESTS) \
+ $(PROFILE_DISABLED_TESTS)
DISABLED_TESTS_WRENCH= \
$(DISABLED_TESTS) \
TEST_CSC_SRC= \
vararg.cs
-TEST_IL_SRC= \
+# constraints-load.il:
+# Failed to load method 0x6000007 from '..../mono/tests/constraints-load.exe' due to
+# Could not resolve type with token 01000002 assembly:mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 type:System.BrokenIComparable`1 member:<none>.
+IL_SRC_MOBILE_STATIC_NOT_SUPPORTED= \
+ constraints-load.il \
+ bug-515884.il
+
+TEST_IL_SRC_UNIVERSAL= \
field-access.il \
method-access.il \
ldftn-access.il \
bug-463303.il \
bug469742.2.il \
bug-528055.il \
- constraints-load.il \
array_load_exception.il \
bug-481403.il \
interface-with-static-method.il \
- bug-515884.il \
bug-633291.il \
delegate-with-null-target.il \
bug-318677.il \
gsharing-valuetype-layout.il \
invalid_generic_instantiation.il
+if INSTALL_MOBILE_STATIC
+TEST_IL_SRC= \
+ $(TEST_IL_SRC_UNIVERSAL)
+else
+TEST_IL_SRC= \
+ $(TEST_IL_SRC_MOBILE_STATIC_NOT_SUPPORTED) \
+ $(TEST_IL_SRC_UNIVERSAL)
+endif
# pre-requisite test sources: files that are not test themselves
# but that need to be compiled
TESTBS=$(BENCHSRC:.cs=.exe)
STRESS_TESTS=$(STRESS_TESTS_SRC:.cs=.exe)
+PREREQSI_IL_AOT=$(PREREQ_IL_SRC:.il=.exe$(PLATFORM_AOT_SUFFIX))
+PREREQSI_CS_AOT=$(PREREQ_CS_SRC:.cs=.exe$(PLATFORM_AOT_SUFFIX))
+
EXTRA_DIST=test-driver test-runner.cs $(TEST_CS_SRC_DIST) $(TEST_IL_SRC) \
$(BENCHSRC) $(STRESS_TESTS_SRC) stress-runner.pl $(PREREQ_IL_SRC) $(PREREQ_CS_SRC)
%.exe: %.il
$(ILASM) -out:$@ $<
-%.exe: %.cs TestDriver.dll
- $(MCS) -r:System.dll -r:System.Xml.dll -r:System.Core.dll -r:TestDriver.dll -r:Mono.Posix.dll -out:$@ $<
+if !INSTALL_MOBILE_STATIC
+TEST_DRIVER_HARD_KILL_FEATURE=-r:Mono.Posix.dll
+endif
+
+if INSTALL_MOBILE_STATIC
+TEST_DRIVER_DEPEND=TestDriver.dll$(PLATFORM_AOT_SUFFIX)
+else
+TEST_DRIVER_DEPEND=TestDriver.dll
+endif
+
+%.exe: %.cs $(TEST_DRIVER_DEPEND)
+ $(MCS) -r:System.dll -r:System.Xml.dll -r:System.Core.dll -r:TestDriver.dll $(TEST_DRIVER_HARD_KILL_FEATURE) -out:$@ $<
+
+%.exe$(PLATFORM_AOT_SUFFIX): %.exe
+ $(RUNTIME) $(AOT_BUILD_FLAGS) $<
+
+%.dll$(PLATFORM_AOT_SUFFIX): %.dll
+ $(RUNTIME) $(AOT_BUILD_FLAGS) $<
# mkbundle works on ppc, but the pkg-config POC doesn't when run with make test
if POWERPC
endif
endif
+AOT_EXTRA_LIBS = \
+bug-382986-lib.dll$(PLATFORM_AOT_SUFFIX) \
+bug-324535-il.dll$(PLATFORM_AOT_SUFFIX) \
+bug-36848-a.dll$(PLATFORM_AOT_SUFFIX) \
+bug-81691-b.dll$(PLATFORM_AOT_SUFFIX) \
+bug-327438.2.exe$(PLATFORM_AOT_SUFFIX) \
+bug-81466-lib.dll$(PLATFORM_AOT_SUFFIX)
+
+if INSTALL_MOBILE_STATIC
+prereqs: $(PREREQSI_IL_AOT) $(PREREQSI_CS_AOT) $(AOT_EXTRA_LIBS)
+else
+prereqs: $(PREREQSI_IL) $(PREREQSI_CS)
+endif
+
# Target to precompile the test executables
-tests: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS) $(GSHARED_TESTS)
+tests: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la prereqs $(GSHARED_TESTS)
#
# Test that no symbols are missed in eglib-remap.h
# Precompile the test assemblies in parallel
compile-tests:
$(MAKE) -j4 $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS)
+if INSTALL_MOBILE_STATIC
+ $(MAKE) $(PREREQSI_IL_AOT) $(PREREQSI_CS_AOT) $(AOT_EXTRA_LIBS)
+endif
# Remove empty .stdout and .stderr files for wrench
rm-empty-logs:
$(MAKE) -C assemblyresolve prereq
TestDriver.dll:
- $(MCS) -target:library -out:$@ $(srcdir)/../mini/TestDriver.cs
+ $(MCS) -target:library -out:$@ $(srcdir)/../mini/TestDriver.cs $(srcdir)/../mini/TestHelpers.cs
test_cs: $(TEST_PROG) $(TESTSI_CS) libtest.la
@failed=0; \
runtest-managed: test-runner.exe $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS)
@if [ "x$$CI" = "x1" ]; then disabled_tests="$(DISABLED_TESTS_WRENCH)"; else disabled_tests="$(DISABLED_TESTS)"; fi; \
- $(RUNTIME) --debug ./test-runner.exe $(TEST_RUNNER_ARGS) -j a --testsuite-name "runtime" --timeout 300 --disabled "$${disabled_tests}" $(TESTSI_CS) $(TESTBS) $(TESTSI_IL)
+ $(RUNTIME) --debug $(TEST_RUNNER) $(TEST_RUNNER_ARGS) -j a --testsuite-name "runtime" --timeout 300 --disabled "$${disabled_tests}" $(TESTSI_CS) $(TESTBS) $(TESTSI_IL)
runtest-managed-serial: test-runner.exe $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS)
@if [ "x$$CI" = "x1" ]; then disabled_tests="$(DISABLED_TESTS_WRENCH)"; else disabled_tests="$(DISABLED_TESTS)"; fi; \
- $(RUNTIME) --debug ./test-runner.exe $(TEST_RUNNER_ARGS) -j 1 --testsuite-name "runtime" --disabled "$${disabled_tests}" $(TESTSI_CS) $(TESTBS) $(TESTSI_IL)
+ $(RUNTIME) --debug $(TEST_RUNNER) $(TEST_RUNNER_ARGS) -j 1 --testsuite-name "runtime" --disabled "$${disabled_tests}" $(TESTSI_CS) $(TESTBS) $(TESTSI_IL)
testjit:
@if test x$(M) != x0; then $(MAKE) runtest-managed; else $(MAKE) runtest; fi
@- rm -rf a.out
EXTRA_DIST += load-missing.il t-missing.cs load-exceptions.cs
-test-type-load: TestDriver.dll
+test-type-load: $(TEST_DRIVER_DEPEND)
@$(ILASM) /dll /output:load-missing.dll $(srcdir)/load-missing.il > /dev/null
@$(MCS) -t:library -out:t.dll -d:FOUND $(srcdir)/t-missing.cs
@$(MCS) -r:TestDriver.dll -r:load-missing.dll -r:t.dll -out:load-exceptions.exe $(srcdir)/load-exceptions.cs
@$(RUNTIME) load-exceptions.exe > load-exceptions.exe.stdout 2> load-exceptions.exe.stderr
EXTRA_DIST += custom-attr-errors.cs custom-attr-errors-lib.cs
-test-cattr-type-load: TestDriver.dll custom-attr-errors.cs custom-attr-errors-lib.cs
+test-cattr-type-load: $(TEST_DRIVER_DEPEND) custom-attr-errors.cs custom-attr-errors-lib.cs
$(MCS) -D:WITH_MEMBERS /t:library $(srcdir)/custom-attr-errors-lib.cs
$(MCS) -r:TestDriver.dll -r:custom-attr-errors-lib.dll $(srcdir)/custom-attr-errors.cs
$(MCS) /t:library $(srcdir)/custom-attr-errors-lib.cs
$(MAKE) sgen-bridge2-tests
endif
-SGEN_REGULAR_TESTS = \
+SGEN_REGULAR_TESTS_MOBILE_STATIC_NOT_SUPPORTED = \
+ sgen-domain-unload.exe \
+ sgen-domain-unload-2.exe
+
+SGEN_REGULAR_TESTS_UNIVERSAL = \
finalizer-wait.exe \
critical-finalizers.exe \
sgen-descriptors.exe \
sgen-gshared-vtype.exe \
- sgen-domain-unload.exe \
- sgen-domain-unload-2.exe \
sgen-weakref-stress.exe \
sgen-cementing-stress.exe \
sgen-case-23400.exe \
gc-graystack-stress.exe \
bug-17590.exe
+if INSTALL_MOBILE_STATIC
+SGEN_REGULAR_TESTS= \
+ $(SGEN_REGULAR_TESTS_UNIVERSAL)
+else
+SGEN_REGULAR_TESTS= \
+ $(SGEN_REGULAR_TESTS_MOBILE_STATIC_NOT_SUPPORTED) \
+ $(SGEN_REGULAR_TESTS_UNIVERSAL)
+endif
+
sgen-regular-tests: $(SGEN_REGULAR_TESTS)
$(MAKE) sgen-regular-tests-plain
$(MAKE) sgen-regular-tests-ms-conc
$(MAKE) sgen-regular-tests-ms-split-clear-at-gc
sgen-regular-tests-plain: $(SGEN_REGULAR_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="" $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
sgen-regular-tests-ms-conc: $(SGEN_REGULAR_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="major=marksweep-conc" $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="major=marksweep-conc" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
sgen-regular-tests-ms-conc-split: $(SGEN_REGULAR_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="major=marksweep-conc,minor=split" $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="major=marksweep-conc,minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
sgen-regular-tests-ms-split: $(SGEN_REGULAR_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="minor=split" $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
sgen-regular-tests-ms-split-95: $(SGEN_REGULAR_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="minor=split,alloc-ratio=95" $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="minor=split,alloc-ratio=95" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
sgen-regular-tests-plain-clear-at-gc: $(SGEN_REGULAR_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="clear-at-gc" MONO_GC_PARAMS="" $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="clear-at-gc" MONO_GC_PARAMS="" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
sgen-regular-tests-ms-conc-clear-at-gc: $(SGEN_REGULAR_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="clear-at-gc" MONO_GC_PARAMS="major=marksweep-conc" $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="clear-at-gc" MONO_GC_PARAMS="major=marksweep-conc" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
sgen-regular-tests-ms-split-clear-at-gc: $(SGEN_REGULAR_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="clear-at-gc" MONO_GC_PARAMS="minor=split" $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="clear-at-gc" MONO_GC_PARAMS="minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
SGEN_TOGGLEREF_TESTS= \
sgen-toggleref.exe
$(MAKE) sgen-toggleref-tests-ms-split-clear-at-gc
sgen-toggleref-tests-plain: $(SGEN_TOGGLEREF_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="toggleref-test" $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_TOGGLEREF_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="toggleref-test" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_TOGGLEREF_TESTS)
sgen-toggleref-tests-ms-conc: $(SGEN_TOGGLEREF_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="toggleref-test,major=marksweep-conc" $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_TOGGLEREF_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="toggleref-test,major=marksweep-conc" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_TOGGLEREF_TESTS)
sgen-toggleref-tests-ms-conc-split: $(SGEN_TOGGLEREF_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="toggleref-test,major=marksweep-conc,minor=split" $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_TOGGLEREF_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="toggleref-test,major=marksweep-conc,minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_TOGGLEREF_TESTS)
sgen-toggleref-tests-ms-split: $(SGEN_TOGGLEREF_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="toggleref-test,minor=split" $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_TOGGLEREF_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="toggleref-test,minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_TOGGLEREF_TESTS)
sgen-toggleref-tests-ms-split-95: $(SGEN_TOGGLEREF_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="toggleref-test,minor=split,alloc-ratio=95" $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_TOGGLEREF_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="toggleref-test,minor=split,alloc-ratio=95" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_TOGGLEREF_TESTS)
sgen-toggleref-tests-plain-clear-at-gc: $(SGEN_TOGGLEREF_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="clear-at-gc" MONO_GC_PARAMS="toggleref-test" $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_TOGGLEREF_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="clear-at-gc" MONO_GC_PARAMS="toggleref-test" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_TOGGLEREF_TESTS)
sgen-toggleref-tests-ms-conc-clear-at-gc: $(SGEN_TOGGLEREF_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="clear-at-gc" MONO_GC_PARAMS="toggleref-test,major=marksweep-conc" $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_TOGGLEREF_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="clear-at-gc" MONO_GC_PARAMS="toggleref-test,major=marksweep-conc" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_TOGGLEREF_TESTS)
sgen-toggleref-tests-ms-split-clear-at-gc: $(SGEN_TOGGLEREF_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="clear-at-gc" MONO_GC_PARAMS="toggleref-test,minor=split" $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_TOGGLEREF_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="clear-at-gc" MONO_GC_PARAMS="toggleref-test,minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_TOGGLEREF_TESTS)
SGEN_BRIDGE_TESTS= \
sgen-bridge.exe \
$(MAKE) sgen-bridge-tests-ms-split-tarjan-bridge
sgen-bridge-tests-plain: $(SGEN_BRIDGE_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=Bridge" MONO_GC_PARAMS="" $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=Bridge" MONO_GC_PARAMS="" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE_TESTS)
sgen-bridge-tests-ms-conc: $(SGEN_BRIDGE_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=Bridge" MONO_GC_PARAMS="major=marksweep-conc" $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=Bridge" MONO_GC_PARAMS="major=marksweep-conc" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE_TESTS)
sgen-bridge-tests-ms-split: $(SGEN_BRIDGE_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=Bridge" MONO_GC_PARAMS="minor=split" $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=Bridge" MONO_GC_PARAMS="minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE_TESTS)
sgen-bridge-tests-plain-new-bridge: $(SGEN_BRIDGE_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=Bridge" MONO_GC_PARAMS="bridge-implementation=new" $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=Bridge" MONO_GC_PARAMS="bridge-implementation=new" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE_TESTS)
sgen-bridge-tests-ms-conc-new-bridge: $(SGEN_BRIDGE_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=Bridge" MONO_GC_PARAMS="bridge-implementation=new,major=marksweep-conc" $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=Bridge" MONO_GC_PARAMS="bridge-implementation=new,major=marksweep-conc" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE_TESTS)
sgen-bridge-tests-ms-split-new-bridge: $(SGEN_BRIDGE_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=Bridge" MONO_GC_PARAMS="bridge-implementation=new,minor=split" $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=Bridge" MONO_GC_PARAMS="bridge-implementation=new,minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE_TESTS)
sgen-bridge-tests-plain-tarjan-bridge: $(SGEN_BRIDGE_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=Bridge" MONO_GC_PARAMS="bridge-implementation=tarjan" $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=Bridge" MONO_GC_PARAMS="bridge-implementation=tarjan" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE_TESTS)
sgen-bridge-tests-ms-split-tarjan-bridge: $(SGEN_BRIDGE_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=Bridge" MONO_GC_PARAMS="bridge-implementation=tarjan,minor=split" $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=Bridge" MONO_GC_PARAMS="bridge-implementation=tarjan,minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE_TESTS)
SGEN_BRIDGE2_TESTS= \
sgen-bridge-xref.exe
$(MAKE) sgen-bridge2-tests-ms-split-tarjan-bridge
sgen-bridge2-tests-plain: $(SGEN_BRIDGE2_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=2Bridge" MONO_GC_PARAMS="" $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE2_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=2Bridge" MONO_GC_PARAMS="" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE2_TESTS)
sgen-bridge2-tests-ms-conc: $(SGEN_BRIDGE2_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=2Bridge" MONO_GC_PARAMS="major=marksweep-conc" $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE2_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=2Bridge" MONO_GC_PARAMS="major=marksweep-conc" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE2_TESTS)
sgen-bridge2-tests-ms-split: $(SGEN_BRIDGE2_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=2Bridge" MONO_GC_PARAMS="minor=split" $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE2_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=2Bridge" MONO_GC_PARAMS="minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE2_TESTS)
sgen-bridge2-tests-plain-new-bridge: $(SGEN_BRIDGE2_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=2Bridge" MONO_GC_PARAMS="bridge-implementation=new" $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE2_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=2Bridge" MONO_GC_PARAMS="bridge-implementation=new" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE2_TESTS)
sgen-bridge2-tests-ms-conc-new-bridge: $(SGEN_BRIDGE2_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=2Bridge" MONO_GC_PARAMS="bridge-implementation=new,major=marksweep-conc" $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE2_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=2Bridge" MONO_GC_PARAMS="bridge-implementation=new,major=marksweep-conc" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE2_TESTS)
sgen-bridge2-tests-ms-split-new-bridge: $(SGEN_BRIDGE2_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=2Bridge" MONO_GC_PARAMS="bridge-implementation=new,minor=split" $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE2_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=2Bridge" MONO_GC_PARAMS="bridge-implementation=new,minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE2_TESTS)
sgen-bridge2-tests-plain-tarjan-bridge: $(SGEN_BRIDGE2_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=2Bridge" MONO_GC_PARAMS="bridge-implementation=tarjan" $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE2_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=2Bridge" MONO_GC_PARAMS="bridge-implementation=tarjan" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE2_TESTS)
sgen-bridge2-tests-ms-split-tarjan-bridge: $(SGEN_BRIDGE2_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=2Bridge" MONO_GC_PARAMS="bridge-implementation=tarjan,minor=split" $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE2_TESTS)
-
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=2Bridge" MONO_GC_PARAMS="bridge-implementation=tarjan,minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE2_TESTS)
SGEN_BRIDGE3_TESTS= \
sgen-bridge-gchandle.exe
$(MAKE) sgen-bridge3-tests-ms-split-tarjan-bridge
sgen-bridge3-tests-plain: $(SGEN_bridge3_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=3Bridge" MONO_GC_PARAMS="" $(RUNTIME) ./test-runner.exe --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE3_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=3Bridge" MONO_GC_PARAMS="" $(RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE3_TESTS)
sgen-bridge3-tests-ms-conc: $(SGEN_BRIDGE3_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=3Bridge" MONO_GC_PARAMS="major=marksweep-conc" $(RUNTIME) ./test-runner.exe --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE3_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=3Bridge" MONO_GC_PARAMS="major=marksweep-conc" $(RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE3_TESTS)
sgen-bridge3-tests-ms-split: $(SGEN_BRIDGE3_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=3Bridge" MONO_GC_PARAMS="minor=split" $(RUNTIME) ./test-runner.exe --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE3_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=3Bridge" MONO_GC_PARAMS="minor=split" $(RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE3_TESTS)
sgen-bridge3-tests-plain-new-bridge: $(SGEN_BRIDGE3_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=3Bridge" MONO_GC_PARAMS="bridge-implementation=new" $(RUNTIME) ./test-runner.exe --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE3_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=3Bridge" MONO_GC_PARAMS="bridge-implementation=new" $(RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE3_TESTS)
sgen-bridge3-tests-ms-conc-new-bridge: $(SGEN_BRIDGE3_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=3Bridge" MONO_GC_PARAMS="bridge-implementation=new,major=marksweep-conc" $(RUNTIME) ./test-runner.exe --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE3_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=3Bridge" MONO_GC_PARAMS="bridge-implementation=new,major=marksweep-conc" $(RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE3_TESTS)
sgen-bridge3-tests-ms-split-new-bridge: $(SGEN_BRIDGE3_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=3Bridge" MONO_GC_PARAMS="bridge-implementation=new,minor=split" $(RUNTIME) ./test-runner.exe --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE3_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=3Bridge" MONO_GC_PARAMS="bridge-implementation=new,minor=split" $(RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE3_TESTS)
sgen-bridge3-tests-plain-tarjan-bridge: $(SGEN_BRIDGE3_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=3Bridge" MONO_GC_PARAMS="bridge-implementation=tarjan" $(RUNTIME) ./test-runner.exe --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE3_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=3Bridge" MONO_GC_PARAMS="bridge-implementation=tarjan" $(RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE3_TESTS)
sgen-bridge3-tests-ms-split-tarjan-bridge: $(SGEN_BRIDGE3_TESTS) test-runner.exe
- MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=3Bridge" MONO_GC_PARAMS="bridge-implementation=tarjan,minor=split" $(RUNTIME) ./test-runner.exe --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE3_TESTS)
+ MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=3Bridge" MONO_GC_PARAMS="bridge-implementation=tarjan,minor=split" $(RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE3_TESTS)
AOT_CONFIGURATIONS= \
# Generated tests for runtime invoke
EXTRA_DIST += gen-runtime-invoke.cs
-runtime-invoke.gen.exe: TestDriver.dll gen-runtime-invoke.exe
+runtime-invoke.gen.exe: $(TEST_DRIVER_DEPEND) gen-runtime-invoke.exe
$(RUNTIME) gen-runtime-invoke.exe > runtime-invoke.gen.cs
$(MCS) -out:runtime-invoke.gen.exe -r:TestDriver.dll runtime-invoke.gen.cs
EXTRA_DIST += make-imt-test.cs
-imt_big_iface_test.exe: TestDriver.dll make-imt-test.exe
+imt_big_iface_test.exe: $(TEST_DRIVER_DEPEND) make-imt-test.exe
$(RUNTIME) make-imt-test.exe > imt_big_iface_test.cs
$(MCS) -out:imt_big_iface_test.exe -r:TestDriver.dll imt_big_iface_test.cs
EXTRA_DIST += test-inline-call-stack-library.cs test-inline-call-stack.cs
-test-inline-call-stack-library.dll: TestDriver.dll $(srcdir)/test-inline-call-stack-library.cs
+test-inline-call-stack-library.dll: $(TEST_DRIVER_DEPEND) $(srcdir)/test-inline-call-stack-library.cs
$(MCS) -t:library -out:test-inline-call-stack-library.dll $(srcdir)/test-inline-call-stack-library.cs
-test-inline-call-stack.exe: TestDriver.dll test-inline-call-stack-library.dll $(srcdir)/test-inline-call-stack.cs
+if INSTALL_MOBILE_STATIC
+ $(RUNTIME) $(AOT_BUILD_FLAGS) $@
+endif
+
+test-inline-call-stack.exe: $(TEST_DRIVER_DEPEND) test-inline-call-stack-library.dll $(srcdir)/test-inline-call-stack.cs
$(MCS) -r:TestDriver.dll -r:test-inline-call-stack-library.dll -out:test-inline-call-stack.exe $(srcdir)/test-inline-call-stack.cs
EXTRA_DIST += unhandled-exception-base-configuration.config
$(MCS) -target:library -out:bug-81673-interface.dll $(srcdir)/bug-81673-interface.cs
$(MCS) -out:bug-81673.exe -r:bug-81673-interface.dll $(srcdir)/bug-81673.cs
$(MCS) -define:WITH_STOP -target:library -out:bug-81673-interface.dll $(srcdir)/bug-81673-interface.cs
+if INSTALL_MOBILE_STATIC
+ $(RUNTIME) $(AOT_BUILD_FLAGS) $@
+endif
EXTRA_DIST += bug-36848-a.cs
bug-36848.exe bug-36848-a.dll: $(srcdir)/bug-36848.cs $(srcdir)/bug-36848-a.cs
$(MCS) -target:library -out:bug-36848-a.dll $(srcdir)/bug-36848-a.cs
$(MCS) -r:bug-36848-a.dll -out:bug-36848.exe $(srcdir)/bug-36848.cs
$(MCS) -target:library -out:bug-36848-a.dll $(srcdir)/bug-36848-a.cs /define:WITH_STOP
+if INSTALL_MOBILE_STATIC
+ $(RUNTIME) $(AOT_BUILD_FLAGS) $@
+endif
EXTRA_DIST += bug-81691-a.cs bug-81691-b.cs
bug-81691.exe bug-81691-b.dll: $(srcdir)/bug-81691.cs $(srcdir)/bug-81691-a.cs $(srcdir)/bug-81691-b.cs
EXTRA_DIST += bug-81466-lib.il
bug-81466-lib.dll: bug-81466-lib.il
$(ILASM) /dll /output:bug-81466-lib.dll $(srcdir)/bug-81466-lib.il
+if INSTALL_MOBILE_STATIC
+ $(RUNTIME) $(AOT_BUILD_FLAGS) $@
+endif
bug-81466.exe: bug-81466.il bug-81466-lib.dll
$(ILASM) /exe /output:bug-81466.exe $(srcdir)/bug-81466.il
EXTRA_DIST += bug-324535-il.il
bug-324535-il.dll : bug-324535-il.il
$(ILASM) /dll /output:bug-324535-il.dll $(srcdir)/bug-324535-il.il
+if INSTALL_MOBILE_STATIC
+ $(RUNTIME) $(AOT_BUILD_FLAGS) $@
+endif
bug-324535.exe : bug-324535.cs bug-324535-il.dll
$(MCS) -r:bug-324535-il.dll -out:bug-324535.exe $(srcdir)/bug-324535.cs
EXTRA_DIST += custom-modifiers.2.cs custom-modifiers-lib.il
custom-modifiers-lib.dll: custom-modifiers-lib.il
$(ILASM) /dll /output:custom-modifiers-lib.dll $(srcdir)/custom-modifiers-lib.il
+if INSTALL_MOBILE_STATIC
+ $(RUNTIME) $(AOT_BUILD_FLAGS) $@
+endif
custom-modifiers.2.exe: custom-modifiers.2.cs custom-modifiers-lib.dll
$(MCS) -r:custom-modifiers-lib.dll -out:custom-modifiers.2.exe $(srcdir)/custom-modifiers.2.cs
EXTRA_DIST += bug-382986-lib.cs
bug-382986-lib.dll: bug-382986-lib.cs
$(MCS) -target:library -out:$@ $(srcdir)/bug-382986-lib.cs
+if INSTALL_MOBILE_STATIC
+ $(RUNTIME) $(AOT_BUILD_FLAGS) $@
+endif
+
bug-382986.exe: bug-382986.cs bug-382986-lib.dll
$(MCS) -out:$@ -r:bug-382986-lib.dll $(srcdir)/bug-382986.cs
EXTRA_DIST += generic-unboxing.2.il
generic-unboxing.2.dll : generic-unboxing.2.il
$(ILASM) /dll /output:generic-unboxing.2.dll $(srcdir)/generic-unboxing.2.il
+if INSTALL_MOBILE_STATIC
+ $(RUNTIME) $(AOT_BUILD_FLAGS) $@
+endif
EXTRA_DIST += generic-boxing.2.il
generic-boxing.2.dll : generic-boxing.2.il generic-unboxing.2.dll
$(ILASM) /dll /output:generic-boxing.2.dll $(srcdir)/generic-boxing.2.il
+if INSTALL_MOBILE_STATIC
+ $(RUNTIME) $(AOT_BUILD_FLAGS) $@
+endif
EXTRA_DIST += generic-unbox.2.cs
generic-unbox.2.exe : generic-unbox.2.cs generic-unboxing.2.dll
EXTRA_DIST += generic-delegate2.2.cs generic-delegate2-lib.2.il
generic-delegate2-lib.2.dll : generic-delegate2-lib.2.il
$(ILASM) /dll /output:$@ $(srcdir)/generic-delegate2-lib.2.il
+if INSTALL_MOBILE_STATIC
+ $(RUNTIME) $(AOT_BUILD_FLAGS) $@
+endif
generic-delegate2.2.exe : generic-delegate2.2.cs generic-delegate2-lib.2.dll
$(MCS) -r:generic-delegate2-lib.2.dll -out:$@ $(srcdir)/generic-delegate2.2.cs
gshared-aot:
@$(MAKE) AOT=1 gshared
-GSHARED_TESTS = \
+GSHARED_TESTS_MOBILE_STATIC_NOT_SUPPORTED = \
+ generic-type-builder.2.exe
+
+GSHARED_TESTS_UNIVERSAL = \
generics-sharing.2.exe shared-generic-methods.2.exe \
shared-generic-synchronized.2.exe generic-initobj.2.exe \
generics-sharing-other-exc.2.exe generic-box.2.exe \
generic-exceptions.2.exe generic-delegate2.2.exe \
generic-virtual2.2.exe generic-valuetype-interface.2.exe \
generic-valuetype-newobj.2.exe generic-valuetype-newobj2.2.exe \
- generic-getgenericarguments.2.exe generic-type-builder.2.exe \
+ generic-getgenericarguments.2.exe \
generic-synchronized.2.exe generic-delegate-ctor.2.exe \
generic-constrained.2.exe bug-431413.2.exe \
generic-virtual-invoke.2.exe generic-typedef.2.exe \
generic-type-load-exception.2.exe bug-616463.exe \
bug-1147.exe
+if INSTALL_MOBILE_STATIC
+GSHARED_TESTS= \
+ $(GSHARED_TESTS_UNIVERSAL)
+else
+GSHARED_TESTS= \
+ $(GSHARED_TESTS_MOBILE_STATIC_NOT_SUPPORTED) \
+ $(GSHARED_TESTS_UNIVERSAL)
+endif
+
test-generic-sharing-normal: $(GSHARED_TESTS)
@for fn in $+ ; do \
echo "Testing $$fn ..."; \
done
test-generic-sharing-managed: test-runner.exe $(GSHARED_TESTS)
- @$(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) -j a --testsuite-name "gshared" --opt-sets "gshared gshared,shared gshared,-inline gshared,-inline,shared" $(GSHARED_TESTS)
+ @$(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) -j a --testsuite-name "gshared" --disabled "$(DISABLED_TESTS)" --opt-sets "gshared gshared,shared gshared,-inline gshared,-inline,shared" $(GSHARED_TESTS)
if NACL_CODEGEN
test-generic-sharing:
EXTRA_DIST += modules.cs modules-m1.cs
modules-m1.netmodule: modules-m1.cs
$(MCS) -out:$@ /target:module $(srcdir)/modules-m1.cs
-modules.exe: modules.cs modules-m1.netmodule TestDriver.dll
+modules.exe: modules.cs modules-m1.netmodule $(TEST_DRIVER_DEPEND)
$(MCS) -out:$@ /addmodule:modules-m1.netmodule -r:TestDriver.dll $(srcdir)/modules.cs
# Useful if mono is compiled with --enable-shared=no
$(MAKE) test-unhandled-exception-2-255-without-managed-handler
test-unhandled-exception-2-1-with-managed-handler: $(UNHANDLED_EXCEPTION_1_TESTS) test-runner.exe
- $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) -j a --testsuite-name $@ --expected-exit-code 1 $(UNHANDLED_EXCEPTION_1_TESTS)
+ $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) -j a --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --expected-exit-code 1 $(UNHANDLED_EXCEPTION_1_TESTS)
test-unhandled-exception-2-1-without-managed-handler: $(UNHANDLED_EXCEPTION_1_TESTS) test-runner.exe
- TEST_UNHANDLED_EXCEPTION_HANDLER=1 $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) -j a --testsuite-name $@ --expected-exit-code 1 $(UNHANDLED_EXCEPTION_1_TESTS)
+ TEST_UNHANDLED_EXCEPTION_HANDLER=1 $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) -j a --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --expected-exit-code 1 $(UNHANDLED_EXCEPTION_1_TESTS)
test-unhandled-exception-2-255-with-managed-handler: $(UNHANDLED_EXCEPTION_255_TESTS) test-runner.exe
- $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) -j a --testsuite-name $@ --expected-exit-code 255 $(UNHANDLED_EXCEPTION_255_TESTS)
+ $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) -j a --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --expected-exit-code 255 $(UNHANDLED_EXCEPTION_255_TESTS)
test-unhandled-exception-2-255-without-managed-handler: $(UNHANDLED_EXCEPTION_255_TESTS) test-runner.exe
- TEST_UNHANDLED_EXCEPTION_HANDLER=1 $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) -j a --testsuite-name $@ --expected-exit-code 255 $(UNHANDLED_EXCEPTION_255_TESTS)
+ TEST_UNHANDLED_EXCEPTION_HANDLER=1 $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) -j a --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --expected-exit-code 255 $(UNHANDLED_EXCEPTION_255_TESTS)
endif
process-leak.exe
test-process-stress: $(PROCESS_STRESS_TESTS) test-runner.exe
- $(RUNTIME) ./test-runner.exe $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 600 $(PROCESS_STRESS_TESTS)
+ $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 600 $(PROCESS_STRESS_TESTS)
coreclr-gcstress:
$(MAKE) -C $(mono_build_root)/acceptance-tests coreclr-gcstress
with_mono_path = MONO_PATH=$(CLASS)
-RUNTIME = $(with_mono_path) $(top_builddir)/runtime/mono-wrapper --debug
-MCS = $(RUNTIME) $(mcs_topdir)/class/lib/build/mcs.exe -debug:full -target:library
+RUNTIME = $(top_builddir)/runtime/mono-wrapper --debug
+MCS = $(with_mono_path) $(RUNTIME) $(mcs_topdir)/class/lib/build/mcs.exe -debug:full -target:library
+if INSTALL_MOBILE_STATIC
+prereq: aot
+else
prereq: test/asm.dll
+endif
test/.dirstamp deps/.dirstamp:
-mkdir $(@D)
clean:
rm -f deps/*.dll test/*.dll
+
+.PHONY: aot
+aot: test/asm.dll
+ MONO_PATH="deps:$(CLASS)" $(RUNTIME) $(AOT_BUILD_FLAGS) deps/test.dll
+ MONO_PATH="deps:$(CLASS)" $(RUNTIME) $(AOT_BUILD_FLAGS) deps/TestBase.dll
+ MONO_PATH="deps:$(CLASS)" $(RUNTIME) $(AOT_BUILD_FLAGS) test/asm.dll
+
using System;
using System.Runtime.InteropServices;
+[AttributeUsage (AttributeTargets.Method)]
+sealed class MonoPInvokeCallbackAttribute : Attribute {
+ public MonoPInvokeCallbackAttribute (Type t) {}
+}
+
namespace TestApp
{
public delegate char MyDelegate(int x);
class Driver
{
+ [MonoPInvokeCallbackAttribute (typeof (MyDelegate))]
static char Test (int x) { return (char)x; }
static int Main()
public class Tests {
+ [AttributeUsage (AttributeTargets.Method)]
+ sealed class MonoPInvokeCallbackAttribute : Attribute {
+ public MonoPInvokeCallbackAttribute (Type t) {}
+ }
+
public static int Main (string[] args) {
return TestDriver.RunTests (typeof (Tests), args);
}
public delegate int SimpleDelegate (int a);
+ [MonoPInvokeCallback (typeof (SimpleDelegate))]
public static int delegate_test (int a)
{
return a + 1;
using System;
using System.Runtime.InteropServices;
+[AttributeUsage (AttributeTargets.Method)]
+sealed class MonoPInvokeCallbackAttribute : Attribute {
+ public MonoPInvokeCallbackAttribute (Type t) {}
+}
+
public class Marshal1 : ICustomMarshaler
{
int param;
[DllImport ("libtest")]
private static extern int mono_test_marshal_pass_return_custom_null_in_delegate (pass_return_int_delegate del);
+ [MonoPInvokeCallback (typeof (pass_return_int_delegate))]
private static object pass_return_int (object i) {
return (int)i;
}
+ [MonoPInvokeCallback (typeof (pass_return_int_delegate))]
private static object pass_return_null (object i) {
return (i == null) ? null : new Object ();
}
return 0;
}
-
+
+ [MonoPInvokeCallback (typeof (custom_out_param_delegate))]
private static void custom_out_param (out object i)
{
i = new object();
public class marshalbool
{
+ [AttributeUsage (AttributeTargets.Method)]
+ sealed class MonoPInvokeCallbackAttribute : Attribute {
+ public MonoPInvokeCallbackAttribute (Type t) {}
+ }
+
[DllImport ("libtest")]
static extern int mono_test_marshal_bool_in (int arg, uint expected,
bool bDefaultMarsh,
public static int test_0_Default_In_Managed ()
{
- MarshalBoolInDelegate fcn = new MarshalBoolInDelegate (new marshalbool ().MarshalBoolInHelper);
+ MarshalBoolInDelegate fcn = new MarshalBoolInDelegate (MarshalBoolInHelper);
int ret;
ret = mono_test_managed_marshal_bool_in (1, 0, 0, fcn);
public static int test_0_Bool_In_Managed ()
{
- MarshalBoolInDelegate fcn = new MarshalBoolInDelegate (new marshalbool ().MarshalBoolInHelper);
+ MarshalBoolInDelegate fcn = new MarshalBoolInDelegate (MarshalBoolInHelper);
int ret;
ret = mono_test_managed_marshal_bool_in (2, 0, 0, fcn);
public static int test_0_I1_In_Managed ()
{
- MarshalBoolInDelegate fcn = new MarshalBoolInDelegate (new marshalbool ().MarshalBoolInHelper);
+ MarshalBoolInDelegate fcn = new MarshalBoolInDelegate (MarshalBoolInHelper);
int ret;
ret = mono_test_managed_marshal_bool_in (3, 0, 0, fcn);
public static int test_0_U1_In_Managed ()
{
- MarshalBoolInDelegate fcn = new MarshalBoolInDelegate (new marshalbool ().MarshalBoolInHelper);
+ MarshalBoolInDelegate fcn = new MarshalBoolInDelegate (MarshalBoolInHelper);
int ret;
ret = mono_test_managed_marshal_bool_in (4, 0, 0, fcn);
public static int test_0_VariantBool_In_Managed ()
{
- MarshalBoolInDelegate fcn = new MarshalBoolInDelegate (new marshalbool ().MarshalBoolInHelper);
+ MarshalBoolInDelegate fcn = new MarshalBoolInDelegate (MarshalBoolInHelper);
int ret;
ret = mono_test_managed_marshal_bool_in (5, 0, 0, fcn);
public static int test_0_Default_Out_Managed ()
{
- MarshalBoolOutDelegate fcn = new MarshalBoolOutDelegate (new marshalbool ().MarshalBoolOutHelper);
+ MarshalBoolOutDelegate fcn = new MarshalBoolOutDelegate (MarshalBoolOutHelper);
int ret;
ret = mono_test_managed_marshal_bool_out (1, 0, 0, fcn);
public static int test_0_Bool_Out_Managed ()
{
- MarshalBoolOutDelegate fcn = new MarshalBoolOutDelegate (new marshalbool ().MarshalBoolOutHelper);
+ MarshalBoolOutDelegate fcn = new MarshalBoolOutDelegate (MarshalBoolOutHelper);
int ret;
ret = mono_test_managed_marshal_bool_out (2, 0, 0, fcn);
public static int test_0_I1_Out_Managed ()
{
- MarshalBoolOutDelegate fcn = new MarshalBoolOutDelegate (new marshalbool ().MarshalBoolOutHelper);
+ MarshalBoolOutDelegate fcn = new MarshalBoolOutDelegate (MarshalBoolOutHelper);
int ret;
ret = mono_test_managed_marshal_bool_out (3, 0, 0, fcn);
public static int test_0_U1_Out_Managed ()
{
- MarshalBoolOutDelegate fcn = new MarshalBoolOutDelegate (new marshalbool ().MarshalBoolOutHelper);
+ MarshalBoolOutDelegate fcn = new MarshalBoolOutDelegate (MarshalBoolOutHelper);
int ret;
ret = mono_test_managed_marshal_bool_out (4, 0, 0, fcn);
public static int test_0_VariantBool_Out_Managed ()
{
- MarshalBoolOutDelegate fcn = new MarshalBoolOutDelegate (new marshalbool ().MarshalBoolOutHelper);
+ MarshalBoolOutDelegate fcn = new MarshalBoolOutDelegate (MarshalBoolOutHelper);
int ret;
ret = mono_test_managed_marshal_bool_out (5, 0, 0, fcn);
public static int test_0_Default_Ref_Managed ()
{
- MarshalBoolRefDelegate fcn = new MarshalBoolRefDelegate (new marshalbool ().MarshalBoolRefHelper);
+ MarshalBoolRefDelegate fcn = new MarshalBoolRefDelegate (MarshalBoolRefHelper);
int ret;
ret = mono_test_managed_marshal_bool_ref (1, 0, 0, 0, 0, fcn);
public static int test_0_Bool_Ref_Managed ()
{
- MarshalBoolRefDelegate fcn = new MarshalBoolRefDelegate (new marshalbool ().MarshalBoolRefHelper);
+ MarshalBoolRefDelegate fcn = new MarshalBoolRefDelegate (MarshalBoolRefHelper);
int ret;
ret = mono_test_managed_marshal_bool_ref (2, 0, 0, 0, 0, fcn);
public static int test_0_I1_Ref_Managed ()
{
- MarshalBoolRefDelegate fcn = new MarshalBoolRefDelegate (new marshalbool ().MarshalBoolRefHelper);
+ MarshalBoolRefDelegate fcn = new MarshalBoolRefDelegate (MarshalBoolRefHelper);
int ret;
ret = mono_test_managed_marshal_bool_ref (3, 0, 0, 0, 0, fcn);
public static int test_0_U1_Ref_Managed ()
{
- MarshalBoolRefDelegate fcn = new MarshalBoolRefDelegate (new marshalbool ().MarshalBoolRefHelper);
+ MarshalBoolRefDelegate fcn = new MarshalBoolRefDelegate (MarshalBoolRefHelper);
int ret;
ret = mono_test_managed_marshal_bool_ref (4, 0, 0, 0, 0, fcn);
public static int test_0_VariantBool_Ref_Managed ()
{
- MarshalBoolRefDelegate fcn = new MarshalBoolRefDelegate (new marshalbool ().MarshalBoolRefHelper);
+ MarshalBoolRefDelegate fcn = new MarshalBoolRefDelegate (MarshalBoolRefHelper);
int ret;
ret = mono_test_managed_marshal_bool_ref (5, 0, 0, 0, 0, fcn);
///////////////////////////////////////////////////////////////////
- unsafe int MarshalBoolInHelper (int arg, uint expected, bool bDefaultMarsh, bool bBoolCustMarsh, bool bI1CustMarsh,
- bool bU1CustMarsh, bool bVBCustMarsh)
+ [MonoPInvokeCallback (typeof (MarshalBoolInDelegate))]
+ unsafe static int MarshalBoolInHelper (int arg, uint expected, bool bDefaultMarsh, bool bBoolCustMarsh, bool bI1CustMarsh,
+ bool bU1CustMarsh, bool bVBCustMarsh)
{
bool* ptestVal;
switch (arg) {
return 0;
}
- unsafe int MarshalBoolOutHelper (int arg, uint testVal, out bool bDefaultMarsh, out bool bBoolCustMarsh,
- out bool bI1CustMarsh, out bool bU1CustMarsh, out bool bVBCustMarsh)
+ [MonoPInvokeCallback (typeof (MarshalBoolOutDelegate))]
+ unsafe static int MarshalBoolOutHelper (int arg, uint testVal, out bool bDefaultMarsh, out bool bBoolCustMarsh,
+ out bool bI1CustMarsh, out bool bU1CustMarsh, out bool bVBCustMarsh)
{
bDefaultMarsh = bBoolCustMarsh = bI1CustMarsh = bU1CustMarsh = bVBCustMarsh = false;
switch (arg) {
return 0;
}
- unsafe int MarshalBoolRefHelper (int arg, uint expected, uint testVal, ref bool bDefaultMarsh, ref bool bBoolCustMarsh,
- ref bool bI1CustMarsh, ref bool bU1CustMarsh, ref bool bVBCustMarsh)
+ [MonoPInvokeCallback (typeof (MarshalBoolRefDelegate))]
+ unsafe static int MarshalBoolRefHelper (int arg, uint expected, uint testVal, ref bool bDefaultMarsh, ref bool bBoolCustMarsh,
+ ref bool bI1CustMarsh, ref bool bU1CustMarsh, ref bool bVBCustMarsh)
{
switch (arg) {
case 1:
private static void RunStuffMode()
{
- for (int i = 0; i < 1000; i++)
+ for (int i = 0; i < 100; i++)
{
Execute(Assembly.GetExecutingAssembly().Location, i.ToString());
}
using System.Threading;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
+using MonoTests.Helpers;
public class Toggleref {
public int __test;
static int test_0_root_keeps_child ()
{
Console.WriteLine ("test_0_root_keeps_child");
- var t = new Thread (SetupLinks);
- t.Start ();
- t.Join ();
+ FinalizerHelpers.PerformNoPinAction (SetupLinks);
GC.Collect ();
GC.WaitForPendingFinalizers ();
{
Console.WriteLine ("test_0_child_goes_away");
- var t = new Thread (SetupLinks2);
- t.Start ();
- t.Join ();
+ FinalizerHelpers.PerformNoPinAction (SetupLinks2);
GC.Collect ();
GC.WaitForPendingFinalizers ();
{
Console.WriteLine ("test_0_CWT_keep_child_alive");
- var t = new Thread (SetupLinks3);
- t.Start ();
- t.Join ();
+ FinalizerHelpers.PerformNoPinAction (SetupLinks3);
GC.Collect ();
GC.WaitForPendingFinalizers ();
return TestDriver.RunTests (typeof (Driver), args);
}
-}
\ No newline at end of file
+}
using System;
using System.IO;
using System.Threading;
-using System.Text;
using System.Diagnostics;
using System.Collections.Generic;
using System.Globalization;
using System.Xml;
+using System.Text;
using System.Text.RegularExpressions;
+
+#if !MOBILE_STATIC
using Mono.Unix.Native;
+#endif
//
// This is a simple test runner with support for parallel execution
{
const string TEST_TIME_FORMAT = "mm\\:ss\\.fff";
const string ENV_TIMEOUT = "TEST_DRIVER_TIMEOUT_SEC";
+ const string MONO_PATH = "MONO_PATH";
class ProcessData {
public string test;
int concurrency = 1;
int timeout = 2 * 60; // in seconds
int expectedExitCode = 0;
+ bool verbose = false;
string testsuiteName = null;
string inputFile = null;
- // FIXME: Add support for runtime arguments + env variables
-
string disabled_tests = null;
string runtime = "mono";
string config = null;
+ string mono_path = null;
var opt_sets = new List<string> ();
+ string aot_run_flags = null;
+ string aot_build_flags = null;
+
// Process options
int i = 0;
while (i < args.Length) {
}
inputFile = args [i + 1];
i += 2;
+ } else if (args [i] == "--runtime") {
+ if (i + 1 >= args.Length) {
+ Console.WriteLine ("Missing argument to --runtime command line option.");
+ return 1;
+ }
+ runtime = args [i + 1];
+ i += 2;
+ } else if (args [i] == "--mono-path") {
+ if (i + 1 >= args.Length) {
+ Console.WriteLine ("Missing argument to --mono-path command line option.");
+ return 1;
+ }
+ mono_path = args [i + 1].Substring(0, args [i + 1].Length);
+
+ i += 2;
+ } else if (args [i] == "--aot-run-flags") {
+ if (i + 1 >= args.Length) {
+ Console.WriteLine ("Missing argument to --aot-run-flags command line option.");
+ return 1;
+ }
+ aot_run_flags = args [i + 1].Substring(0, args [i + 1].Length);
+ i += 2;
+ } else if (args [i] == "--aot-build-flags") {
+ if (i + 1 >= args.Length) {
+ Console.WriteLine ("Missing argument to --aot-build-flags command line option.");
+ return 1;
+ }
+ aot_build_flags = args [i + 1].Substring(0, args [i + 1].Length);
+ i += 2;
+ } else if (args [i] == "--verbose") {
+ verbose = true;
+ i ++;
} else {
Console.WriteLine ("Unknown command line option: '" + args [i] + "'.");
return 1;
output_width = Math.Min (120, ti.test.Length);
}
+ if (aot_build_flags != null) {
+ Console.WriteLine("AOT compiling tests");
+
+ object aot_monitor = new object ();
+ var aot_queue = new Queue<String> (tests);
+
+ List<Thread> build_threads = new List<Thread> (concurrency);
+
+ for (int j = 0; j < concurrency; ++j) {
+ Thread thread = new Thread (() => {
+ while (true) {
+ String test_name;
+
+ lock (aot_monitor) {
+ if (aot_queue.Count == 0)
+ break;
+ test_name = aot_queue.Dequeue ();
+ }
+
+ string test_bitcode_output = test_name + "_bitcode_tmp";
+ string test_bitcode_arg = ",temp-path=" + test_bitcode_output;
+ string aot_args = aot_build_flags + test_bitcode_arg + " " + test_name;
+
+ Directory.CreateDirectory(test_bitcode_output);
+
+ ProcessStartInfo job = new ProcessStartInfo (runtime, aot_args);
+ job.UseShellExecute = false;
+ job.EnvironmentVariables[ENV_TIMEOUT] = timeout.ToString();
+ job.EnvironmentVariables[MONO_PATH] = mono_path;
+ Process compiler = new Process ();
+ compiler.StartInfo = job;
+
+ compiler.Start ();
+
+ if (!compiler.WaitForExit (timeout * 1000)) {
+ try {
+ compiler.Kill ();
+ } catch {
+ }
+ throw new Exception(String.Format("Timeout AOT compiling tests, output in {0}", test_bitcode_output));
+ } else if (compiler.ExitCode != 0) {
+ throw new Exception(String.Format("Error AOT compiling tests, output in {0}", test_bitcode_output));
+ } else {
+ Directory.Delete (test_bitcode_output, true);
+ }
+ }
+ });
+
+ thread.Start ();
+
+ build_threads.Add (thread);
+ }
+
+ for (int j = 0; j < build_threads.Count; ++j)
+ build_threads [j].Join ();
+
+ Console.WriteLine("Done compiling");
+ }
+
List<Thread> threads = new List<Thread> (concurrency);
DateTime test_start_time = DateTime.UtcNow;
string test = ti.test;
string opt_set = ti.opt_set;
- output.Write (String.Format ("{{0,-{0}}} ", output_width), test);
+ if (verbose) {
+ output.Write (String.Format ("{{0,-{0}}} ", output_width), test);
+ } else {
+ Console.Write (".");
+ }
+
+ string test_invoke;
+
+ if (aot_run_flags != null)
+ test_invoke = aot_run_flags + " " + test;
+ else
+ test_invoke = test;
/* Spawn a new process */
string process_args;
if (opt_set == null)
- process_args = test;
+ process_args = test_invoke;
else
- process_args = "-O=" + opt_set + " " + test;
+ process_args = "-O=" + opt_set + " " + test_invoke;
+
ProcessStartInfo info = new ProcessStartInfo (runtime, process_args);
info.UseShellExecute = false;
info.RedirectStandardOutput = true;
info.EnvironmentVariables[ENV_TIMEOUT] = timeout.ToString();
if (config != null)
info.EnvironmentVariables["MONO_CONFIG"] = config;
+ if (mono_path != null)
+ info.EnvironmentVariables[MONO_PATH] = mono_path;
Process p = new Process ();
p.StartInfo = info;
timedout.Add (data);
}
+#if !MOBILE_STATIC
// Force the process to print a thread dump
try {
Syscall.kill (p.Id, Signum.SIGQUIT);
Thread.Sleep (1000);
} catch {
}
+#endif
- output.Write ($"timed out ({timeout}s)");
+ if (verbose) {
+ output.Write ($"timed out ({timeout}s)");
+ }
try {
p.Kill ();
failed.Add (data);
}
- output.Write ("failed, time: {0}, exit code: {1}", (end - start).ToString (TEST_TIME_FORMAT), p.ExitCode);
+ if (verbose)
+ output.Write ("failed, time: {0}, exit code: {1}", (end - start).ToString (TEST_TIME_FORMAT), p.ExitCode);
} else {
var end = DateTime.UtcNow;
passed.Add (data);
}
- output.Write ("passed, time: {0}", (end - start).ToString (TEST_TIME_FORMAT));
+ if (verbose)
+ output.Write ("passed, time: {0}", (end - start).ToString (TEST_TIME_FORMAT));
}
p.Close ();
lock (monitor) {
- Console.WriteLine (output.ToString ());
+ if (verbose)
+ Console.WriteLine (output.ToString ());
}
}
});
writer.WriteEndDocument ();
}
- Console.WriteLine ();
- Console.WriteLine ("Time: {0}", test_time.ToString (TEST_TIME_FORMAT));
- Console.WriteLine ();
- Console.WriteLine ("{0,4} test(s) passed", npassed);
- Console.WriteLine ("{0,4} test(s) failed", nfailed);
- Console.WriteLine ("{0,4} test(s) timed out", ntimedout);
+ if (verbose) {
+ Console.WriteLine ();
+ Console.WriteLine ("Time: {0}", test_time.ToString (TEST_TIME_FORMAT));
+ Console.WriteLine ();
+ Console.WriteLine ("{0,4} test(s) passed", npassed);
+ Console.WriteLine ("{0,4} test(s) failed", nfailed);
+ Console.WriteLine ("{0,4} test(s) timed out", ntimedout);
+ } else {
+ Console.WriteLine ();
+ Console.WriteLine (String.Format ("{0} test(s) passed, {1} test(s) did not pass.", npassed, nfailed));
+ }
if (nfailed > 0) {
Console.WriteLine ();
using System;
using System.Runtime.InteropServices;
+[AttributeUsage (AttributeTargets.Method)]
+sealed class MonoPInvokeCallbackAttribute : Attribute {
+ public MonoPInvokeCallbackAttribute (Type t) {}
+}
+
[StructLayout (LayoutKind.Sequential)]
struct winx64_struct1
{
return 0;
}
+ [MonoPInvokeCallback (typeof (managed_struct1_delegate))]
public static int managed_struct1_test (winx64_struct1 var)
{
if (var.a != 5)
return 0;
}
+ [MonoPInvokeCallback (typeof (managed_struct5_delegate))]
public static int managed_struct5_test (winx64_struct5 var)
{
if (var.a != 5)
return 0;
}
+ [MonoPInvokeCallback (typeof (managed_struct1_struct5_delegate))]
public static int managed_struct1_struct5_test (winx64_struct1 var1, winx64_struct5 var2,
winx64_struct1 var3, winx64_struct5 var4,
winx64_struct1 var5, winx64_struct5 var6)
return 0;
}
+ [MonoPInvokeCallback (typeof (mono_test_Winx64_struct1_ret_delegate))]
public static winx64_struct1 mono_test_Winx64_struct1_ret_test ()
{
return new winx64_struct1 (0x45);
}
+ [MonoPInvokeCallback (typeof (mono_test_Winx64_struct5_ret_delegate))]
public static winx64_struct5 mono_test_Winx64_struct5_ret_test ()
{
return new winx64_struct5 (0x12, 0x34, 0x56);
G_BEGIN_DECLS
+#ifndef MONO_INFINITE_WAIT
+#define MONO_INFINITE_WAIT ((guint32) 0xFFFFFFFF)
+#endif
+
+
#if !defined(HOST_WIN32)
typedef pthread_mutex_t mono_mutex_t;
gint64 usecs;
int res;
- if (timeout_ms == (guint32) 0xFFFFFFFF)
+ if (timeout_ms == MONO_INFINITE_WAIT)
return mono_os_cond_wait (cond, mutex);
/* ms = 10^-3, us = 10^-6, ns = 10^-9 */
#define NSEC_PER_SEC (1000 * 1000 * 1000)
#endif
+#ifndef MONO_INFINITE_WAIT
+#define MONO_INFINITE_WAIT ((guint32) 0xFFFFFFFF)
+#endif
+
G_BEGIN_DECLS
typedef enum {
struct timeval start, current;
int res = 0;
- if (timeout_ms == (guint32) 0xFFFFFFFF)
+ if (timeout_ms == MONO_INFINITE_WAIT)
return mono_os_sem_wait (sem, flags);
ts.tv_sec = timeout_ms / 1000;
return res != 0 ? -1 : 0;
}
- if (timeout_ms == (guint32) 0xFFFFFFFF)
+ if (timeout_ms == MONO_INFINITE_WAIT)
return mono_os_sem_wait (sem, flags);
gettimeofday (&t, NULL);
#define mono_thread_info_run_state(info) (((MonoThreadInfo*)info)->thread_state & THREAD_STATE_MASK)
/*warn at 50 ms*/
-#define SLEEP_DURATION_BEFORE_WARNING (10)
-/*abort at 1 sec*/
-#define SLEEP_DURATION_BEFORE_ABORT 200
+#define SLEEP_DURATION_BEFORE_WARNING (50)
+/*never aborts */
+#define SLEEP_DURATION_BEFORE_ABORT MONO_INFINITE_WAIT
-static long sleepWarnDuration = SLEEP_DURATION_BEFORE_WARNING,
+static guint32 sleepWarnDuration = SLEEP_DURATION_BEFORE_WARNING,
sleepAbortDuration = SLEEP_DURATION_BEFORE_ABORT;
static int suspend_posts, resume_posts, abort_posts, waits_done, pending_ops;
if (threads_callbacks.thread_register) {
if (threads_callbacks.thread_register (info, baseptr) == NULL) {
// g_warning ("thread registation failed\n");
+ mono_native_tls_set_value (thread_info_key, NULL);
g_free (info);
return NULL;
}
gboolean res;
threads_callbacks = *callbacks;
thread_info_size = info_size;
- char *sleepLimit;
+ const char *sleepLimit;
#ifdef HOST_WIN32
res = mono_native_tls_alloc (&thread_info_key, NULL);
res = mono_native_tls_alloc (&thread_exited_key, NULL);
unified_suspend_enabled = g_getenv ("MONO_ENABLE_UNIFIED_SUSPEND") != NULL || mono_threads_is_coop_enabled ();
if ((sleepLimit = g_getenv ("MONO_SLEEP_ABORT_LIMIT")) != NULL) {
+ errno = 0;
long threshold = strtol(sleepLimit, NULL, 10);
if ((errno == 0) && (threshold >= 40)) {
sleepAbortDuration = threshold;
PLATFORM_PATH_SEPARATOR = :
endif
+if INSTALL_MOBILE_STATIC
+# ILASM.exe has features which a mobile_static runtime will not support.
+# It is invoked with an external mono when used in the runtime.
+# We skip it here because otherwise it will fail to verify.
+MOBILE_STATIC_FILTER=grep -v ilasm
+else
+MOBILE_STATIC_FILTER=echo
+endif
+
# Compile all assemblies with the verifier turned on. Code must be valid but not verifiable.
# TODO it would be nice to split assemblies without unsafe code to use the verifier with verifiable mode.
# Skip binary_reference_assemblies because they contain metadata only
mcs-compileall: mono-wrapper etc/mono/config
+ export verifiable_files=`ls "$(mcs_topdir)/class/lib/$$profile/" | grep -E '\.(dll|exe)$$' | $(MOBILE_STATIC_FILTER)` ; \
save_MONO_PATH=$$MONO_PATH; mcs_topdir=`cd $(mcs_topdir) && $(cur_dir_cmd)`; ok=:; \
for profile in $(test_profiles); do \
if [ "binary_reference_assemblies" = "$$profile" ]; then \
MONO_PATH="$$mcs_topdir/class/lib/$$profile$(PLATFORM_PATH_SEPARATOR)$$save_MONO_PATH"; \
fi; \
export MONO_PATH; \
- for i in $(mcs_topdir)/class/lib/$$profile/*.{dll,exe}; do \
+ for stub in $$verifiable_files; do \
+ i=$(mcs_topdir)/class/lib/$$profile/$$stub ; \
+ echo $$i ; \
if [ ! -f $$i ] ; then \
continue ; \
fi ; \
${TESTCMD} --label=corlib --timeout=30m make -w -C mcs/class/corlib run-test
${TESTCMD} --label=verify --timeout=15m make -w -C runtime mcs-compileall
${TESTCMD} --label=profiler --timeout=30m make -w -C mono/profiler -k check
-${TESTCMD} --label=compiler --timeout=30m make -w -C mcs/tests run-test
-${TESTCMD} --label=compiler-errors --timeout=30m make -w -C mcs/errors run-test
${TESTCMD} --label=System --timeout=10m make -w -C mcs/class/System run-test
${TESTCMD} --label=System.XML --timeout=5m make -w -C mcs/class/System.XML run-test
${TESTCMD} --label=Mono.Security --timeout=5m make -w -C mcs/class/Mono.Security run-test
#
# This is a python script and a set of make targets to implement support for conditional submodules
-# There should be a SUBMODULES.json file which contains information about the submodules.
+# Set the SUBMODULES_CONFIG_FILE make variable to the srcdir path of a SUBMODULES.json file which contains information about the submodules.
#
-CONFIG=SUBMODULES.json
SCRIPT=$(top_srcdir)/scripts/submodules/versions.py
# usage $(call ValidateVersionTemplate (name,MAKEFILE VAR,repo name))
define ValidateVersionTemplate
#$(eval REPOSITORY_$(2):=$(shell test -z $(3) && echo $(1) || echo "$(3)"))
-#$(eval DIRECTORY_$(2):=$(shell python $(SCRIPT) get-dir $(1)))
+#$(eval DIRECTORY_$(2):=$(shell python $(SCRIPT) $(SUBMODULES_CONFIG_FILE) get-dir $(1)))
#$(eval DIRECTORY_$(2):=$(shell test -z $(DIRECTORY_$(2)) && echo $(1) || echo $(DIRECTORY_$(2))))
-#$(eval MODULE_$(2):=$(shell python $(SCRIPT) get-url $(1)))
-#$(eval NEEDED_$(2)_VERSION:=$(shell python $(SCRIPT) get-rev $(1)))
-#$(eval $(2)_BRANCH_AND_REMOTE:=$(shell python $(SCRIPT) get-remote-branch $(1)))
+#$(eval MODULE_$(2):=$(shell python $(SCRIPT) $(SUBMODULES_CONFIG_FILE) get-url $(1)))
+#$(eval NEEDED_$(2)_VERSION:=$(shell python $(SCRIPT) $(SUBMODULES_CONFIG_FILE) get-rev $(1)))
+#$(eval $(2)_BRANCH_AND_REMOTE:=$(shell python $(SCRIPT) $(SUBMODULES_CONFIG_FILE) get-remote-branch $(1)))
#$(eval $(2)_VERSION:=$$$$(shell cd $($(2)_PATH) 2>/dev/null && git rev-parse HEAD ))
__bump-version-%:
@if [ "$(REV)" = "" ]; then echo "Usage: make bump-version-$* REV=<ref>"; exit 1; fi
- python $(SCRIPT) set-rev $* $(REV)
- @if [ "$(COMMIT)" = "1" ]; then echo "[submodules] Bump $* to pick up $(REV)." | git commit -F - $(CONFIG); fi
+ python $(SCRIPT) $(SUBMODULES_CONFIG_FILE) set-rev $* $(REV)
+ @if [ "$(COMMIT)" = "1" ]; then echo "[submodules] Bump $* to pick up $(REV)." | git commit -F - $(SUBMODULES_CONFIG_FILE); fi
__bump-branch-%:
@if [ "$(BRANCH)" = "" ]; then echo "Usage: make bump-branch-$* BRANCH=<branch> REMOTE_BRANCH=<remote branch>"; exit 1; fi
@if [ "$(REMOTE_BRANCH)" == "" ]; then echo "Usage: make bump-branch-$* BRANCH=<branch> REMOTE_BRANCH=<remote branch>"; exit 1; fi
- python $(SCRIPT) set-branch $* $(BRANCH)
- python $(SCRIPT) set-remote-branch $* $(REMOTE_BRANCH)
- @if [ "$(COMMIT)" = "1" ]; then echo "[submodules] Bump $* to switch to $(BRANCH) $(REMOTE BRANCH)." | git commit -F - $(CONFIG); fi
+ python $(SCRIPT) $(SUBMODULES_CONFIG_FILE) set-branch $* $(BRANCH)
+ python $(SCRIPT) $(SUBMODULES_CONFIG_FILE) set-remote-branch $* $(REMOTE_BRANCH)
+ @if [ "$(COMMIT)" = "1" ]; then echo "[submodules] Bump $* to switch to $(BRANCH) $(REMOTE BRANCH)." | git commit -F - $(SUBMODULES_CONFIG_FILE); fi
__bump-current-version-%:
REV=$(shell cd $(ACCEPTANCE_TESTS_PATH)/$* && git log -1 --pretty=format:%H); \
- python $(SCRIPT) set-rev $* $$REV; \
- if [ "$(COMMIT)" = "1" ]; then echo "[submodules] Bump $* to pick up $$REV:" | git commit -F - $(CONFIG); fi
+ python $(SCRIPT) $(SUBMODULES_CONFIG_FILE) set-rev $* $$REV; \
+ if [ "$(COMMIT)" = "1" ]; then echo "[submodules] Bump $* to pick up $$REV:" | git commit -F - $(SUBMODULES_CONFIG_FILE); fi
sys.exit(1)
-if len(sys.argv) < 2:
- print("Usage: versions.py <command>")
+if len(sys.argv) < 3:
+ print("Usage: versions.py <path to SUBMODULES.json> <command>")
sys.exit(1)
-CONFIG_FILE = "SUBMODULES.json"
-command = sys.argv[1]
+CONFIG_FILE = sys.argv[1]
+command = sys.argv[2]
submodules = json.load(open(CONFIG_FILE))
if command == "get-rev":
- mod = find_module(submodules, sys.argv[2])
+ mod = find_module(submodules, sys.argv[3])
print(mod["rev"])
elif command == "get-url":
- mod = find_module(submodules, sys.argv[2])
+ mod = find_module(submodules, sys.argv[3])
print(mod["url"])
elif command == "get-dir":
- mod = find_module(submodules, sys.argv[2])
+ mod = find_module(submodules, sys.argv[3])
print(mod["directory"])
elif command == "get-remote-branch":
- mod = find_module(submodules, sys.argv[2])
+ mod = find_module(submodules, sys.argv[3])
print(mod["remote-branch"])
elif command == "set-rev":
- mod = find_module(submodules, sys.argv[2])
- mod["rev"] = sys.argv[3]
+ mod = find_module(submodules, sys.argv[3])
+ mod["rev"] = sys.argv[4]
json.dump(submodules, open(CONFIG_FILE, "w"), indent = 2)
elif command == "set-branch":
- mod = find_module(submodules, sys.argv[2])
- mod["branch"] = sys.argv[3]
+ mod = find_module(submodules, sys.argv[3])
+ mod["branch"] = sys.argv[4]
json.dump(submodules, open(CONFIG_FILE, "w"), indent = 2)
elif command == "set-remote-branch":
- mod = find_module(submodules, sys.argv[2])
- mod["remote-branch"] = sys.argv[3]
+ mod = find_module(submodules, sys.argv[3])
+ mod["remote-branch"] = sys.argv[4]
json.dump(submodules, open(CONFIG_FILE, "w"), indent = 2)
elif command == "cat":
print(json.dumps(submodules, indent = 2))