[submodule "external/linker"]
path = external/linker
url = git://github.com/mono/linker.git
+[submodule "external/roslyn-binaries"]
+ path = external/roslyn-binaries
+ url = git://github.com/mono/roslyn-binaries.git
with_mono_path = MONO_PATH=$(CLASS)
RUNTIME = $(with_mono_path) $(abs_top_builddir)/runtime/mono-wrapper --debug
-MCS = $(RUNTIME) $(mcs_topdir)/class/lib/build/mcs.exe
+MCS = $(RUNTIME) $(CSC) -nologo
ILASM = $(RUNTIME) $(CLASS)/ilasm.exe
include versions.mk
check-ms-test-suite: $(CLASS)/nunitlite.dll
@if $(MAKE) validate-ms-test-suite RESET_VERSIONS=1; then \
- $(MAKE) -C $(MSTESTSUITE_PATH)/conformance build MCS="$(MCS) -debug -t:library -warn:1 -r:$(CLASS)/nunitlite.dll" && \
+ $(MAKE) -C $(MSTESTSUITE_PATH)/conformance build MCS="$(MCS) -debug:portable -t:library -warn:1 -r:$(CLASS)/nunitlite.dll" && \
$(MAKE) -C $(MSTESTSUITE_PATH)/conformance run NUNIT-CONSOLE="$(RUNTIME) $(CLASS)/nunit-lite-console.exe -exclude=MonoBug,BadTest -format:nunit2" NUNIT_XML_RESULT="-result:$(abs_top_builddir)/acceptance-tests/TestResult-ms-test-suite-conformance.xml" || EXIT_CODE=1; \
- $(MAKE) -C $(MSTESTSUITE_PATH)/systemruntimebringup build MCS="$(MCS) -debug -warn:1" && \
+ $(MAKE) -C $(MSTESTSUITE_PATH)/systemruntimebringup build MCS="$(MCS) -debug:portable -warn:1" && \
$(MAKE) -C $(MSTESTSUITE_PATH)/systemruntimebringup run MONO="$(RUNTIME)" || EXIT_CODE=1; \
exit $$EXIT_CODE; \
else \
mono_runtime=mono/mini/mono
AC_SUBST(mono_runtime)
+CSC=$mono_build_root/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools/csc.exe
+
mono_cfg_root=$mono_build_root/runtime
if test x$host_win32 = xyes; then
if test "x$cross_compiling" = "xno"; then
mono_cfg_dir=`cygpath -w -a $mono_cfg_root`\\etc
+ CSC="'"`cygpath -w -a $CSC`"'"
else
mono_cfg_dir=`echo $mono_cfg_root | tr '/' '\\'`\\etc
fi
fi
AC_SUBST(mono_cfg_dir)
+AC_SUBST(CSC)
+
AC_CONFIG_FILES([po/mcs/Makefile.in])
AC_CONFIG_FILES([runtime/mono-wrapper],[chmod +x runtime/mono-wrapper])
echo "BCL_OPTIMIZE = 1" >> $srcdir/$mcsdir/build/config.make
fi
+ echo "CSC_LOCATION = $CSC" >> $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
-Subproject commit 74ab08331c603d45932fa825c49329e124c2c77a
+Subproject commit 8180cef874eb1d631eac3ad186cc28e27165f44f
--- /dev/null
+Subproject commit a1c06d559d6f2cbbaeae86ea87632d409a82ca94
thisdir := .
-SUBDIRS := build jay mcs class nunit24 ilasm tools tests errors docs
+SUBDIRS := build jay mcs class nunit24 ilasm tools tests errors docs packages
# Resgen is corlib specific tool
-basic_SUBDIRS := build jay mcs class
-build_SUBDIRS := build class mcs class/aot-compiler tools
+basic_SUBDIRS := build class
+build_SUBDIRS := build jay class class/aot-compiler tools
monodroid_SUBDIRS := build class
monotouch_SUBDIRS := build class
monotouch_watch_SUBDIRS := build class
aot_hybrid_SUBDIRS := build class ilasm
aot_only_SUBDIRS := build class ilasm
binary_reference_assemblies_SUBDIRS := build class
-net_4_x_SUBDIRS := build mcs class nunit24 ilasm tools tests errors docs
+net_4_x_SUBDIRS := build class nunit24 ilasm tools tests errors docs mcs class/aot-compiler packages
xammac_net_4_5_SUBDIRS := build class
xbuild_12_SUBDIRS := build class tools/xbuild
xbuild_14_SUBDIRS := build class tools/xbuild
if (!Version.TryParse (field.GetValue (null) as string, out version))
return 4;
- if (version < new Version (4, 0))
+ if (version < new Version (4, 8))
return 5;
return 0;
RUNTIME_FLAGS =
TEST_HARNESS = $(topdir)/class/lib/$(PROFILE)/$(PARENT_PROFILE)nunit-lite-console.exe
+PLATFORM_DEBUG_FLAGS = /debug:portable
MCS_FLAGS =
-MBAS_FLAGS = $(PLATFORM_DEBUG_FLAGS)
-LIBRARY_FLAGS = /noconfig
+MBAS_FLAGS = -debug
+LIBRARY_FLAGS =
ifndef CFLAGS
CFLAGS = -g -O2
endif
makefrag = $(depsdir)/$(PROFILE)_$(base_prog).makefrag
+MCS_REFERENCES = $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/%.dll,$(LIB_REFS))
+MCS_REFERENCES += $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/%.exe,$(EXE_REFS))
+
ifndef NO_BUILD
all-local: $(the_lib) $(PROGRAM_config)
endif
$(MKINSTALLDIRS) $(DESTDIR)$(PROGRAM_INSTALL_DIR)
$(INSTALL_BIN) $(the_lib) $(DESTDIR)$(PROGRAM_INSTALL_DIR)
test ! -f $(the_lib).mdb || $(INSTALL_BIN) $(the_lib).mdb $(DESTDIR)$(PROGRAM_INSTALL_DIR)
+ test ! -f $(the_lib:.exe=.pdb) || $(INSTALL_BIN) $(the_lib:.exe=.pdb) $(DESTDIR)$(PROGRAM_INSTALL_DIR)
ifdef PROGRAM_config
$(INSTALL_DATA) $(PROGRAM_config) $(DESTDIR)$(PROGRAM_INSTALL_DIR)
endif
endif
uninstall-local:
- -rm -f $(DESTDIR)$(PROGRAM_INSTALL_DIR)/$(base_prog) $(DESTDIR)$(PROGRAM_INSTALL_DIR)/$(base_prog).mdb $(DESTDIR)$(PROGRAM_INSTALL_DIR)/$(base_prog).config
+ -rm -f $(DESTDIR)$(PROGRAM_INSTALL_DIR)/$(base_prog) $(DESTDIR)$(PROGRAM_INSTALL_DIR)/$(base_prog).mdb \
+ $(DESTDIR)$(PROGRAM_INSTALL_DIR)/$(base_prog:.exe=.pdb) $(DESTDIR)$(PROGRAM_INSTALL_DIR)/$(base_prog).config
endif
clean-local:
-include $(makefrag)
-MCS_REFERENCES = $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/%.dll,$(LIB_REFS))
-MCS_REFERENCES += $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/%.exe,$(EXE_REFS))
-
all-local: $(makefrag) $(extra_targets)
ifdef BUILT_SOURCES
endif
ifdef RESOURCE_STRINGS
-ifdef BOOTSTRAP_PROFILE
-ifneq (basic, $(BUILD_TOOLS_PROFILE))
+ifneq (basic, $(PROFILE))
RESOURCE_STRINGS_FILES += $(RESOURCE_STRINGS:%=--resourcestrings:%)
endif
endif
-endif
#
# The bare directory contains the plain versions of System and System.Xml
$(MKINSTALLDIRS) $(DESTDIR)$(LIBRARY_INSTALL_DIR)
$(INSTALL_LIB) $(the_lib) $(DESTDIR)$(LIBRARY_INSTALL_DIR)/$(LIBRARY_NAME)
test ! -f $(the_lib).mdb || $(INSTALL_LIB) $(the_lib).mdb $(DESTDIR)$(LIBRARY_INSTALL_DIR)/$(LIBRARY_NAME).mdb
+ test ! -f $(the_lib:.dll=.pdb) || $(INSTALL_LIB) $(the_lib:.dll=.pdb) $(DESTDIR)$(LIBRARY_INSTALL_DIR)/$(LIBRARY_NAME:.dll=.pdb)
+
ifdef PLATFORM_AOT_SUFFIX
test ! -f $(aot_lib) || $(INSTALL_LIB) $(aot_lib) $(DESTDIR)$(LIBRARY_INSTALL_DIR)
endif
uninstall-local:
- -rm -f $(DESTDIR)$(LIBRARY_INSTALL_DIR)/$(LIBRARY_NAME) $(DESTDIR)$(LIBRARY_INSTALL_DIR)/$(LIBRARY_NAME).mdb
+ -rm -f $(DESTDIR)$(LIBRARY_INSTALL_DIR)/$(LIBRARY_NAME) $(DESTDIR)$(LIBRARY_INSTALL_DIR)/$(LIBRARY_NAME).mdb $(DESTDIR)$(LIBRARY_INSTALL_DIR)/$(LIBRARY_NAME:.dll=.pdb)
else
# Platform-specific makefile rules. This one's for linux.
#
-PLATFORM_DEBUG_FLAGS = -debug
PLATFORM_MCS_FLAGS =
PLATFORM_RUNTIME = $(RUNTIME)
PLATFORM_CORLIB = mscorlib.dll
# Platform-specific makefile rules. This one's for linux.
#
-PLATFORM_DEBUG_FLAGS = -debug
PLATFORM_MCS_FLAGS =
PLATFORM_RUNTIME = $(RUNTIME)
PLATFORM_CORLIB = mscorlib.dll
# Win32 platform-specific makefile rules.
#
-PLATFORM_DEBUG_FLAGS = /debug+ /debug:full
-PLATFORM_MCS_FLAGS = /nologo
+PLATFORM_MCS_FLAGS =
PLATFORM_RUNTIME =
PLATFORM_CORLIB = mscorlib.dll
PLATFORM_TEST_HARNESS_EXCLUDES = NotOnWindows,
BOOTSTRAP_PROFILE = build
-BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
-MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
+BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" CSC_SDK_PATH_DISABLED= $(INTERNAL_CSC)
+MCS = $(BOOTSTRAP_MCS)
# Use system resgen as we don't want local System.Windows.Forms dependency
RESGEN = resgen2
BOOTSTRAP_PROFILE = build
-BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
-MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
+BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" CSC_SDK_PATH_DISABLED= $(INTERNAL_CSC)
+MCS = $(BOOTSTRAP_MCS)
# Use system resgen as we don't want local System.Windows.Forms dependency
RESGEN = resgen2
monolite_flag := $(depsdir)/use-monolite
use_monolite := $(wildcard $(monolite_flag))
-MONOLITE_MCS = $(topdir)/class/lib/monolite/basic.exe
+MONOLITE_MSCORLIB = $(topdir)/class/lib/monolite/mscorlib.dll
+
+# Bootstrap compiler does not have to be same as production compiler
+INTERNAL_GMCS = $(CSC_LOCATION)
ifdef use_monolite
PROFILE_RUNTIME = $(with_mono_path_monolite) $(RUNTIME)
-BOOTSTRAP_MCS = $(PROFILE_RUNTIME) $(RUNTIME_FLAGS) $(MONOLITE_MCS)
else
PROFILE_RUNTIME = $(EXTERNAL_RUNTIME)
-BOOTSTRAP_MCS = $(EXTERNAL_MCS)
endif
-MCS = $(with_mono_path) $(INTERNAL_GMCS)
+INTERNAL_CSC = $(PROFILE_RUNTIME) $(RUNTIME_FLAGS) $(INTERNAL_GMCS)
+BOOTSTRAP_MCS = CSC_SDK_PATH_DISABLED= $(INTERNAL_CSC)
+MCS = $(BOOTSTRAP_MCS)
+
+DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
-PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:MONO -d:BOOTSTRAP_BASIC -nowarn:1699 -lib:$(topdir)/class/lib/$(PROFILE)
+PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:MONO -d:BOOTSTRAP_BASIC -nowarn:1699 -nostdlib $(DEFAULT_REFERENCES)
NO_SIGN_ASSEMBLY = yes
NO_TEST = yes
NO_INSTALL = yes
#
# Copy from rules.make because I don't know how to unset MCS_FLAGS
#
-USE_MCS_FLAGS = /codepage:$(CODEPAGE) $(LOCAL_MCS_FLAGS) $(PLATFORM_MCS_FLAGS) $(PROFILE_MCS_FLAGS)
+USE_MCS_FLAGS = /codepage:$(CODEPAGE) /nologo /noconfig $(LOCAL_MCS_FLAGS) $(PLATFORM_MCS_FLAGS) $(PROFILE_MCS_FLAGS)
.PHONY: profile-check do-profile-check
profile-check:
do-profile-check: $(depsdir)/.stamp
@ok=:; \
rm -f $(PROFILE_EXE) $(PROFILE_OUT); \
+ if [ -z '$(MAKE_Q)' ] && [ -n '$(PROFILE_RUNTIME)' ]; then $(PROFILE_RUNTIME) --version; fi; \
$(MAKE) $(MAKE_Q) $(PROFILE_OUT) || ok=false; \
if $$ok; then rm -f $(PROFILE_EXE) $(PROFILE_OUT); else \
- if test -f $(MONOLITE_MCS); then \
- $(MAKE) -s do-profile-check-monolite ; \
+ if test ! -s $(MONOLITE_MSCORLIB); then \
+ $(MAKE) $(MAKE_Q) do-get-monolite ; \
+ fi; \
+ if test -f $(MONOLITE_MSCORLIB); then \
+ $(MAKE) $(MAKE_Q) do-profile-check-monolite ; \
else \
- echo "*** The compiler '$(BOOTSTRAP_MCS)' doesn't appear to be usable." 1>&2; \
- echo "*** You need Mono version 4.0 or better installed to build MCS" 1>&2 ; \
+ echo "*** The runtime '$(PROFILE_RUNTIME)' doesn't appear to be usable." 1>&2; \
+ echo "*** You need Mono version 4.8 or better installed to build MCS" 1>&2 ; \
echo "*** Check mono README for information on how to bootstrap a Mono installation." 1>&2 ; \
- echo "*** The version of '$(BOOTSTRAP_MCS)' is: `$(BOOTSTRAP_MCS) --version`." 1>&2 ; \
exit 1; fi; fi
ifdef use_monolite
+do-get-monolite:
+
do-profile-check-monolite:
@echo "*** The contents of your 'monolite' directory may be out-of-date" 1>&2
@echo "*** You may want to try 'make get-monolite-latest'" 1>&2
else
+do-get-monolite:
+ @echo "*** Downloading bootstrap required 'monolite'" 1>&2
+ $(MAKE) $(MAKE_Q) -C $(topdir)/../ get-monolite-latest
+
do-profile-check-monolite: $(depsdir)/.stamp
- @echo "*** The compiler '$(BOOTSTRAP_MCS)' doesn't appear to be usable." 1>&2
+ @echo "*** The runtime '$(PROFILE_RUNTIME)' doesn't appear to be usable." 1>&2
@echo "*** Trying the 'monolite' directory." 1>&2
@echo dummy > $(monolite_flag)
$(MAKE) do-profile-check
endif
$(PROFILE_EXE): $(topdir)/build/common/basic-profile-check.cs
- $(BOOTSTRAP_MCS) /warn:0 /out:$@ $<
- echo -n "Bootstrap compiler: " 1>&2
- $(BOOTSTRAP_MCS) --version 1>&2
+ $(MAKE) $(MAKE_Q) -C $(topdir)/packages
+ $(INTERNAL_CSC) /warn:0 /noconfig /r:System.dll /r:mscorlib.dll /out:$@ $<
$(PROFILE_OUT): $(PROFILE_EXE)
$(PROFILE_RUNTIME) $< > $@ 2>&1
BOOTSTRAP_PROFILE = basic
BUILD_TOOLS_PROFILE = basic
-INTERNAL_GMCS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/basic.exe
-BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
-MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
+# Using CSC_SDK_PATH_DISABLED for sanity check that all references have path specified
+
+BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" CSC_SDK_PATH_DISABLED= $(INTERNAL_CSC)
+MCS = $(BOOTSTRAP_MCS)
# nuttzing!
BOOTSTRAP_PROFILE = build
-BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
-MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
+BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" CSC_SDK_PATH_DISABLED= $(INTERNAL_CSC)
+MCS = $(BOOTSTRAP_MCS)
# Use system resgen as we don't want local System.Windows.Forms dependency
RESGEN = resgen2
BOOTSTRAP_PROFILE = build
-BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
-MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
+BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" CSC_SDK_PATH_DISABLED= $(INTERNAL_CSC)
+MCS = $(BOOTSTRAP_MCS)
# Use system resgen as we don't want local System.Windows.Forms dependency
RESGEN := $(dir $(shell which $(EXTERNAL_MCS)))resgen2
BOOTSTRAP_PROFILE = build
-BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
-MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
+# Using CSC_SDK_PATH_DISABLED for sanity check that all references have path specified
+
+BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" CSC_SDK_PATH_DISABLED= $(INTERNAL_CSC)
+MCS = $(BOOTSTRAP_MCS)
# nuttzing!
BOOTSTRAP_PROFILE = build
-BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
-MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
+BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" CSC_SDK_PATH_DISABLED= $(INTERNAL_CSC)
+MCS = $(BOOTSTRAP_MCS)
# Use system resgen as we don't want local System.Windows.Forms dependency
RESGEN := $(dir $(shell which $(EXTERNAL_MCS)))resgen2
BUILD_TOOLS_PROFILE = build
endif
-USE_MCS_FLAGS = /codepage:$(CODEPAGE) $(LOCAL_MCS_FLAGS) $(PLATFORM_MCS_FLAGS) $(PROFILE_MCS_FLAGS) $(MCS_FLAGS)
+USE_MCS_FLAGS = /codepage:$(CODEPAGE) /nologo /noconfig /deterministic $(LOCAL_MCS_FLAGS) $(PLATFORM_MCS_FLAGS) $(PROFILE_MCS_FLAGS) $(MCS_FLAGS)
USE_MBAS_FLAGS = /codepage:$(CODEPAGE) $(LOCAL_MBAS_FLAGS) $(PLATFORM_MBAS_FLAGS) $(PROFILE_MBAS_FLAGS) $(MBAS_FLAGS)
USE_CFLAGS = $(LOCAL_CFLAGS) $(CFLAGS) $(CPPFLAGS)
CSCOMPILE = $(Q_MCS) $(MCS) $(USE_MCS_FLAGS)
INSTALL_LIB = $(INSTALL_BIN)
MKINSTALLDIRS = $(SHELL) $(topdir)/mkinstalldirs
INTERNAL_MBAS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/mbas/mbas.exe
-INTERNAL_GMCS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/mcs.exe
INTERNAL_ILASM = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/ilasm.exe
INTERNAL_CSC = $(RUNTIME) $(RUNTIME_FLAGS) $(CSC_LOCATION)
net_4_x_SUBDIRS = $(common_DEPS_SUBDIRS) $(drawing_DEPS_SUBDIRS)
net_4_x_PARALLEL_SUBDIRS = $(common_SUBDIRS)
-build_PARALLEL_SUBDIRS = System.Runtime System.Reflection System.Collections System.Resources.ResourceManager System.Globalization \
+basic_PARALLEL_SUBDIRS = System.Runtime System.Reflection System.Collections System.Resources.ResourceManager System.Globalization \
System.Threading.Tasks System.Collections.Concurrent System.Text.Encoding System.IO System.Threading System.Diagnostics.Debug \
System.Linq.Expressions System.Dynamic.Runtime System.Linq System.Threading.Tasks.Parallel System.Xml.ReaderWriter \
System.Diagnostics.Tools System.Reflection.Primitives System.Runtime.Extensions System.Runtime.InteropServices System.Text.Encoding.Extensions \
System.Runtime.Numerics System.Xml.XDocument System.Reflection.Extensions
+build_PARALLEL_SUBDIRS = $(basic_PARALLEL_SUBDIRS)
+
monodroid_SUBDIRS = $(monotouch_SUBDIRS)
monodroid_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS)
thisdir = class
-basic_SUBDIRS := corlib Mono.Security System System.XML System.Core
-
pcl_facade_dirs := Facades
+# The minimal set of csc dependencies
+basic_SUBDIRS := \
+ corlib \
+ Mono.Security \
+ System \
+ System.XML \
+ System.Core \
+ System.ComponentModel.Composition.4.5 \
+ System.Numerics \
+ System.Xml.Linq \
+ Mono.Cecil \
+ $(pcl_facade_dirs) \
+ ../tools/cil-stringreplacer
+
# resgen is corlib specific so we need to wait until corlib is build
# and build it just a step before first dll needs it
resgen_dir = ../tools/resgen
System.XML \
Mono.Posix \
System.Core \
- Mono.Cecil \
- Mono.Cecil.Mdb \
System.ComponentModel.Composition.4.5 \
System.Numerics \
System.Xml.Linq \
- $(pcl_facade_dirs)
+ Mono.Cecil \
+ $(pcl_facade_dirs) \
+ ../tools/cil-stringreplacer
mobile_common_dirs := \
corlib \
xammac_net_4_5_SUBDIRS := $(xammac_4_5_dirs)
binary_reference_assemblies_SUBDIRS := reference-assemblies
net_4_x_SUBDIRS := $(net_4_x_dirs) $(xbuild_4_0_dirs)
-net_4_x_PARALLEL_SUBDIRS := $(net_4_x_parallel_dirs) aot-compiler
+net_4_x_PARALLEL_SUBDIRS := $(net_4_x_parallel_dirs)
xbuild_12_SUBDIRS := $(xbuild_4_0_dirs)
xbuild_14_SUBDIRS := $(xbuild_4_0_dirs) Microsoft.NuGet.Build.Tasks
MicrosoftAjaxLibrary/License.htm \
test-helpers/NetworkHelpers.cs \
test-helpers/SocketResponder.cs \
- lib/$(monolite_dir)/basic.exe \
$(monolite_files)
.PHONY: all-local $(STD_TARGETS:=-local)
$(monolite_files): lib/$(monolite_dir)/%: lib/build/%
cp -p $< $@
-lib/$(monolite_dir)/basic.exe:
- cp -p lib/basic/basic.exe lib/$(monolite_dir)
-
$(build_files:%=lib/build/%):
cd $(topdir) && $(MAKE) profile-do--build--all NO_DIR_CHECK=1 SKIP_AOT=1
-dist-monolite: $(monolite_files) lib/$(monolite_dir)/basic.exe
+dist-monolite: $(monolite_files)
dist-default: dist-monolite
compile-resources: Test/resources/TestTasks-$(PROFILE).dll
cp Test/resources/TestTasks-$(PROFILE).dll Test/resources/TestTasks.dll
- cp Test/resources/TestTasks-$(PROFILE).dll.mdb Test/resources/TestTasks.dll.mdb
-# cp Test/resources/TestTasks-$(PROFILE).pdb Test/resources/TestTasks.pdb
+ cp Test/resources/TestTasks-$(PROFILE).pdb Test/resources/TestTasks.pdb
include $(XBUILD_DIR)/xbuild_test.make
include ../../build/library.make
protected override string ToolName {
get {
- return MSBuildUtils.RunningOnWindows ? "mcs.bat" : "mcs.exe";
+ return MSBuildUtils.RunningOnWindows ? "csc.bat" : "csc.exe";
}
}
}
[Test]
+ [Category ("NotWorking")] // https://bugzilla.xamarin.com/show_bug.cgi?id=44974
public void SingleStepping () {
Event e = run_until ("single_stepping");
req.Disable ();
var frames = e.Thread.GetFrames ();
var locs = frames [0].Method.Locations;
- var next_loc = locs.First (l => (l.LineNumber == frames [0].Location.LineNumber + 2));
+
+ var next_loc = locs.First (l => (l.LineNumber == frames [0].Location.LineNumber + 3));
e.Thread.SetIP (next_loc);
req.Disable ();
var frames = e.Thread.GetFrames ();
var locs = frames [0].Method.Locations;
- var prev_loc = locs.First (l => (l.LineNumber == frames [0].Location.LineNumber - 3));
+ var prev_loc = locs.First (l => (l.LineNumber == frames [0].Location.LineNumber - 1));
AssertValue (2, frames [0].GetValue (frames [0].Method.GetLocal ("i")));
// Set back the ip to the first i ++; line
mcs.StartInfo.UseShellExecute=false;
mcs.StartInfo.RedirectStandardOutput=true;
mcs.StartInfo.RedirectStandardError=true;
- mcs.ErrorDataReceived += new DataReceivedEventHandler (McsStderrDataReceived);
+ mcs.OutputDataReceived += new DataReceivedEventHandler (McsStderrDataReceived);
// Use same text decoder as mcs and not user set values in Console
mcs.StartInfo.StandardOutputEncoding =
options.Win32Resource);
if (options.IncludeDebugInformation)
- args.Append("/debug+ /optimize- ");
+ args.Append("/debug:portable /optimize- ");
else
args.Append("/debug- /optimize+ ");
args.Append ("/noconfig ");
- args.Append (" -- ");
+ args.Append ("/nologo ");
+
+ // args.Append (" -- ");
foreach (string source in fileNames)
args.AppendFormat("\"{0}\" ",source);
return args.ToString();
{
//If this NRE, we're in deep problems because Register Must have
lock (blocking_threads) {
- blocking_threads.Remove (Thread.CurrentThread);
- if (THROW_ON_ABORT_RETRIES)
- threads_stacktraces.Remove (Thread.CurrentThread);
+ var current = Thread.CurrentThread;
+ blocking_threads.Remove (current);
+ if (THROW_ON_ABORT_RETRIES) {
+ if (blocking_threads.IndexOf (current) == -1)
+ threads_stacktraces.Remove (current);
+ }
if (in_cleanup && blocking_threads.Count == 0)
Monitor.Pulse (blocking_threads);
//if (!File.Exists (Mono))
// throw new FileNotFoundException ("Windows mono path not found: " + Mono);
- CSharpCompiler = Path.Combine (GacPath, "4.5\\mcs.exe");
- if (!File.Exists (CSharpCompiler))
- CSharpCompiler = Path.Combine (Path.GetDirectoryName (GacPath), "lib\\build\\mcs.exe");
+ CSharpCompiler = Path.Combine (GacPath, "4.5", "csc.exe");
+ if (!File.Exists (CSharpCompiler)) {
+ // Starting from mono\mcs\class
+ CSharpCompiler = Path.Combine (Path.GetDirectoryName (GacPath), "..", "..", "external", "roslyn-binaries",
+ "Microsoft.Net.Compilers", "Microsoft.Net.Compilers.1.3.2", "tools", "csc.exe");
+ }
//if (!File.Exists (CSharpCompiler))
// throw new FileNotFoundException ("C# compiler not found at " + CSharpCompiler);
Mono = "mono";
var mscorlibPath = new Uri (typeof (object).Assembly.CodeBase).LocalPath;
- CSharpCompiler = Path.GetFullPath (Path.Combine (mscorlibPath, "..", "..", "..", "..", "bin", "mcs"));
+ CSharpCompiler = Path.GetFullPath (Path.Combine (mscorlibPath, "..", "..", "..", "..", "bin", "csc"));
if (!File.Exists (CSharpCompiler))
- CSharpCompiler = "mcs";
+ CSharpCompiler = "csc";
VBCompiler = Path.GetFullPath (Path.Combine (mscorlibPath, "..", "..", "..", "..", "bin", "vbnc"));
if (!File.Exists (VBCompiler))
continue;
}
- throw new Exception (compilerError.ToString ());
+ Assert.Fail (compilerError.ToString ());
}
}
public class ClientWebSocketTest
{
const string EchoServerUrl = "ws://corefx-net.cloudapp.net/WebSocket/EchoWebSocket.ashx";
- int Port = NetworkHelpers.FindFreePort ();
+
+ ClientWebSocket socket;
+ MethodInfo headerSetMethod;
+ int Port;
+
+ [SetUp]
+ public void Setup ()
+ {
+ socket = new ClientWebSocket ();
+ Port = NetworkHelpers.FindFreePort ();
+ }
+
HttpListener _listener;
HttpListener listener {
get {
if (_listener != null)
return _listener;
+
var tmp = new HttpListener ();
tmp.Prefixes.Add ("http://localhost:" + Port + "/");
tmp.Start ();
return _listener = tmp;
}
}
- ClientWebSocket _socket;
- ClientWebSocket socket { get { return _socket ?? (_socket = new ClientWebSocket ()); } }
- MethodInfo headerSetMethod;
[TearDown]
public void Teardown ()
_listener.Stop ();
_listener = null;
}
- if (_socket != null) {
- if (_socket.State == WebSocketState.Open)
- _socket.CloseAsync (WebSocketCloseStatus.NormalClosure, string.Empty, CancellationToken.None).Wait (2000);
- _socket.Dispose ();
- _socket = null;
+ if (socket != null) {
+ if (socket.State == WebSocketState.Open)
+ socket.CloseAsync (WebSocketCloseStatus.NormalClosure, string.Empty, CancellationToken.None).Wait (2000);
+ socket.Dispose ();
}
}
+++ /dev/null
-#include System.dll.sources
-../corlib/System.Security.Permissions/HostProtectionAttribute.cs
include ../../build/rules.make
the_libdir = $(topdir)/class/lib/$(PROFILE)/
+CSC_DIR = $(dir $(CSC_LOCATION))
# mcs.exe is only in the build profile, but the aot image should be compiled against the current
# profile
-mcs_exe = $(topdir)/class/lib/build/mcs.exe
+mcs_exe = $(the_libdir)/mcs.exe
mcs_aot_image = $(the_libdir)/mcs.exe$(PLATFORM_AOT_SUFFIX)
+csc_exe = $(CSC_LOCATION)
+csc_aot_image = $(csc_exe)$(PLATFORM_AOT_SUFFIX)
+csc_MCS_dll = $(CSC_DIR)/Microsoft.CodeAnalysis.CSharp.dll
+csc_MCS_image = $(csc_MCS_dll)$(PLATFORM_AOT_SUFFIX)
+csc_MC_dll = $(CSC_DIR)/Microsoft.CodeAnalysis.dll
+csc_MC_image = $(csc_MC_dll)$(PLATFORM_AOT_SUFFIX)
+csc_SRM_dll = $(CSC_DIR)/System.Reflection.Metadata.dll
+csc_SRM_image = $(csc_SRM_dll)$(PLATFORM_AOT_SUFFIX)
+csc_SCI_dll = $(CSC_DIR)/System.Collections.Immutable.dll
+csc_SCI_image = $(csc_SCI_dll)$(PLATFORM_AOT_SUFFIX)
mscorlib_dll = $(the_libdir)/mscorlib.dll
mscorlib_aot_image = $(mscorlib_dll)$(PLATFORM_AOT_SUFFIX)
$(mcs_aot_image): $(mcs_exe) $(mscorlib_dll) $(runtime_dep)
$(Q_AOT) MONO_PATH='$(the_libdir)' > $(PROFILE)_aot.log 2>&1 $(RUNTIME) --aot=bind-to-runtime-version,outfile=$(mcs_aot_image) --debug $(mcs_exe) || cat $(PROFILE)_aot.log || (cat $(PROFILE)_aot.log; exit 1)
+$(csc_aot_image): $(csc_exe) $(mscorlib_dll) $(runtime_dep)
+ $(Q_AOT) MONO_PATH='$(the_libdir)' > $(PROFILE)_aot.log 2>&1 $(RUNTIME) --aot=bind-to-runtime-version,outfile=$(csc_aot_image) --debug $(csc_exe) || cat $(PROFILE)_aot.log || (cat $(PROFILE)_aot.log; exit 1)
+
$(mscorlib_aot_image): $(mscorlib_dll) $(runtime_dep)
$(Q_AOT) MONO_PATH='$(the_libdir)' > $(PROFILE)_aot.log 2>&1 $(RUNTIME) --aot=bind-to-runtime-version --debug $(mscorlib_dll) || (cat $(PROFILE)_aot.log; exit 1)
+$(csc_MC_image): $(csc_MC_dll) $(runtime_dep)
+ $(Q_AOT) MONO_PATH='$(the_libdir)' > $(PROFILE)_aot.log 2>&1 $(RUNTIME) --aot=bind-to-runtime-version,outfile=$(csc_MC_image) --debug $(csc_MC_dll) || (cat $(PROFILE)_aot.log; exit 1)
+
+$(csc_MCS_image): $(csc_MCS_dll) $(runtime_dep)
+ $(Q_AOT) MONO_PATH='$(the_libdir)' > $(PROFILE)_aot.log 2>&1 $(RUNTIME) --aot=bind-to-runtime-version,outfile=$(csc_MCS_image) --debug $(csc_MCS_dll) || (cat $(PROFILE)_aot.log; exit 1)
+
+$(csc_SRM_image): $(csc_SRM_dll) $(runtime_dep)
+ $(Q_AOT) MONO_PATH='$(the_libdir)' > $(PROFILE)_aot.log 2>&1 $(RUNTIME) --aot=bind-to-runtime-version,outfile=$(csc_SRM_image) --debug $(csc_SRM_dll) || (cat $(PROFILE)_aot.log; exit 1)
+
+$(csc_SCI_image): $(csc_SCI_dll) $(runtime_dep)
+ $(Q_AOT) MONO_PATH='$(the_libdir)' > $(PROFILE)_aot.log 2>&1 $(RUNTIME) --aot=bind-to-runtime-version,outfile=$(csc_SCI_image) --debug $(csc_SCI_dll) || (cat $(PROFILE)_aot.log; exit 1)
+
ifdef ENABLE_AOT
clean-local:
- -rm -f $(mscorlib_aot_image) $(mcs_aot_image) $(PROFILE)_aot.log
+ -rm -f $(mscorlib_aot_image) $(mcs_aot_image) $(csc_aot_image) $(csc_SRM_image) $(csc_SCI_image) $(PROFILE)_aot.log
# AOT build profile mcs to speed up build
ifeq ($(PROFILE),build)
-all-local: $(mscorlib_aot_image) $(mcs_aot_image)
+all-local: $(mscorlib_aot_image) $(csc_aot_image) $(csc_SRM_image) $(csc_SCI_image) $(csc_MC_image) $(csc_MCS_image)
install-local:
endif
#LIBRARY_USE_INTERMEDIATE_FILE = yes
ifeq (2, $(FRAMEWORK_VERSION_MAJOR))
-LIB_MCS_FLAGS += --runtime:v4
+LIB_MCS_FLAGS += -runtimemetadataversion:v4.0.30319
else
ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
-LIB_MCS_FLAGS += --runtime:v4
+LIB_MCS_FLAGS += -runtimemetadataversion:v4.0.30319
else
$(error Unknown framework version)
endif
using System.Runtime.CompilerServices;
[assembly:AssemblyVersion("1.0.0.0")]
-[assembly:AssemblyDelaySign(false)]
+[assembly:AssemblyDelaySign(true)]
[assembly:AssemblyKeyFile("../../class/mono.snk")]
/resource:Resources/mono-ecma.css,mono-ecma.css \
/resource:Resources/mono-ecma.xsl,mono-ecma.xsl \
/resource:Resources/toc-html.xsl,toc-html.xsl \
- $(IMAGE_RESOURCE_COMMAND) \
- /publicsign
+ $(IMAGE_RESOURCE_COMMAND)
CLEAN_FILES += $(the_lib).config
[assembly:System.Reflection.AssemblyVersionAttribute ("1.0.0.0")]
-[assembly:System.Reflection.AssemblyKeyFile("key.snk")]
public class B
{
using System.Reflection;
using System.Runtime.CompilerServices;
-[assembly: AssemblyKeyFile ("key.snk")]
[assembly: InternalsVisibleTo ("cs0281, PublicKey=0024000004800000940000000602000000240000525341310004000011000000e39d99616f48cf7d6d59f345e485e713e89b8b1265a31b1a393e9894ee3fbddaf382dcaf4083dc31ee7a40a2a25c69c6d019fba9f37ec17fd680e4f6fe3b5305f71ae9e494e3501d92508c2e98ca1e22991a217aa8ce259c9882ffdfff4fbc6fa5e6660a8ff951cd94ed011e5633651b64e8f4522519b6ec84921ee22e4840e8")]
public class FriendClass
TEST_PATTERN = 'v4'
TESTER_OPTIONS = -compiler-options:"-v --break-on-ice -d:NET_4_0;NET_4_5"
-COMPILER = $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/mcs.exe
+COMPILER = $(topdir)/class/lib/$(PROFILE)/mcs.exe
TESTER = MONO_RUNTIME='$(RUNTIME)' $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(LOCAL_RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/compiler-tester.exe
run-mcs-tests: $(TEST_SUPPORT_FILES)
csproj-local install-local uninstall-local:
CS0029-26-lib.dll : CS0029-26-lib.cs
- $(CSCOMPILE) /target:library /publicsign /out:$@ $<
+ $(CSCOMPILE) /target:library /publicsign /keyfile:key.snk /out:$@ $<
CS0266-25-lib.dll: CS0266-25-lib.cs
$(CSCOMPILE) /target:library /r:$(topdir)/class/lib/$(PROFILE)/System.Core.dll /out:$@ $<
dlls/first/CS1701-lib.dll: dlls/first/CS1701-lib.cs
- $(CSCOMPILE) /target:library /warn:0 /publicsign /out:$@ $<
+ $(CSCOMPILE) /target:library /warn:0 /publicsign /keyfile:key.snk /out:$@ $<
dlls/first/CS1702-lib.dll: dlls/first/CS1702-lib.cs
- $(CSCOMPILE) /target:library /warn:0 /publicsign /out:$@ $<
+ $(CSCOMPILE) /target:library /warn:0 /publicsign /keyfile:key.snk /out:$@ $<
dlls/first/CS1703-lib.dll: dlls/first/CS1703-lib.cs
- $(CSCOMPILE) /target:library /warn:0 /publicsign /out:$@ $<
+ $(CSCOMPILE) /target:library /warn:0 /publicsign /keyfile:key.snk /out:$@ $<
dlls/first/CS1705-lib.dll: dlls/first/CS1705-lib.cs
- $(CSCOMPILE) /target:library /warn:0 /publicsign /out:$@ $<
+ $(CSCOMPILE) /target:library /warn:0 /publicsign /keyfile:key.snk /out:$@ $<
dlls/second/CS1701-lib.dll: dlls/second/CS1701-lib.cs
- $(CSCOMPILE) /target:library /warn:0 /publicsign /out:$@ $<
+ $(CSCOMPILE) /target:library /warn:0 /publicsign /keyfile:key.snk /out:$@ $<
dlls/second/CS1702-lib.dll: dlls/second/CS1702-lib.cs
- $(CSCOMPILE) /target:library /warn:0 /publicsign /out:$@ $<
+ $(CSCOMPILE) /target:library /warn:0 /publicsign /keyfile:key.snk /out:$@ $<
dlls/second/CS1703-lib.dll: dlls/second/CS1703-lib.cs
- $(CSCOMPILE) /target:library /warn:0 /publicsign /out:$@ $<
+ $(CSCOMPILE) /target:library /warn:0 /publicsign /keyfile:key.snk /out:$@ $<
dlls/second/CS1705-lib.dll: dlls/second/CS1705-lib.cs
- $(CSCOMPILE) /target:library /warn:0 /publicsign /out:$@ $<
+ $(CSCOMPILE) /target:library /warn:0 /publicsign /keyfile:key.snk /out:$@ $<
CS1701-lib.dll : CS1701-lib.cs
$(CSCOMPILE) /target:library /warn:0 /r:dlls/first/CS1701-lib.dll /out:$@ $<
CS1705-lib.dll : CS1705-lib.cs
$(CSCOMPILE) /target:library /warn:0 /r:dlls/first/CS1705-lib.dll /out:$@ $<
+CSFriendAssembly-lib.dll : CSFriendAssembly-lib.cs
+ $(CSCOMPILE) /target:library /publicsign /keyfile:key.snk /warn:0 /out:$@ $<
+
%-lib.dll: %-lib.cs
$(CSCOMPILE) /target:library /warn:0 /out:$@ $<
[assembly:System.Reflection.AssemblyVersionAttribute ("1.0.0.0")]
-[assembly:System.Reflection.AssemblyKeyFile("key.snk")]
public class B
{
[assembly:System.Reflection.AssemblyVersionAttribute ("1.0.0.0")]
-[assembly:System.Reflection.AssemblyKeyFile("key.snk")]
public class B
{
[assembly:System.Reflection.AssemblyVersionAttribute ("1.1.1.0")]
-[assembly:System.Reflection.AssemblyKeyFile("key.snk")]
public class A
{
[assembly:System.Reflection.AssemblyVersionAttribute ("2.0.0.0")]
-[assembly:System.Reflection.AssemblyKeyFile("key.snk")]
public class B
{
[assembly:System.Reflection.AssemblyVersionAttribute ("2.0.1.0")]
-[assembly:System.Reflection.AssemblyKeyFile("key.snk")]
public class B
{
[assembly:System.Reflection.AssemblyVersionAttribute ("1.0.1.0")]
-[assembly:System.Reflection.AssemblyKeyFile("key.snk")]
public class B
{
[assembly:System.Reflection.AssemblyVersionAttribute ("1.2.1.0")]
-[assembly:System.Reflection.AssemblyKeyFile("key.snk")]
public class A
{
[assembly:System.Reflection.AssemblyVersionAttribute ("1.0.0.0")]
-[assembly:System.Reflection.AssemblyKeyFile("key.snk")]
public class B
{
SUBDIRS :=
include ../build/rules.make
+PROGRAM = mcs.exe
+
EXTRA_DISTFILES = \
mcs.csproj \
mcs.sln \
cs-parser.jay \
mcs.exe.sources
-ifeq (basic, $(PROFILE))
-LOCAL_MCS_FLAGS += -r:System.dll -r:System.Core.dll -r:System.Xml.dll -debug
-
-PROGRAM = basic.exe
-sourcefile = mcs.exe.sources
-else
-LIB_REFS = System System.Core System.Xml
-
-PROGRAM_USE_INTERMEDIATE_FILE = true
-PROGRAM = mcs.exe
-the_libdir = $(topdir)/class/lib/build/
-LOCAL_MCS_FLAGS += -debug
-endif
-
+LIB_REFS = System.Core System.Xml System
LOCAL_MCS_FLAGS += -d:STATIC,NO_SYMBOL_WRITER,NO_AUTHENTICODE
ifndef NO_THREAD_ABORT
LOCAL_MCS_FLAGS += $(REFERENCE_SOURCES_FLAGS)
-PROGRAM_INSTALL_DIR = $(mono_libdir)/mono/4.5
-
-PROGRAM_COMPILE = $(BOOT_COMPILE)
-
BUILT_SOURCES = cs-parser.cs
CLEAN_FILES += y.output
LIBRARY = nunit.util.dll
LIBRARY_SNK = $(topdir)/nunit24/nunit.snk
-LOCAL_MCS_FLAGS= /resource:Transform.resources,NUnit.Util.Transform.resources /d:MONO /d:StronglyNamedAssembly /publicsign -warn:1
+LOCAL_MCS_FLAGS= /resource:Transform.resources,NUnit.Util.Transform.resources /d:MONO /d:StronglyNamedAssembly /publicsign -warn:1 /keyfile:../../nunit.snk
LIB_REFS = nunit.core nunit.core.interfaces System System.Xml System.Runtime.Remoting
NO_TEST = yo
LIBRARY = nunit-console-runner.dll
LIBRARY_SNK = $(topdir)/nunit24/nunit.snk
-LOCAL_MCS_FLAGS= /d:MONO /d:StronglyNamedAssembly /publicsign
+LOCAL_MCS_FLAGS= /d:MONO /d:StronglyNamedAssembly /publicsign /keyfile:../../nunit.snk
LIB_REFS = nunit.core nunit.core.interfaces nunit.util System System.Xml
NO_TEST = yo
LIBRARY = nunit.core.dll
LIBRARY_SNK = $(topdir)/nunit24/nunit.snk
-LOCAL_MCS_FLAGS = /d:StronglyNamedAssembly -warn:1 /publicsign
+LOCAL_MCS_FLAGS = /d:StronglyNamedAssembly -warn:1 /publicsign /keyfile:../../nunit.snk
LIB_REFS = nunit.framework nunit.core.interfaces System
NO_TEST = yo
LIBRARY = nunit.core.interfaces.dll
LIBRARY_SNK = $(topdir)/nunit24/nunit.snk
-LOCAL_MCS_FLAGS= /d:StronglyNamedAssembly /publicsign
+LOCAL_MCS_FLAGS= /d:StronglyNamedAssembly /publicsign /keyfile:../../nunit.snk
LIB_REFS = nunit.framework System
NO_TEST = yo
LIBRARY = nunit.core.extensions.dll
LIBRARY_SNK = $(topdir)/nunit24/nunit.snk
-LIB_MCS_FLAGS = /d:StronglyNamedAssembly /publicsign
+LIB_MCS_FLAGS = /d:StronglyNamedAssembly /publicsign /keyfile:../../nunit.snk
LIB_REFS = nunit.core nunit.core.interfaces System.Xml System
NO_TEST = yo
LIBRARY = nunit.framework.extensions.dll
LIBRARY_SNK = $(topdir)/nunit24/nunit.snk
-LIB_MCS_FLAGS = /d:StronglyNamedAssembly /publicsign
+LIB_MCS_FLAGS = /d:StronglyNamedAssembly /publicsign /keyfile:../../nunit.snk
LIB_REFS = System.Xml System
NO_TEST = yo
LIBRARY_NAME = nunit.framework.dll
LIBRARY_SNK = $(topdir)/nunit24/nunit.snk
-LIB_MCS_FLAGS = /d:StronglyNamedAssembly -warn:1 /publicsign
+LIB_MCS_FLAGS = /d:StronglyNamedAssembly -warn:1 /publicsign /keyfile:../../nunit.snk
LIB_REFS = System.Xml System
NO_TEST = yo
LIBRARY = nunit.mocks.dll
LIBRARY_SNK = $(topdir)/nunit24/nunit.snk
-LOCAL_MCS_FLAGS= /d:StronglyNamedAssembly /publicsign
+LOCAL_MCS_FLAGS= /d:StronglyNamedAssembly /publicsign /keyfile:../../nunit.snk
LIB_REFS = nunit.framework System
NO_TEST = yo
--- /dev/null
+Microsoft.Net.Compilers*
\ No newline at end of file
--- /dev/null
+thisdir = packages
+include ../build/rules.make
+
+ROSLYN_CSC_DIR = $(dir $(CSC_LOCATION))
+
+ifeq ($(PROFILE), $(DEFAULT_PROFILE))
+
+TARGET_DIR = $(DESTDIR)$(mono_libdir)/mono/$(FRAMEWORK_VERSION)
+
+install-local:
+ $(INSTALL_LIB) $(ROSLYN_CSC_DIR)/csc.exe $(TARGET_DIR)
+ $(INSTALL_LIB) $(ROSLYN_CSC_DIR)/csc.rsp $(TARGET_DIR)
+ $(INSTALL_LIB) $(ROSLYN_CSC_DIR)/csc.exe.config $(TARGET_DIR)
+ $(INSTALL_LIB) $(ROSLYN_CSC_DIR)/Microsoft.CodeAnalysis.CSharp.dll $(TARGET_DIR)
+ $(INSTALL_LIB) $(ROSLYN_CSC_DIR)/Microsoft.CodeAnalysis.dll $(TARGET_DIR)
+ $(INSTALL_LIB) $(ROSLYN_CSC_DIR)/System.Collections.Immutable.dll $(TARGET_DIR)
+ $(INSTALL_LIB) $(ROSLYN_CSC_DIR)/System.Reflection.Metadata.dll $(TARGET_DIR)
+
+ $(INSTALL_LIB) $(ROSLYN_CSC_DIR)/csc.exe$(PLATFORM_AOT_SUFFIX) $(TARGET_DIR)
+ $(INSTALL_LIB) $(ROSLYN_CSC_DIR)/System.Reflection.Metadata.dll$(PLATFORM_AOT_SUFFIX) $(TARGET_DIR)
+endif
+
+
+dist-local: dist-default
+
endif
LOCAL_RUNTIME_FLAGS = --verify-all
-COMPILER = $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/mcs.exe
+COMPILER = $(topdir)/class/lib/$(PROFILE)/mcs.exe
TESTER = MONO_RUNTIME='$(RUNTIME)' $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(LOCAL_RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/compiler-tester.exe
TEST_ILS := $(wildcard *-lib.il)
%-lib.dll: %-lib.il
$(ILASM) /dll /out:$@ $<
+CSCOMPILE_UTIL = $(CSCOMPILE) -noconfig -nologo -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
+
setup:
- $(CSCOMPILE) -t:library dlls/test-679-2/test-679-lib-2.cs
- $(CSCOMPILE) -t:library dlls/test-679-1/test-679-lib.cs -r:dlls/test-679-2/test-679-lib-2.dll
- $(CSCOMPILE) -t:library dlls/test-939-common.cs -keyfile:key.snk -publicsign
- $(CSCOMPILE) -t:library dlls/test-939-1/test-939-lib.cs -keyfile:key.snk -publicsign
- $(CSCOMPILE) -t:library dlls/test-939-1/test-939-ref.cs -r:dlls/test-939-1/test-939-lib.dll -keyfile:key.snk -publicsign
- $(CSCOMPILE) -t:library dlls/test-939-2/test-939-lib.cs -r:dlls/test-939-common.dll -keyfile:key.snk -publicsign
+ $(CSCOMPILE_UTIL) -t:library dlls/test-679-2/test-679-lib-2.cs -out:dlls/test-679-2/test-679-lib-2.dll
+ $(CSCOMPILE_UTIL) -t:library dlls/test-679-1/test-679-lib.cs -r:dlls/test-679-2/test-679-lib-2.dll -out:dlls/test-679-1/test-679-lib.dll
+ $(CSCOMPILE_UTIL) -t:library dlls/test-939-common.cs -keyfile:key.snk -publicsign -out:dlls/test-939-common.dll
+ $(CSCOMPILE_UTIL) -t:library dlls/test-939-1/test-939-lib.cs -keyfile:key.snk -publicsign -out:dlls/test-939-1/test-939-lib.dll
+ $(CSCOMPILE_UTIL) -t:library dlls/test-939-1/test-939-ref.cs -r:dlls/test-939-1/test-939-lib.dll -keyfile:key.snk -publicsign -out:dlls/test-939-1/test-939-ref.dll
+ $(CSCOMPILE_UTIL) -t:library dlls/test-939-2/test-939-lib.cs -r:dlls/test-939-common.dll -keyfile:key.snk -publicsign -out:dlls/test-939-2/test-939-lib.dll
$(ILASM) -dll dlls/test-883.il
static void RewriteAssembly (string assemblyLocation, Dictionary<string, string> resourcesStrings, CmdOptions options)
{
- var readerParameters = new ReaderParameters { ReadSymbols = true, ReadWrite = true };
+ Stream pdbSymbols = null;
+
+ var debugSymbols = Path.ChangeExtension (assemblyLocation, "pdb");
+ if (File.Exists (debugSymbols))
+ pdbSymbols = File.Open (debugSymbols, FileMode.Open, FileAccess.ReadWrite);
+
+ var readerParameters = new ReaderParameters {
+ ReadWrite = true,
+ };
+
+ if (pdbSymbols != null) {
+ readerParameters.ReadSymbols = true;
+ readerParameters.SymbolReaderProvider = new PortablePdbReaderProvider ();
+ readerParameters.SymbolStream = pdbSymbols;
+ }
+
using (var assembly = AssemblyDefinition.ReadAssembly (assemblyLocation, readerParameters)) {
foreach (var module in assembly.Modules) {
foreach (var type in module.GetTypes ()) {
foreach (var method in type.Methods) {
if (!method.HasBody)
continue;
-
+
foreach (var instr in method.Body.Instructions) {
if (instr.OpCode != OpCodes.Ldstr)
continue;
}
}
- var writerParameters = new WriterParameters { WriteSymbols = true };
+ var writerParameters = new WriterParameters ();
+
+ if (pdbSymbols != null) {
+ writerParameters.WriteSymbols = true;
+ writerParameters.SymbolStream = pdbSymbols;
+ writerParameters.SymbolWriterProvider = new PortablePdbWriterProvider ();
+ pdbSymbols.Seek (0, SeekOrigin.Begin);
+ }
+
assembly.Write (writerParameters);
}
+
+ pdbSymbols?.Dispose ();
}
static bool LoadGetResourceStrings (Dictionary<string, string> resourcesStrings, CmdOptions options)
<Attribute>
<AttributeName>System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute+DebuggingModes.IgnoreSymbolStoreSequencePoints)</AttributeName>
</Attribute>
+ <Attribute>
+ <AttributeName>System.Runtime.CompilerServices.CompilationRelaxations(8)</AttributeName>
+ </Attribute>
<Attribute>
<AttributeName>System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute+DebuggingModes.IgnoreSymbolStoreSequencePoints)</AttributeName>
</Attribute>
+ <Attribute>
+ <AttributeName>System.Runtime.CompilerServices.CompilationRelaxations(8)</AttributeName>
+ </Attribute>
<Attribute>
<AttributeName>System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute+DebuggingModes.IgnoreSymbolStoreSequencePoints)</AttributeName>
</Attribute>
+ <Attribute>
+ <AttributeName>System.Runtime.CompilerServices.CompilationRelaxations(8)</AttributeName>
+ </Attribute>
<Attribute>
<AttributeName>System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute+DebuggingModes.IgnoreSymbolStoreSequencePoints)</AttributeName>
</Attribute>
+ <Attribute>
+ <AttributeName>System.Runtime.CompilerServices.CompilationRelaxations(8)</AttributeName>
+ </Attribute>
<Attribute>
<AttributeName>System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute+DebuggingModes.IgnoreSymbolStoreSequencePoints)</AttributeName>
</Attribute>
+ <Attribute>
+ <AttributeName>System.Runtime.CompilerServices.CompilationRelaxations(8)</AttributeName>
+ </Attribute>
<Attribute>
<AttributeName>System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute+DebuggingModes.IgnoreSymbolStoreSequencePoints)</AttributeName>
</Attribute>
+ <Attribute>
+ <AttributeName>System.Runtime.CompilerServices.CompilationRelaxations(8)</AttributeName>
+ </Attribute>
<Attribute>
<AttributeName>System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute+DebuggingModes.IgnoreSymbolStoreSequencePoints)</AttributeName>
</Attribute>
+ <Attribute>
+ <AttributeName>System.Runtime.CompilerServices.CompilationRelaxations(8)</AttributeName>
+ </Attribute>
<Attribute>
<AttributeName>System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute+DebuggingModes.IgnoreSymbolStoreSequencePoints)</AttributeName>
</Attribute>
+ <Attribute>
+ <AttributeName>System.Runtime.CompilerServices.CompilationRelaxations(8)</AttributeName>
+ </Attribute>
<Attribute>
<AttributeName>System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute+DebuggingModes.IgnoreSymbolStoreSequencePoints)</AttributeName>
</Attribute>
+ <Attribute>
+ <AttributeName>System.Runtime.CompilerServices.CompilationRelaxations(8)</AttributeName>
+ </Attribute>
<Attribute>
<AttributeName>System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute+DebuggingModes.IgnoreSymbolStoreSequencePoints)</AttributeName>
</Attribute>
+ <Attribute>
+ <AttributeName>System.Runtime.CompilerServices.CompilationRelaxations(8)</AttributeName>
+ </Attribute>
<Attribute>
<AttributeName>System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute+DebuggingModes.IgnoreSymbolStoreSequencePoints)</AttributeName>
</Attribute>
+ <Attribute>
+ <AttributeName>System.Runtime.CompilerServices.CompilationRelaxations(8)</AttributeName>
+ </Attribute>
<Attribute>
<AttributeName>System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute+DebuggingModes.IgnoreSymbolStoreSequencePoints)</AttributeName>
</Attribute>
+ <Attribute>
+ <AttributeName>System.Runtime.CompilerServices.CompilationRelaxations(8)</AttributeName>
+ </Attribute>
<Attribute>
<AttributeName>System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute+DebuggingModes.IgnoreSymbolStoreSequencePoints)</AttributeName>
</Attribute>
+ <Attribute>
+ <AttributeName>System.Runtime.CompilerServices.CompilationRelaxations(8)</AttributeName>
+ </Attribute>
<Attribute>
<AttributeName>System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute+DebuggingModes.IgnoreSymbolStoreSequencePoints)</AttributeName>
</Attribute>
+ <Attribute>
+ <AttributeName>System.Runtime.CompilerServices.CompilationRelaxations(8)</AttributeName>
+ </Attribute>
<Attribute>
<AttributeName>System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute+DebuggingModes.IgnoreSymbolStoreSequencePoints)</AttributeName>
</Attribute>
+ <Attribute>
+ <AttributeName>System.Runtime.CompilerServices.CompilationRelaxations(8)</AttributeName>
+ </Attribute>
<Attribute>
<AttributeName>System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute+DebuggingModes.IgnoreSymbolStoreSequencePoints)</AttributeName>
</Attribute>
+ <Attribute>
+ <AttributeName>System.Runtime.CompilerServices.CompilationRelaxations(8)</AttributeName>
+ </Attribute>
<Attribute>
<AttributeName>System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute+DebuggingModes.IgnoreSymbolStoreSequencePoints)</AttributeName>
</Attribute>
+ <Attribute>
+ <AttributeName>System.Runtime.CompilerServices.CompilationRelaxations(8)</AttributeName>
+ </Attribute>
<Attribute>
<AttributeName>System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true)</AttributeName>
</Attribute>
<MemberSignature Language="C#" Value="public static System.Collections.Generic.IEnumerable<T> ToEnumerable<T> (this T self);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.Generic.IEnumerable`1<!!T> ToEnumerable<T>(!!T self) cil managed" />
<MemberType>Method</MemberType>
+ <Attributes>
+ <Attribute>
+ <AttributeName>System.Runtime.CompilerServices.IteratorStateMachine(typeof(Mono.DocTest.Generic.Extensions/<ToEnumerable>d__0`1))</AttributeName>
+ </Attribute>
+ </Attributes>
<ReturnValue>
<ReturnType>System.Collections.Generic.IEnumerable<T></ReturnType>
</ReturnValue>
<AssemblyName>DocTest</AssemblyName>
</AssemblyInfo>
<TypeParameters>
- <TypeParameter Name="T" />
+ <TypeParameter Name="T">
+ <Attributes>
+ <Attribute>
+ <AttributeName>Mono.DocTest.Doc("Type Parameter!")</AttributeName>
+ </Attribute>
+ </Attributes>
+ </TypeParameter>
<TypeParameter Name="U" />
<TypeParameter Name="V" />
</TypeParameters>
<Attribute>
<AttributeName>System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute+DebuggingModes.IgnoreSymbolStoreSequencePoints)</AttributeName>
</Attribute>
+ <Attribute>
+ <AttributeName>System.Runtime.CompilerServices.CompilationRelaxations(8)</AttributeName>
+ </Attribute>
<Attribute>
<AttributeName>System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute+DebuggingModes.IgnoreSymbolStoreSequencePoints)</AttributeName>
</Attribute>
+ <Attribute>
+ <AttributeName>System.Runtime.CompilerServices.CompilationRelaxations(8)</AttributeName>
+ </Attribute>
<Attribute>
<AttributeName>System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true)</AttributeName>
</Attribute>
<param name="list">To be added.</param>
<summary>
<see cref="T:System.Collections.Generic.IEnumerable{System.Int32}" />
- extension method.
- </summary>
+ extension method.
+ </summary>
<returns>To be added.</returns>
<remarks>
<c>M:Mono.DocTest.Generic.Extensions.ToDouble</c>
<param name="val">To be added.</param>
<summary>
<see cref="T:Mono.DocTest.Generic.IFoo`1" /> extension method.
- </summary>
+ </summary>
<returns>To be added.</returns>
<remarks>
<c>M:Mono.DocTest.Generic.Extensions.ToDouble</c>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
+ <Attributes>
+ <Attribute>
+ <AttributeName>System.Runtime.CompilerServices.IteratorStateMachine(typeof(Mono.DocTest.Generic.Extensions/<ToEnumerable>d__0`1))</AttributeName>
+ </Attribute>
+ </Attributes>
<ReturnValue>
<ReturnType>System.Collections.Generic.IEnumerable<T></ReturnType>
</ReturnValue>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<TypeParameters>
- <TypeParameter Name="T" />
+ <TypeParameter Name="T">
+ <Attributes>
+ <Attribute>
+ <AttributeName>Mono.DocTest.Doc("Type Parameter!")</AttributeName>
+ </Attribute>
+ </Attributes>
+ </TypeParameter>
<TypeParameter Name="U" />
<TypeParameter Name="V" />
</TypeParameters>
<summary>Possible colors</summary>
<remarks>
<see cref="T:Mono.DocTest.Color" />.
- Namespace Test: [<see cref="N:Mono.DocTest" />]
- </remarks>
+ Namespace Test: [<see cref="N:Mono.DocTest" />]
+ </remarks>
</Docs>
<Members>
<Member MemberName="AnotherGreen">
<summary>To be added.</summary>
<remarks>
<para>
- cref=<c>T:Mono.DocTest.DocAttribute</c>.
- </para>
+ cref=<c>T:Mono.DocTest.DocAttribute</c>.
+ </para>
<format type="text/html">
<table width="100%">
<tr>
<param name="b">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
- <remarks>To be added.</remarks>
+ <remarks>
+ <c>M:Mono.DocTest.Widget.Dynamic0(System.Object,System.Object)</c>
+ </remarks>
<exception cref="T:System.ArgumentException">To be added; from:
<see cref="M:System.Linq.Expressions.Error.TypeMustBeDerivedFromSystemDelegate" /></exception>
</Docs>
<param name="value">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
- <remarks>To be added.</remarks>
+ <remarks>
+ <c>M:Mono.DocTest.Widget.Dynamic1(System.Collections.Generic.Dictionary{System.Object,System.Object})</c>
+ </remarks>
</Docs>
</Member>
<Member MemberName="Dynamic2">
<param name="value">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
- <remarks>To be added.</remarks>
+ <remarks>
+ <c>M:Mono.DocTest.Widget.Dynamic2(System.Func{System.String,System.Object})</c>
+ </remarks>
</Docs>
</Member>
<Member MemberName="Dynamic3">
<param name="value">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
- <remarks>To be added.</remarks>
+ <remarks>
+ <c>M:Mono.DocTest.Widget.Dynamic3(System.Func{System.Func{System.String,System.Object},System.Func{System.Object,System.String}})</c>
+ </remarks>
</Docs>
</Member>
<Member MemberName="DynamicE1">
</Parameters>
<Docs>
<param name="folder">
- A <see cref="T:System.Environment+SpecialFolder" /> instance.
- </param>
+ A <see cref="T:System.Environment+SpecialFolder" /> instance.
+ </param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>
<Attribute>
<AttributeName>System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute+DebuggingModes.IgnoreSymbolStoreSequencePoints)</AttributeName>
</Attribute>
+ <Attribute>
+ <AttributeName>System.Runtime.CompilerServices.CompilationRelaxations(8)</AttributeName>
+ </Attribute>
<Attribute>
<AttributeName>System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true)</AttributeName>
</Attribute>
<param name="list">To be added.</param>
<summary>
<see cref="T:System.Collections.Generic.IEnumerable{System.Int32}" />
- extension method.
- </summary>
+ extension method.
+ </summary>
</Docs>
<Link Type="Mono.DocTest.Generic.Extensions" Member="M:Mono.DocTest.Generic.Extensions.ToDouble(System.Collections.Generic.IEnumerable{System.Int32})" />
</Member>
<param name="val">To be added.</param>
<summary>
<see cref="T:Mono.DocTest.Generic.IFoo`1" /> extension method.
- </summary>
+ </summary>
</Docs>
<Link Type="Mono.DocTest.Generic.Extensions" Member="M:Mono.DocTest.Generic.Extensions.ToDouble``1(``0)" />
</Member>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
+ <Attributes>
+ <Attribute>
+ <AttributeName>System.Runtime.CompilerServices.IteratorStateMachine(typeof(Mono.DocTest.Generic.Extensions/<ToEnumerable>d__0`1))</AttributeName>
+ </Attribute>
+ </Attributes>
<ReturnValue>
<ReturnType>System.Collections.Generic.IEnumerable<T></ReturnType>
</ReturnValue>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<TypeParameters>
- <TypeParameter Name="T" />
+ <TypeParameter Name="T">
+ <Attributes>
+ <Attribute>
+ <AttributeName>Mono.DocTest.Doc("Type Parameter!")</AttributeName>
+ </Attribute>
+ </Attributes>
+ </TypeParameter>
<TypeParameter Name="U" />
<TypeParameter Name="V" />
</TypeParameters>
<Attribute>
<AttributeName>System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute+DebuggingModes.IgnoreSymbolStoreSequencePoints)</AttributeName>
</Attribute>
+ <Attribute>
+ <AttributeName>System.Runtime.CompilerServices.CompilationRelaxations(8)</AttributeName>
+ </Attribute>
<Attribute>
<AttributeName>System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true)</AttributeName>
</Attribute>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
+ <Attributes>
+ <Attribute>
+ <AttributeName>System.Runtime.CompilerServices.IteratorStateMachine(typeof(Mono.DocTest.Generic.Extensions/<ToEnumerable>d__0`1))</AttributeName>
+ </Attribute>
+ </Attributes>
<ReturnValue>
<ReturnType>System.Collections.Generic.IEnumerable<T></ReturnType>
</ReturnValue>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<TypeParameters>
- <TypeParameter Name="T" />
+ <TypeParameter Name="T">
+ <Attributes>
+ <Attribute>
+ <AttributeName>Mono.DocTest.Doc("Type Parameter!")</AttributeName>
+ </Attribute>
+ </Attributes>
+ </TypeParameter>
<TypeParameter Name="U" />
<TypeParameter Name="V" />
</TypeParameters>
<Attribute>
<AttributeName>System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute+DebuggingModes.IgnoreSymbolStoreSequencePoints)</AttributeName>
</Attribute>
+ <Attribute>
+ <AttributeName>System.Runtime.CompilerServices.CompilationRelaxations(8)</AttributeName>
+ </Attribute>
<Attribute>
<AttributeName>System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true)</AttributeName>
</Attribute>
<b>
<a href="#M:Mono.DocTest.Generic.Extensions.ToDouble(System.Collections.Generic.IEnumerable{System.Int32})">ToDouble</a>
</b>(<i>this</i> <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Collections.Generic.IEnumerable`1">IEnumerable<int></a>)<nobr> : <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Collections.Generic.IEnumerable`1">IEnumerable<double></a></nobr><blockquote><a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Collections.Generic.IEnumerable`1">IEnumerable<int></a>
- extension method.
- </blockquote></td>
+ extension method.
+ </blockquote></td>
</tr>
<tr valign="top">
<td>
<b>
<a href="#M:Mono.DocTest.Generic.Extensions.ToDouble``1(``0)">ToDouble<T></a>
</b>(<i>this</i> <i title="To be added.">T</i>)<nobr> : <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Double">double</a></nobr><blockquote><a href="../Mono.DocTest.Generic/IFoo`1.html">Mono.DocTest.Generic.IFoo`1</a> extension method.
- </blockquote></td>
+ </blockquote></td>
</tr>
<tr valign="top">
<td>
<blockquote id="M:Mono.DocTest.Generic.Extensions.ToDouble(System.Collections.Generic.IEnumerable{System.Int32}):member">
<div class="msummary">
<a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Collections.Generic.IEnumerable`1">IEnumerable<int></a>
- extension method.
- </div>
+ extension method.
+ </div>
<h2>Syntax</h2>
<div class="Signature">public static <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Collections.Generic.IEnumerable`1">IEnumerable<double></a> <b>ToDouble</b> (<i>this</i> <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Collections.Generic.IEnumerable`1">IEnumerable<int></a> list)</div>
<h4 class="Subsection">Parameters</h4>
<blockquote id="M:Mono.DocTest.Generic.Extensions.ToDouble``1(``0):member">
<div class="msummary">
<a href="../Mono.DocTest.Generic/IFoo`1.html">Mono.DocTest.Generic.IFoo`1</a> extension method.
- </div>
+ </div>
<h2>Syntax</h2>
<div class="Signature">public static <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Double">double</a> <b>ToDouble<T></b> (<i>this</i> <i title="To be added.">T</i> val)<br /> where T : <a href="../Mono.DocTest.Generic/IFoo`1.html">Mono.DocTest.Generic.IFoo<T></a></div>
<h4 class="Subsection">Type Parameters</h4>
<div class="msummary">
<tt>System.Object</tt> extension method</div>
<h2>Syntax</h2>
- <div class="Signature">public static <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Collections.Generic.IEnumerable`1">IEnumerable<T></a> <b>ToEnumerable<T></b> (<i>this</i> <i title="To be added.">T</i> self)</div>
+ <div class="Signature">[System.Runtime.CompilerServices.IteratorStateMachine(typeof(Mono.DocTest.Generic.Extensions/<ToEnumerable>d__0`1))]<br />public static <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Collections.Generic.IEnumerable`1">IEnumerable<T></a> <b>ToEnumerable<T></b> (<i>this</i> <i title="To be added.">T</i> self)</div>
<h4 class="Subsection">Type Parameters</h4>
<blockquote class="SubsectionBox" id="M:Mono.DocTest.Generic.Extensions.ToEnumerable``1(``0):Type Parameters">
<dl>
<b>
<a href="../Mono.DocTest.Generic/Extensions.html#M:Mono.DocTest.Generic.Extensions.ToDouble``1(``0)">ToDouble<T></a>
</b>(<i>this</i> <a href="javascript:alert("Documentation not found.")">T</a>)<nobr> : <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Double">double</a></nobr><blockquote><a href="../Mono.DocTest.Generic/IFoo`1.html">Mono.DocTest.Generic.IFoo`1</a> extension method.
- </blockquote></td>
+ </blockquote></td>
</tr>
<tr valign="top">
<td>
</p>
<div>
<h2>Syntax</h2>
- <div class="Signature" id="T:Mono.DocTest.Generic.MyList`1.Helper`2:Signature">public class <b>MyList<T, U, V></b></div>
+ <div class="Signature" id="T:Mono.DocTest.Generic.MyList`1.Helper`2:Signature">public class <b>MyList<[Mono.DocTest.Doc("Type Parameter!")] T, U, V></b></div>
</div>
<div class="Remarks" id="T:Mono.DocTest.Generic.MyList`1.Helper`2:Docs">
<h4 class="Subsection">Type Parameters</h4>
<b>
<a href="../Mono.DocTest.Generic/Extensions.html#M:Mono.DocTest.Generic.Extensions.ToDouble(System.Collections.Generic.IEnumerable{System.Int32})">ToDouble</a>
</b>(<i>this</i> <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Collections.Generic.IEnumerable`1">IEnumerable<int></a>)<nobr> : <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Collections.Generic.IEnumerable`1">IEnumerable<double></a></nobr><blockquote><a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Collections.Generic.IEnumerable`1">IEnumerable<int></a>
- extension method.
- </blockquote></td>
+ extension method.
+ </blockquote></td>
</tr>
<tr valign="top">
<td>
<b>
<a href="../Mono.DocTest.Generic/Extensions.html#M:Mono.DocTest.Generic.Extensions.ToDouble(System.Collections.Generic.IEnumerable{System.Int32})">ToDouble</a>
</b>(<i>this</i> <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Collections.Generic.IEnumerable`1">IEnumerable<int></a>)<nobr> : <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Collections.Generic.IEnumerable`1">IEnumerable<double></a></nobr><blockquote><a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Collections.Generic.IEnumerable`1">IEnumerable<int></a>
- extension method.
- </blockquote></td>
+ extension method.
+ </blockquote></td>
</tr>
<tr valign="top">
<td>
<b>
<a href="../Mono.DocTest.Generic/Extensions.html#M:Mono.DocTest.Generic.Extensions.ToDouble``1(``0)">ToDouble<T></a>
</b>(<i>this</i> <i title="To be added.">T</i>)<nobr> : <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Double">double</a></nobr><blockquote><a href="../Mono.DocTest.Generic/IFoo`1.html">Mono.DocTest.Generic.IFoo`1</a> extension method.
- </blockquote></td>
+ </blockquote></td>
</tr>
<tr valign="top">
<td>
<h2 class="Section">Remarks</h2>
<div class="SectionBox" id="T:Mono.DocTest.Color:Docs:Remarks">
<a href="../Mono.DocTest/Color.html">Mono.DocTest.Color</a>.
- Namespace Test: [<a href="../Mono.DocTest/index.html">Mono.DocTest</a>]
- </div>
+ Namespace Test: [<a href="../Mono.DocTest/index.html">Mono.DocTest</a>]
+ </div>
<h2 class="Section">Members</h2>
<div class="SectionBox" id="T:Mono.DocTest.Color:Docs:Members">
<table class="Enumeration">
<h2 class="Section">Remarks</h2>
<div class="SectionBox" id="T:Mono.DocTest.DocAttribute:Docs:Remarks">
<p>
- cref=<tt>T:Mono.DocTest.DocAttribute</tt>.
- </p>
+ cref=<tt>T:Mono.DocTest.DocAttribute</tt>.
+ </p>
<table width="100%">
<tr>
<td style="color:red">red</td>
</blockquote>
<h2 class="Section">Remarks</h2>
<div class="SectionBox" id="M:Mono.DocTest.Widget.Dynamic0(System.Object,System.Object):Remarks">
- <span class="NotEntered">Documentation for this section has not yet been entered.</span>
+ <tt>M:Mono.DocTest.Widget.Dynamic0(System.Object,System.Object)</tt>
</div>
<h2 class="Section">Requirements</h2>
<div class="SectionBox" id="M:Mono.DocTest.Widget.Dynamic0(System.Object,System.Object):Version Information">
</blockquote>
<h2 class="Section">Remarks</h2>
<div class="SectionBox" id="M:Mono.DocTest.Widget.Dynamic1(System.Collections.Generic.Dictionary{System.Object,System.String}):Remarks">
- <span class="NotEntered">Documentation for this section has not yet been entered.</span>
+ <tt>M:Mono.DocTest.Widget.Dynamic1(System.Collections.Generic.Dictionary{System.Object,System.Object})</tt>
</div>
<h2 class="Section">Requirements</h2>
<div class="SectionBox" id="M:Mono.DocTest.Widget.Dynamic1(System.Collections.Generic.Dictionary{System.Object,System.String}):Version Information">
</blockquote>
<h2 class="Section">Remarks</h2>
<div class="SectionBox" id="M:Mono.DocTest.Widget.Dynamic2(System.Func{System.String,System.Object}):Remarks">
- <span class="NotEntered">Documentation for this section has not yet been entered.</span>
+ <tt>M:Mono.DocTest.Widget.Dynamic2(System.Func{System.String,System.Object})</tt>
</div>
<h2 class="Section">Requirements</h2>
<div class="SectionBox" id="M:Mono.DocTest.Widget.Dynamic2(System.Func{System.String,System.Object}):Version Information">
</blockquote>
<h2 class="Section">Remarks</h2>
<div class="SectionBox" id="M:Mono.DocTest.Widget.Dynamic3(System.Func{System.Func{System.String,System.Object},System.Func{System.Object,System.String}}):Remarks">
- <span class="NotEntered">Documentation for this section has not yet been entered.</span>
+ <tt>M:Mono.DocTest.Widget.Dynamic3(System.Func{System.Func{System.String,System.Object},System.Func{System.Object,System.String}})</tt>
</div>
<h2 class="Section">Requirements</h2>
<div class="SectionBox" id="M:Mono.DocTest.Widget.Dynamic3(System.Func{System.Func{System.String,System.Object},System.Func{System.Object,System.String}}):Version Information">
<i>folder</i>
</dt>
<dd>
- A <a href="../System/Environment+SpecialFolder.html">Environment.SpecialFolder</a> instance.
- </dd>
+ A <a href="../System/Environment+SpecialFolder.html">Environment.SpecialFolder</a> instance.
+ </dd>
</dl>
</blockquote>
<h4 class="Subsection">Returns</h4>
<summary>Possible colors</summary>
<remarks>
<see cref="T:Mono.DocTest.Color" />.
- Namespace Test: [<see cref="N:Mono.DocTest" />]
- </remarks>
+ Namespace Test: [<see cref="N:Mono.DocTest" />]
+ </remarks>
</member>
<member name="F:Mono.DocTest.Color.AnotherGreen">
<summary>To be added.</summary>
<summary>To be added.</summary>
<remarks>
<para>
- cref=<c>T:Mono.DocTest.DocAttribute</c>.
- </para>
+ cref=<c>T:Mono.DocTest.DocAttribute</c>.
+ </para>
<format type="text/html">
<table width="100%">
<tr>
<param name="b">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
- <remarks>To be added.</remarks>
+ <remarks>
+ <c>M:Mono.DocTest.Widget.Dynamic0(System.Object,System.Object)</c>
+ </remarks>
<exception cref="T:System.ArgumentException">To be added; from:
<see cref="M:System.Linq.Expressions.Error.TypeMustBeDerivedFromSystemDelegate" /></exception>
</member>
<param name="value">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
- <remarks>To be added.</remarks>
+ <remarks>
+ <c>M:Mono.DocTest.Widget.Dynamic1(System.Collections.Generic.Dictionary{System.Object,System.Object})</c>
+ </remarks>
</member>
<member name="M:Mono.DocTest.Widget.Dynamic2(System.Func{System.String,System.Object})">
<param name="value">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
- <remarks>To be added.</remarks>
+ <remarks>
+ <c>M:Mono.DocTest.Widget.Dynamic2(System.Func{System.String,System.Object})</c>
+ </remarks>
</member>
<member name="M:Mono.DocTest.Widget.Dynamic3(System.Func{System.Func{System.String,System.Object},System.Func{System.Object,System.String}})">
<param name="value">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
- <remarks>To be added.</remarks>
+ <remarks>
+ <c>M:Mono.DocTest.Widget.Dynamic3(System.Func{System.Func{System.String,System.Object},System.Func{System.Object,System.String}})</c>
+ </remarks>
</member>
<member name="E:Mono.DocTest.Widget.DynamicE1">
<summary>To be added.</summary>
<param name="list">To be added.</param>
<summary>
<see cref="T:System.Collections.Generic.IEnumerable{System.Int32}" />
- extension method.
- </summary>
+ extension method.
+ </summary>
<returns>To be added.</returns>
<remarks>
<c>M:Mono.DocTest.Generic.Extensions.ToDouble</c>
<param name="val">To be added.</param>
<summary>
<see cref="T:Mono.DocTest.Generic.IFoo`1" /> extension method.
- </summary>
+ </summary>
<returns>To be added.</returns>
<remarks>
<c>M:Mono.DocTest.Generic.Extensions.ToDouble</c>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
</member>
- <member name="M:Mono.DocTest.Generic.MyList`1.Helper`2.UseT(```210T`2``21`2```210`2``21`2,```210U`2``21`2```210`2``21`2,```210V`2``21`2```210`2``21`2)">
+ <member name="M:Mono.DocTest.Generic.MyList`1.Helper`2.UseT(``21T`2``21`2,``21U`2``21`2,``21V`2``21`2)">
<param name="a">Ako</param>
<param name="b">bko</param>
<param name="c">cko</param>
</member>
<member name="M:System.Environment.GetFolderPath(System.Environment+SpecialFolder)">
<param name="folder">
- A <see cref="T:System.Environment+SpecialFolder" /> instance.
- </param>
+ A <see cref="T:System.Environment+SpecialFolder" /> instance.
+ </param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>
include ../../build/executable.make
-LOCAL_MCS_FLAGS = -unsafe -publicsign
+LOCAL_MCS_FLAGS = -unsafe -publicsign -keyfile:../../class/mono.snk
LIB_REFS = System.ServiceProcess Mono.Posix System
# Copied from library.make
at StackTraceDumper.Main () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:9
System.Exception: Stacktrace with 2 frames
- at StackTraceDumper.<Main>m__0 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:16
+ at StackTraceDumper+<>c.<Main>b__0_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 mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:16
+ at StackTraceDumper+<>c.<Main>b__0_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 mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:83
- at StackTraceDumper.<Main>m__1 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:18
+ at StackTraceDumper+<>c.<Main>b__0_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 mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:83
- at StackTraceDumper.<Main>m__1 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:18
+ at StackTraceDumper+<>c.<Main>b__0_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 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+<>c.<Main>b__0_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+<>c.<Main>b__0_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 mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:75
- at StackTraceDumper.<Main>m__3 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:24
+ at StackTraceDumper+<>c.<Main>b__0_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 mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:75
- at StackTraceDumper.<Main>m__3 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:24
+ at StackTraceDumper+<>c.<Main>b__0_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 mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:88
- at StackTraceDumper.<Main>m__4 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:29
+ at StackTraceDumper+<>c.<Main>b__0_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 mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:88
- at StackTraceDumper.<Main>m__4 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:29
+ at StackTraceDumper+<>c.<Main>b__0_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 mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:93
- at StackTraceDumper.<Main>m__5 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:32
+ at StackTraceDumper+<>c.<Main>b__0_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 mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:93
- at StackTraceDumper.<Main>m__5 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:32
+ at StackTraceDumper+<>c.<Main>b__0_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 mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:113
- at StackTraceDumper.<Main>m__6 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:34
+ at StackTraceDumper+<>c.<Main>b__0_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 mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:113
- at StackTraceDumper.<Main>m__6 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:34
+ at StackTraceDumper+<>c.<Main>b__0_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 mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:98
- at StackTraceDumper.<Main>m__7 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:36
+ at StackTraceDumper+<>c.<Main>b__0_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 mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:98
- at StackTraceDumper.<Main>m__7 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:36
+ at StackTraceDumper+<>c.<Main>b__0_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 mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:119
- at StackTraceDumper.<Main>m__8 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:38
+ at StackTraceDumper+<>c.<Main>b__0_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 mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:119
- at StackTraceDumper.<Main>m__8 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:38
+ at StackTraceDumper+<>c.<Main>b__0_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 mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:126
- at StackTraceDumper.<Main>m__9 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:40
+ at StackTraceDumper+<>c.<Main>b__0_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 mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:126
- at StackTraceDumper.<Main>m__9 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:40
+ at StackTraceDumper+<>c.<Main>b__0_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 mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:132
- at StackTraceDumper.<Main>m__A () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:42
+ at StackTraceDumper+<>c.<Main>b__0_10 () 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 mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:132
- at StackTraceDumper.<Main>m__A () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:42
+ at StackTraceDumper+<>c.<Main>b__0_10 () 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 mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:137
- at StackTraceDumper.<Main>m__B () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:44
+ at StackTraceDumper+<>c.<Main>b__0_11 () 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 mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:137
- at StackTraceDumper.<Main>m__B () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:44
+ at StackTraceDumper+<>c.<Main>b__0_11 () 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 mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:143
- at StackTraceDumper.<Main>m__C () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:46
+ at StackTraceDumper+<>c.<Main>b__0_12 () 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 mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:143
- at StackTraceDumper.<Main>m__C () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:46
+ at StackTraceDumper+<>c.<Main>b__0_12 () 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 mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:148
- at StackTraceDumper.<Main>m__D () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:48
+ at StackTraceDumper+<>c.<Main>b__0_13 () 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+<>c.<Main>b__0_13 () 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.
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+<>c.<Main>b__0_14 () 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 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+<>c.<Main>b__0_14 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:52
at StackTraceDumper.Catch (System.Action action) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:59
LIBRARY = nunitlite.dll
LIBRARY_SNK = ../../../../external/nunit-lite/NUnitLite-1.0.0/src/framework/nunit.snk
-LOCAL_MCS_FLAGS= /target:library /define:"__MOBILE__;TRACE;DEBUG;NET_4_0;CLR_4_0,NUNITLITE" /warn:4 /keyfile:$(LIBRARY_SNK)
+LOCAL_MCS_FLAGS= /target:library /define:"__MOBILE__;TRACE;DEBUG;NET_4_0;CLR_4_0,NUNITLITE" /warn:4 /keyfile:$(LIBRARY_SNK) /publicsign
LIB_REFS = System System.Xml System.Core
NO_TEST = yes
#include <mono/metadata/tabledefs.h>
-enum InfrequentDataKind {
+typedef enum {
PROP_MARSHAL_INFO = 1, /* MonoMarshalType */
- PROP_EXT = 2, /* MonoClassExt */
- PROP_REF_INFO_HANDLE = 3, /* gchandle */
-};
+ PROP_REF_INFO_HANDLE = 2, /* gchandle */
+ PROP_EXCEPTION_DATA = 3, /* MonoErrorBoxed* */
+ PROP_NESTED_CLASSES = 4, /* GList* */
+ PROP_PROPERTY_INFO = 5, /* MonoClassPropertyInfo* */
+ PROP_EVENT_INFO = 6, /* MonoClassEventInfo* */
+ PROP_FIELD_DEF_VALUES = 7, /* MonoFieldDefaultValue* */
+ PROP_DECLSEC_FLAGS = 8 /* guint32 */
+} InfrequentDataKind;
/* Accessors based on class kind*/
mono_property_bag_add (&class->infrequent_data, marshal_info);
}
-MonoClassExt*
-mono_class_get_ext (MonoClass *class)
-{
- return mono_property_bag_get (&class->infrequent_data, PROP_EXT);
-}
-
-void
-mono_class_set_ext (MonoClass *class, MonoClassExt *ext)
-{
- ext->head.tag = PROP_EXT;
- mono_property_bag_add (&class->infrequent_data, ext);
-}
-
typedef struct {
MonoPropertyBagItem head;
guint32 value;
prop = mono_property_bag_add (&class->infrequent_data, prop);
return prop->value;
}
+
+typedef struct {
+ MonoPropertyBagItem head;
+ gpointer value;
+} PointerProperty;
+
+static void
+set_pointer_property (MonoClass *klass, InfrequentDataKind property, gpointer value)
+{
+ PointerProperty *prop = mono_class_alloc (klass, sizeof (PointerProperty));
+ prop->head.tag = property;
+ prop->value = value;
+ mono_property_bag_add (&klass->infrequent_data, prop);
+}
+
+static gpointer
+get_pointer_property (MonoClass *klass, InfrequentDataKind property)
+{
+ PointerProperty *prop = (PointerProperty*)mono_property_bag_get (&klass->infrequent_data, property);
+ return prop ? prop->value : NULL;
+}
+
+MonoErrorBoxed*
+mono_class_get_exception_data (MonoClass *klass)
+{
+ return (MonoErrorBoxed*)get_pointer_property (klass, PROP_EXCEPTION_DATA);
+}
+
+void
+mono_class_set_exception_data (MonoClass *klass, MonoErrorBoxed *value)
+{
+ set_pointer_property (klass, PROP_EXCEPTION_DATA, value);
+}
+
+GList*
+mono_class_get_nested_classes_property (MonoClass *klass)
+{
+ return (GList*)get_pointer_property (klass, PROP_NESTED_CLASSES);
+}
+
+void
+mono_class_set_nested_classes_property (MonoClass *klass, GList *value)
+{
+ set_pointer_property (klass, PROP_NESTED_CLASSES, value);
+}
+
+MonoClassPropertyInfo*
+mono_class_get_property_info (MonoClass *klass)
+{
+ return mono_property_bag_get (&klass->infrequent_data, PROP_PROPERTY_INFO);
+}
+
+void
+mono_class_set_property_info (MonoClass *klass, MonoClassPropertyInfo *info)
+{
+ info->head.tag = PROP_PROPERTY_INFO;
+ mono_property_bag_add (&klass->infrequent_data, info);
+}
+
+MonoClassEventInfo*
+mono_class_get_event_info (MonoClass *klass)
+{
+ return mono_property_bag_get (&klass->infrequent_data, PROP_EVENT_INFO);
+}
+
+void
+mono_class_set_event_info (MonoClass *klass, MonoClassEventInfo *info)
+{
+ info->head.tag = PROP_EVENT_INFO;
+ mono_property_bag_add (&klass->infrequent_data, info);
+}
+
+MonoFieldDefaultValue*
+mono_class_get_field_def_values (MonoClass *klass)
+{
+ return (MonoFieldDefaultValue*)get_pointer_property (klass, PROP_FIELD_DEF_VALUES);
+}
+
+void
+mono_class_set_field_def_values (MonoClass *klass, MonoFieldDefaultValue *values)
+{
+ set_pointer_property (klass, PROP_FIELD_DEF_VALUES, values);
+}
+
+guint32
+mono_class_get_declsec_flags (MonoClass *class)
+{
+ Uint32Property *prop = mono_property_bag_get (&class->infrequent_data, PROP_DECLSEC_FLAGS);
+ return prop ? prop->value : 0;
+}
+
+void
+mono_class_set_declsec_flags (MonoClass *class, guint32 value)
+{
+ Uint32Property *prop = mono_class_alloc (class, sizeof (Uint32Property));
+ prop->head.tag = PROP_DECLSEC_FLAGS;
+ prop->value = value;
+ mono_property_bag_add (&class->infrequent_data, prop);
+}
#define MONO_SIZEOF_CLASS_RUNTIME_INFO (sizeof (MonoClassRuntimeInfo) - MONO_ZERO_LEN_ARRAY * SIZEOF_VOID_P)
-#define MONO_CLASS_PROP_EXCEPTION_DATA 0
-
-/*
- * This structure contains the rarely used fields of MonoClass
- * Since using just one field causes the whole structure to be allocated, it should
- * be used for fields which are only used in like 5% of all classes.
- */
typedef struct {
MonoPropertyBagItem head;
- struct {
-#if MONO_SMALL_CONFIG
- guint16 first, count;
-#else
- guint32 first, count;
-#endif
- } property, event;
-
- /* Initialized by a call to mono_class_setup_properties () */
MonoProperty *properties;
+ guint32 first, count;
+ MonoFieldDefaultValue *def_values;
+} MonoClassPropertyInfo;
+
+typedef struct {
+ MonoPropertyBagItem head;
/* Initialized by a call to mono_class_setup_events () */
MonoEvent *events;
-
- guint32 declsec_flags; /* declarative security attributes flags */
-
- /* Default values/RVA for fields and properties */
- /* Accessed using mono_class_get_field_default_value () / mono_field_get_data () */
- MonoFieldDefaultValue *field_def_values;
- MonoFieldDefaultValue *prop_def_values;
-
- GList *nested_classes;
-} MonoClassExt;
+ guint32 first, count;
+} MonoClassEventInfo;
typedef enum {
MONO_CLASS_DEF = 1, /* non-generic type */
guint blittable : 1; /* class is blittable */
guint unicode : 1; /* class uses unicode char when marshalled */
guint wastypebuilder : 1; /* class was created at runtime from a TypeBuilder */
+ guint is_array_special_interface : 1; /* gtd or ginst of once of the magic interfaces that arrays implement */
+
/* next byte */
guint8 min_align;
guint simd_type : 1; /* class is a simd intrinsic type */
guint has_finalize_inited : 1; /* has_finalize is initialized */
guint fields_inited : 1; /* setup_fields () has finished */
- guint has_failure : 1; /* See MONO_CLASS_PROP_EXCEPTION_DATA for a MonoErrorBoxed with the details */
+ guint has_failure : 1; /* See mono_class_get_exception_data () for a MonoErrorBoxed with the details */
MonoClass *parent;
MonoClass *nested_in;
gpointer
mono_class_alloc0 (MonoClass *klass, int size);
-void
-mono_class_alloc_ext (MonoClass *klass);
-
void
mono_class_setup_interfaces (MonoClass *klass, MonoError *error);
void
mono_class_set_marshal_info (MonoClass *class, MonoMarshalType *marshal_info);
-MonoClassExt*
-mono_class_get_ext (MonoClass *class);
-
-void
-mono_class_set_ext (MonoClass *class, MonoClassExt *ext);
-
guint32
mono_class_get_ref_info_handle (MonoClass *class);
guint32
mono_class_set_ref_info_handle (MonoClass *class, guint32 value);
+MonoErrorBoxed*
+mono_class_get_exception_data (MonoClass *klass);
+
+void
+mono_class_set_exception_data (MonoClass *klass, MonoErrorBoxed *value);
+
+GList*
+mono_class_get_nested_classes_property (MonoClass *klass);
+
+void
+mono_class_set_nested_classes_property (MonoClass *klass, GList *value);
+
+MonoClassPropertyInfo*
+mono_class_get_property_info (MonoClass *klass);
+
+void
+mono_class_set_property_info (MonoClass *klass, MonoClassPropertyInfo *info);
+
+MonoClassEventInfo*
+mono_class_get_event_info (MonoClass *klass);
+
+void
+mono_class_set_event_info (MonoClass *klass, MonoClassEventInfo *info);
+
+MonoFieldDefaultValue*
+mono_class_get_field_def_values (MonoClass *klass);
+
+void
+mono_class_set_field_def_values (MonoClass *klass, MonoFieldDefaultValue *values);
+
+guint32
+mono_class_get_declsec_flags (MonoClass *class);
+
+void
+mono_class_set_declsec_flags (MonoClass *class, guint32 value);
+
/*Now that everything has been defined, let's include the inline functions */
#include <mono/metadata/class-inlines.h>
static void mono_generic_class_setup_parent (MonoClass *klass, MonoClass *gklass);
static gboolean mono_class_set_failure (MonoClass *klass, MonoErrorBoxed *boxed_error);
-static gpointer mono_class_get_exception_data (const MonoClass *klass);
/*
enclosing = mono_class_from_typeref_checked (image, MONO_TOKEN_TYPE_REF | idx, error);
return_val_if_nok (error, NULL);
- MonoClassExt *ext = mono_class_get_ext (enclosing);
- if (enclosing->nested_classes_inited && ext) {
+ GList *nested_classes = mono_class_get_nested_classes_property (enclosing);
+ if (enclosing->nested_classes_inited && nested_classes) {
/* Micro-optimization: don't scan the metadata tables if enclosing is already inited */
- for (tmp = ext->nested_classes; tmp; tmp = tmp->next) {
+ for (tmp = nested_classes; tmp; tmp = tmp->next) {
res = (MonoClass *)tmp->data;
if (strcmp (res->name, name) == 0)
return res;
mono_error_set_for_class_failure (MonoError *oerror, const MonoClass *klass)
{
g_assert (mono_class_has_failure (klass));
- MonoErrorBoxed *box = (MonoErrorBoxed*)mono_class_get_exception_data (klass);
+ MonoErrorBoxed *box = mono_class_get_exception_data ((MonoClass*)klass);
mono_error_set_from_boxed (oerror, box);
}
-
/*
* mono_class_alloc:
*
MonoProperty *properties;
guint32 last;
int first, count;
+ MonoClassPropertyInfo *info;
- MonoClassExt *ext = mono_class_get_ext (klass);
- if (ext && ext->properties)
+ info = mono_class_get_property_info (klass);
+ if (info)
return;
if (mono_class_is_ginst (klass)) {
if (mono_class_set_type_load_failure_causedby_class (klass, gklass, "Generic type definition failed to load"))
return;
- MonoClassExt *gext = mono_class_get_ext (gklass);
- properties = mono_class_new0 (klass, MonoProperty, gext->property.count + 1);
+ MonoClassPropertyInfo *ginfo = mono_class_get_property_info (gklass);
+ properties = mono_class_new0 (klass, MonoProperty, ginfo->count + 1);
- for (i = 0; i < gext->property.count; i++) {
+ for (i = 0; i < ginfo->count; i++) {
MonoError error;
MonoProperty *prop = &properties [i];
- *prop = gext->properties [i];
+ *prop = ginfo->properties [i];
if (prop->get)
prop->get = mono_class_inflate_generic_method_full_checked (
prop->parent = klass;
}
- first = gext->property.first;
- count = gext->property.count;
+ first = ginfo->first;
+ count = ginfo->count;
} else {
first = mono_metadata_properties_from_typedef (klass->image, mono_metadata_token_index (klass->type_token) - 1, &last);
count = last - first;
}
}
- mono_class_alloc_ext (klass);
- ext = mono_class_get_ext (klass);
-
- mono_image_lock (klass->image);
-
- if (ext->properties) {
- /* We leak 'properties' which was allocated from the image mempool */
- mono_image_unlock (klass->image);
- return;
- }
-
- ext->property.first = first;
- ext->property.count = count;
-
- /* Flush any pending writes as we do double checked locking on klass->ext->properties */
+ info = mono_class_alloc0 (klass, sizeof (MonoClassPropertyInfo));
+ info->first = first;
+ info->count = count;
+ info->properties = properties;
mono_memory_barrier ();
- /* Leave this assignment as the last op in the function */
- ext->properties = properties;
-
- mono_image_unlock (klass->image);
+ /* This might leak 'info' which was allocated from the image mempool */
+ mono_class_set_property_info (klass, info);
}
static MonoMethod**
guint32 last;
MonoEvent *events;
- MonoClassExt *ext = mono_class_get_ext (klass);
- if (ext && ext->events)
+ MonoClassEventInfo *info = mono_class_get_event_info (klass);
+ if (info)
return;
if (mono_class_is_ginst (klass)) {
if (mono_class_set_type_load_failure_causedby_class (klass, gklass, "Generic type definition failed to load"))
return;
- MonoClassExt *gext = mono_class_get_ext (gklass);
- first = gext->event.first;
- count = gext->event.count;
+ MonoClassEventInfo *ginfo = mono_class_get_event_info (gklass);
+ first = ginfo->first;
+ count = ginfo->count;
events = mono_class_new0 (klass, MonoEvent, count);
for (i = 0; i < count; i++) {
MonoError error;
MonoEvent *event = &events [i];
- MonoEvent *gevent = &gext->events [i];
+ MonoEvent *gevent = &ginfo->events [i];
mono_error_init (&error); //since we do conditional calls, we must ensure the default value is ok
}
}
- mono_class_alloc_ext (klass);
- ext = mono_class_get_ext (klass);
+ info = mono_class_alloc0 (klass, sizeof (MonoClassEventInfo));
+ info->events = events;
+ info->first = first;
+ info->count = count;
- mono_image_lock (klass->image);
-
- if (ext->events) {
- mono_image_unlock (klass->image);
- return;
- }
-
- ext->event.first = first;
- ext->event.count = count;
-
- /* Flush any pending writes as we do double checked locking on klass->ext.events */
mono_memory_barrier ();
- /* Leave this assignment as the last op in the function */
- ext->events = events;
-
- mono_image_unlock (klass->image);
+ mono_class_set_event_info (klass, info);
}
/*
if (i >= 0)
return i;
+ if (itf->is_array_special_interface && klass->rank < 2) {
+ MonoClass *gtd = mono_class_get_generic_type_definition (itf);
+
+ for (i = 0; i < klass->interface_offsets_count; i++) {
+ // printf ("\t%s\n", mono_type_get_full_name (klass->interfaces_packed [i]));
+ if (mono_class_get_generic_type_definition (klass->interfaces_packed [i]) == gtd) {
+ *non_exact_match = TRUE;
+ return klass->interface_offsets_packed [i];
+ }
+ }
+ }
+
if (!mono_class_has_variant_generic_params (itf))
return -1;
static GENERATE_GET_CLASS_WITH_CACHE (generic_ireadonlylist, System.Collections.Generic, IReadOnlyList`1)
static GENERATE_GET_CLASS_WITH_CACHE (generic_ireadonlycollection, System.Collections.Generic, IReadOnlyCollection`1)
-/* this won't be needed once bug #325495 is completely fixed
- * though we'll need something similar to know which interfaces to allow
- * in arrays when they'll be lazyly created
- *
- * FIXME: System.Array/InternalEnumerator don't need all this interface fabrication machinery.
- * MS returns diferrent types based on which instance is called. For example:
- * object obj = new byte[10][];
- * Type a = ((IEnumerable<byte[]>)obj).GetEnumerator ().GetType ();
- * Type b = ((IEnumerable<IList<byte>>)obj).GetEnumerator ().GetType ();
- * a != b ==> true
- *
- * Fixing this should kill quite some code, save some bits and improve compatibility.
- */
-static MonoClass**
-get_implicit_generic_array_interfaces (MonoClass *klass, int *num, int *is_enumerator)
-{
- MonoClass *eclass = klass->element_class;
- MonoClass* generic_icollection_class;
- MonoClass* generic_ienumerable_class;
- MonoClass* generic_ienumerator_class;
- MonoClass* generic_ireadonlylist_class;
- MonoClass* generic_ireadonlycollection_class;
- MonoClass *valuetype_types[2] = { NULL, NULL };
- MonoClass **interfaces = NULL;
- int i, nifaces, interface_count, real_count, original_rank;
- int all_interfaces;
- gboolean internal_enumerator;
- gboolean eclass_is_valuetype;
-
- if (!mono_defaults.generic_ilist_class) {
- *num = 0;
- return NULL;
- }
- internal_enumerator = FALSE;
- eclass_is_valuetype = FALSE;
- original_rank = eclass->rank;
- if (klass->byval_arg.type != MONO_TYPE_SZARRAY) {
- MonoGenericClass *gklass = mono_class_try_get_generic_class (klass);
- if (gklass && klass->nested_in == mono_defaults.array_class && strcmp (klass->name, "InternalEnumerator`1") == 0) {
- /*
- * For a Enumerator<T[]> we need to get the list of interfaces for T.
- */
- eclass = mono_class_from_mono_type (gklass->context.class_inst->type_argv [0]);
- original_rank = eclass->rank;
- if (!eclass->rank)
- eclass = eclass->element_class;
- internal_enumerator = TRUE;
- *is_enumerator = TRUE;
- } else {
- *num = 0;
- return NULL;
- }
- }
-
- /*
- * with this non-lazy impl we can't implement all the interfaces so we do just the minimal stuff
- * for deep levels of arrays of arrays (string[][] has all the interfaces, string[][][] doesn't)
- */
- all_interfaces = eclass->rank && eclass->element_class->rank? FALSE: TRUE;
-
- generic_icollection_class = mono_class_get_generic_icollection_class ();
- generic_ienumerable_class = mono_class_get_generic_ienumerable_class ();
- generic_ienumerator_class = mono_class_get_generic_ienumerator_class ();
- generic_ireadonlylist_class = mono_class_get_generic_ireadonlylist_class ();
- generic_ireadonlycollection_class = mono_class_get_generic_ireadonlycollection_class ();
-
- mono_class_init (eclass);
-
- /*
- * Arrays in 2.0 need to implement a number of generic interfaces
- * (IList`1, ICollection`1, IEnumerable`1 for a number of types depending
- * on the element class). For net 4.5, we also need to implement IReadOnlyList`1/IReadOnlyCollection`1.
- * We collect the types needed to build the
- * instantiations in interfaces at intervals of 3/5, because 3/5 are
- * the generic interfaces needed to implement.
- *
- * On 4.5, as an optimization, we don't expand ref classes for the variant generic interfaces
- * (IEnumerator, IReadOnlyList and IReadOnlyColleciton). The regular dispatch code can handle those cases.
- */
- if (eclass->valuetype) {
- nifaces = generic_ireadonlylist_class ? 5 : 3;
- fill_valuetype_array_derived_types (valuetype_types, eclass, original_rank);
-
- /* IList, ICollection, IEnumerable, IReadOnlyList`1 */
- real_count = interface_count = valuetype_types [1] ? (nifaces * 2) : nifaces;
- if (internal_enumerator) {
- ++real_count;
- if (valuetype_types [1])
- ++real_count;
- }
-
- interfaces = (MonoClass **)g_malloc0 (sizeof (MonoClass*) * real_count);
- interfaces [0] = valuetype_types [0];
- if (valuetype_types [1])
- interfaces [nifaces] = valuetype_types [1];
-
- eclass_is_valuetype = TRUE;
- } else {
- int j;
- int idepth = eclass->idepth;
- if (!internal_enumerator)
- idepth--;
- nifaces = generic_ireadonlylist_class ? 2 : 3;
-
- // FIXME: This doesn't seem to work/required for generic params
- if (!(eclass->this_arg.type == MONO_TYPE_VAR || eclass->this_arg.type == MONO_TYPE_MVAR || (image_is_dynamic (eclass->image) && !eclass->wastypebuilder)))
- mono_class_setup_interface_offsets (eclass);
-
- interface_count = all_interfaces? eclass->interface_offsets_count: eclass->interface_count;
- /* we add object for interfaces and the supertypes for the other
- * types. The last of the supertypes is the element class itself which we
- * already created the explicit interfaces for (so we include it for IEnumerator
- * and exclude it for arrays).
- */
- if (MONO_CLASS_IS_INTERFACE (eclass))
- interface_count++;
- else
- interface_count += idepth;
- if (eclass->rank && eclass->element_class->valuetype) {
- fill_valuetype_array_derived_types (valuetype_types, eclass->element_class, original_rank);
- if (valuetype_types [1])
- ++interface_count;
- }
- /* IList, ICollection, IEnumerable, IReadOnlyList */
- interface_count *= nifaces;
- real_count = interface_count;
- if (internal_enumerator) {
- real_count += (MONO_CLASS_IS_INTERFACE (eclass) ? 1 : idepth) + eclass->interface_offsets_count;
- if (valuetype_types [1])
- ++real_count;
- }
- interfaces = (MonoClass **)g_malloc0 (sizeof (MonoClass*) * real_count);
- if (MONO_CLASS_IS_INTERFACE (eclass)) {
- interfaces [0] = mono_defaults.object_class;
- j = nifaces;
- } else {
- j = 0;
- for (i = 0; i < idepth; i++) {
- mono_class_init (eclass->supertypes [i]);
- interfaces [j] = eclass->supertypes [i];
- j += nifaces;
- }
- }
- if (all_interfaces) {
- for (i = 0; i < eclass->interface_offsets_count; i++) {
- interfaces [j] = eclass->interfaces_packed [i];
- j += nifaces;
- }
- } else {
- for (i = 0; i < eclass->interface_count; i++) {
- interfaces [j] = eclass->interfaces [i];
- j += nifaces;
- }
- }
- if (valuetype_types [1]) {
- interfaces [j] = array_class_get_if_rank (valuetype_types [1], original_rank);
- j += nifaces;
- }
- }
-
- /* instantiate the generic interfaces */
- for (i = 0; i < interface_count; i += nifaces) {
- MonoClass *iface = interfaces [i];
-
- interfaces [i + 0] = inflate_class_one_arg (mono_defaults.generic_ilist_class, iface);
- interfaces [i + 1] = inflate_class_one_arg (generic_icollection_class, iface);
-
- if (eclass->valuetype) {
- interfaces [i + 2] = inflate_class_one_arg (generic_ienumerable_class, iface);
- if (generic_ireadonlylist_class) {
- interfaces [i + 3] = inflate_class_one_arg (generic_ireadonlylist_class, iface);
- interfaces [i + 4] = inflate_class_one_arg (generic_ireadonlycollection_class, iface);
- }
- } else {
- if (!generic_ireadonlylist_class)
- interfaces [i + 2] = inflate_class_one_arg (generic_ienumerable_class, iface);
- }
- }
- if (internal_enumerator) {
- int j;
- /* instantiate IEnumerator<iface> */
- for (i = 0; i < interface_count; i++) {
- interfaces [i] = inflate_class_one_arg (generic_ienumerator_class, interfaces [i]);
- }
- j = interface_count;
- if (!eclass_is_valuetype) {
- if (MONO_CLASS_IS_INTERFACE (eclass)) {
- interfaces [j] = inflate_class_one_arg (generic_ienumerator_class, mono_defaults.object_class);
- j ++;
- } else {
- for (i = 0; i < eclass->idepth; i++) {
- interfaces [j] = inflate_class_one_arg (generic_ienumerator_class, eclass->supertypes [i]);
- j ++;
- }
- }
- for (i = 0; i < eclass->interface_offsets_count; i++) {
- interfaces [j] = inflate_class_one_arg (generic_ienumerator_class, eclass->interfaces_packed [i]);
- j ++;
- }
- } else {
- interfaces [j++] = inflate_class_one_arg (generic_ienumerator_class, array_class_get_if_rank (valuetype_types [0], original_rank));
- }
- if (valuetype_types [1])
- interfaces [j] = inflate_class_one_arg (generic_ienumerator_class, array_class_get_if_rank (valuetype_types [1], original_rank));
- }
-#if 0
- {
- char *type_name = mono_type_get_name_full (&klass->byval_arg, 0);
- for (i = 0; i < real_count; ++i) {
- char *name = mono_type_get_name_full (&interfaces [i]->byval_arg, 0);
- g_print ("%s implements %s\n", type_name, name);
- g_free (name);
- }
- g_free (type_name);
- }
-#endif
- *num = real_count;
- return interfaces;
-}
-
static int
find_array_interface (MonoClass *klass, const char *name)
{
GPtrArray *ifaces;
GPtrArray **ifaces_array = NULL;
int interface_offsets_count;
- MonoClass **array_interfaces = NULL;
- int num_array_interfaces;
- int is_enumerator = FALSE;
mono_loader_lock ();
mono_class_setup_supertypes (klass);
- /*
- * get the implicit generic interfaces for either the arrays or for System.Array/InternalEnumerator<T>
- * implicit interfaces have the property that they are assigned the same slot in the
- * vtables for compatible interfaces
- */
- array_interfaces = get_implicit_generic_array_interfaces (klass, &num_array_interfaces, &is_enumerator);
/* compute maximum number of slots and maximum interface id */
max_iid = 0;
- num_ifaces = num_array_interfaces; /* this can include duplicated ones */
+ num_ifaces = 0; /* this can include duplicated ones */
ifaces_array = g_new0 (GPtrArray *, klass->idepth);
for (j = 0; j < klass->idepth; j++) {
k = klass->supertypes [j];
}
}
- for (i = 0; i < num_array_interfaces; ++i) {
- ic = array_interfaces [i];
- mono_class_init (ic);
- if (max_iid < ic->interface_id)
- max_iid = ic->interface_id;
- }
-
if (MONO_CLASS_IS_INTERFACE (klass)) {
num_ifaces++;
if (max_iid < klass->interface_id)
if (MONO_CLASS_IS_INTERFACE (klass))
set_interface_and_offset (num_ifaces, interfaces_full, interface_offsets_full, klass, cur_slot, TRUE);
- if (num_array_interfaces) {
- if (is_enumerator) {
- int ienumerator_idx = find_array_interface (klass, "IEnumerator`1");
- int ienumerator_offset = find_interface_offset (num_ifaces, interfaces_full, interface_offsets_full, klass->interfaces [ienumerator_idx]);
- g_assert (ienumerator_offset >= 0);
- for (i = 0; i < num_array_interfaces; ++i) {
- ic = array_interfaces [i];
- if (strcmp (ic->name, "IEnumerator`1") == 0)
- set_interface_and_offset (num_ifaces, interfaces_full, interface_offsets_full, ic, ienumerator_offset, TRUE);
- else
- g_assert_not_reached ();
- /*g_print ("type %s has %s offset at %d (%s)\n", klass->name, ic->name, interface_offsets_full [ic->interface_id], klass->interfaces [0]->name);*/
- }
- } else {
- int ilist_offset, icollection_offset, ienumerable_offset, ireadonlylist_offset, ireadonlycollection_offset;
- int ilist_iface_idx = find_array_interface (klass, "IList`1");
- MonoClass* ilist_class = klass->interfaces [ilist_iface_idx];
- int ireadonlylist_iface_idx = find_array_interface (klass, "IReadOnlyList`1");
- MonoClass* ireadonlylist_class = ireadonlylist_iface_idx != -1 ? klass->interfaces [ireadonlylist_iface_idx] : NULL;
- int icollection_iface_idx = find_array_interface (ilist_class, "ICollection`1");
- int ienumerable_iface_idx = find_array_interface (ilist_class, "IEnumerable`1");
- int ireadonlycollection_iface_idx = ireadonlylist_iface_idx != -1 ? find_array_interface (ireadonlylist_class, "IReadOnlyCollection`1") : -1;
- ilist_offset = find_interface_offset (num_ifaces, interfaces_full, interface_offsets_full, klass->interfaces [ilist_iface_idx]);
- icollection_offset = find_interface_offset (num_ifaces, interfaces_full, interface_offsets_full, ilist_class->interfaces [icollection_iface_idx]);
- ienumerable_offset = find_interface_offset (num_ifaces, interfaces_full, interface_offsets_full, ilist_class->interfaces [ienumerable_iface_idx]);
- ireadonlylist_offset = ireadonlylist_iface_idx != -1 ? find_interface_offset (num_ifaces, interfaces_full, interface_offsets_full, klass->interfaces [ireadonlylist_iface_idx]) : -1;
- ireadonlycollection_offset = ireadonlycollection_iface_idx != -1 ? find_interface_offset (num_ifaces, interfaces_full, interface_offsets_full, ireadonlylist_class->interfaces [ireadonlycollection_iface_idx]) : -1;
- g_assert (ilist_offset >= 0 && icollection_offset >= 0 && ienumerable_offset >= 0);
- for (i = 0; i < num_array_interfaces; ++i) {
- int offset;
- ic = array_interfaces [i];
- if (mono_class_get_generic_class (ic)->container_class == mono_defaults.generic_ilist_class)
- offset = ilist_offset;
- else if (strcmp (ic->name, "ICollection`1") == 0)
- offset = icollection_offset;
- else if (strcmp (ic->name, "IEnumerable`1") == 0)
- offset = ienumerable_offset;
- else if (strcmp (ic->name, "IReadOnlyList`1") == 0)
- offset = ireadonlylist_offset;
- else if (strcmp (ic->name, "IReadOnlyCollection`1") == 0)
- offset = ireadonlycollection_offset;
- else
- g_assert_not_reached ();
- set_interface_and_offset (num_ifaces, interfaces_full, interface_offsets_full, ic, offset, TRUE);
- /*g_print ("type %s has %s offset at %d (%s)\n", klass->name, ic->name, offset, klass->interfaces [0]->name);*/
- }
- }
- }
-
for (interface_offsets_count = 0, i = 0; i < num_ifaces; i++) {
if (interface_offsets_full [i] != -1)
interface_offsets_count ++;
bitmap [id >> 3] |= (1 << (id & 7));
klass->interfaces_packed [i] = interfaces_full [i];
klass->interface_offsets_packed [i] = interface_offsets_full [i];
- /*if (num_array_interfaces)
- g_print ("type %s has %s offset at %d\n", mono_type_get_name_full (&klass->byval_arg, 0), mono_type_get_name_full (&interfaces_full [i]->byval_arg, 0), interface_offsets_full [i]);*/
}
#ifdef COMPRESSED_INTERFACE_BITMAP
i = mono_compress_bitmap (NULL, bitmap, bsize);
g_free (interfaces_full);
g_free (interface_offsets_full);
- g_free (array_interfaces);
for (i = 0; i < klass->idepth; i++) {
ifaces = ifaces_array [i];
if (ifaces)
klass->this_arg.type = (MonoTypeEnum)t;
}
- if (MONO_CLASS_IS_INTERFACE (klass))
+ if (MONO_CLASS_IS_INTERFACE (klass)) {
klass->interface_id = mono_get_unique_iid (klass);
+
+ if (is_corlib && !strcmp (nspace, "System.Collections.Generic")) {
+ //FIXME IEnumerator needs to be special because GetEnumerator uses magic under the hood
+ /* FIXME: System.Array/InternalEnumerator don't need all this interface fabrication machinery.
+ * MS returns diferrent types based on which instance is called. For example:
+ * object obj = new byte[10][];
+ * Type a = ((IEnumerable<byte[]>)obj).GetEnumerator ().GetType ();
+ * Type b = ((IEnumerable<IList<byte>>)obj).GetEnumerator ().GetType ();
+ * a != b ==> true
+ */
+ if (!strcmp (name, "IList`1") || !strcmp (name, "ICollection`1") || !strcmp (name, "IEnumerable`1") || !strcmp (name, "IEnumerator`1"))
+ klass->is_array_special_interface = 1;
+ }
+ }
}
#ifndef DISABLE_COM
#endif
klass->cast_class = klass->element_class = klass;
+ if (mono_is_corlib_image (klass->image)) {
+ switch (klass->byval_arg.type) {
+ case MONO_TYPE_I1:
+ if (mono_defaults.byte_class)
+ klass->cast_class = mono_defaults.byte_class;
+ break;
+ case MONO_TYPE_U1:
+ if (mono_defaults.sbyte_class)
+ mono_defaults.sbyte_class = klass;
+ break;
+ case MONO_TYPE_I2:
+ if (mono_defaults.uint16_class)
+ mono_defaults.uint16_class = klass;
+ break;
+ case MONO_TYPE_U2:
+ if (mono_defaults.int16_class)
+ klass->cast_class = mono_defaults.int16_class;
+ break;
+ case MONO_TYPE_I4:
+ if (mono_defaults.uint32_class)
+ mono_defaults.uint32_class = klass;
+ break;
+ case MONO_TYPE_U4:
+ if (mono_defaults.int32_class)
+ klass->cast_class = mono_defaults.int32_class;
+ break;
+ case MONO_TYPE_I8:
+ if (mono_defaults.uint64_class)
+ mono_defaults.uint64_class = klass;
+ break;
+ case MONO_TYPE_U8:
+ if (mono_defaults.int64_class)
+ klass->cast_class = mono_defaults.int64_class;
+ break;
+ }
+ }
if (!klass->enumtype) {
if (!mono_metadata_interfaces_from_typedef_full (
klass->enumtype = gklass->enumtype;
klass->valuetype = gklass->valuetype;
+
if (gklass->image->assembly_name && !strcmp (gklass->image->assembly_name, "System.Numerics.Vectors") && !strcmp (gklass->name_space, "System.Numerics") && !strcmp (gklass->name, "Vector`1")) {
g_assert (gclass->context.class_inst);
g_assert (gclass->context.class_inst->type_argc > 0);
if (mono_type_is_primitive (gclass->context.class_inst->type_argv [0]))
klass->simd_type = 1;
}
+ klass->is_array_special_interface = gklass->is_array_special_interface;
klass->cast_class = klass->element_class = klass;
guint32 constant_cols [MONO_CONSTANT_SIZE];
int field_index;
MonoClass *klass = field->parent;
+ MonoFieldDefaultValue *def_values;
g_assert (field->type->attrs & FIELD_ATTRIBUTE_HAS_DEFAULT);
- MonoClassExt *ext = mono_class_get_ext (klass);
- if (!ext || !ext->field_def_values) {
- MonoFieldDefaultValue *def_values;
-
- mono_class_alloc_ext (klass);
- ext = mono_class_get_ext (klass);
-
+ def_values = mono_class_get_field_def_values (klass);
+ if (!def_values) {
def_values = (MonoFieldDefaultValue *)mono_class_alloc0 (klass, sizeof (MonoFieldDefaultValue) * mono_class_get_field_count (klass));
- mono_image_lock (klass->image);
- mono_memory_barrier ();
- if (!ext->field_def_values)
- ext->field_def_values = def_values;
- mono_image_unlock (klass->image);
+ mono_class_set_field_def_values (klass, def_values);
}
field_index = mono_field_get_index (field);
- if (!ext->field_def_values [field_index].data) {
+ if (!def_values [field_index].data) {
cindex = mono_metadata_get_constant_index (field->parent->image, mono_class_get_field_token (field), 0);
if (!cindex)
return NULL;
g_assert (!(field->type->attrs & FIELD_ATTRIBUTE_HAS_FIELD_RVA));
mono_metadata_decode_row (&field->parent->image->tables [MONO_TABLE_CONSTANT], cindex - 1, constant_cols, MONO_CONSTANT_SIZE);
- ext->field_def_values [field_index].def_type = (MonoTypeEnum)constant_cols [MONO_CONSTANT_TYPE];
- ext->field_def_values [field_index].data = (const char *)mono_metadata_blob_heap (field->parent->image, constant_cols [MONO_CONSTANT_VALUE]);
+ def_values [field_index].def_type = (MonoTypeEnum)constant_cols [MONO_CONSTANT_TYPE];
+ mono_memory_barrier ();
+ def_values [field_index].data = (const char *)mono_metadata_blob_heap (field->parent->image, constant_cols [MONO_CONSTANT_VALUE]);
}
- *def_type = ext->field_def_values [field_index].def_type;
- return ext->field_def_values [field_index].data;
+ *def_type = def_values [field_index].def_type;
+ return def_values [field_index].data;
}
static int
mono_property_get_index (MonoProperty *prop)
{
- MonoClassExt *ext = mono_class_get_ext (prop->parent);
- int index = prop - ext->properties;
+ MonoClassPropertyInfo *info = mono_class_get_property_info (prop->parent);
+ int index = prop - info->properties;
- g_assert (index >= 0 && index < ext->property.count);
+ g_assert (index >= 0 && index < info->count);
return index;
}
*/
if (image_is_dynamic (klass->image)) {
- MonoClassExt *ext = mono_class_get_ext (klass);
+ MonoClassPropertyInfo *info = mono_class_get_property_info (klass);
int prop_index = mono_property_get_index (property);
- if (ext->prop_def_values && ext->prop_def_values [prop_index].data) {
- *def_type = ext->prop_def_values [prop_index].def_type;
- return ext->prop_def_values [prop_index].data;
+ if (info->def_values && info->def_values [prop_index].data) {
+ *def_type = info->def_values [prop_index].def_type;
+ return info->def_values [prop_index].data;
}
return NULL;
}
int i;
while (klass) {
- MonoClassExt *ext = mono_class_get_ext (klass);
- if (ext) {
- for (i = 0; i < ext->event.count; ++i) {
- if (&ext->events [i] == event)
- return mono_metadata_make_token (MONO_TABLE_EVENT, ext->event.first + i + 1);
+ MonoClassEventInfo *info = mono_class_get_event_info (klass);
+ if (info) {
+ for (i = 0; i < info->count; ++i) {
+ if (&info->events [i] == event)
+ return mono_metadata_make_token (MONO_TABLE_EVENT, info->first + i + 1);
}
}
klass = klass->parent;
MonoProperty* p;
int i = 0;
gpointer iter = NULL;
- MonoClassExt *ext = mono_class_get_ext (klass);
+ MonoClassPropertyInfo *info = mono_class_get_property_info (klass);
while ((p = mono_class_get_properties (klass, &iter))) {
- if (&ext->properties [i] == prop)
- return mono_metadata_make_token (MONO_TABLE_PROPERTY, ext->property.first + i + 1);
+ if (&info->properties [i] == prop)
+ return mono_metadata_make_token (MONO_TABLE_PROPERTY, info->first + i + 1);
i ++;
}
if (MONO_CLASS_IMPLEMENTS_INTERFACE (oklass, klass->interface_id))
return TRUE;
+ if (klass->is_array_special_interface && oklass->rank == 1) {
+ //XXX we could offset this by having the cast target computed at JIT time
+ //XXX we could go even further and emit a wrapper that would do the extra type check
+ MonoClass *iface_klass = mono_class_from_mono_type (mono_class_get_generic_class (klass)->context.class_inst->type_argv [0]);
+ MonoClass *obj_klass = oklass->cast_class; //This gets us the cast class of element type of the array
+
+ // If the target we're trying to cast to is a valuetype, we must account of weird valuetype equivalences such as IntEnum <> int or uint <> int
+ // We can't apply it for ref types as this would go wrong with arrays - IList<byte[]> would have byte tested
+ if (iface_klass->valuetype)
+ iface_klass = iface_klass->cast_class;
+
+ //array covariant casts only operates on scalar to scalar
+ //This is so int[] can't be casted to IComparable<int>[]
+ if (!(obj_klass->valuetype && !iface_klass->valuetype) && mono_class_is_assignable_from (iface_klass, obj_klass))
+ return TRUE;
+ }
+
if (mono_class_has_variant_generic_params (klass)) {
int i;
mono_class_setup_interfaces (oklass, &error);
{
mono_class_setup_properties (klass);
- return mono_class_get_ext (klass)->property.count;
+ return mono_class_get_property_info (klass)->count;
}
/**
{
mono_class_setup_events (klass);
- return mono_class_get_ext (klass)->event.count;
+ return mono_class_get_event_info (klass)->count;
}
/**
return NULL;
if (!*iter) {
mono_class_setup_properties (klass);
- MonoClassExt *ext = mono_class_get_ext (klass);
+ MonoClassPropertyInfo *info = mono_class_get_property_info (klass);
/* start from the first */
- if (ext->property.count) {
- *iter = &ext->properties [0];
+ if (info->count) {
+ *iter = &info->properties [0];
return (MonoProperty *)*iter;
} else {
/* no fields */
}
property = (MonoProperty *)*iter;
property++;
- MonoClassExt *ext = mono_class_get_ext (klass);
- if (property < &ext->properties [ext->property.count]) {
+ MonoClassPropertyInfo *info = mono_class_get_property_info (klass);
+ if (property < &info->properties [info->count]) {
*iter = property;
return (MonoProperty *)*iter;
}
return NULL;
if (!*iter) {
mono_class_setup_events (klass);
- MonoClassExt *ext = mono_class_get_ext (klass);
+ MonoClassEventInfo *info = mono_class_get_event_info (klass);
/* start from the first */
- if (ext->event.count) {
- *iter = &ext->events [0];
+ if (info->count) {
+ *iter = &info->events [0];
return (MonoEvent *)*iter;
} else {
/* no fields */
}
event = (MonoEvent *)*iter;
event++;
- MonoClassExt *ext = mono_class_get_ext (klass);
- if (event < &ext->events [ext->event.count]) {
+ MonoClassEventInfo *info = mono_class_get_event_info (klass);
+ if (event < &info->events [info->count]) {
*iter = event;
return (MonoEvent *)*iter;
}
i = mono_metadata_nesting_typedef (klass->image, klass->type_token, i + 1);
}
- mono_class_alloc_ext (klass);
-
nested_classes = NULL;
for (l = classes; l; l = l->next)
nested_classes = g_list_prepend_image (klass->image, nested_classes, l->data);
g_list_free (classes);
- mono_image_lock (klass->image);
-
- mono_memory_barrier ();
+ mono_loader_lock ();
if (!klass->nested_classes_inited) {
- mono_class_get_ext (klass)->nested_classes = nested_classes;
+ mono_class_set_nested_classes_property (klass, nested_classes);
mono_memory_barrier ();
klass->nested_classes_inited = TRUE;
}
-
- mono_image_unlock (klass->image);
+ mono_loader_unlock ();
}
/**
setup_nested_types (klass);
if (!*iter) {
- MonoClassExt *ext = mono_class_get_ext (klass);
+ GList *nested_classes = mono_class_get_nested_classes_property (klass);
/* start from the first */
- if (ext && ext->nested_classes) {
- *iter = ext->nested_classes;
- return (MonoClass *)ext->nested_classes->data;
+ if (nested_classes) {
+ *iter = nested_classes;
+ return (MonoClass *)nested_classes->data;
} else {
/* no nested types */
return NULL;
guint32 rva;
int field_index;
MonoClass *klass = field->parent;
- MonoFieldDefaultValue *field_def_values;
+ MonoFieldDefaultValue *def_values;
g_assert (field->type->attrs & FIELD_ATTRIBUTE_HAS_FIELD_RVA);
- MonoClassExt *ext = mono_class_get_ext (klass);
- if (!ext || !ext->field_def_values) {
- mono_class_alloc_ext (klass);
- ext = mono_class_get_ext (klass);
-
- field_def_values = (MonoFieldDefaultValue *)mono_class_alloc0 (klass, sizeof (MonoFieldDefaultValue) * mono_class_get_field_count (klass));
+ def_values = mono_class_get_field_def_values (klass);
+ if (!def_values) {
+ def_values = (MonoFieldDefaultValue *)mono_class_alloc0 (klass, sizeof (MonoFieldDefaultValue) * mono_class_get_field_count (klass));
- mono_image_lock (klass->image);
- if (!ext->field_def_values)
- ext->field_def_values = field_def_values;
- mono_image_unlock (klass->image);
+ mono_class_set_field_def_values (klass, def_values);
}
field_index = mono_field_get_index (field);
- if (!ext->field_def_values [field_index].data && !image_is_dynamic (klass->image)) {
+ if (!def_values [field_index].data && !image_is_dynamic (klass->image)) {
int first_field_idx = mono_class_get_first_field_idx (klass);
mono_metadata_field_info (field->parent->image, first_field_idx + field_index, NULL, &rva, NULL);
if (!rva)
g_warning ("field %s in %s should have RVA data, but hasn't", mono_field_get_name (field), field->parent->name);
- ext->field_def_values [field_index].data = mono_image_rva_map (field->parent->image, rva);
+ def_values [field_index].data = mono_image_rva_map (field->parent->image, rva);
}
- return ext->field_def_values [field_index].data;
+ return def_values [field_index].data;
}
/**
mono_loader_lock ();
klass->has_failure = 1;
- mono_image_property_insert (klass->image, klass, MONO_CLASS_PROP_EXCEPTION_DATA, boxed_error);
+ mono_class_set_exception_data (klass, boxed_error);
mono_loader_unlock ();
return TRUE;
return mono_class_set_failure (klass, box);
}
-/*
- * mono_class_get_exception_data:
- *
- * Return the exception_data property of KLASS.
- *
- * LOCKING: Acquires the loader lock.
- */
-static gpointer
-mono_class_get_exception_data (const MonoClass *klass)
-{
- return mono_image_property_lookup (klass->image, (MonoClass*)klass, MONO_CLASS_PROP_EXCEPTION_DATA);
-}
-
/**
* mono_classes_init:
*
MONO_COUNTER_GENERICS | MONO_COUNTER_INT, &inflated_classes_size);
mono_counters_register ("MonoClass size",
MONO_COUNTER_METADATA | MONO_COUNTER_INT, &classes_size);
- mono_counters_register ("MonoClassExt size",
- MONO_COUNTER_METADATA | MONO_COUNTER_INT, &class_ext_size);
-
- mono_counters_register ("MonoClassExt count",
- MONO_COUNTER_METADATA | MONO_COUNTER_INT, &class_ext_count);
}
/**
mono_loader_unlock ();
}
-/*
- * mono_class_alloc_ext:
- *
- * Allocate klass->ext if not already done.
- */
-void
-mono_class_alloc_ext (MonoClass *klass)
-{
- MonoClassExt *ext;
-
- if (mono_class_get_ext (klass))
- return;
-
- ext = (MonoClassExt *)mono_class_alloc0 (klass, sizeof (MonoClassExt));
- mono_image_lock (klass->image);
- mono_memory_barrier ();
- if (!mono_class_get_ext (klass))
- mono_class_set_ext (klass, ext);
- class_ext_size += sizeof (MonoClassExt);
- ++class_ext_count;
- mono_image_unlock (klass->image);
-}
-
/*
* mono_class_setup_interfaces:
*
* Find the property index in the metadata Property table.
*/
static guint32
-find_property_index (MonoClass *klass, MonoProperty *property) {
+find_property_index (MonoClass *klass, MonoProperty *property)
+{
int i;
- MonoClassExt *ext = mono_class_get_ext (klass);
+ MonoClassPropertyInfo *info = mono_class_get_property_info (klass);
- for (i = 0; i < ext->property.count; ++i) {
- if (property == &ext->properties [i])
- return ext->property.first + 1 + i;
+ for (i = 0; i < info->count; ++i) {
+ if (property == &info->properties [i])
+ return info->first + 1 + i;
}
return 0;
}
* Find the event index in the metadata Event table.
*/
static guint32
-find_event_index (MonoClass *klass, MonoEvent *event) {
+find_event_index (MonoClass *klass, MonoEvent *event)
+{
int i;
- MonoClassExt *ext = mono_class_get_ext (klass);
+ MonoClassEventInfo *info = mono_class_get_event_info (klass);
- for (i = 0; i < ext->event.count; ++i) {
- if (event == &ext->events [i])
- return ext->event.first + 1 + i;
+ for (i = 0; i < info->count; ++i) {
+ if (event == &info->events [i])
+ return info->first + 1 + i;
}
return 0;
}
// .net seems to check that at least 50% of stack is available
min_size = thread->stack_size / 2;
+ // TODO: It's not always set
+ if (!min_size)
+ return TRUE;
+
current = (guint8 *)&stack_addr;
if (current > stack_addr) {
if ((current - stack_addr) < min_size)
if (image_is_dynamic (field->parent->image)) {
MonoClass *klass = field->parent;
int fidx = field - klass->fields;
- MonoClassExt *ext = mono_class_get_ext (klass);
+ MonoFieldDefaultValue *def_values = mono_class_get_field_def_values (klass);
- g_assert (ext);
- g_assert (ext->field_def_values);
- def_type = ext->field_def_values [fidx].def_type;
- def_value = ext->field_def_values [fidx].data;
+ g_assert (def_values);
+ def_type = def_values [fidx].def_type;
+ def_value = def_values [fidx].data;
if (def_type == MONO_TYPE_END) {
mono_set_pending_exception (mono_get_exception_invalid_operation (NULL));
return event;
gtd = mono_class_get_generic_class (event->parent)->container_class;
- offset = event - mono_class_get_ext (event->parent)->events;
- return mono_class_get_ext (gtd)->events + offset;
+ offset = event - mono_class_get_event_info (event->parent)->events;
+ return mono_class_get_event_info (gtd)->events + offset;
}
/*
MonoProperty*
mono_metadata_get_corresponding_property_from_generic_type_definition (MonoProperty *property)
{
+ MonoClassPropertyInfo *info;
MonoClass *gtd;
int offset;
if (!mono_class_is_ginst (property->parent))
return property;
+ info = mono_class_get_property_info (property->parent);
gtd = mono_class_get_generic_class (property->parent)->container_class;
- offset = property - mono_class_get_ext (property->parent)->properties;
- return mono_class_get_ext (gtd)->properties + offset;
+ offset = property - info->properties;
+ return mono_class_get_property_info (gtd)->properties + offset;
}
MonoWrapperCaches*
gboolean (*mono_exception_walk_trace) (MonoException *ex, MonoInternalExceptionFrameWalk func, gpointer user_data);
gboolean (*mono_install_handler_block_guard) (MonoThreadUnwindState *unwind_state);
gboolean (*mono_current_thread_has_handle_block_guard) (void);
+ gboolean (*mono_above_abort_threshold) (void);
+ void (*mono_clear_abort_threshold) (void);
} MonoRuntimeExceptionHandlingCallbacks;
MONO_COLD void mono_set_pending_exception (MonoException *exc);
#define ldstr_unlock() mono_os_mutex_unlock (&ldstr_section)
static mono_mutex_t ldstr_section;
+
/**
* mono_runtime_object_init:
* @this_obj: the object to initialize
return obj;
}
+ /* casting an array one of the invariant interfaces that must act as such */
+ if (klass->is_array_special_interface) {
+ if (mono_class_is_assignable_from (klass, vt->klass))
+ return obj;
+ }
+
/*If the above check fails we are in the slow path of possibly raising an exception. So it's ok to it this way.*/
- if (mono_class_has_variant_generic_params (klass) && mono_class_is_assignable_from (klass, obj->vtable->klass))
+ else if (mono_class_has_variant_generic_params (klass) && mono_class_is_assignable_from (klass, obj->vtable->klass))
return obj;
} else {
MonoClass *oklass = vt->klass;
#include <mono/utils/atomic.h>
#include <mono/utils/mono-membar.h>
+/*
+ * mono_property_bag_get:
+ *
+ * Return the value of the property with TAG or NULL.
+ * This doesn't take any locks.
+ */
void*
mono_property_bag_get (MonoPropertyBag *bag, int tag)
{
return NULL;
}
+/*
+ * mono_property_bag_add:
+ *
+ * Store VALUE in the property bag. Return the previous value
+ * with the same tag, or NULL. VALUE should point to a structure
+ * extending the MonoPropertyBagItem structure with the 'tag'
+ * field set.
+ * This doesn't take any locks.
+ */
void*
mono_property_bag_add (MonoPropertyBag *bag, void *value)
{
}
static MonoObject*
-get_dbnull (MonoDomain *domain, MonoObject **dbnull)
+get_dbnull_object (MonoDomain *domain, MonoError *error)
{
+ MonoObject *obj;
+ static MonoClassField *dbnull_value_field = NULL;
+
+ mono_error_init (error);
+
+ if (!dbnull_value_field) {
+ MonoClass *dbnull_klass;
+ dbnull_klass = mono_class_get_dbnull_class ();
+ dbnull_value_field = mono_class_get_field_from_name (dbnull_klass, "Value");
+ g_assert (dbnull_value_field);
+ }
+ obj = mono_field_get_value_object_checked (domain, dbnull_value_field, NULL, error);
+ return obj;
+}
+
+static MonoObject*
+get_dbnull (MonoDomain *domain, MonoObject **dbnull, MonoError *error)
+{
+ mono_error_init (error);
if (!*dbnull)
- *dbnull = mono_get_dbnull_object (domain);
+ *dbnull = get_dbnull_object (domain, error);
return *dbnull;
}
if (param->AttrsImpl & PARAM_ATTRIBUTE_OPTIONAL)
MONO_OBJECT_SETREF (param, DefaultValueImpl, get_reflection_missing (domain, &missing));
else
- MONO_OBJECT_SETREF (param, DefaultValueImpl, get_dbnull (domain, &dbnull));
+ MONO_OBJECT_SETREF (param, DefaultValueImpl, get_dbnull (domain, &dbnull, error));
+ if (!is_ok (error))
+ goto leave;
} else {
if (!blobs) {
if (param->AttrsImpl & PARAM_ATTRIBUTE_OPTIONAL)
MONO_OBJECT_SETREF (param, DefaultValueImpl, get_reflection_missing (domain, &missing));
else
- MONO_OBJECT_SETREF (param, DefaultValueImpl, get_dbnull (domain, &dbnull));
+ MONO_OBJECT_SETREF (param, DefaultValueImpl, get_dbnull (domain, &dbnull, error));
+ if (!is_ok (error))
+ goto leave;
}
-
}
if (mspecs [i + 1]) {
{
MonoError error;
MonoObject *obj;
- static MonoClassField *dbnull_value_field = NULL;
-
- if (!dbnull_value_field) {
- MonoClass *dbnull_klass;
- dbnull_klass = mono_class_get_dbnull_class ();
- dbnull_value_field = mono_class_get_field_from_name (dbnull_klass, "Value");
- g_assert (dbnull_value_field);
- }
- obj = mono_field_get_value_object_checked (domain, dbnull_value_field, NULL, &error);
+
+ obj = get_dbnull_object (domain, &error);
mono_error_assert_ok (&error);
return obj;
}
mono_declsec_flags_from_class (MonoClass *klass)
{
if (mono_class_get_flags (klass) & TYPE_ATTRIBUTE_HAS_SECURITY) {
- MonoClassExt *ext = mono_class_get_ext (klass);
- if (!ext || !ext->declsec_flags) {
+ guint32 flags = mono_class_get_declsec_flags (klass);
+
+ if (!flags) {
guint32 idx;
idx = mono_metadata_token_index (klass->type_token);
idx <<= MONO_HAS_DECL_SECURITY_BITS;
idx |= MONO_HAS_DECL_SECURITY_TYPEDEF;
- mono_loader_lock ();
- mono_class_alloc_ext (klass);
- ext = mono_class_get_ext (klass);
- mono_loader_unlock ();
+ flags = mono_declsec_get_flags (klass->image, idx);
/* we cache the flags on classes */
- ext->declsec_flags = mono_declsec_get_flags (klass->image, idx);
+ mono_class_set_declsec_flags (klass, flags);
}
- return ext->declsec_flags;
+ return flags;
}
return 0;
}
table->next_idx ++;
/* Emit nested types */
- MonoClassExt *ext = mono_class_get_ext (klass);
- if (ext && ext->nested_classes) {
- GList *tmp;
-
- for (tmp = ext->nested_classes; tmp; tmp = tmp->next)
- mono_image_fill_export_table_from_class (domain, (MonoClass *)tmp->data, module_index, table->next_idx - 1, assembly);
- }
+ GList *nested_classes = mono_class_get_nested_classes_property (klass);
+ GList *tmp;
+ for (tmp = nested_classes; tmp; tmp = tmp->next)
+ mono_image_fill_export_table_from_class (domain, (MonoClass *)tmp->data, module_index, table->next_idx - 1, assembly);
return res;
}
MonoReflectionTypeBuilder *tb = (MonoReflectionTypeBuilder *)mono_class_get_ref_info (klass);
MonoReflectionFieldBuilder *fb;
MonoClassField *field;
- MonoClassExt *ext;
+ MonoFieldDefaultValue *def_values;
MonoImage *image = klass->image;
const char *p, *p2;
int i, instance_size, packing_size = 0;
}
klass->fields = image_g_new0 (image, MonoClassField, fcount);
- mono_class_alloc_ext (klass);
- ext = mono_class_get_ext (klass);
- ext->field_def_values = image_g_new0 (image, MonoFieldDefaultValue, fcount);
+ def_values = image_g_new0 (image, MonoFieldDefaultValue, fcount);
+ mono_class_set_field_def_values (klass, def_values);
/*
This is, guess what, a hack.
The issue is that the runtime doesn't know how to setup the fields of a typebuider and crash.
size_t size = mono_array_length (rva_data);
char *data = (char *)mono_image_alloc (klass->image, size);
memcpy (data, base, size);
- ext->field_def_values [i].data = data;
+ def_values [i].data = data;
}
if (fb->offset != -1)
field->offset = fb->offset;
if (fb->def_value) {
MonoDynamicImage *assembly = (MonoDynamicImage*)klass->image;
field->type->attrs |= FIELD_ATTRIBUTE_HAS_DEFAULT;
- idx = mono_dynimage_encode_constant (assembly, fb->def_value, &ext->field_def_values [i].def_type);
+ idx = mono_dynimage_encode_constant (assembly, fb->def_value, &def_values [i].def_type);
/* Copy the data from the blob since it might get realloc-ed */
p = assembly->blob.data + idx;
len = mono_metadata_decode_blob_size (p, &p2);
len += p2 - p;
- ext->field_def_values [i].data = (const char *)mono_image_alloc (image, len);
- memcpy ((gpointer)ext->field_def_values [i].data, p, len);
+ def_values [i].data = (const char *)mono_image_alloc (image, len);
+ memcpy ((gpointer)def_values [i].data, p, len);
}
}
MonoReflectionPropertyBuilder *pb;
MonoImage *image = klass->image;
MonoProperty *properties;
- MonoClassExt *ext;
+ MonoClassPropertyInfo *info;
int i;
mono_error_init (error);
- ext = mono_class_get_ext (klass);
- if (!ext)
- mono_class_set_ext (klass, ext = image_g_new0 (image, MonoClassExt, 1));
+ info = mono_class_get_property_info (klass);
+ if (!info) {
+ info = mono_class_alloc0 (klass, sizeof (MonoClassPropertyInfo));
+ mono_class_set_property_info (klass, info);
+ }
- ext->property.count = tb->properties ? mono_array_length (tb->properties) : 0;
- ext->property.first = 0;
+ info->count = tb->properties ? mono_array_length (tb->properties) : 0;
+ info->first = 0;
- properties = image_g_new0 (image, MonoProperty, ext->property.count);
- ext->properties = properties;
- for (i = 0; i < ext->property.count; ++i) {
+ properties = image_g_new0 (image, MonoProperty, info->count);
+ info->properties = properties;
+ for (i = 0; i < info->count; ++i) {
pb = mono_array_get (tb->properties, MonoReflectionPropertyBuilder*, i);
properties [i].parent = klass;
properties [i].attrs = pb->attrs;
guint32 len, idx;
const char *p, *p2;
MonoDynamicImage *assembly = (MonoDynamicImage*)klass->image;
- if (!ext->prop_def_values)
- ext->prop_def_values = image_g_new0 (image, MonoFieldDefaultValue, ext->property.count);
+ if (!info->def_values)
+ info->def_values = image_g_new0 (image, MonoFieldDefaultValue, info->count);
properties [i].attrs |= PROPERTY_ATTRIBUTE_HAS_DEFAULT;
- idx = mono_dynimage_encode_constant (assembly, pb->def_value, &ext->prop_def_values [i].def_type);
+ idx = mono_dynimage_encode_constant (assembly, pb->def_value, &info->def_values [i].def_type);
/* Copy the data from the blob since it might get realloc-ed */
p = assembly->blob.data + idx;
len = mono_metadata_decode_blob_size (p, &p2);
len += p2 - p;
- ext->prop_def_values [i].data = (const char *)mono_image_alloc (image, len);
- memcpy ((gpointer)ext->prop_def_values [i].data, p, len);
+ info->def_values [i].data = (const char *)mono_image_alloc (image, len);
+ memcpy ((gpointer)info->def_values [i].data, p, len);
}
}
}
MonoReflectionEventBuilder *eb;
MonoImage *image = klass->image;
MonoEvent *events;
- MonoClassExt *ext;
+ MonoClassEventInfo *info;
int i;
mono_error_init (error);
- ext = mono_class_get_ext (klass);
- if (!ext)
- mono_class_set_ext (klass, ext = image_g_new0 (image, MonoClassExt, 1));
+ info = mono_class_alloc0 (klass, sizeof (MonoClassEventInfo));
+ mono_class_set_event_info (klass, info);
- ext->event.count = tb->events ? mono_array_length (tb->events) : 0;
- ext->event.first = 0;
+ info->count = tb->events ? mono_array_length (tb->events) : 0;
+ info->first = 0;
- events = image_g_new0 (image, MonoEvent, ext->event.count);
- ext->events = events;
- for (i = 0; i < ext->event.count; ++i) {
+ events = image_g_new0 (image, MonoEvent, info->count);
+ info->events = events;
+ for (i = 0; i < info->count; ++i) {
eb = mono_array_get (tb->events, MonoReflectionEventBuilder*, i);
events [i].parent = klass;
events [i].attrs = eb->attrs;
goto failure;
if (tb->subtypes) {
+ GList *nested = NULL;
for (i = 0; i < mono_array_length (tb->subtypes); ++i) {
MonoReflectionTypeBuilder *subtb = mono_array_get (tb->subtypes, MonoReflectionTypeBuilder*, i);
- mono_class_alloc_ext (klass);
if (!subtb->type.type) {
reflection_setup_internal_class (subtb, &error);
MonoType *subtype = mono_reflection_type_get_handle ((MonoReflectionType*)subtb, &error);
if (!is_ok (&error)) goto failure;
- mono_class_get_ext (klass)->nested_classes = g_list_prepend_image (klass->image, mono_class_get_ext (klass)->nested_classes, mono_class_from_mono_type (subtype));
+ nested = g_list_prepend_image (klass->image, nested, mono_class_from_mono_type (subtype));
}
+ mono_class_set_nested_classes_property (klass, nested);
}
klass->nested_classes_inited = TRUE;
mono_set_pending_exception (mono_get_exception_thread_state (msg));
return;
}
+
+ mono_get_eh_callbacks ()->mono_clear_abort_threshold ();
thread->abort_exc = NULL;
if (thread->abort_state_handle) {
mono_gchandle_free (thread->abort_state_handle);
thread->state &= ~ThreadState_AbortRequested;
if (thread->abort_exc) {
+ mono_get_eh_callbacks ()->mono_clear_abort_threshold ();
thread->abort_exc = NULL;
if (thread->abort_state_handle) {
mono_gchandle_free (thread->abort_state_handle);
{
MonoInternalThread *thread = mono_thread_internal_current ();
- if (thread && thread->abort_exc && !is_running_protected_wrapper ()) {
- /*
- * FIXME: Clear the abort exception and return an AppDomainUnloaded
- * exception if the thread no longer references a dying appdomain.
- */
- thread->abort_exc->trace_ips = NULL;
- thread->abort_exc->stack_trace = NULL;
- return thread->abort_exc;
- }
+ if (!(thread && thread->abort_exc && !is_running_protected_wrapper ()))
+ return NULL;
- return NULL;
+ // We don't want to have our exception effect calls made by
+ // the catching block
+
+ if (!mono_get_eh_callbacks ()->mono_above_abort_threshold ())
+ return NULL;
+
+ /*
+ * FIXME: Clear the abort exception and return an AppDomainUnloaded
+ * exception if the thread no longer references a dying appdomain.
+ */
+ thread->abort_exc->trace_ips = NULL;
+ thread->abort_exc->stack_trace = NULL;
+ return thread->abort_exc;
}
#if MONO_SMALL_CONFIG
mono_w32process_try_get_modules (gpointer process, gpointer *modules, guint32 size, guint32 *needed)
{
MonoW32HandleProcess *process_handle;
- GSList *mods = NULL;
+ GSList *mods = NULL, *mods_iter;
MonoW32ProcessModule *module;
guint32 count, avail = size / sizeof(gpointer);
int i;
return TRUE;
}
- count = g_slist_length (mods);
-
- /* count + 1 to leave slot 0 for the main module */
- *needed = sizeof(gpointer) * (count + 1);
+ count = 0;
/*
* Use the NULL shortcut, as the first line in
* be a problem.
*/
modules[0] = NULL;
- for (i = 0; i < (avail - 1) && i < count; i++) {
- module = (MonoW32ProcessModule *)g_slist_nth_data (mods, i);
- if (modules[0] != NULL)
- modules[i] = module->address_start;
- else if (match_procname_to_modulename (proc_name, module->filename))
- modules[0] = module->address_start;
- else
- modules[i + 1] = module->address_start;
+ mods_iter = mods;
+ for (i = 0; mods_iter; i++) {
+ if (i < avail - 1) {
+ module = (MonoW32ProcessModule *)mods_iter->data;
+ if (modules[0] != NULL)
+ modules[i] = module->address_start;
+ else if (match_procname_to_modulename (proc_name, module->filename))
+ modules[0] = module->address_start;
+ else
+ modules[i + 1] = module->address_start;
+ }
+ mono_w32process_module_free ((MonoW32ProcessModule *)mods_iter->data);
+ mods_iter = g_slist_next (mods_iter);
+ count++;
}
- for (i = 0; i < count; i++) {
- mono_w32process_module_free ((MonoW32ProcessModule *)g_slist_nth_data (mods, i));
- }
+ /* count + 1 to leave slot 0 for the main module */
+ *needed = sizeof(gpointer) * (count + 1);
+
g_slist_free (mods);
g_free (proc_name);
char *procname_ext = NULL;
glong len;
gsize bytes;
- GSList *mods = NULL;
+ GSList *mods = NULL, *mods_iter;
MonoW32ProcessModule *found_module;
- guint32 count;
- int i;
char *proc_name = NULL;
gboolean res;
return 0;
}
- count = g_slist_length (mods);
-
/* If module != NULL compare the address.
* If module == NULL we are looking for the main module.
* The best we can do for now check it the module name end with the process name.
*/
- for (i = 0; i < count; i++) {
- found_module = (MonoW32ProcessModule *)g_slist_nth_data (mods, i);
+ for (mods_iter = mods; mods_iter; mods_iter = g_slist_next (mods_iter)) {
+ found_module = (MonoW32ProcessModule *)mods_iter->data;
if (procname_ext == NULL &&
((module == NULL && match_procname_to_modulename (proc_name, found_module->filename)) ||
(module != NULL && found_module->address_start == module))) {
{
MonoW32HandleProcess *process_handle;
pid_t pid;
- GSList *mods = NULL;
+ GSList *mods = NULL, *mods_iter;
MonoW32ProcessModule *found_module;
- guint32 count;
- int i;
gboolean ret = FALSE;
char *proc_name = NULL;
gboolean res;
return FALSE;
}
- count = g_slist_length (mods);
-
/* If module != NULL compare the address.
* If module == NULL we are looking for the main module.
* The best we can do for now check it the module name end with the process name.
*/
- for (i = 0; i < count; i++) {
- found_module = (MonoW32ProcessModule *)g_slist_nth_data (mods, i);
+ for (mods_iter = mods; mods_iter; mods_iter = g_slist_next (mods_iter)) {
+ found_module = (MonoW32ProcessModule *)mods_iter->data;
if (ret == FALSE &&
((module == NULL && match_procname_to_modulename (proc_name, found_module->filename)) ||
(module != NULL && found_module->address_start == module))) {
MINI_RUNTIME = MONO_PATH=$(CLASS) $(RUNTIME_EXECUTABLE)
RUNTIME_AOTCHECK = MONO_PATH="$(CLASS)$(PLATFORM_PATH_SEPARATOR)." $(RUNTIME_EXECUTABLE)
-CSC = $(mcs_topdir)/class/lib/build/mcs.exe
MCS = CSC_SDK_PATH_DISABLED= $(MINI_RUNTIME) $(CSC) -unsafe -nowarn:0162 -nologo -noconfig -r:$(CLASS)/mscorlib.dll -r:$(CLASS)/System.dll -r:$(CLASS)/System.Core.dll
ILASM = $(MINI_RUNTIME) $(CLASS)/ilasm.exe
get; set;
}
}
+public class TestDriverReporter
+{
+ public int FailedTests { get; private set; }
+ public int SkippedTests { get; private set; }
+ public int ExecutedTests { get; private set; }
+
+ public void ReportResults (int executed, int skipped, int failed) {
+ ExecutedTests = executed;
+ SkippedTests = skipped;
+ FailedTests = failed;
+ }
+};
public class TestDriver {
- static public int RunTests (Type type, string[] args) {
+ static public int RunTests(Type type, string[] args, TestDriverReporter reporter) {
int failed = 0, ran = 0;
int result, expected;
int i, j, iterations;
}
}
+ if (reporter != null) {
+ reporter.ReportResults (ran, nskipped, failed);
+ }
+
//Console.WriteLine ("Regression tests: {0} ran, {1} failed in [{2}]{3}", ran, failed, type.Assembly.GetName().Name, type);
return failed;
}
+
+ static public int RunTests (Type type, string[] args) {
+ return RunTests (type, args, null);
+ }
+
static public int RunTests (Type type) {
- return RunTests (type, null);
+ return RunTests (type, null, null);
}
}
break;
case MONO_PATCH_INFO_GC_SAFE_POINT_FLAG:
case MONO_PATCH_INFO_GET_TLS_TRAMP:
+ case MONO_PATCH_INFO_JIT_THREAD_ATTACH:
break;
default:
g_warning ("unable to handle jump info %d", patch_info->type);
if (mono_class_is_gtd (klass) || cant_encode) {
encode_value (-1, p, &p);
} else {
+ gboolean has_nested = mono_class_get_nested_classes_property (klass) != NULL;
encode_value (klass->vtable_size, p, &p);
- encode_value ((mono_class_is_gtd (klass) ? (1 << 8) : 0) | (no_special_static << 7) | (klass->has_static_refs << 6) | (klass->has_references << 5) | ((klass->blittable << 4) | ((mono_class_get_ext (klass) && mono_class_get_ext (klass)->nested_classes) ? 1 : 0) << 3) | (klass->has_cctor << 2) | (klass->has_finalize << 1) | klass->ghcimpl, p, &p);
+ encode_value ((mono_class_is_gtd (klass) ? (1 << 8) : 0) | (no_special_static << 7) | (klass->has_static_refs << 6) | (klass->has_references << 5) | ((klass->blittable << 4) | (has_nested ? 1 : 0) << 3) | (klass->has_cctor << 2) | (klass->has_finalize << 1) | klass->ghcimpl, p, &p);
if (klass->has_cctor)
encode_method_ref (acfg, mono_class_get_cctor (klass), p, &p);
if (klass->has_finalize)
* encountered.
*/
depth = GPOINTER_TO_UINT (g_hash_table_lookup (acfg->method_depth, method));
- if (!acfg->aot_opts.no_instances && depth < 32) {
+ if (!acfg->aot_opts.no_instances && depth < 32 && mono_aot_mode_is_full (&acfg->aot_opts)) {
for (patch_info = cfg->patch_info; patch_info; patch_info = patch_info->next) {
switch (patch_info->type) {
case MONO_PATCH_INFO_RGCTX_FETCH:
if (!m)
break;
- if (m->is_inflated) {
+ if (m->is_inflated && mono_aot_mode_is_full (&acfg->aot_opts)) {
if (!(mono_class_generic_sharing_enabled (m->klass) &&
mono_method_is_generic_sharable_full (m, FALSE, FALSE, FALSE)) &&
(!method_has_type_vars (m) || mono_method_is_generic_sharable_full (m, TRUE, TRUE, FALSE))) {
}
}
- add_generic_instances (acfg);
+ if (mono_aot_mode_is_full (&acfg->aot_opts))
+ add_generic_instances (acfg);
if (mono_aot_mode_is_full (&acfg->aot_opts))
add_wrappers (acfg);
get_got_offset (acfg, FALSE, ji);
get_got_offset (acfg, TRUE, ji);
+ ji = (MonoJumpInfo *)mono_mempool_alloc0 (acfg->mempool, sizeof (MonoJumpInfo));
+ ji->type = MONO_PATCH_INFO_JIT_THREAD_ATTACH;
+ get_got_offset (acfg, FALSE, ji);
+ get_got_offset (acfg, TRUE, ji);
+
for (i = 0; i < sizeof (preinited_jit_icalls) / sizeof (char*); ++i) {
ji = (MonoJumpInfo *)mono_mempool_alloc0 (acfg->mempool, sizeof (MonoAotCompile));
ji->type = MONO_PATCH_INFO_INTERNAL_METHOD;
}
case MONO_PATCH_INFO_GC_SAFE_POINT_FLAG:
case MONO_PATCH_INFO_GET_TLS_TRAMP:
+ case MONO_PATCH_INFO_JIT_THREAD_ATTACH:
break;
case MONO_PATCH_INFO_AOT_JIT_INFO:
ji->data.index = decode_value (p, &p);
static MonoMethodSignature *helper_sig_domain_get;
static MonoMethodSignature *helper_sig_rgctx_lazy_fetch_trampoline;
static MonoMethodSignature *helper_sig_llvmonly_imt_trampoline;
+static MonoMethodSignature *helper_sig_jit_thread_attach;
/* type loading helpers */
static GENERATE_GET_CLASS_WITH_CACHE (runtime_helpers, System.Runtime.CompilerServices, RuntimeHelpers)
helper_sig_domain_get = mono_create_icall_signature ("ptr");
helper_sig_rgctx_lazy_fetch_trampoline = mono_create_icall_signature ("ptr ptr");
helper_sig_llvmonly_imt_trampoline = mono_create_icall_signature ("ptr ptr ptr");
+ helper_sig_jit_thread_attach = mono_create_icall_signature ("ptr ptr");
}
static MONO_NEVER_INLINE void
/* AOT code is only used in the root domain */
EMIT_NEW_PCONST (cfg, args [0], cfg->compile_aot ? NULL : cfg->domain);
- ins = mono_emit_jit_icall (cfg, mono_jit_thread_attach, args);
+ if (cfg->compile_aot) {
+ MonoInst *addr;
+
+ /*
+ * This is called on unattached threads, so it cannot go through the trampoline
+ * infrastructure. Use an indirect call through a got slot initialized at load time
+ * instead.
+ */
+ EMIT_NEW_AOTCONST (cfg, addr, MONO_PATCH_INFO_JIT_THREAD_ATTACH, NULL);
+ ins = mono_emit_calli (cfg, helper_sig_jit_thread_attach, args, addr, NULL, NULL);
+ } else {
+ ins = mono_emit_jit_icall (cfg, mono_jit_thread_attach, args);
+ }
MONO_EMIT_NEW_UNALU (cfg, OP_MOVE, cfg->orig_domain_var->dreg, ins->dreg);
if (next_bb)
MONO_START_BB (cfg, next_bb);
-
ip += 2;
break;
}
NEW_BBLOCK (cfg, first_bb);
cfg->cbb = first_bb;
- if (!context_used && mini_class_has_reference_variant_generic_argument (cfg, klass, context_used)) {
+ if (!context_used && (mini_class_has_reference_variant_generic_argument (cfg, klass, context_used) || klass->is_array_special_interface)) {
if (is_isinst)
ret = emit_isinst_with_cache_nonshared (cfg, source, klass);
else
#define MONO_ARCH_CONTEXT_DEF
#endif
+#ifndef MONO_ARCH_STACK_GROWS_UP
+#define MONO_ARCH_STACK_GROWS_UP 0
+#endif
+
static gpointer restore_context_func, call_filter_func;
static gpointer throw_exception_func, rethrow_exception_func;
static gpointer throw_corlib_exception_func;
static void mono_runtime_walk_stack_with_ctx (MonoJitStackWalk func, MonoContext *start_ctx, MonoUnwindOptions unwind_options, void *user_data);
static gboolean mono_current_thread_has_handle_block_guard (void);
+static gboolean
+first_managed (MonoStackFrameInfo *frame, MonoContext *ctx, gpointer addr)
+{
+ gpointer **data = (gpointer **)addr;
+
+ if (!frame->managed)
+ return FALSE;
+
+ *data = MONO_CONTEXT_GET_SP(ctx);
+ g_assert (*data);
+ return TRUE;
+}
+
+static gpointer
+mono_thread_get_managed_sp (void)
+{
+ gpointer addr = NULL;
+ mono_walk_stack (first_managed, MONO_UNWIND_SIGNAL_SAFE, &addr);
+ return addr;
+}
+
+static inline int
+mini_abort_threshold_offset (gpointer threshold, gpointer sp)
+{
+ intptr_t stack_threshold = (intptr_t) threshold;
+ intptr_t stack_pointer = (intptr_t) sp;
+
+ const int direction = MONO_ARCH_STACK_GROWS_UP ? -1 : 1;
+ intptr_t magnitude = stack_pointer - stack_threshold;
+
+ return direction * magnitude;
+}
+
+static inline void
+mini_clear_abort_threshold (void)
+{
+ MonoJitTlsData *jit_tls = mono_get_jit_tls ();
+ jit_tls->abort_exc_stack_threshold = NULL;
+}
+
+static inline void
+mini_set_abort_threshold (MonoContext *ctx)
+{
+ gpointer sp = MONO_CONTEXT_GET_SP (ctx);
+ MonoJitTlsData *jit_tls = mono_get_jit_tls ();
+ // Only move it up, to avoid thrown/caught
+ // exceptions lower in the stack from triggering
+ // a rethrow
+ gboolean above_threshold = mini_abort_threshold_offset (jit_tls->abort_exc_stack_threshold, sp) >= 0;
+ if (!jit_tls->abort_exc_stack_threshold || above_threshold) {
+ jit_tls->abort_exc_stack_threshold = sp;
+ }
+}
+
+// Note: In the case that the frame is above where the thread abort
+// was set we bump the threshold so that functions called from the new,
+// higher threshold don't trigger the thread abort exception
+static inline gboolean
+mini_above_abort_threshold (void)
+{
+ gpointer sp = mono_thread_get_managed_sp ();
+ MonoJitTlsData *jit_tls = mono_native_tls_get_value (mono_jit_tls_id);
+
+ gboolean above_threshold = mini_abort_threshold_offset (jit_tls->abort_exc_stack_threshold, sp) >= 0;
+
+ if (above_threshold)
+ jit_tls->abort_exc_stack_threshold = sp;
+
+ return above_threshold;
+}
+
void
mono_exceptions_init (void)
{
cbs.mono_exception_walk_trace = mono_exception_walk_trace;
cbs.mono_install_handler_block_guard = mono_install_handler_block_guard;
cbs.mono_current_thread_has_handle_block_guard = mono_current_thread_has_handle_block_guard;
+ cbs.mono_clear_abort_threshold = mini_clear_abort_threshold;
+ cbs.mono_above_abort_threshold = mini_above_abort_threshold;
mono_install_eh_callbacks (&cbs);
}
return val;
}
-#ifndef MONO_ARCH_STACK_GROWS_UP
-#define DOES_STACK_GROWS_UP 1
-#else
-#define DOES_STACK_GROWS_UP 0
-#endif
-
#define MAX_UNMANAGED_BACKTRACE 128
static MonoArray*
build_native_trace (MonoError *error)
dynamic_methods = g_slist_prepend (dynamic_methods, method);
if (stack_overflow) {
- if (DOES_STACK_GROWS_UP)
- free_stack = (guint8*)(MONO_CONTEXT_GET_SP (ctx)) - (guint8*)(MONO_CONTEXT_GET_SP (&initial_ctx));
- else
+ if (MONO_ARCH_STACK_GROWS_UP)
free_stack = (guint8*)(MONO_CONTEXT_GET_SP (&initial_ctx)) - (guint8*)(MONO_CONTEXT_GET_SP (ctx));
+ else
+ free_stack = (guint8*)(MONO_CONTEXT_GET_SP (ctx)) - (guint8*)(MONO_CONTEXT_GET_SP (&initial_ctx));
} else {
free_stack = 0xffffff;
}
setup_stack_trace (mono_ex, dynamic_methods, initial_trace_ips, &trace_ips);
g_slist_free (dynamic_methods);
/* mono_debugger_agent_handle_exception () needs this */
+ mini_set_abort_threshold (ctx);
MONO_CONTEXT_SET_IP (ctx, ei->handler_start);
return TRUE;
}
// FIXME: This runs managed code so it might cause another stack overflow when
// we are handling a stack overflow
+ mini_set_abort_threshold (ctx);
mono_unhandled_exception (obj);
} else {
gboolean unhandled = FALSE;
//printf ("M: %s %d.\n", mono_method_full_name (method, TRUE), frame_count);
if (stack_overflow) {
- if (DOES_STACK_GROWS_UP)
- free_stack = (guint8*)(MONO_CONTEXT_GET_SP (ctx)) - (guint8*)(MONO_CONTEXT_GET_SP (&initial_ctx));
- else
+ if (MONO_ARCH_STACK_GROWS_UP)
free_stack = (guint8*)(MONO_CONTEXT_GET_SP (&initial_ctx)) - (guint8*)(MONO_CONTEXT_GET_SP (ctx));
+ else
+ free_stack = (guint8*)(MONO_CONTEXT_GET_SP (ctx)) - (guint8*)(MONO_CONTEXT_GET_SP (&initial_ctx));
} else {
free_stack = 0xffffff;
}
jit_tls->orig_ex_ctx_set = TRUE;
mono_profiler_exception_clause_handler (method, ei->flags, i);
jit_tls->orig_ex_ctx_set = FALSE;
+ mini_set_abort_threshold (ctx);
MONO_CONTEXT_SET_IP (ctx, ei->handler_start);
mono_set_lmf (lmf);
#ifndef DISABLE_PERFCOUNTERS
jit_tls->orig_ex_ctx_set = TRUE;
mono_profiler_exception_clause_handler (method, ei->flags, i);
jit_tls->orig_ex_ctx_set = FALSE;
+ mini_set_abort_threshold (ctx);
call_filter (ctx, ei->handler_start);
}
if (ei->flags == MONO_EXCEPTION_CLAUSE_FINALLY) {
jit_tls->resume_state.lmf = lmf;
jit_tls->resume_state.first_filter_idx = first_filter_idx;
jit_tls->resume_state.filter_idx = filter_idx;
+ mini_set_abort_threshold (ctx);
MONO_CONTEXT_SET_IP (ctx, ei->handler_start);
return 0;
} else {
+ mini_set_abort_threshold (ctx);
call_filter (ctx, ei->handler_start);
}
}
LLVMValueRef switch_ins = LLVMBuildSwitch (lpadBuilder, match, resume_bb, group_size);
// else move to that target bb
- for (int i=0; i < group_size; i++) {
+ for (int i = 0; i < group_size; i++) {
MonoExceptionClause *clause = group_start + i;
int clause_index = clause - cfg->header->clauses;
MonoBasicBlock *handler_bb = (MonoBasicBlock*)g_hash_table_lookup (ctx->clause_to_handler, GINT_TO_POINTER (clause_index));
LLVMValueRef switch_ins = (LLVMValueRef)l->data;
GSList *bb_list = info->call_handler_return_bbs;
- for (i = 0; i < g_slist_length (bb_list); ++i)
- LLVMAddCase (switch_ins, LLVMConstInt (LLVMInt32Type (), i + 1, FALSE), (LLVMBasicBlockRef)(g_slist_nth (bb_list, i)->data));
+ GSList *bb_list_iter;
+ i = 0;
+ for (bb_list_iter = bb_list; bb_list_iter; bb_list_iter = g_slist_next (bb_list_iter)) {
+ LLVMAddCase (switch_ins, LLVMConstInt (LLVMInt32Type (), i + 1, FALSE), (LLVMBasicBlockRef)bb_list_iter->data);
+ i ++;
+ }
}
}
case MONO_PATCH_INFO_GC_SAFE_POINT_FLAG:
case MONO_PATCH_INFO_AOT_MODULE:
case MONO_PATCH_INFO_GET_TLS_TRAMP:
+ case MONO_PATCH_INFO_JIT_THREAD_ATTACH:
return (ji->type << 8);
case MONO_PATCH_INFO_CASTCLASS_CACHE:
return (ji->type << 8) | (ji->data.index);
target = NULL;
#endif
break;
+ case MONO_PATCH_INFO_JIT_THREAD_ATTACH: {
+ MonoJitICallInfo *mi = mono_find_jit_icall_by_name ("mono_jit_thread_attach");
+ g_assert (mi);
+ target = mi->func;
+ break;
+ }
default:
g_assert_not_reached ();
}
#endif
/* Version number of the AOT file format */
-#define MONO_AOT_FILE_VERSION 137
+#define MONO_AOT_FILE_VERSION 138
//TODO: This is x86/amd64 specific.
#define mono_simd_shuffle_mask(a,b,c,d) ((a) | ((b) << 2) | ((c) << 4) | ((d) << 6))
* The calling assembly in llvmonly mode.
*/
MonoImage *calling_image;
+
+ /*
+ * The stack frame "high water mark" for ThreadAbortExceptions.
+ * We will rethrow the exception upon exiting a catch clause that's
+ * in a function stack frame above the water mark(isn't being called by
+ * the catch block that caught the ThreadAbortException).
+ */
+ gpointer abort_exc_stack_threshold;
} MonoJitTlsData;
/*
PATCH_INFO(GSHAREDVT_IN_WRAPPER, "gsharedvt_in_wrapper")
PATCH_INFO(ICALL_ADDR_CALL, "icall_addr_call")
PATCH_INFO(GET_TLS_TRAMP, "get_tls_tramp")
+PATCH_INFO(JIT_THREAD_ATTACH, "jit_thread_attach")
with_mono_path = MONO_PATH=$(CLASS)
RUNTIME = $(with_mono_path) $(top_builddir)/runtime/mono-wrapper
-MCS = $(RUNTIME) $(mcs_topdir)/class/lib/build/mcs.exe -unsafe -nowarn:0162 -nowarn:0168 -nowarn:0219 -debug
+MCS = $(RUNTIME) $(CSC) -lib:$(CLASS) -unsafe -nologo -noconfig -nowarn:0162 -nowarn:0168 -nowarn:0219 -debug:portable
%.exe: %.cs
$(MCS) -out:$@ $<
PROFILE_MCS_FLAGS = -d:MOBILE,MOBILE_LEGACY
endif
-MCS_NO_LIB = $(RUNTIME) $(mcs_topdir)/class/lib/build/mcs.exe -unsafe -debug \
+MCS_NO_LIB = $(RUNTIME) $(CSC) -unsafe -debug:portable \
-noconfig -nologo \
-nowarn:0162 -nowarn:0168 -nowarn:0219 -nowarn:0414 -nowarn:0618 \
-nowarn:0169 -nowarn:1690 -nowarn:0649 -nowarn:0612 -nowarn:3021 \
with_mono_path = MONO_PATH=$(CLASS)
RUNTIME = $(top_builddir)/runtime/mono-wrapper --debug
-MCS = $(with_mono_path) $(RUNTIME) $(mcs_topdir)/class/lib/build/mcs.exe -debug:full -target:library
+MCS = $(with_mono_path) $(RUNTIME) $(CSC) -noconfig -nologo -debug:portable -target:library
if INSTALL_AOT_ONLY
prereq: aot
class Driver
{
+ static DateTime targetTime;
+ static bool finished() {
+ DateTime now = DateTime.UtcNow;
+ return now > targetTime;
+ }
+
public static void Main ()
{
- BlockingCollection<Thread> threads = new BlockingCollection<Thread> (new ConcurrentQueue<Thread> (), 128);
-
- bool finished = false;
+ int gcCount = 0;
+ int joinCount = 0;
+ targetTime = DateTime.UtcNow.AddSeconds(30);
Thread gcThread = new Thread (() => {
- while (!finished) {
+ while (!finished()) {
GC.Collect ();
- Thread.Yield ();
- }
- });
-
- Thread joinThread = new Thread (() => {
- for (int i = 0; ; ++i) {
- Thread t = threads.Take ();
- if (t == null)
- break;
- t.Join ();
- if ((i + 1) % (50) == 0)
- Console.Write (".");
- if ((i + 1) % (50 * 50) == 0)
- Console.WriteLine ();
+ gcCount++;
+ Thread.Sleep (1);
}
});
gcThread.Start ();
- joinThread.Start ();
- for (int i = 0; i < 10 * 1000; ++i) {
- Thread t = new Thread (() => { Thread.Yield (); });
- t.Start ();
+ // Create threads then join them for 30 seconds nonstop while GCs occur once per ms
+ while (!finished()) {
+ BlockingCollection<Thread> threads = new BlockingCollection<Thread> (new ConcurrentQueue<Thread> (), 128);
- threads.Add (t);
- }
+ Thread joinThread = new Thread (() => {
+ for (int i = 0; ; ++i) {
+ Thread t = threads.Take ();
+ if (t == null)
+ break;
+ t.Join ();
- threads.Add (null);
+ // Uncomment this and run with MONO_LOG_LEVEL=info MONO_LOG_MASK=gc
+ // to see GC/join balance in real time
+ //Console.Write ("*");
+ }
+ });
+ joinThread.Start ();
+
+ const int makeThreads = 10*1000;
+ for (int i = 0; i < makeThreads; ++i) {
+ Thread t = new Thread (() => { Thread.Yield (); });
+ t.Start ();
- joinThread.Join ();
+ threads.Add (t);
+ }
- finished = true;
+ threads.Add (null);
+ joinThread.Join ();
+
+ joinCount += makeThreads;
+ Console.WriteLine("Performed {0} GCs, created {1} threads. Finished? {2}", gcCount, joinCount, finished());
+ }
gcThread.Join ();
}
-}
\ No newline at end of file
+}
return 0;
}
+ public static void HasTry ()
+ {
+ try {
+ throw new Exception ("boop");
+ } catch (Exception e) {
+ // See if we re-throw the thread abort exception here
+ }
+ }
+
+ public static int test_0_thread_abort_water_mark ()
+ {
+ Boolean failed = true;
+
+ try {
+ Thread.CurrentThread.Abort ("test_0_thread_abort_water_mark");
+ } catch (ThreadAbortException e) {
+ HasTry ();
+ Thread.ResetAbort ();
+ failed = false;
+ } finally {
+ if (failed) {
+ Thread.ResetAbort ();
+ throw new Exception ("Threw pending ThreadAbort exception under stack threshold");
+ }
+ Console.WriteLine ("Working thread abort");
+ }
+
+ return 0;
+ }
+
+ public static int test_0_thread_abort_water_mark_other_exc ()
+ {
+ Boolean failed = true;
+
+ try {
+ try {
+ try {
+ Thread.CurrentThread.Abort ("TestKeepAbort");
+ } catch (ThreadAbortException ta_ex) {
+ throw new ArgumentNullException("SpecificDummyException");
+ }
+ } catch (ArgumentNullException ex){
+ // Throw ThreadAbortException here
+ }
+ } catch (ThreadAbortException ex) {
+ Console.WriteLine ("Retained thread abort exception");
+ failed = false;
+ Thread.ResetAbort ();
+ } catch (Exception e) {
+ failed = true;
+ } finally {
+ if (failed)
+ throw new Exception ("Lost the thread abort due to another exception running.");
+ }
+
+ return 0;
+ }
+
public class CBO : ContextBoundObject {
public void Run () {
Thread.CurrentThread.Abort ("FOO");
endif BUILD_MCS
-TEST_SUPPORT_FILES = $(tmpinst)/bin/mono $(tmpinst)/bin/ilasm $(tmpinst)/bin/mcs $(tmpinst)/bin/al
+TEST_SUPPORT_FILES = $(tmpinst)/bin/mono $(tmpinst)/bin/ilasm $(tmpinst)/bin/csc $(tmpinst)/bin/al
mcs-do-test-profiles:
cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(test_profiles)' test-profiles
$(mkinstalldirs) $(tmpinst)/bin
cp mono-wrapper $@
-$(tmpinst)/bin/mcs: $(tmpinst)/bin/mono Makefile
+$(tmpinst)/bin/csc: $(tmpinst)/bin/mono Makefile
echo '#! /bin/sh' > $@ ; \
r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
- echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/class/lib/build/mcs.exe"'" "$$@"' >> $@ ; \
+ echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$(CSC)"'" "$$@"' >> $@ ; \
chmod +x $@
$(tmpinst)/bin/ilasm: $(tmpinst)/bin/mono Makefile
/sgen
/sgen1
/signcode
-/smcs
+/csc
/sn
/soapsuds
/sqlmetal
mono-test-install \
peverify \
mcs \
+ csc \
mono-package-runtime \
mono-heapviz \
$(scripts_mono_configuration_crypto)
xbuild.in \
update_submodules \
mcs.in \
+ csc.in \
dmcs.in \
mono-package-runtime \
mono-test-install \
$(REWRITE_COMMON) $(srcdir)/mcs.in > $@.tmp
mv -f $@.tmp $@
+csc: csc.in Makefile
+ $(REWRITE_COMMON) $(srcdir)/csc.in > $@.tmp
+ mv -f $@.tmp $@
+
dmcs: dmcs.in Makefile
$(REWRITE_COMMON) $(srcdir)/dmcs.in > $@.tmp
mv -f $@.tmp $@
--- /dev/null
+#!/bin/sh
+exec @bindir@/mono $MONO_OPTIONS @mono_instdir@/4.5/csc.exe "$@"